diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 92d403a..6d98e04 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -2,17 +2,17 @@ module.exports = { root: true, env: { browser: true, es2020: true }, extends: [ - 'eslint:recommended', - 'plugin:@typescript-eslint/recommended', - 'plugin:react-hooks/recommended', + "eslint:recommended", + "plugin:@typescript-eslint/recommended", + "plugin:react-hooks/recommended", ], - ignorePatterns: ['dist', '.eslintrc.cjs'], - parser: '@typescript-eslint/parser', - plugins: ['react-refresh'], + ignorePatterns: ["dist", ".eslintrc.cjs"], + parser: "@typescript-eslint/parser", + plugins: ["react-refresh"], rules: { - 'react-refresh/only-export-components': [ - 'off', + "react-refresh/only-export-components": [ + "off", { allowConstantExport: true }, ], }, -} +}; diff --git a/.gitignore b/.gitignore index e494b90..756e09b 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ lerna-debug.log* node_modules dist +dist.zip dist-ssr *.local @@ -23,4 +24,7 @@ dist-ssr *.sln *.sw? release-builds/ -.env \ No newline at end of file +.env + +# reports from scripts +scripts/i18n_report* \ No newline at end of file diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..e13c8ee --- /dev/null +++ b/.prettierignore @@ -0,0 +1,3 @@ +node_modules +build +dist \ No newline at end of file diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..badfcf9 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,23 @@ +{ + "arrowParens": "always", + "bracketSameLine": false, + "bracketSpacing": true, + "embeddedLanguageFormatting": "auto", + "endOfLine": "lf", + "experimentalTernaries": false, + "htmlWhitespaceSensitivity": "css", + "insertPragma": false, + "jsxBracketSameLine": false, + "jsxSingleQuote": false, + "printWidth": 80, + "proseWrap": "preserve", + "quoteProps": "as-needed", + "requirePragma": false, + "semi": true, + "singleAttributePerLine": false, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "es5", + "useTabs": false, + "vueIndentScriptAndStyle": false +} diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f288702 --- /dev/null +++ b/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/README.md b/README.md index 25f4e90..bd5ef7b 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,36 @@ # Qortal Hub - Desktop Interface for Qortal -Qortal Hub is the newest interface for Qortal, part of the 'Qortal Trifecta' series of new User Interfaces for the platform/network. +![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/Qortal/Qortal-Hub?label=latest%20version) +[![GitHub Releases](https://img.shields.io/github/downloads/Qortal/Qortal-Hub/latest/total)](https://github.com/Qortal/Qortal-Hub/releases/latest) +[![License](https://img.shields.io/badge/license-GPL--3.0-blue)](https://opensource.org/licenses/GPL-3.0) +[![Qortal Discord Invite](https://img.shields.io/discord/745037351163527189?color=%237289DA&label=Chat&logo=discord&logoColor=white)](https://discord.com/invite/54UyhB7) + +Qortal Hub is the newest interface for Qortal, part of the 'Qortal Trifecta' series of new User Interfaces for the platform/network. It is likely that Qortal Hub will become the new 'primary interface' for Qortal, and that the primary development focus surrounding Qortal Interface development, will be focused here instead of the previous 'qortal-ui' repo. +## Hosted access links + +Without installing any application on you computer or mobile phone, you can use the hosted-access [Qortal Hub](https://hub.qortal.link/) or [Qortal Go, the mobile version](https://go.qortal.link) + ## Qortal Hub - Next-Level Secure Communications and More Qortal Hub came along with the new Group Encryption methodologies applied, which provide **encrypted chat in Q-Chat for private groups.** Qortal Hub was the first to implement the new method of group encryption, which allows new users to see previously published data, unlike the previous group encryption methodology of things like 'threads' in Q-Mail. -Allowing new users to view older messages also comes along with a massive boost to the usability of the group encryption, and as such has been leveraged in multiple places inside Qortal Hub, Qortal Extension, and Qortal Go. +Allowing new users to view older messages also comes along with a massive boost to the usability of the group encryption, and as such has been leveraged in multiple places inside Qortal Hub, Qortal Extension, and Qortal Go. ## Ease of Use Expanded -Qortal Hub has a focus on ease of use for new users. Providing both the ability to utlilize Qortal without needing to run a local node (though running a local node is still the recommended method to access Qortal), and multiple built-in (QDN-published) walk-thru videos (by Qortal Justin) that explain the various basics of any given section of the application. This allows new users to 'jump right in' to utilizing Qortal Hub, and Qortal overall, in a much more streamlined fashion than that which was previously required by the 'legacy UI' (qortal-ui). +Qortal Hub has a focus on ease of use for new users. Providing both the ability to utlilize Qortal without needing to run a local node (though running a local node is still the recommended method to access Qortal), and multiple built-in (QDN-published) walk-thru videos (by Qortal Justin) that explain the various basics of any given section of the application. This allows new users to 'jump right in' to utilizing Qortal Hub, and Qortal overall, in a much more streamlined fashion than that which was previously required by the 'legacy UI' (qortal-ui). -Leveraging a redundant set of publicly accessible nodes provided by crowetic, Qortal Hub, Qortal Go, and Qortal Extension, all allow the use of Qortal without running a node, making it very simple to 'install and go' and start making use of the extensive functionality provided within the Qortal Ecosystem. +Leveraging a redundant set of publicly accessible nodes provided by crowetic, Qortal Hub, Qortal Go, and Qortal Extension, all allow the use of Qortal without running a node, making it very simple to 'install and go' and start making use of the extensive functionality provided within the Qortal Ecosystem. Many additional details and a fully featured wiki will be created over time. Reach out on the chat on https://qortal.dev or in any of the community locations for Qortal, if you have any issues. Thank you! +## Internationalization (i18n) +Qortal-Hub supports internationalization (i18n) using [i18next](https://www.i18next.com/), allowing seamless translation of UI text into multiple languages. +The setup includes modularized translation files, language detection, context and runtime language switching. +Files with translation are in `src/i18n/locales/` folder. + +See [guidelines](./docs/i18n_languages.md). diff --git a/android/.gitignore b/android/.gitignore deleted file mode 100644 index 48354a3..0000000 --- a/android/.gitignore +++ /dev/null @@ -1,101 +0,0 @@ -# Using Android gitignore template: https://github.com/github/gitignore/blob/HEAD/Android.gitignore - -# Built application files -*.apk -*.aar -*.ap_ -*.aab - -# Files for the ART/Dalvik VM -*.dex - -# Java class files -*.class - -# Generated files -bin/ -gen/ -out/ -# Uncomment the following line in case you need and you don't have the release build type files in your app -# release/ - -# Gradle files -.gradle/ -build/ - -# Local configuration file (sdk path, etc) -local.properties - -# Proguard folder generated by Eclipse -proguard/ - -# Log Files -*.log - -# Android Studio Navigation editor temp files -.navigation/ - -# Android Studio captures folder -captures/ - -# IntelliJ -*.iml -.idea/workspace.xml -.idea/tasks.xml -.idea/gradle.xml -.idea/assetWizardSettings.xml -.idea/dictionaries -.idea/libraries -# Android Studio 3 in .gitignore file. -.idea/caches -.idea/modules.xml -# Comment next line if keeping position of elements in Navigation Editor is relevant for you -.idea/navEditor.xml - -# Keystore files -# Uncomment the following lines if you do not want to check your keystore files in. -#*.jks -#*.keystore - -# External native build folder generated in Android Studio 2.2 and later -.externalNativeBuild -.cxx/ - -# Google Services (e.g. APIs or Firebase) -# google-services.json - -# Freeline -freeline.py -freeline/ -freeline_project_description.json - -# fastlane -fastlane/report.xml -fastlane/Preview.html -fastlane/screenshots -fastlane/test_output -fastlane/readme.md - -# Version control -vcs.xml - -# lint -lint/intermediates/ -lint/generated/ -lint/outputs/ -lint/tmp/ -# lint/reports/ - -# Android Profiling -*.hprof - -# Cordova plugins for Capacitor -capacitor-cordova-android-plugins - -# Copied web assets -app/src/main/assets/public - -# Generated Config files -app/src/main/assets/capacitor.config.json -app/src/main/assets/capacitor.plugins.json -app/src/main/res/xml/config.xml diff --git a/android/app/.gitignore b/android/app/.gitignore deleted file mode 100644 index 043df80..0000000 --- a/android/app/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/build/* -!/build/.npmkeep diff --git a/android/app/build.gradle b/android/app/build.gradle deleted file mode 100644 index 3f5e684..0000000 --- a/android/app/build.gradle +++ /dev/null @@ -1,54 +0,0 @@ -apply plugin: 'com.android.application' - -android { - namespace "com.example.app" - compileSdk rootProject.ext.compileSdkVersion - defaultConfig { - applicationId "com.example.app" - minSdkVersion rootProject.ext.minSdkVersion - targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 1 - versionName "1.0" - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - aaptOptions { - // Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps. - // Default: https://android.googlesource.com/platform/frameworks/base/+/282e181b58cf72b6ca770dc7ca5f91f135444502/tools/aapt/AaptAssets.cpp#61 - ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~' - } - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } -} - -repositories { - flatDir{ - dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs' - } -} - -dependencies { - implementation fileTree(include: ['*.jar'], dir: 'libs') - implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion" - implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion" - implementation "androidx.core:core-splashscreen:$coreSplashScreenVersion" - implementation project(':capacitor-android') - testImplementation "junit:junit:$junitVersion" - androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion" - androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion" - implementation project(':capacitor-cordova-android-plugins') -} - -apply from: 'capacitor.build.gradle' - -try { - def servicesJSON = file('google-services.json') - if (servicesJSON.text) { - apply plugin: 'com.google.gms.google-services' - } -} catch(Exception e) { - logger.info("google-services.json not found, google-services plugin not applied. Push Notifications won't work") -} diff --git a/android/app/capacitor.build.gradle b/android/app/capacitor.build.gradle deleted file mode 100644 index d4f22b6..0000000 --- a/android/app/capacitor.build.gradle +++ /dev/null @@ -1,23 +0,0 @@ -// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN - -android { - compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 - } -} - -apply from: "../capacitor-cordova-android-plugins/cordova.variables.gradle" -dependencies { - implementation project(':capacitor-browser') - implementation project(':capacitor-filesystem') - implementation project(':capacitor-local-notifications') - implementation project(':evva-capacitor-secure-storage-plugin') - implementation project(':transistorsoft-capacitor-background-fetch') - implementation "androidx.webkit:webkit:1.4.0" -} - - -if (hasProperty('postBuildExtras')) { - postBuildExtras() -} diff --git a/android/app/proguard-rules.pro b/android/app/proguard-rules.pro deleted file mode 100644 index f1b4245..0000000 --- a/android/app/proguard-rules.pro +++ /dev/null @@ -1,21 +0,0 @@ -# Add project specific ProGuard rules here. -# You can control the set of applied configuration files using the -# proguardFiles setting in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} - -# Uncomment this to preserve the line number information for -# debugging stack traces. -#-keepattributes SourceFile,LineNumberTable - -# If you keep the line number information, uncomment this to -# hide the original source file name. -#-renamesourcefileattribute SourceFile diff --git a/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java b/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java deleted file mode 100644 index f2c2217..0000000 --- a/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.getcapacitor.myapp; - -import static org.junit.Assert.*; - -import android.content.Context; -import androidx.test.ext.junit.runners.AndroidJUnit4; -import androidx.test.platform.app.InstrumentationRegistry; -import org.junit.Test; -import org.junit.runner.RunWith; - -/** - * Instrumented test, which will execute on an Android device. - * - * @see Testing documentation - */ -@RunWith(AndroidJUnit4.class) -public class ExampleInstrumentedTest { - - @Test - public void useAppContext() throws Exception { - // Context of the app under test. - Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); - - assertEquals("com.getcapacitor.app", appContext.getPackageName()); - } -} diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml deleted file mode 100644 index 2b2013c..0000000 --- a/android/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/android/app/src/main/java/com/example/app/BackgroundFetchHeadlessTask.java b/android/app/src/main/java/com/example/app/BackgroundFetchHeadlessTask.java deleted file mode 100644 index fac2dc1..0000000 --- a/android/app/src/main/java/com/example/app/BackgroundFetchHeadlessTask.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.example.app; - - -import android.content.Context; -import android.util.Log; - -import com.transistorsoft.tsbackgroundfetch.BackgroundFetch; -import com.transistorsoft.tsbackgroundfetch.BGTask; - -public class BackgroundFetchHeadlessTask{ - public void onFetch(Context context, BGTask task) { - // Get a reference to the BackgroundFetch Android API. - BackgroundFetch backgroundFetch = BackgroundFetch.getInstance(context); - // Get the taskId. - String taskId = task.getTaskId(); - // Log a message to adb logcat. - Log.d("MyHeadlessTask", "BackgroundFetchHeadlessTask onFetch -- CUSTOM IMPLEMENTATION: " + taskId); - - boolean isTimeout = task.getTimedOut(); - // Is this a timeout? - if (isTimeout) { - backgroundFetch.finish(taskId); - return; - } - // Do your work here... - // - // - // Signal finish just like the Javascript API. - backgroundFetch.finish(taskId); - } -} \ No newline at end of file diff --git a/android/app/src/main/java/com/example/app/MainActivity.java b/android/app/src/main/java/com/example/app/MainActivity.java deleted file mode 100644 index 966f32d..0000000 --- a/android/app/src/main/java/com/example/app/MainActivity.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.example.app; - -import com.getcapacitor.BridgeActivity; - -public class MainActivity extends BridgeActivity {} diff --git a/android/app/src/main/res/drawable-land-hdpi/splash.png b/android/app/src/main/res/drawable-land-hdpi/splash.png deleted file mode 100644 index e31573b..0000000 Binary files a/android/app/src/main/res/drawable-land-hdpi/splash.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-land-mdpi/splash.png b/android/app/src/main/res/drawable-land-mdpi/splash.png deleted file mode 100644 index f7a6492..0000000 Binary files a/android/app/src/main/res/drawable-land-mdpi/splash.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-land-xhdpi/splash.png b/android/app/src/main/res/drawable-land-xhdpi/splash.png deleted file mode 100644 index 8077255..0000000 Binary files a/android/app/src/main/res/drawable-land-xhdpi/splash.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-land-xxhdpi/splash.png b/android/app/src/main/res/drawable-land-xxhdpi/splash.png deleted file mode 100644 index 14c6c8f..0000000 Binary files a/android/app/src/main/res/drawable-land-xxhdpi/splash.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-land-xxxhdpi/splash.png b/android/app/src/main/res/drawable-land-xxxhdpi/splash.png deleted file mode 100644 index 244ca25..0000000 Binary files a/android/app/src/main/res/drawable-land-xxxhdpi/splash.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-port-hdpi/splash.png b/android/app/src/main/res/drawable-port-hdpi/splash.png deleted file mode 100644 index 74faaa5..0000000 Binary files a/android/app/src/main/res/drawable-port-hdpi/splash.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-port-mdpi/splash.png b/android/app/src/main/res/drawable-port-mdpi/splash.png deleted file mode 100644 index e944f4a..0000000 Binary files a/android/app/src/main/res/drawable-port-mdpi/splash.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-port-xhdpi/splash.png b/android/app/src/main/res/drawable-port-xhdpi/splash.png deleted file mode 100644 index 564a82f..0000000 Binary files a/android/app/src/main/res/drawable-port-xhdpi/splash.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-port-xxhdpi/splash.png b/android/app/src/main/res/drawable-port-xxhdpi/splash.png deleted file mode 100644 index bfabe68..0000000 Binary files a/android/app/src/main/res/drawable-port-xxhdpi/splash.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-port-xxxhdpi/splash.png b/android/app/src/main/res/drawable-port-xxxhdpi/splash.png deleted file mode 100644 index 6929071..0000000 Binary files a/android/app/src/main/res/drawable-port-xxxhdpi/splash.png and /dev/null differ diff --git a/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml deleted file mode 100644 index c7bd21d..0000000 --- a/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - diff --git a/android/app/src/main/res/drawable/ic_launcher_background.xml b/android/app/src/main/res/drawable/ic_launcher_background.xml deleted file mode 100644 index d5fccc5..0000000 --- a/android/app/src/main/res/drawable/ic_launcher_background.xml +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/android/app/src/main/res/drawable/qort.png b/android/app/src/main/res/drawable/qort.png deleted file mode 100644 index 39d090f..0000000 Binary files a/android/app/src/main/res/drawable/qort.png and /dev/null differ diff --git a/android/app/src/main/res/drawable/splash.png b/android/app/src/main/res/drawable/splash.png deleted file mode 100644 index a760af2..0000000 Binary files a/android/app/src/main/res/drawable/splash.png and /dev/null differ diff --git a/android/app/src/main/res/layout/activity_main.xml b/android/app/src/main/res/layout/activity_main.xml deleted file mode 100644 index b5ad138..0000000 --- a/android/app/src/main/res/layout/activity_main.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - diff --git a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml deleted file mode 100644 index 90f9580..0000000 --- a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index 12a409b..0000000 Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_adaptive_back.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher_adaptive_back.png deleted file mode 100644 index a05f3fc..0000000 Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher_adaptive_back.png and /dev/null differ diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_adaptive_fore.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher_adaptive_fore.png deleted file mode 100644 index d6bdb01..0000000 Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher_adaptive_fore.png and /dev/null differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 3966b05..0000000 Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_adaptive_back.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher_adaptive_back.png deleted file mode 100644 index 3814b23..0000000 Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher_adaptive_back.png and /dev/null differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_adaptive_fore.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher_adaptive_fore.png deleted file mode 100644 index 1907b24..0000000 Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher_adaptive_fore.png and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index ff8e391..0000000 Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_adaptive_back.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_adaptive_back.png deleted file mode 100644 index 2e1846f..0000000 Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_adaptive_back.png and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_adaptive_fore.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_adaptive_fore.png deleted file mode 100644 index 123ff93..0000000 Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_adaptive_fore.png and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index f1f3036..0000000 Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_adaptive_back.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_adaptive_back.png deleted file mode 100644 index fe154c8..0000000 Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_adaptive_back.png and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_adaptive_fore.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_adaptive_fore.png deleted file mode 100644 index c4fdc57..0000000 Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_adaptive_fore.png and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index 7191d0c..0000000 Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_adaptive_back.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_adaptive_back.png deleted file mode 100644 index b640524..0000000 Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_adaptive_back.png and /dev/null differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_adaptive_fore.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_adaptive_fore.png deleted file mode 100644 index 69a0eb8..0000000 Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_adaptive_fore.png and /dev/null differ diff --git a/android/app/src/main/res/values/ic_launcher_background.xml b/android/app/src/main/res/values/ic_launcher_background.xml deleted file mode 100644 index c5d5899..0000000 --- a/android/app/src/main/res/values/ic_launcher_background.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - #FFFFFF - \ No newline at end of file diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml deleted file mode 100644 index 624265c..0000000 --- a/android/app/src/main/res/values/strings.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - Qortal - Qortal - com.example.app - com.example.app - diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml deleted file mode 100644 index be874e5..0000000 --- a/android/app/src/main/res/values/styles.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/android/app/src/main/res/xml/file_paths.xml b/android/app/src/main/res/xml/file_paths.xml deleted file mode 100644 index bd0c4d8..0000000 --- a/android/app/src/main/res/xml/file_paths.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java b/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java deleted file mode 100644 index 0297327..0000000 --- a/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.getcapacitor.myapp; - -import static org.junit.Assert.*; - -import org.junit.Test; - -/** - * Example local unit test, which will execute on the development machine (host). - * - * @see Testing documentation - */ -public class ExampleUnitTest { - - @Test - public void addition_isCorrect() throws Exception { - assertEquals(4, 2 + 2); - } -} diff --git a/android/build.gradle b/android/build.gradle deleted file mode 100644 index 7e1c3f3..0000000 --- a/android/build.gradle +++ /dev/null @@ -1,33 +0,0 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. - -buildscript { - - repositories { - google() - mavenCentral() - } - dependencies { - classpath 'com.android.tools.build:gradle:8.2.1' - classpath 'com.google.gms:google-services:4.4.0' - - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files - } -} - -apply from: "variables.gradle" - -allprojects { - repositories { - google() - mavenCentral() - maven { - // capacitor-background-fetch - url("${project(':transistorsoft-capacitor-background-fetch').projectDir}/libs") - } - } -} - -task clean(type: Delete) { - delete rootProject.buildDir -} diff --git a/android/capacitor.settings.gradle b/android/capacitor.settings.gradle deleted file mode 100644 index c72458d..0000000 --- a/android/capacitor.settings.gradle +++ /dev/null @@ -1,18 +0,0 @@ -// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN -include ':capacitor-android' -project(':capacitor-android').projectDir = new File('../node_modules/@capacitor/android/capacitor') - -include ':capacitor-browser' -project(':capacitor-browser').projectDir = new File('../node_modules/@capacitor/browser/android') - -include ':capacitor-filesystem' -project(':capacitor-filesystem').projectDir = new File('../node_modules/@capacitor/filesystem/android') - -include ':capacitor-local-notifications' -project(':capacitor-local-notifications').projectDir = new File('../node_modules/@capacitor/local-notifications/android') - -include ':evva-capacitor-secure-storage-plugin' -project(':evva-capacitor-secure-storage-plugin').projectDir = new File('../node_modules/@evva/capacitor-secure-storage-plugin/android') - -include ':transistorsoft-capacitor-background-fetch' -project(':transistorsoft-capacitor-background-fetch').projectDir = new File('../node_modules/@transistorsoft/capacitor-background-fetch/android') diff --git a/android/gradle.properties b/android/gradle.properties deleted file mode 100644 index 2e87c52..0000000 --- a/android/gradle.properties +++ /dev/null @@ -1,22 +0,0 @@ -# Project-wide Gradle settings. - -# IDE (e.g. Android Studio) users: -# Gradle settings configured through the IDE *will override* -# any settings specified in this file. - -# For more details on how to configure your build environment visit -# http://www.gradle.org/docs/current/userguide/build_environment.html - -# Specifies the JVM arguments used for the daemon process. -# The setting is particularly useful for tweaking memory settings. -org.gradle.jvmargs=-Xmx1536m - -# When configured, Gradle will run in incubating parallel mode. -# This option should only be used with decoupled projects. More details, visit -# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects -# org.gradle.parallel=true - -# AndroidX package structure to make it clearer which packages are bundled with the -# Android operating system, and which are packaged with your app's APK -# https://developer.android.com/topic/libraries/support-library/androidx-rn -android.useAndroidX=true diff --git a/android/gradle/wrapper/gradle-wrapper.jar b/android/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 033e24c..0000000 Binary files a/android/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index c747538..0000000 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,7 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip -networkTimeout=10000 -validateDistributionUrl=true -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/android/gradlew b/android/gradlew deleted file mode 100755 index fcb6fca..0000000 --- a/android/gradlew +++ /dev/null @@ -1,248 +0,0 @@ -#!/bin/sh - -# -# Copyright © 2015-2021 the original authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -############################################################################## -# -# Gradle start up script for POSIX generated by Gradle. -# -# Important for running: -# -# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is -# noncompliant, but you have some other compliant shell such as ksh or -# bash, then to run this script, type that shell name before the whole -# command line, like: -# -# ksh Gradle -# -# Busybox and similar reduced shells will NOT work, because this script -# requires all of these POSIX shell features: -# * functions; -# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», -# «${var#prefix}», «${var%suffix}», and «$( cmd )»; -# * compound commands having a testable exit status, especially «case»; -# * various built-in commands including «command», «set», and «ulimit». -# -# Important for patching: -# -# (2) This script targets any POSIX shell, so it avoids extensions provided -# by Bash, Ksh, etc; in particular arrays are avoided. -# -# The "traditional" practice of packing multiple parameters into a -# space-separated string is a well documented source of bugs and security -# problems, so this is (mostly) avoided, by progressively accumulating -# options in "$@", and eventually passing that to Java. -# -# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, -# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; -# see the in-line comments for details. -# -# There are tweaks for specific operating systems such as AIX, CygWin, -# Darwin, MinGW, and NonStop. -# -# (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt -# within the Gradle project. -# -# You can find Gradle at https://github.com/gradle/gradle/. -# -############################################################################## - -# Attempt to set APP_HOME - -# Resolve links: $0 may be a link -app_path=$0 - -# Need this for daisy-chained symlinks. -while - APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path - [ -h "$app_path" ] -do - ls=$( ls -ld "$app_path" ) - link=${ls#*' -> '} - case $link in #( - /*) app_path=$link ;; #( - *) app_path=$APP_HOME$link ;; - esac -done - -# This is normally unused -# shellcheck disable=SC2034 -APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD=maximum - -warn () { - echo "$*" -} >&2 - -die () { - echo - echo "$*" - echo - exit 1 -} >&2 - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "$( uname )" in #( - CYGWIN* ) cygwin=true ;; #( - Darwin* ) darwin=true ;; #( - MSYS* | MINGW* ) msys=true ;; #( - NONSTOP* ) nonstop=true ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD=$JAVA_HOME/jre/sh/java - else - JAVACMD=$JAVA_HOME/bin/java - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD=java - if ! command -v java >/dev/null 2>&1 - then - die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -fi - -# Increase the maximum file descriptors if we can. -if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then - case $MAX_FD in #( - max*) - # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - MAX_FD=$( ulimit -H -n ) || - warn "Could not query maximum file descriptor limit" - esac - case $MAX_FD in #( - '' | soft) :;; #( - *) - # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. - # shellcheck disable=SC3045 - ulimit -n "$MAX_FD" || - warn "Could not set maximum file descriptor limit to $MAX_FD" - esac -fi - -# Collect all arguments for the java command, stacking in reverse order: -# * args from the command line -# * the main class name -# * -classpath -# * -D...appname settings -# * --module-path (only if needed) -# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. - -# For Cygwin or MSYS, switch paths to Windows format before running java -if "$cygwin" || "$msys" ; then - APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) - - JAVACMD=$( cygpath --unix "$JAVACMD" ) - - # Now convert the arguments - kludge to limit ourselves to /bin/sh - for arg do - if - case $arg in #( - -*) false ;; # don't mess with options #( - /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath - [ -e "$t" ] ;; #( - *) false ;; - esac - then - arg=$( cygpath --path --ignore --mixed "$arg" ) - fi - # Roll the args list around exactly as many times as the number of - # args, so each arg winds up back in the position where it started, but - # possibly modified. - # - # NB: a `for` loop captures its iteration list before it begins, so - # changing the positional parameters here affects neither the number of - # iterations, nor the values presented in `arg`. - shift # remove old arg - set -- "$@" "$arg" # push replacement arg - done -fi - - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Collect all arguments for the java command; -# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of -# shell script including quotes and variable substitutions, so put them in -# double quotes to make sure that they get re-expanded; and -# * put everything else in single quotes, so that it's not re-expanded. - -set -- \ - "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ - org.gradle.wrapper.GradleWrapperMain \ - "$@" - -# Stop when "xargs" is not available. -if ! command -v xargs >/dev/null 2>&1 -then - die "xargs is not available" -fi - -# Use "xargs" to parse quoted args. -# -# With -n1 it outputs one arg per line, with the quotes and backslashes removed. -# -# In Bash we could simply go: -# -# readarray ARGS < <( xargs -n1 <<<"$var" ) && -# set -- "${ARGS[@]}" "$@" -# -# but POSIX shell has neither arrays nor command substitution, so instead we -# post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse -# that process (while maintaining the separation between arguments), and wrap -# the whole thing up as a single "set" statement. -# -# This will of course break if any of these variables contains a newline or -# an unmatched quote. -# - -eval "set -- $( - printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | - xargs -n1 | - sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | - tr '\n' ' ' - )" '"$@"' - -exec "$JAVACMD" "$@" diff --git a/android/gradlew.bat b/android/gradlew.bat deleted file mode 100644 index 6689b85..0000000 --- a/android/gradlew.bat +++ /dev/null @@ -1,92 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/android/settings.gradle b/android/settings.gradle deleted file mode 100644 index 3b4431d..0000000 --- a/android/settings.gradle +++ /dev/null @@ -1,5 +0,0 @@ -include ':app' -include ':capacitor-cordova-android-plugins' -project(':capacitor-cordova-android-plugins').projectDir = new File('./capacitor-cordova-android-plugins/') - -apply from: 'capacitor.settings.gradle' \ No newline at end of file diff --git a/android/variables.gradle b/android/variables.gradle deleted file mode 100644 index 8ef305d..0000000 --- a/android/variables.gradle +++ /dev/null @@ -1,16 +0,0 @@ -ext { - minSdkVersion = 22 - compileSdkVersion = 34 - targetSdkVersion = 34 - androidxActivityVersion = '1.8.0' - androidxAppCompatVersion = '1.6.1' - androidxCoordinatorLayoutVersion = '1.2.0' - androidxCoreVersion = '1.12.0' - androidxFragmentVersion = '1.6.2' - coreSplashScreenVersion = '1.0.1' - androidxWebkitVersion = '1.9.0' - junitVersion = '4.13.2' - androidxJunitVersion = '1.1.5' - androidxEspressoCoreVersion = '3.5.1' - cordovaAndroidVersion = '10.1.1' -} \ No newline at end of file diff --git a/capacitor.config.ts b/capacitor.config.ts index c7f641f..87d927b 100644 --- a/capacitor.config.ts +++ b/capacitor.config.ts @@ -1,15 +1,15 @@ -import type { CapacitorConfig } from '@capacitor/cli'; +import type { CapacitorConfig } from "@capacitor/cli"; const config: CapacitorConfig = { - appId: 'org.Qortal.Qortal-Hub', - appName: 'Qortal-Hub', - webDir: 'dist', - "plugins": { - "LocalNotifications": { - "smallIcon": "qort", - "iconColor": "#09b6e8" - } - } + appId: "org.Qortal.Qortal-Hub", + appName: "Qortal-Hub", + webDir: "dist", + plugins: { + LocalNotifications: { + smallIcon: "qort", + iconColor: "#09b6e8", + }, + }, }; export default config; diff --git a/dist.zip b/dist.zip deleted file mode 100644 index 8f6f422..0000000 Binary files a/dist.zip and /dev/null differ diff --git a/docs/contribution.md b/docs/contribution.md new file mode 100644 index 0000000..07d06fe --- /dev/null +++ b/docs/contribution.md @@ -0,0 +1,84 @@ + +# 🤝 Contributing Guide + +Thank you for your interest in contributing! We follow a structured Git workflow to keep the project clean, stable, and production-ready at all times. + +--- + +## 📦 Branch Overview + +| Branch | Purpose | +|------------------|----------------------------------------------------------| +| `master` | Stable, production-ready code. All releases are tagged from here. | +| `develop` | Active development branch. All new features go here first. | +| `release/x.y.z` | Pre-release branch for staging, QA, and final polish. | + +--- + +## 🌿 Creating a Feature or Fix + +1. **Start from `develop`:** + + ```bash + git checkout develop + git checkout -b feature/your-feature-name + ``` + +2. **Make your changes and commit them.** + +3. **Push your branch:** + + ```bash + git push origin feature/your-feature-name + ``` + +4. **Open a Pull Request into `develop`.** + +--- + +## 🚀 Releasing Code (Maintainers Only) + +A new `release/x.y.z` branch must be created for **every release**. + +1. **Create a `release/` branch from `master`:** + + ```bash + git checkout master + git checkout -b release/1.2.0 + ``` + +2. **Merge in `develop` or selected branches if `develop` is not ready:** + + ```bash + git merge develop + # or + git merge feature/finished-feature + git merge feature/another-complete-feature + ``` + +3. **Polish, test, and fix issues as needed.** + +4. **Merge back into `develop`:** + + ```bash + git checkout develop + git merge release/1.2.0 + git push origin develop + ``` + +5. **Finalize the release:** + + ```bash + git checkout master + git merge release/1.2.0 + git tag v1.2.0 + git push origin master --tags + ``` + +6. **Delete the release branch:** + + ```bash + git branch -d release/1.2.0 + git push origin --delete release/1.2.0 + ``` + diff --git a/docs/i18n_languages.md b/docs/i18n_languages.md new file mode 100644 index 0000000..11a792d --- /dev/null +++ b/docs/i18n_languages.md @@ -0,0 +1,35 @@ +# I18N Guidelines + +[react-i18next](https://react.i18next.com/) is the framework used for internationalization. + +## Locales + +Locales are in folder `./src/i18n/locales`, one folder per language. + +A single JSON file represents a namespace (group of translation). +It's a sorted key/value structure. + +Translation in GUI: + +- If the first letter of the translation must be uppercase, use the postProcess, for example: `t('core:advanced_users', { postProcess: 'capitalizeFirstChar' })` +- For all translation in uppercase `{ postProcess: 'capitalizeAll' }` +- See `.src/i18n/i18n.ts` for processor definition + +## Namespaces + +These are the current namespaces, in which all translations are organized: + +- `auth`: relative to the authentication (name, addresses, keys, secrets, seedphrase, and so on...) +- `core`: all the core translation +- `group`: all translations concerning group management +- `question`: all questions to the users +- `tutorial`: dedicated to the tutorial pages + +Please avoid duplication of the same translation. +In the same page the usage of translations from different namespaces is permissible. + +## Missing language? + +- Please open an issue on the project's github repository and specify the missing language, by clicking [New Issue](https://github.com/Qortal/Qortal-Hub/issues/new) + +- You can also open a Pull Request if you like to contribute directly to the project. diff --git a/electron/capacitor.config.ts b/electron/capacitor.config.ts index c7f641f..87d927b 100644 --- a/electron/capacitor.config.ts +++ b/electron/capacitor.config.ts @@ -1,15 +1,15 @@ -import type { CapacitorConfig } from '@capacitor/cli'; +import type { CapacitorConfig } from "@capacitor/cli"; const config: CapacitorConfig = { - appId: 'org.Qortal.Qortal-Hub', - appName: 'Qortal-Hub', - webDir: 'dist', - "plugins": { - "LocalNotifications": { - "smallIcon": "qort", - "iconColor": "#09b6e8" - } - } + appId: "org.Qortal.Qortal-Hub", + appName: "Qortal-Hub", + webDir: "dist", + plugins: { + LocalNotifications: { + smallIcon: "qort", + iconColor: "#09b6e8", + }, + }, }; export default config; diff --git a/electron/electron-builder.config.arm.json b/electron/electron-builder.config.arm.json index 1490123..8bccc56 100644 --- a/electron/electron-builder.config.arm.json +++ b/electron/electron-builder.config.arm.json @@ -10,13 +10,10 @@ "build/**/*", "capacitor.config.*", "app/**/*", - "scripts/**/*" + "scripts/**/*" ], "linux": { - "target": [ - "AppImage", - "deb" - ], + "target": ["AppImage", "deb"], "category": "Network", "packageCategory": "Network", "desktop": { @@ -26,11 +23,11 @@ "icon": "assets/png" }, "appImage": { - "artifactName": "Qortal-Hub-arm64_${version}.${ext}" + "artifactName": "Qortal-Hub-arm64.${ext}" }, "deb": { - "artifactName": "Qortal-Hub-Setup-arm64_${version}.${ext}", - "synopsis": "Qortal Hub for Linux", + "artifactName": "Qortal-Hub-Setup-arm64.${ext}", + "synopsis": "Qortal Hub for Linux" }, "directories": { "output": "dist", diff --git a/electron/electron-builder.config.json b/electron/electron-builder.config.json index 6f3bf7c..669de4a 100644 --- a/electron/electron-builder.config.json +++ b/electron/electron-builder.config.json @@ -20,7 +20,7 @@ "win": { "target": ["nsis", "portable"], "icon": "assets/appIcon.ico", - "artifactName": "Qortal-Hub-Setup_${version}.exe", + "artifactName": "Qortal-Hub-Setup.exe" }, "linux": { "target": ["AppImage"], @@ -34,15 +34,15 @@ "asar": true }, "deb": { - "artifactName": "Qortal-Hub-Setup_${version}.${ext}", + "artifactName": "Qortal-Hub-Setup.${ext}", "synopsis": "Qortal Hub for Linux" }, "appImage": { "artifactName": "Qortal-Hub.${ext}" }, - + "snap": { - "artifactName": "Qortal-Hub-Setup_${version}.${ext}", + "artifactName": "Qortal-Hub-Setup.${ext}", "synopsis": "Qortal Hub for Linux" }, "mac": { diff --git a/electron/electron-builder.config.lin.json b/electron/electron-builder.config.lin.json index 863557d..a95d8ae 100644 --- a/electron/electron-builder.config.lin.json +++ b/electron/electron-builder.config.lin.json @@ -10,15 +10,10 @@ "build/**/*", "capacitor.config.*", "app/**/*", - "scripts/**/*" + "scripts/**/*" ], "linux": { - "target": [ - "AppImage", - "deb", - "snap", - "rpm" - ], + "target": ["AppImage", "deb", "snap", "rpm"], "category": "Network", "packageCategory": "Network", "desktop": { @@ -28,19 +23,19 @@ "icon": "assets/png" }, "appImage": { - "artifactName": "Qortal-Hub_${version}.${ext}" + "artifactName": "Qortal-Hub.${ext}" }, "deb": { - "artifactName": "Qortal-Hub-Setup_${version}.${ext}", + "artifactName": "Qortal-Hub-Setup.${ext}", "synopsis": "Qortal Hub for Linux", - "afterInstall": "scripts/add-debian-apt-repo.sh" + "afterInstall": "scripts/add-debian-apt-repo.sh" }, "snap": { - "artifactName": "Qortal-Hub-Setup_${version}.${ext}", + "artifactName": "Qortal-Hub-Setup.${ext}", "synopsis": "Qortal Hub for Linux" }, "rpm": { - "artifactName": "Qortal-Hub-Setup_${version}.${ext}", + "artifactName": "Qortal-Hub-Setup.${ext}", "synopsis": "Qortal Hub for Linux" }, "directories": { diff --git a/electron/electron-builder.config.mac.json b/electron/electron-builder.config.mac.json index 056babc..c9c935f 100644 --- a/electron/electron-builder.config.mac.json +++ b/electron/electron-builder.config.mac.json @@ -2,7 +2,7 @@ "appId": "org.Qortal.Qortal-Hub", "productName": "Qortal Hub", "copyright": "Copyright © 2021 - 2025 Qortal", - "artifactName": "Qortal-Hub-Setup-macOS_${version}.${ext}", + "artifactName": "Qortal-Hub-Setup-macOS.${ext}", "compression": "normal", @@ -33,7 +33,7 @@ "dmg": { "sign": false, - "artifactName": "Qortal-Hub-Setup-macOS_${version}.${ext}", + "artifactName": "Qortal-Hub-Setup-macOS.${ext}", "icon": "assets/mac/appIcon.icns", "iconSize": 100, "contents": [ @@ -51,7 +51,7 @@ }, "pkg": { - "artifactName": "Qortal-Hub-Setup-macOS_${version}.${ext}", + "artifactName": "Qortal-Hub-Setup-macOS.${ext}", "installLocation": "/Applications", "background": { "file": "buildmac/logo-hub.png", @@ -78,4 +78,4 @@ "releaseType": "draft" } ] -} \ No newline at end of file +} diff --git a/electron/electron-builder.config.win.json b/electron/electron-builder.config.win.json index 4097af6..ea5e6d4 100644 --- a/electron/electron-builder.config.win.json +++ b/electron/electron-builder.config.win.json @@ -4,22 +4,14 @@ "copyright": "Copyright © 2021 - 2025 Qortal", "compression": "normal", "asar": "true", - "files": [ - "assets/**/*", - "build/**/*", - "capacitor.config.*", - "app/**/*" - ], + "files": ["assets/**/*", "build/**/*", "capacitor.config.*", "app/**/*"], "win": { "legalTrademarks": "QORTAL.ORG", "icon": "assets/appIcon.ico", - "target": [ - "nsis", - "portable" - ] + "target": ["nsis", "portable"] }, "nsis": { - "artifactName": "Qortal-Hub-Setup-win64_${version}.${ext}", + "artifactName": "Qortal-Hub-Setup-win64.${ext}", "allowElevation": true, "oneClick": false, "allowToChangeInstallationDirectory": true, diff --git a/electron/package.json b/electron/package.json index 31f5372..12aade9 100644 --- a/electron/package.json +++ b/electron/package.json @@ -1,6 +1,6 @@ { "name": "qortal-hub", - "version": "0.5.3", + "version": "0.5.4", "description": "A desktop app that gives you access to the Qortal network", "author": { "name": "", @@ -57,4 +57,4 @@ "capacitor", "electron" ] -} \ No newline at end of file +} diff --git a/index.html b/index.html index 43b8b56..74f19fd 100644 --- a/index.html +++ b/index.html @@ -1,12 +1,9 @@ - + - - + - - Qortal Hub diff --git a/package-lock.json b/package-lock.json index b43a338..11070dd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,35 +15,34 @@ "@capacitor/core": "^6.1.2", "@capacitor/filesystem": "^6.0.1", "@capacitor/local-notifications": "^6.1.0", - "@chatscope/chat-ui-kit-react": "^2.0.3", - "@dnd-kit/core": "^6.1.0", - "@dnd-kit/sortable": "^8.0.0", + "@dnd-kit/core": "^6.3.0", + "@dnd-kit/sortable": "^10.0.0", "@electron/packager": "^18.3.6", "@emotion/react": "^11.11.4", "@emotion/styled": "^11.11.0", "@evva/capacitor-secure-storage-plugin": "^3.0.1", - "@mui/icons-material": "^5.16.4", - "@mui/lab": "^5.0.0-alpha.173", - "@mui/material": "^5.16.7", - "@reduxjs/toolkit": "^2.2.7", - "@tanstack/react-virtual": "^3.10.8", + "@mui/icons-material": "^7.0.1", + "@mui/lab": "^7.0.0-beta.11", + "@mui/material": "^7.0.1", + "@tanstack/react-virtual": "^3.13.6", "@testing-library/jest-dom": "^6.4.6", - "@testing-library/user-event": "^14.5.2", - "@tiptap/extension-color": "^2.5.9", - "@tiptap/extension-highlight": "^2.6.6", - "@tiptap/extension-image": "^2.6.6", - "@tiptap/extension-mention": "^2.9.1", - "@tiptap/extension-placeholder": "^2.6.2", - "@tiptap/extension-text-style": "^2.5.9", - "@tiptap/extension-underline": "^2.6.6", - "@tiptap/pm": "^2.5.9", - "@tiptap/react": "^2.5.9", - "@tiptap/starter-kit": "^2.5.9", + "@testing-library/user-event": "^14.6.1", + "@tiptap/extension-color": "^2.11.7", + "@tiptap/extension-highlight": "^2.11.7", + "@tiptap/extension-image": "^2.11.7", + "@tiptap/extension-mention": "^2.11.7", + "@tiptap/extension-placeholder": "^2.11.7", + "@tiptap/extension-text-style": "^2.11.7", + "@tiptap/extension-underline": "^2.11.7", + "@tiptap/pm": "^2.11.7", + "@tiptap/react": "^2.11.7", + "@tiptap/starter-kit": "^2.11.7", "@transistorsoft/capacitor-background-fetch": "^6.0.1", "@types/chrome": "^0.0.263", + "@uiw/react-color": "^2.5.1", "adm-zip": "^0.5.16", "asmcrypto.js": "2.3.2", - "axios": "^1.7.7", + "axios": "^1.8.2", "bcryptjs": "2.4.3", "buffer": "6.0.3", "chokidar": "^3.6.0", @@ -56,29 +55,29 @@ "emoji-picker-react": "^4.12.0", "file-saver": "^2.0.5", "html-to-text": "^9.0.5", + "i18next": "^25.0.1", + "i18next-browser-languagedetector": "^8.0.5", + "i18next-http-backend": "^3.0.2", + "i18next-localstorage-backend": "^4.2.0", + "jotai": "^2.12.3", "jssha": "3.3.1", "lit": "^3.2.1", "lodash": "^4.17.21", "mime": "^4.0.4", "moment": "^2.30.1", "npm": "^10.8.3", - "quill-image-resize-module-react": "^3.0.0", - "react": "^18.2.0", - "react-copy-to-clipboard": "^5.1.0", + "react": "^19.1.0", "react-countdown-circle-timer": "^3.2.1", - "react-dom": "^18.2.0", + "react-dom": "^19.1.0", "react-dropzone": "^14.2.3", "react-frame-component": "^5.2.7", - "react-infinite-scroller": "^1.2.6", - "react-intersection-observer": "^9.13.0", - "react-json-view-lite": "^2.0.1", + "react-i18next": "^15.4.1", + "react-intersection-observer": "^9.16.0", + "react-json-view-lite": "^2.4.1", "react-loader-spinner": "^6.1.6", "react-qr-code": "^2.0.15", - "react-quill": "^2.0.0", - "react-redux": "^9.1.2", - "react-virtualized": "^9.22.5", + "react-virtualized": "^9.22.6", "react-virtuoso": "^4.10.4", - "recoil": "^0.7.7", "short-unique-id": "^5.2.0", "slate": "^0.103.0", "slate-react": "^0.109.0", @@ -90,14 +89,12 @@ "vite-plugin-wasm": "^3.3.0" }, "devDependencies": { - "@testing-library/dom": "^10.3.0", - "@testing-library/react": "^16.0.0", + "@testing-library/dom": "^10.4.0", + "@testing-library/react": "^16.3.0", "@types/dompurify": "^3.0.5", "@types/lodash": "^4.17.7", - "@types/react": "^18.2.64", - "@types/react-copy-to-clipboard": "^5.0.7", - "@types/react-dom": "^18.2.21", - "@types/react-infinite-scroller": "^1.2.5", + "@types/react": "^19.1.0", + "@types/react-dom": "^19.1.0", "@types/react-virtualized": "^9.21.30", "@typescript-eslint/eslint-plugin": "^7.1.1", "@typescript-eslint/parser": "^7.1.1", @@ -106,10 +103,11 @@ "eslint": "^8.57.0", "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-refresh": "^0.4.5", + "prettier": "^3.5.3", "rename-cli": "^6.2.1", "typescript": "^5.2.2", "vite": "^5.1.6", - "vitest": "^1.6.0" + "vitest": "^1.6.1" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -1478,9 +1476,10 @@ } }, "node_modules/@babel/runtime": { - "version": "7.24.1", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.1.tgz", - "integrity": "sha512-+BIznRzyqBf+2wCTxcKE3wDjfGeCoVE61KSHGpkzqrLi8qxqFwBeUFyId2cxkTmm55fzDGnm0+yCxaxygrLUnQ==", + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.27.0.tgz", + "integrity": "sha512-VtPOkrdPHZsKc/clNqyi9WUA8TINkZ4cGk63UUE3u4pmB2k+ZMQRDuIOagv8UVd6j7k0T3+RRIb7beKTebNbcw==", + "license": "MIT", "dependencies": { "regenerator-runtime": "^0.14.0" }, @@ -1771,30 +1770,6 @@ "@capacitor/core": "^6.0.0" } }, - "node_modules/@chatscope/chat-ui-kit-react": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@chatscope/chat-ui-kit-react/-/chat-ui-kit-react-2.0.3.tgz", - "integrity": "sha512-0IkjFskRec7SHrFivOQPiZMie5GLQL+ZnROiIbj4yptbC3aMEMFdHRAZrfqlid3uQx9kYhdtn34wMLh1vVNMLA==", - "dependencies": { - "@chatscope/chat-ui-kit-styles": "^1.2.0", - "@fortawesome/fontawesome-free": "^5.12.1", - "@fortawesome/fontawesome-svg-core": "^1.2.26", - "@fortawesome/free-solid-svg-icons": "^5.12.0", - "@fortawesome/react-fontawesome": "^0.1.8", - "classnames": "^2.2.6", - "prop-types": "^15.7.2" - }, - "peerDependencies": { - "prop-types": "^15.7.2", - "react": "^16.12.0 || ^17.0.0 || ^18.2.0", - "react-dom": "^16.12.0 || ^17.0.0 || ^18.2.0" - } - }, - "node_modules/@chatscope/chat-ui-kit-styles": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@chatscope/chat-ui-kit-styles/-/chat-ui-kit-styles-1.4.0.tgz", - "integrity": "sha512-016mBJD3DESw7Nh+lkKcPd22xG92ghA0VpIXIbjQtmXhC7Ve6wRazTy8z1Ahut+Tbv179+JxrftuMngsj/yV8Q==" - }, "node_modules/@develar/schema-utils": { "version": "2.6.5", "resolved": "https://registry.npmjs.org/@develar/schema-utils/-/schema-utils-2.6.5.tgz", @@ -1812,9 +1787,10 @@ } }, "node_modules/@dnd-kit/accessibility": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@dnd-kit/accessibility/-/accessibility-3.1.0.tgz", - "integrity": "sha512-ea7IkhKvlJUv9iSHJOnxinBcoOI3ppGnnL+VDJ75O45Nss6HtZd8IdN8touXPDtASfeI2T2LImb8VOZcL47wjQ==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@dnd-kit/accessibility/-/accessibility-3.1.1.tgz", + "integrity": "sha512-2P+YgaXF+gRsIihwwY1gCsQSYnu9Zyj2py8kY5fFvUM1qm2WA2u639R6YNVfU4GWr+ZM5mqEsfHZZLoRONbemw==", + "license": "MIT", "dependencies": { "tslib": "^2.0.0" }, @@ -1823,11 +1799,12 @@ } }, "node_modules/@dnd-kit/core": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/@dnd-kit/core/-/core-6.1.0.tgz", - "integrity": "sha512-J3cQBClB4TVxwGo3KEjssGEXNJqGVWx17aRTZ1ob0FliR5IjYgTxl5YJbKTzA6IzrtelotH19v6y7uoIRUZPSg==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/@dnd-kit/core/-/core-6.3.1.tgz", + "integrity": "sha512-xkGBRQQab4RLwgXxoqETICr6S5JlogafbhNsidmrkVv2YRs5MLwpjoF2qpiGjQt8S9AoxtIV603s0GIUpY5eYQ==", + "license": "MIT", "dependencies": { - "@dnd-kit/accessibility": "^3.1.0", + "@dnd-kit/accessibility": "^3.1.1", "@dnd-kit/utilities": "^3.2.2", "tslib": "^2.0.0" }, @@ -1837,15 +1814,16 @@ } }, "node_modules/@dnd-kit/sortable": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@dnd-kit/sortable/-/sortable-8.0.0.tgz", - "integrity": "sha512-U3jk5ebVXe1Lr7c2wU7SBZjcWdQP+j7peHJfCspnA81enlu88Mgd7CC8Q+pub9ubP7eKVETzJW+IBAhsqbSu/g==", + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@dnd-kit/sortable/-/sortable-10.0.0.tgz", + "integrity": "sha512-+xqhmIIzvAYMGfBYYnbKuNicfSsk4RksY2XdmJhT+HAC01nix6fHCztU68jooFiMUB01Ky3F0FyOvhG/BZrWkg==", + "license": "MIT", "dependencies": { "@dnd-kit/utilities": "^3.2.2", "tslib": "^2.0.0" }, "peerDependencies": { - "@dnd-kit/core": "^6.1.0", + "@dnd-kit/core": "^6.3.0", "react": ">=16.8.0" } }, @@ -2425,21 +2403,35 @@ } }, "node_modules/@emotion/cache": { - "version": "11.11.0", - "resolved": "https://registry.npmjs.org/@emotion/cache/-/cache-11.11.0.tgz", - "integrity": "sha512-P34z9ssTCBi3e9EI1ZsWpNHcfY1r09ZO0rZbRO2ob3ZQMnFI35jB536qoXbkdesr5EUhYi22anuEJuyxifaqAQ==", + "version": "11.14.0", + "resolved": "https://registry.npmjs.org/@emotion/cache/-/cache-11.14.0.tgz", + "integrity": "sha512-L/B1lc/TViYk4DcpGxtAVbx0ZyiKM5ktoIyafGkH6zg/tj+mA+NE//aPYKG0k8kCHSHVJrpLpcAlOBEXQ3SavA==", + "license": "MIT", "dependencies": { - "@emotion/memoize": "^0.8.1", - "@emotion/sheet": "^1.2.2", - "@emotion/utils": "^1.2.1", - "@emotion/weak-memoize": "^0.3.1", + "@emotion/memoize": "^0.9.0", + "@emotion/sheet": "^1.4.0", + "@emotion/utils": "^1.4.2", + "@emotion/weak-memoize": "^0.4.0", "stylis": "4.2.0" } }, + "node_modules/@emotion/cache/node_modules/@emotion/memoize": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.9.0.tgz", + "integrity": "sha512-30FAj7/EoJ5mwVPOWhAyCX+FPfMDrVecJAM+Iw9NRoSl4BBAQeqj4cApHHUXOVvIPgLVDsCFoz/hGD+5QQD1GQ==", + "license": "MIT" + }, + "node_modules/@emotion/cache/node_modules/@emotion/weak-memoize": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@emotion/weak-memoize/-/weak-memoize-0.4.0.tgz", + "integrity": "sha512-snKqtPW01tN0ui7yu9rGv69aJXr/a/Ywvl11sUjNtEcRc+ng/mQriFL0wLXMef74iHa/EkftbDzU9F8iFbH+zg==", + "license": "MIT" + }, "node_modules/@emotion/hash": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/@emotion/hash/-/hash-0.9.1.tgz", - "integrity": "sha512-gJB6HLm5rYwSLI6PQa+X1t5CFGrv1J1TWG+sOyMCeKz2ojaj6Fnl/rZEspogG+cvqbt4AE/2eIyD2QfLKTBNlQ==" + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/@emotion/hash/-/hash-0.9.2.tgz", + "integrity": "sha512-MyqliTZGuOm3+5ZRSaaBGP3USLw6+EGykkwZns2EPC5g8jJ4z9OrdZY9apkl3+UP9+sdz76YYkwCKP5gh8iY3g==", + "license": "MIT" }, "node_modules/@emotion/is-prop-valid": { "version": "1.2.2", @@ -2478,21 +2470,35 @@ } }, "node_modules/@emotion/serialize": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@emotion/serialize/-/serialize-1.1.3.tgz", - "integrity": "sha512-iD4D6QVZFDhcbH0RAG1uVu1CwVLMWUkCvAqqlewO/rxf8+87yIBAlt4+AxMiiKPLs5hFc0owNk/sLLAOROw3cA==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/@emotion/serialize/-/serialize-1.3.3.tgz", + "integrity": "sha512-EISGqt7sSNWHGI76hC7x1CksiXPahbxEOrC5RjmFRJTqLyEK9/9hZvBbiYn70dw4wuwMKiEMCUlR6ZXTSWQqxA==", + "license": "MIT", "dependencies": { - "@emotion/hash": "^0.9.1", - "@emotion/memoize": "^0.8.1", - "@emotion/unitless": "^0.8.1", - "@emotion/utils": "^1.2.1", + "@emotion/hash": "^0.9.2", + "@emotion/memoize": "^0.9.0", + "@emotion/unitless": "^0.10.0", + "@emotion/utils": "^1.4.2", "csstype": "^3.0.2" } }, + "node_modules/@emotion/serialize/node_modules/@emotion/memoize": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.9.0.tgz", + "integrity": "sha512-30FAj7/EoJ5mwVPOWhAyCX+FPfMDrVecJAM+Iw9NRoSl4BBAQeqj4cApHHUXOVvIPgLVDsCFoz/hGD+5QQD1GQ==", + "license": "MIT" + }, + "node_modules/@emotion/serialize/node_modules/@emotion/unitless": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.10.0.tgz", + "integrity": "sha512-dFoMUuQA20zvtVTuxZww6OHoJYgrzfKM1t52mVySDJnMSEa08ruEvdYQbhvyu6soU+NeLVd3yKfTfT0NeV6qGg==", + "license": "MIT" + }, "node_modules/@emotion/sheet": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@emotion/sheet/-/sheet-1.2.2.tgz", - "integrity": "sha512-0QBtGvaqtWi+nx6doRwDdBIzhNdZrXUppvTM4dtZZWEGTXL/XE/yJxLMGlDT1Gt+UHH5IX1n+jkXyytE/av7OA==" + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@emotion/sheet/-/sheet-1.4.0.tgz", + "integrity": "sha512-fTBW9/8r2w3dXWYM4HCB1Rdp8NLibOw2+XELH5m5+AkWiL/KqYX6dc0kKYlaYyKjrQ6ds33MCdMPEwgs2z1rqg==", + "license": "MIT" }, "node_modules/@emotion/styled": { "version": "11.11.0", @@ -2519,7 +2525,8 @@ "node_modules/@emotion/unitless": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.8.1.tgz", - "integrity": "sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==" + "integrity": "sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==", + "license": "MIT" }, "node_modules/@emotion/use-insertion-effect-with-fallbacks": { "version": "1.0.1", @@ -2530,9 +2537,10 @@ } }, "node_modules/@emotion/utils": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-1.2.1.tgz", - "integrity": "sha512-Y2tGf3I+XVnajdItskUCn6LX+VUDmP6lTL4fcqsXAv43dnlbZiuW4MWQW38rW/BVWSE7Q/7+XQocmpnRYILUmg==" + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-1.4.2.tgz", + "integrity": "sha512-3vLclRofFziIa3J2wDh9jjbkUz9qk5Vi3IZ/FSTKViB0k+ef0fPV7dYrUIugbgupYDx7v9ud/SjrtEP8Y4xLoA==", + "license": "MIT" }, "node_modules/@emotion/weak-memoize": { "version": "0.3.1", @@ -2985,94 +2993,6 @@ "@capacitor/core": "^6.1.2" } }, - "node_modules/@floating-ui/core": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.6.0.tgz", - "integrity": "sha512-PcF++MykgmTj3CIyOQbKA/hDzOAiqI3mhuoN44WRCopIs1sgoDoU4oty4Jtqaj/y3oDU6fnVSm4QG0a3t5i0+g==", - "dependencies": { - "@floating-ui/utils": "^0.2.1" - } - }, - "node_modules/@floating-ui/dom": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.6.3.tgz", - "integrity": "sha512-RnDthu3mzPlQ31Ss/BTwQ1zjzIhr3lk1gZB1OC56h/1vEtaXkESrOqL5fQVMfXpwGtRwX+YsZBdyHtJMQnkArw==", - "dependencies": { - "@floating-ui/core": "^1.0.0", - "@floating-ui/utils": "^0.2.0" - } - }, - "node_modules/@floating-ui/react-dom": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.0.8.tgz", - "integrity": "sha512-HOdqOt3R3OGeTKidaLvJKcgg75S6tibQ3Tif4eyd91QnIJWr0NLvoXFpJA/j8HqkFSL68GDca9AuyWEHlhyClw==", - "dependencies": { - "@floating-ui/dom": "^1.6.1" - }, - "peerDependencies": { - "react": ">=16.8.0", - "react-dom": ">=16.8.0" - } - }, - "node_modules/@floating-ui/utils": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.1.tgz", - "integrity": "sha512-9TANp6GPoMtYzQdt54kfAyMmz1+osLlXdg2ENroU7zzrtflTLrrC/lgrIfaSe+Wu0b89GKccT7vxXA0MoAIO+Q==" - }, - "node_modules/@fortawesome/fontawesome-common-types": { - "version": "0.2.36", - "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-0.2.36.tgz", - "integrity": "sha512-a/7BiSgobHAgBWeN7N0w+lAhInrGxksn13uK7231n2m8EDPE3BMCl9NZLTGrj9ZXfCmC6LM0QLqXidIizVQ6yg==", - "hasInstallScript": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/@fortawesome/fontawesome-free": { - "version": "5.15.4", - "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-5.15.4.tgz", - "integrity": "sha512-eYm8vijH/hpzr/6/1CJ/V/Eb1xQFW2nnUKArb3z+yUWv7HTwj6M7SP957oMjfZjAHU6qpoNc2wQvIxBLWYa/Jg==", - "hasInstallScript": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/@fortawesome/fontawesome-svg-core": { - "version": "1.2.36", - "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-1.2.36.tgz", - "integrity": "sha512-YUcsLQKYb6DmaJjIHdDWpBIGCcyE/W+p/LMGvjQem55Mm2XWVAP5kWTMKWLv9lwpCVjpLxPyOMOyUocP1GxrtA==", - "hasInstallScript": true, - "dependencies": { - "@fortawesome/fontawesome-common-types": "^0.2.36" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/@fortawesome/free-solid-svg-icons": { - "version": "5.15.4", - "resolved": "https://registry.npmjs.org/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-5.15.4.tgz", - "integrity": "sha512-JLmQfz6tdtwxoihXLg6lT78BorrFyCf59SAwBM6qV/0zXyVeDygJVb3fk+j5Qat+Yvcxp1buLTY5iDh1ZSAQ8w==", - "hasInstallScript": true, - "dependencies": { - "@fortawesome/fontawesome-common-types": "^0.2.36" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/@fortawesome/react-fontawesome": { - "version": "0.1.19", - "resolved": "https://registry.npmjs.org/@fortawesome/react-fontawesome/-/react-fontawesome-0.1.19.tgz", - "integrity": "sha512-Hyb+lB8T18cvLNX0S3llz7PcSOAJMLwiVKBuuzwM/nI5uoBw+gQjnf9il0fR1C3DKOI5Kc79pkJ4/xB0Uw9aFQ==", - "dependencies": { - "prop-types": "^15.8.1" - }, - "peerDependencies": { - "@fortawesome/fontawesome-svg-core": "~1 || ~6", - "react": ">=16.x" - } - }, "node_modules/@gar/promisify": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz", @@ -3624,9 +3544,10 @@ } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", + "license": "MIT" }, "node_modules/@jridgewell/trace-mapping": { "version": "0.3.25", @@ -3723,64 +3644,35 @@ "node": ">= 10.0.0" } }, - "node_modules/@mui/base": { - "version": "5.0.0-beta.40", - "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.40.tgz", - "integrity": "sha512-I/lGHztkCzvwlXpjD2+SNmvNQvB4227xBXhISPjEaJUXGImOQ9f3D2Yj/T3KasSI/h0MLWy74X0J6clhPmsRbQ==", - "dependencies": { - "@babel/runtime": "^7.23.9", - "@floating-ui/react-dom": "^2.0.8", - "@mui/types": "^7.2.14", - "@mui/utils": "^5.15.14", - "@popperjs/core": "^2.11.8", - "clsx": "^2.1.0", - "prop-types": "^15.8.1" - }, - "engines": { - "node": ">=12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mui-org" - }, - "peerDependencies": { - "@types/react": "^17.0.0 || ^18.0.0", - "react": "^17.0.0 || ^18.0.0", - "react-dom": "^17.0.0 || ^18.0.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - } - } - }, "node_modules/@mui/core-downloads-tracker": { - "version": "5.16.7", - "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.16.7.tgz", - "integrity": "sha512-RtsCt4Geed2/v74sbihWzzRs+HsIQCfclHeORh5Ynu2fS4icIKozcSubwuG7vtzq2uW3fOR1zITSP84TNt2GoQ==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-7.0.2.tgz", + "integrity": "sha512-TfeFU9TgN1N06hyb/pV/63FfO34nijZRMqgHk0TJ3gkl4Fbd+wZ73+ZtOd7jag6hMmzO9HSrBc6Vdn591nhkAg==", + "license": "MIT", "funding": { "type": "opencollective", "url": "https://opencollective.com/mui-org" } }, "node_modules/@mui/icons-material": { - "version": "5.16.4", - "resolved": "https://registry.npmjs.org/@mui/icons-material/-/icons-material-5.16.4.tgz", - "integrity": "sha512-j9/CWctv6TH6Dou2uR2EH7UOgu79CW/YcozxCYVLJ7l03pCsiOlJ5sBArnWJxJ+nGkFwyL/1d1k8JEPMDR125A==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@mui/icons-material/-/icons-material-7.0.2.tgz", + "integrity": "sha512-Bo57PFLOqXOqPNrXjd8AhzH5s6TCsNUQbvnQ0VKZ8D+lIlteqKnrk/O1luMJUc/BXONK7BfIdTdc7qOnXYbMdw==", + "license": "MIT", "dependencies": { - "@babel/runtime": "^7.23.9" + "@babel/runtime": "^7.27.0" }, "engines": { - "node": ">=12.0.0" + "node": ">=14.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/mui-org" }, "peerDependencies": { - "@mui/material": "^5.0.0", - "@types/react": "^17.0.0 || ^18.0.0", - "react": "^17.0.0 || ^18.0.0" + "@mui/material": "^7.0.2", + "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0", + "react": "^17.0.0 || ^18.0.0 || ^19.0.0" }, "peerDependenciesMeta": { "@types/react": { @@ -3789,20 +3681,20 @@ } }, "node_modules/@mui/lab": { - "version": "5.0.0-alpha.173", - "resolved": "https://registry.npmjs.org/@mui/lab/-/lab-5.0.0-alpha.173.tgz", - "integrity": "sha512-Gt5zopIWwxDgGy/MXcp6GueD84xFFugFai4hYiXY0zowJpTVnIrTQCQXV004Q7rejJ7aaCntX9hpPJqCrioshA==", + "version": "7.0.0-beta.11", + "resolved": "https://registry.npmjs.org/@mui/lab/-/lab-7.0.0-beta.11.tgz", + "integrity": "sha512-VJDEUgiRsjo8V2xDvBEE9Cfs1cSlwzp9UFmD3KzIg6emFMqz9BfYh+9cFI4iQWaoz3Agm3q6bVKlhlX6xw6sVQ==", + "license": "MIT", "dependencies": { - "@babel/runtime": "^7.23.9", - "@mui/base": "5.0.0-beta.40", - "@mui/system": "^5.16.5", - "@mui/types": "^7.2.15", - "@mui/utils": "^5.16.5", - "clsx": "^2.1.0", + "@babel/runtime": "^7.27.0", + "@mui/system": "^7.0.2", + "@mui/types": "^7.4.1", + "@mui/utils": "^7.0.2", + "clsx": "^2.1.1", "prop-types": "^15.8.1" }, "engines": { - "node": ">=12.0.0" + "node": ">=14.0.0" }, "funding": { "type": "opencollective", @@ -3811,10 +3703,11 @@ "peerDependencies": { "@emotion/react": "^11.5.0", "@emotion/styled": "^11.3.0", - "@mui/material": ">=5.15.0", - "@types/react": "^17.0.0 || ^18.0.0", - "react": "^17.0.0 || ^18.0.0", - "react-dom": "^17.0.0 || ^18.0.0" + "@mui/material": "^7.0.2", + "@mui/material-pigment-css": "^7.0.2", + "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0", + "react": "^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0" }, "peerDependenciesMeta": { "@emotion/react": { @@ -3823,31 +3716,35 @@ "@emotion/styled": { "optional": true }, + "@mui/material-pigment-css": { + "optional": true + }, "@types/react": { "optional": true } } }, "node_modules/@mui/material": { - "version": "5.16.7", - "resolved": "https://registry.npmjs.org/@mui/material/-/material-5.16.7.tgz", - "integrity": "sha512-cwwVQxBhK60OIOqZOVLFt55t01zmarKJiJUWbk0+8s/Ix5IaUzAShqlJchxsIQ4mSrWqgcKCCXKtIlG5H+/Jmg==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@mui/material/-/material-7.0.2.tgz", + "integrity": "sha512-rjJlJ13+3LdLfobRplkXbjIFEIkn6LgpetgU/Cs3Xd8qINCCQK9qXQIjjQ6P0FXFTPFzEVMj0VgBR1mN+FhOcA==", + "license": "MIT", "dependencies": { - "@babel/runtime": "^7.23.9", - "@mui/core-downloads-tracker": "^5.16.7", - "@mui/system": "^5.16.7", - "@mui/types": "^7.2.15", - "@mui/utils": "^5.16.6", + "@babel/runtime": "^7.27.0", + "@mui/core-downloads-tracker": "^7.0.2", + "@mui/system": "^7.0.2", + "@mui/types": "^7.4.1", + "@mui/utils": "^7.0.2", "@popperjs/core": "^2.11.8", - "@types/react-transition-group": "^4.4.10", - "clsx": "^2.1.0", + "@types/react-transition-group": "^4.4.12", + "clsx": "^2.1.1", "csstype": "^3.1.3", "prop-types": "^15.8.1", - "react-is": "^18.3.1", + "react-is": "^19.1.0", "react-transition-group": "^4.4.5" }, "engines": { - "node": ">=12.0.0" + "node": ">=14.0.0" }, "funding": { "type": "opencollective", @@ -3856,9 +3753,10 @@ "peerDependencies": { "@emotion/react": "^11.5.0", "@emotion/styled": "^11.3.0", - "@types/react": "^17.0.0 || ^18.0.0", - "react": "^17.0.0 || ^18.0.0", - "react-dom": "^17.0.0 || ^18.0.0" + "@mui/material-pigment-css": "^7.0.2", + "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0", + "react": "^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0" }, "peerDependenciesMeta": { "@emotion/react": { @@ -3867,35 +3765,40 @@ "@emotion/styled": { "optional": true }, + "@mui/material-pigment-css": { + "optional": true + }, "@types/react": { "optional": true } } }, "node_modules/@mui/material/node_modules/react-is": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==" + "version": "19.1.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-19.1.0.tgz", + "integrity": "sha512-Oe56aUPnkHyyDxxkvqtd7KkdQP5uIUfHxd5XTb3wE9d/kRnZLmKbDB0GWk919tdQ+mxxPtG6EAs6RMT6i1qtHg==", + "license": "MIT" }, "node_modules/@mui/private-theming": { - "version": "5.16.6", - "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-5.16.6.tgz", - "integrity": "sha512-rAk+Rh8Clg7Cd7shZhyt2HGTTE5wYKNSJ5sspf28Fqm/PZ69Er9o6KX25g03/FG2dfpg5GCwZh/xOojiTfm3hw==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-7.0.2.tgz", + "integrity": "sha512-6lt8heDC9wN8YaRqEdhqnm0cFCv08AMf4IlttFvOVn7ZdKd81PNpD/rEtPGLLwQAFyyKSxBG4/2XCgpbcdNKiA==", + "license": "MIT", "dependencies": { - "@babel/runtime": "^7.23.9", - "@mui/utils": "^5.16.6", + "@babel/runtime": "^7.27.0", + "@mui/utils": "^7.0.2", "prop-types": "^15.8.1" }, "engines": { - "node": ">=12.0.0" + "node": ">=14.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/mui-org" }, "peerDependencies": { - "@types/react": "^17.0.0 || ^18.0.0", - "react": "^17.0.0 || ^18.0.0" + "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0", + "react": "^17.0.0 || ^18.0.0 || ^19.0.0" }, "peerDependenciesMeta": { "@types/react": { @@ -3904,17 +3807,20 @@ } }, "node_modules/@mui/styled-engine": { - "version": "5.16.6", - "resolved": "https://registry.npmjs.org/@mui/styled-engine/-/styled-engine-5.16.6.tgz", - "integrity": "sha512-zaThmS67ZmtHSWToTiHslbI8jwrmITcN93LQaR2lKArbvS7Z3iLkwRoiikNWutx9MBs8Q6okKvbZq1RQYB3v7g==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@mui/styled-engine/-/styled-engine-7.0.2.tgz", + "integrity": "sha512-11Bt4YdHGlh7sB8P75S9mRCUxTlgv7HGbr0UKz6m6Z9KLeiw1Bm9y/t3iqLLVMvSHYB6zL8X8X+LmfTE++gyBw==", + "license": "MIT", "dependencies": { - "@babel/runtime": "^7.23.9", - "@emotion/cache": "^11.11.0", + "@babel/runtime": "^7.27.0", + "@emotion/cache": "^11.13.5", + "@emotion/serialize": "^1.3.3", + "@emotion/sheet": "^1.4.0", "csstype": "^3.1.3", "prop-types": "^15.8.1" }, "engines": { - "node": ">=12.0.0" + "node": ">=14.0.0" }, "funding": { "type": "opencollective", @@ -3923,7 +3829,7 @@ "peerDependencies": { "@emotion/react": "^11.4.1", "@emotion/styled": "^11.3.0", - "react": "^17.0.0 || ^18.0.0" + "react": "^17.0.0 || ^18.0.0 || ^19.0.0" }, "peerDependenciesMeta": { "@emotion/react": { @@ -3935,21 +3841,22 @@ } }, "node_modules/@mui/system": { - "version": "5.16.7", - "resolved": "https://registry.npmjs.org/@mui/system/-/system-5.16.7.tgz", - "integrity": "sha512-Jncvs/r/d/itkxh7O7opOunTqbbSSzMTHzZkNLM+FjAOg+cYAZHrPDlYe1ZGKUYORwwb2XexlWnpZp0kZ4AHuA==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@mui/system/-/system-7.0.2.tgz", + "integrity": "sha512-yFUraAWYWuKIISPPEVPSQ1NLeqmTT4qiQ+ktmyS8LO/KwHxB+NNVOacEZaIofh5x1NxY8rzphvU5X2heRZ/RDA==", + "license": "MIT", "dependencies": { - "@babel/runtime": "^7.23.9", - "@mui/private-theming": "^5.16.6", - "@mui/styled-engine": "^5.16.6", - "@mui/types": "^7.2.15", - "@mui/utils": "^5.16.6", - "clsx": "^2.1.0", + "@babel/runtime": "^7.27.0", + "@mui/private-theming": "^7.0.2", + "@mui/styled-engine": "^7.0.2", + "@mui/types": "^7.4.1", + "@mui/utils": "^7.0.2", + "clsx": "^2.1.1", "csstype": "^3.1.3", "prop-types": "^15.8.1" }, "engines": { - "node": ">=12.0.0" + "node": ">=14.0.0" }, "funding": { "type": "opencollective", @@ -3958,8 +3865,8 @@ "peerDependencies": { "@emotion/react": "^11.5.0", "@emotion/styled": "^11.3.0", - "@types/react": "^17.0.0 || ^18.0.0", - "react": "^17.0.0 || ^18.0.0" + "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0", + "react": "^17.0.0 || ^18.0.0 || ^19.0.0" }, "peerDependenciesMeta": { "@emotion/react": { @@ -3974,11 +3881,15 @@ } }, "node_modules/@mui/types": { - "version": "7.2.15", - "resolved": "https://registry.npmjs.org/@mui/types/-/types-7.2.15.tgz", - "integrity": "sha512-nbo7yPhtKJkdf9kcVOF8JZHPZTmqXjJ/tI0bdWgHg5tp9AnIN4Y7f7wm9T+0SyGYJk76+GYZ8Q5XaTYAsUHN0Q==", + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/@mui/types/-/types-7.4.1.tgz", + "integrity": "sha512-gUL8IIAI52CRXP/MixT1tJKt3SI6tVv4U/9soFsTtAsHzaJQptZ42ffdHZV3niX1ei0aUgMvOxBBN0KYqdG39g==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.27.0" + }, "peerDependencies": { - "@types/react": "^17.0.0 || ^18.0.0" + "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0" }, "peerDependenciesMeta": { "@types/react": { @@ -3987,27 +3898,28 @@ } }, "node_modules/@mui/utils": { - "version": "5.16.6", - "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.16.6.tgz", - "integrity": "sha512-tWiQqlhxAt3KENNiSRL+DIn9H5xNVK6Jjf70x3PnfQPz1MPBdh7yyIcAyVBT9xiw7hP3SomRhPR7hzBMBCjqEA==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-7.0.2.tgz", + "integrity": "sha512-72gcuQjPzhj/MLmPHLCgZjy2VjOH4KniR/4qRtXTTXIEwbkgcN+Y5W/rC90rWtMmZbjt9svZev/z+QHUI4j74w==", + "license": "MIT", "dependencies": { - "@babel/runtime": "^7.23.9", - "@mui/types": "^7.2.15", - "@types/prop-types": "^15.7.12", + "@babel/runtime": "^7.27.0", + "@mui/types": "^7.4.1", + "@types/prop-types": "^15.7.14", "clsx": "^2.1.1", "prop-types": "^15.8.1", - "react-is": "^18.3.1" + "react-is": "^19.1.0" }, "engines": { - "node": ">=12.0.0" + "node": ">=14.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/mui-org" }, "peerDependencies": { - "@types/react": "^17.0.0 || ^18.0.0", - "react": "^17.0.0 || ^18.0.0" + "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0", + "react": "^17.0.0 || ^18.0.0 || ^19.0.0" }, "peerDependenciesMeta": { "@types/react": { @@ -4016,9 +3928,10 @@ } }, "node_modules/@mui/utils/node_modules/react-is": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==" + "version": "19.1.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-19.1.0.tgz", + "integrity": "sha512-Oe56aUPnkHyyDxxkvqtd7KkdQP5uIUfHxd5XTb3wE9d/kRnZLmKbDB0GWk919tdQ+mxxPtG6EAs6RMT6i1qtHg==", + "license": "MIT" }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", @@ -4098,29 +4011,6 @@ "url": "https://opencollective.com/popperjs" } }, - "node_modules/@reduxjs/toolkit": { - "version": "2.2.7", - "resolved": "https://registry.npmjs.org/@reduxjs/toolkit/-/toolkit-2.2.7.tgz", - "integrity": "sha512-faI3cZbSdFb8yv9dhDTmGwclW0vk0z5o1cia+kf7gCbaCwHI5e+7tP57mJUv22pNcNbeA62GSrPpfrUfdXcQ6g==", - "dependencies": { - "immer": "^10.0.3", - "redux": "^5.0.1", - "redux-thunk": "^3.1.0", - "reselect": "^5.1.0" - }, - "peerDependencies": { - "react": "^16.9.0 || ^17.0.0 || ^18", - "react-redux": "^7.2.1 || ^8.1.3 || ^9.0.0" - }, - "peerDependenciesMeta": { - "react": { - "optional": true - }, - "react-redux": { - "optional": true - } - } - }, "node_modules/@remirror/core-constants": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@remirror/core-constants/-/core-constants-3.0.0.tgz", @@ -4640,34 +4530,36 @@ } }, "node_modules/@tanstack/react-virtual": { - "version": "3.10.8", - "resolved": "https://registry.npmjs.org/@tanstack/react-virtual/-/react-virtual-3.10.8.tgz", - "integrity": "sha512-VbzbVGSsZlQktyLrP5nxE+vE1ZR+U0NFAWPbJLoG2+DKPwd2D7dVICTVIIaYlJqX1ZCEnYDbaOpmMwbsyhBoIA==", + "version": "3.13.6", + "resolved": "https://registry.npmjs.org/@tanstack/react-virtual/-/react-virtual-3.13.6.tgz", + "integrity": "sha512-WT7nWs8ximoQ0CDx/ngoFP7HbQF9Q2wQe4nh2NB+u2486eX3nZRE40P9g6ccCVq7ZfTSH5gFOuCoVH5DLNS/aA==", + "license": "MIT", "dependencies": { - "@tanstack/virtual-core": "3.10.8" + "@tanstack/virtual-core": "3.13.6" }, "funding": { "type": "github", "url": "https://github.com/sponsors/tannerlinsley" }, "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "node_modules/@tanstack/virtual-core": { - "version": "3.10.8", - "resolved": "https://registry.npmjs.org/@tanstack/virtual-core/-/virtual-core-3.10.8.tgz", - "integrity": "sha512-PBu00mtt95jbKFi6Llk9aik8bnR3tR/oQP1o3TSi+iG//+Q2RTIzCEgKkHG8BB86kxMNW6O8wku+Lmi+QFR6jA==", + "version": "3.13.6", + "resolved": "https://registry.npmjs.org/@tanstack/virtual-core/-/virtual-core-3.13.6.tgz", + "integrity": "sha512-cnQUeWnhNP8tJ4WsGcYiX24Gjkc9ALstLbHcBj1t3E7EimN6n6kHH+DPV4PpDnuw00NApQp+ViojMj1GRdwYQg==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/tannerlinsley" } }, "node_modules/@testing-library/dom": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-10.3.0.tgz", - "integrity": "sha512-pT/TYB2+IyMYkkB6lqpkzD7VFbsR0JBJtflK3cS68sCNWxmOhWwRm1XvVHlseNEorsNcxkYsb4sRDV3aNIpttg==", + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-10.4.0.tgz", + "integrity": "sha512-pemlzrSESWbdAloYml3bAJMEfNh1Z7EduzqPKprCH5S341frlpYnUEW0H72dLxa6IsYr+mPno20GiSm+h9dEdQ==", "license": "MIT", "dependencies": { "@babel/code-frame": "^7.10.4", @@ -4904,9 +4796,9 @@ } }, "node_modules/@testing-library/react": { - "version": "16.0.0", - "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-16.0.0.tgz", - "integrity": "sha512-guuxUKRWQ+FgNX0h0NS0FIq3Q3uLtWVpBzcLOggmfMoUpgBnzBzvLLd4fbm6yS8ydJd94cIfY4yP9qUQjM2KwQ==", + "version": "16.3.0", + "resolved": "https://registry.npmjs.org/@testing-library/react/-/react-16.3.0.tgz", + "integrity": "sha512-kFSyxiEDwv1WLl2fgsq6pPBbw5aWKrsY2/noi1Id0TK0UParSF62oFQFGHXIyaG4pp2tEub/Zlel+fjjZILDsw==", "dev": true, "license": "MIT", "dependencies": { @@ -4917,10 +4809,10 @@ }, "peerDependencies": { "@testing-library/dom": "^10.0.0", - "@types/react": "^18.0.0", - "@types/react-dom": "^18.0.0", - "react": "^18.0.0", - "react-dom": "^18.0.0" + "@types/react": "^18.0.0 || ^19.0.0", + "@types/react-dom": "^18.0.0 || ^19.0.0", + "react": "^18.0.0 || ^19.0.0", + "react-dom": "^18.0.0 || ^19.0.0" }, "peerDependenciesMeta": { "@types/react": { @@ -4932,9 +4824,9 @@ } }, "node_modules/@testing-library/user-event": { - "version": "14.5.2", - "resolved": "https://registry.npmjs.org/@testing-library/user-event/-/user-event-14.5.2.tgz", - "integrity": "sha512-YAh82Wh4TIrxYLmfGcixwD18oIjyC1pFQC2Y01F2lzV2HTMiYrI0nze0FD0ocB//CKS/7jIUgae+adPqxK5yCQ==", + "version": "14.6.1", + "resolved": "https://registry.npmjs.org/@testing-library/user-event/-/user-event-14.6.1.tgz", + "integrity": "sha512-vq7fv0rnt+QTXgPxr5Hjc210p6YKq2kmdziLgnsZGgLJ9e6VAShx1pACLuRjd/AS/sr7phAR58OIIpf0LlmQNw==", "license": "MIT", "engines": { "node": ">=12", @@ -4945,9 +4837,10 @@ } }, "node_modules/@tiptap/core": { - "version": "2.9.1", - "resolved": "https://registry.npmjs.org/@tiptap/core/-/core-2.9.1.tgz", - "integrity": "sha512-tifnLL/ARzQ6/FGEJjVwj9UT3v+pENdWHdk9x6F3X0mB1y0SeCjV21wpFLYESzwNdBPAj8NMp8Behv7dBnhIfw==", + "version": "2.11.7", + "resolved": "https://registry.npmjs.org/@tiptap/core/-/core-2.11.7.tgz", + "integrity": "sha512-zN+NFFxLsxNEL8Qioc+DL6b8+Tt2bmRbXH22Gk6F6nD30x83eaUSFlSv3wqvgyCq3I1i1NO394So+Agmayx6rQ==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" @@ -4957,33 +4850,36 @@ } }, "node_modules/@tiptap/extension-blockquote": { - "version": "2.5.9", - "resolved": "https://registry.npmjs.org/@tiptap/extension-blockquote/-/extension-blockquote-2.5.9.tgz", - "integrity": "sha512-LhGyigmd/v1OjYPeoVK8UvFHbH6ffh175ZuNvseZY4PsBd7kZhrSUiuMG8xYdNX8FxamsxAzr2YpsYnOzu3W7A==", + "version": "2.11.7", + "resolved": "https://registry.npmjs.org/@tiptap/extension-blockquote/-/extension-blockquote-2.11.7.tgz", + "integrity": "sha512-liD8kWowl3CcYCG9JQlVx1eSNc/aHlt6JpVsuWvzq6J8APWX693i3+zFqyK2eCDn0k+vW62muhSBe3u09hA3Zw==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.9" + "@tiptap/core": "^2.7.0" } }, "node_modules/@tiptap/extension-bold": { - "version": "2.5.9", - "resolved": "https://registry.npmjs.org/@tiptap/extension-bold/-/extension-bold-2.5.9.tgz", - "integrity": "sha512-XUJdzFb31t0+bwiRquJf0btBpqOB3axQNHTKM9XADuL4S+Z6OBPj0I5rYINeElw/Q7muvdWrHWHh/ovNJA1/5A==", + "version": "2.11.7", + "resolved": "https://registry.npmjs.org/@tiptap/extension-bold/-/extension-bold-2.11.7.tgz", + "integrity": "sha512-VTR3JlldBixXbjpLTFme/Bxf1xeUgZZY3LTlt5JDlCW3CxO7k05CIa+kEZ8LXpog5annytZDUVtWqxrNjmsuHQ==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.9" + "@tiptap/core": "^2.7.0" } }, "node_modules/@tiptap/extension-bubble-menu": { - "version": "2.5.9", - "resolved": "https://registry.npmjs.org/@tiptap/extension-bubble-menu/-/extension-bubble-menu-2.5.9.tgz", - "integrity": "sha512-NddZ8Qn5dgPPa1W4yk0jdhF4tDBh0FwzBpbnDu2Xz/0TUHrA36ugB2CvR5xS1we4zUKckgpVqOqgdelrmqqFVg==", + "version": "2.11.7", + "resolved": "https://registry.npmjs.org/@tiptap/extension-bubble-menu/-/extension-bubble-menu-2.11.7.tgz", + "integrity": "sha512-0vYqSUSSap3kk3/VT4tFE1/6StX70I3/NKQ4J68ZSFgkgyB3ZVlYv7/dY3AkEukjsEp3yN7m8Gw8ei2eEwyzwg==", + "license": "MIT", "dependencies": { "tippy.js": "^6.3.7" }, @@ -4992,89 +4888,96 @@ "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.9", - "@tiptap/pm": "^2.5.9" + "@tiptap/core": "^2.7.0", + "@tiptap/pm": "^2.7.0" } }, "node_modules/@tiptap/extension-bullet-list": { - "version": "2.5.9", - "resolved": "https://registry.npmjs.org/@tiptap/extension-bullet-list/-/extension-bullet-list-2.5.9.tgz", - "integrity": "sha512-hJTv1x4omFgaID4LMRT5tOZb/VKmi8Kc6jsf4JNq4Grxd2sANmr9qpmKtBZvviK+XD5PpTXHvL+1c8C1SQtuHQ==", + "version": "2.11.7", + "resolved": "https://registry.npmjs.org/@tiptap/extension-bullet-list/-/extension-bullet-list-2.11.7.tgz", + "integrity": "sha512-WbPogE2/Q3e3/QYgbT1Sj4KQUfGAJNc5pvb7GrUbvRQsAh7HhtuO8hqdDwH8dEdD/cNUehgt17TO7u8qV6qeBw==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.9" + "@tiptap/core": "^2.7.0" } }, "node_modules/@tiptap/extension-code": { - "version": "2.5.9", - "resolved": "https://registry.npmjs.org/@tiptap/extension-code/-/extension-code-2.5.9.tgz", - "integrity": "sha512-Q1PL3DUXiEe5eYUwOug1haRjSaB0doAKwx7KFVI+kSGbDwCV6BdkKAeYf3us/O2pMP9D0im8RWX4dbSnatgwBA==", + "version": "2.11.7", + "resolved": "https://registry.npmjs.org/@tiptap/extension-code/-/extension-code-2.11.7.tgz", + "integrity": "sha512-VpPO1Uy/eF4hYOpohS/yMOcE1C07xmMj0/D989D9aS1x95jWwUVrSkwC+PlWMUBx9PbY2NRsg1ZDwVvlNKZ6yQ==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.9" + "@tiptap/core": "^2.7.0" } }, "node_modules/@tiptap/extension-code-block": { - "version": "2.5.9", - "resolved": "https://registry.npmjs.org/@tiptap/extension-code-block/-/extension-code-block-2.5.9.tgz", - "integrity": "sha512-+MUwp0VFFv2aFiZ/qN6q10vfIc6VhLoFFpfuETX10eIRks0Xuj2nGiqCDj7ca0/M44bRg2VvW8+tg/ZEHFNl9g==", + "version": "2.11.7", + "resolved": "https://registry.npmjs.org/@tiptap/extension-code-block/-/extension-code-block-2.11.7.tgz", + "integrity": "sha512-To/y/2H04VWqiANy53aXjV7S6fA86c2759RsH1hTIe57jA1KyE7I5tlAofljOLZK/covkGmPeBddSPHGJbz++Q==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.9", - "@tiptap/pm": "^2.5.9" + "@tiptap/core": "^2.7.0", + "@tiptap/pm": "^2.7.0" } }, "node_modules/@tiptap/extension-color": { - "version": "2.5.9", - "resolved": "https://registry.npmjs.org/@tiptap/extension-color/-/extension-color-2.5.9.tgz", - "integrity": "sha512-VUGCT9iqD/Ni9arLIxkCbykAElRMFyew7uk2kbbNvttzdwzmZkbslEgCiaEZQTqKr8w4wjuQL14YOtXc6iwEww==", + "version": "2.11.7", + "resolved": "https://registry.npmjs.org/@tiptap/extension-color/-/extension-color-2.11.7.tgz", + "integrity": "sha512-2CWb0Qnh8Crf9OwnnWB+M1QJtWrbn6IMSwuOzk+tSzdWSazjN8h6XAZVemr0qMdAA/SyUigzorStiPxN6o3/vQ==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.9", - "@tiptap/extension-text-style": "^2.5.9" + "@tiptap/core": "^2.7.0", + "@tiptap/extension-text-style": "^2.7.0" } }, "node_modules/@tiptap/extension-document": { - "version": "2.5.9", - "resolved": "https://registry.npmjs.org/@tiptap/extension-document/-/extension-document-2.5.9.tgz", - "integrity": "sha512-VdNZYDyCzC3W430UdeRXR9IZzPeODSbi5Xz/JEdV93THVp8AC9CrZR7/qjqdBTgbTB54VP8Yr6bKfCoIAF0BeQ==", + "version": "2.11.7", + "resolved": "https://registry.npmjs.org/@tiptap/extension-document/-/extension-document-2.11.7.tgz", + "integrity": "sha512-95ouJXPjdAm9+VBRgFo4lhDoMcHovyl/awORDI8gyEn0Rdglt+ZRZYoySFzbVzer9h0cre+QdIwr9AIzFFbfdA==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.9" + "@tiptap/core": "^2.7.0" } }, "node_modules/@tiptap/extension-dropcursor": { - "version": "2.5.9", - "resolved": "https://registry.npmjs.org/@tiptap/extension-dropcursor/-/extension-dropcursor-2.5.9.tgz", - "integrity": "sha512-nEOb37UryG6bsU9JAs/HojE6Jg43LupNTAMISbnuB1CPAeAqNsFMwORd9eEPkyEwnQT7MkhsMOSJM44GoPGIFA==", + "version": "2.11.7", + "resolved": "https://registry.npmjs.org/@tiptap/extension-dropcursor/-/extension-dropcursor-2.11.7.tgz", + "integrity": "sha512-63mL+nxQILizsr5NbmgDeOjFEWi34BLt7evwL6UUZEVM15K8V1G8pD9Y0kCXrZYpHWz0tqFRXdrhDz0Ppu8oVw==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.9", - "@tiptap/pm": "^2.5.9" + "@tiptap/core": "^2.7.0", + "@tiptap/pm": "^2.7.0" } }, "node_modules/@tiptap/extension-floating-menu": { - "version": "2.5.9", - "resolved": "https://registry.npmjs.org/@tiptap/extension-floating-menu/-/extension-floating-menu-2.5.9.tgz", - "integrity": "sha512-MWJIQQT6e5MgqHny8neeH2Dx926nVPF7sv4p84nX4E0dnkRbEYUP8mCsWYhSUvxxIif6e+yY+4654f2Q9qTx1w==", + "version": "2.11.7", + "resolved": "https://registry.npmjs.org/@tiptap/extension-floating-menu/-/extension-floating-menu-2.11.7.tgz", + "integrity": "sha512-DG54WoUu2vxHRVzKZiR5I5RMOYj45IlxQMkBAx1wjS0ch41W8DUYEeipvMMjCeKtEI+emz03xYUcOAP9LRmg+w==", + "license": "MIT", "dependencies": { "tippy.js": "^6.3.7" }, @@ -5083,125 +4986,135 @@ "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.9", - "@tiptap/pm": "^2.5.9" + "@tiptap/core": "^2.7.0", + "@tiptap/pm": "^2.7.0" } }, "node_modules/@tiptap/extension-gapcursor": { - "version": "2.5.9", - "resolved": "https://registry.npmjs.org/@tiptap/extension-gapcursor/-/extension-gapcursor-2.5.9.tgz", - "integrity": "sha512-yW7V2ebezsa7mWEDWCg4A1ZGsmSV5bEHKse9wzHCDkb7TutSVhLZxGo72U6hNN9PnAksv+FJQk03NuZNYvNyRQ==", + "version": "2.11.7", + "resolved": "https://registry.npmjs.org/@tiptap/extension-gapcursor/-/extension-gapcursor-2.11.7.tgz", + "integrity": "sha512-EceesmPG7FyjXZ8EgeJPUov9G1mAf2AwdypxBNH275g6xd5dmU/KvjoFZjmQ0X1ve7mS+wNupVlGxAEUYoveew==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.9", - "@tiptap/pm": "^2.5.9" + "@tiptap/core": "^2.7.0", + "@tiptap/pm": "^2.7.0" } }, "node_modules/@tiptap/extension-hard-break": { - "version": "2.5.9", - "resolved": "https://registry.npmjs.org/@tiptap/extension-hard-break/-/extension-hard-break-2.5.9.tgz", - "integrity": "sha512-8hQ63SgZRG4BqHOeSfeaowG2eMr2beced018pOGbpHbE3XSYoISkMVuFz4Z8UEVR3W9dTbKo4wxNufSTducocQ==", + "version": "2.11.7", + "resolved": "https://registry.npmjs.org/@tiptap/extension-hard-break/-/extension-hard-break-2.11.7.tgz", + "integrity": "sha512-zTkZSA6q+F5sLOdCkiC2+RqJQN0zdsJqvFIOVFL/IDVOnq6PZO5THzwRRLvOSnJJl3edRQCl/hUgS0L5sTInGQ==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.9" + "@tiptap/core": "^2.7.0" } }, "node_modules/@tiptap/extension-heading": { - "version": "2.5.9", - "resolved": "https://registry.npmjs.org/@tiptap/extension-heading/-/extension-heading-2.5.9.tgz", - "integrity": "sha512-HHowAlGUbFn1qvmY02ydM7qiPPMTGhAJn2A46enDRjNHW5UoqeMfkMpTEYaioOexyguRFSfDT3gpK68IHkQORQ==", + "version": "2.11.7", + "resolved": "https://registry.npmjs.org/@tiptap/extension-heading/-/extension-heading-2.11.7.tgz", + "integrity": "sha512-8kWh7y4Rd2fwxfWOhFFWncHdkDkMC1Z60yzIZWjIu72+6yQxvo8w3yeb7LI7jER4kffbMmadgcfhCHC/fkObBA==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.9" + "@tiptap/core": "^2.7.0" } }, "node_modules/@tiptap/extension-highlight": { - "version": "2.6.6", - "resolved": "https://registry.npmjs.org/@tiptap/extension-highlight/-/extension-highlight-2.6.6.tgz", - "integrity": "sha512-Z02AYWm1AJAfhmfT4fGCI3YitijF4uNu+eiuq7OxhCiVf9IYaq8xlH2YMxa09QvMUo70ovklxk97+vQUUHeqfQ==", + "version": "2.11.7", + "resolved": "https://registry.npmjs.org/@tiptap/extension-highlight/-/extension-highlight-2.11.7.tgz", + "integrity": "sha512-c/NH4kIpNOWCUQv8RkFNDyOcgt+2pYFpDf0QBJmzhAuv4BIeS2bDmDtuNS7VgoWRZH+xxCNXfvm2BG+kjtipEg==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.6.6" + "@tiptap/core": "^2.7.0" } }, "node_modules/@tiptap/extension-history": { - "version": "2.5.9", - "resolved": "https://registry.npmjs.org/@tiptap/extension-history/-/extension-history-2.5.9.tgz", - "integrity": "sha512-hGPtJgoZSwnVVqi/xipC2ET/9X2G2UI/Y+M3IYV1ZlM0tCYsv4spNi3uXlZqnXRwYcBXLk5u6e/dmsy5QFbL8g==", + "version": "2.11.7", + "resolved": "https://registry.npmjs.org/@tiptap/extension-history/-/extension-history-2.11.7.tgz", + "integrity": "sha512-Cu5x3aS13I040QSRoLdd+w09G4OCVfU+azpUqxufZxeNs9BIJC+0jowPLeOxKDh6D5GGT2A8sQtxc6a/ssbs8g==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.9", - "@tiptap/pm": "^2.5.9" + "@tiptap/core": "^2.7.0", + "@tiptap/pm": "^2.7.0" } }, "node_modules/@tiptap/extension-horizontal-rule": { - "version": "2.5.9", - "resolved": "https://registry.npmjs.org/@tiptap/extension-horizontal-rule/-/extension-horizontal-rule-2.5.9.tgz", - "integrity": "sha512-/ES5NdxCndBmZAgIXSpCJH8YzENcpxR0S8w34coSWyv+iW0Sq7rW/mksQw8ZIVsj8a7ntpoY5OoRFpSlqcvyGw==", + "version": "2.11.7", + "resolved": "https://registry.npmjs.org/@tiptap/extension-horizontal-rule/-/extension-horizontal-rule-2.11.7.tgz", + "integrity": "sha512-uVmQwD2dzZ5xwmvUlciy0ItxOdOfQjH6VLmu80zyJf8Yu7mvwP8JyxoXUX0vd1xHpwAhgQ9/ozjIWYGIw79DPQ==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.9", - "@tiptap/pm": "^2.5.9" + "@tiptap/core": "^2.7.0", + "@tiptap/pm": "^2.7.0" } }, "node_modules/@tiptap/extension-image": { - "version": "2.6.6", - "resolved": "https://registry.npmjs.org/@tiptap/extension-image/-/extension-image-2.6.6.tgz", - "integrity": "sha512-dwJKvoqsr72B4tcTH8hXhfBJzUMs/jXUEE9MnfzYnSXf+CYALLjF8r/IkGYbxce62GP/bMDoj8BgpF8saeHtqA==", + "version": "2.11.7", + "resolved": "https://registry.npmjs.org/@tiptap/extension-image/-/extension-image-2.11.7.tgz", + "integrity": "sha512-YvCmTDB7Oo+A56tR4S/gcNaYpqU4DDlSQcRp5IQvmQV5EekSe0lnEazGDoqOCwsit9qQhj4MPQJhKrnaWrJUrg==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.6.6" + "@tiptap/core": "^2.7.0" } }, "node_modules/@tiptap/extension-italic": { - "version": "2.5.9", - "resolved": "https://registry.npmjs.org/@tiptap/extension-italic/-/extension-italic-2.5.9.tgz", - "integrity": "sha512-Bw+P139L4cy+B56zpUiRjP8BZSaAUl3JFMnr/FO+FG55QhCxFMXIc6XrC3vslNy5ef3B3zv4gCttS3ee8ByMiw==", + "version": "2.11.7", + "resolved": "https://registry.npmjs.org/@tiptap/extension-italic/-/extension-italic-2.11.7.tgz", + "integrity": "sha512-r985bkQfG0HMpmCU0X0p/Xe7U1qgRm2mxvcp6iPCuts2FqxaCoyfNZ8YnMsgVK1mRhM7+CQ5SEg2NOmQNtHvPw==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.9" + "@tiptap/core": "^2.7.0" } }, "node_modules/@tiptap/extension-list-item": { - "version": "2.5.9", - "resolved": "https://registry.npmjs.org/@tiptap/extension-list-item/-/extension-list-item-2.5.9.tgz", - "integrity": "sha512-d9Eo+vBz74SMxP0r25aqiErV256C+lGz+VWMjOoqJa6xWLM1keYy12JtGQWJi8UDVZrDskJKCHq81A0uLt27WA==", + "version": "2.11.7", + "resolved": "https://registry.npmjs.org/@tiptap/extension-list-item/-/extension-list-item-2.11.7.tgz", + "integrity": "sha512-6ikh7Y+qAbkSuIHXPIINqfzmWs5uIGrylihdZ9adaIyvrN1KSnWIqrZIk/NcZTg5YFIJlXrnGSRSjb/QM3WUhw==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.9" + "@tiptap/core": "^2.7.0" } }, "node_modules/@tiptap/extension-mention": { - "version": "2.9.1", - "resolved": "https://registry.npmjs.org/@tiptap/extension-mention/-/extension-mention-2.9.1.tgz", - "integrity": "sha512-2IzunpivdNtDNdtAXwRiQbNhTm87zrbkhz1cCE+2y9pWiX1QLXyx0HQq/DIAjxp6v7y4sIh+5UTUTFlH7vD9wQ==", + "version": "2.11.7", + "resolved": "https://registry.npmjs.org/@tiptap/extension-mention/-/extension-mention-2.11.7.tgz", + "integrity": "sha512-Q/fkceDOug4VjiqrCRLzBnOL9Oj+XugWwDgwfucJJMBOJxZ3++3eZGZ54dri/xK39A4ZD+xuMBF7PrJIy+Z5dw==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" @@ -5213,113 +5126,121 @@ } }, "node_modules/@tiptap/extension-ordered-list": { - "version": "2.5.9", - "resolved": "https://registry.npmjs.org/@tiptap/extension-ordered-list/-/extension-ordered-list-2.5.9.tgz", - "integrity": "sha512-9MsWpvVvzILuEOd/GdroF7RI7uDuE1M6at9rzsaVGvCPVHZBvu1XR3MSVK5OdiJbbJuPGttlzEFLaN/rQdCGFg==", + "version": "2.11.7", + "resolved": "https://registry.npmjs.org/@tiptap/extension-ordered-list/-/extension-ordered-list-2.11.7.tgz", + "integrity": "sha512-bLGCHDMB0vbJk7uu8bRg8vES3GsvxkX7Cgjgm/6xysHFbK98y0asDtNxkW1VvuRreNGz4tyB6vkcVCfrxl4jKw==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.9" + "@tiptap/core": "^2.7.0" } }, "node_modules/@tiptap/extension-paragraph": { - "version": "2.5.9", - "resolved": "https://registry.npmjs.org/@tiptap/extension-paragraph/-/extension-paragraph-2.5.9.tgz", - "integrity": "sha512-HDXGiHTJ/V85dbDMjcFj4XfqyTQZqry6V21ucMzgBZYX60X3gIn7VpQTQnnRjvULSgtfOASSJP6BELc5TyiK0w==", + "version": "2.11.7", + "resolved": "https://registry.npmjs.org/@tiptap/extension-paragraph/-/extension-paragraph-2.11.7.tgz", + "integrity": "sha512-Pl3B4q6DJqTvvAdraqZaNP9Hh0UWEHL5nNdxhaRNuhKaUo7lq8wbDSIxIW3lvV0lyCs0NfyunkUvSm1CXb6d4Q==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.9" + "@tiptap/core": "^2.7.0" } }, "node_modules/@tiptap/extension-placeholder": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/@tiptap/extension-placeholder/-/extension-placeholder-2.6.2.tgz", - "integrity": "sha512-Aou6lH456j5mpry36jyAdZzINxFx6fjqvmapmmORJKV+9J889P7RN7laRRsosWHez0Oxg4KuWL3FuDexx6ZJOQ==", + "version": "2.11.7", + "resolved": "https://registry.npmjs.org/@tiptap/extension-placeholder/-/extension-placeholder-2.11.7.tgz", + "integrity": "sha512-/06zXV4HIjYoiaUq1fVJo/RcU8pHbzx21evOpeG/foCfNpMI4xLU/vnxdUi6/SQqpZMY0eFutDqod1InkSOqsg==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.6.2", - "@tiptap/pm": "^2.6.2" + "@tiptap/core": "^2.7.0", + "@tiptap/pm": "^2.7.0" } }, "node_modules/@tiptap/extension-strike": { - "version": "2.5.9", - "resolved": "https://registry.npmjs.org/@tiptap/extension-strike/-/extension-strike-2.5.9.tgz", - "integrity": "sha512-QezkOZpczpl09S8lp5JL7sRkwREoPY16Y/lTvBcFKm3TZbVzYZZ/KwS0zpwK9HXTfXr8os4L9AGjQf0tHonX+w==", + "version": "2.11.7", + "resolved": "https://registry.npmjs.org/@tiptap/extension-strike/-/extension-strike-2.11.7.tgz", + "integrity": "sha512-D6GYiW9F24bvAY7XMOARNZbC8YGPzdzWdXd8VOOJABhf4ynMi/oW4NNiko+kZ67jn3EGaKoz32VMJzNQgYi1HA==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.9" + "@tiptap/core": "^2.7.0" } }, "node_modules/@tiptap/extension-text": { - "version": "2.5.9", - "resolved": "https://registry.npmjs.org/@tiptap/extension-text/-/extension-text-2.5.9.tgz", - "integrity": "sha512-W0pfiQUPsMkwaV5Y/wKW4cFsyXAIkyOFt7uN5u6LrZ/iW9KZ/IsDODPJDikWp0aeQnXzT9NNQULTpCjbHzzS6g==", + "version": "2.11.7", + "resolved": "https://registry.npmjs.org/@tiptap/extension-text/-/extension-text-2.11.7.tgz", + "integrity": "sha512-wObCn8qZkIFnXTLvBP+X8KgaEvTap/FJ/i4hBMfHBCKPGDx99KiJU6VIbDXG8d5ZcFZE0tOetK1pP5oI7qgMlQ==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.9" + "@tiptap/core": "^2.7.0" } }, "node_modules/@tiptap/extension-text-style": { - "version": "2.5.9", - "resolved": "https://registry.npmjs.org/@tiptap/extension-text-style/-/extension-text-style-2.5.9.tgz", - "integrity": "sha512-1pNnl/a5EdY7g3IeFomm0B6eiTvAFOBeJGswoYxogzHmkWbLFhXFdgZ6qz7+k985w4qscsG1GpvtOW3IrJ9J6g==", + "version": "2.11.7", + "resolved": "https://registry.npmjs.org/@tiptap/extension-text-style/-/extension-text-style-2.11.7.tgz", + "integrity": "sha512-LHO6DBg/9SkCQFdWlVfw9nolUmw+Cid94WkTY+7IwrpyG2+ZGQxnKpCJCKyeaFNbDoYAtvu0vuTsSXeCkgShcA==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.9" + "@tiptap/core": "^2.7.0" } }, "node_modules/@tiptap/extension-underline": { - "version": "2.6.6", - "resolved": "https://registry.npmjs.org/@tiptap/extension-underline/-/extension-underline-2.6.6.tgz", - "integrity": "sha512-3A4HqsDM/AFb2VaeWACpGexjgI257kz0yU4jNV8uyydDR2KhqeinuEnoSoOmx9T3pL006TWfPg4vaQYPO3qvrQ==", + "version": "2.11.7", + "resolved": "https://registry.npmjs.org/@tiptap/extension-underline/-/extension-underline-2.11.7.tgz", + "integrity": "sha512-NtoQw6PGijOAtXC6G+0Aq0/Z5wwEjPhNHs8nsjXogfWIgaj/aI4/zfBnA06eI3WT+emMYQTl0fTc4CUPnLVU8g==", + "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.6.6" + "@tiptap/core": "^2.7.0" } }, "node_modules/@tiptap/pm": { - "version": "2.9.1", - "resolved": "https://registry.npmjs.org/@tiptap/pm/-/pm-2.9.1.tgz", - "integrity": "sha512-mvV86fr7kEuDYEApQ2uMPCKL2uagUE0BsXiyyz3KOkY1zifyVm1fzdkscb24Qy1GmLzWAIIihA+3UHNRgYdOlQ==", + "version": "2.11.7", + "resolved": "https://registry.npmjs.org/@tiptap/pm/-/pm-2.11.7.tgz", + "integrity": "sha512-7gEEfz2Q6bYKXM07vzLUD0vqXFhC5geWRA6LCozTiLdVFDdHWiBrvb2rtkL5T7mfLq03zc1QhH7rI3F6VntOEA==", + "license": "MIT", "dependencies": { "prosemirror-changeset": "^2.2.1", "prosemirror-collab": "^1.3.1", - "prosemirror-commands": "^1.6.0", + "prosemirror-commands": "^1.6.2", "prosemirror-dropcursor": "^1.8.1", "prosemirror-gapcursor": "^1.3.2", "prosemirror-history": "^1.4.1", "prosemirror-inputrules": "^1.4.0", "prosemirror-keymap": "^1.2.2", - "prosemirror-markdown": "^1.13.0", + "prosemirror-markdown": "^1.13.1", "prosemirror-menu": "^1.2.4", - "prosemirror-model": "^1.22.3", + "prosemirror-model": "^1.23.0", "prosemirror-schema-basic": "^1.2.3", "prosemirror-schema-list": "^1.4.1", "prosemirror-state": "^1.4.3", - "prosemirror-tables": "^1.4.0", + "prosemirror-tables": "^1.6.4", "prosemirror-trailing-node": "^3.0.0", - "prosemirror-transform": "^1.10.0", - "prosemirror-view": "^1.34.3" + "prosemirror-transform": "^1.10.2", + "prosemirror-view": "^1.37.0" }, "funding": { "type": "github", @@ -5327,50 +5248,55 @@ } }, "node_modules/@tiptap/react": { - "version": "2.5.9", - "resolved": "https://registry.npmjs.org/@tiptap/react/-/react-2.5.9.tgz", - "integrity": "sha512-NZYAslIb79oxIOFHx9T9ey5oX0aJ1uRbtT2vvrvvyRaO6fKWgAwMYN92bOu5/f2oUVGUp6l7wkYZGdjz/XP5bA==", + "version": "2.11.7", + "resolved": "https://registry.npmjs.org/@tiptap/react/-/react-2.11.7.tgz", + "integrity": "sha512-gQZEUkAoPsBptnB4T2gAtiUxswjVGhfsM9vOElQco+b11DYmy110T2Zuhg+2YGvB/CG3RoWJx34808P0FX1ijA==", + "license": "MIT", "dependencies": { - "@tiptap/extension-bubble-menu": "^2.5.9", - "@tiptap/extension-floating-menu": "^2.5.9", + "@tiptap/extension-bubble-menu": "^2.11.7", + "@tiptap/extension-floating-menu": "^2.11.7", "@types/use-sync-external-store": "^0.0.6", - "use-sync-external-store": "^1.2.2" + "fast-deep-equal": "^3", + "use-sync-external-store": "^1" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.9", - "@tiptap/pm": "^2.5.9", - "react": "^17.0.0 || ^18.0.0", - "react-dom": "^17.0.0 || ^18.0.0" + "@tiptap/core": "^2.7.0", + "@tiptap/pm": "^2.7.0", + "react": "^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0" } }, "node_modules/@tiptap/starter-kit": { - "version": "2.5.9", - "resolved": "https://registry.npmjs.org/@tiptap/starter-kit/-/starter-kit-2.5.9.tgz", - "integrity": "sha512-nZ4V+vRayomjxUsajFMHv1iJ5SiSaEA65LAXze/CzyZXGMXfL2OLzY7wJoaVJ4BgwINuO0dOSAtpNDN6jI+6mQ==", + "version": "2.11.7", + "resolved": "https://registry.npmjs.org/@tiptap/starter-kit/-/starter-kit-2.11.7.tgz", + "integrity": "sha512-K+q51KwNU/l0kqRuV5e1824yOLVftj6kGplGQLvJG56P7Rb2dPbM/JeaDbxQhnHT/KDGamG0s0Po0M3pPY163A==", + "license": "MIT", "dependencies": { - "@tiptap/core": "^2.5.9", - "@tiptap/extension-blockquote": "^2.5.9", - "@tiptap/extension-bold": "^2.5.9", - "@tiptap/extension-bullet-list": "^2.5.9", - "@tiptap/extension-code": "^2.5.9", - "@tiptap/extension-code-block": "^2.5.9", - "@tiptap/extension-document": "^2.5.9", - "@tiptap/extension-dropcursor": "^2.5.9", - "@tiptap/extension-gapcursor": "^2.5.9", - "@tiptap/extension-hard-break": "^2.5.9", - "@tiptap/extension-heading": "^2.5.9", - "@tiptap/extension-history": "^2.5.9", - "@tiptap/extension-horizontal-rule": "^2.5.9", - "@tiptap/extension-italic": "^2.5.9", - "@tiptap/extension-list-item": "^2.5.9", - "@tiptap/extension-ordered-list": "^2.5.9", - "@tiptap/extension-paragraph": "^2.5.9", - "@tiptap/extension-strike": "^2.5.9", - "@tiptap/extension-text": "^2.5.9" + "@tiptap/core": "^2.11.7", + "@tiptap/extension-blockquote": "^2.11.7", + "@tiptap/extension-bold": "^2.11.7", + "@tiptap/extension-bullet-list": "^2.11.7", + "@tiptap/extension-code": "^2.11.7", + "@tiptap/extension-code-block": "^2.11.7", + "@tiptap/extension-document": "^2.11.7", + "@tiptap/extension-dropcursor": "^2.11.7", + "@tiptap/extension-gapcursor": "^2.11.7", + "@tiptap/extension-hard-break": "^2.11.7", + "@tiptap/extension-heading": "^2.11.7", + "@tiptap/extension-history": "^2.11.7", + "@tiptap/extension-horizontal-rule": "^2.11.7", + "@tiptap/extension-italic": "^2.11.7", + "@tiptap/extension-list-item": "^2.11.7", + "@tiptap/extension-ordered-list": "^2.11.7", + "@tiptap/extension-paragraph": "^2.11.7", + "@tiptap/extension-strike": "^2.11.7", + "@tiptap/extension-text": "^2.11.7", + "@tiptap/extension-text-style": "^2.11.7", + "@tiptap/pm": "^2.11.7" }, "funding": { "type": "github", @@ -5541,12 +5467,34 @@ "@types/node": "*" } }, + "node_modules/@types/linkify-it": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-5.0.0.tgz", + "integrity": "sha512-sVDA58zAw4eWAffKOaQH5/5j3XeayukzDk+ewSsnv3p4yJEZHCCzMDiZM8e0OUrRvmpGZ85jf4yDHkHsgBNr9Q==", + "license": "MIT" + }, "node_modules/@types/lodash": { "version": "4.17.7", "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.7.tgz", "integrity": "sha512-8wTvZawATi/lsmNu10/j2hk1KEP0IvjubqPE3cu1Xz7xfXXt5oCq3SNUz4fMIP4XGF9Ky+Ue2tBA3hcS7LSBlA==", "dev": true }, + "node_modules/@types/markdown-it": { + "version": "14.1.2", + "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-14.1.2.tgz", + "integrity": "sha512-promo4eFwuiW+TfGxhi+0x3czqTYJkG8qB17ZUJiVF10Xm7NLVRSLUsfRTU/6h1e24VvRnXCx+hG7li58lkzog==", + "license": "MIT", + "dependencies": { + "@types/linkify-it": "^5", + "@types/mdurl": "^2" + } + }, + "node_modules/@types/mdurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-2.0.0.tgz", + "integrity": "sha512-RGdgjQUZba5p6QEFAVx2OGb8rQDL/cPRG7GiedRzMcJ1tYnUANBncjbSB1NRGwbvjcPeikRABz2nshyPk1bhWg==", + "license": "MIT" + }, "node_modules/@types/ms": { "version": "0.7.34", "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.34.tgz", @@ -5576,60 +5524,36 @@ } }, "node_modules/@types/prop-types": { - "version": "15.7.12", - "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.12.tgz", - "integrity": "sha512-5zvhXYtRNRluoE/jAp4GVsSduVUzNWKkOZrCDBWYtE7biZywwdC2AcEzg+cSMLFRfVgeAFqpfNabiPjxFddV1Q==" - }, - "node_modules/@types/quill": { - "version": "1.3.10", - "resolved": "https://registry.npmjs.org/@types/quill/-/quill-1.3.10.tgz", - "integrity": "sha512-IhW3fPW+bkt9MLNlycw8u8fWb7oO7W5URC9MfZYHBlA24rex9rs23D5DETChu1zvgVdc5ka64ICjJOgQMr6Shw==", - "dependencies": { - "parchment": "^1.1.2" - } + "version": "15.7.14", + "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.14.tgz", + "integrity": "sha512-gNMvNH49DJ7OJYv+KAKn0Xp45p8PLl6zo2YnvDIbTd4J6MER2BmWN49TG7n9LvkyihINxeKW8+3bfS2yDC9dzQ==", + "license": "MIT" }, "node_modules/@types/react": { - "version": "18.2.67", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.67.tgz", - "integrity": "sha512-vkIE2vTIMHQ/xL0rgmuoECBCkZFZeHr49HeWSc24AptMbNRo7pwSBvj73rlJJs9fGKj0koS+V7kQB1jHS0uCgw==", + "version": "19.1.2", + "resolved": "https://registry.npmjs.org/@types/react/-/react-19.1.2.tgz", + "integrity": "sha512-oxLPMytKchWGbnQM9O7D67uPa9paTNxO7jVoNMXgkkErULBPhPARCfkKL9ytcIJJRGjbsVwW4ugJzyFFvm/Tiw==", + "license": "MIT", "dependencies": { - "@types/prop-types": "*", - "@types/scheduler": "*", "csstype": "^3.0.2" } }, - "node_modules/@types/react-copy-to-clipboard": { - "version": "5.0.7", - "resolved": "https://registry.npmjs.org/@types/react-copy-to-clipboard/-/react-copy-to-clipboard-5.0.7.tgz", - "integrity": "sha512-Gft19D+as4M+9Whq1oglhmK49vqPhcLzk8WfvfLvaYMIPYanyfLy0+CwFucMJfdKoSFyySPmkkWn8/E6voQXjQ==", - "dev": true, - "dependencies": { - "@types/react": "*" - } - }, "node_modules/@types/react-dom": { - "version": "18.2.22", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.2.22.tgz", - "integrity": "sha512-fHkBXPeNtfvri6gdsMYyW+dW7RXFo6Ad09nLFK0VQWR7yGLai/Cyvyj696gbwYvBnhGtevUG9cET0pmUbMtoPQ==", + "version": "19.1.2", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.1.2.tgz", + "integrity": "sha512-XGJkWF41Qq305SKWEILa1O8vzhb3aOo3ogBlSmiqNko/WmRb6QIaweuZCXjKygVDXpzXb5wyxKTSOsmkuqj+Qw==", "dev": true, - "dependencies": { - "@types/react": "*" - } - }, - "node_modules/@types/react-infinite-scroller": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/@types/react-infinite-scroller/-/react-infinite-scroller-1.2.5.tgz", - "integrity": "sha512-fJU1jhMgoL6NJFrqTM0Ob7tnd2sQWGxe2ESwiU6FZWbJK/VO/Er5+AOhc+e2zbT0dk5pLygqctsulOLJ8xnSzw==", - "dev": true, - "dependencies": { - "@types/react": "*" + "license": "MIT", + "peerDependencies": { + "@types/react": "^19.0.0" } }, "node_modules/@types/react-transition-group": { - "version": "4.4.10", - "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.10.tgz", - "integrity": "sha512-hT/+s0VQs2ojCX823m60m5f0sL5idt9SO6Tj6Dg+rdphGPIeJbJ6CxvBYkgkGKrYeDjvIpKTR38UzmtHJOGW3Q==", - "dependencies": { + "version": "4.4.12", + "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.12.tgz", + "integrity": "sha512-8TV6R3h2j7a91c+1DXdJi3Syo69zzIZbz7Lg5tORM5LEJG7X/E6a1V3drRyBRZq7/utz7A+c4OgYLiLcYGHG6w==", + "license": "MIT", + "peerDependencies": { "@types/react": "*" } }, @@ -5656,11 +5580,6 @@ "@types/node": "*" } }, - "node_modules/@types/scheduler": { - "version": "0.16.8", - "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.8.tgz", - "integrity": "sha512-WZLiwShhwLRmeV6zH+GkbOFT6Z6VklCItrDioxUnv+u4Ll+8vKeFySoFyK/0ctcRpOmwAicELfmys1sDc/Rw+A==" - }, "node_modules/@types/semver": { "version": "7.5.8", "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", @@ -5675,7 +5594,8 @@ "node_modules/@types/stylis": { "version": "4.2.5", "resolved": "https://registry.npmjs.org/@types/stylis/-/stylis-4.2.5.tgz", - "integrity": "sha512-1Xve+NMN7FWjY14vLoY5tL3BVEQ/n42YLwaqJIPYhotZ9uBHt87VceMwWQpzmdEt2TNXIorIFG+YeCUUW7RInw==" + "integrity": "sha512-1Xve+NMN7FWjY14vLoY5tL3BVEQ/n42YLwaqJIPYhotZ9uBHt87VceMwWQpzmdEt2TNXIorIFG+YeCUUW7RInw==", + "license": "MIT" }, "node_modules/@types/trusted-types": { "version": "2.0.7", @@ -5892,6 +5812,418 @@ "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@uiw/color-convert": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@uiw/color-convert/-/color-convert-2.5.1.tgz", + "integrity": "sha512-p+P8Ho0Z1AbUprES0hcLEDAaXbGH92TmjckkRQZ5S7HcyQ+9ZXlSsDFILjFbYu/okVjx5VG59T57Dx84lv9AWA==", + "funding": { + "url": "https://jaywcjlove.github.io/#/sponsor" + }, + "peerDependencies": { + "@babel/runtime": ">=7.19.0" + } + }, + "node_modules/@uiw/react-color": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@uiw/react-color/-/react-color-2.5.1.tgz", + "integrity": "sha512-u6Kj7rdhsMOls2KItpHLkG8WTghDS2jYBucLeOLLJXJDs25TuEBI9d1o939og8cUJtTwBrowWFFU63a1kGsciA==", + "license": "MIT", + "dependencies": { + "@uiw/color-convert": "2.5.1", + "@uiw/react-color-alpha": "2.5.1", + "@uiw/react-color-block": "2.5.1", + "@uiw/react-color-chrome": "2.5.1", + "@uiw/react-color-circle": "2.5.1", + "@uiw/react-color-colorful": "2.5.1", + "@uiw/react-color-compact": "2.5.1", + "@uiw/react-color-editable-input": "2.5.1", + "@uiw/react-color-editable-input-hsla": "2.5.1", + "@uiw/react-color-editable-input-rgba": "2.5.1", + "@uiw/react-color-github": "2.5.1", + "@uiw/react-color-hue": "2.5.1", + "@uiw/react-color-material": "2.5.1", + "@uiw/react-color-name": "2.5.1", + "@uiw/react-color-saturation": "2.5.1", + "@uiw/react-color-shade-slider": "2.5.1", + "@uiw/react-color-sketch": "2.5.1", + "@uiw/react-color-slider": "2.5.1", + "@uiw/react-color-swatch": "2.5.1", + "@uiw/react-color-wheel": "2.5.1" + }, + "funding": { + "url": "https://jaywcjlove.github.io/#/sponsor" + }, + "peerDependencies": { + "@babel/runtime": ">=7.19.0", + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@uiw/react-color-alpha": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@uiw/react-color-alpha/-/react-color-alpha-2.5.1.tgz", + "integrity": "sha512-hPsIgsnuOQrqinXt3Gt+87fHudbUvvPW+TpvRY0HS9v4ptFu5UsCc/7DPTVKTaL+p+0oaA6eTbziLzPLRLzgsQ==", + "license": "MIT", + "dependencies": { + "@uiw/color-convert": "2.5.1", + "@uiw/react-drag-event-interactive": "2.5.1" + }, + "funding": { + "url": "https://jaywcjlove.github.io/#/sponsor" + }, + "peerDependencies": { + "@babel/runtime": ">=7.19.0", + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@uiw/react-color-block": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@uiw/react-color-block/-/react-color-block-2.5.1.tgz", + "integrity": "sha512-qvubiV0z0P3OxpNt6o1UQ3CVsjVBY1/n/oz6Gzzxx9YPqSClI04AtFjwOQxF7M17SYqXv+88y77gfEfPIqk5+A==", + "license": "MIT", + "dependencies": { + "@uiw/color-convert": "2.5.1", + "@uiw/react-color-editable-input": "2.5.1", + "@uiw/react-color-swatch": "2.5.1" + }, + "funding": { + "url": "https://jaywcjlove.github.io/#/sponsor" + }, + "peerDependencies": { + "@babel/runtime": ">=7.19.0", + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@uiw/react-color-chrome": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@uiw/react-color-chrome/-/react-color-chrome-2.5.1.tgz", + "integrity": "sha512-m/CyRaWgmkW5aQTQ8AZwyvopYm+bhvX06uS+ezQjXDYDtjLvq7RbM0JLLNIOyMXke964R58fhoX4G06ZWd8ycA==", + "license": "MIT", + "dependencies": { + "@uiw/color-convert": "2.5.1", + "@uiw/react-color-alpha": "2.5.1", + "@uiw/react-color-editable-input": "2.5.1", + "@uiw/react-color-editable-input-hsla": "2.5.1", + "@uiw/react-color-editable-input-rgba": "2.5.1", + "@uiw/react-color-github": "2.5.1", + "@uiw/react-color-hue": "2.5.1", + "@uiw/react-color-saturation": "2.5.1" + }, + "funding": { + "url": "https://jaywcjlove.github.io/#/sponsor" + }, + "peerDependencies": { + "@babel/runtime": ">=7.19.0", + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@uiw/react-color-circle": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@uiw/react-color-circle/-/react-color-circle-2.5.1.tgz", + "integrity": "sha512-+8zb/Ork1Q5f2bq0jN+GF7OyqY+2ZDYGrdZovN3EBZLMmERbg6TM2+1gTweeFsdiEM/gpteupJpwKpO1aBCocg==", + "license": "MIT", + "dependencies": { + "@uiw/color-convert": "2.5.1", + "@uiw/react-color-swatch": "2.5.1" + }, + "funding": { + "url": "https://jaywcjlove.github.io/#/sponsor" + }, + "peerDependencies": { + "@babel/runtime": ">=7.19.0", + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@uiw/react-color-colorful": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@uiw/react-color-colorful/-/react-color-colorful-2.5.1.tgz", + "integrity": "sha512-Y/8Y2Kman6IZQpgs4tPTGPuTNr3fJIJxf4f13jll6xuaOsVZeDq9q+DlMErggL+5ICtaBr8gG+w68nCiY+QqKg==", + "license": "MIT", + "dependencies": { + "@uiw/color-convert": "2.5.1", + "@uiw/react-color-alpha": "2.5.1", + "@uiw/react-color-hue": "2.5.1", + "@uiw/react-color-saturation": "2.5.1" + }, + "funding": { + "url": "https://jaywcjlove.github.io/#/sponsor" + }, + "peerDependencies": { + "@babel/runtime": ">=7.19.0", + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@uiw/react-color-compact": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@uiw/react-color-compact/-/react-color-compact-2.5.1.tgz", + "integrity": "sha512-5jHJcXEkjMwcghzCgSBU2rPMVjuuaJ7B6IxypNkafRQ4FkW/6bP9WpPkzcNXCZ/gPvSJ1OMQ+Y600mdO78qG5Q==", + "license": "MIT", + "dependencies": { + "@uiw/color-convert": "2.5.1", + "@uiw/react-color-editable-input": "2.5.1", + "@uiw/react-color-editable-input-rgba": "2.5.1", + "@uiw/react-color-swatch": "2.5.1" + }, + "funding": { + "url": "https://jaywcjlove.github.io/#/sponsor" + }, + "peerDependencies": { + "@babel/runtime": ">=7.19.0", + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@uiw/react-color-editable-input": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@uiw/react-color-editable-input/-/react-color-editable-input-2.5.1.tgz", + "integrity": "sha512-0kr5vQJGPln8LObXwfI2YLiHFz2DW3Atgi51JXlrZUyyaVujXRgMTAc1fz/1RQR6cU2A4bweFaCQljcTsv+Cdg==", + "license": "MIT", + "funding": { + "url": "https://jaywcjlove.github.io/#/sponsor" + }, + "peerDependencies": { + "@babel/runtime": ">=7.19.0", + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@uiw/react-color-editable-input-hsla": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@uiw/react-color-editable-input-hsla/-/react-color-editable-input-hsla-2.5.1.tgz", + "integrity": "sha512-gmnXB6JrYFAd8VN/EfNDJaTdkFHAnUxjzcsQjQyOEr046jDjWgEc/5o2uE1LwIvoJNg9Lo6LYsr37LnFWwsiLw==", + "license": "MIT", + "dependencies": { + "@uiw/color-convert": "2.5.1", + "@uiw/react-color-editable-input-rgba": "2.5.1" + }, + "funding": { + "url": "https://jaywcjlove.github.io/#/sponsor" + }, + "peerDependencies": { + "@babel/runtime": ">=7.19.0", + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@uiw/react-color-editable-input-rgba": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@uiw/react-color-editable-input-rgba/-/react-color-editable-input-rgba-2.5.1.tgz", + "integrity": "sha512-rk6OxL9lTdRI45aNe3GbUghvaELk4knkEf0gvF/mPHxoeE+nNphSrO5gHm3HhoDOgaplp81VP3q4gUwcdjBzvw==", + "license": "MIT", + "dependencies": { + "@uiw/color-convert": "2.5.1", + "@uiw/react-color-editable-input": "2.5.1" + }, + "funding": { + "url": "https://jaywcjlove.github.io/#/sponsor" + }, + "peerDependencies": { + "@babel/runtime": ">=7.19.0", + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@uiw/react-color-github": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@uiw/react-color-github/-/react-color-github-2.5.1.tgz", + "integrity": "sha512-t05rIy2ifReiVnjv3x+IVlJH7wvwtZugMeouDa/1Y7jIGZswO0zw3zMxz7qfHrzf5NVYWjmEF8QCj85ngv9brg==", + "license": "MIT", + "dependencies": { + "@uiw/color-convert": "2.5.1", + "@uiw/react-color-swatch": "2.5.1" + }, + "funding": { + "url": "https://jaywcjlove.github.io/#/sponsor" + }, + "peerDependencies": { + "@babel/runtime": ">=7.19.0", + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@uiw/react-color-hue": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@uiw/react-color-hue/-/react-color-hue-2.5.1.tgz", + "integrity": "sha512-o7mjZhm+U4gHxaBXFxjPINeE3jWfiZAl7RUFqwn4PDZC8wvhU5hEKgJUvcXzErYro0ZYrE1fC/wUHRpI+vcEBg==", + "license": "MIT", + "dependencies": { + "@uiw/color-convert": "2.5.1", + "@uiw/react-color-alpha": "2.5.1" + }, + "funding": { + "url": "https://jaywcjlove.github.io/#/sponsor" + }, + "peerDependencies": { + "@babel/runtime": ">=7.19.0", + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@uiw/react-color-material": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@uiw/react-color-material/-/react-color-material-2.5.1.tgz", + "integrity": "sha512-iPB4YfKVTNO1lSIQ16DMdDurDKvGTjv6Qwi/nq47yE3nnhB0YbOFwb/IZbWBS1sCTPx1an7dM2IZ+hYoYcjrXg==", + "license": "MIT", + "dependencies": { + "@uiw/color-convert": "2.5.1", + "@uiw/react-color-editable-input": "2.5.1", + "@uiw/react-color-editable-input-rgba": "2.5.1" + }, + "funding": { + "url": "https://jaywcjlove.github.io/#/sponsor" + }, + "peerDependencies": { + "@babel/runtime": ">=7.19.0", + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@uiw/react-color-name": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@uiw/react-color-name/-/react-color-name-2.5.1.tgz", + "integrity": "sha512-JFb6DFz9kF2jI42MS/vtXZu1XzIrzcSIOqCwVkYWCQnSxOM9h+vd4pv2Yi1oy7IPgaadXUDkrGQSAvEkXU593Q==", + "dependencies": { + "colors-named": "^1.0.1", + "colors-named-hex": "^1.0.1" + }, + "funding": { + "url": "https://jaywcjlove.github.io/#/sponsor" + }, + "peerDependencies": { + "@babel/runtime": ">=7.19.0" + } + }, + "node_modules/@uiw/react-color-saturation": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@uiw/react-color-saturation/-/react-color-saturation-2.5.1.tgz", + "integrity": "sha512-mQ6eGmn6dUXfScQrb5tP0TBGCpZWzrQuYOAiwK9u31IJaxFwD1NNAzkiienWe4MQkA5zmgz7Ol6FEdLN8K+vGw==", + "license": "MIT", + "dependencies": { + "@uiw/color-convert": "2.5.1", + "@uiw/react-drag-event-interactive": "2.5.1" + }, + "funding": { + "url": "https://jaywcjlove.github.io/#/sponsor" + }, + "peerDependencies": { + "@babel/runtime": ">=7.19.0", + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@uiw/react-color-shade-slider": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@uiw/react-color-shade-slider/-/react-color-shade-slider-2.5.1.tgz", + "integrity": "sha512-hrscAmqmy/Od/usUPETaEuvsNRhUGvNArl73d7HK6e6FjbRFPDBq40LkvjETe8BJMbxrBXTMo6dK7DO08lYq9g==", + "license": "MIT", + "dependencies": { + "@uiw/color-convert": "2.5.1", + "@uiw/react-color-alpha": "2.5.1" + }, + "funding": { + "url": "https://jaywcjlove.github.io/#/sponsor" + }, + "peerDependencies": { + "@babel/runtime": ">=7.19.0", + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@uiw/react-color-sketch": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@uiw/react-color-sketch/-/react-color-sketch-2.5.1.tgz", + "integrity": "sha512-eQgAnlSZvqoTt6frZa/j+tFdaIBEFneIdxEUfidD8hwvyu5OR/WLHnDy/4fYAxhehDp9Ej8eS3ZsCgPACBMOtA==", + "license": "MIT", + "dependencies": { + "@uiw/color-convert": "2.5.1", + "@uiw/react-color-alpha": "2.5.1", + "@uiw/react-color-editable-input": "2.5.1", + "@uiw/react-color-editable-input-rgba": "2.5.1", + "@uiw/react-color-hue": "2.5.1", + "@uiw/react-color-saturation": "2.5.1", + "@uiw/react-color-swatch": "2.5.1" + }, + "funding": { + "url": "https://jaywcjlove.github.io/#/sponsor" + }, + "peerDependencies": { + "@babel/runtime": ">=7.19.0", + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@uiw/react-color-slider": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@uiw/react-color-slider/-/react-color-slider-2.5.1.tgz", + "integrity": "sha512-2yluI0Akp6UMXTeAJ4CEjL8flhIFpn3xUPsFXbQmBSzMYJygleVFmwhMye8LSA2PCe3UdaqA2cWXxWsTL0FbIg==", + "license": "MIT", + "dependencies": { + "@uiw/color-convert": "2.5.1", + "@uiw/react-color-alpha": "2.5.1" + }, + "funding": { + "url": "https://jaywcjlove.github.io/#/sponsor" + }, + "peerDependencies": { + "@babel/runtime": ">=7.19.0", + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@uiw/react-color-swatch": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@uiw/react-color-swatch/-/react-color-swatch-2.5.1.tgz", + "integrity": "sha512-EQ7UEzxdohfsdpXmcEWNmK/uiznZovEKo6+j3OLrSU5pZGO7pxjR9sQMlscikvd8Mu1Mm3U0E6bJseo2acD4Lg==", + "license": "MIT", + "dependencies": { + "@uiw/color-convert": "2.5.1" + }, + "funding": { + "url": "https://jaywcjlove.github.io/#/sponsor" + }, + "peerDependencies": { + "@babel/runtime": ">=7.19.0", + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@uiw/react-color-wheel": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@uiw/react-color-wheel/-/react-color-wheel-2.5.1.tgz", + "integrity": "sha512-e3tDwDoC2T7zTapRRm/QxcOJ7IWJwNCoxZ/f97RL1Ib3gAN/k67H1bkR9TK7euRCUxGy031guxTgdKO9v19XFg==", + "license": "MIT", + "dependencies": { + "@uiw/color-convert": "2.5.1", + "@uiw/react-drag-event-interactive": "2.5.1" + }, + "funding": { + "url": "https://jaywcjlove.github.io/#/sponsor" + }, + "peerDependencies": { + "@babel/runtime": ">=7.19.0", + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, + "node_modules/@uiw/react-drag-event-interactive": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@uiw/react-drag-event-interactive/-/react-drag-event-interactive-2.5.1.tgz", + "integrity": "sha512-GNxhxk5L4O5Gpi20A/BG5sO0GNBNwtNWJidJsJu3pgHUBErN4rhqTDXXu3BQTz5C8yOG5D02Y6Zq/6yu6ckImw==", + "license": "MIT", + "funding": { + "url": "https://jaywcjlove.github.io/#/sponsor" + }, + "peerDependencies": { + "@babel/runtime": ">=7.19.0", + "react": ">=16.9.0", + "react-dom": ">=16.9.0" + } + }, "node_modules/@ungap/structured-clone": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", @@ -5918,14 +6250,14 @@ } }, "node_modules/@vitest/expect": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.6.0.tgz", - "integrity": "sha512-ixEvFVQjycy/oNgHjqsL6AZCDduC+tflRluaHIzKIsdbzkLn2U/iBnVeJwB6HsIjQBdfMR8Z0tRxKUsvFJEeWQ==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.6.1.tgz", + "integrity": "sha512-jXL+9+ZNIJKruofqXuuTClf44eSpcHlgj3CiuNihUF3Ioujtmc0zIa3UJOW5RjDK1YLBJZnWBlPuqhYycLioog==", "devOptional": true, "license": "MIT", "dependencies": { - "@vitest/spy": "1.6.0", - "@vitest/utils": "1.6.0", + "@vitest/spy": "1.6.1", + "@vitest/utils": "1.6.1", "chai": "^4.3.10" }, "funding": { @@ -5933,13 +6265,13 @@ } }, "node_modules/@vitest/runner": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.6.0.tgz", - "integrity": "sha512-P4xgwPjwesuBiHisAVz/LSSZtDjOTPYZVmNAnpHHSR6ONrf8eCJOFRvUwdHn30F5M1fxhqtl7QZQUk2dprIXAg==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.6.1.tgz", + "integrity": "sha512-3nSnYXkVkf3mXFfE7vVyPmi3Sazhb/2cfZGGs0JRzFsPFvAMBEcrweV1V1GsrstdXeKCTXlJbvnQwGWgEIHmOA==", "devOptional": true, "license": "MIT", "dependencies": { - "@vitest/utils": "1.6.0", + "@vitest/utils": "1.6.1", "p-limit": "^5.0.0", "pathe": "^1.1.1" }, @@ -5964,9 +6296,9 @@ } }, "node_modules/@vitest/runner/node_modules/yocto-queue": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.1.1.tgz", - "integrity": "sha512-b4JR1PFR10y1mKjhHY9LaGo6tmrgjit7hxVIeAmyMw3jegXR4dhYqLaQF5zMXZxY7tLpMyJeLjr1C4rLmkVe8g==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.2.1.tgz", + "integrity": "sha512-AyeEbWOu/TAXdxlV9wmGcR0+yh2j3vYPGOECcIj2S7MkrLyC7ne+oye2BKTItt0ii2PHk4cDy+95+LshzbXnGg==", "devOptional": true, "license": "MIT", "engines": { @@ -5977,9 +6309,9 @@ } }, "node_modules/@vitest/snapshot": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.6.0.tgz", - "integrity": "sha512-+Hx43f8Chus+DCmygqqfetcAZrDJwvTj0ymqjQq4CvmpKFSTVteEOBzCusu1x2tt4OJcvBflyHUE0DZSLgEMtQ==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.6.1.tgz", + "integrity": "sha512-WvidQuWAzU2p95u8GAKlRMqMyN1yOJkGHnx3M1PL9Raf7AQ1kwLKg04ADlCa3+OXUZE7BceOhVZiuWAbzCKcUQ==", "devOptional": true, "license": "MIT", "dependencies": { @@ -5992,9 +6324,9 @@ } }, "node_modules/@vitest/spy": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.6.0.tgz", - "integrity": "sha512-leUTap6B/cqi/bQkXUu6bQV5TZPx7pmMBKBQiI0rJA8c3pB56ZsaTbREnF7CJfmvAS4V2cXIBAh/3rVwrrCYgw==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.6.1.tgz", + "integrity": "sha512-MGcMmpGkZebsMZhbQKkAf9CX5zGvjkBTqf8Zx3ApYWXr3wG+QvEu2eXWfnIIWYSJExIp4V9FCKDEeygzkYrXMw==", "devOptional": true, "license": "MIT", "dependencies": { @@ -6005,9 +6337,9 @@ } }, "node_modules/@vitest/utils": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.6.0.tgz", - "integrity": "sha512-21cPiuGMoMZwiOHa2i4LXkMkMkCGzA+MVFV70jRwHo95dL4x/ts5GZhML1QWuy7yfp3WzK3lRvZi3JnXTYqrBw==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.6.1.tgz", + "integrity": "sha512-jOrrUvXM4Av9ZWiG1EajNto0u96kWAhJ1LmPmJhXXQx/32MecEKd10pOLYgS2BQx1TgkGhloPU1ArDW2vvaY6g==", "devOptional": true, "license": "MIT", "dependencies": { @@ -6631,9 +6963,10 @@ } }, "node_modules/axios": { - "version": "1.7.7", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz", - "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.8.2.tgz", + "integrity": "sha512-ls4GYBm5aig9vWx8AWDSGLpnpDQRtWAfrjU+EuytuODrFBkqesN2RkOQCBzrA1RQNHw1SmRMSDDDSwzNAYQ6Rg==", + "license": "MIT", "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.0", @@ -7255,6 +7588,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/camelize/-/camelize-1.0.1.tgz", "integrity": "sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==", + "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -7289,9 +7623,9 @@ } }, "node_modules/chai": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz", - "integrity": "sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.5.0.tgz", + "integrity": "sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw==", "devOptional": true, "license": "MIT", "dependencies": { @@ -7301,7 +7635,7 @@ "get-func-name": "^2.0.2", "loupe": "^2.3.6", "pathval": "^1.1.1", - "type-detect": "^4.0.8" + "type-detect": "^4.1.0" }, "engines": { "node": ">=4" @@ -7441,11 +7775,6 @@ "node": ">=8" } }, - "node_modules/classnames": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.5.1.tgz", - "integrity": "sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==" - }, "node_modules/clean-stack": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", @@ -7706,14 +8035,6 @@ "wrap-ansi": "^6.2.0" } }, - "node_modules/clone": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", - "integrity": "sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==", - "engines": { - "node": ">=0.8" - } - }, "node_modules/clone-response": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.3.tgz", @@ -7766,6 +8087,28 @@ "color-support": "bin.js" } }, + "node_modules/colors-named": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/colors-named/-/colors-named-1.0.2.tgz", + "integrity": "sha512-2ANq2r393PV9njYUD66UdfBcxR1slMqRA3QRTWgCx49JoCJ+kOhyfbQYxKJbPZQIhZUcNjVOs5AlyY1WwXec3w==", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://jaywcjlove.github.io/#/sponsor" + } + }, + "node_modules/colors-named-hex": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/colors-named-hex/-/colors-named-hex-1.0.2.tgz", + "integrity": "sha512-k6kq1e1pUCQvSVwIaGFq2l0LrkAPQZWyeuZn1Z8nOiYSEZiKoFj4qx690h2Kd34DFl9Me0gKS6MUwAMBJj8nuA==", + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://jaywcjlove.github.io/#/sponsor" + } + }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -7903,14 +8246,6 @@ "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==" }, - "node_modules/copy-to-clipboard": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/copy-to-clipboard/-/copy-to-clipboard-3.3.3.tgz", - "integrity": "sha512-2KV8NhB5JqC3ky0r9PMCAZKbUHSwtEo4CwCs0KXgruG43gX5PMqDEBbVU4OUzw2MuAWUfsuFmWvEKG5QRfSnJA==", - "dependencies": { - "toggle-selection": "^1.0.6" - } - }, "node_modules/cordova-plugin-android-permissions": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/cordova-plugin-android-permissions/-/cordova-plugin-android-permissions-1.1.5.tgz", @@ -8043,6 +8378,15 @@ "resolved": "https://registry.npmjs.org/cross-dirname/-/cross-dirname-0.1.0.tgz", "integrity": "sha512-+R08/oI0nl3vfPcqftZRpytksBXDzOUveBq/NBVx0sUp1axwzPQrKinNx5yd5sxPu8j1wIy8AfnVQ+5eFdha6Q==" }, + "node_modules/cross-fetch": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", + "integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==", + "license": "MIT", + "dependencies": { + "node-fetch": "^2.6.12" + } + }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -8068,6 +8412,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/css-color-keywords/-/css-color-keywords-1.0.0.tgz", "integrity": "sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==", + "license": "ISC", "engines": { "node": ">=4" } @@ -8076,6 +8421,7 @@ "version": "3.2.0", "resolved": "https://registry.npmjs.org/css-to-react-native/-/css-to-react-native-3.2.0.tgz", "integrity": "sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==", + "license": "MIT", "dependencies": { "camelize": "^1.0.0", "css-color-keywords": "^1.0.0", @@ -8262,25 +8608,6 @@ "node": ">=6" } }, - "node_modules/deep-equal": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.2.tgz", - "integrity": "sha512-5tdhKF6DbU7iIzrIOa1AOUt39ZRm13cmL1cGEh//aqR8x9+tNfbywRf0n5FD/18OKMdo7DNEtrX2t22ZAkI+eg==", - "dependencies": { - "is-arguments": "^1.1.1", - "is-date-object": "^1.0.5", - "is-regex": "^1.1.4", - "object-is": "^1.1.5", - "object-keys": "^1.1.1", - "regexp.prototype.flags": "^1.5.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", @@ -9660,11 +9987,6 @@ "node": ">=0.10.0" } }, - "node_modules/eventemitter3": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-2.0.3.tgz", - "integrity": "sha512-jLN68Dx5kyFHaePoXWPsCGW5qdyZQtLYHkxkg02/Mz6g0kYpDx4FyP6XfArhQdlOC4b8Mv+EMxPo/8La7Tzghg==" - }, "node_modules/events": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", @@ -9705,7 +10027,8 @@ "node_modules/extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true }, "node_modules/external-editor": { "version": "3.1.0", @@ -9780,11 +10103,6 @@ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" }, - "node_modules/fast-diff": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.1.2.tgz", - "integrity": "sha512-KaJUt+M9t1qaIteSvjc6P3RbMdXsNhK61GRftR6SNxqmhthcd9MGIi4T+o0jD8LUSpSnSKXE20nLtJ3fOHxQig==" - }, "node_modules/fast-glob": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", @@ -10560,11 +10878,6 @@ "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", "dev": true }, - "node_modules/hamt_plus": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/hamt_plus/-/hamt_plus-1.0.2.tgz", - "integrity": "sha512-t2JXKaehnMb9paaYA7J0BX8QQAY8lwfQ9Gjf4pg/mk4krt+cmwmU652HOoWonf+7+EQV97ARPMhhVgU1ra2GhA==" - }, "node_modules/has-bigints": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.1.0.tgz", @@ -10679,6 +10992,15 @@ "node": ">=18" } }, + "node_modules/html-parse-stringify": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/html-parse-stringify/-/html-parse-stringify-3.0.1.tgz", + "integrity": "sha512-KknJ50kTInJ7qIScF3jeaFRpMpE8/lfiTdzf/twXyPBLAGrLRTmkz3AdTnKeh40X8k9L2fdYwEp/42WGXIRGcg==", + "license": "MIT", + "dependencies": { + "void-elements": "3.1.0" + } + }, "node_modules/html-to-text": { "version": "9.0.5", "resolved": "https://registry.npmjs.org/html-to-text/-/html-to-text-9.0.5.tgz", @@ -10773,6 +11095,64 @@ "ms": "^2.0.0" } }, + "node_modules/i18next": { + "version": "25.0.1", + "resolved": "https://registry.npmjs.org/i18next/-/i18next-25.0.1.tgz", + "integrity": "sha512-8S8PyZbrymJZn3DaN70/34JYWNhsqrU6yA4MuzcygJBv+41dgNMocEA8h+kV1P7MCc1ll03lOTOIXE7mpNCicw==", + "funding": [ + { + "type": "individual", + "url": "https://locize.com" + }, + { + "type": "individual", + "url": "https://locize.com/i18next.html" + }, + { + "type": "individual", + "url": "https://www.i18next.com/how-to/faq#i18next-is-awesome.-how-can-i-support-the-project" + } + ], + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.26.10" + }, + "peerDependencies": { + "typescript": "^5" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/i18next-browser-languagedetector": { + "version": "8.0.5", + "resolved": "https://registry.npmjs.org/i18next-browser-languagedetector/-/i18next-browser-languagedetector-8.0.5.tgz", + "integrity": "sha512-OstebRKqKiQw8xEvQF5aRyUujsCatanj7Q9eo5iiH2gJpoXGZ7483ol3sVBwfqbobTQPNH1J+NAyJ1aCQoEC+w==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.23.2" + } + }, + "node_modules/i18next-http-backend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/i18next-http-backend/-/i18next-http-backend-3.0.2.tgz", + "integrity": "sha512-PdlvPnvIp4E1sYi46Ik4tBYh/v/NbYfFFgTjkwFl0is8A18s7/bx9aXqsrOax9WUbeNS6mD2oix7Z0yGGf6m5g==", + "license": "MIT", + "dependencies": { + "cross-fetch": "4.0.0" + } + }, + "node_modules/i18next-localstorage-backend": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/i18next-localstorage-backend/-/i18next-localstorage-backend-4.2.0.tgz", + "integrity": "sha512-vglEQF0AnLriX7dLA2drHnqAYzHxnLwWQzBDw8YxcIDjOvYZz5rvpal59Dq4In+IHNmGNM32YgF0TDjBT0fHmA==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.22.15" + } + }, "node_modules/iconv-corefoundation": { "version": "1.1.7", "resolved": "https://registry.npmjs.org/iconv-corefoundation/-/iconv-corefoundation-1.1.7.tgz", @@ -11054,21 +11434,6 @@ "url": "https://github.com/sponsors/wooorm" } }, - "node_modules/is-arguments": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", - "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", - "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-array-buffer": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.5.tgz", @@ -11748,6 +12113,27 @@ "node": ">=8" } }, + "node_modules/jotai": { + "version": "2.12.3", + "resolved": "https://registry.npmjs.org/jotai/-/jotai-2.12.3.tgz", + "integrity": "sha512-DpoddSkmPGXMFtdfnoIHfueFeGP643nqYUWC6REjUcME+PG2UkAtYnLbffRDw3OURI9ZUTcRWkRGLsOvxuWMCg==", + "license": "MIT", + "engines": { + "node": ">=12.20.0" + }, + "peerDependencies": { + "@types/react": ">=17.0.0", + "react": ">=17.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "react": { + "optional": true + } + } + }, "node_modules/jpeg-exif": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/jpeg-exif/-/jpeg-exif-1.1.4.tgz", @@ -12005,6 +12391,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.0.tgz", "integrity": "sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==", + "license": "MIT", "dependencies": { "uc.micro": "^2.0.0" } @@ -12286,13 +12673,13 @@ } }, "node_modules/magic-string": { - "version": "0.30.10", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.10.tgz", - "integrity": "sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==", + "version": "0.30.17", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.17.tgz", + "integrity": "sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==", "devOptional": true, "license": "MIT", "dependencies": { - "@jridgewell/sourcemap-codec": "^1.4.15" + "@jridgewell/sourcemap-codec": "^1.5.0" } }, "node_modules/make-fetch-happen": { @@ -12395,6 +12782,7 @@ "version": "14.1.0", "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.1.0.tgz", "integrity": "sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==", + "license": "MIT", "dependencies": { "argparse": "^2.0.1", "entities": "^4.4.0", @@ -12461,7 +12849,8 @@ "node_modules/mdurl": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz", - "integrity": "sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==" + "integrity": "sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==", + "license": "MIT" }, "node_modules/merge-stream": { "version": "2.0.0", @@ -12890,6 +13279,48 @@ "semver": "^7.3.5" } }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "license": "MIT", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/node-fetch/node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "license": "MIT" + }, + "node_modules/node-fetch/node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "license": "BSD-2-Clause" + }, + "node_modules/node-fetch/node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "license": "MIT", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "node_modules/node-gyp": { "version": "9.4.1", "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-9.4.1.tgz", @@ -15382,21 +15813,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/object-is": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.1.6.tgz", - "integrity": "sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q==", - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", @@ -15692,11 +16108,6 @@ "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==" }, - "node_modules/parchment": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/parchment/-/parchment-1.1.4.tgz", - "integrity": "sha512-J5FBQt/pM2inLzg4hEWmzQx/8h8D0CiDxaG3vyp9rKrQRSDgBlhjdP5jQGgosEajXPSQouXGHOmVdgo7QmJuOg==" - }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -15936,9 +16347,9 @@ } }, "node_modules/postcss": { - "version": "8.4.38", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz", - "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==", + "version": "8.4.49", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.49.tgz", + "integrity": "sha512-OCVPnIObs4N29kxTjzLfUryOkvZEq+pf8jTF0lg8E7uETuWHA+v7j3c/xJmiqpX450191LlmZfUKkXxkTry7nA==", "funding": [ { "type": "opencollective", @@ -15953,10 +16364,11 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "dependencies": { "nanoid": "^3.3.7", - "picocolors": "^1.0.0", - "source-map-js": "^1.2.0" + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" }, "engines": { "node": "^10 || ^12 || >=14" @@ -15965,7 +16377,8 @@ "node_modules/postcss-value-parser": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", - "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==" + "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", + "license": "MIT" }, "node_modules/postject": { "version": "1.0.0-alpha.6", @@ -15990,6 +16403,22 @@ "node": ">= 0.8.0" } }, + "node_modules/prettier": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.3.tgz", + "integrity": "sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw==", + "dev": true, + "license": "MIT", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/pretty-bytes": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-6.1.1.tgz", @@ -16144,13 +16573,14 @@ } }, "node_modules/prosemirror-commands": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/prosemirror-commands/-/prosemirror-commands-1.6.0.tgz", - "integrity": "sha512-xn1U/g36OqXn2tn5nGmvnnimAj/g1pUx2ypJJIe8WkVX83WyJVC5LTARaxZa2AtQRwntu9Jc5zXs9gL9svp/mg==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/prosemirror-commands/-/prosemirror-commands-1.7.1.tgz", + "integrity": "sha512-rT7qZnQtx5c0/y/KlYaGvtG411S97UaL6gdp6RIZ23DLHanMYLyfGBV5DtSnZdthQql7W+lEVbpSfwtO8T+L2w==", + "license": "MIT", "dependencies": { "prosemirror-model": "^1.0.0", "prosemirror-state": "^1.0.0", - "prosemirror-transform": "^1.0.0" + "prosemirror-transform": "^1.10.2" } }, "node_modules/prosemirror-dropcursor": { @@ -16204,12 +16634,14 @@ } }, "node_modules/prosemirror-markdown": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/prosemirror-markdown/-/prosemirror-markdown-1.13.0.tgz", - "integrity": "sha512-UziddX3ZYSYibgx8042hfGKmukq5Aljp2qoBiJRejD/8MH70siQNz5RB1TrdTPheqLMy4aCe4GYNF10/3lQS5g==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/prosemirror-markdown/-/prosemirror-markdown-1.13.2.tgz", + "integrity": "sha512-FPD9rHPdA9fqzNmIIDhhnYQ6WgNoSWX9StUZ8LEKapaXU9i6XgykaHKhp6XMyXlOWetmaFgGDS/nu/w9/vUc5g==", + "license": "MIT", "dependencies": { + "@types/markdown-it": "^14.0.0", "markdown-it": "^14.0.0", - "prosemirror-model": "^1.20.0" + "prosemirror-model": "^1.25.0" } }, "node_modules/prosemirror-menu": { @@ -16224,9 +16656,10 @@ } }, "node_modules/prosemirror-model": { - "version": "1.22.3", - "resolved": "https://registry.npmjs.org/prosemirror-model/-/prosemirror-model-1.22.3.tgz", - "integrity": "sha512-V4XCysitErI+i0rKFILGt/xClnFJaohe/wrrlT2NSZ+zk8ggQfDH4x2wNK7Gm0Hp4CIoWizvXFP7L9KMaCuI0Q==", + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/prosemirror-model/-/prosemirror-model-1.25.1.tgz", + "integrity": "sha512-AUvbm7qqmpZa5d9fPKMvH1Q5bqYQvAZWOGRvxsB6iFLyycvC9MwNemNVjHVrWgjaoxAfY8XVg7DbvQ/qxvI9Eg==", + "license": "MIT", "dependencies": { "orderedmap": "^2.0.0" } @@ -16260,15 +16693,16 @@ } }, "node_modules/prosemirror-tables": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/prosemirror-tables/-/prosemirror-tables-1.4.0.tgz", - "integrity": "sha512-fxryZZkQG12fSCNuZDrYx6Xvo2rLYZTbKLRd8rglOPgNJGMKIS8uvTt6gGC38m7UCu/ENnXIP9pEz5uDaPc+cA==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/prosemirror-tables/-/prosemirror-tables-1.7.1.tgz", + "integrity": "sha512-eRQ97Bf+i9Eby99QbyAiyov43iOKgWa7QCGly+lrDt7efZ1v8NWolhXiB43hSDGIXT1UXgbs4KJN3a06FGpr1Q==", + "license": "MIT", "dependencies": { - "prosemirror-keymap": "^1.1.2", - "prosemirror-model": "^1.8.1", - "prosemirror-state": "^1.3.1", - "prosemirror-transform": "^1.2.1", - "prosemirror-view": "^1.13.3" + "prosemirror-keymap": "^1.2.2", + "prosemirror-model": "^1.25.0", + "prosemirror-state": "^1.4.3", + "prosemirror-transform": "^1.10.3", + "prosemirror-view": "^1.39.1" } }, "node_modules/prosemirror-trailing-node": { @@ -16297,17 +16731,19 @@ } }, "node_modules/prosemirror-transform": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/prosemirror-transform/-/prosemirror-transform-1.10.2.tgz", - "integrity": "sha512-2iUq0wv2iRoJO/zj5mv8uDUriOHWzXRnOTVgCzSXnktS/2iQRa3UUQwVlkBlYZFtygw6Nh1+X4mGqoYBINn5KQ==", + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/prosemirror-transform/-/prosemirror-transform-1.10.4.tgz", + "integrity": "sha512-pwDy22nAnGqNR1feOQKHxoFkkUtepoFAd3r2hbEDsnf4wp57kKA36hXsB3njA9FtONBEwSDnDeCiJe+ItD+ykw==", + "license": "MIT", "dependencies": { "prosemirror-model": "^1.21.0" } }, "node_modules/prosemirror-view": { - "version": "1.36.0", - "resolved": "https://registry.npmjs.org/prosemirror-view/-/prosemirror-view-1.36.0.tgz", - "integrity": "sha512-U0GQd5yFvV5qUtT41X1zCQfbw14vkbbKwLlQXhdylEmgpYVHkefXYcC4HHwWOfZa3x6Y8wxDLUBv7dxN5XQ3nA==", + "version": "1.39.2", + "resolved": "https://registry.npmjs.org/prosemirror-view/-/prosemirror-view-1.39.2.tgz", + "integrity": "sha512-BmOkml0QWNob165gyUxXi5K5CVUgVPpqMEAAml/qzgKn9boLUWVPzQ6LtzXw8Cn1GtRQX4ELumPxqtLTDaAKtg==", + "license": "MIT", "dependencies": { "prosemirror-model": "^1.20.0", "prosemirror-state": "^1.0.0", @@ -16349,6 +16785,7 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz", "integrity": "sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==", + "license": "MIT", "engines": { "node": ">=6" } @@ -16398,42 +16835,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/quill": { - "version": "1.3.7", - "resolved": "https://registry.npmjs.org/quill/-/quill-1.3.7.tgz", - "integrity": "sha512-hG/DVzh/TiknWtE6QmWAF/pxoZKYxfe3J/d/+ShUWkDvvkZQVTPeVmUJVu1uE6DDooC4fWTiCLh84ul89oNz5g==", - "dependencies": { - "clone": "^2.1.1", - "deep-equal": "^1.0.1", - "eventemitter3": "^2.0.3", - "extend": "^3.0.2", - "parchment": "^1.1.4", - "quill-delta": "^3.6.2" - } - }, - "node_modules/quill-delta": { - "version": "3.6.3", - "resolved": "https://registry.npmjs.org/quill-delta/-/quill-delta-3.6.3.tgz", - "integrity": "sha512-wdIGBlcX13tCHOXGMVnnTVFtGRLoP0imqxM696fIPwIf5ODIYUHIvHbZcyvGlZFiFhK5XzDC2lpjbxRhnM05Tg==", - "dependencies": { - "deep-equal": "^1.0.1", - "extend": "^3.0.2", - "fast-diff": "1.1.2" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/quill-image-resize-module-react": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/quill-image-resize-module-react/-/quill-image-resize-module-react-3.0.0.tgz", - "integrity": "sha512-3jVChLoXh+fwEELx3OswOEEuF+1KU3r/B9RAqZ//s+d+UMduVZzUepU1g/XoxjKoBJvWD2lJwBIFBRUNb8ebCw==", - "dependencies": { - "lodash": "^4.17.4", - "quill": "^1.2.2", - "raw-loader": "^0.5.1" - } - }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -16442,34 +16843,15 @@ "safe-buffer": "^5.1.0" } }, - "node_modules/raw-loader": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/raw-loader/-/raw-loader-0.5.1.tgz", - "integrity": "sha512-sf7oGoLuaYAScB4VGr0tzetsYlS8EJH6qnTCfQ/WVEa89hALQ4RQfCKt5xCyPQKPDUbVUAIP1QsxAwfAjlDp7Q==" - }, "node_modules/react": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react/-/react-18.2.0.tgz", - "integrity": "sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==", - "dependencies": { - "loose-envify": "^1.1.0" - }, + "version": "19.1.0", + "resolved": "https://registry.npmjs.org/react/-/react-19.1.0.tgz", + "integrity": "sha512-FS+XFBNvn3GTAWq26joslQgWNoFu08F4kl0J4CgdNKADkdSGXQyTCnKteIAJy96Br6YbpEU1LSzV5dYtjMkMDg==", + "license": "MIT", "engines": { "node": ">=0.10.0" } }, - "node_modules/react-copy-to-clipboard": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/react-copy-to-clipboard/-/react-copy-to-clipboard-5.1.0.tgz", - "integrity": "sha512-k61RsNgAayIJNoy9yDsYzDe/yAZAzEbEgcz3DZMhF686LEyukcE1hzurxe85JandPUG+yTfGVFzuEw3xt8WP/A==", - "dependencies": { - "copy-to-clipboard": "^3.3.1", - "prop-types": "^15.8.1" - }, - "peerDependencies": { - "react": "^15.3.0 || 16 || 17 || 18" - } - }, "node_modules/react-countdown-circle-timer": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/react-countdown-circle-timer/-/react-countdown-circle-timer-3.2.1.tgz", @@ -16479,15 +16861,15 @@ } }, "node_modules/react-dom": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", - "integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==", + "version": "19.1.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.1.0.tgz", + "integrity": "sha512-Xs1hdnE+DyKgeHJeJznQmYMIBG3TKIHJJT95Q58nHLSrElKlGQqDTR2HQ9fx5CN/Gk6Vh/kupBTDLU11/nDk/g==", + "license": "MIT", "dependencies": { - "loose-envify": "^1.1.0", - "scheduler": "^0.23.0" + "scheduler": "^0.26.0" }, "peerDependencies": { - "react": "^18.2.0" + "react": "^19.1.0" } }, "node_modules/react-dropzone": { @@ -16516,24 +16898,36 @@ "react-dom": ">= 16.3" } }, - "node_modules/react-infinite-scroller": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/react-infinite-scroller/-/react-infinite-scroller-1.2.6.tgz", - "integrity": "sha512-mGdMyOD00YArJ1S1F3TVU9y4fGSfVVl6p5gh/Vt4u99CJOptfVu/q5V/Wlle72TMgYlBwIhbxK5wF0C/R33PXQ==", + "node_modules/react-i18next": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-15.4.1.tgz", + "integrity": "sha512-ahGab+IaSgZmNPYXdV1n+OYky95TGpFwnKRflX/16dY04DsYYKHtVLjeny7sBSCREEcoMbAgSkFiGLF5g5Oofw==", + "license": "MIT", "dependencies": { - "prop-types": "^15.5.8" + "@babel/runtime": "^7.25.0", + "html-parse-stringify": "^3.0.1" }, "peerDependencies": { - "react": "^0.14.9 || ^15.3.0 || ^16.0.0 || ^17.0.0 || ^18.0.0" + "i18next": ">= 23.2.3", + "react": ">= 16.8.0" + }, + "peerDependenciesMeta": { + "react-dom": { + "optional": true + }, + "react-native": { + "optional": true + } } }, "node_modules/react-intersection-observer": { - "version": "9.13.0", - "resolved": "https://registry.npmjs.org/react-intersection-observer/-/react-intersection-observer-9.13.0.tgz", - "integrity": "sha512-y0UvBfjDiXqC8h0EWccyaj4dVBWMxgEx0t5RGNzQsvkfvZwugnKwxpu70StY4ivzYuMajavwUDjH4LJyIki9Lw==", + "version": "9.16.0", + "resolved": "https://registry.npmjs.org/react-intersection-observer/-/react-intersection-observer-9.16.0.tgz", + "integrity": "sha512-w9nJSEp+DrW9KmQmeWHQyfaP6b03v+TdXynaoA964Wxt7mdR3An11z4NNCQgL4gKSK7y1ver2Fq+JKH6CWEzUA==", + "license": "MIT", "peerDependencies": { - "react": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", - "react-dom": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + "react": "^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0" }, "peerDependenciesMeta": { "react-dom": { @@ -16547,14 +16941,15 @@ "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, "node_modules/react-json-view-lite": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/react-json-view-lite/-/react-json-view-lite-2.0.1.tgz", - "integrity": "sha512-yElNMSzL7UJ9rMDQIbTiBemXbvfAoqpxM/0IQd3nr52CLLBC0HxOSKcta/bayct2QCq7ZVzLzI8CGfuf387hHw==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/react-json-view-lite/-/react-json-view-lite-2.4.1.tgz", + "integrity": "sha512-fwFYknRIBxjbFm0kBDrzgBy1xa5tDg2LyXXBepC5f1b+MY3BUClMCsvanMPn089JbV1Eg3nZcrp0VCuH43aXnA==", + "license": "MIT", "engines": { "node": ">=18" }, "peerDependencies": { - "react": "^18.0.0" + "react": "^18.0.0 || ^19.0.0" } }, "node_modules/react-lifecycles-compat": { @@ -16595,47 +16990,6 @@ "react": "*" } }, - "node_modules/react-quill": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/react-quill/-/react-quill-2.0.0.tgz", - "integrity": "sha512-4qQtv1FtCfLgoD3PXAur5RyxuUbPXQGOHgTlFie3jtxp43mXDtzCKaOgQ3mLyZfi1PUlyjycfivKelFhy13QUg==", - "dependencies": { - "@types/quill": "^1.3.10", - "lodash": "^4.17.4", - "quill": "^1.3.7" - }, - "peerDependencies": { - "react": "^16 || ^17 || ^18", - "react-dom": "^16 || ^17 || ^18" - } - }, - "node_modules/react-redux": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-9.1.2.tgz", - "integrity": "sha512-0OA4dhM1W48l3uzmv6B7TXPCGmokUU4p1M44DGN2/D9a1FjVPukVjER1PcPX97jIg6aUeLq1XJo1IpfbgULn0w==", - "dependencies": { - "@types/use-sync-external-store": "^0.0.3", - "use-sync-external-store": "^1.0.0" - }, - "peerDependencies": { - "@types/react": "^18.2.25", - "react": "^18.0", - "redux": "^5.0.0" - }, - "peerDependenciesMeta": { - "@types/react": { - "optional": true - }, - "redux": { - "optional": true - } - } - }, - "node_modules/react-redux/node_modules/@types/use-sync-external-store": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/@types/use-sync-external-store/-/use-sync-external-store-0.0.3.tgz", - "integrity": "sha512-EwmlvuaxPNej9+T4v5AuBPJa2x2UOJVdjCtDHgcDqitUeOtjnJKJ+apYjVcAoBEMjKW1VVFGZLUb5+qqa09XFA==" - }, "node_modules/react-refresh": { "version": "0.14.0", "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.14.0.tgz", @@ -16649,6 +17003,7 @@ "version": "4.4.5", "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.5.tgz", "integrity": "sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==", + "license": "BSD-3-Clause", "dependencies": { "@babel/runtime": "^7.5.5", "dom-helpers": "^5.0.1", @@ -16661,9 +17016,10 @@ } }, "node_modules/react-virtualized": { - "version": "9.22.5", - "resolved": "https://registry.npmjs.org/react-virtualized/-/react-virtualized-9.22.5.tgz", - "integrity": "sha512-YqQMRzlVANBv1L/7r63OHa2b0ZsAaDp1UhVNEdUaXI8A5u6hTpA5NYtUueLH2rFuY/27mTGIBl7ZhqFKzw18YQ==", + "version": "9.22.6", + "resolved": "https://registry.npmjs.org/react-virtualized/-/react-virtualized-9.22.6.tgz", + "integrity": "sha512-U5j7KuUQt3AaMatlMJ0UJddqSiX+Km0YJxSqbAzIiGw5EmNz0khMyqP2hzgu4+QUtm+QPIrxzUX4raJxmVJnHg==", + "license": "MIT", "dependencies": { "@babel/runtime": "^7.7.2", "clsx": "^1.0.4", @@ -16673,8 +17029,8 @@ "react-lifecycles-compat": "^3.0.4" }, "peerDependencies": { - "react": "^15.3.0 || ^16.0.0-alpha || ^17.0.0 || ^18.0.0", - "react-dom": "^15.3.0 || ^16.0.0-alpha || ^17.0.0 || ^18.0.0" + "react": "^16.3.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^16.3.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "node_modules/react-virtualized/node_modules/clsx": { @@ -16850,25 +17206,6 @@ "node": ">=8.10.0" } }, - "node_modules/recoil": { - "version": "0.7.7", - "resolved": "https://registry.npmjs.org/recoil/-/recoil-0.7.7.tgz", - "integrity": "sha512-8Og5KPQW9LwC577Vc7Ug2P0vQshkv1y3zG3tSSkWMqkWSwHmE+by06L8JtnGocjW6gcCvfwB3YtrJG6/tWivNQ==", - "dependencies": { - "hamt_plus": "1.0.2" - }, - "peerDependencies": { - "react": ">=16.13.1" - }, - "peerDependenciesMeta": { - "react-dom": { - "optional": true - }, - "react-native": { - "optional": true - } - } - }, "node_modules/redent": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", @@ -16882,19 +17219,6 @@ "node": ">=8" } }, - "node_modules/redux": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/redux/-/redux-5.0.1.tgz", - "integrity": "sha512-M9/ELqF6fy8FwmkpnF0S3YKOqMyoWJ4+CS5Efg2ct3oY9daQvd/Pc71FpGZsVsbl3Cpb+IIcjBDUnnyBdQbq4w==" - }, - "node_modules/redux-thunk": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/redux-thunk/-/redux-thunk-3.1.0.tgz", - "integrity": "sha512-NW2r5T6ksUKXCabzhL9z+h206HQw/NJkcLm1GPImRQ8IzfXwRGqjVhKJGauHirT0DAuyy6hjdnMZaRoAcy0Klw==", - "peerDependencies": { - "redux": "^5.0.0" - } - }, "node_modules/reflect.getprototypeof": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.10.tgz", @@ -17154,11 +17478,6 @@ "url": "https://github.com/sponsors/jet2jet" } }, - "node_modules/reselect": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/reselect/-/reselect-5.1.1.tgz", - "integrity": "sha512-K/BG6eIky/SBpzfHZv/dd+9JBFiS4SWV7FIujVyJRux6e45+73RaUHXLmIR1f7WOMaQ0U1km6qwklRQxpJJY0w==" - }, "node_modules/resolve": { "version": "1.22.8", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", @@ -17495,12 +17814,10 @@ } }, "node_modules/scheduler": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz", - "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==", - "dependencies": { - "loose-envify": "^1.1.0" - } + "version": "0.26.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.26.0.tgz", + "integrity": "sha512-NlHwttCI/l5gCPR3D1nNXtWABUmBwvZpEQiD4IXSbIDq8BzLIK/7Ir5gTFSGZDUu37K5cMNp0hFtzO38sC7gWA==", + "license": "MIT" }, "node_modules/scroll-into-view-if-needed": { "version": "3.1.0", @@ -17643,7 +17960,8 @@ "node_modules/shallowequal": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/shallowequal/-/shallowequal-1.1.0.tgz", - "integrity": "sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==" + "integrity": "sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==", + "license": "MIT" }, "node_modules/shebang-command": { "version": "2.0.0", @@ -17920,9 +18238,10 @@ } }, "node_modules/source-map-js": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", - "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } @@ -18306,16 +18625,17 @@ } }, "node_modules/styled-components": { - "version": "6.1.13", - "resolved": "https://registry.npmjs.org/styled-components/-/styled-components-6.1.13.tgz", - "integrity": "sha512-M0+N2xSnAtwcVAQeFEsGWFFxXDftHUD7XrKla06QbpUMmbmtFBMMTcKWvFXtWxuD5qQkB8iU5gk6QASlx2ZRMw==", + "version": "6.1.17", + "resolved": "https://registry.npmjs.org/styled-components/-/styled-components-6.1.17.tgz", + "integrity": "sha512-97D7DwWanI7nN24v0D4SvbfjLE9656umNSJZkBkDIWL37aZqG/wRQ+Y9pWtXyBIM/NSfcBzHLErEsqHmJNSVUg==", + "license": "MIT", "dependencies": { "@emotion/is-prop-valid": "1.2.2", "@emotion/unitless": "0.8.1", "@types/stylis": "4.2.5", "css-to-react-native": "3.2.0", "csstype": "3.1.3", - "postcss": "8.4.38", + "postcss": "8.4.49", "shallowequal": "1.1.0", "stylis": "4.3.2", "tslib": "2.6.2" @@ -18335,7 +18655,8 @@ "node_modules/styled-components/node_modules/stylis": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.3.2.tgz", - "integrity": "sha512-bhtUjWd/z6ltJiQwg0dUfxEJ+W+jdqQd8TbWLWyeIJHlnsqmGLRFFd8e5mA0AZi/zx90smXRlN66YMTcaSFifg==" + "integrity": "sha512-bhtUjWd/z6ltJiQwg0dUfxEJ+W+jdqQd8TbWLWyeIJHlnsqmGLRFFd8e5mA0AZi/zx90smXRlN66YMTcaSFifg==", + "license": "MIT" }, "node_modules/stylis": { "version": "4.2.0", @@ -18685,11 +19006,6 @@ "node": ">=8.0" } }, - "node_modules/toggle-selection": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/toggle-selection/-/toggle-selection-1.0.6.tgz", - "integrity": "sha512-BiZS+C1OS8g/q2RRbJmy59xpyghNBqrr6k5L/uKBGRsTfxmu3ffiRnd8mlGPUVayg8pvfi5urfnu8TU7DVOkLQ==" - }, "node_modules/tough-cookie": { "version": "4.1.4", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.4.tgz", @@ -18812,9 +19128,9 @@ } }, "node_modules/type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz", + "integrity": "sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==", "devOptional": true, "license": "MIT", "engines": { @@ -18918,7 +19234,8 @@ "node_modules/uc.micro": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz", - "integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==" + "integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==", + "license": "MIT" }, "node_modules/ufo": { "version": "1.5.3", @@ -19169,11 +19486,12 @@ } }, "node_modules/use-sync-external-store": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.2.tgz", - "integrity": "sha512-PElTlVMwpblvbNqQ82d2n6RjStvdSoNe9FG28kNfz3WiXilJm4DdNkEzRhCZuIDwY8U08WVihhGR5iRqAwfDiw==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.5.0.tgz", + "integrity": "sha512-Rb46I4cGGVBmjamjphe8L/UnvJD+uPPtTkNvX5mZgqdbavhI4EbgIWJiIHXJ8bc/i9EQGPRh4DwEURJ552Do0A==", + "license": "MIT", "peerDependencies": { - "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "node_modules/utf8-byte-length": { @@ -19307,9 +19625,9 @@ } }, "node_modules/vite-node": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.6.0.tgz", - "integrity": "sha512-de6HJgzC+TFzOu0NTC4RAIsyf/DY/ibWDYQUcuEA84EMHhcefTUGkjFHKKEJhQN4A+6I0u++kr3l36ZF2d7XRw==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.6.1.tgz", + "integrity": "sha512-YAXkfvGtuTzwWbDSACdJSg4A4DZiAqckWe90Zapc/sEX3XvHcw1NdurM/6od8J207tSDqNbSsgdCacBgvJKFuA==", "devOptional": true, "license": "MIT", "dependencies": { @@ -19380,17 +19698,17 @@ } }, "node_modules/vitest": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.6.0.tgz", - "integrity": "sha512-H5r/dN06swuFnzNFhq/dnz37bPXnq8xB2xB5JOVk8K09rUtoeNN+LHWkoQ0A/i3hvbUKKcCei9KpbxqHMLhLLA==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.6.1.tgz", + "integrity": "sha512-Ljb1cnSJSivGN0LqXd/zmDbWEM0RNNg2t1QW/XUhYl/qPqyu7CsqeWtqQXHVaJsecLPuDoak2oJcZN2QoRIOag==", "devOptional": true, "license": "MIT", "dependencies": { - "@vitest/expect": "1.6.0", - "@vitest/runner": "1.6.0", - "@vitest/snapshot": "1.6.0", - "@vitest/spy": "1.6.0", - "@vitest/utils": "1.6.0", + "@vitest/expect": "1.6.1", + "@vitest/runner": "1.6.1", + "@vitest/snapshot": "1.6.1", + "@vitest/spy": "1.6.1", + "@vitest/utils": "1.6.1", "acorn-walk": "^8.3.2", "chai": "^4.3.10", "debug": "^4.3.4", @@ -19404,7 +19722,7 @@ "tinybench": "^2.5.1", "tinypool": "^0.8.3", "vite": "^5.0.0", - "vite-node": "1.6.0", + "vite-node": "1.6.1", "why-is-node-running": "^2.2.2" }, "bin": { @@ -19419,8 +19737,8 @@ "peerDependencies": { "@edge-runtime/vm": "*", "@types/node": "^18.0.0 || >=20.0.0", - "@vitest/browser": "1.6.0", - "@vitest/ui": "1.6.0", + "@vitest/browser": "1.6.1", + "@vitest/ui": "1.6.1", "happy-dom": "*", "jsdom": "*" }, @@ -19445,6 +19763,15 @@ } } }, + "node_modules/void-elements": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-3.1.0.tgz", + "integrity": "sha512-Dhxzh5HZuiHQhbvTW9AMetFfBHDMYpo23Uo9btPXgdYP+3T5S+p+jgNy7spra+veYhBP2dCSgxR/i2Y02h5/6w==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/w3c-keyname": { "version": "2.2.8", "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.8.tgz", diff --git a/package.json b/package.json index f5b6940..2f922de 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "scripts": { "dev": "vite", "build": "vite build", + "format": "prettier --write .", "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "preview": "vite preview", "test": "vitest", @@ -19,35 +20,34 @@ "@capacitor/core": "^6.1.2", "@capacitor/filesystem": "^6.0.1", "@capacitor/local-notifications": "^6.1.0", - "@chatscope/chat-ui-kit-react": "^2.0.3", - "@dnd-kit/core": "^6.1.0", - "@dnd-kit/sortable": "^8.0.0", + "@dnd-kit/core": "^6.3.0", + "@dnd-kit/sortable": "^10.0.0", "@electron/packager": "^18.3.6", "@emotion/react": "^11.11.4", "@emotion/styled": "^11.11.0", "@evva/capacitor-secure-storage-plugin": "^3.0.1", - "@mui/icons-material": "^5.16.4", - "@mui/lab": "^5.0.0-alpha.173", - "@mui/material": "^5.16.7", - "@reduxjs/toolkit": "^2.2.7", - "@tanstack/react-virtual": "^3.10.8", + "@mui/icons-material": "^7.0.1", + "@mui/lab": "^7.0.0-beta.11", + "@mui/material": "^7.0.1", + "@tanstack/react-virtual": "^3.13.6", "@testing-library/jest-dom": "^6.4.6", - "@testing-library/user-event": "^14.5.2", - "@tiptap/extension-color": "^2.5.9", - "@tiptap/extension-highlight": "^2.6.6", - "@tiptap/extension-image": "^2.6.6", - "@tiptap/extension-mention": "^2.9.1", - "@tiptap/extension-placeholder": "^2.6.2", - "@tiptap/extension-text-style": "^2.5.9", - "@tiptap/extension-underline": "^2.6.6", - "@tiptap/pm": "^2.5.9", - "@tiptap/react": "^2.5.9", - "@tiptap/starter-kit": "^2.5.9", + "@testing-library/user-event": "^14.6.1", + "@tiptap/extension-color": "^2.11.7", + "@tiptap/extension-highlight": "^2.11.7", + "@tiptap/extension-image": "^2.11.7", + "@tiptap/extension-mention": "^2.11.7", + "@tiptap/extension-placeholder": "^2.11.7", + "@tiptap/extension-text-style": "^2.11.7", + "@tiptap/extension-underline": "^2.11.7", + "@tiptap/pm": "^2.11.7", + "@tiptap/react": "^2.11.7", + "@tiptap/starter-kit": "^2.11.7", "@transistorsoft/capacitor-background-fetch": "^6.0.1", "@types/chrome": "^0.0.263", + "@uiw/react-color": "^2.5.1", "adm-zip": "^0.5.16", "asmcrypto.js": "2.3.2", - "axios": "^1.7.7", + "axios": "^1.8.2", "bcryptjs": "2.4.3", "buffer": "6.0.3", "chokidar": "^3.6.0", @@ -60,29 +60,29 @@ "emoji-picker-react": "^4.12.0", "file-saver": "^2.0.5", "html-to-text": "^9.0.5", + "i18next": "^25.0.1", + "i18next-browser-languagedetector": "^8.0.5", + "i18next-http-backend": "^3.0.2", + "i18next-localstorage-backend": "^4.2.0", + "jotai": "^2.12.3", "jssha": "3.3.1", "lit": "^3.2.1", "lodash": "^4.17.21", "mime": "^4.0.4", "moment": "^2.30.1", "npm": "^10.8.3", - "quill-image-resize-module-react": "^3.0.0", - "react": "^18.2.0", - "react-copy-to-clipboard": "^5.1.0", + "react": "^19.1.0", "react-countdown-circle-timer": "^3.2.1", - "react-dom": "^18.2.0", + "react-dom": "^19.1.0", "react-dropzone": "^14.2.3", "react-frame-component": "^5.2.7", - "react-infinite-scroller": "^1.2.6", - "react-intersection-observer": "^9.13.0", - "react-json-view-lite": "^2.0.1", + "react-i18next": "^15.4.1", + "react-intersection-observer": "^9.16.0", + "react-json-view-lite": "^2.4.1", "react-loader-spinner": "^6.1.6", "react-qr-code": "^2.0.15", - "react-quill": "^2.0.0", - "react-redux": "^9.1.2", - "react-virtualized": "^9.22.5", + "react-virtualized": "^9.22.6", "react-virtuoso": "^4.10.4", - "recoil": "^0.7.7", "short-unique-id": "^5.2.0", "slate": "^0.103.0", "slate-react": "^0.109.0", @@ -94,14 +94,12 @@ "vite-plugin-wasm": "^3.3.0" }, "devDependencies": { - "@testing-library/dom": "^10.3.0", - "@testing-library/react": "^16.0.0", + "@testing-library/dom": "^10.4.0", + "@testing-library/react": "^16.3.0", "@types/dompurify": "^3.0.5", "@types/lodash": "^4.17.7", - "@types/react": "^18.2.64", - "@types/react-copy-to-clipboard": "^5.0.7", - "@types/react-dom": "^18.2.21", - "@types/react-infinite-scroller": "^1.2.5", + "@types/react": "^19.1.0", + "@types/react-dom": "^19.1.0", "@types/react-virtualized": "^9.21.30", "@typescript-eslint/eslint-plugin": "^7.1.1", "@typescript-eslint/parser": "^7.1.1", @@ -110,9 +108,16 @@ "eslint": "^8.57.0", "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-refresh": "^0.4.5", + "prettier": "^3.5.3", "rename-cli": "^6.2.1", "typescript": "^5.2.2", "vite": "^5.1.6", - "vitest": "^1.6.0" + "vitest": "^1.6.1" + }, + "overrides": { + "react-loader-spinner": { + "react": "^18 || ^19", + "react-dom": "^18 || ^19" + } } } diff --git a/public/appsBg.svg b/public/appsBg.svg deleted file mode 100644 index 9775d89..0000000 --- a/public/appsBg.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/public/msg-not1.wav b/public/msg-not1.wav deleted file mode 100644 index 475c210..0000000 Binary files a/public/msg-not1.wav and /dev/null differ diff --git a/public/pdfjs/build/pdf.mjs b/public/pdfjs/build/pdf.mjs new file mode 100644 index 0000000..0d201af --- /dev/null +++ b/public/pdfjs/build/pdf.mjs @@ -0,0 +1,21576 @@ +/** + * @licstart The following is the entire license notice for the + * JavaScript code in this page + * + * Copyright 2024 Mozilla Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @licend The above is the entire license notice for the + * JavaScript code in this page + */ + +/******/ // The require scope +/******/ var __webpack_require__ = {}; +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = globalThis.pdfjsLib = {}; + +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + AbortException: () => (/* reexport */ AbortException), + AnnotationEditorLayer: () => (/* reexport */ AnnotationEditorLayer), + AnnotationEditorParamsType: () => (/* reexport */ AnnotationEditorParamsType), + AnnotationEditorType: () => (/* reexport */ AnnotationEditorType), + AnnotationEditorUIManager: () => (/* reexport */ AnnotationEditorUIManager), + AnnotationLayer: () => (/* reexport */ AnnotationLayer), + AnnotationMode: () => (/* reexport */ AnnotationMode), + ColorPicker: () => (/* reexport */ ColorPicker), + DOMSVGFactory: () => (/* reexport */ DOMSVGFactory), + DrawLayer: () => (/* reexport */ DrawLayer), + FeatureTest: () => (/* reexport */ util_FeatureTest), + GlobalWorkerOptions: () => (/* reexport */ GlobalWorkerOptions), + ImageKind: () => (/* reexport */ util_ImageKind), + InvalidPDFException: () => (/* reexport */ InvalidPDFException), + MissingPDFException: () => (/* reexport */ MissingPDFException), + OPS: () => (/* reexport */ OPS), + OutputScale: () => (/* reexport */ OutputScale), + PDFDataRangeTransport: () => (/* reexport */ PDFDataRangeTransport), + PDFDateString: () => (/* reexport */ PDFDateString), + PDFWorker: () => (/* reexport */ PDFWorker), + PasswordResponses: () => (/* reexport */ PasswordResponses), + PermissionFlag: () => (/* reexport */ PermissionFlag), + PixelsPerInch: () => (/* reexport */ PixelsPerInch), + RenderingCancelledException: () => (/* reexport */ RenderingCancelledException), + TextLayer: () => (/* reexport */ TextLayer), + TouchManager: () => (/* reexport */ TouchManager), + UnexpectedResponseException: () => (/* reexport */ UnexpectedResponseException), + Util: () => (/* reexport */ Util), + VerbosityLevel: () => (/* reexport */ VerbosityLevel), + XfaLayer: () => (/* reexport */ XfaLayer), + build: () => (/* reexport */ build), + createValidAbsoluteUrl: () => (/* reexport */ createValidAbsoluteUrl), + fetchData: () => (/* reexport */ fetchData), + getDocument: () => (/* reexport */ getDocument), + getFilenameFromUrl: () => (/* reexport */ getFilenameFromUrl), + getPdfFilenameFromUrl: () => (/* reexport */ getPdfFilenameFromUrl), + getXfaPageViewport: () => (/* reexport */ getXfaPageViewport), + isDataScheme: () => (/* reexport */ isDataScheme), + isPdfFile: () => (/* reexport */ isPdfFile), + noContextMenu: () => (/* reexport */ noContextMenu), + normalizeUnicode: () => (/* reexport */ normalizeUnicode), + setLayerDimensions: () => (/* reexport */ setLayerDimensions), + shadow: () => (/* reexport */ shadow), + stopEvent: () => (/* reexport */ stopEvent), + version: () => (/* reexport */ version) +}); + +;// ./src/shared/util.js +const isNodeJS = typeof process === "object" && process + "" === "[object process]" && !process.versions.nw && !(process.versions.electron && process.type && process.type !== "browser"); +const IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0]; +const FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0]; +const MAX_IMAGE_SIZE_TO_CACHE = 10e6; +const LINE_FACTOR = 1.35; +const LINE_DESCENT_FACTOR = 0.35; +const BASELINE_FACTOR = LINE_DESCENT_FACTOR / LINE_FACTOR; +const RenderingIntentFlag = { + ANY: 0x01, + DISPLAY: 0x02, + PRINT: 0x04, + SAVE: 0x08, + ANNOTATIONS_FORMS: 0x10, + ANNOTATIONS_STORAGE: 0x20, + ANNOTATIONS_DISABLE: 0x40, + IS_EDITING: 0x80, + OPLIST: 0x100 +}; +const AnnotationMode = { + DISABLE: 0, + ENABLE: 1, + ENABLE_FORMS: 2, + ENABLE_STORAGE: 3 +}; +const AnnotationEditorPrefix = "pdfjs_internal_editor_"; +const AnnotationEditorType = { + DISABLE: -1, + NONE: 0, + FREETEXT: 3, + HIGHLIGHT: 9, + STAMP: 13, + INK: 15 +}; +const AnnotationEditorParamsType = { + RESIZE: 1, + CREATE: 2, + FREETEXT_SIZE: 11, + FREETEXT_COLOR: 12, + FREETEXT_OPACITY: 13, + INK_COLOR: 21, + INK_THICKNESS: 22, + INK_OPACITY: 23, + HIGHLIGHT_COLOR: 31, + HIGHLIGHT_DEFAULT_COLOR: 32, + HIGHLIGHT_THICKNESS: 33, + HIGHLIGHT_FREE: 34, + HIGHLIGHT_SHOW_ALL: 35, + DRAW_STEP: 41 +}; +const PermissionFlag = { + PRINT: 0x04, + MODIFY_CONTENTS: 0x08, + COPY: 0x10, + MODIFY_ANNOTATIONS: 0x20, + FILL_INTERACTIVE_FORMS: 0x100, + COPY_FOR_ACCESSIBILITY: 0x200, + ASSEMBLE: 0x400, + PRINT_HIGH_QUALITY: 0x800 +}; +const TextRenderingMode = { + FILL: 0, + STROKE: 1, + FILL_STROKE: 2, + INVISIBLE: 3, + FILL_ADD_TO_PATH: 4, + STROKE_ADD_TO_PATH: 5, + FILL_STROKE_ADD_TO_PATH: 6, + ADD_TO_PATH: 7, + FILL_STROKE_MASK: 3, + ADD_TO_PATH_FLAG: 4 +}; +const util_ImageKind = { + GRAYSCALE_1BPP: 1, + RGB_24BPP: 2, + RGBA_32BPP: 3 +}; +const AnnotationType = { + TEXT: 1, + LINK: 2, + FREETEXT: 3, + LINE: 4, + SQUARE: 5, + CIRCLE: 6, + POLYGON: 7, + POLYLINE: 8, + HIGHLIGHT: 9, + UNDERLINE: 10, + SQUIGGLY: 11, + STRIKEOUT: 12, + STAMP: 13, + CARET: 14, + INK: 15, + POPUP: 16, + FILEATTACHMENT: 17, + SOUND: 18, + MOVIE: 19, + WIDGET: 20, + SCREEN: 21, + PRINTERMARK: 22, + TRAPNET: 23, + WATERMARK: 24, + THREED: 25, + REDACT: 26 +}; +const AnnotationReplyType = { + GROUP: "Group", + REPLY: "R" +}; +const AnnotationFlag = { + INVISIBLE: 0x01, + HIDDEN: 0x02, + PRINT: 0x04, + NOZOOM: 0x08, + NOROTATE: 0x10, + NOVIEW: 0x20, + READONLY: 0x40, + LOCKED: 0x80, + TOGGLENOVIEW: 0x100, + LOCKEDCONTENTS: 0x200 +}; +const AnnotationFieldFlag = { + READONLY: 0x0000001, + REQUIRED: 0x0000002, + NOEXPORT: 0x0000004, + MULTILINE: 0x0001000, + PASSWORD: 0x0002000, + NOTOGGLETOOFF: 0x0004000, + RADIO: 0x0008000, + PUSHBUTTON: 0x0010000, + COMBO: 0x0020000, + EDIT: 0x0040000, + SORT: 0x0080000, + FILESELECT: 0x0100000, + MULTISELECT: 0x0200000, + DONOTSPELLCHECK: 0x0400000, + DONOTSCROLL: 0x0800000, + COMB: 0x1000000, + RICHTEXT: 0x2000000, + RADIOSINUNISON: 0x2000000, + COMMITONSELCHANGE: 0x4000000 +}; +const AnnotationBorderStyleType = { + SOLID: 1, + DASHED: 2, + BEVELED: 3, + INSET: 4, + UNDERLINE: 5 +}; +const AnnotationActionEventType = { + E: "Mouse Enter", + X: "Mouse Exit", + D: "Mouse Down", + U: "Mouse Up", + Fo: "Focus", + Bl: "Blur", + PO: "PageOpen", + PC: "PageClose", + PV: "PageVisible", + PI: "PageInvisible", + K: "Keystroke", + F: "Format", + V: "Validate", + C: "Calculate" +}; +const DocumentActionEventType = { + WC: "WillClose", + WS: "WillSave", + DS: "DidSave", + WP: "WillPrint", + DP: "DidPrint" +}; +const PageActionEventType = { + O: "PageOpen", + C: "PageClose" +}; +const VerbosityLevel = { + ERRORS: 0, + WARNINGS: 1, + INFOS: 5 +}; +const OPS = { + dependency: 1, + setLineWidth: 2, + setLineCap: 3, + setLineJoin: 4, + setMiterLimit: 5, + setDash: 6, + setRenderingIntent: 7, + setFlatness: 8, + setGState: 9, + save: 10, + restore: 11, + transform: 12, + moveTo: 13, + lineTo: 14, + curveTo: 15, + curveTo2: 16, + curveTo3: 17, + closePath: 18, + rectangle: 19, + stroke: 20, + closeStroke: 21, + fill: 22, + eoFill: 23, + fillStroke: 24, + eoFillStroke: 25, + closeFillStroke: 26, + closeEOFillStroke: 27, + endPath: 28, + clip: 29, + eoClip: 30, + beginText: 31, + endText: 32, + setCharSpacing: 33, + setWordSpacing: 34, + setHScale: 35, + setLeading: 36, + setFont: 37, + setTextRenderingMode: 38, + setTextRise: 39, + moveText: 40, + setLeadingMoveText: 41, + setTextMatrix: 42, + nextLine: 43, + showText: 44, + showSpacedText: 45, + nextLineShowText: 46, + nextLineSetSpacingShowText: 47, + setCharWidth: 48, + setCharWidthAndBounds: 49, + setStrokeColorSpace: 50, + setFillColorSpace: 51, + setStrokeColor: 52, + setStrokeColorN: 53, + setFillColor: 54, + setFillColorN: 55, + setStrokeGray: 56, + setFillGray: 57, + setStrokeRGBColor: 58, + setFillRGBColor: 59, + setStrokeCMYKColor: 60, + setFillCMYKColor: 61, + shadingFill: 62, + beginInlineImage: 63, + beginImageData: 64, + endInlineImage: 65, + paintXObject: 66, + markPoint: 67, + markPointProps: 68, + beginMarkedContent: 69, + beginMarkedContentProps: 70, + endMarkedContent: 71, + beginCompat: 72, + endCompat: 73, + paintFormXObjectBegin: 74, + paintFormXObjectEnd: 75, + beginGroup: 76, + endGroup: 77, + beginAnnotation: 80, + endAnnotation: 81, + paintImageMaskXObject: 83, + paintImageMaskXObjectGroup: 84, + paintImageXObject: 85, + paintInlineImageXObject: 86, + paintInlineImageXObjectGroup: 87, + paintImageXObjectRepeat: 88, + paintImageMaskXObjectRepeat: 89, + paintSolidColorImageMask: 90, + constructPath: 91, + setStrokeTransparent: 92, + setFillTransparent: 93 +}; +const PasswordResponses = { + NEED_PASSWORD: 1, + INCORRECT_PASSWORD: 2 +}; +let verbosity = VerbosityLevel.WARNINGS; +function setVerbosityLevel(level) { + if (Number.isInteger(level)) { + verbosity = level; + } +} +function getVerbosityLevel() { + return verbosity; +} +function info(msg) { + if (verbosity >= VerbosityLevel.INFOS) { + console.log(`Info: ${msg}`); + } +} +function warn(msg) { + if (verbosity >= VerbosityLevel.WARNINGS) { + console.log(`Warning: ${msg}`); + } +} +function unreachable(msg) { + throw new Error(msg); +} +function assert(cond, msg) { + if (!cond) { + unreachable(msg); + } +} +function _isValidProtocol(url) { + switch (url?.protocol) { + case "http:": + case "https:": + case "ftp:": + case "mailto:": + case "tel:": + return true; + default: + return false; + } +} +function createValidAbsoluteUrl(url, baseUrl = null, options = null) { + if (!url) { + return null; + } + try { + if (options && typeof url === "string") { + if (options.addDefaultProtocol && url.startsWith("www.")) { + const dots = url.match(/\./g); + if (dots?.length >= 2) { + url = `http://${url}`; + } + } + if (options.tryConvertEncoding) { + try { + url = stringToUTF8String(url); + } catch {} + } + } + const absoluteUrl = baseUrl ? new URL(url, baseUrl) : new URL(url); + if (_isValidProtocol(absoluteUrl)) { + return absoluteUrl; + } + } catch {} + return null; +} +function shadow(obj, prop, value, nonSerializable = false) { + Object.defineProperty(obj, prop, { + value, + enumerable: !nonSerializable, + configurable: true, + writable: false + }); + return value; +} +const BaseException = function BaseExceptionClosure() { + function BaseException(message, name) { + this.message = message; + this.name = name; + } + BaseException.prototype = new Error(); + BaseException.constructor = BaseException; + return BaseException; +}(); +class PasswordException extends BaseException { + constructor(msg, code) { + super(msg, "PasswordException"); + this.code = code; + } +} +class UnknownErrorException extends BaseException { + constructor(msg, details) { + super(msg, "UnknownErrorException"); + this.details = details; + } +} +class InvalidPDFException extends BaseException { + constructor(msg) { + super(msg, "InvalidPDFException"); + } +} +class MissingPDFException extends BaseException { + constructor(msg) { + super(msg, "MissingPDFException"); + } +} +class UnexpectedResponseException extends BaseException { + constructor(msg, status) { + super(msg, "UnexpectedResponseException"); + this.status = status; + } +} +class FormatError extends BaseException { + constructor(msg) { + super(msg, "FormatError"); + } +} +class AbortException extends BaseException { + constructor(msg) { + super(msg, "AbortException"); + } +} +function bytesToString(bytes) { + if (typeof bytes !== "object" || bytes?.length === undefined) { + unreachable("Invalid argument for bytesToString"); + } + const length = bytes.length; + const MAX_ARGUMENT_COUNT = 8192; + if (length < MAX_ARGUMENT_COUNT) { + return String.fromCharCode.apply(null, bytes); + } + const strBuf = []; + for (let i = 0; i < length; i += MAX_ARGUMENT_COUNT) { + const chunkEnd = Math.min(i + MAX_ARGUMENT_COUNT, length); + const chunk = bytes.subarray(i, chunkEnd); + strBuf.push(String.fromCharCode.apply(null, chunk)); + } + return strBuf.join(""); +} +function stringToBytes(str) { + if (typeof str !== "string") { + unreachable("Invalid argument for stringToBytes"); + } + const length = str.length; + const bytes = new Uint8Array(length); + for (let i = 0; i < length; ++i) { + bytes[i] = str.charCodeAt(i) & 0xff; + } + return bytes; +} +function string32(value) { + return String.fromCharCode(value >> 24 & 0xff, value >> 16 & 0xff, value >> 8 & 0xff, value & 0xff); +} +function objectSize(obj) { + return Object.keys(obj).length; +} +function objectFromMap(map) { + const obj = Object.create(null); + for (const [key, value] of map) { + obj[key] = value; + } + return obj; +} +function isLittleEndian() { + const buffer8 = new Uint8Array(4); + buffer8[0] = 1; + const view32 = new Uint32Array(buffer8.buffer, 0, 1); + return view32[0] === 1; +} +function isEvalSupported() { + try { + new Function(""); + return true; + } catch { + return false; + } +} +class util_FeatureTest { + static get isLittleEndian() { + return shadow(this, "isLittleEndian", isLittleEndian()); + } + static get isEvalSupported() { + return shadow(this, "isEvalSupported", isEvalSupported()); + } + static get isOffscreenCanvasSupported() { + return shadow(this, "isOffscreenCanvasSupported", typeof OffscreenCanvas !== "undefined"); + } + static get isImageDecoderSupported() { + return shadow(this, "isImageDecoderSupported", typeof ImageDecoder !== "undefined"); + } + static get platform() { + if (typeof navigator !== "undefined" && typeof navigator?.platform === "string") { + return shadow(this, "platform", { + isMac: navigator.platform.includes("Mac"), + isWindows: navigator.platform.includes("Win"), + isFirefox: typeof navigator?.userAgent === "string" && navigator.userAgent.includes("Firefox") + }); + } + return shadow(this, "platform", { + isMac: false, + isWindows: false, + isFirefox: false + }); + } + static get isCSSRoundSupported() { + return shadow(this, "isCSSRoundSupported", globalThis.CSS?.supports?.("width: round(1.5px, 1px)")); + } +} +const hexNumbers = Array.from(Array(256).keys(), n => n.toString(16).padStart(2, "0")); +class Util { + static makeHexColor(r, g, b) { + return `#${hexNumbers[r]}${hexNumbers[g]}${hexNumbers[b]}`; + } + static scaleMinMax(transform, minMax) { + let temp; + if (transform[0]) { + if (transform[0] < 0) { + temp = minMax[0]; + minMax[0] = minMax[2]; + minMax[2] = temp; + } + minMax[0] *= transform[0]; + minMax[2] *= transform[0]; + if (transform[3] < 0) { + temp = minMax[1]; + minMax[1] = minMax[3]; + minMax[3] = temp; + } + minMax[1] *= transform[3]; + minMax[3] *= transform[3]; + } else { + temp = minMax[0]; + minMax[0] = minMax[1]; + minMax[1] = temp; + temp = minMax[2]; + minMax[2] = minMax[3]; + minMax[3] = temp; + if (transform[1] < 0) { + temp = minMax[1]; + minMax[1] = minMax[3]; + minMax[3] = temp; + } + minMax[1] *= transform[1]; + minMax[3] *= transform[1]; + if (transform[2] < 0) { + temp = minMax[0]; + minMax[0] = minMax[2]; + minMax[2] = temp; + } + minMax[0] *= transform[2]; + minMax[2] *= transform[2]; + } + minMax[0] += transform[4]; + minMax[1] += transform[5]; + minMax[2] += transform[4]; + minMax[3] += transform[5]; + } + static transform(m1, m2) { + return [m1[0] * m2[0] + m1[2] * m2[1], m1[1] * m2[0] + m1[3] * m2[1], m1[0] * m2[2] + m1[2] * m2[3], m1[1] * m2[2] + m1[3] * m2[3], m1[0] * m2[4] + m1[2] * m2[5] + m1[4], m1[1] * m2[4] + m1[3] * m2[5] + m1[5]]; + } + static applyTransform(p, m) { + const xt = p[0] * m[0] + p[1] * m[2] + m[4]; + const yt = p[0] * m[1] + p[1] * m[3] + m[5]; + return [xt, yt]; + } + static applyInverseTransform(p, m) { + const d = m[0] * m[3] - m[1] * m[2]; + const xt = (p[0] * m[3] - p[1] * m[2] + m[2] * m[5] - m[4] * m[3]) / d; + const yt = (-p[0] * m[1] + p[1] * m[0] + m[4] * m[1] - m[5] * m[0]) / d; + return [xt, yt]; + } + static getAxialAlignedBoundingBox(r, m) { + const p1 = this.applyTransform(r, m); + const p2 = this.applyTransform(r.slice(2, 4), m); + const p3 = this.applyTransform([r[0], r[3]], m); + const p4 = this.applyTransform([r[2], r[1]], m); + return [Math.min(p1[0], p2[0], p3[0], p4[0]), Math.min(p1[1], p2[1], p3[1], p4[1]), Math.max(p1[0], p2[0], p3[0], p4[0]), Math.max(p1[1], p2[1], p3[1], p4[1])]; + } + static inverseTransform(m) { + const d = m[0] * m[3] - m[1] * m[2]; + return [m[3] / d, -m[1] / d, -m[2] / d, m[0] / d, (m[2] * m[5] - m[4] * m[3]) / d, (m[4] * m[1] - m[5] * m[0]) / d]; + } + static singularValueDecompose2dScale(m) { + const transpose = [m[0], m[2], m[1], m[3]]; + const a = m[0] * transpose[0] + m[1] * transpose[2]; + const b = m[0] * transpose[1] + m[1] * transpose[3]; + const c = m[2] * transpose[0] + m[3] * transpose[2]; + const d = m[2] * transpose[1] + m[3] * transpose[3]; + const first = (a + d) / 2; + const second = Math.sqrt((a + d) ** 2 - 4 * (a * d - c * b)) / 2; + const sx = first + second || 1; + const sy = first - second || 1; + return [Math.sqrt(sx), Math.sqrt(sy)]; + } + static normalizeRect(rect) { + const r = rect.slice(0); + if (rect[0] > rect[2]) { + r[0] = rect[2]; + r[2] = rect[0]; + } + if (rect[1] > rect[3]) { + r[1] = rect[3]; + r[3] = rect[1]; + } + return r; + } + static intersect(rect1, rect2) { + const xLow = Math.max(Math.min(rect1[0], rect1[2]), Math.min(rect2[0], rect2[2])); + const xHigh = Math.min(Math.max(rect1[0], rect1[2]), Math.max(rect2[0], rect2[2])); + if (xLow > xHigh) { + return null; + } + const yLow = Math.max(Math.min(rect1[1], rect1[3]), Math.min(rect2[1], rect2[3])); + const yHigh = Math.min(Math.max(rect1[1], rect1[3]), Math.max(rect2[1], rect2[3])); + if (yLow > yHigh) { + return null; + } + return [xLow, yLow, xHigh, yHigh]; + } + static #getExtremumOnCurve(x0, x1, x2, x3, y0, y1, y2, y3, t, minMax) { + if (t <= 0 || t >= 1) { + return; + } + const mt = 1 - t; + const tt = t * t; + const ttt = tt * t; + const x = mt * (mt * (mt * x0 + 3 * t * x1) + 3 * tt * x2) + ttt * x3; + const y = mt * (mt * (mt * y0 + 3 * t * y1) + 3 * tt * y2) + ttt * y3; + minMax[0] = Math.min(minMax[0], x); + minMax[1] = Math.min(minMax[1], y); + minMax[2] = Math.max(minMax[2], x); + minMax[3] = Math.max(minMax[3], y); + } + static #getExtremum(x0, x1, x2, x3, y0, y1, y2, y3, a, b, c, minMax) { + if (Math.abs(a) < 1e-12) { + if (Math.abs(b) >= 1e-12) { + this.#getExtremumOnCurve(x0, x1, x2, x3, y0, y1, y2, y3, -c / b, minMax); + } + return; + } + const delta = b ** 2 - 4 * c * a; + if (delta < 0) { + return; + } + const sqrtDelta = Math.sqrt(delta); + const a2 = 2 * a; + this.#getExtremumOnCurve(x0, x1, x2, x3, y0, y1, y2, y3, (-b + sqrtDelta) / a2, minMax); + this.#getExtremumOnCurve(x0, x1, x2, x3, y0, y1, y2, y3, (-b - sqrtDelta) / a2, minMax); + } + static bezierBoundingBox(x0, y0, x1, y1, x2, y2, x3, y3, minMax) { + if (minMax) { + minMax[0] = Math.min(minMax[0], x0, x3); + minMax[1] = Math.min(minMax[1], y0, y3); + minMax[2] = Math.max(minMax[2], x0, x3); + minMax[3] = Math.max(minMax[3], y0, y3); + } else { + minMax = [Math.min(x0, x3), Math.min(y0, y3), Math.max(x0, x3), Math.max(y0, y3)]; + } + this.#getExtremum(x0, x1, x2, x3, y0, y1, y2, y3, 3 * (-x0 + 3 * (x1 - x2) + x3), 6 * (x0 - 2 * x1 + x2), 3 * (x1 - x0), minMax); + this.#getExtremum(x0, x1, x2, x3, y0, y1, y2, y3, 3 * (-y0 + 3 * (y1 - y2) + y3), 6 * (y0 - 2 * y1 + y2), 3 * (y1 - y0), minMax); + return minMax; + } +} +const PDFStringTranslateTable = (/* unused pure expression or super */ null && ([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2d8, 0x2c7, 0x2c6, 0x2d9, 0x2dd, 0x2db, 0x2da, 0x2dc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2022, 0x2020, 0x2021, 0x2026, 0x2014, 0x2013, 0x192, 0x2044, 0x2039, 0x203a, 0x2212, 0x2030, 0x201e, 0x201c, 0x201d, 0x2018, 0x2019, 0x201a, 0x2122, 0xfb01, 0xfb02, 0x141, 0x152, 0x160, 0x178, 0x17d, 0x131, 0x142, 0x153, 0x161, 0x17e, 0, 0x20ac])); +function stringToPDFString(str) { + if (str[0] >= "\xEF") { + let encoding; + if (str[0] === "\xFE" && str[1] === "\xFF") { + encoding = "utf-16be"; + if (str.length % 2 === 1) { + str = str.slice(0, -1); + } + } else if (str[0] === "\xFF" && str[1] === "\xFE") { + encoding = "utf-16le"; + if (str.length % 2 === 1) { + str = str.slice(0, -1); + } + } else if (str[0] === "\xEF" && str[1] === "\xBB" && str[2] === "\xBF") { + encoding = "utf-8"; + } + if (encoding) { + try { + const decoder = new TextDecoder(encoding, { + fatal: true + }); + const buffer = stringToBytes(str); + const decoded = decoder.decode(buffer); + if (!decoded.includes("\x1b")) { + return decoded; + } + return decoded.replaceAll(/\x1b[^\x1b]*(?:\x1b|$)/g, ""); + } catch (ex) { + warn(`stringToPDFString: "${ex}".`); + } + } + } + const strBuf = []; + for (let i = 0, ii = str.length; i < ii; i++) { + const charCode = str.charCodeAt(i); + if (charCode === 0x1b) { + while (++i < ii && str.charCodeAt(i) !== 0x1b) {} + continue; + } + const code = PDFStringTranslateTable[charCode]; + strBuf.push(code ? String.fromCharCode(code) : str.charAt(i)); + } + return strBuf.join(""); +} +function stringToUTF8String(str) { + return decodeURIComponent(escape(str)); +} +function utf8StringToString(str) { + return unescape(encodeURIComponent(str)); +} +function isArrayEqual(arr1, arr2) { + if (arr1.length !== arr2.length) { + return false; + } + for (let i = 0, ii = arr1.length; i < ii; i++) { + if (arr1[i] !== arr2[i]) { + return false; + } + } + return true; +} +function getModificationDate(date = new Date()) { + const buffer = [date.getUTCFullYear().toString(), (date.getUTCMonth() + 1).toString().padStart(2, "0"), date.getUTCDate().toString().padStart(2, "0"), date.getUTCHours().toString().padStart(2, "0"), date.getUTCMinutes().toString().padStart(2, "0"), date.getUTCSeconds().toString().padStart(2, "0")]; + return buffer.join(""); +} +let NormalizeRegex = null; +let NormalizationMap = null; +function normalizeUnicode(str) { + if (!NormalizeRegex) { + NormalizeRegex = /([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu; + NormalizationMap = new Map([["ſt", "ſt"]]); + } + return str.replaceAll(NormalizeRegex, (_, p1, p2) => p1 ? p1.normalize("NFKC") : NormalizationMap.get(p2)); +} +function getUuid() { + if (typeof crypto.randomUUID === "function") { + return crypto.randomUUID(); + } + const buf = new Uint8Array(32); + crypto.getRandomValues(buf); + return bytesToString(buf); +} +const AnnotationPrefix = "pdfjs_internal_id_"; +function toHexUtil(arr) { + if (Uint8Array.prototype.toHex) { + return arr.toHex(); + } + return Array.from(arr, num => hexNumbers[num]).join(""); +} +function toBase64Util(arr) { + if (Uint8Array.prototype.toBase64) { + return arr.toBase64(); + } + return btoa(bytesToString(arr)); +} +function fromBase64Util(str) { + if (Uint8Array.fromBase64) { + return Uint8Array.fromBase64(str); + } + return stringToBytes(atob(str)); +} +if (typeof Promise.try !== "function") { + Promise.try = function (fn, ...args) { + return new Promise(resolve => { + resolve(fn(...args)); + }); + }; +} + +;// ./src/display/display_utils.js + +const SVG_NS = "http://www.w3.org/2000/svg"; +class PixelsPerInch { + static CSS = 96.0; + static PDF = 72.0; + static PDF_TO_CSS_UNITS = this.CSS / this.PDF; +} +async function fetchData(url, type = "text") { + if (isValidFetchUrl(url, document.baseURI)) { + const response = await fetch(url); + if (!response.ok) { + throw new Error(response.statusText); + } + switch (type) { + case "arraybuffer": + return response.arrayBuffer(); + case "blob": + return response.blob(); + case "json": + return response.json(); + } + return response.text(); + } + return new Promise((resolve, reject) => { + const request = new XMLHttpRequest(); + request.open("GET", url, true); + request.responseType = type; + request.onreadystatechange = () => { + if (request.readyState !== XMLHttpRequest.DONE) { + return; + } + if (request.status === 200 || request.status === 0) { + switch (type) { + case "arraybuffer": + case "blob": + case "json": + resolve(request.response); + return; + } + resolve(request.responseText); + return; + } + reject(new Error(request.statusText)); + }; + request.send(null); + }); +} +class PageViewport { + constructor({ + viewBox, + userUnit, + scale, + rotation, + offsetX = 0, + offsetY = 0, + dontFlip = false + }) { + this.viewBox = viewBox; + this.userUnit = userUnit; + this.scale = scale; + this.rotation = rotation; + this.offsetX = offsetX; + this.offsetY = offsetY; + scale *= userUnit; + const centerX = (viewBox[2] + viewBox[0]) / 2; + const centerY = (viewBox[3] + viewBox[1]) / 2; + let rotateA, rotateB, rotateC, rotateD; + rotation %= 360; + if (rotation < 0) { + rotation += 360; + } + switch (rotation) { + case 180: + rotateA = -1; + rotateB = 0; + rotateC = 0; + rotateD = 1; + break; + case 90: + rotateA = 0; + rotateB = 1; + rotateC = 1; + rotateD = 0; + break; + case 270: + rotateA = 0; + rotateB = -1; + rotateC = -1; + rotateD = 0; + break; + case 0: + rotateA = 1; + rotateB = 0; + rotateC = 0; + rotateD = -1; + break; + default: + throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees."); + } + if (dontFlip) { + rotateC = -rotateC; + rotateD = -rotateD; + } + let offsetCanvasX, offsetCanvasY; + let width, height; + if (rotateA === 0) { + offsetCanvasX = Math.abs(centerY - viewBox[1]) * scale + offsetX; + offsetCanvasY = Math.abs(centerX - viewBox[0]) * scale + offsetY; + width = (viewBox[3] - viewBox[1]) * scale; + height = (viewBox[2] - viewBox[0]) * scale; + } else { + offsetCanvasX = Math.abs(centerX - viewBox[0]) * scale + offsetX; + offsetCanvasY = Math.abs(centerY - viewBox[1]) * scale + offsetY; + width = (viewBox[2] - viewBox[0]) * scale; + height = (viewBox[3] - viewBox[1]) * scale; + } + this.transform = [rotateA * scale, rotateB * scale, rotateC * scale, rotateD * scale, offsetCanvasX - rotateA * scale * centerX - rotateC * scale * centerY, offsetCanvasY - rotateB * scale * centerX - rotateD * scale * centerY]; + this.width = width; + this.height = height; + } + get rawDims() { + const { + userUnit, + viewBox + } = this; + const dims = viewBox.map(x => x * userUnit); + return shadow(this, "rawDims", { + pageWidth: dims[2] - dims[0], + pageHeight: dims[3] - dims[1], + pageX: dims[0], + pageY: dims[1] + }); + } + clone({ + scale = this.scale, + rotation = this.rotation, + offsetX = this.offsetX, + offsetY = this.offsetY, + dontFlip = false + } = {}) { + return new PageViewport({ + viewBox: this.viewBox.slice(), + userUnit: this.userUnit, + scale, + rotation, + offsetX, + offsetY, + dontFlip + }); + } + convertToViewportPoint(x, y) { + return Util.applyTransform([x, y], this.transform); + } + convertToViewportRectangle(rect) { + const topLeft = Util.applyTransform([rect[0], rect[1]], this.transform); + const bottomRight = Util.applyTransform([rect[2], rect[3]], this.transform); + return [topLeft[0], topLeft[1], bottomRight[0], bottomRight[1]]; + } + convertToPdfPoint(x, y) { + return Util.applyInverseTransform([x, y], this.transform); + } +} +class RenderingCancelledException extends BaseException { + constructor(msg, extraDelay = 0) { + super(msg, "RenderingCancelledException"); + this.extraDelay = extraDelay; + } +} +function isDataScheme(url) { + const ii = url.length; + let i = 0; + while (i < ii && url[i].trim() === "") { + i++; + } + return url.substring(i, i + 5).toLowerCase() === "data:"; +} +function isPdfFile(filename) { + return typeof filename === "string" && /\.pdf$/i.test(filename); +} +function getFilenameFromUrl(url) { + [url] = url.split(/[#?]/, 1); + return url.substring(url.lastIndexOf("/") + 1); +} +function getPdfFilenameFromUrl(url, defaultFilename = "document.pdf") { + if (typeof url !== "string") { + return defaultFilename; + } + if (isDataScheme(url)) { + warn('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'); + return defaultFilename; + } + const reURI = /^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/; + const reFilename = /[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i; + const splitURI = reURI.exec(url); + let suggestedFilename = reFilename.exec(splitURI[1]) || reFilename.exec(splitURI[2]) || reFilename.exec(splitURI[3]); + if (suggestedFilename) { + suggestedFilename = suggestedFilename[0]; + if (suggestedFilename.includes("%")) { + try { + suggestedFilename = reFilename.exec(decodeURIComponent(suggestedFilename))[0]; + } catch {} + } + } + return suggestedFilename || defaultFilename; +} +class StatTimer { + started = Object.create(null); + times = []; + time(name) { + if (name in this.started) { + warn(`Timer is already running for ${name}`); + } + this.started[name] = Date.now(); + } + timeEnd(name) { + if (!(name in this.started)) { + warn(`Timer has not been started for ${name}`); + } + this.times.push({ + name, + start: this.started[name], + end: Date.now() + }); + delete this.started[name]; + } + toString() { + const outBuf = []; + let longest = 0; + for (const { + name + } of this.times) { + longest = Math.max(name.length, longest); + } + for (const { + name, + start, + end + } of this.times) { + outBuf.push(`${name.padEnd(longest)} ${end - start}ms\n`); + } + return outBuf.join(""); + } +} +function isValidFetchUrl(url, baseUrl) { + try { + const { + protocol + } = baseUrl ? new URL(url, baseUrl) : new URL(url); + return protocol === "http:" || protocol === "https:"; + } catch { + return false; + } +} +function noContextMenu(e) { + e.preventDefault(); +} +function stopEvent(e) { + e.preventDefault(); + e.stopPropagation(); +} +function deprecated(details) { + console.log("Deprecated API usage: " + details); +} +class PDFDateString { + static #regex; + static toDateObject(input) { + if (!input || typeof input !== "string") { + return null; + } + this.#regex ||= new RegExp("^D:" + "(\\d{4})" + "(\\d{2})?" + "(\\d{2})?" + "(\\d{2})?" + "(\\d{2})?" + "(\\d{2})?" + "([Z|+|-])?" + "(\\d{2})?" + "'?" + "(\\d{2})?" + "'?"); + const matches = this.#regex.exec(input); + if (!matches) { + return null; + } + const year = parseInt(matches[1], 10); + let month = parseInt(matches[2], 10); + month = month >= 1 && month <= 12 ? month - 1 : 0; + let day = parseInt(matches[3], 10); + day = day >= 1 && day <= 31 ? day : 1; + let hour = parseInt(matches[4], 10); + hour = hour >= 0 && hour <= 23 ? hour : 0; + let minute = parseInt(matches[5], 10); + minute = minute >= 0 && minute <= 59 ? minute : 0; + let second = parseInt(matches[6], 10); + second = second >= 0 && second <= 59 ? second : 0; + const universalTimeRelation = matches[7] || "Z"; + let offsetHour = parseInt(matches[8], 10); + offsetHour = offsetHour >= 0 && offsetHour <= 23 ? offsetHour : 0; + let offsetMinute = parseInt(matches[9], 10) || 0; + offsetMinute = offsetMinute >= 0 && offsetMinute <= 59 ? offsetMinute : 0; + if (universalTimeRelation === "-") { + hour += offsetHour; + minute += offsetMinute; + } else if (universalTimeRelation === "+") { + hour -= offsetHour; + minute -= offsetMinute; + } + return new Date(Date.UTC(year, month, day, hour, minute, second)); + } +} +function getXfaPageViewport(xfaPage, { + scale = 1, + rotation = 0 +}) { + const { + width, + height + } = xfaPage.attributes.style; + const viewBox = [0, 0, parseInt(width), parseInt(height)]; + return new PageViewport({ + viewBox, + userUnit: 1, + scale, + rotation + }); +} +function getRGB(color) { + if (color.startsWith("#")) { + const colorRGB = parseInt(color.slice(1), 16); + return [(colorRGB & 0xff0000) >> 16, (colorRGB & 0x00ff00) >> 8, colorRGB & 0x0000ff]; + } + if (color.startsWith("rgb(")) { + return color.slice(4, -1).split(",").map(x => parseInt(x)); + } + if (color.startsWith("rgba(")) { + return color.slice(5, -1).split(",").map(x => parseInt(x)).slice(0, 3); + } + warn(`Not a valid color format: "${color}"`); + return [0, 0, 0]; +} +function getColorValues(colors) { + const span = document.createElement("span"); + span.style.visibility = "hidden"; + document.body.append(span); + for (const name of colors.keys()) { + span.style.color = name; + const computedColor = window.getComputedStyle(span).color; + colors.set(name, getRGB(computedColor)); + } + span.remove(); +} +function getCurrentTransform(ctx) { + const { + a, + b, + c, + d, + e, + f + } = ctx.getTransform(); + return [a, b, c, d, e, f]; +} +function getCurrentTransformInverse(ctx) { + const { + a, + b, + c, + d, + e, + f + } = ctx.getTransform().invertSelf(); + return [a, b, c, d, e, f]; +} +function setLayerDimensions(div, viewport, mustFlip = false, mustRotate = true) { + if (viewport instanceof PageViewport) { + const { + pageWidth, + pageHeight + } = viewport.rawDims; + const { + style + } = div; + const useRound = util_FeatureTest.isCSSRoundSupported; + const w = `var(--scale-factor) * ${pageWidth}px`, + h = `var(--scale-factor) * ${pageHeight}px`; + const widthStr = useRound ? `round(down, ${w}, var(--scale-round-x, 1px))` : `calc(${w})`, + heightStr = useRound ? `round(down, ${h}, var(--scale-round-y, 1px))` : `calc(${h})`; + if (!mustFlip || viewport.rotation % 180 === 0) { + style.width = widthStr; + style.height = heightStr; + } else { + style.width = heightStr; + style.height = widthStr; + } + } + if (mustRotate) { + div.setAttribute("data-main-rotation", viewport.rotation); + } +} +class OutputScale { + constructor() { + const pixelRatio = window.devicePixelRatio || 1; + this.sx = pixelRatio; + this.sy = pixelRatio; + } + get scaled() { + return this.sx !== 1 || this.sy !== 1; + } + get symmetric() { + return this.sx === this.sy; + } +} + +;// ./src/display/editor/toolbar.js + +class EditorToolbar { + #toolbar = null; + #colorPicker = null; + #editor; + #buttons = null; + #altText = null; + static #l10nRemove = null; + constructor(editor) { + this.#editor = editor; + EditorToolbar.#l10nRemove ||= Object.freeze({ + freetext: "pdfjs-editor-remove-freetext-button", + highlight: "pdfjs-editor-remove-highlight-button", + ink: "pdfjs-editor-remove-ink-button", + stamp: "pdfjs-editor-remove-stamp-button" + }); + } + render() { + const editToolbar = this.#toolbar = document.createElement("div"); + editToolbar.classList.add("editToolbar", "hidden"); + editToolbar.setAttribute("role", "toolbar"); + const signal = this.#editor._uiManager._signal; + editToolbar.addEventListener("contextmenu", noContextMenu, { + signal + }); + editToolbar.addEventListener("pointerdown", EditorToolbar.#pointerDown, { + signal + }); + const buttons = this.#buttons = document.createElement("div"); + buttons.className = "buttons"; + editToolbar.append(buttons); + const position = this.#editor.toolbarPosition; + if (position) { + const { + style + } = editToolbar; + const x = this.#editor._uiManager.direction === "ltr" ? 1 - position[0] : position[0]; + style.insetInlineEnd = `${100 * x}%`; + style.top = `calc(${100 * position[1]}% + var(--editor-toolbar-vert-offset))`; + } + this.#addDeleteButton(); + return editToolbar; + } + get div() { + return this.#toolbar; + } + static #pointerDown(e) { + e.stopPropagation(); + } + #focusIn(e) { + this.#editor._focusEventsAllowed = false; + stopEvent(e); + } + #focusOut(e) { + this.#editor._focusEventsAllowed = true; + stopEvent(e); + } + #addListenersToElement(element) { + const signal = this.#editor._uiManager._signal; + element.addEventListener("focusin", this.#focusIn.bind(this), { + capture: true, + signal + }); + element.addEventListener("focusout", this.#focusOut.bind(this), { + capture: true, + signal + }); + element.addEventListener("contextmenu", noContextMenu, { + signal + }); + } + hide() { + this.#toolbar.classList.add("hidden"); + this.#colorPicker?.hideDropdown(); + } + show() { + this.#toolbar.classList.remove("hidden"); + this.#altText?.shown(); + } + #addDeleteButton() { + const { + editorType, + _uiManager + } = this.#editor; + const button = document.createElement("button"); + button.className = "delete"; + button.tabIndex = 0; + button.setAttribute("data-l10n-id", EditorToolbar.#l10nRemove[editorType]); + this.#addListenersToElement(button); + button.addEventListener("click", e => { + _uiManager.delete(); + }, { + signal: _uiManager._signal + }); + this.#buttons.append(button); + } + get #divider() { + const divider = document.createElement("div"); + divider.className = "divider"; + return divider; + } + async addAltText(altText) { + const button = await altText.render(); + this.#addListenersToElement(button); + this.#buttons.prepend(button, this.#divider); + this.#altText = altText; + } + addColorPicker(colorPicker) { + this.#colorPicker = colorPicker; + const button = colorPicker.renderButton(); + this.#addListenersToElement(button); + this.#buttons.prepend(button, this.#divider); + } + remove() { + this.#toolbar.remove(); + this.#colorPicker?.destroy(); + this.#colorPicker = null; + } +} +class HighlightToolbar { + #buttons = null; + #toolbar = null; + #uiManager; + constructor(uiManager) { + this.#uiManager = uiManager; + } + #render() { + const editToolbar = this.#toolbar = document.createElement("div"); + editToolbar.className = "editToolbar"; + editToolbar.setAttribute("role", "toolbar"); + editToolbar.addEventListener("contextmenu", noContextMenu, { + signal: this.#uiManager._signal + }); + const buttons = this.#buttons = document.createElement("div"); + buttons.className = "buttons"; + editToolbar.append(buttons); + this.#addHighlightButton(); + return editToolbar; + } + #getLastPoint(boxes, isLTR) { + let lastY = 0; + let lastX = 0; + for (const box of boxes) { + const y = box.y + box.height; + if (y < lastY) { + continue; + } + const x = box.x + (isLTR ? box.width : 0); + if (y > lastY) { + lastX = x; + lastY = y; + continue; + } + if (isLTR) { + if (x > lastX) { + lastX = x; + } + } else if (x < lastX) { + lastX = x; + } + } + return [isLTR ? 1 - lastX : lastX, lastY]; + } + show(parent, boxes, isLTR) { + const [x, y] = this.#getLastPoint(boxes, isLTR); + const { + style + } = this.#toolbar ||= this.#render(); + parent.append(this.#toolbar); + style.insetInlineEnd = `${100 * x}%`; + style.top = `calc(${100 * y}% + var(--editor-toolbar-vert-offset))`; + } + hide() { + this.#toolbar.remove(); + } + #addHighlightButton() { + const button = document.createElement("button"); + button.className = "highlightButton"; + button.tabIndex = 0; + button.setAttribute("data-l10n-id", `pdfjs-highlight-floating-button1`); + const span = document.createElement("span"); + button.append(span); + span.className = "visuallyHidden"; + span.setAttribute("data-l10n-id", "pdfjs-highlight-floating-button-label"); + const signal = this.#uiManager._signal; + button.addEventListener("contextmenu", noContextMenu, { + signal + }); + button.addEventListener("click", () => { + this.#uiManager.highlightSelection("floating_button"); + }, { + signal + }); + this.#buttons.append(button); + } +} + +;// ./src/display/editor/tools.js + + + +function bindEvents(obj, element, names) { + for (const name of names) { + element.addEventListener(name, obj[name].bind(obj)); + } +} +function opacityToHex(opacity) { + return Math.round(Math.min(255, Math.max(1, 255 * opacity))).toString(16).padStart(2, "0"); +} +class IdManager { + #id = 0; + get id() { + return `${AnnotationEditorPrefix}${this.#id++}`; + } +} +class ImageManager { + #baseId = getUuid(); + #id = 0; + #cache = null; + static get _isSVGFittingCanvas() { + const svg = `data:image/svg+xml;charset=UTF-8,`; + const canvas = new OffscreenCanvas(1, 3); + const ctx = canvas.getContext("2d", { + willReadFrequently: true + }); + const image = new Image(); + image.src = svg; + const promise = image.decode().then(() => { + ctx.drawImage(image, 0, 0, 1, 1, 0, 0, 1, 3); + return new Uint32Array(ctx.getImageData(0, 0, 1, 1).data.buffer)[0] === 0; + }); + return shadow(this, "_isSVGFittingCanvas", promise); + } + async #get(key, rawData) { + this.#cache ||= new Map(); + let data = this.#cache.get(key); + if (data === null) { + return null; + } + if (data?.bitmap) { + data.refCounter += 1; + return data; + } + try { + data ||= { + bitmap: null, + id: `image_${this.#baseId}_${this.#id++}`, + refCounter: 0, + isSvg: false + }; + let image; + if (typeof rawData === "string") { + data.url = rawData; + image = await fetchData(rawData, "blob"); + } else if (rawData instanceof File) { + image = data.file = rawData; + } else if (rawData instanceof Blob) { + image = rawData; + } + if (image.type === "image/svg+xml") { + const mustRemoveAspectRatioPromise = ImageManager._isSVGFittingCanvas; + const fileReader = new FileReader(); + const imageElement = new Image(); + const imagePromise = new Promise((resolve, reject) => { + imageElement.onload = () => { + data.bitmap = imageElement; + data.isSvg = true; + resolve(); + }; + fileReader.onload = async () => { + const url = data.svgUrl = fileReader.result; + imageElement.src = (await mustRemoveAspectRatioPromise) ? `${url}#svgView(preserveAspectRatio(none))` : url; + }; + imageElement.onerror = fileReader.onerror = reject; + }); + fileReader.readAsDataURL(image); + await imagePromise; + } else { + data.bitmap = await createImageBitmap(image); + } + data.refCounter = 1; + } catch (e) { + warn(e); + data = null; + } + this.#cache.set(key, data); + if (data) { + this.#cache.set(data.id, data); + } + return data; + } + async getFromFile(file) { + const { + lastModified, + name, + size, + type + } = file; + return this.#get(`${lastModified}_${name}_${size}_${type}`, file); + } + async getFromUrl(url) { + return this.#get(url, url); + } + async getFromBlob(id, blobPromise) { + const blob = await blobPromise; + return this.#get(id, blob); + } + async getFromId(id) { + this.#cache ||= new Map(); + const data = this.#cache.get(id); + if (!data) { + return null; + } + if (data.bitmap) { + data.refCounter += 1; + return data; + } + if (data.file) { + return this.getFromFile(data.file); + } + if (data.blobPromise) { + const { + blobPromise + } = data; + delete data.blobPromise; + return this.getFromBlob(data.id, blobPromise); + } + return this.getFromUrl(data.url); + } + getFromCanvas(id, canvas) { + this.#cache ||= new Map(); + let data = this.#cache.get(id); + if (data?.bitmap) { + data.refCounter += 1; + return data; + } + const offscreen = new OffscreenCanvas(canvas.width, canvas.height); + const ctx = offscreen.getContext("2d"); + ctx.drawImage(canvas, 0, 0); + data = { + bitmap: offscreen.transferToImageBitmap(), + id: `image_${this.#baseId}_${this.#id++}`, + refCounter: 1, + isSvg: false + }; + this.#cache.set(id, data); + this.#cache.set(data.id, data); + return data; + } + getSvgUrl(id) { + const data = this.#cache.get(id); + if (!data?.isSvg) { + return null; + } + return data.svgUrl; + } + deleteId(id) { + this.#cache ||= new Map(); + const data = this.#cache.get(id); + if (!data) { + return; + } + data.refCounter -= 1; + if (data.refCounter !== 0) { + return; + } + const { + bitmap + } = data; + if (!data.url && !data.file) { + const canvas = new OffscreenCanvas(bitmap.width, bitmap.height); + const ctx = canvas.getContext("bitmaprenderer"); + ctx.transferFromImageBitmap(bitmap); + data.blobPromise = canvas.convertToBlob(); + } + bitmap.close?.(); + data.bitmap = null; + } + isValidId(id) { + return id.startsWith(`image_${this.#baseId}_`); + } +} +class CommandManager { + #commands = []; + #locked = false; + #maxSize; + #position = -1; + constructor(maxSize = 128) { + this.#maxSize = maxSize; + } + add({ + cmd, + undo, + post, + mustExec, + type = NaN, + overwriteIfSameType = false, + keepUndo = false + }) { + if (mustExec) { + cmd(); + } + if (this.#locked) { + return; + } + const save = { + cmd, + undo, + post, + type + }; + if (this.#position === -1) { + if (this.#commands.length > 0) { + this.#commands.length = 0; + } + this.#position = 0; + this.#commands.push(save); + return; + } + if (overwriteIfSameType && this.#commands[this.#position].type === type) { + if (keepUndo) { + save.undo = this.#commands[this.#position].undo; + } + this.#commands[this.#position] = save; + return; + } + const next = this.#position + 1; + if (next === this.#maxSize) { + this.#commands.splice(0, 1); + } else { + this.#position = next; + if (next < this.#commands.length) { + this.#commands.splice(next); + } + } + this.#commands.push(save); + } + undo() { + if (this.#position === -1) { + return; + } + this.#locked = true; + const { + undo, + post + } = this.#commands[this.#position]; + undo(); + post?.(); + this.#locked = false; + this.#position -= 1; + } + redo() { + if (this.#position < this.#commands.length - 1) { + this.#position += 1; + this.#locked = true; + const { + cmd, + post + } = this.#commands[this.#position]; + cmd(); + post?.(); + this.#locked = false; + } + } + hasSomethingToUndo() { + return this.#position !== -1; + } + hasSomethingToRedo() { + return this.#position < this.#commands.length - 1; + } + cleanType(type) { + if (this.#position === -1) { + return; + } + for (let i = this.#position; i >= 0; i--) { + if (this.#commands[i].type !== type) { + this.#commands.splice(i + 1, this.#position - i); + this.#position = i; + return; + } + } + this.#commands.length = 0; + this.#position = -1; + } + destroy() { + this.#commands = null; + } +} +class KeyboardManager { + constructor(callbacks) { + this.buffer = []; + this.callbacks = new Map(); + this.allKeys = new Set(); + const { + isMac + } = util_FeatureTest.platform; + for (const [keys, callback, options = {}] of callbacks) { + for (const key of keys) { + const isMacKey = key.startsWith("mac+"); + if (isMac && isMacKey) { + this.callbacks.set(key.slice(4), { + callback, + options + }); + this.allKeys.add(key.split("+").at(-1)); + } else if (!isMac && !isMacKey) { + this.callbacks.set(key, { + callback, + options + }); + this.allKeys.add(key.split("+").at(-1)); + } + } + } + } + #serialize(event) { + if (event.altKey) { + this.buffer.push("alt"); + } + if (event.ctrlKey) { + this.buffer.push("ctrl"); + } + if (event.metaKey) { + this.buffer.push("meta"); + } + if (event.shiftKey) { + this.buffer.push("shift"); + } + this.buffer.push(event.key); + const str = this.buffer.join("+"); + this.buffer.length = 0; + return str; + } + exec(self, event) { + if (!this.allKeys.has(event.key)) { + return; + } + const info = this.callbacks.get(this.#serialize(event)); + if (!info) { + return; + } + const { + callback, + options: { + bubbles = false, + args = [], + checker = null + } + } = info; + if (checker && !checker(self, event)) { + return; + } + callback.bind(self, ...args, event)(); + if (!bubbles) { + stopEvent(event); + } + } +} +class ColorManager { + static _colorsMapping = new Map([["CanvasText", [0, 0, 0]], ["Canvas", [255, 255, 255]]]); + get _colors() { + const colors = new Map([["CanvasText", null], ["Canvas", null]]); + getColorValues(colors); + return shadow(this, "_colors", colors); + } + convert(color) { + const rgb = getRGB(color); + if (!window.matchMedia("(forced-colors: active)").matches) { + return rgb; + } + for (const [name, RGB] of this._colors) { + if (RGB.every((x, i) => x === rgb[i])) { + return ColorManager._colorsMapping.get(name); + } + } + return rgb; + } + getHexCode(name) { + const rgb = this._colors.get(name); + if (!rgb) { + return name; + } + return Util.makeHexColor(...rgb); + } +} +class AnnotationEditorUIManager { + #abortController = new AbortController(); + #activeEditor = null; + #allEditors = new Map(); + #allLayers = new Map(); + #altTextManager = null; + #annotationStorage = null; + #changedExistingAnnotations = null; + #commandManager = new CommandManager(); + #copyPasteAC = null; + #currentDrawingSession = null; + #currentPageIndex = 0; + #deletedAnnotationsElementIds = new Set(); + #draggingEditors = null; + #editorTypes = null; + #editorsToRescale = new Set(); + _editorUndoBar = null; + #enableHighlightFloatingButton = false; + #enableUpdatedAddImage = false; + #enableNewAltTextWhenAddingImage = false; + #filterFactory = null; + #focusMainContainerTimeoutId = null; + #focusManagerAC = null; + #highlightColors = null; + #highlightWhenShiftUp = false; + #highlightToolbar = null; + #idManager = new IdManager(); + #isEnabled = false; + #isWaiting = false; + #keyboardManagerAC = null; + #lastActiveElement = null; + #mainHighlightColorPicker = null; + #mlManager = null; + #mode = AnnotationEditorType.NONE; + #selectedEditors = new Set(); + #selectedTextNode = null; + #pageColors = null; + #showAllStates = null; + #previousStates = { + isEditing: false, + isEmpty: true, + hasSomethingToUndo: false, + hasSomethingToRedo: false, + hasSelectedEditor: false, + hasSelectedText: false + }; + #translation = [0, 0]; + #translationTimeoutId = null; + #container = null; + #viewer = null; + #updateModeCapability = null; + static TRANSLATE_SMALL = 1; + static TRANSLATE_BIG = 10; + static get _keyboardManager() { + const proto = AnnotationEditorUIManager.prototype; + const arrowChecker = self => self.#container.contains(document.activeElement) && document.activeElement.tagName !== "BUTTON" && self.hasSomethingToControl(); + const textInputChecker = (_self, { + target: el + }) => { + if (el instanceof HTMLInputElement) { + const { + type + } = el; + return type !== "text" && type !== "number"; + } + return true; + }; + const small = this.TRANSLATE_SMALL; + const big = this.TRANSLATE_BIG; + return shadow(this, "_keyboardManager", new KeyboardManager([[["ctrl+a", "mac+meta+a"], proto.selectAll, { + checker: textInputChecker + }], [["ctrl+z", "mac+meta+z"], proto.undo, { + checker: textInputChecker + }], [["ctrl+y", "ctrl+shift+z", "mac+meta+shift+z", "ctrl+shift+Z", "mac+meta+shift+Z"], proto.redo, { + checker: textInputChecker + }], [["Backspace", "alt+Backspace", "ctrl+Backspace", "shift+Backspace", "mac+Backspace", "mac+alt+Backspace", "mac+ctrl+Backspace", "Delete", "ctrl+Delete", "shift+Delete", "mac+Delete"], proto.delete, { + checker: textInputChecker + }], [["Enter", "mac+Enter"], proto.addNewEditorFromKeyboard, { + checker: (self, { + target: el + }) => !(el instanceof HTMLButtonElement) && self.#container.contains(el) && !self.isEnterHandled + }], [[" ", "mac+ "], proto.addNewEditorFromKeyboard, { + checker: (self, { + target: el + }) => !(el instanceof HTMLButtonElement) && self.#container.contains(document.activeElement) + }], [["Escape", "mac+Escape"], proto.unselectAll], [["ArrowLeft", "mac+ArrowLeft"], proto.translateSelectedEditors, { + args: [-small, 0], + checker: arrowChecker + }], [["ctrl+ArrowLeft", "mac+shift+ArrowLeft"], proto.translateSelectedEditors, { + args: [-big, 0], + checker: arrowChecker + }], [["ArrowRight", "mac+ArrowRight"], proto.translateSelectedEditors, { + args: [small, 0], + checker: arrowChecker + }], [["ctrl+ArrowRight", "mac+shift+ArrowRight"], proto.translateSelectedEditors, { + args: [big, 0], + checker: arrowChecker + }], [["ArrowUp", "mac+ArrowUp"], proto.translateSelectedEditors, { + args: [0, -small], + checker: arrowChecker + }], [["ctrl+ArrowUp", "mac+shift+ArrowUp"], proto.translateSelectedEditors, { + args: [0, -big], + checker: arrowChecker + }], [["ArrowDown", "mac+ArrowDown"], proto.translateSelectedEditors, { + args: [0, small], + checker: arrowChecker + }], [["ctrl+ArrowDown", "mac+shift+ArrowDown"], proto.translateSelectedEditors, { + args: [0, big], + checker: arrowChecker + }]])); + } + constructor(container, viewer, altTextManager, eventBus, pdfDocument, pageColors, highlightColors, enableHighlightFloatingButton, enableUpdatedAddImage, enableNewAltTextWhenAddingImage, mlManager, editorUndoBar, supportsPinchToZoom) { + const signal = this._signal = this.#abortController.signal; + this.#container = container; + this.#viewer = viewer; + this.#altTextManager = altTextManager; + this._eventBus = eventBus; + eventBus._on("editingaction", this.onEditingAction.bind(this), { + signal + }); + eventBus._on("pagechanging", this.onPageChanging.bind(this), { + signal + }); + eventBus._on("scalechanging", this.onScaleChanging.bind(this), { + signal + }); + eventBus._on("rotationchanging", this.onRotationChanging.bind(this), { + signal + }); + eventBus._on("setpreference", this.onSetPreference.bind(this), { + signal + }); + eventBus._on("switchannotationeditorparams", evt => this.updateParams(evt.type, evt.value), { + signal + }); + this.#addSelectionListener(); + this.#addDragAndDropListeners(); + this.#addKeyboardManager(); + this.#annotationStorage = pdfDocument.annotationStorage; + this.#filterFactory = pdfDocument.filterFactory; + this.#pageColors = pageColors; + this.#highlightColors = highlightColors || null; + this.#enableHighlightFloatingButton = enableHighlightFloatingButton; + this.#enableUpdatedAddImage = enableUpdatedAddImage; + this.#enableNewAltTextWhenAddingImage = enableNewAltTextWhenAddingImage; + this.#mlManager = mlManager || null; + this.viewParameters = { + realScale: PixelsPerInch.PDF_TO_CSS_UNITS, + rotation: 0 + }; + this.isShiftKeyDown = false; + this._editorUndoBar = editorUndoBar || null; + this._supportsPinchToZoom = supportsPinchToZoom !== false; + } + destroy() { + this.#updateModeCapability?.resolve(); + this.#updateModeCapability = null; + this.#abortController?.abort(); + this.#abortController = null; + this._signal = null; + for (const layer of this.#allLayers.values()) { + layer.destroy(); + } + this.#allLayers.clear(); + this.#allEditors.clear(); + this.#editorsToRescale.clear(); + this.#activeEditor = null; + this.#selectedEditors.clear(); + this.#commandManager.destroy(); + this.#altTextManager?.destroy(); + this.#highlightToolbar?.hide(); + this.#highlightToolbar = null; + if (this.#focusMainContainerTimeoutId) { + clearTimeout(this.#focusMainContainerTimeoutId); + this.#focusMainContainerTimeoutId = null; + } + if (this.#translationTimeoutId) { + clearTimeout(this.#translationTimeoutId); + this.#translationTimeoutId = null; + } + this._editorUndoBar?.destroy(); + } + combinedSignal(ac) { + return AbortSignal.any([this._signal, ac.signal]); + } + get mlManager() { + return this.#mlManager; + } + get useNewAltTextFlow() { + return this.#enableUpdatedAddImage; + } + get useNewAltTextWhenAddingImage() { + return this.#enableNewAltTextWhenAddingImage; + } + get hcmFilter() { + return shadow(this, "hcmFilter", this.#pageColors ? this.#filterFactory.addHCMFilter(this.#pageColors.foreground, this.#pageColors.background) : "none"); + } + get direction() { + return shadow(this, "direction", getComputedStyle(this.#container).direction); + } + get highlightColors() { + return shadow(this, "highlightColors", this.#highlightColors ? new Map(this.#highlightColors.split(",").map(pair => pair.split("=").map(x => x.trim()))) : null); + } + get highlightColorNames() { + return shadow(this, "highlightColorNames", this.highlightColors ? new Map(Array.from(this.highlightColors, e => e.reverse())) : null); + } + setCurrentDrawingSession(layer) { + if (layer) { + this.unselectAll(); + this.disableUserSelect(true); + } else { + this.disableUserSelect(false); + } + this.#currentDrawingSession = layer; + } + setMainHighlightColorPicker(colorPicker) { + this.#mainHighlightColorPicker = colorPicker; + } + editAltText(editor, firstTime = false) { + this.#altTextManager?.editAltText(this, editor, firstTime); + } + switchToMode(mode, callback) { + this._eventBus.on("annotationeditormodechanged", callback, { + once: true, + signal: this._signal + }); + this._eventBus.dispatch("showannotationeditorui", { + source: this, + mode + }); + } + setPreference(name, value) { + this._eventBus.dispatch("setpreference", { + source: this, + name, + value + }); + } + onSetPreference({ + name, + value + }) { + switch (name) { + case "enableNewAltTextWhenAddingImage": + this.#enableNewAltTextWhenAddingImage = value; + break; + } + } + onPageChanging({ + pageNumber + }) { + this.#currentPageIndex = pageNumber - 1; + } + focusMainContainer() { + this.#container.focus(); + } + findParent(x, y) { + for (const layer of this.#allLayers.values()) { + const { + x: layerX, + y: layerY, + width, + height + } = layer.div.getBoundingClientRect(); + if (x >= layerX && x <= layerX + width && y >= layerY && y <= layerY + height) { + return layer; + } + } + return null; + } + disableUserSelect(value = false) { + this.#viewer.classList.toggle("noUserSelect", value); + } + addShouldRescale(editor) { + this.#editorsToRescale.add(editor); + } + removeShouldRescale(editor) { + this.#editorsToRescale.delete(editor); + } + onScaleChanging({ + scale + }) { + this.commitOrRemove(); + this.viewParameters.realScale = scale * PixelsPerInch.PDF_TO_CSS_UNITS; + for (const editor of this.#editorsToRescale) { + editor.onScaleChanging(); + } + this.#currentDrawingSession?.onScaleChanging(); + } + onRotationChanging({ + pagesRotation + }) { + this.commitOrRemove(); + this.viewParameters.rotation = pagesRotation; + } + #getAnchorElementForSelection({ + anchorNode + }) { + return anchorNode.nodeType === Node.TEXT_NODE ? anchorNode.parentElement : anchorNode; + } + #getLayerForTextLayer(textLayer) { + const { + currentLayer + } = this; + if (currentLayer.hasTextLayer(textLayer)) { + return currentLayer; + } + for (const layer of this.#allLayers.values()) { + if (layer.hasTextLayer(textLayer)) { + return layer; + } + } + return null; + } + highlightSelection(methodOfCreation = "") { + const selection = document.getSelection(); + if (!selection || selection.isCollapsed) { + return; + } + const { + anchorNode, + anchorOffset, + focusNode, + focusOffset + } = selection; + const text = selection.toString(); + const anchorElement = this.#getAnchorElementForSelection(selection); + const textLayer = anchorElement.closest(".textLayer"); + const boxes = this.getSelectionBoxes(textLayer); + if (!boxes) { + return; + } + selection.empty(); + const layer = this.#getLayerForTextLayer(textLayer); + const isNoneMode = this.#mode === AnnotationEditorType.NONE; + const callback = () => { + layer?.createAndAddNewEditor({ + x: 0, + y: 0 + }, false, { + methodOfCreation, + boxes, + anchorNode, + anchorOffset, + focusNode, + focusOffset, + text + }); + if (isNoneMode) { + this.showAllEditors("highlight", true, true); + } + }; + if (isNoneMode) { + this.switchToMode(AnnotationEditorType.HIGHLIGHT, callback); + return; + } + callback(); + } + #displayHighlightToolbar() { + const selection = document.getSelection(); + if (!selection || selection.isCollapsed) { + return; + } + const anchorElement = this.#getAnchorElementForSelection(selection); + const textLayer = anchorElement.closest(".textLayer"); + const boxes = this.getSelectionBoxes(textLayer); + if (!boxes) { + return; + } + this.#highlightToolbar ||= new HighlightToolbar(this); + this.#highlightToolbar.show(textLayer, boxes, this.direction === "ltr"); + } + addToAnnotationStorage(editor) { + if (!editor.isEmpty() && this.#annotationStorage && !this.#annotationStorage.has(editor.id)) { + this.#annotationStorage.setValue(editor.id, editor); + } + } + #selectionChange() { + const selection = document.getSelection(); + if (!selection || selection.isCollapsed) { + if (this.#selectedTextNode) { + this.#highlightToolbar?.hide(); + this.#selectedTextNode = null; + this.#dispatchUpdateStates({ + hasSelectedText: false + }); + } + return; + } + const { + anchorNode + } = selection; + if (anchorNode === this.#selectedTextNode) { + return; + } + const anchorElement = this.#getAnchorElementForSelection(selection); + const textLayer = anchorElement.closest(".textLayer"); + if (!textLayer) { + if (this.#selectedTextNode) { + this.#highlightToolbar?.hide(); + this.#selectedTextNode = null; + this.#dispatchUpdateStates({ + hasSelectedText: false + }); + } + return; + } + this.#highlightToolbar?.hide(); + this.#selectedTextNode = anchorNode; + this.#dispatchUpdateStates({ + hasSelectedText: true + }); + if (this.#mode !== AnnotationEditorType.HIGHLIGHT && this.#mode !== AnnotationEditorType.NONE) { + return; + } + if (this.#mode === AnnotationEditorType.HIGHLIGHT) { + this.showAllEditors("highlight", true, true); + } + this.#highlightWhenShiftUp = this.isShiftKeyDown; + if (!this.isShiftKeyDown) { + const activeLayer = this.#mode === AnnotationEditorType.HIGHLIGHT ? this.#getLayerForTextLayer(textLayer) : null; + activeLayer?.toggleDrawing(); + const ac = new AbortController(); + const signal = this.combinedSignal(ac); + const pointerup = e => { + if (e.type === "pointerup" && e.button !== 0) { + return; + } + ac.abort(); + activeLayer?.toggleDrawing(true); + if (e.type === "pointerup") { + this.#onSelectEnd("main_toolbar"); + } + }; + window.addEventListener("pointerup", pointerup, { + signal + }); + window.addEventListener("blur", pointerup, { + signal + }); + } + } + #onSelectEnd(methodOfCreation = "") { + if (this.#mode === AnnotationEditorType.HIGHLIGHT) { + this.highlightSelection(methodOfCreation); + } else if (this.#enableHighlightFloatingButton) { + this.#displayHighlightToolbar(); + } + } + #addSelectionListener() { + document.addEventListener("selectionchange", this.#selectionChange.bind(this), { + signal: this._signal + }); + } + #addFocusManager() { + if (this.#focusManagerAC) { + return; + } + this.#focusManagerAC = new AbortController(); + const signal = this.combinedSignal(this.#focusManagerAC); + window.addEventListener("focus", this.focus.bind(this), { + signal + }); + window.addEventListener("blur", this.blur.bind(this), { + signal + }); + } + #removeFocusManager() { + this.#focusManagerAC?.abort(); + this.#focusManagerAC = null; + } + blur() { + this.isShiftKeyDown = false; + if (this.#highlightWhenShiftUp) { + this.#highlightWhenShiftUp = false; + this.#onSelectEnd("main_toolbar"); + } + if (!this.hasSelection) { + return; + } + const { + activeElement + } = document; + for (const editor of this.#selectedEditors) { + if (editor.div.contains(activeElement)) { + this.#lastActiveElement = [editor, activeElement]; + editor._focusEventsAllowed = false; + break; + } + } + } + focus() { + if (!this.#lastActiveElement) { + return; + } + const [lastEditor, lastActiveElement] = this.#lastActiveElement; + this.#lastActiveElement = null; + lastActiveElement.addEventListener("focusin", () => { + lastEditor._focusEventsAllowed = true; + }, { + once: true, + signal: this._signal + }); + lastActiveElement.focus(); + } + #addKeyboardManager() { + if (this.#keyboardManagerAC) { + return; + } + this.#keyboardManagerAC = new AbortController(); + const signal = this.combinedSignal(this.#keyboardManagerAC); + window.addEventListener("keydown", this.keydown.bind(this), { + signal + }); + window.addEventListener("keyup", this.keyup.bind(this), { + signal + }); + } + #removeKeyboardManager() { + this.#keyboardManagerAC?.abort(); + this.#keyboardManagerAC = null; + } + #addCopyPasteListeners() { + if (this.#copyPasteAC) { + return; + } + this.#copyPasteAC = new AbortController(); + const signal = this.combinedSignal(this.#copyPasteAC); + document.addEventListener("copy", this.copy.bind(this), { + signal + }); + document.addEventListener("cut", this.cut.bind(this), { + signal + }); + document.addEventListener("paste", this.paste.bind(this), { + signal + }); + } + #removeCopyPasteListeners() { + this.#copyPasteAC?.abort(); + this.#copyPasteAC = null; + } + #addDragAndDropListeners() { + const signal = this._signal; + document.addEventListener("dragover", this.dragOver.bind(this), { + signal + }); + document.addEventListener("drop", this.drop.bind(this), { + signal + }); + } + addEditListeners() { + this.#addKeyboardManager(); + this.#addCopyPasteListeners(); + } + removeEditListeners() { + this.#removeKeyboardManager(); + this.#removeCopyPasteListeners(); + } + dragOver(event) { + for (const { + type + } of event.dataTransfer.items) { + for (const editorType of this.#editorTypes) { + if (editorType.isHandlingMimeForPasting(type)) { + event.dataTransfer.dropEffect = "copy"; + event.preventDefault(); + return; + } + } + } + } + drop(event) { + for (const item of event.dataTransfer.items) { + for (const editorType of this.#editorTypes) { + if (editorType.isHandlingMimeForPasting(item.type)) { + editorType.paste(item, this.currentLayer); + event.preventDefault(); + return; + } + } + } + } + copy(event) { + event.preventDefault(); + this.#activeEditor?.commitOrRemove(); + if (!this.hasSelection) { + return; + } + const editors = []; + for (const editor of this.#selectedEditors) { + const serialized = editor.serialize(true); + if (serialized) { + editors.push(serialized); + } + } + if (editors.length === 0) { + return; + } + event.clipboardData.setData("application/pdfjs", JSON.stringify(editors)); + } + cut(event) { + this.copy(event); + this.delete(); + } + async paste(event) { + event.preventDefault(); + const { + clipboardData + } = event; + for (const item of clipboardData.items) { + for (const editorType of this.#editorTypes) { + if (editorType.isHandlingMimeForPasting(item.type)) { + editorType.paste(item, this.currentLayer); + return; + } + } + } + let data = clipboardData.getData("application/pdfjs"); + if (!data) { + return; + } + try { + data = JSON.parse(data); + } catch (ex) { + warn(`paste: "${ex.message}".`); + return; + } + if (!Array.isArray(data)) { + return; + } + this.unselectAll(); + const layer = this.currentLayer; + try { + const newEditors = []; + for (const editor of data) { + const deserializedEditor = await layer.deserialize(editor); + if (!deserializedEditor) { + return; + } + newEditors.push(deserializedEditor); + } + const cmd = () => { + for (const editor of newEditors) { + this.#addEditorToLayer(editor); + } + this.#selectEditors(newEditors); + }; + const undo = () => { + for (const editor of newEditors) { + editor.remove(); + } + }; + this.addCommands({ + cmd, + undo, + mustExec: true + }); + } catch (ex) { + warn(`paste: "${ex.message}".`); + } + } + keydown(event) { + if (!this.isShiftKeyDown && event.key === "Shift") { + this.isShiftKeyDown = true; + } + if (this.#mode !== AnnotationEditorType.NONE && !this.isEditorHandlingKeyboard) { + AnnotationEditorUIManager._keyboardManager.exec(this, event); + } + } + keyup(event) { + if (this.isShiftKeyDown && event.key === "Shift") { + this.isShiftKeyDown = false; + if (this.#highlightWhenShiftUp) { + this.#highlightWhenShiftUp = false; + this.#onSelectEnd("main_toolbar"); + } + } + } + onEditingAction({ + name + }) { + switch (name) { + case "undo": + case "redo": + case "delete": + case "selectAll": + this[name](); + break; + case "highlightSelection": + this.highlightSelection("context_menu"); + break; + } + } + #dispatchUpdateStates(details) { + const hasChanged = Object.entries(details).some(([key, value]) => this.#previousStates[key] !== value); + if (hasChanged) { + this._eventBus.dispatch("annotationeditorstateschanged", { + source: this, + details: Object.assign(this.#previousStates, details) + }); + if (this.#mode === AnnotationEditorType.HIGHLIGHT && details.hasSelectedEditor === false) { + this.#dispatchUpdateUI([[AnnotationEditorParamsType.HIGHLIGHT_FREE, true]]); + } + } + } + #dispatchUpdateUI(details) { + this._eventBus.dispatch("annotationeditorparamschanged", { + source: this, + details + }); + } + setEditingState(isEditing) { + if (isEditing) { + this.#addFocusManager(); + this.#addCopyPasteListeners(); + this.#dispatchUpdateStates({ + isEditing: this.#mode !== AnnotationEditorType.NONE, + isEmpty: this.#isEmpty(), + hasSomethingToUndo: this.#commandManager.hasSomethingToUndo(), + hasSomethingToRedo: this.#commandManager.hasSomethingToRedo(), + hasSelectedEditor: false + }); + } else { + this.#removeFocusManager(); + this.#removeCopyPasteListeners(); + this.#dispatchUpdateStates({ + isEditing: false + }); + this.disableUserSelect(false); + } + } + registerEditorTypes(types) { + if (this.#editorTypes) { + return; + } + this.#editorTypes = types; + for (const editorType of this.#editorTypes) { + this.#dispatchUpdateUI(editorType.defaultPropertiesToUpdate); + } + } + getId() { + return this.#idManager.id; + } + get currentLayer() { + return this.#allLayers.get(this.#currentPageIndex); + } + getLayer(pageIndex) { + return this.#allLayers.get(pageIndex); + } + get currentPageIndex() { + return this.#currentPageIndex; + } + addLayer(layer) { + this.#allLayers.set(layer.pageIndex, layer); + if (this.#isEnabled) { + layer.enable(); + } else { + layer.disable(); + } + } + removeLayer(layer) { + this.#allLayers.delete(layer.pageIndex); + } + async updateMode(mode, editId = null, isFromKeyboard = false) { + if (this.#mode === mode) { + return; + } + if (this.#updateModeCapability) { + await this.#updateModeCapability.promise; + if (!this.#updateModeCapability) { + return; + } + } + this.#updateModeCapability = Promise.withResolvers(); + this.#mode = mode; + if (mode === AnnotationEditorType.NONE) { + this.setEditingState(false); + this.#disableAll(); + this._editorUndoBar?.hide(); + this.#updateModeCapability.resolve(); + return; + } + this.setEditingState(true); + await this.#enableAll(); + this.unselectAll(); + for (const layer of this.#allLayers.values()) { + layer.updateMode(mode); + } + if (!editId) { + if (isFromKeyboard) { + this.addNewEditorFromKeyboard(); + } + this.#updateModeCapability.resolve(); + return; + } + for (const editor of this.#allEditors.values()) { + if (editor.annotationElementId === editId) { + this.setSelected(editor); + editor.enterInEditMode(); + } else { + editor.unselect(); + } + } + this.#updateModeCapability.resolve(); + } + addNewEditorFromKeyboard() { + if (this.currentLayer.canCreateNewEmptyEditor()) { + this.currentLayer.addNewEditor(); + } + } + updateToolbar(mode) { + if (mode === this.#mode) { + return; + } + this._eventBus.dispatch("switchannotationeditormode", { + source: this, + mode + }); + } + updateParams(type, value) { + if (!this.#editorTypes) { + return; + } + switch (type) { + case AnnotationEditorParamsType.CREATE: + this.currentLayer.addNewEditor(); + return; + case AnnotationEditorParamsType.HIGHLIGHT_DEFAULT_COLOR: + this.#mainHighlightColorPicker?.updateColor(value); + break; + case AnnotationEditorParamsType.HIGHLIGHT_SHOW_ALL: + this._eventBus.dispatch("reporttelemetry", { + source: this, + details: { + type: "editing", + data: { + type: "highlight", + action: "toggle_visibility" + } + } + }); + (this.#showAllStates ||= new Map()).set(type, value); + this.showAllEditors("highlight", value); + break; + } + for (const editor of this.#selectedEditors) { + editor.updateParams(type, value); + } + for (const editorType of this.#editorTypes) { + editorType.updateDefaultParams(type, value); + } + } + showAllEditors(type, visible, updateButton = false) { + for (const editor of this.#allEditors.values()) { + if (editor.editorType === type) { + editor.show(visible); + } + } + const state = this.#showAllStates?.get(AnnotationEditorParamsType.HIGHLIGHT_SHOW_ALL) ?? true; + if (state !== visible) { + this.#dispatchUpdateUI([[AnnotationEditorParamsType.HIGHLIGHT_SHOW_ALL, visible]]); + } + } + enableWaiting(mustWait = false) { + if (this.#isWaiting === mustWait) { + return; + } + this.#isWaiting = mustWait; + for (const layer of this.#allLayers.values()) { + if (mustWait) { + layer.disableClick(); + } else { + layer.enableClick(); + } + layer.div.classList.toggle("waiting", mustWait); + } + } + async #enableAll() { + if (!this.#isEnabled) { + this.#isEnabled = true; + const promises = []; + for (const layer of this.#allLayers.values()) { + promises.push(layer.enable()); + } + await Promise.all(promises); + for (const editor of this.#allEditors.values()) { + editor.enable(); + } + } + } + #disableAll() { + this.unselectAll(); + if (this.#isEnabled) { + this.#isEnabled = false; + for (const layer of this.#allLayers.values()) { + layer.disable(); + } + for (const editor of this.#allEditors.values()) { + editor.disable(); + } + } + } + getEditors(pageIndex) { + const editors = []; + for (const editor of this.#allEditors.values()) { + if (editor.pageIndex === pageIndex) { + editors.push(editor); + } + } + return editors; + } + getEditor(id) { + return this.#allEditors.get(id); + } + addEditor(editor) { + this.#allEditors.set(editor.id, editor); + } + removeEditor(editor) { + if (editor.div.contains(document.activeElement)) { + if (this.#focusMainContainerTimeoutId) { + clearTimeout(this.#focusMainContainerTimeoutId); + } + this.#focusMainContainerTimeoutId = setTimeout(() => { + this.focusMainContainer(); + this.#focusMainContainerTimeoutId = null; + }, 0); + } + this.#allEditors.delete(editor.id); + this.unselect(editor); + if (!editor.annotationElementId || !this.#deletedAnnotationsElementIds.has(editor.annotationElementId)) { + this.#annotationStorage?.remove(editor.id); + } + } + addDeletedAnnotationElement(editor) { + this.#deletedAnnotationsElementIds.add(editor.annotationElementId); + this.addChangedExistingAnnotation(editor); + editor.deleted = true; + } + isDeletedAnnotationElement(annotationElementId) { + return this.#deletedAnnotationsElementIds.has(annotationElementId); + } + removeDeletedAnnotationElement(editor) { + this.#deletedAnnotationsElementIds.delete(editor.annotationElementId); + this.removeChangedExistingAnnotation(editor); + editor.deleted = false; + } + #addEditorToLayer(editor) { + const layer = this.#allLayers.get(editor.pageIndex); + if (layer) { + layer.addOrRebuild(editor); + } else { + this.addEditor(editor); + this.addToAnnotationStorage(editor); + } + } + setActiveEditor(editor) { + if (this.#activeEditor === editor) { + return; + } + this.#activeEditor = editor; + if (editor) { + this.#dispatchUpdateUI(editor.propertiesToUpdate); + } + } + get #lastSelectedEditor() { + let ed = null; + for (ed of this.#selectedEditors) {} + return ed; + } + updateUI(editor) { + if (this.#lastSelectedEditor === editor) { + this.#dispatchUpdateUI(editor.propertiesToUpdate); + } + } + updateUIForDefaultProperties(editorType) { + this.#dispatchUpdateUI(editorType.defaultPropertiesToUpdate); + } + toggleSelected(editor) { + if (this.#selectedEditors.has(editor)) { + this.#selectedEditors.delete(editor); + editor.unselect(); + this.#dispatchUpdateStates({ + hasSelectedEditor: this.hasSelection + }); + return; + } + this.#selectedEditors.add(editor); + editor.select(); + this.#dispatchUpdateUI(editor.propertiesToUpdate); + this.#dispatchUpdateStates({ + hasSelectedEditor: true + }); + } + setSelected(editor) { + this.#currentDrawingSession?.commitOrRemove(); + for (const ed of this.#selectedEditors) { + if (ed !== editor) { + ed.unselect(); + } + } + this.#selectedEditors.clear(); + this.#selectedEditors.add(editor); + editor.select(); + this.#dispatchUpdateUI(editor.propertiesToUpdate); + this.#dispatchUpdateStates({ + hasSelectedEditor: true + }); + } + isSelected(editor) { + return this.#selectedEditors.has(editor); + } + get firstSelectedEditor() { + return this.#selectedEditors.values().next().value; + } + unselect(editor) { + editor.unselect(); + this.#selectedEditors.delete(editor); + this.#dispatchUpdateStates({ + hasSelectedEditor: this.hasSelection + }); + } + get hasSelection() { + return this.#selectedEditors.size !== 0; + } + get isEnterHandled() { + return this.#selectedEditors.size === 1 && this.firstSelectedEditor.isEnterHandled; + } + undo() { + this.#commandManager.undo(); + this.#dispatchUpdateStates({ + hasSomethingToUndo: this.#commandManager.hasSomethingToUndo(), + hasSomethingToRedo: true, + isEmpty: this.#isEmpty() + }); + this._editorUndoBar?.hide(); + } + redo() { + this.#commandManager.redo(); + this.#dispatchUpdateStates({ + hasSomethingToUndo: true, + hasSomethingToRedo: this.#commandManager.hasSomethingToRedo(), + isEmpty: this.#isEmpty() + }); + } + addCommands(params) { + this.#commandManager.add(params); + this.#dispatchUpdateStates({ + hasSomethingToUndo: true, + hasSomethingToRedo: false, + isEmpty: this.#isEmpty() + }); + } + cleanUndoStack(type) { + this.#commandManager.cleanType(type); + } + #isEmpty() { + if (this.#allEditors.size === 0) { + return true; + } + if (this.#allEditors.size === 1) { + for (const editor of this.#allEditors.values()) { + return editor.isEmpty(); + } + } + return false; + } + delete() { + this.commitOrRemove(); + const drawingEditor = this.currentLayer?.endDrawingSession(true); + if (!this.hasSelection && !drawingEditor) { + return; + } + const editors = drawingEditor ? [drawingEditor] : [...this.#selectedEditors]; + const cmd = () => { + this._editorUndoBar?.show(undo, editors.length === 1 ? editors[0].editorType : editors.length); + for (const editor of editors) { + editor.remove(); + } + }; + const undo = () => { + for (const editor of editors) { + this.#addEditorToLayer(editor); + } + }; + this.addCommands({ + cmd, + undo, + mustExec: true + }); + } + commitOrRemove() { + this.#activeEditor?.commitOrRemove(); + } + hasSomethingToControl() { + return this.#activeEditor || this.hasSelection; + } + #selectEditors(editors) { + for (const editor of this.#selectedEditors) { + editor.unselect(); + } + this.#selectedEditors.clear(); + for (const editor of editors) { + if (editor.isEmpty()) { + continue; + } + this.#selectedEditors.add(editor); + editor.select(); + } + this.#dispatchUpdateStates({ + hasSelectedEditor: this.hasSelection + }); + } + selectAll() { + for (const editor of this.#selectedEditors) { + editor.commit(); + } + this.#selectEditors(this.#allEditors.values()); + } + unselectAll() { + if (this.#activeEditor) { + this.#activeEditor.commitOrRemove(); + if (this.#mode !== AnnotationEditorType.NONE) { + return; + } + } + if (this.#currentDrawingSession?.commitOrRemove()) { + return; + } + if (!this.hasSelection) { + return; + } + for (const editor of this.#selectedEditors) { + editor.unselect(); + } + this.#selectedEditors.clear(); + this.#dispatchUpdateStates({ + hasSelectedEditor: false + }); + } + translateSelectedEditors(x, y, noCommit = false) { + if (!noCommit) { + this.commitOrRemove(); + } + if (!this.hasSelection) { + return; + } + this.#translation[0] += x; + this.#translation[1] += y; + const [totalX, totalY] = this.#translation; + const editors = [...this.#selectedEditors]; + const TIME_TO_WAIT = 1000; + if (this.#translationTimeoutId) { + clearTimeout(this.#translationTimeoutId); + } + this.#translationTimeoutId = setTimeout(() => { + this.#translationTimeoutId = null; + this.#translation[0] = this.#translation[1] = 0; + this.addCommands({ + cmd: () => { + for (const editor of editors) { + if (this.#allEditors.has(editor.id)) { + editor.translateInPage(totalX, totalY); + } + } + }, + undo: () => { + for (const editor of editors) { + if (this.#allEditors.has(editor.id)) { + editor.translateInPage(-totalX, -totalY); + } + } + }, + mustExec: false + }); + }, TIME_TO_WAIT); + for (const editor of editors) { + editor.translateInPage(x, y); + } + } + setUpDragSession() { + if (!this.hasSelection) { + return; + } + this.disableUserSelect(true); + this.#draggingEditors = new Map(); + for (const editor of this.#selectedEditors) { + this.#draggingEditors.set(editor, { + savedX: editor.x, + savedY: editor.y, + savedPageIndex: editor.pageIndex, + newX: 0, + newY: 0, + newPageIndex: -1 + }); + } + } + endDragSession() { + if (!this.#draggingEditors) { + return false; + } + this.disableUserSelect(false); + const map = this.#draggingEditors; + this.#draggingEditors = null; + let mustBeAddedInUndoStack = false; + for (const [{ + x, + y, + pageIndex + }, value] of map) { + value.newX = x; + value.newY = y; + value.newPageIndex = pageIndex; + mustBeAddedInUndoStack ||= x !== value.savedX || y !== value.savedY || pageIndex !== value.savedPageIndex; + } + if (!mustBeAddedInUndoStack) { + return false; + } + const move = (editor, x, y, pageIndex) => { + if (this.#allEditors.has(editor.id)) { + const parent = this.#allLayers.get(pageIndex); + if (parent) { + editor._setParentAndPosition(parent, x, y); + } else { + editor.pageIndex = pageIndex; + editor.x = x; + editor.y = y; + } + } + }; + this.addCommands({ + cmd: () => { + for (const [editor, { + newX, + newY, + newPageIndex + }] of map) { + move(editor, newX, newY, newPageIndex); + } + }, + undo: () => { + for (const [editor, { + savedX, + savedY, + savedPageIndex + }] of map) { + move(editor, savedX, savedY, savedPageIndex); + } + }, + mustExec: true + }); + return true; + } + dragSelectedEditors(tx, ty) { + if (!this.#draggingEditors) { + return; + } + for (const editor of this.#draggingEditors.keys()) { + editor.drag(tx, ty); + } + } + rebuild(editor) { + if (editor.parent === null) { + const parent = this.getLayer(editor.pageIndex); + if (parent) { + parent.changeParent(editor); + parent.addOrRebuild(editor); + } else { + this.addEditor(editor); + this.addToAnnotationStorage(editor); + editor.rebuild(); + } + } else { + editor.parent.addOrRebuild(editor); + } + } + get isEditorHandlingKeyboard() { + return this.getActive()?.shouldGetKeyboardEvents() || this.#selectedEditors.size === 1 && this.firstSelectedEditor.shouldGetKeyboardEvents(); + } + isActive(editor) { + return this.#activeEditor === editor; + } + getActive() { + return this.#activeEditor; + } + getMode() { + return this.#mode; + } + get imageManager() { + return shadow(this, "imageManager", new ImageManager()); + } + getSelectionBoxes(textLayer) { + if (!textLayer) { + return null; + } + const selection = document.getSelection(); + for (let i = 0, ii = selection.rangeCount; i < ii; i++) { + if (!textLayer.contains(selection.getRangeAt(i).commonAncestorContainer)) { + return null; + } + } + const { + x: layerX, + y: layerY, + width: parentWidth, + height: parentHeight + } = textLayer.getBoundingClientRect(); + let rotator; + switch (textLayer.getAttribute("data-main-rotation")) { + case "90": + rotator = (x, y, w, h) => ({ + x: (y - layerY) / parentHeight, + y: 1 - (x + w - layerX) / parentWidth, + width: h / parentHeight, + height: w / parentWidth + }); + break; + case "180": + rotator = (x, y, w, h) => ({ + x: 1 - (x + w - layerX) / parentWidth, + y: 1 - (y + h - layerY) / parentHeight, + width: w / parentWidth, + height: h / parentHeight + }); + break; + case "270": + rotator = (x, y, w, h) => ({ + x: 1 - (y + h - layerY) / parentHeight, + y: (x - layerX) / parentWidth, + width: h / parentHeight, + height: w / parentWidth + }); + break; + default: + rotator = (x, y, w, h) => ({ + x: (x - layerX) / parentWidth, + y: (y - layerY) / parentHeight, + width: w / parentWidth, + height: h / parentHeight + }); + break; + } + const boxes = []; + for (let i = 0, ii = selection.rangeCount; i < ii; i++) { + const range = selection.getRangeAt(i); + if (range.collapsed) { + continue; + } + for (const { + x, + y, + width, + height + } of range.getClientRects()) { + if (width === 0 || height === 0) { + continue; + } + boxes.push(rotator(x, y, width, height)); + } + } + return boxes.length === 0 ? null : boxes; + } + addChangedExistingAnnotation({ + annotationElementId, + id + }) { + (this.#changedExistingAnnotations ||= new Map()).set(annotationElementId, id); + } + removeChangedExistingAnnotation({ + annotationElementId + }) { + this.#changedExistingAnnotations?.delete(annotationElementId); + } + renderAnnotationElement(annotation) { + const editorId = this.#changedExistingAnnotations?.get(annotation.data.id); + if (!editorId) { + return; + } + const editor = this.#annotationStorage.getRawValue(editorId); + if (!editor) { + return; + } + if (this.#mode === AnnotationEditorType.NONE && !editor.hasBeenModified) { + return; + } + editor.renderAnnotationElement(annotation); + } +} + +;// ./src/display/editor/alt_text.js + +class AltText { + #altText = null; + #altTextDecorative = false; + #altTextButton = null; + #altTextButtonLabel = null; + #altTextTooltip = null; + #altTextTooltipTimeout = null; + #altTextWasFromKeyBoard = false; + #badge = null; + #editor = null; + #guessedText = null; + #textWithDisclaimer = null; + #useNewAltTextFlow = false; + static #l10nNewButton = null; + static _l10n = null; + constructor(editor) { + this.#editor = editor; + this.#useNewAltTextFlow = editor._uiManager.useNewAltTextFlow; + AltText.#l10nNewButton ||= Object.freeze({ + added: "pdfjs-editor-new-alt-text-added-button", + "added-label": "pdfjs-editor-new-alt-text-added-button-label", + missing: "pdfjs-editor-new-alt-text-missing-button", + "missing-label": "pdfjs-editor-new-alt-text-missing-button-label", + review: "pdfjs-editor-new-alt-text-to-review-button", + "review-label": "pdfjs-editor-new-alt-text-to-review-button-label" + }); + } + static initialize(l10n) { + AltText._l10n ??= l10n; + } + async render() { + const altText = this.#altTextButton = document.createElement("button"); + altText.className = "altText"; + altText.tabIndex = "0"; + const label = this.#altTextButtonLabel = document.createElement("span"); + altText.append(label); + if (this.#useNewAltTextFlow) { + altText.classList.add("new"); + altText.setAttribute("data-l10n-id", AltText.#l10nNewButton.missing); + label.setAttribute("data-l10n-id", AltText.#l10nNewButton["missing-label"]); + } else { + altText.setAttribute("data-l10n-id", "pdfjs-editor-alt-text-button"); + label.setAttribute("data-l10n-id", "pdfjs-editor-alt-text-button-label"); + } + const signal = this.#editor._uiManager._signal; + altText.addEventListener("contextmenu", noContextMenu, { + signal + }); + altText.addEventListener("pointerdown", event => event.stopPropagation(), { + signal + }); + const onClick = event => { + event.preventDefault(); + this.#editor._uiManager.editAltText(this.#editor); + if (this.#useNewAltTextFlow) { + this.#editor._reportTelemetry({ + action: "pdfjs.image.alt_text.image_status_label_clicked", + data: { + label: this.#label + } + }); + } + }; + altText.addEventListener("click", onClick, { + capture: true, + signal + }); + altText.addEventListener("keydown", event => { + if (event.target === altText && event.key === "Enter") { + this.#altTextWasFromKeyBoard = true; + onClick(event); + } + }, { + signal + }); + await this.#setState(); + return altText; + } + get #label() { + return this.#altText && "added" || this.#altText === null && this.guessedText && "review" || "missing"; + } + finish() { + if (!this.#altTextButton) { + return; + } + this.#altTextButton.focus({ + focusVisible: this.#altTextWasFromKeyBoard + }); + this.#altTextWasFromKeyBoard = false; + } + isEmpty() { + if (this.#useNewAltTextFlow) { + return this.#altText === null; + } + return !this.#altText && !this.#altTextDecorative; + } + hasData() { + if (this.#useNewAltTextFlow) { + return this.#altText !== null || !!this.#guessedText; + } + return this.isEmpty(); + } + get guessedText() { + return this.#guessedText; + } + async setGuessedText(guessedText) { + if (this.#altText !== null) { + return; + } + this.#guessedText = guessedText; + this.#textWithDisclaimer = await AltText._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer", { + generatedAltText: guessedText + }); + this.#setState(); + } + toggleAltTextBadge(visibility = false) { + if (!this.#useNewAltTextFlow || this.#altText) { + this.#badge?.remove(); + this.#badge = null; + return; + } + if (!this.#badge) { + const badge = this.#badge = document.createElement("div"); + badge.className = "noAltTextBadge"; + this.#editor.div.append(badge); + } + this.#badge.classList.toggle("hidden", !visibility); + } + serialize(isForCopying) { + let altText = this.#altText; + if (!isForCopying && this.#guessedText === altText) { + altText = this.#textWithDisclaimer; + } + return { + altText, + decorative: this.#altTextDecorative, + guessedText: this.#guessedText, + textWithDisclaimer: this.#textWithDisclaimer + }; + } + get data() { + return { + altText: this.#altText, + decorative: this.#altTextDecorative + }; + } + set data({ + altText, + decorative, + guessedText, + textWithDisclaimer, + cancel = false + }) { + if (guessedText) { + this.#guessedText = guessedText; + this.#textWithDisclaimer = textWithDisclaimer; + } + if (this.#altText === altText && this.#altTextDecorative === decorative) { + return; + } + if (!cancel) { + this.#altText = altText; + this.#altTextDecorative = decorative; + } + this.#setState(); + } + toggle(enabled = false) { + if (!this.#altTextButton) { + return; + } + if (!enabled && this.#altTextTooltipTimeout) { + clearTimeout(this.#altTextTooltipTimeout); + this.#altTextTooltipTimeout = null; + } + this.#altTextButton.disabled = !enabled; + } + shown() { + this.#editor._reportTelemetry({ + action: "pdfjs.image.alt_text.image_status_label_displayed", + data: { + label: this.#label + } + }); + } + destroy() { + this.#altTextButton?.remove(); + this.#altTextButton = null; + this.#altTextButtonLabel = null; + this.#altTextTooltip = null; + this.#badge?.remove(); + this.#badge = null; + } + async #setState() { + const button = this.#altTextButton; + if (!button) { + return; + } + if (this.#useNewAltTextFlow) { + button.classList.toggle("done", !!this.#altText); + button.setAttribute("data-l10n-id", AltText.#l10nNewButton[this.#label]); + this.#altTextButtonLabel?.setAttribute("data-l10n-id", AltText.#l10nNewButton[`${this.#label}-label`]); + if (!this.#altText) { + this.#altTextTooltip?.remove(); + return; + } + } else { + if (!this.#altText && !this.#altTextDecorative) { + button.classList.remove("done"); + this.#altTextTooltip?.remove(); + return; + } + button.classList.add("done"); + button.setAttribute("data-l10n-id", "pdfjs-editor-alt-text-edit-button"); + } + let tooltip = this.#altTextTooltip; + if (!tooltip) { + this.#altTextTooltip = tooltip = document.createElement("span"); + tooltip.className = "tooltip"; + tooltip.setAttribute("role", "tooltip"); + tooltip.id = `alt-text-tooltip-${this.#editor.id}`; + const DELAY_TO_SHOW_TOOLTIP = 100; + const signal = this.#editor._uiManager._signal; + signal.addEventListener("abort", () => { + clearTimeout(this.#altTextTooltipTimeout); + this.#altTextTooltipTimeout = null; + }, { + once: true + }); + button.addEventListener("mouseenter", () => { + this.#altTextTooltipTimeout = setTimeout(() => { + this.#altTextTooltipTimeout = null; + this.#altTextTooltip.classList.add("show"); + this.#editor._reportTelemetry({ + action: "alt_text_tooltip" + }); + }, DELAY_TO_SHOW_TOOLTIP); + }, { + signal + }); + button.addEventListener("mouseleave", () => { + if (this.#altTextTooltipTimeout) { + clearTimeout(this.#altTextTooltipTimeout); + this.#altTextTooltipTimeout = null; + } + this.#altTextTooltip?.classList.remove("show"); + }, { + signal + }); + } + if (this.#altTextDecorative) { + tooltip.setAttribute("data-l10n-id", "pdfjs-editor-alt-text-decorative-tooltip"); + } else { + tooltip.removeAttribute("data-l10n-id"); + tooltip.textContent = this.#altText; + } + if (!tooltip.parentNode) { + button.append(tooltip); + } + const element = this.#editor.getImageForAltText(); + element?.setAttribute("aria-describedby", tooltip.id); + } +} + +;// ./src/display/touch_manager.js + + +class TouchManager { + #container; + #isPinching = false; + #isPinchingStopped = null; + #isPinchingDisabled; + #onPinchStart; + #onPinching; + #onPinchEnd; + #signal; + #touchInfo = null; + #touchManagerAC; + #touchMoveAC = null; + constructor({ + container, + isPinchingDisabled = null, + isPinchingStopped = null, + onPinchStart = null, + onPinching = null, + onPinchEnd = null, + signal + }) { + this.#container = container; + this.#isPinchingStopped = isPinchingStopped; + this.#isPinchingDisabled = isPinchingDisabled; + this.#onPinchStart = onPinchStart; + this.#onPinching = onPinching; + this.#onPinchEnd = onPinchEnd; + this.#touchManagerAC = new AbortController(); + this.#signal = AbortSignal.any([signal, this.#touchManagerAC.signal]); + container.addEventListener("touchstart", this.#onTouchStart.bind(this), { + passive: false, + signal: this.#signal + }); + } + get MIN_TOUCH_DISTANCE_TO_PINCH() { + return shadow(this, "MIN_TOUCH_DISTANCE_TO_PINCH", 35 / (window.devicePixelRatio || 1)); + } + #onTouchStart(evt) { + if (this.#isPinchingDisabled?.() || evt.touches.length < 2) { + return; + } + if (!this.#touchMoveAC) { + this.#touchMoveAC = new AbortController(); + const signal = AbortSignal.any([this.#signal, this.#touchMoveAC.signal]); + const container = this.#container; + const opt = { + signal, + passive: false + }; + container.addEventListener("touchmove", this.#onTouchMove.bind(this), opt); + container.addEventListener("touchend", this.#onTouchEnd.bind(this), opt); + container.addEventListener("touchcancel", this.#onTouchEnd.bind(this), opt); + this.#onPinchStart?.(); + } + stopEvent(evt); + if (evt.touches.length !== 2 || this.#isPinchingStopped?.()) { + this.#touchInfo = null; + return; + } + let [touch0, touch1] = evt.touches; + if (touch0.identifier > touch1.identifier) { + [touch0, touch1] = [touch1, touch0]; + } + this.#touchInfo = { + touch0X: touch0.screenX, + touch0Y: touch0.screenY, + touch1X: touch1.screenX, + touch1Y: touch1.screenY + }; + } + #onTouchMove(evt) { + if (!this.#touchInfo || evt.touches.length !== 2) { + return; + } + let [touch0, touch1] = evt.touches; + if (touch0.identifier > touch1.identifier) { + [touch0, touch1] = [touch1, touch0]; + } + const { + screenX: screen0X, + screenY: screen0Y + } = touch0; + const { + screenX: screen1X, + screenY: screen1Y + } = touch1; + const touchInfo = this.#touchInfo; + const { + touch0X: pTouch0X, + touch0Y: pTouch0Y, + touch1X: pTouch1X, + touch1Y: pTouch1Y + } = touchInfo; + const prevGapX = pTouch1X - pTouch0X; + const prevGapY = pTouch1Y - pTouch0Y; + const currGapX = screen1X - screen0X; + const currGapY = screen1Y - screen0Y; + const distance = Math.hypot(currGapX, currGapY) || 1; + const pDistance = Math.hypot(prevGapX, prevGapY) || 1; + if (!this.#isPinching && Math.abs(pDistance - distance) <= TouchManager.MIN_TOUCH_DISTANCE_TO_PINCH) { + return; + } + touchInfo.touch0X = screen0X; + touchInfo.touch0Y = screen0Y; + touchInfo.touch1X = screen1X; + touchInfo.touch1Y = screen1Y; + evt.preventDefault(); + if (!this.#isPinching) { + this.#isPinching = true; + return; + } + const origin = [(screen0X + screen1X) / 2, (screen0Y + screen1Y) / 2]; + this.#onPinching?.(origin, pDistance, distance); + } + #onTouchEnd(evt) { + this.#touchMoveAC.abort(); + this.#touchMoveAC = null; + this.#onPinchEnd?.(); + if (!this.#touchInfo) { + return; + } + evt.preventDefault(); + this.#touchInfo = null; + this.#isPinching = false; + } + destroy() { + this.#touchManagerAC?.abort(); + this.#touchManagerAC = null; + } +} + +;// ./src/display/editor/editor.js + + + + + + +class AnnotationEditor { + #accessibilityData = null; + #allResizerDivs = null; + #altText = null; + #disabled = false; + #dragPointerId = null; + #dragPointerType = ""; + #keepAspectRatio = false; + #resizersDiv = null; + #lastPointerCoords = null; + #savedDimensions = null; + #focusAC = null; + #focusedResizerName = ""; + #hasBeenClicked = false; + #initialRect = null; + #isEditing = false; + #isInEditMode = false; + #isResizerEnabledForKeyboard = false; + #moveInDOMTimeout = null; + #prevDragX = 0; + #prevDragY = 0; + #telemetryTimeouts = null; + #touchManager = null; + _editToolbar = null; + _initialOptions = Object.create(null); + _initialData = null; + _isVisible = true; + _uiManager = null; + _focusEventsAllowed = true; + static _l10n = null; + static _l10nResizer = null; + #isDraggable = false; + #zIndex = AnnotationEditor._zIndex++; + static _borderLineWidth = -1; + static _colorManager = new ColorManager(); + static _zIndex = 1; + static _telemetryTimeout = 1000; + static get _resizerKeyboardManager() { + const resize = AnnotationEditor.prototype._resizeWithKeyboard; + const small = AnnotationEditorUIManager.TRANSLATE_SMALL; + const big = AnnotationEditorUIManager.TRANSLATE_BIG; + return shadow(this, "_resizerKeyboardManager", new KeyboardManager([[["ArrowLeft", "mac+ArrowLeft"], resize, { + args: [-small, 0] + }], [["ctrl+ArrowLeft", "mac+shift+ArrowLeft"], resize, { + args: [-big, 0] + }], [["ArrowRight", "mac+ArrowRight"], resize, { + args: [small, 0] + }], [["ctrl+ArrowRight", "mac+shift+ArrowRight"], resize, { + args: [big, 0] + }], [["ArrowUp", "mac+ArrowUp"], resize, { + args: [0, -small] + }], [["ctrl+ArrowUp", "mac+shift+ArrowUp"], resize, { + args: [0, -big] + }], [["ArrowDown", "mac+ArrowDown"], resize, { + args: [0, small] + }], [["ctrl+ArrowDown", "mac+shift+ArrowDown"], resize, { + args: [0, big] + }], [["Escape", "mac+Escape"], AnnotationEditor.prototype._stopResizingWithKeyboard]])); + } + constructor(parameters) { + this.parent = parameters.parent; + this.id = parameters.id; + this.width = this.height = null; + this.pageIndex = parameters.parent.pageIndex; + this.name = parameters.name; + this.div = null; + this._uiManager = parameters.uiManager; + this.annotationElementId = null; + this._willKeepAspectRatio = false; + this._initialOptions.isCentered = parameters.isCentered; + this._structTreeParentId = null; + const { + rotation, + rawDims: { + pageWidth, + pageHeight, + pageX, + pageY + } + } = this.parent.viewport; + this.rotation = rotation; + this.pageRotation = (360 + rotation - this._uiManager.viewParameters.rotation) % 360; + this.pageDimensions = [pageWidth, pageHeight]; + this.pageTranslation = [pageX, pageY]; + const [width, height] = this.parentDimensions; + this.x = parameters.x / width; + this.y = parameters.y / height; + this.isAttachedToDOM = false; + this.deleted = false; + } + get editorType() { + return Object.getPrototypeOf(this).constructor._type; + } + static get isDrawer() { + return false; + } + static get _defaultLineColor() { + return shadow(this, "_defaultLineColor", this._colorManager.getHexCode("CanvasText")); + } + static deleteAnnotationElement(editor) { + const fakeEditor = new FakeEditor({ + id: editor.parent.getNextId(), + parent: editor.parent, + uiManager: editor._uiManager + }); + fakeEditor.annotationElementId = editor.annotationElementId; + fakeEditor.deleted = true; + fakeEditor._uiManager.addToAnnotationStorage(fakeEditor); + } + static initialize(l10n, _uiManager) { + AnnotationEditor._l10n ??= l10n; + AnnotationEditor._l10nResizer ||= Object.freeze({ + topLeft: "pdfjs-editor-resizer-top-left", + topMiddle: "pdfjs-editor-resizer-top-middle", + topRight: "pdfjs-editor-resizer-top-right", + middleRight: "pdfjs-editor-resizer-middle-right", + bottomRight: "pdfjs-editor-resizer-bottom-right", + bottomMiddle: "pdfjs-editor-resizer-bottom-middle", + bottomLeft: "pdfjs-editor-resizer-bottom-left", + middleLeft: "pdfjs-editor-resizer-middle-left" + }); + if (AnnotationEditor._borderLineWidth !== -1) { + return; + } + const style = getComputedStyle(document.documentElement); + AnnotationEditor._borderLineWidth = parseFloat(style.getPropertyValue("--outline-width")) || 0; + } + static updateDefaultParams(_type, _value) {} + static get defaultPropertiesToUpdate() { + return []; + } + static isHandlingMimeForPasting(mime) { + return false; + } + static paste(item, parent) { + unreachable("Not implemented"); + } + get propertiesToUpdate() { + return []; + } + get _isDraggable() { + return this.#isDraggable; + } + set _isDraggable(value) { + this.#isDraggable = value; + this.div?.classList.toggle("draggable", value); + } + get isEnterHandled() { + return true; + } + center() { + const [pageWidth, pageHeight] = this.pageDimensions; + switch (this.parentRotation) { + case 90: + this.x -= this.height * pageHeight / (pageWidth * 2); + this.y += this.width * pageWidth / (pageHeight * 2); + break; + case 180: + this.x += this.width / 2; + this.y += this.height / 2; + break; + case 270: + this.x += this.height * pageHeight / (pageWidth * 2); + this.y -= this.width * pageWidth / (pageHeight * 2); + break; + default: + this.x -= this.width / 2; + this.y -= this.height / 2; + break; + } + this.fixAndSetPosition(); + } + addCommands(params) { + this._uiManager.addCommands(params); + } + get currentLayer() { + return this._uiManager.currentLayer; + } + setInBackground() { + this.div.style.zIndex = 0; + } + setInForeground() { + this.div.style.zIndex = this.#zIndex; + } + setParent(parent) { + if (parent !== null) { + this.pageIndex = parent.pageIndex; + this.pageDimensions = parent.pageDimensions; + } else { + this.#stopResizing(); + } + this.parent = parent; + } + focusin(event) { + if (!this._focusEventsAllowed) { + return; + } + if (!this.#hasBeenClicked) { + this.parent.setSelected(this); + } else { + this.#hasBeenClicked = false; + } + } + focusout(event) { + if (!this._focusEventsAllowed) { + return; + } + if (!this.isAttachedToDOM) { + return; + } + const target = event.relatedTarget; + if (target?.closest(`#${this.id}`)) { + return; + } + event.preventDefault(); + if (!this.parent?.isMultipleSelection) { + this.commitOrRemove(); + } + } + commitOrRemove() { + if (this.isEmpty()) { + this.remove(); + } else { + this.commit(); + } + } + commit() { + this.addToAnnotationStorage(); + } + addToAnnotationStorage() { + this._uiManager.addToAnnotationStorage(this); + } + setAt(x, y, tx, ty) { + const [width, height] = this.parentDimensions; + [tx, ty] = this.screenToPageTranslation(tx, ty); + this.x = (x + tx) / width; + this.y = (y + ty) / height; + this.fixAndSetPosition(); + } + #translate([width, height], x, y) { + [x, y] = this.screenToPageTranslation(x, y); + this.x += x / width; + this.y += y / height; + this._onTranslating(this.x, this.y); + this.fixAndSetPosition(); + } + translate(x, y) { + this.#translate(this.parentDimensions, x, y); + } + translateInPage(x, y) { + this.#initialRect ||= [this.x, this.y, this.width, this.height]; + this.#translate(this.pageDimensions, x, y); + this.div.scrollIntoView({ + block: "nearest" + }); + } + drag(tx, ty) { + this.#initialRect ||= [this.x, this.y, this.width, this.height]; + const { + div, + parentDimensions: [parentWidth, parentHeight] + } = this; + this.x += tx / parentWidth; + this.y += ty / parentHeight; + if (this.parent && (this.x < 0 || this.x > 1 || this.y < 0 || this.y > 1)) { + const { + x, + y + } = this.div.getBoundingClientRect(); + if (this.parent.findNewParent(this, x, y)) { + this.x -= Math.floor(this.x); + this.y -= Math.floor(this.y); + } + } + let { + x, + y + } = this; + const [bx, by] = this.getBaseTranslation(); + x += bx; + y += by; + const { + style + } = div; + style.left = `${(100 * x).toFixed(2)}%`; + style.top = `${(100 * y).toFixed(2)}%`; + this._onTranslating(x, y); + div.scrollIntoView({ + block: "nearest" + }); + } + _onTranslating(x, y) {} + _onTranslated(x, y) {} + get _hasBeenMoved() { + return !!this.#initialRect && (this.#initialRect[0] !== this.x || this.#initialRect[1] !== this.y); + } + get _hasBeenResized() { + return !!this.#initialRect && (this.#initialRect[2] !== this.width || this.#initialRect[3] !== this.height); + } + getBaseTranslation() { + const [parentWidth, parentHeight] = this.parentDimensions; + const { + _borderLineWidth + } = AnnotationEditor; + const x = _borderLineWidth / parentWidth; + const y = _borderLineWidth / parentHeight; + switch (this.rotation) { + case 90: + return [-x, y]; + case 180: + return [x, y]; + case 270: + return [x, -y]; + default: + return [-x, -y]; + } + } + get _mustFixPosition() { + return true; + } + fixAndSetPosition(rotation = this.rotation) { + const { + div: { + style + }, + pageDimensions: [pageWidth, pageHeight] + } = this; + let { + x, + y, + width, + height + } = this; + width *= pageWidth; + height *= pageHeight; + x *= pageWidth; + y *= pageHeight; + if (this._mustFixPosition) { + switch (rotation) { + case 0: + x = Math.max(0, Math.min(pageWidth - width, x)); + y = Math.max(0, Math.min(pageHeight - height, y)); + break; + case 90: + x = Math.max(0, Math.min(pageWidth - height, x)); + y = Math.min(pageHeight, Math.max(width, y)); + break; + case 180: + x = Math.min(pageWidth, Math.max(width, x)); + y = Math.min(pageHeight, Math.max(height, y)); + break; + case 270: + x = Math.min(pageWidth, Math.max(height, x)); + y = Math.max(0, Math.min(pageHeight - width, y)); + break; + } + } + this.x = x /= pageWidth; + this.y = y /= pageHeight; + const [bx, by] = this.getBaseTranslation(); + x += bx; + y += by; + style.left = `${(100 * x).toFixed(2)}%`; + style.top = `${(100 * y).toFixed(2)}%`; + this.moveInDOM(); + } + static #rotatePoint(x, y, angle) { + switch (angle) { + case 90: + return [y, -x]; + case 180: + return [-x, -y]; + case 270: + return [-y, x]; + default: + return [x, y]; + } + } + screenToPageTranslation(x, y) { + return AnnotationEditor.#rotatePoint(x, y, this.parentRotation); + } + pageTranslationToScreen(x, y) { + return AnnotationEditor.#rotatePoint(x, y, 360 - this.parentRotation); + } + #getRotationMatrix(rotation) { + switch (rotation) { + case 90: + { + const [pageWidth, pageHeight] = this.pageDimensions; + return [0, -pageWidth / pageHeight, pageHeight / pageWidth, 0]; + } + case 180: + return [-1, 0, 0, -1]; + case 270: + { + const [pageWidth, pageHeight] = this.pageDimensions; + return [0, pageWidth / pageHeight, -pageHeight / pageWidth, 0]; + } + default: + return [1, 0, 0, 1]; + } + } + get parentScale() { + return this._uiManager.viewParameters.realScale; + } + get parentRotation() { + return (this._uiManager.viewParameters.rotation + this.pageRotation) % 360; + } + get parentDimensions() { + const { + parentScale, + pageDimensions: [pageWidth, pageHeight] + } = this; + return [pageWidth * parentScale, pageHeight * parentScale]; + } + setDims(width, height) { + const [parentWidth, parentHeight] = this.parentDimensions; + const { + style + } = this.div; + style.width = `${(100 * width / parentWidth).toFixed(2)}%`; + if (!this.#keepAspectRatio) { + style.height = `${(100 * height / parentHeight).toFixed(2)}%`; + } + } + fixDims() { + const { + style + } = this.div; + const { + height, + width + } = style; + const widthPercent = width.endsWith("%"); + const heightPercent = !this.#keepAspectRatio && height.endsWith("%"); + if (widthPercent && heightPercent) { + return; + } + const [parentWidth, parentHeight] = this.parentDimensions; + if (!widthPercent) { + style.width = `${(100 * parseFloat(width) / parentWidth).toFixed(2)}%`; + } + if (!this.#keepAspectRatio && !heightPercent) { + style.height = `${(100 * parseFloat(height) / parentHeight).toFixed(2)}%`; + } + } + getInitialTranslation() { + return [0, 0]; + } + #createResizers() { + if (this.#resizersDiv) { + return; + } + this.#resizersDiv = document.createElement("div"); + this.#resizersDiv.classList.add("resizers"); + const classes = this._willKeepAspectRatio ? ["topLeft", "topRight", "bottomRight", "bottomLeft"] : ["topLeft", "topMiddle", "topRight", "middleRight", "bottomRight", "bottomMiddle", "bottomLeft", "middleLeft"]; + const signal = this._uiManager._signal; + for (const name of classes) { + const div = document.createElement("div"); + this.#resizersDiv.append(div); + div.classList.add("resizer", name); + div.setAttribute("data-resizer-name", name); + div.addEventListener("pointerdown", this.#resizerPointerdown.bind(this, name), { + signal + }); + div.addEventListener("contextmenu", noContextMenu, { + signal + }); + div.tabIndex = -1; + } + this.div.prepend(this.#resizersDiv); + } + #resizerPointerdown(name, event) { + event.preventDefault(); + const { + isMac + } = util_FeatureTest.platform; + if (event.button !== 0 || event.ctrlKey && isMac) { + return; + } + this.#altText?.toggle(false); + const savedDraggable = this._isDraggable; + this._isDraggable = false; + this.#lastPointerCoords = [event.screenX, event.screenY]; + const ac = new AbortController(); + const signal = this._uiManager.combinedSignal(ac); + this.parent.togglePointerEvents(false); + window.addEventListener("pointermove", this.#resizerPointermove.bind(this, name), { + passive: true, + capture: true, + signal + }); + window.addEventListener("touchmove", stopEvent, { + passive: false, + signal + }); + window.addEventListener("contextmenu", noContextMenu, { + signal + }); + this.#savedDimensions = { + savedX: this.x, + savedY: this.y, + savedWidth: this.width, + savedHeight: this.height + }; + const savedParentCursor = this.parent.div.style.cursor; + const savedCursor = this.div.style.cursor; + this.div.style.cursor = this.parent.div.style.cursor = window.getComputedStyle(event.target).cursor; + const pointerUpCallback = () => { + ac.abort(); + this.parent.togglePointerEvents(true); + this.#altText?.toggle(true); + this._isDraggable = savedDraggable; + this.parent.div.style.cursor = savedParentCursor; + this.div.style.cursor = savedCursor; + this.#addResizeToUndoStack(); + }; + window.addEventListener("pointerup", pointerUpCallback, { + signal + }); + window.addEventListener("blur", pointerUpCallback, { + signal + }); + } + #resize(x, y, width, height) { + this.width = width; + this.height = height; + this.x = x; + this.y = y; + const [parentWidth, parentHeight] = this.parentDimensions; + this.setDims(parentWidth * width, parentHeight * height); + this.fixAndSetPosition(); + this._onResized(); + } + _onResized() {} + #addResizeToUndoStack() { + if (!this.#savedDimensions) { + return; + } + const { + savedX, + savedY, + savedWidth, + savedHeight + } = this.#savedDimensions; + this.#savedDimensions = null; + const newX = this.x; + const newY = this.y; + const newWidth = this.width; + const newHeight = this.height; + if (newX === savedX && newY === savedY && newWidth === savedWidth && newHeight === savedHeight) { + return; + } + this.addCommands({ + cmd: this.#resize.bind(this, newX, newY, newWidth, newHeight), + undo: this.#resize.bind(this, savedX, savedY, savedWidth, savedHeight), + mustExec: true + }); + } + static _round(x) { + return Math.round(x * 10000) / 10000; + } + #resizerPointermove(name, event) { + const [parentWidth, parentHeight] = this.parentDimensions; + const savedX = this.x; + const savedY = this.y; + const savedWidth = this.width; + const savedHeight = this.height; + const minWidth = AnnotationEditor.MIN_SIZE / parentWidth; + const minHeight = AnnotationEditor.MIN_SIZE / parentHeight; + const rotationMatrix = this.#getRotationMatrix(this.rotation); + const transf = (x, y) => [rotationMatrix[0] * x + rotationMatrix[2] * y, rotationMatrix[1] * x + rotationMatrix[3] * y]; + const invRotationMatrix = this.#getRotationMatrix(360 - this.rotation); + const invTransf = (x, y) => [invRotationMatrix[0] * x + invRotationMatrix[2] * y, invRotationMatrix[1] * x + invRotationMatrix[3] * y]; + let getPoint; + let getOpposite; + let isDiagonal = false; + let isHorizontal = false; + switch (name) { + case "topLeft": + isDiagonal = true; + getPoint = (w, h) => [0, 0]; + getOpposite = (w, h) => [w, h]; + break; + case "topMiddle": + getPoint = (w, h) => [w / 2, 0]; + getOpposite = (w, h) => [w / 2, h]; + break; + case "topRight": + isDiagonal = true; + getPoint = (w, h) => [w, 0]; + getOpposite = (w, h) => [0, h]; + break; + case "middleRight": + isHorizontal = true; + getPoint = (w, h) => [w, h / 2]; + getOpposite = (w, h) => [0, h / 2]; + break; + case "bottomRight": + isDiagonal = true; + getPoint = (w, h) => [w, h]; + getOpposite = (w, h) => [0, 0]; + break; + case "bottomMiddle": + getPoint = (w, h) => [w / 2, h]; + getOpposite = (w, h) => [w / 2, 0]; + break; + case "bottomLeft": + isDiagonal = true; + getPoint = (w, h) => [0, h]; + getOpposite = (w, h) => [w, 0]; + break; + case "middleLeft": + isHorizontal = true; + getPoint = (w, h) => [0, h / 2]; + getOpposite = (w, h) => [w, h / 2]; + break; + } + const point = getPoint(savedWidth, savedHeight); + const oppositePoint = getOpposite(savedWidth, savedHeight); + let transfOppositePoint = transf(...oppositePoint); + const oppositeX = AnnotationEditor._round(savedX + transfOppositePoint[0]); + const oppositeY = AnnotationEditor._round(savedY + transfOppositePoint[1]); + let ratioX = 1; + let ratioY = 1; + let deltaX, deltaY; + if (!event.fromKeyboard) { + const { + screenX, + screenY + } = event; + const [lastScreenX, lastScreenY] = this.#lastPointerCoords; + [deltaX, deltaY] = this.screenToPageTranslation(screenX - lastScreenX, screenY - lastScreenY); + this.#lastPointerCoords[0] = screenX; + this.#lastPointerCoords[1] = screenY; + } else { + ({ + deltaX, + deltaY + } = event); + } + [deltaX, deltaY] = invTransf(deltaX / parentWidth, deltaY / parentHeight); + if (isDiagonal) { + const oldDiag = Math.hypot(savedWidth, savedHeight); + ratioX = ratioY = Math.max(Math.min(Math.hypot(oppositePoint[0] - point[0] - deltaX, oppositePoint[1] - point[1] - deltaY) / oldDiag, 1 / savedWidth, 1 / savedHeight), minWidth / savedWidth, minHeight / savedHeight); + } else if (isHorizontal) { + ratioX = Math.max(minWidth, Math.min(1, Math.abs(oppositePoint[0] - point[0] - deltaX))) / savedWidth; + } else { + ratioY = Math.max(minHeight, Math.min(1, Math.abs(oppositePoint[1] - point[1] - deltaY))) / savedHeight; + } + const newWidth = AnnotationEditor._round(savedWidth * ratioX); + const newHeight = AnnotationEditor._round(savedHeight * ratioY); + transfOppositePoint = transf(...getOpposite(newWidth, newHeight)); + const newX = oppositeX - transfOppositePoint[0]; + const newY = oppositeY - transfOppositePoint[1]; + this.#initialRect ||= [this.x, this.y, this.width, this.height]; + this.width = newWidth; + this.height = newHeight; + this.x = newX; + this.y = newY; + this.setDims(parentWidth * newWidth, parentHeight * newHeight); + this.fixAndSetPosition(); + this._onResizing(); + } + _onResizing() {} + altTextFinish() { + this.#altText?.finish(); + } + async addEditToolbar() { + if (this._editToolbar || this.#isInEditMode) { + return this._editToolbar; + } + this._editToolbar = new EditorToolbar(this); + this.div.append(this._editToolbar.render()); + if (this.#altText) { + await this._editToolbar.addAltText(this.#altText); + } + return this._editToolbar; + } + removeEditToolbar() { + if (!this._editToolbar) { + return; + } + this._editToolbar.remove(); + this._editToolbar = null; + this.#altText?.destroy(); + } + addContainer(container) { + const editToolbarDiv = this._editToolbar?.div; + if (editToolbarDiv) { + editToolbarDiv.before(container); + } else { + this.div.append(container); + } + } + getClientDimensions() { + return this.div.getBoundingClientRect(); + } + async addAltTextButton() { + if (this.#altText) { + return; + } + AltText.initialize(AnnotationEditor._l10n); + this.#altText = new AltText(this); + if (this.#accessibilityData) { + this.#altText.data = this.#accessibilityData; + this.#accessibilityData = null; + } + await this.addEditToolbar(); + } + get altTextData() { + return this.#altText?.data; + } + set altTextData(data) { + if (!this.#altText) { + return; + } + this.#altText.data = data; + } + get guessedAltText() { + return this.#altText?.guessedText; + } + async setGuessedAltText(text) { + await this.#altText?.setGuessedText(text); + } + serializeAltText(isForCopying) { + return this.#altText?.serialize(isForCopying); + } + hasAltText() { + return !!this.#altText && !this.#altText.isEmpty(); + } + hasAltTextData() { + return this.#altText?.hasData() ?? false; + } + render() { + this.div = document.createElement("div"); + this.div.setAttribute("data-editor-rotation", (360 - this.rotation) % 360); + this.div.className = this.name; + this.div.setAttribute("id", this.id); + this.div.tabIndex = this.#disabled ? -1 : 0; + if (!this._isVisible) { + this.div.classList.add("hidden"); + } + this.setInForeground(); + this.#addFocusListeners(); + const [parentWidth, parentHeight] = this.parentDimensions; + if (this.parentRotation % 180 !== 0) { + this.div.style.maxWidth = `${(100 * parentHeight / parentWidth).toFixed(2)}%`; + this.div.style.maxHeight = `${(100 * parentWidth / parentHeight).toFixed(2)}%`; + } + const [tx, ty] = this.getInitialTranslation(); + this.translate(tx, ty); + bindEvents(this, this.div, ["pointerdown"]); + if (this.isResizable && this._uiManager._supportsPinchToZoom) { + this.#touchManager ||= new TouchManager({ + container: this.div, + isPinchingDisabled: () => !this.isSelected, + onPinchStart: this.#touchPinchStartCallback.bind(this), + onPinching: this.#touchPinchCallback.bind(this), + onPinchEnd: this.#touchPinchEndCallback.bind(this), + signal: this._uiManager._signal + }); + } + this._uiManager._editorUndoBar?.hide(); + return this.div; + } + #touchPinchStartCallback() { + this.#savedDimensions = { + savedX: this.x, + savedY: this.y, + savedWidth: this.width, + savedHeight: this.height + }; + this.#altText?.toggle(false); + this.parent.togglePointerEvents(false); + } + #touchPinchCallback(_origin, prevDistance, distance) { + const slowDownFactor = 0.7; + let factor = slowDownFactor * (distance / prevDistance) + 1 - slowDownFactor; + if (factor === 1) { + return; + } + const rotationMatrix = this.#getRotationMatrix(this.rotation); + const transf = (x, y) => [rotationMatrix[0] * x + rotationMatrix[2] * y, rotationMatrix[1] * x + rotationMatrix[3] * y]; + const [parentWidth, parentHeight] = this.parentDimensions; + const savedX = this.x; + const savedY = this.y; + const savedWidth = this.width; + const savedHeight = this.height; + const minWidth = AnnotationEditor.MIN_SIZE / parentWidth; + const minHeight = AnnotationEditor.MIN_SIZE / parentHeight; + factor = Math.max(Math.min(factor, 1 / savedWidth, 1 / savedHeight), minWidth / savedWidth, minHeight / savedHeight); + const newWidth = AnnotationEditor._round(savedWidth * factor); + const newHeight = AnnotationEditor._round(savedHeight * factor); + if (newWidth === savedWidth && newHeight === savedHeight) { + return; + } + this.#initialRect ||= [savedX, savedY, savedWidth, savedHeight]; + const transfCenterPoint = transf(savedWidth / 2, savedHeight / 2); + const centerX = AnnotationEditor._round(savedX + transfCenterPoint[0]); + const centerY = AnnotationEditor._round(savedY + transfCenterPoint[1]); + const newTransfCenterPoint = transf(newWidth / 2, newHeight / 2); + this.x = centerX - newTransfCenterPoint[0]; + this.y = centerY - newTransfCenterPoint[1]; + this.width = newWidth; + this.height = newHeight; + this.setDims(parentWidth * newWidth, parentHeight * newHeight); + this.fixAndSetPosition(); + this._onResizing(); + } + #touchPinchEndCallback() { + this.#altText?.toggle(true); + this.parent.togglePointerEvents(true); + this.#addResizeToUndoStack(); + } + pointerdown(event) { + const { + isMac + } = util_FeatureTest.platform; + if (event.button !== 0 || event.ctrlKey && isMac) { + event.preventDefault(); + return; + } + this.#hasBeenClicked = true; + if (this._isDraggable) { + this.#setUpDragSession(event); + return; + } + this.#selectOnPointerEvent(event); + } + get isSelected() { + return this._uiManager.isSelected(this); + } + #selectOnPointerEvent(event) { + const { + isMac + } = util_FeatureTest.platform; + if (event.ctrlKey && !isMac || event.shiftKey || event.metaKey && isMac) { + this.parent.toggleSelected(this); + } else { + this.parent.setSelected(this); + } + } + #setUpDragSession(event) { + const { + isSelected + } = this; + this._uiManager.setUpDragSession(); + let hasDraggingStarted = false; + const ac = new AbortController(); + const signal = this._uiManager.combinedSignal(ac); + const opts = { + capture: true, + passive: false, + signal + }; + const cancelDrag = e => { + ac.abort(); + this.#dragPointerId = null; + this.#hasBeenClicked = false; + if (!this._uiManager.endDragSession()) { + this.#selectOnPointerEvent(e); + } + if (hasDraggingStarted) { + this._onStopDragging(); + } + }; + if (isSelected) { + this.#prevDragX = event.clientX; + this.#prevDragY = event.clientY; + this.#dragPointerId = event.pointerId; + this.#dragPointerType = event.pointerType; + window.addEventListener("pointermove", e => { + if (!hasDraggingStarted) { + hasDraggingStarted = true; + this._onStartDragging(); + } + const { + clientX: x, + clientY: y, + pointerId + } = e; + if (pointerId !== this.#dragPointerId) { + stopEvent(e); + return; + } + const [tx, ty] = this.screenToPageTranslation(x - this.#prevDragX, y - this.#prevDragY); + this.#prevDragX = x; + this.#prevDragY = y; + this._uiManager.dragSelectedEditors(tx, ty); + }, opts); + window.addEventListener("touchmove", stopEvent, opts); + window.addEventListener("pointerdown", e => { + if (e.pointerType === this.#dragPointerType) { + if (this.#touchManager || e.isPrimary) { + cancelDrag(e); + } + } + stopEvent(e); + }, opts); + } + const pointerUpCallback = e => { + if (!this.#dragPointerId || this.#dragPointerId === e.pointerId) { + cancelDrag(e); + return; + } + stopEvent(e); + }; + window.addEventListener("pointerup", pointerUpCallback, { + signal + }); + window.addEventListener("blur", pointerUpCallback, { + signal + }); + } + _onStartDragging() {} + _onStopDragging() {} + moveInDOM() { + if (this.#moveInDOMTimeout) { + clearTimeout(this.#moveInDOMTimeout); + } + this.#moveInDOMTimeout = setTimeout(() => { + this.#moveInDOMTimeout = null; + this.parent?.moveEditorInDOM(this); + }, 0); + } + _setParentAndPosition(parent, x, y) { + parent.changeParent(this); + this.x = x; + this.y = y; + this.fixAndSetPosition(); + this._onTranslated(); + } + getRect(tx, ty, rotation = this.rotation) { + const scale = this.parentScale; + const [pageWidth, pageHeight] = this.pageDimensions; + const [pageX, pageY] = this.pageTranslation; + const shiftX = tx / scale; + const shiftY = ty / scale; + const x = this.x * pageWidth; + const y = this.y * pageHeight; + const width = this.width * pageWidth; + const height = this.height * pageHeight; + switch (rotation) { + case 0: + return [x + shiftX + pageX, pageHeight - y - shiftY - height + pageY, x + shiftX + width + pageX, pageHeight - y - shiftY + pageY]; + case 90: + return [x + shiftY + pageX, pageHeight - y + shiftX + pageY, x + shiftY + height + pageX, pageHeight - y + shiftX + width + pageY]; + case 180: + return [x - shiftX - width + pageX, pageHeight - y + shiftY + pageY, x - shiftX + pageX, pageHeight - y + shiftY + height + pageY]; + case 270: + return [x - shiftY - height + pageX, pageHeight - y - shiftX - width + pageY, x - shiftY + pageX, pageHeight - y - shiftX + pageY]; + default: + throw new Error("Invalid rotation"); + } + } + getRectInCurrentCoords(rect, pageHeight) { + const [x1, y1, x2, y2] = rect; + const width = x2 - x1; + const height = y2 - y1; + switch (this.rotation) { + case 0: + return [x1, pageHeight - y2, width, height]; + case 90: + return [x1, pageHeight - y1, height, width]; + case 180: + return [x2, pageHeight - y1, width, height]; + case 270: + return [x2, pageHeight - y2, height, width]; + default: + throw new Error("Invalid rotation"); + } + } + onceAdded(focus) {} + isEmpty() { + return false; + } + enableEditMode() { + this.#isInEditMode = true; + } + disableEditMode() { + this.#isInEditMode = false; + } + isInEditMode() { + return this.#isInEditMode; + } + shouldGetKeyboardEvents() { + return this.#isResizerEnabledForKeyboard; + } + needsToBeRebuilt() { + return this.div && !this.isAttachedToDOM; + } + get isOnScreen() { + const { + top, + left, + bottom, + right + } = this.getClientDimensions(); + const { + innerHeight, + innerWidth + } = window; + return left < innerWidth && right > 0 && top < innerHeight && bottom > 0; + } + #addFocusListeners() { + if (this.#focusAC || !this.div) { + return; + } + this.#focusAC = new AbortController(); + const signal = this._uiManager.combinedSignal(this.#focusAC); + this.div.addEventListener("focusin", this.focusin.bind(this), { + signal + }); + this.div.addEventListener("focusout", this.focusout.bind(this), { + signal + }); + } + rebuild() { + this.#addFocusListeners(); + } + rotate(_angle) {} + resize() {} + serializeDeleted() { + return { + id: this.annotationElementId, + deleted: true, + pageIndex: this.pageIndex, + popupRef: this._initialData?.popupRef || "" + }; + } + serialize(isForCopying = false, context = null) { + unreachable("An editor must be serializable"); + } + static async deserialize(data, parent, uiManager) { + const editor = new this.prototype.constructor({ + parent, + id: parent.getNextId(), + uiManager + }); + editor.rotation = data.rotation; + editor.#accessibilityData = data.accessibilityData; + const [pageWidth, pageHeight] = editor.pageDimensions; + const [x, y, width, height] = editor.getRectInCurrentCoords(data.rect, pageHeight); + editor.x = x / pageWidth; + editor.y = y / pageHeight; + editor.width = width / pageWidth; + editor.height = height / pageHeight; + return editor; + } + get hasBeenModified() { + return !!this.annotationElementId && (this.deleted || this.serialize() !== null); + } + remove() { + this.#focusAC?.abort(); + this.#focusAC = null; + if (!this.isEmpty()) { + this.commit(); + } + if (this.parent) { + this.parent.remove(this); + } else { + this._uiManager.removeEditor(this); + } + if (this.#moveInDOMTimeout) { + clearTimeout(this.#moveInDOMTimeout); + this.#moveInDOMTimeout = null; + } + this.#stopResizing(); + this.removeEditToolbar(); + if (this.#telemetryTimeouts) { + for (const timeout of this.#telemetryTimeouts.values()) { + clearTimeout(timeout); + } + this.#telemetryTimeouts = null; + } + this.parent = null; + this.#touchManager?.destroy(); + this.#touchManager = null; + } + get isResizable() { + return false; + } + makeResizable() { + if (this.isResizable) { + this.#createResizers(); + this.#resizersDiv.classList.remove("hidden"); + bindEvents(this, this.div, ["keydown"]); + } + } + get toolbarPosition() { + return null; + } + keydown(event) { + if (!this.isResizable || event.target !== this.div || event.key !== "Enter") { + return; + } + this._uiManager.setSelected(this); + this.#savedDimensions = { + savedX: this.x, + savedY: this.y, + savedWidth: this.width, + savedHeight: this.height + }; + const children = this.#resizersDiv.children; + if (!this.#allResizerDivs) { + this.#allResizerDivs = Array.from(children); + const boundResizerKeydown = this.#resizerKeydown.bind(this); + const boundResizerBlur = this.#resizerBlur.bind(this); + const signal = this._uiManager._signal; + for (const div of this.#allResizerDivs) { + const name = div.getAttribute("data-resizer-name"); + div.setAttribute("role", "spinbutton"); + div.addEventListener("keydown", boundResizerKeydown, { + signal + }); + div.addEventListener("blur", boundResizerBlur, { + signal + }); + div.addEventListener("focus", this.#resizerFocus.bind(this, name), { + signal + }); + div.setAttribute("data-l10n-id", AnnotationEditor._l10nResizer[name]); + } + } + const first = this.#allResizerDivs[0]; + let firstPosition = 0; + for (const div of children) { + if (div === first) { + break; + } + firstPosition++; + } + const nextFirstPosition = (360 - this.rotation + this.parentRotation) % 360 / 90 * (this.#allResizerDivs.length / 4); + if (nextFirstPosition !== firstPosition) { + if (nextFirstPosition < firstPosition) { + for (let i = 0; i < firstPosition - nextFirstPosition; i++) { + this.#resizersDiv.append(this.#resizersDiv.firstChild); + } + } else if (nextFirstPosition > firstPosition) { + for (let i = 0; i < nextFirstPosition - firstPosition; i++) { + this.#resizersDiv.firstChild.before(this.#resizersDiv.lastChild); + } + } + let i = 0; + for (const child of children) { + const div = this.#allResizerDivs[i++]; + const name = div.getAttribute("data-resizer-name"); + child.setAttribute("data-l10n-id", AnnotationEditor._l10nResizer[name]); + } + } + this.#setResizerTabIndex(0); + this.#isResizerEnabledForKeyboard = true; + this.#resizersDiv.firstChild.focus({ + focusVisible: true + }); + event.preventDefault(); + event.stopImmediatePropagation(); + } + #resizerKeydown(event) { + AnnotationEditor._resizerKeyboardManager.exec(this, event); + } + #resizerBlur(event) { + if (this.#isResizerEnabledForKeyboard && event.relatedTarget?.parentNode !== this.#resizersDiv) { + this.#stopResizing(); + } + } + #resizerFocus(name) { + this.#focusedResizerName = this.#isResizerEnabledForKeyboard ? name : ""; + } + #setResizerTabIndex(value) { + if (!this.#allResizerDivs) { + return; + } + for (const div of this.#allResizerDivs) { + div.tabIndex = value; + } + } + _resizeWithKeyboard(x, y) { + if (!this.#isResizerEnabledForKeyboard) { + return; + } + this.#resizerPointermove(this.#focusedResizerName, { + deltaX: x, + deltaY: y, + fromKeyboard: true + }); + } + #stopResizing() { + this.#isResizerEnabledForKeyboard = false; + this.#setResizerTabIndex(-1); + this.#addResizeToUndoStack(); + } + _stopResizingWithKeyboard() { + this.#stopResizing(); + this.div.focus(); + } + select() { + this.makeResizable(); + this.div?.classList.add("selectedEditor"); + if (!this._editToolbar) { + this.addEditToolbar().then(() => { + if (this.div?.classList.contains("selectedEditor")) { + this._editToolbar?.show(); + } + }); + return; + } + this._editToolbar?.show(); + this.#altText?.toggleAltTextBadge(false); + } + unselect() { + this.#resizersDiv?.classList.add("hidden"); + this.div?.classList.remove("selectedEditor"); + if (this.div?.contains(document.activeElement)) { + this._uiManager.currentLayer.div.focus({ + preventScroll: true + }); + } + this._editToolbar?.hide(); + this.#altText?.toggleAltTextBadge(true); + } + updateParams(type, value) {} + disableEditing() {} + enableEditing() {} + enterInEditMode() {} + getImageForAltText() { + return null; + } + get contentDiv() { + return this.div; + } + get isEditing() { + return this.#isEditing; + } + set isEditing(value) { + this.#isEditing = value; + if (!this.parent) { + return; + } + if (value) { + this.parent.setSelected(this); + this.parent.setActiveEditor(this); + } else { + this.parent.setActiveEditor(null); + } + } + setAspectRatio(width, height) { + this.#keepAspectRatio = true; + const aspectRatio = width / height; + const { + style + } = this.div; + style.aspectRatio = aspectRatio; + style.height = "auto"; + } + static get MIN_SIZE() { + return 16; + } + static canCreateNewEmptyEditor() { + return true; + } + get telemetryInitialData() { + return { + action: "added" + }; + } + get telemetryFinalData() { + return null; + } + _reportTelemetry(data, mustWait = false) { + if (mustWait) { + this.#telemetryTimeouts ||= new Map(); + const { + action + } = data; + let timeout = this.#telemetryTimeouts.get(action); + if (timeout) { + clearTimeout(timeout); + } + timeout = setTimeout(() => { + this._reportTelemetry(data); + this.#telemetryTimeouts.delete(action); + if (this.#telemetryTimeouts.size === 0) { + this.#telemetryTimeouts = null; + } + }, AnnotationEditor._telemetryTimeout); + this.#telemetryTimeouts.set(action, timeout); + return; + } + data.type ||= this.editorType; + this._uiManager._eventBus.dispatch("reporttelemetry", { + source: this, + details: { + type: "editing", + data + } + }); + } + show(visible = this._isVisible) { + this.div.classList.toggle("hidden", !visible); + this._isVisible = visible; + } + enable() { + if (this.div) { + this.div.tabIndex = 0; + } + this.#disabled = false; + } + disable() { + if (this.div) { + this.div.tabIndex = -1; + } + this.#disabled = true; + } + renderAnnotationElement(annotation) { + let content = annotation.container.querySelector(".annotationContent"); + if (!content) { + content = document.createElement("div"); + content.classList.add("annotationContent", this.editorType); + annotation.container.prepend(content); + } else if (content.nodeName === "CANVAS") { + const canvas = content; + content = document.createElement("div"); + content.classList.add("annotationContent", this.editorType); + canvas.before(content); + } + return content; + } + resetAnnotationElement(annotation) { + const { + firstChild + } = annotation.container; + if (firstChild?.nodeName === "DIV" && firstChild.classList.contains("annotationContent")) { + firstChild.remove(); + } + } +} +class FakeEditor extends AnnotationEditor { + constructor(params) { + super(params); + this.annotationElementId = params.annotationElementId; + this.deleted = true; + } + serialize() { + return this.serializeDeleted(); + } +} + +;// ./src/shared/murmurhash3.js +const SEED = 0xc3d2e1f0; +const MASK_HIGH = 0xffff0000; +const MASK_LOW = 0xffff; +class MurmurHash3_64 { + constructor(seed) { + this.h1 = seed ? seed & 0xffffffff : SEED; + this.h2 = seed ? seed & 0xffffffff : SEED; + } + update(input) { + let data, length; + if (typeof input === "string") { + data = new Uint8Array(input.length * 2); + length = 0; + for (let i = 0, ii = input.length; i < ii; i++) { + const code = input.charCodeAt(i); + if (code <= 0xff) { + data[length++] = code; + } else { + data[length++] = code >>> 8; + data[length++] = code & 0xff; + } + } + } else if (ArrayBuffer.isView(input)) { + data = input.slice(); + length = data.byteLength; + } else { + throw new Error("Invalid data format, must be a string or TypedArray."); + } + const blockCounts = length >> 2; + const tailLength = length - blockCounts * 4; + const dataUint32 = new Uint32Array(data.buffer, 0, blockCounts); + let k1 = 0, + k2 = 0; + let h1 = this.h1, + h2 = this.h2; + const C1 = 0xcc9e2d51, + C2 = 0x1b873593; + const C1_LOW = C1 & MASK_LOW, + C2_LOW = C2 & MASK_LOW; + for (let i = 0; i < blockCounts; i++) { + if (i & 1) { + k1 = dataUint32[i]; + k1 = k1 * C1 & MASK_HIGH | k1 * C1_LOW & MASK_LOW; + k1 = k1 << 15 | k1 >>> 17; + k1 = k1 * C2 & MASK_HIGH | k1 * C2_LOW & MASK_LOW; + h1 ^= k1; + h1 = h1 << 13 | h1 >>> 19; + h1 = h1 * 5 + 0xe6546b64; + } else { + k2 = dataUint32[i]; + k2 = k2 * C1 & MASK_HIGH | k2 * C1_LOW & MASK_LOW; + k2 = k2 << 15 | k2 >>> 17; + k2 = k2 * C2 & MASK_HIGH | k2 * C2_LOW & MASK_LOW; + h2 ^= k2; + h2 = h2 << 13 | h2 >>> 19; + h2 = h2 * 5 + 0xe6546b64; + } + } + k1 = 0; + switch (tailLength) { + case 3: + k1 ^= data[blockCounts * 4 + 2] << 16; + case 2: + k1 ^= data[blockCounts * 4 + 1] << 8; + case 1: + k1 ^= data[blockCounts * 4]; + k1 = k1 * C1 & MASK_HIGH | k1 * C1_LOW & MASK_LOW; + k1 = k1 << 15 | k1 >>> 17; + k1 = k1 * C2 & MASK_HIGH | k1 * C2_LOW & MASK_LOW; + if (blockCounts & 1) { + h1 ^= k1; + } else { + h2 ^= k1; + } + } + this.h1 = h1; + this.h2 = h2; + } + hexdigest() { + let h1 = this.h1, + h2 = this.h2; + h1 ^= h2 >>> 1; + h1 = h1 * 0xed558ccd & MASK_HIGH | h1 * 0x8ccd & MASK_LOW; + h2 = h2 * 0xff51afd7 & MASK_HIGH | ((h2 << 16 | h1 >>> 16) * 0xafd7ed55 & MASK_HIGH) >>> 16; + h1 ^= h2 >>> 1; + h1 = h1 * 0x1a85ec53 & MASK_HIGH | h1 * 0xec53 & MASK_LOW; + h2 = h2 * 0xc4ceb9fe & MASK_HIGH | ((h2 << 16 | h1 >>> 16) * 0xb9fe1a85 & MASK_HIGH) >>> 16; + h1 ^= h2 >>> 1; + return (h1 >>> 0).toString(16).padStart(8, "0") + (h2 >>> 0).toString(16).padStart(8, "0"); + } +} + +;// ./src/display/annotation_storage.js + + + +const SerializableEmpty = Object.freeze({ + map: null, + hash: "", + transfer: undefined +}); +class AnnotationStorage { + #modified = false; + #modifiedIds = null; + #storage = new Map(); + constructor() { + this.onSetModified = null; + this.onResetModified = null; + this.onAnnotationEditor = null; + } + getValue(key, defaultValue) { + const value = this.#storage.get(key); + if (value === undefined) { + return defaultValue; + } + return Object.assign(defaultValue, value); + } + getRawValue(key) { + return this.#storage.get(key); + } + remove(key) { + this.#storage.delete(key); + if (this.#storage.size === 0) { + this.resetModified(); + } + if (typeof this.onAnnotationEditor === "function") { + for (const value of this.#storage.values()) { + if (value instanceof AnnotationEditor) { + return; + } + } + this.onAnnotationEditor(null); + } + } + setValue(key, value) { + const obj = this.#storage.get(key); + let modified = false; + if (obj !== undefined) { + for (const [entry, val] of Object.entries(value)) { + if (obj[entry] !== val) { + modified = true; + obj[entry] = val; + } + } + } else { + modified = true; + this.#storage.set(key, value); + } + if (modified) { + this.#setModified(); + } + if (value instanceof AnnotationEditor && typeof this.onAnnotationEditor === "function") { + this.onAnnotationEditor(value.constructor._type); + } + } + has(key) { + return this.#storage.has(key); + } + getAll() { + return this.#storage.size > 0 ? objectFromMap(this.#storage) : null; + } + setAll(obj) { + for (const [key, val] of Object.entries(obj)) { + this.setValue(key, val); + } + } + get size() { + return this.#storage.size; + } + #setModified() { + if (!this.#modified) { + this.#modified = true; + if (typeof this.onSetModified === "function") { + this.onSetModified(); + } + } + } + resetModified() { + if (this.#modified) { + this.#modified = false; + if (typeof this.onResetModified === "function") { + this.onResetModified(); + } + } + } + get print() { + return new PrintAnnotationStorage(this); + } + get serializable() { + if (this.#storage.size === 0) { + return SerializableEmpty; + } + const map = new Map(), + hash = new MurmurHash3_64(), + transfer = []; + const context = Object.create(null); + let hasBitmap = false; + for (const [key, val] of this.#storage) { + const serialized = val instanceof AnnotationEditor ? val.serialize(false, context) : val; + if (serialized) { + map.set(key, serialized); + hash.update(`${key}:${JSON.stringify(serialized)}`); + hasBitmap ||= !!serialized.bitmap; + } + } + if (hasBitmap) { + for (const value of map.values()) { + if (value.bitmap) { + transfer.push(value.bitmap); + } + } + } + return map.size > 0 ? { + map, + hash: hash.hexdigest(), + transfer + } : SerializableEmpty; + } + get editorStats() { + let stats = null; + const typeToEditor = new Map(); + for (const value of this.#storage.values()) { + if (!(value instanceof AnnotationEditor)) { + continue; + } + const editorStats = value.telemetryFinalData; + if (!editorStats) { + continue; + } + const { + type + } = editorStats; + if (!typeToEditor.has(type)) { + typeToEditor.set(type, Object.getPrototypeOf(value).constructor); + } + stats ||= Object.create(null); + const map = stats[type] ||= new Map(); + for (const [key, val] of Object.entries(editorStats)) { + if (key === "type") { + continue; + } + let counters = map.get(key); + if (!counters) { + counters = new Map(); + map.set(key, counters); + } + const count = counters.get(val) ?? 0; + counters.set(val, count + 1); + } + } + for (const [type, editor] of typeToEditor) { + stats[type] = editor.computeTelemetryFinalData(stats[type]); + } + return stats; + } + resetModifiedIds() { + this.#modifiedIds = null; + } + get modifiedIds() { + if (this.#modifiedIds) { + return this.#modifiedIds; + } + const ids = []; + for (const value of this.#storage.values()) { + if (!(value instanceof AnnotationEditor) || !value.annotationElementId || !value.serialize()) { + continue; + } + ids.push(value.annotationElementId); + } + return this.#modifiedIds = { + ids: new Set(ids), + hash: ids.join(",") + }; + } +} +class PrintAnnotationStorage extends AnnotationStorage { + #serializable; + constructor(parent) { + super(); + const { + map, + hash, + transfer + } = parent.serializable; + const clone = structuredClone(map, transfer ? { + transfer + } : null); + this.#serializable = { + map: clone, + hash, + transfer + }; + } + get print() { + unreachable("Should not call PrintAnnotationStorage.print"); + } + get serializable() { + return this.#serializable; + } + get modifiedIds() { + return shadow(this, "modifiedIds", { + ids: new Set(), + hash: "" + }); + } +} + +;// ./src/display/font_loader.js + +class FontLoader { + #systemFonts = new Set(); + constructor({ + ownerDocument = globalThis.document, + styleElement = null + }) { + this._document = ownerDocument; + this.nativeFontFaces = new Set(); + this.styleElement = null; + this.loadingRequests = []; + this.loadTestFontId = 0; + } + addNativeFontFace(nativeFontFace) { + this.nativeFontFaces.add(nativeFontFace); + this._document.fonts.add(nativeFontFace); + } + removeNativeFontFace(nativeFontFace) { + this.nativeFontFaces.delete(nativeFontFace); + this._document.fonts.delete(nativeFontFace); + } + insertRule(rule) { + if (!this.styleElement) { + this.styleElement = this._document.createElement("style"); + this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement); + } + const styleSheet = this.styleElement.sheet; + styleSheet.insertRule(rule, styleSheet.cssRules.length); + } + clear() { + for (const nativeFontFace of this.nativeFontFaces) { + this._document.fonts.delete(nativeFontFace); + } + this.nativeFontFaces.clear(); + this.#systemFonts.clear(); + if (this.styleElement) { + this.styleElement.remove(); + this.styleElement = null; + } + } + async loadSystemFont({ + systemFontInfo: info, + _inspectFont + }) { + if (!info || this.#systemFonts.has(info.loadedName)) { + return; + } + assert(!this.disableFontFace, "loadSystemFont shouldn't be called when `disableFontFace` is set."); + if (this.isFontLoadingAPISupported) { + const { + loadedName, + src, + style + } = info; + const fontFace = new FontFace(loadedName, src, style); + this.addNativeFontFace(fontFace); + try { + await fontFace.load(); + this.#systemFonts.add(loadedName); + _inspectFont?.(info); + } catch { + warn(`Cannot load system font: ${info.baseFontName}, installing it could help to improve PDF rendering.`); + this.removeNativeFontFace(fontFace); + } + return; + } + unreachable("Not implemented: loadSystemFont without the Font Loading API."); + } + async bind(font) { + if (font.attached || font.missingFile && !font.systemFontInfo) { + return; + } + font.attached = true; + if (font.systemFontInfo) { + await this.loadSystemFont(font); + return; + } + if (this.isFontLoadingAPISupported) { + const nativeFontFace = font.createNativeFontFace(); + if (nativeFontFace) { + this.addNativeFontFace(nativeFontFace); + try { + await nativeFontFace.loaded; + } catch (ex) { + warn(`Failed to load font '${nativeFontFace.family}': '${ex}'.`); + font.disableFontFace = true; + throw ex; + } + } + return; + } + const rule = font.createFontFaceRule(); + if (rule) { + this.insertRule(rule); + if (this.isSyncFontLoadingSupported) { + return; + } + await new Promise(resolve => { + const request = this._queueLoadingCallback(resolve); + this._prepareFontLoadEvent(font, request); + }); + } + } + get isFontLoadingAPISupported() { + const hasFonts = !!this._document?.fonts; + return shadow(this, "isFontLoadingAPISupported", hasFonts); + } + get isSyncFontLoadingSupported() { + let supported = false; + if (isNodeJS) { + supported = true; + } else if (typeof navigator !== "undefined" && typeof navigator?.userAgent === "string" && /Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent)) { + supported = true; + } + return shadow(this, "isSyncFontLoadingSupported", supported); + } + _queueLoadingCallback(callback) { + function completeRequest() { + assert(!request.done, "completeRequest() cannot be called twice."); + request.done = true; + while (loadingRequests.length > 0 && loadingRequests[0].done) { + const otherRequest = loadingRequests.shift(); + setTimeout(otherRequest.callback, 0); + } + } + const { + loadingRequests + } = this; + const request = { + done: false, + complete: completeRequest, + callback + }; + loadingRequests.push(request); + return request; + } + get _loadTestFont() { + const testFont = atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQA" + "FQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAA" + "ALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgA" + "AAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1" + "AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD" + "6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACM" + "AooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4D" + "IP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAA" + "AAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUA" + "AQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgAB" + "AAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABY" + "AAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAA" + "AC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "AAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAA" + "AAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQAC" + "AQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3" + "Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTj" + "FQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA=="); + return shadow(this, "_loadTestFont", testFont); + } + _prepareFontLoadEvent(font, request) { + function int32(data, offset) { + return data.charCodeAt(offset) << 24 | data.charCodeAt(offset + 1) << 16 | data.charCodeAt(offset + 2) << 8 | data.charCodeAt(offset + 3) & 0xff; + } + function spliceString(s, offset, remove, insert) { + const chunk1 = s.substring(0, offset); + const chunk2 = s.substring(offset + remove); + return chunk1 + insert + chunk2; + } + let i, ii; + const canvas = this._document.createElement("canvas"); + canvas.width = 1; + canvas.height = 1; + const ctx = canvas.getContext("2d"); + let called = 0; + function isFontReady(name, callback) { + if (++called > 30) { + warn("Load test font never loaded."); + callback(); + return; + } + ctx.font = "30px " + name; + ctx.fillText(".", 0, 20); + const imageData = ctx.getImageData(0, 0, 1, 1); + if (imageData.data[3] > 0) { + callback(); + return; + } + setTimeout(isFontReady.bind(null, name, callback)); + } + const loadTestFontId = `lt${Date.now()}${this.loadTestFontId++}`; + let data = this._loadTestFont; + const COMMENT_OFFSET = 976; + data = spliceString(data, COMMENT_OFFSET, loadTestFontId.length, loadTestFontId); + const CFF_CHECKSUM_OFFSET = 16; + const XXXX_VALUE = 0x58585858; + let checksum = int32(data, CFF_CHECKSUM_OFFSET); + for (i = 0, ii = loadTestFontId.length - 3; i < ii; i += 4) { + checksum = checksum - XXXX_VALUE + int32(loadTestFontId, i) | 0; + } + if (i < loadTestFontId.length) { + checksum = checksum - XXXX_VALUE + int32(loadTestFontId + "XXX", i) | 0; + } + data = spliceString(data, CFF_CHECKSUM_OFFSET, 4, string32(checksum)); + const url = `url(data:font/opentype;base64,${btoa(data)});`; + const rule = `@font-face {font-family:"${loadTestFontId}";src:${url}}`; + this.insertRule(rule); + const div = this._document.createElement("div"); + div.style.visibility = "hidden"; + div.style.width = div.style.height = "10px"; + div.style.position = "absolute"; + div.style.top = div.style.left = "0px"; + for (const name of [font.loadedName, loadTestFontId]) { + const span = this._document.createElement("span"); + span.textContent = "Hi"; + span.style.fontFamily = name; + div.append(span); + } + this._document.body.append(div); + isFontReady(loadTestFontId, () => { + div.remove(); + request.complete(); + }); + } +} +class FontFaceObject { + constructor(translatedData, { + disableFontFace = false, + fontExtraProperties = false, + inspectFont = null + }) { + this.compiledGlyphs = Object.create(null); + for (const i in translatedData) { + this[i] = translatedData[i]; + } + this.disableFontFace = disableFontFace === true; + this.fontExtraProperties = fontExtraProperties === true; + this._inspectFont = inspectFont; + } + createNativeFontFace() { + if (!this.data || this.disableFontFace) { + return null; + } + let nativeFontFace; + if (!this.cssFontInfo) { + nativeFontFace = new FontFace(this.loadedName, this.data, {}); + } else { + const css = { + weight: this.cssFontInfo.fontWeight + }; + if (this.cssFontInfo.italicAngle) { + css.style = `oblique ${this.cssFontInfo.italicAngle}deg`; + } + nativeFontFace = new FontFace(this.cssFontInfo.fontFamily, this.data, css); + } + this._inspectFont?.(this); + return nativeFontFace; + } + createFontFaceRule() { + if (!this.data || this.disableFontFace) { + return null; + } + const url = `url(data:${this.mimetype};base64,${toBase64Util(this.data)});`; + let rule; + if (!this.cssFontInfo) { + rule = `@font-face {font-family:"${this.loadedName}";src:${url}}`; + } else { + let css = `font-weight: ${this.cssFontInfo.fontWeight};`; + if (this.cssFontInfo.italicAngle) { + css += `font-style: oblique ${this.cssFontInfo.italicAngle}deg;`; + } + rule = `@font-face {font-family:"${this.cssFontInfo.fontFamily}";${css}src:${url}}`; + } + this._inspectFont?.(this, url); + return rule; + } + getPathGenerator(objs, character) { + if (this.compiledGlyphs[character] !== undefined) { + return this.compiledGlyphs[character]; + } + const objId = this.loadedName + "_path_" + character; + let cmds; + try { + cmds = objs.get(objId); + } catch (ex) { + warn(`getPathGenerator - ignoring character: "${ex}".`); + } + const path = new Path2D(cmds || ""); + if (!this.fontExtraProperties) { + objs.delete(objId); + } + return this.compiledGlyphs[character] = path; + } +} + +;// ./src/shared/message_handler.js + +const CallbackKind = { + DATA: 1, + ERROR: 2 +}; +const StreamKind = { + CANCEL: 1, + CANCEL_COMPLETE: 2, + CLOSE: 3, + ENQUEUE: 4, + ERROR: 5, + PULL: 6, + PULL_COMPLETE: 7, + START_COMPLETE: 8 +}; +function onFn() {} +function wrapReason(ex) { + if (ex instanceof AbortException || ex instanceof InvalidPDFException || ex instanceof MissingPDFException || ex instanceof PasswordException || ex instanceof UnexpectedResponseException || ex instanceof UnknownErrorException) { + return ex; + } + if (!(ex instanceof Error || typeof ex === "object" && ex !== null)) { + unreachable('wrapReason: Expected "reason" to be a (possibly cloned) Error.'); + } + switch (ex.name) { + case "AbortException": + return new AbortException(ex.message); + case "InvalidPDFException": + return new InvalidPDFException(ex.message); + case "MissingPDFException": + return new MissingPDFException(ex.message); + case "PasswordException": + return new PasswordException(ex.message, ex.code); + case "UnexpectedResponseException": + return new UnexpectedResponseException(ex.message, ex.status); + case "UnknownErrorException": + return new UnknownErrorException(ex.message, ex.details); + } + return new UnknownErrorException(ex.message, ex.toString()); +} +class MessageHandler { + #messageAC = new AbortController(); + constructor(sourceName, targetName, comObj) { + this.sourceName = sourceName; + this.targetName = targetName; + this.comObj = comObj; + this.callbackId = 1; + this.streamId = 1; + this.streamSinks = Object.create(null); + this.streamControllers = Object.create(null); + this.callbackCapabilities = Object.create(null); + this.actionHandler = Object.create(null); + comObj.addEventListener("message", this.#onMessage.bind(this), { + signal: this.#messageAC.signal + }); + } + #onMessage({ + data + }) { + if (data.targetName !== this.sourceName) { + return; + } + if (data.stream) { + this.#processStreamMessage(data); + return; + } + if (data.callback) { + const callbackId = data.callbackId; + const capability = this.callbackCapabilities[callbackId]; + if (!capability) { + throw new Error(`Cannot resolve callback ${callbackId}`); + } + delete this.callbackCapabilities[callbackId]; + if (data.callback === CallbackKind.DATA) { + capability.resolve(data.data); + } else if (data.callback === CallbackKind.ERROR) { + capability.reject(wrapReason(data.reason)); + } else { + throw new Error("Unexpected callback case"); + } + return; + } + const action = this.actionHandler[data.action]; + if (!action) { + throw new Error(`Unknown action from worker: ${data.action}`); + } + if (data.callbackId) { + const sourceName = this.sourceName, + targetName = data.sourceName, + comObj = this.comObj; + Promise.try(action, data.data).then(function (result) { + comObj.postMessage({ + sourceName, + targetName, + callback: CallbackKind.DATA, + callbackId: data.callbackId, + data: result + }); + }, function (reason) { + comObj.postMessage({ + sourceName, + targetName, + callback: CallbackKind.ERROR, + callbackId: data.callbackId, + reason: wrapReason(reason) + }); + }); + return; + } + if (data.streamId) { + this.#createStreamSink(data); + return; + } + action(data.data); + } + on(actionName, handler) { + const ah = this.actionHandler; + if (ah[actionName]) { + throw new Error(`There is already an actionName called "${actionName}"`); + } + ah[actionName] = handler; + } + send(actionName, data, transfers) { + this.comObj.postMessage({ + sourceName: this.sourceName, + targetName: this.targetName, + action: actionName, + data + }, transfers); + } + sendWithPromise(actionName, data, transfers) { + const callbackId = this.callbackId++; + const capability = Promise.withResolvers(); + this.callbackCapabilities[callbackId] = capability; + try { + this.comObj.postMessage({ + sourceName: this.sourceName, + targetName: this.targetName, + action: actionName, + callbackId, + data + }, transfers); + } catch (ex) { + capability.reject(ex); + } + return capability.promise; + } + sendWithStream(actionName, data, queueingStrategy, transfers) { + const streamId = this.streamId++, + sourceName = this.sourceName, + targetName = this.targetName, + comObj = this.comObj; + return new ReadableStream({ + start: controller => { + const startCapability = Promise.withResolvers(); + this.streamControllers[streamId] = { + controller, + startCall: startCapability, + pullCall: null, + cancelCall: null, + isClosed: false + }; + comObj.postMessage({ + sourceName, + targetName, + action: actionName, + streamId, + data, + desiredSize: controller.desiredSize + }, transfers); + return startCapability.promise; + }, + pull: controller => { + const pullCapability = Promise.withResolvers(); + this.streamControllers[streamId].pullCall = pullCapability; + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.PULL, + streamId, + desiredSize: controller.desiredSize + }); + return pullCapability.promise; + }, + cancel: reason => { + assert(reason instanceof Error, "cancel must have a valid reason"); + const cancelCapability = Promise.withResolvers(); + this.streamControllers[streamId].cancelCall = cancelCapability; + this.streamControllers[streamId].isClosed = true; + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.CANCEL, + streamId, + reason: wrapReason(reason) + }); + return cancelCapability.promise; + } + }, queueingStrategy); + } + #createStreamSink(data) { + const streamId = data.streamId, + sourceName = this.sourceName, + targetName = data.sourceName, + comObj = this.comObj; + const self = this, + action = this.actionHandler[data.action]; + const streamSink = { + enqueue(chunk, size = 1, transfers) { + if (this.isCancelled) { + return; + } + const lastDesiredSize = this.desiredSize; + this.desiredSize -= size; + if (lastDesiredSize > 0 && this.desiredSize <= 0) { + this.sinkCapability = Promise.withResolvers(); + this.ready = this.sinkCapability.promise; + } + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.ENQUEUE, + streamId, + chunk + }, transfers); + }, + close() { + if (this.isCancelled) { + return; + } + this.isCancelled = true; + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.CLOSE, + streamId + }); + delete self.streamSinks[streamId]; + }, + error(reason) { + assert(reason instanceof Error, "error must have a valid reason"); + if (this.isCancelled) { + return; + } + this.isCancelled = true; + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.ERROR, + streamId, + reason: wrapReason(reason) + }); + }, + sinkCapability: Promise.withResolvers(), + onPull: null, + onCancel: null, + isCancelled: false, + desiredSize: data.desiredSize, + ready: null + }; + streamSink.sinkCapability.resolve(); + streamSink.ready = streamSink.sinkCapability.promise; + this.streamSinks[streamId] = streamSink; + Promise.try(action, data.data, streamSink).then(function () { + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.START_COMPLETE, + streamId, + success: true + }); + }, function (reason) { + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.START_COMPLETE, + streamId, + reason: wrapReason(reason) + }); + }); + } + #processStreamMessage(data) { + const streamId = data.streamId, + sourceName = this.sourceName, + targetName = data.sourceName, + comObj = this.comObj; + const streamController = this.streamControllers[streamId], + streamSink = this.streamSinks[streamId]; + switch (data.stream) { + case StreamKind.START_COMPLETE: + if (data.success) { + streamController.startCall.resolve(); + } else { + streamController.startCall.reject(wrapReason(data.reason)); + } + break; + case StreamKind.PULL_COMPLETE: + if (data.success) { + streamController.pullCall.resolve(); + } else { + streamController.pullCall.reject(wrapReason(data.reason)); + } + break; + case StreamKind.PULL: + if (!streamSink) { + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.PULL_COMPLETE, + streamId, + success: true + }); + break; + } + if (streamSink.desiredSize <= 0 && data.desiredSize > 0) { + streamSink.sinkCapability.resolve(); + } + streamSink.desiredSize = data.desiredSize; + Promise.try(streamSink.onPull || onFn).then(function () { + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.PULL_COMPLETE, + streamId, + success: true + }); + }, function (reason) { + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.PULL_COMPLETE, + streamId, + reason: wrapReason(reason) + }); + }); + break; + case StreamKind.ENQUEUE: + assert(streamController, "enqueue should have stream controller"); + if (streamController.isClosed) { + break; + } + streamController.controller.enqueue(data.chunk); + break; + case StreamKind.CLOSE: + assert(streamController, "close should have stream controller"); + if (streamController.isClosed) { + break; + } + streamController.isClosed = true; + streamController.controller.close(); + this.#deleteStreamController(streamController, streamId); + break; + case StreamKind.ERROR: + assert(streamController, "error should have stream controller"); + streamController.controller.error(wrapReason(data.reason)); + this.#deleteStreamController(streamController, streamId); + break; + case StreamKind.CANCEL_COMPLETE: + if (data.success) { + streamController.cancelCall.resolve(); + } else { + streamController.cancelCall.reject(wrapReason(data.reason)); + } + this.#deleteStreamController(streamController, streamId); + break; + case StreamKind.CANCEL: + if (!streamSink) { + break; + } + const dataReason = wrapReason(data.reason); + Promise.try(streamSink.onCancel || onFn, dataReason).then(function () { + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.CANCEL_COMPLETE, + streamId, + success: true + }); + }, function (reason) { + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.CANCEL_COMPLETE, + streamId, + reason: wrapReason(reason) + }); + }); + streamSink.sinkCapability.reject(dataReason); + streamSink.isCancelled = true; + delete this.streamSinks[streamId]; + break; + default: + throw new Error("Unexpected stream case"); + } + } + async #deleteStreamController(streamController, streamId) { + await Promise.allSettled([streamController.startCall?.promise, streamController.pullCall?.promise, streamController.cancelCall?.promise]); + delete this.streamControllers[streamId]; + } + destroy() { + this.#messageAC?.abort(); + this.#messageAC = null; + } +} + +;// ./src/display/canvas_factory.js + +class BaseCanvasFactory { + #enableHWA = false; + constructor({ + enableHWA = false + }) { + this.#enableHWA = enableHWA; + } + create(width, height) { + if (width <= 0 || height <= 0) { + throw new Error("Invalid canvas size"); + } + const canvas = this._createCanvas(width, height); + return { + canvas, + context: canvas.getContext("2d", { + willReadFrequently: !this.#enableHWA + }) + }; + } + reset(canvasAndContext, width, height) { + if (!canvasAndContext.canvas) { + throw new Error("Canvas is not specified"); + } + if (width <= 0 || height <= 0) { + throw new Error("Invalid canvas size"); + } + canvasAndContext.canvas.width = width; + canvasAndContext.canvas.height = height; + } + destroy(canvasAndContext) { + if (!canvasAndContext.canvas) { + throw new Error("Canvas is not specified"); + } + canvasAndContext.canvas.width = 0; + canvasAndContext.canvas.height = 0; + canvasAndContext.canvas = null; + canvasAndContext.context = null; + } + _createCanvas(width, height) { + unreachable("Abstract method `_createCanvas` called."); + } +} +class DOMCanvasFactory extends BaseCanvasFactory { + constructor({ + ownerDocument = globalThis.document, + enableHWA = false + }) { + super({ + enableHWA + }); + this._document = ownerDocument; + } + _createCanvas(width, height) { + const canvas = this._document.createElement("canvas"); + canvas.width = width; + canvas.height = height; + return canvas; + } +} + +;// ./src/display/cmap_reader_factory.js + + +class BaseCMapReaderFactory { + constructor({ + baseUrl = null, + isCompressed = true + }) { + this.baseUrl = baseUrl; + this.isCompressed = isCompressed; + } + async fetch({ + name + }) { + if (!this.baseUrl) { + throw new Error("Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided."); + } + if (!name) { + throw new Error("CMap name must be specified."); + } + const url = this.baseUrl + name + (this.isCompressed ? ".bcmap" : ""); + return this._fetch(url).then(cMapData => ({ + cMapData, + isCompressed: this.isCompressed + })).catch(reason => { + throw new Error(`Unable to load ${this.isCompressed ? "binary " : ""}CMap at: ${url}`); + }); + } + async _fetch(url) { + unreachable("Abstract method `_fetch` called."); + } +} +class DOMCMapReaderFactory extends BaseCMapReaderFactory { + async _fetch(url) { + const data = await fetchData(url, this.isCompressed ? "arraybuffer" : "text"); + return data instanceof ArrayBuffer ? new Uint8Array(data) : stringToBytes(data); + } +} + +;// ./src/display/filter_factory.js + + +class BaseFilterFactory { + addFilter(maps) { + return "none"; + } + addHCMFilter(fgColor, bgColor) { + return "none"; + } + addAlphaFilter(map) { + return "none"; + } + addLuminosityFilter(map) { + return "none"; + } + addHighlightHCMFilter(filterName, fgColor, bgColor, newFgColor, newBgColor) { + return "none"; + } + destroy(keepHCM = false) {} +} +class DOMFilterFactory extends BaseFilterFactory { + #baseUrl; + #_cache; + #_defs; + #docId; + #document; + #_hcmCache; + #id = 0; + constructor({ + docId, + ownerDocument = globalThis.document + }) { + super(); + this.#docId = docId; + this.#document = ownerDocument; + } + get #cache() { + return this.#_cache ||= new Map(); + } + get #hcmCache() { + return this.#_hcmCache ||= new Map(); + } + get #defs() { + if (!this.#_defs) { + const div = this.#document.createElement("div"); + const { + style + } = div; + style.visibility = "hidden"; + style.contain = "strict"; + style.width = style.height = 0; + style.position = "absolute"; + style.top = style.left = 0; + style.zIndex = -1; + const svg = this.#document.createElementNS(SVG_NS, "svg"); + svg.setAttribute("width", 0); + svg.setAttribute("height", 0); + this.#_defs = this.#document.createElementNS(SVG_NS, "defs"); + div.append(svg); + svg.append(this.#_defs); + this.#document.body.append(div); + } + return this.#_defs; + } + #createTables(maps) { + if (maps.length === 1) { + const mapR = maps[0]; + const buffer = new Array(256); + for (let i = 0; i < 256; i++) { + buffer[i] = mapR[i] / 255; + } + const table = buffer.join(","); + return [table, table, table]; + } + const [mapR, mapG, mapB] = maps; + const bufferR = new Array(256); + const bufferG = new Array(256); + const bufferB = new Array(256); + for (let i = 0; i < 256; i++) { + bufferR[i] = mapR[i] / 255; + bufferG[i] = mapG[i] / 255; + bufferB[i] = mapB[i] / 255; + } + return [bufferR.join(","), bufferG.join(","), bufferB.join(",")]; + } + #createUrl(id) { + if (this.#baseUrl === undefined) { + this.#baseUrl = ""; + const url = this.#document.URL; + if (url !== this.#document.baseURI) { + if (isDataScheme(url)) { + warn('#createUrl: ignore "data:"-URL for performance reasons.'); + } else { + this.#baseUrl = url.split("#", 1)[0]; + } + } + } + return `url(${this.#baseUrl}#${id})`; + } + addFilter(maps) { + if (!maps) { + return "none"; + } + let value = this.#cache.get(maps); + if (value) { + return value; + } + const [tableR, tableG, tableB] = this.#createTables(maps); + const key = maps.length === 1 ? tableR : `${tableR}${tableG}${tableB}`; + value = this.#cache.get(key); + if (value) { + this.#cache.set(maps, value); + return value; + } + const id = `g_${this.#docId}_transfer_map_${this.#id++}`; + const url = this.#createUrl(id); + this.#cache.set(maps, url); + this.#cache.set(key, url); + const filter = this.#createFilter(id); + this.#addTransferMapConversion(tableR, tableG, tableB, filter); + return url; + } + addHCMFilter(fgColor, bgColor) { + const key = `${fgColor}-${bgColor}`; + const filterName = "base"; + let info = this.#hcmCache.get(filterName); + if (info?.key === key) { + return info.url; + } + if (info) { + info.filter?.remove(); + info.key = key; + info.url = "none"; + info.filter = null; + } else { + info = { + key, + url: "none", + filter: null + }; + this.#hcmCache.set(filterName, info); + } + if (!fgColor || !bgColor) { + return info.url; + } + const fgRGB = this.#getRGB(fgColor); + fgColor = Util.makeHexColor(...fgRGB); + const bgRGB = this.#getRGB(bgColor); + bgColor = Util.makeHexColor(...bgRGB); + this.#defs.style.color = ""; + if (fgColor === "#000000" && bgColor === "#ffffff" || fgColor === bgColor) { + return info.url; + } + const map = new Array(256); + for (let i = 0; i <= 255; i++) { + const x = i / 255; + map[i] = x <= 0.03928 ? x / 12.92 : ((x + 0.055) / 1.055) ** 2.4; + } + const table = map.join(","); + const id = `g_${this.#docId}_hcm_filter`; + const filter = info.filter = this.#createFilter(id); + this.#addTransferMapConversion(table, table, table, filter); + this.#addGrayConversion(filter); + const getSteps = (c, n) => { + const start = fgRGB[c] / 255; + const end = bgRGB[c] / 255; + const arr = new Array(n + 1); + for (let i = 0; i <= n; i++) { + arr[i] = start + i / n * (end - start); + } + return arr.join(","); + }; + this.#addTransferMapConversion(getSteps(0, 5), getSteps(1, 5), getSteps(2, 5), filter); + info.url = this.#createUrl(id); + return info.url; + } + addAlphaFilter(map) { + let value = this.#cache.get(map); + if (value) { + return value; + } + const [tableA] = this.#createTables([map]); + const key = `alpha_${tableA}`; + value = this.#cache.get(key); + if (value) { + this.#cache.set(map, value); + return value; + } + const id = `g_${this.#docId}_alpha_map_${this.#id++}`; + const url = this.#createUrl(id); + this.#cache.set(map, url); + this.#cache.set(key, url); + const filter = this.#createFilter(id); + this.#addTransferMapAlphaConversion(tableA, filter); + return url; + } + addLuminosityFilter(map) { + let value = this.#cache.get(map || "luminosity"); + if (value) { + return value; + } + let tableA, key; + if (map) { + [tableA] = this.#createTables([map]); + key = `luminosity_${tableA}`; + } else { + key = "luminosity"; + } + value = this.#cache.get(key); + if (value) { + this.#cache.set(map, value); + return value; + } + const id = `g_${this.#docId}_luminosity_map_${this.#id++}`; + const url = this.#createUrl(id); + this.#cache.set(map, url); + this.#cache.set(key, url); + const filter = this.#createFilter(id); + this.#addLuminosityConversion(filter); + if (map) { + this.#addTransferMapAlphaConversion(tableA, filter); + } + return url; + } + addHighlightHCMFilter(filterName, fgColor, bgColor, newFgColor, newBgColor) { + const key = `${fgColor}-${bgColor}-${newFgColor}-${newBgColor}`; + let info = this.#hcmCache.get(filterName); + if (info?.key === key) { + return info.url; + } + if (info) { + info.filter?.remove(); + info.key = key; + info.url = "none"; + info.filter = null; + } else { + info = { + key, + url: "none", + filter: null + }; + this.#hcmCache.set(filterName, info); + } + if (!fgColor || !bgColor) { + return info.url; + } + const [fgRGB, bgRGB] = [fgColor, bgColor].map(this.#getRGB.bind(this)); + let fgGray = Math.round(0.2126 * fgRGB[0] + 0.7152 * fgRGB[1] + 0.0722 * fgRGB[2]); + let bgGray = Math.round(0.2126 * bgRGB[0] + 0.7152 * bgRGB[1] + 0.0722 * bgRGB[2]); + let [newFgRGB, newBgRGB] = [newFgColor, newBgColor].map(this.#getRGB.bind(this)); + if (bgGray < fgGray) { + [fgGray, bgGray, newFgRGB, newBgRGB] = [bgGray, fgGray, newBgRGB, newFgRGB]; + } + this.#defs.style.color = ""; + const getSteps = (fg, bg, n) => { + const arr = new Array(256); + const step = (bgGray - fgGray) / n; + const newStart = fg / 255; + const newStep = (bg - fg) / (255 * n); + let prev = 0; + for (let i = 0; i <= n; i++) { + const k = Math.round(fgGray + i * step); + const value = newStart + i * newStep; + for (let j = prev; j <= k; j++) { + arr[j] = value; + } + prev = k + 1; + } + for (let i = prev; i < 256; i++) { + arr[i] = arr[prev - 1]; + } + return arr.join(","); + }; + const id = `g_${this.#docId}_hcm_${filterName}_filter`; + const filter = info.filter = this.#createFilter(id); + this.#addGrayConversion(filter); + this.#addTransferMapConversion(getSteps(newFgRGB[0], newBgRGB[0], 5), getSteps(newFgRGB[1], newBgRGB[1], 5), getSteps(newFgRGB[2], newBgRGB[2], 5), filter); + info.url = this.#createUrl(id); + return info.url; + } + destroy(keepHCM = false) { + if (keepHCM && this.#_hcmCache?.size) { + return; + } + this.#_defs?.parentNode.parentNode.remove(); + this.#_defs = null; + this.#_cache?.clear(); + this.#_cache = null; + this.#_hcmCache?.clear(); + this.#_hcmCache = null; + this.#id = 0; + } + #addLuminosityConversion(filter) { + const feColorMatrix = this.#document.createElementNS(SVG_NS, "feColorMatrix"); + feColorMatrix.setAttribute("type", "matrix"); + feColorMatrix.setAttribute("values", "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"); + filter.append(feColorMatrix); + } + #addGrayConversion(filter) { + const feColorMatrix = this.#document.createElementNS(SVG_NS, "feColorMatrix"); + feColorMatrix.setAttribute("type", "matrix"); + feColorMatrix.setAttribute("values", "0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"); + filter.append(feColorMatrix); + } + #createFilter(id) { + const filter = this.#document.createElementNS(SVG_NS, "filter"); + filter.setAttribute("color-interpolation-filters", "sRGB"); + filter.setAttribute("id", id); + this.#defs.append(filter); + return filter; + } + #appendFeFunc(feComponentTransfer, func, table) { + const feFunc = this.#document.createElementNS(SVG_NS, func); + feFunc.setAttribute("type", "discrete"); + feFunc.setAttribute("tableValues", table); + feComponentTransfer.append(feFunc); + } + #addTransferMapConversion(rTable, gTable, bTable, filter) { + const feComponentTransfer = this.#document.createElementNS(SVG_NS, "feComponentTransfer"); + filter.append(feComponentTransfer); + this.#appendFeFunc(feComponentTransfer, "feFuncR", rTable); + this.#appendFeFunc(feComponentTransfer, "feFuncG", gTable); + this.#appendFeFunc(feComponentTransfer, "feFuncB", bTable); + } + #addTransferMapAlphaConversion(aTable, filter) { + const feComponentTransfer = this.#document.createElementNS(SVG_NS, "feComponentTransfer"); + filter.append(feComponentTransfer); + this.#appendFeFunc(feComponentTransfer, "feFuncA", aTable); + } + #getRGB(color) { + this.#defs.style.color = color; + return getRGB(getComputedStyle(this.#defs).getPropertyValue("color")); + } +} + +;// ./src/display/standard_fontdata_factory.js + + +class BaseStandardFontDataFactory { + constructor({ + baseUrl = null + }) { + this.baseUrl = baseUrl; + } + async fetch({ + filename + }) { + if (!this.baseUrl) { + throw new Error("Ensure that the `standardFontDataUrl` API parameter is provided."); + } + if (!filename) { + throw new Error("Font filename must be specified."); + } + const url = `${this.baseUrl}${filename}`; + return this._fetch(url).catch(reason => { + throw new Error(`Unable to load font data at: ${url}`); + }); + } + async _fetch(url) { + unreachable("Abstract method `_fetch` called."); + } +} +class DOMStandardFontDataFactory extends BaseStandardFontDataFactory { + async _fetch(url) { + const data = await fetchData(url, "arraybuffer"); + return new Uint8Array(data); + } +} + +;// ./src/display/node_utils.js + + + + + +if (isNodeJS) { + warn("Please use the `legacy` build in Node.js environments."); +} +async function node_utils_fetchData(url) { + const fs = process.getBuiltinModule("fs"); + const data = await fs.promises.readFile(url); + return new Uint8Array(data); +} +class NodeFilterFactory extends BaseFilterFactory {} +class NodeCanvasFactory extends BaseCanvasFactory { + _createCanvas(width, height) { + const require = process.getBuiltinModule("module").createRequire(import.meta.url); + const canvas = require("@napi-rs/canvas"); + return canvas.createCanvas(width, height); + } +} +class NodeCMapReaderFactory extends BaseCMapReaderFactory { + async _fetch(url) { + return node_utils_fetchData(url); + } +} +class NodeStandardFontDataFactory extends BaseStandardFontDataFactory { + async _fetch(url) { + return node_utils_fetchData(url); + } +} + +;// ./src/display/pattern_helper.js + + +const PathType = { + FILL: "Fill", + STROKE: "Stroke", + SHADING: "Shading" +}; +function applyBoundingBox(ctx, bbox) { + if (!bbox) { + return; + } + const width = bbox[2] - bbox[0]; + const height = bbox[3] - bbox[1]; + const region = new Path2D(); + region.rect(bbox[0], bbox[1], width, height); + ctx.clip(region); +} +class BaseShadingPattern { + getPattern() { + unreachable("Abstract method `getPattern` called."); + } +} +class RadialAxialShadingPattern extends BaseShadingPattern { + constructor(IR) { + super(); + this._type = IR[1]; + this._bbox = IR[2]; + this._colorStops = IR[3]; + this._p0 = IR[4]; + this._p1 = IR[5]; + this._r0 = IR[6]; + this._r1 = IR[7]; + this.matrix = null; + } + _createGradient(ctx) { + let grad; + if (this._type === "axial") { + grad = ctx.createLinearGradient(this._p0[0], this._p0[1], this._p1[0], this._p1[1]); + } else if (this._type === "radial") { + grad = ctx.createRadialGradient(this._p0[0], this._p0[1], this._r0, this._p1[0], this._p1[1], this._r1); + } + for (const colorStop of this._colorStops) { + grad.addColorStop(colorStop[0], colorStop[1]); + } + return grad; + } + getPattern(ctx, owner, inverse, pathType) { + let pattern; + if (pathType === PathType.STROKE || pathType === PathType.FILL) { + const ownerBBox = owner.current.getClippedPathBoundingBox(pathType, getCurrentTransform(ctx)) || [0, 0, 0, 0]; + const width = Math.ceil(ownerBBox[2] - ownerBBox[0]) || 1; + const height = Math.ceil(ownerBBox[3] - ownerBBox[1]) || 1; + const tmpCanvas = owner.cachedCanvases.getCanvas("pattern", width, height); + const tmpCtx = tmpCanvas.context; + tmpCtx.clearRect(0, 0, tmpCtx.canvas.width, tmpCtx.canvas.height); + tmpCtx.beginPath(); + tmpCtx.rect(0, 0, tmpCtx.canvas.width, tmpCtx.canvas.height); + tmpCtx.translate(-ownerBBox[0], -ownerBBox[1]); + inverse = Util.transform(inverse, [1, 0, 0, 1, ownerBBox[0], ownerBBox[1]]); + tmpCtx.transform(...owner.baseTransform); + if (this.matrix) { + tmpCtx.transform(...this.matrix); + } + applyBoundingBox(tmpCtx, this._bbox); + tmpCtx.fillStyle = this._createGradient(tmpCtx); + tmpCtx.fill(); + pattern = ctx.createPattern(tmpCanvas.canvas, "no-repeat"); + const domMatrix = new DOMMatrix(inverse); + pattern.setTransform(domMatrix); + } else { + applyBoundingBox(ctx, this._bbox); + pattern = this._createGradient(ctx); + } + return pattern; + } +} +function drawTriangle(data, context, p1, p2, p3, c1, c2, c3) { + const coords = context.coords, + colors = context.colors; + const bytes = data.data, + rowSize = data.width * 4; + let tmp; + if (coords[p1 + 1] > coords[p2 + 1]) { + tmp = p1; + p1 = p2; + p2 = tmp; + tmp = c1; + c1 = c2; + c2 = tmp; + } + if (coords[p2 + 1] > coords[p3 + 1]) { + tmp = p2; + p2 = p3; + p3 = tmp; + tmp = c2; + c2 = c3; + c3 = tmp; + } + if (coords[p1 + 1] > coords[p2 + 1]) { + tmp = p1; + p1 = p2; + p2 = tmp; + tmp = c1; + c1 = c2; + c2 = tmp; + } + const x1 = (coords[p1] + context.offsetX) * context.scaleX; + const y1 = (coords[p1 + 1] + context.offsetY) * context.scaleY; + const x2 = (coords[p2] + context.offsetX) * context.scaleX; + const y2 = (coords[p2 + 1] + context.offsetY) * context.scaleY; + const x3 = (coords[p3] + context.offsetX) * context.scaleX; + const y3 = (coords[p3 + 1] + context.offsetY) * context.scaleY; + if (y1 >= y3) { + return; + } + const c1r = colors[c1], + c1g = colors[c1 + 1], + c1b = colors[c1 + 2]; + const c2r = colors[c2], + c2g = colors[c2 + 1], + c2b = colors[c2 + 2]; + const c3r = colors[c3], + c3g = colors[c3 + 1], + c3b = colors[c3 + 2]; + const minY = Math.round(y1), + maxY = Math.round(y3); + let xa, car, cag, cab; + let xb, cbr, cbg, cbb; + for (let y = minY; y <= maxY; y++) { + if (y < y2) { + const k = y < y1 ? 0 : (y1 - y) / (y1 - y2); + xa = x1 - (x1 - x2) * k; + car = c1r - (c1r - c2r) * k; + cag = c1g - (c1g - c2g) * k; + cab = c1b - (c1b - c2b) * k; + } else { + let k; + if (y > y3) { + k = 1; + } else if (y2 === y3) { + k = 0; + } else { + k = (y2 - y) / (y2 - y3); + } + xa = x2 - (x2 - x3) * k; + car = c2r - (c2r - c3r) * k; + cag = c2g - (c2g - c3g) * k; + cab = c2b - (c2b - c3b) * k; + } + let k; + if (y < y1) { + k = 0; + } else if (y > y3) { + k = 1; + } else { + k = (y1 - y) / (y1 - y3); + } + xb = x1 - (x1 - x3) * k; + cbr = c1r - (c1r - c3r) * k; + cbg = c1g - (c1g - c3g) * k; + cbb = c1b - (c1b - c3b) * k; + const x1_ = Math.round(Math.min(xa, xb)); + const x2_ = Math.round(Math.max(xa, xb)); + let j = rowSize * y + x1_ * 4; + for (let x = x1_; x <= x2_; x++) { + k = (xa - x) / (xa - xb); + if (k < 0) { + k = 0; + } else if (k > 1) { + k = 1; + } + bytes[j++] = car - (car - cbr) * k | 0; + bytes[j++] = cag - (cag - cbg) * k | 0; + bytes[j++] = cab - (cab - cbb) * k | 0; + bytes[j++] = 255; + } + } +} +function drawFigure(data, figure, context) { + const ps = figure.coords; + const cs = figure.colors; + let i, ii; + switch (figure.type) { + case "lattice": + const verticesPerRow = figure.verticesPerRow; + const rows = Math.floor(ps.length / verticesPerRow) - 1; + const cols = verticesPerRow - 1; + for (i = 0; i < rows; i++) { + let q = i * verticesPerRow; + for (let j = 0; j < cols; j++, q++) { + drawTriangle(data, context, ps[q], ps[q + 1], ps[q + verticesPerRow], cs[q], cs[q + 1], cs[q + verticesPerRow]); + drawTriangle(data, context, ps[q + verticesPerRow + 1], ps[q + 1], ps[q + verticesPerRow], cs[q + verticesPerRow + 1], cs[q + 1], cs[q + verticesPerRow]); + } + } + break; + case "triangles": + for (i = 0, ii = ps.length; i < ii; i += 3) { + drawTriangle(data, context, ps[i], ps[i + 1], ps[i + 2], cs[i], cs[i + 1], cs[i + 2]); + } + break; + default: + throw new Error("illegal figure"); + } +} +class MeshShadingPattern extends BaseShadingPattern { + constructor(IR) { + super(); + this._coords = IR[2]; + this._colors = IR[3]; + this._figures = IR[4]; + this._bounds = IR[5]; + this._bbox = IR[7]; + this._background = IR[8]; + this.matrix = null; + } + _createMeshCanvas(combinedScale, backgroundColor, cachedCanvases) { + const EXPECTED_SCALE = 1.1; + const MAX_PATTERN_SIZE = 3000; + const BORDER_SIZE = 2; + const offsetX = Math.floor(this._bounds[0]); + const offsetY = Math.floor(this._bounds[1]); + const boundsWidth = Math.ceil(this._bounds[2]) - offsetX; + const boundsHeight = Math.ceil(this._bounds[3]) - offsetY; + const width = Math.min(Math.ceil(Math.abs(boundsWidth * combinedScale[0] * EXPECTED_SCALE)), MAX_PATTERN_SIZE); + const height = Math.min(Math.ceil(Math.abs(boundsHeight * combinedScale[1] * EXPECTED_SCALE)), MAX_PATTERN_SIZE); + const scaleX = boundsWidth / width; + const scaleY = boundsHeight / height; + const context = { + coords: this._coords, + colors: this._colors, + offsetX: -offsetX, + offsetY: -offsetY, + scaleX: 1 / scaleX, + scaleY: 1 / scaleY + }; + const paddedWidth = width + BORDER_SIZE * 2; + const paddedHeight = height + BORDER_SIZE * 2; + const tmpCanvas = cachedCanvases.getCanvas("mesh", paddedWidth, paddedHeight); + const tmpCtx = tmpCanvas.context; + const data = tmpCtx.createImageData(width, height); + if (backgroundColor) { + const bytes = data.data; + for (let i = 0, ii = bytes.length; i < ii; i += 4) { + bytes[i] = backgroundColor[0]; + bytes[i + 1] = backgroundColor[1]; + bytes[i + 2] = backgroundColor[2]; + bytes[i + 3] = 255; + } + } + for (const figure of this._figures) { + drawFigure(data, figure, context); + } + tmpCtx.putImageData(data, BORDER_SIZE, BORDER_SIZE); + const canvas = tmpCanvas.canvas; + return { + canvas, + offsetX: offsetX - BORDER_SIZE * scaleX, + offsetY: offsetY - BORDER_SIZE * scaleY, + scaleX, + scaleY + }; + } + getPattern(ctx, owner, inverse, pathType) { + applyBoundingBox(ctx, this._bbox); + let scale; + if (pathType === PathType.SHADING) { + scale = Util.singularValueDecompose2dScale(getCurrentTransform(ctx)); + } else { + scale = Util.singularValueDecompose2dScale(owner.baseTransform); + if (this.matrix) { + const matrixScale = Util.singularValueDecompose2dScale(this.matrix); + scale = [scale[0] * matrixScale[0], scale[1] * matrixScale[1]]; + } + } + const temporaryPatternCanvas = this._createMeshCanvas(scale, pathType === PathType.SHADING ? null : this._background, owner.cachedCanvases); + if (pathType !== PathType.SHADING) { + ctx.setTransform(...owner.baseTransform); + if (this.matrix) { + ctx.transform(...this.matrix); + } + } + ctx.translate(temporaryPatternCanvas.offsetX, temporaryPatternCanvas.offsetY); + ctx.scale(temporaryPatternCanvas.scaleX, temporaryPatternCanvas.scaleY); + return ctx.createPattern(temporaryPatternCanvas.canvas, "no-repeat"); + } +} +class DummyShadingPattern extends BaseShadingPattern { + getPattern() { + return "hotpink"; + } +} +function getShadingPattern(IR) { + switch (IR[0]) { + case "RadialAxial": + return new RadialAxialShadingPattern(IR); + case "Mesh": + return new MeshShadingPattern(IR); + case "Dummy": + return new DummyShadingPattern(); + } + throw new Error(`Unknown IR type: ${IR[0]}`); +} +const PaintType = { + COLORED: 1, + UNCOLORED: 2 +}; +class TilingPattern { + static MAX_PATTERN_SIZE = 3000; + constructor(IR, color, ctx, canvasGraphicsFactory, baseTransform) { + this.operatorList = IR[2]; + this.matrix = IR[3]; + this.bbox = IR[4]; + this.xstep = IR[5]; + this.ystep = IR[6]; + this.paintType = IR[7]; + this.tilingType = IR[8]; + this.color = color; + this.ctx = ctx; + this.canvasGraphicsFactory = canvasGraphicsFactory; + this.baseTransform = baseTransform; + } + createPatternCanvas(owner) { + const { + bbox, + operatorList, + paintType, + tilingType, + color, + canvasGraphicsFactory + } = this; + let { + xstep, + ystep + } = this; + xstep = Math.abs(xstep); + ystep = Math.abs(ystep); + info("TilingType: " + tilingType); + const x0 = bbox[0], + y0 = bbox[1], + x1 = bbox[2], + y1 = bbox[3]; + const width = x1 - x0; + const height = y1 - y0; + const matrixScale = Util.singularValueDecompose2dScale(this.matrix); + const curMatrixScale = Util.singularValueDecompose2dScale(this.baseTransform); + const combinedScaleX = matrixScale[0] * curMatrixScale[0]; + const combinedScaleY = matrixScale[1] * curMatrixScale[1]; + let canvasWidth = width, + canvasHeight = height, + redrawHorizontally = false, + redrawVertically = false; + const xScaledStep = Math.ceil(xstep * combinedScaleX); + const yScaledStep = Math.ceil(ystep * combinedScaleY); + const xScaledWidth = Math.ceil(width * combinedScaleX); + const yScaledHeight = Math.ceil(height * combinedScaleY); + if (xScaledStep >= xScaledWidth) { + canvasWidth = xstep; + } else { + redrawHorizontally = true; + } + if (yScaledStep >= yScaledHeight) { + canvasHeight = ystep; + } else { + redrawVertically = true; + } + const dimx = this.getSizeAndScale(canvasWidth, this.ctx.canvas.width, combinedScaleX); + const dimy = this.getSizeAndScale(canvasHeight, this.ctx.canvas.height, combinedScaleY); + const tmpCanvas = owner.cachedCanvases.getCanvas("pattern", dimx.size, dimy.size); + const tmpCtx = tmpCanvas.context; + const graphics = canvasGraphicsFactory.createCanvasGraphics(tmpCtx); + graphics.groupLevel = owner.groupLevel; + this.setFillAndStrokeStyleToContext(graphics, paintType, color); + tmpCtx.translate(-dimx.scale * x0, -dimy.scale * y0); + graphics.transform(dimx.scale, 0, 0, dimy.scale, 0, 0); + tmpCtx.save(); + this.clipBbox(graphics, x0, y0, x1, y1); + graphics.baseTransform = getCurrentTransform(graphics.ctx); + graphics.executeOperatorList(operatorList); + graphics.endDrawing(); + tmpCtx.restore(); + if (redrawHorizontally || redrawVertically) { + const image = tmpCanvas.canvas; + if (redrawHorizontally) { + canvasWidth = xstep; + } + if (redrawVertically) { + canvasHeight = ystep; + } + const dimx2 = this.getSizeAndScale(canvasWidth, this.ctx.canvas.width, combinedScaleX); + const dimy2 = this.getSizeAndScale(canvasHeight, this.ctx.canvas.height, combinedScaleY); + const xSize = dimx2.size; + const ySize = dimy2.size; + const tmpCanvas2 = owner.cachedCanvases.getCanvas("pattern-workaround", xSize, ySize); + const tmpCtx2 = tmpCanvas2.context; + const ii = redrawHorizontally ? Math.floor(width / xstep) : 0; + const jj = redrawVertically ? Math.floor(height / ystep) : 0; + for (let i = 0; i <= ii; i++) { + for (let j = 0; j <= jj; j++) { + tmpCtx2.drawImage(image, xSize * i, ySize * j, xSize, ySize, 0, 0, xSize, ySize); + } + } + return { + canvas: tmpCanvas2.canvas, + scaleX: dimx2.scale, + scaleY: dimy2.scale, + offsetX: x0, + offsetY: y0 + }; + } + return { + canvas: tmpCanvas.canvas, + scaleX: dimx.scale, + scaleY: dimy.scale, + offsetX: x0, + offsetY: y0 + }; + } + getSizeAndScale(step, realOutputSize, scale) { + const maxSize = Math.max(TilingPattern.MAX_PATTERN_SIZE, realOutputSize); + let size = Math.ceil(step * scale); + if (size >= maxSize) { + size = maxSize; + } else { + scale = size / step; + } + return { + scale, + size + }; + } + clipBbox(graphics, x0, y0, x1, y1) { + const bboxWidth = x1 - x0; + const bboxHeight = y1 - y0; + graphics.ctx.rect(x0, y0, bboxWidth, bboxHeight); + graphics.current.updateRectMinMax(getCurrentTransform(graphics.ctx), [x0, y0, x1, y1]); + graphics.clip(); + graphics.endPath(); + } + setFillAndStrokeStyleToContext(graphics, paintType, color) { + const context = graphics.ctx, + current = graphics.current; + switch (paintType) { + case PaintType.COLORED: + const ctx = this.ctx; + context.fillStyle = ctx.fillStyle; + context.strokeStyle = ctx.strokeStyle; + current.fillColor = ctx.fillStyle; + current.strokeColor = ctx.strokeStyle; + break; + case PaintType.UNCOLORED: + const cssColor = Util.makeHexColor(color[0], color[1], color[2]); + context.fillStyle = cssColor; + context.strokeStyle = cssColor; + current.fillColor = cssColor; + current.strokeColor = cssColor; + break; + default: + throw new FormatError(`Unsupported paint type: ${paintType}`); + } + } + getPattern(ctx, owner, inverse, pathType) { + let matrix = inverse; + if (pathType !== PathType.SHADING) { + matrix = Util.transform(matrix, owner.baseTransform); + if (this.matrix) { + matrix = Util.transform(matrix, this.matrix); + } + } + const temporaryPatternCanvas = this.createPatternCanvas(owner); + let domMatrix = new DOMMatrix(matrix); + domMatrix = domMatrix.translate(temporaryPatternCanvas.offsetX, temporaryPatternCanvas.offsetY); + domMatrix = domMatrix.scale(1 / temporaryPatternCanvas.scaleX, 1 / temporaryPatternCanvas.scaleY); + const pattern = ctx.createPattern(temporaryPatternCanvas.canvas, "repeat"); + pattern.setTransform(domMatrix); + return pattern; + } +} + +;// ./src/shared/image_utils.js + +function convertToRGBA(params) { + switch (params.kind) { + case ImageKind.GRAYSCALE_1BPP: + return convertBlackAndWhiteToRGBA(params); + case ImageKind.RGB_24BPP: + return convertRGBToRGBA(params); + } + return null; +} +function convertBlackAndWhiteToRGBA({ + src, + srcPos = 0, + dest, + width, + height, + nonBlackColor = 0xffffffff, + inverseDecode = false +}) { + const black = util_FeatureTest.isLittleEndian ? 0xff000000 : 0x000000ff; + const [zeroMapping, oneMapping] = inverseDecode ? [nonBlackColor, black] : [black, nonBlackColor]; + const widthInSource = width >> 3; + const widthRemainder = width & 7; + const srcLength = src.length; + dest = new Uint32Array(dest.buffer); + let destPos = 0; + for (let i = 0; i < height; i++) { + for (const max = srcPos + widthInSource; srcPos < max; srcPos++) { + const elem = srcPos < srcLength ? src[srcPos] : 255; + dest[destPos++] = elem & 0b10000000 ? oneMapping : zeroMapping; + dest[destPos++] = elem & 0b1000000 ? oneMapping : zeroMapping; + dest[destPos++] = elem & 0b100000 ? oneMapping : zeroMapping; + dest[destPos++] = elem & 0b10000 ? oneMapping : zeroMapping; + dest[destPos++] = elem & 0b1000 ? oneMapping : zeroMapping; + dest[destPos++] = elem & 0b100 ? oneMapping : zeroMapping; + dest[destPos++] = elem & 0b10 ? oneMapping : zeroMapping; + dest[destPos++] = elem & 0b1 ? oneMapping : zeroMapping; + } + if (widthRemainder === 0) { + continue; + } + const elem = srcPos < srcLength ? src[srcPos++] : 255; + for (let j = 0; j < widthRemainder; j++) { + dest[destPos++] = elem & 1 << 7 - j ? oneMapping : zeroMapping; + } + } + return { + srcPos, + destPos + }; +} +function convertRGBToRGBA({ + src, + srcPos = 0, + dest, + destPos = 0, + width, + height +}) { + let i = 0; + const len = width * height * 3; + const len32 = len >> 2; + const src32 = new Uint32Array(src.buffer, srcPos, len32); + if (FeatureTest.isLittleEndian) { + for (; i < len32 - 2; i += 3, destPos += 4) { + const s1 = src32[i]; + const s2 = src32[i + 1]; + const s3 = src32[i + 2]; + dest[destPos] = s1 | 0xff000000; + dest[destPos + 1] = s1 >>> 24 | s2 << 8 | 0xff000000; + dest[destPos + 2] = s2 >>> 16 | s3 << 16 | 0xff000000; + dest[destPos + 3] = s3 >>> 8 | 0xff000000; + } + for (let j = i * 4, jj = srcPos + len; j < jj; j += 3) { + dest[destPos++] = src[j] | src[j + 1] << 8 | src[j + 2] << 16 | 0xff000000; + } + } else { + for (; i < len32 - 2; i += 3, destPos += 4) { + const s1 = src32[i]; + const s2 = src32[i + 1]; + const s3 = src32[i + 2]; + dest[destPos] = s1 | 0xff; + dest[destPos + 1] = s1 << 24 | s2 >>> 8 | 0xff; + dest[destPos + 2] = s2 << 16 | s3 >>> 16 | 0xff; + dest[destPos + 3] = s3 << 8 | 0xff; + } + for (let j = i * 4, jj = srcPos + len; j < jj; j += 3) { + dest[destPos++] = src[j] << 24 | src[j + 1] << 16 | src[j + 2] << 8 | 0xff; + } + } + return { + srcPos: srcPos + len, + destPos + }; +} +function grayToRGBA(src, dest) { + if (FeatureTest.isLittleEndian) { + for (let i = 0, ii = src.length; i < ii; i++) { + dest[i] = src[i] * 0x10101 | 0xff000000; + } + } else { + for (let i = 0, ii = src.length; i < ii; i++) { + dest[i] = src[i] * 0x1010100 | 0x000000ff; + } + } +} + +;// ./src/display/canvas.js + + + + +const MIN_FONT_SIZE = 16; +const MAX_FONT_SIZE = 100; +const EXECUTION_TIME = 15; +const EXECUTION_STEPS = 10; +const MAX_SIZE_TO_COMPILE = 1000; +const FULL_CHUNK_HEIGHT = 16; +function mirrorContextOperations(ctx, destCtx) { + if (ctx._removeMirroring) { + throw new Error("Context is already forwarding operations."); + } + ctx.__originalSave = ctx.save; + ctx.__originalRestore = ctx.restore; + ctx.__originalRotate = ctx.rotate; + ctx.__originalScale = ctx.scale; + ctx.__originalTranslate = ctx.translate; + ctx.__originalTransform = ctx.transform; + ctx.__originalSetTransform = ctx.setTransform; + ctx.__originalResetTransform = ctx.resetTransform; + ctx.__originalClip = ctx.clip; + ctx.__originalMoveTo = ctx.moveTo; + ctx.__originalLineTo = ctx.lineTo; + ctx.__originalBezierCurveTo = ctx.bezierCurveTo; + ctx.__originalRect = ctx.rect; + ctx.__originalClosePath = ctx.closePath; + ctx.__originalBeginPath = ctx.beginPath; + ctx._removeMirroring = () => { + ctx.save = ctx.__originalSave; + ctx.restore = ctx.__originalRestore; + ctx.rotate = ctx.__originalRotate; + ctx.scale = ctx.__originalScale; + ctx.translate = ctx.__originalTranslate; + ctx.transform = ctx.__originalTransform; + ctx.setTransform = ctx.__originalSetTransform; + ctx.resetTransform = ctx.__originalResetTransform; + ctx.clip = ctx.__originalClip; + ctx.moveTo = ctx.__originalMoveTo; + ctx.lineTo = ctx.__originalLineTo; + ctx.bezierCurveTo = ctx.__originalBezierCurveTo; + ctx.rect = ctx.__originalRect; + ctx.closePath = ctx.__originalClosePath; + ctx.beginPath = ctx.__originalBeginPath; + delete ctx._removeMirroring; + }; + ctx.save = function ctxSave() { + destCtx.save(); + this.__originalSave(); + }; + ctx.restore = function ctxRestore() { + destCtx.restore(); + this.__originalRestore(); + }; + ctx.translate = function ctxTranslate(x, y) { + destCtx.translate(x, y); + this.__originalTranslate(x, y); + }; + ctx.scale = function ctxScale(x, y) { + destCtx.scale(x, y); + this.__originalScale(x, y); + }; + ctx.transform = function ctxTransform(a, b, c, d, e, f) { + destCtx.transform(a, b, c, d, e, f); + this.__originalTransform(a, b, c, d, e, f); + }; + ctx.setTransform = function ctxSetTransform(a, b, c, d, e, f) { + destCtx.setTransform(a, b, c, d, e, f); + this.__originalSetTransform(a, b, c, d, e, f); + }; + ctx.resetTransform = function ctxResetTransform() { + destCtx.resetTransform(); + this.__originalResetTransform(); + }; + ctx.rotate = function ctxRotate(angle) { + destCtx.rotate(angle); + this.__originalRotate(angle); + }; + ctx.clip = function ctxRotate(rule) { + destCtx.clip(rule); + this.__originalClip(rule); + }; + ctx.moveTo = function (x, y) { + destCtx.moveTo(x, y); + this.__originalMoveTo(x, y); + }; + ctx.lineTo = function (x, y) { + destCtx.lineTo(x, y); + this.__originalLineTo(x, y); + }; + ctx.bezierCurveTo = function (cp1x, cp1y, cp2x, cp2y, x, y) { + destCtx.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y); + this.__originalBezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y); + }; + ctx.rect = function (x, y, width, height) { + destCtx.rect(x, y, width, height); + this.__originalRect(x, y, width, height); + }; + ctx.closePath = function () { + destCtx.closePath(); + this.__originalClosePath(); + }; + ctx.beginPath = function () { + destCtx.beginPath(); + this.__originalBeginPath(); + }; +} +class CachedCanvases { + constructor(canvasFactory) { + this.canvasFactory = canvasFactory; + this.cache = Object.create(null); + } + getCanvas(id, width, height) { + let canvasEntry; + if (this.cache[id] !== undefined) { + canvasEntry = this.cache[id]; + this.canvasFactory.reset(canvasEntry, width, height); + } else { + canvasEntry = this.canvasFactory.create(width, height); + this.cache[id] = canvasEntry; + } + return canvasEntry; + } + delete(id) { + delete this.cache[id]; + } + clear() { + for (const id in this.cache) { + const canvasEntry = this.cache[id]; + this.canvasFactory.destroy(canvasEntry); + delete this.cache[id]; + } + } +} +function drawImageAtIntegerCoords(ctx, srcImg, srcX, srcY, srcW, srcH, destX, destY, destW, destH) { + const [a, b, c, d, tx, ty] = getCurrentTransform(ctx); + if (b === 0 && c === 0) { + const tlX = destX * a + tx; + const rTlX = Math.round(tlX); + const tlY = destY * d + ty; + const rTlY = Math.round(tlY); + const brX = (destX + destW) * a + tx; + const rWidth = Math.abs(Math.round(brX) - rTlX) || 1; + const brY = (destY + destH) * d + ty; + const rHeight = Math.abs(Math.round(brY) - rTlY) || 1; + ctx.setTransform(Math.sign(a), 0, 0, Math.sign(d), rTlX, rTlY); + ctx.drawImage(srcImg, srcX, srcY, srcW, srcH, 0, 0, rWidth, rHeight); + ctx.setTransform(a, b, c, d, tx, ty); + return [rWidth, rHeight]; + } + if (a === 0 && d === 0) { + const tlX = destY * c + tx; + const rTlX = Math.round(tlX); + const tlY = destX * b + ty; + const rTlY = Math.round(tlY); + const brX = (destY + destH) * c + tx; + const rWidth = Math.abs(Math.round(brX) - rTlX) || 1; + const brY = (destX + destW) * b + ty; + const rHeight = Math.abs(Math.round(brY) - rTlY) || 1; + ctx.setTransform(0, Math.sign(b), Math.sign(c), 0, rTlX, rTlY); + ctx.drawImage(srcImg, srcX, srcY, srcW, srcH, 0, 0, rHeight, rWidth); + ctx.setTransform(a, b, c, d, tx, ty); + return [rHeight, rWidth]; + } + ctx.drawImage(srcImg, srcX, srcY, srcW, srcH, destX, destY, destW, destH); + const scaleX = Math.hypot(a, b); + const scaleY = Math.hypot(c, d); + return [scaleX * destW, scaleY * destH]; +} +function compileType3Glyph(imgData) { + const { + width, + height + } = imgData; + if (width > MAX_SIZE_TO_COMPILE || height > MAX_SIZE_TO_COMPILE) { + return null; + } + const POINT_TO_PROCESS_LIMIT = 1000; + const POINT_TYPES = new Uint8Array([0, 2, 4, 0, 1, 0, 5, 4, 8, 10, 0, 8, 0, 2, 1, 0]); + const width1 = width + 1; + let points = new Uint8Array(width1 * (height + 1)); + let i, j, j0; + const lineSize = width + 7 & ~7; + let data = new Uint8Array(lineSize * height), + pos = 0; + for (const elem of imgData.data) { + let mask = 128; + while (mask > 0) { + data[pos++] = elem & mask ? 0 : 255; + mask >>= 1; + } + } + let count = 0; + pos = 0; + if (data[pos] !== 0) { + points[0] = 1; + ++count; + } + for (j = 1; j < width; j++) { + if (data[pos] !== data[pos + 1]) { + points[j] = data[pos] ? 2 : 1; + ++count; + } + pos++; + } + if (data[pos] !== 0) { + points[j] = 2; + ++count; + } + for (i = 1; i < height; i++) { + pos = i * lineSize; + j0 = i * width1; + if (data[pos - lineSize] !== data[pos]) { + points[j0] = data[pos] ? 1 : 8; + ++count; + } + let sum = (data[pos] ? 4 : 0) + (data[pos - lineSize] ? 8 : 0); + for (j = 1; j < width; j++) { + sum = (sum >> 2) + (data[pos + 1] ? 4 : 0) + (data[pos - lineSize + 1] ? 8 : 0); + if (POINT_TYPES[sum]) { + points[j0 + j] = POINT_TYPES[sum]; + ++count; + } + pos++; + } + if (data[pos - lineSize] !== data[pos]) { + points[j0 + j] = data[pos] ? 2 : 4; + ++count; + } + if (count > POINT_TO_PROCESS_LIMIT) { + return null; + } + } + pos = lineSize * (height - 1); + j0 = i * width1; + if (data[pos] !== 0) { + points[j0] = 8; + ++count; + } + for (j = 1; j < width; j++) { + if (data[pos] !== data[pos + 1]) { + points[j0 + j] = data[pos] ? 4 : 8; + ++count; + } + pos++; + } + if (data[pos] !== 0) { + points[j0 + j] = 4; + ++count; + } + if (count > POINT_TO_PROCESS_LIMIT) { + return null; + } + const steps = new Int32Array([0, width1, -1, 0, -width1, 0, 0, 0, 1]); + const path = new Path2D(); + for (i = 0; count && i <= height; i++) { + let p = i * width1; + const end = p + width; + while (p < end && !points[p]) { + p++; + } + if (p === end) { + continue; + } + path.moveTo(p % width1, i); + const p0 = p; + let type = points[p]; + do { + const step = steps[type]; + do { + p += step; + } while (!points[p]); + const pp = points[p]; + if (pp !== 5 && pp !== 10) { + type = pp; + points[p] = 0; + } else { + type = pp & 0x33 * type >> 4; + points[p] &= type >> 2 | type << 2; + } + path.lineTo(p % width1, p / width1 | 0); + if (!points[p]) { + --count; + } + } while (p0 !== p); + --i; + } + data = null; + points = null; + const drawOutline = function (c) { + c.save(); + c.scale(1 / width, -1 / height); + c.translate(0, -height); + c.fill(path); + c.beginPath(); + c.restore(); + }; + return drawOutline; +} +class CanvasExtraState { + constructor(width, height) { + this.alphaIsShape = false; + this.fontSize = 0; + this.fontSizeScale = 1; + this.textMatrix = IDENTITY_MATRIX; + this.textMatrixScale = 1; + this.fontMatrix = FONT_IDENTITY_MATRIX; + this.leading = 0; + this.x = 0; + this.y = 0; + this.lineX = 0; + this.lineY = 0; + this.charSpacing = 0; + this.wordSpacing = 0; + this.textHScale = 1; + this.textRenderingMode = TextRenderingMode.FILL; + this.textRise = 0; + this.fillColor = "#000000"; + this.strokeColor = "#000000"; + this.patternFill = false; + this.patternStroke = false; + this.fillAlpha = 1; + this.strokeAlpha = 1; + this.lineWidth = 1; + this.activeSMask = null; + this.transferMaps = "none"; + this.startNewPathAndClipBox([0, 0, width, height]); + } + clone() { + const clone = Object.create(this); + clone.clipBox = this.clipBox.slice(); + return clone; + } + setCurrentPoint(x, y) { + this.x = x; + this.y = y; + } + updatePathMinMax(transform, x, y) { + [x, y] = Util.applyTransform([x, y], transform); + this.minX = Math.min(this.minX, x); + this.minY = Math.min(this.minY, y); + this.maxX = Math.max(this.maxX, x); + this.maxY = Math.max(this.maxY, y); + } + updateRectMinMax(transform, rect) { + const p1 = Util.applyTransform(rect, transform); + const p2 = Util.applyTransform(rect.slice(2), transform); + const p3 = Util.applyTransform([rect[0], rect[3]], transform); + const p4 = Util.applyTransform([rect[2], rect[1]], transform); + this.minX = Math.min(this.minX, p1[0], p2[0], p3[0], p4[0]); + this.minY = Math.min(this.minY, p1[1], p2[1], p3[1], p4[1]); + this.maxX = Math.max(this.maxX, p1[0], p2[0], p3[0], p4[0]); + this.maxY = Math.max(this.maxY, p1[1], p2[1], p3[1], p4[1]); + } + updateScalingPathMinMax(transform, minMax) { + Util.scaleMinMax(transform, minMax); + this.minX = Math.min(this.minX, minMax[0]); + this.minY = Math.min(this.minY, minMax[1]); + this.maxX = Math.max(this.maxX, minMax[2]); + this.maxY = Math.max(this.maxY, minMax[3]); + } + updateCurvePathMinMax(transform, x0, y0, x1, y1, x2, y2, x3, y3, minMax) { + const box = Util.bezierBoundingBox(x0, y0, x1, y1, x2, y2, x3, y3, minMax); + if (minMax) { + return; + } + this.updateRectMinMax(transform, box); + } + getPathBoundingBox(pathType = PathType.FILL, transform = null) { + const box = [this.minX, this.minY, this.maxX, this.maxY]; + if (pathType === PathType.STROKE) { + if (!transform) { + unreachable("Stroke bounding box must include transform."); + } + const scale = Util.singularValueDecompose2dScale(transform); + const xStrokePad = scale[0] * this.lineWidth / 2; + const yStrokePad = scale[1] * this.lineWidth / 2; + box[0] -= xStrokePad; + box[1] -= yStrokePad; + box[2] += xStrokePad; + box[3] += yStrokePad; + } + return box; + } + updateClipFromPath() { + const intersect = Util.intersect(this.clipBox, this.getPathBoundingBox()); + this.startNewPathAndClipBox(intersect || [0, 0, 0, 0]); + } + isEmptyClip() { + return this.minX === Infinity; + } + startNewPathAndClipBox(box) { + this.clipBox = box; + this.minX = Infinity; + this.minY = Infinity; + this.maxX = 0; + this.maxY = 0; + } + getClippedPathBoundingBox(pathType = PathType.FILL, transform = null) { + return Util.intersect(this.clipBox, this.getPathBoundingBox(pathType, transform)); + } +} +function putBinaryImageData(ctx, imgData) { + if (imgData instanceof ImageData) { + ctx.putImageData(imgData, 0, 0); + return; + } + const height = imgData.height, + width = imgData.width; + const partialChunkHeight = height % FULL_CHUNK_HEIGHT; + const fullChunks = (height - partialChunkHeight) / FULL_CHUNK_HEIGHT; + const totalChunks = partialChunkHeight === 0 ? fullChunks : fullChunks + 1; + const chunkImgData = ctx.createImageData(width, FULL_CHUNK_HEIGHT); + let srcPos = 0, + destPos; + const src = imgData.data; + const dest = chunkImgData.data; + let i, j, thisChunkHeight, elemsInThisChunk; + if (imgData.kind === util_ImageKind.GRAYSCALE_1BPP) { + const srcLength = src.byteLength; + const dest32 = new Uint32Array(dest.buffer, 0, dest.byteLength >> 2); + const dest32DataLength = dest32.length; + const fullSrcDiff = width + 7 >> 3; + const white = 0xffffffff; + const black = util_FeatureTest.isLittleEndian ? 0xff000000 : 0x000000ff; + for (i = 0; i < totalChunks; i++) { + thisChunkHeight = i < fullChunks ? FULL_CHUNK_HEIGHT : partialChunkHeight; + destPos = 0; + for (j = 0; j < thisChunkHeight; j++) { + const srcDiff = srcLength - srcPos; + let k = 0; + const kEnd = srcDiff > fullSrcDiff ? width : srcDiff * 8 - 7; + const kEndUnrolled = kEnd & ~7; + let mask = 0; + let srcByte = 0; + for (; k < kEndUnrolled; k += 8) { + srcByte = src[srcPos++]; + dest32[destPos++] = srcByte & 128 ? white : black; + dest32[destPos++] = srcByte & 64 ? white : black; + dest32[destPos++] = srcByte & 32 ? white : black; + dest32[destPos++] = srcByte & 16 ? white : black; + dest32[destPos++] = srcByte & 8 ? white : black; + dest32[destPos++] = srcByte & 4 ? white : black; + dest32[destPos++] = srcByte & 2 ? white : black; + dest32[destPos++] = srcByte & 1 ? white : black; + } + for (; k < kEnd; k++) { + if (mask === 0) { + srcByte = src[srcPos++]; + mask = 128; + } + dest32[destPos++] = srcByte & mask ? white : black; + mask >>= 1; + } + } + while (destPos < dest32DataLength) { + dest32[destPos++] = 0; + } + ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT); + } + } else if (imgData.kind === util_ImageKind.RGBA_32BPP) { + j = 0; + elemsInThisChunk = width * FULL_CHUNK_HEIGHT * 4; + for (i = 0; i < fullChunks; i++) { + dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk)); + srcPos += elemsInThisChunk; + ctx.putImageData(chunkImgData, 0, j); + j += FULL_CHUNK_HEIGHT; + } + if (i < totalChunks) { + elemsInThisChunk = width * partialChunkHeight * 4; + dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk)); + ctx.putImageData(chunkImgData, 0, j); + } + } else if (imgData.kind === util_ImageKind.RGB_24BPP) { + thisChunkHeight = FULL_CHUNK_HEIGHT; + elemsInThisChunk = width * thisChunkHeight; + for (i = 0; i < totalChunks; i++) { + if (i >= fullChunks) { + thisChunkHeight = partialChunkHeight; + elemsInThisChunk = width * thisChunkHeight; + } + destPos = 0; + for (j = elemsInThisChunk; j--;) { + dest[destPos++] = src[srcPos++]; + dest[destPos++] = src[srcPos++]; + dest[destPos++] = src[srcPos++]; + dest[destPos++] = 255; + } + ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT); + } + } else { + throw new Error(`bad image kind: ${imgData.kind}`); + } +} +function putBinaryImageMask(ctx, imgData) { + if (imgData.bitmap) { + ctx.drawImage(imgData.bitmap, 0, 0); + return; + } + const height = imgData.height, + width = imgData.width; + const partialChunkHeight = height % FULL_CHUNK_HEIGHT; + const fullChunks = (height - partialChunkHeight) / FULL_CHUNK_HEIGHT; + const totalChunks = partialChunkHeight === 0 ? fullChunks : fullChunks + 1; + const chunkImgData = ctx.createImageData(width, FULL_CHUNK_HEIGHT); + let srcPos = 0; + const src = imgData.data; + const dest = chunkImgData.data; + for (let i = 0; i < totalChunks; i++) { + const thisChunkHeight = i < fullChunks ? FULL_CHUNK_HEIGHT : partialChunkHeight; + ({ + srcPos + } = convertBlackAndWhiteToRGBA({ + src, + srcPos, + dest, + width, + height: thisChunkHeight, + nonBlackColor: 0 + })); + ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT); + } +} +function copyCtxState(sourceCtx, destCtx) { + const properties = ["strokeStyle", "fillStyle", "fillRule", "globalAlpha", "lineWidth", "lineCap", "lineJoin", "miterLimit", "globalCompositeOperation", "font", "filter"]; + for (const property of properties) { + if (sourceCtx[property] !== undefined) { + destCtx[property] = sourceCtx[property]; + } + } + if (sourceCtx.setLineDash !== undefined) { + destCtx.setLineDash(sourceCtx.getLineDash()); + destCtx.lineDashOffset = sourceCtx.lineDashOffset; + } +} +function resetCtxToDefault(ctx) { + ctx.strokeStyle = ctx.fillStyle = "#000000"; + ctx.fillRule = "nonzero"; + ctx.globalAlpha = 1; + ctx.lineWidth = 1; + ctx.lineCap = "butt"; + ctx.lineJoin = "miter"; + ctx.miterLimit = 10; + ctx.globalCompositeOperation = "source-over"; + ctx.font = "10px sans-serif"; + if (ctx.setLineDash !== undefined) { + ctx.setLineDash([]); + ctx.lineDashOffset = 0; + } + if (!isNodeJS) { + const { + filter + } = ctx; + if (filter !== "none" && filter !== "") { + ctx.filter = "none"; + } + } +} +function getImageSmoothingEnabled(transform, interpolate) { + if (interpolate) { + return true; + } + const scale = Util.singularValueDecompose2dScale(transform); + scale[0] = Math.fround(scale[0]); + scale[1] = Math.fround(scale[1]); + const actualScale = Math.fround((globalThis.devicePixelRatio || 1) * PixelsPerInch.PDF_TO_CSS_UNITS); + return scale[0] <= actualScale && scale[1] <= actualScale; +} +const LINE_CAP_STYLES = ["butt", "round", "square"]; +const LINE_JOIN_STYLES = ["miter", "round", "bevel"]; +const NORMAL_CLIP = {}; +const EO_CLIP = {}; +class CanvasGraphics { + constructor(canvasCtx, commonObjs, objs, canvasFactory, filterFactory, { + optionalContentConfig, + markedContentStack = null + }, annotationCanvasMap, pageColors) { + this.ctx = canvasCtx; + this.current = new CanvasExtraState(this.ctx.canvas.width, this.ctx.canvas.height); + this.stateStack = []; + this.pendingClip = null; + this.pendingEOFill = false; + this.res = null; + this.xobjs = null; + this.commonObjs = commonObjs; + this.objs = objs; + this.canvasFactory = canvasFactory; + this.filterFactory = filterFactory; + this.groupStack = []; + this.processingType3 = null; + this.baseTransform = null; + this.baseTransformStack = []; + this.groupLevel = 0; + this.smaskStack = []; + this.smaskCounter = 0; + this.tempSMask = null; + this.suspendedCtx = null; + this.contentVisible = true; + this.markedContentStack = markedContentStack || []; + this.optionalContentConfig = optionalContentConfig; + this.cachedCanvases = new CachedCanvases(this.canvasFactory); + this.cachedPatterns = new Map(); + this.annotationCanvasMap = annotationCanvasMap; + this.viewportScale = 1; + this.outputScaleX = 1; + this.outputScaleY = 1; + this.pageColors = pageColors; + this._cachedScaleForStroking = [-1, 0]; + this._cachedGetSinglePixelWidth = null; + this._cachedBitmapsMap = new Map(); + } + getObject(data, fallback = null) { + if (typeof data === "string") { + return data.startsWith("g_") ? this.commonObjs.get(data) : this.objs.get(data); + } + return fallback; + } + beginDrawing({ + transform, + viewport, + transparency = false, + background = null + }) { + const width = this.ctx.canvas.width; + const height = this.ctx.canvas.height; + const savedFillStyle = this.ctx.fillStyle; + this.ctx.fillStyle = background || "#ffffff"; + this.ctx.fillRect(0, 0, width, height); + this.ctx.fillStyle = savedFillStyle; + if (transparency) { + const transparentCanvas = this.cachedCanvases.getCanvas("transparent", width, height); + this.compositeCtx = this.ctx; + this.transparentCanvas = transparentCanvas.canvas; + this.ctx = transparentCanvas.context; + this.ctx.save(); + this.ctx.transform(...getCurrentTransform(this.compositeCtx)); + } + this.ctx.save(); + resetCtxToDefault(this.ctx); + if (transform) { + this.ctx.transform(...transform); + this.outputScaleX = transform[0]; + this.outputScaleY = transform[0]; + } + this.ctx.transform(...viewport.transform); + this.viewportScale = viewport.scale; + this.baseTransform = getCurrentTransform(this.ctx); + } + executeOperatorList(operatorList, executionStartIdx, continueCallback, stepper) { + const argsArray = operatorList.argsArray; + const fnArray = operatorList.fnArray; + let i = executionStartIdx || 0; + const argsArrayLen = argsArray.length; + if (argsArrayLen === i) { + return i; + } + const chunkOperations = argsArrayLen - i > EXECUTION_STEPS && typeof continueCallback === "function"; + const endTime = chunkOperations ? Date.now() + EXECUTION_TIME : 0; + let steps = 0; + const commonObjs = this.commonObjs; + const objs = this.objs; + let fnId; + while (true) { + if (stepper !== undefined && i === stepper.nextBreakPoint) { + stepper.breakIt(i, continueCallback); + return i; + } + fnId = fnArray[i]; + if (fnId !== OPS.dependency) { + this[fnId].apply(this, argsArray[i]); + } else { + for (const depObjId of argsArray[i]) { + const objsPool = depObjId.startsWith("g_") ? commonObjs : objs; + if (!objsPool.has(depObjId)) { + objsPool.get(depObjId, continueCallback); + return i; + } + } + } + i++; + if (i === argsArrayLen) { + return i; + } + if (chunkOperations && ++steps > EXECUTION_STEPS) { + if (Date.now() > endTime) { + continueCallback(); + return i; + } + steps = 0; + } + } + } + #restoreInitialState() { + while (this.stateStack.length || this.inSMaskMode) { + this.restore(); + } + this.current.activeSMask = null; + this.ctx.restore(); + if (this.transparentCanvas) { + this.ctx = this.compositeCtx; + this.ctx.save(); + this.ctx.setTransform(1, 0, 0, 1, 0, 0); + this.ctx.drawImage(this.transparentCanvas, 0, 0); + this.ctx.restore(); + this.transparentCanvas = null; + } + } + endDrawing() { + this.#restoreInitialState(); + this.cachedCanvases.clear(); + this.cachedPatterns.clear(); + for (const cache of this._cachedBitmapsMap.values()) { + for (const canvas of cache.values()) { + if (typeof HTMLCanvasElement !== "undefined" && canvas instanceof HTMLCanvasElement) { + canvas.width = canvas.height = 0; + } + } + cache.clear(); + } + this._cachedBitmapsMap.clear(); + this.#drawFilter(); + } + #drawFilter() { + if (this.pageColors) { + const hcmFilterId = this.filterFactory.addHCMFilter(this.pageColors.foreground, this.pageColors.background); + if (hcmFilterId !== "none") { + const savedFilter = this.ctx.filter; + this.ctx.filter = hcmFilterId; + this.ctx.drawImage(this.ctx.canvas, 0, 0); + this.ctx.filter = savedFilter; + } + } + } + _scaleImage(img, inverseTransform) { + const width = img.width ?? img.displayWidth; + const height = img.height ?? img.displayHeight; + let widthScale = Math.max(Math.hypot(inverseTransform[0], inverseTransform[1]), 1); + let heightScale = Math.max(Math.hypot(inverseTransform[2], inverseTransform[3]), 1); + let paintWidth = width, + paintHeight = height; + let tmpCanvasId = "prescale1"; + let tmpCanvas, tmpCtx; + while (widthScale > 2 && paintWidth > 1 || heightScale > 2 && paintHeight > 1) { + let newWidth = paintWidth, + newHeight = paintHeight; + if (widthScale > 2 && paintWidth > 1) { + newWidth = paintWidth >= 16384 ? Math.floor(paintWidth / 2) - 1 || 1 : Math.ceil(paintWidth / 2); + widthScale /= paintWidth / newWidth; + } + if (heightScale > 2 && paintHeight > 1) { + newHeight = paintHeight >= 16384 ? Math.floor(paintHeight / 2) - 1 || 1 : Math.ceil(paintHeight) / 2; + heightScale /= paintHeight / newHeight; + } + tmpCanvas = this.cachedCanvases.getCanvas(tmpCanvasId, newWidth, newHeight); + tmpCtx = tmpCanvas.context; + tmpCtx.clearRect(0, 0, newWidth, newHeight); + tmpCtx.drawImage(img, 0, 0, paintWidth, paintHeight, 0, 0, newWidth, newHeight); + img = tmpCanvas.canvas; + paintWidth = newWidth; + paintHeight = newHeight; + tmpCanvasId = tmpCanvasId === "prescale1" ? "prescale2" : "prescale1"; + } + return { + img, + paintWidth, + paintHeight + }; + } + _createMaskCanvas(img) { + const ctx = this.ctx; + const { + width, + height + } = img; + const fillColor = this.current.fillColor; + const isPatternFill = this.current.patternFill; + const currentTransform = getCurrentTransform(ctx); + let cache, cacheKey, scaled, maskCanvas; + if ((img.bitmap || img.data) && img.count > 1) { + const mainKey = img.bitmap || img.data.buffer; + cacheKey = JSON.stringify(isPatternFill ? currentTransform : [currentTransform.slice(0, 4), fillColor]); + cache = this._cachedBitmapsMap.get(mainKey); + if (!cache) { + cache = new Map(); + this._cachedBitmapsMap.set(mainKey, cache); + } + const cachedImage = cache.get(cacheKey); + if (cachedImage && !isPatternFill) { + const offsetX = Math.round(Math.min(currentTransform[0], currentTransform[2]) + currentTransform[4]); + const offsetY = Math.round(Math.min(currentTransform[1], currentTransform[3]) + currentTransform[5]); + return { + canvas: cachedImage, + offsetX, + offsetY + }; + } + scaled = cachedImage; + } + if (!scaled) { + maskCanvas = this.cachedCanvases.getCanvas("maskCanvas", width, height); + putBinaryImageMask(maskCanvas.context, img); + } + let maskToCanvas = Util.transform(currentTransform, [1 / width, 0, 0, -1 / height, 0, 0]); + maskToCanvas = Util.transform(maskToCanvas, [1, 0, 0, 1, 0, -height]); + const [minX, minY, maxX, maxY] = Util.getAxialAlignedBoundingBox([0, 0, width, height], maskToCanvas); + const drawnWidth = Math.round(maxX - minX) || 1; + const drawnHeight = Math.round(maxY - minY) || 1; + const fillCanvas = this.cachedCanvases.getCanvas("fillCanvas", drawnWidth, drawnHeight); + const fillCtx = fillCanvas.context; + const offsetX = minX; + const offsetY = minY; + fillCtx.translate(-offsetX, -offsetY); + fillCtx.transform(...maskToCanvas); + if (!scaled) { + scaled = this._scaleImage(maskCanvas.canvas, getCurrentTransformInverse(fillCtx)); + scaled = scaled.img; + if (cache && isPatternFill) { + cache.set(cacheKey, scaled); + } + } + fillCtx.imageSmoothingEnabled = getImageSmoothingEnabled(getCurrentTransform(fillCtx), img.interpolate); + drawImageAtIntegerCoords(fillCtx, scaled, 0, 0, scaled.width, scaled.height, 0, 0, width, height); + fillCtx.globalCompositeOperation = "source-in"; + const inverse = Util.transform(getCurrentTransformInverse(fillCtx), [1, 0, 0, 1, -offsetX, -offsetY]); + fillCtx.fillStyle = isPatternFill ? fillColor.getPattern(ctx, this, inverse, PathType.FILL) : fillColor; + fillCtx.fillRect(0, 0, width, height); + if (cache && !isPatternFill) { + this.cachedCanvases.delete("fillCanvas"); + cache.set(cacheKey, fillCanvas.canvas); + } + return { + canvas: fillCanvas.canvas, + offsetX: Math.round(offsetX), + offsetY: Math.round(offsetY) + }; + } + setLineWidth(width) { + if (width !== this.current.lineWidth) { + this._cachedScaleForStroking[0] = -1; + } + this.current.lineWidth = width; + this.ctx.lineWidth = width; + } + setLineCap(style) { + this.ctx.lineCap = LINE_CAP_STYLES[style]; + } + setLineJoin(style) { + this.ctx.lineJoin = LINE_JOIN_STYLES[style]; + } + setMiterLimit(limit) { + this.ctx.miterLimit = limit; + } + setDash(dashArray, dashPhase) { + const ctx = this.ctx; + if (ctx.setLineDash !== undefined) { + ctx.setLineDash(dashArray); + ctx.lineDashOffset = dashPhase; + } + } + setRenderingIntent(intent) {} + setFlatness(flatness) {} + setGState(states) { + for (const [key, value] of states) { + switch (key) { + case "LW": + this.setLineWidth(value); + break; + case "LC": + this.setLineCap(value); + break; + case "LJ": + this.setLineJoin(value); + break; + case "ML": + this.setMiterLimit(value); + break; + case "D": + this.setDash(value[0], value[1]); + break; + case "RI": + this.setRenderingIntent(value); + break; + case "FL": + this.setFlatness(value); + break; + case "Font": + this.setFont(value[0], value[1]); + break; + case "CA": + this.current.strokeAlpha = value; + break; + case "ca": + this.current.fillAlpha = value; + this.ctx.globalAlpha = value; + break; + case "BM": + this.ctx.globalCompositeOperation = value; + break; + case "SMask": + this.current.activeSMask = value ? this.tempSMask : null; + this.tempSMask = null; + this.checkSMaskState(); + break; + case "TR": + this.ctx.filter = this.current.transferMaps = this.filterFactory.addFilter(value); + break; + } + } + } + get inSMaskMode() { + return !!this.suspendedCtx; + } + checkSMaskState() { + const inSMaskMode = this.inSMaskMode; + if (this.current.activeSMask && !inSMaskMode) { + this.beginSMaskMode(); + } else if (!this.current.activeSMask && inSMaskMode) { + this.endSMaskMode(); + } + } + beginSMaskMode() { + if (this.inSMaskMode) { + throw new Error("beginSMaskMode called while already in smask mode"); + } + const drawnWidth = this.ctx.canvas.width; + const drawnHeight = this.ctx.canvas.height; + const cacheId = "smaskGroupAt" + this.groupLevel; + const scratchCanvas = this.cachedCanvases.getCanvas(cacheId, drawnWidth, drawnHeight); + this.suspendedCtx = this.ctx; + this.ctx = scratchCanvas.context; + const ctx = this.ctx; + ctx.setTransform(...getCurrentTransform(this.suspendedCtx)); + copyCtxState(this.suspendedCtx, ctx); + mirrorContextOperations(ctx, this.suspendedCtx); + this.setGState([["BM", "source-over"], ["ca", 1], ["CA", 1]]); + } + endSMaskMode() { + if (!this.inSMaskMode) { + throw new Error("endSMaskMode called while not in smask mode"); + } + this.ctx._removeMirroring(); + copyCtxState(this.ctx, this.suspendedCtx); + this.ctx = this.suspendedCtx; + this.suspendedCtx = null; + } + compose(dirtyBox) { + if (!this.current.activeSMask) { + return; + } + if (!dirtyBox) { + dirtyBox = [0, 0, this.ctx.canvas.width, this.ctx.canvas.height]; + } else { + dirtyBox[0] = Math.floor(dirtyBox[0]); + dirtyBox[1] = Math.floor(dirtyBox[1]); + dirtyBox[2] = Math.ceil(dirtyBox[2]); + dirtyBox[3] = Math.ceil(dirtyBox[3]); + } + const smask = this.current.activeSMask; + const suspendedCtx = this.suspendedCtx; + this.composeSMask(suspendedCtx, smask, this.ctx, dirtyBox); + this.ctx.save(); + this.ctx.setTransform(1, 0, 0, 1, 0, 0); + this.ctx.clearRect(0, 0, this.ctx.canvas.width, this.ctx.canvas.height); + this.ctx.restore(); + } + composeSMask(ctx, smask, layerCtx, layerBox) { + const layerOffsetX = layerBox[0]; + const layerOffsetY = layerBox[1]; + const layerWidth = layerBox[2] - layerOffsetX; + const layerHeight = layerBox[3] - layerOffsetY; + if (layerWidth === 0 || layerHeight === 0) { + return; + } + this.genericComposeSMask(smask.context, layerCtx, layerWidth, layerHeight, smask.subtype, smask.backdrop, smask.transferMap, layerOffsetX, layerOffsetY, smask.offsetX, smask.offsetY); + ctx.save(); + ctx.globalAlpha = 1; + ctx.globalCompositeOperation = "source-over"; + ctx.setTransform(1, 0, 0, 1, 0, 0); + ctx.drawImage(layerCtx.canvas, 0, 0); + ctx.restore(); + } + genericComposeSMask(maskCtx, layerCtx, width, height, subtype, backdrop, transferMap, layerOffsetX, layerOffsetY, maskOffsetX, maskOffsetY) { + let maskCanvas = maskCtx.canvas; + let maskX = layerOffsetX - maskOffsetX; + let maskY = layerOffsetY - maskOffsetY; + if (backdrop) { + const backdropRGB = Util.makeHexColor(...backdrop); + if (maskX < 0 || maskY < 0 || maskX + width > maskCanvas.width || maskY + height > maskCanvas.height) { + const canvas = this.cachedCanvases.getCanvas("maskExtension", width, height); + const ctx = canvas.context; + ctx.drawImage(maskCanvas, -maskX, -maskY); + ctx.globalCompositeOperation = "destination-atop"; + ctx.fillStyle = backdropRGB; + ctx.fillRect(0, 0, width, height); + ctx.globalCompositeOperation = "source-over"; + maskCanvas = canvas.canvas; + maskX = maskY = 0; + } else { + maskCtx.save(); + maskCtx.globalAlpha = 1; + maskCtx.setTransform(1, 0, 0, 1, 0, 0); + const clip = new Path2D(); + clip.rect(maskX, maskY, width, height); + maskCtx.clip(clip); + maskCtx.globalCompositeOperation = "destination-atop"; + maskCtx.fillStyle = backdropRGB; + maskCtx.fillRect(maskX, maskY, width, height); + maskCtx.restore(); + } + } + layerCtx.save(); + layerCtx.globalAlpha = 1; + layerCtx.setTransform(1, 0, 0, 1, 0, 0); + if (subtype === "Alpha" && transferMap) { + layerCtx.filter = this.filterFactory.addAlphaFilter(transferMap); + } else if (subtype === "Luminosity") { + layerCtx.filter = this.filterFactory.addLuminosityFilter(transferMap); + } + const clip = new Path2D(); + clip.rect(layerOffsetX, layerOffsetY, width, height); + layerCtx.clip(clip); + layerCtx.globalCompositeOperation = "destination-in"; + layerCtx.drawImage(maskCanvas, maskX, maskY, width, height, layerOffsetX, layerOffsetY, width, height); + layerCtx.restore(); + } + save() { + if (this.inSMaskMode) { + copyCtxState(this.ctx, this.suspendedCtx); + this.suspendedCtx.save(); + } else { + this.ctx.save(); + } + const old = this.current; + this.stateStack.push(old); + this.current = old.clone(); + } + restore() { + if (this.stateStack.length === 0 && this.inSMaskMode) { + this.endSMaskMode(); + } + if (this.stateStack.length !== 0) { + this.current = this.stateStack.pop(); + if (this.inSMaskMode) { + this.suspendedCtx.restore(); + copyCtxState(this.suspendedCtx, this.ctx); + } else { + this.ctx.restore(); + } + this.checkSMaskState(); + this.pendingClip = null; + this._cachedScaleForStroking[0] = -1; + this._cachedGetSinglePixelWidth = null; + } + } + transform(a, b, c, d, e, f) { + this.ctx.transform(a, b, c, d, e, f); + this._cachedScaleForStroking[0] = -1; + this._cachedGetSinglePixelWidth = null; + } + constructPath(ops, args, minMax) { + const ctx = this.ctx; + const current = this.current; + let x = current.x, + y = current.y; + let startX, startY; + const currentTransform = getCurrentTransform(ctx); + const isScalingMatrix = currentTransform[0] === 0 && currentTransform[3] === 0 || currentTransform[1] === 0 && currentTransform[2] === 0; + const minMaxForBezier = isScalingMatrix ? minMax.slice(0) : null; + for (let i = 0, j = 0, ii = ops.length; i < ii; i++) { + switch (ops[i] | 0) { + case OPS.rectangle: + x = args[j++]; + y = args[j++]; + const width = args[j++]; + const height = args[j++]; + const xw = x + width; + const yh = y + height; + ctx.moveTo(x, y); + if (width === 0 || height === 0) { + ctx.lineTo(xw, yh); + } else { + ctx.lineTo(xw, y); + ctx.lineTo(xw, yh); + ctx.lineTo(x, yh); + } + if (!isScalingMatrix) { + current.updateRectMinMax(currentTransform, [x, y, xw, yh]); + } + ctx.closePath(); + break; + case OPS.moveTo: + x = args[j++]; + y = args[j++]; + ctx.moveTo(x, y); + if (!isScalingMatrix) { + current.updatePathMinMax(currentTransform, x, y); + } + break; + case OPS.lineTo: + x = args[j++]; + y = args[j++]; + ctx.lineTo(x, y); + if (!isScalingMatrix) { + current.updatePathMinMax(currentTransform, x, y); + } + break; + case OPS.curveTo: + startX = x; + startY = y; + x = args[j + 4]; + y = args[j + 5]; + ctx.bezierCurveTo(args[j], args[j + 1], args[j + 2], args[j + 3], x, y); + current.updateCurvePathMinMax(currentTransform, startX, startY, args[j], args[j + 1], args[j + 2], args[j + 3], x, y, minMaxForBezier); + j += 6; + break; + case OPS.curveTo2: + startX = x; + startY = y; + ctx.bezierCurveTo(x, y, args[j], args[j + 1], args[j + 2], args[j + 3]); + current.updateCurvePathMinMax(currentTransform, startX, startY, x, y, args[j], args[j + 1], args[j + 2], args[j + 3], minMaxForBezier); + x = args[j + 2]; + y = args[j + 3]; + j += 4; + break; + case OPS.curveTo3: + startX = x; + startY = y; + x = args[j + 2]; + y = args[j + 3]; + ctx.bezierCurveTo(args[j], args[j + 1], x, y, x, y); + current.updateCurvePathMinMax(currentTransform, startX, startY, args[j], args[j + 1], x, y, x, y, minMaxForBezier); + j += 4; + break; + case OPS.closePath: + ctx.closePath(); + break; + } + } + if (isScalingMatrix) { + current.updateScalingPathMinMax(currentTransform, minMaxForBezier); + } + current.setCurrentPoint(x, y); + } + closePath() { + this.ctx.closePath(); + } + stroke(consumePath = true) { + const ctx = this.ctx; + const strokeColor = this.current.strokeColor; + ctx.globalAlpha = this.current.strokeAlpha; + if (this.contentVisible) { + if (typeof strokeColor === "object" && strokeColor?.getPattern) { + ctx.save(); + ctx.strokeStyle = strokeColor.getPattern(ctx, this, getCurrentTransformInverse(ctx), PathType.STROKE); + this.rescaleAndStroke(false); + ctx.restore(); + } else { + this.rescaleAndStroke(true); + } + } + if (consumePath) { + this.consumePath(this.current.getClippedPathBoundingBox()); + } + ctx.globalAlpha = this.current.fillAlpha; + } + closeStroke() { + this.closePath(); + this.stroke(); + } + fill(consumePath = true) { + const ctx = this.ctx; + const fillColor = this.current.fillColor; + const isPatternFill = this.current.patternFill; + let needRestore = false; + if (isPatternFill) { + ctx.save(); + ctx.fillStyle = fillColor.getPattern(ctx, this, getCurrentTransformInverse(ctx), PathType.FILL); + needRestore = true; + } + const intersect = this.current.getClippedPathBoundingBox(); + if (this.contentVisible && intersect !== null) { + if (this.pendingEOFill) { + ctx.fill("evenodd"); + this.pendingEOFill = false; + } else { + ctx.fill(); + } + } + if (needRestore) { + ctx.restore(); + } + if (consumePath) { + this.consumePath(intersect); + } + } + eoFill() { + this.pendingEOFill = true; + this.fill(); + } + fillStroke() { + this.fill(false); + this.stroke(false); + this.consumePath(); + } + eoFillStroke() { + this.pendingEOFill = true; + this.fillStroke(); + } + closeFillStroke() { + this.closePath(); + this.fillStroke(); + } + closeEOFillStroke() { + this.pendingEOFill = true; + this.closePath(); + this.fillStroke(); + } + endPath() { + this.consumePath(); + } + clip() { + this.pendingClip = NORMAL_CLIP; + } + eoClip() { + this.pendingClip = EO_CLIP; + } + beginText() { + this.current.textMatrix = IDENTITY_MATRIX; + this.current.textMatrixScale = 1; + this.current.x = this.current.lineX = 0; + this.current.y = this.current.lineY = 0; + } + endText() { + const paths = this.pendingTextPaths; + const ctx = this.ctx; + if (paths === undefined) { + ctx.beginPath(); + return; + } + const newPath = new Path2D(); + const invTransf = ctx.getTransform().invertSelf(); + for (const { + transform, + x, + y, + fontSize, + path + } of paths) { + newPath.addPath(path, new DOMMatrix(transform).preMultiplySelf(invTransf).translate(x, y).scale(fontSize, -fontSize)); + } + ctx.clip(newPath); + ctx.beginPath(); + delete this.pendingTextPaths; + } + setCharSpacing(spacing) { + this.current.charSpacing = spacing; + } + setWordSpacing(spacing) { + this.current.wordSpacing = spacing; + } + setHScale(scale) { + this.current.textHScale = scale / 100; + } + setLeading(leading) { + this.current.leading = -leading; + } + setFont(fontRefName, size) { + const fontObj = this.commonObjs.get(fontRefName); + const current = this.current; + if (!fontObj) { + throw new Error(`Can't find font for ${fontRefName}`); + } + current.fontMatrix = fontObj.fontMatrix || FONT_IDENTITY_MATRIX; + if (current.fontMatrix[0] === 0 || current.fontMatrix[3] === 0) { + warn("Invalid font matrix for font " + fontRefName); + } + if (size < 0) { + size = -size; + current.fontDirection = -1; + } else { + current.fontDirection = 1; + } + this.current.font = fontObj; + this.current.fontSize = size; + if (fontObj.isType3Font) { + return; + } + const name = fontObj.loadedName || "sans-serif"; + const typeface = fontObj.systemFontInfo?.css || `"${name}", ${fontObj.fallbackName}`; + let bold = "normal"; + if (fontObj.black) { + bold = "900"; + } else if (fontObj.bold) { + bold = "bold"; + } + const italic = fontObj.italic ? "italic" : "normal"; + let browserFontSize = size; + if (size < MIN_FONT_SIZE) { + browserFontSize = MIN_FONT_SIZE; + } else if (size > MAX_FONT_SIZE) { + browserFontSize = MAX_FONT_SIZE; + } + this.current.fontSizeScale = size / browserFontSize; + this.ctx.font = `${italic} ${bold} ${browserFontSize}px ${typeface}`; + } + setTextRenderingMode(mode) { + this.current.textRenderingMode = mode; + } + setTextRise(rise) { + this.current.textRise = rise; + } + moveText(x, y) { + this.current.x = this.current.lineX += x; + this.current.y = this.current.lineY += y; + } + setLeadingMoveText(x, y) { + this.setLeading(-y); + this.moveText(x, y); + } + setTextMatrix(a, b, c, d, e, f) { + this.current.textMatrix = [a, b, c, d, e, f]; + this.current.textMatrixScale = Math.hypot(a, b); + this.current.x = this.current.lineX = 0; + this.current.y = this.current.lineY = 0; + } + nextLine() { + this.moveText(0, this.current.leading); + } + #getScaledPath(path, currentTransform, transform) { + const newPath = new Path2D(); + newPath.addPath(path, new DOMMatrix(transform).invertSelf().multiplySelf(currentTransform)); + return newPath; + } + paintChar(character, x, y, patternFillTransform, patternStrokeTransform) { + const ctx = this.ctx; + const current = this.current; + const font = current.font; + const textRenderingMode = current.textRenderingMode; + const fontSize = current.fontSize / current.fontSizeScale; + const fillStrokeMode = textRenderingMode & TextRenderingMode.FILL_STROKE_MASK; + const isAddToPathSet = !!(textRenderingMode & TextRenderingMode.ADD_TO_PATH_FLAG); + const patternFill = current.patternFill && !font.missingFile; + const patternStroke = current.patternStroke && !font.missingFile; + let path; + if (font.disableFontFace || isAddToPathSet || patternFill || patternStroke) { + path = font.getPathGenerator(this.commonObjs, character); + } + if (font.disableFontFace || patternFill || patternStroke) { + ctx.save(); + ctx.translate(x, y); + ctx.scale(fontSize, -fontSize); + if (fillStrokeMode === TextRenderingMode.FILL || fillStrokeMode === TextRenderingMode.FILL_STROKE) { + if (patternFillTransform) { + const currentTransform = ctx.getTransform(); + ctx.setTransform(...patternFillTransform); + ctx.fill(this.#getScaledPath(path, currentTransform, patternFillTransform)); + } else { + ctx.fill(path); + } + } + if (fillStrokeMode === TextRenderingMode.STROKE || fillStrokeMode === TextRenderingMode.FILL_STROKE) { + if (patternStrokeTransform) { + const currentTransform = ctx.getTransform(); + ctx.setTransform(...patternStrokeTransform); + ctx.stroke(this.#getScaledPath(path, currentTransform, patternStrokeTransform)); + } else { + ctx.lineWidth /= fontSize; + ctx.stroke(path); + } + } + ctx.restore(); + } else { + if (fillStrokeMode === TextRenderingMode.FILL || fillStrokeMode === TextRenderingMode.FILL_STROKE) { + ctx.fillText(character, x, y); + } + if (fillStrokeMode === TextRenderingMode.STROKE || fillStrokeMode === TextRenderingMode.FILL_STROKE) { + ctx.strokeText(character, x, y); + } + } + if (isAddToPathSet) { + const paths = this.pendingTextPaths ||= []; + paths.push({ + transform: getCurrentTransform(ctx), + x, + y, + fontSize, + path + }); + } + } + get isFontSubpixelAAEnabled() { + const { + context: ctx + } = this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled", 10, 10); + ctx.scale(1.5, 1); + ctx.fillText("I", 0, 10); + const data = ctx.getImageData(0, 0, 10, 10).data; + let enabled = false; + for (let i = 3; i < data.length; i += 4) { + if (data[i] > 0 && data[i] < 255) { + enabled = true; + break; + } + } + return shadow(this, "isFontSubpixelAAEnabled", enabled); + } + showText(glyphs) { + const current = this.current; + const font = current.font; + if (font.isType3Font) { + return this.showType3Text(glyphs); + } + const fontSize = current.fontSize; + if (fontSize === 0) { + return undefined; + } + const ctx = this.ctx; + const fontSizeScale = current.fontSizeScale; + const charSpacing = current.charSpacing; + const wordSpacing = current.wordSpacing; + const fontDirection = current.fontDirection; + const textHScale = current.textHScale * fontDirection; + const glyphsLength = glyphs.length; + const vertical = font.vertical; + const spacingDir = vertical ? 1 : -1; + const defaultVMetrics = font.defaultVMetrics; + const widthAdvanceScale = fontSize * current.fontMatrix[0]; + const simpleFillText = current.textRenderingMode === TextRenderingMode.FILL && !font.disableFontFace && !current.patternFill; + ctx.save(); + ctx.transform(...current.textMatrix); + ctx.translate(current.x, current.y + current.textRise); + if (fontDirection > 0) { + ctx.scale(textHScale, -1); + } else { + ctx.scale(textHScale, 1); + } + let patternFillTransform, patternStrokeTransform; + if (current.patternFill) { + ctx.save(); + const pattern = current.fillColor.getPattern(ctx, this, getCurrentTransformInverse(ctx), PathType.FILL); + patternFillTransform = getCurrentTransform(ctx); + ctx.restore(); + ctx.fillStyle = pattern; + } + if (current.patternStroke) { + ctx.save(); + const pattern = current.strokeColor.getPattern(ctx, this, getCurrentTransformInverse(ctx), PathType.STROKE); + patternStrokeTransform = getCurrentTransform(ctx); + ctx.restore(); + ctx.strokeStyle = pattern; + } + let lineWidth = current.lineWidth; + const scale = current.textMatrixScale; + if (scale === 0 || lineWidth === 0) { + const fillStrokeMode = current.textRenderingMode & TextRenderingMode.FILL_STROKE_MASK; + if (fillStrokeMode === TextRenderingMode.STROKE || fillStrokeMode === TextRenderingMode.FILL_STROKE) { + lineWidth = this.getSinglePixelWidth(); + } + } else { + lineWidth /= scale; + } + if (fontSizeScale !== 1.0) { + ctx.scale(fontSizeScale, fontSizeScale); + lineWidth /= fontSizeScale; + } + ctx.lineWidth = lineWidth; + if (font.isInvalidPDFjsFont) { + const chars = []; + let width = 0; + for (const glyph of glyphs) { + chars.push(glyph.unicode); + width += glyph.width; + } + ctx.fillText(chars.join(""), 0, 0); + current.x += width * widthAdvanceScale * textHScale; + ctx.restore(); + this.compose(); + return undefined; + } + let x = 0, + i; + for (i = 0; i < glyphsLength; ++i) { + const glyph = glyphs[i]; + if (typeof glyph === "number") { + x += spacingDir * glyph * fontSize / 1000; + continue; + } + let restoreNeeded = false; + const spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing; + const character = glyph.fontChar; + const accent = glyph.accent; + let scaledX, scaledY; + let width = glyph.width; + if (vertical) { + const vmetric = glyph.vmetric || defaultVMetrics; + const vx = -(glyph.vmetric ? vmetric[1] : width * 0.5) * widthAdvanceScale; + const vy = vmetric[2] * widthAdvanceScale; + width = vmetric ? -vmetric[0] : width; + scaledX = vx / fontSizeScale; + scaledY = (x + vy) / fontSizeScale; + } else { + scaledX = x / fontSizeScale; + scaledY = 0; + } + if (font.remeasure && width > 0) { + const measuredWidth = ctx.measureText(character).width * 1000 / fontSize * fontSizeScale; + if (width < measuredWidth && this.isFontSubpixelAAEnabled) { + const characterScaleX = width / measuredWidth; + restoreNeeded = true; + ctx.save(); + ctx.scale(characterScaleX, 1); + scaledX /= characterScaleX; + } else if (width !== measuredWidth) { + scaledX += (width - measuredWidth) / 2000 * fontSize / fontSizeScale; + } + } + if (this.contentVisible && (glyph.isInFont || font.missingFile)) { + if (simpleFillText && !accent) { + ctx.fillText(character, scaledX, scaledY); + } else { + this.paintChar(character, scaledX, scaledY, patternFillTransform, patternStrokeTransform); + if (accent) { + const scaledAccentX = scaledX + fontSize * accent.offset.x / fontSizeScale; + const scaledAccentY = scaledY - fontSize * accent.offset.y / fontSizeScale; + this.paintChar(accent.fontChar, scaledAccentX, scaledAccentY, patternFillTransform, patternStrokeTransform); + } + } + } + const charWidth = vertical ? width * widthAdvanceScale - spacing * fontDirection : width * widthAdvanceScale + spacing * fontDirection; + x += charWidth; + if (restoreNeeded) { + ctx.restore(); + } + } + if (vertical) { + current.y -= x; + } else { + current.x += x * textHScale; + } + ctx.restore(); + this.compose(); + return undefined; + } + showType3Text(glyphs) { + const ctx = this.ctx; + const current = this.current; + const font = current.font; + const fontSize = current.fontSize; + const fontDirection = current.fontDirection; + const spacingDir = font.vertical ? 1 : -1; + const charSpacing = current.charSpacing; + const wordSpacing = current.wordSpacing; + const textHScale = current.textHScale * fontDirection; + const fontMatrix = current.fontMatrix || FONT_IDENTITY_MATRIX; + const glyphsLength = glyphs.length; + const isTextInvisible = current.textRenderingMode === TextRenderingMode.INVISIBLE; + let i, glyph, width, spacingLength; + if (isTextInvisible || fontSize === 0) { + return; + } + this._cachedScaleForStroking[0] = -1; + this._cachedGetSinglePixelWidth = null; + ctx.save(); + ctx.transform(...current.textMatrix); + ctx.translate(current.x, current.y); + ctx.scale(textHScale, fontDirection); + for (i = 0; i < glyphsLength; ++i) { + glyph = glyphs[i]; + if (typeof glyph === "number") { + spacingLength = spacingDir * glyph * fontSize / 1000; + this.ctx.translate(spacingLength, 0); + current.x += spacingLength * textHScale; + continue; + } + const spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing; + const operatorList = font.charProcOperatorList[glyph.operatorListId]; + if (!operatorList) { + warn(`Type3 character "${glyph.operatorListId}" is not available.`); + continue; + } + if (this.contentVisible) { + this.processingType3 = glyph; + this.save(); + ctx.scale(fontSize, fontSize); + ctx.transform(...fontMatrix); + this.executeOperatorList(operatorList); + this.restore(); + } + const transformed = Util.applyTransform([glyph.width, 0], fontMatrix); + width = transformed[0] * fontSize + spacing; + ctx.translate(width, 0); + current.x += width * textHScale; + } + ctx.restore(); + this.processingType3 = null; + } + setCharWidth(xWidth, yWidth) {} + setCharWidthAndBounds(xWidth, yWidth, llx, lly, urx, ury) { + this.ctx.rect(llx, lly, urx - llx, ury - lly); + this.ctx.clip(); + this.endPath(); + } + getColorN_Pattern(IR) { + let pattern; + if (IR[0] === "TilingPattern") { + const color = IR[1]; + const baseTransform = this.baseTransform || getCurrentTransform(this.ctx); + const canvasGraphicsFactory = { + createCanvasGraphics: ctx => new CanvasGraphics(ctx, this.commonObjs, this.objs, this.canvasFactory, this.filterFactory, { + optionalContentConfig: this.optionalContentConfig, + markedContentStack: this.markedContentStack + }) + }; + pattern = new TilingPattern(IR, color, this.ctx, canvasGraphicsFactory, baseTransform); + } else { + pattern = this._getPattern(IR[1], IR[2]); + } + return pattern; + } + setStrokeColorN() { + this.current.strokeColor = this.getColorN_Pattern(arguments); + this.current.patternStroke = true; + } + setFillColorN() { + this.current.fillColor = this.getColorN_Pattern(arguments); + this.current.patternFill = true; + } + setStrokeRGBColor(r, g, b) { + this.ctx.strokeStyle = this.current.strokeColor = Util.makeHexColor(r, g, b); + this.current.patternStroke = false; + } + setStrokeTransparent() { + this.ctx.strokeStyle = this.current.strokeColor = "transparent"; + this.current.patternStroke = false; + } + setFillRGBColor(r, g, b) { + this.ctx.fillStyle = this.current.fillColor = Util.makeHexColor(r, g, b); + this.current.patternFill = false; + } + setFillTransparent() { + this.ctx.fillStyle = this.current.fillColor = "transparent"; + this.current.patternFill = false; + } + _getPattern(objId, matrix = null) { + let pattern; + if (this.cachedPatterns.has(objId)) { + pattern = this.cachedPatterns.get(objId); + } else { + pattern = getShadingPattern(this.getObject(objId)); + this.cachedPatterns.set(objId, pattern); + } + if (matrix) { + pattern.matrix = matrix; + } + return pattern; + } + shadingFill(objId) { + if (!this.contentVisible) { + return; + } + const ctx = this.ctx; + this.save(); + const pattern = this._getPattern(objId); + ctx.fillStyle = pattern.getPattern(ctx, this, getCurrentTransformInverse(ctx), PathType.SHADING); + const inv = getCurrentTransformInverse(ctx); + if (inv) { + const { + width, + height + } = ctx.canvas; + const [x0, y0, x1, y1] = Util.getAxialAlignedBoundingBox([0, 0, width, height], inv); + this.ctx.fillRect(x0, y0, x1 - x0, y1 - y0); + } else { + this.ctx.fillRect(-1e10, -1e10, 2e10, 2e10); + } + this.compose(this.current.getClippedPathBoundingBox()); + this.restore(); + } + beginInlineImage() { + unreachable("Should not call beginInlineImage"); + } + beginImageData() { + unreachable("Should not call beginImageData"); + } + paintFormXObjectBegin(matrix, bbox) { + if (!this.contentVisible) { + return; + } + this.save(); + this.baseTransformStack.push(this.baseTransform); + if (matrix) { + this.transform(...matrix); + } + this.baseTransform = getCurrentTransform(this.ctx); + if (bbox) { + const width = bbox[2] - bbox[0]; + const height = bbox[3] - bbox[1]; + this.ctx.rect(bbox[0], bbox[1], width, height); + this.current.updateRectMinMax(getCurrentTransform(this.ctx), bbox); + this.clip(); + this.endPath(); + } + } + paintFormXObjectEnd() { + if (!this.contentVisible) { + return; + } + this.restore(); + this.baseTransform = this.baseTransformStack.pop(); + } + beginGroup(group) { + if (!this.contentVisible) { + return; + } + this.save(); + if (this.inSMaskMode) { + this.endSMaskMode(); + this.current.activeSMask = null; + } + const currentCtx = this.ctx; + if (!group.isolated) { + info("TODO: Support non-isolated groups."); + } + if (group.knockout) { + warn("Knockout groups not supported."); + } + const currentTransform = getCurrentTransform(currentCtx); + if (group.matrix) { + currentCtx.transform(...group.matrix); + } + if (!group.bbox) { + throw new Error("Bounding box is required."); + } + let bounds = Util.getAxialAlignedBoundingBox(group.bbox, getCurrentTransform(currentCtx)); + const canvasBounds = [0, 0, currentCtx.canvas.width, currentCtx.canvas.height]; + bounds = Util.intersect(bounds, canvasBounds) || [0, 0, 0, 0]; + const offsetX = Math.floor(bounds[0]); + const offsetY = Math.floor(bounds[1]); + const drawnWidth = Math.max(Math.ceil(bounds[2]) - offsetX, 1); + const drawnHeight = Math.max(Math.ceil(bounds[3]) - offsetY, 1); + this.current.startNewPathAndClipBox([0, 0, drawnWidth, drawnHeight]); + let cacheId = "groupAt" + this.groupLevel; + if (group.smask) { + cacheId += "_smask_" + this.smaskCounter++ % 2; + } + const scratchCanvas = this.cachedCanvases.getCanvas(cacheId, drawnWidth, drawnHeight); + const groupCtx = scratchCanvas.context; + groupCtx.translate(-offsetX, -offsetY); + groupCtx.transform(...currentTransform); + if (group.smask) { + this.smaskStack.push({ + canvas: scratchCanvas.canvas, + context: groupCtx, + offsetX, + offsetY, + subtype: group.smask.subtype, + backdrop: group.smask.backdrop, + transferMap: group.smask.transferMap || null, + startTransformInverse: null + }); + } else { + currentCtx.setTransform(1, 0, 0, 1, 0, 0); + currentCtx.translate(offsetX, offsetY); + currentCtx.save(); + } + copyCtxState(currentCtx, groupCtx); + this.ctx = groupCtx; + this.setGState([["BM", "source-over"], ["ca", 1], ["CA", 1]]); + this.groupStack.push(currentCtx); + this.groupLevel++; + } + endGroup(group) { + if (!this.contentVisible) { + return; + } + this.groupLevel--; + const groupCtx = this.ctx; + const ctx = this.groupStack.pop(); + this.ctx = ctx; + this.ctx.imageSmoothingEnabled = false; + if (group.smask) { + this.tempSMask = this.smaskStack.pop(); + this.restore(); + } else { + this.ctx.restore(); + const currentMtx = getCurrentTransform(this.ctx); + this.restore(); + this.ctx.save(); + this.ctx.setTransform(...currentMtx); + const dirtyBox = Util.getAxialAlignedBoundingBox([0, 0, groupCtx.canvas.width, groupCtx.canvas.height], currentMtx); + this.ctx.drawImage(groupCtx.canvas, 0, 0); + this.ctx.restore(); + this.compose(dirtyBox); + } + } + beginAnnotation(id, rect, transform, matrix, hasOwnCanvas) { + this.#restoreInitialState(); + resetCtxToDefault(this.ctx); + this.ctx.save(); + this.save(); + if (this.baseTransform) { + this.ctx.setTransform(...this.baseTransform); + } + if (rect) { + const width = rect[2] - rect[0]; + const height = rect[3] - rect[1]; + if (hasOwnCanvas && this.annotationCanvasMap) { + transform = transform.slice(); + transform[4] -= rect[0]; + transform[5] -= rect[1]; + rect = rect.slice(); + rect[0] = rect[1] = 0; + rect[2] = width; + rect[3] = height; + const [scaleX, scaleY] = Util.singularValueDecompose2dScale(getCurrentTransform(this.ctx)); + const { + viewportScale + } = this; + const canvasWidth = Math.ceil(width * this.outputScaleX * viewportScale); + const canvasHeight = Math.ceil(height * this.outputScaleY * viewportScale); + this.annotationCanvas = this.canvasFactory.create(canvasWidth, canvasHeight); + const { + canvas, + context + } = this.annotationCanvas; + this.annotationCanvasMap.set(id, canvas); + this.annotationCanvas.savedCtx = this.ctx; + this.ctx = context; + this.ctx.save(); + this.ctx.setTransform(scaleX, 0, 0, -scaleY, 0, height * scaleY); + resetCtxToDefault(this.ctx); + } else { + resetCtxToDefault(this.ctx); + this.endPath(); + this.ctx.rect(rect[0], rect[1], width, height); + this.ctx.clip(); + this.ctx.beginPath(); + } + } + this.current = new CanvasExtraState(this.ctx.canvas.width, this.ctx.canvas.height); + this.transform(...transform); + this.transform(...matrix); + } + endAnnotation() { + if (this.annotationCanvas) { + this.ctx.restore(); + this.#drawFilter(); + this.ctx = this.annotationCanvas.savedCtx; + delete this.annotationCanvas.savedCtx; + delete this.annotationCanvas; + } + } + paintImageMaskXObject(img) { + if (!this.contentVisible) { + return; + } + const count = img.count; + img = this.getObject(img.data, img); + img.count = count; + const ctx = this.ctx; + const glyph = this.processingType3; + if (glyph) { + if (glyph.compiled === undefined) { + glyph.compiled = compileType3Glyph(img); + } + if (glyph.compiled) { + glyph.compiled(ctx); + return; + } + } + const mask = this._createMaskCanvas(img); + const maskCanvas = mask.canvas; + ctx.save(); + ctx.setTransform(1, 0, 0, 1, 0, 0); + ctx.drawImage(maskCanvas, mask.offsetX, mask.offsetY); + ctx.restore(); + this.compose(); + } + paintImageMaskXObjectRepeat(img, scaleX, skewX = 0, skewY = 0, scaleY, positions) { + if (!this.contentVisible) { + return; + } + img = this.getObject(img.data, img); + const ctx = this.ctx; + ctx.save(); + const currentTransform = getCurrentTransform(ctx); + ctx.transform(scaleX, skewX, skewY, scaleY, 0, 0); + const mask = this._createMaskCanvas(img); + ctx.setTransform(1, 0, 0, 1, mask.offsetX - currentTransform[4], mask.offsetY - currentTransform[5]); + for (let i = 0, ii = positions.length; i < ii; i += 2) { + const trans = Util.transform(currentTransform, [scaleX, skewX, skewY, scaleY, positions[i], positions[i + 1]]); + const [x, y] = Util.applyTransform([0, 0], trans); + ctx.drawImage(mask.canvas, x, y); + } + ctx.restore(); + this.compose(); + } + paintImageMaskXObjectGroup(images) { + if (!this.contentVisible) { + return; + } + const ctx = this.ctx; + const fillColor = this.current.fillColor; + const isPatternFill = this.current.patternFill; + for (const image of images) { + const { + data, + width, + height, + transform + } = image; + const maskCanvas = this.cachedCanvases.getCanvas("maskCanvas", width, height); + const maskCtx = maskCanvas.context; + maskCtx.save(); + const img = this.getObject(data, image); + putBinaryImageMask(maskCtx, img); + maskCtx.globalCompositeOperation = "source-in"; + maskCtx.fillStyle = isPatternFill ? fillColor.getPattern(maskCtx, this, getCurrentTransformInverse(ctx), PathType.FILL) : fillColor; + maskCtx.fillRect(0, 0, width, height); + maskCtx.restore(); + ctx.save(); + ctx.transform(...transform); + ctx.scale(1, -1); + drawImageAtIntegerCoords(ctx, maskCanvas.canvas, 0, 0, width, height, 0, -1, 1, 1); + ctx.restore(); + } + this.compose(); + } + paintImageXObject(objId) { + if (!this.contentVisible) { + return; + } + const imgData = this.getObject(objId); + if (!imgData) { + warn("Dependent image isn't ready yet"); + return; + } + this.paintInlineImageXObject(imgData); + } + paintImageXObjectRepeat(objId, scaleX, scaleY, positions) { + if (!this.contentVisible) { + return; + } + const imgData = this.getObject(objId); + if (!imgData) { + warn("Dependent image isn't ready yet"); + return; + } + const width = imgData.width; + const height = imgData.height; + const map = []; + for (let i = 0, ii = positions.length; i < ii; i += 2) { + map.push({ + transform: [scaleX, 0, 0, scaleY, positions[i], positions[i + 1]], + x: 0, + y: 0, + w: width, + h: height + }); + } + this.paintInlineImageXObjectGroup(imgData, map); + } + applyTransferMapsToCanvas(ctx) { + if (this.current.transferMaps !== "none") { + ctx.filter = this.current.transferMaps; + ctx.drawImage(ctx.canvas, 0, 0); + ctx.filter = "none"; + } + return ctx.canvas; + } + applyTransferMapsToBitmap(imgData) { + if (this.current.transferMaps === "none") { + return imgData.bitmap; + } + const { + bitmap, + width, + height + } = imgData; + const tmpCanvas = this.cachedCanvases.getCanvas("inlineImage", width, height); + const tmpCtx = tmpCanvas.context; + tmpCtx.filter = this.current.transferMaps; + tmpCtx.drawImage(bitmap, 0, 0); + tmpCtx.filter = "none"; + return tmpCanvas.canvas; + } + paintInlineImageXObject(imgData) { + if (!this.contentVisible) { + return; + } + const width = imgData.width; + const height = imgData.height; + const ctx = this.ctx; + this.save(); + if (!isNodeJS) { + const { + filter + } = ctx; + if (filter !== "none" && filter !== "") { + ctx.filter = "none"; + } + } + ctx.scale(1 / width, -1 / height); + let imgToPaint; + if (imgData.bitmap) { + imgToPaint = this.applyTransferMapsToBitmap(imgData); + } else if (typeof HTMLElement === "function" && imgData instanceof HTMLElement || !imgData.data) { + imgToPaint = imgData; + } else { + const tmpCanvas = this.cachedCanvases.getCanvas("inlineImage", width, height); + const tmpCtx = tmpCanvas.context; + putBinaryImageData(tmpCtx, imgData); + imgToPaint = this.applyTransferMapsToCanvas(tmpCtx); + } + const scaled = this._scaleImage(imgToPaint, getCurrentTransformInverse(ctx)); + ctx.imageSmoothingEnabled = getImageSmoothingEnabled(getCurrentTransform(ctx), imgData.interpolate); + drawImageAtIntegerCoords(ctx, scaled.img, 0, 0, scaled.paintWidth, scaled.paintHeight, 0, -height, width, height); + this.compose(); + this.restore(); + } + paintInlineImageXObjectGroup(imgData, map) { + if (!this.contentVisible) { + return; + } + const ctx = this.ctx; + let imgToPaint; + if (imgData.bitmap) { + imgToPaint = imgData.bitmap; + } else { + const w = imgData.width; + const h = imgData.height; + const tmpCanvas = this.cachedCanvases.getCanvas("inlineImage", w, h); + const tmpCtx = tmpCanvas.context; + putBinaryImageData(tmpCtx, imgData); + imgToPaint = this.applyTransferMapsToCanvas(tmpCtx); + } + for (const entry of map) { + ctx.save(); + ctx.transform(...entry.transform); + ctx.scale(1, -1); + drawImageAtIntegerCoords(ctx, imgToPaint, entry.x, entry.y, entry.w, entry.h, 0, -1, 1, 1); + ctx.restore(); + } + this.compose(); + } + paintSolidColorImageMask() { + if (!this.contentVisible) { + return; + } + this.ctx.fillRect(0, 0, 1, 1); + this.compose(); + } + markPoint(tag) {} + markPointProps(tag, properties) {} + beginMarkedContent(tag) { + this.markedContentStack.push({ + visible: true + }); + } + beginMarkedContentProps(tag, properties) { + if (tag === "OC") { + this.markedContentStack.push({ + visible: this.optionalContentConfig.isVisible(properties) + }); + } else { + this.markedContentStack.push({ + visible: true + }); + } + this.contentVisible = this.isContentVisible(); + } + endMarkedContent() { + this.markedContentStack.pop(); + this.contentVisible = this.isContentVisible(); + } + beginCompat() {} + endCompat() {} + consumePath(clipBox) { + const isEmpty = this.current.isEmptyClip(); + if (this.pendingClip) { + this.current.updateClipFromPath(); + } + if (!this.pendingClip) { + this.compose(clipBox); + } + const ctx = this.ctx; + if (this.pendingClip) { + if (!isEmpty) { + if (this.pendingClip === EO_CLIP) { + ctx.clip("evenodd"); + } else { + ctx.clip(); + } + } + this.pendingClip = null; + } + this.current.startNewPathAndClipBox(this.current.clipBox); + ctx.beginPath(); + } + getSinglePixelWidth() { + if (!this._cachedGetSinglePixelWidth) { + const m = getCurrentTransform(this.ctx); + if (m[1] === 0 && m[2] === 0) { + this._cachedGetSinglePixelWidth = 1 / Math.min(Math.abs(m[0]), Math.abs(m[3])); + } else { + const absDet = Math.abs(m[0] * m[3] - m[2] * m[1]); + const normX = Math.hypot(m[0], m[2]); + const normY = Math.hypot(m[1], m[3]); + this._cachedGetSinglePixelWidth = Math.max(normX, normY) / absDet; + } + } + return this._cachedGetSinglePixelWidth; + } + getScaleForStroking() { + if (this._cachedScaleForStroking[0] === -1) { + const { + lineWidth + } = this.current; + const { + a, + b, + c, + d + } = this.ctx.getTransform(); + let scaleX, scaleY; + if (b === 0 && c === 0) { + const normX = Math.abs(a); + const normY = Math.abs(d); + if (normX === normY) { + if (lineWidth === 0) { + scaleX = scaleY = 1 / normX; + } else { + const scaledLineWidth = normX * lineWidth; + scaleX = scaleY = scaledLineWidth < 1 ? 1 / scaledLineWidth : 1; + } + } else if (lineWidth === 0) { + scaleX = 1 / normX; + scaleY = 1 / normY; + } else { + const scaledXLineWidth = normX * lineWidth; + const scaledYLineWidth = normY * lineWidth; + scaleX = scaledXLineWidth < 1 ? 1 / scaledXLineWidth : 1; + scaleY = scaledYLineWidth < 1 ? 1 / scaledYLineWidth : 1; + } + } else { + const absDet = Math.abs(a * d - b * c); + const normX = Math.hypot(a, b); + const normY = Math.hypot(c, d); + if (lineWidth === 0) { + scaleX = normY / absDet; + scaleY = normX / absDet; + } else { + const baseArea = lineWidth * absDet; + scaleX = normY > baseArea ? normY / baseArea : 1; + scaleY = normX > baseArea ? normX / baseArea : 1; + } + } + this._cachedScaleForStroking[0] = scaleX; + this._cachedScaleForStroking[1] = scaleY; + } + return this._cachedScaleForStroking; + } + rescaleAndStroke(saveRestore) { + const { + ctx + } = this; + const { + lineWidth + } = this.current; + const [scaleX, scaleY] = this.getScaleForStroking(); + ctx.lineWidth = lineWidth || 1; + if (scaleX === 1 && scaleY === 1) { + ctx.stroke(); + return; + } + const dashes = ctx.getLineDash(); + if (saveRestore) { + ctx.save(); + } + ctx.scale(scaleX, scaleY); + if (dashes.length > 0) { + const scale = Math.max(scaleX, scaleY); + ctx.setLineDash(dashes.map(x => x / scale)); + ctx.lineDashOffset /= scale; + } + ctx.stroke(); + if (saveRestore) { + ctx.restore(); + } + } + isContentVisible() { + for (let i = this.markedContentStack.length - 1; i >= 0; i--) { + if (!this.markedContentStack[i].visible) { + return false; + } + } + return true; + } +} +for (const op in OPS) { + if (CanvasGraphics.prototype[op] !== undefined) { + CanvasGraphics.prototype[OPS[op]] = CanvasGraphics.prototype[op]; + } +} + +;// ./src/display/worker_options.js +class GlobalWorkerOptions { + static #port = null; + static #src = ""; + static get workerPort() { + return this.#port; + } + static set workerPort(val) { + if (!(typeof Worker !== "undefined" && val instanceof Worker) && val !== null) { + throw new Error("Invalid `workerPort` type."); + } + this.#port = val; + } + static get workerSrc() { + return this.#src; + } + static set workerSrc(val) { + if (typeof val !== "string") { + throw new Error("Invalid `workerSrc` type."); + } + this.#src = val; + } +} + +;// ./src/display/metadata.js + +class Metadata { + #metadataMap; + #data; + constructor({ + parsedData, + rawData + }) { + this.#metadataMap = parsedData; + this.#data = rawData; + } + getRaw() { + return this.#data; + } + get(name) { + return this.#metadataMap.get(name) ?? null; + } + getAll() { + return objectFromMap(this.#metadataMap); + } + has(name) { + return this.#metadataMap.has(name); + } +} + +;// ./src/display/optional_content_config.js + + +const INTERNAL = Symbol("INTERNAL"); +class OptionalContentGroup { + #isDisplay = false; + #isPrint = false; + #userSet = false; + #visible = true; + constructor(renderingIntent, { + name, + intent, + usage, + rbGroups + }) { + this.#isDisplay = !!(renderingIntent & RenderingIntentFlag.DISPLAY); + this.#isPrint = !!(renderingIntent & RenderingIntentFlag.PRINT); + this.name = name; + this.intent = intent; + this.usage = usage; + this.rbGroups = rbGroups; + } + get visible() { + if (this.#userSet) { + return this.#visible; + } + if (!this.#visible) { + return false; + } + const { + print, + view + } = this.usage; + if (this.#isDisplay) { + return view?.viewState !== "OFF"; + } else if (this.#isPrint) { + return print?.printState !== "OFF"; + } + return true; + } + _setVisible(internal, visible, userSet = false) { + if (internal !== INTERNAL) { + unreachable("Internal method `_setVisible` called."); + } + this.#userSet = userSet; + this.#visible = visible; + } +} +class OptionalContentConfig { + #cachedGetHash = null; + #groups = new Map(); + #initialHash = null; + #order = null; + constructor(data, renderingIntent = RenderingIntentFlag.DISPLAY) { + this.renderingIntent = renderingIntent; + this.name = null; + this.creator = null; + if (data === null) { + return; + } + this.name = data.name; + this.creator = data.creator; + this.#order = data.order; + for (const group of data.groups) { + this.#groups.set(group.id, new OptionalContentGroup(renderingIntent, group)); + } + if (data.baseState === "OFF") { + for (const group of this.#groups.values()) { + group._setVisible(INTERNAL, false); + } + } + for (const on of data.on) { + this.#groups.get(on)._setVisible(INTERNAL, true); + } + for (const off of data.off) { + this.#groups.get(off)._setVisible(INTERNAL, false); + } + this.#initialHash = this.getHash(); + } + #evaluateVisibilityExpression(array) { + const length = array.length; + if (length < 2) { + return true; + } + const operator = array[0]; + for (let i = 1; i < length; i++) { + const element = array[i]; + let state; + if (Array.isArray(element)) { + state = this.#evaluateVisibilityExpression(element); + } else if (this.#groups.has(element)) { + state = this.#groups.get(element).visible; + } else { + warn(`Optional content group not found: ${element}`); + return true; + } + switch (operator) { + case "And": + if (!state) { + return false; + } + break; + case "Or": + if (state) { + return true; + } + break; + case "Not": + return !state; + default: + return true; + } + } + return operator === "And"; + } + isVisible(group) { + if (this.#groups.size === 0) { + return true; + } + if (!group) { + info("Optional content group not defined."); + return true; + } + if (group.type === "OCG") { + if (!this.#groups.has(group.id)) { + warn(`Optional content group not found: ${group.id}`); + return true; + } + return this.#groups.get(group.id).visible; + } else if (group.type === "OCMD") { + if (group.expression) { + return this.#evaluateVisibilityExpression(group.expression); + } + if (!group.policy || group.policy === "AnyOn") { + for (const id of group.ids) { + if (!this.#groups.has(id)) { + warn(`Optional content group not found: ${id}`); + return true; + } + if (this.#groups.get(id).visible) { + return true; + } + } + return false; + } else if (group.policy === "AllOn") { + for (const id of group.ids) { + if (!this.#groups.has(id)) { + warn(`Optional content group not found: ${id}`); + return true; + } + if (!this.#groups.get(id).visible) { + return false; + } + } + return true; + } else if (group.policy === "AnyOff") { + for (const id of group.ids) { + if (!this.#groups.has(id)) { + warn(`Optional content group not found: ${id}`); + return true; + } + if (!this.#groups.get(id).visible) { + return true; + } + } + return false; + } else if (group.policy === "AllOff") { + for (const id of group.ids) { + if (!this.#groups.has(id)) { + warn(`Optional content group not found: ${id}`); + return true; + } + if (this.#groups.get(id).visible) { + return false; + } + } + return true; + } + warn(`Unknown optional content policy ${group.policy}.`); + return true; + } + warn(`Unknown group type ${group.type}.`); + return true; + } + setVisibility(id, visible = true, preserveRB = true) { + const group = this.#groups.get(id); + if (!group) { + warn(`Optional content group not found: ${id}`); + return; + } + if (preserveRB && visible && group.rbGroups.length) { + for (const rbGroup of group.rbGroups) { + for (const otherId of rbGroup) { + if (otherId !== id) { + this.#groups.get(otherId)?._setVisible(INTERNAL, false, true); + } + } + } + } + group._setVisible(INTERNAL, !!visible, true); + this.#cachedGetHash = null; + } + setOCGState({ + state, + preserveRB + }) { + let operator; + for (const elem of state) { + switch (elem) { + case "ON": + case "OFF": + case "Toggle": + operator = elem; + continue; + } + const group = this.#groups.get(elem); + if (!group) { + continue; + } + switch (operator) { + case "ON": + this.setVisibility(elem, true, preserveRB); + break; + case "OFF": + this.setVisibility(elem, false, preserveRB); + break; + case "Toggle": + this.setVisibility(elem, !group.visible, preserveRB); + break; + } + } + this.#cachedGetHash = null; + } + get hasInitialVisibility() { + return this.#initialHash === null || this.getHash() === this.#initialHash; + } + getOrder() { + if (!this.#groups.size) { + return null; + } + if (this.#order) { + return this.#order.slice(); + } + return [...this.#groups.keys()]; + } + getGroups() { + return this.#groups.size > 0 ? objectFromMap(this.#groups) : null; + } + getGroup(id) { + return this.#groups.get(id) || null; + } + getHash() { + if (this.#cachedGetHash !== null) { + return this.#cachedGetHash; + } + const hash = new MurmurHash3_64(); + for (const [id, group] of this.#groups) { + hash.update(`${id}:${group.visible}`); + } + return this.#cachedGetHash = hash.hexdigest(); + } +} + +;// ./src/display/transport_stream.js + + +class PDFDataTransportStream { + constructor(pdfDataRangeTransport, { + disableRange = false, + disableStream = false + }) { + assert(pdfDataRangeTransport, 'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'); + const { + length, + initialData, + progressiveDone, + contentDispositionFilename + } = pdfDataRangeTransport; + this._queuedChunks = []; + this._progressiveDone = progressiveDone; + this._contentDispositionFilename = contentDispositionFilename; + if (initialData?.length > 0) { + const buffer = initialData instanceof Uint8Array && initialData.byteLength === initialData.buffer.byteLength ? initialData.buffer : new Uint8Array(initialData).buffer; + this._queuedChunks.push(buffer); + } + this._pdfDataRangeTransport = pdfDataRangeTransport; + this._isStreamingSupported = !disableStream; + this._isRangeSupported = !disableRange; + this._contentLength = length; + this._fullRequestReader = null; + this._rangeReaders = []; + pdfDataRangeTransport.addRangeListener((begin, chunk) => { + this._onReceiveData({ + begin, + chunk + }); + }); + pdfDataRangeTransport.addProgressListener((loaded, total) => { + this._onProgress({ + loaded, + total + }); + }); + pdfDataRangeTransport.addProgressiveReadListener(chunk => { + this._onReceiveData({ + chunk + }); + }); + pdfDataRangeTransport.addProgressiveDoneListener(() => { + this._onProgressiveDone(); + }); + pdfDataRangeTransport.transportReady(); + } + _onReceiveData({ + begin, + chunk + }) { + const buffer = chunk instanceof Uint8Array && chunk.byteLength === chunk.buffer.byteLength ? chunk.buffer : new Uint8Array(chunk).buffer; + if (begin === undefined) { + if (this._fullRequestReader) { + this._fullRequestReader._enqueue(buffer); + } else { + this._queuedChunks.push(buffer); + } + } else { + const found = this._rangeReaders.some(function (rangeReader) { + if (rangeReader._begin !== begin) { + return false; + } + rangeReader._enqueue(buffer); + return true; + }); + assert(found, "_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found."); + } + } + get _progressiveDataLength() { + return this._fullRequestReader?._loaded ?? 0; + } + _onProgress(evt) { + if (evt.total === undefined) { + this._rangeReaders[0]?.onProgress?.({ + loaded: evt.loaded + }); + } else { + this._fullRequestReader?.onProgress?.({ + loaded: evt.loaded, + total: evt.total + }); + } + } + _onProgressiveDone() { + this._fullRequestReader?.progressiveDone(); + this._progressiveDone = true; + } + _removeRangeReader(reader) { + const i = this._rangeReaders.indexOf(reader); + if (i >= 0) { + this._rangeReaders.splice(i, 1); + } + } + getFullReader() { + assert(!this._fullRequestReader, "PDFDataTransportStream.getFullReader can only be called once."); + const queuedChunks = this._queuedChunks; + this._queuedChunks = null; + return new PDFDataTransportStreamReader(this, queuedChunks, this._progressiveDone, this._contentDispositionFilename); + } + getRangeReader(begin, end) { + if (end <= this._progressiveDataLength) { + return null; + } + const reader = new PDFDataTransportStreamRangeReader(this, begin, end); + this._pdfDataRangeTransport.requestDataRange(begin, end); + this._rangeReaders.push(reader); + return reader; + } + cancelAllRequests(reason) { + this._fullRequestReader?.cancel(reason); + for (const reader of this._rangeReaders.slice(0)) { + reader.cancel(reason); + } + this._pdfDataRangeTransport.abort(); + } +} +class PDFDataTransportStreamReader { + constructor(stream, queuedChunks, progressiveDone = false, contentDispositionFilename = null) { + this._stream = stream; + this._done = progressiveDone || false; + this._filename = isPdfFile(contentDispositionFilename) ? contentDispositionFilename : null; + this._queuedChunks = queuedChunks || []; + this._loaded = 0; + for (const chunk of this._queuedChunks) { + this._loaded += chunk.byteLength; + } + this._requests = []; + this._headersReady = Promise.resolve(); + stream._fullRequestReader = this; + this.onProgress = null; + } + _enqueue(chunk) { + if (this._done) { + return; + } + if (this._requests.length > 0) { + const requestCapability = this._requests.shift(); + requestCapability.resolve({ + value: chunk, + done: false + }); + } else { + this._queuedChunks.push(chunk); + } + this._loaded += chunk.byteLength; + } + get headersReady() { + return this._headersReady; + } + get filename() { + return this._filename; + } + get isRangeSupported() { + return this._stream._isRangeSupported; + } + get isStreamingSupported() { + return this._stream._isStreamingSupported; + } + get contentLength() { + return this._stream._contentLength; + } + async read() { + if (this._queuedChunks.length > 0) { + const chunk = this._queuedChunks.shift(); + return { + value: chunk, + done: false + }; + } + if (this._done) { + return { + value: undefined, + done: true + }; + } + const requestCapability = Promise.withResolvers(); + this._requests.push(requestCapability); + return requestCapability.promise; + } + cancel(reason) { + this._done = true; + for (const requestCapability of this._requests) { + requestCapability.resolve({ + value: undefined, + done: true + }); + } + this._requests.length = 0; + } + progressiveDone() { + if (this._done) { + return; + } + this._done = true; + } +} +class PDFDataTransportStreamRangeReader { + constructor(stream, begin, end) { + this._stream = stream; + this._begin = begin; + this._end = end; + this._queuedChunk = null; + this._requests = []; + this._done = false; + this.onProgress = null; + } + _enqueue(chunk) { + if (this._done) { + return; + } + if (this._requests.length === 0) { + this._queuedChunk = chunk; + } else { + const requestsCapability = this._requests.shift(); + requestsCapability.resolve({ + value: chunk, + done: false + }); + for (const requestCapability of this._requests) { + requestCapability.resolve({ + value: undefined, + done: true + }); + } + this._requests.length = 0; + } + this._done = true; + this._stream._removeRangeReader(this); + } + get isStreamingSupported() { + return false; + } + async read() { + if (this._queuedChunk) { + const chunk = this._queuedChunk; + this._queuedChunk = null; + return { + value: chunk, + done: false + }; + } + if (this._done) { + return { + value: undefined, + done: true + }; + } + const requestCapability = Promise.withResolvers(); + this._requests.push(requestCapability); + return requestCapability.promise; + } + cancel(reason) { + this._done = true; + for (const requestCapability of this._requests) { + requestCapability.resolve({ + value: undefined, + done: true + }); + } + this._requests.length = 0; + this._stream._removeRangeReader(this); + } +} + +;// ./src/display/content_disposition.js + +function getFilenameFromContentDispositionHeader(contentDisposition) { + let needsEncodingFixup = true; + let tmp = toParamRegExp("filename\\*", "i").exec(contentDisposition); + if (tmp) { + tmp = tmp[1]; + let filename = rfc2616unquote(tmp); + filename = unescape(filename); + filename = rfc5987decode(filename); + filename = rfc2047decode(filename); + return fixupEncoding(filename); + } + tmp = rfc2231getparam(contentDisposition); + if (tmp) { + const filename = rfc2047decode(tmp); + return fixupEncoding(filename); + } + tmp = toParamRegExp("filename", "i").exec(contentDisposition); + if (tmp) { + tmp = tmp[1]; + let filename = rfc2616unquote(tmp); + filename = rfc2047decode(filename); + return fixupEncoding(filename); + } + function toParamRegExp(attributePattern, flags) { + return new RegExp("(?:^|;)\\s*" + attributePattern + "\\s*=\\s*" + "(" + '[^";\\s][^;\\s]*' + "|" + '"(?:[^"\\\\]|\\\\"?)+"?' + ")", flags); + } + function textdecode(encoding, value) { + if (encoding) { + if (!/^[\x00-\xFF]+$/.test(value)) { + return value; + } + try { + const decoder = new TextDecoder(encoding, { + fatal: true + }); + const buffer = stringToBytes(value); + value = decoder.decode(buffer); + needsEncodingFixup = false; + } catch {} + } + return value; + } + function fixupEncoding(value) { + if (needsEncodingFixup && /[\x80-\xff]/.test(value)) { + value = textdecode("utf-8", value); + if (needsEncodingFixup) { + value = textdecode("iso-8859-1", value); + } + } + return value; + } + function rfc2231getparam(contentDispositionStr) { + const matches = []; + let match; + const iter = toParamRegExp("filename\\*((?!0\\d)\\d+)(\\*?)", "ig"); + while ((match = iter.exec(contentDispositionStr)) !== null) { + let [, n, quot, part] = match; + n = parseInt(n, 10); + if (n in matches) { + if (n === 0) { + break; + } + continue; + } + matches[n] = [quot, part]; + } + const parts = []; + for (let n = 0; n < matches.length; ++n) { + if (!(n in matches)) { + break; + } + let [quot, part] = matches[n]; + part = rfc2616unquote(part); + if (quot) { + part = unescape(part); + if (n === 0) { + part = rfc5987decode(part); + } + } + parts.push(part); + } + return parts.join(""); + } + function rfc2616unquote(value) { + if (value.startsWith('"')) { + const parts = value.slice(1).split('\\"'); + for (let i = 0; i < parts.length; ++i) { + const quotindex = parts[i].indexOf('"'); + if (quotindex !== -1) { + parts[i] = parts[i].slice(0, quotindex); + parts.length = i + 1; + } + parts[i] = parts[i].replaceAll(/\\(.)/g, "$1"); + } + value = parts.join('"'); + } + return value; + } + function rfc5987decode(extvalue) { + const encodingend = extvalue.indexOf("'"); + if (encodingend === -1) { + return extvalue; + } + const encoding = extvalue.slice(0, encodingend); + const langvalue = extvalue.slice(encodingend + 1); + const value = langvalue.replace(/^[^']*'/, ""); + return textdecode(encoding, value); + } + function rfc2047decode(value) { + if (!value.startsWith("=?") || /[\x00-\x19\x80-\xff]/.test(value)) { + return value; + } + return value.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g, function (matches, charset, encoding, text) { + if (encoding === "q" || encoding === "Q") { + text = text.replaceAll("_", " "); + text = text.replaceAll(/=([0-9a-fA-F]{2})/g, function (match, hex) { + return String.fromCharCode(parseInt(hex, 16)); + }); + return textdecode(charset, text); + } + try { + text = atob(text); + } catch {} + return textdecode(charset, text); + }); + } + return ""; +} + +;// ./src/display/network_utils.js + + + +function createHeaders(isHttp, httpHeaders) { + const headers = new Headers(); + if (!isHttp || !httpHeaders || typeof httpHeaders !== "object") { + return headers; + } + for (const key in httpHeaders) { + const val = httpHeaders[key]; + if (val !== undefined) { + headers.append(key, val); + } + } + return headers; +} +function getResponseOrigin(url) { + try { + return new URL(url).origin; + } catch {} + return null; +} +function validateRangeRequestCapabilities({ + responseHeaders, + isHttp, + rangeChunkSize, + disableRange +}) { + const returnValues = { + allowRangeRequests: false, + suggestedLength: undefined + }; + const length = parseInt(responseHeaders.get("Content-Length"), 10); + if (!Number.isInteger(length)) { + return returnValues; + } + returnValues.suggestedLength = length; + if (length <= 2 * rangeChunkSize) { + return returnValues; + } + if (disableRange || !isHttp) { + return returnValues; + } + if (responseHeaders.get("Accept-Ranges") !== "bytes") { + return returnValues; + } + const contentEncoding = responseHeaders.get("Content-Encoding") || "identity"; + if (contentEncoding !== "identity") { + return returnValues; + } + returnValues.allowRangeRequests = true; + return returnValues; +} +function extractFilenameFromHeader(responseHeaders) { + const contentDisposition = responseHeaders.get("Content-Disposition"); + if (contentDisposition) { + let filename = getFilenameFromContentDispositionHeader(contentDisposition); + if (filename.includes("%")) { + try { + filename = decodeURIComponent(filename); + } catch {} + } + if (isPdfFile(filename)) { + return filename; + } + } + return null; +} +function createResponseStatusError(status, url) { + if (status === 404 || status === 0 && url.startsWith("file:")) { + return new MissingPDFException('Missing PDF "' + url + '".'); + } + return new UnexpectedResponseException(`Unexpected server response (${status}) while retrieving PDF "${url}".`, status); +} +function validateResponseStatus(status) { + return status === 200 || status === 206; +} + +;// ./src/display/fetch_stream.js + + +function createFetchOptions(headers, withCredentials, abortController) { + return { + method: "GET", + headers, + signal: abortController.signal, + mode: "cors", + credentials: withCredentials ? "include" : "same-origin", + redirect: "follow" + }; +} +function getArrayBuffer(val) { + if (val instanceof Uint8Array) { + return val.buffer; + } + if (val instanceof ArrayBuffer) { + return val; + } + warn(`getArrayBuffer - unexpected data format: ${val}`); + return new Uint8Array(val).buffer; +} +class PDFFetchStream { + _responseOrigin = null; + constructor(source) { + this.source = source; + this.isHttp = /^https?:/i.test(source.url); + this.headers = createHeaders(this.isHttp, source.httpHeaders); + this._fullRequestReader = null; + this._rangeRequestReaders = []; + } + get _progressiveDataLength() { + return this._fullRequestReader?._loaded ?? 0; + } + getFullReader() { + assert(!this._fullRequestReader, "PDFFetchStream.getFullReader can only be called once."); + this._fullRequestReader = new PDFFetchStreamReader(this); + return this._fullRequestReader; + } + getRangeReader(begin, end) { + if (end <= this._progressiveDataLength) { + return null; + } + const reader = new PDFFetchStreamRangeReader(this, begin, end); + this._rangeRequestReaders.push(reader); + return reader; + } + cancelAllRequests(reason) { + this._fullRequestReader?.cancel(reason); + for (const reader of this._rangeRequestReaders.slice(0)) { + reader.cancel(reason); + } + } +} +class PDFFetchStreamReader { + constructor(stream) { + this._stream = stream; + this._reader = null; + this._loaded = 0; + this._filename = null; + const source = stream.source; + this._withCredentials = source.withCredentials || false; + this._contentLength = source.length; + this._headersCapability = Promise.withResolvers(); + this._disableRange = source.disableRange || false; + this._rangeChunkSize = source.rangeChunkSize; + if (!this._rangeChunkSize && !this._disableRange) { + this._disableRange = true; + } + this._abortController = new AbortController(); + this._isStreamingSupported = !source.disableStream; + this._isRangeSupported = !source.disableRange; + const headers = new Headers(stream.headers); + const url = source.url; + fetch(url, createFetchOptions(headers, this._withCredentials, this._abortController)).then(response => { + stream._responseOrigin = getResponseOrigin(response.url); + if (!validateResponseStatus(response.status)) { + throw createResponseStatusError(response.status, url); + } + this._reader = response.body.getReader(); + this._headersCapability.resolve(); + const responseHeaders = response.headers; + const { + allowRangeRequests, + suggestedLength + } = validateRangeRequestCapabilities({ + responseHeaders, + isHttp: stream.isHttp, + rangeChunkSize: this._rangeChunkSize, + disableRange: this._disableRange + }); + this._isRangeSupported = allowRangeRequests; + this._contentLength = suggestedLength || this._contentLength; + this._filename = extractFilenameFromHeader(responseHeaders); + if (!this._isStreamingSupported && this._isRangeSupported) { + this.cancel(new AbortException("Streaming is disabled.")); + } + }).catch(this._headersCapability.reject); + this.onProgress = null; + } + get headersReady() { + return this._headersCapability.promise; + } + get filename() { + return this._filename; + } + get contentLength() { + return this._contentLength; + } + get isRangeSupported() { + return this._isRangeSupported; + } + get isStreamingSupported() { + return this._isStreamingSupported; + } + async read() { + await this._headersCapability.promise; + const { + value, + done + } = await this._reader.read(); + if (done) { + return { + value, + done + }; + } + this._loaded += value.byteLength; + this.onProgress?.({ + loaded: this._loaded, + total: this._contentLength + }); + return { + value: getArrayBuffer(value), + done: false + }; + } + cancel(reason) { + this._reader?.cancel(reason); + this._abortController.abort(); + } +} +class PDFFetchStreamRangeReader { + constructor(stream, begin, end) { + this._stream = stream; + this._reader = null; + this._loaded = 0; + const source = stream.source; + this._withCredentials = source.withCredentials || false; + this._readCapability = Promise.withResolvers(); + this._isStreamingSupported = !source.disableStream; + this._abortController = new AbortController(); + const headers = new Headers(stream.headers); + headers.append("Range", `bytes=${begin}-${end - 1}`); + const url = source.url; + fetch(url, createFetchOptions(headers, this._withCredentials, this._abortController)).then(response => { + const responseOrigin = getResponseOrigin(response.url); + if (responseOrigin !== stream._responseOrigin) { + throw new Error(`Expected range response-origin "${responseOrigin}" to match "${stream._responseOrigin}".`); + } + if (!validateResponseStatus(response.status)) { + throw createResponseStatusError(response.status, url); + } + this._readCapability.resolve(); + this._reader = response.body.getReader(); + }).catch(this._readCapability.reject); + this.onProgress = null; + } + get isStreamingSupported() { + return this._isStreamingSupported; + } + async read() { + await this._readCapability.promise; + const { + value, + done + } = await this._reader.read(); + if (done) { + return { + value, + done + }; + } + this._loaded += value.byteLength; + this.onProgress?.({ + loaded: this._loaded + }); + return { + value: getArrayBuffer(value), + done: false + }; + } + cancel(reason) { + this._reader?.cancel(reason); + this._abortController.abort(); + } +} + +;// ./src/display/network.js + + +const OK_RESPONSE = 200; +const PARTIAL_CONTENT_RESPONSE = 206; +function network_getArrayBuffer(xhr) { + const data = xhr.response; + if (typeof data !== "string") { + return data; + } + return stringToBytes(data).buffer; +} +class NetworkManager { + _responseOrigin = null; + constructor({ + url, + httpHeaders, + withCredentials + }) { + this.url = url; + this.isHttp = /^https?:/i.test(url); + this.headers = createHeaders(this.isHttp, httpHeaders); + this.withCredentials = withCredentials || false; + this.currXhrId = 0; + this.pendingRequests = Object.create(null); + } + request(args) { + const xhr = new XMLHttpRequest(); + const xhrId = this.currXhrId++; + const pendingRequest = this.pendingRequests[xhrId] = { + xhr + }; + xhr.open("GET", this.url); + xhr.withCredentials = this.withCredentials; + for (const [key, val] of this.headers) { + xhr.setRequestHeader(key, val); + } + if (this.isHttp && "begin" in args && "end" in args) { + xhr.setRequestHeader("Range", `bytes=${args.begin}-${args.end - 1}`); + pendingRequest.expectedStatus = PARTIAL_CONTENT_RESPONSE; + } else { + pendingRequest.expectedStatus = OK_RESPONSE; + } + xhr.responseType = "arraybuffer"; + assert(args.onError, "Expected `onError` callback to be provided."); + xhr.onerror = () => { + args.onError(xhr.status); + }; + xhr.onreadystatechange = this.onStateChange.bind(this, xhrId); + xhr.onprogress = this.onProgress.bind(this, xhrId); + pendingRequest.onHeadersReceived = args.onHeadersReceived; + pendingRequest.onDone = args.onDone; + pendingRequest.onError = args.onError; + pendingRequest.onProgress = args.onProgress; + xhr.send(null); + return xhrId; + } + onProgress(xhrId, evt) { + const pendingRequest = this.pendingRequests[xhrId]; + if (!pendingRequest) { + return; + } + pendingRequest.onProgress?.(evt); + } + onStateChange(xhrId, evt) { + const pendingRequest = this.pendingRequests[xhrId]; + if (!pendingRequest) { + return; + } + const xhr = pendingRequest.xhr; + if (xhr.readyState >= 2 && pendingRequest.onHeadersReceived) { + pendingRequest.onHeadersReceived(); + delete pendingRequest.onHeadersReceived; + } + if (xhr.readyState !== 4) { + return; + } + if (!(xhrId in this.pendingRequests)) { + return; + } + delete this.pendingRequests[xhrId]; + if (xhr.status === 0 && this.isHttp) { + pendingRequest.onError(xhr.status); + return; + } + const xhrStatus = xhr.status || OK_RESPONSE; + const ok_response_on_range_request = xhrStatus === OK_RESPONSE && pendingRequest.expectedStatus === PARTIAL_CONTENT_RESPONSE; + if (!ok_response_on_range_request && xhrStatus !== pendingRequest.expectedStatus) { + pendingRequest.onError(xhr.status); + return; + } + const chunk = network_getArrayBuffer(xhr); + if (xhrStatus === PARTIAL_CONTENT_RESPONSE) { + const rangeHeader = xhr.getResponseHeader("Content-Range"); + const matches = /bytes (\d+)-(\d+)\/(\d+)/.exec(rangeHeader); + if (matches) { + pendingRequest.onDone({ + begin: parseInt(matches[1], 10), + chunk + }); + } else { + warn(`Missing or invalid "Content-Range" header.`); + pendingRequest.onError(0); + } + } else if (chunk) { + pendingRequest.onDone({ + begin: 0, + chunk + }); + } else { + pendingRequest.onError(xhr.status); + } + } + getRequestXhr(xhrId) { + return this.pendingRequests[xhrId].xhr; + } + isPendingRequest(xhrId) { + return xhrId in this.pendingRequests; + } + abortRequest(xhrId) { + const xhr = this.pendingRequests[xhrId].xhr; + delete this.pendingRequests[xhrId]; + xhr.abort(); + } +} +class PDFNetworkStream { + constructor(source) { + this._source = source; + this._manager = new NetworkManager(source); + this._rangeChunkSize = source.rangeChunkSize; + this._fullRequestReader = null; + this._rangeRequestReaders = []; + } + _onRangeRequestReaderClosed(reader) { + const i = this._rangeRequestReaders.indexOf(reader); + if (i >= 0) { + this._rangeRequestReaders.splice(i, 1); + } + } + getFullReader() { + assert(!this._fullRequestReader, "PDFNetworkStream.getFullReader can only be called once."); + this._fullRequestReader = new PDFNetworkStreamFullRequestReader(this._manager, this._source); + return this._fullRequestReader; + } + getRangeReader(begin, end) { + const reader = new PDFNetworkStreamRangeRequestReader(this._manager, begin, end); + reader.onClosed = this._onRangeRequestReaderClosed.bind(this); + this._rangeRequestReaders.push(reader); + return reader; + } + cancelAllRequests(reason) { + this._fullRequestReader?.cancel(reason); + for (const reader of this._rangeRequestReaders.slice(0)) { + reader.cancel(reason); + } + } +} +class PDFNetworkStreamFullRequestReader { + constructor(manager, source) { + this._manager = manager; + this._url = source.url; + this._fullRequestId = manager.request({ + onHeadersReceived: this._onHeadersReceived.bind(this), + onDone: this._onDone.bind(this), + onError: this._onError.bind(this), + onProgress: this._onProgress.bind(this) + }); + this._headersCapability = Promise.withResolvers(); + this._disableRange = source.disableRange || false; + this._contentLength = source.length; + this._rangeChunkSize = source.rangeChunkSize; + if (!this._rangeChunkSize && !this._disableRange) { + this._disableRange = true; + } + this._isStreamingSupported = false; + this._isRangeSupported = false; + this._cachedChunks = []; + this._requests = []; + this._done = false; + this._storedError = undefined; + this._filename = null; + this.onProgress = null; + } + _onHeadersReceived() { + const fullRequestXhrId = this._fullRequestId; + const fullRequestXhr = this._manager.getRequestXhr(fullRequestXhrId); + this._manager._responseOrigin = getResponseOrigin(fullRequestXhr.responseURL); + const rawResponseHeaders = fullRequestXhr.getAllResponseHeaders(); + const responseHeaders = new Headers(rawResponseHeaders ? rawResponseHeaders.trimStart().replace(/[^\S ]+$/, "").split(/[\r\n]+/).map(x => { + const [key, ...val] = x.split(": "); + return [key, val.join(": ")]; + }) : []); + const { + allowRangeRequests, + suggestedLength + } = validateRangeRequestCapabilities({ + responseHeaders, + isHttp: this._manager.isHttp, + rangeChunkSize: this._rangeChunkSize, + disableRange: this._disableRange + }); + if (allowRangeRequests) { + this._isRangeSupported = true; + } + this._contentLength = suggestedLength || this._contentLength; + this._filename = extractFilenameFromHeader(responseHeaders); + if (this._isRangeSupported) { + this._manager.abortRequest(fullRequestXhrId); + } + this._headersCapability.resolve(); + } + _onDone(data) { + if (data) { + if (this._requests.length > 0) { + const requestCapability = this._requests.shift(); + requestCapability.resolve({ + value: data.chunk, + done: false + }); + } else { + this._cachedChunks.push(data.chunk); + } + } + this._done = true; + if (this._cachedChunks.length > 0) { + return; + } + for (const requestCapability of this._requests) { + requestCapability.resolve({ + value: undefined, + done: true + }); + } + this._requests.length = 0; + } + _onError(status) { + this._storedError = createResponseStatusError(status, this._url); + this._headersCapability.reject(this._storedError); + for (const requestCapability of this._requests) { + requestCapability.reject(this._storedError); + } + this._requests.length = 0; + this._cachedChunks.length = 0; + } + _onProgress(evt) { + this.onProgress?.({ + loaded: evt.loaded, + total: evt.lengthComputable ? evt.total : this._contentLength + }); + } + get filename() { + return this._filename; + } + get isRangeSupported() { + return this._isRangeSupported; + } + get isStreamingSupported() { + return this._isStreamingSupported; + } + get contentLength() { + return this._contentLength; + } + get headersReady() { + return this._headersCapability.promise; + } + async read() { + await this._headersCapability.promise; + if (this._storedError) { + throw this._storedError; + } + if (this._cachedChunks.length > 0) { + const chunk = this._cachedChunks.shift(); + return { + value: chunk, + done: false + }; + } + if (this._done) { + return { + value: undefined, + done: true + }; + } + const requestCapability = Promise.withResolvers(); + this._requests.push(requestCapability); + return requestCapability.promise; + } + cancel(reason) { + this._done = true; + this._headersCapability.reject(reason); + for (const requestCapability of this._requests) { + requestCapability.resolve({ + value: undefined, + done: true + }); + } + this._requests.length = 0; + if (this._manager.isPendingRequest(this._fullRequestId)) { + this._manager.abortRequest(this._fullRequestId); + } + this._fullRequestReader = null; + } +} +class PDFNetworkStreamRangeRequestReader { + constructor(manager, begin, end) { + this._manager = manager; + this._url = manager.url; + this._requestId = manager.request({ + begin, + end, + onHeadersReceived: this._onHeadersReceived.bind(this), + onDone: this._onDone.bind(this), + onError: this._onError.bind(this), + onProgress: this._onProgress.bind(this) + }); + this._requests = []; + this._queuedChunk = null; + this._done = false; + this._storedError = undefined; + this.onProgress = null; + this.onClosed = null; + } + _onHeadersReceived() { + const responseOrigin = getResponseOrigin(this._manager.getRequestXhr(this._requestId)?.responseURL); + if (responseOrigin !== this._manager._responseOrigin) { + this._storedError = new Error(`Expected range response-origin "${responseOrigin}" to match "${this._manager._responseOrigin}".`); + this._onError(0); + } + } + _close() { + this.onClosed?.(this); + } + _onDone(data) { + const chunk = data.chunk; + if (this._requests.length > 0) { + const requestCapability = this._requests.shift(); + requestCapability.resolve({ + value: chunk, + done: false + }); + } else { + this._queuedChunk = chunk; + } + this._done = true; + for (const requestCapability of this._requests) { + requestCapability.resolve({ + value: undefined, + done: true + }); + } + this._requests.length = 0; + this._close(); + } + _onError(status) { + this._storedError ??= createResponseStatusError(status, this._url); + for (const requestCapability of this._requests) { + requestCapability.reject(this._storedError); + } + this._requests.length = 0; + this._queuedChunk = null; + } + _onProgress(evt) { + if (!this.isStreamingSupported) { + this.onProgress?.({ + loaded: evt.loaded + }); + } + } + get isStreamingSupported() { + return false; + } + async read() { + if (this._storedError) { + throw this._storedError; + } + if (this._queuedChunk !== null) { + const chunk = this._queuedChunk; + this._queuedChunk = null; + return { + value: chunk, + done: false + }; + } + if (this._done) { + return { + value: undefined, + done: true + }; + } + const requestCapability = Promise.withResolvers(); + this._requests.push(requestCapability); + return requestCapability.promise; + } + cancel(reason) { + this._done = true; + for (const requestCapability of this._requests) { + requestCapability.resolve({ + value: undefined, + done: true + }); + } + this._requests.length = 0; + if (this._manager.isPendingRequest(this._requestId)) { + this._manager.abortRequest(this._requestId); + } + this._close(); + } +} + +;// ./src/display/node_stream.js + +const urlRegex = /^[a-z][a-z0-9\-+.]+:/i; +function parseUrlOrPath(sourceUrl) { + if (urlRegex.test(sourceUrl)) { + return new URL(sourceUrl); + } + const url = process.getBuiltinModule("url"); + return new URL(url.pathToFileURL(sourceUrl)); +} +class PDFNodeStream { + constructor(source) { + this.source = source; + this.url = parseUrlOrPath(source.url); + assert(this.url.protocol === "file:", "PDFNodeStream only supports file:// URLs."); + this._fullRequestReader = null; + this._rangeRequestReaders = []; + } + get _progressiveDataLength() { + return this._fullRequestReader?._loaded ?? 0; + } + getFullReader() { + assert(!this._fullRequestReader, "PDFNodeStream.getFullReader can only be called once."); + this._fullRequestReader = new PDFNodeStreamFsFullReader(this); + return this._fullRequestReader; + } + getRangeReader(start, end) { + if (end <= this._progressiveDataLength) { + return null; + } + const rangeReader = new PDFNodeStreamFsRangeReader(this, start, end); + this._rangeRequestReaders.push(rangeReader); + return rangeReader; + } + cancelAllRequests(reason) { + this._fullRequestReader?.cancel(reason); + for (const reader of this._rangeRequestReaders.slice(0)) { + reader.cancel(reason); + } + } +} +class PDFNodeStreamFsFullReader { + constructor(stream) { + this._url = stream.url; + this._done = false; + this._storedError = null; + this.onProgress = null; + const source = stream.source; + this._contentLength = source.length; + this._loaded = 0; + this._filename = null; + this._disableRange = source.disableRange || false; + this._rangeChunkSize = source.rangeChunkSize; + if (!this._rangeChunkSize && !this._disableRange) { + this._disableRange = true; + } + this._isStreamingSupported = !source.disableStream; + this._isRangeSupported = !source.disableRange; + this._readableStream = null; + this._readCapability = Promise.withResolvers(); + this._headersCapability = Promise.withResolvers(); + const fs = process.getBuiltinModule("fs"); + fs.promises.lstat(this._url).then(stat => { + this._contentLength = stat.size; + this._setReadableStream(fs.createReadStream(this._url)); + this._headersCapability.resolve(); + }, error => { + if (error.code === "ENOENT") { + error = new MissingPDFException(`Missing PDF "${this._url}".`); + } + this._storedError = error; + this._headersCapability.reject(error); + }); + } + get headersReady() { + return this._headersCapability.promise; + } + get filename() { + return this._filename; + } + get contentLength() { + return this._contentLength; + } + get isRangeSupported() { + return this._isRangeSupported; + } + get isStreamingSupported() { + return this._isStreamingSupported; + } + async read() { + await this._readCapability.promise; + if (this._done) { + return { + value: undefined, + done: true + }; + } + if (this._storedError) { + throw this._storedError; + } + const chunk = this._readableStream.read(); + if (chunk === null) { + this._readCapability = Promise.withResolvers(); + return this.read(); + } + this._loaded += chunk.length; + this.onProgress?.({ + loaded: this._loaded, + total: this._contentLength + }); + const buffer = new Uint8Array(chunk).buffer; + return { + value: buffer, + done: false + }; + } + cancel(reason) { + if (!this._readableStream) { + this._error(reason); + return; + } + this._readableStream.destroy(reason); + } + _error(reason) { + this._storedError = reason; + this._readCapability.resolve(); + } + _setReadableStream(readableStream) { + this._readableStream = readableStream; + readableStream.on("readable", () => { + this._readCapability.resolve(); + }); + readableStream.on("end", () => { + readableStream.destroy(); + this._done = true; + this._readCapability.resolve(); + }); + readableStream.on("error", reason => { + this._error(reason); + }); + if (!this._isStreamingSupported && this._isRangeSupported) { + this._error(new AbortException("streaming is disabled")); + } + if (this._storedError) { + this._readableStream.destroy(this._storedError); + } + } +} +class PDFNodeStreamFsRangeReader { + constructor(stream, start, end) { + this._url = stream.url; + this._done = false; + this._storedError = null; + this.onProgress = null; + this._loaded = 0; + this._readableStream = null; + this._readCapability = Promise.withResolvers(); + const source = stream.source; + this._isStreamingSupported = !source.disableStream; + const fs = process.getBuiltinModule("fs"); + this._setReadableStream(fs.createReadStream(this._url, { + start, + end: end - 1 + })); + } + get isStreamingSupported() { + return this._isStreamingSupported; + } + async read() { + await this._readCapability.promise; + if (this._done) { + return { + value: undefined, + done: true + }; + } + if (this._storedError) { + throw this._storedError; + } + const chunk = this._readableStream.read(); + if (chunk === null) { + this._readCapability = Promise.withResolvers(); + return this.read(); + } + this._loaded += chunk.length; + this.onProgress?.({ + loaded: this._loaded + }); + const buffer = new Uint8Array(chunk).buffer; + return { + value: buffer, + done: false + }; + } + cancel(reason) { + if (!this._readableStream) { + this._error(reason); + return; + } + this._readableStream.destroy(reason); + } + _error(reason) { + this._storedError = reason; + this._readCapability.resolve(); + } + _setReadableStream(readableStream) { + this._readableStream = readableStream; + readableStream.on("readable", () => { + this._readCapability.resolve(); + }); + readableStream.on("end", () => { + readableStream.destroy(); + this._done = true; + this._readCapability.resolve(); + }); + readableStream.on("error", reason => { + this._error(reason); + }); + if (this._storedError) { + this._readableStream.destroy(this._storedError); + } + } +} + +;// ./src/display/text_layer.js + + +const MAX_TEXT_DIVS_TO_RENDER = 100000; +const DEFAULT_FONT_SIZE = 30; +const DEFAULT_FONT_ASCENT = 0.8; +class TextLayer { + #capability = Promise.withResolvers(); + #container = null; + #disableProcessItems = false; + #fontInspectorEnabled = !!globalThis.FontInspector?.enabled; + #lang = null; + #layoutTextParams = null; + #pageHeight = 0; + #pageWidth = 0; + #reader = null; + #rootContainer = null; + #rotation = 0; + #scale = 0; + #styleCache = Object.create(null); + #textContentItemsStr = []; + #textContentSource = null; + #textDivs = []; + #textDivProperties = new WeakMap(); + #transform = null; + static #ascentCache = new Map(); + static #canvasContexts = new Map(); + static #canvasCtxFonts = new WeakMap(); + static #minFontSize = null; + static #pendingTextLayers = new Set(); + constructor({ + textContentSource, + container, + viewport + }) { + if (textContentSource instanceof ReadableStream) { + this.#textContentSource = textContentSource; + } else if (typeof textContentSource === "object") { + this.#textContentSource = new ReadableStream({ + start(controller) { + controller.enqueue(textContentSource); + controller.close(); + } + }); + } else { + throw new Error('No "textContentSource" parameter specified.'); + } + this.#container = this.#rootContainer = container; + this.#scale = viewport.scale * (globalThis.devicePixelRatio || 1); + this.#rotation = viewport.rotation; + this.#layoutTextParams = { + div: null, + properties: null, + ctx: null + }; + const { + pageWidth, + pageHeight, + pageX, + pageY + } = viewport.rawDims; + this.#transform = [1, 0, 0, -1, -pageX, pageY + pageHeight]; + this.#pageWidth = pageWidth; + this.#pageHeight = pageHeight; + TextLayer.#ensureMinFontSizeComputed(); + setLayerDimensions(container, viewport); + this.#capability.promise.finally(() => { + TextLayer.#pendingTextLayers.delete(this); + this.#layoutTextParams = null; + this.#styleCache = null; + }).catch(() => {}); + } + static get fontFamilyMap() { + const { + isWindows, + isFirefox + } = util_FeatureTest.platform; + return shadow(this, "fontFamilyMap", new Map([["sans-serif", `${isWindows && isFirefox ? "Calibri, " : ""}sans-serif`], ["monospace", `${isWindows && isFirefox ? "Lucida Console, " : ""}monospace`]])); + } + render() { + const pump = () => { + this.#reader.read().then(({ + value, + done + }) => { + if (done) { + this.#capability.resolve(); + return; + } + this.#lang ??= value.lang; + Object.assign(this.#styleCache, value.styles); + this.#processItems(value.items); + pump(); + }, this.#capability.reject); + }; + this.#reader = this.#textContentSource.getReader(); + TextLayer.#pendingTextLayers.add(this); + pump(); + return this.#capability.promise; + } + update({ + viewport, + onBefore = null + }) { + const scale = viewport.scale * (globalThis.devicePixelRatio || 1); + const rotation = viewport.rotation; + if (rotation !== this.#rotation) { + onBefore?.(); + this.#rotation = rotation; + setLayerDimensions(this.#rootContainer, { + rotation + }); + } + if (scale !== this.#scale) { + onBefore?.(); + this.#scale = scale; + const params = { + div: null, + properties: null, + ctx: TextLayer.#getCtx(this.#lang) + }; + for (const div of this.#textDivs) { + params.properties = this.#textDivProperties.get(div); + params.div = div; + this.#layout(params); + } + } + } + cancel() { + const abortEx = new AbortException("TextLayer task cancelled."); + this.#reader?.cancel(abortEx).catch(() => {}); + this.#reader = null; + this.#capability.reject(abortEx); + } + get textDivs() { + return this.#textDivs; + } + get textContentItemsStr() { + return this.#textContentItemsStr; + } + #processItems(items) { + if (this.#disableProcessItems) { + return; + } + this.#layoutTextParams.ctx ??= TextLayer.#getCtx(this.#lang); + const textDivs = this.#textDivs, + textContentItemsStr = this.#textContentItemsStr; + for (const item of items) { + if (textDivs.length > MAX_TEXT_DIVS_TO_RENDER) { + warn("Ignoring additional textDivs for performance reasons."); + this.#disableProcessItems = true; + return; + } + if (item.str === undefined) { + if (item.type === "beginMarkedContentProps" || item.type === "beginMarkedContent") { + const parent = this.#container; + this.#container = document.createElement("span"); + this.#container.classList.add("markedContent"); + if (item.id !== null) { + this.#container.setAttribute("id", `${item.id}`); + } + parent.append(this.#container); + } else if (item.type === "endMarkedContent") { + this.#container = this.#container.parentNode; + } + continue; + } + textContentItemsStr.push(item.str); + this.#appendText(item); + } + } + #appendText(geom) { + const textDiv = document.createElement("span"); + const textDivProperties = { + angle: 0, + canvasWidth: 0, + hasText: geom.str !== "", + hasEOL: geom.hasEOL, + fontSize: 0 + }; + this.#textDivs.push(textDiv); + const tx = Util.transform(this.#transform, geom.transform); + let angle = Math.atan2(tx[1], tx[0]); + const style = this.#styleCache[geom.fontName]; + if (style.vertical) { + angle += Math.PI / 2; + } + let fontFamily = this.#fontInspectorEnabled && style.fontSubstitution || style.fontFamily; + fontFamily = TextLayer.fontFamilyMap.get(fontFamily) || fontFamily; + const fontHeight = Math.hypot(tx[2], tx[3]); + const fontAscent = fontHeight * TextLayer.#getAscent(fontFamily, this.#lang); + let left, top; + if (angle === 0) { + left = tx[4]; + top = tx[5] - fontAscent; + } else { + left = tx[4] + fontAscent * Math.sin(angle); + top = tx[5] - fontAscent * Math.cos(angle); + } + const scaleFactorStr = "calc(var(--scale-factor)*"; + const divStyle = textDiv.style; + if (this.#container === this.#rootContainer) { + divStyle.left = `${(100 * left / this.#pageWidth).toFixed(2)}%`; + divStyle.top = `${(100 * top / this.#pageHeight).toFixed(2)}%`; + } else { + divStyle.left = `${scaleFactorStr}${left.toFixed(2)}px)`; + divStyle.top = `${scaleFactorStr}${top.toFixed(2)}px)`; + } + divStyle.fontSize = `${scaleFactorStr}${(TextLayer.#minFontSize * fontHeight).toFixed(2)}px)`; + divStyle.fontFamily = fontFamily; + textDivProperties.fontSize = fontHeight; + textDiv.setAttribute("role", "presentation"); + textDiv.textContent = geom.str; + textDiv.dir = geom.dir; + if (this.#fontInspectorEnabled) { + textDiv.dataset.fontName = style.fontSubstitutionLoadedName || geom.fontName; + } + if (angle !== 0) { + textDivProperties.angle = angle * (180 / Math.PI); + } + let shouldScaleText = false; + if (geom.str.length > 1) { + shouldScaleText = true; + } else if (geom.str !== " " && geom.transform[0] !== geom.transform[3]) { + const absScaleX = Math.abs(geom.transform[0]), + absScaleY = Math.abs(geom.transform[3]); + if (absScaleX !== absScaleY && Math.max(absScaleX, absScaleY) / Math.min(absScaleX, absScaleY) > 1.5) { + shouldScaleText = true; + } + } + if (shouldScaleText) { + textDivProperties.canvasWidth = style.vertical ? geom.height : geom.width; + } + this.#textDivProperties.set(textDiv, textDivProperties); + this.#layoutTextParams.div = textDiv; + this.#layoutTextParams.properties = textDivProperties; + this.#layout(this.#layoutTextParams); + if (textDivProperties.hasText) { + this.#container.append(textDiv); + } + if (textDivProperties.hasEOL) { + const br = document.createElement("br"); + br.setAttribute("role", "presentation"); + this.#container.append(br); + } + } + #layout(params) { + const { + div, + properties, + ctx + } = params; + const { + style + } = div; + let transform = ""; + if (TextLayer.#minFontSize > 1) { + transform = `scale(${1 / TextLayer.#minFontSize})`; + } + if (properties.canvasWidth !== 0 && properties.hasText) { + const { + fontFamily + } = style; + const { + canvasWidth, + fontSize + } = properties; + TextLayer.#ensureCtxFont(ctx, fontSize * this.#scale, fontFamily); + const { + width + } = ctx.measureText(div.textContent); + if (width > 0) { + transform = `scaleX(${canvasWidth * this.#scale / width}) ${transform}`; + } + } + if (properties.angle !== 0) { + transform = `rotate(${properties.angle}deg) ${transform}`; + } + if (transform.length > 0) { + style.transform = transform; + } + } + static cleanup() { + if (this.#pendingTextLayers.size > 0) { + return; + } + this.#ascentCache.clear(); + for (const { + canvas + } of this.#canvasContexts.values()) { + canvas.remove(); + } + this.#canvasContexts.clear(); + } + static #getCtx(lang = null) { + let ctx = this.#canvasContexts.get(lang ||= ""); + if (!ctx) { + const canvas = document.createElement("canvas"); + canvas.className = "hiddenCanvasElement"; + canvas.lang = lang; + document.body.append(canvas); + ctx = canvas.getContext("2d", { + alpha: false, + willReadFrequently: true + }); + this.#canvasContexts.set(lang, ctx); + this.#canvasCtxFonts.set(ctx, { + size: 0, + family: "" + }); + } + return ctx; + } + static #ensureCtxFont(ctx, size, family) { + const cached = this.#canvasCtxFonts.get(ctx); + if (size === cached.size && family === cached.family) { + return; + } + ctx.font = `${size}px ${family}`; + cached.size = size; + cached.family = family; + } + static #ensureMinFontSizeComputed() { + if (this.#minFontSize !== null) { + return; + } + const div = document.createElement("div"); + div.style.opacity = 0; + div.style.lineHeight = 1; + div.style.fontSize = "1px"; + div.style.position = "absolute"; + div.textContent = "X"; + document.body.append(div); + this.#minFontSize = div.getBoundingClientRect().height; + div.remove(); + } + static #getAscent(fontFamily, lang) { + const cachedAscent = this.#ascentCache.get(fontFamily); + if (cachedAscent) { + return cachedAscent; + } + const ctx = this.#getCtx(lang); + ctx.canvas.width = ctx.canvas.height = DEFAULT_FONT_SIZE; + this.#ensureCtxFont(ctx, DEFAULT_FONT_SIZE, fontFamily); + const metrics = ctx.measureText(""); + let ascent = metrics.fontBoundingBoxAscent; + let descent = Math.abs(metrics.fontBoundingBoxDescent); + if (ascent) { + const ratio = ascent / (ascent + descent); + this.#ascentCache.set(fontFamily, ratio); + ctx.canvas.width = ctx.canvas.height = 0; + return ratio; + } + ctx.strokeStyle = "red"; + ctx.clearRect(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE); + ctx.strokeText("g", 0, 0); + let pixels = ctx.getImageData(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE).data; + descent = 0; + for (let i = pixels.length - 1 - 3; i >= 0; i -= 4) { + if (pixels[i] > 0) { + descent = Math.ceil(i / 4 / DEFAULT_FONT_SIZE); + break; + } + } + ctx.clearRect(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE); + ctx.strokeText("A", 0, DEFAULT_FONT_SIZE); + pixels = ctx.getImageData(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE).data; + ascent = 0; + for (let i = 0, ii = pixels.length; i < ii; i += 4) { + if (pixels[i] > 0) { + ascent = DEFAULT_FONT_SIZE - Math.floor(i / 4 / DEFAULT_FONT_SIZE); + break; + } + } + ctx.canvas.width = ctx.canvas.height = 0; + const ratio = ascent ? ascent / (ascent + descent) : DEFAULT_FONT_ASCENT; + this.#ascentCache.set(fontFamily, ratio); + return ratio; + } +} + +;// ./src/display/xfa_text.js +class XfaText { + static textContent(xfa) { + const items = []; + const output = { + items, + styles: Object.create(null) + }; + function walk(node) { + if (!node) { + return; + } + let str = null; + const name = node.name; + if (name === "#text") { + str = node.value; + } else if (!XfaText.shouldBuildText(name)) { + return; + } else if (node?.attributes?.textContent) { + str = node.attributes.textContent; + } else if (node.value) { + str = node.value; + } + if (str !== null) { + items.push({ + str + }); + } + if (!node.children) { + return; + } + for (const child of node.children) { + walk(child); + } + } + walk(xfa); + return output; + } + static shouldBuildText(name) { + return !(name === "textarea" || name === "input" || name === "option" || name === "select"); + } +} + +;// ./src/display/api.js + + + + + + + + + + + + + + + + + + + + +const DEFAULT_RANGE_CHUNK_SIZE = 65536; +const RENDERING_CANCELLED_TIMEOUT = 100; +const DELAYED_CLEANUP_TIMEOUT = 5000; +const DefaultCanvasFactory = isNodeJS ? NodeCanvasFactory : DOMCanvasFactory; +const DefaultCMapReaderFactory = isNodeJS ? NodeCMapReaderFactory : DOMCMapReaderFactory; +const DefaultFilterFactory = isNodeJS ? NodeFilterFactory : DOMFilterFactory; +const DefaultStandardFontDataFactory = isNodeJS ? NodeStandardFontDataFactory : DOMStandardFontDataFactory; +function getDocument(src = {}) { + if (typeof src === "string" || src instanceof URL) { + src = { + url: src + }; + } else if (src instanceof ArrayBuffer || ArrayBuffer.isView(src)) { + src = { + data: src + }; + } + const task = new PDFDocumentLoadingTask(); + const { + docId + } = task; + const url = src.url ? getUrlProp(src.url) : null; + const data = src.data ? getDataProp(src.data) : null; + const httpHeaders = src.httpHeaders || null; + const withCredentials = src.withCredentials === true; + const password = src.password ?? null; + const rangeTransport = src.range instanceof PDFDataRangeTransport ? src.range : null; + const rangeChunkSize = Number.isInteger(src.rangeChunkSize) && src.rangeChunkSize > 0 ? src.rangeChunkSize : DEFAULT_RANGE_CHUNK_SIZE; + let worker = src.worker instanceof PDFWorker ? src.worker : null; + const verbosity = src.verbosity; + const docBaseUrl = typeof src.docBaseUrl === "string" && !isDataScheme(src.docBaseUrl) ? src.docBaseUrl : null; + const cMapUrl = typeof src.cMapUrl === "string" ? src.cMapUrl : null; + const cMapPacked = src.cMapPacked !== false; + const CMapReaderFactory = src.CMapReaderFactory || DefaultCMapReaderFactory; + const standardFontDataUrl = typeof src.standardFontDataUrl === "string" ? src.standardFontDataUrl : null; + const StandardFontDataFactory = src.StandardFontDataFactory || DefaultStandardFontDataFactory; + const ignoreErrors = src.stopAtErrors !== true; + const maxImageSize = Number.isInteger(src.maxImageSize) && src.maxImageSize > -1 ? src.maxImageSize : -1; + const isEvalSupported = src.isEvalSupported !== false; + const isOffscreenCanvasSupported = typeof src.isOffscreenCanvasSupported === "boolean" ? src.isOffscreenCanvasSupported : !isNodeJS; + const isImageDecoderSupported = typeof src.isImageDecoderSupported === "boolean" ? src.isImageDecoderSupported : !isNodeJS && (util_FeatureTest.platform.isFirefox || !globalThis.chrome); + const canvasMaxAreaInBytes = Number.isInteger(src.canvasMaxAreaInBytes) ? src.canvasMaxAreaInBytes : -1; + const disableFontFace = typeof src.disableFontFace === "boolean" ? src.disableFontFace : isNodeJS; + const fontExtraProperties = src.fontExtraProperties === true; + const enableXfa = src.enableXfa === true; + const ownerDocument = src.ownerDocument || globalThis.document; + const disableRange = src.disableRange === true; + const disableStream = src.disableStream === true; + const disableAutoFetch = src.disableAutoFetch === true; + const pdfBug = src.pdfBug === true; + const CanvasFactory = src.CanvasFactory || DefaultCanvasFactory; + const FilterFactory = src.FilterFactory || DefaultFilterFactory; + const enableHWA = src.enableHWA === true; + const length = rangeTransport ? rangeTransport.length : src.length ?? NaN; + const useSystemFonts = typeof src.useSystemFonts === "boolean" ? src.useSystemFonts : !isNodeJS && !disableFontFace; + const useWorkerFetch = typeof src.useWorkerFetch === "boolean" ? src.useWorkerFetch : CMapReaderFactory === DOMCMapReaderFactory && StandardFontDataFactory === DOMStandardFontDataFactory && cMapUrl && standardFontDataUrl && isValidFetchUrl(cMapUrl, document.baseURI) && isValidFetchUrl(standardFontDataUrl, document.baseURI); + const styleElement = null; + setVerbosityLevel(verbosity); + const transportFactory = { + canvasFactory: new CanvasFactory({ + ownerDocument, + enableHWA + }), + filterFactory: new FilterFactory({ + docId, + ownerDocument + }), + cMapReaderFactory: useWorkerFetch ? null : new CMapReaderFactory({ + baseUrl: cMapUrl, + isCompressed: cMapPacked + }), + standardFontDataFactory: useWorkerFetch ? null : new StandardFontDataFactory({ + baseUrl: standardFontDataUrl + }) + }; + if (!worker) { + const workerParams = { + verbosity, + port: GlobalWorkerOptions.workerPort + }; + worker = workerParams.port ? PDFWorker.fromPort(workerParams) : new PDFWorker(workerParams); + task._worker = worker; + } + const docParams = { + docId, + apiVersion: "4.10.38", + data, + password, + disableAutoFetch, + rangeChunkSize, + length, + docBaseUrl, + enableXfa, + evaluatorOptions: { + maxImageSize, + disableFontFace, + ignoreErrors, + isEvalSupported, + isOffscreenCanvasSupported, + isImageDecoderSupported, + canvasMaxAreaInBytes, + fontExtraProperties, + useSystemFonts, + cMapUrl: useWorkerFetch ? cMapUrl : null, + standardFontDataUrl: useWorkerFetch ? standardFontDataUrl : null + } + }; + const transportParams = { + disableFontFace, + fontExtraProperties, + ownerDocument, + pdfBug, + styleElement, + loadingParams: { + disableAutoFetch, + enableXfa + } + }; + worker.promise.then(function () { + if (task.destroyed) { + throw new Error("Loading aborted"); + } + if (worker.destroyed) { + throw new Error("Worker was destroyed"); + } + const workerIdPromise = worker.messageHandler.sendWithPromise("GetDocRequest", docParams, data ? [data.buffer] : null); + let networkStream; + if (rangeTransport) { + networkStream = new PDFDataTransportStream(rangeTransport, { + disableRange, + disableStream + }); + } else if (!data) { + if (!url) { + throw new Error("getDocument - no `url` parameter provided."); + } + let NetworkStream; + if (isNodeJS) { + if (isValidFetchUrl(url)) { + if (typeof fetch === "undefined" || typeof Response === "undefined" || !("body" in Response.prototype)) { + throw new Error("getDocument - the Fetch API was disabled in Node.js, see `--no-experimental-fetch`."); + } + NetworkStream = PDFFetchStream; + } else { + NetworkStream = PDFNodeStream; + } + } else { + NetworkStream = isValidFetchUrl(url) ? PDFFetchStream : PDFNetworkStream; + } + networkStream = new NetworkStream({ + url, + length, + httpHeaders, + withCredentials, + rangeChunkSize, + disableRange, + disableStream + }); + } + return workerIdPromise.then(workerId => { + if (task.destroyed) { + throw new Error("Loading aborted"); + } + if (worker.destroyed) { + throw new Error("Worker was destroyed"); + } + const messageHandler = new MessageHandler(docId, workerId, worker.port); + const transport = new WorkerTransport(messageHandler, task, networkStream, transportParams, transportFactory); + task._transport = transport; + messageHandler.send("Ready", null); + }); + }).catch(task._capability.reject); + return task; +} +function getUrlProp(val) { + if (val instanceof URL) { + return val.href; + } + try { + return new URL(val, window.location).href; + } catch { + if (isNodeJS && typeof val === "string") { + return val; + } + } + throw new Error("Invalid PDF url data: " + "either string or URL-object is expected in the url property."); +} +function getDataProp(val) { + if (isNodeJS && typeof Buffer !== "undefined" && val instanceof Buffer) { + throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`."); + } + if (val instanceof Uint8Array && val.byteLength === val.buffer.byteLength) { + return val; + } + if (typeof val === "string") { + return stringToBytes(val); + } + if (val instanceof ArrayBuffer || ArrayBuffer.isView(val) || typeof val === "object" && !isNaN(val?.length)) { + return new Uint8Array(val); + } + throw new Error("Invalid PDF binary data: either TypedArray, " + "string, or array-like object is expected in the data property."); +} +function isRefProxy(ref) { + return typeof ref === "object" && Number.isInteger(ref?.num) && ref.num >= 0 && Number.isInteger(ref?.gen) && ref.gen >= 0; +} +class PDFDocumentLoadingTask { + static #docId = 0; + constructor() { + this._capability = Promise.withResolvers(); + this._transport = null; + this._worker = null; + this.docId = `d${PDFDocumentLoadingTask.#docId++}`; + this.destroyed = false; + this.onPassword = null; + this.onProgress = null; + } + get promise() { + return this._capability.promise; + } + async destroy() { + this.destroyed = true; + try { + if (this._worker?.port) { + this._worker._pendingDestroy = true; + } + await this._transport?.destroy(); + } catch (ex) { + if (this._worker?.port) { + delete this._worker._pendingDestroy; + } + throw ex; + } + this._transport = null; + this._worker?.destroy(); + this._worker = null; + } +} +class PDFDataRangeTransport { + constructor(length, initialData, progressiveDone = false, contentDispositionFilename = null) { + this.length = length; + this.initialData = initialData; + this.progressiveDone = progressiveDone; + this.contentDispositionFilename = contentDispositionFilename; + this._rangeListeners = []; + this._progressListeners = []; + this._progressiveReadListeners = []; + this._progressiveDoneListeners = []; + this._readyCapability = Promise.withResolvers(); + } + addRangeListener(listener) { + this._rangeListeners.push(listener); + } + addProgressListener(listener) { + this._progressListeners.push(listener); + } + addProgressiveReadListener(listener) { + this._progressiveReadListeners.push(listener); + } + addProgressiveDoneListener(listener) { + this._progressiveDoneListeners.push(listener); + } + onDataRange(begin, chunk) { + for (const listener of this._rangeListeners) { + listener(begin, chunk); + } + } + onDataProgress(loaded, total) { + this._readyCapability.promise.then(() => { + for (const listener of this._progressListeners) { + listener(loaded, total); + } + }); + } + onDataProgressiveRead(chunk) { + this._readyCapability.promise.then(() => { + for (const listener of this._progressiveReadListeners) { + listener(chunk); + } + }); + } + onDataProgressiveDone() { + this._readyCapability.promise.then(() => { + for (const listener of this._progressiveDoneListeners) { + listener(); + } + }); + } + transportReady() { + this._readyCapability.resolve(); + } + requestDataRange(begin, end) { + unreachable("Abstract method PDFDataRangeTransport.requestDataRange"); + } + abort() {} +} +class PDFDocumentProxy { + constructor(pdfInfo, transport) { + this._pdfInfo = pdfInfo; + this._transport = transport; + } + get annotationStorage() { + return this._transport.annotationStorage; + } + get canvasFactory() { + return this._transport.canvasFactory; + } + get filterFactory() { + return this._transport.filterFactory; + } + get numPages() { + return this._pdfInfo.numPages; + } + get fingerprints() { + return this._pdfInfo.fingerprints; + } + get isPureXfa() { + return shadow(this, "isPureXfa", !!this._transport._htmlForXfa); + } + get allXfaHtml() { + return this._transport._htmlForXfa; + } + getPage(pageNumber) { + return this._transport.getPage(pageNumber); + } + getPageIndex(ref) { + return this._transport.getPageIndex(ref); + } + getDestinations() { + return this._transport.getDestinations(); + } + getDestination(id) { + return this._transport.getDestination(id); + } + getPageLabels() { + return this._transport.getPageLabels(); + } + getPageLayout() { + return this._transport.getPageLayout(); + } + getPageMode() { + return this._transport.getPageMode(); + } + getViewerPreferences() { + return this._transport.getViewerPreferences(); + } + getOpenAction() { + return this._transport.getOpenAction(); + } + getAttachments() { + return this._transport.getAttachments(); + } + getJSActions() { + return this._transport.getDocJSActions(); + } + getOutline() { + return this._transport.getOutline(); + } + getOptionalContentConfig({ + intent = "display" + } = {}) { + const { + renderingIntent + } = this._transport.getRenderingIntent(intent); + return this._transport.getOptionalContentConfig(renderingIntent); + } + getPermissions() { + return this._transport.getPermissions(); + } + getMetadata() { + return this._transport.getMetadata(); + } + getMarkInfo() { + return this._transport.getMarkInfo(); + } + getData() { + return this._transport.getData(); + } + saveDocument() { + return this._transport.saveDocument(); + } + getDownloadInfo() { + return this._transport.downloadInfoCapability.promise; + } + cleanup(keepLoadedFonts = false) { + return this._transport.startCleanup(keepLoadedFonts || this.isPureXfa); + } + destroy() { + return this.loadingTask.destroy(); + } + cachedPageNumber(ref) { + return this._transport.cachedPageNumber(ref); + } + get loadingParams() { + return this._transport.loadingParams; + } + get loadingTask() { + return this._transport.loadingTask; + } + getFieldObjects() { + return this._transport.getFieldObjects(); + } + hasJSActions() { + return this._transport.hasJSActions(); + } + getCalculationOrderIds() { + return this._transport.getCalculationOrderIds(); + } +} +class PDFPageProxy { + #delayedCleanupTimeout = null; + #pendingCleanup = false; + constructor(pageIndex, pageInfo, transport, pdfBug = false) { + this._pageIndex = pageIndex; + this._pageInfo = pageInfo; + this._transport = transport; + this._stats = pdfBug ? new StatTimer() : null; + this._pdfBug = pdfBug; + this.commonObjs = transport.commonObjs; + this.objs = new PDFObjects(); + this._maybeCleanupAfterRender = false; + this._intentStates = new Map(); + this.destroyed = false; + } + get pageNumber() { + return this._pageIndex + 1; + } + get rotate() { + return this._pageInfo.rotate; + } + get ref() { + return this._pageInfo.ref; + } + get userUnit() { + return this._pageInfo.userUnit; + } + get view() { + return this._pageInfo.view; + } + getViewport({ + scale, + rotation = this.rotate, + offsetX = 0, + offsetY = 0, + dontFlip = false + } = {}) { + return new PageViewport({ + viewBox: this.view, + userUnit: this.userUnit, + scale, + rotation, + offsetX, + offsetY, + dontFlip + }); + } + getAnnotations({ + intent = "display" + } = {}) { + const { + renderingIntent + } = this._transport.getRenderingIntent(intent); + return this._transport.getAnnotations(this._pageIndex, renderingIntent); + } + getJSActions() { + return this._transport.getPageJSActions(this._pageIndex); + } + get filterFactory() { + return this._transport.filterFactory; + } + get isPureXfa() { + return shadow(this, "isPureXfa", !!this._transport._htmlForXfa); + } + async getXfa() { + return this._transport._htmlForXfa?.children[this._pageIndex] || null; + } + render({ + canvasContext, + viewport, + intent = "display", + annotationMode = AnnotationMode.ENABLE, + transform = null, + background = null, + optionalContentConfigPromise = null, + annotationCanvasMap = null, + pageColors = null, + printAnnotationStorage = null, + isEditing = false + }) { + this._stats?.time("Overall"); + const intentArgs = this._transport.getRenderingIntent(intent, annotationMode, printAnnotationStorage, isEditing); + const { + renderingIntent, + cacheKey + } = intentArgs; + this.#pendingCleanup = false; + this.#abortDelayedCleanup(); + optionalContentConfigPromise ||= this._transport.getOptionalContentConfig(renderingIntent); + let intentState = this._intentStates.get(cacheKey); + if (!intentState) { + intentState = Object.create(null); + this._intentStates.set(cacheKey, intentState); + } + if (intentState.streamReaderCancelTimeout) { + clearTimeout(intentState.streamReaderCancelTimeout); + intentState.streamReaderCancelTimeout = null; + } + const intentPrint = !!(renderingIntent & RenderingIntentFlag.PRINT); + if (!intentState.displayReadyCapability) { + intentState.displayReadyCapability = Promise.withResolvers(); + intentState.operatorList = { + fnArray: [], + argsArray: [], + lastChunk: false, + separateAnnots: null + }; + this._stats?.time("Page Request"); + this._pumpOperatorList(intentArgs); + } + const complete = error => { + intentState.renderTasks.delete(internalRenderTask); + if (this._maybeCleanupAfterRender || intentPrint) { + this.#pendingCleanup = true; + } + this.#tryCleanup(!intentPrint); + if (error) { + internalRenderTask.capability.reject(error); + this._abortOperatorList({ + intentState, + reason: error instanceof Error ? error : new Error(error) + }); + } else { + internalRenderTask.capability.resolve(); + } + if (this._stats) { + this._stats.timeEnd("Rendering"); + this._stats.timeEnd("Overall"); + if (globalThis.Stats?.enabled) { + globalThis.Stats.add(this.pageNumber, this._stats); + } + } + }; + const internalRenderTask = new InternalRenderTask({ + callback: complete, + params: { + canvasContext, + viewport, + transform, + background + }, + objs: this.objs, + commonObjs: this.commonObjs, + annotationCanvasMap, + operatorList: intentState.operatorList, + pageIndex: this._pageIndex, + canvasFactory: this._transport.canvasFactory, + filterFactory: this._transport.filterFactory, + useRequestAnimationFrame: !intentPrint, + pdfBug: this._pdfBug, + pageColors + }); + (intentState.renderTasks ||= new Set()).add(internalRenderTask); + const renderTask = internalRenderTask.task; + Promise.all([intentState.displayReadyCapability.promise, optionalContentConfigPromise]).then(([transparency, optionalContentConfig]) => { + if (this.destroyed) { + complete(); + return; + } + this._stats?.time("Rendering"); + if (!(optionalContentConfig.renderingIntent & renderingIntent)) { + throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` " + "and `PDFDocumentProxy.getOptionalContentConfig` methods."); + } + internalRenderTask.initializeGraphics({ + transparency, + optionalContentConfig + }); + internalRenderTask.operatorListChanged(); + }).catch(complete); + return renderTask; + } + getOperatorList({ + intent = "display", + annotationMode = AnnotationMode.ENABLE, + printAnnotationStorage = null, + isEditing = false + } = {}) { + function operatorListChanged() { + if (intentState.operatorList.lastChunk) { + intentState.opListReadCapability.resolve(intentState.operatorList); + intentState.renderTasks.delete(opListTask); + } + } + const intentArgs = this._transport.getRenderingIntent(intent, annotationMode, printAnnotationStorage, isEditing, true); + let intentState = this._intentStates.get(intentArgs.cacheKey); + if (!intentState) { + intentState = Object.create(null); + this._intentStates.set(intentArgs.cacheKey, intentState); + } + let opListTask; + if (!intentState.opListReadCapability) { + opListTask = Object.create(null); + opListTask.operatorListChanged = operatorListChanged; + intentState.opListReadCapability = Promise.withResolvers(); + (intentState.renderTasks ||= new Set()).add(opListTask); + intentState.operatorList = { + fnArray: [], + argsArray: [], + lastChunk: false, + separateAnnots: null + }; + this._stats?.time("Page Request"); + this._pumpOperatorList(intentArgs); + } + return intentState.opListReadCapability.promise; + } + streamTextContent({ + includeMarkedContent = false, + disableNormalization = false + } = {}) { + const TEXT_CONTENT_CHUNK_SIZE = 100; + return this._transport.messageHandler.sendWithStream("GetTextContent", { + pageIndex: this._pageIndex, + includeMarkedContent: includeMarkedContent === true, + disableNormalization: disableNormalization === true + }, { + highWaterMark: TEXT_CONTENT_CHUNK_SIZE, + size(textContent) { + return textContent.items.length; + } + }); + } + getTextContent(params = {}) { + if (this._transport._htmlForXfa) { + return this.getXfa().then(xfa => XfaText.textContent(xfa)); + } + const readableStream = this.streamTextContent(params); + return new Promise(function (resolve, reject) { + function pump() { + reader.read().then(function ({ + value, + done + }) { + if (done) { + resolve(textContent); + return; + } + textContent.lang ??= value.lang; + Object.assign(textContent.styles, value.styles); + textContent.items.push(...value.items); + pump(); + }, reject); + } + const reader = readableStream.getReader(); + const textContent = { + items: [], + styles: Object.create(null), + lang: null + }; + pump(); + }); + } + getStructTree() { + return this._transport.getStructTree(this._pageIndex); + } + _destroy() { + this.destroyed = true; + const waitOn = []; + for (const intentState of this._intentStates.values()) { + this._abortOperatorList({ + intentState, + reason: new Error("Page was destroyed."), + force: true + }); + if (intentState.opListReadCapability) { + continue; + } + for (const internalRenderTask of intentState.renderTasks) { + waitOn.push(internalRenderTask.completed); + internalRenderTask.cancel(); + } + } + this.objs.clear(); + this.#pendingCleanup = false; + this.#abortDelayedCleanup(); + return Promise.all(waitOn); + } + cleanup(resetStats = false) { + this.#pendingCleanup = true; + const success = this.#tryCleanup(false); + if (resetStats && success) { + this._stats &&= new StatTimer(); + } + return success; + } + #tryCleanup(delayed = false) { + this.#abortDelayedCleanup(); + if (!this.#pendingCleanup || this.destroyed) { + return false; + } + if (delayed) { + this.#delayedCleanupTimeout = setTimeout(() => { + this.#delayedCleanupTimeout = null; + this.#tryCleanup(false); + }, DELAYED_CLEANUP_TIMEOUT); + return false; + } + for (const { + renderTasks, + operatorList + } of this._intentStates.values()) { + if (renderTasks.size > 0 || !operatorList.lastChunk) { + return false; + } + } + this._intentStates.clear(); + this.objs.clear(); + this.#pendingCleanup = false; + return true; + } + #abortDelayedCleanup() { + if (this.#delayedCleanupTimeout) { + clearTimeout(this.#delayedCleanupTimeout); + this.#delayedCleanupTimeout = null; + } + } + _startRenderPage(transparency, cacheKey) { + const intentState = this._intentStates.get(cacheKey); + if (!intentState) { + return; + } + this._stats?.timeEnd("Page Request"); + intentState.displayReadyCapability?.resolve(transparency); + } + _renderPageChunk(operatorListChunk, intentState) { + for (let i = 0, ii = operatorListChunk.length; i < ii; i++) { + intentState.operatorList.fnArray.push(operatorListChunk.fnArray[i]); + intentState.operatorList.argsArray.push(operatorListChunk.argsArray[i]); + } + intentState.operatorList.lastChunk = operatorListChunk.lastChunk; + intentState.operatorList.separateAnnots = operatorListChunk.separateAnnots; + for (const internalRenderTask of intentState.renderTasks) { + internalRenderTask.operatorListChanged(); + } + if (operatorListChunk.lastChunk) { + this.#tryCleanup(true); + } + } + _pumpOperatorList({ + renderingIntent, + cacheKey, + annotationStorageSerializable, + modifiedIds + }) { + const { + map, + transfer + } = annotationStorageSerializable; + const readableStream = this._transport.messageHandler.sendWithStream("GetOperatorList", { + pageIndex: this._pageIndex, + intent: renderingIntent, + cacheKey, + annotationStorage: map, + modifiedIds + }, transfer); + const reader = readableStream.getReader(); + const intentState = this._intentStates.get(cacheKey); + intentState.streamReader = reader; + const pump = () => { + reader.read().then(({ + value, + done + }) => { + if (done) { + intentState.streamReader = null; + return; + } + if (this._transport.destroyed) { + return; + } + this._renderPageChunk(value, intentState); + pump(); + }, reason => { + intentState.streamReader = null; + if (this._transport.destroyed) { + return; + } + if (intentState.operatorList) { + intentState.operatorList.lastChunk = true; + for (const internalRenderTask of intentState.renderTasks) { + internalRenderTask.operatorListChanged(); + } + this.#tryCleanup(true); + } + if (intentState.displayReadyCapability) { + intentState.displayReadyCapability.reject(reason); + } else if (intentState.opListReadCapability) { + intentState.opListReadCapability.reject(reason); + } else { + throw reason; + } + }); + }; + pump(); + } + _abortOperatorList({ + intentState, + reason, + force = false + }) { + if (!intentState.streamReader) { + return; + } + if (intentState.streamReaderCancelTimeout) { + clearTimeout(intentState.streamReaderCancelTimeout); + intentState.streamReaderCancelTimeout = null; + } + if (!force) { + if (intentState.renderTasks.size > 0) { + return; + } + if (reason instanceof RenderingCancelledException) { + let delay = RENDERING_CANCELLED_TIMEOUT; + if (reason.extraDelay > 0 && reason.extraDelay < 1000) { + delay += reason.extraDelay; + } + intentState.streamReaderCancelTimeout = setTimeout(() => { + intentState.streamReaderCancelTimeout = null; + this._abortOperatorList({ + intentState, + reason, + force: true + }); + }, delay); + return; + } + } + intentState.streamReader.cancel(new AbortException(reason.message)).catch(() => {}); + intentState.streamReader = null; + if (this._transport.destroyed) { + return; + } + for (const [curCacheKey, curIntentState] of this._intentStates) { + if (curIntentState === intentState) { + this._intentStates.delete(curCacheKey); + break; + } + } + this.cleanup(); + } + get stats() { + return this._stats; + } +} +class LoopbackPort { + #listeners = new Map(); + #deferred = Promise.resolve(); + postMessage(obj, transfer) { + const event = { + data: structuredClone(obj, transfer ? { + transfer + } : null) + }; + this.#deferred.then(() => { + for (const [listener] of this.#listeners) { + listener.call(this, event); + } + }); + } + addEventListener(name, listener, options = null) { + let rmAbort = null; + if (options?.signal instanceof AbortSignal) { + const { + signal + } = options; + if (signal.aborted) { + warn("LoopbackPort - cannot use an `aborted` signal."); + return; + } + const onAbort = () => this.removeEventListener(name, listener); + rmAbort = () => signal.removeEventListener("abort", onAbort); + signal.addEventListener("abort", onAbort); + } + this.#listeners.set(listener, rmAbort); + } + removeEventListener(name, listener) { + const rmAbort = this.#listeners.get(listener); + rmAbort?.(); + this.#listeners.delete(listener); + } + terminate() { + for (const [, rmAbort] of this.#listeners) { + rmAbort?.(); + } + this.#listeners.clear(); + } +} +class PDFWorker { + static #fakeWorkerId = 0; + static #isWorkerDisabled = false; + static #workerPorts; + static { + if (isNodeJS) { + this.#isWorkerDisabled = true; + GlobalWorkerOptions.workerSrc ||= "./pdf.worker.mjs"; + } + this._isSameOrigin = (baseUrl, otherUrl) => { + let base; + try { + base = new URL(baseUrl); + if (!base.origin || base.origin === "null") { + return false; + } + } catch { + return false; + } + const other = new URL(otherUrl, base); + return base.origin === other.origin; + }; + this._createCDNWrapper = url => { + const wrapper = `await import("${url}");`; + return URL.createObjectURL(new Blob([wrapper], { + type: "text/javascript" + })); + }; + } + constructor({ + name = null, + port = null, + verbosity = getVerbosityLevel() + } = {}) { + this.name = name; + this.destroyed = false; + this.verbosity = verbosity; + this._readyCapability = Promise.withResolvers(); + this._port = null; + this._webWorker = null; + this._messageHandler = null; + if (port) { + if (PDFWorker.#workerPorts?.has(port)) { + throw new Error("Cannot use more than one PDFWorker per port."); + } + (PDFWorker.#workerPorts ||= new WeakMap()).set(port, this); + this._initializeFromPort(port); + return; + } + this._initialize(); + } + get promise() { + return this._readyCapability.promise; + } + #resolve() { + this._readyCapability.resolve(); + this._messageHandler.send("configure", { + verbosity: this.verbosity + }); + } + get port() { + return this._port; + } + get messageHandler() { + return this._messageHandler; + } + _initializeFromPort(port) { + this._port = port; + this._messageHandler = new MessageHandler("main", "worker", port); + this._messageHandler.on("ready", function () {}); + this.#resolve(); + } + _initialize() { + if (PDFWorker.#isWorkerDisabled || PDFWorker.#mainThreadWorkerMessageHandler) { + this._setupFakeWorker(); + return; + } + let { + workerSrc + } = PDFWorker; + try { + if (!PDFWorker._isSameOrigin(window.location.href, workerSrc)) { + workerSrc = PDFWorker._createCDNWrapper(new URL(workerSrc, window.location).href); + } + const worker = new Worker(workerSrc, { + type: "module" + }); + const messageHandler = new MessageHandler("main", "worker", worker); + const terminateEarly = () => { + ac.abort(); + messageHandler.destroy(); + worker.terminate(); + if (this.destroyed) { + this._readyCapability.reject(new Error("Worker was destroyed")); + } else { + this._setupFakeWorker(); + } + }; + const ac = new AbortController(); + worker.addEventListener("error", () => { + if (!this._webWorker) { + terminateEarly(); + } + }, { + signal: ac.signal + }); + messageHandler.on("test", data => { + ac.abort(); + if (this.destroyed || !data) { + terminateEarly(); + return; + } + this._messageHandler = messageHandler; + this._port = worker; + this._webWorker = worker; + this.#resolve(); + }); + messageHandler.on("ready", data => { + ac.abort(); + if (this.destroyed) { + terminateEarly(); + return; + } + try { + sendTest(); + } catch { + this._setupFakeWorker(); + } + }); + const sendTest = () => { + const testObj = new Uint8Array(); + messageHandler.send("test", testObj, [testObj.buffer]); + }; + sendTest(); + return; + } catch { + info("The worker has been disabled."); + } + this._setupFakeWorker(); + } + _setupFakeWorker() { + if (!PDFWorker.#isWorkerDisabled) { + warn("Setting up fake worker."); + PDFWorker.#isWorkerDisabled = true; + } + PDFWorker._setupFakeWorkerGlobal.then(WorkerMessageHandler => { + if (this.destroyed) { + this._readyCapability.reject(new Error("Worker was destroyed")); + return; + } + const port = new LoopbackPort(); + this._port = port; + const id = `fake${PDFWorker.#fakeWorkerId++}`; + const workerHandler = new MessageHandler(id + "_worker", id, port); + WorkerMessageHandler.setup(workerHandler, port); + this._messageHandler = new MessageHandler(id, id + "_worker", port); + this.#resolve(); + }).catch(reason => { + this._readyCapability.reject(new Error(`Setting up fake worker failed: "${reason.message}".`)); + }); + } + destroy() { + this.destroyed = true; + this._webWorker?.terminate(); + this._webWorker = null; + PDFWorker.#workerPorts?.delete(this._port); + this._port = null; + this._messageHandler?.destroy(); + this._messageHandler = null; + } + static fromPort(params) { + if (!params?.port) { + throw new Error("PDFWorker.fromPort - invalid method signature."); + } + const cachedPort = this.#workerPorts?.get(params.port); + if (cachedPort) { + if (cachedPort._pendingDestroy) { + throw new Error("PDFWorker.fromPort - the worker is being destroyed.\n" + "Please remember to await `PDFDocumentLoadingTask.destroy()`-calls."); + } + return cachedPort; + } + return new PDFWorker(params); + } + static get workerSrc() { + if (GlobalWorkerOptions.workerSrc) { + return GlobalWorkerOptions.workerSrc; + } + throw new Error('No "GlobalWorkerOptions.workerSrc" specified.'); + } + static get #mainThreadWorkerMessageHandler() { + try { + return globalThis.pdfjsWorker?.WorkerMessageHandler || null; + } catch { + return null; + } + } + static get _setupFakeWorkerGlobal() { + const loader = async () => { + if (this.#mainThreadWorkerMessageHandler) { + return this.#mainThreadWorkerMessageHandler; + } + const worker = await import(/*webpackIgnore: true*/this.workerSrc); + return worker.WorkerMessageHandler; + }; + return shadow(this, "_setupFakeWorkerGlobal", loader()); + } +} +class WorkerTransport { + #methodPromises = new Map(); + #pageCache = new Map(); + #pagePromises = new Map(); + #pageRefCache = new Map(); + #passwordCapability = null; + constructor(messageHandler, loadingTask, networkStream, params, factory) { + this.messageHandler = messageHandler; + this.loadingTask = loadingTask; + this.commonObjs = new PDFObjects(); + this.fontLoader = new FontLoader({ + ownerDocument: params.ownerDocument, + styleElement: params.styleElement + }); + this.loadingParams = params.loadingParams; + this._params = params; + this.canvasFactory = factory.canvasFactory; + this.filterFactory = factory.filterFactory; + this.cMapReaderFactory = factory.cMapReaderFactory; + this.standardFontDataFactory = factory.standardFontDataFactory; + this.destroyed = false; + this.destroyCapability = null; + this._networkStream = networkStream; + this._fullReader = null; + this._lastProgress = null; + this.downloadInfoCapability = Promise.withResolvers(); + this.setupMessageHandler(); + } + #cacheSimpleMethod(name, data = null) { + const cachedPromise = this.#methodPromises.get(name); + if (cachedPromise) { + return cachedPromise; + } + const promise = this.messageHandler.sendWithPromise(name, data); + this.#methodPromises.set(name, promise); + return promise; + } + get annotationStorage() { + return shadow(this, "annotationStorage", new AnnotationStorage()); + } + getRenderingIntent(intent, annotationMode = AnnotationMode.ENABLE, printAnnotationStorage = null, isEditing = false, isOpList = false) { + let renderingIntent = RenderingIntentFlag.DISPLAY; + let annotationStorageSerializable = SerializableEmpty; + switch (intent) { + case "any": + renderingIntent = RenderingIntentFlag.ANY; + break; + case "display": + break; + case "print": + renderingIntent = RenderingIntentFlag.PRINT; + break; + default: + warn(`getRenderingIntent - invalid intent: ${intent}`); + } + const annotationStorage = renderingIntent & RenderingIntentFlag.PRINT && printAnnotationStorage instanceof PrintAnnotationStorage ? printAnnotationStorage : this.annotationStorage; + switch (annotationMode) { + case AnnotationMode.DISABLE: + renderingIntent += RenderingIntentFlag.ANNOTATIONS_DISABLE; + break; + case AnnotationMode.ENABLE: + break; + case AnnotationMode.ENABLE_FORMS: + renderingIntent += RenderingIntentFlag.ANNOTATIONS_FORMS; + break; + case AnnotationMode.ENABLE_STORAGE: + renderingIntent += RenderingIntentFlag.ANNOTATIONS_STORAGE; + annotationStorageSerializable = annotationStorage.serializable; + break; + default: + warn(`getRenderingIntent - invalid annotationMode: ${annotationMode}`); + } + if (isEditing) { + renderingIntent += RenderingIntentFlag.IS_EDITING; + } + if (isOpList) { + renderingIntent += RenderingIntentFlag.OPLIST; + } + const { + ids: modifiedIds, + hash: modifiedIdsHash + } = annotationStorage.modifiedIds; + const cacheKeyBuf = [renderingIntent, annotationStorageSerializable.hash, modifiedIdsHash]; + return { + renderingIntent, + cacheKey: cacheKeyBuf.join("_"), + annotationStorageSerializable, + modifiedIds + }; + } + destroy() { + if (this.destroyCapability) { + return this.destroyCapability.promise; + } + this.destroyed = true; + this.destroyCapability = Promise.withResolvers(); + this.#passwordCapability?.reject(new Error("Worker was destroyed during onPassword callback")); + const waitOn = []; + for (const page of this.#pageCache.values()) { + waitOn.push(page._destroy()); + } + this.#pageCache.clear(); + this.#pagePromises.clear(); + this.#pageRefCache.clear(); + if (this.hasOwnProperty("annotationStorage")) { + this.annotationStorage.resetModified(); + } + const terminated = this.messageHandler.sendWithPromise("Terminate", null); + waitOn.push(terminated); + Promise.all(waitOn).then(() => { + this.commonObjs.clear(); + this.fontLoader.clear(); + this.#methodPromises.clear(); + this.filterFactory.destroy(); + TextLayer.cleanup(); + this._networkStream?.cancelAllRequests(new AbortException("Worker was terminated.")); + this.messageHandler?.destroy(); + this.messageHandler = null; + this.destroyCapability.resolve(); + }, this.destroyCapability.reject); + return this.destroyCapability.promise; + } + setupMessageHandler() { + const { + messageHandler, + loadingTask + } = this; + messageHandler.on("GetReader", (data, sink) => { + assert(this._networkStream, "GetReader - no `IPDFStream` instance available."); + this._fullReader = this._networkStream.getFullReader(); + this._fullReader.onProgress = evt => { + this._lastProgress = { + loaded: evt.loaded, + total: evt.total + }; + }; + sink.onPull = () => { + this._fullReader.read().then(function ({ + value, + done + }) { + if (done) { + sink.close(); + return; + } + assert(value instanceof ArrayBuffer, "GetReader - expected an ArrayBuffer."); + sink.enqueue(new Uint8Array(value), 1, [value]); + }).catch(reason => { + sink.error(reason); + }); + }; + sink.onCancel = reason => { + this._fullReader.cancel(reason); + sink.ready.catch(readyReason => { + if (this.destroyed) { + return; + } + throw readyReason; + }); + }; + }); + messageHandler.on("ReaderHeadersReady", async data => { + await this._fullReader.headersReady; + const { + isStreamingSupported, + isRangeSupported, + contentLength + } = this._fullReader; + if (!isStreamingSupported || !isRangeSupported) { + if (this._lastProgress) { + loadingTask.onProgress?.(this._lastProgress); + } + this._fullReader.onProgress = evt => { + loadingTask.onProgress?.({ + loaded: evt.loaded, + total: evt.total + }); + }; + } + return { + isStreamingSupported, + isRangeSupported, + contentLength + }; + }); + messageHandler.on("GetRangeReader", (data, sink) => { + assert(this._networkStream, "GetRangeReader - no `IPDFStream` instance available."); + const rangeReader = this._networkStream.getRangeReader(data.begin, data.end); + if (!rangeReader) { + sink.close(); + return; + } + sink.onPull = () => { + rangeReader.read().then(function ({ + value, + done + }) { + if (done) { + sink.close(); + return; + } + assert(value instanceof ArrayBuffer, "GetRangeReader - expected an ArrayBuffer."); + sink.enqueue(new Uint8Array(value), 1, [value]); + }).catch(reason => { + sink.error(reason); + }); + }; + sink.onCancel = reason => { + rangeReader.cancel(reason); + sink.ready.catch(readyReason => { + if (this.destroyed) { + return; + } + throw readyReason; + }); + }; + }); + messageHandler.on("GetDoc", ({ + pdfInfo + }) => { + this._numPages = pdfInfo.numPages; + this._htmlForXfa = pdfInfo.htmlForXfa; + delete pdfInfo.htmlForXfa; + loadingTask._capability.resolve(new PDFDocumentProxy(pdfInfo, this)); + }); + messageHandler.on("DocException", ex => { + loadingTask._capability.reject(wrapReason(ex)); + }); + messageHandler.on("PasswordRequest", ex => { + this.#passwordCapability = Promise.withResolvers(); + try { + if (!loadingTask.onPassword) { + throw wrapReason(ex); + } + const updatePassword = password => { + if (password instanceof Error) { + this.#passwordCapability.reject(password); + } else { + this.#passwordCapability.resolve({ + password + }); + } + }; + loadingTask.onPassword(updatePassword, ex.code); + } catch (err) { + this.#passwordCapability.reject(err); + } + return this.#passwordCapability.promise; + }); + messageHandler.on("DataLoaded", data => { + loadingTask.onProgress?.({ + loaded: data.length, + total: data.length + }); + this.downloadInfoCapability.resolve(data); + }); + messageHandler.on("StartRenderPage", data => { + if (this.destroyed) { + return; + } + const page = this.#pageCache.get(data.pageIndex); + page._startRenderPage(data.transparency, data.cacheKey); + }); + messageHandler.on("commonobj", ([id, type, exportedData]) => { + if (this.destroyed) { + return null; + } + if (this.commonObjs.has(id)) { + return null; + } + switch (type) { + case "Font": + const { + disableFontFace, + fontExtraProperties, + pdfBug + } = this._params; + if ("error" in exportedData) { + const exportedError = exportedData.error; + warn(`Error during font loading: ${exportedError}`); + this.commonObjs.resolve(id, exportedError); + break; + } + const inspectFont = pdfBug && globalThis.FontInspector?.enabled ? (font, url) => globalThis.FontInspector.fontAdded(font, url) : null; + const font = new FontFaceObject(exportedData, { + disableFontFace, + fontExtraProperties, + inspectFont + }); + this.fontLoader.bind(font).catch(() => messageHandler.sendWithPromise("FontFallback", { + id + })).finally(() => { + if (!fontExtraProperties && font.data) { + font.data = null; + } + this.commonObjs.resolve(id, font); + }); + break; + case "CopyLocalImage": + const { + imageRef + } = exportedData; + assert(imageRef, "The imageRef must be defined."); + for (const pageProxy of this.#pageCache.values()) { + for (const [, data] of pageProxy.objs) { + if (data?.ref !== imageRef) { + continue; + } + if (!data.dataLen) { + return null; + } + this.commonObjs.resolve(id, structuredClone(data)); + return data.dataLen; + } + } + break; + case "FontPath": + case "Image": + case "Pattern": + this.commonObjs.resolve(id, exportedData); + break; + default: + throw new Error(`Got unknown common object type ${type}`); + } + return null; + }); + messageHandler.on("obj", ([id, pageIndex, type, imageData]) => { + if (this.destroyed) { + return; + } + const pageProxy = this.#pageCache.get(pageIndex); + if (pageProxy.objs.has(id)) { + return; + } + if (pageProxy._intentStates.size === 0) { + imageData?.bitmap?.close(); + return; + } + switch (type) { + case "Image": + pageProxy.objs.resolve(id, imageData); + if (imageData?.dataLen > MAX_IMAGE_SIZE_TO_CACHE) { + pageProxy._maybeCleanupAfterRender = true; + } + break; + case "Pattern": + pageProxy.objs.resolve(id, imageData); + break; + default: + throw new Error(`Got unknown object type ${type}`); + } + }); + messageHandler.on("DocProgress", data => { + if (this.destroyed) { + return; + } + loadingTask.onProgress?.({ + loaded: data.loaded, + total: data.total + }); + }); + messageHandler.on("FetchBuiltInCMap", async data => { + if (this.destroyed) { + throw new Error("Worker was destroyed."); + } + if (!this.cMapReaderFactory) { + throw new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."); + } + return this.cMapReaderFactory.fetch(data); + }); + messageHandler.on("FetchStandardFontData", async data => { + if (this.destroyed) { + throw new Error("Worker was destroyed."); + } + if (!this.standardFontDataFactory) { + throw new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter."); + } + return this.standardFontDataFactory.fetch(data); + }); + } + getData() { + return this.messageHandler.sendWithPromise("GetData", null); + } + saveDocument() { + if (this.annotationStorage.size <= 0) { + warn("saveDocument called while `annotationStorage` is empty, " + "please use the getData-method instead."); + } + const { + map, + transfer + } = this.annotationStorage.serializable; + return this.messageHandler.sendWithPromise("SaveDocument", { + isPureXfa: !!this._htmlForXfa, + numPages: this._numPages, + annotationStorage: map, + filename: this._fullReader?.filename ?? null + }, transfer).finally(() => { + this.annotationStorage.resetModified(); + }); + } + getPage(pageNumber) { + if (!Number.isInteger(pageNumber) || pageNumber <= 0 || pageNumber > this._numPages) { + return Promise.reject(new Error("Invalid page request.")); + } + const pageIndex = pageNumber - 1, + cachedPromise = this.#pagePromises.get(pageIndex); + if (cachedPromise) { + return cachedPromise; + } + const promise = this.messageHandler.sendWithPromise("GetPage", { + pageIndex + }).then(pageInfo => { + if (this.destroyed) { + throw new Error("Transport destroyed"); + } + if (pageInfo.refStr) { + this.#pageRefCache.set(pageInfo.refStr, pageNumber); + } + const page = new PDFPageProxy(pageIndex, pageInfo, this, this._params.pdfBug); + this.#pageCache.set(pageIndex, page); + return page; + }); + this.#pagePromises.set(pageIndex, promise); + return promise; + } + getPageIndex(ref) { + if (!isRefProxy(ref)) { + return Promise.reject(new Error("Invalid pageIndex request.")); + } + return this.messageHandler.sendWithPromise("GetPageIndex", { + num: ref.num, + gen: ref.gen + }); + } + getAnnotations(pageIndex, intent) { + return this.messageHandler.sendWithPromise("GetAnnotations", { + pageIndex, + intent + }); + } + getFieldObjects() { + return this.#cacheSimpleMethod("GetFieldObjects"); + } + hasJSActions() { + return this.#cacheSimpleMethod("HasJSActions"); + } + getCalculationOrderIds() { + return this.messageHandler.sendWithPromise("GetCalculationOrderIds", null); + } + getDestinations() { + return this.messageHandler.sendWithPromise("GetDestinations", null); + } + getDestination(id) { + if (typeof id !== "string") { + return Promise.reject(new Error("Invalid destination request.")); + } + return this.messageHandler.sendWithPromise("GetDestination", { + id + }); + } + getPageLabels() { + return this.messageHandler.sendWithPromise("GetPageLabels", null); + } + getPageLayout() { + return this.messageHandler.sendWithPromise("GetPageLayout", null); + } + getPageMode() { + return this.messageHandler.sendWithPromise("GetPageMode", null); + } + getViewerPreferences() { + return this.messageHandler.sendWithPromise("GetViewerPreferences", null); + } + getOpenAction() { + return this.messageHandler.sendWithPromise("GetOpenAction", null); + } + getAttachments() { + return this.messageHandler.sendWithPromise("GetAttachments", null); + } + getDocJSActions() { + return this.#cacheSimpleMethod("GetDocJSActions"); + } + getPageJSActions(pageIndex) { + return this.messageHandler.sendWithPromise("GetPageJSActions", { + pageIndex + }); + } + getStructTree(pageIndex) { + return this.messageHandler.sendWithPromise("GetStructTree", { + pageIndex + }); + } + getOutline() { + return this.messageHandler.sendWithPromise("GetOutline", null); + } + getOptionalContentConfig(renderingIntent) { + return this.#cacheSimpleMethod("GetOptionalContentConfig").then(data => new OptionalContentConfig(data, renderingIntent)); + } + getPermissions() { + return this.messageHandler.sendWithPromise("GetPermissions", null); + } + getMetadata() { + const name = "GetMetadata", + cachedPromise = this.#methodPromises.get(name); + if (cachedPromise) { + return cachedPromise; + } + const promise = this.messageHandler.sendWithPromise(name, null).then(results => ({ + info: results[0], + metadata: results[1] ? new Metadata(results[1]) : null, + contentDispositionFilename: this._fullReader?.filename ?? null, + contentLength: this._fullReader?.contentLength ?? null + })); + this.#methodPromises.set(name, promise); + return promise; + } + getMarkInfo() { + return this.messageHandler.sendWithPromise("GetMarkInfo", null); + } + async startCleanup(keepLoadedFonts = false) { + if (this.destroyed) { + return; + } + await this.messageHandler.sendWithPromise("Cleanup", null); + for (const page of this.#pageCache.values()) { + const cleanupSuccessful = page.cleanup(); + if (!cleanupSuccessful) { + throw new Error(`startCleanup: Page ${page.pageNumber} is currently rendering.`); + } + } + this.commonObjs.clear(); + if (!keepLoadedFonts) { + this.fontLoader.clear(); + } + this.#methodPromises.clear(); + this.filterFactory.destroy(true); + TextLayer.cleanup(); + } + cachedPageNumber(ref) { + if (!isRefProxy(ref)) { + return null; + } + const refStr = ref.gen === 0 ? `${ref.num}R` : `${ref.num}R${ref.gen}`; + return this.#pageRefCache.get(refStr) ?? null; + } +} +const INITIAL_DATA = Symbol("INITIAL_DATA"); +class PDFObjects { + #objs = Object.create(null); + #ensureObj(objId) { + return this.#objs[objId] ||= { + ...Promise.withResolvers(), + data: INITIAL_DATA + }; + } + get(objId, callback = null) { + if (callback) { + const obj = this.#ensureObj(objId); + obj.promise.then(() => callback(obj.data)); + return null; + } + const obj = this.#objs[objId]; + if (!obj || obj.data === INITIAL_DATA) { + throw new Error(`Requesting object that isn't resolved yet ${objId}.`); + } + return obj.data; + } + has(objId) { + const obj = this.#objs[objId]; + return !!obj && obj.data !== INITIAL_DATA; + } + delete(objId) { + const obj = this.#objs[objId]; + if (!obj || obj.data === INITIAL_DATA) { + return false; + } + delete this.#objs[objId]; + return true; + } + resolve(objId, data = null) { + const obj = this.#ensureObj(objId); + obj.data = data; + obj.resolve(); + } + clear() { + for (const objId in this.#objs) { + const { + data + } = this.#objs[objId]; + data?.bitmap?.close(); + } + this.#objs = Object.create(null); + } + *[Symbol.iterator]() { + for (const objId in this.#objs) { + const { + data + } = this.#objs[objId]; + if (data === INITIAL_DATA) { + continue; + } + yield [objId, data]; + } + } +} +class RenderTask { + #internalRenderTask = null; + constructor(internalRenderTask) { + this.#internalRenderTask = internalRenderTask; + this.onContinue = null; + } + get promise() { + return this.#internalRenderTask.capability.promise; + } + cancel(extraDelay = 0) { + this.#internalRenderTask.cancel(null, extraDelay); + } + get separateAnnots() { + const { + separateAnnots + } = this.#internalRenderTask.operatorList; + if (!separateAnnots) { + return false; + } + const { + annotationCanvasMap + } = this.#internalRenderTask; + return separateAnnots.form || separateAnnots.canvas && annotationCanvasMap?.size > 0; + } +} +class InternalRenderTask { + #rAF = null; + static #canvasInUse = new WeakSet(); + constructor({ + callback, + params, + objs, + commonObjs, + annotationCanvasMap, + operatorList, + pageIndex, + canvasFactory, + filterFactory, + useRequestAnimationFrame = false, + pdfBug = false, + pageColors = null + }) { + this.callback = callback; + this.params = params; + this.objs = objs; + this.commonObjs = commonObjs; + this.annotationCanvasMap = annotationCanvasMap; + this.operatorListIdx = null; + this.operatorList = operatorList; + this._pageIndex = pageIndex; + this.canvasFactory = canvasFactory; + this.filterFactory = filterFactory; + this._pdfBug = pdfBug; + this.pageColors = pageColors; + this.running = false; + this.graphicsReadyCallback = null; + this.graphicsReady = false; + this._useRequestAnimationFrame = useRequestAnimationFrame === true && typeof window !== "undefined"; + this.cancelled = false; + this.capability = Promise.withResolvers(); + this.task = new RenderTask(this); + this._cancelBound = this.cancel.bind(this); + this._continueBound = this._continue.bind(this); + this._scheduleNextBound = this._scheduleNext.bind(this); + this._nextBound = this._next.bind(this); + this._canvas = params.canvasContext.canvas; + } + get completed() { + return this.capability.promise.catch(function () {}); + } + initializeGraphics({ + transparency = false, + optionalContentConfig + }) { + if (this.cancelled) { + return; + } + if (this._canvas) { + if (InternalRenderTask.#canvasInUse.has(this._canvas)) { + throw new Error("Cannot use the same canvas during multiple render() operations. " + "Use different canvas or ensure previous operations were " + "cancelled or completed."); + } + InternalRenderTask.#canvasInUse.add(this._canvas); + } + if (this._pdfBug && globalThis.StepperManager?.enabled) { + this.stepper = globalThis.StepperManager.create(this._pageIndex); + this.stepper.init(this.operatorList); + this.stepper.nextBreakPoint = this.stepper.getNextBreakPoint(); + } + const { + canvasContext, + viewport, + transform, + background + } = this.params; + this.gfx = new CanvasGraphics(canvasContext, this.commonObjs, this.objs, this.canvasFactory, this.filterFactory, { + optionalContentConfig + }, this.annotationCanvasMap, this.pageColors); + this.gfx.beginDrawing({ + transform, + viewport, + transparency, + background + }); + this.operatorListIdx = 0; + this.graphicsReady = true; + this.graphicsReadyCallback?.(); + } + cancel(error = null, extraDelay = 0) { + this.running = false; + this.cancelled = true; + this.gfx?.endDrawing(); + if (this.#rAF) { + window.cancelAnimationFrame(this.#rAF); + this.#rAF = null; + } + InternalRenderTask.#canvasInUse.delete(this._canvas); + this.callback(error || new RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex + 1}`, extraDelay)); + } + operatorListChanged() { + if (!this.graphicsReady) { + this.graphicsReadyCallback ||= this._continueBound; + return; + } + this.stepper?.updateOperatorList(this.operatorList); + if (this.running) { + return; + } + this._continue(); + } + _continue() { + this.running = true; + if (this.cancelled) { + return; + } + if (this.task.onContinue) { + this.task.onContinue(this._scheduleNextBound); + } else { + this._scheduleNext(); + } + } + _scheduleNext() { + if (this._useRequestAnimationFrame) { + this.#rAF = window.requestAnimationFrame(() => { + this.#rAF = null; + this._nextBound().catch(this._cancelBound); + }); + } else { + Promise.resolve().then(this._nextBound).catch(this._cancelBound); + } + } + async _next() { + if (this.cancelled) { + return; + } + this.operatorListIdx = this.gfx.executeOperatorList(this.operatorList, this.operatorListIdx, this._continueBound, this.stepper); + if (this.operatorListIdx === this.operatorList.argsArray.length) { + this.running = false; + if (this.operatorList.lastChunk) { + this.gfx.endDrawing(); + InternalRenderTask.#canvasInUse.delete(this._canvas); + this.callback(); + } + } + } +} +const version = "4.10.38"; +const build = "f9bea397f"; + +;// ./src/shared/scripting_utils.js +function makeColorComp(n) { + return Math.floor(Math.max(0, Math.min(1, n)) * 255).toString(16).padStart(2, "0"); +} +function scaleAndClamp(x) { + return Math.max(0, Math.min(255, 255 * x)); +} +class ColorConverters { + static CMYK_G([c, y, m, k]) { + return ["G", 1 - Math.min(1, 0.3 * c + 0.59 * m + 0.11 * y + k)]; + } + static G_CMYK([g]) { + return ["CMYK", 0, 0, 0, 1 - g]; + } + static G_RGB([g]) { + return ["RGB", g, g, g]; + } + static G_rgb([g]) { + g = scaleAndClamp(g); + return [g, g, g]; + } + static G_HTML([g]) { + const G = makeColorComp(g); + return `#${G}${G}${G}`; + } + static RGB_G([r, g, b]) { + return ["G", 0.3 * r + 0.59 * g + 0.11 * b]; + } + static RGB_rgb(color) { + return color.map(scaleAndClamp); + } + static RGB_HTML(color) { + return `#${color.map(makeColorComp).join("")}`; + } + static T_HTML() { + return "#00000000"; + } + static T_rgb() { + return [null]; + } + static CMYK_RGB([c, y, m, k]) { + return ["RGB", 1 - Math.min(1, c + k), 1 - Math.min(1, m + k), 1 - Math.min(1, y + k)]; + } + static CMYK_rgb([c, y, m, k]) { + return [scaleAndClamp(1 - Math.min(1, c + k)), scaleAndClamp(1 - Math.min(1, m + k)), scaleAndClamp(1 - Math.min(1, y + k))]; + } + static CMYK_HTML(components) { + const rgb = this.CMYK_RGB(components).slice(1); + return this.RGB_HTML(rgb); + } + static RGB_CMYK([r, g, b]) { + const c = 1 - r; + const m = 1 - g; + const y = 1 - b; + const k = Math.min(c, m, y); + return ["CMYK", c, m, y, k]; + } +} + +;// ./src/display/svg_factory.js + + +class BaseSVGFactory { + create(width, height, skipDimensions = false) { + if (width <= 0 || height <= 0) { + throw new Error("Invalid SVG dimensions"); + } + const svg = this._createSVG("svg:svg"); + svg.setAttribute("version", "1.1"); + if (!skipDimensions) { + svg.setAttribute("width", `${width}px`); + svg.setAttribute("height", `${height}px`); + } + svg.setAttribute("preserveAspectRatio", "none"); + svg.setAttribute("viewBox", `0 0 ${width} ${height}`); + return svg; + } + createElement(type) { + if (typeof type !== "string") { + throw new Error("Invalid SVG element type"); + } + return this._createSVG(type); + } + _createSVG(type) { + unreachable("Abstract method `_createSVG` called."); + } +} +class DOMSVGFactory extends BaseSVGFactory { + _createSVG(type) { + return document.createElementNS(SVG_NS, type); + } +} + +;// ./src/display/xfa_layer.js + +class XfaLayer { + static setupStorage(html, id, element, storage, intent) { + const storedData = storage.getValue(id, { + value: null + }); + switch (element.name) { + case "textarea": + if (storedData.value !== null) { + html.textContent = storedData.value; + } + if (intent === "print") { + break; + } + html.addEventListener("input", event => { + storage.setValue(id, { + value: event.target.value + }); + }); + break; + case "input": + if (element.attributes.type === "radio" || element.attributes.type === "checkbox") { + if (storedData.value === element.attributes.xfaOn) { + html.setAttribute("checked", true); + } else if (storedData.value === element.attributes.xfaOff) { + html.removeAttribute("checked"); + } + if (intent === "print") { + break; + } + html.addEventListener("change", event => { + storage.setValue(id, { + value: event.target.checked ? event.target.getAttribute("xfaOn") : event.target.getAttribute("xfaOff") + }); + }); + } else { + if (storedData.value !== null) { + html.setAttribute("value", storedData.value); + } + if (intent === "print") { + break; + } + html.addEventListener("input", event => { + storage.setValue(id, { + value: event.target.value + }); + }); + } + break; + case "select": + if (storedData.value !== null) { + html.setAttribute("value", storedData.value); + for (const option of element.children) { + if (option.attributes.value === storedData.value) { + option.attributes.selected = true; + } else if (option.attributes.hasOwnProperty("selected")) { + delete option.attributes.selected; + } + } + } + html.addEventListener("input", event => { + const options = event.target.options; + const value = options.selectedIndex === -1 ? "" : options[options.selectedIndex].value; + storage.setValue(id, { + value + }); + }); + break; + } + } + static setAttributes({ + html, + element, + storage = null, + intent, + linkService + }) { + const { + attributes + } = element; + const isHTMLAnchorElement = html instanceof HTMLAnchorElement; + if (attributes.type === "radio") { + attributes.name = `${attributes.name}-${intent}`; + } + for (const [key, value] of Object.entries(attributes)) { + if (value === null || value === undefined) { + continue; + } + switch (key) { + case "class": + if (value.length) { + html.setAttribute(key, value.join(" ")); + } + break; + case "dataId": + break; + case "id": + html.setAttribute("data-element-id", value); + break; + case "style": + Object.assign(html.style, value); + break; + case "textContent": + html.textContent = value; + break; + default: + if (!isHTMLAnchorElement || key !== "href" && key !== "newWindow") { + html.setAttribute(key, value); + } + } + } + if (isHTMLAnchorElement) { + linkService.addLinkAttributes(html, attributes.href, attributes.newWindow); + } + if (storage && attributes.dataId) { + this.setupStorage(html, attributes.dataId, element, storage); + } + } + static render(parameters) { + const storage = parameters.annotationStorage; + const linkService = parameters.linkService; + const root = parameters.xfaHtml; + const intent = parameters.intent || "display"; + const rootHtml = document.createElement(root.name); + if (root.attributes) { + this.setAttributes({ + html: rootHtml, + element: root, + intent, + linkService + }); + } + const isNotForRichText = intent !== "richText"; + const rootDiv = parameters.div; + rootDiv.append(rootHtml); + if (parameters.viewport) { + const transform = `matrix(${parameters.viewport.transform.join(",")})`; + rootDiv.style.transform = transform; + } + if (isNotForRichText) { + rootDiv.setAttribute("class", "xfaLayer xfaFont"); + } + const textDivs = []; + if (root.children.length === 0) { + if (root.value) { + const node = document.createTextNode(root.value); + rootHtml.append(node); + if (isNotForRichText && XfaText.shouldBuildText(root.name)) { + textDivs.push(node); + } + } + return { + textDivs + }; + } + const stack = [[root, -1, rootHtml]]; + while (stack.length > 0) { + const [parent, i, html] = stack.at(-1); + if (i + 1 === parent.children.length) { + stack.pop(); + continue; + } + const child = parent.children[++stack.at(-1)[1]]; + if (child === null) { + continue; + } + const { + name + } = child; + if (name === "#text") { + const node = document.createTextNode(child.value); + textDivs.push(node); + html.append(node); + continue; + } + const childHtml = child?.attributes?.xmlns ? document.createElementNS(child.attributes.xmlns, name) : document.createElement(name); + html.append(childHtml); + if (child.attributes) { + this.setAttributes({ + html: childHtml, + element: child, + storage, + intent, + linkService + }); + } + if (child.children?.length > 0) { + stack.push([child, -1, childHtml]); + } else if (child.value) { + const node = document.createTextNode(child.value); + if (isNotForRichText && XfaText.shouldBuildText(name)) { + textDivs.push(node); + } + childHtml.append(node); + } + } + for (const el of rootDiv.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea")) { + el.setAttribute("readOnly", true); + } + return { + textDivs + }; + } + static update(parameters) { + const transform = `matrix(${parameters.viewport.transform.join(",")})`; + parameters.div.style.transform = transform; + parameters.div.hidden = false; + } +} + +;// ./src/display/annotation_layer.js + + + + + + +const DEFAULT_TAB_INDEX = 1000; +const annotation_layer_DEFAULT_FONT_SIZE = 9; +const GetElementsByNameSet = new WeakSet(); +function getRectDims(rect) { + return { + width: rect[2] - rect[0], + height: rect[3] - rect[1] + }; +} +class AnnotationElementFactory { + static create(parameters) { + const subtype = parameters.data.annotationType; + switch (subtype) { + case AnnotationType.LINK: + return new LinkAnnotationElement(parameters); + case AnnotationType.TEXT: + return new TextAnnotationElement(parameters); + case AnnotationType.WIDGET: + const fieldType = parameters.data.fieldType; + switch (fieldType) { + case "Tx": + return new TextWidgetAnnotationElement(parameters); + case "Btn": + if (parameters.data.radioButton) { + return new RadioButtonWidgetAnnotationElement(parameters); + } else if (parameters.data.checkBox) { + return new CheckboxWidgetAnnotationElement(parameters); + } + return new PushButtonWidgetAnnotationElement(parameters); + case "Ch": + return new ChoiceWidgetAnnotationElement(parameters); + case "Sig": + return new SignatureWidgetAnnotationElement(parameters); + } + return new WidgetAnnotationElement(parameters); + case AnnotationType.POPUP: + return new PopupAnnotationElement(parameters); + case AnnotationType.FREETEXT: + return new FreeTextAnnotationElement(parameters); + case AnnotationType.LINE: + return new LineAnnotationElement(parameters); + case AnnotationType.SQUARE: + return new SquareAnnotationElement(parameters); + case AnnotationType.CIRCLE: + return new CircleAnnotationElement(parameters); + case AnnotationType.POLYLINE: + return new PolylineAnnotationElement(parameters); + case AnnotationType.CARET: + return new CaretAnnotationElement(parameters); + case AnnotationType.INK: + return new InkAnnotationElement(parameters); + case AnnotationType.POLYGON: + return new PolygonAnnotationElement(parameters); + case AnnotationType.HIGHLIGHT: + return new HighlightAnnotationElement(parameters); + case AnnotationType.UNDERLINE: + return new UnderlineAnnotationElement(parameters); + case AnnotationType.SQUIGGLY: + return new SquigglyAnnotationElement(parameters); + case AnnotationType.STRIKEOUT: + return new StrikeOutAnnotationElement(parameters); + case AnnotationType.STAMP: + return new StampAnnotationElement(parameters); + case AnnotationType.FILEATTACHMENT: + return new FileAttachmentAnnotationElement(parameters); + default: + return new AnnotationElement(parameters); + } + } +} +class AnnotationElement { + #updates = null; + #hasBorder = false; + #popupElement = null; + constructor(parameters, { + isRenderable = false, + ignoreBorder = false, + createQuadrilaterals = false + } = {}) { + this.isRenderable = isRenderable; + this.data = parameters.data; + this.layer = parameters.layer; + this.linkService = parameters.linkService; + this.downloadManager = parameters.downloadManager; + this.imageResourcesPath = parameters.imageResourcesPath; + this.renderForms = parameters.renderForms; + this.svgFactory = parameters.svgFactory; + this.annotationStorage = parameters.annotationStorage; + this.enableScripting = parameters.enableScripting; + this.hasJSActions = parameters.hasJSActions; + this._fieldObjects = parameters.fieldObjects; + this.parent = parameters.parent; + if (isRenderable) { + this.container = this._createContainer(ignoreBorder); + } + if (createQuadrilaterals) { + this._createQuadrilaterals(); + } + } + static _hasPopupData({ + titleObj, + contentsObj, + richText + }) { + return !!(titleObj?.str || contentsObj?.str || richText?.str); + } + get _isEditable() { + return this.data.isEditable; + } + get hasPopupData() { + return AnnotationElement._hasPopupData(this.data); + } + updateEdited(params) { + if (!this.container) { + return; + } + this.#updates ||= { + rect: this.data.rect.slice(0) + }; + const { + rect + } = params; + if (rect) { + this.#setRectEdited(rect); + } + this.#popupElement?.popup.updateEdited(params); + } + resetEdited() { + if (!this.#updates) { + return; + } + this.#setRectEdited(this.#updates.rect); + this.#popupElement?.popup.resetEdited(); + this.#updates = null; + } + #setRectEdited(rect) { + const { + container: { + style + }, + data: { + rect: currentRect, + rotation + }, + parent: { + viewport: { + rawDims: { + pageWidth, + pageHeight, + pageX, + pageY + } + } + } + } = this; + currentRect?.splice(0, 4, ...rect); + const { + width, + height + } = getRectDims(rect); + style.left = `${100 * (rect[0] - pageX) / pageWidth}%`; + style.top = `${100 * (pageHeight - rect[3] + pageY) / pageHeight}%`; + if (rotation === 0) { + style.width = `${100 * width / pageWidth}%`; + style.height = `${100 * height / pageHeight}%`; + } else { + this.setRotation(rotation); + } + } + _createContainer(ignoreBorder) { + const { + data, + parent: { + page, + viewport + } + } = this; + const container = document.createElement("section"); + container.setAttribute("data-annotation-id", data.id); + if (!(this instanceof WidgetAnnotationElement)) { + container.tabIndex = DEFAULT_TAB_INDEX; + } + const { + style + } = container; + style.zIndex = this.parent.zIndex++; + if (data.alternativeText) { + container.title = data.alternativeText; + } + if (data.noRotate) { + container.classList.add("norotate"); + } + if (!data.rect || this instanceof PopupAnnotationElement) { + const { + rotation + } = data; + if (!data.hasOwnCanvas && rotation !== 0) { + this.setRotation(rotation, container); + } + return container; + } + const { + width, + height + } = getRectDims(data.rect); + if (!ignoreBorder && data.borderStyle.width > 0) { + style.borderWidth = `${data.borderStyle.width}px`; + const horizontalRadius = data.borderStyle.horizontalCornerRadius; + const verticalRadius = data.borderStyle.verticalCornerRadius; + if (horizontalRadius > 0 || verticalRadius > 0) { + const radius = `calc(${horizontalRadius}px * var(--scale-factor)) / calc(${verticalRadius}px * var(--scale-factor))`; + style.borderRadius = radius; + } else if (this instanceof RadioButtonWidgetAnnotationElement) { + const radius = `calc(${width}px * var(--scale-factor)) / calc(${height}px * var(--scale-factor))`; + style.borderRadius = radius; + } + switch (data.borderStyle.style) { + case AnnotationBorderStyleType.SOLID: + style.borderStyle = "solid"; + break; + case AnnotationBorderStyleType.DASHED: + style.borderStyle = "dashed"; + break; + case AnnotationBorderStyleType.BEVELED: + warn("Unimplemented border style: beveled"); + break; + case AnnotationBorderStyleType.INSET: + warn("Unimplemented border style: inset"); + break; + case AnnotationBorderStyleType.UNDERLINE: + style.borderBottomStyle = "solid"; + break; + default: + break; + } + const borderColor = data.borderColor || null; + if (borderColor) { + this.#hasBorder = true; + style.borderColor = Util.makeHexColor(borderColor[0] | 0, borderColor[1] | 0, borderColor[2] | 0); + } else { + style.borderWidth = 0; + } + } + const rect = Util.normalizeRect([data.rect[0], page.view[3] - data.rect[1] + page.view[1], data.rect[2], page.view[3] - data.rect[3] + page.view[1]]); + const { + pageWidth, + pageHeight, + pageX, + pageY + } = viewport.rawDims; + style.left = `${100 * (rect[0] - pageX) / pageWidth}%`; + style.top = `${100 * (rect[1] - pageY) / pageHeight}%`; + const { + rotation + } = data; + if (data.hasOwnCanvas || rotation === 0) { + style.width = `${100 * width / pageWidth}%`; + style.height = `${100 * height / pageHeight}%`; + } else { + this.setRotation(rotation, container); + } + return container; + } + setRotation(angle, container = this.container) { + if (!this.data.rect) { + return; + } + const { + pageWidth, + pageHeight + } = this.parent.viewport.rawDims; + const { + width, + height + } = getRectDims(this.data.rect); + let elementWidth, elementHeight; + if (angle % 180 === 0) { + elementWidth = 100 * width / pageWidth; + elementHeight = 100 * height / pageHeight; + } else { + elementWidth = 100 * height / pageWidth; + elementHeight = 100 * width / pageHeight; + } + container.style.width = `${elementWidth}%`; + container.style.height = `${elementHeight}%`; + container.setAttribute("data-main-rotation", (360 - angle) % 360); + } + get _commonActions() { + const setColor = (jsName, styleName, event) => { + const color = event.detail[jsName]; + const colorType = color[0]; + const colorArray = color.slice(1); + event.target.style[styleName] = ColorConverters[`${colorType}_HTML`](colorArray); + this.annotationStorage.setValue(this.data.id, { + [styleName]: ColorConverters[`${colorType}_rgb`](colorArray) + }); + }; + return shadow(this, "_commonActions", { + display: event => { + const { + display + } = event.detail; + const hidden = display % 2 === 1; + this.container.style.visibility = hidden ? "hidden" : "visible"; + this.annotationStorage.setValue(this.data.id, { + noView: hidden, + noPrint: display === 1 || display === 2 + }); + }, + print: event => { + this.annotationStorage.setValue(this.data.id, { + noPrint: !event.detail.print + }); + }, + hidden: event => { + const { + hidden + } = event.detail; + this.container.style.visibility = hidden ? "hidden" : "visible"; + this.annotationStorage.setValue(this.data.id, { + noPrint: hidden, + noView: hidden + }); + }, + focus: event => { + setTimeout(() => event.target.focus({ + preventScroll: false + }), 0); + }, + userName: event => { + event.target.title = event.detail.userName; + }, + readonly: event => { + event.target.disabled = event.detail.readonly; + }, + required: event => { + this._setRequired(event.target, event.detail.required); + }, + bgColor: event => { + setColor("bgColor", "backgroundColor", event); + }, + fillColor: event => { + setColor("fillColor", "backgroundColor", event); + }, + fgColor: event => { + setColor("fgColor", "color", event); + }, + textColor: event => { + setColor("textColor", "color", event); + }, + borderColor: event => { + setColor("borderColor", "borderColor", event); + }, + strokeColor: event => { + setColor("strokeColor", "borderColor", event); + }, + rotation: event => { + const angle = event.detail.rotation; + this.setRotation(angle); + this.annotationStorage.setValue(this.data.id, { + rotation: angle + }); + } + }); + } + _dispatchEventFromSandbox(actions, jsEvent) { + const commonActions = this._commonActions; + for (const name of Object.keys(jsEvent.detail)) { + const action = actions[name] || commonActions[name]; + action?.(jsEvent); + } + } + _setDefaultPropertiesFromJS(element) { + if (!this.enableScripting) { + return; + } + const storedData = this.annotationStorage.getRawValue(this.data.id); + if (!storedData) { + return; + } + const commonActions = this._commonActions; + for (const [actionName, detail] of Object.entries(storedData)) { + const action = commonActions[actionName]; + if (action) { + const eventProxy = { + detail: { + [actionName]: detail + }, + target: element + }; + action(eventProxy); + delete storedData[actionName]; + } + } + } + _createQuadrilaterals() { + if (!this.container) { + return; + } + const { + quadPoints + } = this.data; + if (!quadPoints) { + return; + } + const [rectBlX, rectBlY, rectTrX, rectTrY] = this.data.rect.map(x => Math.fround(x)); + if (quadPoints.length === 8) { + const [trX, trY, blX, blY] = quadPoints.subarray(2, 6); + if (rectTrX === trX && rectTrY === trY && rectBlX === blX && rectBlY === blY) { + return; + } + } + const { + style + } = this.container; + let svgBuffer; + if (this.#hasBorder) { + const { + borderColor, + borderWidth + } = style; + style.borderWidth = 0; + svgBuffer = ["url('data:image/svg+xml;utf8,", ``, ``]; + this.container.classList.add("hasBorder"); + } + const width = rectTrX - rectBlX; + const height = rectTrY - rectBlY; + const { + svgFactory + } = this; + const svg = svgFactory.createElement("svg"); + svg.classList.add("quadrilateralsContainer"); + svg.setAttribute("width", 0); + svg.setAttribute("height", 0); + const defs = svgFactory.createElement("defs"); + svg.append(defs); + const clipPath = svgFactory.createElement("clipPath"); + const id = `clippath_${this.data.id}`; + clipPath.setAttribute("id", id); + clipPath.setAttribute("clipPathUnits", "objectBoundingBox"); + defs.append(clipPath); + for (let i = 2, ii = quadPoints.length; i < ii; i += 8) { + const trX = quadPoints[i]; + const trY = quadPoints[i + 1]; + const blX = quadPoints[i + 2]; + const blY = quadPoints[i + 3]; + const rect = svgFactory.createElement("rect"); + const x = (blX - rectBlX) / width; + const y = (rectTrY - trY) / height; + const rectWidth = (trX - blX) / width; + const rectHeight = (trY - blY) / height; + rect.setAttribute("x", x); + rect.setAttribute("y", y); + rect.setAttribute("width", rectWidth); + rect.setAttribute("height", rectHeight); + clipPath.append(rect); + svgBuffer?.push(``); + } + if (this.#hasBorder) { + svgBuffer.push(`')`); + style.backgroundImage = svgBuffer.join(""); + } + this.container.append(svg); + this.container.style.clipPath = `url(#${id})`; + } + _createPopup() { + const { + data + } = this; + const popup = this.#popupElement = new PopupAnnotationElement({ + data: { + color: data.color, + titleObj: data.titleObj, + modificationDate: data.modificationDate, + contentsObj: data.contentsObj, + richText: data.richText, + parentRect: data.rect, + borderStyle: 0, + id: `popup_${data.id}`, + rotation: data.rotation + }, + parent: this.parent, + elements: [this] + }); + this.parent.div.append(popup.render()); + } + render() { + unreachable("Abstract method `AnnotationElement.render` called"); + } + _getElementsByName(name, skipId = null) { + const fields = []; + if (this._fieldObjects) { + const fieldObj = this._fieldObjects[name]; + if (fieldObj) { + for (const { + page, + id, + exportValues + } of fieldObj) { + if (page === -1) { + continue; + } + if (id === skipId) { + continue; + } + const exportValue = typeof exportValues === "string" ? exportValues : null; + const domElement = document.querySelector(`[data-element-id="${id}"]`); + if (domElement && !GetElementsByNameSet.has(domElement)) { + warn(`_getElementsByName - element not allowed: ${id}`); + continue; + } + fields.push({ + id, + exportValue, + domElement + }); + } + } + return fields; + } + for (const domElement of document.getElementsByName(name)) { + const { + exportValue + } = domElement; + const id = domElement.getAttribute("data-element-id"); + if (id === skipId) { + continue; + } + if (!GetElementsByNameSet.has(domElement)) { + continue; + } + fields.push({ + id, + exportValue, + domElement + }); + } + return fields; + } + show() { + if (this.container) { + this.container.hidden = false; + } + this.popup?.maybeShow(); + } + hide() { + if (this.container) { + this.container.hidden = true; + } + this.popup?.forceHide(); + } + getElementsToTriggerPopup() { + return this.container; + } + addHighlightArea() { + const triggers = this.getElementsToTriggerPopup(); + if (Array.isArray(triggers)) { + for (const element of triggers) { + element.classList.add("highlightArea"); + } + } else { + triggers.classList.add("highlightArea"); + } + } + _editOnDoubleClick() { + if (!this._isEditable) { + return; + } + const { + annotationEditorType: mode, + data: { + id: editId + } + } = this; + this.container.addEventListener("dblclick", () => { + this.linkService.eventBus?.dispatch("switchannotationeditormode", { + source: this, + mode, + editId + }); + }); + } +} +class LinkAnnotationElement extends AnnotationElement { + constructor(parameters, options = null) { + super(parameters, { + isRenderable: true, + ignoreBorder: !!options?.ignoreBorder, + createQuadrilaterals: true + }); + this.isTooltipOnly = parameters.data.isTooltipOnly; + } + render() { + const { + data, + linkService + } = this; + const link = document.createElement("a"); + link.setAttribute("data-element-id", data.id); + let isBound = false; + if (data.url) { + linkService.addLinkAttributes(link, data.url, data.newWindow); + isBound = true; + } else if (data.action) { + this._bindNamedAction(link, data.action); + isBound = true; + } else if (data.attachment) { + this.#bindAttachment(link, data.attachment, data.attachmentDest); + isBound = true; + } else if (data.setOCGState) { + this.#bindSetOCGState(link, data.setOCGState); + isBound = true; + } else if (data.dest) { + this._bindLink(link, data.dest); + isBound = true; + } else { + if (data.actions && (data.actions.Action || data.actions["Mouse Up"] || data.actions["Mouse Down"]) && this.enableScripting && this.hasJSActions) { + this._bindJSAction(link, data); + isBound = true; + } + if (data.resetForm) { + this._bindResetFormAction(link, data.resetForm); + isBound = true; + } else if (this.isTooltipOnly && !isBound) { + this._bindLink(link, ""); + isBound = true; + } + } + this.container.classList.add("linkAnnotation"); + if (isBound) { + this.container.append(link); + } + return this.container; + } + #setInternalLink() { + this.container.setAttribute("data-internal-link", ""); + } + _bindLink(link, destination) { + link.href = this.linkService.getDestinationHash(destination); + link.onclick = () => { + if (destination) { + this.linkService.goToDestination(destination); + } + return false; + }; + if (destination || destination === "") { + this.#setInternalLink(); + } + } + _bindNamedAction(link, action) { + link.href = this.linkService.getAnchorUrl(""); + link.onclick = () => { + this.linkService.executeNamedAction(action); + return false; + }; + this.#setInternalLink(); + } + #bindAttachment(link, attachment, dest = null) { + link.href = this.linkService.getAnchorUrl(""); + if (attachment.description) { + link.title = attachment.description; + } + link.onclick = () => { + this.downloadManager?.openOrDownloadData(attachment.content, attachment.filename, dest); + return false; + }; + this.#setInternalLink(); + } + #bindSetOCGState(link, action) { + link.href = this.linkService.getAnchorUrl(""); + link.onclick = () => { + this.linkService.executeSetOCGState(action); + return false; + }; + this.#setInternalLink(); + } + _bindJSAction(link, data) { + link.href = this.linkService.getAnchorUrl(""); + const map = new Map([["Action", "onclick"], ["Mouse Up", "onmouseup"], ["Mouse Down", "onmousedown"]]); + for (const name of Object.keys(data.actions)) { + const jsName = map.get(name); + if (!jsName) { + continue; + } + link[jsName] = () => { + this.linkService.eventBus?.dispatch("dispatcheventinsandbox", { + source: this, + detail: { + id: data.id, + name + } + }); + return false; + }; + } + if (!link.onclick) { + link.onclick = () => false; + } + this.#setInternalLink(); + } + _bindResetFormAction(link, resetForm) { + const otherClickAction = link.onclick; + if (!otherClickAction) { + link.href = this.linkService.getAnchorUrl(""); + } + this.#setInternalLink(); + if (!this._fieldObjects) { + warn(`_bindResetFormAction - "resetForm" action not supported, ` + "ensure that the `fieldObjects` parameter is provided."); + if (!otherClickAction) { + link.onclick = () => false; + } + return; + } + link.onclick = () => { + otherClickAction?.(); + const { + fields: resetFormFields, + refs: resetFormRefs, + include + } = resetForm; + const allFields = []; + if (resetFormFields.length !== 0 || resetFormRefs.length !== 0) { + const fieldIds = new Set(resetFormRefs); + for (const fieldName of resetFormFields) { + const fields = this._fieldObjects[fieldName] || []; + for (const { + id + } of fields) { + fieldIds.add(id); + } + } + for (const fields of Object.values(this._fieldObjects)) { + for (const field of fields) { + if (fieldIds.has(field.id) === include) { + allFields.push(field); + } + } + } + } else { + for (const fields of Object.values(this._fieldObjects)) { + allFields.push(...fields); + } + } + const storage = this.annotationStorage; + const allIds = []; + for (const field of allFields) { + const { + id + } = field; + allIds.push(id); + switch (field.type) { + case "text": + { + const value = field.defaultValue || ""; + storage.setValue(id, { + value + }); + break; + } + case "checkbox": + case "radiobutton": + { + const value = field.defaultValue === field.exportValues; + storage.setValue(id, { + value + }); + break; + } + case "combobox": + case "listbox": + { + const value = field.defaultValue || ""; + storage.setValue(id, { + value + }); + break; + } + default: + continue; + } + const domElement = document.querySelector(`[data-element-id="${id}"]`); + if (!domElement) { + continue; + } else if (!GetElementsByNameSet.has(domElement)) { + warn(`_bindResetFormAction - element not allowed: ${id}`); + continue; + } + domElement.dispatchEvent(new Event("resetform")); + } + if (this.enableScripting) { + this.linkService.eventBus?.dispatch("dispatcheventinsandbox", { + source: this, + detail: { + id: "app", + ids: allIds, + name: "ResetForm" + } + }); + } + return false; + }; + } +} +class TextAnnotationElement extends AnnotationElement { + constructor(parameters) { + super(parameters, { + isRenderable: true + }); + } + render() { + this.container.classList.add("textAnnotation"); + const image = document.createElement("img"); + image.src = this.imageResourcesPath + "annotation-" + this.data.name.toLowerCase() + ".svg"; + image.setAttribute("data-l10n-id", "pdfjs-text-annotation-type"); + image.setAttribute("data-l10n-args", JSON.stringify({ + type: this.data.name + })); + if (!this.data.popupRef && this.hasPopupData) { + this._createPopup(); + } + this.container.append(image); + return this.container; + } +} +class WidgetAnnotationElement extends AnnotationElement { + render() { + return this.container; + } + showElementAndHideCanvas(element) { + if (this.data.hasOwnCanvas) { + if (element.previousSibling?.nodeName === "CANVAS") { + element.previousSibling.hidden = true; + } + element.hidden = false; + } + } + _getKeyModifier(event) { + return util_FeatureTest.platform.isMac ? event.metaKey : event.ctrlKey; + } + _setEventListener(element, elementData, baseName, eventName, valueGetter) { + if (baseName.includes("mouse")) { + element.addEventListener(baseName, event => { + this.linkService.eventBus?.dispatch("dispatcheventinsandbox", { + source: this, + detail: { + id: this.data.id, + name: eventName, + value: valueGetter(event), + shift: event.shiftKey, + modifier: this._getKeyModifier(event) + } + }); + }); + } else { + element.addEventListener(baseName, event => { + if (baseName === "blur") { + if (!elementData.focused || !event.relatedTarget) { + return; + } + elementData.focused = false; + } else if (baseName === "focus") { + if (elementData.focused) { + return; + } + elementData.focused = true; + } + if (!valueGetter) { + return; + } + this.linkService.eventBus?.dispatch("dispatcheventinsandbox", { + source: this, + detail: { + id: this.data.id, + name: eventName, + value: valueGetter(event) + } + }); + }); + } + } + _setEventListeners(element, elementData, names, getter) { + for (const [baseName, eventName] of names) { + if (eventName === "Action" || this.data.actions?.[eventName]) { + if (eventName === "Focus" || eventName === "Blur") { + elementData ||= { + focused: false + }; + } + this._setEventListener(element, elementData, baseName, eventName, getter); + if (eventName === "Focus" && !this.data.actions?.Blur) { + this._setEventListener(element, elementData, "blur", "Blur", null); + } else if (eventName === "Blur" && !this.data.actions?.Focus) { + this._setEventListener(element, elementData, "focus", "Focus", null); + } + } + } + } + _setBackgroundColor(element) { + const color = this.data.backgroundColor || null; + element.style.backgroundColor = color === null ? "transparent" : Util.makeHexColor(color[0], color[1], color[2]); + } + _setTextStyle(element) { + const TEXT_ALIGNMENT = ["left", "center", "right"]; + const { + fontColor + } = this.data.defaultAppearanceData; + const fontSize = this.data.defaultAppearanceData.fontSize || annotation_layer_DEFAULT_FONT_SIZE; + const style = element.style; + let computedFontSize; + const BORDER_SIZE = 2; + const roundToOneDecimal = x => Math.round(10 * x) / 10; + if (this.data.multiLine) { + const height = Math.abs(this.data.rect[3] - this.data.rect[1] - BORDER_SIZE); + const numberOfLines = Math.round(height / (LINE_FACTOR * fontSize)) || 1; + const lineHeight = height / numberOfLines; + computedFontSize = Math.min(fontSize, roundToOneDecimal(lineHeight / LINE_FACTOR)); + } else { + const height = Math.abs(this.data.rect[3] - this.data.rect[1] - BORDER_SIZE); + computedFontSize = Math.min(fontSize, roundToOneDecimal(height / LINE_FACTOR)); + } + style.fontSize = `calc(${computedFontSize}px * var(--scale-factor))`; + style.color = Util.makeHexColor(fontColor[0], fontColor[1], fontColor[2]); + if (this.data.textAlignment !== null) { + style.textAlign = TEXT_ALIGNMENT[this.data.textAlignment]; + } + } + _setRequired(element, isRequired) { + if (isRequired) { + element.setAttribute("required", true); + } else { + element.removeAttribute("required"); + } + element.setAttribute("aria-required", isRequired); + } +} +class TextWidgetAnnotationElement extends WidgetAnnotationElement { + constructor(parameters) { + const isRenderable = parameters.renderForms || parameters.data.hasOwnCanvas || !parameters.data.hasAppearance && !!parameters.data.fieldValue; + super(parameters, { + isRenderable + }); + } + setPropertyOnSiblings(base, key, value, keyInStorage) { + const storage = this.annotationStorage; + for (const element of this._getElementsByName(base.name, base.id)) { + if (element.domElement) { + element.domElement[key] = value; + } + storage.setValue(element.id, { + [keyInStorage]: value + }); + } + } + render() { + const storage = this.annotationStorage; + const id = this.data.id; + this.container.classList.add("textWidgetAnnotation"); + let element = null; + if (this.renderForms) { + const storedData = storage.getValue(id, { + value: this.data.fieldValue + }); + let textContent = storedData.value || ""; + const maxLen = storage.getValue(id, { + charLimit: this.data.maxLen + }).charLimit; + if (maxLen && textContent.length > maxLen) { + textContent = textContent.slice(0, maxLen); + } + let fieldFormattedValues = storedData.formattedValue || this.data.textContent?.join("\n") || null; + if (fieldFormattedValues && this.data.comb) { + fieldFormattedValues = fieldFormattedValues.replaceAll(/\s+/g, ""); + } + const elementData = { + userValue: textContent, + formattedValue: fieldFormattedValues, + lastCommittedValue: null, + commitKey: 1, + focused: false + }; + if (this.data.multiLine) { + element = document.createElement("textarea"); + element.textContent = fieldFormattedValues ?? textContent; + if (this.data.doNotScroll) { + element.style.overflowY = "hidden"; + } + } else { + element = document.createElement("input"); + element.type = "text"; + element.setAttribute("value", fieldFormattedValues ?? textContent); + if (this.data.doNotScroll) { + element.style.overflowX = "hidden"; + } + } + if (this.data.hasOwnCanvas) { + element.hidden = true; + } + GetElementsByNameSet.add(element); + element.setAttribute("data-element-id", id); + element.disabled = this.data.readOnly; + element.name = this.data.fieldName; + element.tabIndex = DEFAULT_TAB_INDEX; + this._setRequired(element, this.data.required); + if (maxLen) { + element.maxLength = maxLen; + } + element.addEventListener("input", event => { + storage.setValue(id, { + value: event.target.value + }); + this.setPropertyOnSiblings(element, "value", event.target.value, "value"); + elementData.formattedValue = null; + }); + element.addEventListener("resetform", event => { + const defaultValue = this.data.defaultFieldValue ?? ""; + element.value = elementData.userValue = defaultValue; + elementData.formattedValue = null; + }); + let blurListener = event => { + const { + formattedValue + } = elementData; + if (formattedValue !== null && formattedValue !== undefined) { + event.target.value = formattedValue; + } + event.target.scrollLeft = 0; + }; + if (this.enableScripting && this.hasJSActions) { + element.addEventListener("focus", event => { + if (elementData.focused) { + return; + } + const { + target + } = event; + if (elementData.userValue) { + target.value = elementData.userValue; + } + elementData.lastCommittedValue = target.value; + elementData.commitKey = 1; + if (!this.data.actions?.Focus) { + elementData.focused = true; + } + }); + element.addEventListener("updatefromsandbox", jsEvent => { + this.showElementAndHideCanvas(jsEvent.target); + const actions = { + value(event) { + elementData.userValue = event.detail.value ?? ""; + storage.setValue(id, { + value: elementData.userValue.toString() + }); + event.target.value = elementData.userValue; + }, + formattedValue(event) { + const { + formattedValue + } = event.detail; + elementData.formattedValue = formattedValue; + if (formattedValue !== null && formattedValue !== undefined && event.target !== document.activeElement) { + event.target.value = formattedValue; + } + storage.setValue(id, { + formattedValue + }); + }, + selRange(event) { + event.target.setSelectionRange(...event.detail.selRange); + }, + charLimit: event => { + const { + charLimit + } = event.detail; + const { + target + } = event; + if (charLimit === 0) { + target.removeAttribute("maxLength"); + return; + } + target.setAttribute("maxLength", charLimit); + let value = elementData.userValue; + if (!value || value.length <= charLimit) { + return; + } + value = value.slice(0, charLimit); + target.value = elementData.userValue = value; + storage.setValue(id, { + value + }); + this.linkService.eventBus?.dispatch("dispatcheventinsandbox", { + source: this, + detail: { + id, + name: "Keystroke", + value, + willCommit: true, + commitKey: 1, + selStart: target.selectionStart, + selEnd: target.selectionEnd + } + }); + } + }; + this._dispatchEventFromSandbox(actions, jsEvent); + }); + element.addEventListener("keydown", event => { + elementData.commitKey = 1; + let commitKey = -1; + if (event.key === "Escape") { + commitKey = 0; + } else if (event.key === "Enter" && !this.data.multiLine) { + commitKey = 2; + } else if (event.key === "Tab") { + elementData.commitKey = 3; + } + if (commitKey === -1) { + return; + } + const { + value + } = event.target; + if (elementData.lastCommittedValue === value) { + return; + } + elementData.lastCommittedValue = value; + elementData.userValue = value; + this.linkService.eventBus?.dispatch("dispatcheventinsandbox", { + source: this, + detail: { + id, + name: "Keystroke", + value, + willCommit: true, + commitKey, + selStart: event.target.selectionStart, + selEnd: event.target.selectionEnd + } + }); + }); + const _blurListener = blurListener; + blurListener = null; + element.addEventListener("blur", event => { + if (!elementData.focused || !event.relatedTarget) { + return; + } + if (!this.data.actions?.Blur) { + elementData.focused = false; + } + const { + value + } = event.target; + elementData.userValue = value; + if (elementData.lastCommittedValue !== value) { + this.linkService.eventBus?.dispatch("dispatcheventinsandbox", { + source: this, + detail: { + id, + name: "Keystroke", + value, + willCommit: true, + commitKey: elementData.commitKey, + selStart: event.target.selectionStart, + selEnd: event.target.selectionEnd + } + }); + } + _blurListener(event); + }); + if (this.data.actions?.Keystroke) { + element.addEventListener("beforeinput", event => { + elementData.lastCommittedValue = null; + const { + data, + target + } = event; + const { + value, + selectionStart, + selectionEnd + } = target; + let selStart = selectionStart, + selEnd = selectionEnd; + switch (event.inputType) { + case "deleteWordBackward": + { + const match = value.substring(0, selectionStart).match(/\w*[^\w]*$/); + if (match) { + selStart -= match[0].length; + } + break; + } + case "deleteWordForward": + { + const match = value.substring(selectionStart).match(/^[^\w]*\w*/); + if (match) { + selEnd += match[0].length; + } + break; + } + case "deleteContentBackward": + if (selectionStart === selectionEnd) { + selStart -= 1; + } + break; + case "deleteContentForward": + if (selectionStart === selectionEnd) { + selEnd += 1; + } + break; + } + event.preventDefault(); + this.linkService.eventBus?.dispatch("dispatcheventinsandbox", { + source: this, + detail: { + id, + name: "Keystroke", + value, + change: data || "", + willCommit: false, + selStart, + selEnd + } + }); + }); + } + this._setEventListeners(element, elementData, [["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], event => event.target.value); + } + if (blurListener) { + element.addEventListener("blur", blurListener); + } + if (this.data.comb) { + const fieldWidth = this.data.rect[2] - this.data.rect[0]; + const combWidth = fieldWidth / maxLen; + element.classList.add("comb"); + element.style.letterSpacing = `calc(${combWidth}px * var(--scale-factor) - 1ch)`; + } + } else { + element = document.createElement("div"); + element.textContent = this.data.fieldValue; + element.style.verticalAlign = "middle"; + element.style.display = "table-cell"; + if (this.data.hasOwnCanvas) { + element.hidden = true; + } + } + this._setTextStyle(element); + this._setBackgroundColor(element); + this._setDefaultPropertiesFromJS(element); + this.container.append(element); + return this.container; + } +} +class SignatureWidgetAnnotationElement extends WidgetAnnotationElement { + constructor(parameters) { + super(parameters, { + isRenderable: !!parameters.data.hasOwnCanvas + }); + } +} +class CheckboxWidgetAnnotationElement extends WidgetAnnotationElement { + constructor(parameters) { + super(parameters, { + isRenderable: parameters.renderForms + }); + } + render() { + const storage = this.annotationStorage; + const data = this.data; + const id = data.id; + let value = storage.getValue(id, { + value: data.exportValue === data.fieldValue + }).value; + if (typeof value === "string") { + value = value !== "Off"; + storage.setValue(id, { + value + }); + } + this.container.classList.add("buttonWidgetAnnotation", "checkBox"); + const element = document.createElement("input"); + GetElementsByNameSet.add(element); + element.setAttribute("data-element-id", id); + element.disabled = data.readOnly; + this._setRequired(element, this.data.required); + element.type = "checkbox"; + element.name = data.fieldName; + if (value) { + element.setAttribute("checked", true); + } + element.setAttribute("exportValue", data.exportValue); + element.tabIndex = DEFAULT_TAB_INDEX; + element.addEventListener("change", event => { + const { + name, + checked + } = event.target; + for (const checkbox of this._getElementsByName(name, id)) { + const curChecked = checked && checkbox.exportValue === data.exportValue; + if (checkbox.domElement) { + checkbox.domElement.checked = curChecked; + } + storage.setValue(checkbox.id, { + value: curChecked + }); + } + storage.setValue(id, { + value: checked + }); + }); + element.addEventListener("resetform", event => { + const defaultValue = data.defaultFieldValue || "Off"; + event.target.checked = defaultValue === data.exportValue; + }); + if (this.enableScripting && this.hasJSActions) { + element.addEventListener("updatefromsandbox", jsEvent => { + const actions = { + value(event) { + event.target.checked = event.detail.value !== "Off"; + storage.setValue(id, { + value: event.target.checked + }); + } + }; + this._dispatchEventFromSandbox(actions, jsEvent); + }); + this._setEventListeners(element, null, [["change", "Validate"], ["change", "Action"], ["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], event => event.target.checked); + } + this._setBackgroundColor(element); + this._setDefaultPropertiesFromJS(element); + this.container.append(element); + return this.container; + } +} +class RadioButtonWidgetAnnotationElement extends WidgetAnnotationElement { + constructor(parameters) { + super(parameters, { + isRenderable: parameters.renderForms + }); + } + render() { + this.container.classList.add("buttonWidgetAnnotation", "radioButton"); + const storage = this.annotationStorage; + const data = this.data; + const id = data.id; + let value = storage.getValue(id, { + value: data.fieldValue === data.buttonValue + }).value; + if (typeof value === "string") { + value = value !== data.buttonValue; + storage.setValue(id, { + value + }); + } + if (value) { + for (const radio of this._getElementsByName(data.fieldName, id)) { + storage.setValue(radio.id, { + value: false + }); + } + } + const element = document.createElement("input"); + GetElementsByNameSet.add(element); + element.setAttribute("data-element-id", id); + element.disabled = data.readOnly; + this._setRequired(element, this.data.required); + element.type = "radio"; + element.name = data.fieldName; + if (value) { + element.setAttribute("checked", true); + } + element.tabIndex = DEFAULT_TAB_INDEX; + element.addEventListener("change", event => { + const { + name, + checked + } = event.target; + for (const radio of this._getElementsByName(name, id)) { + storage.setValue(radio.id, { + value: false + }); + } + storage.setValue(id, { + value: checked + }); + }); + element.addEventListener("resetform", event => { + const defaultValue = data.defaultFieldValue; + event.target.checked = defaultValue !== null && defaultValue !== undefined && defaultValue === data.buttonValue; + }); + if (this.enableScripting && this.hasJSActions) { + const pdfButtonValue = data.buttonValue; + element.addEventListener("updatefromsandbox", jsEvent => { + const actions = { + value: event => { + const checked = pdfButtonValue === event.detail.value; + for (const radio of this._getElementsByName(event.target.name)) { + const curChecked = checked && radio.id === id; + if (radio.domElement) { + radio.domElement.checked = curChecked; + } + storage.setValue(radio.id, { + value: curChecked + }); + } + } + }; + this._dispatchEventFromSandbox(actions, jsEvent); + }); + this._setEventListeners(element, null, [["change", "Validate"], ["change", "Action"], ["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], event => event.target.checked); + } + this._setBackgroundColor(element); + this._setDefaultPropertiesFromJS(element); + this.container.append(element); + return this.container; + } +} +class PushButtonWidgetAnnotationElement extends LinkAnnotationElement { + constructor(parameters) { + super(parameters, { + ignoreBorder: parameters.data.hasAppearance + }); + } + render() { + const container = super.render(); + container.classList.add("buttonWidgetAnnotation", "pushButton"); + const linkElement = container.lastChild; + if (this.enableScripting && this.hasJSActions && linkElement) { + this._setDefaultPropertiesFromJS(linkElement); + linkElement.addEventListener("updatefromsandbox", jsEvent => { + this._dispatchEventFromSandbox({}, jsEvent); + }); + } + return container; + } +} +class ChoiceWidgetAnnotationElement extends WidgetAnnotationElement { + constructor(parameters) { + super(parameters, { + isRenderable: parameters.renderForms + }); + } + render() { + this.container.classList.add("choiceWidgetAnnotation"); + const storage = this.annotationStorage; + const id = this.data.id; + const storedData = storage.getValue(id, { + value: this.data.fieldValue + }); + const selectElement = document.createElement("select"); + GetElementsByNameSet.add(selectElement); + selectElement.setAttribute("data-element-id", id); + selectElement.disabled = this.data.readOnly; + this._setRequired(selectElement, this.data.required); + selectElement.name = this.data.fieldName; + selectElement.tabIndex = DEFAULT_TAB_INDEX; + let addAnEmptyEntry = this.data.combo && this.data.options.length > 0; + if (!this.data.combo) { + selectElement.size = this.data.options.length; + if (this.data.multiSelect) { + selectElement.multiple = true; + } + } + selectElement.addEventListener("resetform", event => { + const defaultValue = this.data.defaultFieldValue; + for (const option of selectElement.options) { + option.selected = option.value === defaultValue; + } + }); + for (const option of this.data.options) { + const optionElement = document.createElement("option"); + optionElement.textContent = option.displayValue; + optionElement.value = option.exportValue; + if (storedData.value.includes(option.exportValue)) { + optionElement.setAttribute("selected", true); + addAnEmptyEntry = false; + } + selectElement.append(optionElement); + } + let removeEmptyEntry = null; + if (addAnEmptyEntry) { + const noneOptionElement = document.createElement("option"); + noneOptionElement.value = " "; + noneOptionElement.setAttribute("hidden", true); + noneOptionElement.setAttribute("selected", true); + selectElement.prepend(noneOptionElement); + removeEmptyEntry = () => { + noneOptionElement.remove(); + selectElement.removeEventListener("input", removeEmptyEntry); + removeEmptyEntry = null; + }; + selectElement.addEventListener("input", removeEmptyEntry); + } + const getValue = isExport => { + const name = isExport ? "value" : "textContent"; + const { + options, + multiple + } = selectElement; + if (!multiple) { + return options.selectedIndex === -1 ? null : options[options.selectedIndex][name]; + } + return Array.prototype.filter.call(options, option => option.selected).map(option => option[name]); + }; + let selectedValues = getValue(false); + const getItems = event => { + const options = event.target.options; + return Array.prototype.map.call(options, option => ({ + displayValue: option.textContent, + exportValue: option.value + })); + }; + if (this.enableScripting && this.hasJSActions) { + selectElement.addEventListener("updatefromsandbox", jsEvent => { + const actions = { + value(event) { + removeEmptyEntry?.(); + const value = event.detail.value; + const values = new Set(Array.isArray(value) ? value : [value]); + for (const option of selectElement.options) { + option.selected = values.has(option.value); + } + storage.setValue(id, { + value: getValue(true) + }); + selectedValues = getValue(false); + }, + multipleSelection(event) { + selectElement.multiple = true; + }, + remove(event) { + const options = selectElement.options; + const index = event.detail.remove; + options[index].selected = false; + selectElement.remove(index); + if (options.length > 0) { + const i = Array.prototype.findIndex.call(options, option => option.selected); + if (i === -1) { + options[0].selected = true; + } + } + storage.setValue(id, { + value: getValue(true), + items: getItems(event) + }); + selectedValues = getValue(false); + }, + clear(event) { + while (selectElement.length !== 0) { + selectElement.remove(0); + } + storage.setValue(id, { + value: null, + items: [] + }); + selectedValues = getValue(false); + }, + insert(event) { + const { + index, + displayValue, + exportValue + } = event.detail.insert; + const selectChild = selectElement.children[index]; + const optionElement = document.createElement("option"); + optionElement.textContent = displayValue; + optionElement.value = exportValue; + if (selectChild) { + selectChild.before(optionElement); + } else { + selectElement.append(optionElement); + } + storage.setValue(id, { + value: getValue(true), + items: getItems(event) + }); + selectedValues = getValue(false); + }, + items(event) { + const { + items + } = event.detail; + while (selectElement.length !== 0) { + selectElement.remove(0); + } + for (const item of items) { + const { + displayValue, + exportValue + } = item; + const optionElement = document.createElement("option"); + optionElement.textContent = displayValue; + optionElement.value = exportValue; + selectElement.append(optionElement); + } + if (selectElement.options.length > 0) { + selectElement.options[0].selected = true; + } + storage.setValue(id, { + value: getValue(true), + items: getItems(event) + }); + selectedValues = getValue(false); + }, + indices(event) { + const indices = new Set(event.detail.indices); + for (const option of event.target.options) { + option.selected = indices.has(option.index); + } + storage.setValue(id, { + value: getValue(true) + }); + selectedValues = getValue(false); + }, + editable(event) { + event.target.disabled = !event.detail.editable; + } + }; + this._dispatchEventFromSandbox(actions, jsEvent); + }); + selectElement.addEventListener("input", event => { + const exportValue = getValue(true); + const change = getValue(false); + storage.setValue(id, { + value: exportValue + }); + event.preventDefault(); + this.linkService.eventBus?.dispatch("dispatcheventinsandbox", { + source: this, + detail: { + id, + name: "Keystroke", + value: selectedValues, + change, + changeEx: exportValue, + willCommit: false, + commitKey: 1, + keyDown: false + } + }); + }); + this._setEventListeners(selectElement, null, [["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"], ["input", "Action"], ["input", "Validate"]], event => event.target.value); + } else { + selectElement.addEventListener("input", function (event) { + storage.setValue(id, { + value: getValue(true) + }); + }); + } + if (this.data.combo) { + this._setTextStyle(selectElement); + } else {} + this._setBackgroundColor(selectElement); + this._setDefaultPropertiesFromJS(selectElement); + this.container.append(selectElement); + return this.container; + } +} +class PopupAnnotationElement extends AnnotationElement { + constructor(parameters) { + const { + data, + elements + } = parameters; + super(parameters, { + isRenderable: AnnotationElement._hasPopupData(data) + }); + this.elements = elements; + this.popup = null; + } + render() { + this.container.classList.add("popupAnnotation"); + const popup = this.popup = new PopupElement({ + container: this.container, + color: this.data.color, + titleObj: this.data.titleObj, + modificationDate: this.data.modificationDate, + contentsObj: this.data.contentsObj, + richText: this.data.richText, + rect: this.data.rect, + parentRect: this.data.parentRect || null, + parent: this.parent, + elements: this.elements, + open: this.data.open + }); + const elementIds = []; + for (const element of this.elements) { + element.popup = popup; + element.container.ariaHasPopup = "dialog"; + elementIds.push(element.data.id); + element.addHighlightArea(); + } + this.container.setAttribute("aria-controls", elementIds.map(id => `${AnnotationPrefix}${id}`).join(",")); + return this.container; + } +} +class PopupElement { + #boundKeyDown = this.#keyDown.bind(this); + #boundHide = this.#hide.bind(this); + #boundShow = this.#show.bind(this); + #boundToggle = this.#toggle.bind(this); + #color = null; + #container = null; + #contentsObj = null; + #dateObj = null; + #elements = null; + #parent = null; + #parentRect = null; + #pinned = false; + #popup = null; + #position = null; + #rect = null; + #richText = null; + #titleObj = null; + #updates = null; + #wasVisible = false; + constructor({ + container, + color, + elements, + titleObj, + modificationDate, + contentsObj, + richText, + parent, + rect, + parentRect, + open + }) { + this.#container = container; + this.#titleObj = titleObj; + this.#contentsObj = contentsObj; + this.#richText = richText; + this.#parent = parent; + this.#color = color; + this.#rect = rect; + this.#parentRect = parentRect; + this.#elements = elements; + this.#dateObj = PDFDateString.toDateObject(modificationDate); + this.trigger = elements.flatMap(e => e.getElementsToTriggerPopup()); + for (const element of this.trigger) { + element.addEventListener("click", this.#boundToggle); + element.addEventListener("mouseenter", this.#boundShow); + element.addEventListener("mouseleave", this.#boundHide); + element.classList.add("popupTriggerArea"); + } + for (const element of elements) { + element.container?.addEventListener("keydown", this.#boundKeyDown); + } + this.#container.hidden = true; + if (open) { + this.#toggle(); + } + } + render() { + if (this.#popup) { + return; + } + const popup = this.#popup = document.createElement("div"); + popup.className = "popup"; + if (this.#color) { + const baseColor = popup.style.outlineColor = Util.makeHexColor(...this.#color); + if (CSS.supports("background-color", "color-mix(in srgb, red 30%, white)")) { + popup.style.backgroundColor = `color-mix(in srgb, ${baseColor} 30%, white)`; + } else { + const BACKGROUND_ENLIGHT = 0.7; + popup.style.backgroundColor = Util.makeHexColor(...this.#color.map(c => Math.floor(BACKGROUND_ENLIGHT * (255 - c) + c))); + } + } + const header = document.createElement("span"); + header.className = "header"; + const title = document.createElement("h1"); + header.append(title); + ({ + dir: title.dir, + str: title.textContent + } = this.#titleObj); + popup.append(header); + if (this.#dateObj) { + const modificationDate = document.createElement("span"); + modificationDate.classList.add("popupDate"); + modificationDate.setAttribute("data-l10n-id", "pdfjs-annotation-date-time-string"); + modificationDate.setAttribute("data-l10n-args", JSON.stringify({ + dateObj: this.#dateObj.valueOf() + })); + header.append(modificationDate); + } + const html = this.#html; + if (html) { + XfaLayer.render({ + xfaHtml: html, + intent: "richText", + div: popup + }); + popup.lastChild.classList.add("richText", "popupContent"); + } else { + const contents = this._formatContents(this.#contentsObj); + popup.append(contents); + } + this.#container.append(popup); + } + get #html() { + const richText = this.#richText; + const contentsObj = this.#contentsObj; + if (richText?.str && (!contentsObj?.str || contentsObj.str === richText.str)) { + return this.#richText.html || null; + } + return null; + } + get #fontSize() { + return this.#html?.attributes?.style?.fontSize || 0; + } + get #fontColor() { + return this.#html?.attributes?.style?.color || null; + } + #makePopupContent(text) { + const popupLines = []; + const popupContent = { + str: text, + html: { + name: "div", + attributes: { + dir: "auto" + }, + children: [{ + name: "p", + children: popupLines + }] + } + }; + const lineAttributes = { + style: { + color: this.#fontColor, + fontSize: this.#fontSize ? `calc(${this.#fontSize}px * var(--scale-factor))` : "" + } + }; + for (const line of text.split("\n")) { + popupLines.push({ + name: "span", + value: line, + attributes: lineAttributes + }); + } + return popupContent; + } + _formatContents({ + str, + dir + }) { + const p = document.createElement("p"); + p.classList.add("popupContent"); + p.dir = dir; + const lines = str.split(/(?:\r\n?|\n)/); + for (let i = 0, ii = lines.length; i < ii; ++i) { + const line = lines[i]; + p.append(document.createTextNode(line)); + if (i < ii - 1) { + p.append(document.createElement("br")); + } + } + return p; + } + #keyDown(event) { + if (event.altKey || event.shiftKey || event.ctrlKey || event.metaKey) { + return; + } + if (event.key === "Enter" || event.key === "Escape" && this.#pinned) { + this.#toggle(); + } + } + updateEdited({ + rect, + popupContent + }) { + this.#updates ||= { + contentsObj: this.#contentsObj, + richText: this.#richText + }; + if (rect) { + this.#position = null; + } + if (popupContent) { + this.#richText = this.#makePopupContent(popupContent); + this.#contentsObj = null; + } + this.#popup?.remove(); + this.#popup = null; + } + resetEdited() { + if (!this.#updates) { + return; + } + ({ + contentsObj: this.#contentsObj, + richText: this.#richText + } = this.#updates); + this.#updates = null; + this.#popup?.remove(); + this.#popup = null; + this.#position = null; + } + #setPosition() { + if (this.#position !== null) { + return; + } + const { + page: { + view + }, + viewport: { + rawDims: { + pageWidth, + pageHeight, + pageX, + pageY + } + } + } = this.#parent; + let useParentRect = !!this.#parentRect; + let rect = useParentRect ? this.#parentRect : this.#rect; + for (const element of this.#elements) { + if (!rect || Util.intersect(element.data.rect, rect) !== null) { + rect = element.data.rect; + useParentRect = true; + break; + } + } + const normalizedRect = Util.normalizeRect([rect[0], view[3] - rect[1] + view[1], rect[2], view[3] - rect[3] + view[1]]); + const HORIZONTAL_SPACE_AFTER_ANNOTATION = 5; + const parentWidth = useParentRect ? rect[2] - rect[0] + HORIZONTAL_SPACE_AFTER_ANNOTATION : 0; + const popupLeft = normalizedRect[0] + parentWidth; + const popupTop = normalizedRect[1]; + this.#position = [100 * (popupLeft - pageX) / pageWidth, 100 * (popupTop - pageY) / pageHeight]; + const { + style + } = this.#container; + style.left = `${this.#position[0]}%`; + style.top = `${this.#position[1]}%`; + } + #toggle() { + this.#pinned = !this.#pinned; + if (this.#pinned) { + this.#show(); + this.#container.addEventListener("click", this.#boundToggle); + this.#container.addEventListener("keydown", this.#boundKeyDown); + } else { + this.#hide(); + this.#container.removeEventListener("click", this.#boundToggle); + this.#container.removeEventListener("keydown", this.#boundKeyDown); + } + } + #show() { + if (!this.#popup) { + this.render(); + } + if (!this.isVisible) { + this.#setPosition(); + this.#container.hidden = false; + this.#container.style.zIndex = parseInt(this.#container.style.zIndex) + 1000; + } else if (this.#pinned) { + this.#container.classList.add("focused"); + } + } + #hide() { + this.#container.classList.remove("focused"); + if (this.#pinned || !this.isVisible) { + return; + } + this.#container.hidden = true; + this.#container.style.zIndex = parseInt(this.#container.style.zIndex) - 1000; + } + forceHide() { + this.#wasVisible = this.isVisible; + if (!this.#wasVisible) { + return; + } + this.#container.hidden = true; + } + maybeShow() { + if (!this.#wasVisible) { + return; + } + if (!this.#popup) { + this.#show(); + } + this.#wasVisible = false; + this.#container.hidden = false; + } + get isVisible() { + return this.#container.hidden === false; + } +} +class FreeTextAnnotationElement extends AnnotationElement { + constructor(parameters) { + super(parameters, { + isRenderable: true, + ignoreBorder: true + }); + this.textContent = parameters.data.textContent; + this.textPosition = parameters.data.textPosition; + this.annotationEditorType = AnnotationEditorType.FREETEXT; + } + render() { + this.container.classList.add("freeTextAnnotation"); + if (this.textContent) { + const content = document.createElement("div"); + content.classList.add("annotationTextContent"); + content.setAttribute("role", "comment"); + for (const line of this.textContent) { + const lineSpan = document.createElement("span"); + lineSpan.textContent = line; + content.append(lineSpan); + } + this.container.append(content); + } + if (!this.data.popupRef && this.hasPopupData) { + this._createPopup(); + } + this._editOnDoubleClick(); + return this.container; + } +} +class LineAnnotationElement extends AnnotationElement { + #line = null; + constructor(parameters) { + super(parameters, { + isRenderable: true, + ignoreBorder: true + }); + } + render() { + this.container.classList.add("lineAnnotation"); + const data = this.data; + const { + width, + height + } = getRectDims(data.rect); + const svg = this.svgFactory.create(width, height, true); + const line = this.#line = this.svgFactory.createElement("svg:line"); + line.setAttribute("x1", data.rect[2] - data.lineCoordinates[0]); + line.setAttribute("y1", data.rect[3] - data.lineCoordinates[1]); + line.setAttribute("x2", data.rect[2] - data.lineCoordinates[2]); + line.setAttribute("y2", data.rect[3] - data.lineCoordinates[3]); + line.setAttribute("stroke-width", data.borderStyle.width || 1); + line.setAttribute("stroke", "transparent"); + line.setAttribute("fill", "transparent"); + svg.append(line); + this.container.append(svg); + if (!data.popupRef && this.hasPopupData) { + this._createPopup(); + } + return this.container; + } + getElementsToTriggerPopup() { + return this.#line; + } + addHighlightArea() { + this.container.classList.add("highlightArea"); + } +} +class SquareAnnotationElement extends AnnotationElement { + #square = null; + constructor(parameters) { + super(parameters, { + isRenderable: true, + ignoreBorder: true + }); + } + render() { + this.container.classList.add("squareAnnotation"); + const data = this.data; + const { + width, + height + } = getRectDims(data.rect); + const svg = this.svgFactory.create(width, height, true); + const borderWidth = data.borderStyle.width; + const square = this.#square = this.svgFactory.createElement("svg:rect"); + square.setAttribute("x", borderWidth / 2); + square.setAttribute("y", borderWidth / 2); + square.setAttribute("width", width - borderWidth); + square.setAttribute("height", height - borderWidth); + square.setAttribute("stroke-width", borderWidth || 1); + square.setAttribute("stroke", "transparent"); + square.setAttribute("fill", "transparent"); + svg.append(square); + this.container.append(svg); + if (!data.popupRef && this.hasPopupData) { + this._createPopup(); + } + return this.container; + } + getElementsToTriggerPopup() { + return this.#square; + } + addHighlightArea() { + this.container.classList.add("highlightArea"); + } +} +class CircleAnnotationElement extends AnnotationElement { + #circle = null; + constructor(parameters) { + super(parameters, { + isRenderable: true, + ignoreBorder: true + }); + } + render() { + this.container.classList.add("circleAnnotation"); + const data = this.data; + const { + width, + height + } = getRectDims(data.rect); + const svg = this.svgFactory.create(width, height, true); + const borderWidth = data.borderStyle.width; + const circle = this.#circle = this.svgFactory.createElement("svg:ellipse"); + circle.setAttribute("cx", width / 2); + circle.setAttribute("cy", height / 2); + circle.setAttribute("rx", width / 2 - borderWidth / 2); + circle.setAttribute("ry", height / 2 - borderWidth / 2); + circle.setAttribute("stroke-width", borderWidth || 1); + circle.setAttribute("stroke", "transparent"); + circle.setAttribute("fill", "transparent"); + svg.append(circle); + this.container.append(svg); + if (!data.popupRef && this.hasPopupData) { + this._createPopup(); + } + return this.container; + } + getElementsToTriggerPopup() { + return this.#circle; + } + addHighlightArea() { + this.container.classList.add("highlightArea"); + } +} +class PolylineAnnotationElement extends AnnotationElement { + #polyline = null; + constructor(parameters) { + super(parameters, { + isRenderable: true, + ignoreBorder: true + }); + this.containerClassName = "polylineAnnotation"; + this.svgElementName = "svg:polyline"; + } + render() { + this.container.classList.add(this.containerClassName); + const { + data: { + rect, + vertices, + borderStyle, + popupRef + } + } = this; + if (!vertices) { + return this.container; + } + const { + width, + height + } = getRectDims(rect); + const svg = this.svgFactory.create(width, height, true); + let points = []; + for (let i = 0, ii = vertices.length; i < ii; i += 2) { + const x = vertices[i] - rect[0]; + const y = rect[3] - vertices[i + 1]; + points.push(`${x},${y}`); + } + points = points.join(" "); + const polyline = this.#polyline = this.svgFactory.createElement(this.svgElementName); + polyline.setAttribute("points", points); + polyline.setAttribute("stroke-width", borderStyle.width || 1); + polyline.setAttribute("stroke", "transparent"); + polyline.setAttribute("fill", "transparent"); + svg.append(polyline); + this.container.append(svg); + if (!popupRef && this.hasPopupData) { + this._createPopup(); + } + return this.container; + } + getElementsToTriggerPopup() { + return this.#polyline; + } + addHighlightArea() { + this.container.classList.add("highlightArea"); + } +} +class PolygonAnnotationElement extends PolylineAnnotationElement { + constructor(parameters) { + super(parameters); + this.containerClassName = "polygonAnnotation"; + this.svgElementName = "svg:polygon"; + } +} +class CaretAnnotationElement extends AnnotationElement { + constructor(parameters) { + super(parameters, { + isRenderable: true, + ignoreBorder: true + }); + } + render() { + this.container.classList.add("caretAnnotation"); + if (!this.data.popupRef && this.hasPopupData) { + this._createPopup(); + } + return this.container; + } +} +class InkAnnotationElement extends AnnotationElement { + #polylinesGroupElement = null; + #polylines = []; + constructor(parameters) { + super(parameters, { + isRenderable: true, + ignoreBorder: true + }); + this.containerClassName = "inkAnnotation"; + this.svgElementName = "svg:polyline"; + this.annotationEditorType = this.data.it === "InkHighlight" ? AnnotationEditorType.HIGHLIGHT : AnnotationEditorType.INK; + } + #getTransform(rotation, rect) { + switch (rotation) { + case 90: + return { + transform: `rotate(90) translate(${-rect[0]},${rect[1]}) scale(1,-1)`, + width: rect[3] - rect[1], + height: rect[2] - rect[0] + }; + case 180: + return { + transform: `rotate(180) translate(${-rect[2]},${rect[1]}) scale(1,-1)`, + width: rect[2] - rect[0], + height: rect[3] - rect[1] + }; + case 270: + return { + transform: `rotate(270) translate(${-rect[2]},${rect[3]}) scale(1,-1)`, + width: rect[3] - rect[1], + height: rect[2] - rect[0] + }; + default: + return { + transform: `translate(${-rect[0]},${rect[3]}) scale(1,-1)`, + width: rect[2] - rect[0], + height: rect[3] - rect[1] + }; + } + } + render() { + this.container.classList.add(this.containerClassName); + const { + data: { + rect, + rotation, + inkLists, + borderStyle, + popupRef + } + } = this; + const { + transform, + width, + height + } = this.#getTransform(rotation, rect); + const svg = this.svgFactory.create(width, height, true); + const g = this.#polylinesGroupElement = this.svgFactory.createElement("svg:g"); + svg.append(g); + g.setAttribute("stroke-width", borderStyle.width || 1); + g.setAttribute("stroke-linecap", "round"); + g.setAttribute("stroke-linejoin", "round"); + g.setAttribute("stroke-miterlimit", 10); + g.setAttribute("stroke", "transparent"); + g.setAttribute("fill", "transparent"); + g.setAttribute("transform", transform); + for (let i = 0, ii = inkLists.length; i < ii; i++) { + const polyline = this.svgFactory.createElement(this.svgElementName); + this.#polylines.push(polyline); + polyline.setAttribute("points", inkLists[i].join(",")); + g.append(polyline); + } + if (!popupRef && this.hasPopupData) { + this._createPopup(); + } + this.container.append(svg); + this._editOnDoubleClick(); + return this.container; + } + updateEdited(params) { + super.updateEdited(params); + const { + thickness, + points, + rect + } = params; + const g = this.#polylinesGroupElement; + if (thickness >= 0) { + g.setAttribute("stroke-width", thickness || 1); + } + if (points) { + for (let i = 0, ii = this.#polylines.length; i < ii; i++) { + this.#polylines[i].setAttribute("points", points[i].join(",")); + } + } + if (rect) { + const { + transform, + width, + height + } = this.#getTransform(this.data.rotation, rect); + const root = g.parentElement; + root.setAttribute("viewBox", `0 0 ${width} ${height}`); + g.setAttribute("transform", transform); + } + } + getElementsToTriggerPopup() { + return this.#polylines; + } + addHighlightArea() { + this.container.classList.add("highlightArea"); + } +} +class HighlightAnnotationElement extends AnnotationElement { + constructor(parameters) { + super(parameters, { + isRenderable: true, + ignoreBorder: true, + createQuadrilaterals: true + }); + this.annotationEditorType = AnnotationEditorType.HIGHLIGHT; + } + render() { + if (!this.data.popupRef && this.hasPopupData) { + this._createPopup(); + } + this.container.classList.add("highlightAnnotation"); + this._editOnDoubleClick(); + return this.container; + } +} +class UnderlineAnnotationElement extends AnnotationElement { + constructor(parameters) { + super(parameters, { + isRenderable: true, + ignoreBorder: true, + createQuadrilaterals: true + }); + } + render() { + if (!this.data.popupRef && this.hasPopupData) { + this._createPopup(); + } + this.container.classList.add("underlineAnnotation"); + return this.container; + } +} +class SquigglyAnnotationElement extends AnnotationElement { + constructor(parameters) { + super(parameters, { + isRenderable: true, + ignoreBorder: true, + createQuadrilaterals: true + }); + } + render() { + if (!this.data.popupRef && this.hasPopupData) { + this._createPopup(); + } + this.container.classList.add("squigglyAnnotation"); + return this.container; + } +} +class StrikeOutAnnotationElement extends AnnotationElement { + constructor(parameters) { + super(parameters, { + isRenderable: true, + ignoreBorder: true, + createQuadrilaterals: true + }); + } + render() { + if (!this.data.popupRef && this.hasPopupData) { + this._createPopup(); + } + this.container.classList.add("strikeoutAnnotation"); + return this.container; + } +} +class StampAnnotationElement extends AnnotationElement { + constructor(parameters) { + super(parameters, { + isRenderable: true, + ignoreBorder: true + }); + this.annotationEditorType = AnnotationEditorType.STAMP; + } + render() { + this.container.classList.add("stampAnnotation"); + this.container.setAttribute("role", "img"); + if (!this.data.popupRef && this.hasPopupData) { + this._createPopup(); + } + this._editOnDoubleClick(); + return this.container; + } +} +class FileAttachmentAnnotationElement extends AnnotationElement { + #trigger = null; + constructor(parameters) { + super(parameters, { + isRenderable: true + }); + const { + file + } = this.data; + this.filename = file.filename; + this.content = file.content; + this.linkService.eventBus?.dispatch("fileattachmentannotation", { + source: this, + ...file + }); + } + render() { + this.container.classList.add("fileAttachmentAnnotation"); + const { + container, + data + } = this; + let trigger; + if (data.hasAppearance || data.fillAlpha === 0) { + trigger = document.createElement("div"); + } else { + trigger = document.createElement("img"); + trigger.src = `${this.imageResourcesPath}annotation-${/paperclip/i.test(data.name) ? "paperclip" : "pushpin"}.svg`; + if (data.fillAlpha && data.fillAlpha < 1) { + trigger.style = `filter: opacity(${Math.round(data.fillAlpha * 100)}%);`; + } + } + trigger.addEventListener("dblclick", this.#download.bind(this)); + this.#trigger = trigger; + const { + isMac + } = util_FeatureTest.platform; + container.addEventListener("keydown", evt => { + if (evt.key === "Enter" && (isMac ? evt.metaKey : evt.ctrlKey)) { + this.#download(); + } + }); + if (!data.popupRef && this.hasPopupData) { + this._createPopup(); + } else { + trigger.classList.add("popupTriggerArea"); + } + container.append(trigger); + return container; + } + getElementsToTriggerPopup() { + return this.#trigger; + } + addHighlightArea() { + this.container.classList.add("highlightArea"); + } + #download() { + this.downloadManager?.openOrDownloadData(this.content, this.filename); + } +} +class AnnotationLayer { + #accessibilityManager = null; + #annotationCanvasMap = null; + #editableAnnotations = new Map(); + #structTreeLayer = null; + constructor({ + div, + accessibilityManager, + annotationCanvasMap, + annotationEditorUIManager, + page, + viewport, + structTreeLayer + }) { + this.div = div; + this.#accessibilityManager = accessibilityManager; + this.#annotationCanvasMap = annotationCanvasMap; + this.#structTreeLayer = structTreeLayer || null; + this.page = page; + this.viewport = viewport; + this.zIndex = 0; + this._annotationEditorUIManager = annotationEditorUIManager; + } + hasEditableAnnotations() { + return this.#editableAnnotations.size > 0; + } + async #appendElement(element, id) { + const contentElement = element.firstChild || element; + const annotationId = contentElement.id = `${AnnotationPrefix}${id}`; + const ariaAttributes = await this.#structTreeLayer?.getAriaAttributes(annotationId); + if (ariaAttributes) { + for (const [key, value] of ariaAttributes) { + contentElement.setAttribute(key, value); + } + } + this.div.append(element); + this.#accessibilityManager?.moveElementInDOM(this.div, element, contentElement, false); + } + async render(params) { + const { + annotations + } = params; + const layer = this.div; + setLayerDimensions(layer, this.viewport); + const popupToElements = new Map(); + const elementParams = { + data: null, + layer, + linkService: params.linkService, + downloadManager: params.downloadManager, + imageResourcesPath: params.imageResourcesPath || "", + renderForms: params.renderForms !== false, + svgFactory: new DOMSVGFactory(), + annotationStorage: params.annotationStorage || new AnnotationStorage(), + enableScripting: params.enableScripting === true, + hasJSActions: params.hasJSActions, + fieldObjects: params.fieldObjects, + parent: this, + elements: null + }; + for (const data of annotations) { + if (data.noHTML) { + continue; + } + const isPopupAnnotation = data.annotationType === AnnotationType.POPUP; + if (!isPopupAnnotation) { + const { + width, + height + } = getRectDims(data.rect); + if (width <= 0 || height <= 0) { + continue; + } + } else { + const elements = popupToElements.get(data.id); + if (!elements) { + continue; + } + elementParams.elements = elements; + } + elementParams.data = data; + const element = AnnotationElementFactory.create(elementParams); + if (!element.isRenderable) { + continue; + } + if (!isPopupAnnotation && data.popupRef) { + const elements = popupToElements.get(data.popupRef); + if (!elements) { + popupToElements.set(data.popupRef, [element]); + } else { + elements.push(element); + } + } + const rendered = element.render(); + if (data.hidden) { + rendered.style.visibility = "hidden"; + } + await this.#appendElement(rendered, data.id); + if (element._isEditable) { + this.#editableAnnotations.set(element.data.id, element); + this._annotationEditorUIManager?.renderAnnotationElement(element); + } + } + this.#setAnnotationCanvasMap(); + } + update({ + viewport + }) { + const layer = this.div; + this.viewport = viewport; + setLayerDimensions(layer, { + rotation: viewport.rotation + }); + this.#setAnnotationCanvasMap(); + layer.hidden = false; + } + #setAnnotationCanvasMap() { + if (!this.#annotationCanvasMap) { + return; + } + const layer = this.div; + for (const [id, canvas] of this.#annotationCanvasMap) { + const element = layer.querySelector(`[data-annotation-id="${id}"]`); + if (!element) { + continue; + } + canvas.className = "annotationContent"; + const { + firstChild + } = element; + if (!firstChild) { + element.append(canvas); + } else if (firstChild.nodeName === "CANVAS") { + firstChild.replaceWith(canvas); + } else if (!firstChild.classList.contains("annotationContent")) { + firstChild.before(canvas); + } else { + firstChild.after(canvas); + } + } + this.#annotationCanvasMap.clear(); + } + getEditableAnnotations() { + return Array.from(this.#editableAnnotations.values()); + } + getEditableAnnotation(id) { + return this.#editableAnnotations.get(id); + } +} + +;// ./src/display/editor/freetext.js + + + + +const EOL_PATTERN = /\r\n?|\n/g; +class FreeTextEditor extends AnnotationEditor { + #color; + #content = ""; + #editorDivId = `${this.id}-editor`; + #editModeAC = null; + #fontSize; + static _freeTextDefaultContent = ""; + static _internalPadding = 0; + static _defaultColor = null; + static _defaultFontSize = 10; + static get _keyboardManager() { + const proto = FreeTextEditor.prototype; + const arrowChecker = self => self.isEmpty(); + const small = AnnotationEditorUIManager.TRANSLATE_SMALL; + const big = AnnotationEditorUIManager.TRANSLATE_BIG; + return shadow(this, "_keyboardManager", new KeyboardManager([[["ctrl+s", "mac+meta+s", "ctrl+p", "mac+meta+p"], proto.commitOrRemove, { + bubbles: true + }], [["ctrl+Enter", "mac+meta+Enter", "Escape", "mac+Escape"], proto.commitOrRemove], [["ArrowLeft", "mac+ArrowLeft"], proto._translateEmpty, { + args: [-small, 0], + checker: arrowChecker + }], [["ctrl+ArrowLeft", "mac+shift+ArrowLeft"], proto._translateEmpty, { + args: [-big, 0], + checker: arrowChecker + }], [["ArrowRight", "mac+ArrowRight"], proto._translateEmpty, { + args: [small, 0], + checker: arrowChecker + }], [["ctrl+ArrowRight", "mac+shift+ArrowRight"], proto._translateEmpty, { + args: [big, 0], + checker: arrowChecker + }], [["ArrowUp", "mac+ArrowUp"], proto._translateEmpty, { + args: [0, -small], + checker: arrowChecker + }], [["ctrl+ArrowUp", "mac+shift+ArrowUp"], proto._translateEmpty, { + args: [0, -big], + checker: arrowChecker + }], [["ArrowDown", "mac+ArrowDown"], proto._translateEmpty, { + args: [0, small], + checker: arrowChecker + }], [["ctrl+ArrowDown", "mac+shift+ArrowDown"], proto._translateEmpty, { + args: [0, big], + checker: arrowChecker + }]])); + } + static _type = "freetext"; + static _editorType = AnnotationEditorType.FREETEXT; + constructor(params) { + super({ + ...params, + name: "freeTextEditor" + }); + this.#color = params.color || FreeTextEditor._defaultColor || AnnotationEditor._defaultLineColor; + this.#fontSize = params.fontSize || FreeTextEditor._defaultFontSize; + } + static initialize(l10n, uiManager) { + AnnotationEditor.initialize(l10n, uiManager); + const style = getComputedStyle(document.documentElement); + this._internalPadding = parseFloat(style.getPropertyValue("--freetext-padding")); + } + static updateDefaultParams(type, value) { + switch (type) { + case AnnotationEditorParamsType.FREETEXT_SIZE: + FreeTextEditor._defaultFontSize = value; + break; + case AnnotationEditorParamsType.FREETEXT_COLOR: + FreeTextEditor._defaultColor = value; + break; + } + } + updateParams(type, value) { + switch (type) { + case AnnotationEditorParamsType.FREETEXT_SIZE: + this.#updateFontSize(value); + break; + case AnnotationEditorParamsType.FREETEXT_COLOR: + this.#updateColor(value); + break; + } + } + static get defaultPropertiesToUpdate() { + return [[AnnotationEditorParamsType.FREETEXT_SIZE, FreeTextEditor._defaultFontSize], [AnnotationEditorParamsType.FREETEXT_COLOR, FreeTextEditor._defaultColor || AnnotationEditor._defaultLineColor]]; + } + get propertiesToUpdate() { + return [[AnnotationEditorParamsType.FREETEXT_SIZE, this.#fontSize], [AnnotationEditorParamsType.FREETEXT_COLOR, this.#color]]; + } + #updateFontSize(fontSize) { + const setFontsize = size => { + this.editorDiv.style.fontSize = `calc(${size}px * var(--scale-factor))`; + this.translate(0, -(size - this.#fontSize) * this.parentScale); + this.#fontSize = size; + this.#setEditorDimensions(); + }; + const savedFontsize = this.#fontSize; + this.addCommands({ + cmd: setFontsize.bind(this, fontSize), + undo: setFontsize.bind(this, savedFontsize), + post: this._uiManager.updateUI.bind(this._uiManager, this), + mustExec: true, + type: AnnotationEditorParamsType.FREETEXT_SIZE, + overwriteIfSameType: true, + keepUndo: true + }); + } + #updateColor(color) { + const setColor = col => { + this.#color = this.editorDiv.style.color = col; + }; + const savedColor = this.#color; + this.addCommands({ + cmd: setColor.bind(this, color), + undo: setColor.bind(this, savedColor), + post: this._uiManager.updateUI.bind(this._uiManager, this), + mustExec: true, + type: AnnotationEditorParamsType.FREETEXT_COLOR, + overwriteIfSameType: true, + keepUndo: true + }); + } + _translateEmpty(x, y) { + this._uiManager.translateSelectedEditors(x, y, true); + } + getInitialTranslation() { + const scale = this.parentScale; + return [-FreeTextEditor._internalPadding * scale, -(FreeTextEditor._internalPadding + this.#fontSize) * scale]; + } + rebuild() { + if (!this.parent) { + return; + } + super.rebuild(); + if (this.div === null) { + return; + } + if (!this.isAttachedToDOM) { + this.parent.add(this); + } + } + enableEditMode() { + if (this.isInEditMode()) { + return; + } + this.parent.setEditingState(false); + this.parent.updateToolbar(AnnotationEditorType.FREETEXT); + super.enableEditMode(); + this.overlayDiv.classList.remove("enabled"); + this.editorDiv.contentEditable = true; + this._isDraggable = false; + this.div.removeAttribute("aria-activedescendant"); + this.#editModeAC = new AbortController(); + const signal = this._uiManager.combinedSignal(this.#editModeAC); + this.editorDiv.addEventListener("keydown", this.editorDivKeydown.bind(this), { + signal + }); + this.editorDiv.addEventListener("focus", this.editorDivFocus.bind(this), { + signal + }); + this.editorDiv.addEventListener("blur", this.editorDivBlur.bind(this), { + signal + }); + this.editorDiv.addEventListener("input", this.editorDivInput.bind(this), { + signal + }); + this.editorDiv.addEventListener("paste", this.editorDivPaste.bind(this), { + signal + }); + } + disableEditMode() { + if (!this.isInEditMode()) { + return; + } + this.parent.setEditingState(true); + super.disableEditMode(); + this.overlayDiv.classList.add("enabled"); + this.editorDiv.contentEditable = false; + this.div.setAttribute("aria-activedescendant", this.#editorDivId); + this._isDraggable = true; + this.#editModeAC?.abort(); + this.#editModeAC = null; + this.div.focus({ + preventScroll: true + }); + this.isEditing = false; + this.parent.div.classList.add("freetextEditing"); + } + focusin(event) { + if (!this._focusEventsAllowed) { + return; + } + super.focusin(event); + if (event.target !== this.editorDiv) { + this.editorDiv.focus(); + } + } + onceAdded(focus) { + if (this.width) { + return; + } + this.enableEditMode(); + if (focus) { + this.editorDiv.focus(); + } + if (this._initialOptions?.isCentered) { + this.center(); + } + this._initialOptions = null; + } + isEmpty() { + return !this.editorDiv || this.editorDiv.innerText.trim() === ""; + } + remove() { + this.isEditing = false; + if (this.parent) { + this.parent.setEditingState(true); + this.parent.div.classList.add("freetextEditing"); + } + super.remove(); + } + #extractText() { + const buffer = []; + this.editorDiv.normalize(); + let prevChild = null; + for (const child of this.editorDiv.childNodes) { + if (prevChild?.nodeType === Node.TEXT_NODE && child.nodeName === "BR") { + continue; + } + buffer.push(FreeTextEditor.#getNodeContent(child)); + prevChild = child; + } + return buffer.join("\n"); + } + #setEditorDimensions() { + const [parentWidth, parentHeight] = this.parentDimensions; + let rect; + if (this.isAttachedToDOM) { + rect = this.div.getBoundingClientRect(); + } else { + const { + currentLayer, + div + } = this; + const savedDisplay = div.style.display; + const savedVisibility = div.classList.contains("hidden"); + div.classList.remove("hidden"); + div.style.display = "hidden"; + currentLayer.div.append(this.div); + rect = div.getBoundingClientRect(); + div.remove(); + div.style.display = savedDisplay; + div.classList.toggle("hidden", savedVisibility); + } + if (this.rotation % 180 === this.parentRotation % 180) { + this.width = rect.width / parentWidth; + this.height = rect.height / parentHeight; + } else { + this.width = rect.height / parentWidth; + this.height = rect.width / parentHeight; + } + this.fixAndSetPosition(); + } + commit() { + if (!this.isInEditMode()) { + return; + } + super.commit(); + this.disableEditMode(); + const savedText = this.#content; + const newText = this.#content = this.#extractText().trimEnd(); + if (savedText === newText) { + return; + } + const setText = text => { + this.#content = text; + if (!text) { + this.remove(); + return; + } + this.#setContent(); + this._uiManager.rebuild(this); + this.#setEditorDimensions(); + }; + this.addCommands({ + cmd: () => { + setText(newText); + }, + undo: () => { + setText(savedText); + }, + mustExec: false + }); + this.#setEditorDimensions(); + } + shouldGetKeyboardEvents() { + return this.isInEditMode(); + } + enterInEditMode() { + this.enableEditMode(); + this.editorDiv.focus(); + } + dblclick(event) { + this.enterInEditMode(); + } + keydown(event) { + if (event.target === this.div && event.key === "Enter") { + this.enterInEditMode(); + event.preventDefault(); + } + } + editorDivKeydown(event) { + FreeTextEditor._keyboardManager.exec(this, event); + } + editorDivFocus(event) { + this.isEditing = true; + } + editorDivBlur(event) { + this.isEditing = false; + } + editorDivInput(event) { + this.parent.div.classList.toggle("freetextEditing", this.isEmpty()); + } + disableEditing() { + this.editorDiv.setAttribute("role", "comment"); + this.editorDiv.removeAttribute("aria-multiline"); + } + enableEditing() { + this.editorDiv.setAttribute("role", "textbox"); + this.editorDiv.setAttribute("aria-multiline", true); + } + render() { + if (this.div) { + return this.div; + } + let baseX, baseY; + if (this.width) { + baseX = this.x; + baseY = this.y; + } + super.render(); + this.editorDiv = document.createElement("div"); + this.editorDiv.className = "internal"; + this.editorDiv.setAttribute("id", this.#editorDivId); + this.editorDiv.setAttribute("data-l10n-id", "pdfjs-free-text2"); + this.editorDiv.setAttribute("data-l10n-attrs", "default-content"); + this.enableEditing(); + this.editorDiv.contentEditable = true; + const { + style + } = this.editorDiv; + style.fontSize = `calc(${this.#fontSize}px * var(--scale-factor))`; + style.color = this.#color; + this.div.append(this.editorDiv); + this.overlayDiv = document.createElement("div"); + this.overlayDiv.classList.add("overlay", "enabled"); + this.div.append(this.overlayDiv); + bindEvents(this, this.div, ["dblclick", "keydown"]); + if (this.width) { + const [parentWidth, parentHeight] = this.parentDimensions; + if (this.annotationElementId) { + const { + position + } = this._initialData; + let [tx, ty] = this.getInitialTranslation(); + [tx, ty] = this.pageTranslationToScreen(tx, ty); + const [pageWidth, pageHeight] = this.pageDimensions; + const [pageX, pageY] = this.pageTranslation; + let posX, posY; + switch (this.rotation) { + case 0: + posX = baseX + (position[0] - pageX) / pageWidth; + posY = baseY + this.height - (position[1] - pageY) / pageHeight; + break; + case 90: + posX = baseX + (position[0] - pageX) / pageWidth; + posY = baseY - (position[1] - pageY) / pageHeight; + [tx, ty] = [ty, -tx]; + break; + case 180: + posX = baseX - this.width + (position[0] - pageX) / pageWidth; + posY = baseY - (position[1] - pageY) / pageHeight; + [tx, ty] = [-tx, -ty]; + break; + case 270: + posX = baseX + (position[0] - pageX - this.height * pageHeight) / pageWidth; + posY = baseY + (position[1] - pageY - this.width * pageWidth) / pageHeight; + [tx, ty] = [-ty, tx]; + break; + } + this.setAt(posX * parentWidth, posY * parentHeight, tx, ty); + } else { + this.setAt(baseX * parentWidth, baseY * parentHeight, this.width * parentWidth, this.height * parentHeight); + } + this.#setContent(); + this._isDraggable = true; + this.editorDiv.contentEditable = false; + } else { + this._isDraggable = false; + this.editorDiv.contentEditable = true; + } + return this.div; + } + static #getNodeContent(node) { + return (node.nodeType === Node.TEXT_NODE ? node.nodeValue : node.innerText).replaceAll(EOL_PATTERN, ""); + } + editorDivPaste(event) { + const clipboardData = event.clipboardData || window.clipboardData; + const { + types + } = clipboardData; + if (types.length === 1 && types[0] === "text/plain") { + return; + } + event.preventDefault(); + const paste = FreeTextEditor.#deserializeContent(clipboardData.getData("text") || "").replaceAll(EOL_PATTERN, "\n"); + if (!paste) { + return; + } + const selection = window.getSelection(); + if (!selection.rangeCount) { + return; + } + this.editorDiv.normalize(); + selection.deleteFromDocument(); + const range = selection.getRangeAt(0); + if (!paste.includes("\n")) { + range.insertNode(document.createTextNode(paste)); + this.editorDiv.normalize(); + selection.collapseToStart(); + return; + } + const { + startContainer, + startOffset + } = range; + const bufferBefore = []; + const bufferAfter = []; + if (startContainer.nodeType === Node.TEXT_NODE) { + const parent = startContainer.parentElement; + bufferAfter.push(startContainer.nodeValue.slice(startOffset).replaceAll(EOL_PATTERN, "")); + if (parent !== this.editorDiv) { + let buffer = bufferBefore; + for (const child of this.editorDiv.childNodes) { + if (child === parent) { + buffer = bufferAfter; + continue; + } + buffer.push(FreeTextEditor.#getNodeContent(child)); + } + } + bufferBefore.push(startContainer.nodeValue.slice(0, startOffset).replaceAll(EOL_PATTERN, "")); + } else if (startContainer === this.editorDiv) { + let buffer = bufferBefore; + let i = 0; + for (const child of this.editorDiv.childNodes) { + if (i++ === startOffset) { + buffer = bufferAfter; + } + buffer.push(FreeTextEditor.#getNodeContent(child)); + } + } + this.#content = `${bufferBefore.join("\n")}${paste}${bufferAfter.join("\n")}`; + this.#setContent(); + const newRange = new Range(); + let beforeLength = bufferBefore.reduce((acc, line) => acc + line.length, 0); + for (const { + firstChild + } of this.editorDiv.childNodes) { + if (firstChild.nodeType === Node.TEXT_NODE) { + const length = firstChild.nodeValue.length; + if (beforeLength <= length) { + newRange.setStart(firstChild, beforeLength); + newRange.setEnd(firstChild, beforeLength); + break; + } + beforeLength -= length; + } + } + selection.removeAllRanges(); + selection.addRange(newRange); + } + #setContent() { + this.editorDiv.replaceChildren(); + if (!this.#content) { + return; + } + for (const line of this.#content.split("\n")) { + const div = document.createElement("div"); + div.append(line ? document.createTextNode(line) : document.createElement("br")); + this.editorDiv.append(div); + } + } + #serializeContent() { + return this.#content.replaceAll("\xa0", " "); + } + static #deserializeContent(content) { + return content.replaceAll(" ", "\xa0"); + } + get contentDiv() { + return this.editorDiv; + } + static async deserialize(data, parent, uiManager) { + let initialData = null; + if (data instanceof FreeTextAnnotationElement) { + const { + data: { + defaultAppearanceData: { + fontSize, + fontColor + }, + rect, + rotation, + id, + popupRef + }, + textContent, + textPosition, + parent: { + page: { + pageNumber + } + } + } = data; + if (!textContent || textContent.length === 0) { + return null; + } + initialData = data = { + annotationType: AnnotationEditorType.FREETEXT, + color: Array.from(fontColor), + fontSize, + value: textContent.join("\n"), + position: textPosition, + pageIndex: pageNumber - 1, + rect: rect.slice(0), + rotation, + id, + deleted: false, + popupRef + }; + } + const editor = await super.deserialize(data, parent, uiManager); + editor.#fontSize = data.fontSize; + editor.#color = Util.makeHexColor(...data.color); + editor.#content = FreeTextEditor.#deserializeContent(data.value); + editor.annotationElementId = data.id || null; + editor._initialData = initialData; + return editor; + } + serialize(isForCopying = false) { + if (this.isEmpty()) { + return null; + } + if (this.deleted) { + return this.serializeDeleted(); + } + const padding = FreeTextEditor._internalPadding * this.parentScale; + const rect = this.getRect(padding, padding); + const color = AnnotationEditor._colorManager.convert(this.isAttachedToDOM ? getComputedStyle(this.editorDiv).color : this.#color); + const serialized = { + annotationType: AnnotationEditorType.FREETEXT, + color, + fontSize: this.#fontSize, + value: this.#serializeContent(), + pageIndex: this.pageIndex, + rect, + rotation: this.rotation, + structTreeParentId: this._structTreeParentId + }; + if (isForCopying) { + return serialized; + } + if (this.annotationElementId && !this.#hasElementChanged(serialized)) { + return null; + } + serialized.id = this.annotationElementId; + return serialized; + } + #hasElementChanged(serialized) { + const { + value, + fontSize, + color, + pageIndex + } = this._initialData; + return this._hasBeenMoved || serialized.value !== value || serialized.fontSize !== fontSize || serialized.color.some((c, i) => c !== color[i]) || serialized.pageIndex !== pageIndex; + } + renderAnnotationElement(annotation) { + const content = super.renderAnnotationElement(annotation); + if (this.deleted) { + return content; + } + const { + style + } = content; + style.fontSize = `calc(${this.#fontSize}px * var(--scale-factor))`; + style.color = this.#color; + content.replaceChildren(); + for (const line of this.#content.split("\n")) { + const div = document.createElement("div"); + div.append(line ? document.createTextNode(line) : document.createElement("br")); + content.append(div); + } + const padding = FreeTextEditor._internalPadding * this.parentScale; + annotation.updateEdited({ + rect: this.getRect(padding, padding), + popupContent: this.#content + }); + return content; + } + resetAnnotationElement(annotation) { + super.resetAnnotationElement(annotation); + annotation.resetEdited(); + } +} + +;// ./src/display/editor/drawers/outline.js + +class Outline { + static PRECISION = 1e-4; + toSVGPath() { + unreachable("Abstract method `toSVGPath` must be implemented."); + } + get box() { + unreachable("Abstract getter `box` must be implemented."); + } + serialize(_bbox, _rotation) { + unreachable("Abstract method `serialize` must be implemented."); + } + static _rescale(src, tx, ty, sx, sy, dest) { + dest ||= new Float32Array(src.length); + for (let i = 0, ii = src.length; i < ii; i += 2) { + dest[i] = tx + src[i] * sx; + dest[i + 1] = ty + src[i + 1] * sy; + } + return dest; + } + static _rescaleAndSwap(src, tx, ty, sx, sy, dest) { + dest ||= new Float32Array(src.length); + for (let i = 0, ii = src.length; i < ii; i += 2) { + dest[i] = tx + src[i + 1] * sx; + dest[i + 1] = ty + src[i] * sy; + } + return dest; + } + static _translate(src, tx, ty, dest) { + dest ||= new Float32Array(src.length); + for (let i = 0, ii = src.length; i < ii; i += 2) { + dest[i] = tx + src[i]; + dest[i + 1] = ty + src[i + 1]; + } + return dest; + } + static svgRound(x) { + return Math.round(x * 10000); + } + static _normalizePoint(x, y, parentWidth, parentHeight, rotation) { + switch (rotation) { + case 90: + return [1 - y / parentWidth, x / parentHeight]; + case 180: + return [1 - x / parentWidth, 1 - y / parentHeight]; + case 270: + return [y / parentWidth, 1 - x / parentHeight]; + default: + return [x / parentWidth, y / parentHeight]; + } + } + static _normalizePagePoint(x, y, rotation) { + switch (rotation) { + case 90: + return [1 - y, x]; + case 180: + return [1 - x, 1 - y]; + case 270: + return [y, 1 - x]; + default: + return [x, y]; + } + } + static createBezierPoints(x1, y1, x2, y2, x3, y3) { + return [(x1 + 5 * x2) / 6, (y1 + 5 * y2) / 6, (5 * x2 + x3) / 6, (5 * y2 + y3) / 6, (x2 + x3) / 2, (y2 + y3) / 2]; + } +} + +;// ./src/display/editor/drawers/freedraw.js + + +class FreeDrawOutliner { + #box; + #bottom = []; + #innerMargin; + #isLTR; + #top = []; + #last = new Float32Array(18); + #lastX; + #lastY; + #min; + #min_dist; + #scaleFactor; + #thickness; + #points = []; + static #MIN_DIST = 8; + static #MIN_DIFF = 2; + static #MIN = FreeDrawOutliner.#MIN_DIST + FreeDrawOutliner.#MIN_DIFF; + constructor({ + x, + y + }, box, scaleFactor, thickness, isLTR, innerMargin = 0) { + this.#box = box; + this.#thickness = thickness * scaleFactor; + this.#isLTR = isLTR; + this.#last.set([NaN, NaN, NaN, NaN, x, y], 6); + this.#innerMargin = innerMargin; + this.#min_dist = FreeDrawOutliner.#MIN_DIST * scaleFactor; + this.#min = FreeDrawOutliner.#MIN * scaleFactor; + this.#scaleFactor = scaleFactor; + this.#points.push(x, y); + } + isEmpty() { + return isNaN(this.#last[8]); + } + #getLastCoords() { + const lastTop = this.#last.subarray(4, 6); + const lastBottom = this.#last.subarray(16, 18); + const [x, y, width, height] = this.#box; + return [(this.#lastX + (lastTop[0] - lastBottom[0]) / 2 - x) / width, (this.#lastY + (lastTop[1] - lastBottom[1]) / 2 - y) / height, (this.#lastX + (lastBottom[0] - lastTop[0]) / 2 - x) / width, (this.#lastY + (lastBottom[1] - lastTop[1]) / 2 - y) / height]; + } + add({ + x, + y + }) { + this.#lastX = x; + this.#lastY = y; + const [layerX, layerY, layerWidth, layerHeight] = this.#box; + let [x1, y1, x2, y2] = this.#last.subarray(8, 12); + const diffX = x - x2; + const diffY = y - y2; + const d = Math.hypot(diffX, diffY); + if (d < this.#min) { + return false; + } + const diffD = d - this.#min_dist; + const K = diffD / d; + const shiftX = K * diffX; + const shiftY = K * diffY; + let x0 = x1; + let y0 = y1; + x1 = x2; + y1 = y2; + x2 += shiftX; + y2 += shiftY; + this.#points?.push(x, y); + const nX = -shiftY / diffD; + const nY = shiftX / diffD; + const thX = nX * this.#thickness; + const thY = nY * this.#thickness; + this.#last.set(this.#last.subarray(2, 8), 0); + this.#last.set([x2 + thX, y2 + thY], 4); + this.#last.set(this.#last.subarray(14, 18), 12); + this.#last.set([x2 - thX, y2 - thY], 16); + if (isNaN(this.#last[6])) { + if (this.#top.length === 0) { + this.#last.set([x1 + thX, y1 + thY], 2); + this.#top.push(NaN, NaN, NaN, NaN, (x1 + thX - layerX) / layerWidth, (y1 + thY - layerY) / layerHeight); + this.#last.set([x1 - thX, y1 - thY], 14); + this.#bottom.push(NaN, NaN, NaN, NaN, (x1 - thX - layerX) / layerWidth, (y1 - thY - layerY) / layerHeight); + } + this.#last.set([x0, y0, x1, y1, x2, y2], 6); + return !this.isEmpty(); + } + this.#last.set([x0, y0, x1, y1, x2, y2], 6); + const angle = Math.abs(Math.atan2(y0 - y1, x0 - x1) - Math.atan2(shiftY, shiftX)); + if (angle < Math.PI / 2) { + [x1, y1, x2, y2] = this.#last.subarray(2, 6); + this.#top.push(NaN, NaN, NaN, NaN, ((x1 + x2) / 2 - layerX) / layerWidth, ((y1 + y2) / 2 - layerY) / layerHeight); + [x1, y1, x0, y0] = this.#last.subarray(14, 18); + this.#bottom.push(NaN, NaN, NaN, NaN, ((x0 + x1) / 2 - layerX) / layerWidth, ((y0 + y1) / 2 - layerY) / layerHeight); + return true; + } + [x0, y0, x1, y1, x2, y2] = this.#last.subarray(0, 6); + this.#top.push(((x0 + 5 * x1) / 6 - layerX) / layerWidth, ((y0 + 5 * y1) / 6 - layerY) / layerHeight, ((5 * x1 + x2) / 6 - layerX) / layerWidth, ((5 * y1 + y2) / 6 - layerY) / layerHeight, ((x1 + x2) / 2 - layerX) / layerWidth, ((y1 + y2) / 2 - layerY) / layerHeight); + [x2, y2, x1, y1, x0, y0] = this.#last.subarray(12, 18); + this.#bottom.push(((x0 + 5 * x1) / 6 - layerX) / layerWidth, ((y0 + 5 * y1) / 6 - layerY) / layerHeight, ((5 * x1 + x2) / 6 - layerX) / layerWidth, ((5 * y1 + y2) / 6 - layerY) / layerHeight, ((x1 + x2) / 2 - layerX) / layerWidth, ((y1 + y2) / 2 - layerY) / layerHeight); + return true; + } + toSVGPath() { + if (this.isEmpty()) { + return ""; + } + const top = this.#top; + const bottom = this.#bottom; + if (isNaN(this.#last[6]) && !this.isEmpty()) { + return this.#toSVGPathTwoPoints(); + } + const buffer = []; + buffer.push(`M${top[4]} ${top[5]}`); + for (let i = 6; i < top.length; i += 6) { + if (isNaN(top[i])) { + buffer.push(`L${top[i + 4]} ${top[i + 5]}`); + } else { + buffer.push(`C${top[i]} ${top[i + 1]} ${top[i + 2]} ${top[i + 3]} ${top[i + 4]} ${top[i + 5]}`); + } + } + this.#toSVGPathEnd(buffer); + for (let i = bottom.length - 6; i >= 6; i -= 6) { + if (isNaN(bottom[i])) { + buffer.push(`L${bottom[i + 4]} ${bottom[i + 5]}`); + } else { + buffer.push(`C${bottom[i]} ${bottom[i + 1]} ${bottom[i + 2]} ${bottom[i + 3]} ${bottom[i + 4]} ${bottom[i + 5]}`); + } + } + this.#toSVGPathStart(buffer); + return buffer.join(" "); + } + #toSVGPathTwoPoints() { + const [x, y, width, height] = this.#box; + const [lastTopX, lastTopY, lastBottomX, lastBottomY] = this.#getLastCoords(); + return `M${(this.#last[2] - x) / width} ${(this.#last[3] - y) / height} L${(this.#last[4] - x) / width} ${(this.#last[5] - y) / height} L${lastTopX} ${lastTopY} L${lastBottomX} ${lastBottomY} L${(this.#last[16] - x) / width} ${(this.#last[17] - y) / height} L${(this.#last[14] - x) / width} ${(this.#last[15] - y) / height} Z`; + } + #toSVGPathStart(buffer) { + const bottom = this.#bottom; + buffer.push(`L${bottom[4]} ${bottom[5]} Z`); + } + #toSVGPathEnd(buffer) { + const [x, y, width, height] = this.#box; + const lastTop = this.#last.subarray(4, 6); + const lastBottom = this.#last.subarray(16, 18); + const [lastTopX, lastTopY, lastBottomX, lastBottomY] = this.#getLastCoords(); + buffer.push(`L${(lastTop[0] - x) / width} ${(lastTop[1] - y) / height} L${lastTopX} ${lastTopY} L${lastBottomX} ${lastBottomY} L${(lastBottom[0] - x) / width} ${(lastBottom[1] - y) / height}`); + } + newFreeDrawOutline(outline, points, box, scaleFactor, innerMargin, isLTR) { + return new FreeDrawOutline(outline, points, box, scaleFactor, innerMargin, isLTR); + } + getOutlines() { + const top = this.#top; + const bottom = this.#bottom; + const last = this.#last; + const [layerX, layerY, layerWidth, layerHeight] = this.#box; + const points = new Float32Array((this.#points?.length ?? 0) + 2); + for (let i = 0, ii = points.length - 2; i < ii; i += 2) { + points[i] = (this.#points[i] - layerX) / layerWidth; + points[i + 1] = (this.#points[i + 1] - layerY) / layerHeight; + } + points[points.length - 2] = (this.#lastX - layerX) / layerWidth; + points[points.length - 1] = (this.#lastY - layerY) / layerHeight; + if (isNaN(last[6]) && !this.isEmpty()) { + return this.#getOutlineTwoPoints(points); + } + const outline = new Float32Array(this.#top.length + 24 + this.#bottom.length); + let N = top.length; + for (let i = 0; i < N; i += 2) { + if (isNaN(top[i])) { + outline[i] = outline[i + 1] = NaN; + continue; + } + outline[i] = top[i]; + outline[i + 1] = top[i + 1]; + } + N = this.#getOutlineEnd(outline, N); + for (let i = bottom.length - 6; i >= 6; i -= 6) { + for (let j = 0; j < 6; j += 2) { + if (isNaN(bottom[i + j])) { + outline[N] = outline[N + 1] = NaN; + N += 2; + continue; + } + outline[N] = bottom[i + j]; + outline[N + 1] = bottom[i + j + 1]; + N += 2; + } + } + this.#getOutlineStart(outline, N); + return this.newFreeDrawOutline(outline, points, this.#box, this.#scaleFactor, this.#innerMargin, this.#isLTR); + } + #getOutlineTwoPoints(points) { + const last = this.#last; + const [layerX, layerY, layerWidth, layerHeight] = this.#box; + const [lastTopX, lastTopY, lastBottomX, lastBottomY] = this.#getLastCoords(); + const outline = new Float32Array(36); + outline.set([NaN, NaN, NaN, NaN, (last[2] - layerX) / layerWidth, (last[3] - layerY) / layerHeight, NaN, NaN, NaN, NaN, (last[4] - layerX) / layerWidth, (last[5] - layerY) / layerHeight, NaN, NaN, NaN, NaN, lastTopX, lastTopY, NaN, NaN, NaN, NaN, lastBottomX, lastBottomY, NaN, NaN, NaN, NaN, (last[16] - layerX) / layerWidth, (last[17] - layerY) / layerHeight, NaN, NaN, NaN, NaN, (last[14] - layerX) / layerWidth, (last[15] - layerY) / layerHeight], 0); + return this.newFreeDrawOutline(outline, points, this.#box, this.#scaleFactor, this.#innerMargin, this.#isLTR); + } + #getOutlineStart(outline, pos) { + const bottom = this.#bottom; + outline.set([NaN, NaN, NaN, NaN, bottom[4], bottom[5]], pos); + return pos += 6; + } + #getOutlineEnd(outline, pos) { + const lastTop = this.#last.subarray(4, 6); + const lastBottom = this.#last.subarray(16, 18); + const [layerX, layerY, layerWidth, layerHeight] = this.#box; + const [lastTopX, lastTopY, lastBottomX, lastBottomY] = this.#getLastCoords(); + outline.set([NaN, NaN, NaN, NaN, (lastTop[0] - layerX) / layerWidth, (lastTop[1] - layerY) / layerHeight, NaN, NaN, NaN, NaN, lastTopX, lastTopY, NaN, NaN, NaN, NaN, lastBottomX, lastBottomY, NaN, NaN, NaN, NaN, (lastBottom[0] - layerX) / layerWidth, (lastBottom[1] - layerY) / layerHeight], pos); + return pos += 24; + } +} +class FreeDrawOutline extends Outline { + #box; + #bbox = new Float32Array(4); + #innerMargin; + #isLTR; + #points; + #scaleFactor; + #outline; + constructor(outline, points, box, scaleFactor, innerMargin, isLTR) { + super(); + this.#outline = outline; + this.#points = points; + this.#box = box; + this.#scaleFactor = scaleFactor; + this.#innerMargin = innerMargin; + this.#isLTR = isLTR; + this.lastPoint = [NaN, NaN]; + this.#computeMinMax(isLTR); + const [x, y, width, height] = this.#bbox; + for (let i = 0, ii = outline.length; i < ii; i += 2) { + outline[i] = (outline[i] - x) / width; + outline[i + 1] = (outline[i + 1] - y) / height; + } + for (let i = 0, ii = points.length; i < ii; i += 2) { + points[i] = (points[i] - x) / width; + points[i + 1] = (points[i + 1] - y) / height; + } + } + toSVGPath() { + const buffer = [`M${this.#outline[4]} ${this.#outline[5]}`]; + for (let i = 6, ii = this.#outline.length; i < ii; i += 6) { + if (isNaN(this.#outline[i])) { + buffer.push(`L${this.#outline[i + 4]} ${this.#outline[i + 5]}`); + continue; + } + buffer.push(`C${this.#outline[i]} ${this.#outline[i + 1]} ${this.#outline[i + 2]} ${this.#outline[i + 3]} ${this.#outline[i + 4]} ${this.#outline[i + 5]}`); + } + buffer.push("Z"); + return buffer.join(" "); + } + serialize([blX, blY, trX, trY], rotation) { + const width = trX - blX; + const height = trY - blY; + let outline; + let points; + switch (rotation) { + case 0: + outline = Outline._rescale(this.#outline, blX, trY, width, -height); + points = Outline._rescale(this.#points, blX, trY, width, -height); + break; + case 90: + outline = Outline._rescaleAndSwap(this.#outline, blX, blY, width, height); + points = Outline._rescaleAndSwap(this.#points, blX, blY, width, height); + break; + case 180: + outline = Outline._rescale(this.#outline, trX, blY, -width, height); + points = Outline._rescale(this.#points, trX, blY, -width, height); + break; + case 270: + outline = Outline._rescaleAndSwap(this.#outline, trX, trY, -width, -height); + points = Outline._rescaleAndSwap(this.#points, trX, trY, -width, -height); + break; + } + return { + outline: Array.from(outline), + points: [Array.from(points)] + }; + } + #computeMinMax(isLTR) { + const outline = this.#outline; + let lastX = outline[4]; + let lastY = outline[5]; + let minX = lastX; + let minY = lastY; + let maxX = lastX; + let maxY = lastY; + let lastPointX = lastX; + let lastPointY = lastY; + const ltrCallback = isLTR ? Math.max : Math.min; + for (let i = 6, ii = outline.length; i < ii; i += 6) { + if (isNaN(outline[i])) { + minX = Math.min(minX, outline[i + 4]); + minY = Math.min(minY, outline[i + 5]); + maxX = Math.max(maxX, outline[i + 4]); + maxY = Math.max(maxY, outline[i + 5]); + if (lastPointY < outline[i + 5]) { + lastPointX = outline[i + 4]; + lastPointY = outline[i + 5]; + } else if (lastPointY === outline[i + 5]) { + lastPointX = ltrCallback(lastPointX, outline[i + 4]); + } + } else { + const bbox = Util.bezierBoundingBox(lastX, lastY, ...outline.slice(i, i + 6)); + minX = Math.min(minX, bbox[0]); + minY = Math.min(minY, bbox[1]); + maxX = Math.max(maxX, bbox[2]); + maxY = Math.max(maxY, bbox[3]); + if (lastPointY < bbox[3]) { + lastPointX = bbox[2]; + lastPointY = bbox[3]; + } else if (lastPointY === bbox[3]) { + lastPointX = ltrCallback(lastPointX, bbox[2]); + } + } + lastX = outline[i + 4]; + lastY = outline[i + 5]; + } + const bbox = this.#bbox; + bbox[0] = minX - this.#innerMargin; + bbox[1] = minY - this.#innerMargin; + bbox[2] = maxX - minX + 2 * this.#innerMargin; + bbox[3] = maxY - minY + 2 * this.#innerMargin; + this.lastPoint = [lastPointX, lastPointY]; + } + get box() { + return this.#bbox; + } + newOutliner(point, box, scaleFactor, thickness, isLTR, innerMargin = 0) { + return new FreeDrawOutliner(point, box, scaleFactor, thickness, isLTR, innerMargin); + } + getNewOutline(thickness, innerMargin) { + const [x, y, width, height] = this.#bbox; + const [layerX, layerY, layerWidth, layerHeight] = this.#box; + const sx = width * layerWidth; + const sy = height * layerHeight; + const tx = x * layerWidth + layerX; + const ty = y * layerHeight + layerY; + const outliner = this.newOutliner({ + x: this.#points[0] * sx + tx, + y: this.#points[1] * sy + ty + }, this.#box, this.#scaleFactor, thickness, this.#isLTR, innerMargin ?? this.#innerMargin); + for (let i = 2; i < this.#points.length; i += 2) { + outliner.add({ + x: this.#points[i] * sx + tx, + y: this.#points[i + 1] * sy + ty + }); + } + return outliner.getOutlines(); + } +} + +;// ./src/display/editor/drawers/highlight.js + + +class HighlightOutliner { + #box; + #lastPoint; + #verticalEdges = []; + #intervals = []; + constructor(boxes, borderWidth = 0, innerMargin = 0, isLTR = true) { + let minX = Infinity; + let maxX = -Infinity; + let minY = Infinity; + let maxY = -Infinity; + const NUMBER_OF_DIGITS = 4; + const EPSILON = 10 ** -NUMBER_OF_DIGITS; + for (const { + x, + y, + width, + height + } of boxes) { + const x1 = Math.floor((x - borderWidth) / EPSILON) * EPSILON; + const x2 = Math.ceil((x + width + borderWidth) / EPSILON) * EPSILON; + const y1 = Math.floor((y - borderWidth) / EPSILON) * EPSILON; + const y2 = Math.ceil((y + height + borderWidth) / EPSILON) * EPSILON; + const left = [x1, y1, y2, true]; + const right = [x2, y1, y2, false]; + this.#verticalEdges.push(left, right); + minX = Math.min(minX, x1); + maxX = Math.max(maxX, x2); + minY = Math.min(minY, y1); + maxY = Math.max(maxY, y2); + } + const bboxWidth = maxX - minX + 2 * innerMargin; + const bboxHeight = maxY - minY + 2 * innerMargin; + const shiftedMinX = minX - innerMargin; + const shiftedMinY = minY - innerMargin; + const lastEdge = this.#verticalEdges.at(isLTR ? -1 : -2); + const lastPoint = [lastEdge[0], lastEdge[2]]; + for (const edge of this.#verticalEdges) { + const [x, y1, y2] = edge; + edge[0] = (x - shiftedMinX) / bboxWidth; + edge[1] = (y1 - shiftedMinY) / bboxHeight; + edge[2] = (y2 - shiftedMinY) / bboxHeight; + } + this.#box = new Float32Array([shiftedMinX, shiftedMinY, bboxWidth, bboxHeight]); + this.#lastPoint = lastPoint; + } + getOutlines() { + this.#verticalEdges.sort((a, b) => a[0] - b[0] || a[1] - b[1] || a[2] - b[2]); + const outlineVerticalEdges = []; + for (const edge of this.#verticalEdges) { + if (edge[3]) { + outlineVerticalEdges.push(...this.#breakEdge(edge)); + this.#insert(edge); + } else { + this.#remove(edge); + outlineVerticalEdges.push(...this.#breakEdge(edge)); + } + } + return this.#getOutlines(outlineVerticalEdges); + } + #getOutlines(outlineVerticalEdges) { + const edges = []; + const allEdges = new Set(); + for (const edge of outlineVerticalEdges) { + const [x, y1, y2] = edge; + edges.push([x, y1, edge], [x, y2, edge]); + } + edges.sort((a, b) => a[1] - b[1] || a[0] - b[0]); + for (let i = 0, ii = edges.length; i < ii; i += 2) { + const edge1 = edges[i][2]; + const edge2 = edges[i + 1][2]; + edge1.push(edge2); + edge2.push(edge1); + allEdges.add(edge1); + allEdges.add(edge2); + } + const outlines = []; + let outline; + while (allEdges.size > 0) { + const edge = allEdges.values().next().value; + let [x, y1, y2, edge1, edge2] = edge; + allEdges.delete(edge); + let lastPointX = x; + let lastPointY = y1; + outline = [x, y2]; + outlines.push(outline); + while (true) { + let e; + if (allEdges.has(edge1)) { + e = edge1; + } else if (allEdges.has(edge2)) { + e = edge2; + } else { + break; + } + allEdges.delete(e); + [x, y1, y2, edge1, edge2] = e; + if (lastPointX !== x) { + outline.push(lastPointX, lastPointY, x, lastPointY === y1 ? y1 : y2); + lastPointX = x; + } + lastPointY = lastPointY === y1 ? y2 : y1; + } + outline.push(lastPointX, lastPointY); + } + return new HighlightOutline(outlines, this.#box, this.#lastPoint); + } + #binarySearch(y) { + const array = this.#intervals; + let start = 0; + let end = array.length - 1; + while (start <= end) { + const middle = start + end >> 1; + const y1 = array[middle][0]; + if (y1 === y) { + return middle; + } + if (y1 < y) { + start = middle + 1; + } else { + end = middle - 1; + } + } + return end + 1; + } + #insert([, y1, y2]) { + const index = this.#binarySearch(y1); + this.#intervals.splice(index, 0, [y1, y2]); + } + #remove([, y1, y2]) { + const index = this.#binarySearch(y1); + for (let i = index; i < this.#intervals.length; i++) { + const [start, end] = this.#intervals[i]; + if (start !== y1) { + break; + } + if (start === y1 && end === y2) { + this.#intervals.splice(i, 1); + return; + } + } + for (let i = index - 1; i >= 0; i--) { + const [start, end] = this.#intervals[i]; + if (start !== y1) { + break; + } + if (start === y1 && end === y2) { + this.#intervals.splice(i, 1); + return; + } + } + } + #breakEdge(edge) { + const [x, y1, y2] = edge; + const results = [[x, y1, y2]]; + const index = this.#binarySearch(y2); + for (let i = 0; i < index; i++) { + const [start, end] = this.#intervals[i]; + for (let j = 0, jj = results.length; j < jj; j++) { + const [, y3, y4] = results[j]; + if (end <= y3 || y4 <= start) { + continue; + } + if (y3 >= start) { + if (y4 > end) { + results[j][1] = end; + } else { + if (jj === 1) { + return []; + } + results.splice(j, 1); + j--; + jj--; + } + continue; + } + results[j][2] = start; + if (y4 > end) { + results.push([x, end, y4]); + } + } + } + return results; + } +} +class HighlightOutline extends Outline { + #box; + #outlines; + constructor(outlines, box, lastPoint) { + super(); + this.#outlines = outlines; + this.#box = box; + this.lastPoint = lastPoint; + } + toSVGPath() { + const buffer = []; + for (const polygon of this.#outlines) { + let [prevX, prevY] = polygon; + buffer.push(`M${prevX} ${prevY}`); + for (let i = 2; i < polygon.length; i += 2) { + const x = polygon[i]; + const y = polygon[i + 1]; + if (x === prevX) { + buffer.push(`V${y}`); + prevY = y; + } else if (y === prevY) { + buffer.push(`H${x}`); + prevX = x; + } + } + buffer.push("Z"); + } + return buffer.join(" "); + } + serialize([blX, blY, trX, trY], _rotation) { + const outlines = []; + const width = trX - blX; + const height = trY - blY; + for (const outline of this.#outlines) { + const points = new Array(outline.length); + for (let i = 0; i < outline.length; i += 2) { + points[i] = blX + outline[i] * width; + points[i + 1] = trY - outline[i + 1] * height; + } + outlines.push(points); + } + return outlines; + } + get box() { + return this.#box; + } + get classNamesForOutlining() { + return ["highlightOutline"]; + } +} +class FreeHighlightOutliner extends FreeDrawOutliner { + newFreeDrawOutline(outline, points, box, scaleFactor, innerMargin, isLTR) { + return new FreeHighlightOutline(outline, points, box, scaleFactor, innerMargin, isLTR); + } +} +class FreeHighlightOutline extends FreeDrawOutline { + newOutliner(point, box, scaleFactor, thickness, isLTR, innerMargin = 0) { + return new FreeHighlightOutliner(point, box, scaleFactor, thickness, isLTR, innerMargin); + } +} + +;// ./src/display/editor/color_picker.js + + + +class ColorPicker { + #button = null; + #buttonSwatch = null; + #defaultColor; + #dropdown = null; + #dropdownWasFromKeyboard = false; + #isMainColorPicker = false; + #editor = null; + #eventBus; + #openDropdownAC = null; + #uiManager = null; + #type; + static #l10nColor = null; + static get _keyboardManager() { + return shadow(this, "_keyboardManager", new KeyboardManager([[["Escape", "mac+Escape"], ColorPicker.prototype._hideDropdownFromKeyboard], [[" ", "mac+ "], ColorPicker.prototype._colorSelectFromKeyboard], [["ArrowDown", "ArrowRight", "mac+ArrowDown", "mac+ArrowRight"], ColorPicker.prototype._moveToNext], [["ArrowUp", "ArrowLeft", "mac+ArrowUp", "mac+ArrowLeft"], ColorPicker.prototype._moveToPrevious], [["Home", "mac+Home"], ColorPicker.prototype._moveToBeginning], [["End", "mac+End"], ColorPicker.prototype._moveToEnd]])); + } + constructor({ + editor = null, + uiManager = null + }) { + if (editor) { + this.#isMainColorPicker = false; + this.#type = AnnotationEditorParamsType.HIGHLIGHT_COLOR; + this.#editor = editor; + } else { + this.#isMainColorPicker = true; + this.#type = AnnotationEditorParamsType.HIGHLIGHT_DEFAULT_COLOR; + } + this.#uiManager = editor?._uiManager || uiManager; + this.#eventBus = this.#uiManager._eventBus; + this.#defaultColor = editor?.color || this.#uiManager?.highlightColors.values().next().value || "#FFFF98"; + ColorPicker.#l10nColor ||= Object.freeze({ + blue: "pdfjs-editor-colorpicker-blue", + green: "pdfjs-editor-colorpicker-green", + pink: "pdfjs-editor-colorpicker-pink", + red: "pdfjs-editor-colorpicker-red", + yellow: "pdfjs-editor-colorpicker-yellow" + }); + } + renderButton() { + const button = this.#button = document.createElement("button"); + button.className = "colorPicker"; + button.tabIndex = "0"; + button.setAttribute("data-l10n-id", "pdfjs-editor-colorpicker-button"); + button.setAttribute("aria-haspopup", true); + const signal = this.#uiManager._signal; + button.addEventListener("click", this.#openDropdown.bind(this), { + signal + }); + button.addEventListener("keydown", this.#keyDown.bind(this), { + signal + }); + const swatch = this.#buttonSwatch = document.createElement("span"); + swatch.className = "swatch"; + swatch.setAttribute("aria-hidden", true); + swatch.style.backgroundColor = this.#defaultColor; + button.append(swatch); + return button; + } + renderMainDropdown() { + const dropdown = this.#dropdown = this.#getDropdownRoot(); + dropdown.setAttribute("aria-orientation", "horizontal"); + dropdown.setAttribute("aria-labelledby", "highlightColorPickerLabel"); + return dropdown; + } + #getDropdownRoot() { + const div = document.createElement("div"); + const signal = this.#uiManager._signal; + div.addEventListener("contextmenu", noContextMenu, { + signal + }); + div.className = "dropdown"; + div.role = "listbox"; + div.setAttribute("aria-multiselectable", false); + div.setAttribute("aria-orientation", "vertical"); + div.setAttribute("data-l10n-id", "pdfjs-editor-colorpicker-dropdown"); + for (const [name, color] of this.#uiManager.highlightColors) { + const button = document.createElement("button"); + button.tabIndex = "0"; + button.role = "option"; + button.setAttribute("data-color", color); + button.title = name; + button.setAttribute("data-l10n-id", ColorPicker.#l10nColor[name]); + const swatch = document.createElement("span"); + button.append(swatch); + swatch.className = "swatch"; + swatch.style.backgroundColor = color; + button.setAttribute("aria-selected", color === this.#defaultColor); + button.addEventListener("click", this.#colorSelect.bind(this, color), { + signal + }); + div.append(button); + } + div.addEventListener("keydown", this.#keyDown.bind(this), { + signal + }); + return div; + } + #colorSelect(color, event) { + event.stopPropagation(); + this.#eventBus.dispatch("switchannotationeditorparams", { + source: this, + type: this.#type, + value: color + }); + } + _colorSelectFromKeyboard(event) { + if (event.target === this.#button) { + this.#openDropdown(event); + return; + } + const color = event.target.getAttribute("data-color"); + if (!color) { + return; + } + this.#colorSelect(color, event); + } + _moveToNext(event) { + if (!this.#isDropdownVisible) { + this.#openDropdown(event); + return; + } + if (event.target === this.#button) { + this.#dropdown.firstChild?.focus(); + return; + } + event.target.nextSibling?.focus(); + } + _moveToPrevious(event) { + if (event.target === this.#dropdown?.firstChild || event.target === this.#button) { + if (this.#isDropdownVisible) { + this._hideDropdownFromKeyboard(); + } + return; + } + if (!this.#isDropdownVisible) { + this.#openDropdown(event); + } + event.target.previousSibling?.focus(); + } + _moveToBeginning(event) { + if (!this.#isDropdownVisible) { + this.#openDropdown(event); + return; + } + this.#dropdown.firstChild?.focus(); + } + _moveToEnd(event) { + if (!this.#isDropdownVisible) { + this.#openDropdown(event); + return; + } + this.#dropdown.lastChild?.focus(); + } + #keyDown(event) { + ColorPicker._keyboardManager.exec(this, event); + } + #openDropdown(event) { + if (this.#isDropdownVisible) { + this.hideDropdown(); + return; + } + this.#dropdownWasFromKeyboard = event.detail === 0; + if (!this.#openDropdownAC) { + this.#openDropdownAC = new AbortController(); + window.addEventListener("pointerdown", this.#pointerDown.bind(this), { + signal: this.#uiManager.combinedSignal(this.#openDropdownAC) + }); + } + if (this.#dropdown) { + this.#dropdown.classList.remove("hidden"); + return; + } + const root = this.#dropdown = this.#getDropdownRoot(); + this.#button.append(root); + } + #pointerDown(event) { + if (this.#dropdown?.contains(event.target)) { + return; + } + this.hideDropdown(); + } + hideDropdown() { + this.#dropdown?.classList.add("hidden"); + this.#openDropdownAC?.abort(); + this.#openDropdownAC = null; + } + get #isDropdownVisible() { + return this.#dropdown && !this.#dropdown.classList.contains("hidden"); + } + _hideDropdownFromKeyboard() { + if (this.#isMainColorPicker) { + return; + } + if (!this.#isDropdownVisible) { + this.#editor?.unselect(); + return; + } + this.hideDropdown(); + this.#button.focus({ + preventScroll: true, + focusVisible: this.#dropdownWasFromKeyboard + }); + } + updateColor(color) { + if (this.#buttonSwatch) { + this.#buttonSwatch.style.backgroundColor = color; + } + if (!this.#dropdown) { + return; + } + const i = this.#uiManager.highlightColors.values(); + for (const child of this.#dropdown.children) { + child.setAttribute("aria-selected", i.next().value === color); + } + } + destroy() { + this.#button?.remove(); + this.#button = null; + this.#buttonSwatch = null; + this.#dropdown?.remove(); + this.#dropdown = null; + } +} + +;// ./src/display/editor/highlight.js + + + + + + + +class HighlightEditor extends AnnotationEditor { + #anchorNode = null; + #anchorOffset = 0; + #boxes; + #clipPathId = null; + #colorPicker = null; + #focusOutlines = null; + #focusNode = null; + #focusOffset = 0; + #highlightDiv = null; + #highlightOutlines = null; + #id = null; + #isFreeHighlight = false; + #lastPoint = null; + #opacity; + #outlineId = null; + #text = ""; + #thickness; + #methodOfCreation = ""; + static _defaultColor = null; + static _defaultOpacity = 1; + static _defaultThickness = 12; + static _type = "highlight"; + static _editorType = AnnotationEditorType.HIGHLIGHT; + static _freeHighlightId = -1; + static _freeHighlight = null; + static _freeHighlightClipId = ""; + static get _keyboardManager() { + const proto = HighlightEditor.prototype; + return shadow(this, "_keyboardManager", new KeyboardManager([[["ArrowLeft", "mac+ArrowLeft"], proto._moveCaret, { + args: [0] + }], [["ArrowRight", "mac+ArrowRight"], proto._moveCaret, { + args: [1] + }], [["ArrowUp", "mac+ArrowUp"], proto._moveCaret, { + args: [2] + }], [["ArrowDown", "mac+ArrowDown"], proto._moveCaret, { + args: [3] + }]])); + } + constructor(params) { + super({ + ...params, + name: "highlightEditor" + }); + this.color = params.color || HighlightEditor._defaultColor; + this.#thickness = params.thickness || HighlightEditor._defaultThickness; + this.#opacity = params.opacity || HighlightEditor._defaultOpacity; + this.#boxes = params.boxes || null; + this.#methodOfCreation = params.methodOfCreation || ""; + this.#text = params.text || ""; + this._isDraggable = false; + if (params.highlightId > -1) { + this.#isFreeHighlight = true; + this.#createFreeOutlines(params); + this.#addToDrawLayer(); + } else if (this.#boxes) { + this.#anchorNode = params.anchorNode; + this.#anchorOffset = params.anchorOffset; + this.#focusNode = params.focusNode; + this.#focusOffset = params.focusOffset; + this.#createOutlines(); + this.#addToDrawLayer(); + this.rotate(this.rotation); + } + } + get telemetryInitialData() { + return { + action: "added", + type: this.#isFreeHighlight ? "free_highlight" : "highlight", + color: this._uiManager.highlightColorNames.get(this.color), + thickness: this.#thickness, + methodOfCreation: this.#methodOfCreation + }; + } + get telemetryFinalData() { + return { + type: "highlight", + color: this._uiManager.highlightColorNames.get(this.color) + }; + } + static computeTelemetryFinalData(data) { + return { + numberOfColors: data.get("color").size + }; + } + #createOutlines() { + const outliner = new HighlightOutliner(this.#boxes, 0.001); + this.#highlightOutlines = outliner.getOutlines(); + [this.x, this.y, this.width, this.height] = this.#highlightOutlines.box; + const outlinerForOutline = new HighlightOutliner(this.#boxes, 0.0025, 0.001, this._uiManager.direction === "ltr"); + this.#focusOutlines = outlinerForOutline.getOutlines(); + const { + lastPoint + } = this.#focusOutlines; + this.#lastPoint = [(lastPoint[0] - this.x) / this.width, (lastPoint[1] - this.y) / this.height]; + } + #createFreeOutlines({ + highlightOutlines, + highlightId, + clipPathId + }) { + this.#highlightOutlines = highlightOutlines; + const extraThickness = 1.5; + this.#focusOutlines = highlightOutlines.getNewOutline(this.#thickness / 2 + extraThickness, 0.0025); + if (highlightId >= 0) { + this.#id = highlightId; + this.#clipPathId = clipPathId; + this.parent.drawLayer.finalizeDraw(highlightId, { + bbox: highlightOutlines.box, + path: { + d: highlightOutlines.toSVGPath() + } + }); + this.#outlineId = this.parent.drawLayer.drawOutline({ + rootClass: { + highlightOutline: true, + free: true + }, + bbox: this.#focusOutlines.box, + path: { + d: this.#focusOutlines.toSVGPath() + } + }, true); + } else if (this.parent) { + const angle = this.parent.viewport.rotation; + this.parent.drawLayer.updateProperties(this.#id, { + bbox: HighlightEditor.#rotateBbox(this.#highlightOutlines.box, (angle - this.rotation + 360) % 360), + path: { + d: highlightOutlines.toSVGPath() + } + }); + this.parent.drawLayer.updateProperties(this.#outlineId, { + bbox: HighlightEditor.#rotateBbox(this.#focusOutlines.box, angle), + path: { + d: this.#focusOutlines.toSVGPath() + } + }); + } + const [x, y, width, height] = highlightOutlines.box; + switch (this.rotation) { + case 0: + this.x = x; + this.y = y; + this.width = width; + this.height = height; + break; + case 90: + { + const [pageWidth, pageHeight] = this.parentDimensions; + this.x = y; + this.y = 1 - x; + this.width = width * pageHeight / pageWidth; + this.height = height * pageWidth / pageHeight; + break; + } + case 180: + this.x = 1 - x; + this.y = 1 - y; + this.width = width; + this.height = height; + break; + case 270: + { + const [pageWidth, pageHeight] = this.parentDimensions; + this.x = 1 - y; + this.y = x; + this.width = width * pageHeight / pageWidth; + this.height = height * pageWidth / pageHeight; + break; + } + } + const { + lastPoint + } = this.#focusOutlines; + this.#lastPoint = [(lastPoint[0] - x) / width, (lastPoint[1] - y) / height]; + } + static initialize(l10n, uiManager) { + AnnotationEditor.initialize(l10n, uiManager); + HighlightEditor._defaultColor ||= uiManager.highlightColors?.values().next().value || "#fff066"; + } + static updateDefaultParams(type, value) { + switch (type) { + case AnnotationEditorParamsType.HIGHLIGHT_DEFAULT_COLOR: + HighlightEditor._defaultColor = value; + break; + case AnnotationEditorParamsType.HIGHLIGHT_THICKNESS: + HighlightEditor._defaultThickness = value; + break; + } + } + translateInPage(x, y) {} + get toolbarPosition() { + return this.#lastPoint; + } + updateParams(type, value) { + switch (type) { + case AnnotationEditorParamsType.HIGHLIGHT_COLOR: + this.#updateColor(value); + break; + case AnnotationEditorParamsType.HIGHLIGHT_THICKNESS: + this.#updateThickness(value); + break; + } + } + static get defaultPropertiesToUpdate() { + return [[AnnotationEditorParamsType.HIGHLIGHT_DEFAULT_COLOR, HighlightEditor._defaultColor], [AnnotationEditorParamsType.HIGHLIGHT_THICKNESS, HighlightEditor._defaultThickness]]; + } + get propertiesToUpdate() { + return [[AnnotationEditorParamsType.HIGHLIGHT_COLOR, this.color || HighlightEditor._defaultColor], [AnnotationEditorParamsType.HIGHLIGHT_THICKNESS, this.#thickness || HighlightEditor._defaultThickness], [AnnotationEditorParamsType.HIGHLIGHT_FREE, this.#isFreeHighlight]]; + } + #updateColor(color) { + const setColorAndOpacity = (col, opa) => { + this.color = col; + this.#opacity = opa; + this.parent?.drawLayer.updateProperties(this.#id, { + root: { + fill: col, + "fill-opacity": opa + } + }); + this.#colorPicker?.updateColor(col); + }; + const savedColor = this.color; + const savedOpacity = this.#opacity; + this.addCommands({ + cmd: setColorAndOpacity.bind(this, color, HighlightEditor._defaultOpacity), + undo: setColorAndOpacity.bind(this, savedColor, savedOpacity), + post: this._uiManager.updateUI.bind(this._uiManager, this), + mustExec: true, + type: AnnotationEditorParamsType.HIGHLIGHT_COLOR, + overwriteIfSameType: true, + keepUndo: true + }); + this._reportTelemetry({ + action: "color_changed", + color: this._uiManager.highlightColorNames.get(color) + }, true); + } + #updateThickness(thickness) { + const savedThickness = this.#thickness; + const setThickness = th => { + this.#thickness = th; + this.#changeThickness(th); + }; + this.addCommands({ + cmd: setThickness.bind(this, thickness), + undo: setThickness.bind(this, savedThickness), + post: this._uiManager.updateUI.bind(this._uiManager, this), + mustExec: true, + type: AnnotationEditorParamsType.INK_THICKNESS, + overwriteIfSameType: true, + keepUndo: true + }); + this._reportTelemetry({ + action: "thickness_changed", + thickness + }, true); + } + async addEditToolbar() { + const toolbar = await super.addEditToolbar(); + if (!toolbar) { + return null; + } + if (this._uiManager.highlightColors) { + this.#colorPicker = new ColorPicker({ + editor: this + }); + toolbar.addColorPicker(this.#colorPicker); + } + return toolbar; + } + disableEditing() { + super.disableEditing(); + this.div.classList.toggle("disabled", true); + } + enableEditing() { + super.enableEditing(); + this.div.classList.toggle("disabled", false); + } + fixAndSetPosition() { + return super.fixAndSetPosition(this.#getRotation()); + } + getBaseTranslation() { + return [0, 0]; + } + getRect(tx, ty) { + return super.getRect(tx, ty, this.#getRotation()); + } + onceAdded(focus) { + if (!this.annotationElementId) { + this.parent.addUndoableEditor(this); + } + if (focus) { + this.div.focus(); + } + } + remove() { + this.#cleanDrawLayer(); + this._reportTelemetry({ + action: "deleted" + }); + super.remove(); + } + rebuild() { + if (!this.parent) { + return; + } + super.rebuild(); + if (this.div === null) { + return; + } + this.#addToDrawLayer(); + if (!this.isAttachedToDOM) { + this.parent.add(this); + } + } + setParent(parent) { + let mustBeSelected = false; + if (this.parent && !parent) { + this.#cleanDrawLayer(); + } else if (parent) { + this.#addToDrawLayer(parent); + mustBeSelected = !this.parent && this.div?.classList.contains("selectedEditor"); + } + super.setParent(parent); + this.show(this._isVisible); + if (mustBeSelected) { + this.select(); + } + } + #changeThickness(thickness) { + if (!this.#isFreeHighlight) { + return; + } + this.#createFreeOutlines({ + highlightOutlines: this.#highlightOutlines.getNewOutline(thickness / 2) + }); + this.fixAndSetPosition(); + const [parentWidth, parentHeight] = this.parentDimensions; + this.setDims(this.width * parentWidth, this.height * parentHeight); + } + #cleanDrawLayer() { + if (this.#id === null || !this.parent) { + return; + } + this.parent.drawLayer.remove(this.#id); + this.#id = null; + this.parent.drawLayer.remove(this.#outlineId); + this.#outlineId = null; + } + #addToDrawLayer(parent = this.parent) { + if (this.#id !== null) { + return; + } + ({ + id: this.#id, + clipPathId: this.#clipPathId + } = parent.drawLayer.draw({ + bbox: this.#highlightOutlines.box, + root: { + viewBox: "0 0 1 1", + fill: this.color, + "fill-opacity": this.#opacity + }, + rootClass: { + highlight: true, + free: this.#isFreeHighlight + }, + path: { + d: this.#highlightOutlines.toSVGPath() + } + }, false, true)); + this.#outlineId = parent.drawLayer.drawOutline({ + rootClass: { + highlightOutline: true, + free: this.#isFreeHighlight + }, + bbox: this.#focusOutlines.box, + path: { + d: this.#focusOutlines.toSVGPath() + } + }, this.#isFreeHighlight); + if (this.#highlightDiv) { + this.#highlightDiv.style.clipPath = this.#clipPathId; + } + } + static #rotateBbox([x, y, width, height], angle) { + switch (angle) { + case 90: + return [1 - y - height, x, height, width]; + case 180: + return [1 - x - width, 1 - y - height, width, height]; + case 270: + return [y, 1 - x - width, height, width]; + } + return [x, y, width, height]; + } + rotate(angle) { + const { + drawLayer + } = this.parent; + let box; + if (this.#isFreeHighlight) { + angle = (angle - this.rotation + 360) % 360; + box = HighlightEditor.#rotateBbox(this.#highlightOutlines.box, angle); + } else { + box = HighlightEditor.#rotateBbox([this.x, this.y, this.width, this.height], angle); + } + drawLayer.updateProperties(this.#id, { + bbox: box, + root: { + "data-main-rotation": angle + } + }); + drawLayer.updateProperties(this.#outlineId, { + bbox: HighlightEditor.#rotateBbox(this.#focusOutlines.box, angle), + root: { + "data-main-rotation": angle + } + }); + } + render() { + if (this.div) { + return this.div; + } + const div = super.render(); + if (this.#text) { + div.setAttribute("aria-label", this.#text); + div.setAttribute("role", "mark"); + } + if (this.#isFreeHighlight) { + div.classList.add("free"); + } else { + this.div.addEventListener("keydown", this.#keydown.bind(this), { + signal: this._uiManager._signal + }); + } + const highlightDiv = this.#highlightDiv = document.createElement("div"); + div.append(highlightDiv); + highlightDiv.setAttribute("aria-hidden", "true"); + highlightDiv.className = "internal"; + highlightDiv.style.clipPath = this.#clipPathId; + const [parentWidth, parentHeight] = this.parentDimensions; + this.setDims(this.width * parentWidth, this.height * parentHeight); + bindEvents(this, this.#highlightDiv, ["pointerover", "pointerleave"]); + this.enableEditing(); + return div; + } + pointerover() { + if (!this.isSelected) { + this.parent?.drawLayer.updateProperties(this.#outlineId, { + rootClass: { + hovered: true + } + }); + } + } + pointerleave() { + if (!this.isSelected) { + this.parent?.drawLayer.updateProperties(this.#outlineId, { + rootClass: { + hovered: false + } + }); + } + } + #keydown(event) { + HighlightEditor._keyboardManager.exec(this, event); + } + _moveCaret(direction) { + this.parent.unselect(this); + switch (direction) { + case 0: + case 2: + this.#setCaret(true); + break; + case 1: + case 3: + this.#setCaret(false); + break; + } + } + #setCaret(start) { + if (!this.#anchorNode) { + return; + } + const selection = window.getSelection(); + if (start) { + selection.setPosition(this.#anchorNode, this.#anchorOffset); + } else { + selection.setPosition(this.#focusNode, this.#focusOffset); + } + } + select() { + super.select(); + if (!this.#outlineId) { + return; + } + this.parent?.drawLayer.updateProperties(this.#outlineId, { + rootClass: { + hovered: false, + selected: true + } + }); + } + unselect() { + super.unselect(); + if (!this.#outlineId) { + return; + } + this.parent?.drawLayer.updateProperties(this.#outlineId, { + rootClass: { + selected: false + } + }); + if (!this.#isFreeHighlight) { + this.#setCaret(false); + } + } + get _mustFixPosition() { + return !this.#isFreeHighlight; + } + show(visible = this._isVisible) { + super.show(visible); + if (this.parent) { + this.parent.drawLayer.updateProperties(this.#id, { + rootClass: { + hidden: !visible + } + }); + this.parent.drawLayer.updateProperties(this.#outlineId, { + rootClass: { + hidden: !visible + } + }); + } + } + #getRotation() { + return this.#isFreeHighlight ? this.rotation : 0; + } + #serializeBoxes() { + if (this.#isFreeHighlight) { + return null; + } + const [pageWidth, pageHeight] = this.pageDimensions; + const [pageX, pageY] = this.pageTranslation; + const boxes = this.#boxes; + const quadPoints = new Float32Array(boxes.length * 8); + let i = 0; + for (const { + x, + y, + width, + height + } of boxes) { + const sx = x * pageWidth + pageX; + const sy = (1 - y) * pageHeight + pageY; + quadPoints[i] = quadPoints[i + 4] = sx; + quadPoints[i + 1] = quadPoints[i + 3] = sy; + quadPoints[i + 2] = quadPoints[i + 6] = sx + width * pageWidth; + quadPoints[i + 5] = quadPoints[i + 7] = sy - height * pageHeight; + i += 8; + } + return quadPoints; + } + #serializeOutlines(rect) { + return this.#highlightOutlines.serialize(rect, this.#getRotation()); + } + static startHighlighting(parent, isLTR, { + target: textLayer, + x, + y + }) { + const { + x: layerX, + y: layerY, + width: parentWidth, + height: parentHeight + } = textLayer.getBoundingClientRect(); + const ac = new AbortController(); + const signal = parent.combinedSignal(ac); + const pointerUpCallback = e => { + ac.abort(); + this.#endHighlight(parent, e); + }; + window.addEventListener("blur", pointerUpCallback, { + signal + }); + window.addEventListener("pointerup", pointerUpCallback, { + signal + }); + window.addEventListener("pointerdown", stopEvent, { + capture: true, + passive: false, + signal + }); + window.addEventListener("contextmenu", noContextMenu, { + signal + }); + textLayer.addEventListener("pointermove", this.#highlightMove.bind(this, parent), { + signal + }); + this._freeHighlight = new FreeHighlightOutliner({ + x, + y + }, [layerX, layerY, parentWidth, parentHeight], parent.scale, this._defaultThickness / 2, isLTR, 0.001); + ({ + id: this._freeHighlightId, + clipPathId: this._freeHighlightClipId + } = parent.drawLayer.draw({ + bbox: [0, 0, 1, 1], + root: { + viewBox: "0 0 1 1", + fill: this._defaultColor, + "fill-opacity": this._defaultOpacity + }, + rootClass: { + highlight: true, + free: true + }, + path: { + d: this._freeHighlight.toSVGPath() + } + }, true, true)); + } + static #highlightMove(parent, event) { + if (this._freeHighlight.add(event)) { + parent.drawLayer.updateProperties(this._freeHighlightId, { + path: { + d: this._freeHighlight.toSVGPath() + } + }); + } + } + static #endHighlight(parent, event) { + if (!this._freeHighlight.isEmpty()) { + parent.createAndAddNewEditor(event, false, { + highlightId: this._freeHighlightId, + highlightOutlines: this._freeHighlight.getOutlines(), + clipPathId: this._freeHighlightClipId, + methodOfCreation: "main_toolbar" + }); + } else { + parent.drawLayer.remove(this._freeHighlightId); + } + this._freeHighlightId = -1; + this._freeHighlight = null; + this._freeHighlightClipId = ""; + } + static async deserialize(data, parent, uiManager) { + let initialData = null; + if (data instanceof HighlightAnnotationElement) { + const { + data: { + quadPoints, + rect, + rotation, + id, + color, + opacity, + popupRef + }, + parent: { + page: { + pageNumber + } + } + } = data; + initialData = data = { + annotationType: AnnotationEditorType.HIGHLIGHT, + color: Array.from(color), + opacity, + quadPoints, + boxes: null, + pageIndex: pageNumber - 1, + rect: rect.slice(0), + rotation, + id, + deleted: false, + popupRef + }; + } else if (data instanceof InkAnnotationElement) { + const { + data: { + inkLists, + rect, + rotation, + id, + color, + borderStyle: { + rawWidth: thickness + }, + popupRef + }, + parent: { + page: { + pageNumber + } + } + } = data; + initialData = data = { + annotationType: AnnotationEditorType.HIGHLIGHT, + color: Array.from(color), + thickness, + inkLists, + boxes: null, + pageIndex: pageNumber - 1, + rect: rect.slice(0), + rotation, + id, + deleted: false, + popupRef + }; + } + const { + color, + quadPoints, + inkLists, + opacity + } = data; + const editor = await super.deserialize(data, parent, uiManager); + editor.color = Util.makeHexColor(...color); + editor.#opacity = opacity || 1; + if (inkLists) { + editor.#thickness = data.thickness; + } + editor.annotationElementId = data.id || null; + editor._initialData = initialData; + const [pageWidth, pageHeight] = editor.pageDimensions; + const [pageX, pageY] = editor.pageTranslation; + if (quadPoints) { + const boxes = editor.#boxes = []; + for (let i = 0; i < quadPoints.length; i += 8) { + boxes.push({ + x: (quadPoints[i] - pageX) / pageWidth, + y: 1 - (quadPoints[i + 1] - pageY) / pageHeight, + width: (quadPoints[i + 2] - quadPoints[i]) / pageWidth, + height: (quadPoints[i + 1] - quadPoints[i + 5]) / pageHeight + }); + } + editor.#createOutlines(); + editor.#addToDrawLayer(); + editor.rotate(editor.rotation); + } else if (inkLists) { + editor.#isFreeHighlight = true; + const points = inkLists[0]; + const point = { + x: points[0] - pageX, + y: pageHeight - (points[1] - pageY) + }; + const outliner = new FreeHighlightOutliner(point, [0, 0, pageWidth, pageHeight], 1, editor.#thickness / 2, true, 0.001); + for (let i = 0, ii = points.length; i < ii; i += 2) { + point.x = points[i] - pageX; + point.y = pageHeight - (points[i + 1] - pageY); + outliner.add(point); + } + const { + id, + clipPathId + } = parent.drawLayer.draw({ + bbox: [0, 0, 1, 1], + root: { + viewBox: "0 0 1 1", + fill: editor.color, + "fill-opacity": editor._defaultOpacity + }, + rootClass: { + highlight: true, + free: true + }, + path: { + d: outliner.toSVGPath() + } + }, true, true); + editor.#createFreeOutlines({ + highlightOutlines: outliner.getOutlines(), + highlightId: id, + clipPathId + }); + editor.#addToDrawLayer(); + } + return editor; + } + serialize(isForCopying = false) { + if (this.isEmpty() || isForCopying) { + return null; + } + if (this.deleted) { + return this.serializeDeleted(); + } + const rect = this.getRect(0, 0); + const color = AnnotationEditor._colorManager.convert(this.color); + const serialized = { + annotationType: AnnotationEditorType.HIGHLIGHT, + color, + opacity: this.#opacity, + thickness: this.#thickness, + quadPoints: this.#serializeBoxes(), + outlines: this.#serializeOutlines(rect), + pageIndex: this.pageIndex, + rect, + rotation: this.#getRotation(), + structTreeParentId: this._structTreeParentId + }; + if (this.annotationElementId && !this.#hasElementChanged(serialized)) { + return null; + } + serialized.id = this.annotationElementId; + return serialized; + } + #hasElementChanged(serialized) { + const { + color + } = this._initialData; + return serialized.color.some((c, i) => c !== color[i]); + } + renderAnnotationElement(annotation) { + annotation.updateEdited({ + rect: this.getRect(0, 0) + }); + return null; + } + static canCreateNewEmptyEditor() { + return false; + } +} + +;// ./src/display/editor/draw.js + + + +class DrawingOptions { + #svgProperties = Object.create(null); + updateProperty(name, value) { + this[name] = value; + this.updateSVGProperty(name, value); + } + updateProperties(properties) { + if (!properties) { + return; + } + for (const [name, value] of Object.entries(properties)) { + this.updateProperty(name, value); + } + } + updateSVGProperty(name, value) { + this.#svgProperties[name] = value; + } + toSVGProperties() { + const root = this.#svgProperties; + this.#svgProperties = Object.create(null); + return { + root + }; + } + reset() { + this.#svgProperties = Object.create(null); + } + updateAll(options = this) { + this.updateProperties(options); + } + clone() { + unreachable("Not implemented"); + } +} +class DrawingEditor extends AnnotationEditor { + #drawOutlines = null; + #mustBeCommitted; + _drawId = null; + static _currentDrawId = -1; + static _currentParent = null; + static #currentDraw = null; + static #currentDrawingAC = null; + static #currentDrawingOptions = null; + static #currentPointerId = NaN; + static #currentPointerType = null; + static #currentPointerIds = null; + static #currentMoveTimestamp = NaN; + static _INNER_MARGIN = 3; + constructor(params) { + super(params); + this.#mustBeCommitted = params.mustBeCommitted || false; + if (params.drawOutlines) { + this.#createDrawOutlines(params); + this.#addToDrawLayer(); + } + } + #createDrawOutlines({ + drawOutlines, + drawId, + drawingOptions + }) { + this.#drawOutlines = drawOutlines; + this._drawingOptions ||= drawingOptions; + if (drawId >= 0) { + this._drawId = drawId; + this.parent.drawLayer.finalizeDraw(drawId, drawOutlines.defaultProperties); + } else { + this._drawId = this.#createDrawing(drawOutlines, this.parent); + } + this.#updateBbox(drawOutlines.box); + } + #createDrawing(drawOutlines, parent) { + const { + id + } = parent.drawLayer.draw(DrawingEditor._mergeSVGProperties(this._drawingOptions.toSVGProperties(), drawOutlines.defaultSVGProperties), false, false); + return id; + } + static _mergeSVGProperties(p1, p2) { + const p1Keys = new Set(Object.keys(p1)); + for (const [key, value] of Object.entries(p2)) { + if (p1Keys.has(key)) { + Object.assign(p1[key], value); + } else { + p1[key] = value; + } + } + return p1; + } + static getDefaultDrawingOptions(_options) { + unreachable("Not implemented"); + } + static get typesMap() { + unreachable("Not implemented"); + } + static get isDrawer() { + return true; + } + static get supportMultipleDrawings() { + return false; + } + static updateDefaultParams(type, value) { + const propertyName = this.typesMap.get(type); + if (propertyName) { + this._defaultDrawingOptions.updateProperty(propertyName, value); + } + if (this._currentParent) { + DrawingEditor.#currentDraw.updateProperty(propertyName, value); + this._currentParent.drawLayer.updateProperties(this._currentDrawId, this._defaultDrawingOptions.toSVGProperties()); + } + } + updateParams(type, value) { + const propertyName = this.constructor.typesMap.get(type); + if (propertyName) { + this._updateProperty(type, propertyName, value); + } + } + static get defaultPropertiesToUpdate() { + const properties = []; + const options = this._defaultDrawingOptions; + for (const [type, name] of this.typesMap) { + properties.push([type, options[name]]); + } + return properties; + } + get propertiesToUpdate() { + const properties = []; + const { + _drawingOptions + } = this; + for (const [type, name] of this.constructor.typesMap) { + properties.push([type, _drawingOptions[name]]); + } + return properties; + } + _updateProperty(type, name, value) { + const options = this._drawingOptions; + const savedValue = options[name]; + const setter = val => { + options.updateProperty(name, val); + const bbox = this.#drawOutlines.updateProperty(name, val); + if (bbox) { + this.#updateBbox(bbox); + } + this.parent?.drawLayer.updateProperties(this._drawId, options.toSVGProperties()); + }; + this.addCommands({ + cmd: setter.bind(this, value), + undo: setter.bind(this, savedValue), + post: this._uiManager.updateUI.bind(this._uiManager, this), + mustExec: true, + type, + overwriteIfSameType: true, + keepUndo: true + }); + } + _onResizing() { + this.parent?.drawLayer.updateProperties(this._drawId, DrawingEditor._mergeSVGProperties(this.#drawOutlines.getPathResizingSVGProperties(this.#convertToDrawSpace()), { + bbox: this.#rotateBox() + })); + } + _onResized() { + this.parent?.drawLayer.updateProperties(this._drawId, DrawingEditor._mergeSVGProperties(this.#drawOutlines.getPathResizedSVGProperties(this.#convertToDrawSpace()), { + bbox: this.#rotateBox() + })); + } + _onTranslating(x, y) { + this.parent?.drawLayer.updateProperties(this._drawId, { + bbox: this.#rotateBox(x, y) + }); + } + _onTranslated() { + this.parent?.drawLayer.updateProperties(this._drawId, DrawingEditor._mergeSVGProperties(this.#drawOutlines.getPathTranslatedSVGProperties(this.#convertToDrawSpace(), this.parentDimensions), { + bbox: this.#rotateBox() + })); + } + _onStartDragging() { + this.parent?.drawLayer.updateProperties(this._drawId, { + rootClass: { + moving: true + } + }); + } + _onStopDragging() { + this.parent?.drawLayer.updateProperties(this._drawId, { + rootClass: { + moving: false + } + }); + } + commit() { + super.commit(); + this.disableEditMode(); + this.disableEditing(); + } + disableEditing() { + super.disableEditing(); + this.div.classList.toggle("disabled", true); + } + enableEditing() { + super.enableEditing(); + this.div.classList.toggle("disabled", false); + } + getBaseTranslation() { + return [0, 0]; + } + get isResizable() { + return true; + } + onceAdded(focus) { + if (!this.annotationElementId) { + this.parent.addUndoableEditor(this); + } + this._isDraggable = true; + if (this.#mustBeCommitted) { + this.#mustBeCommitted = false; + this.commit(); + this.parent.setSelected(this); + if (focus && this.isOnScreen) { + this.div.focus(); + } + } + } + remove() { + this.#cleanDrawLayer(); + super.remove(); + } + rebuild() { + if (!this.parent) { + return; + } + super.rebuild(); + if (this.div === null) { + return; + } + this.#addToDrawLayer(); + this.#updateBbox(this.#drawOutlines.box); + if (!this.isAttachedToDOM) { + this.parent.add(this); + } + } + setParent(parent) { + let mustBeSelected = false; + if (this.parent && !parent) { + this._uiManager.removeShouldRescale(this); + this.#cleanDrawLayer(); + } else if (parent) { + this._uiManager.addShouldRescale(this); + this.#addToDrawLayer(parent); + mustBeSelected = !this.parent && this.div?.classList.contains("selectedEditor"); + } + super.setParent(parent); + if (mustBeSelected) { + this.select(); + } + } + #cleanDrawLayer() { + if (this._drawId === null || !this.parent) { + return; + } + this.parent.drawLayer.remove(this._drawId); + this._drawId = null; + this._drawingOptions.reset(); + } + #addToDrawLayer(parent = this.parent) { + if (this._drawId !== null && this.parent === parent) { + return; + } + if (this._drawId !== null) { + this.parent.drawLayer.updateParent(this._drawId, parent.drawLayer); + return; + } + this._drawingOptions.updateAll(); + this._drawId = this.#createDrawing(this.#drawOutlines, parent); + } + #convertToParentSpace([x, y, width, height]) { + const { + parentDimensions: [pW, pH], + rotation + } = this; + switch (rotation) { + case 90: + return [y, 1 - x, width * (pH / pW), height * (pW / pH)]; + case 180: + return [1 - x, 1 - y, width, height]; + case 270: + return [1 - y, x, width * (pH / pW), height * (pW / pH)]; + default: + return [x, y, width, height]; + } + } + #convertToDrawSpace() { + const { + x, + y, + width, + height, + parentDimensions: [pW, pH], + rotation + } = this; + switch (rotation) { + case 90: + return [1 - y, x, width * (pW / pH), height * (pH / pW)]; + case 180: + return [1 - x, 1 - y, width, height]; + case 270: + return [y, 1 - x, width * (pW / pH), height * (pH / pW)]; + default: + return [x, y, width, height]; + } + } + #updateBbox(bbox) { + [this.x, this.y, this.width, this.height] = this.#convertToParentSpace(bbox); + if (this.div) { + this.fixAndSetPosition(); + const [parentWidth, parentHeight] = this.parentDimensions; + this.setDims(this.width * parentWidth, this.height * parentHeight); + } + this._onResized(); + } + #rotateBox() { + const { + x, + y, + width, + height, + rotation, + parentRotation, + parentDimensions: [pW, pH] + } = this; + switch ((rotation * 4 + parentRotation) / 90) { + case 1: + return [1 - y - height, x, height, width]; + case 2: + return [1 - x - width, 1 - y - height, width, height]; + case 3: + return [y, 1 - x - width, height, width]; + case 4: + return [x, y - width * (pW / pH), height * (pH / pW), width * (pW / pH)]; + case 5: + return [1 - y, x, width * (pW / pH), height * (pH / pW)]; + case 6: + return [1 - x - height * (pH / pW), 1 - y, height * (pH / pW), width * (pW / pH)]; + case 7: + return [y - width * (pW / pH), 1 - x - height * (pH / pW), width * (pW / pH), height * (pH / pW)]; + case 8: + return [x - width, y - height, width, height]; + case 9: + return [1 - y, x - width, height, width]; + case 10: + return [1 - x, 1 - y, width, height]; + case 11: + return [y - height, 1 - x, height, width]; + case 12: + return [x - height * (pH / pW), y, height * (pH / pW), width * (pW / pH)]; + case 13: + return [1 - y - width * (pW / pH), x - height * (pH / pW), width * (pW / pH), height * (pH / pW)]; + case 14: + return [1 - x, 1 - y - width * (pW / pH), height * (pH / pW), width * (pW / pH)]; + case 15: + return [y, 1 - x, width * (pW / pH), height * (pH / pW)]; + default: + return [x, y, width, height]; + } + } + rotate() { + if (!this.parent) { + return; + } + this.parent.drawLayer.updateProperties(this._drawId, DrawingEditor._mergeSVGProperties({ + bbox: this.#rotateBox() + }, this.#drawOutlines.updateRotation((this.parentRotation - this.rotation + 360) % 360))); + } + onScaleChanging() { + if (!this.parent) { + return; + } + this.#updateBbox(this.#drawOutlines.updateParentDimensions(this.parentDimensions, this.parent.scale)); + } + static onScaleChangingWhenDrawing() {} + render() { + if (this.div) { + return this.div; + } + const div = super.render(); + div.classList.add("draw"); + const drawDiv = document.createElement("div"); + div.append(drawDiv); + drawDiv.setAttribute("aria-hidden", "true"); + drawDiv.className = "internal"; + const [parentWidth, parentHeight] = this.parentDimensions; + this.setDims(this.width * parentWidth, this.height * parentHeight); + this._uiManager.addShouldRescale(this); + this.disableEditing(); + return div; + } + static createDrawerInstance(_x, _y, _parentWidth, _parentHeight, _rotation) { + unreachable("Not implemented"); + } + static startDrawing(parent, uiManager, _isLTR, event) { + const { + target, + offsetX: x, + offsetY: y, + pointerId, + pointerType + } = event; + if (DrawingEditor.#currentPointerType && DrawingEditor.#currentPointerType !== pointerType) { + return; + } + const { + viewport: { + rotation + } + } = parent; + const { + width: parentWidth, + height: parentHeight + } = target.getBoundingClientRect(); + const ac = DrawingEditor.#currentDrawingAC = new AbortController(); + const signal = parent.combinedSignal(ac); + DrawingEditor.#currentPointerId ||= pointerId; + DrawingEditor.#currentPointerType ??= pointerType; + window.addEventListener("pointerup", e => { + if (DrawingEditor.#currentPointerId === e.pointerId) { + this._endDraw(e); + } else { + DrawingEditor.#currentPointerIds?.delete(e.pointerId); + } + }, { + signal + }); + window.addEventListener("pointercancel", e => { + if (DrawingEditor.#currentPointerId === e.pointerId) { + this._currentParent.endDrawingSession(); + } else { + DrawingEditor.#currentPointerIds?.delete(e.pointerId); + } + }, { + signal + }); + window.addEventListener("pointerdown", e => { + if (DrawingEditor.#currentPointerType !== e.pointerType) { + return; + } + (DrawingEditor.#currentPointerIds ||= new Set()).add(e.pointerId); + if (DrawingEditor.#currentDraw.isCancellable()) { + DrawingEditor.#currentDraw.removeLastElement(); + if (DrawingEditor.#currentDraw.isEmpty()) { + this._currentParent.endDrawingSession(true); + } else { + this._endDraw(null); + } + } + }, { + capture: true, + passive: false, + signal + }); + window.addEventListener("contextmenu", noContextMenu, { + signal + }); + target.addEventListener("pointermove", this._drawMove.bind(this), { + signal + }); + target.addEventListener("touchmove", e => { + if (e.timeStamp === DrawingEditor.#currentMoveTimestamp) { + stopEvent(e); + } + }, { + signal + }); + parent.toggleDrawing(); + uiManager._editorUndoBar?.hide(); + if (DrawingEditor.#currentDraw) { + parent.drawLayer.updateProperties(this._currentDrawId, DrawingEditor.#currentDraw.startNew(x, y, parentWidth, parentHeight, rotation)); + return; + } + uiManager.updateUIForDefaultProperties(this); + DrawingEditor.#currentDraw = this.createDrawerInstance(x, y, parentWidth, parentHeight, rotation); + DrawingEditor.#currentDrawingOptions = this.getDefaultDrawingOptions(); + this._currentParent = parent; + ({ + id: this._currentDrawId + } = parent.drawLayer.draw(this._mergeSVGProperties(DrawingEditor.#currentDrawingOptions.toSVGProperties(), DrawingEditor.#currentDraw.defaultSVGProperties), true, false)); + } + static _drawMove(event) { + DrawingEditor.#currentMoveTimestamp = -1; + if (!DrawingEditor.#currentDraw) { + return; + } + const { + offsetX, + offsetY, + pointerId + } = event; + if (DrawingEditor.#currentPointerId !== pointerId) { + return; + } + if (DrawingEditor.#currentPointerIds?.size >= 1) { + this._endDraw(event); + return; + } + this._currentParent.drawLayer.updateProperties(this._currentDrawId, DrawingEditor.#currentDraw.add(offsetX, offsetY)); + DrawingEditor.#currentMoveTimestamp = event.timeStamp; + stopEvent(event); + } + static _cleanup(all) { + if (all) { + this._currentDrawId = -1; + this._currentParent = null; + DrawingEditor.#currentDraw = null; + DrawingEditor.#currentDrawingOptions = null; + DrawingEditor.#currentPointerType = null; + DrawingEditor.#currentMoveTimestamp = NaN; + } + if (DrawingEditor.#currentDrawingAC) { + DrawingEditor.#currentDrawingAC.abort(); + DrawingEditor.#currentDrawingAC = null; + DrawingEditor.#currentPointerId = NaN; + DrawingEditor.#currentPointerIds = null; + } + } + static _endDraw(event) { + const parent = this._currentParent; + if (!parent) { + return; + } + parent.toggleDrawing(true); + this._cleanup(false); + if (event) { + parent.drawLayer.updateProperties(this._currentDrawId, DrawingEditor.#currentDraw.end(event.offsetX, event.offsetY)); + } + if (this.supportMultipleDrawings) { + const draw = DrawingEditor.#currentDraw; + const drawId = this._currentDrawId; + const lastElement = draw.getLastElement(); + parent.addCommands({ + cmd: () => { + parent.drawLayer.updateProperties(drawId, draw.setLastElement(lastElement)); + }, + undo: () => { + parent.drawLayer.updateProperties(drawId, draw.removeLastElement()); + }, + mustExec: false, + type: AnnotationEditorParamsType.DRAW_STEP + }); + return; + } + this.endDrawing(false); + } + static endDrawing(isAborted) { + const parent = this._currentParent; + if (!parent) { + return null; + } + parent.toggleDrawing(true); + parent.cleanUndoStack(AnnotationEditorParamsType.DRAW_STEP); + if (!DrawingEditor.#currentDraw.isEmpty()) { + const { + pageDimensions: [pageWidth, pageHeight], + scale + } = parent; + const editor = parent.createAndAddNewEditor({ + offsetX: 0, + offsetY: 0 + }, false, { + drawId: this._currentDrawId, + drawOutlines: DrawingEditor.#currentDraw.getOutlines(pageWidth * scale, pageHeight * scale, scale, this._INNER_MARGIN), + drawingOptions: DrawingEditor.#currentDrawingOptions, + mustBeCommitted: !isAborted + }); + this._cleanup(true); + return editor; + } + parent.drawLayer.remove(this._currentDrawId); + this._cleanup(true); + return null; + } + createDrawingOptions(_data) {} + static deserializeDraw(_pageX, _pageY, _pageWidth, _pageHeight, _innerWidth, _data) { + unreachable("Not implemented"); + } + static async deserialize(data, parent, uiManager) { + const { + rawDims: { + pageWidth, + pageHeight, + pageX, + pageY + } + } = parent.viewport; + const drawOutlines = this.deserializeDraw(pageX, pageY, pageWidth, pageHeight, this._INNER_MARGIN, data); + const editor = await super.deserialize(data, parent, uiManager); + editor.createDrawingOptions(data); + editor.#createDrawOutlines({ + drawOutlines + }); + editor.#addToDrawLayer(); + editor.onScaleChanging(); + editor.rotate(); + return editor; + } + serializeDraw(isForCopying) { + const [pageX, pageY] = this.pageTranslation; + const [pageWidth, pageHeight] = this.pageDimensions; + return this.#drawOutlines.serialize([pageX, pageY, pageWidth, pageHeight], isForCopying); + } + renderAnnotationElement(annotation) { + annotation.updateEdited({ + rect: this.getRect(0, 0) + }); + return null; + } + static canCreateNewEmptyEditor() { + return false; + } +} + +;// ./src/display/editor/drawers/inkdraw.js + + +class InkDrawOutliner { + #last = new Float64Array(6); + #line; + #lines; + #rotation; + #thickness; + #points; + #lastSVGPath = ""; + #lastIndex = 0; + #outlines = new InkDrawOutline(); + #parentWidth; + #parentHeight; + constructor(x, y, parentWidth, parentHeight, rotation, thickness) { + this.#parentWidth = parentWidth; + this.#parentHeight = parentHeight; + this.#rotation = rotation; + this.#thickness = thickness; + [x, y] = this.#normalizePoint(x, y); + const line = this.#line = [NaN, NaN, NaN, NaN, x, y]; + this.#points = [x, y]; + this.#lines = [{ + line, + points: this.#points + }]; + this.#last.set(line, 0); + } + updateProperty(name, value) { + if (name === "stroke-width") { + this.#thickness = value; + } + } + #normalizePoint(x, y) { + return Outline._normalizePoint(x, y, this.#parentWidth, this.#parentHeight, this.#rotation); + } + isEmpty() { + return !this.#lines || this.#lines.length === 0; + } + isCancellable() { + return this.#points.length <= 10; + } + add(x, y) { + [x, y] = this.#normalizePoint(x, y); + const [x1, y1, x2, y2] = this.#last.subarray(2, 6); + const diffX = x - x2; + const diffY = y - y2; + const d = Math.hypot(this.#parentWidth * diffX, this.#parentHeight * diffY); + if (d <= 2) { + return null; + } + this.#points.push(x, y); + if (isNaN(x1)) { + this.#last.set([x2, y2, x, y], 2); + this.#line.push(NaN, NaN, NaN, NaN, x, y); + return { + path: { + d: this.toSVGPath() + } + }; + } + if (isNaN(this.#last[0])) { + this.#line.splice(6, 6); + } + this.#last.set([x1, y1, x2, y2, x, y], 0); + this.#line.push(...Outline.createBezierPoints(x1, y1, x2, y2, x, y)); + return { + path: { + d: this.toSVGPath() + } + }; + } + end(x, y) { + const change = this.add(x, y); + if (change) { + return change; + } + if (this.#points.length === 2) { + return { + path: { + d: this.toSVGPath() + } + }; + } + return null; + } + startNew(x, y, parentWidth, parentHeight, rotation) { + this.#parentWidth = parentWidth; + this.#parentHeight = parentHeight; + this.#rotation = rotation; + [x, y] = this.#normalizePoint(x, y); + const line = this.#line = [NaN, NaN, NaN, NaN, x, y]; + this.#points = [x, y]; + const last = this.#lines.at(-1); + if (last) { + last.line = new Float32Array(last.line); + last.points = new Float32Array(last.points); + } + this.#lines.push({ + line, + points: this.#points + }); + this.#last.set(line, 0); + this.#lastIndex = 0; + this.toSVGPath(); + return null; + } + getLastElement() { + return this.#lines.at(-1); + } + setLastElement(element) { + if (!this.#lines) { + return this.#outlines.setLastElement(element); + } + this.#lines.push(element); + this.#line = element.line; + this.#points = element.points; + this.#lastIndex = 0; + return { + path: { + d: this.toSVGPath() + } + }; + } + removeLastElement() { + if (!this.#lines) { + return this.#outlines.removeLastElement(); + } + this.#lines.pop(); + this.#lastSVGPath = ""; + for (let i = 0, ii = this.#lines.length; i < ii; i++) { + const { + line, + points + } = this.#lines[i]; + this.#line = line; + this.#points = points; + this.#lastIndex = 0; + this.toSVGPath(); + } + return { + path: { + d: this.#lastSVGPath + } + }; + } + toSVGPath() { + const firstX = Outline.svgRound(this.#line[4]); + const firstY = Outline.svgRound(this.#line[5]); + if (this.#points.length === 2) { + this.#lastSVGPath = `${this.#lastSVGPath} M ${firstX} ${firstY} Z`; + return this.#lastSVGPath; + } + if (this.#points.length <= 6) { + const i = this.#lastSVGPath.lastIndexOf("M"); + this.#lastSVGPath = `${this.#lastSVGPath.slice(0, i)} M ${firstX} ${firstY}`; + this.#lastIndex = 6; + } + if (this.#points.length === 4) { + const secondX = Outline.svgRound(this.#line[10]); + const secondY = Outline.svgRound(this.#line[11]); + this.#lastSVGPath = `${this.#lastSVGPath} L ${secondX} ${secondY}`; + this.#lastIndex = 12; + return this.#lastSVGPath; + } + const buffer = []; + if (this.#lastIndex === 0) { + buffer.push(`M ${firstX} ${firstY}`); + this.#lastIndex = 6; + } + for (let i = this.#lastIndex, ii = this.#line.length; i < ii; i += 6) { + const [c1x, c1y, c2x, c2y, x, y] = this.#line.slice(i, i + 6).map(Outline.svgRound); + buffer.push(`C${c1x} ${c1y} ${c2x} ${c2y} ${x} ${y}`); + } + this.#lastSVGPath += buffer.join(" "); + this.#lastIndex = this.#line.length; + return this.#lastSVGPath; + } + getOutlines(parentWidth, parentHeight, scale, innerMargin) { + const last = this.#lines.at(-1); + last.line = new Float32Array(last.line); + last.points = new Float32Array(last.points); + this.#outlines.build(this.#lines, parentWidth, parentHeight, scale, this.#rotation, this.#thickness, innerMargin); + this.#last = null; + this.#line = null; + this.#lines = null; + this.#lastSVGPath = null; + return this.#outlines; + } + get defaultSVGProperties() { + return { + root: { + viewBox: "0 0 10000 10000" + }, + rootClass: { + draw: true + }, + bbox: [0, 0, 1, 1] + }; + } +} +class InkDrawOutline extends Outline { + #bbox; + #currentRotation = 0; + #innerMargin; + #lines; + #parentWidth; + #parentHeight; + #parentScale; + #rotation; + #thickness; + build(lines, parentWidth, parentHeight, parentScale, rotation, thickness, innerMargin) { + this.#parentWidth = parentWidth; + this.#parentHeight = parentHeight; + this.#parentScale = parentScale; + this.#rotation = rotation; + this.#thickness = thickness; + this.#innerMargin = innerMargin ?? 0; + this.#lines = lines; + this.#computeBbox(); + } + setLastElement(element) { + this.#lines.push(element); + return { + path: { + d: this.toSVGPath() + } + }; + } + removeLastElement() { + this.#lines.pop(); + return { + path: { + d: this.toSVGPath() + } + }; + } + toSVGPath() { + const buffer = []; + for (const { + line + } of this.#lines) { + buffer.push(`M${Outline.svgRound(line[4])} ${Outline.svgRound(line[5])}`); + if (line.length === 6) { + buffer.push("Z"); + continue; + } + if (line.length === 12) { + buffer.push(`L${Outline.svgRound(line[10])} ${Outline.svgRound(line[11])}`); + continue; + } + for (let i = 6, ii = line.length; i < ii; i += 6) { + const [c1x, c1y, c2x, c2y, x, y] = line.subarray(i, i + 6).map(Outline.svgRound); + buffer.push(`C${c1x} ${c1y} ${c2x} ${c2y} ${x} ${y}`); + } + } + return buffer.join(""); + } + serialize([pageX, pageY, pageWidth, pageHeight], isForCopying) { + const serializedLines = []; + const serializedPoints = []; + const [x, y, width, height] = this.#getBBoxWithNoMargin(); + let tx, ty, sx, sy, x1, y1, x2, y2, rescaleFn; + switch (this.#rotation) { + case 0: + rescaleFn = Outline._rescale; + tx = pageX; + ty = pageY + pageHeight; + sx = pageWidth; + sy = -pageHeight; + x1 = pageX + x * pageWidth; + y1 = pageY + (1 - y - height) * pageHeight; + x2 = pageX + (x + width) * pageWidth; + y2 = pageY + (1 - y) * pageHeight; + break; + case 90: + rescaleFn = Outline._rescaleAndSwap; + tx = pageX; + ty = pageY; + sx = pageWidth; + sy = pageHeight; + x1 = pageX + y * pageWidth; + y1 = pageY + x * pageHeight; + x2 = pageX + (y + height) * pageWidth; + y2 = pageY + (x + width) * pageHeight; + break; + case 180: + rescaleFn = Outline._rescale; + tx = pageX + pageWidth; + ty = pageY; + sx = -pageWidth; + sy = pageHeight; + x1 = pageX + (1 - x - width) * pageWidth; + y1 = pageY + y * pageHeight; + x2 = pageX + (1 - x) * pageWidth; + y2 = pageY + (y + height) * pageHeight; + break; + case 270: + rescaleFn = Outline._rescaleAndSwap; + tx = pageX + pageWidth; + ty = pageY + pageHeight; + sx = -pageWidth; + sy = -pageHeight; + x1 = pageX + (1 - y - height) * pageWidth; + y1 = pageY + (1 - x - width) * pageHeight; + x2 = pageX + (1 - y) * pageWidth; + y2 = pageY + (1 - x) * pageHeight; + break; + } + for (const { + line, + points + } of this.#lines) { + serializedLines.push(rescaleFn(line, tx, ty, sx, sy, isForCopying ? new Array(line.length) : null)); + serializedPoints.push(rescaleFn(points, tx, ty, sx, sy, isForCopying ? new Array(points.length) : null)); + } + return { + lines: serializedLines, + points: serializedPoints, + rect: [x1, y1, x2, y2] + }; + } + static deserialize(pageX, pageY, pageWidth, pageHeight, innerMargin, { + paths: { + lines, + points + }, + rotation, + thickness + }) { + const newLines = []; + let tx, ty, sx, sy, rescaleFn; + switch (rotation) { + case 0: + rescaleFn = Outline._rescale; + tx = -pageX / pageWidth; + ty = pageY / pageHeight + 1; + sx = 1 / pageWidth; + sy = -1 / pageHeight; + break; + case 90: + rescaleFn = Outline._rescaleAndSwap; + tx = -pageY / pageHeight; + ty = -pageX / pageWidth; + sx = 1 / pageHeight; + sy = 1 / pageWidth; + break; + case 180: + rescaleFn = Outline._rescale; + tx = pageX / pageWidth + 1; + ty = -pageY / pageHeight; + sx = -1 / pageWidth; + sy = 1 / pageHeight; + break; + case 270: + rescaleFn = Outline._rescaleAndSwap; + tx = pageY / pageHeight + 1; + ty = pageX / pageWidth + 1; + sx = -1 / pageHeight; + sy = -1 / pageWidth; + break; + } + if (!lines) { + lines = []; + for (const point of points) { + const len = point.length; + if (len === 2) { + lines.push(new Float32Array([NaN, NaN, NaN, NaN, point[0], point[1]])); + continue; + } + if (len === 4) { + lines.push(new Float32Array([NaN, NaN, NaN, NaN, point[0], point[1], NaN, NaN, NaN, NaN, point[2], point[3]])); + continue; + } + const line = new Float32Array(3 * (len - 2)); + lines.push(line); + let [x1, y1, x2, y2] = point.subarray(0, 4); + line.set([NaN, NaN, NaN, NaN, x1, y1], 0); + for (let i = 4; i < len; i += 2) { + const x = point[i]; + const y = point[i + 1]; + line.set(Outline.createBezierPoints(x1, y1, x2, y2, x, y), (i - 2) * 3); + [x1, y1, x2, y2] = [x2, y2, x, y]; + } + } + } + for (let i = 0, ii = lines.length; i < ii; i++) { + newLines.push({ + line: rescaleFn(lines[i].map(x => x ?? NaN), tx, ty, sx, sy), + points: rescaleFn(points[i].map(x => x ?? NaN), tx, ty, sx, sy) + }); + } + const outlines = new InkDrawOutline(); + outlines.build(newLines, pageWidth, pageHeight, 1, rotation, thickness, innerMargin); + return outlines; + } + #getMarginComponents(thickness = this.#thickness) { + const margin = this.#innerMargin + thickness / 2 * this.#parentScale; + return this.#rotation % 180 === 0 ? [margin / this.#parentWidth, margin / this.#parentHeight] : [margin / this.#parentHeight, margin / this.#parentWidth]; + } + #getBBoxWithNoMargin() { + const [x, y, width, height] = this.#bbox; + const [marginX, marginY] = this.#getMarginComponents(0); + return [x + marginX, y + marginY, width - 2 * marginX, height - 2 * marginY]; + } + #computeBbox() { + const bbox = this.#bbox = new Float32Array([Infinity, Infinity, -Infinity, -Infinity]); + for (const { + line + } of this.#lines) { + if (line.length <= 12) { + for (let i = 4, ii = line.length; i < ii; i += 6) { + const [x, y] = line.subarray(i, i + 2); + bbox[0] = Math.min(bbox[0], x); + bbox[1] = Math.min(bbox[1], y); + bbox[2] = Math.max(bbox[2], x); + bbox[3] = Math.max(bbox[3], y); + } + continue; + } + let lastX = line[4], + lastY = line[5]; + for (let i = 6, ii = line.length; i < ii; i += 6) { + const [c1x, c1y, c2x, c2y, x, y] = line.subarray(i, i + 6); + Util.bezierBoundingBox(lastX, lastY, c1x, c1y, c2x, c2y, x, y, bbox); + lastX = x; + lastY = y; + } + } + const [marginX, marginY] = this.#getMarginComponents(); + bbox[0] = Math.min(1, Math.max(0, bbox[0] - marginX)); + bbox[1] = Math.min(1, Math.max(0, bbox[1] - marginY)); + bbox[2] = Math.min(1, Math.max(0, bbox[2] + marginX)); + bbox[3] = Math.min(1, Math.max(0, bbox[3] + marginY)); + bbox[2] -= bbox[0]; + bbox[3] -= bbox[1]; + } + get box() { + return this.#bbox; + } + updateProperty(name, value) { + if (name === "stroke-width") { + return this.#updateThickness(value); + } + return null; + } + #updateThickness(thickness) { + const [oldMarginX, oldMarginY] = this.#getMarginComponents(); + this.#thickness = thickness; + const [newMarginX, newMarginY] = this.#getMarginComponents(); + const [diffMarginX, diffMarginY] = [newMarginX - oldMarginX, newMarginY - oldMarginY]; + const bbox = this.#bbox; + bbox[0] -= diffMarginX; + bbox[1] -= diffMarginY; + bbox[2] += 2 * diffMarginX; + bbox[3] += 2 * diffMarginY; + return bbox; + } + updateParentDimensions([width, height], scale) { + const [oldMarginX, oldMarginY] = this.#getMarginComponents(); + this.#parentWidth = width; + this.#parentHeight = height; + this.#parentScale = scale; + const [newMarginX, newMarginY] = this.#getMarginComponents(); + const diffMarginX = newMarginX - oldMarginX; + const diffMarginY = newMarginY - oldMarginY; + const bbox = this.#bbox; + bbox[0] -= diffMarginX; + bbox[1] -= diffMarginY; + bbox[2] += 2 * diffMarginX; + bbox[3] += 2 * diffMarginY; + return bbox; + } + updateRotation(rotation) { + this.#currentRotation = rotation; + return { + path: { + transform: this.rotationTransform + } + }; + } + get viewBox() { + return this.#bbox.map(Outline.svgRound).join(" "); + } + get defaultProperties() { + const [x, y] = this.#bbox; + return { + root: { + viewBox: this.viewBox + }, + path: { + "transform-origin": `${Outline.svgRound(x)} ${Outline.svgRound(y)}` + } + }; + } + get rotationTransform() { + const [,, width, height] = this.#bbox; + let a = 0, + b = 0, + c = 0, + d = 0, + e = 0, + f = 0; + switch (this.#currentRotation) { + case 90: + b = height / width; + c = -width / height; + e = width; + break; + case 180: + a = -1; + d = -1; + e = width; + f = height; + break; + case 270: + b = -height / width; + c = width / height; + f = height; + break; + default: + return ""; + } + return `matrix(${a} ${b} ${c} ${d} ${Outline.svgRound(e)} ${Outline.svgRound(f)})`; + } + getPathResizingSVGProperties([newX, newY, newWidth, newHeight]) { + const [marginX, marginY] = this.#getMarginComponents(); + const [x, y, width, height] = this.#bbox; + if (Math.abs(width - marginX) <= Outline.PRECISION || Math.abs(height - marginY) <= Outline.PRECISION) { + const tx = newX + newWidth / 2 - (x + width / 2); + const ty = newY + newHeight / 2 - (y + height / 2); + return { + path: { + "transform-origin": `${Outline.svgRound(newX)} ${Outline.svgRound(newY)}`, + transform: `${this.rotationTransform} translate(${tx} ${ty})` + } + }; + } + const s1x = (newWidth - 2 * marginX) / (width - 2 * marginX); + const s1y = (newHeight - 2 * marginY) / (height - 2 * marginY); + const s2x = width / newWidth; + const s2y = height / newHeight; + return { + path: { + "transform-origin": `${Outline.svgRound(x)} ${Outline.svgRound(y)}`, + transform: `${this.rotationTransform} scale(${s2x} ${s2y}) ` + `translate(${Outline.svgRound(marginX)} ${Outline.svgRound(marginY)}) scale(${s1x} ${s1y}) ` + `translate(${Outline.svgRound(-marginX)} ${Outline.svgRound(-marginY)})` + } + }; + } + getPathResizedSVGProperties([newX, newY, newWidth, newHeight]) { + const [marginX, marginY] = this.#getMarginComponents(); + const bbox = this.#bbox; + const [x, y, width, height] = bbox; + bbox[0] = newX; + bbox[1] = newY; + bbox[2] = newWidth; + bbox[3] = newHeight; + if (Math.abs(width - marginX) <= Outline.PRECISION || Math.abs(height - marginY) <= Outline.PRECISION) { + const tx = newX + newWidth / 2 - (x + width / 2); + const ty = newY + newHeight / 2 - (y + height / 2); + for (const { + line, + points + } of this.#lines) { + Outline._translate(line, tx, ty, line); + Outline._translate(points, tx, ty, points); + } + return { + root: { + viewBox: this.viewBox + }, + path: { + "transform-origin": `${Outline.svgRound(newX)} ${Outline.svgRound(newY)}`, + transform: this.rotationTransform || null, + d: this.toSVGPath() + } + }; + } + const s1x = (newWidth - 2 * marginX) / (width - 2 * marginX); + const s1y = (newHeight - 2 * marginY) / (height - 2 * marginY); + const tx = -s1x * (x + marginX) + newX + marginX; + const ty = -s1y * (y + marginY) + newY + marginY; + if (s1x !== 1 || s1y !== 1 || tx !== 0 || ty !== 0) { + for (const { + line, + points + } of this.#lines) { + Outline._rescale(line, tx, ty, s1x, s1y, line); + Outline._rescale(points, tx, ty, s1x, s1y, points); + } + } + return { + root: { + viewBox: this.viewBox + }, + path: { + "transform-origin": `${Outline.svgRound(newX)} ${Outline.svgRound(newY)}`, + transform: this.rotationTransform || null, + d: this.toSVGPath() + } + }; + } + getPathTranslatedSVGProperties([newX, newY], parentDimensions) { + const [newParentWidth, newParentHeight] = parentDimensions; + const bbox = this.#bbox; + const tx = newX - bbox[0]; + const ty = newY - bbox[1]; + if (this.#parentWidth === newParentWidth && this.#parentHeight === newParentHeight) { + for (const { + line, + points + } of this.#lines) { + Outline._translate(line, tx, ty, line); + Outline._translate(points, tx, ty, points); + } + } else { + const sx = this.#parentWidth / newParentWidth; + const sy = this.#parentHeight / newParentHeight; + this.#parentWidth = newParentWidth; + this.#parentHeight = newParentHeight; + for (const { + line, + points + } of this.#lines) { + Outline._rescale(line, tx, ty, sx, sy, line); + Outline._rescale(points, tx, ty, sx, sy, points); + } + bbox[2] *= sx; + bbox[3] *= sy; + } + bbox[0] = newX; + bbox[1] = newY; + return { + root: { + viewBox: this.viewBox + }, + path: { + d: this.toSVGPath(), + "transform-origin": `${Outline.svgRound(newX)} ${Outline.svgRound(newY)}` + } + }; + } + get defaultSVGProperties() { + const bbox = this.#bbox; + return { + root: { + viewBox: this.viewBox + }, + rootClass: { + draw: true + }, + path: { + d: this.toSVGPath(), + "transform-origin": `${Outline.svgRound(bbox[0])} ${Outline.svgRound(bbox[1])}`, + transform: this.rotationTransform || null + }, + bbox + }; + } +} + +;// ./src/display/editor/ink.js + + + + + +class InkDrawingOptions extends DrawingOptions { + #viewParameters; + constructor(viewerParameters) { + super(); + this.#viewParameters = viewerParameters; + super.updateProperties({ + fill: "none", + stroke: AnnotationEditor._defaultLineColor, + "stroke-opacity": 1, + "stroke-width": 1, + "stroke-linecap": "round", + "stroke-linejoin": "round", + "stroke-miterlimit": 10 + }); + } + updateSVGProperty(name, value) { + if (name === "stroke-width") { + value ??= this["stroke-width"]; + value *= this.#viewParameters.realScale; + } + super.updateSVGProperty(name, value); + } + clone() { + const clone = new InkDrawingOptions(this.#viewParameters); + clone.updateAll(this); + return clone; + } +} +class InkEditor extends DrawingEditor { + static _type = "ink"; + static _editorType = AnnotationEditorType.INK; + static _defaultDrawingOptions = null; + constructor(params) { + super({ + ...params, + name: "inkEditor" + }); + this._willKeepAspectRatio = true; + } + static initialize(l10n, uiManager) { + AnnotationEditor.initialize(l10n, uiManager); + this._defaultDrawingOptions = new InkDrawingOptions(uiManager.viewParameters); + } + static getDefaultDrawingOptions(options) { + const clone = this._defaultDrawingOptions.clone(); + clone.updateProperties(options); + return clone; + } + static get supportMultipleDrawings() { + return true; + } + static get typesMap() { + return shadow(this, "typesMap", new Map([[AnnotationEditorParamsType.INK_THICKNESS, "stroke-width"], [AnnotationEditorParamsType.INK_COLOR, "stroke"], [AnnotationEditorParamsType.INK_OPACITY, "stroke-opacity"]])); + } + static createDrawerInstance(x, y, parentWidth, parentHeight, rotation) { + return new InkDrawOutliner(x, y, parentWidth, parentHeight, rotation, this._defaultDrawingOptions["stroke-width"]); + } + static deserializeDraw(pageX, pageY, pageWidth, pageHeight, innerMargin, data) { + return InkDrawOutline.deserialize(pageX, pageY, pageWidth, pageHeight, innerMargin, data); + } + static async deserialize(data, parent, uiManager) { + let initialData = null; + if (data instanceof InkAnnotationElement) { + const { + data: { + inkLists, + rect, + rotation, + id, + color, + opacity, + borderStyle: { + rawWidth: thickness + }, + popupRef + }, + parent: { + page: { + pageNumber + } + } + } = data; + initialData = data = { + annotationType: AnnotationEditorType.INK, + color: Array.from(color), + thickness, + opacity, + paths: { + points: inkLists + }, + boxes: null, + pageIndex: pageNumber - 1, + rect: rect.slice(0), + rotation, + id, + deleted: false, + popupRef + }; + } + const editor = await super.deserialize(data, parent, uiManager); + editor.annotationElementId = data.id || null; + editor._initialData = initialData; + return editor; + } + onScaleChanging() { + if (!this.parent) { + return; + } + super.onScaleChanging(); + const { + _drawId, + _drawingOptions, + parent + } = this; + _drawingOptions.updateSVGProperty("stroke-width"); + parent.drawLayer.updateProperties(_drawId, _drawingOptions.toSVGProperties()); + } + static onScaleChangingWhenDrawing() { + const parent = this._currentParent; + if (!parent) { + return; + } + super.onScaleChangingWhenDrawing(); + this._defaultDrawingOptions.updateSVGProperty("stroke-width"); + parent.drawLayer.updateProperties(this._currentDrawId, this._defaultDrawingOptions.toSVGProperties()); + } + createDrawingOptions({ + color, + thickness, + opacity + }) { + this._drawingOptions = InkEditor.getDefaultDrawingOptions({ + stroke: Util.makeHexColor(...color), + "stroke-width": thickness, + "stroke-opacity": opacity + }); + } + serialize(isForCopying = false) { + if (this.isEmpty()) { + return null; + } + if (this.deleted) { + return this.serializeDeleted(); + } + const { + lines, + points, + rect + } = this.serializeDraw(isForCopying); + const { + _drawingOptions: { + stroke, + "stroke-opacity": opacity, + "stroke-width": thickness + } + } = this; + const serialized = { + annotationType: AnnotationEditorType.INK, + color: AnnotationEditor._colorManager.convert(stroke), + opacity, + thickness, + paths: { + lines, + points + }, + pageIndex: this.pageIndex, + rect, + rotation: this.rotation, + structTreeParentId: this._structTreeParentId + }; + if (isForCopying) { + return serialized; + } + if (this.annotationElementId && !this.#hasElementChanged(serialized)) { + return null; + } + serialized.id = this.annotationElementId; + return serialized; + } + #hasElementChanged(serialized) { + const { + color, + thickness, + opacity, + pageIndex + } = this._initialData; + return this._hasBeenMoved || this._hasBeenResized || serialized.color.some((c, i) => c !== color[i]) || serialized.thickness !== thickness || serialized.opacity !== opacity || serialized.pageIndex !== pageIndex; + } + renderAnnotationElement(annotation) { + const { + points, + rect + } = this.serializeDraw(false); + annotation.updateEdited({ + rect, + thickness: this._drawingOptions["stroke-width"], + points + }); + return null; + } +} + +;// ./src/display/editor/stamp.js + + + + +class StampEditor extends AnnotationEditor { + #bitmap = null; + #bitmapId = null; + #bitmapPromise = null; + #bitmapUrl = null; + #bitmapFile = null; + #bitmapFileName = ""; + #canvas = null; + #resizeTimeoutId = null; + #isSvg = false; + #hasBeenAddedInUndoStack = false; + static _type = "stamp"; + static _editorType = AnnotationEditorType.STAMP; + constructor(params) { + super({ + ...params, + name: "stampEditor" + }); + this.#bitmapUrl = params.bitmapUrl; + this.#bitmapFile = params.bitmapFile; + } + static initialize(l10n, uiManager) { + AnnotationEditor.initialize(l10n, uiManager); + } + static get supportedTypes() { + const types = ["apng", "avif", "bmp", "gif", "jpeg", "png", "svg+xml", "webp", "x-icon"]; + return shadow(this, "supportedTypes", types.map(type => `image/${type}`)); + } + static get supportedTypesStr() { + return shadow(this, "supportedTypesStr", this.supportedTypes.join(",")); + } + static isHandlingMimeForPasting(mime) { + return this.supportedTypes.includes(mime); + } + static paste(item, parent) { + parent.pasteEditor(AnnotationEditorType.STAMP, { + bitmapFile: item.getAsFile() + }); + } + altTextFinish() { + if (this._uiManager.useNewAltTextFlow) { + this.div.hidden = false; + } + super.altTextFinish(); + } + get telemetryFinalData() { + return { + type: "stamp", + hasAltText: !!this.altTextData?.altText + }; + } + static computeTelemetryFinalData(data) { + const hasAltTextStats = data.get("hasAltText"); + return { + hasAltText: hasAltTextStats.get(true) ?? 0, + hasNoAltText: hasAltTextStats.get(false) ?? 0 + }; + } + #getBitmapFetched(data, fromId = false) { + if (!data) { + this.remove(); + return; + } + this.#bitmap = data.bitmap; + if (!fromId) { + this.#bitmapId = data.id; + this.#isSvg = data.isSvg; + } + if (data.file) { + this.#bitmapFileName = data.file.name; + } + this.#createCanvas(); + } + #getBitmapDone() { + this.#bitmapPromise = null; + this._uiManager.enableWaiting(false); + if (!this.#canvas) { + return; + } + if (this._uiManager.useNewAltTextWhenAddingImage && this._uiManager.useNewAltTextFlow && this.#bitmap) { + this._editToolbar.hide(); + this._uiManager.editAltText(this, true); + return; + } + if (!this._uiManager.useNewAltTextWhenAddingImage && this._uiManager.useNewAltTextFlow && this.#bitmap) { + this._reportTelemetry({ + action: "pdfjs.image.image_added", + data: { + alt_text_modal: false, + alt_text_type: "empty" + } + }); + try { + this.mlGuessAltText(); + } catch {} + } + this.div.focus(); + } + async mlGuessAltText(imageData = null, updateAltTextData = true) { + if (this.hasAltTextData()) { + return null; + } + const { + mlManager + } = this._uiManager; + if (!mlManager) { + throw new Error("No ML."); + } + if (!(await mlManager.isEnabledFor("altText"))) { + throw new Error("ML isn't enabled for alt text."); + } + const { + data, + width, + height + } = imageData || this.copyCanvas(null, null, true).imageData; + const response = await mlManager.guess({ + name: "altText", + request: { + data, + width, + height, + channels: data.length / (width * height) + } + }); + if (!response) { + throw new Error("No response from the AI service."); + } + if (response.error) { + throw new Error("Error from the AI service."); + } + if (response.cancel) { + return null; + } + if (!response.output) { + throw new Error("No valid response from the AI service."); + } + const altText = response.output; + await this.setGuessedAltText(altText); + if (updateAltTextData && !this.hasAltTextData()) { + this.altTextData = { + alt: altText, + decorative: false + }; + } + return altText; + } + #getBitmap() { + if (this.#bitmapId) { + this._uiManager.enableWaiting(true); + this._uiManager.imageManager.getFromId(this.#bitmapId).then(data => this.#getBitmapFetched(data, true)).finally(() => this.#getBitmapDone()); + return; + } + if (this.#bitmapUrl) { + const url = this.#bitmapUrl; + this.#bitmapUrl = null; + this._uiManager.enableWaiting(true); + this.#bitmapPromise = this._uiManager.imageManager.getFromUrl(url).then(data => this.#getBitmapFetched(data)).finally(() => this.#getBitmapDone()); + return; + } + if (this.#bitmapFile) { + const file = this.#bitmapFile; + this.#bitmapFile = null; + this._uiManager.enableWaiting(true); + this.#bitmapPromise = this._uiManager.imageManager.getFromFile(file).then(data => this.#getBitmapFetched(data)).finally(() => this.#getBitmapDone()); + return; + } + const input = document.createElement("input"); + input.type = "file"; + input.accept = StampEditor.supportedTypesStr; + const signal = this._uiManager._signal; + this.#bitmapPromise = new Promise(resolve => { + input.addEventListener("change", async () => { + if (!input.files || input.files.length === 0) { + this.remove(); + } else { + this._uiManager.enableWaiting(true); + const data = await this._uiManager.imageManager.getFromFile(input.files[0]); + this._reportTelemetry({ + action: "pdfjs.image.image_selected", + data: { + alt_text_modal: this._uiManager.useNewAltTextFlow + } + }); + this.#getBitmapFetched(data); + } + resolve(); + }, { + signal + }); + input.addEventListener("cancel", () => { + this.remove(); + resolve(); + }, { + signal + }); + }).finally(() => this.#getBitmapDone()); + input.click(); + } + remove() { + if (this.#bitmapId) { + this.#bitmap = null; + this._uiManager.imageManager.deleteId(this.#bitmapId); + this.#canvas?.remove(); + this.#canvas = null; + if (this.#resizeTimeoutId) { + clearTimeout(this.#resizeTimeoutId); + this.#resizeTimeoutId = null; + } + } + super.remove(); + } + rebuild() { + if (!this.parent) { + if (this.#bitmapId) { + this.#getBitmap(); + } + return; + } + super.rebuild(); + if (this.div === null) { + return; + } + if (this.#bitmapId && this.#canvas === null) { + this.#getBitmap(); + } + if (!this.isAttachedToDOM) { + this.parent.add(this); + } + } + onceAdded(focus) { + this._isDraggable = true; + if (focus) { + this.div.focus(); + } + } + isEmpty() { + return !(this.#bitmapPromise || this.#bitmap || this.#bitmapUrl || this.#bitmapFile || this.#bitmapId); + } + get isResizable() { + return true; + } + render() { + if (this.div) { + return this.div; + } + let baseX, baseY; + if (this.width) { + baseX = this.x; + baseY = this.y; + } + super.render(); + this.div.hidden = true; + this.div.setAttribute("role", "figure"); + this.addAltTextButton(); + if (this.#bitmap) { + this.#createCanvas(); + } else { + this.#getBitmap(); + } + if (this.width && !this.annotationElementId) { + const [parentWidth, parentHeight] = this.parentDimensions; + this.setAt(baseX * parentWidth, baseY * parentHeight, this.width * parentWidth, this.height * parentHeight); + } + this._uiManager.addShouldRescale(this); + return this.div; + } + _onResized() { + this.onScaleChanging(); + } + onScaleChanging() { + if (!this.parent) { + return; + } + if (this.#resizeTimeoutId !== null) { + clearTimeout(this.#resizeTimeoutId); + } + const TIME_TO_WAIT = 200; + this.#resizeTimeoutId = setTimeout(() => { + this.#resizeTimeoutId = null; + this.#drawBitmap(); + }, TIME_TO_WAIT); + } + #createCanvas() { + const { + div + } = this; + let { + width, + height + } = this.#bitmap; + const [pageWidth, pageHeight] = this.pageDimensions; + const MAX_RATIO = 0.75; + if (this.width) { + width = this.width * pageWidth; + height = this.height * pageHeight; + } else if (width > MAX_RATIO * pageWidth || height > MAX_RATIO * pageHeight) { + const factor = Math.min(MAX_RATIO * pageWidth / width, MAX_RATIO * pageHeight / height); + width *= factor; + height *= factor; + } + const [parentWidth, parentHeight] = this.parentDimensions; + this.setDims(width * parentWidth / pageWidth, height * parentHeight / pageHeight); + this._uiManager.enableWaiting(false); + const canvas = this.#canvas = document.createElement("canvas"); + canvas.setAttribute("role", "img"); + this.addContainer(canvas); + this.width = width / pageWidth; + this.height = height / pageHeight; + if (this._initialOptions?.isCentered) { + this.center(); + } else { + this.fixAndSetPosition(); + } + this._initialOptions = null; + if (!this._uiManager.useNewAltTextWhenAddingImage || !this._uiManager.useNewAltTextFlow || this.annotationElementId) { + div.hidden = false; + } + this.#drawBitmap(); + if (!this.#hasBeenAddedInUndoStack) { + this.parent.addUndoableEditor(this); + this.#hasBeenAddedInUndoStack = true; + } + this._reportTelemetry({ + action: "inserted_image" + }); + if (this.#bitmapFileName) { + canvas.setAttribute("aria-label", this.#bitmapFileName); + } + } + copyCanvas(maxDataDimension, maxPreviewDimension, createImageData = false) { + if (!maxDataDimension) { + maxDataDimension = 224; + } + const { + width: bitmapWidth, + height: bitmapHeight + } = this.#bitmap; + const outputScale = new OutputScale(); + let bitmap = this.#bitmap; + let width = bitmapWidth, + height = bitmapHeight; + let canvas = null; + if (maxPreviewDimension) { + if (bitmapWidth > maxPreviewDimension || bitmapHeight > maxPreviewDimension) { + const ratio = Math.min(maxPreviewDimension / bitmapWidth, maxPreviewDimension / bitmapHeight); + width = Math.floor(bitmapWidth * ratio); + height = Math.floor(bitmapHeight * ratio); + } + canvas = document.createElement("canvas"); + const scaledWidth = canvas.width = Math.ceil(width * outputScale.sx); + const scaledHeight = canvas.height = Math.ceil(height * outputScale.sy); + if (!this.#isSvg) { + bitmap = this.#scaleBitmap(scaledWidth, scaledHeight); + } + const ctx = canvas.getContext("2d"); + ctx.filter = this._uiManager.hcmFilter; + let white = "white", + black = "#cfcfd8"; + if (this._uiManager.hcmFilter !== "none") { + black = "black"; + } else if (window.matchMedia?.("(prefers-color-scheme: dark)").matches) { + white = "#8f8f9d"; + black = "#42414d"; + } + const boxDim = 15; + const boxDimWidth = boxDim * outputScale.sx; + const boxDimHeight = boxDim * outputScale.sy; + const pattern = new OffscreenCanvas(boxDimWidth * 2, boxDimHeight * 2); + const patternCtx = pattern.getContext("2d"); + patternCtx.fillStyle = white; + patternCtx.fillRect(0, 0, boxDimWidth * 2, boxDimHeight * 2); + patternCtx.fillStyle = black; + patternCtx.fillRect(0, 0, boxDimWidth, boxDimHeight); + patternCtx.fillRect(boxDimWidth, boxDimHeight, boxDimWidth, boxDimHeight); + ctx.fillStyle = ctx.createPattern(pattern, "repeat"); + ctx.fillRect(0, 0, scaledWidth, scaledHeight); + ctx.drawImage(bitmap, 0, 0, bitmap.width, bitmap.height, 0, 0, scaledWidth, scaledHeight); + } + let imageData = null; + if (createImageData) { + let dataWidth, dataHeight; + if (outputScale.symmetric && bitmap.width < maxDataDimension && bitmap.height < maxDataDimension) { + dataWidth = bitmap.width; + dataHeight = bitmap.height; + } else { + bitmap = this.#bitmap; + if (bitmapWidth > maxDataDimension || bitmapHeight > maxDataDimension) { + const ratio = Math.min(maxDataDimension / bitmapWidth, maxDataDimension / bitmapHeight); + dataWidth = Math.floor(bitmapWidth * ratio); + dataHeight = Math.floor(bitmapHeight * ratio); + if (!this.#isSvg) { + bitmap = this.#scaleBitmap(dataWidth, dataHeight); + } + } + } + const offscreen = new OffscreenCanvas(dataWidth, dataHeight); + const offscreenCtx = offscreen.getContext("2d", { + willReadFrequently: true + }); + offscreenCtx.drawImage(bitmap, 0, 0, bitmap.width, bitmap.height, 0, 0, dataWidth, dataHeight); + imageData = { + width: dataWidth, + height: dataHeight, + data: offscreenCtx.getImageData(0, 0, dataWidth, dataHeight).data + }; + } + return { + canvas, + width, + height, + imageData + }; + } + #scaleBitmap(width, height) { + const { + width: bitmapWidth, + height: bitmapHeight + } = this.#bitmap; + let newWidth = bitmapWidth; + let newHeight = bitmapHeight; + let bitmap = this.#bitmap; + while (newWidth > 2 * width || newHeight > 2 * height) { + const prevWidth = newWidth; + const prevHeight = newHeight; + if (newWidth > 2 * width) { + newWidth = newWidth >= 16384 ? Math.floor(newWidth / 2) - 1 : Math.ceil(newWidth / 2); + } + if (newHeight > 2 * height) { + newHeight = newHeight >= 16384 ? Math.floor(newHeight / 2) - 1 : Math.ceil(newHeight / 2); + } + const offscreen = new OffscreenCanvas(newWidth, newHeight); + const ctx = offscreen.getContext("2d"); + ctx.drawImage(bitmap, 0, 0, prevWidth, prevHeight, 0, 0, newWidth, newHeight); + bitmap = offscreen.transferToImageBitmap(); + } + return bitmap; + } + #drawBitmap() { + const [parentWidth, parentHeight] = this.parentDimensions; + const { + width, + height + } = this; + const outputScale = new OutputScale(); + const scaledWidth = Math.ceil(width * parentWidth * outputScale.sx); + const scaledHeight = Math.ceil(height * parentHeight * outputScale.sy); + const canvas = this.#canvas; + if (!canvas || canvas.width === scaledWidth && canvas.height === scaledHeight) { + return; + } + canvas.width = scaledWidth; + canvas.height = scaledHeight; + const bitmap = this.#isSvg ? this.#bitmap : this.#scaleBitmap(scaledWidth, scaledHeight); + const ctx = canvas.getContext("2d"); + ctx.filter = this._uiManager.hcmFilter; + ctx.drawImage(bitmap, 0, 0, bitmap.width, bitmap.height, 0, 0, scaledWidth, scaledHeight); + } + getImageForAltText() { + return this.#canvas; + } + #serializeBitmap(toUrl) { + if (toUrl) { + if (this.#isSvg) { + const url = this._uiManager.imageManager.getSvgUrl(this.#bitmapId); + if (url) { + return url; + } + } + const canvas = document.createElement("canvas"); + ({ + width: canvas.width, + height: canvas.height + } = this.#bitmap); + const ctx = canvas.getContext("2d"); + ctx.drawImage(this.#bitmap, 0, 0); + return canvas.toDataURL(); + } + if (this.#isSvg) { + const [pageWidth, pageHeight] = this.pageDimensions; + const width = Math.round(this.width * pageWidth * PixelsPerInch.PDF_TO_CSS_UNITS); + const height = Math.round(this.height * pageHeight * PixelsPerInch.PDF_TO_CSS_UNITS); + const offscreen = new OffscreenCanvas(width, height); + const ctx = offscreen.getContext("2d"); + ctx.drawImage(this.#bitmap, 0, 0, this.#bitmap.width, this.#bitmap.height, 0, 0, width, height); + return offscreen.transferToImageBitmap(); + } + return structuredClone(this.#bitmap); + } + static async deserialize(data, parent, uiManager) { + let initialData = null; + if (data instanceof StampAnnotationElement) { + const { + data: { + rect, + rotation, + id, + structParent, + popupRef + }, + container, + parent: { + page: { + pageNumber + } + } + } = data; + const canvas = container.querySelector("canvas"); + const imageData = uiManager.imageManager.getFromCanvas(container.id, canvas); + canvas.remove(); + const altText = (await parent._structTree.getAriaAttributes(`${AnnotationPrefix}${id}`))?.get("aria-label") || ""; + initialData = data = { + annotationType: AnnotationEditorType.STAMP, + bitmapId: imageData.id, + bitmap: imageData.bitmap, + pageIndex: pageNumber - 1, + rect: rect.slice(0), + rotation, + id, + deleted: false, + accessibilityData: { + decorative: false, + altText + }, + isSvg: false, + structParent, + popupRef + }; + } + const editor = await super.deserialize(data, parent, uiManager); + const { + rect, + bitmap, + bitmapUrl, + bitmapId, + isSvg, + accessibilityData + } = data; + if (bitmapId && uiManager.imageManager.isValidId(bitmapId)) { + editor.#bitmapId = bitmapId; + if (bitmap) { + editor.#bitmap = bitmap; + } + } else { + editor.#bitmapUrl = bitmapUrl; + } + editor.#isSvg = isSvg; + const [parentWidth, parentHeight] = editor.pageDimensions; + editor.width = (rect[2] - rect[0]) / parentWidth; + editor.height = (rect[3] - rect[1]) / parentHeight; + editor.annotationElementId = data.id || null; + if (accessibilityData) { + editor.altTextData = accessibilityData; + } + editor._initialData = initialData; + editor.#hasBeenAddedInUndoStack = !!initialData; + return editor; + } + serialize(isForCopying = false, context = null) { + if (this.isEmpty()) { + return null; + } + if (this.deleted) { + return this.serializeDeleted(); + } + const serialized = { + annotationType: AnnotationEditorType.STAMP, + bitmapId: this.#bitmapId, + pageIndex: this.pageIndex, + rect: this.getRect(0, 0), + rotation: this.rotation, + isSvg: this.#isSvg, + structTreeParentId: this._structTreeParentId + }; + if (isForCopying) { + serialized.bitmapUrl = this.#serializeBitmap(true); + serialized.accessibilityData = this.serializeAltText(true); + return serialized; + } + const { + decorative, + altText + } = this.serializeAltText(false); + if (!decorative && altText) { + serialized.accessibilityData = { + type: "Figure", + alt: altText + }; + } + if (this.annotationElementId) { + const changes = this.#hasElementChanged(serialized); + if (changes.isSame) { + return null; + } + if (changes.isSameAltText) { + delete serialized.accessibilityData; + } else { + serialized.accessibilityData.structParent = this._initialData.structParent ?? -1; + } + } + serialized.id = this.annotationElementId; + if (context === null) { + return serialized; + } + context.stamps ||= new Map(); + const area = this.#isSvg ? (serialized.rect[2] - serialized.rect[0]) * (serialized.rect[3] - serialized.rect[1]) : null; + if (!context.stamps.has(this.#bitmapId)) { + context.stamps.set(this.#bitmapId, { + area, + serialized + }); + serialized.bitmap = this.#serializeBitmap(false); + } else if (this.#isSvg) { + const prevData = context.stamps.get(this.#bitmapId); + if (area > prevData.area) { + prevData.area = area; + prevData.serialized.bitmap.close(); + prevData.serialized.bitmap = this.#serializeBitmap(false); + } + } + return serialized; + } + #hasElementChanged(serialized) { + const { + pageIndex, + accessibilityData: { + altText + } + } = this._initialData; + const isSamePageIndex = serialized.pageIndex === pageIndex; + const isSameAltText = (serialized.accessibilityData?.alt || "") === altText; + return { + isSame: !this._hasBeenMoved && !this._hasBeenResized && isSamePageIndex && isSameAltText, + isSameAltText + }; + } + renderAnnotationElement(annotation) { + annotation.updateEdited({ + rect: this.getRect(0, 0) + }); + return null; + } +} + +;// ./src/display/editor/annotation_editor_layer.js + + + + + + + +class AnnotationEditorLayer { + #accessibilityManager; + #allowClick = false; + #annotationLayer = null; + #clickAC = null; + #editorFocusTimeoutId = null; + #editors = new Map(); + #hadPointerDown = false; + #isDisabling = false; + #isEnabling = false; + #drawingAC = null; + #focusedElement = null; + #textLayer = null; + #textSelectionAC = null; + #uiManager; + static _initialized = false; + static #editorTypes = new Map([FreeTextEditor, InkEditor, StampEditor, HighlightEditor].map(type => [type._editorType, type])); + constructor({ + uiManager, + pageIndex, + div, + structTreeLayer, + accessibilityManager, + annotationLayer, + drawLayer, + textLayer, + viewport, + l10n + }) { + const editorTypes = [...AnnotationEditorLayer.#editorTypes.values()]; + if (!AnnotationEditorLayer._initialized) { + AnnotationEditorLayer._initialized = true; + for (const editorType of editorTypes) { + editorType.initialize(l10n, uiManager); + } + } + uiManager.registerEditorTypes(editorTypes); + this.#uiManager = uiManager; + this.pageIndex = pageIndex; + this.div = div; + this.#accessibilityManager = accessibilityManager; + this.#annotationLayer = annotationLayer; + this.viewport = viewport; + this.#textLayer = textLayer; + this.drawLayer = drawLayer; + this._structTree = structTreeLayer; + this.#uiManager.addLayer(this); + } + get isEmpty() { + return this.#editors.size === 0; + } + get isInvisible() { + return this.isEmpty && this.#uiManager.getMode() === AnnotationEditorType.NONE; + } + updateToolbar(mode) { + this.#uiManager.updateToolbar(mode); + } + updateMode(mode = this.#uiManager.getMode()) { + this.#cleanup(); + switch (mode) { + case AnnotationEditorType.NONE: + this.disableTextSelection(); + this.togglePointerEvents(false); + this.toggleAnnotationLayerPointerEvents(true); + this.disableClick(); + return; + case AnnotationEditorType.INK: + this.disableTextSelection(); + this.togglePointerEvents(true); + this.enableClick(); + break; + case AnnotationEditorType.HIGHLIGHT: + this.enableTextSelection(); + this.togglePointerEvents(false); + this.disableClick(); + break; + default: + this.disableTextSelection(); + this.togglePointerEvents(true); + this.enableClick(); + } + this.toggleAnnotationLayerPointerEvents(false); + const { + classList + } = this.div; + for (const editorType of AnnotationEditorLayer.#editorTypes.values()) { + classList.toggle(`${editorType._type}Editing`, mode === editorType._editorType); + } + this.div.hidden = false; + } + hasTextLayer(textLayer) { + return textLayer === this.#textLayer?.div; + } + setEditingState(isEditing) { + this.#uiManager.setEditingState(isEditing); + } + addCommands(params) { + this.#uiManager.addCommands(params); + } + cleanUndoStack(type) { + this.#uiManager.cleanUndoStack(type); + } + toggleDrawing(enabled = false) { + this.div.classList.toggle("drawing", !enabled); + } + togglePointerEvents(enabled = false) { + this.div.classList.toggle("disabled", !enabled); + } + toggleAnnotationLayerPointerEvents(enabled = false) { + this.#annotationLayer?.div.classList.toggle("disabled", !enabled); + } + async enable() { + this.#isEnabling = true; + this.div.tabIndex = 0; + this.togglePointerEvents(true); + const annotationElementIds = new Set(); + for (const editor of this.#editors.values()) { + editor.enableEditing(); + editor.show(true); + if (editor.annotationElementId) { + this.#uiManager.removeChangedExistingAnnotation(editor); + annotationElementIds.add(editor.annotationElementId); + } + } + if (!this.#annotationLayer) { + this.#isEnabling = false; + return; + } + const editables = this.#annotationLayer.getEditableAnnotations(); + for (const editable of editables) { + editable.hide(); + if (this.#uiManager.isDeletedAnnotationElement(editable.data.id)) { + continue; + } + if (annotationElementIds.has(editable.data.id)) { + continue; + } + const editor = await this.deserialize(editable); + if (!editor) { + continue; + } + this.addOrRebuild(editor); + editor.enableEditing(); + } + this.#isEnabling = false; + } + disable() { + this.#isDisabling = true; + this.div.tabIndex = -1; + this.togglePointerEvents(false); + const changedAnnotations = new Map(); + const resetAnnotations = new Map(); + for (const editor of this.#editors.values()) { + editor.disableEditing(); + if (!editor.annotationElementId) { + continue; + } + if (editor.serialize() !== null) { + changedAnnotations.set(editor.annotationElementId, editor); + continue; + } else { + resetAnnotations.set(editor.annotationElementId, editor); + } + this.getEditableAnnotation(editor.annotationElementId)?.show(); + editor.remove(); + } + if (this.#annotationLayer) { + const editables = this.#annotationLayer.getEditableAnnotations(); + for (const editable of editables) { + const { + id + } = editable.data; + if (this.#uiManager.isDeletedAnnotationElement(id)) { + continue; + } + let editor = resetAnnotations.get(id); + if (editor) { + editor.resetAnnotationElement(editable); + editor.show(false); + editable.show(); + continue; + } + editor = changedAnnotations.get(id); + if (editor) { + this.#uiManager.addChangedExistingAnnotation(editor); + if (editor.renderAnnotationElement(editable)) { + editor.show(false); + } + } + editable.show(); + } + } + this.#cleanup(); + if (this.isEmpty) { + this.div.hidden = true; + } + const { + classList + } = this.div; + for (const editorType of AnnotationEditorLayer.#editorTypes.values()) { + classList.remove(`${editorType._type}Editing`); + } + this.disableTextSelection(); + this.toggleAnnotationLayerPointerEvents(true); + this.#isDisabling = false; + } + getEditableAnnotation(id) { + return this.#annotationLayer?.getEditableAnnotation(id) || null; + } + setActiveEditor(editor) { + const currentActive = this.#uiManager.getActive(); + if (currentActive === editor) { + return; + } + this.#uiManager.setActiveEditor(editor); + } + enableTextSelection() { + this.div.tabIndex = -1; + if (this.#textLayer?.div && !this.#textSelectionAC) { + this.#textSelectionAC = new AbortController(); + const signal = this.#uiManager.combinedSignal(this.#textSelectionAC); + this.#textLayer.div.addEventListener("pointerdown", this.#textLayerPointerDown.bind(this), { + signal + }); + this.#textLayer.div.classList.add("highlighting"); + } + } + disableTextSelection() { + this.div.tabIndex = 0; + if (this.#textLayer?.div && this.#textSelectionAC) { + this.#textSelectionAC.abort(); + this.#textSelectionAC = null; + this.#textLayer.div.classList.remove("highlighting"); + } + } + #textLayerPointerDown(event) { + this.#uiManager.unselectAll(); + const { + target + } = event; + if (target === this.#textLayer.div || (target.getAttribute("role") === "img" || target.classList.contains("endOfContent")) && this.#textLayer.div.contains(target)) { + const { + isMac + } = util_FeatureTest.platform; + if (event.button !== 0 || event.ctrlKey && isMac) { + return; + } + this.#uiManager.showAllEditors("highlight", true, true); + this.#textLayer.div.classList.add("free"); + this.toggleDrawing(); + HighlightEditor.startHighlighting(this, this.#uiManager.direction === "ltr", { + target: this.#textLayer.div, + x: event.x, + y: event.y + }); + this.#textLayer.div.addEventListener("pointerup", () => { + this.#textLayer.div.classList.remove("free"); + this.toggleDrawing(true); + }, { + once: true, + signal: this.#uiManager._signal + }); + event.preventDefault(); + } + } + enableClick() { + if (this.#clickAC) { + return; + } + this.#clickAC = new AbortController(); + const signal = this.#uiManager.combinedSignal(this.#clickAC); + this.div.addEventListener("pointerdown", this.pointerdown.bind(this), { + signal + }); + const pointerup = this.pointerup.bind(this); + this.div.addEventListener("pointerup", pointerup, { + signal + }); + this.div.addEventListener("pointercancel", pointerup, { + signal + }); + } + disableClick() { + this.#clickAC?.abort(); + this.#clickAC = null; + } + attach(editor) { + this.#editors.set(editor.id, editor); + const { + annotationElementId + } = editor; + if (annotationElementId && this.#uiManager.isDeletedAnnotationElement(annotationElementId)) { + this.#uiManager.removeDeletedAnnotationElement(editor); + } + } + detach(editor) { + this.#editors.delete(editor.id); + this.#accessibilityManager?.removePointerInTextLayer(editor.contentDiv); + if (!this.#isDisabling && editor.annotationElementId) { + this.#uiManager.addDeletedAnnotationElement(editor); + } + } + remove(editor) { + this.detach(editor); + this.#uiManager.removeEditor(editor); + editor.div.remove(); + editor.isAttachedToDOM = false; + } + changeParent(editor) { + if (editor.parent === this) { + return; + } + if (editor.parent && editor.annotationElementId) { + this.#uiManager.addDeletedAnnotationElement(editor.annotationElementId); + AnnotationEditor.deleteAnnotationElement(editor); + editor.annotationElementId = null; + } + this.attach(editor); + editor.parent?.detach(editor); + editor.setParent(this); + if (editor.div && editor.isAttachedToDOM) { + editor.div.remove(); + this.div.append(editor.div); + } + } + add(editor) { + if (editor.parent === this && editor.isAttachedToDOM) { + return; + } + this.changeParent(editor); + this.#uiManager.addEditor(editor); + this.attach(editor); + if (!editor.isAttachedToDOM) { + const div = editor.render(); + this.div.append(div); + editor.isAttachedToDOM = true; + } + editor.fixAndSetPosition(); + editor.onceAdded(!this.#isEnabling); + this.#uiManager.addToAnnotationStorage(editor); + editor._reportTelemetry(editor.telemetryInitialData); + } + moveEditorInDOM(editor) { + if (!editor.isAttachedToDOM) { + return; + } + const { + activeElement + } = document; + if (editor.div.contains(activeElement) && !this.#editorFocusTimeoutId) { + editor._focusEventsAllowed = false; + this.#editorFocusTimeoutId = setTimeout(() => { + this.#editorFocusTimeoutId = null; + if (!editor.div.contains(document.activeElement)) { + editor.div.addEventListener("focusin", () => { + editor._focusEventsAllowed = true; + }, { + once: true, + signal: this.#uiManager._signal + }); + activeElement.focus(); + } else { + editor._focusEventsAllowed = true; + } + }, 0); + } + editor._structTreeParentId = this.#accessibilityManager?.moveElementInDOM(this.div, editor.div, editor.contentDiv, true); + } + addOrRebuild(editor) { + if (editor.needsToBeRebuilt()) { + editor.parent ||= this; + editor.rebuild(); + editor.show(); + } else { + this.add(editor); + } + } + addUndoableEditor(editor) { + const cmd = () => editor._uiManager.rebuild(editor); + const undo = () => { + editor.remove(); + }; + this.addCommands({ + cmd, + undo, + mustExec: false + }); + } + getNextId() { + return this.#uiManager.getId(); + } + get #currentEditorType() { + return AnnotationEditorLayer.#editorTypes.get(this.#uiManager.getMode()); + } + combinedSignal(ac) { + return this.#uiManager.combinedSignal(ac); + } + #createNewEditor(params) { + const editorType = this.#currentEditorType; + return editorType ? new editorType.prototype.constructor(params) : null; + } + canCreateNewEmptyEditor() { + return this.#currentEditorType?.canCreateNewEmptyEditor(); + } + pasteEditor(mode, params) { + this.#uiManager.updateToolbar(mode); + this.#uiManager.updateMode(mode); + const { + offsetX, + offsetY + } = this.#getCenterPoint(); + const id = this.getNextId(); + const editor = this.#createNewEditor({ + parent: this, + id, + x: offsetX, + y: offsetY, + uiManager: this.#uiManager, + isCentered: true, + ...params + }); + if (editor) { + this.add(editor); + } + } + async deserialize(data) { + return (await AnnotationEditorLayer.#editorTypes.get(data.annotationType ?? data.annotationEditorType)?.deserialize(data, this, this.#uiManager)) || null; + } + createAndAddNewEditor(event, isCentered, data = {}) { + const id = this.getNextId(); + const editor = this.#createNewEditor({ + parent: this, + id, + x: event.offsetX, + y: event.offsetY, + uiManager: this.#uiManager, + isCentered, + ...data + }); + if (editor) { + this.add(editor); + } + return editor; + } + #getCenterPoint() { + const { + x, + y, + width, + height + } = this.div.getBoundingClientRect(); + const tlX = Math.max(0, x); + const tlY = Math.max(0, y); + const brX = Math.min(window.innerWidth, x + width); + const brY = Math.min(window.innerHeight, y + height); + const centerX = (tlX + brX) / 2 - x; + const centerY = (tlY + brY) / 2 - y; + const [offsetX, offsetY] = this.viewport.rotation % 180 === 0 ? [centerX, centerY] : [centerY, centerX]; + return { + offsetX, + offsetY + }; + } + addNewEditor() { + this.createAndAddNewEditor(this.#getCenterPoint(), true); + } + setSelected(editor) { + this.#uiManager.setSelected(editor); + } + toggleSelected(editor) { + this.#uiManager.toggleSelected(editor); + } + unselect(editor) { + this.#uiManager.unselect(editor); + } + pointerup(event) { + const { + isMac + } = util_FeatureTest.platform; + if (event.button !== 0 || event.ctrlKey && isMac) { + return; + } + if (event.target !== this.div) { + return; + } + if (!this.#hadPointerDown) { + return; + } + this.#hadPointerDown = false; + if (this.#currentEditorType?.isDrawer && this.#currentEditorType.supportMultipleDrawings) { + return; + } + if (!this.#allowClick) { + this.#allowClick = true; + return; + } + if (this.#uiManager.getMode() === AnnotationEditorType.STAMP) { + this.#uiManager.unselectAll(); + return; + } + this.createAndAddNewEditor(event, false); + } + pointerdown(event) { + if (this.#uiManager.getMode() === AnnotationEditorType.HIGHLIGHT) { + this.enableTextSelection(); + } + if (this.#hadPointerDown) { + this.#hadPointerDown = false; + return; + } + const { + isMac + } = util_FeatureTest.platform; + if (event.button !== 0 || event.ctrlKey && isMac) { + return; + } + if (event.target !== this.div) { + return; + } + this.#hadPointerDown = true; + if (this.#currentEditorType?.isDrawer) { + this.startDrawingSession(event); + return; + } + const editor = this.#uiManager.getActive(); + this.#allowClick = !editor || editor.isEmpty(); + } + startDrawingSession(event) { + this.div.focus(); + if (this.#drawingAC) { + this.#currentEditorType.startDrawing(this, this.#uiManager, false, event); + return; + } + this.#uiManager.setCurrentDrawingSession(this); + this.#drawingAC = new AbortController(); + const signal = this.#uiManager.combinedSignal(this.#drawingAC); + this.div.addEventListener("blur", ({ + relatedTarget + }) => { + if (relatedTarget && !this.div.contains(relatedTarget)) { + this.#focusedElement = null; + this.commitOrRemove(); + } + }, { + signal + }); + this.#currentEditorType.startDrawing(this, this.#uiManager, false, event); + } + pause(on) { + if (on) { + const { + activeElement + } = document; + if (this.div.contains(activeElement)) { + this.#focusedElement = activeElement; + } + return; + } + if (this.#focusedElement) { + setTimeout(() => { + this.#focusedElement?.focus(); + this.#focusedElement = null; + }, 0); + } + } + endDrawingSession(isAborted = false) { + if (!this.#drawingAC) { + return null; + } + this.#uiManager.setCurrentDrawingSession(null); + this.#drawingAC.abort(); + this.#drawingAC = null; + this.#focusedElement = null; + return this.#currentEditorType.endDrawing(isAborted); + } + findNewParent(editor, x, y) { + const layer = this.#uiManager.findParent(x, y); + if (layer === null || layer === this) { + return false; + } + layer.changeParent(editor); + return true; + } + commitOrRemove() { + if (this.#drawingAC) { + this.endDrawingSession(); + return true; + } + return false; + } + onScaleChanging() { + if (!this.#drawingAC) { + return; + } + this.#currentEditorType.onScaleChangingWhenDrawing(this); + } + destroy() { + this.commitOrRemove(); + if (this.#uiManager.getActive()?.parent === this) { + this.#uiManager.commitOrRemove(); + this.#uiManager.setActiveEditor(null); + } + if (this.#editorFocusTimeoutId) { + clearTimeout(this.#editorFocusTimeoutId); + this.#editorFocusTimeoutId = null; + } + for (const editor of this.#editors.values()) { + this.#accessibilityManager?.removePointerInTextLayer(editor.contentDiv); + editor.setParent(null); + editor.isAttachedToDOM = false; + editor.div.remove(); + } + this.div = null; + this.#editors.clear(); + this.#uiManager.removeLayer(this); + } + #cleanup() { + for (const editor of this.#editors.values()) { + if (editor.isEmpty()) { + editor.remove(); + } + } + } + render({ + viewport + }) { + this.viewport = viewport; + setLayerDimensions(this.div, viewport); + for (const editor of this.#uiManager.getEditors(this.pageIndex)) { + this.add(editor); + editor.rebuild(); + } + this.updateMode(); + } + update({ + viewport + }) { + this.#uiManager.commitOrRemove(); + this.#cleanup(); + const oldRotation = this.viewport.rotation; + const rotation = viewport.rotation; + this.viewport = viewport; + setLayerDimensions(this.div, { + rotation + }); + if (oldRotation !== rotation) { + for (const editor of this.#editors.values()) { + editor.rotate(rotation); + } + } + } + get pageDimensions() { + const { + pageWidth, + pageHeight + } = this.viewport.rawDims; + return [pageWidth, pageHeight]; + } + get scale() { + return this.#uiManager.viewParameters.realScale; + } +} + +;// ./src/display/draw_layer.js + + +class DrawLayer { + #parent = null; + #id = 0; + #mapping = new Map(); + #toUpdate = new Map(); + constructor({ + pageIndex + }) { + this.pageIndex = pageIndex; + } + setParent(parent) { + if (!this.#parent) { + this.#parent = parent; + return; + } + if (this.#parent !== parent) { + if (this.#mapping.size > 0) { + for (const root of this.#mapping.values()) { + root.remove(); + parent.append(root); + } + } + this.#parent = parent; + } + } + static get _svgFactory() { + return shadow(this, "_svgFactory", new DOMSVGFactory()); + } + static #setBox(element, [x, y, width, height]) { + const { + style + } = element; + style.top = `${100 * y}%`; + style.left = `${100 * x}%`; + style.width = `${100 * width}%`; + style.height = `${100 * height}%`; + } + #createSVG() { + const svg = DrawLayer._svgFactory.create(1, 1, true); + this.#parent.append(svg); + svg.setAttribute("aria-hidden", true); + return svg; + } + #createClipPath(defs, pathId) { + const clipPath = DrawLayer._svgFactory.createElement("clipPath"); + defs.append(clipPath); + const clipPathId = `clip_${pathId}`; + clipPath.setAttribute("id", clipPathId); + clipPath.setAttribute("clipPathUnits", "objectBoundingBox"); + const clipPathUse = DrawLayer._svgFactory.createElement("use"); + clipPath.append(clipPathUse); + clipPathUse.setAttribute("href", `#${pathId}`); + clipPathUse.classList.add("clip"); + return clipPathId; + } + #updateProperties(element, properties) { + for (const [key, value] of Object.entries(properties)) { + if (value === null) { + element.removeAttribute(key); + } else { + element.setAttribute(key, value); + } + } + } + draw(properties, isPathUpdatable = false, hasClip = false) { + const id = this.#id++; + const root = this.#createSVG(); + const defs = DrawLayer._svgFactory.createElement("defs"); + root.append(defs); + const path = DrawLayer._svgFactory.createElement("path"); + defs.append(path); + const pathId = `path_p${this.pageIndex}_${id}`; + path.setAttribute("id", pathId); + path.setAttribute("vector-effect", "non-scaling-stroke"); + if (isPathUpdatable) { + this.#toUpdate.set(id, path); + } + const clipPathId = hasClip ? this.#createClipPath(defs, pathId) : null; + const use = DrawLayer._svgFactory.createElement("use"); + root.append(use); + use.setAttribute("href", `#${pathId}`); + this.updateProperties(root, properties); + this.#mapping.set(id, root); + return { + id, + clipPathId: `url(#${clipPathId})` + }; + } + drawOutline(properties, mustRemoveSelfIntersections) { + const id = this.#id++; + const root = this.#createSVG(); + const defs = DrawLayer._svgFactory.createElement("defs"); + root.append(defs); + const path = DrawLayer._svgFactory.createElement("path"); + defs.append(path); + const pathId = `path_p${this.pageIndex}_${id}`; + path.setAttribute("id", pathId); + path.setAttribute("vector-effect", "non-scaling-stroke"); + let maskId; + if (mustRemoveSelfIntersections) { + const mask = DrawLayer._svgFactory.createElement("mask"); + defs.append(mask); + maskId = `mask_p${this.pageIndex}_${id}`; + mask.setAttribute("id", maskId); + mask.setAttribute("maskUnits", "objectBoundingBox"); + const rect = DrawLayer._svgFactory.createElement("rect"); + mask.append(rect); + rect.setAttribute("width", "1"); + rect.setAttribute("height", "1"); + rect.setAttribute("fill", "white"); + const use = DrawLayer._svgFactory.createElement("use"); + mask.append(use); + use.setAttribute("href", `#${pathId}`); + use.setAttribute("stroke", "none"); + use.setAttribute("fill", "black"); + use.setAttribute("fill-rule", "nonzero"); + use.classList.add("mask"); + } + const use1 = DrawLayer._svgFactory.createElement("use"); + root.append(use1); + use1.setAttribute("href", `#${pathId}`); + if (maskId) { + use1.setAttribute("mask", `url(#${maskId})`); + } + const use2 = use1.cloneNode(); + root.append(use2); + use1.classList.add("mainOutline"); + use2.classList.add("secondaryOutline"); + this.updateProperties(root, properties); + this.#mapping.set(id, root); + return id; + } + finalizeDraw(id, properties) { + this.#toUpdate.delete(id); + this.updateProperties(id, properties); + } + updateProperties(elementOrId, properties) { + if (!properties) { + return; + } + const { + root, + bbox, + rootClass, + path + } = properties; + const element = typeof elementOrId === "number" ? this.#mapping.get(elementOrId) : elementOrId; + if (!element) { + return; + } + if (root) { + this.#updateProperties(element, root); + } + if (bbox) { + DrawLayer.#setBox(element, bbox); + } + if (rootClass) { + const { + classList + } = element; + for (const [className, value] of Object.entries(rootClass)) { + classList.toggle(className, value); + } + } + if (path) { + const defs = element.firstChild; + const pathElement = defs.firstChild; + this.#updateProperties(pathElement, path); + } + } + updateParent(id, layer) { + if (layer === this) { + return; + } + const root = this.#mapping.get(id); + if (!root) { + return; + } + layer.#parent.append(root); + this.#mapping.delete(id); + layer.#mapping.set(id, root); + } + remove(id) { + this.#toUpdate.delete(id); + if (this.#parent === null) { + return; + } + this.#mapping.get(id).remove(); + this.#mapping.delete(id); + } + destroy() { + this.#parent = null; + for (const root of this.#mapping.values()) { + root.remove(); + } + this.#mapping.clear(); + this.#toUpdate.clear(); + } +} + +;// ./src/pdf.js + + + + + + + + + + + + + + +const pdfjsVersion = "4.10.38"; +const pdfjsBuild = "f9bea397f"; +{ + globalThis.pdfjsTestingUtils = { + HighlightOutliner: HighlightOutliner + }; +} + +var __webpack_exports__AbortException = __webpack_exports__.AbortException; +var __webpack_exports__AnnotationEditorLayer = __webpack_exports__.AnnotationEditorLayer; +var __webpack_exports__AnnotationEditorParamsType = __webpack_exports__.AnnotationEditorParamsType; +var __webpack_exports__AnnotationEditorType = __webpack_exports__.AnnotationEditorType; +var __webpack_exports__AnnotationEditorUIManager = __webpack_exports__.AnnotationEditorUIManager; +var __webpack_exports__AnnotationLayer = __webpack_exports__.AnnotationLayer; +var __webpack_exports__AnnotationMode = __webpack_exports__.AnnotationMode; +var __webpack_exports__ColorPicker = __webpack_exports__.ColorPicker; +var __webpack_exports__DOMSVGFactory = __webpack_exports__.DOMSVGFactory; +var __webpack_exports__DrawLayer = __webpack_exports__.DrawLayer; +var __webpack_exports__FeatureTest = __webpack_exports__.FeatureTest; +var __webpack_exports__GlobalWorkerOptions = __webpack_exports__.GlobalWorkerOptions; +var __webpack_exports__ImageKind = __webpack_exports__.ImageKind; +var __webpack_exports__InvalidPDFException = __webpack_exports__.InvalidPDFException; +var __webpack_exports__MissingPDFException = __webpack_exports__.MissingPDFException; +var __webpack_exports__OPS = __webpack_exports__.OPS; +var __webpack_exports__OutputScale = __webpack_exports__.OutputScale; +var __webpack_exports__PDFDataRangeTransport = __webpack_exports__.PDFDataRangeTransport; +var __webpack_exports__PDFDateString = __webpack_exports__.PDFDateString; +var __webpack_exports__PDFWorker = __webpack_exports__.PDFWorker; +var __webpack_exports__PasswordResponses = __webpack_exports__.PasswordResponses; +var __webpack_exports__PermissionFlag = __webpack_exports__.PermissionFlag; +var __webpack_exports__PixelsPerInch = __webpack_exports__.PixelsPerInch; +var __webpack_exports__RenderingCancelledException = __webpack_exports__.RenderingCancelledException; +var __webpack_exports__TextLayer = __webpack_exports__.TextLayer; +var __webpack_exports__TouchManager = __webpack_exports__.TouchManager; +var __webpack_exports__UnexpectedResponseException = __webpack_exports__.UnexpectedResponseException; +var __webpack_exports__Util = __webpack_exports__.Util; +var __webpack_exports__VerbosityLevel = __webpack_exports__.VerbosityLevel; +var __webpack_exports__XfaLayer = __webpack_exports__.XfaLayer; +var __webpack_exports__build = __webpack_exports__.build; +var __webpack_exports__createValidAbsoluteUrl = __webpack_exports__.createValidAbsoluteUrl; +var __webpack_exports__fetchData = __webpack_exports__.fetchData; +var __webpack_exports__getDocument = __webpack_exports__.getDocument; +var __webpack_exports__getFilenameFromUrl = __webpack_exports__.getFilenameFromUrl; +var __webpack_exports__getPdfFilenameFromUrl = __webpack_exports__.getPdfFilenameFromUrl; +var __webpack_exports__getXfaPageViewport = __webpack_exports__.getXfaPageViewport; +var __webpack_exports__isDataScheme = __webpack_exports__.isDataScheme; +var __webpack_exports__isPdfFile = __webpack_exports__.isPdfFile; +var __webpack_exports__noContextMenu = __webpack_exports__.noContextMenu; +var __webpack_exports__normalizeUnicode = __webpack_exports__.normalizeUnicode; +var __webpack_exports__setLayerDimensions = __webpack_exports__.setLayerDimensions; +var __webpack_exports__shadow = __webpack_exports__.shadow; +var __webpack_exports__stopEvent = __webpack_exports__.stopEvent; +var __webpack_exports__version = __webpack_exports__.version; +export { __webpack_exports__AbortException as AbortException, __webpack_exports__AnnotationEditorLayer as AnnotationEditorLayer, __webpack_exports__AnnotationEditorParamsType as AnnotationEditorParamsType, __webpack_exports__AnnotationEditorType as AnnotationEditorType, __webpack_exports__AnnotationEditorUIManager as AnnotationEditorUIManager, __webpack_exports__AnnotationLayer as AnnotationLayer, __webpack_exports__AnnotationMode as AnnotationMode, __webpack_exports__ColorPicker as ColorPicker, __webpack_exports__DOMSVGFactory as DOMSVGFactory, __webpack_exports__DrawLayer as DrawLayer, __webpack_exports__FeatureTest as FeatureTest, __webpack_exports__GlobalWorkerOptions as GlobalWorkerOptions, __webpack_exports__ImageKind as ImageKind, __webpack_exports__InvalidPDFException as InvalidPDFException, __webpack_exports__MissingPDFException as MissingPDFException, __webpack_exports__OPS as OPS, __webpack_exports__OutputScale as OutputScale, __webpack_exports__PDFDataRangeTransport as PDFDataRangeTransport, __webpack_exports__PDFDateString as PDFDateString, __webpack_exports__PDFWorker as PDFWorker, __webpack_exports__PasswordResponses as PasswordResponses, __webpack_exports__PermissionFlag as PermissionFlag, __webpack_exports__PixelsPerInch as PixelsPerInch, __webpack_exports__RenderingCancelledException as RenderingCancelledException, __webpack_exports__TextLayer as TextLayer, __webpack_exports__TouchManager as TouchManager, __webpack_exports__UnexpectedResponseException as UnexpectedResponseException, __webpack_exports__Util as Util, __webpack_exports__VerbosityLevel as VerbosityLevel, __webpack_exports__XfaLayer as XfaLayer, __webpack_exports__build as build, __webpack_exports__createValidAbsoluteUrl as createValidAbsoluteUrl, __webpack_exports__fetchData as fetchData, __webpack_exports__getDocument as getDocument, __webpack_exports__getFilenameFromUrl as getFilenameFromUrl, __webpack_exports__getPdfFilenameFromUrl as getPdfFilenameFromUrl, __webpack_exports__getXfaPageViewport as getXfaPageViewport, __webpack_exports__isDataScheme as isDataScheme, __webpack_exports__isPdfFile as isPdfFile, __webpack_exports__noContextMenu as noContextMenu, __webpack_exports__normalizeUnicode as normalizeUnicode, __webpack_exports__setLayerDimensions as setLayerDimensions, __webpack_exports__shadow as shadow, __webpack_exports__stopEvent as stopEvent, __webpack_exports__version as version }; + +//# sourceMappingURL=pdf.mjs.map \ No newline at end of file diff --git a/public/pdfjs/build/pdf.sandbox.mjs b/public/pdfjs/build/pdf.sandbox.mjs new file mode 100644 index 0000000..9c5997d --- /dev/null +++ b/public/pdfjs/build/pdf.sandbox.mjs @@ -0,0 +1,242 @@ +/** + * @licstart The following is the entire license notice for the + * JavaScript code in this page + * + * Copyright 2024 Mozilla Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @licend The above is the entire license notice for the + * JavaScript code in this page + */ + +/******/ // The require scope +/******/ var __webpack_require__ = {}; +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = globalThis.pdfjsSandbox = {}; + +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + QuickJSSandbox: () => (/* binding */ QuickJSSandbox) +}); + +;// ./external/quickjs/quickjs-eval.js +var Module=(()=>{var _scriptDir=typeof document!=='undefined'&&document.currentScript?document.currentScript.src:undefined;return function(moduleArg={}){var d=moduleArg,k,n;d.ready=new Promise((a,b)=>{k=a;n=b;});var p=Object.assign({},d),q="";"undefined"!=typeof document&&document.currentScript&&(q=document.currentScript.src);_scriptDir&&(q=_scriptDir);q.startsWith("blob:")?q="":q=q.substr(0,q.replace(/[?#].*/,"").lastIndexOf("/")+1);var aa=d.print||console.log.bind(console),u=d.printErr||console.error.bind(console);Object.assign(d,p);p=null;var v;d.wasmBinary&&(v=d.wasmBinary);"object"!=typeof WebAssembly&&w("no native wasm support detected");var x,y=!1,z,A,B,C;function D(){var a=x.buffer;d.HEAP8=z=new Int8Array(a);d.HEAP16=new Int16Array(a);d.HEAPU8=A=new Uint8Array(a);d.HEAPU16=new Uint16Array(a);d.HEAP32=B=new Int32Array(a);d.HEAPU32=C=new Uint32Array(a);d.HEAPF32=new Float32Array(a);d.HEAPF64=new Float64Array(a);}var E=[],F=[],G=[];function ba(){var a=d.preRun.shift();E.unshift(a);}var H=0,I=null,J=null;function w(a){d.onAbort?.(a);a="Aborted("+a+")";u(a);y=!0;a=new WebAssembly.RuntimeError(a+". Build with -sASSERTIONS for more info.");n(a);throw a;}var K=a=>a.startsWith("data:application/octet-stream;base64,"),L;L="data:application/octet-stream;base64,AGFzbQEAAAABzgZtYAJ/fwBgA39/fwF/YAR/fn9/AX5gAn9/AX9gBX9+f39/AX5gAX8Bf2ADf39/AGAEf39/fwF/YAJ/fgF+YAF/AGABfAF8YAV/f39/fwF/YAJ/fgBgAn9+AX9gAn9/AX5gA39/fgF/YAN/fn8BfmAGf35/f39/AX5gA39+fwBgA39+fwF/YAZ/f39/f38Bf2AEf39/fwBgBn9+fn9/fwF+YAR/f35/AX9gA39+fgF+YAN/f38BfmADf35+AX9gBH9/f38BfmAFf35+fn4AYAJ8fAF8YAF/AX5gBH9/f34Bf2AFf35+f38BfmAFf39/f38AYAd/fn9+fn5/AX9gBX9/f35+AX9gB39/f39/f38Bf2AAAGAFf35/fn8Bf2AEf35+fwBgBH9+fn8BfmAFf35+fn8Bf2AFf39/f38BfmAEf39+fgF/YAF+AX9gBH9+f34BfmAEf35/fwBgBH9+fn8Bf2AJf39/f39/f39/AX9gCH9/f39/f39/AX9gA39+fgBgBH9+f38Bf2AGf35/fn5/AX9gBX9+fn9/AGABfgF+YAd/fn9/f39/AX5gAX8BfGADf39+AGAEf35/fg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kACQkBCQkBCQkBAQECAgICBAUGBwkDCQsgBCAFai0AACEEIAggA0EIaiICNgIMIAMoAgQiA0F/RgRAIAAgBDYCFAwJCyADIARGDQgMCQsgBCAFai8AACEEIAggA0EIaiICNgIMIAMoAgQiA0F/RgRAIAAgBDYCFAwICyADIARGDQcMCAsgACAEIAVqKAAANgIYDAYLIAAgBCAFaiIDKAAANgIYIAAgAy8ABDYCHAwFCyAAIAQgBWooAAA2AiAMBAsgACAEIAVqIgMoAAA2AiAgACADLQAENgIcDAMLIAAgBCAFaiIDKAAANgIgIAAgAy8ABDYCHAwCCyAAIAQgBWoiAygAADYCICAAIAMoAAQ2AhggACADLQAINgIcDAELCyAAIAk2AgwgACABNgIIQQEhCwsgCwskAQF/IAAoAhAiAkEQaiABIAIoAgARAwAiAUUEQCAAEHALIAELCwAgACABQQAQjQQLJwEBfyMAQRBrIgIkACACIAE7AQ4gACACQQ5qQQIQchogAkEQaiQAC9QBAgR/An5BfyECAkACQAJAAkACQAJAAkAgAUIgiKciA0EKag4RAwUFAgUFBQUFBAABAQEFBQYFCyABp0EARw8LIAGnDwsgAacpAgQhByAAIAEQDCAHQv////8Hg0IAUg8LIAGnKAIMIQQgACABEAwgBEH/////B2pBfkkPCyABpywABSEFIAAgARAMIAVBAE4PCyADQQdrQW1NBEAgAUKAgICAwIGA/P8AfEL///////////8Ag0IBfUKAgICAgICA+P8AVA8LIAAgARAMQQEhAgsgAgs/AQJ/IwBBEGsiAiQAAn8gASAAKAIQRwRAIAIgATYCACAAQcyQASACEBNBfwwBCyAAEA8LIQMgAkEQaiQAIAMLCwAgACABQQEQ6QULGQAgAEEAEFAaIABCgICAgPD/////ADcCBAvDCgIFfxF+IwBB4ABrIgUkACAEQv///////z+DIQwgAiAEhUKAgICAgICAgIB/gyEKIAJC////////P4MiDUIgiCEOIARCMIinQf//AXEhBwJAAkAgAkIwiKdB//8BcSIJQf//AWtBgoB+TwRAIAdB//8Ba0GBgH5LDQELIAFQIAJC////////////AIMiC0KAgICAgIDA//8AVCALQoCAgICAgMD//wBRG0UEQCACQoCAgICAgCCEIQoMAgsgA1AgBEL///////////8AgyICQoCAgICAgMD//wBUIAJCgICAgICAwP//AFEbRQRAIARCgICAgICAIIQhCiADIQEMAgsgASALQoCAgICAgMD//wCFhFAEQCACIAOEUARAQoCAgICAgOD//wAhCkIAIQEMAwsgCkKAgICAgIDA//8AhCEKQgAhAQwCCyADIAJCgICAgICAwP//AIWEUARAIAEgC4QhGUIAIQEgGVAEQEKAgICAgIDg//8AIQoMAwsgCkKAgICAgIDA//8AhCEKDAILIAEgC4RQBEBCACEBDAILIAIgA4RQBEBCACEBDAILIAtC////////P1gEQCAFQdAAaiABIA0gASANIA1QIgYbeSAGQQZ0rXynIgZBD2sQYkEQIAZrIQYgBSkDWCINQiCIIQ4gBSkDUCEBCyACQv///////z9WDQAgBUFAayADIAwgAyAMIAxQIggbeSAIQQZ0rXynIghBD2sQYiAGIAhrQRBqIQYgBSkDSCEMIAUpA0AhAwsgA0IPhiILQoCA/v8PgyICIAFCIIgiBH4iECALQiCIIhMgAUL/////D4MiAX58Ig9CIIYiESABIAJ+fCILIBFUrSACIA1C/////w+DIg1+IhUgBCATfnwiESAMQg+GIhIgA0IxiIRC/////w+DIgMgAX58IhQgDyAQVK1CIIYgD0IgiIR8Ig8gAiAOQoCABIQiDH4iFiANIBN+fCIOIBJCIIhCgICAgAiEIgIgAX58IhAgAyAEfnwiEkIghnwiF3whASAHIAlqIAZqQf//AGshBgJAIAIgBH4iGCAMIBN+fCIEIBhUrSAEIAQgAyANfnwiBFatfCACIAx+fCAEIAQgESAVVK0gESAUVq18fCIEVq18IAMgDH4iAyACIA1+fCICIANUrUIghiACQiCIhHwgBCACQiCGfCICIARUrXwgAiACIBAgElatIA4gFlStIA4gEFatfHxCIIYgEkIgiIR8IgJWrXwgAiACIA8gFFStIA8gF1atfHwiAlatfCIEQoCAgICAgMAAg1BFBEAgBkEBaiEGDAELIAtCP4ghGiAEQgGGIAJCP4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ADC0EBAX8gAQRAA0AgAiADRkUEQCAAIAEgA0EDdGooAgQQECADQQFqIQMMAQsLIAAoAhAiAEEQaiABIAAoAgQRAAALCywBAX8gACgCECICQRBqIAEgAigCABEDACICBEAgAkEAIAEQLA8LIAAQcCACC20BAX8jAEGAAmsiBSQAIARBgMAEcSACIANMckUEQCAFIAFB/wFxIAIgA2siA0GAAiADQYACSSIBGxAsGiABRQRAA0AgACAFQYACEFcgA0GAAmsiA0H/AUsNAAsLIAAgBSADEFcLIAVBgAJqJAALvgECAn4BfwJAAkAgAUKAgICAcINCgICAgDBRBEAgACgCKCACQQN0aikDACIDQiCIp0F0Sw0BDAILIAAgAUE8IAFBABARIgNCgICAgHCDQoCAgIDgAFEEQCADDwsgA0L/////b1YNASAAIAMQDCAAIAEQ/AIiBUUEQEKAgICA4AAPCyAFKAIoIAJBA3RqKQMAIgNCIIinQXVJDQELIAOnIgUgBSgCAEEBajYCAAsgACADIAIQRyEEIAAgAxAMIAQLDAAgAEHZ6gBBABASCw0AIAAgASABED0Q6gELdQEBfiAAIAEgBH4gAiADfnwgA0IgiCICIAFCIIgiBH58IANC/////w+DIgMgAUL/////D4MiAX4iBUIgiCADIAR+fCIDQiCIfCABIAJ+IANC/////w+DfCIBQiCIfDcDCCAAIAVC/////w+DIAFCIIaENwMAC1ABAX4CQCADQcAAcQRAIAEgA0FAaq2GIQJCACEBDAELIANFDQAgAiADrSIEhiABQcAAIANrrYiEIQIgASAEhiEBCyAAIAE3AwAgACACNwMIC2QAAkACQCABQQBIDQAgACgCrAIgAUwNACAAKAKkAiABQRRsaiIAIAAoAgAgAmoiADYCACAAQQBIDQEgAA8LQdwXQajsAEHzpwFBr8MAEAAAC0HphQFBqOwAQfanAUGvwwAQAAALcAECfyAEIAMoAgBKBH8jAEEQayIFJAAgACABKAIAIAQgAygCAEEDbEECbSIAIAAgBEgbIgAgAmwgBUEMahCnASIEBH8gAyAFKAIMIAJuIABqNgIAIAEgBDYCAEEABUF/CyEGIAVBEG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IAghCEEIAEhAwwCCyADUCAJQoCAgICAgMD//wBUIAlCgICAgICAwP//AFEbRQRAIARCgICAgICAIIQhBAwCCyABIApCgICAgICAwP//AIWEUARAQoCAgICAgOD//wAgAiABIAOFIAIgBIVCgICAgICAgICAf4WEUCIFGyEEQgAgASAFGyEDDAILIAMgCUKAgICAgIDA//8AhYRQDQEgASAKhFAEQCADIAmEQgBSDQIgASADgyEDIAIgBIMhBAwCCyADIAmEUEUNACABIQMgAiEEDAELIAMgASABIANUIAkgClYgCSAKURsiCBshCiAEIAIgCBsiDEL///////8/gyEJIAIgBCAIGyILQjCIp0H//wFxIQcgDEIwiKdB//8BcSIFRQRAIAZB4ABqIAogCSAKIAkgCVAiBRt5IAVBBnStfKciBUEPaxBiIAYpA2ghCSAGKQNgIQpBECAFayEFCyABIAMgCBshAyALQv///////z+DIQEgBwR+IAEFIAZB0ABqIAMgASADIAEgAVAiBxt5IAdBBnStfKciB0EPaxBiQRAgB2shByAGKQNQIQMgBikDWAtCA4YgA0I9iIRCgICAgICAgASEIQEgCUIDhiAKQj2IhCENIAIgBIUhBAJ+IANCA4YiAiAFIAdGDQAaIAUgB2siB0H/AEsEQEIAIQFCAQwBCyAGQUBrIAIgAUGAASAHaxBiIAZBMGogAiABIAcQjQIgBikDOCEBIAYpAzAgBikDQCAGKQNIhEIAUq2ECyEJIA1CgICAgICAgASEIQsgCkIDhiEKAkAgBEIAUwRAQgAhA0IAIQQgCSAKhSABIAuFhFANAiAKIAl9IQIgCyABfSAJIApWrX0iBEL/////////A1YNASAGQSBqIAIgBCACIAQgBFAiBxt5IAdBBnStfKdBDGsiBxBiIAUgB2shBSAGKQMoIQQgBikDICECDAELIAkgCnwiAiAJVK0gASALfHwiBEKAgICAgICACINQDQAgCUIBgyAEQj+GIAJCAYiEhCECIAVBAWohBSAEQgGIIQQLIAxCgICAgICAgICAf4MhAyAFQf//AU4EQCADQoCAgICAgMD//wCEIQRCACEDDAELQQAhBwJAIAVBAEoEQCAFIQcMA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CDQoCAgIDgAFEEQCAAEPcCQX8PCyAAIAGnIgJBACACKAIEQf////8HcRBLIQMgACgCACABEAwgAw8LIAAgAaciAEEAIAAoAgRB/////wdxEEsLC54CAgN/AX4gAiABKQIEIgenQf////8HcSADR3JFBEAgASABKAIAQQFqNgIAIAGtQoCAgICQf4QPCyABQRBqIQUgB0KAgICACINQIAMgAmsiBEEATHJFBEAgAyACIAIgA0gbIQZBACEDIAIhAQNAIAEgBkZFBEAgBSABQQF0ai8BACADciEDIAFBAWohAQwBCwsgA0H//wNxQYACTwRAIAAgBSACQQF0aiAEEJIDDwtBACEBIAAgBEEAEOkBIgBFBEBCgICAgOAADwsgAEEQaiEDA0AgASAERkUEQCABIANqIAUgASACakEBdGotAAA6AAAgAUEBaiEBDAELCyADIARqQQA6AAAgAK1CgICAgJB/hA8LIAAgAiAFaiAEEJwDC0QBAn8CQCAAQoCAgIBwVA0AIACnIgMvAQZBAkcNACADLQAFQQhxRQ0AIAIgAygCKDYCACABIAMoAiQ2AgBBASEECyAEC9UBAgJ/A34CfyACRQRAQoCAgIAwIQVBAAwBCyAAKAIQIgMpA4ABIQUgA0KAgICAIDcDgAFBfwshAwJAIAAgAUEGIAFBABARIgdCgICAgHCDIgZCgICAgCBRIAZCgICAgDBRckUEQEF/IQQgBkKAgICA4ABRDQEgACAHIAFBAEEAEDYhAQJ/IAMgAg0AGkF/IAFCgICAgHCDQoCAgIDgAFENABogAyABQv////9vVg0AGiAAECJBfwshBCAAIAEQDAwBCyADIQQLIAIEQCAAIAUQmAELIAQLxQECAX4CfyMAQRBrIgUkAEKAgICA4AAhBAJAAkAgACABIAJBAEEAIAVBDGoQkQUiAUKAgICAcINCgICAgOAAUQ0AIAUoAgwiBkECRwRAIAMgBjYCACABIQQMAgsgACABQeoAIAFBABARIgJCgICAgHCDQoCAgIDgAFENACADIAAgAhAnIgM2AgBCgICAgDAhBCADRQRAIAAgAUHBACABQQAQESEECyAAIAEQDAwBCyAAIAEQDCADQQA2AgALIAV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sgA0ECRw0BCyAIIAlhIQQMAwsgASAKUSEEDAILIAVBdkcNACAAIAdBHGoiBiABEK0CIgMgACAHQQhqIAIQrQIiBRC9AiEEIAMgBkYEQCAGEBkLIAUgB0EIaiIDRw0AIAMQGQsgACABEAwgACACEAwLIAdBMGokACAECy8BAX8jAEHQAGsiAyQAIAMgACADQRBqIAEQgQE2AgAgACACIAMQEiADQdAAaiQACw0AIAAgASABED0QnQMLHQEBfyAAIAFB/wFxEA4gACgCBCEDIAAgAhAbIAMLEgAgACABIAIgAyAEQZQDELEDC1IBAX8gACgCDCIDRQRAQQAPCyAAIAAoAghB/////wNBgYCAgHwgASABQYGAgIB8TBsiASABQf////8DThtqNgIIIABB/////wMgAiADQQAQ3AILHwEBfyAAKAIMIgNFBEBBAA8LIAAgASACIANBABDcAgsgACABQgA3AgwgAUKAgICAgICAgIB/NwIEIAEgADYCAAtmAQF/An9BACAAKAIIIgIgAU8NABpBfyAAKAIMDQAaIAAoAhQgACgCACACQQNsQQF2IgIgASABIAJJGyIBIAAoAhARAQAiAkUEQCAAQQE2AgxBfw8LIAAgATYCCCAAIAI2AgBBAAsLZwECfwJAIAFCgICAgHBUDQAgAaciAy8BBkEEayIEQR1LQQEgBHRBz4CAgAJxRXINACAAIAMpAyAQDCADIAI3AyAPCyAAIAIQDCABQoCAgIBwg0KAgICA4ABSBEAgAEHu0gBBABASCwshAQF/IAAgASAAIAIQtgEiAiADIAQQFSEFIAAgAhAQIAULRwIBfgF/IAApA8ABIQQgAUIgiKdBdU8EQCABpyIFIAUoAgBBAWo2AgALIAAgBCACIAFBAxC+ARogACABIAMQrAQgACABEAwLhAEBAX8CQCACRSABQoCAgIBwg0KAgICAkH9SckUEQCABpyIDIAMoAgBBAWo2AgBBBCECIAAoAgAgAxCRBCIDQQBKDQELIAFCIIinQXVPBEAgAaciAiACKAIAQQFqNgIAC0ECIQIgACABEMcDIgNBAE4NAEF/DwsgACACEA0gACADEDhBAAv8AgACQAJAAkACQAJAAkACQAJ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GKAIwIghBuAFHIAhBPEdxRQRAIAAgBigCNBCeAQsgACAEEBoLIAAgBigCMCAGKAIsIAYoAjQgBigCPEEBIAwQwQELIAAoAhBB3QBGDQAgB0Glf0YEQEGQ0wAhCAwECyAAQSwQKEUNAQwFCwsgAEGFARANIAAoAkAiASABKAKwAigCADYCsAIgABAPDQMLAkAgBUUNACAAKAIQQT1HDQBBfyEHIABB7ABBfxAYIQEgABAPDQQgACAKEBogAwRAIABBDhANCyAAEFMNBCAAQewAIAsQGBogACABEBpBASEHDAQLIANFBEAgAEHDPUEAEBMMAwsgACgCQCgCgAIgDWpBswEgDiANaxAsGiAAKAJAKAKkAiAKQRRsaiIAIAAoAgBBAWs2AgBBACEHDAMLIAAgCEEAEBMMAQsgACgCACAGKAI0EBALQX8hBwsgBkFAayQAIAcLKwAgACgCQCgCpAFBAE4EQCAAQQYQDSAAQdkAEA0gACAAKAJALwGkARAUCwsTACAAIAEgAiADIARBAEEAEN0BC6YBAQF/IwBBEGsiAyQAIAMgAjcDCAJAIAAgAUGHASABQQAQESICQoCAgIBwg0KAgICA4ABRDQAgACACEDUEQCAAIAIgAUEBIANBCGoQNiICQv////9vViACQoCAgICwf4NCgICAgCBRcg0BIAAgAhAMIABBpcEAQQAQEkKAgICA4AAhAgwBCyAAIAIQDCAAIAEgACADQQhqEIoFIQILIANBEGokACACC6MBAgN/AX4gAEEQaiECIAEoAgAiBEEBaiEDAkAgACkCBCIFQoCAgIAIg1BFBEAgAiAEQQF0ai8BACIAQYD4A3FBgLADRyADIAWnQf////8HcU5yDQEgAiADQQF0ai8BACICQYD4A3FBgLgDRw0BIABBCnRBgPg/cSACQf8HcXJBgIAEaiEAIARBAmohAwwBCyACIARqLQAAIQALIAEgAzYCACAACxIAIAFB2AFOBEAgACABEIYFCwthACAAIAEgAkKAgICACHxC/////w9YBH4gAkL/////D4MFQoCAgIDAfiACub0iAkKAgICAwIGA/P8AfSACQv///////////wCDQoCAgICAgID4/wBWGwsgAyAEQQdyEJQ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gBygCAEEBajYCAAsgBiABNwMAIAhBCGohBwzcAQsgCCAIQQhrIgYpAwAiATcDACAIQRBrIgcpAwAhNSAHIAhBGGsiBykDADcDACAGIDU3AwAgAUIgiKdBdU8EQCABpyIGIAYoAgBBAWo2AgALIAcgATcDACAIQQhqIQcM2wELIAggCEEIayIGKQMAIgE3AwAgCEEQayIHKQMAITUgByAIQRhrIgcpAwA3AwAgBiA1NwMAIAcgCEEgayIGKQMANwMAIAFCIIinQXVPBEAgAaciByAHKAIAQQFqNgIACyAGIAE3AwAgCEEIaiEHDNoBCyAIQRBrIgYpAwAhASAGIAhBGGsiBikDADcDACAGIAE3AwAM0wELIAhBGGsiBikDACEBIAYgCEEQayIGKQMANwMAIAhBCGsiBykDACE1IAcgATcDACAGIDU3AwAM0gELIAhBIGsiBikDACEBIAYgCEEYayIGKQMANwMAIAhBEGsiBykDACE1IAcgCEEIayIHKQMANwMAIAYgNTcDACAHIAE3AwAM0QELIAhBKGsiBikDACEBIAYgCEEgayIGKQMANwMAIAhBGGsiBykDACE1IAcgCEEQayIHKQMANwMAIAYgNTcDACAHIAhBCGsiBikDADcDACAGIAE3AwAM0AELIAhBCGsiBikDACEBIAYgCEEQayIGKQMANwMAIAhBGGsiBykDACE1IAcgATcDACAGIDU3AwAMzwELIAhBEGsiBikDACEBIAYgCEEYayIGKQMANwMAIAhBIGsiBykDACE1IAcgATcDACAGIDU3AwAMzgELIAhBEGsiBikDACEBIAYgCEEYayIGKQMANwMAIAhBIGsiBykDACE1IAcgCEEoayIHKQMANwMAIAYgNTcDACAHIAE3AwAMzQELIAhBCGsiBikDACEBIAYgCEEQayIGKQMANwMAIAYgATcDAAzMAQsgCEEgayIGKQMAIQEgBiAIQRBrIgYpAwA3AwAgCEEIayIHKQMAITUgByAIQRhrIgcpAwA3AwAgBiABNwMAIAcgNTcDAAzLAQsgEigCNCAMKAAAQQN0aikDACIBQiCIp0F1TwRAIAGnIgcgBygCAEEBajYCAAsgCCAJIAEgEyAUEIAE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BABARIgFCgICAgHCDIjVCgICAgCBRIDVCgICAgDBRcgR+QoGAgIAQBSA1QoCAgIDgAFENbCAHKQMAITUCfiAKQQJxBEAgCSABIDVBAEEAEDYMAQsgCSABIDVBASAIQQhrEDYLIgFCgICAgHCDQoCAgIDgAFENbCAJIAhBCGsiBikDABAMIAYgATcDAEKAgICAEAs3AwAgCEEIaiEHDGcLAn8gCEEIayIGKQMAIgFC/////z9YBEAgAadBAEcMAQsgCSABECcLIQcgBiAHRa1CgICAgBCENwMADGALIAZBBWohDCAJIAhBCGsiBykDACIBIAYoAAEgAUEAEBEiAUKAgICAcINCgICAgOAAUQ1pIAkgBykDABAMIAcgATcDAAxfCyAGQQVqIQwgCSAIQQhrKQMAIgEgBigAASABQQAQESIBQoCAgIBwg0KAgICA4ABRDWggCCABNwMAIAhBCGohBwxkCyAJIAhBEGsiBykDACIBIAYoAAEgCEEIaykDACABQYCAAhDQASEsIAkgBykDABAMIAZBBWohDCAsQQBODWMMTwsgBkEFaiEMIAkgBigAARDNBSIBQoCAgIBwg0KAgICA4ABRDWYgCCABNwMAIAhBCGohBwxiCyAIQQhrIQcCQCAIQRBrIgopAwAiAUL/////b1gEQCAJECJCgICAgOAAITUMAQsgBykDACI1QoCAgIBwg0KAgICAgH9SBEAgCRD8A0KAgICA4AAhNQwBCyAJIDUQiAIhCCABpyINKAIQIgtBMGohDyALIAggCygCGHFBf3NBAnRqKAIAIQsCQANAIAsEQCAPIAtBAWtBA3QiC2oiECgCBCAIRg0CIBAoAgBB////H3EhCwwBCwsgCSAIEMcFQoCAgIDgACE1DAELIA0oAhQgC2opAwAiNUIgiKdBdUkNACA1pyIIIAgoAgBBAWo2AgALIAkgBykDABAMIAkgCikDABAMIAogNTcDACA1QoCAgIBwg0KAgICA4ABSDWEMTQsgCEEQaykDACEBIAhBCGshCgJAAkAgCEEYayIHKQMAIjVC/////29YBEAgCRAiDAELIAopAwAiNkKAgICAcINCgICAgIB/UgRAIAkQ/AMMAQsgCSA2EIg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EGsiCykDACI1QiCIp0EHa0FtSyAIQQhrIg0pAwAiAUIgiKdBB2tBbUtyRQRAIAcgAUKAgICAwIGA/P8AfDcDACAHIDVCgICAgMCBgPz/AHw3AwgMAQsgCSA1EGUiNUKAgICAcINCgICAgOAAUQ0FIAkgARBlIgFCgICAgHCDQoCAgIDgAFEEQCA1IQEMBgtBByABQiCIpyIPIA9BB2tBbkkbIg9BByA1QiCIpyIQIBBBB2tBbkkbIhByRQRAIAGnIQ0gNachDyALAn4CQAJAAkACQAJAAkACQAJAIApBmwFrDgYAAQILBAMLCyABxCA1xH4iAUIAUg0EIA0gD3JBAE4NBSALQoCAgIDA/v8DNwMADA0LIAtCgICAgMB+IA+3IA23o70iAUKAgICAwIGA/P8AfSABQv///////////wCDQoCAgICAgID4/wBWGzcDAAwMCyANQQBKIA9BAE5xRQRAIAsCfiAPtyANtxCZBCI8vSIBAn8gPJlEAAAAAAAA4EFjBEAgPKoMAQtBgICAgHgLIgq3vVEEQCAKrQwBC0KAgICAwH4gAUKAgICAwIGA/P8AfSABQv///////////wCDQoCAgICAgID4/wBWGws3AwAMDAsgDyANcK0hAQwCCyAPtyE8IAsCfgJ8IA23Ij29QoCAgICAgID4/wCDQoCAgICAgID4/wBRBEBEAAAAAAAA+H8gPJlEAAAAAAAA8D9hDQEaCyA8ID0QowMLIjy9IgECfyA8mUQAAAAAAADgQWMEQCA8qgwBC0GAgICAeAsiCre9UQRAIAqtDAELQoCAgIDAfiABQoCAgIDAgYD8/wB9IAFC////////////AINCgICAgICAgPj/AFYbCzcDAAwKCyA1xCABxH0hAQsgAUKAgICACHxC/////w9WDQEgASE2CyA2Qv////8PgwwBC0KAgICAwH4gAbm9IgFCgICAgMCBgPz/AH0gAUL///////////8Ag0KAgICAgICA+P8AVhsLNwMADAULIBBBdkcgD0F2R3FFBEAgCSAKIAsgNSABIAkoAhAoAqwCESMADQcMBQsgCSAHQQhqIDUQbQ0FIAkgByABEG0NBgsCQAJAAkACQCAKQZsBaw4GAAECBAUDBAsgBysDCCAHKwMAogwFCyAHKwMIIAcrAwCjDAQLIAcrAwggBysDABCZBAwDCyAHKwMIITwgBysDACI9vUKAgICAgICA+P8Ag0KAgICAgICA+P8AUQRARAAAAAAAAPh/IDyZRAAAAAAAAPA/YQ0DGgsgPCA9EKMDDAILEAEACyAHKwMIIAcrAwChCyE8IAtCgICAgMB+IDy9IgFCgICAgMCBgPz/AH0gAUL///////////8Ag0KAgICAgICA+P8AVhs3AwALQQAMAgsgCSABEAwLIAtCgICAgDA3AwAgDUKAgICAMDcDAEF/CyEwIAdBEGokACAwDUsgCEEIayEHDEcLIAhBBGsoAgAiB0UgB0EHa0FuSXINQCAIIQcgCSAIQY4BEOEBRQ1GDEoLAkACfCAIQQhrIgcpAwAiAUIgiKciCkUEQEQAAAAAAAAAgCABpyIGRQ0BGkQAAAAAAADgQSAGQYCAgIB4Rg0BGiAHQgAgAX1C/////w+DNwMADEILIApBB2tBbUsNASABQoCAgIDA/v8Dfb8LITwgB0KAgICAwH4gPL0iAUKAgICAwIGA/P8AfSABQv///////////wCDQoCAgICAgID4/wBWGzcDAAxACyAIIQcgCSAIQY0BEOEBRQ1FDEkLIAhBCGsiBykDACIBQv////8PViABQv////8HUXJFBEAgByABQgF8Qv////8PgzcDAAw/CyAIIQcgCSAIQZABEOEBRQ1EDEgLIAhBCGsiBykDACIBQv////8PViABQoCAgIAIUXJFBEAgByABQgF9Qv////8PgzcDAAw+CyAIIQcgCSAIQY8BEOEBRQ1DDEcLIAkgCEEIayIHKQMAEGUiAUKAgICAcINCgICAgOAAUQRAIAdCgICAgDA3AwAMRwsgByABNwMAIAFCIIinQXVPBEAgAaciByAHKAIAQQFqNgIACyAIIAE3AwAgCSAIQQhqIgcgCkECaxDhAUUNQgxGCyAGQQJqIQwgESAGLQABQQN0aiIHKQMAIgFC/////w9WIAFC/////wdRckUEQCAHIAFCAXxC/////w+DNwMADDwLIAFCIIinQXVPBEAgAaciCiAKKAIAQQFqNgIACyAOIAE3A2AgCSAiQZABEOEBDUUgCSAHIA4pA2AQHQw7CyAGQQJqIQwgESAGLQABQQN0aiIHKQMAIgFC/////w9WIAFCgICAgAhRckUEQCAHIAFCAX1C/////w+DNwMADDsLIAFCIIinQXVPBEAgAaciCiAKKAIAQQFqNgIACyAOIAE3A2AgCSAiQY8BEOEBDUQgCSAHIA4pA2AQHQw6CyAIQQhrIgcpAwAiAUL/////D1gEQCAHIAFC/////w+FNwMADDoLIAghByMAQRBrIgokAAJ/AkACQCAJIAhBCGsiCykDABBlIgFCgICAgHCDIjVCgICAgOAAUQ0AIDVCgICAgOB+UQRAIAkgC0GWASABIAkoAhAoAqgCER8ADQEMAgsgCSAKQQxqIAEQlQENACALIAo1AgxC/////w+FNwMADAELIAtCgICAgDA3AwBBfwwBC0EACyExIApBEGokACAxRQ0/DEMLIAhBCGsiBykDACIBIAhBEGsiCikDACI1hEL/////D1gEQCAKIDWnIAGndK03AwAMPwsgCSAIQaEBELUCRQ0+DEILIAhBCGsiBykDACIBIAhBEGsiCikDACI1hEL/////D1gEQCAKAn4gNacgAad2IgZBAE4EQCAGrQwBC0KAgICAwH4gBri9IgFCgICAgMCBgPz/AH0gAUKAgICAgICA+P8AVhsLNwMADD4LIwBBEGsiCiQAIAhBCGsiDSkDACEBAn8CQAJAIAkgCEEQayILKQMAEGUiNUKAgICAcIMiNkKAgICA4ABRDQAgCSABEGUiAUKAgICAcIMiN0KAgICA4ABRBEAgNSEBDAELIDZCgICAgOB+UiA3QoCAgIDgflJxDQEgCUGlgAFBABASIAkgNRAMCyAJIAEQDCALQoCAgIAwNwMAIA1CgICAgDA3AwBBfwwBCyAJIApBDGogNRCVARogCSAKQQhqIAEQlQEaIAsCfiAKKAIMIAooAgh2IgtBAE4EQCALrQwBC0KAgICAwH4gC7i9IgFCgICAgMCBgPz/AH0gAUKAgICAgICA+P8AVhsLNwMAQQALITIgCkEQaiQAIDJFDT0MQQsgCEEIayIHKQMAIgEgCEEQayIKKQMAIjWEQv////8PWARA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AwLIAEhBQsgAkEQaiQAIAULDQAgACABIAJBABCaAwstAQF/QQEhAQJAAkACQCAAQQ1rDgQCAQECAAsgAEEwRg0BCyAAQTRGIQELIAELnQMDAn4BfAJ/AkACfgJAAkACQAJAIAFBCGsiBikDACIEQiCIp0EHa0FuSQ0AQX8hAUKAgICAMCEDIAAgBBBlIgRCgICAgHCDQoCAgIDgAFENBSAEQiCIpyIHQXZHBEAgBw0BIATEIQMCQAJAAkAgAkGNAWsOBAACAQEFCyAEQiCGUARAQQAhAUKAgICAwP7/AyEDDAkLQgAgA30hAwwBCyADIAJBAXRBnwJrrHwhAwsgA0L/////D4MgA0KAgICACHxC/////w9YDQUaQoCAgIDAfiADub0iA0KAgICAwIGA/P8AfSADQv///////////wCDQoCAgICAgID4/wBWGwwFCyAAIAYgAiAEIAAoAhAoAqgCER8ADQVBAA8LIARCgICAgMCBgPz/AHy/IQUCQCACQY0Baw4EAAMCAgELIAWaIQUMAgsQAQALIAJBAXRBnwJrtyAFoCEFC0KAgICAwH4gBb0iA0KAgICAwIGA/P8AfSADQv///////////wCDQoCAgICAgID4/wBWGwshA0EAIQELIAYgAzcDACABCzgBAX8gAEEYECQiAUUEQEKAgICA4AAPCyABQQE2AgAgACgC2AEgAUEEahC7ASABrUKAgICA4H6ECykBAX8gAkIgiKdBdU8EQCACpyIDIAMoAgBBAWo2AgALIAAgASACENIFCyYBAX8gAUIgiKdBdU8EQCABpyICIAIoAgBBAWo2AgALIAAgARAnC7UBAQJ/AkACQCABRQ0AIAEoAgAiAkEATA0BIAEgAkEBayICNgIAIAINAAJAIAEtAAVBAXEEQCAAIAEpAxgQIQwBCyABKAIYIgIgASgCHCIDNgIEIAMgAjYCACABQgA3AhggASgCICICRQ0AIAAgAhDOAQsgASgCCCICIAEoAgwiAzYCBCADIAI2AgAgAUIANwIIIABBEGogASAAKAIEEQAACw8LQfeEAUGo7ABB/ShBvcwAEAAACyEAIAEgAkYEQCABEBkPCyAAIAFBBGutQoCAgIDgfoQQ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DQALCyAEQQRqIAEQhwEaDAILAAsLIARBBGoQNwwCCyAEKAIEKAIQIgBBEGogBCgCCCAAKAIEEQAAC0KAgICA4AALIQggBEEgaiQAIAgL2wECAX8CfkEBIQQCQCAAQgBSIAFC////////////AIMiBUKAgICAgIDA//8AViAFQoCAgICAgMD//wBRGw0AIAJCAFIgA0L///////////8AgyIGQoCAgICAgMD//wBWIAZCgICAgICAwP//AFEbDQAgACAChCAFIAaEhFAEQEEADwsgASADg0IAWQRAQX8hBCAAIAJUIAEgA1MgASADURsNASAAIAKFIAEgA4WEQgBSDwtBfyEEIAAgAlYgASADVSABIANRGw0AIAAgAoUgASADhYRCAFIhBAsgBAuhAgEFfwNAAkACQAJAAkACfyACIAdMIgkgBCAGTHJFBEAgASAHQQJ0aigCACIIIAMgBkECdGooAgAiCUkEQCAIDAILIAggCUcNAyAGQQFqIQYgB0EBaiEHIAghCQwECyAJDQEgASAHQQJ0aigCAAshCSAHQQFqIQcMAgsgBCAGTA0CIAMgBkECdGooAgAhCQsgBkEBaiEGCwJ/AkACQAJAAkAgBQ4DAwABAgsgBiAHcUEBcQwDCyAGIAdzQQFxDAILEAEACyAGIAdyQQFxCyAAKAIAIghBAXFGDQEgACgCBCAITARAIAAgCEEBahDRAgRAQX8PCyAAKAIAIQgLIAAgCEEBajYCACAAKAIIIAhBAnRqIAk2AgAMAQsLIAAQmAZBAAvmAQAgAAJ/IAEoAggiAEH+////B04EQEEAIAJBAXENARpB/////wcgAEH+////B0cNARogASgCBEH/////B2oMAQtBACAAQQBMDQAaIABBH00EQEEAIAEoAhAgASgCDEECdGpBBGsoAgBBICAAa3YiAGsgACABKAIEGwwBCyACQQFxRQRAQf////8HIAEoAgRFDQEaQYCAgIB4IABBIEcNARogASgCECABKAIMQQJ0akEEaygCABpBgICAgHgMAQtBACABKAIQIAEoAgwiAiACQQV0IABrEHEiAGsgACABKAIEGws2AgALEgAgACABIAIgAyAEQZMDELEDCw4AIABBACABQRByELoBC58BAgR/An4gAzU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AyAFQQZqIQIMAgsgAUECRgRAQX8hBCAFDQNBACEDIAItAABBOmtBdkkNAgwDCyACLQAAQTBrIgFBB0sEQCAFIQMMAgsgBkECaiECIAEgBUEDdHIiA0EfSw0BIAYtAAJBMGsiAUEHSw0BIAZBA2ohAiABIANBA3RyIQMMAQsgBSECCyAAIAI2AgAgAyEECyAEC6MBAQV/IAAoAgBBCGohAyACIgZBB3EhB0EgIQUDQCADKAIUIgQgASAFaiICSQRAIAMoAgxFBEAgACgCACEEIANCADcCDCADQoCAgICAgICAgH83AgQgAyAENgIACyADIAIQqwQgAyACNgIUIAIhBAsgACADEEkaIABBADYCBCAAIAEgByAEELYDRQRAIAVBAXYgBWohBQwBCwsgACABIAYQugEaC1ABA38gAkEAIAJBAEobIQICQANAIAIgBEYNASAAIARBAnRqIgMgAygCACIDIAFrNgIAIARBAWohBCABIANLIQVBASEBIAUNAAtBACEBCyABCysBAn8gAkEFdSIDQQBIIAEgA01yBH9BAAUgACADQQJ0aigCACACdkEBcQsLwgEBB38gACgCDCIEIQMCQANAIAMEQCAAKAIQIgcgA0ECdGpBBGsiBSgCAA0CIANBAWshAwwBCwsgAEGAgICAeDYCCCAAQQAQUBpBAA8LIAAgACgCCCADIARrQQV0ajYCCCAFKAIAZyIFBEBBICAFayEIQQAhBANAIAMgBEZFBEAgByAEQQJ0aiIJIAYgCHYgCSgCACIGIAV0cjYCACAEQQFqIQQMAQsLIAAgACgCCCAFazYCCAsgACABIAIgA0EAENwCCycBAn8gAUIAUwRAIABCACABfRAyIQMgAEEBNgIEIAMPCyAAIAEQMgskACAAQgA3AgAgACABNgIUIABCADcCCCAAIAJBhwMgAhs2AhALYwEBfwJAIAFCIIinIgJFIAJBC2pBEUtyDQACQCABQoCAgIBwVA0AIAGnIgIvAQZBBEcNACACKQMgIgFCIIinIgJFIAJBC2pBEUtyDQELIABBqzVBABASQoCAgIDgACEBCyABC80CAQJ/IwBBEGsiAyQAIAMgAjcDCAJAAkAgACABEMwBIgRBAEg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QBCgICAgOAAIQogACACEDQiAkKAgICAcINCgICAgOAAUg0AIAEhAgwBCwJAIAKnIgUpAgQiCkL/////B4NQDQAgAaciAykCBCELAkAgAygCAEEBRyAKIAuFQoCAgIAIg0IAUnINACADIAAoAhAoAgwRBQAgBSkCBCIKpyIEQf////8HcSIHIAMpAgQiC6ciBkH/////B3EiCGogBEEfdnQgBkEfdiIJQRFzakkNACAFQRBqIQYgA0EQaiEEIAkEQCAEIAhBAXRqIAYgB0EBdBAeGiADIAMpAgQiCiAFKQIEfEL/////B4MgCkKAgICAeIOENwIEDAILIAQgCGogBiAHEB4aIAMgAykCBCIKIAUpAgR8Qv////8HgyILIApCgICAgHiDhDcCBCAEIAunakEAOgAADAELAn4CQAJAIAunQf////8HcSAKp0H/////B3FqIgdBgICAgARPBEAgAEHkyABBABA6DAELIAAgByAKIAuEpyIGQR92EOkBIggNAQtCgICAgOAADAELIAhBEGohBAJAIAZBAE4EQCAEIANBEGogAygCBEH/////B3EQHiIEIAMoAgRB/////wdxaiAFQRBqIAUoAgRB/////wdxEB4aIAQgB2pBADoAAAwBCyAEIAMgAygCBEH/////B3EQkwUgBCADKAIEQQF0aiAFIAUoAgRB/////wdxEJMFCyAIrUKAgICAkH+ECyEKIAAgARAMDAELIAEhCgsgACACEAwgCgsPACAAIAFCgICAgDAQggILCwAgAEGfCUEAEBILjgIBA38jAEEQayIFJAAgBSAAOQMIIAUgAUEBayIHNgIAIAZBgAFB9t8AIAUQSBogAyAGLQAAQS1GNgIAIAQgBi0AAToAACABQQJOBEAgBEEBaiAGQQNqIAcQHhoLIAEgBGpBADoAACACIQkgASAGaiABQQFKakECaiEBA0AgASICQQFqIQEgAiwAACIDEI8GDQALQQEhBAJAAkACQCADQf8BcUEraw4DAQIAAgtBACEECyABLAAAIQMgASECC0EAIQEgA0EwayIDQQlNBEADQCABQQpsIANrIQEgAiwAASEIIAJBAWohAiAIQTBrIgNBCkkNAAsLIAlBACABayABIAQbQQFqNgIAIAVBEGokAAuAD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gByAFQRxqIAVBIGogBUGgAWogAiAFQaACaiICELkCIAUoAiAEQCAFQS06AKACIAJBAXIhAgsgBSgCHCEGAkAgBEEEcQ0AIAMgBkggBkEATHJFBEAgBiAHTgRAQQAhAyAGIAdrIgRBACAEQQBKGyEEIAIgBUGgAWogBxAeIAdqIQIDQCADIARHBEAgAkEwOgAAIANBAWohAyACQQFqIQIMAQsLIAJBADoAAAwDCyACIAVBoAFqIAYQHiAGaiICQS46AABBACEDIAcgBmsiBEEAIARBAEobIQQDQCACQQFqIQIgAyAERwRAIAIgBUGgAWogAyAGamotAAA6AAAgA0EBaiEDDAELCyACQQA6AAAMAgsgBkEFakEFSw0AIAJBsNwAOwAAQQAhA0EAIAZrIQQgAkECaiECA0AgAyAERwRAIAJBMDoAACADQQFqIQMgAkEBaiECDAELCyACIAVBoAFqIAcQHiAHakEAOgAADAELIAIgBS0AoAE6AAACQCAHQQJIBEAgAkEBaiECDAELIAJBLjoAASACQQJqIQJBASEDA0AgAyAHRg0BIAIgBUGgAWogA2otAAA6AAAgA0EBaiEDIAJBAWohAgwACwALIAJB5QA6AAAgBkEBayEDIAZBAEwEfyACQQFqBSACQSs6AAEgAkECagshAiAFIAM2AgAjAEEQayIEJAAgBCAFNgIMIwBBoAFrIgMkACADQQhqIgdBgNIEQZABEB4aIAMgAjYCNCADIAI2AhwgA0H/////B0F+IAJrIgYgBkH/////B0sbIgY2AjggAyACIAZqIgY2AiQgAyAGNgIYIAdB7usAIAUQkwQgAkF+RwRAIAMoAhwiAiACIAMoAhhGa0EAOgAACyADQaABaiQAIARBEGokAAsgACAFQaACahBgIRAgBUGgA2okACAQCykBAX8gAUIgiKdBdU8EQCABpyIDIAMoAgBBAWo2AgALIAAgASACEJIBC00BAX8CQCAAIAEgACgCBEH/////B3EiACABKAIEQf////8HcSICIAAgAkgbEOoFIgENAEEAIQEgACACRg0AQX9BASAAIAJJGyEBCyABCwoAIAAgARC1A0ULiwMCA38BfCMAQSBrIgQkAAJAAkACQAJA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wIMAQsgBSgCDCEDIAAgAjYCBCAAQf////8DIAMgACgCEHYgAWoiACAAQf////8DThs2AgxBACEDCyAFQRBqJAAgAwsqAQF/IAAoAhAiA0EQaiABIAIgAygCCBEBACIBIAJFckUEQCAAEHALIAELgQECAn8BfgJAIAEpAgQiBEL//////////79/VgRAIAEoAgwhAAwBCyAAKAI0IARCIIinIAAoAiRBAWtxQQJ0aiECIAAoAjghAwNAIAMgAigCACIAQQJ0aigCACICIAFGDQEgAkEMaiECIAANAAtBxocBQajsAEH/FEH4DhAAAAsgAAupBwIJfwF+AkACQAJAAn8gAkECTARAIAIgASkCBCIMQj6Ip0YEQCAAIAEQxgIiBEHXAUoNBSABIAEoAgBBAWs2AgAgBA8LIAAoAjQgACgCJEEBayABIAIQ6wVB/////wNxIgdxIgpBAnRqIQMgDKdB/////wdxIQUDQCACIAMoAgAiBEUNAhoCQCAAKAI4IARBAnRqKAIAIgMpAgQiDKdB/////wdxIAVHIAxCPoinIAJHciAMQiCIp0H/////A3EgB0dyDQAgAyABIAUQ6gUNACAEQdgBSA0EIAMgAygCAEEBajYCAAwECyADQQxqIQMMAAsACyACQQNHIQdBAwshBQJAIAAoAjwNAEEAIQQgAEEQaiILIAAoAjhB0wEgACgCLEEDbEECbSICIAJB0wFMGyICQQJ0IAAoAggRAQAiCEUNASAAKAIsIgkhAyAJRQRAIAtBECAAKAIAEQMAIgZFBEAgCyAIIAAoAgQRAAAMAwsgBkKAgICAgICAgEA3AgQgBkEBNgIAIAZBADYADCAIIAY2AgAgACAAKAIoQQFqNgIoQQEhAwsgACADNgI8IAAgCDYCOCAAIAI2AiwgCSACIAIgCUkbIQQgAkEBayEGA0AgAyAERg0BIAAoAjggA0ECdGpBASADQQFqIgJBAXRBAXIgAyAGRhs2AgAgAiEDDAALAAsCQCABBEAgASkCBCIMQv//////////P1gEQCABIAwgBa1CPoaENwIEDAILIABBEGogDKciAkEfdSACQf////8HcSACQR92dGpBEWogACgCABEDACICRQRAQQAhBAwECyACQ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KAK4Ak5FBEAgACADIAJBA3RqKQMAEAwgAkEBaiECDAELCyAAKAIQIgJBEGogAyACKAIEEQAAIAAgASgCcBAQQQAhAgNAIAEoAnQhAyACIAEoAnxORQRAIAAgAyACQQR0aigCABAQIAJBAWohAgwBCwsgACgCECICQRBqIAMgAigCBBEAAEEAIQIDQCABKAKAASEDIAIgASgCiAFORQRAIAAgAyACQQR0aigCABAQIAJBAWohAgwBCwsgACgCECICQRBqIAMgAigCBBEAAEEAIQIDQCABKAL8ASEDIAIgASgC9AFORQRAIAAgAyACQQR0aigCDBAQIAJBAWohAgwBCwsgACgCECICQRBqIAMgAigCBBEAAEEAIQIDQCABKALIAiEDIAIgASgCwAJORQRAIAAgAyACQQN0aigCBBAQIAJBAWohAgwBCwsgACgCECICQRBqIAMgAigCBBEAACABKALMASICIAFB0AFqRwRAIAAoAhAiA0EQaiACIAMoAgQRAAALIAAgASgC7AIQECABQfQCahCJASAAKAIQIgJBEGogASgCjAMgAigCBBEAACABKAIEBEAgASgCGCICIAEoAhwiAzYCBCADIAI2AgAgAUIANwIYCyAAKAIQIgBBEGogASAAKAIEEQAAC4wBAQJ/AkADQCABQoCAgIBwVA0BAkACQAJAAkACQAJAIAGnIgIvAQYiA0EMaw4FBQEDBwEACyADQSxGDQEgA0Ewaw4FAAYGBgAGCyACKAIgKAIwDwsgAigCICICRQ0EIAItABFFDQEgABC4AkEADwsgAigCICECCyACKQMAIQEMAQsLIAIoAiAhAAsgAAuLAQIEfgF/IAAQOyIEQoCAgIBwg0KAgICA4ABSBEAgAUEAIAFBAEobrSEGA0AgAyAGUQRAIAQPCyACIAOnQQN0aikDACIFQiCIp0F1TwRAIAWnIgEgASgCAEEBajYCAAsgACAEIAMgBUEAEMgBIQcgA0IBfCEDIAdBAE4NAAsgACAEEAwLQoCAgIDgAAsRACAAIAEgAiADIARBAhD+AwuTBgEHfyMAQSBrIgckACAHIAM2AhwCfwJAIAAoAgAgB0EEakEgED4NACABQeAARyEKAkACQANAIAMg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gACgCECIAQRBqIAUgACgCBBEAAEEADwsgAUIgiKdBdU8EQCAIIAgoAgBBAWo2AgALIAUgATcDQCACQiCIp0F1TwRAIAKnIgAgACgCAEEBajYCAAsgBSAKNgJcIAUgAzYCGCAFIAI3AxAgBSAJIApBA3RqIgA2AkwgBSAAIAcvASoiC0EDdGo2AmRBACEGIANBACADQQBKGyEHA0AgBiAHRwRAIAQgBkEDdCIIaikDACIBQiCIp0F1TwRAIAGnIgAgACgCAEEBajYCAAsgCCAJaiABNwMAIAZBAWohBgwBCwsgAyAKIAtqIgAgACADSBshAANAIAAgA0ZFBEAgCSADQQN0akKAgICAMDcDACADQQFqIQMMAQsLIAVCgICAgDA3AzAgBUKAgICAMDcDKCAFQQA2AiAgBQVBAAsLowMCB34BfyMAQRBrIgwkAAJ+AkAgACAMQQhqIAAgARAgIgUQLw0AIAwpAwgiASACrCIHfCIGQoCAgICAgIAQWQRAIABB9MgAQQAQEgwBCwJAIARFIAJBAExyRQRAIAAgBSAHQgAgAUF/EPMCDQIMAQsgASEICyACQQAgAkEAShutIQlCACEBA0AgASAJUgRAIAMgAadBA3RqKQMAIgdCIIinQXVPBEAgB6ciAiACKAIAQQFqNgIACyABIAh8IQogAUIBfCEBIAAgBSAKIAcQe0EATg0BDAILCyAAIAVBMCAGQoCAgIAIfCIIQv////8PWAR+IAZC/////w+DBUKAgICAwH4gBrm9IgFCgICAgMCBgPz/AH0gAUL///////////8Ag0KAgICAgICA+P8AVhsLEDlBAEgNACAAIAUQDCAGQv////8PgyAIQv////8PWA0BGkKAgICAwH4gBrm9IgFCgICAgMCBgPz/AH0gAUL///////////8Ag0KAgICAgICA+P8AVhsMAQsgACAFEAxCgICAgOAACyELIAxBEGokACALCxUBAn4gACABEIcFIQMgACABEAwgAwv5DgIKfgR/IwBBEGsiECQAIBAgAjcDCAJAAkACfgJAAkACQAJAAkACQAJAAkACQAJAQQcgAkIgiKciDiAOQQdrQW5JGyIOQQdqDg8EAwMDAwMABQUFAwMDAwEC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3AhQgAkKAgICAgICAgIB/NwIMIAIgAzYCCCAAIAJBHGoiBCACQQhqIgNBACABQQ9qQQNuQQFqQQAQqwMgACAAIAMgAUEAEIgBGiAEEBkgAxAZIAJBMGokAAsPACAAIAEgAkEAQQMQ9AELvQECBH8BfiAAIABBH3UiA3MgA2shAyAAQR92RSEFQQACfyABIAFBAWsiBHFFBEBBICAEZyIGayEEIAIEQEEfIAZrQQAgBRsgA2ogBG4MAgsgBEEAIAFBAk8bIANsDAELIAFBAmshASAFAn4gAgRAIAOtIgcgAUEDdCIBQZT4AWo1AgB+QiCIIAFBkPgBajUCACAHfnxCH4gMAQsgAUECdEGw+gFqNQIAIAOtfkIdiAunagsiAWsgASAAQQBIGwtAAQN/QQEgAEG+/gFqLQAAIgEgAUEBTRshA0EBIQIgACEBA0AgAiADRkUEQCACQQFqIQIgACABbCEBDAELCyABC1ABAn8DQCABLAAAIgQEQCAEIAAsAAAiA0EgciADIANBwQBrQRpJG0cEQEEADwUgAUEBaiEBIABBAWohAAwCCwALCyACBEAgAiAANgIAC0EBC4cDAgN+BH8CQCABKAIIIgZB/v///wdOBEBBASEHIAJBAXENAUL///////////8AIQMgBkH+////B0cNASABNAIEQv///////////wB8IQMMAQsgBkEATARADAELIAZBP00EQCABKAIQIAEoAgwiCEECdGoiCUEEaygCACECQgAgBkEgTQR+IAJBICAGa3atBSAIQQJPBH4gCUEIazUCAAVCAAsgAq1CIIaEQcAAIAZrrYgLIgN9IAMgASgCBBshAwwBCyACQQFxRQRAIAEoAgRFBEBC////////////ACEDQQEhBwwCC0KAgICAgICAgIB/IQNBASEHIAZBwABHDQEgASgCECABKAIMIgFBAnRqIgJBBGs1AgBCIIYhBCABQQJPBH4gAkEIazUCAAVCAAsgBIRCgICAgICAgICAf1IhBwwBC0IAIAEoAhAiCCABKAIMIgIgAkEFdCAGayIGEHGtIAggAiAGQSBqEHGtQiCGhCIDfSADIAEoAgQbIQMLIAAgAzcDACAHC60CAgJ/An4jAEEgayICJAACQC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lBAU0EfyACIANBAnRqIgQgASAHIAEgBxDwASACIAIgBCAOEPEBBSAGCyADQQFxEJkCayIGQQBODQAgAUEBIAMQmQIaIAIgASADQQIQvQQgBmogAkEBIAMQ2wJqIQYLIAUgBjYCAEEAIQYLIAhBEGokACAGC5gBAQJ/IAAgAUH/AXEgAUEIdkH/AXEgAUEXdkH+A3FBwPoBai8BACIAQQF0IgJBf3NBACABQRB2IAAgAGxrIgEgAksiAhsgAWpBCHRyIgEgACACaiICQQF0IgNuIgAgAGxrIAEgACADbGtBCHRqIgFBH3UgAkEIdCAAaiIAQQFrIgJBAXRBAXJxIAFqNgIAIAIgACABQQBIGws5AQJ/IwBBEGsiASQAIAAEfyABQQxqIAAgAGciAEEecXQQuAQgAEEBdnYFQQALIQIgAUEQaiQAIAILsgQBBn8jAEEwayIEJAACQAJAIAAgAkYgACADRnJFBEAgASACRiABIANGcg0BIAAgAUYNAgJAAkAgAigCDCIFBEAgAygCDCIGDQELQQAhBSAAQQAQgAECQCACKAIIIgBB/////wdHBEAgAygCCCIDQf////8HRw0BCyABECoMAgsgAEH+////B0cgA0GAgICAeEdxRQRAIAEQKkEBIQUMAgsgASACEEkaIAFB/////wNBARC6ASEFDAELIAIoAgQgAygCBHMhByAEIAIoAggiCDYCJCACKAIQIQkgBCAFNgIoIAQgCTYCLCAEQQA2AiAgBCADKAIIIgU2AhAgAygCECEDIAQgBjYCFCAEIAM2AhggBEEANgIMAkAgBEEcaiIDIARBCGoQ8gFBAEgEQCAAQgAQMhogASADEEkaDAELIAAgBEEcaiIDIARBCGoiBkEBIAggBWsiBSAFQQFMG0EBakEBEIgBGiAAQQEQ7wEaIAEgACAGQf////8DQQEQQBogASADIAFB/////wNBARDuARoLAkAgACgCCEH/////B0YNACABKAIIQf////8HRg0AAkAgASgCDEUNAAsgASABKAIEIAIoAgRzNgIEIAAgBzYCBCABQf////8DQQEQugEhBQwBCyAAECogARAqQSAhBQsgBEEwaiQAIAUPC0HU7QBB2OwAQd8NQe/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DCAAIAEQDAwBCyABIQ0LIAVBIGokACANC0sBAn8gACABRwRAIAAoAhAiAgRAIAAoAgAiAygCACACQQAgAygCBBEBABoLIAAgASkCADcCACAAIAEoAhA2AhAgACABKQIINwIICwv0AQIDfgF/AkAgAykDACIEQoCAgIBwWgRAIAMpAwgiBUL/////b1YNAQsgABAiQoCAgIDgAA8LQoCAgIDgACEGIABCgICAgCBBLBBHIgFCgICAgHCDQoCAgIDgAFIEfiAAQRgQJCICRQRAIAAgARAMQoCAgIDgAA8LIASnIgMgAygCAEEBajYCACACIAQ3AwAgBaciByAHKAIAQQFqNgIAIAIgBTcDCCAAIAQQNSEAIAJBADoAESACIAA6ABAgAUKAgICAcFoEQCABpyIAIAI2AiAgACAALQAFQe8BcSADLQAFQRBxcjoABQsgAQVCgICAgOAACwsbACAAEBkgAEIANwIQIABCADcCCCAAQgA3AgALCQAgASACEPgFCxMAIABBEGogASACIAAoAggRAQALqAECAX8CfiAAvSIEQv///////////wCDQoGAgICAgID4/wBaBEAgAb1C////////////AINCgYCAgICAgPj/AFQPC0F/IQICQCAAIAFjDQAgAb0iA0L///////////8Ag0KAgICAgICA+P8AVg0AQQEhAiAAIAFkDQBBACECIABEAAAAAAAAAABiDQAgBEIAUwRAIANCP4enQX9zDwsgA0I/iKchAgsgAgvKBQIFfwN+IwBBMGsiAiQAIAIgATcDECACQQA2AgwgAiAANgIIIAIgAykDACIKNwMYAkACQCAKQoCAgIBwgyILQoCAgIAwUgRAQoCAgIDgACEJIAAgChBVDQELQoCAgIDgACEJIAAgARCKASIFQQBIDQACQCAFQQJJDQAgAaciAy8BBkEVayIEQf//A3FBC08NAiACIARBAnRB/P8PcSIEQZz1AWooAgA2AiBBASADLwEGQcqeAWotAAAiBnQhCCADKAIkIQcgC0KAgICAMFIEQCAAIAVBAnQQJCIERQ0CQQAhAwNAIAMgBUZFBEAgBCADQQJ0aiADNgIAIANBAWohAwwBCwsgAiAINgIoIAIgBzYCJCAEIAVBBEHLACACQQhqENcBAkACQAJAAkAgAigCDA4CAAEDCyAAIAUgBnQiAxAkIgYNAQsgACgCECIAQRBqIAQgACgCBBEAAAwECyAGIAcgAxAeIQZBACEDAkACQAJAAkACQCAIQQFrDggAAQkCCQkJAwkLA0AgAyAFRg0EIAMgB2ogBiAEIANBAnRqKAIAai0AADoAACADQQFqIQMMAAsACwNAIAMgBUYNAyAHIANBAXRqIAYgBCADQQJ0aigCAEEBdGovAQA7AQAgA0EBaiEDDAALAAsDQCADIAVGDQIgByADQQJ0IghqIAYgBCAIaigCAEECdGooAgA2AgAgA0EBaiEDDAALAAsDQCADIAVGDQEgByADQQN0aiAGIAQgA0ECdGooAgBBA3RqKQMANwMAIANBAWohAwwACwALIAAoAhAiA0EQaiAGIAMoAgQRAAALIAAoAhAiAEEQaiAEIAAoAgQRAAAMAQsgByAFIAggBEHI9QFqKAIAIAJBCGoQ1wEgAigCDA0BCyABQiCIp0F1TwRAIAGnIgAgACgCAEEBajYCAAsgASEJCyACQTBqJAAgCQ8LEAEAC+cCAQF+IAAgARCKASICQQBIBEBCgICAgOAADwsCQCACRQ0AAkACQAJAAkACQCABpyIALwEGQcqeAWotAAAOBAABAgMECyAAKAIkIgAgAmohAgNAIAAgAkEBayICTw0FIAAtAAAhAyAAIAItAAA6AAAgAiADOgAAIABBAWohAAwACwALIAAoAiQiACACQQF0aiECA0AgACACQQJrIgJPDQQgAC8BACEDIAAgAi8BADsBACACIAM7AQAgAEECaiEADAALAAsgACgCJCIAIAJBAnRqIQIDQCAAIAJBBGsiAk8NAyAAKAIAIQMgACACKAIANgIAIAIgAzYCACAAQQRqIQAMAAsACyAAKAIkIgAgAkEDdGohAgNAIAAgAkEIayICTw0CIAApAwAhBCAAIAIpAwA3AwAgAiAENwMAIABBCGohAAwACwALEAEACyABQiCIp0F1TwRAIAGnIgAgACgCAEEBajYCAAsgAQtRAgF/AX5CgICAgOAAIQQgACABIAIQayIDBH4gAygCICIDKAIMKAIgLQAEBEAgAkUEQEIADwsgABBfQoCAgIDgAA8LIAM1AhAFQoCAgIDgAAsLNwAgACABIAIQayIARQRAQoCAgIDgAA8LIAAoAiAoAgwiACAAKAIAQQFqNgIAIACtQoCAgIBwhAsMACAAKAIQIAEQ5wML2gEBAn4CQAJAIAJFBEAgAUKAgICAcIMhBSAAQS8QKSEEDAELAn4gAUKAgICAcIMiBUKAgICAMFIgAykDACIEQoCAgIBwg0KAgICAgH9SckUEQCAAQbmMASAAIAAoAhAgBKcQxgIQKUGrjAEQsgEMAQsgACAEECULIgRCgICAgHCDQoCAgIDgAFENAQsgBUKAgICAMFENACAAIAFBBRBeIgFCgICAgHCDQoCAgIDgAFIEQCAAIAEgBBC9ASAAIAFBMCAEpykCBEL/////B4NBABAVGgsgASEECyAEC0YBAX8CQCAAKAIIIAJqIgMgACgCDEoEQCAAIAMgARDEAg0BCwNAIAJBAEwEQEEADwsgAkEBayECIAAgARCHAUUNAAsLQX8LlQECBX8BfiABKQIEIginQf////8HcSIDRQRAIAIPCyAAKAIEQf////8HcSEHAn8gCEKAgICACINQRQRAIAEvARAMAQsgAS0AEAshBSADQQFrIQYgByADayEEAkADQCACIARKDQEgACAFIAIQoAEiA0EASCADIARKcg0BIAAgASADQQFqIgJBASAGELwDDQALIAMPC0F/C6cBAgN/AX4CQAJAIAAgARD2AyIDQQBIDQAgA0UNAUGbHiECIAAgACABQe4AIAFBABARIgVCgICAgHCDIgFCgICAgCBRIAFCgICAgDBRcgR/QZseBSABQoCAgIDgAFENASAAIAUQNCIBQoCAgIBwg0KAgICA4ABRDQFBACECIAGnQecAQQAQoAEhBCAAIAEQDCAEQQBODQJB2ssAC0EAEBILQX8hAgsgAguhAQIDfwF+AkACQCAAKQIEIgRCgICAgAiDUA0AIABBEGohAiAEp0H/////B3EhA0EAIQADQCAAIANODQECQCACIABBAXRqLwEAIgFBgPADcUGAsANHBEAgACEBDAELIAFB/7cDSw0DIABBAWoiASADTg0DIAIgAUEBdGovAQBBgEBrQf//A3FBgPgDSQ0DCyABQQFqIQ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ACAFEEYLIAVBIGokACAEC4MCAgZ/AX4jAEEQayIEJAACQCABQv////9vWARAIAAQIkF/IQMMAQtBfyEDIAAgAhAgIglCgICAgHCDQoCAgIDgAFENACAAIARBDGogBEEIaiAJp0ETEH0hA0KAgICAMCECIAQoAgghBiAEKAIMIQcCQAJAIANBAEgNAANAIAUgBkYEQEEAIQMMAwsgACACEAwgACAJIAcgBUEDdGoiCCgCBCAJQQAQESICQoCAgIBwg0KAgICA4ABRDQFBfyEDIAVBAWohBSAAIAEgCCgCBCACQYCAARDZBEEATg0ACwwBC0F/IQMLIAAgByAGEFsgACAJEAwgACACEAwLIARBEGokACADC0gBAn8jAEEQayICJABBfyEDAkAgACACQQxqIAEQswENACACKAIMIgNBJWtBXEsNACAAQYSBAUEAEERBfyEDCyACQRBqJAAgAwt1AQF/AkAgAUKAgICAcINCgICAgOB+UQRADAELAkAgAUKAgICAcFQNACABpyICLwEGQSFHDQAgAikDICIBQoCAgIBwg0KAgICA4H5SDQAMAQsgAEGTGkEAEBJCgICAgOAADwsgAaciACAAKAIAQQFqNgIAIAELvwEBAX8gASADai0AAEE8RgRAIAAgBEH/AXEQDiAAIAVB//8DcRAmIANBAWohAwsgASACKAIEIgBBBWsiAmoiBi0AAEG2AUYEQCAAIAFqLQAAQRZGBEAgBkEROgAAIABBBGshAgsgAEECaiEAIAEgAmoiBiAFOwABIAYgBEEBajoAACACQQNqIQIDQCAAIAJMRQRAIAEgAmpBswE6AAAgAkEBaiECDAELCyADDwtBvMMAQajsAEGz6gFBiM0AEAAAC84CAgd/AX4jAEEwayICJAACQAJAIAMpAwAiAUL/////b1gEQCABQiCIp0F1SQ0BIAGnIgAgACgCAEEBajYCAAwBC0KAgICA4AAhDCAAIAEQigQiA0EASA0BIANFBEAgAEHt0ABBABASDAILIAAgAkEsaiACQShqIAGnIgZBAxB9DQEgAigCLCEHIAIoAighCEEAIQMCQANAIAMgCEcEQCAHIANBA3RqKAIEIQlBgIIBIQUCQCAERQ0AIAAgAkE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iCyQAQoCAgIDgACEHAkAgACABIARBImoQWiICRQ0AIAIoAgBFIAMpAwAiBUIAIAVCIIinQQdrQW5PGyAFIAVCgICAgMCBgPz/AHxC////////////AINQGyIFQv////9vVnJFBEAgABAiDAELQoCAgIAwIQYgBEEBcUUEQCADKQMIIQYLAkAgACACIAUQ8gIiAwRAIAAgAykDKBAMDAELIABBMBAkIgNFDQEgAyACNgIIIANCATcDAAJAIAIoAgAEQCADIAWnIgQoAhg2AgwgBCADNgIYDAELIAVCIIinQXVJDQAgBaciBCAEKAIAQQFqNgIACyADIAU3AyAgAigCECIJIAIoAhQiBEEBayAFENkDcUEDdGoiCCgCACIKIANBGGoiDDYCBCADIAg2AhwgAyAKNgIYIAggDDYCACACKAIEIgggA0EQaiIKNgIEIAMgAkEEaiIMNgIUIAMgCDYCECACIAo2AgQgAiACKAIMQQFqIgg2AgwgCCACKAIYSQ0AIAAgCUEEIARBAXQgBEEBRhsiAEEDdCALQQxqEKcBIghFDQAgCygCDEEDdiAAaiEEQQAhAANAIAAgBEZFBEAgCCAAQQN0aiIJIAk2AgQgCSAJNgIAIABBAWohAAwBCwsgBEEBayEKIAJBCGohAANAIAwgACgCACIARwRAIABBDGsoAgBFBEAgCCAAKQMQENkDIApxQQN0aiIJKAIAIg0gAEEIaiIONgIEIAAgCTYCDCAAIA02AgggCSAONgIACyAAQQRqIQAMAQsLIAIgBDYCFCACIAg2AhAgAiAEQQF0NgIYCyAGQiCIp0F1TwRAIAanIgAgACgCAEEBajYCAAsgAyAGNwMoIAFCIIinQXVPBEAgAaciACAAKAIAQQFqNgIACyABIQcLIAtBEGokACAHCz8BAX8gAUEAIAFBAEobIQEDQAJAIAEgA0YEQEF/IQMMAQsgACADQQN0aigCBCACRg0AIANBAWohAwwBCwsgAwv/BAICfwR+AkAgAkL/////b1gEQCAAECIMAQsCQCAAIAJBPhBuBH9CgICAgDAhBUKAgICAMCEGQoCAgIAwIQggACACQT4gAkEAEBEiB0KAgICAcINCgICAgOAAUQ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A0gBUEAEM0BDAELIAAgDSAFIA5BBxAVCyEMIAAgBRAQIAdBAWohByAMQQBODQALDAELIAAgBiAIEFtBACEGIAAgAhBSIg5CgICAgHCDQoCAgIDgAFENACAEIA03AxggBCAONwMQIAAgAyABQQIgBEEQahAcIQEgACAOEAwgACANEAwMAQsgACAGIAQoAgwQWyAAIA0QDEKAgICA4AAhAQsgBEEgaiQAIAELMAEBfyAAKAI4IAFBAnRqKAIAIgEgASgCACICQQFrNgIAIAJBAUwEQCAAIAEQmwMLC44DAQR/IwBBQGoiAyQAAkAgACABEEoiAUKAgICAcINCgICAgOAAUQ0AAkAgACADQSRqIgIgAaciBCgCBEH/////B3FBAmoQPg0AIAJBIhA8DQBBACECIANBADYCPANAIAQoAgRB/////wdxIAJKBEACQAJAAkACQAJAAkACQAJAAkACQCAEIANBPGoQxgEiAkEIaw4GBQIEAQYDAAsgAkEiRiACQdwARnINBgsgAkGA8P8AcUGAsANHIAJBIE9xDQYgAyACNgIAIANBEGoiAkEQQf4PIAMQSBogA0EkaiACEIMBDQoMBwtB9AAhAgwEC0HyACECDAMLQe4AIQIMAgtB4gAhAgwBC0HmACECCyADQSRqIgVB3AAQPA0EIAUgAhA8RQ0BDAQLIANBJGogAhCxAQ0DCyADKAI8IQIMAQsLIANBJGoiAkEiEDwNACAAIAEQDCACEDchAQwBCyAAIAEQDCADKAIkKAIQIgBBEGogAygCKCAAKAIEEQAAQoCAgIDgACEBCyADQUBrJAAgAQvdBgIMfwd+IwBBMGsiAiQAAn4CQAJAIAEpAygiDkKAgICAcINCgICAgJB/UQRAIAEpAwgiEEKAgICAcINCgICAgJB/UQ0BCyAAQcbJAEEAEBIMAQsgASkDICESIAEpAxghDyABKQMAIRMgACACQQxqQQAQPhogAkEANgIkAkAgD0KAgICAcINCgICAgDBSBEAgACACQSRqIA8QygENAQsgACACQShqIBMQygENACAAIAJBLGogASkDEBB1QQBIDQAgEKchCCASQoCAgIBwgyEQIAIoAiwiDCACKAIoaiENIA6nIg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ACIAUgAiADQYACahAjDRYMDQsgA0KOgICAcDcD8AIgA0GcBmogBCADQfACahAjBEAgAygCqAYiAkEASA0SIAMgAjYC2AYMEgsgA0KogICAcDcD4AIgA0GcBmogBCADQeACahAjBEACQCADKAKoBiICQQBIBEAgAygC2AYhAgwBCyADIAI2AtgGCyABIAMoAsQGIAIQLiADQcAGakEpEA4MEgsgA0Lq1oGAcDcD0AJBACEJIANBnAZqIgUgBCADQdACahAjDQggA0KsgYCAcDcDwAIgBSAEIANBwAJqECMEQAJAIAMoAqgGIgJBAEgEQCADKALYBiECDAELIAMgAjYC2AYLIAEgAygCxAYgAhAuIANBwAZqQfIBEA4MEgsgA0F/NgK4AiADQq2BgICg7Ro3A7ACIANBnAZqIAQgA0GwAmoQI0UNDAJAIAMoAqgGIgVBAEgEQCADKALYBiEFDAELIAMgBTYC2AYLIAEgAygCxAYgBRAuIANBwAZqQfIBEA4gAygCrAZBAXMhBQwSCyADQX82AogDIANCw/aAgOABNwOAAyADQZwGaiAEIANBgANqECNFDQsCQCADKAKoBiICQQBIBEAgAygC2AYhAgwBCyADIAI2AtgGCyABIAMoAsQGIAIQLiADQcAGaiICIAMtAKwGEA4gAiADKAK8BhAbDBALIANBfzYCuAMgA0LZuP2CcDcDsAMgA0GcBmogBCADQbADahAjRQ0KIAMoAqgGIgJBAE4EQCADIAI2AtgGCyADQo6AgIBwNwOgAyADKAKsBiIFQQFqIQYCQCADQZwGaiADKAKkBiICIANBoANqECMEfyADKAKoBiICQQBOBEAgAyACNgLYBgsgAyADKAKwBjYClANBfyEEIANBfzYCmAMgAyAFQQFrNgKQAyADQZwGaiADKAKkBiICIANBkANqECNFDQEgAygCpAYhAiADKAKoBgVBfwshBCAGIQULIAEgAygCxAYgAygC2AYQLiADQcAGaiAFIAMoArAGEFkgBEEASA0TIAMgBDYC2AYMEwsgBi8AASICQf8BSw0JIANCjoCAgHA3AswEIAMgAjYCyAQgA0KRpYKAkAs3A8AEAkAgA0GcBmoiBiAEIANBwARqECNFBEAgA0KOgICAcDcDsAQgAyACNgKsBCADQdkANgKoBCADQo+hgoCQAjcDoAQgBiAEIANBoARqECNFDQELAkAgAygCqAYiBUEASARAIAMoAtgGIQUMAQsgAyAFNgLYBgsgASADKALEBiAFEC4gA0HABmoiBEGUAUGTASADKAKsBkF9cUGQAUYbEA4gBCACQf8BcRAODA8LIANCjoCAgHA3ApQEIAMgAjYCkAQgA0KRgICAkAs3A4gEIANChICAgOATNwOABCADQZwGaiAEIANBgARqECMEQAJAIAMoAqgGIgVBAEgEQCADKALYBiEFDAELIAMgBTYC2AYLIAEgAygCxAYgBRAuAkAgAygCvAZBL0YEQCADQcAGakHBARAODAELIANBwAZqIgRBBBAOIAQgAygCvAYQGwsgA0HABmoiBEGVARAOIAQgAkH/AXEQDgwPCyADQo6AgIBwNwL0AyADIAI2AvADIANCkYCAgJALNwPoAyADQoGAgIDgEzcD4AMgA0GcBmogBCADQeADahAjBEACQCADKAKoBiIFQQBIBEAgAygC2AYhBQwBCyADIAU2AtgGCyABIAMoAsQGIAUQLiADQcAGaiIEIAMoArQGEM4DIARBlQEQDiAEIAJB/wFxEA4MDwsgA0KOgICAcDcD2AMgAyACNgLUAyADQdkANgLQAyADQp6BgICQAjcDyAMgA0LYtvmCcDcDwAMgA0GcBmogBCADQcADahAjBEACQCADKAKoBiIFQQBIBEAgAygC2AYhBQwBCyADIAU2AtgGCyABIAMoAsQGIAUQLiADQcAGaiIEIAMoAqwGIAMoArAGEFkgBEGVARAOIAQgAkH/AXEQDgwPCyABIAMoAsQGIAMoAtgGEC4gA0HABmpB2AAgAhBZIAQhAgwSCyAGLwABIQIgASADKALEBiADKALYBhAuIANBwAZqIAUgAhBZIAQhAgwRCyADIAYvAAEiAjYC5AQgA0F/NgLoBCADIAVBAWs2AuAEIANBnAZqIAQgA0HgBGoQIwRAAkAgAygCqAYiBEEASARAIAMoAtgGIQQMAQsgAyAENgLYBgsgASADKALEBiAEEC4gA0HABmogBUEBaiACEFkMDQsgASADK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CAgIBwg0KAgICA4ABRBEAgACACEAwMAwtBByADQiCIpyIBIAFBB2tBbkkbIgFBByACQiCIpyIEIARBB2tBbkkbIgRyRQRAIAUCfiADxCACxHwiAkKAgICACHxC/////w9YBEAgAkL/////D4MMAQtCgICAgMB+IAK5vSICQoCAgIDAgYD8/wB9IAJC////////////AINCgICAgICAgPj/AFYbCzcDAAwBCyAEQXZHIAFBdkdxRQRAIABBngEgBSACIAMgACgCECgCrAIRIwANAwwBCyAAIAZBCGogAhBtBEAgACADEAwMAwsgACAGIAMQbQ0CIAVCgICAgMB+IAYrAwggBisDAKC9IgJCgICAgMCBgPz/AH0gAkL///////////8Ag0KAgICAgICA+P8AVhs3AwALQQAhAQwCCyAAIAMQDAsgBUKAgICAMDcDACAHQoCAgIAwNwMAQX8hAQsgBkEQaiQAIAELtAMBCH8jAEEQayIEJAAgACAAKQOAARAhIABBEGohAyAAQaABaiEFIAAoAqQBIQEDQCABIAVHBEAgASgCBCEIIAFBGGohB0EAIQIDQCABKAIQIAJKBEAgACAHIAJBA3RqKQMAECEgAkEBaiECDAELCyADIAEgACgCBBEAACAIIQEMAQsLIAAgBTYCpAEgACAAQaABajYCoAEgABCdBSAAKAJUIABB0ABqRgRAQQAhAgNAAkAgACgCRCEBIAIgACgCQE4NACABIAJBGGxqIgEoAgAEQCAAIAEoAgQQxwELIAJBAWohAgwBCwsgAyABIAAoAgQRAAAgAEHkAWoiAUEIahDBBCABQSBqEMEEQQAhAgNAAkAgACgCOCEBIAIgACgCLE4NACABIAJBAnRqKAIAIgFBAXFFBEAgAyABIAAoAgQRAAALIAJBAWohAgwBCwsgAyABIAAoAgQRAAAgAyAAKAI0IAAoAgQRAAAgAyAAKALgASAAKAIEEQAAIAQgAykCCDcDCCAEIAMpAgA3AwAgBCAAIAAoAgQRAAAgBEEQaiQADwtBuogBQajsAEHHD0Hd0wAQAAALjgMBC38jAEEwayIHJAACQCACQoCAgIBwVA0AQRMhBQJAIAKnIgotAAVBBHFFDQAgACg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8BBhDgAUUNACADKAIoIgRFDQAgBCgCECIDQTBqIQUgAyADKAIYQX9zQQJ0QdR5cmooAgAhAwNAIANFDQMgBSADQQFrIgNBA3RqIgYoAgRBygFHBEAgBigCAEH///8fcSEDDAELCyABQoCAgIBwVA0AIAQoAhQgA0EDdGopAwAiAkKAgICAcINCgICAgIB/UQ0BCyAAECIMAgsgACACEIgCIQMgAacoAhAiAEEwaiEEIAAgAyAAKAIYcUF/c0ECdGooAgAhAANAIABFBEBBAA8LIAQgAEEDdGoiBUEIayEAIAMgBUEEaygCAEYEQCAAQQBHDwUgACgCAEH///8fcSEADAELAAsACyAAQZ3kAEEAEBILQX8LRAEBfyAAQeQBaiECIABB4AFqIQADfyAAIAIoAgAiAkYEQEEADwsgASACQQRrKAIARgR/IAJBCGsFIAJBBGohAgwBCwsLiQECA38BfgJAIAAoAhAoAowBIgJFDQADQCABQQBMBEADQCACKQMIIgRCgICAgHBUDQMgBKciAS8BBhDgAUUNAyABKAIgIgEvABEiA0GAwABxRQRAIANBgAhxRQ0EIAAgASgCQBAWDwsgAigCACICDQAMAwsACyABQQFrIQEgAigCACICDQALC0EACykBAX8gAkIgiKdBdU8EQCACpyIDIAMoAgBBAWo2AgALIAAgASACEIUEC/QBAwF+An8BfANAAkBBfyEEAkACQAJAQQcgAkIgiKciBSAFQQdrQW5JGw4IAAAAAAICAwECCyACxCEDQQAhBAwCC0EAIQQgAkKAgICAwIGA/P8AfCICQv///////////wCDQoCAgICAgID4/wBWDQFCgICAgICAgICAfyEDIAK/IgZEAAAAAAAA4MNjDQFC////////////ACEDIAZEAAAAAAAA4ENkDQEgBplEAAAAAAAA4ENjBEAgBrAhAwwCC0KAgICAgICAgIB/IQMMAQsgACACEJYBIgJCgICAgHCDQoCAgIDgAFINAQsLIAEgAzcDACAEC+YBAgN/AXwDQAJAQX8hBAJAAkACQEEHIAJCIIinIgUgBUEHa0FuSRsOCAAAAAACAgMBAgsgAqchA0EAIQQMAgtBACEEIAJCgICAgMCBg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0AIAGnIgMvAQYgAkcNACADKAIgIgNFDQAgACADKQMAECEgACADKQMIECEgAEEQaiADIAAoAgQRAAALCzgBAX8gAEEwayIEQQpPBH8gAEHBAGsgA00EQCAAQTdrDwsgAiAAQdcAayAAQeEAayABTxsFIAQLC6IDAQJ/IAAgASgCBBAQA0AgASgCECEDIAIgASgCFE5FBEAgACADIAJBA3RqKAIAEBAgAkEBaiECDAELCyAAKAIQIgJBEGogAyACKAIEEQAAQQAhAgNAAkAgASgCHCEDIAIgASgCIE4NACADIAJBFGxqIgMoAghFBEAgACgCECADKAIEEOUBCyAAIAMoAhAQECAAIAMoAgwQECACQQFqIQIMAQsLIAAoAhAiAkEQaiADIAIoAgQRAAAgACgCECICQRBqIAEoAiggAigCBBEAAEEAIQIDQCABKAI0IQMgAiABKAI4TkUEQCAAIAMgAkEMbGooAgQQECACQQFqIQIMAQsLIAAoAhAiAkEQaiADIAIoAgQRAAAgACgCECICQRBqIAEoAmQgAigCBBEAACAAIAEpA0AQDCAAIAEpA0gQDCAAIAEpA6gBEAwgACABKQOwARAMIAAgASkDiAEQDCAAIAEpA5ABEAwgACABKQOYARAMIAEoAggiAiABKAIMIgM2AgQgAyACNgIAIAFCADcCCCAAKAIQIgBBEGogASAAKAIEEQAAC9IDAgJ+An8jAEEgayIEJAACQCABQv///////////wCDIgNCgICAgICAwIA8fSADQoCAgICAgMD/wwB9VARAIAFCBIYgAEI8iIQhAyAAQv//////////D4MiAEKBgICAgICAgAhaBEAgA0KBgICAgICAgMAAfCECDAILIANCgICAgICAgIBAfSECIABCgICAgICAgIAIUg0BIAIgA0IBg3whAgwBCyAAUCADQoCAgICAgMD//wBUIANCgICAgICAwP//AFEbRQRAIAFCBIYgAEI8iIRC/////////wODQoCAgICAgID8/wCEIQIMAQtCgICAgICAgPj/ACECIANC////////v//DAFYNAEIAIQIgA0IwiKciBUGR9wBJDQAgBEEQaiAAIAFC////////P4NCgICAgICAwACEIgIgBUGB9wBrEGIgBCAAIAJBgfgAIAVrEI0CIAQpAwhCBIYgBCkDACIAQjyIhCECIAQpAxAgBCkDGIRCAFKtIABC//////////8Pg4QiAEKBgICAgICAgAhaBEAgAkIBfCECDAELIABCgICAgICAgIAIUg0AIAJCAYMgAnwhAgsgBEEgaiQAIAIgAUKAgICAgICAgIB/g4S/C6oPAgV/D34jAEHQAmsiBSQAIARC////////P4MhCiACQv///////z+DIQsgAiAEhUKAgICAgICAgIB/gyEMIARCMIinQf//AXEhCAJAAkAgAkIwiKdB//8BcSIJQf//AWtBgoB+TwRAIAhB//8Ba0GBgH5LDQELIAFQIAJC////////////AIMiDUKAgICAgIDA//8AVCANQoCAgICAgMD//wBRG0UEQCACQoCAgICAgCCEIQwMAgsgA1AgBEL///////////8AgyICQoCAgICAgMD//wBUIAJCgICAgICAwP//AFEbRQRAIARCgICAgICAIIQhDCADIQEMAgsgASANQoCAgICAgMD//wCFhFAEQCADIAJCgICAgICAwP//AIWEUARAQgAhAUKAgICAgIDg//8AIQwMAwsgDEKAgICAgIDA//8AhCEMQgAhAQwCCyADIAJCgICAgICAwP//AIWEUARAQgAhAQwCCyABIA2EUARAQoCAgICAgOD//wAgDCACIAOEUBshDEIAIQEMAgsgAiADhFAEQCAMQoCAgICAgMD//wCEIQxCACEBDAILIA1C////////P1gEQCAFQcACaiABIAsgASALIAtQIgYbeSAGQQZ0rXynIgZBD2sQYkEQIAZrIQYgBSkDyAIhCyAFKQPAAiEBCyACQv///////z9WDQAgBUGwAmogAyAKIAMgCiAKUCIHG3kgB0EGdK18pyIHQQ9rEGIgBiAHakEQayEGIAUpA7gCIQogBSkDsAIhAwsgBUGgAmogCkKAgICAgIDAAIQiEkIPhiADQjGIhCICQgBCgICAgLDmvIL1ACACfSIEQgAQYSAFQZACakIAIAUpA6gCfUIAIARCABBhIAVBgAJqIAUpA5gCQgGGIAUpA5ACQj+IhCIEQgAgAkIAEGEgBUHwAWogBEIAQgAgBSkDiAJ9QgAQYSAFQeABaiAFKQP4AUIBhiAFKQPwAUI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AMQoCAgICAgMD//wCEIQxCACEBDAELAn4gBkEASgRAIApCAYYgC0I/iIQhASAEQv///////z+DIAatQjCGhCEKIAtCAYYMAQsgBkGPf0wEQEIAIQEMAgsgBUFAayACIARBASAGaxCNAiAFQTBqIA0gFSAGQfAAahBiIAVBIGogAyASIAUpA0AiAiAFKQNIIgoQYSAFKQM4IAUpAyhCAYYgBSkDICIBQj+IhH0gBSkDMCIEIAFCAYYiDVStfSEBIAQgDX0LIQQgBUEQaiADIBJCA0IAEGEgBSADIBJCBUIAEGEgCiACIAIgAyAEIAJCAYMiBHwiA1QgASADIARUrXwiASASViABIBJRG618IgJWrXwiBCACIAIgBEKAgICAgIDA//8AVCADIAUpAxBWIAEgBSkDGCIEViABIARRG3GtfCICVq18IgQgAiAEQoCAgICAgMD//wBUIAMgBSkDAFYgASAFKQMIIgNWIAEgA1Ebca18IgEgAlStfCAMhCEMCyAAIAE3AwAgACAMNwMIIAVB0AJqJAALwAECAX8CfkF/IQMCQCAAQgBSIAFC////////////AIMiBEKAgICAgIDA//8AViAEQoCAgICAgMD//wBRGw0AIAJC////////////AIMiBUKAgICAgIDA//8AViAFQoCAgICAgMD//wBScQ0AIAAgBCAFhIRQBEBBAA8LIAEgAoNCAFkEQCABIAJSIAEgAlNxDQEgACABIAKFhEIAUg8LIABCAFIgASACVSABIAJRGw0AIAAgASAChYRCAFIhAwsgAwtAAQN/IABB4AFqIQQgACgC5AEhAwNAIAQgAyICRwRAIAIoAgQhAyABBEAgAi0ATQ0CCyAAIAJBCGsQ8gUMAQsLC7QLAQZ/IAAgAWohBQJAAkAgACgCBCICQQFxDQAgAkECcUUNASAAKAIAIgIgAWohAQJAAkACQCAAIAJrIgBB2N4EKAIARwRAIAAoAgwhAyACQf8BTQRAIAJBA3YhAiAAKAIIIgQgA0cNAkHE3gRBxN4EKAIAQX4gAndxNgIADAULIAAoAhghBiAAIANHBEBB1N4EKAIAGiAAKAIIIgIgAzYCDCADIAI2AggMBAsgACgCFCIEBH8g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ARAIAEgCyADIAoQ6wEEQCABIQQMAgsgBUHwAGogASACQgBCABArIAUpA3ghAiAFKQNwIQQMAQsgBEIwiKdB//8BcSEGIAcEfiABBSAFQeAAaiABIAtCAEKAgICAgIDAu8AAECsgBSkDaCILQjCIp0H4AGshByAFKQNgCyEEIAZFBEAgBUHQAGogAyAKQgBCgICAgICAwLvAABArIAUpA1giCkIwiKdB+ABrIQYgBSkDUCEDCyAKQv///////z+DQoCAgICAgMAAhCEMIAtC////////P4NCgICAgICAwACEIQsgBiAHSARAA0ACfiALIAx9IAMgBFatfSIKQgBZBEAgCiAEIAN9IgSEUARAIAVBIGogASACQgBCABArIAUpAyghAiAFKQMgIQQMBQsgCkIBhiAEQj+IhAwBCyALQgGGIARCP4iECyELIARCAYYhBCAHQQFrIgcgBkoNAAsgBiEHCwJAIAsgDH0gAyAEVq19IgpCAFMEQCALIQoMAQsgCiAEIAN9IgSEQgBSDQAgBUEwaiABIAJCAEIAECsgBSkDOCECIAUpAzAhBAwBCyAKQv///////z9YBEADQCAEQj+IIQ0gB0EBayEHIARCAYYhBCANIApCAYaEIgpCgICAgICAwABUDQALCyAIQYCAAnEhBiAHQQBMBEAgBUFAayAEIApC////////P4MgB0H4AGogBnKtQjCGhEIAQoCAgICAgMDDPxArIAUpA0ghAiAFKQNAIQQMAQsgCkL///////8/gyAGIAdyrUIwhoQhAgsgACAENwMAIAAgAjcDCCAFQYABaiQAC78CAQF/IwBB0ABrIgQkAAJAIANBgIABTgRAIARBIGogASACQgBCgICAgICAgP//ABArIAQpAyghAiAEKQMgIQEgA0H//wFJBEAgA0H//wBrIQMMAgsgBEEQaiABIAJCAEKAgICAgICA//8AECtB/f8CIAMgA0H9/wJOG0H+/wFrIQMgBCkDGCECIAQpAxAhAQwBCyADQYGAf0oNACAEQUBrIAEgAkIAQoCAgICAgIA5ECsgBCkDSCECIAQpA0AhASADQfSAfksEQCADQY3/AGohAwwBCyAEQTBqIAEgAkIAQoCAgICAgIA5ECtB6IF9IAM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AyABQQAQiAEaIAAgACADIAFBABBAGiAAIABCASABQQAQehogCkIBfSEKDAELC0EAIQMgBkEAIAZBAEobIQQgAkEEahAZIAJBHGoQGQNAIAMgBEcEQCAAIAAgACABQeAPEEAaIANBAWohAwwBCwsgACAIQeEPELkBGiACQTBqJAAMAQtB6e0AQdjsAEHUIUGzxAAQAAALCyAFQQxqEBkgBUEgaiQAQRALrwEBAn8jAEEgayIEJAAgACgCACEFIARBCGogA0EAEO0BIAAgASAEKAIIIgEgAUEfdSIBcyABayIBIAJBwAAgAUEBa2dBAXRrQQAgAUECTxtqQQhqIgJB4A8QrwMhASADKAIEBEAgBEIANwIYIARCgICAgICAgICAfzcCECAEIAU2AgwgBEEMaiIDQgEQMhogACADIAAgAkHgDxCIASABciEBIAMQGQsgBEEgaiQAIAELkAYCCH8BfiMAQfAAayIDJAAgACABRwRAIAAoAgAhBCADQgA3AmggA0KAgICAgICAgIB/NwJgIAMgBDYCXCADQdwAaiIFIAEQSRogA0IANwJUIANCgICAgICAgICAfzcCTCADIAQ2AkggAygCZCEGIANBADYCZCADQcgAaiIBQqrVqtUKEDIaIANBADYCUCAFIAEQrAIEQCADIAMoAmRBAWo2AmQgBkEBayEGCyADQcgAahAZIAJBAWpBAXYQuQQhBSADQgA3AlQgA0KAgICAgICAgIB/NwJMIAMgBDYCSCADQgA3AkAgA0KAgICAgICAgIB/NwI4IAMgBDYCNCADQdwAaiIBIAFCf0H/////A0EAEHoaIAVBACAFQQBKGyEJIAIgBWogAiAFQQF0bkEBaiIKQQF0akEgaiECQQAhAQNAIAEgCUZFBEAgA0HIAGoiByADQdwAaiIIQgEgAkEAEHoaIANBNGoiCyAHIAJBBhC1BCAHIAtCASACQQAQehogCCAIIAcgAkEAEIgBGiABQQFqIQEMAQsLIANCADcCLCADQoCAgICAgICAgH83AiQgAyAENgIgIANCADcCGCADQoCAgICAgICAgH83AhAgAyAENgIMIANBIGoiASADQdwAaiIEQgIgAkEAEHoaIAEgBCABIAJBABCIARogA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QSBqEBwhASAAIAQQDCABQoCAgIBwg0KAgICA4ABRDQILIAAgBSAIIAEQeyERIAhCAXwhCCARQQBODQALCwwBC0KAgICAMCEFCyAAIAUQDEKAgICA4AAhBQsgACAHEAwgACAGEAwgACAJEAwgDUEwaiQAIAULDwAgACsDACABKwMAEMQECzkBAX5CgICAgMB+IAEpAwAiAkKAgICAwIGA/P8AfSACQv///////////wCDQoCAgICAgID4/wBWGwsRACAAKgIAuyABKgIAuxDEBAs7AQF+QoCAgIDAfiABKgIAu70iAkKAgICAwIGA/P8AfSACQv///////////wCDQoCAgICAgID4/wBWGwsZAQJ+IAEpAwAiAyAAKQMAIgRUIAMgBFZrCwwAIAAgASkDABCIBAsZAQJ+IAEpAwAiAyAAKQMAIgRTIAMgBFVrCwwAIAAgASkDABC/AgsXACABKAIAIgEgACgCACIASSAAIAFJaws9AQF+IAEoAgAiAEEATgRAIACtDwtCgICAgMB+IAC4vSICQoCAgIDAgYD8/wB9IAJCgICAgICAgPj/AFYbC9sFAwV/A34BfCMAQUBqIgUkAAJAAnwCQAJAAkACQAJAIAJBACABQoCAgIBwgyILQoCAgIAwUhsiAg4CAgABCwJAIAMpAwAiCUKAgICAcFQNACAJpyIELwEGQQpHDQAgBCkDICIKQiCIpyIEQQAgBEELakESSRsNACAAIAUgChBCDQMMBAsgBSAAIAlBAhC7AiIJNwM4IAlCgICAgHCDQoCAgICQf1EEQCAAIAEgBCAFQThqEKkFIQogACAJEAwgCkKAgICAcINCgICAgOAAUQ0DIAAgBSAKEG1FDQQMAwsgACAFIAkQbUUNAwwCCyAFQQBBOBAsIgZCgICAgICAgPg/NwMQQQcgAiACQQdOGyIHQQAgB0EAShshAgNAAkAgAiAERwRAIAAgBkE4aiADIARBA3QiCGopAwAQQg0EIAYrAzgiDL1CgICAgICAgPj/AINCgICAgICAgPj/AFINASAEIQILRAAAAAAAAPh/IAIgB0cNBRogBkEBEOsDDAULIAYgCGogDJ05AwACQCAEDQAgBisDACIMRAAAAAAAAAA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UKAgICAwIGA/P8AfSABQv///////////wCDQoCAgICAgID4/wBWGyEBCyAKQRBqJAAgAQtOACAAIABEAAAAAAAA8L9EAAAAAAAA8D8gAEQAAAAAAAAAAGMbIAC9Qv///////////wCDQoCAgICAgID4/wBWGyAARAAAAAAAAAAAYRsLgwECAn4BfyAAvSIBQjSIp0H/D3EiA0H+B00EQCABQoCAgICAgICAgH+DIQIgA0H+B0cgAUKAgICAgICA8L9/UXJFBEAgAkKAgICAgICA+D+Evw8LIAK/DwsgA0GyCE0EfCABQj+HIAF8QgFBswggA2uthiIBQgGIfEIAIAF9g78FIAALC4IFAwJ8BX8CfiMAQRBrIgkkAAJ+QoCAgIDA/v/7/wBCgICAgMD+/3sgBBsgAkUNABoCfCADKQMAIgFC/////w9YBEBBASACIAJBAUwbIQogAachCEEBIQcDQCAHIApHBEAgCLcgAyAHQQN0aikDACIBQoCAgIAQWg0DGiAIIAGnIgsgCCALShsgCCALIAggC0gbIAQbIQggB0EBaiEHDAELCyAIrQwCC0KAgICA4AAgACAJQQhqIAEQQg0BGkEBIQcgCSsDCAshBSAHIAIgAiAHSBshAgNAIAIgB0cEQEKAgICA4AAgACAJIAMgB0EDdGopAwAQQg0CGgJAIAW9IgxC////////////AINCgICAgICAgPj/AFYNACAJKwMAIga9IgFC////////////AINCgICAgICAgPj/AFYEQCAGIQUMAQsgBUQAAAAAAAAAAGEgBkQAAAAAAAAAAGFxIQogBARAIAoEQCABIAyDvyEFDAILIAUgBSAGpSAGvUL///////////8Ag0KAgICAgICA+P8AVhsgBiAFvUL///////////8Ag0KAgICAgICA+P8AWBshBQwBCyAKBEAgASAMhL8hBQwBCyAFIAUgBqQgBr1C////////////AINCgICAgICAgPj/AFYbIAYgBb1C////////////AINCgICAgICAgPj/AFgbIQULIAdBAWohBwwBCwsgBb0iAQJ/IAWZRAAAAAAAAOBBYwRAIAWqDAELQYCAgIB4CyIAt71RBEAgAK0MAQtCgICAgMB+IAFCgICAgMCBgPz/AH0gAUL///////////8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hqIAMgBWwgBkEfdhCZAw0AAkAgBUEBRwRAA0AgA0EATA0CIAJBCGogBEEAIAUQSxogA0EBayEDDAALAAsgAkEIagJ/IAQtAAdBgAFxBEAgBC8BEAwBCyAELQAQCyADEMsEGgsgACABEAwgAkEIahA3IQcMAgsgACABEAwMAQsgASEHCyACQSBqJAAgBwtYAQF+IAAgAykDABDkAUEAR61CgICAgBCEIQQgAUKAgICAcINCgICAgDBRBEAgBA8LIAAgAUEGEF4iAUKAgICAcINCgICAgOAAUgRAIAAgASAEEL0BCyABC8EBAgJ/An4jAEEQayIEJABCgICAgOAAIQYCQCAAIAEQSiIBQoCAgIBwg0KAgICA4ABRBEAgASEGDAELAkAgACAEQQxqIAMpAwAgAaciBSgCBEH/////B3EiAiACEFYNACAEIAI2AgggAykDCCIHQoCAgIBwg0KAgICAMFIEQCAAIARBCGogByACIAIQVg0BIAQoAgghAgsgACAFIAQoAgwiAyACIAMgAiADShsQjgEhBgsgACABEAwLIARBEGokACAGC8ABAgN/An4jAEEQayICJABCgICAgOAAIQcCQCAAIAEQSiIBQoCAgIBwg0KAgICA4ABRBEAgASEHDAELAkAgACACQQxqIAMpAwAgAaciBigCBEH/////B3EiBCAEEFYNACACIAQgAigCDCIFayIENgIIIAAgBiAFIAMpAwgiCEKAgICAcINCgICAgDBSBH8gACACQQhqIAggBEEAEFYNASACKAIIBSAECyAFahCOASEHCyAAIAEQDAsgAkEQaiQAIAcL0wECAn8CfiMAQRBrIgIkAEKAgICA4AAhBgJAIAAgARBKIgFCgICAgHCDQoCAgIDgAFEEQCABIQYMAQsCQCAAIAJBDGogAykDACABpyIFKAIEQf////8HcUEAEFYNACACIAUoAgRB/////wdxIgQ2AgggAykDCCIHQoCAgIBwg0KAgICAMFIEQCAAIAJBCGogByAEQQAQVg0BIAIoAgghBAsgACAFIAIoAgwiAyAEIAMgBEgbIAMgBCADIARKGxCOASEGCyAAIAEQDAsgAkEQaiQAIAYLoQUCC34DfyMAQRBrIgIkAAJAIAFC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wASADQYqUASAAQfABahCqASAHKQNoIQ4gACAHKQNwIg83A+ABIAAgD7kgDrmjOQPoASAAIA43A9gBIABBxic2AtABIANBg5YBIABB0AFqEKoBCwJAIAcpA3giDlANACAAIAcpA4ABNwPAASAAIA43A7gBIABB/iQ2ArABIANBrJMBIABBsAFqEJoBIAcpA3ghDiAAIAcpA4gBIg83A6ABIAAgD7kgDrmjOQOoASAAIA43A5gBIABBrtwANgKQASADQbGUASAAQZABahCqASAHKQOQASIOUA0AIAAgBykDmAEiDzcDgAEgACAONwN4IAAgD7kgDrmjOQOIASAAQbzTADYCcCADQbGUASAAQfAAahCqAQsgBykDoAEiDlBFBEAgACAONwNoIABBkSU2AmAgA0GfkwEgAEHgAGoQmgELAkAgBykDqAEiDlANACAAIA43A1ggAEHMIDYCUCADQZ+TASAAQdAAahCaASAHKQOwASIOUA0AIAAgDjcDSCAAQcUgNgJAIANBn5MBIABBQGsQmgEgBykDsAEhDyAAIAcpA7gBIg5CA4Y3AzAgACAOuSAPuaM5AzggACAONwMoIABB4CE2AiAgA0HfkwEgAEEgahCqAQsgBykDwAEiDlBFBEAgACAHKQPIATcDECAAIA43AwggAEGEIjYCACADQayTASAAEJoBCyAAQcAGaiQAIAMoAkwaIAMQogMaIAMgAygCDBEFABogAy0AAEEBcUUEQCADKAI4IQAgAygCNCIBBEAgASAANgI4CyAABEAgACABNgI0CyADQZjVBCgCAEYEQEGY1QQgADYCAAsgAygCYBDUASADENQBCyAMEAogDBDUAQsgB0HQAWokAAsJACAAIAEQzwQLLAAgACABEM8EIgFCgICAgHCDQoCAgIDgAFIEfiAAQQNBAiABpxsQKQUgAQsLkAECAXwBfiMAQRBrIgIkAAJ+IAMpAwAiAUIgiKciAwRAQoCAgIAQIANBC2pBEkkNARoLQoCAgIDgACAAIAJBCGogARBCDQAaIAIrAwgiBJlE////////P0NlIAS9QoCAgICAgID4/wCDQoCAgICAgID4/wBSIAScIARhcXGtQoCAgIAQhAshBSACQRBqJAAgBQsmAEKAgICA4AAgACADKQMAENkFIgBBAEetQoCAgIAQhCAAQQBIGwsvAQF+An4gAygCBCICBEBCgICAgBAiBCACQQtqQRJJDQEaCyAAIAQgAyADENIECwsvAQF+An4gAygCBCICBEBCgICAgBAiBCACQQtqQRJJDQEaCyAAIAQgAyADENMECwsJACAAIAEQngILowECAn4BfyMAQRBrIgIkAAJ+IAAgARCeAiIFQoCAgIBwg0KAgICA4ABRBEAgBQwBC0EKIQcCQAJAIAQNACADKQMAIgFCgICAgHCDQoCAgIAwUQ0AIAAgARDbBCIHQQBIDQELQoCAgIDgACAAIAJBCGogBRBtDQEaIAAgAisDCCAHQQBBABC6AgwBCyAAIAUQDEKAgICA4AALIQYgAkEQaiQAIAYLkAICAX4BfCMAQRBrIgIkAEKAgICA4AAhBAJAIAAgARCeAiIBQoCAgIBwg0KAgICA4ABRBEAgASEEDAELIAAgAiABEG0NAAJAAkAgAykDACIBQoCAgIBwg0KAgICAMFEEQCACKwMAIgW9IQEMAQsgACACQQxqIAEQswENAiACKwMAIgW9IgFCgICAgICAgPj/AINCgICAgICAgPj/AFINAQsgAEKAgICAwH4gAUKAgICAwIGA/P8AfSAFvUL///////////8Ag0KAgICAgICA+P8AVhsQNCEEDAELIAIoAgwiA0HlAGtBm39NBEAgAEHrIUEAEEQMAQsgACAFQQogA0EBELoCIQQLIAJBEGokACAEC80BAgF+AnwjAEEQayICJABCgICAgOAAIQQCQCAAIAEQngIiAUKAgICAcINCgICAgOAAUQRAIAEhBAwBCyAAIAIgARBtDQAgACACQQxqIAMpAwAQswENACACKAIMIgNB5QBPBEAgAEHrIUEAEEQMAQsgAisDACIFmSIGRFDv4tbkGktEZgRAIABCgICAgMB+IAW9QoCAgIDAgYD8/wB9IAa9QoCAgICAgID4/wBWGxA0IQQMAQsgACAFQQogA0ECELoCIQQLIAJBEGokACAEC4sCAwF+AX8BfCMAQRBrIgIkAEKAgICA4AAhBAJAIAAgARCeAiIBQoCAgIBwg0KAgICA4ABRBEAgASEEDAELIA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AhCgwGCwJAIAUEQCAIIQoMAQsgBCAINwMgIAQgAUL/////D4M3AyggACAOIA9BAiAEQSBqEBwhCiAAIAgQDCAKQoCAgIBwg0KAgICA4ABRDQMLIAAgCyABIAoQZ0EASA0CIAFCAXwhAQwACwALIAAgCBAgIgpCgICAgHCDQoCAgIDgAFENAiAAIARBCGogChAvQQBIDQIgBAJ+IAQpAwgiCEKAgICACHxC/////w9YBEAgCEL/////D4MMAQtCgICAgMB+IAi5vSIJQoCAgIDAgYD8/wB9IAlC////////////AINCgICAgICAgPj/AFYbCyINNwMgAn4CQCABQoCAgIBwVA0AIAGnLQAFQRBxRQ0AIAAgAUEBIARBIGoQowEMAQsgAEKAgICAMEEBIARBIGoQ4AILIQsgACANEAwgC0KAgICAcINCgICAgOAAUQRAQoCAgIAwIQwMAgtCACENIAhCACAIQgBVGyEBA0AgASANUQRAQoCAgIAwIQxCgICAgDAhCQwFC0KAgICAMCEMIAAgCiANEGwiCEKAgICAcINCgICAgOAAUQ0CAkAgBQRAIAghCQwBCyAEIAg3AyAgBCANQv////8PgzcDKCAAIA4gD0ECIARBIGoQHCEJIAAgCBAMIAlCgICAgHCDQoCAgIDgAFENAwsgACALIA0gCRBnIQcgDUIBfCENIAdBAE4NAAsMAQtCgICAgDAhCiAJQoCAgIBwg0KAgICAMFENAyAAIAlBARCQARoMAwtCgICAgDAhCQwCC0KAgICAMCEMQoCAgIAwIQlCgICAgDAhCwwBCyAAIAtBMCABpyICQQBOBH4gAUL/////D4MFQoCAgIDAfiACuL0iAUKAgICAwIGA/P8AfSABQoCAgICAgID4/wBWGwsQOUEATg0BCyAAIAsQDEKAgICA4AAhCwsgACAKEAwgACAJEAwgACAMEAwgBEEwaiQAIAsLJgBCgICAgOAAIAAgAykDABDMASIAQQBHrUKAgICAEIQgAEEASBsLowICAX8EfiMAQRBrIgUkAEKAgICAMCEGAkACQCAAIAVBCGogACABECAiCRAvDQAgBUEBNgIEAkAgBARAIAMpAwAhCEKAgICAMCEHIAJ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GIQEgAykDCCINQoCAgIBwg0KAgICAMFIEfiAAIA5BEGogDUIAIAEgARBmDQIgDikDEAUgAQsgDikDGH0iAUIAIAFCAFUbIQdBACECCyAAIAogB0KAgICACHxC/////w9YBH4gB0L/////D4MFQoCAgIDAfiAHub0iAUKAgICAwIGA/P8AfSABQv///////////wCDQoCAgICAgID4/wBWGwsiBRCfAiEBIAAgBRAMAkAgAUKAgICAcINCgICAgOAAUQ0AIA4pAxgiDSAHfCELAkACQCAKIA5BDGogDkEIahCPAUUgAUKAgICAcFRyDQAgAaciDy8BBkECRw0AIA0hBSAPLQAFQQhxRQ0BIAUgCyAONQIIIgggCCALVRsiCCAFIAhVGyAFfSEJIA4oAgwhEANAIAkgDFENAiAQIAWnQQN0aikDACIIQiCIp0F1TwRAIAinIg8gDygCAEEBajYCAAsgACABIAwgCEGAgAEQyAFBAEgNAyAMQgF8IQwgBUIBfCEFDAALAAsgDSEFCyAFIAsgBSALVRshCANAIAUgCFIEQCAAIAogBSAOQShqEFQiD0EASA0CIA8EQCAAIAEgCSAOKQMoQYCAARDIAUEASA0DCyAJQgF8IQkgBUIBfCEFDAELCyAAIAFBMCAJQoCAgIAIWgR+QoCAgIDAfiAJub0iBUKAgICAwIGA/P8AfSAFQv///////////wCDQoCAgICAgID4/wBWGwUgCQsQOUEASA0AIAQEQCAGIAKtIgt8IAd9IQwCQCAHIAtRDQAgACAKIAsgDXwgByANfCIFIAYgBX1Bf0EBIAcgC1MbEPMCQQBIDQIDQCAGIAxXDQEgACAKIAZCAX0iBhCFAkEATg0ACwwCCyADQRBqIQNCACEFA0AgBSALUgRAIAMgBadBA3RqKQMAIghCIIinQXVPBEAgCKciAiACKAIAQQFqNgIACyAFIA18IQYgBUIBfCEFIAAgCiAGIAgQe0EATg0BDAMLCyAMQoCAgIAIfEL/////D1gEfiAMQv////8PgwVCgICAgMB+IAy5vSIFQoCAgIDAgYD8/wB9IAVC////////////AINCgICAgICAgPj/AFYbCyEJIAEhBSAAIApBMCAJ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B9IAFC////////////AINCgICAgICAgPj/AFYbCyEHIARBIGokACAHC+cDAgJ/B34jAEEgayIEJAACfgJAIAAgBEEQaiAAIAEQICIIEC8NAEJ/IQkCQCAEKQMQIgdCAFcNAEIAIQEgBEIANwMIIAJBAk4EQCAAIARBCGogAykDCEIAIAcgBxBmDQIgBCkDCCEBCwJAAkAgCCAEQQRqIAQQjwFFDQAgASAENQIAIgYgASAGVRshBiAEKAIEIQIDQCABIAZRBEAgBiEBDAILIAMpAwAiCkIgiKdBdU8EQCAKpyIFIAUoAgBBAWo2AgALIAIgAadBA3RqKQMAIgtCIIinQXVPBEAgC6ciBSAFKAIAQQFqNgIACyAAIAogC0EAELQBDQIgAUIBfCEBDAALAAsgASAHIAEgB1UbIQcDQCABIAdRDQIgACAIIAEgBEEYahBUIgJBAEgNAyACBEAgAykDACIGQiCIp0F1TwRAIAanIgIgAigCAEEBajYCAAsgACAGIAQpAxhBABC0AQ0CCyABQgF8IQEMAAsACyABIQkLIAAgCBAMIAlC/////w+DIAlCgICAgAh8Qv////8PWA0BGkKAgICAwH4gCbm9IgFCgICAgMCBgPz/AH0gAUL///////////8Ag0KAgICAgICA+P8AVhsMAQsgACAIEAxCgICAgOAACyEMIARBIGokACAMC+cDAgl+AX8jAEEwayIOJABCgICAgDAhBgJAAkAgACAOQQhqIAAgARAgIggQLwRAQoCAgIAwIQUMAQtCgICAgDAhBSAAIAMpAwAiChBVDQBCgICAgDAhCSACQQJOBEAgAykDCCEJCyAOKQMIIgVCAX1CACAEQX5xQQJGIgIbIQdCf0IBIAIbIQtCfyAFIAIbIQwDQCAHIAxSBEAgB0KAgICACHxC/////w9YBH4gB0L/////D4MFQoCAgIDAfiAHub0iBUKAgICAwIGA/P8AfSAFQv///////////wCDQoCAgICAgID4/wBWGwsiBUKAgICAcINCgICAgOAAUQ0CIAAgCCAFEE4iBkKAgICAcINCgICAgOAAUQ0CIA4gATcDICAOIAU3AxggDiAGNwMQIAAgCiAJQQMgDkEQahAcIg1Cg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BBRDQIgDCAIQn+FfCAIIAQbIQoCQAJAAkAgBwRAIAUgACABIAoQbCILNwM4IAtCgICAgHCDQoCAgIDgAFINAQwDCyAAIAEgCiAFQThqEFQiAkEASARAIAUpAzghCwwDCyACRQ0BCyAKQoCAgIAIfEL/////D1gEfiAKQv////8PgwVCgICAgMB+IAq5vSILQoCAgIDAgYD8/wB9IAtC////////////AINCgICAgICAgPj/AFYbCyENIAUpAzghCiANQoCAgIBwg0KAgICA4ABRBEAgCiELDAILIAUgATcDKCAFIA03AyAgBSAKNwMYIAUgCTcDEEKAgICAMCELIAAgD0KAgICAMEEEIAVBEGoQHCEOIAAgDRAMIAAgChAMIAVCgICAgDA3AzggDkKAgICAcINCgICAgOAAUQ0BIAAgCRAMIA4hCQsgCEIBfCEIDAELCyAFIAk3AzALIAAgBSkDMBAMIAAgCxAMQoCAgIDgACEJCyAAIAEQDCAFQUBrJAAgCQvlCAIDfwp+IwBBMGsiBSQAQoCAgIAwIQggBUKAgICAMDcDKAJAAkACQCAEQQhxIgcEQCABQiCIp0F1TwRAIAGnIgYgBigCAEEBajYCAAsgBSAAIAEQigEiBqw3AwggBkEATg0BQoCAgIDgACEJDAILQoCAgIDgACEJIAAgBUEIaiAAIAEQICIBEC8NAQsgAykDACEQQoCAgIAwIQ8gAkECTgRAIAMpAwghDwtCgICAgOAAIQkgACAQEFUNAAJAAkACQAJAAkACQAJAIAQODQUABgECBgYGBQAGAwQGC0KAgICAECEIDAULIAAgAQJ+IAUpAwgiCEKAgICACHxC/////w9YBEAgCEL/////D4MMAQtCgICAgMB+IAi5vSIIQoCAgIDAgYD8/wB9IAhC////////////AINCgICAgICAgPj/AFYbCxCfAiIIQoCAgIBwg0KAgICA4ABSDQQMBQsgACABQgAQnwIiCEKAgICAcINCgICAgOAAUg0DDAQLIAUgATcDECAFIAU1Agg3AxggAEECIAVBEGoQ4QIiCEKAgICAcINCgICAgOAAUg0CDAMLIAAQOyIIQoCAgIBwg0KAgICA4ABSDQFCgICAg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AAQS8QKQUgAQtBnggQsgELC+EFAwN+B38DfAJAIAAgARBVDQAgACAAKQMwQQ4QRyIFQoCAgIBwg0KAgICA4ABRDQAgBaciCSABQoCAgIBwWgR/IAGnLQAFQRBxBUEACyAJLQAFQe8BcXI6AAUCQCAAQQEgAiACQQFMGyIKQQFrIghBA3RBGGoQJCIHRQ0AIAFCIIinQXVPBEAgAaciAiACKAIAQQFqNgIACyAHIAE3AwAgAykDACIEQiCIp0F1TwRAIASnIgIgAigCAEEBajYCAAsgByAINgIQIAcgBDcDCCAHQRhqIQtBACECA0AgAiAIRwRAIAMgAkEBaiIMQQN0aikDACIEQiCIp0F1TwRAIASnIg0gDSgCAEEBajYCAAsgCyACQQN0aiAENwMAIAwhAgwBCwsgCSAHNgIgAn8gAUL/////b1gEQCAAECJBfwwBCyAAQQAgAadBMBBDCyICQQBIDQACQCACRQ0AIAAgAUEwIAFBABARIgRCgICAgHCDQoCAgIDgAFENASAEQv////8PWARAIASnIgIgCGtBACACIApOG60hBgwBCyAEQiCIp0EHa0FtTQRAAkAgBEKAgICAwIGA/P8AfCIEQv///////////wCDQoCAgICAgID4/wBWDQAgBL+dIg8gCLciEGUNACAPIBChIQ4LIA69IgQCfyAOmUQAAAAAAADgQWMEQCAOqgwBC0GAgICAeAsiAre9UQRAIAKtIQYMAgtCgICAgMB+IARCgICAgMCBgPz/AH0gBEL///////////8Ag0KAgICAgICA+P8AVhshBgwBCyAAIAQQDAsgACAFQTAgBkEBEBUaIABBgJIBIAAgAUE3IAFBABARIgFCgICAgHCDIgRCgICAgJB/UgR+IARCgICAgOAAUQ0BIAAgARAMIABBLxApBSABC0HslgEQsgEiAUKAgICAcINCgICAgOAAUQ0AIAAgBUE3IAFBARAVGiAFDwsgACAFEAwLQoCAgIDgAAswACACQQBMBEAgACABQoCAgIAwQQBBABAcDwsgACABIAMpAwAgAkEBayADQQhqEBwLgwICAX4BfyMAQSBrIgIkAEKAgICA4AAhBQJAAkAgACABECAiAUKAgICAcINCgIC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4AAPCyADKQMQIQZCgICAgOAAIQUCQCAAIAMpAwgQMCICRQ0AIAAgASACIAYgBEVBDnQQ2QQhAyAAIAIQECADQQBIDQAgBARAIANBAEetQoCAgIAQhA8LIAGnIgAgACgCAEEBajYCACABIQULIAULQQAgACADKQMAIgEgAykDCEEBEIkCQQBIBEBCgICAgOAADwsgAUIgiKdBdU8EQCABpyIAIAAoAgBBAWo2AgALIAELXQACQCABQoCAgIBwg0KAgICAMFENACAAKAIQKAKMASgCCCABp0YNACAAIAFBARBeDwsgAykDACIBQiCIpyICQQtqQRFLIAJBfnFBAkdyRQRAIAAQMw8LIAAgARAgCzYAIAMpAwAiAUIgiKciAkF/RiAERSACQX5xQQJHcXJFBEAgABAiQoCAgIDgAA8LIAAgARDoAQuJAQEBfiADKQMAIgFC/////29WIAFCgICAgHCDQoCAgIAgUXJFBEAgAEHe0gBBABASQoCAgIDgAA8LAkAgACABEEEiAUKAgICAcINCgICAgOAAUgRAIAMpAwgiBEKAgICAcINCgICAgDBRDQEgACABIAQQ2gRFDQEgACABEAwLQoCAgIDgAA8LIAELnwIBA34gAUL/////b1gEQCAAECJCgICAgOAADwtCgICAgOAAIQUCfiAAIAFBNyABQQAQESIEQoCAgIBwg0KAgICAMFEEQCAAQZQBECkMAQsgACAEEDQLIgRCgICAgHCDIgZCgICAgOAAUgR+An4gACABQTMgAUEAEBEiAUKAgICAcINCgICAgDBRBEAgAEEvECkMAQsgACABEDQLIgFCgICAgHCDIgVCgICAgOAAUQRAIAAgBBAMQoCAgIDgAA8LAkAgBkKAgICAkH9RBEAgBKcoAgRB/////wdxRQ0BCyAFQoCAgICQf1EEQCABpygCBEH/////B3FFDQELIABB7JYBIARBpJIBELIBIQQLIAAgBCABELYCBUKAgICA4AALC5UCAgF+An8jAEEwayICJABCgICAgOAAIQECQCAAIAJBKGogAykDABCkAQ0AIAAQ4gEiBUKAgICAcINCgICAgOAAUQ0AIAAgAkEUaiADKQMIEK4CIgZFBEAgACAFEAwMAQsgACg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ICAMCEBDAELIAIoAhgEQEKAgICAMCEBQQEMBQsgACACKQMAIgggAikDCCIGEMUBIgFCgICAgHCDIgdCgICAgOAAUg0BC0KAgICAMCEHDAELIAdCgICAgCBRBEAgAkEBNgIYQoCAgIAwIQFBAQwDCyACKAIQBEAgACAAIAFCABBOEDQiB0KAgICAcIMiCUKAgICA4ABRDQECQCAJQoCAgICQf1INACAHpygCBEH/////B3ENACAAIANBCGogACAIQdYAIAhBABAREKEBQQBIDQIgACAIQdYAAn4gBqcgAykDCCACKAIUEPQCIgZCgICAgAh8Qv////8PWARAIAZC/////w+DDAELQoCAgIDAfiAGub0iBkKAgICAwIGA/P8AfSAGQv///////////wCDQoCAgICAgID4/wBWGwsQOUEASA0CCyAAIAcQDAwCCyACQQE2AhgMAQsgACABEAwgACAHEAxCgICAgOAAIQELQQALNgIAIANBEGokACABCyAAIAFCIIinQXVPBEAgAaciACAAKAIAQQFqNgIACyABC/EHAgR/C34jAEEwayIEJAACQCABQv////9vWARAIAAQIkKAgICA4AAhAQwBC0KAgICAMCEIAkACQCAAIAMpAwAQJSIPQoCAgIBwg0KAgICA4ABRBEBCgICAgDAhDEKAgICAMCEBQoCAgIAwIQ1CgICAgDAhEAwBCyAAIAEgACkDSBD9ASIQQoCAgIBwg0KAgICA4ABRBEBCgICAgDAhDEKAgICAMCEBQoCAgIAwIQ0MAQsCQAJAIAAgACABQe4AIAFBABAREDQiDUKAgICAcINCgICAgOAAUQ0AIA2nIgJB9QBBABCgASEGIAJB+QBBABCgAUEASARAIABB7JYBIA1B0A4QsgEiDUKAgICAcINCgICAgOAAUQ0BCyAEIA03AyggBCABNwMgIAAgEEECIARBIGoQowEiDEKAgICAcINCgICAgOAAUQ0BIAAQOyIBQoCAgIBwg0KAgICA4ABRBEBCgICAgOAAIQEMAwtBfyECAkAgAykDCCIJQoCAgIBwg0KAgICAMFENACAAIARBHGogCRB1QQBIDQMgBCgCHCICDQAMBAsCQAJAIA+nIgcpAgQiCKdB/////wdxIgUEQCAGQX9zQR92IQYgCEL/////B4MhESACrSESQgAhCUKAgICAMCEIQQAhAgNAIAKtIQogAiEDA0AgAyAFTw0DIAAgDEHWACADrSIOEDlBAEgNByAAIAgQDAJAIAAgDCAPEMUBIghCgICAgHCDIgtCgICAgCBRDQAgC0KAgICA4ABRDQggACAEQRBqIAAgDEHWACAMQQAQERChAQ0IIAQgBCkDECILIBEgCyARUxsiCzcDECAKIAtRDQAgACAHIAIgAxCOASIKQoCAgIBwg0KAgICA4ABRDQggACABIAkgChBnQQBIDQggCUIBfCIKIBJRDQkgACAEQQhqIAgQLw0IIAunIQJCASELIAlCASAEKQMIIg4gDkIBVxt8IQkDQCAJIApRDQMgACAAIAggCxBsEDQiDkKAgICAcINCgICAgOAAUQ0JIAAgASAKIA4QZ0EASA0JIAtCAXwhCyAKQgF8IgogElINAAsMCQsgByAOIAYQ9AKnIQMMAAsACwALIAAgDCAPEMUBIghCgICAgHCDIglCgICAgCBSDQFCACEJQQAhAgsgACAHIAIgBSACIAVJGyAFEI4BIgpCgICAgHCDQoCAgIDgAFENAyAAIAEgCSAKEGdBAEgNAwwECyAJQoCAgIDgAFINAwwCC0KAgICAMCEMC0KAgICAMCEBCyAAIAEQDEKAgICA4AAhAQsgACAPEAwgACAQEAwgACAMEAwgACANEAwgACAIEAwLIARBMGokACABC+ACAQd+IAFC/////29YBEAgABAiQoCAgIDgAA8LQoCAgIDgACEIQoCAgIAwIQYCQAJAAkAgACADKQMAECUiB0KAgICAcINCgICAgOAAUQRAQoCAgIAwIQQMAQsgACABQdYAIAFBABARIgRCgICAgHCDQoCAgIDgAFENACAAIARCABBNRQRAIAAgAUHWAEIAEDlBAEgNAQsgACABIAcQxQEiBUKAgICAcIMiCUKAgICA4ABRDQEgACABQdYAIAFBABARIgZCgICAgHCDQoCAgIDgAFENAQJAIAAgBiAEEE0EQCAAIAQQDAwBCyAAIAFB1gAgBBA5QQBODQBCgICAgDAhBAwCCyAAIAcQDCAAIAYQDEL/////DyEIIAlCgICAgCBRDQIgACAFQdgAIAVBABARIQogACAFEAwgCg8LQoCAgIAwIQULIAAgBRAMIAAgBxAMIAAgBhAMIAAgBBAMCyAIC84EAgZ+AX8jAEEgayICJAACQCABQv////9vWARAIAAQIkKAgICA4AAhBwwBC0KAgICA4AAhB0KAgICAMCEIAkAgACADKQMAECUiCUKAgICAcINCgICAgOAAUQRAQoCAgIAwIQRCgICAgDAhBUKAgICAMCEGDAELAkACQCAAIAEgACkDSBD9ASIGQoCAgIBwg0KAgICA4ABRBEBCgICAgDAhBAwBCyAAIAAgAUHuACABQQAQERA0IgRCgICAgHCDQoCAgIDgAFINAQtCgICAgDAhBQwBCyACIAQ3AxggAiABNwMQIAAgBkECIAJBEGoQowEiBUKAgICAcINCgICAgOAAUQ0AIAAgAkEIaiAAIAFB1gAgAUEAEBEQoQENACAAIAVB1gACfiACKQMIIgFCgICAgAh8Qv////8PWARAIAFC/////w+DDAELQoCAgIDAfiABub0iAUKAgICAwIGA/P8AfSABQv///////////wCDQoCAgICAgID4/wBWGwsQOUEASA0AQoCAgIDgACEIIABBKhCGASIBQoCAgIBwg0KAgICA4ABRDQAgAEEgECQiA0UEQCABIQgMAQsgAyAJNwMIIAMgBTcDACADIASnIgpB5wBBABCgAUF/c0EfdjYCECAKQfUAQQAQoAEhCiADQQA2AhggAyAKQX9zQR92NgIUIAFCgICAgHBaBEAgAacgAzYCIAsgACAGEAwgACAEEAwgASEHDAELIAAgCRAMIAAgBhAMIAAgBBAMIAAgBRAMIAAgCBAMCyACQSBqJAAgBwv+BAIIfgJ/IwBBEGsiAiQAAkAgAUL/////b1gEQCAAECJCgICAgOAAIQcMAQtCgICAgOAAIQdCgICAgDAhBQJAAkACQCAAIAMpAwAQJSIJQoCAgIBwg0KAgICA4ABRBEBCgICAgDAhCAwBCyAAIAFB7gAgAUEAEBEiCEKAgICAcINCgICAgOAAUQ0AIAAgCBA0IghCgICAgHCDQoCAgIDgAFENACAIp0HnAEEAEKABQX9GBEAgACABIAkQxQEhBwwDCyAAIAAgAUHwACABQQAQERAnIgxBAEgNACAAIAFB1gBCABA5QQBIDQAgABA7IgZCgICAgHCDQoCAgIDgAFEEQEKAgICA4AAhBgwCCyAJpyENA0ACQCAAIAUQDCAAIAEgCRDFASIFQoCAgIBwgyIEQoCAgIAgUQ0AIARCgICAgOAAUQ0DAkAgACAAIAVCABBOEDQiBEKAgICAcIMiC0KAgICAkH9SBEBBACEDIAtCgICAgOAAUQ0FDAELIASnKAIEQf////8HcUUhAwsgACAGIAogBBB7QQBIDQMgCkIBfCEKIANFDQEgACACQQhqIAAgAUHWACABQQAQERChAUEASA0DIAAgAUHWAAJ+IA0gAikDCCAMEPQCIgRCgICAgAh8Qv////8PWARAIARC/////w+DDAELQoCAgIDAfiAEub0iBEKAgICAwIGA/P8AfSAEQv///////////wCDQoCAgICAgID4/wBWGwsQOUEATg0BDAMLCyAKpwRAIAYhBwwDCyAAIAYQDEKAgICAICEHDAILQoCAgIAwIQYLIAAgBhAMCyAAIAUQDCAAIAgQDCAAIAkQDAsgAkEQaiQAIAcLjgEBAn8gASgCACICQQBKBEAgASACQQFrIgI2AgACQCACDQAgAS0ABEHwAXFBEEcNACABKAIIIgIgASgCDCIDNgIEIAMgAjYCACABQQA2AgggACgCYCICIAFBCGoiAzYCBCABIABB4ABqNgIMIAEgAjYCCCAAIAM2AmALDwtB5oQBQajsAEHWLEHN4wAQAAAL8BQCDn8OfiMAQZABayIEJAACQCABQv////9vWARAIAAQIkKAgICA4AAhFQwBCyADKQMIIR4gACAEQThqQQAQPhogBEEANgIwIARCgICAgMAANwMoIAQgADYCACAEIARBCGoiBzYCBEKAgICA4AAhFUKAgICAMCEWQoCAgIAwIRdCgICAgDAhE0KAgICAMCEUQoCAgIAwIR1CgICAgDAhHAJAAkAgACADKQMAECUiGEKAgICAcINCgICAgOAAUQ0AIAAgHhA1IglFBEAgACAeECUiHUKAgICAcINCgICAgOAAUQ0BIB2nIQULAkACQCAAIAFB7gAgAUEAEBEiHEKA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INCgICAgDBRDQAaAkAgACAEQQRqIAcQ3wEiAgRAAkAgAi0AAEHOAEcNACACLQABQcYARw0AIAJBA0ECIAItAAJBywBGIgMbai0AACIFQcMAa0H/AXFBAUsNACAEKAIEIAJBA2ogAkECaiADGyACa0EBakYNAgsgACACEDEgAEGywABBABBECyAAIAEQDAwCCyAAIAIQMSAFIANBAXRqQcMAawsQ2gMhAyAAIAEQDCADQQBODQELQoCAgIDgACEBDAELIAQoAgAhBUKAgICA4AAhAQJAIAAgBEEIaiADED4NAEEAIQICQANAIAIgA0YNASACQQJ0IQYgAkEBaiECIARBCGogBSAGaigCABCxAUUNAAsgBCgCCCgCECICQRBqIAQoAgwgAigCBBEAAAwBCyAEQQhqEDchAQsgACgCECIAQRBqIAUgACgCBBEAAAsgBEEgaiQAIAELgQICA38BfgJAAkAgAkEATg0AIAGnKQMgIgpCgICAgHCDQoCAgICQf1INACACQf////8HcSIIIAqnIgcpAgQiCqdB/////wdxTw0AAkBBBCAGEI8DRQ0AQQEhAiAGQYDAAHFFDQIgA0KAgICAcINCgICAgJB/Ug0AIAOnIgkpAgQiAUL/////B4NCAVINACAHQRBqIQcCfyAKQoCAgIAIg1BFBEAgByAIQQF0ai8BAAwBCyAHIAhqLQAACwJ/IAFCgICAgAiDUEUEQCAJLwEQDAELIAktABALRg0CCyAAIAZB79gAEHwPCyAAIAEgAiADIAQgBSAGQYCACHIQaiECCyACC0YAAn8CQCACQQBODQAgAacpAyAiAUKAgICAcINCgICAgJB/Ug0AQQAgAkH/////B3EgAacoAgRB/////wdxSQ0BGgtBAQsLswEBAn8CQCADQQBODQAgAqcpAyAiAkKAgICAcINCgICAgJB/Ug0AIANB/////wdxIgMgAqciBCkCBCICp0H/////B3FPDQBBASEFIAFFDQAgBEEQaiEEAn8gAkKAgICACINQRQRAIAQgA0EBdGovAQAMAQsgAyAEai0AAAshAyABQQQ2AgAgACADQf//A3EQlAMhAiABQoCAgIAwNwMYIAFCgICAgDA3AxAgASACNwMICyAFCx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IAEEQCAAIAAoAgBBAWs2AgAgACAAKAIEQQhrNgIEIAEQ1AELCyUBAX8CQCABpygCICIDRQ0AIAMoAgQiA0UNACAAIAMgAhEAAAsLPwEBfwJAIAFCgICAgHBUDQAgAaciAi8BBkErRw0AIAIoAiAiAkUNACAAIAIQ5wMgAEEQaiACIAAoAgQRAAALC0cBAX8CQCABpygCICIDRQ0AIAMpAwAiAUKAgICAYFoEQCAAIAGnIAIRAAALIAMpAwgiAUKAgICAYFQNACAAIAGnIAIRAAALCzABAX8gAacoAiAiAgRAIAAgAikDABAhIAAgAikDCBAhIABBEGogAiAAKAIEEQAACwsnAQF/IAGnKAIgIgIEQCAAIAIpAwAQISAAQRBqIAIgACgCBBEAAAsLWgECfyABpygCICICBEACQCACKQMAIgFCgICAgHBUDQAgAactAAVBAnENACACKAIMIgNFDQAgACADEOIDIAIpAwAhAQsgACABECEgAEEQaiACIAAoAgQRAAALC3gBA38CQCABpygCICIERQ0AIARBCGohAyAEQQRqIQUDQCADKAIAIgMgBUYNAQJAIAQoAgANACADKQMQIgFCgICAgGBUDQAgACABpyACEQAACyADKQMYIgFCgICAgGBaBEAgACABpyACEQAACyADQQRqIQMMAAsACwuaAQEHfyABpygCICIDBEAgAEEQaiEEIANBBGohBiADKAIIIQIDQCACIAZHBEAgAigCBCEIIAJBEGshBSACQQxrKAIARQRAAkAgAygCAARAIAUQnAUMAQsgACACKQMQECELIAAgAikDGBAhCyAEIAUgACgCBBEAACAIIQIMAQsLIAQgAygCECAAKAIEEQAAIAQgAyAAKAIEEQAACwsbAQF/IAGnKAIgIgMEQCAAIAMoAgwgAhEAAAsLUgEDfyABpygCICICBEAgAigCBCIDBEAgAigCACIEIAM2AgQgAyAENgIAIAJCADcCAAsgACACNQIMQoCAgIBwhBAhIABBEGogAiAAKAIEEQAACwupAQEGfyABpygCICIDBEAgA0EMaiEFIAMoAhAhAgNAIAIgBUcEQCACKAIEIQcgAkIANwIAIAIoAgghBCAHIQIgBC8BBkEgRg0BIARCADcCJAwBCwsCQAJAIAMtAAVFDQAgACgCyAEiAkUNACAAKALQASADKAIIIAIRAAAMAQsgAygCGCICRQ0AIAAgAygCFCADKAIIIAIRBgALIABBEGogAyAAKAIEEQAACwspAQF/IAAgAaciAjUCJEKAgICAkH+EECEgACACNQIgQoCAgICQf4QQIQshACABpygCICkDACIBQoCAgIBgWgRAIAAgAacgAhEAAAsLaQEDfyAAIAGnKAIgIgIpAwAQISACLQARRQRAA0AgAigCFCEEIAMgAigCDE9FBEAgACAEIANBA3RqKAIEEMcBIANBAWohAwwBCwsgAEEQaiAEIAAoAgQRAAALIABBEGogAiAAKAIEEQAAC2wBA38CQCABQoCAgIBwVA0AIAGnIgMvAQZBD0cNACADKAIgIgRFDQAgBEEIaiEFQQAhAwNAIAMgBC0ABU8NASAFIANBA3RqKQMAIgFCgICAgGBaBEAgACABpyACEQAACyADQQFqIQMMAAsACwtqAQN/AkAgAUKAgICAcFQNACABpyICLwEGQQ9HDQAgAigCICIDRQ0AIANBCGohBEEAIQIDQCACIAMtAAVPRQRAIAAgBCACQQN0aikDABAhIAJBAWohAgwBCwsgAEEQaiADIAAoAgQRAAALC38BA38gAacoAiAiBCkDACIBQoCAgIBgWgRAIAAgAacgAhEAAAsgBCkDCCIBQoCAgIBgWgRAIAAgAacgAhEAAAsgBEEYaiEFA0AgBCgCECADSgRAIAUgA0EDdGopAwAiAUKAgICAYFoEQCAAIAGnIAIRAAALIANBAWohAwwBCwsLWQEDfyAAIAGnKAIgIgIpAwAQISAAIAIpAwgQISACQRhqIQQDQCADIAIoAhBORQRAIAAgBCADQQN0aikDABAhIANBAWohAwwBCwsgAEEQaiACIAAoAgQRAAALcgEEfyABpyIDKAIgIQQgAygCJCEFIAMoAigiAwRAIAAgAyACEQAACyAEBEACQCAFRQ0AQQAhAwNAIAMgBCgCPE4NASAFIANBAnRqKAIAIgYEQCAAIAYgAhEAAAsgA0EBaiEDDAALAAsgACAEIAIRAAALC3wBA38gAaciAigCKCIDBEAgAC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JAAkACQAJAAkACQAJAAkAgCw4NCwIAAQABBwgDBAUGCQoLIAVBAXENCkKAgICAMCECIAtBAkcNCgwLCyAFQQFxDQBCgICAgDAhAiALQQNGDQoLIAcgAiADIAAgCC4BKiAEEQQAIQEMCwsgByACIAQRCAAhAQwKCyAHIAIgACkDACAEERgAIQEMCQsgByACIAguASogBBEQACEBDAgLIAcgAiAAKQMAIAguASogBBEoACEBDAcLIAcgBkEIaiAAKQMAEEINBSAGKwMIIAQRCgAiD70iAQJ/IA+ZRAAAAAAAAOBBYwRAIA+qDAELQYCAgIB4CyIAt71RBEAgAK0hAQwHC0KAgICAwH4gAUKAgICAwIGA/P8AfSABQv///////////wCDQoCAgICAgID4/wBWGyEBDAYLQoCAgIDgACEBIAcgBkEIaiAAKQMAEEINBSAHIAYgACkDCBBCDQUgBisDCCAGKwMAIAQRHQAiD70iAQJ/IA+ZRAAAAAAAAOBBYwRAIA+qDAELQYCAgIB4CyIAt71RBEAgAK0hAQwGC0KAgICAwH4gAUKAgICAwIGA/P8AfSABQv///////////wCDQoCAgICAgID4/wBWGyEBDAULIAcgAiADIAAgBkEIaiAILgEqIAQREQAiAUKAgICAcINCgICAgOAAUQ0EIAYoAggiAEECRg0EIAcgASAAEIIDIQEMBAsQAQALIAcgAiADIAAgBBECACEBDAILIAdBmRFBABASC0KAgICA4AAhAQsgDCAGKAIQNgKMASAGQUBrJAAgAQvVAQEGfyMAIgUhCwJAIAFCgICAgHBUDQAgAaciBi8BBkEPRw0AIAYoAiAhBwsgACACIAMgAyAHLQAEIgBIBH9BACEGIANBACADQQBKGyEJIAUgAEEDdEEPakHwH3FrIgUkAAN/IAYgCUYEfyADIQQDfyAAIARGBH8gBQUgBSAEQQN0akKAgICAMDcDACAEQQFqIQQMAQsLBSAFIAZBA3QiCmogBCAKaikDADcDACAGQQFqIQYMAQsLBSAECyAHLwEGIAdBCGogBygCABERACEBIAskACABCw4AIAAQqwJCgICAgOAACwkAQoCAgIDAfgsPACAAIAMQDCA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/uhdExqWSKPEBFblt20O8/7eM75Lo3jrwUvpyt/dvvP53NkU07iXc82JCegcHn7z+JzGBBwQVTPPFxjyvC8+8/0XSeAFedvSqAcFIP//8+JwoAAABkAAAA6AMAABAnAACghgEAQEIPAICWmAAA4fUFGAAAADUAAABxAAAAa////877//+Sv///AAAAAAAAAAAZAAoAGRkZAAAAAAUAAAAAAAAJAAAAAAsAAAAAAAAAABkAEQoZGRkDCgcAAQAJCxgAAAkGCwAACwAGGQAAABkZGQBB8c4ECyEOAAAAAAAAAAAZAAoNGRkZAA0AAAIACQ4AAAAJAA4AAA4AQavPBAsBDABBt88ECxUTAAAAABMAAAAACQwAAAAAAAwAAAwAQeXPBAsBEABB8c8ECxUPAAAABA8AAAAACRAAAAAAABAAABAAQZ/QBAsBEgBBq9AECx4RAAAAABEAAAAACRIAAAAAABIAABIAABoAAAAaGhoAQeLQBAsOGgAAABoaGgAAAAAAAAkAQZPRBAsBFABBn9EECxUXAAAAABcAAAAACRQAAAAAABQAABQAQc3RBAsBFgBB2dEECycVAAAAABUAAAAACRYAAAAAABYAABYAADAxMjM0NTY3ODlBQkNERUYAQaTSBAsCpgEAQczSBAsI//////////8AQZDTBAsBBQBBnNMECwKhAQBBtNMECw6iAQAAowEAACgrAQAABABBzNMECwEBAEHc0wQLBf////8KAEGg1AQLB5ApAQBAMQI=";if(!K(L)){var M=L;L=d.locateFile?d.locateFile(M,q):q+M;}function ca(){var a=L;return Promise.resolve().then(()=>{if(a==L&&v)var b=new Uint8Array(v);else{if(K(a)){b=atob(a.slice(37));for(var c=new Uint8Array(b.length),e=0;eWebAssembly.instantiate(c,a)).then(c=>c).then(b,c=>{u(`failed to asynchronously prepare wasm: ${c}`);w(c);});}function ea(a,b){return da(a,b);}var N=a=>{for(;0{for(var c=b+NaN,e=b;a[e]&&!(e>=c);)++e;if(16f?c+=String.fromCharCode(f):(f-=65536,c+=String.fromCharCode(55296|f>>10,56320|f&1023));}}else c+=String.fromCharCode(f);}return c;},fa=[0,31,60,91,121,152,182,213,244,274,305,335],ha=[0,31,59,90,120,151,181,212,243,273,304,334],Q=a=>{for(var b=0,c=0;c=e?b++:2047>=e?b+=2:55296<=e&&57343>=e?(b+=4,++c):b+=3;}return b;},R=(a,b,c)=>{var e=A;if(0=g){var l=a.charCodeAt(++f);g=65536+((g&1023)<<10)|l&1023;}if(127>=g){if(b>=c)break;e[b++]=g;}else{if(2047>=g){if(b+1>=c)break;e[b++]=192|g>>6;}else{if(65535>=g){if(b+2>=c)break;e[b++]=224|g>>12;}else{if(b+3>=c)break;e[b++]=240|g>>18;e[b++]=128|g>>12&63;}e[b++]=128|g>>6&63;}e[b++]=128|g&63;}}e[b]=0;}},T=a=>{var b=Q(a)+1,c=S(b);c&&R(a,c,b);return c;};function U(){}var ia=[null,[],[]],ka=(a,b,c,e)=>{var f={string:h=>{var r=0;if(null!==h&&void 0!==h&&0!==h){r=Q(h)+1;var Y=V(r);R(h,Y,r);r=Y;}return r;},array:h=>{var r=V(h.length);z.set(h,r);return r;}};a=d["_"+a];var g=[],l=0;if(e)for(var m=0;m{a=a?P(A,a):"";b=null!==b?JSON.parse(b?P(A,b):""):[];try{const e=d.externalCall(a,b);return e?T(e):null;}catch(e){return d.HEAPU8[c]=1,T(e.message);}};var la={a:(a,b,c,e)=>{w(`Assertion failed: ${a?P(A,a):""}, at: `+[b?b?P(A,b):"":"unknown filename",c,e?e?P(A,e):"":"unknown function"]);},i:function(a,b,c){a=new Date(1E3*(b+2097152>>>0<4194305-!!a?(a>>>0)+4294967296*b:NaN));B[c>>2]=a.getSeconds();B[c+4>>2]=a.getMinutes();B[c+8>>2]=a.getHours();B[c+12>>2]=a.getDate();B[c+16>>2]=a.getMonth();B[c+20>>2]=a.getFullYear()-1900;B[c+24>>2]=a.getDay();b=a.getFullYear();B[c+28>>2]=(0!==b%4||0===b%100&&0!==b%400?ha:fa)[a.getMonth()]+a.getDate()-1|0;B[c+36>>2]=-(60*a.getTimezoneOffset());b=new Date(a.getFullYear(),6,1).getTimezoneOffset();var e=new Date(a.getFullYear(),0,1).getTimezoneOffset();B[c+32>>2]=(b!=e&&a.getTimezoneOffset()==Math.min(e,b))|0;},d:(a,b,c)=>{function e(t){return(t=t.toTimeString().match(/\(([A-Za-z ]+)\)$/))?t[1]:"GMT";}var f=new Date().getFullYear(),g=new Date(f,0,1),l=new Date(f,6,1);f=g.getTimezoneOffset();var m=l.getTimezoneOffset();C[a>>2]=60*Math.max(f,m);B[b>>2]=Number(f!=m);a=e(g);b=e(l);a=T(a);b=T(b);m>2]=a,C[c+4>>2]=b):(C[c>>2]=b,C[c+4>>2]=a);},b:()=>{w("");},g:U,f:function(a,b){a=a?P(A,a):"";let c;try{c=window.JSON.parse(a);}catch(e){c=a;}0!==b?window.alert(a):window.console.log("DUMP",c);},e:()=>Date.now(),j:a=>{var b=A.length;a>>>=0;if(2147483648=c;c*=2){var e=b*(1+.2/c);e=Math.min(e,a+100663296);var f=Math;e=Math.max(a,e);a:{f=(f.min.call(f,2147483648,e+(65536-e%65536)%65536)-x.buffer.byteLength+65535)/65536;try{x.grow(f);D();var g=1;break a;}catch(l){}g=void 0;}if(g)return!0;}return!1;},c:(a,b,c,e)=>{for(var f=0,g=0;g>2],m=C[b+4>>2];b+=8;for(var t=0;t>2]=f;return 0;},k:function(a){a=a?P(A,a):"";window.console.log(a);},h:function(a){a=a?P(A,a):"";return Date.parse(a);},l:function(a,b,c,e){a=a?P(A,a):"";b=b?P(A,b):"";c=c?P(A,c):"";c=`Quickjs -- ${a}: ${b}\n${c}`;0!==e?window.alert(c):window.console.error(c);}},X=function(){function a(c){X=c.exports;x=X.m;D();F.unshift(X.n);H--;d.monitorRunDependencies?.(H);0==H&&(null!==I&&(clearInterval(I),I=null),J&&(c=J,J=null,c()));return X;}var b={a:la};H++;d.monitorRunDependencies?.(H);if(d.instantiateWasm)try{return d.instantiateWasm(b,a);}catch(c){u(`Module.instantiateWasm callback failed with error: ${c}`),n(c);}ea(b,function(c){a(c.instance);}).catch(n);return{};}();d._evalInSandbox=(a,b)=>(d._evalInSandbox=X.o)(a,b);d._nukeSandbox=()=>(d._nukeSandbox=X.p)();d._init=(a,b)=>(d._init=X.q)(a,b);d._commFun=(a,b)=>(d._commFun=X.r)(a,b);d._dumpMemoryUse=()=>(d._dumpMemoryUse=X.s)();var S=a=>(S=X.t)(a);d._free=a=>(d._free=X.u)(a);var W=()=>(W=X.w)(),ja=a=>(ja=X.x)(a),V=a=>(V=X.y)(a);d.ccall=ka;d.cwrap=(a,b,c,e)=>{var f=!c||c.every(g=>"number"===g||"boolean"===g);return"string"!==b&&f&&!e?d["_"+a]:function(){return ka(a,b,c,arguments,e);};};d.stringToNewUTF8=T;var Z;J=function ma(){Z||na();Z||(J=ma);};function na(){function a(){if(!Z&&(Z=!0,d.calledRun=!0,!y)){N(F);k(d);if(d.onRuntimeInitialized)d.onRuntimeInitialized();if(d.postRun)for("function"==typeof d.postRun&&(d.postRun=[d.postRun]);d.postRun.length;){var b=d.postRun.shift();G.unshift(b);}N(G);}}if(!(0 { + if (typeof callbackId !== "number" || typeof nMilliseconds !== "number") { + return; + } + if (callbackId === 0) { + this.win.clearTimeout(this.timeoutIds.get(callbackId)); + } + const id = this.win.setTimeout(() => { + this.timeoutIds.delete(callbackId); + this.callSandboxFunction("timeoutCb", { + callbackId, + interval: false + }); + }, nMilliseconds); + this.timeoutIds.set(callbackId, id); + }, + clearTimeout: callbackId => { + this.win.clearTimeout(this.timeoutIds.get(callbackId)); + this.timeoutIds.delete(callbackId); + }, + setInterval: (callbackId, nMilliseconds) => { + if (typeof callbackId !== "number" || typeof nMilliseconds !== "number") { + return; + } + const id = this.win.setInterval(() => { + this.callSandboxFunction("timeoutCb", { + callbackId, + interval: true + }); + }, nMilliseconds); + this.timeoutIds.set(callbackId, id); + }, + clearInterval: callbackId => { + this.win.clearInterval(this.timeoutIds.get(callbackId)); + this.timeoutIds.delete(callbackId); + }, + alert: cMsg => { + if (typeof cMsg !== "string") { + return; + } + this.win.alert(cMsg); + }, + confirm: cMsg => { + if (typeof cMsg !== "string") { + return false; + } + return this.win.confirm(cMsg); + }, + prompt: (cQuestion, cDefault) => { + if (typeof cQuestion !== "string" || typeof cDefault !== "string") { + return null; + } + return this.win.prompt(cQuestion, cDefault); + }, + parseURL: cUrl => { + const url = new this.win.URL(cUrl); + const props = ["hash", "host", "hostname", "href", "origin", "password", "pathname", "port", "protocol", "search", "searchParams", "username"]; + return Object.fromEntries(props.map(name => [name, url[name].toString()])); + }, + send: data => { + if (!data) { + return; + } + const event = new this.win.CustomEvent("updatefromsandbox", { + detail: this.importValueFromSandbox(data) + }); + this.win.dispatchEvent(event); + } + }; + Object.setPrototypeOf(externals, null); + return (name, args) => { + try { + const result = externals[name](...args); + return this.exportValueToSandbox(result); + } catch (error) { + throw this.createErrorForSandbox(error?.toString() ?? ""); + } + }; + } +} +;// ./src/pdf.sandbox.js + + +const pdfjsVersion = "4.10.38"; +const pdfjsBuild = "f9bea397f"; +class SandboxSupport extends SandboxSupportBase { + exportValueToSandbox(val) { + return JSON.stringify(val); + } + importValueFromSandbox(val) { + return val; + } + createErrorForSandbox(errorMessage) { + return new Error(errorMessage); + } +} +class Sandbox { + constructor(win, module) { + this.support = new SandboxSupport(win, this); + module.externalCall = this.support.createSandboxExternals(); + this._module = module; + this._alertOnError = 0; + } + create(data) { + const code = ["var __webpack_exports__ = globalThis.pdfjsSandbox = {};\n\n;// ./src/scripting_api/constants.js\nconst Border = Object.freeze({\n s: \"solid\",\n d: \"dashed\",\n b: \"beveled\",\n i: \"inset\",\n u: \"underline\"\n});\nconst Cursor = Object.freeze({\n visible: 0,\n hidden: 1,\n delay: 2\n});\nconst Display = Object.freeze({\n visible: 0,\n hidden: 1,\n noPrint: 2,\n noView: 3\n});\nconst Font = Object.freeze({\n Times: \"Times-Roman\",\n TimesB: \"Times-Bold\",\n TimesI: \"Times-Italic\",\n TimesBI: \"Times-BoldItalic\",\n Helv: \"Helvetica\",\n HelvB: \"Helvetica-Bold\",\n HelvI: \"Helvetica-Oblique\",\n HelvBI: \"Helvetica-BoldOblique\",\n Cour: \"Courier\",\n CourB: \"Courier-Bold\",\n CourI: \"Courier-Oblique\",\n CourBI: \"Courier-BoldOblique\",\n Symbol: \"Symbol\",\n ZapfD: \"ZapfDingbats\",\n KaGo: \"HeiseiKakuGo-W5-UniJIS-UCS2-H\",\n KaMi: \"HeiseiMin-W3-UniJIS-UCS2-H\"\n});\nconst Highlight = Object.freeze({\n n: \"none\",\n i: \"invert\",\n p: \"push\",\n o: \"outline\"\n});\nconst Position = Object.freeze({\n textOnly: 0,\n iconOnly: 1,\n iconTextV: 2,\n textIconV: 3,\n iconTextH: 4,\n textIconH: 5,\n overlay: 6\n});\nconst ScaleHow = Object.freeze({\n proportional: 0,\n anamorphic: 1\n});\nconst ScaleWhen = Object.freeze({\n always: 0,\n never: 1,\n tooBig: 2,\n tooSmall: 3\n});\nconst Style = Object.freeze({\n ch: \"check\",\n cr: \"cross\",\n di: \"diamond\",\n ci: \"circle\",\n st: \"star\",\n sq: \"square\"\n});\nconst Trans = Object.freeze({\n blindsH: \"BlindsHorizontal\",\n blindsV: \"BlindsVertical\",\n boxI: \"BoxIn\",\n boxO: \"BoxOut\",\n dissolve: \"Dissolve\",\n glitterD: \"GlitterDown\",\n glitterR: \"GlitterRight\",\n glitterRD: \"GlitterRightDown\",\n random: \"Random\",\n replace: \"Replace\",\n splitHI: \"SplitHorizontalIn\",\n splitHO: \"SplitHorizontalOut\",\n splitVI: \"SplitVerticalIn\",\n splitVO: \"SplitVerticalOut\",\n wipeD: \"WipeDown\",\n wipeL: \"WipeLeft\",\n wipeR: \"WipeRight\",\n wipeU: \"WipeUp\"\n});\nconst ZoomType = Object.freeze({\n none: \"NoVary\",\n fitP: \"FitPage\",\n fitW: \"FitWidth\",\n fitH: \"FitHeight\",\n fitV: \"FitVisibleWidth\",\n pref: \"Preferred\",\n refW: \"ReflowWidth\"\n});\nconst GlobalConstants = Object.freeze({\n IDS_GREATER_THAN: \"Invalid value: must be greater than or equal to % s.\",\n IDS_GT_AND_LT: \"Invalid value: must be greater than or equal to % s \" + \"and less than or equal to % s.\",\n IDS_LESS_THAN: \"Invalid value: must be less than or equal to % s.\",\n IDS_INVALID_MONTH: \"** Invalid **\",\n IDS_INVALID_DATE: \"Invalid date / time: please ensure that the date / time exists. Field\",\n IDS_INVALID_DATE2: \" should match format \",\n IDS_INVALID_VALUE: \"The value entered does not match the format of the field\",\n IDS_AM: \"am\",\n IDS_PM: \"pm\",\n IDS_MONTH_INFO: \"January[1] February[2] March[3] April[4] May[5] \" + \"June[6] July[7] August[8] September[9] October[10] \" + \"November[11] December[12] Sept[9] Jan[1] Feb[2] Mar[3] \" + \"Apr[4] Jun[6] Jul[7] Aug[8] Sep[9] Oct[10] Nov[11] Dec[12]\",\n IDS_STARTUP_CONSOLE_MSG: \"** ^ _ ^ **\",\n RE_NUMBER_ENTRY_DOT_SEP: [\"[+-]?\\\\d*\\\\.?\\\\d*\"],\n RE_NUMBER_COMMIT_DOT_SEP: [\"[+-]?\\\\d+(\\\\.\\\\d+)?\", \"[+-]?\\\\.\\\\d+\", \"[+-]?\\\\d+\\\\.\"],\n RE_NUMBER_ENTRY_COMMA_SEP: [\"[+-]?\\\\d*,?\\\\d*\"],\n RE_NUMBER_COMMIT_COMMA_SEP: [\"[+-]?\\\\d+([.,]\\\\d+)?\", \"[+-]?[.,]\\\\d+\", \"[+-]?\\\\d+[.,]\"],\n RE_ZIP_ENTRY: [\"\\\\d{0,5}\"],\n RE_ZIP_COMMIT: [\"\\\\d{5}\"],\n RE_ZIP4_ENTRY: [\"\\\\d{0,5}(\\\\.|[- ])?\\\\d{0,4}\"],\n RE_ZIP4_COMMIT: [\"\\\\d{5}(\\\\.|[- ])?\\\\d{4}\"],\n RE_PHONE_ENTRY: [\"\\\\d{0,3}(\\\\.|[- ])?\\\\d{0,3}(\\\\.|[- ])?\\\\d{0,4}\", \"\\\\(\\\\d{0,3}\", \"\\\\(\\\\d{0,3}\\\\)(\\\\.|[- ])?\\\\d{0,3}(\\\\.|[- ])?\\\\d{0,4}\", \"\\\\(\\\\d{0,3}(\\\\.|[- ])?\\\\d{0,3}(\\\\.|[- ])?\\\\d{0,4}\", \"\\\\d{0,3}\\\\)(\\\\.|[- ])?\\\\d{0,3}(\\\\.|[- ])?\\\\d{0,4}\", \"011(\\\\.|[- \\\\d])*\"],\n RE_PHONE_COMMIT: [\"\\\\d{3}(\\\\.|[- ])?\\\\d{4}\", \"\\\\d{3}(\\\\.|[- ])?\\\\d{3}(\\\\.|[- ])?\\\\d{4}\", \"\\\\(\\\\d{3}\\\\)(\\\\.|[- ])?\\\\d{3}(\\\\.|[- ])?\\\\d{4}\", \"011(\\\\.|[- \\\\d])*\"],\n RE_SSN_ENTRY: [\"\\\\d{0,3}(\\\\.|[- ])?\\\\d{0,2}(\\\\.|[- ])?\\\\d{0,4}\"],\n RE_SSN_COMMIT: [\"\\\\d{3}(\\\\.|[- ])?\\\\d{2}(\\\\.|[- ])?\\\\d{4}\"]\n});\n\n;// ./src/scripting_api/common.js\nconst FieldType = {\n none: 0,\n number: 1,\n percent: 2,\n date: 3,\n time: 4\n};\nfunction createActionsMap(actions) {\n const actionsMap = new Map();\n if (actions) {\n for (const [eventType, actionsForEvent] of Object.entries(actions)) {\n actionsMap.set(eventType, actionsForEvent);\n }\n }\n return actionsMap;\n}\nfunction getFieldType(actions) {\n let format = actions.get(\"Format\");\n if (!format) {\n return FieldType.none;\n }\n format = format[0];\n format = format.trim();\n if (format.startsWith(\"AFNumber_\")) {\n return FieldType.number;\n }\n if (format.startsWith(\"AFPercent_\")) {\n return FieldType.percent;\n }\n if (format.startsWith(\"AFDate_\")) {\n return FieldType.date;\n }\n if (format.startsWith(\"AFTime_\")) {\n return FieldType.time;\n }\n return FieldType.none;\n}\n\n;// ./src/shared/scripting_utils.js\nfunction makeColorComp(n) {\n return Math.floor(Math.max(0, Math.min(1, n)) * 255).toString(16).padStart(2, \"0\");\n}\nfunction scaleAndClamp(x) {\n return Math.max(0, Math.min(255, 255 * x));\n}\nclass ColorConverters {\n static CMYK_G([c, y, m, k]) {\n return [\"G\", 1 - Math.min(1, 0.3 * c + 0.59 * m + 0.11 * y + k)];\n }\n static G_CMYK([g]) {\n return [\"CMYK\", 0, 0, 0, 1 - g];\n }\n static G_RGB([g]) {\n return [\"RGB\", g, g, g];\n }\n static G_rgb([g]) {\n g = scaleAndClamp(g);\n return [g, g, g];\n }\n static G_HTML([g]) {\n const G = makeColorComp(g);\n return `#${G}${G}${G}`;\n }\n static RGB_G([r, g, b]) {\n return [\"G\", 0.3 * r + 0.59 * g + 0.11 * b];\n }\n static RGB_rgb(color) {\n return color.map(scaleAndClamp);\n }\n static RGB_HTML(color) {\n return `#${color.map(makeColorComp).join(\"\")}`;\n }\n static T_HTML() {\n return \"#00000000\";\n }\n static T_rgb() {\n return [null];\n }\n static CMYK_RGB([c, y, m, k]) {\n return [\"RGB\", 1 - Math.min(1, c + k), 1 - Math.min(1, m + k), 1 - Math.min(1, y + k)];\n }\n static CMYK_rgb([c, y, m, k]) {\n return [scaleAndClamp(1 - Math.min(1, c + k)), scaleAndClamp(1 - Math.min(1, m + k)), scaleAndClamp(1 - Math.min(1, y + k))];\n }\n static CMYK_HTML(components) {\n const rgb = this.CMYK_RGB(components).slice(1);\n return this.RGB_HTML(rgb);\n }\n static RGB_CMYK([r, g, b]) {\n const c = 1 - r;\n const m = 1 - g;\n const y = 1 - b;\n const k = Math.min(c, m, y);\n return [\"CMYK\", c, m, y, k];\n }\n}\n\n;// ./src/scripting_api/pdf_object.js\nclass PDFObject {\n constructor(data) {\n this._expandos = Object.create(null);\n this._send = data.send || null;\n this._id = data.id || null;\n }\n}\n\n;// ./src/scripting_api/color.js\n\n\nclass Color extends PDFObject {\n constructor() {\n super({});\n this.transparent = [\"T\"];\n this.black = [\"G\", 0];\n this.white = [\"G\", 1];\n this.red = [\"RGB\", 1, 0, 0];\n this.green = [\"RGB\", 0, 1, 0];\n this.blue = [\"RGB\", 0, 0, 1];\n this.cyan = [\"CMYK\", 1, 0, 0, 0];\n this.magenta = [\"CMYK\", 0, 1, 0, 0];\n this.yellow = [\"CMYK\", 0, 0, 1, 0];\n this.dkGray = [\"G\", 0.25];\n this.gray = [\"G\", 0.5];\n this.ltGray = [\"G\", 0.75];\n }\n static _isValidSpace(cColorSpace) {\n return typeof cColorSpace === \"string\" && (cColorSpace === \"T\" || cColorSpace === \"G\" || cColorSpace === \"RGB\" || cColorSpace === \"CMYK\");\n }\n static _isValidColor(colorArray) {\n if (!Array.isArray(colorArray) || colorArray.length === 0) {\n return false;\n }\n const space = colorArray[0];\n if (!Color._isValidSpace(space)) {\n return false;\n }\n switch (space) {\n case \"T\":\n if (colorArray.length !== 1) {\n return false;\n }\n break;\n case \"G\":\n if (colorArray.length !== 2) {\n return false;\n }\n break;\n case \"RGB\":\n if (colorArray.length !== 4) {\n return false;\n }\n break;\n case \"CMYK\":\n if (colorArray.length !== 5) {\n return false;\n }\n break;\n default:\n return false;\n }\n return colorArray.slice(1).every(c => typeof c === \"number\" && c >= 0 && c <= 1);\n }\n static _getCorrectColor(colorArray) {\n return Color._isValidColor(colorArray) ? colorArray : [\"G\", 0];\n }\n convert(colorArray, cColorSpace) {\n if (!Color._isValidSpace(cColorSpace)) {\n return this.black;\n }\n if (cColorSpace === \"T\") {\n return [\"T\"];\n }\n colorArray = Color._getCorrectColor(colorArray);\n if (colorArray[0] === cColorSpace) {\n return colorArray;\n }\n if (colorArray[0] === \"T\") {\n return this.convert(this.black, cColorSpace);\n }\n return ColorConverters[`${colorArray[0]}_${cColorSpace}`](colorArray.slice(1));\n }\n equal(colorArray1, colorArray2) {\n colorArray1 = Color._getCorrectColor(colorArray1);\n colorArray2 = Color._getCorrectColor(colorArray2);\n if (colorArray1[0] === \"T\" || colorArray2[0] === \"T\") {\n return colorArray1[0] === \"T\" && colorArray2[0] === \"T\";\n }\n if (colorArray1[0] !== colorArray2[0]) {\n colorArray2 = this.convert(colorArray2, colorArray1[0]);\n }\n return colorArray1.slice(1).every((c, i) => c === colorArray2[i + 1]);\n }\n}\n\n;// ./src/scripting_api/field.js\n\n\n\nclass Field extends PDFObject {\n constructor(data) {\n super(data);\n this.alignment = data.alignment || \"left\";\n this.borderStyle = data.borderStyle || \"\";\n this.buttonAlignX = data.buttonAlignX || 50;\n this.buttonAlignY = data.buttonAlignY || 50;\n this.buttonFitBounds = data.buttonFitBounds;\n this.buttonPosition = data.buttonPosition;\n this.buttonScaleHow = data.buttonScaleHow;\n this.ButtonScaleWhen = data.buttonScaleWhen;\n this.calcOrderIndex = data.calcOrderIndex;\n this.comb = data.comb;\n this.commitOnSelChange = data.commitOnSelChange;\n this.currentValueIndices = data.currentValueIndices;\n this.defaultStyle = data.defaultStyle;\n this.defaultValue = data.defaultValue;\n this.doNotScroll = data.doNotScroll;\n this.doNotSpellCheck = data.doNotSpellCheck;\n this.delay = data.delay;\n this.display = data.display;\n this.doc = data.doc.wrapped;\n this.editable = data.editable;\n this.exportValues = data.exportValues;\n this.fileSelect = data.fileSelect;\n this.hidden = data.hidden;\n this.highlight = data.highlight;\n this.lineWidth = data.lineWidth;\n this.multiline = data.multiline;\n this.multipleSelection = !!data.multipleSelection;\n this.name = data.name;\n this.password = data.password;\n this.print = data.print;\n this.radiosInUnison = data.radiosInUnison;\n this.readonly = data.readonly;\n this.rect = data.rect;\n this.required = data.required;\n this.richText = data.richText;\n this.richValue = data.richValue;\n this.style = data.style;\n this.submitName = data.submitName;\n this.textFont = data.textFont;\n this.textSize = data.textSize;\n this.type = data.type;\n this.userName = data.userName;\n this._actions = createActionsMap(data.actions);\n this._browseForFileToSubmit = data.browseForFileToSubmit || null;\n this._buttonCaption = null;\n this._buttonIcon = null;\n this._charLimit = data.charLimit;\n this._children = null;\n this._currentValueIndices = data.currentValueIndices || 0;\n this._document = data.doc;\n this._fieldPath = data.fieldPath;\n this._fillColor = data.fillColor || [\"T\"];\n this._isChoice = Array.isArray(data.items);\n this._items = data.items || [];\n this._hasValue = data.hasOwnProperty(\"value\");\n this._page = data.page || 0;\n this._strokeColor = data.strokeColor || [\"G\", 0];\n this._textColor = data.textColor || [\"G\", 0];\n this._value = null;\n this._kidIds = data.kidIds || null;\n this._fieldType = getFieldType(this._actions);\n this._siblings = data.siblings || null;\n this._rotation = data.rotation || 0;\n this._globalEval = data.globalEval;\n this._appObjects = data.appObjects;\n this.value = data.value || \"\";\n }\n get currentValueIndices() {\n if (!this._isChoice) {\n return 0;\n }\n return this._currentValueIndices;\n }\n set currentValueIndices(indices) {\n if (!this._isChoice) {\n return;\n }\n if (!Array.isArray(indices)) {\n indices = [indices];\n }\n if (!indices.every(i => typeof i === \"number\" && Number.isInteger(i) && i >= 0 && i < this.numItems)) {\n return;\n }\n indices.sort();\n if (this.multipleSelection) {\n this._currentValueIndices = indices;\n this._value = [];\n indices.forEach(i => {\n this._value.push(this._items[i].displayValue);\n });\n } else if (indices.length > 0) {\n indices = indices.splice(1, indices.length - 1);\n this._currentValueIndices = indices[0];\n this._value = this._items[this._currentValueIndices];\n }\n this._send({\n id: this._id,\n indices\n });\n }\n get fillColor() {\n return this._fillColor;\n }\n set fillColor(color) {\n if (Color._isValidColor(color)) {\n this._fillColor = color;\n }\n }\n get bgColor() {\n return this.fillColor;\n }\n set bgColor(color) {\n this.fillColor = color;\n }\n get charLimit() {\n return this._charLimit;\n }\n set charLimit(limit) {\n if (typeof limit !== \"number\") {\n throw new Error(\"Invalid argument value\");\n }\n this._charLimit = Math.max(0, Math.floor(limit));\n }\n get numItems() {\n if (!this._isChoice) {\n throw new Error(\"Not a choice widget\");\n }\n return this._items.length;\n }\n set numItems(_) {\n throw new Error(\"field.numItems is read-only\");\n }\n get strokeColor() {\n return this._strokeColor;\n }\n set strokeColor(color) {\n if (Color._isValidColor(color)) {\n this._strokeColor = color;\n }\n }\n get borderColor() {\n return this.strokeColor;\n }\n set borderColor(color) {\n this.strokeColor = color;\n }\n get page() {\n return this._page;\n }\n set page(_) {\n throw new Error(\"field.page is read-only\");\n }\n get rotation() {\n return this._rotation;\n }\n set rotation(angle) {\n angle = Math.floor(angle);\n if (angle % 90 !== 0) {\n throw new Error(\"Invalid rotation: must be a multiple of 90\");\n }\n angle %= 360;\n if (angle < 0) {\n angle += 360;\n }\n this._rotation = angle;\n }\n get textColor() {\n return this._textColor;\n }\n set textColor(color) {\n if (Color._isValidColor(color)) {\n this._textColor = color;\n }\n }\n get fgColor() {\n return this.textColor;\n }\n set fgColor(color) {\n this.textColor = color;\n }\n get value() {\n return this._value;\n }\n set value(value) {\n if (this._isChoice) {\n this._setChoiceValue(value);\n return;\n }\n if (value === \"\" || typeof value !== \"string\" || this._fieldType >= FieldType.date) {\n this._originalValue = undefined;\n this._value = value;\n return;\n }\n this._originalValue = value;\n const _value = value.trim().replace(\",\", \".\");\n this._value = !isNaN(_value) ? parseFloat(_value) : value;\n }\n _getValue() {\n return this._originalValue ?? this.value;\n }\n _setChoiceValue(value) {\n if (this.multipleSelection) {\n if (!Array.isArray(value)) {\n value = [value];\n }\n const values = new Set(value);\n if (Array.isArray(this._currentValueIndices)) {\n this._currentValueIndices.length = 0;\n this._value.length = 0;\n } else {\n this._currentValueIndices = [];\n this._value = [];\n }\n this._items.forEach((item, i) => {\n if (values.has(item.exportValue)) {\n this._currentValueIndices.push(i);\n this._value.push(item.exportValue);\n }\n });\n } else {\n if (Array.isArray(value)) {\n value = value[0];\n }\n const index = this._items.findIndex(({\n exportValue\n }) => value === exportValue);\n if (index !== -1) {\n this._currentValueIndices = index;\n this._value = this._items[index].exportValue;\n }\n }\n }\n get valueAsString() {\n return (this._value ?? \"\").toString();\n }\n set valueAsString(_) {}\n browseForFileToSubmit() {\n if (this._browseForFileToSubmit) {\n this._browseForFileToSubmit();\n }\n }\n buttonGetCaption(nFace = 0) {\n if (this._buttonCaption) {\n return this._buttonCaption[nFace];\n }\n return \"\";\n }\n buttonGetIcon(nFace = 0) {\n if (this._buttonIcon) {\n return this._buttonIcon[nFace];\n }\n return null;\n }\n buttonImportIcon(cPath = null, nPave = 0) {}\n buttonSetCaption(cCaption, nFace = 0) {\n if (!this._buttonCaption) {\n this._buttonCaption = [\"\", \"\", \"\"];\n }\n this._buttonCaption[nFace] = cCaption;\n }\n buttonSetIcon(oIcon, nFace = 0) {\n if (!this._buttonIcon) {\n this._buttonIcon = [null, null, null];\n }\n this._buttonIcon[nFace] = oIcon;\n }\n checkThisBox(nWidget, bCheckIt = true) {}\n clearItems() {\n if (!this._isChoice) {\n throw new Error(\"Not a choice widget\");\n }\n this._items = [];\n this._send({\n id: this._id,\n clear: null\n });\n }\n deleteItemAt(nIdx = null) {\n if (!this._isChoice) {\n throw new Error(\"Not a choice widget\");\n }\n if (!this.numItems) {\n return;\n }\n if (nIdx === null) {\n nIdx = Array.isArray(this._currentValueIndices) ? this._currentValueIndices[0] : this._currentValueIndices;\n nIdx ||= 0;\n }\n if (nIdx < 0 || nIdx >= this.numItems) {\n nIdx = this.numItems - 1;\n }\n this._items.splice(nIdx, 1);\n if (Array.isArray(this._currentValueIndices)) {\n let index = this._currentValueIndices.findIndex(i => i >= nIdx);\n if (index !== -1) {\n if (this._currentValueIndices[index] === nIdx) {\n this._currentValueIndices.splice(index, 1);\n }\n for (const ii = this._currentValueIndices.length; index < ii; index++) {\n --this._currentValueIndices[index];\n }\n }\n } else if (this._currentValueIndices === nIdx) {\n this._currentValueIndices = this.numItems > 0 ? 0 : -1;\n } else if (this._currentValueIndices > nIdx) {\n --this._currentValueIndices;\n }\n this._send({\n id: this._id,\n remove: nIdx\n });\n }\n getItemAt(nIdx = -1, bExportValue = false) {\n if (!this._isChoice) {\n throw new Error(\"Not a choice widget\");\n }\n if (nIdx < 0 || nIdx >= this.numItems) {\n nIdx = this.numItems - 1;\n }\n const item = this._items[nIdx];\n return bExportValue ? item.exportValue : item.displayValue;\n }\n getArray() {\n if (this._kidIds) {\n const array = [];\n const fillArrayWithKids = kidIds => {\n for (const id of kidIds) {\n const obj = this._appObjects[id];\n if (!obj) {\n continue;\n }\n if (obj.obj._hasValue) {\n array.push(obj.wrapped);\n }\n if (obj.obj._kidIds) {\n fillArrayWithKids(obj.obj._kidIds);\n }\n }\n };\n fillArrayWithKids(this._kidIds);\n return array;\n }\n if (this._children === null) {\n this._children = this._document.obj._getTerminalChildren(this._fieldPath);\n }\n return this._children;\n }\n getLock() {\n return undefined;\n }\n isBoxChecked(nWidget) {\n return false;\n }\n isDefaultChecked(nWidget) {\n return false;\n }\n insertItemAt(cName, cExport = undefined, nIdx = 0) {\n if (!this._isChoice) {\n throw new Error(\"Not a choice widget\");\n }\n if (!cName) {\n return;\n }\n if (nIdx < 0 || nIdx > this.numItems) {\n nIdx = this.numItems;\n }\n if (this._items.some(({\n displayValue\n }) => displayValue === cName)) {\n return;\n }\n if (cExport === undefined) {\n cExport = cName;\n }\n const data = {\n displayValue: cName,\n exportValue: cExport\n };\n this._items.splice(nIdx, 0, data);\n if (Array.isArray(this._currentValueIndices)) {\n let index = this._currentValueIndices.findIndex(i => i >= nIdx);\n if (index !== -1) {\n for (const ii = this._currentValueIndices.length; index < ii; index++) {\n ++this._currentValueIndices[index];\n }\n }\n } else if (this._currentValueIndices >= nIdx) {\n ++this._currentValueIndices;\n }\n this._send({\n id: this._id,\n insert: {\n index: nIdx,\n ...data\n }\n });\n }\n setAction(cTrigger, cScript) {\n if (typeof cTrigger !== \"string\" || typeof cScript !== \"string\") {\n return;\n }\n if (!(cTrigger in this._actions)) {\n this._actions[cTrigger] = [];\n }\n this._actions[cTrigger].push(cScript);\n }\n setFocus() {\n this._send({\n id: this._id,\n focus: true\n });\n }\n setItems(oArray) {\n if (!this._isChoice) {\n throw new Error(\"Not a choice widget\");\n }\n this._items.length = 0;\n for (const element of oArray) {\n let displayValue, exportValue;\n if (Array.isArray(element)) {\n displayValue = element[0]?.toString() || \"\";\n exportValue = element[1]?.toString() || \"\";\n } else {\n displayValue = exportValue = element?.toString() || \"\";\n }\n this._items.push({\n displayValue,\n exportValue\n });\n }\n this._currentValueIndices = 0;\n this._send({\n id: this._id,\n items: this._items\n });\n }\n setLock() {}\n signatureGetModifications() {}\n signatureGetSeedValue() {}\n signatureInfo() {}\n signatureSetSeedValue() {}\n signatureSign() {}\n signatureValidate() {}\n _isButton() {\n return false;\n }\n _reset() {\n this.value = this.defaultValue;\n }\n _runActions(event) {\n const eventName = event.name;\n if (!this._actions.has(eventName)) {\n return false;\n }\n const actions = this._actions.get(eventName);\n try {\n for (const action of actions) {\n this._globalEval(action);\n }\n } catch (error) {\n event.rc = false;\n throw error;\n }\n return true;\n }\n}\nclass RadioButtonField extends Field {\n constructor(otherButtons, data) {\n super(data);\n this.exportValues = [this.exportValues];\n this._radioIds = [this._id];\n this._radioActions = [this._actions];\n for (const radioData of otherButtons) {\n this.exportValues.push(radioData.exportValues);\n this._radioIds.push(radioData.id);\n this._radioActions.push(createActionsMap(radioData.actions));\n if (this._value === radioData.exportValues) {\n this._id = radioData.id;\n }\n }\n this._hasBeenInitialized = true;\n this._value = data.value || \"\";\n }\n get _siblings() {\n return this._radioIds.filter(id => id !== this._id);\n }\n set _siblings(_) {}\n get value() {\n return this._value;\n }\n set value(value) {\n if (!this._hasBeenInitialized) {\n return;\n }\n if (value === null || value === undefined) {\n this._value = \"\";\n }\n const i = this.exportValues.indexOf(value);\n if (0 <= i && i < this._radioIds.length) {\n this._id = this._radioIds[i];\n this._value = value;\n } else if (value === \"Off\" && this._radioIds.length === 2) {\n const nextI = (1 + this._radioIds.indexOf(this._id)) % 2;\n this._id = this._radioIds[nextI];\n this._value = this.exportValues[nextI];\n }\n }\n checkThisBox(nWidget, bCheckIt = true) {\n if (nWidget < 0 || nWidget >= this._radioIds.length || !bCheckIt) {\n return;\n }\n this._id = this._radioIds[nWidget];\n this._value = this.exportValues[nWidget];\n this._send({\n id: this._id,\n value: this._value\n });\n }\n isBoxChecked(nWidget) {\n return nWidget >= 0 && nWidget < this._radioIds.length && this._id === this._radioIds[nWidget];\n }\n isDefaultChecked(nWidget) {\n return nWidget >= 0 && nWidget < this.exportValues.length && this.defaultValue === this.exportValues[nWidget];\n }\n _getExportValue(state) {\n const i = this._radioIds.indexOf(this._id);\n return this.exportValues[i];\n }\n _runActions(event) {\n const i = this._radioIds.indexOf(this._id);\n this._actions = this._radioActions[i];\n return super._runActions(event);\n }\n _isButton() {\n return true;\n }\n}\nclass CheckboxField extends RadioButtonField {\n get value() {\n return this._value;\n }\n set value(value) {\n if (!value || value === \"Off\") {\n this._value = \"Off\";\n } else {\n super.value = value;\n }\n }\n _getExportValue(state) {\n return state ? super._getExportValue(state) : \"Off\";\n }\n isBoxChecked(nWidget) {\n if (this._value === \"Off\") {\n return false;\n }\n return super.isBoxChecked(nWidget);\n }\n isDefaultChecked(nWidget) {\n if (this.defaultValue === \"Off\") {\n return this._value === \"Off\";\n }\n return super.isDefaultChecked(nWidget);\n }\n checkThisBox(nWidget, bCheckIt = true) {\n if (nWidget < 0 || nWidget >= this._radioIds.length) {\n return;\n }\n this._id = this._radioIds[nWidget];\n this._value = bCheckIt ? this.exportValues[nWidget] : \"Off\";\n this._send({\n id: this._id,\n value: this._value\n });\n }\n}\n\n;// ./src/scripting_api/aform.js\n\nclass AForm {\n constructor(document, app, util, color) {\n this._document = document;\n this._app = app;\n this._util = util;\n this._color = color;\n this._dateFormats = [\"m/d\", \"m/d/yy\", \"mm/dd/yy\", \"mm/yy\", \"d-mmm\", \"d-mmm-yy\", \"dd-mmm-yy\", \"yy-mm-dd\", \"mmm-yy\", \"mmmm-yy\", \"mmm d, yyyy\", \"mmmm d, yyyy\", \"m/d/yy h:MM tt\", \"m/d/yy HH:MM\"];\n this._timeFormats = [\"HH:MM\", \"h:MM tt\", \"HH:MM:ss\", \"h:MM:ss tt\"];\n this._emailRegex = new RegExp(\"^[a-zA-Z0-9.!#$%&'*+\\\\/=?^_`{|}~-]+\" + \"@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\" + \"(?:\\\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$\");\n }\n _mkTargetName(event) {\n return event.target ? `[ ${event.target.name} ]` : \"\";\n }\n _parseDate(cFormat, cDate, strict = false) {\n let date = null;\n try {\n date = this._util._scand(cFormat, cDate, strict);\n } catch {}\n if (date) {\n return date;\n }\n if (strict) {\n return null;\n }\n date = Date.parse(cDate);\n return isNaN(date) ? null : new Date(date);\n }\n AFMergeChange(event = globalThis.event) {\n if (event.willCommit) {\n return event.value.toString();\n }\n return this._app._eventDispatcher.mergeChange(event);\n }\n AFParseDateEx(cString, cOrder) {\n return this._parseDate(cOrder, cString);\n }\n AFExtractNums(str) {\n if (typeof str === \"number\") {\n return [str];\n }\n if (!str || typeof str !== \"string\") {\n return null;\n }\n const first = str.charAt(0);\n if (first === \".\" || first === \",\") {\n str = `0${str}`;\n }\n const numbers = str.match(/(\\d+)/g);\n if (numbers.length === 0) {\n return null;\n }\n return numbers;\n }\n AFMakeNumber(str) {\n if (typeof str === \"number\") {\n return str;\n }\n if (typeof str !== \"string\") {\n return null;\n }\n str = str.trim().replace(\",\", \".\");\n const number = parseFloat(str);\n if (isNaN(number) || !isFinite(number)) {\n return null;\n }\n return number;\n }\n AFMakeArrayFromList(string) {\n if (typeof string === \"string\") {\n return string.split(/, ?/g);\n }\n return string;\n }\n AFNumber_Format(nDec, sepStyle, negStyle, currStyle, strCurrency, bCurrencyPrepend) {\n const event = globalThis.event;\n let value = this.AFMakeNumber(event.value);\n if (value === null) {\n event.value = \"\";\n return;\n }\n const sign = Math.sign(value);\n const buf = [];\n let hasParen = false;\n if (sign === -1 && bCurrencyPrepend && negStyle === 0) {\n buf.push(\"-\");\n }\n if ((negStyle === 2 || negStyle === 3) && sign === -1) {\n buf.push(\"(\");\n hasParen = true;\n }\n if (bCurrencyPrepend) {\n buf.push(strCurrency);\n }\n sepStyle = Math.min(Math.max(0, Math.floor(sepStyle)), 4);\n buf.push(\"%,\", sepStyle, \".\", nDec.toString(), \"f\");\n if (!bCurrencyPrepend) {\n buf.push(strCurrency);\n }\n if (hasParen) {\n buf.push(\")\");\n }\n if (negStyle === 1 || negStyle === 3) {\n event.target.textColor = sign === 1 ? this._color.black : this._color.red;\n }\n if ((negStyle !== 0 || bCurrencyPrepend) && sign === -1) {\n value = -value;\n }\n const formatStr = buf.join(\"\");\n event.value = this._util.printf(formatStr, value);\n }\n AFNumber_Keystroke(nDec, sepStyle, negStyle, currStyle, strCurrency, bCurrencyPrepend) {\n const event = globalThis.event;\n let value = this.AFMergeChange(event);\n if (!value) {\n return;\n }\n value = value.trim();\n let pattern;\n if (sepStyle > 1) {\n pattern = event.willCommit ? /^[+-]?(\\d+(,\\d*)?|,\\d+)$/ : /^[+-]?\\d*,?\\d*$/;\n } else {\n pattern = event.willCommit ? /^[+-]?(\\d+(\\.\\d*)?|\\.\\d+)$/ : /^[+-]?\\d*\\.?\\d*$/;\n }\n if (!pattern.test(value)) {\n if (event.willCommit) {\n const err = `${GlobalConstants.IDS_INVALID_VALUE} ${this._mkTargetName(event)}`;\n this._app.alert(err);\n }\n event.rc = false;\n }\n if (event.willCommit && sepStyle > 1) {\n event.value = parseFloat(value.replace(\",\", \".\"));\n }\n }\n AFPercent_Format(nDec, sepStyle, percentPrepend = false) {\n if (typeof nDec !== \"number\") {\n return;\n }\n if (typeof sepStyle !== \"number\") {\n return;\n }\n if (nDec < 0) {\n throw new Error(\"Invalid nDec value in AFPercent_Format\");\n }\n const event = globalThis.event;\n if (nDec > 512) {\n event.value = \"%\";\n return;\n }\n nDec = Math.floor(nDec);\n sepStyle = Math.min(Math.max(0, Math.floor(sepStyle)), 4);\n let value = this.AFMakeNumber(event.value);\n if (value === null) {\n event.value = \"%\";\n return;\n }\n const formatStr = `%,${sepStyle}.${nDec}f`;\n value = this._util.printf(formatStr, value * 100);\n event.value = percentPrepend ? `%${value}` : `${value}%`;\n }\n AFPercent_Keystroke(nDec, sepStyle) {\n this.AFNumber_Keystroke(nDec, sepStyle, 0, 0, \"\", true);\n }\n AFDate_FormatEx(cFormat) {\n const event = globalThis.event;\n const value = event.value;\n if (!value) {\n return;\n }\n const date = this._parseDate(cFormat, value);\n if (date !== null) {\n event.value = this._util.printd(cFormat, date);\n }\n }\n AFDate_Format(pdf) {\n if (pdf >= 0 && pdf < this._dateFormats.length) {\n this.AFDate_FormatEx(this._dateFormats[pdf]);\n }\n }\n AFDate_KeystrokeEx(cFormat) {\n const event = globalThis.event;\n if (!event.willCommit) {\n return;\n }\n const value = this.AFMergeChange(event);\n if (!value) {\n return;\n }\n if (this._parseDate(cFormat, value, true) === null) {\n const invalid = GlobalConstants.IDS_INVALID_DATE;\n const invalid2 = GlobalConstants.IDS_INVALID_DATE2;\n const err = `${invalid} ${this._mkTargetName(event)}${invalid2}${cFormat}`;\n this._app.alert(err);\n event.rc = false;\n }\n }\n AFDate_Keystroke(pdf) {\n if (pdf >= 0 && pdf < this._dateFormats.length) {\n this.AFDate_KeystrokeEx(this._dateFormats[pdf]);\n }\n }\n AFRange_Validate(bGreaterThan, nGreaterThan, bLessThan, nLessThan) {\n const event = globalThis.event;\n if (!event.value) {\n return;\n }\n const value = this.AFMakeNumber(event.value);\n if (value === null) {\n return;\n }\n bGreaterThan = !!bGreaterThan;\n bLessThan = !!bLessThan;\n if (bGreaterThan) {\n nGreaterThan = this.AFMakeNumber(nGreaterThan);\n if (nGreaterThan === null) {\n return;\n }\n }\n if (bLessThan) {\n nLessThan = this.AFMakeNumber(nLessThan);\n if (nLessThan === null) {\n return;\n }\n }\n let err = \"\";\n if (bGreaterThan && bLessThan) {\n if (value < nGreaterThan || value > nLessThan) {\n err = this._util.printf(GlobalConstants.IDS_GT_AND_LT, nGreaterThan, nLessThan);\n }\n } else if (bGreaterThan) {\n if (value < nGreaterThan) {\n err = this._util.printf(GlobalConstants.IDS_GREATER_THAN, nGreaterThan);\n }\n } else if (value > nLessThan) {\n err = this._util.printf(GlobalConstants.IDS_LESS_THAN, nLessThan);\n }\n if (err) {\n this._app.alert(err);\n event.rc = false;\n }\n }\n AFSimple(cFunction, nValue1, nValue2) {\n const value1 = this.AFMakeNumber(nValue1);\n if (value1 === null) {\n throw new Error(\"Invalid nValue1 in AFSimple\");\n }\n const value2 = this.AFMakeNumber(nValue2);\n if (value2 === null) {\n throw new Error(\"Invalid nValue2 in AFSimple\");\n }\n switch (cFunction) {\n case \"AVG\":\n return (value1 + value2) / 2;\n case \"SUM\":\n return value1 + value2;\n case \"PRD\":\n return value1 * value2;\n case \"MIN\":\n return Math.min(value1, value2);\n case \"MAX\":\n return Math.max(value1, value2);\n }\n throw new Error(\"Invalid cFunction in AFSimple\");\n }\n AFSimple_Calculate(cFunction, cFields) {\n const actions = {\n AVG: args => args.reduce((acc, value) => acc + value, 0) / args.length,\n SUM: args => args.reduce((acc, value) => acc + value, 0),\n PRD: args => args.reduce((acc, value) => acc * value, 1),\n MIN: args => args.reduce((acc, value) => Math.min(acc, value), Number.MAX_VALUE),\n MAX: args => args.reduce((acc, value) => Math.max(acc, value), Number.MIN_VALUE)\n };\n if (!(cFunction in actions)) {\n throw new TypeError(\"Invalid function in AFSimple_Calculate\");\n }\n const event = globalThis.event;\n const values = [];\n cFields = this.AFMakeArrayFromList(cFields);\n for (const cField of cFields) {\n const field = this._document.getField(cField);\n if (!field) {\n continue;\n }\n for (const child of field.getArray()) {\n const number = this.AFMakeNumber(child.value);\n values.push(number ?? 0);\n }\n }\n if (values.length === 0) {\n event.value = 0;\n return;\n }\n const res = actions[cFunction](values);\n event.value = Math.round(1e6 * res) / 1e6;\n }\n AFSpecial_Format(psf) {\n const event = globalThis.event;\n if (!event.value) {\n return;\n }\n psf = this.AFMakeNumber(psf);\n let formatStr;\n switch (psf) {\n case 0:\n formatStr = \"99999\";\n break;\n case 1:\n formatStr = \"99999-9999\";\n break;\n case 2:\n formatStr = this._util.printx(\"9999999999\", event.value).length >= 10 ? \"(999) 999-9999\" : \"999-9999\";\n break;\n case 3:\n formatStr = \"999-99-9999\";\n break;\n default:\n throw new Error(\"Invalid psf in AFSpecial_Format\");\n }\n event.value = this._util.printx(formatStr, event.value);\n }\n AFSpecial_KeystrokeEx(cMask) {\n const event = globalThis.event;\n const simplifiedFormatStr = cMask.replaceAll(/[^9AOX]/g, \"\");\n this.#AFSpecial_KeystrokeEx_helper(simplifiedFormatStr, false);\n if (event.rc) {\n return;\n }\n event.rc = true;\n this.#AFSpecial_KeystrokeEx_helper(cMask, true);\n }\n #AFSpecial_KeystrokeEx_helper(cMask, warn) {\n if (!cMask) {\n return;\n }\n const event = globalThis.event;\n const value = this.AFMergeChange(event);\n if (!value) {\n return;\n }\n const checkers = new Map([[\"9\", char => char >= \"0\" && char <= \"9\"], [\"A\", char => \"a\" <= char && char <= \"z\" || \"A\" <= char && char <= \"Z\"], [\"O\", char => \"a\" <= char && char <= \"z\" || \"A\" <= char && char <= \"Z\" || \"0\" <= char && char <= \"9\"], [\"X\", char => true]]);\n function _checkValidity(_value, _cMask) {\n for (let i = 0, ii = _value.length; i < ii; i++) {\n const mask = _cMask.charAt(i);\n const char = _value.charAt(i);\n const checker = checkers.get(mask);\n if (checker) {\n if (!checker(char)) {\n return false;\n }\n } else if (mask !== char) {\n return false;\n }\n }\n return true;\n }\n const err = `${GlobalConstants.IDS_INVALID_VALUE} = \"${cMask}\"`;\n if (value.length > cMask.length) {\n if (warn) {\n this._app.alert(err);\n }\n event.rc = false;\n return;\n }\n if (event.willCommit) {\n if (value.length < cMask.length) {\n if (warn) {\n this._app.alert(err);\n }\n event.rc = false;\n return;\n }\n if (!_checkValidity(value, cMask)) {\n if (warn) {\n this._app.alert(err);\n }\n event.rc = false;\n return;\n }\n event.value += cMask.substring(value.length);\n return;\n }\n if (value.length < cMask.length) {\n cMask = cMask.substring(0, value.length);\n }\n if (!_checkValidity(value, cMask)) {\n if (warn) {\n this._app.alert(err);\n }\n event.rc = false;\n }\n }\n AFSpecial_Keystroke(psf) {\n const event = globalThis.event;\n psf = this.AFMakeNumber(psf);\n let formatStr;\n switch (psf) {\n case 0:\n formatStr = \"99999\";\n break;\n case 1:\n formatStr = \"99999-9999\";\n break;\n case 2:\n const value = this.AFMergeChange(event);\n formatStr = value.startsWith(\"(\") || value.length > 7 && /^\\p{N}+$/.test(value) ? \"(999) 999-9999\" : \"999-9999\";\n break;\n case 3:\n formatStr = \"999-99-9999\";\n break;\n default:\n throw new Error(\"Invalid psf in AFSpecial_Keystroke\");\n }\n this.AFSpecial_KeystrokeEx(formatStr);\n }\n AFTime_FormatEx(cFormat) {\n this.AFDate_FormatEx(cFormat);\n }\n AFTime_Format(pdf) {\n if (pdf >= 0 && pdf < this._timeFormats.length) {\n this.AFDate_FormatEx(this._timeFormats[pdf]);\n }\n }\n AFTime_KeystrokeEx(cFormat) {\n this.AFDate_KeystrokeEx(cFormat);\n }\n AFTime_Keystroke(pdf) {\n if (pdf >= 0 && pdf < this._timeFormats.length) {\n this.AFDate_KeystrokeEx(this._timeFormats[pdf]);\n }\n }\n eMailValidate(str) {\n return this._emailRegex.test(str);\n }\n AFExactMatch(rePatterns, str) {\n if (rePatterns instanceof RegExp) {\n return str.match(rePatterns)?.[0] === str || 0;\n }\n return rePatterns.findIndex(re => str.match(re)?.[0] === str) + 1;\n }\n}\n\n;// ./src/scripting_api/app_utils.js\nconst VIEWER_TYPE = \"PDF.js\";\nconst VIEWER_VARIATION = \"Full\";\nconst VIEWER_VERSION = 21.00720099;\nconst FORMS_VERSION = 21.00720099;\nconst USERACTIVATION_CALLBACKID = 0;\nconst USERACTIVATION_MAXTIME_VALIDITY = 5000;\nfunction serializeError(error) {\n const value = `${error.toString()}\\n${error.stack}`;\n return {\n command: \"error\",\n value\n };\n}\n\n;// ./src/scripting_api/event.js\n\nclass Event {\n constructor(data) {\n this.change = data.change || \"\";\n this.changeEx = data.changeEx || null;\n this.commitKey = data.commitKey || 0;\n this.fieldFull = data.fieldFull || false;\n this.keyDown = data.keyDown || false;\n this.modifier = data.modifier || false;\n this.name = data.name;\n this.rc = true;\n this.richChange = data.richChange || [];\n this.richChangeEx = data.richChangeEx || [];\n this.richValue = data.richValue || [];\n this.selEnd = data.selEnd ?? -1;\n this.selStart = data.selStart ?? -1;\n this.shift = data.shift || false;\n this.source = data.source || null;\n this.target = data.target || null;\n this.targetName = \"\";\n this.type = \"Field\";\n this.value = data.value || \"\";\n this.willCommit = data.willCommit || false;\n }\n}\nclass EventDispatcher {\n constructor(document, calculationOrder, objects, externalCall) {\n this._document = document;\n this._calculationOrder = calculationOrder;\n this._objects = objects;\n this._externalCall = externalCall;\n this._document.obj._eventDispatcher = this;\n this._isCalculating = false;\n }\n mergeChange(event) {\n let value = event.value;\n if (Array.isArray(value)) {\n return value;\n }\n if (typeof value !== \"string\") {\n value = value.toString();\n }\n const prefix = event.selStart >= 0 ? value.substring(0, event.selStart) : \"\";\n const postfix = event.selEnd >= 0 && event.selEnd <= value.length ? value.substring(event.selEnd) : \"\";\n return `${prefix}${event.change}${postfix}`;\n }\n userActivation() {\n this._document.obj._userActivation = true;\n this._externalCall(\"setTimeout\", [USERACTIVATION_CALLBACKID, USERACTIVATION_MAXTIME_VALIDITY]);\n }\n dispatch(baseEvent) {\n const id = baseEvent.id;\n if (!(id in this._objects)) {\n let event;\n if (id === \"doc\" || id === \"page\") {\n event = globalThis.event = new Event(baseEvent);\n event.source = event.target = this._document.wrapped;\n event.name = baseEvent.name;\n }\n if (id === \"doc\") {\n const eventName = event.name;\n if (eventName === \"Open\") {\n this.userActivation();\n this._document.obj._initActions();\n this.formatAll();\n }\n if (![\"DidPrint\", \"DidSave\", \"WillPrint\", \"WillSave\"].includes(eventName)) {\n this.userActivation();\n }\n this._document.obj._dispatchDocEvent(event.name);\n } else if (id === \"page\") {\n this.userActivation();\n this._document.obj._dispatchPageEvent(event.name, baseEvent.actions, baseEvent.pageNumber);\n } else if (id === \"app\" && baseEvent.name === \"ResetForm\") {\n this.userActivation();\n for (const fieldId of baseEvent.ids) {\n const obj = this._objects[fieldId];\n obj?.obj._reset();\n }\n }\n return;\n }\n const name = baseEvent.name;\n const source = this._objects[id];\n const event = globalThis.event = new Event(baseEvent);\n let savedChange;\n this.userActivation();\n if (source.obj._isButton()) {\n source.obj._id = id;\n event.value = source.obj._getExportValue(event.value);\n if (name === \"Action\") {\n source.obj._value = event.value;\n }\n }\n switch (name) {\n case \"Keystroke\":\n savedChange = {\n value: event.value,\n changeEx: event.changeEx,\n change: event.change,\n selStart: event.selStart,\n selEnd: event.selEnd\n };\n break;\n case \"Blur\":\n case \"Focus\":\n Object.defineProperty(event, \"value\", {\n configurable: false,\n writable: false,\n enumerable: true,\n value: event.value\n });\n break;\n case \"Validate\":\n this.runValidation(source, event);\n return;\n case \"Action\":\n this.runActions(source, source, event, name);\n this.runCalculate(source, event);\n return;\n }\n this.runActions(source, source, event, name);\n if (name !== \"Keystroke\") {\n return;\n }\n if (event.rc) {\n if (event.willCommit) {\n this.runValidation(source, event);\n } else {\n if (source.obj._isChoice) {\n source.obj.value = savedChange.changeEx;\n source.obj._send({\n id: source.obj._id,\n siblings: source.obj._siblings,\n value: source.obj.value\n });\n return;\n }\n const value = source.obj.value = this.mergeChange(event);\n let selStart, selEnd;\n if (event.selStart !== savedChange.selStart || event.selEnd !== savedChange.selEnd) {\n selStart = event.selStart;\n selEnd = event.selEnd;\n } else {\n selEnd = selStart = savedChange.selStart + event.change.length;\n }\n source.obj._send({\n id: source.obj._id,\n siblings: source.obj._siblings,\n value,\n selRange: [selStart, selEnd]\n });\n }\n } else if (!event.willCommit) {\n source.obj._send({\n id: source.obj._id,\n siblings: source.obj._siblings,\n value: savedChange.value,\n selRange: [savedChange.selStart, savedChange.selEnd]\n });\n } else {\n source.obj._send({\n id: source.obj._id,\n siblings: source.obj._siblings,\n value: \"\",\n formattedValue: null,\n selRange: [0, 0]\n });\n }\n }\n formatAll() {\n const event = globalThis.event = new Event({});\n for (const source of Object.values(this._objects)) {\n event.value = source.obj._getValue();\n this.runActions(source, source, event, \"Format\");\n }\n }\n runValidation(source, event) {\n const didValidateRun = this.runActions(source, source, event, \"Validate\");\n if (event.rc) {\n source.obj.value = event.value;\n this.runCalculate(source, event);\n const savedValue = event.value = source.obj._getValue();\n let formattedValue = null;\n if (this.runActions(source, source, event, \"Format\")) {\n formattedValue = event.value?.toString?.();\n }\n source.obj._send({\n id: source.obj._id,\n siblings: source.obj._siblings,\n value: savedValue,\n formattedValue\n });\n event.value = savedValue;\n } else if (didValidateRun) {\n source.obj._send({\n id: source.obj._id,\n siblings: source.obj._siblings,\n value: \"\",\n formattedValue: null,\n selRange: [0, 0],\n focus: true\n });\n }\n }\n runActions(source, target, event, eventName) {\n event.source = source.wrapped;\n event.target = target.wrapped;\n event.name = eventName;\n event.targetName = target.obj.name;\n event.rc = true;\n return target.obj._runActions(event);\n }\n calculateNow() {\n if (!this._calculationOrder || this._isCalculating || !this._document.obj.calculate) {\n return;\n }\n this._isCalculating = true;\n const first = this._calculationOrder[0];\n const source = this._objects[first];\n globalThis.event = new Event({});\n try {\n this.runCalculate(source, globalThis.event);\n } catch (error) {\n this._isCalculating = false;\n throw error;\n }\n this._isCalculating = false;\n }\n runCalculate(source, event) {\n if (!this._calculationOrder || !this._document.obj.calculate) {\n return;\n }\n for (const targetId of this._calculationOrder) {\n if (!(targetId in this._objects)) {\n continue;\n }\n if (!this._document.obj.calculate) {\n break;\n }\n event.value = null;\n const target = this._objects[targetId];\n let savedValue = target.obj._getValue();\n try {\n this.runActions(source, target, event, \"Calculate\");\n } catch (error) {\n const fieldId = target.obj._id;\n const serializedError = serializeError(error);\n serializedError.value = `Error when calculating value for field \"${fieldId}\"\\n${serializedError.value}`;\n this._externalCall(\"send\", [serializedError]);\n continue;\n }\n if (!event.rc) {\n continue;\n }\n if (event.value !== null) {\n target.obj.value = event.value;\n } else {\n event.value = target.obj._getValue();\n }\n this.runActions(target, target, event, \"Validate\");\n if (!event.rc) {\n if (target.obj._getValue() !== savedValue) {\n target.wrapped.value = savedValue;\n }\n continue;\n }\n if (event.value === null) {\n event.value = target.obj._getValue();\n }\n savedValue = target.obj._getValue();\n let formattedValue = null;\n if (this.runActions(target, target, event, \"Format\")) {\n formattedValue = event.value?.toString?.();\n }\n target.obj._send({\n id: target.obj._id,\n siblings: target.obj._siblings,\n value: savedValue,\n formattedValue\n });\n }\n }\n}\n\n;// ./src/scripting_api/fullscreen.js\n\n\nclass FullScreen extends PDFObject {\n constructor(data) {\n super(data);\n this._backgroundColor = [];\n this._clickAdvances = true;\n this._cursor = Cursor.hidden;\n this._defaultTransition = \"\";\n this._escapeExits = true;\n this._isFullScreen = true;\n this._loop = false;\n this._timeDelay = 3600;\n this._usePageTiming = false;\n this._useTimer = false;\n }\n get backgroundColor() {\n return this._backgroundColor;\n }\n set backgroundColor(_) {}\n get clickAdvances() {\n return this._clickAdvances;\n }\n set clickAdvances(_) {}\n get cursor() {\n return this._cursor;\n }\n set cursor(_) {}\n get defaultTransition() {\n return this._defaultTransition;\n }\n set defaultTransition(_) {}\n get escapeExits() {\n return this._escapeExits;\n }\n set escapeExits(_) {}\n get isFullScreen() {\n return this._isFullScreen;\n }\n set isFullScreen(_) {}\n get loop() {\n return this._loop;\n }\n set loop(_) {}\n get timeDelay() {\n return this._timeDelay;\n }\n set timeDelay(_) {}\n get transitions() {\n return [\"Replace\", \"WipeRight\", \"WipeLeft\", \"WipeDown\", \"WipeUp\", \"SplitHorizontalIn\", \"SplitHorizontalOut\", \"SplitVerticalIn\", \"SplitVerticalOut\", \"BlindsHorizontal\", \"BlindsVertical\", \"BoxIn\", \"BoxOut\", \"GlitterRight\", \"GlitterDown\", \"GlitterRightDown\", \"Dissolve\", \"Random\"];\n }\n set transitions(_) {\n throw new Error(\"fullscreen.transitions is read-only\");\n }\n get usePageTiming() {\n return this._usePageTiming;\n }\n set usePageTiming(_) {}\n get useTimer() {\n return this._useTimer;\n }\n set useTimer(_) {}\n}\n\n;// ./src/scripting_api/thermometer.js\n\nclass Thermometer extends PDFObject {\n constructor(data) {\n super(data);\n this._cancelled = false;\n this._duration = 100;\n this._text = \"\";\n this._value = 0;\n }\n get cancelled() {\n return this._cancelled;\n }\n set cancelled(_) {\n throw new Error(\"thermometer.cancelled is read-only\");\n }\n get duration() {\n return this._duration;\n }\n set duration(val) {\n this._duration = val;\n }\n get text() {\n return this._text;\n }\n set text(val) {\n this._text = val;\n }\n get value() {\n return this._value;\n }\n set value(val) {\n this._value = val;\n }\n begin() {}\n end() {}\n}\n\n;// ./src/scripting_api/app.js\n\n\n\n\n\n\nclass App extends PDFObject {\n constructor(data) {\n super(data);\n this._constants = null;\n this._focusRect = true;\n this._fs = null;\n this._language = App._getLanguage(data.language);\n this._openInPlace = false;\n this._platform = App._getPlatform(data.platform);\n this._runtimeHighlight = false;\n this._runtimeHighlightColor = [\"T\"];\n this._thermometer = null;\n this._toolbar = false;\n this._document = data._document;\n this._proxyHandler = data.proxyHandler;\n this._objects = Object.create(null);\n this._eventDispatcher = new EventDispatcher(this._document, data.calculationOrder, this._objects, data.externalCall);\n this._timeoutIds = new WeakMap();\n if (typeof FinalizationRegistry !== \"undefined\") {\n this._timeoutIdsRegistry = new FinalizationRegistry(this._cleanTimeout.bind(this));\n } else {\n this._timeoutIdsRegistry = null;\n }\n this._timeoutCallbackIds = new Map();\n this._timeoutCallbackId = USERACTIVATION_CALLBACKID + 1;\n this._globalEval = data.globalEval;\n this._externalCall = data.externalCall;\n }\n _dispatchEvent(pdfEvent) {\n this._eventDispatcher.dispatch(pdfEvent);\n }\n _registerTimeoutCallback(cExpr) {\n const id = this._timeoutCallbackId++;\n this._timeoutCallbackIds.set(id, cExpr);\n return id;\n }\n _unregisterTimeoutCallback(id) {\n this._timeoutCallbackIds.delete(id);\n }\n _evalCallback({\n callbackId,\n interval\n }) {\n if (callbackId === USERACTIVATION_CALLBACKID) {\n this._document.obj._userActivation = false;\n return;\n }\n const expr = this._timeoutCallbackIds.get(callbackId);\n if (!interval) {\n this._unregisterTimeoutCallback(callbackId);\n }\n if (expr) {\n this._globalEval(expr);\n }\n }\n _registerTimeout(callbackId, interval) {\n const timeout = Object.create(null);\n const id = {\n callbackId,\n interval\n };\n this._timeoutIds.set(timeout, id);\n this._timeoutIdsRegistry?.register(timeout, id);\n return timeout;\n }\n _unregisterTimeout(timeout) {\n this._timeoutIdsRegistry?.unregister(timeout);\n const data = this._timeoutIds.get(timeout);\n if (!data) {\n return;\n }\n this._timeoutIds.delete(timeout);\n this._cleanTimeout(data);\n }\n _cleanTimeout({\n callbackId,\n interval\n }) {\n this._unregisterTimeoutCallback(callbackId);\n if (interval) {\n this._externalCall(\"clearInterval\", [callbackId]);\n } else {\n this._externalCall(\"clearTimeout\", [callbackId]);\n }\n }\n static _getPlatform(platform) {\n if (typeof platform === \"string\") {\n platform = platform.toLowerCase();\n if (platform.includes(\"win\")) {\n return \"WIN\";\n } else if (platform.includes(\"mac\")) {\n return \"MAC\";\n }\n }\n return \"UNIX\";\n }\n static _getLanguage(language) {\n const [main, sub] = language.toLowerCase().split(/[-_]/);\n switch (main) {\n case \"zh\":\n if (sub === \"cn\" || sub === \"sg\") {\n return \"CHS\";\n }\n return \"CHT\";\n case \"da\":\n return \"DAN\";\n case \"de\":\n return \"DEU\";\n case \"es\":\n return \"ESP\";\n case \"fr\":\n return \"FRA\";\n case \"it\":\n return \"ITA\";\n case \"ko\":\n return \"KOR\";\n case \"ja\":\n return \"JPN\";\n case \"nl\":\n return \"NLD\";\n case \"no\":\n return \"NOR\";\n case \"pt\":\n if (sub === \"br\") {\n return \"PTB\";\n }\n return \"ENU\";\n case \"fi\":\n return \"SUO\";\n case \"SV\":\n return \"SVE\";\n default:\n return \"ENU\";\n }\n }\n get activeDocs() {\n return [this._document.wrapped];\n }\n set activeDocs(_) {\n throw new Error(\"app.activeDocs is read-only\");\n }\n get calculate() {\n return this._document.obj.calculate;\n }\n set calculate(calculate) {\n this._document.obj.calculate = calculate;\n }\n get constants() {\n if (!this._constants) {\n this._constants = Object.freeze({\n align: Object.freeze({\n left: 0,\n center: 1,\n right: 2,\n top: 3,\n bottom: 4\n })\n });\n }\n return this._constants;\n }\n set constants(_) {\n throw new Error(\"app.constants is read-only\");\n }\n get focusRect() {\n return this._focusRect;\n }\n set focusRect(val) {\n this._focusRect = val;\n }\n get formsVersion() {\n return FORMS_VERSION;\n }\n set formsVersion(_) {\n throw new Error(\"app.formsVersion is read-only\");\n }\n get fromPDFConverters() {\n return [];\n }\n set fromPDFConverters(_) {\n throw new Error(\"app.fromPDFConverters is read-only\");\n }\n get fs() {\n if (this._fs === null) {\n this._fs = new Proxy(new FullScreen({\n send: this._send\n }), this._proxyHandler);\n }\n return this._fs;\n }\n set fs(_) {\n throw new Error(\"app.fs is read-only\");\n }\n get language() {\n return this._language;\n }\n set language(_) {\n throw new Error(\"app.language is read-only\");\n }\n get media() {\n return undefined;\n }\n set media(_) {\n throw new Error(\"app.media is read-only\");\n }\n get monitors() {\n return [];\n }\n set monitors(_) {\n throw new Error(\"app.monitors is read-only\");\n }\n get numPlugins() {\n return 0;\n }\n set numPlugins(_) {\n throw new Error(\"app.numPlugins is read-only\");\n }\n get openInPlace() {\n return this._openInPlace;\n }\n set openInPlace(val) {\n this._openInPlace = val;\n }\n get platform() {\n return this._platform;\n }\n set platform(_) {\n throw new Error(\"app.platform is read-only\");\n }\n get plugins() {\n return [];\n }\n set plugins(_) {\n throw new Error(\"app.plugins is read-only\");\n }\n get printColorProfiles() {\n return [];\n }\n set printColorProfiles(_) {\n throw new Error(\"app.printColorProfiles is read-only\");\n }\n get printerNames() {\n return [];\n }\n set printerNames(_) {\n throw new Error(\"app.printerNames is read-only\");\n }\n get runtimeHighlight() {\n return this._runtimeHighlight;\n }\n set runtimeHighlight(val) {\n this._runtimeHighlight = val;\n }\n get runtimeHighlightColor() {\n return this._runtimeHighlightColor;\n }\n set runtimeHighlightColor(val) {\n if (Color._isValidColor(val)) {\n this._runtimeHighlightColor = val;\n }\n }\n get thermometer() {\n if (this._thermometer === null) {\n this._thermometer = new Proxy(new Thermometer({\n send: this._send\n }), this._proxyHandler);\n }\n return this._thermometer;\n }\n set thermometer(_) {\n throw new Error(\"app.thermometer is read-only\");\n }\n get toolbar() {\n return this._toolbar;\n }\n set toolbar(val) {\n this._toolbar = val;\n }\n get toolbarHorizontal() {\n return this.toolbar;\n }\n set toolbarHorizontal(value) {\n this.toolbar = value;\n }\n get toolbarVertical() {\n return this.toolbar;\n }\n set toolbarVertical(value) {\n this.toolbar = value;\n }\n get viewerType() {\n return VIEWER_TYPE;\n }\n set viewerType(_) {\n throw new Error(\"app.viewerType is read-only\");\n }\n get viewerVariation() {\n return VIEWER_VARIATION;\n }\n set viewerVariation(_) {\n throw new Error(\"app.viewerVariation is read-only\");\n }\n get viewerVersion() {\n return VIEWER_VERSION;\n }\n set viewerVersion(_) {\n throw new Error(\"app.viewerVersion is read-only\");\n }\n addMenuItem() {}\n addSubMenu() {}\n addToolButton() {}\n alert(cMsg, nIcon = 0, nType = 0, cTitle = \"PDF.js\", oDoc = null, oCheckbox = null) {\n if (!this._document.obj._userActivation) {\n return 0;\n }\n this._document.obj._userActivation = false;\n if (cMsg && typeof cMsg === \"object\") {\n nType = cMsg.nType;\n cMsg = cMsg.cMsg;\n }\n cMsg = (cMsg || \"\").toString();\n if (!cMsg) {\n return 0;\n }\n nType = typeof nType !== \"number\" || isNaN(nType) || nType < 0 || nType > 3 ? 0 : nType;\n if (nType >= 2) {\n return this._externalCall(\"confirm\", [cMsg]) ? 4 : 3;\n }\n this._externalCall(\"alert\", [cMsg]);\n return 1;\n }\n beep() {}\n beginPriv() {}\n browseForDoc() {}\n clearInterval(oInterval) {\n this._unregisterTimeout(oInterval);\n }\n clearTimeOut(oTime) {\n this._unregisterTimeout(oTime);\n }\n endPriv() {}\n execDialog() {}\n execMenuItem(item) {\n if (!this._document.obj._userActivation) {\n return;\n }\n this._document.obj._userActivation = false;\n switch (item) {\n case \"SaveAs\":\n if (this._document.obj._disableSaving) {\n return;\n }\n this._send({\n command: item\n });\n break;\n case \"FirstPage\":\n case \"LastPage\":\n case \"NextPage\":\n case \"PrevPage\":\n case \"ZoomViewIn\":\n case \"ZoomViewOut\":\n this._send({\n command: item\n });\n break;\n case \"FitPage\":\n this._send({\n command: \"zoom\",\n value: \"page-fit\"\n });\n break;\n case \"Print\":\n if (this._document.obj._disablePrinting) {\n return;\n }\n this._send({\n command: \"print\"\n });\n break;\n }\n }\n getNthPlugInName() {}\n getPath() {}\n goBack() {}\n goForward() {}\n hideMenuItem() {}\n hideToolbarButton() {}\n launchURL() {}\n listMenuItems() {}\n listToolbarButtons() {}\n loadPolicyFile() {}\n mailGetAddrs() {}\n mailMsg() {}\n newDoc() {}\n newCollection() {}\n newFDF() {}\n openDoc() {}\n openFDF() {}\n popUpMenu() {}\n popUpMenuEx() {}\n removeToolButton() {}\n response(cQuestion, cTitle = \"\", cDefault = \"\", bPassword = \"\", cLabel = \"\") {\n if (cQuestion && typeof cQuestion === \"object\") {\n cDefault = cQuestion.cDefault;\n cQuestion = cQuestion.cQuestion;\n }\n cQuestion = (cQuestion || \"\").toString();\n cDefault = (cDefault || \"\").toString();\n return this._externalCall(\"prompt\", [cQuestion, cDefault || \"\"]);\n }\n setInterval(cExpr, nMilliseconds = 0) {\n if (cExpr && typeof cExpr === \"object\") {\n nMilliseconds = cExpr.nMilliseconds || 0;\n cExpr = cExpr.cExpr;\n }\n if (typeof cExpr !== \"string\") {\n throw new TypeError(\"First argument of app.setInterval must be a string\");\n }\n if (typeof nMilliseconds !== \"number\") {\n throw new TypeError(\"Second argument of app.setInterval must be a number\");\n }\n const callbackId = this._registerTimeoutCallback(cExpr);\n this._externalCall(\"setInterval\", [callbackId, nMilliseconds]);\n return this._registerTimeout(callbackId, true);\n }\n setTimeOut(cExpr, nMilliseconds = 0) {\n if (cExpr && typeof cExpr === \"object\") {\n nMilliseconds = cExpr.nMilliseconds || 0;\n cExpr = cExpr.cExpr;\n }\n if (typeof cExpr !== \"string\") {\n throw new TypeError(\"First argument of app.setTimeOut must be a string\");\n }\n if (typeof nMilliseconds !== \"number\") {\n throw new TypeError(\"Second argument of app.setTimeOut must be a number\");\n }\n const callbackId = this._registerTimeoutCallback(cExpr);\n this._externalCall(\"setTimeout\", [callbackId, nMilliseconds]);\n return this._registerTimeout(callbackId, false);\n }\n trustedFunction() {}\n trustPropagatorFunction() {}\n}\n\n;// ./src/scripting_api/console.js\n\nclass Console extends PDFObject {\n clear() {\n this._send({\n id: \"clear\"\n });\n }\n hide() {}\n println(msg) {\n if (typeof msg === \"string\") {\n this._send({\n command: \"println\",\n value: \"PDF.js Console:: \" + msg\n });\n }\n }\n show() {}\n}\n\n;// ./src/scripting_api/print_params.js\nclass PrintParams {\n constructor(data) {\n this.binaryOk = true;\n this.bitmapDPI = 150;\n this.booklet = {\n binding: 0,\n duplexMode: 0,\n subsetFrom: 0,\n subsetTo: -1\n };\n this.colorOverride = 0;\n this.colorProfile = \"\";\n this.constants = Object.freeze({\n bookletBindings: Object.freeze({\n Left: 0,\n Right: 1,\n LeftTall: 2,\n RightTall: 3\n }),\n bookletDuplexMode: Object.freeze({\n BothSides: 0,\n FrontSideOnly: 1,\n BasicSideOnly: 2\n }),\n colorOverrides: Object.freeze({\n auto: 0,\n gray: 1,\n mono: 2\n }),\n fontPolicies: Object.freeze({\n everyPage: 0,\n jobStart: 1,\n pageRange: 2\n }),\n handling: Object.freeze({\n none: 0,\n fit: 1,\n shrink: 2,\n tileAll: 3,\n tileLarge: 4,\n nUp: 5,\n booklet: 6\n }),\n interactionLevel: Object.freeze({\n automatic: 0,\n full: 1,\n silent: 2\n }),\n nUpPageOrders: Object.freeze({\n Horizontal: 0,\n HorizontalReversed: 1,\n Vertical: 2\n }),\n printContents: Object.freeze({\n doc: 0,\n docAndComments: 1,\n formFieldsOnly: 2\n }),\n flagValues: Object.freeze({\n applyOverPrint: 1,\n applySoftProofSettings: 1 << 1,\n applyWorkingColorSpaces: 1 << 2,\n emitHalftones: 1 << 3,\n emitPostScriptXObjects: 1 << 4,\n emitFormsAsPSForms: 1 << 5,\n maxJP2KRes: 1 << 6,\n setPageSize: 1 << 7,\n suppressBG: 1 << 8,\n suppressCenter: 1 << 9,\n suppressCJKFontSubst: 1 << 10,\n suppressCropClip: 1 << 1,\n suppressRotate: 1 << 12,\n suppressTransfer: 1 << 13,\n suppressUCR: 1 << 14,\n useTrapAnnots: 1 << 15,\n usePrintersMarks: 1 << 16\n }),\n rasterFlagValues: Object.freeze({\n textToOutline: 1,\n strokesToOutline: 1 << 1,\n allowComplexClip: 1 << 2,\n preserveOverprint: 1 << 3\n }),\n subsets: Object.freeze({\n all: 0,\n even: 1,\n odd: 2\n }),\n tileMarks: Object.freeze({\n none: 0,\n west: 1,\n east: 2\n }),\n usages: Object.freeze({\n auto: 0,\n use: 1,\n noUse: 2\n })\n });\n this.downloadFarEastFonts = false;\n this.fileName = \"\";\n this.firstPage = 0;\n this.flags = 0;\n this.fontPolicy = 0;\n this.gradientDPI = 150;\n this.interactive = 1;\n this.lastPage = data.lastPage;\n this.npUpAutoRotate = false;\n this.npUpNumPagesH = 2;\n this.npUpNumPagesV = 2;\n this.npUpPageBorder = false;\n this.npUpPageOrder = 0;\n this.pageHandling = 0;\n this.pageSubset = 0;\n this.printAsImage = false;\n this.printContent = 0;\n this.printerName = \"\";\n this.psLevel = 0;\n this.rasterFlags = 0;\n this.reversePages = false;\n this.tileLabel = false;\n this.tileMark = 0;\n this.tileOverlap = 0;\n this.tileScale = 1.0;\n this.transparencyLevel = 75;\n this.usePrinterCRD = 0;\n this.useT1Conversion = 0;\n }\n}\n\n;// ./src/scripting_api/doc.js\n\n\n\n\n\nconst DOC_EXTERNAL = false;\nclass InfoProxyHandler {\n static get(obj, prop) {\n return obj[prop.toLowerCase()];\n }\n static set(obj, prop, value) {\n throw new Error(`doc.info.${prop} is read-only`);\n }\n}\nclass Doc extends PDFObject {\n constructor(data) {\n super(data);\n this._expandos = globalThis;\n this._baseURL = data.baseURL || \"\";\n this._calculate = true;\n this._delay = false;\n this._dirty = false;\n this._disclosed = false;\n this._media = undefined;\n this._metadata = data.metadata || \"\";\n this._noautocomplete = undefined;\n this._nocache = undefined;\n this._spellDictionaryOrder = [];\n this._spellLanguageOrder = [];\n this._printParams = null;\n this._fields = new Map();\n this._fieldNames = [];\n this._event = null;\n this._author = data.Author || \"\";\n this._creator = data.Creator || \"\";\n this._creationDate = this._getDate(data.CreationDate) || null;\n this._docID = data.docID || [\"\", \"\"];\n this._documentFileName = data.filename || \"\";\n this._filesize = data.filesize || 0;\n this._keywords = data.Keywords || \"\";\n this._layout = data.layout || \"\";\n this._modDate = this._getDate(data.ModDate) || null;\n this._numFields = 0;\n this._numPages = data.numPages || 1;\n this._pageNum = data.pageNum || 0;\n this._producer = data.Producer || \"\";\n this._securityHandler = data.EncryptFilterName || null;\n this._subject = data.Subject || \"\";\n this._title = data.Title || \"\";\n this._URL = data.URL || \"\";\n this._info = new Proxy({\n title: this._title,\n author: this._author,\n authors: data.authors || [this._author],\n subject: this._subject,\n keywords: this._keywords,\n creator: this._creator,\n producer: this._producer,\n creationdate: this._creationDate,\n moddate: this._modDate,\n trapped: data.Trapped || \"Unknown\"\n }, InfoProxyHandler);\n this._zoomType = ZoomType.none;\n this._zoom = data.zoom || 100;\n this._actions = createActionsMap(data.actions);\n this._globalEval = data.globalEval;\n this._pageActions = null;\n this._userActivation = false;\n this._disablePrinting = false;\n this._disableSaving = false;\n this._otherPageActions = null;\n }\n _initActions() {\n const dontRun = new Set([\"WillClose\", \"WillSave\", \"DidSave\", \"WillPrint\", \"DidPrint\", \"OpenAction\"]);\n this._disableSaving = true;\n for (const actionName of this._actions.keys()) {\n if (!dontRun.has(actionName)) {\n this._runActions(actionName);\n }\n }\n this._runActions(\"OpenAction\");\n this._disableSaving = false;\n }\n _dispatchDocEvent(name) {\n switch (name) {\n case \"Open\":\n this._disableSaving = true;\n this._runActions(\"OpenAction\");\n this._disableSaving = false;\n break;\n case \"WillPrint\":\n this._disablePrinting = true;\n try {\n this._runActions(name);\n } catch (error) {\n this._send(serializeError(error));\n }\n this._send({\n command: \"WillPrintFinished\"\n });\n this._disablePrinting = false;\n break;\n case \"WillSave\":\n this._disableSaving = true;\n this._runActions(name);\n this._disableSaving = false;\n break;\n default:\n this._runActions(name);\n }\n }\n _dispatchPageEvent(name, actions, pageNumber) {\n if (name === \"PageOpen\") {\n this._pageActions ||= new Map();\n if (!this._pageActions.has(pageNumber)) {\n this._pageActions.set(pageNumber, createActionsMap(actions));\n }\n this._pageNum = pageNumber - 1;\n }\n for (const acts of [this._pageActions, this._otherPageActions]) {\n actions = acts?.get(pageNumber)?.get(name);\n if (actions) {\n for (const action of actions) {\n this._globalEval(action);\n }\n }\n }\n }\n _runActions(name) {\n const actions = this._actions.get(name);\n if (actions) {\n for (const action of actions) {\n this._globalEval(action);\n }\n }\n }\n _addField(name, field) {\n this._fields.set(name, field);\n this._fieldNames.push(name);\n this._numFields++;\n const po = field.obj._actions.get(\"PageOpen\");\n const pc = field.obj._actions.get(\"PageClose\");\n if (po || pc) {\n this._otherPageActions ||= new Map();\n let actions = this._otherPageActions.get(field.obj._page + 1);\n if (!actions) {\n actions = new Map();\n this._otherPageActions.set(field.obj._page + 1, actions);\n }\n if (po) {\n let poActions = actions.get(\"PageOpen\");\n if (!poActions) {\n poActions = [];\n actions.set(\"PageOpen\", poActions);\n }\n poActions.push(...po);\n }\n if (pc) {\n let pcActions = actions.get(\"PageClose\");\n if (!pcActions) {\n pcActions = [];\n actions.set(\"PageClose\", pcActions);\n }\n pcActions.push(...pc);\n }\n }\n }\n _getDate(date) {\n if (!date || date.length < 15 || !date.startsWith(\"D:\")) {\n return date;\n }\n date = date.substring(2);\n const year = date.substring(0, 4);\n const month = date.substring(4, 6);\n const day = date.substring(6, 8);\n const hour = date.substring(8, 10);\n const minute = date.substring(10, 12);\n const o = date.charAt(12);\n let second, offsetPos;\n if (o === \"Z\" || o === \"+\" || o === \"-\") {\n second = \"00\";\n offsetPos = 12;\n } else {\n second = date.substring(12, 14);\n offsetPos = 14;\n }\n const offset = date.substring(offsetPos).replaceAll(\"'\", \"\");\n return new Date(`${year}-${month}-${day}T${hour}:${minute}:${second}${offset}`);\n }\n get author() {\n return this._author;\n }\n set author(_) {\n throw new Error(\"doc.author is read-only\");\n }\n get baseURL() {\n return this._baseURL;\n }\n set baseURL(baseURL) {\n this._baseURL = baseURL;\n }\n get bookmarkRoot() {\n return undefined;\n }\n set bookmarkRoot(_) {\n throw new Error(\"doc.bookmarkRoot is read-only\");\n }\n get calculate() {\n return this._calculate;\n }\n set calculate(calculate) {\n this._calculate = calculate;\n }\n get creator() {\n return this._creator;\n }\n set creator(_) {\n throw new Error(\"doc.creator is read-only\");\n }\n get dataObjects() {\n return [];\n }\n set dataObjects(_) {\n throw new Error(\"doc.dataObjects is read-only\");\n }\n get delay() {\n return this._delay;\n }\n set delay(delay) {\n this._delay = delay;\n }\n get dirty() {\n return this._dirty;\n }\n set dirty(dirty) {\n this._dirty = dirty;\n }\n get disclosed() {\n return this._disclosed;\n }\n set disclosed(disclosed) {\n this._disclosed = disclosed;\n }\n get docID() {\n return this._docID;\n }\n set docID(_) {\n throw new Error(\"doc.docID is read-only\");\n }\n get documentFileName() {\n return this._documentFileName;\n }\n set documentFileName(_) {\n throw new Error(\"doc.documentFileName is read-only\");\n }\n get dynamicXFAForm() {\n return false;\n }\n set dynamicXFAForm(_) {\n throw new Error(\"doc.dynamicXFAForm is read-only\");\n }\n get external() {\n return DOC_EXTERNAL;\n }\n set external(_) {\n throw new Error(\"doc.external is read-only\");\n }\n get filesize() {\n return this._filesize;\n }\n set filesize(_) {\n throw new Error(\"doc.filesize is read-only\");\n }\n get hidden() {\n return false;\n }\n set hidden(_) {\n throw new Error(\"doc.hidden is read-only\");\n }\n get hostContainer() {\n return undefined;\n }\n set hostContainer(_) {\n throw new Error(\"doc.hostContainer is read-only\");\n }\n get icons() {\n return undefined;\n }\n set icons(_) {\n throw new Error(\"doc.icons is read-only\");\n }\n get info() {\n return this._info;\n }\n set info(_) {\n throw new Error(\"doc.info is read-only\");\n }\n get innerAppWindowRect() {\n return [0, 0, 0, 0];\n }\n set innerAppWindowRect(_) {\n throw new Error(\"doc.innerAppWindowRect is read-only\");\n }\n get innerDocWindowRect() {\n return [0, 0, 0, 0];\n }\n set innerDocWindowRect(_) {\n throw new Error(\"doc.innerDocWindowRect is read-only\");\n }\n get isModal() {\n return false;\n }\n set isModal(_) {\n throw new Error(\"doc.isModal is read-only\");\n }\n get keywords() {\n return this._keywords;\n }\n set keywords(_) {\n throw new Error(\"doc.keywords is read-only\");\n }\n get layout() {\n return this._layout;\n }\n set layout(value) {\n if (!this._userActivation) {\n return;\n }\n this._userActivation = false;\n if (typeof value !== \"string\") {\n return;\n }\n if (value !== \"SinglePage\" && value !== \"OneColumn\" && value !== \"TwoColumnLeft\" && value !== \"TwoPageLeft\" && value !== \"TwoColumnRight\" && value !== \"TwoPageRight\") {\n value = \"SinglePage\";\n }\n this._send({\n command: \"layout\",\n value\n });\n this._layout = value;\n }\n get media() {\n return this._media;\n }\n set media(media) {\n this._media = media;\n }\n get metadata() {\n return this._metadata;\n }\n set metadata(metadata) {\n this._metadata = metadata;\n }\n get modDate() {\n return this._modDate;\n }\n set modDate(_) {\n throw new Error(\"doc.modDate is read-only\");\n }\n get mouseX() {\n return 0;\n }\n set mouseX(_) {\n throw new Error(\"doc.mouseX is read-only\");\n }\n get mouseY() {\n return 0;\n }\n set mouseY(_) {\n throw new Error(\"doc.mouseY is read-only\");\n }\n get noautocomplete() {\n return this._noautocomplete;\n }\n set noautocomplete(noautocomplete) {\n this._noautocomplete = noautocomplete;\n }\n get nocache() {\n return this._nocache;\n }\n set nocache(nocache) {\n this._nocache = nocache;\n }\n get numFields() {\n return this._numFields;\n }\n set numFields(_) {\n throw new Error(\"doc.numFields is read-only\");\n }\n get numPages() {\n return this._numPages;\n }\n set numPages(_) {\n throw new Error(\"doc.numPages is read-only\");\n }\n get numTemplates() {\n return 0;\n }\n set numTemplates(_) {\n throw new Error(\"doc.numTemplates is read-only\");\n }\n get outerAppWindowRect() {\n return [0, 0, 0, 0];\n }\n set outerAppWindowRect(_) {\n throw new Error(\"doc.outerAppWindowRect is read-only\");\n }\n get outerDocWindowRect() {\n return [0, 0, 0, 0];\n }\n set outerDocWindowRect(_) {\n throw new Error(\"doc.outerDocWindowRect is read-only\");\n }\n get pageNum() {\n return this._pageNum;\n }\n set pageNum(value) {\n if (!this._userActivation) {\n return;\n }\n this._userActivation = false;\n if (typeof value !== \"number\" || value < 0 || value >= this._numPages) {\n return;\n }\n this._send({\n command: \"page-num\",\n value\n });\n this._pageNum = value;\n }\n get pageWindowRect() {\n return [0, 0, 0, 0];\n }\n set pageWindowRect(_) {\n throw new Error(\"doc.pageWindowRect is read-only\");\n }\n get path() {\n return \"\";\n }\n set path(_) {\n throw new Error(\"doc.path is read-only\");\n }\n get permStatusReady() {\n return true;\n }\n set permStatusReady(_) {\n throw new Error(\"doc.permStatusReady is read-only\");\n }\n get producer() {\n return this._producer;\n }\n set producer(_) {\n throw new Error(\"doc.producer is read-only\");\n }\n get requiresFullSave() {\n return false;\n }\n set requiresFullSave(_) {\n throw new Error(\"doc.requiresFullSave is read-only\");\n }\n get securityHandler() {\n return this._securityHandler;\n }\n set securityHandler(_) {\n throw new Error(\"doc.securityHandler is read-only\");\n }\n get selectedAnnots() {\n return [];\n }\n set selectedAnnots(_) {\n throw new Error(\"doc.selectedAnnots is read-only\");\n }\n get sounds() {\n return [];\n }\n set sounds(_) {\n throw new Error(\"doc.sounds is read-only\");\n }\n get spellDictionaryOrder() {\n return this._spellDictionaryOrder;\n }\n set spellDictionaryOrder(spellDictionaryOrder) {\n this._spellDictionaryOrder = spellDictionaryOrder;\n }\n get spellLanguageOrder() {\n return this._spellLanguageOrder;\n }\n set spellLanguageOrder(spellLanguageOrder) {\n this._spellLanguageOrder = spellLanguageOrder;\n }\n get subject() {\n return this._subject;\n }\n set subject(_) {\n throw new Error(\"doc.subject is read-only\");\n }\n get templates() {\n return [];\n }\n set templates(_) {\n throw new Error(\"doc.templates is read-only\");\n }\n get title() {\n return this._title;\n }\n set title(_) {\n throw new Error(\"doc.title is read-only\");\n }\n get URL() {\n return this._URL;\n }\n set URL(_) {\n throw new Error(\"doc.URL is read-only\");\n }\n get viewState() {\n return undefined;\n }\n set viewState(_) {\n throw new Error(\"doc.viewState is read-only\");\n }\n get xfa() {\n return this._xfa;\n }\n set xfa(_) {\n throw new Error(\"doc.xfa is read-only\");\n }\n get XFAForeground() {\n return false;\n }\n set XFAForeground(_) {\n throw new Error(\"doc.XFAForeground is read-only\");\n }\n get zoomType() {\n return this._zoomType;\n }\n set zoomType(type) {\n if (!this._userActivation) {\n return;\n }\n this._userActivation = false;\n if (typeof type !== \"string\") {\n return;\n }\n switch (type) {\n case ZoomType.none:\n this._send({\n command: \"zoom\",\n value: 1\n });\n break;\n case ZoomType.fitP:\n this._send({\n command: \"zoom\",\n value: \"page-fit\"\n });\n break;\n case ZoomType.fitW:\n this._send({\n command: \"zoom\",\n value: \"page-width\"\n });\n break;\n case ZoomType.fitH:\n this._send({\n command: \"zoom\",\n value: \"page-height\"\n });\n break;\n case ZoomType.fitV:\n this._send({\n command: \"zoom\",\n value: \"auto\"\n });\n break;\n case ZoomType.pref:\n case ZoomType.refW:\n break;\n default:\n return;\n }\n this._zoomType = type;\n }\n get zoom() {\n return this._zoom;\n }\n set zoom(value) {\n if (!this._userActivation) {\n return;\n }\n this._userActivation = false;\n if (typeof value !== \"number\" || value < 8.33 || value > 6400) {\n return;\n }\n this._send({\n command: \"zoom\",\n value: value / 100\n });\n }\n addAnnot() {}\n addField() {}\n addIcon() {}\n addLink() {}\n addRecipientListCryptFilter() {}\n addRequirement() {}\n addScript() {}\n addThumbnails() {}\n addWatermarkFromFile() {}\n addWatermarkFromText() {}\n addWeblinks() {}\n bringToFront() {}\n calculateNow() {\n this._eventDispatcher.calculateNow();\n }\n closeDoc() {}\n colorConvertPage() {}\n createDataObject() {}\n createTemplate() {}\n deletePages() {}\n deleteSound() {}\n embedDocAsDataObject() {}\n embedOutputIntent() {}\n encryptForRecipients() {}\n encryptUsingPolicy() {}\n exportAsFDF() {}\n exportAsFDFStr() {}\n exportAsText() {}\n exportAsXFDF() {}\n exportAsXFDFStr() {}\n exportDataObject() {}\n exportXFAData() {}\n extractPages() {}\n flattenPages() {}\n getAnnot() {}\n getAnnots() {}\n getAnnot3D() {}\n getAnnots3D() {}\n getColorConvertAction() {}\n getDataObject() {}\n getDataObjectContents() {}\n _getField(cName) {\n if (cName && typeof cName === \"object\") {\n cName = cName.cName;\n }\n if (typeof cName !== \"string\") {\n throw new TypeError(\"Invalid field name: must be a string\");\n }\n const searchedField = this._fields.get(cName);\n if (searchedField) {\n return searchedField;\n }\n const parts = cName.split(\"#\");\n let childIndex = NaN;\n if (parts.length === 2) {\n childIndex = Math.floor(parseFloat(parts[1]));\n cName = parts[0];\n }\n for (const [name, field] of this._fields.entries()) {\n if (name.endsWith(cName)) {\n if (!isNaN(childIndex)) {\n const children = this._getChildren(name);\n if (childIndex < 0 || childIndex >= children.length) {\n childIndex = 0;\n }\n if (childIndex < children.length) {\n this._fields.set(cName, children[childIndex]);\n return children[childIndex];\n }\n }\n this._fields.set(cName, field);\n return field;\n }\n }\n return null;\n }\n getField(cName) {\n const field = this._getField(cName);\n if (!field) {\n return null;\n }\n return field.wrapped;\n }\n _getChildren(fieldName) {\n const len = fieldName.length;\n const children = [];\n const pattern = /^\\.[^.]+$/;\n for (const [name, field] of this._fields.entries()) {\n if (name.startsWith(fieldName)) {\n const finalPart = name.slice(len);\n if (pattern.test(finalPart)) {\n children.push(field);\n }\n }\n }\n return children;\n }\n _getTerminalChildren(fieldName) {\n const children = [];\n const len = fieldName.length;\n for (const [name, field] of this._fields.entries()) {\n if (name.startsWith(fieldName)) {\n const finalPart = name.slice(len);\n if (field.obj._hasValue && (finalPart === \"\" || finalPart.startsWith(\".\"))) {\n children.push(field.wrapped);\n }\n }\n }\n return children;\n }\n getIcon() {}\n getLegalWarnings() {}\n getLinks() {}\n getNthFieldName(nIndex) {\n if (nIndex && typeof nIndex === \"object\") {\n nIndex = nIndex.nIndex;\n }\n if (typeof nIndex !== \"number\") {\n throw new TypeError(\"Invalid field index: must be a number\");\n }\n if (0 <= nIndex && nIndex < this.numFields) {\n return this._fieldNames[Math.trunc(nIndex)];\n }\n return null;\n }\n getNthTemplate() {\n return null;\n }\n getOCGs() {}\n getOCGOrder() {}\n getPageBox() {}\n getPageLabel() {}\n getPageNthWord() {}\n getPageNthWordQuads() {}\n getPageNumWords() {}\n getPageRotation() {}\n getPageTransition() {}\n getPrintParams() {\n return this._printParams ||= new PrintParams({\n lastPage: this._numPages - 1\n });\n }\n getSound() {}\n getTemplate() {}\n getURL() {}\n gotoNamedDest() {}\n importAnFDF() {}\n importAnXFDF() {}\n importDataObject() {}\n importIcon() {}\n importSound() {}\n importTextData() {}\n importXFAData() {}\n insertPages() {}\n mailDoc() {}\n mailForm() {}\n movePage() {}\n newPage() {}\n openDataObject() {}\n print(bUI = true, nStart = 0, nEnd = -1, bSilent = false, bShrinkToFit = false, bPrintAsImage = false, bReverse = false, bAnnotations = true, printParams = null) {\n if (this._disablePrinting || !this._userActivation) {\n return;\n }\n this._userActivation = false;\n if (bUI && typeof bUI === \"object\") {\n nStart = bUI.nStart;\n nEnd = bUI.nEnd;\n bSilent = bUI.bSilent;\n bShrinkToFit = bUI.bShrinkToFit;\n bPrintAsImage = bUI.bPrintAsImage;\n bReverse = bUI.bReverse;\n bAnnotations = bUI.bAnnotations;\n printParams = bUI.printParams;\n bUI = bUI.bUI;\n }\n if (printParams) {\n nStart = printParams.firstPage;\n nEnd = printParams.lastPage;\n }\n nStart = typeof nStart === \"number\" ? Math.max(0, Math.trunc(nStart)) : 0;\n nEnd = typeof nEnd === \"number\" ? Math.max(0, Math.trunc(nEnd)) : -1;\n this._send({\n command: \"print\",\n start: nStart,\n end: nEnd\n });\n }\n removeDataObject() {}\n removeField() {}\n removeIcon() {}\n removeLinks() {}\n removeRequirement() {}\n removeScript() {}\n removeTemplate() {}\n removeThumbnails() {}\n removeWeblinks() {}\n replacePages() {}\n resetForm(aFields = null) {\n if (aFields && typeof aFields === \"object\" && !Array.isArray(aFields)) {\n aFields = aFields.aFields;\n }\n if (aFields && !Array.isArray(aFields)) {\n aFields = [aFields];\n }\n let mustCalculate = false;\n let fieldsToReset;\n if (aFields) {\n fieldsToReset = [];\n for (const fieldName of aFields) {\n if (!fieldName) {\n continue;\n }\n if (typeof fieldName !== \"string\") {\n fieldsToReset = null;\n break;\n }\n const field = this._getField(fieldName);\n if (!field) {\n continue;\n }\n fieldsToReset.push(field);\n mustCalculate = true;\n }\n }\n if (!fieldsToReset) {\n fieldsToReset = this._fields.values();\n mustCalculate = this._fields.size !== 0;\n }\n for (const field of fieldsToReset) {\n field.obj.value = field.obj.defaultValue;\n this._send({\n id: field.obj._id,\n siblings: field.obj._siblings,\n value: field.obj.defaultValue,\n formattedValue: null,\n selRange: [0, 0]\n });\n }\n if (mustCalculate) {\n this.calculateNow();\n }\n }\n saveAs() {}\n scroll() {}\n selectPageNthWord() {}\n setAction() {}\n setDataObjectContents() {}\n setOCGOrder() {}\n setPageAction() {}\n setPageBoxes() {}\n setPageLabels() {}\n setPageRotations() {}\n setPageTabOrder() {}\n setPageTransitions() {}\n spawnPageFromTemplate() {}\n submitForm() {}\n syncAnnotScan() {}\n}\n\n;// ./src/scripting_api/proxy.js\nclass ProxyHandler {\n constructor() {\n this.nosend = new Set([\"delay\"]);\n }\n get(obj, prop) {\n if (prop in obj._expandos) {\n const val = obj._expandos[prop];\n if (typeof val === \"function\") {\n return val.bind(obj);\n }\n return val;\n }\n if (typeof prop === \"string\" && !prop.startsWith(\"_\") && prop in obj) {\n const val = obj[prop];\n if (typeof val === \"function\") {\n return val.bind(obj);\n }\n return val;\n }\n return undefined;\n }\n set(obj, prop, value) {\n if (obj._kidIds) {\n obj._kidIds.forEach(id => {\n obj._appObjects[id].wrapped[prop] = value;\n });\n }\n if (typeof prop === \"string\" && !prop.startsWith(\"_\") && prop in obj) {\n const old = obj[prop];\n obj[prop] = value;\n if (!this.nosend.has(prop) && obj._send && obj._id !== null && typeof old !== \"function\") {\n const data = {\n id: obj._id\n };\n data[prop] = prop === \"value\" ? obj._getValue() : obj[prop];\n if (!obj._siblings) {\n obj._send(data);\n } else {\n data.siblings = obj._siblings;\n obj._send(data);\n }\n }\n } else {\n obj._expandos[prop] = value;\n }\n return true;\n }\n has(obj, prop) {\n return prop in obj._expandos || typeof prop === \"string\" && !prop.startsWith(\"_\") && prop in obj;\n }\n getPrototypeOf(obj) {\n return null;\n }\n setPrototypeOf(obj, proto) {\n return false;\n }\n isExtensible(obj) {\n return true;\n }\n preventExtensions(obj) {\n return false;\n }\n getOwnPropertyDescriptor(obj, prop) {\n if (prop in obj._expandos) {\n return {\n configurable: true,\n enumerable: true,\n value: obj._expandos[prop]\n };\n }\n if (typeof prop === \"string\" && !prop.startsWith(\"_\") && prop in obj) {\n return {\n configurable: true,\n enumerable: true,\n value: obj[prop]\n };\n }\n return undefined;\n }\n defineProperty(obj, key, descriptor) {\n Object.defineProperty(obj._expandos, key, descriptor);\n return true;\n }\n deleteProperty(obj, prop) {\n if (prop in obj._expandos) {\n delete obj._expandos[prop];\n }\n }\n ownKeys(obj) {\n const fromExpandos = Reflect.ownKeys(obj._expandos);\n const fromObj = Reflect.ownKeys(obj).filter(k => !k.startsWith(\"_\"));\n return fromExpandos.concat(fromObj);\n }\n}\n\n;// ./src/scripting_api/util.js\n\nclass Util extends PDFObject {\n #dateActionsCache = null;\n constructor(data) {\n super(data);\n this._scandCache = new Map();\n this._months = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"];\n this._days = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"];\n this.MILLISECONDS_IN_DAY = 86400000;\n this.MILLISECONDS_IN_WEEK = 604800000;\n this._externalCall = data.externalCall;\n }\n printf(...args) {\n if (args.length === 0) {\n throw new Error(\"Invalid number of params in printf\");\n }\n if (typeof args[0] !== \"string\") {\n throw new TypeError(\"First argument of printf must be a string\");\n }\n const pattern = /%(,[0-4])?([+ 0#]+)?(\\d+)?(\\.\\d+)?(.)/g;\n const PLUS = 1;\n const SPACE = 2;\n const ZERO = 4;\n const HASH = 8;\n let i = 0;\n return args[0].replaceAll(pattern, function (match, nDecSep, cFlags, nWidth, nPrecision, cConvChar) {\n if (cConvChar !== \"d\" && cConvChar !== \"f\" && cConvChar !== \"s\" && cConvChar !== \"x\") {\n const buf = [\"%\"];\n for (const str of [nDecSep, cFlags, nWidth, nPrecision, cConvChar]) {\n if (str) {\n buf.push(str);\n }\n }\n return buf.join(\"\");\n }\n i++;\n if (i === args.length) {\n throw new Error(\"Not enough arguments in printf\");\n }\n const arg = args[i];\n if (cConvChar === \"s\") {\n return arg.toString();\n }\n let flags = 0;\n if (cFlags) {\n for (const flag of cFlags) {\n switch (flag) {\n case \"+\":\n flags |= PLUS;\n break;\n case \" \":\n flags |= SPACE;\n break;\n case \"0\":\n flags |= ZERO;\n break;\n case \"#\":\n flags |= HASH;\n break;\n }\n }\n }\n cFlags = flags;\n if (nWidth) {\n nWidth = parseInt(nWidth);\n }\n let intPart = Math.trunc(arg);\n if (cConvChar === \"x\") {\n let hex = Math.abs(intPart).toString(16).toUpperCase();\n if (nWidth !== undefined) {\n hex = hex.padStart(nWidth, cFlags & ZERO ? \"0\" : \" \");\n }\n if (cFlags & HASH) {\n hex = `0x${hex}`;\n }\n return hex;\n }\n if (nPrecision) {\n nPrecision = parseInt(nPrecision.substring(1));\n }\n nDecSep = nDecSep ? nDecSep.substring(1) : \"0\";\n const separators = {\n 0: [\",\", \".\"],\n 1: [\"\", \".\"],\n 2: [\".\", \",\"],\n 3: [\"\", \",\"],\n 4: [\"'\", \".\"]\n };\n const [thousandSep, decimalSep] = separators[nDecSep];\n let decPart = \"\";\n if (cConvChar === \"f\") {\n decPart = nPrecision !== undefined ? Math.abs(arg - intPart).toFixed(nPrecision) : Math.abs(arg - intPart).toString();\n if (decPart.length > 2) {\n if (/^1\\.0+$/.test(decPart)) {\n intPart += Math.sign(arg);\n decPart = `${decimalSep}${decPart.split(\".\")[1]}`;\n } else {\n decPart = `${decimalSep}${decPart.substring(2)}`;\n }\n } else {\n if (decPart === \"1\") {\n intPart += Math.sign(arg);\n }\n decPart = cFlags & HASH ? \".\" : \"\";\n }\n }\n let sign = \"\";\n if (intPart < 0) {\n sign = \"-\";\n intPart = -intPart;\n } else if (cFlags & PLUS) {\n sign = \"+\";\n } else if (cFlags & SPACE) {\n sign = \" \";\n }\n if (thousandSep && intPart >= 1000) {\n const buf = [];\n while (true) {\n buf.push((intPart % 1000).toString().padStart(3, \"0\"));\n intPart = Math.trunc(intPart / 1000);\n if (intPart < 1000) {\n buf.push(intPart.toString());\n break;\n }\n }\n intPart = buf.reverse().join(thousandSep);\n } else {\n intPart = intPart.toString();\n }\n let n = `${intPart}${decPart}`;\n if (nWidth !== undefined) {\n n = n.padStart(nWidth - sign.length, cFlags & ZERO ? \"0\" : \" \");\n }\n return `${sign}${n}`;\n });\n }\n iconStreamFromIcon() {}\n printd(cFormat, oDate) {\n switch (cFormat) {\n case 0:\n return this.printd(\"D:yyyymmddHHMMss\", oDate);\n case 1:\n return this.printd(\"yyyy.mm.dd HH:MM:ss\", oDate);\n case 2:\n return this.printd(\"m/d/yy h:MM:ss tt\", oDate);\n }\n const handlers = {\n mmmm: data => this._months[data.month],\n mmm: data => this._months[data.month].substring(0, 3),\n mm: data => (data.month + 1).toString().padStart(2, \"0\"),\n m: data => (data.month + 1).toString(),\n dddd: data => this._days[data.dayOfWeek],\n ddd: data => this._days[data.dayOfWeek].substring(0, 3),\n dd: data => data.day.toString().padStart(2, \"0\"),\n d: data => data.day.toString(),\n yyyy: data => data.year.toString(),\n yy: data => (data.year % 100).toString().padStart(2, \"0\"),\n HH: data => data.hours.toString().padStart(2, \"0\"),\n H: data => data.hours.toString(),\n hh: data => (1 + (data.hours + 11) % 12).toString().padStart(2, \"0\"),\n h: data => (1 + (data.hours + 11) % 12).toString(),\n MM: data => data.minutes.toString().padStart(2, \"0\"),\n M: data => data.minutes.toString(),\n ss: data => data.seconds.toString().padStart(2, \"0\"),\n s: data => data.seconds.toString(),\n tt: data => data.hours < 12 ? \"am\" : \"pm\",\n t: data => data.hours < 12 ? \"a\" : \"p\"\n };\n const data = {\n year: oDate.getFullYear(),\n month: oDate.getMonth(),\n day: oDate.getDate(),\n dayOfWeek: oDate.getDay(),\n hours: oDate.getHours(),\n minutes: oDate.getMinutes(),\n seconds: oDate.getSeconds()\n };\n const patterns = /(mmmm|mmm|mm|m|dddd|ddd|dd|d|yyyy|yy|HH|H|hh|h|MM|M|ss|s|tt|t|\\\\.)/g;\n return cFormat.replaceAll(patterns, function (match, pattern) {\n if (pattern in handlers) {\n return handlers[pattern](data);\n }\n return pattern.charCodeAt(1);\n });\n }\n printx(cFormat, cSource) {\n cSource = (cSource ?? \"\").toString();\n const handlers = [x => x, x => x.toUpperCase(), x => x.toLowerCase()];\n const buf = [];\n let i = 0;\n const ii = cSource.length;\n let currCase = handlers[0];\n let escaped = false;\n for (const command of cFormat) {\n if (escaped) {\n buf.push(command);\n escaped = false;\n continue;\n }\n if (i >= ii) {\n break;\n }\n switch (command) {\n case \"?\":\n buf.push(currCase(cSource.charAt(i++)));\n break;\n case \"X\":\n while (i < ii) {\n const char = cSource.charAt(i++);\n if (\"a\" <= char && char <= \"z\" || \"A\" <= char && char <= \"Z\" || \"0\" <= char && char <= \"9\") {\n buf.push(currCase(char));\n break;\n }\n }\n break;\n case \"A\":\n while (i < ii) {\n const char = cSource.charAt(i++);\n if (\"a\" <= char && char <= \"z\" || \"A\" <= char && char <= \"Z\") {\n buf.push(currCase(char));\n break;\n }\n }\n break;\n case \"9\":\n while (i < ii) {\n const char = cSource.charAt(i++);\n if (\"0\" <= char && char <= \"9\") {\n buf.push(char);\n break;\n }\n }\n break;\n case \"*\":\n while (i < ii) {\n buf.push(currCase(cSource.charAt(i++)));\n }\n break;\n case \"\\\\\":\n escaped = true;\n break;\n case \">\":\n currCase = handlers[1];\n break;\n case \"<\":\n currCase = handlers[2];\n break;\n case \"=\":\n currCase = handlers[0];\n break;\n default:\n buf.push(command);\n }\n }\n return buf.join(\"\");\n }\n #tryToGuessDate(cFormat, cDate) {\n let actions = (this.#dateActionsCache ||= new Map()).get(cFormat);\n if (!actions) {\n actions = [];\n this.#dateActionsCache.set(cFormat, actions);\n cFormat.replaceAll(/(d+)|(m+)|(y+)|(H+)|(M+)|(s+)/g, function (_match, d, m, y, H, M, s) {\n if (d) {\n actions.push((n, data) => {\n if (n >= 1 && n <= 31) {\n data.day = n;\n return true;\n }\n return false;\n });\n } else if (m) {\n actions.push((n, data) => {\n if (n >= 1 && n <= 12) {\n data.month = n - 1;\n return true;\n }\n return false;\n });\n } else if (y) {\n actions.push((n, data) => {\n if (n < 50) {\n n += 2000;\n } else if (n < 100) {\n n += 1900;\n }\n data.year = n;\n return true;\n });\n } else if (H) {\n actions.push((n, data) => {\n if (n >= 0 && n <= 23) {\n data.hours = n;\n return true;\n }\n return false;\n });\n } else if (M) {\n actions.push((n, data) => {\n if (n >= 0 && n <= 59) {\n data.minutes = n;\n return true;\n }\n return false;\n });\n } else if (s) {\n actions.push((n, data) => {\n if (n >= 0 && n <= 59) {\n data.seconds = n;\n return true;\n }\n return false;\n });\n }\n return \"\";\n });\n }\n const number = /\\d+/g;\n let i = 0;\n let array;\n const data = {\n year: new Date().getFullYear(),\n month: 0,\n day: 1,\n hours: 12,\n minutes: 0,\n seconds: 0\n };\n while ((array = number.exec(cDate)) !== null) {\n if (i < actions.length) {\n if (!actions[i++](parseInt(array[0]), data)) {\n return null;\n }\n } else {\n break;\n }\n }\n if (i === 0) {\n return null;\n }\n return new Date(data.year, data.month, data.day, data.hours, data.minutes, data.seconds);\n }\n scand(cFormat, cDate) {\n return this._scand(cFormat, cDate);\n }\n _scand(cFormat, cDate, strict = false) {\n if (typeof cDate !== \"string\") {\n return new Date(cDate);\n }\n if (cDate === \"\") {\n return new Date();\n }\n switch (cFormat) {\n case 0:\n return this.scand(\"D:yyyymmddHHMMss\", cDate);\n case 1:\n return this.scand(\"yyyy.mm.dd HH:MM:ss\", cDate);\n case 2:\n return this.scand(\"m/d/yy h:MM:ss tt\", cDate);\n }\n if (!this._scandCache.has(cFormat)) {\n const months = this._months;\n const days = this._days;\n const handlers = {\n mmmm: {\n pattern: `(${months.join(\"|\")})`,\n action: (value, data) => {\n data.month = months.indexOf(value);\n }\n },\n mmm: {\n pattern: `(${months.map(month => month.substring(0, 3)).join(\"|\")})`,\n action: (value, data) => {\n data.month = months.findIndex(month => month.substring(0, 3) === value);\n }\n },\n mm: {\n pattern: `(\\\\d{2})`,\n action: (value, data) => {\n data.month = parseInt(value) - 1;\n }\n },\n m: {\n pattern: `(\\\\d{1,2})`,\n action: (value, data) => {\n data.month = parseInt(value) - 1;\n }\n },\n dddd: {\n pattern: `(${days.join(\"|\")})`,\n action: (value, data) => {\n data.day = days.indexOf(value);\n }\n },\n ddd: {\n pattern: `(${days.map(day => day.substring(0, 3)).join(\"|\")})`,\n action: (value, data) => {\n data.day = days.findIndex(day => day.substring(0, 3) === value);\n }\n },\n dd: {\n pattern: \"(\\\\d{2})\",\n action: (value, data) => {\n data.day = parseInt(value);\n }\n },\n d: {\n pattern: \"(\\\\d{1,2})\",\n action: (value, data) => {\n data.day = parseInt(value);\n }\n },\n yyyy: {\n pattern: \"(\\\\d{4})\",\n action: (value, data) => {\n data.year = parseInt(value);\n }\n },\n yy: {\n pattern: \"(\\\\d{2})\",\n action: (value, data) => {\n data.year = 2000 + parseInt(value);\n }\n },\n HH: {\n pattern: \"(\\\\d{2})\",\n action: (value, data) => {\n data.hours = parseInt(value);\n }\n },\n H: {\n pattern: \"(\\\\d{1,2})\",\n action: (value, data) => {\n data.hours = parseInt(value);\n }\n },\n hh: {\n pattern: \"(\\\\d{2})\",\n action: (value, data) => {\n data.hours = parseInt(value);\n }\n },\n h: {\n pattern: \"(\\\\d{1,2})\",\n action: (value, data) => {\n data.hours = parseInt(value);\n }\n },\n MM: {\n pattern: \"(\\\\d{2})\",\n action: (value, data) => {\n data.minutes = parseInt(value);\n }\n },\n M: {\n pattern: \"(\\\\d{1,2})\",\n action: (value, data) => {\n data.minutes = parseInt(value);\n }\n },\n ss: {\n pattern: \"(\\\\d{2})\",\n action: (value, data) => {\n data.seconds = parseInt(value);\n }\n },\n s: {\n pattern: \"(\\\\d{1,2})\",\n action: (value, data) => {\n data.seconds = parseInt(value);\n }\n },\n tt: {\n pattern: \"([aApP][mM])\",\n action: (value, data) => {\n const char = value.charAt(0);\n data.am = char === \"a\" || char === \"A\";\n }\n },\n t: {\n pattern: \"([aApP])\",\n action: (value, data) => {\n data.am = value === \"a\" || value === \"A\";\n }\n }\n };\n const escapedFormat = cFormat.replaceAll(/[.*+\\-?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n const patterns = /(mmmm|mmm|mm|m|dddd|ddd|dd|d|yyyy|yy|HH|H|hh|h|MM|M|ss|s|tt|t)/g;\n const actions = [];\n const re = escapedFormat.replaceAll(patterns, function (match, patternElement) {\n const {\n pattern,\n action\n } = handlers[patternElement];\n actions.push(action);\n return pattern;\n });\n this._scandCache.set(cFormat, [re, actions]);\n }\n const [re, actions] = this._scandCache.get(cFormat);\n const matches = new RegExp(`^${re}$`, \"g\").exec(cDate);\n if (!matches || matches.length !== actions.length + 1) {\n return strict ? null : this.#tryToGuessDate(cFormat, cDate);\n }\n const data = {\n year: new Date().getFullYear(),\n month: 0,\n day: 1,\n hours: 12,\n minutes: 0,\n seconds: 0,\n am: null\n };\n actions.forEach((action, i) => action(matches[i + 1], data));\n if (data.am !== null) {\n data.hours = data.hours % 12 + (data.am ? 0 : 12);\n }\n return new Date(data.year, data.month, data.day, data.hours, data.minutes, data.seconds);\n }\n spansToXML() {}\n stringFromStream() {}\n xmlToSpans() {}\n}\n\n;// ./src/scripting_api/initialization.js\n\n\n\n\n\n\n\n\n\n\nfunction initSandbox(params) {\n delete globalThis.pdfjsScripting;\n const externalCall = globalThis.callExternalFunction;\n delete globalThis.callExternalFunction;\n const globalEval = code => globalThis.eval(code);\n const send = data => externalCall(\"send\", [data]);\n const proxyHandler = new ProxyHandler();\n const {\n data\n } = params;\n const doc = new Doc({\n send,\n globalEval,\n ...data.docInfo\n });\n const _document = {\n obj: doc,\n wrapped: new Proxy(doc, proxyHandler)\n };\n const app = new App({\n send,\n globalEval,\n externalCall,\n _document,\n calculationOrder: data.calculationOrder,\n proxyHandler,\n ...data.appInfo\n });\n const util = new Util({\n externalCall\n });\n const appObjects = app._objects;\n if (data.objects) {\n const annotations = [];\n for (const [name, objs] of Object.entries(data.objects)) {\n annotations.length = 0;\n let container = null;\n for (const obj of objs) {\n if (obj.type !== \"\") {\n annotations.push(obj);\n } else {\n container = obj;\n }\n }\n let obj = container;\n if (annotations.length > 0) {\n obj = annotations[0];\n obj.send = send;\n }\n obj.globalEval = globalEval;\n obj.doc = _document;\n obj.fieldPath = name;\n obj.appObjects = appObjects;\n const otherFields = annotations.slice(1);\n let field;\n switch (obj.type) {\n case \"radiobutton\":\n {\n field = new RadioButtonField(otherFields, obj);\n break;\n }\n case \"checkbox\":\n {\n field = new CheckboxField(otherFields, obj);\n break;\n }\n default:\n if (otherFields.length > 0) {\n obj.siblings = otherFields.map(x => x.id);\n }\n field = new Field(obj);\n }\n const wrapped = new Proxy(field, proxyHandler);\n const _object = {\n obj: field,\n wrapped\n };\n doc._addField(name, _object);\n for (const object of objs) {\n appObjects[object.id] = _object;\n }\n if (container) {\n appObjects[container.id] = _object;\n }\n }\n }\n const color = new Color();\n globalThis.event = null;\n globalThis.global = Object.create(null);\n globalThis.app = new Proxy(app, proxyHandler);\n globalThis.color = new Proxy(color, proxyHandler);\n globalThis.console = new Proxy(new Console({\n send\n }), proxyHandler);\n globalThis.util = new Proxy(util, proxyHandler);\n globalThis.border = Border;\n globalThis.cursor = Cursor;\n globalThis.display = Display;\n globalThis.font = Font;\n globalThis.highlight = Highlight;\n globalThis.position = Position;\n globalThis.scaleHow = ScaleHow;\n globalThis.scaleWhen = ScaleWhen;\n globalThis.style = Style;\n globalThis.trans = Trans;\n globalThis.zoomtype = ZoomType;\n globalThis.ADBE = {\n Reader_Value_Asked: true,\n Viewer_Value_Asked: true\n };\n const aform = new AForm(doc, app, util, color);\n for (const name of Object.getOwnPropertyNames(AForm.prototype)) {\n if (name !== \"constructor\" && !name.startsWith(\"_\")) {\n globalThis[name] = aform[name].bind(aform);\n }\n }\n for (const [name, value] of Object.entries(GlobalConstants)) {\n Object.defineProperty(globalThis, name, {\n value,\n writable: false\n });\n }\n Object.defineProperties(globalThis, {\n ColorConvert: {\n value: color.convert.bind(color),\n writable: true\n },\n ColorEqual: {\n value: color.equal.bind(color),\n writable: true\n }\n });\n const properties = Object.create(null);\n for (const name of Object.getOwnPropertyNames(Doc.prototype)) {\n if (name === \"constructor\" || name.startsWith(\"_\")) {\n continue;\n }\n const descriptor = Object.getOwnPropertyDescriptor(Doc.prototype, name);\n if (descriptor.get) {\n properties[name] = {\n get: descriptor.get.bind(doc),\n set: descriptor.set.bind(doc)\n };\n } else {\n properties[name] = {\n value: Doc.prototype[name].bind(doc)\n };\n }\n }\n Object.defineProperties(globalThis, properties);\n const functions = {\n dispatchEvent: app._dispatchEvent.bind(app),\n timeoutCb: app._evalCallback.bind(app)\n };\n return (name, args) => {\n try {\n functions[name](args);\n } catch (error) {\n send(serializeError(error));\n }\n };\n}\n\n;// ./src/pdf.scripting.js\n\nconst pdfjsVersion = \"4.10.38\";\nconst pdfjsBuild = \"f9bea397f\";\nglobalThis.pdfjsScripting = {\n initSandbox: initSandbox\n};\n"]; + code.push("delete dump;"); + let success = false; + let buf = 0; + try { + const sandboxData = JSON.stringify(data); + code.push(`pdfjsScripting.initSandbox({ data: ${sandboxData} })`); + buf = this._module.stringToNewUTF8(code.join("\n")); + success = !!this._module.ccall("init", "number", ["number", "number"], [buf, this._alertOnError]); + } catch (error) { + console.error(error); + } finally { + if (buf) { + this._module.ccall("free", "number", ["number"], [buf]); + } + } + if (success) { + this.support.commFun = this._module.cwrap("commFun", null, ["string", "string"]); + } else { + this.nukeSandbox(); + throw new Error("Cannot start sandbox"); + } + } + dispatchEvent(event) { + this.support?.callSandboxFunction("dispatchEvent", event); + } + dumpMemoryUse() { + this._module?.ccall("dumpMemoryUse", null, []); + } + nukeSandbox() { + if (this._module !== null) { + this.support.destroy(); + this.support = null; + this._module.ccall("nukeSandbox", null, []); + this._module = null; + } + } + evalForTesting(code, key) { + throw new Error("Not implemented: evalForTesting"); + } +} +function QuickJSSandbox() { + return quickjs_eval().then(module => new Sandbox(window, module)); +} + +var __webpack_exports__QuickJSSandbox = __webpack_exports__.QuickJSSandbox; +export { __webpack_exports__QuickJSSandbox as QuickJSSandbox }; + +//# sourceMappingURL=pdf.sandbox.mjs.map \ No newline at end of file diff --git a/public/pdfjs/build/pdf.worker.mjs b/public/pdfjs/build/pdf.worker.mjs new file mode 100644 index 0000000..92eba68 --- /dev/null +++ b/public/pdfjs/build/pdf.worker.mjs @@ -0,0 +1,56979 @@ +/** + * @licstart The following is the entire license notice for the + * JavaScript code in this page + * + * Copyright 2024 Mozilla Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @licend The above is the entire license notice for the + * JavaScript code in this page + */ + +/******/ // The require scope +/******/ var __webpack_require__ = {}; +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = globalThis.pdfjsWorker = {}; + +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + WorkerMessageHandler: () => (/* reexport */ WorkerMessageHandler) +}); + +;// ./src/shared/util.js +const isNodeJS = typeof process === "object" && process + "" === "[object process]" && !process.versions.nw && !(process.versions.electron && process.type && process.type !== "browser"); +const IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0]; +const FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0]; +const MAX_IMAGE_SIZE_TO_CACHE = 10e6; +const LINE_FACTOR = 1.35; +const LINE_DESCENT_FACTOR = 0.35; +const BASELINE_FACTOR = LINE_DESCENT_FACTOR / LINE_FACTOR; +const RenderingIntentFlag = { + ANY: 0x01, + DISPLAY: 0x02, + PRINT: 0x04, + SAVE: 0x08, + ANNOTATIONS_FORMS: 0x10, + ANNOTATIONS_STORAGE: 0x20, + ANNOTATIONS_DISABLE: 0x40, + IS_EDITING: 0x80, + OPLIST: 0x100 +}; +const AnnotationMode = { + DISABLE: 0, + ENABLE: 1, + ENABLE_FORMS: 2, + ENABLE_STORAGE: 3 +}; +const AnnotationEditorPrefix = "pdfjs_internal_editor_"; +const AnnotationEditorType = { + DISABLE: -1, + NONE: 0, + FREETEXT: 3, + HIGHLIGHT: 9, + STAMP: 13, + INK: 15 +}; +const AnnotationEditorParamsType = { + RESIZE: 1, + CREATE: 2, + FREETEXT_SIZE: 11, + FREETEXT_COLOR: 12, + FREETEXT_OPACITY: 13, + INK_COLOR: 21, + INK_THICKNESS: 22, + INK_OPACITY: 23, + HIGHLIGHT_COLOR: 31, + HIGHLIGHT_DEFAULT_COLOR: 32, + HIGHLIGHT_THICKNESS: 33, + HIGHLIGHT_FREE: 34, + HIGHLIGHT_SHOW_ALL: 35, + DRAW_STEP: 41 +}; +const PermissionFlag = { + PRINT: 0x04, + MODIFY_CONTENTS: 0x08, + COPY: 0x10, + MODIFY_ANNOTATIONS: 0x20, + FILL_INTERACTIVE_FORMS: 0x100, + COPY_FOR_ACCESSIBILITY: 0x200, + ASSEMBLE: 0x400, + PRINT_HIGH_QUALITY: 0x800 +}; +const TextRenderingMode = { + FILL: 0, + STROKE: 1, + FILL_STROKE: 2, + INVISIBLE: 3, + FILL_ADD_TO_PATH: 4, + STROKE_ADD_TO_PATH: 5, + FILL_STROKE_ADD_TO_PATH: 6, + ADD_TO_PATH: 7, + FILL_STROKE_MASK: 3, + ADD_TO_PATH_FLAG: 4 +}; +const ImageKind = { + GRAYSCALE_1BPP: 1, + RGB_24BPP: 2, + RGBA_32BPP: 3 +}; +const AnnotationType = { + TEXT: 1, + LINK: 2, + FREETEXT: 3, + LINE: 4, + SQUARE: 5, + CIRCLE: 6, + POLYGON: 7, + POLYLINE: 8, + HIGHLIGHT: 9, + UNDERLINE: 10, + SQUIGGLY: 11, + STRIKEOUT: 12, + STAMP: 13, + CARET: 14, + INK: 15, + POPUP: 16, + FILEATTACHMENT: 17, + SOUND: 18, + MOVIE: 19, + WIDGET: 20, + SCREEN: 21, + PRINTERMARK: 22, + TRAPNET: 23, + WATERMARK: 24, + THREED: 25, + REDACT: 26 +}; +const AnnotationReplyType = { + GROUP: "Group", + REPLY: "R" +}; +const AnnotationFlag = { + INVISIBLE: 0x01, + HIDDEN: 0x02, + PRINT: 0x04, + NOZOOM: 0x08, + NOROTATE: 0x10, + NOVIEW: 0x20, + READONLY: 0x40, + LOCKED: 0x80, + TOGGLENOVIEW: 0x100, + LOCKEDCONTENTS: 0x200 +}; +const AnnotationFieldFlag = { + READONLY: 0x0000001, + REQUIRED: 0x0000002, + NOEXPORT: 0x0000004, + MULTILINE: 0x0001000, + PASSWORD: 0x0002000, + NOTOGGLETOOFF: 0x0004000, + RADIO: 0x0008000, + PUSHBUTTON: 0x0010000, + COMBO: 0x0020000, + EDIT: 0x0040000, + SORT: 0x0080000, + FILESELECT: 0x0100000, + MULTISELECT: 0x0200000, + DONOTSPELLCHECK: 0x0400000, + DONOTSCROLL: 0x0800000, + COMB: 0x1000000, + RICHTEXT: 0x2000000, + RADIOSINUNISON: 0x2000000, + COMMITONSELCHANGE: 0x4000000 +}; +const AnnotationBorderStyleType = { + SOLID: 1, + DASHED: 2, + BEVELED: 3, + INSET: 4, + UNDERLINE: 5 +}; +const AnnotationActionEventType = { + E: "Mouse Enter", + X: "Mouse Exit", + D: "Mouse Down", + U: "Mouse Up", + Fo: "Focus", + Bl: "Blur", + PO: "PageOpen", + PC: "PageClose", + PV: "PageVisible", + PI: "PageInvisible", + K: "Keystroke", + F: "Format", + V: "Validate", + C: "Calculate" +}; +const DocumentActionEventType = { + WC: "WillClose", + WS: "WillSave", + DS: "DidSave", + WP: "WillPrint", + DP: "DidPrint" +}; +const PageActionEventType = { + O: "PageOpen", + C: "PageClose" +}; +const VerbosityLevel = { + ERRORS: 0, + WARNINGS: 1, + INFOS: 5 +}; +const OPS = { + dependency: 1, + setLineWidth: 2, + setLineCap: 3, + setLineJoin: 4, + setMiterLimit: 5, + setDash: 6, + setRenderingIntent: 7, + setFlatness: 8, + setGState: 9, + save: 10, + restore: 11, + transform: 12, + moveTo: 13, + lineTo: 14, + curveTo: 15, + curveTo2: 16, + curveTo3: 17, + closePath: 18, + rectangle: 19, + stroke: 20, + closeStroke: 21, + fill: 22, + eoFill: 23, + fillStroke: 24, + eoFillStroke: 25, + closeFillStroke: 26, + closeEOFillStroke: 27, + endPath: 28, + clip: 29, + eoClip: 30, + beginText: 31, + endText: 32, + setCharSpacing: 33, + setWordSpacing: 34, + setHScale: 35, + setLeading: 36, + setFont: 37, + setTextRenderingMode: 38, + setTextRise: 39, + moveText: 40, + setLeadingMoveText: 41, + setTextMatrix: 42, + nextLine: 43, + showText: 44, + showSpacedText: 45, + nextLineShowText: 46, + nextLineSetSpacingShowText: 47, + setCharWidth: 48, + setCharWidthAndBounds: 49, + setStrokeColorSpace: 50, + setFillColorSpace: 51, + setStrokeColor: 52, + setStrokeColorN: 53, + setFillColor: 54, + setFillColorN: 55, + setStrokeGray: 56, + setFillGray: 57, + setStrokeRGBColor: 58, + setFillRGBColor: 59, + setStrokeCMYKColor: 60, + setFillCMYKColor: 61, + shadingFill: 62, + beginInlineImage: 63, + beginImageData: 64, + endInlineImage: 65, + paintXObject: 66, + markPoint: 67, + markPointProps: 68, + beginMarkedContent: 69, + beginMarkedContentProps: 70, + endMarkedContent: 71, + beginCompat: 72, + endCompat: 73, + paintFormXObjectBegin: 74, + paintFormXObjectEnd: 75, + beginGroup: 76, + endGroup: 77, + beginAnnotation: 80, + endAnnotation: 81, + paintImageMaskXObject: 83, + paintImageMaskXObjectGroup: 84, + paintImageXObject: 85, + paintInlineImageXObject: 86, + paintInlineImageXObjectGroup: 87, + paintImageXObjectRepeat: 88, + paintImageMaskXObjectRepeat: 89, + paintSolidColorImageMask: 90, + constructPath: 91, + setStrokeTransparent: 92, + setFillTransparent: 93 +}; +const PasswordResponses = { + NEED_PASSWORD: 1, + INCORRECT_PASSWORD: 2 +}; +let verbosity = VerbosityLevel.WARNINGS; +function setVerbosityLevel(level) { + if (Number.isInteger(level)) { + verbosity = level; + } +} +function getVerbosityLevel() { + return verbosity; +} +function info(msg) { + if (verbosity >= VerbosityLevel.INFOS) { + console.log(`Info: ${msg}`); + } +} +function warn(msg) { + if (verbosity >= VerbosityLevel.WARNINGS) { + console.log(`Warning: ${msg}`); + } +} +function unreachable(msg) { + throw new Error(msg); +} +function assert(cond, msg) { + if (!cond) { + unreachable(msg); + } +} +function _isValidProtocol(url) { + switch (url?.protocol) { + case "http:": + case "https:": + case "ftp:": + case "mailto:": + case "tel:": + return true; + default: + return false; + } +} +function createValidAbsoluteUrl(url, baseUrl = null, options = null) { + if (!url) { + return null; + } + try { + if (options && typeof url === "string") { + if (options.addDefaultProtocol && url.startsWith("www.")) { + const dots = url.match(/\./g); + if (dots?.length >= 2) { + url = `http://${url}`; + } + } + if (options.tryConvertEncoding) { + try { + url = stringToUTF8String(url); + } catch {} + } + } + const absoluteUrl = baseUrl ? new URL(url, baseUrl) : new URL(url); + if (_isValidProtocol(absoluteUrl)) { + return absoluteUrl; + } + } catch {} + return null; +} +function shadow(obj, prop, value, nonSerializable = false) { + Object.defineProperty(obj, prop, { + value, + enumerable: !nonSerializable, + configurable: true, + writable: false + }); + return value; +} +const BaseException = function BaseExceptionClosure() { + function BaseException(message, name) { + this.message = message; + this.name = name; + } + BaseException.prototype = new Error(); + BaseException.constructor = BaseException; + return BaseException; +}(); +class PasswordException extends BaseException { + constructor(msg, code) { + super(msg, "PasswordException"); + this.code = code; + } +} +class UnknownErrorException extends BaseException { + constructor(msg, details) { + super(msg, "UnknownErrorException"); + this.details = details; + } +} +class InvalidPDFException extends BaseException { + constructor(msg) { + super(msg, "InvalidPDFException"); + } +} +class MissingPDFException extends BaseException { + constructor(msg) { + super(msg, "MissingPDFException"); + } +} +class UnexpectedResponseException extends BaseException { + constructor(msg, status) { + super(msg, "UnexpectedResponseException"); + this.status = status; + } +} +class FormatError extends BaseException { + constructor(msg) { + super(msg, "FormatError"); + } +} +class AbortException extends BaseException { + constructor(msg) { + super(msg, "AbortException"); + } +} +function bytesToString(bytes) { + if (typeof bytes !== "object" || bytes?.length === undefined) { + unreachable("Invalid argument for bytesToString"); + } + const length = bytes.length; + const MAX_ARGUMENT_COUNT = 8192; + if (length < MAX_ARGUMENT_COUNT) { + return String.fromCharCode.apply(null, bytes); + } + const strBuf = []; + for (let i = 0; i < length; i += MAX_ARGUMENT_COUNT) { + const chunkEnd = Math.min(i + MAX_ARGUMENT_COUNT, length); + const chunk = bytes.subarray(i, chunkEnd); + strBuf.push(String.fromCharCode.apply(null, chunk)); + } + return strBuf.join(""); +} +function stringToBytes(str) { + if (typeof str !== "string") { + unreachable("Invalid argument for stringToBytes"); + } + const length = str.length; + const bytes = new Uint8Array(length); + for (let i = 0; i < length; ++i) { + bytes[i] = str.charCodeAt(i) & 0xff; + } + return bytes; +} +function string32(value) { + return String.fromCharCode(value >> 24 & 0xff, value >> 16 & 0xff, value >> 8 & 0xff, value & 0xff); +} +function objectSize(obj) { + return Object.keys(obj).length; +} +function objectFromMap(map) { + const obj = Object.create(null); + for (const [key, value] of map) { + obj[key] = value; + } + return obj; +} +function isLittleEndian() { + const buffer8 = new Uint8Array(4); + buffer8[0] = 1; + const view32 = new Uint32Array(buffer8.buffer, 0, 1); + return view32[0] === 1; +} +function isEvalSupported() { + try { + new Function(""); + return true; + } catch { + return false; + } +} +class FeatureTest { + static get isLittleEndian() { + return shadow(this, "isLittleEndian", isLittleEndian()); + } + static get isEvalSupported() { + return shadow(this, "isEvalSupported", isEvalSupported()); + } + static get isOffscreenCanvasSupported() { + return shadow(this, "isOffscreenCanvasSupported", typeof OffscreenCanvas !== "undefined"); + } + static get isImageDecoderSupported() { + return shadow(this, "isImageDecoderSupported", typeof ImageDecoder !== "undefined"); + } + static get platform() { + if (typeof navigator !== "undefined" && typeof navigator?.platform === "string") { + return shadow(this, "platform", { + isMac: navigator.platform.includes("Mac"), + isWindows: navigator.platform.includes("Win"), + isFirefox: typeof navigator?.userAgent === "string" && navigator.userAgent.includes("Firefox") + }); + } + return shadow(this, "platform", { + isMac: false, + isWindows: false, + isFirefox: false + }); + } + static get isCSSRoundSupported() { + return shadow(this, "isCSSRoundSupported", globalThis.CSS?.supports?.("width: round(1.5px, 1px)")); + } +} +const hexNumbers = Array.from(Array(256).keys(), n => n.toString(16).padStart(2, "0")); +class Util { + static makeHexColor(r, g, b) { + return `#${hexNumbers[r]}${hexNumbers[g]}${hexNumbers[b]}`; + } + static scaleMinMax(transform, minMax) { + let temp; + if (transform[0]) { + if (transform[0] < 0) { + temp = minMax[0]; + minMax[0] = minMax[2]; + minMax[2] = temp; + } + minMax[0] *= transform[0]; + minMax[2] *= transform[0]; + if (transform[3] < 0) { + temp = minMax[1]; + minMax[1] = minMax[3]; + minMax[3] = temp; + } + minMax[1] *= transform[3]; + minMax[3] *= transform[3]; + } else { + temp = minMax[0]; + minMax[0] = minMax[1]; + minMax[1] = temp; + temp = minMax[2]; + minMax[2] = minMax[3]; + minMax[3] = temp; + if (transform[1] < 0) { + temp = minMax[1]; + minMax[1] = minMax[3]; + minMax[3] = temp; + } + minMax[1] *= transform[1]; + minMax[3] *= transform[1]; + if (transform[2] < 0) { + temp = minMax[0]; + minMax[0] = minMax[2]; + minMax[2] = temp; + } + minMax[0] *= transform[2]; + minMax[2] *= transform[2]; + } + minMax[0] += transform[4]; + minMax[1] += transform[5]; + minMax[2] += transform[4]; + minMax[3] += transform[5]; + } + static transform(m1, m2) { + return [m1[0] * m2[0] + m1[2] * m2[1], m1[1] * m2[0] + m1[3] * m2[1], m1[0] * m2[2] + m1[2] * m2[3], m1[1] * m2[2] + m1[3] * m2[3], m1[0] * m2[4] + m1[2] * m2[5] + m1[4], m1[1] * m2[4] + m1[3] * m2[5] + m1[5]]; + } + static applyTransform(p, m) { + const xt = p[0] * m[0] + p[1] * m[2] + m[4]; + const yt = p[0] * m[1] + p[1] * m[3] + m[5]; + return [xt, yt]; + } + static applyInverseTransform(p, m) { + const d = m[0] * m[3] - m[1] * m[2]; + const xt = (p[0] * m[3] - p[1] * m[2] + m[2] * m[5] - m[4] * m[3]) / d; + const yt = (-p[0] * m[1] + p[1] * m[0] + m[4] * m[1] - m[5] * m[0]) / d; + return [xt, yt]; + } + static getAxialAlignedBoundingBox(r, m) { + const p1 = this.applyTransform(r, m); + const p2 = this.applyTransform(r.slice(2, 4), m); + const p3 = this.applyTransform([r[0], r[3]], m); + const p4 = this.applyTransform([r[2], r[1]], m); + return [Math.min(p1[0], p2[0], p3[0], p4[0]), Math.min(p1[1], p2[1], p3[1], p4[1]), Math.max(p1[0], p2[0], p3[0], p4[0]), Math.max(p1[1], p2[1], p3[1], p4[1])]; + } + static inverseTransform(m) { + const d = m[0] * m[3] - m[1] * m[2]; + return [m[3] / d, -m[1] / d, -m[2] / d, m[0] / d, (m[2] * m[5] - m[4] * m[3]) / d, (m[4] * m[1] - m[5] * m[0]) / d]; + } + static singularValueDecompose2dScale(m) { + const transpose = [m[0], m[2], m[1], m[3]]; + const a = m[0] * transpose[0] + m[1] * transpose[2]; + const b = m[0] * transpose[1] + m[1] * transpose[3]; + const c = m[2] * transpose[0] + m[3] * transpose[2]; + const d = m[2] * transpose[1] + m[3] * transpose[3]; + const first = (a + d) / 2; + const second = Math.sqrt((a + d) ** 2 - 4 * (a * d - c * b)) / 2; + const sx = first + second || 1; + const sy = first - second || 1; + return [Math.sqrt(sx), Math.sqrt(sy)]; + } + static normalizeRect(rect) { + const r = rect.slice(0); + if (rect[0] > rect[2]) { + r[0] = rect[2]; + r[2] = rect[0]; + } + if (rect[1] > rect[3]) { + r[1] = rect[3]; + r[3] = rect[1]; + } + return r; + } + static intersect(rect1, rect2) { + const xLow = Math.max(Math.min(rect1[0], rect1[2]), Math.min(rect2[0], rect2[2])); + const xHigh = Math.min(Math.max(rect1[0], rect1[2]), Math.max(rect2[0], rect2[2])); + if (xLow > xHigh) { + return null; + } + const yLow = Math.max(Math.min(rect1[1], rect1[3]), Math.min(rect2[1], rect2[3])); + const yHigh = Math.min(Math.max(rect1[1], rect1[3]), Math.max(rect2[1], rect2[3])); + if (yLow > yHigh) { + return null; + } + return [xLow, yLow, xHigh, yHigh]; + } + static #getExtremumOnCurve(x0, x1, x2, x3, y0, y1, y2, y3, t, minMax) { + if (t <= 0 || t >= 1) { + return; + } + const mt = 1 - t; + const tt = t * t; + const ttt = tt * t; + const x = mt * (mt * (mt * x0 + 3 * t * x1) + 3 * tt * x2) + ttt * x3; + const y = mt * (mt * (mt * y0 + 3 * t * y1) + 3 * tt * y2) + ttt * y3; + minMax[0] = Math.min(minMax[0], x); + minMax[1] = Math.min(minMax[1], y); + minMax[2] = Math.max(minMax[2], x); + minMax[3] = Math.max(minMax[3], y); + } + static #getExtremum(x0, x1, x2, x3, y0, y1, y2, y3, a, b, c, minMax) { + if (Math.abs(a) < 1e-12) { + if (Math.abs(b) >= 1e-12) { + this.#getExtremumOnCurve(x0, x1, x2, x3, y0, y1, y2, y3, -c / b, minMax); + } + return; + } + const delta = b ** 2 - 4 * c * a; + if (delta < 0) { + return; + } + const sqrtDelta = Math.sqrt(delta); + const a2 = 2 * a; + this.#getExtremumOnCurve(x0, x1, x2, x3, y0, y1, y2, y3, (-b + sqrtDelta) / a2, minMax); + this.#getExtremumOnCurve(x0, x1, x2, x3, y0, y1, y2, y3, (-b - sqrtDelta) / a2, minMax); + } + static bezierBoundingBox(x0, y0, x1, y1, x2, y2, x3, y3, minMax) { + if (minMax) { + minMax[0] = Math.min(minMax[0], x0, x3); + minMax[1] = Math.min(minMax[1], y0, y3); + minMax[2] = Math.max(minMax[2], x0, x3); + minMax[3] = Math.max(minMax[3], y0, y3); + } else { + minMax = [Math.min(x0, x3), Math.min(y0, y3), Math.max(x0, x3), Math.max(y0, y3)]; + } + this.#getExtremum(x0, x1, x2, x3, y0, y1, y2, y3, 3 * (-x0 + 3 * (x1 - x2) + x3), 6 * (x0 - 2 * x1 + x2), 3 * (x1 - x0), minMax); + this.#getExtremum(x0, x1, x2, x3, y0, y1, y2, y3, 3 * (-y0 + 3 * (y1 - y2) + y3), 6 * (y0 - 2 * y1 + y2), 3 * (y1 - y0), minMax); + return minMax; + } +} +const PDFStringTranslateTable = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2d8, 0x2c7, 0x2c6, 0x2d9, 0x2dd, 0x2db, 0x2da, 0x2dc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2022, 0x2020, 0x2021, 0x2026, 0x2014, 0x2013, 0x192, 0x2044, 0x2039, 0x203a, 0x2212, 0x2030, 0x201e, 0x201c, 0x201d, 0x2018, 0x2019, 0x201a, 0x2122, 0xfb01, 0xfb02, 0x141, 0x152, 0x160, 0x178, 0x17d, 0x131, 0x142, 0x153, 0x161, 0x17e, 0, 0x20ac]; +function stringToPDFString(str) { + if (str[0] >= "\xEF") { + let encoding; + if (str[0] === "\xFE" && str[1] === "\xFF") { + encoding = "utf-16be"; + if (str.length % 2 === 1) { + str = str.slice(0, -1); + } + } else if (str[0] === "\xFF" && str[1] === "\xFE") { + encoding = "utf-16le"; + if (str.length % 2 === 1) { + str = str.slice(0, -1); + } + } else if (str[0] === "\xEF" && str[1] === "\xBB" && str[2] === "\xBF") { + encoding = "utf-8"; + } + if (encoding) { + try { + const decoder = new TextDecoder(encoding, { + fatal: true + }); + const buffer = stringToBytes(str); + const decoded = decoder.decode(buffer); + if (!decoded.includes("\x1b")) { + return decoded; + } + return decoded.replaceAll(/\x1b[^\x1b]*(?:\x1b|$)/g, ""); + } catch (ex) { + warn(`stringToPDFString: "${ex}".`); + } + } + } + const strBuf = []; + for (let i = 0, ii = str.length; i < ii; i++) { + const charCode = str.charCodeAt(i); + if (charCode === 0x1b) { + while (++i < ii && str.charCodeAt(i) !== 0x1b) {} + continue; + } + const code = PDFStringTranslateTable[charCode]; + strBuf.push(code ? String.fromCharCode(code) : str.charAt(i)); + } + return strBuf.join(""); +} +function stringToUTF8String(str) { + return decodeURIComponent(escape(str)); +} +function utf8StringToString(str) { + return unescape(encodeURIComponent(str)); +} +function isArrayEqual(arr1, arr2) { + if (arr1.length !== arr2.length) { + return false; + } + for (let i = 0, ii = arr1.length; i < ii; i++) { + if (arr1[i] !== arr2[i]) { + return false; + } + } + return true; +} +function getModificationDate(date = new Date()) { + const buffer = [date.getUTCFullYear().toString(), (date.getUTCMonth() + 1).toString().padStart(2, "0"), date.getUTCDate().toString().padStart(2, "0"), date.getUTCHours().toString().padStart(2, "0"), date.getUTCMinutes().toString().padStart(2, "0"), date.getUTCSeconds().toString().padStart(2, "0")]; + return buffer.join(""); +} +let NormalizeRegex = null; +let NormalizationMap = null; +function normalizeUnicode(str) { + if (!NormalizeRegex) { + NormalizeRegex = /([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu; + NormalizationMap = new Map([["ſt", "ſt"]]); + } + return str.replaceAll(NormalizeRegex, (_, p1, p2) => p1 ? p1.normalize("NFKC") : NormalizationMap.get(p2)); +} +function getUuid() { + if (typeof crypto.randomUUID === "function") { + return crypto.randomUUID(); + } + const buf = new Uint8Array(32); + crypto.getRandomValues(buf); + return bytesToString(buf); +} +const AnnotationPrefix = "pdfjs_internal_id_"; +function toHexUtil(arr) { + if (Uint8Array.prototype.toHex) { + return arr.toHex(); + } + return Array.from(arr, num => hexNumbers[num]).join(""); +} +function toBase64Util(arr) { + if (Uint8Array.prototype.toBase64) { + return arr.toBase64(); + } + return btoa(bytesToString(arr)); +} +function fromBase64Util(str) { + if (Uint8Array.fromBase64) { + return Uint8Array.fromBase64(str); + } + return stringToBytes(atob(str)); +} +if (typeof Promise.try !== "function") { + Promise.try = function (fn, ...args) { + return new Promise(resolve => { + resolve(fn(...args)); + }); + }; +} + +;// ./src/core/primitives.js + +const CIRCULAR_REF = Symbol("CIRCULAR_REF"); +const EOF = Symbol("EOF"); +let CmdCache = Object.create(null); +let NameCache = Object.create(null); +let RefCache = Object.create(null); +function clearPrimitiveCaches() { + CmdCache = Object.create(null); + NameCache = Object.create(null); + RefCache = Object.create(null); +} +class Name { + constructor(name) { + this.name = name; + } + static get(name) { + return NameCache[name] ||= new Name(name); + } +} +class Cmd { + constructor(cmd) { + this.cmd = cmd; + } + static get(cmd) { + return CmdCache[cmd] ||= new Cmd(cmd); + } +} +const nonSerializable = function nonSerializableClosure() { + return nonSerializable; +}; +class Dict { + constructor(xref = null) { + this._map = new Map(); + this.xref = xref; + this.objId = null; + this.suppressEncryption = false; + this.__nonSerializable__ = nonSerializable; + } + assignXref(newXref) { + this.xref = newXref; + } + get size() { + return this._map.size; + } + get(key1, key2, key3) { + let value = this._map.get(key1); + if (value === undefined && key2 !== undefined) { + value = this._map.get(key2); + if (value === undefined && key3 !== undefined) { + value = this._map.get(key3); + } + } + if (value instanceof Ref && this.xref) { + return this.xref.fetch(value, this.suppressEncryption); + } + return value; + } + async getAsync(key1, key2, key3) { + let value = this._map.get(key1); + if (value === undefined && key2 !== undefined) { + value = this._map.get(key2); + if (value === undefined && key3 !== undefined) { + value = this._map.get(key3); + } + } + if (value instanceof Ref && this.xref) { + return this.xref.fetchAsync(value, this.suppressEncryption); + } + return value; + } + getArray(key1, key2, key3) { + let value = this._map.get(key1); + if (value === undefined && key2 !== undefined) { + value = this._map.get(key2); + if (value === undefined && key3 !== undefined) { + value = this._map.get(key3); + } + } + if (value instanceof Ref && this.xref) { + value = this.xref.fetch(value, this.suppressEncryption); + } + if (Array.isArray(value)) { + value = value.slice(); + for (let i = 0, ii = value.length; i < ii; i++) { + if (value[i] instanceof Ref && this.xref) { + value[i] = this.xref.fetch(value[i], this.suppressEncryption); + } + } + } + return value; + } + getRaw(key) { + return this._map.get(key); + } + getKeys() { + return [...this._map.keys()]; + } + getRawValues() { + return [...this._map.values()]; + } + set(key, value) { + this._map.set(key, value); + } + has(key) { + return this._map.has(key); + } + *[Symbol.iterator]() { + for (const [key, value] of this._map) { + yield [key, value instanceof Ref && this.xref ? this.xref.fetch(value, this.suppressEncryption) : value]; + } + } + static get empty() { + const emptyDict = new Dict(null); + emptyDict.set = (key, value) => { + unreachable("Should not call `set` on the empty dictionary."); + }; + return shadow(this, "empty", emptyDict); + } + static merge({ + xref, + dictArray, + mergeSubDicts = false + }) { + const mergedDict = new Dict(xref), + properties = new Map(); + for (const dict of dictArray) { + if (!(dict instanceof Dict)) { + continue; + } + for (const [key, value] of dict._map) { + let property = properties.get(key); + if (property === undefined) { + property = []; + properties.set(key, property); + } else if (!mergeSubDicts || !(value instanceof Dict)) { + continue; + } + property.push(value); + } + } + for (const [name, values] of properties) { + if (values.length === 1 || !(values[0] instanceof Dict)) { + mergedDict._map.set(name, values[0]); + continue; + } + const subDict = new Dict(xref); + for (const dict of values) { + for (const [key, value] of dict._map) { + if (!subDict._map.has(key)) { + subDict._map.set(key, value); + } + } + } + if (subDict.size > 0) { + mergedDict._map.set(name, subDict); + } + } + properties.clear(); + return mergedDict.size > 0 ? mergedDict : Dict.empty; + } + clone() { + const dict = new Dict(this.xref); + for (const key of this.getKeys()) { + dict.set(key, this.getRaw(key)); + } + return dict; + } + delete(key) { + delete this._map[key]; + } +} +class Ref { + constructor(num, gen) { + this.num = num; + this.gen = gen; + } + toString() { + if (this.gen === 0) { + return `${this.num}R`; + } + return `${this.num}R${this.gen}`; + } + static fromString(str) { + const ref = RefCache[str]; + if (ref) { + return ref; + } + const m = /^(\d+)R(\d*)$/.exec(str); + if (!m || m[1] === "0") { + return null; + } + return RefCache[str] = new Ref(parseInt(m[1]), !m[2] ? 0 : parseInt(m[2])); + } + static get(num, gen) { + const key = gen === 0 ? `${num}R` : `${num}R${gen}`; + return RefCache[key] ||= new Ref(num, gen); + } +} +class RefSet { + constructor(parent = null) { + this._set = new Set(parent?._set); + } + has(ref) { + return this._set.has(ref.toString()); + } + put(ref) { + this._set.add(ref.toString()); + } + remove(ref) { + this._set.delete(ref.toString()); + } + [Symbol.iterator]() { + return this._set.values(); + } + clear() { + this._set.clear(); + } +} +class RefSetCache { + constructor() { + this._map = new Map(); + } + get size() { + return this._map.size; + } + get(ref) { + return this._map.get(ref.toString()); + } + has(ref) { + return this._map.has(ref.toString()); + } + put(ref, obj) { + this._map.set(ref.toString(), obj); + } + putAlias(ref, aliasRef) { + this._map.set(ref.toString(), this.get(aliasRef)); + } + [Symbol.iterator]() { + return this._map.values(); + } + clear() { + this._map.clear(); + } + *values() { + yield* this._map.values(); + } + *items() { + for (const [ref, value] of this._map) { + yield [Ref.fromString(ref), value]; + } + } +} +function isName(v, name) { + return v instanceof Name && (name === undefined || v.name === name); +} +function isCmd(v, cmd) { + return v instanceof Cmd && (cmd === undefined || v.cmd === cmd); +} +function isDict(v, type) { + return v instanceof Dict && (type === undefined || isName(v.get("Type"), type)); +} +function isRefsEqual(v1, v2) { + return v1.num === v2.num && v1.gen === v2.gen; +} + +;// ./src/core/base_stream.js + +class BaseStream { + get length() { + unreachable("Abstract getter `length` accessed"); + } + get isEmpty() { + unreachable("Abstract getter `isEmpty` accessed"); + } + get isDataLoaded() { + return shadow(this, "isDataLoaded", true); + } + getByte() { + unreachable("Abstract method `getByte` called"); + } + getBytes(length) { + unreachable("Abstract method `getBytes` called"); + } + async getImageData(length, decoderOptions) { + return this.getBytes(length, decoderOptions); + } + async asyncGetBytes() { + unreachable("Abstract method `asyncGetBytes` called"); + } + get isAsync() { + return false; + } + get canAsyncDecodeImageFromBuffer() { + return false; + } + async getTransferableImage() { + return null; + } + peekByte() { + const peekedByte = this.getByte(); + if (peekedByte !== -1) { + this.pos--; + } + return peekedByte; + } + peekBytes(length) { + const bytes = this.getBytes(length); + this.pos -= bytes.length; + return bytes; + } + getUint16() { + const b0 = this.getByte(); + const b1 = this.getByte(); + if (b0 === -1 || b1 === -1) { + return -1; + } + return (b0 << 8) + b1; + } + getInt32() { + const b0 = this.getByte(); + const b1 = this.getByte(); + const b2 = this.getByte(); + const b3 = this.getByte(); + return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3; + } + getByteRange(begin, end) { + unreachable("Abstract method `getByteRange` called"); + } + getString(length) { + return bytesToString(this.getBytes(length)); + } + skip(n) { + this.pos += n || 1; + } + reset() { + unreachable("Abstract method `reset` called"); + } + moveStart() { + unreachable("Abstract method `moveStart` called"); + } + makeSubStream(start, length, dict = null) { + unreachable("Abstract method `makeSubStream` called"); + } + getBaseStreams() { + return null; + } +} + +;// ./src/core/core_utils.js + + + +const PDF_VERSION_REGEXP = /^[1-9]\.\d$/; +const MAX_INT_32 = 2 ** 31 - 1; +const MIN_INT_32 = -(2 ** 31); +function getLookupTableFactory(initializer) { + let lookup; + return function () { + if (initializer) { + lookup = Object.create(null); + initializer(lookup); + initializer = null; + } + return lookup; + }; +} +class MissingDataException extends BaseException { + constructor(begin, end) { + super(`Missing data [${begin}, ${end})`, "MissingDataException"); + this.begin = begin; + this.end = end; + } +} +class ParserEOFException extends BaseException { + constructor(msg) { + super(msg, "ParserEOFException"); + } +} +class XRefEntryException extends BaseException { + constructor(msg) { + super(msg, "XRefEntryException"); + } +} +class XRefParseException extends BaseException { + constructor(msg) { + super(msg, "XRefParseException"); + } +} +function arrayBuffersToBytes(arr) { + const length = arr.length; + if (length === 0) { + return new Uint8Array(0); + } + if (length === 1) { + return new Uint8Array(arr[0]); + } + let dataLength = 0; + for (let i = 0; i < length; i++) { + dataLength += arr[i].byteLength; + } + const data = new Uint8Array(dataLength); + let pos = 0; + for (let i = 0; i < length; i++) { + const item = new Uint8Array(arr[i]); + data.set(item, pos); + pos += item.byteLength; + } + return data; +} +function getInheritableProperty({ + dict, + key, + getArray = false, + stopWhenFound = true +}) { + let values; + const visited = new RefSet(); + while (dict instanceof Dict && !(dict.objId && visited.has(dict.objId))) { + if (dict.objId) { + visited.put(dict.objId); + } + const value = getArray ? dict.getArray(key) : dict.get(key); + if (value !== undefined) { + if (stopWhenFound) { + return value; + } + (values ||= []).push(value); + } + dict = dict.get("Parent"); + } + return values; +} +function getParentToUpdate(dict, ref, xref) { + const visited = new RefSet(); + const firstDict = dict; + const result = { + dict: null, + ref: null + }; + while (dict instanceof Dict && !visited.has(ref)) { + visited.put(ref); + if (dict.has("T")) { + break; + } + ref = dict.getRaw("Parent"); + if (!(ref instanceof Ref)) { + return result; + } + dict = xref.fetch(ref); + } + if (dict instanceof Dict && dict !== firstDict) { + result.dict = dict; + result.ref = ref; + } + return result; +} +const ROMAN_NUMBER_MAP = ["", "C", "CC", "CCC", "CD", "D", "DC", "DCC", "DCCC", "CM", "", "X", "XX", "XXX", "XL", "L", "LX", "LXX", "LXXX", "XC", "", "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX"]; +function toRomanNumerals(number, lowerCase = false) { + assert(Number.isInteger(number) && number > 0, "The number should be a positive integer."); + const roman = "M".repeat(number / 1000 | 0) + ROMAN_NUMBER_MAP[number % 1000 / 100 | 0] + ROMAN_NUMBER_MAP[10 + (number % 100 / 10 | 0)] + ROMAN_NUMBER_MAP[20 + number % 10]; + return lowerCase ? roman.toLowerCase() : roman; +} +function log2(x) { + return x > 0 ? Math.ceil(Math.log2(x)) : 0; +} +function readInt8(data, offset) { + return data[offset] << 24 >> 24; +} +function readUint16(data, offset) { + return data[offset] << 8 | data[offset + 1]; +} +function readUint32(data, offset) { + return (data[offset] << 24 | data[offset + 1] << 16 | data[offset + 2] << 8 | data[offset + 3]) >>> 0; +} +function isWhiteSpace(ch) { + return ch === 0x20 || ch === 0x09 || ch === 0x0d || ch === 0x0a; +} +function isBooleanArray(arr, len) { + return Array.isArray(arr) && (len === null || arr.length === len) && arr.every(x => typeof x === "boolean"); +} +function isNumberArray(arr, len) { + if (Array.isArray(arr)) { + return (len === null || arr.length === len) && arr.every(x => typeof x === "number"); + } + return ArrayBuffer.isView(arr) && (arr.length === 0 || typeof arr[0] === "number") && (len === null || arr.length === len); +} +function lookupMatrix(arr, fallback) { + return isNumberArray(arr, 6) ? arr : fallback; +} +function lookupRect(arr, fallback) { + return isNumberArray(arr, 4) ? arr : fallback; +} +function lookupNormalRect(arr, fallback) { + return isNumberArray(arr, 4) ? Util.normalizeRect(arr) : fallback; +} +function parseXFAPath(path) { + const positionPattern = /(.+)\[(\d+)\]$/; + return path.split(".").map(component => { + const m = component.match(positionPattern); + if (m) { + return { + name: m[1], + pos: parseInt(m[2], 10) + }; + } + return { + name: component, + pos: 0 + }; + }); +} +function escapePDFName(str) { + const buffer = []; + let start = 0; + for (let i = 0, ii = str.length; i < ii; i++) { + const char = str.charCodeAt(i); + if (char < 0x21 || char > 0x7e || char === 0x23 || char === 0x28 || char === 0x29 || char === 0x3c || char === 0x3e || char === 0x5b || char === 0x5d || char === 0x7b || char === 0x7d || char === 0x2f || char === 0x25) { + if (start < i) { + buffer.push(str.substring(start, i)); + } + buffer.push(`#${char.toString(16)}`); + start = i + 1; + } + } + if (buffer.length === 0) { + return str; + } + if (start < str.length) { + buffer.push(str.substring(start, str.length)); + } + return buffer.join(""); +} +function escapeString(str) { + return str.replaceAll(/([()\\\n\r])/g, match => { + if (match === "\n") { + return "\\n"; + } else if (match === "\r") { + return "\\r"; + } + return `\\${match}`; + }); +} +function _collectJS(entry, xref, list, parents) { + if (!entry) { + return; + } + let parent = null; + if (entry instanceof Ref) { + if (parents.has(entry)) { + return; + } + parent = entry; + parents.put(parent); + entry = xref.fetch(entry); + } + if (Array.isArray(entry)) { + for (const element of entry) { + _collectJS(element, xref, list, parents); + } + } else if (entry instanceof Dict) { + if (isName(entry.get("S"), "JavaScript")) { + const js = entry.get("JS"); + let code; + if (js instanceof BaseStream) { + code = js.getString(); + } else if (typeof js === "string") { + code = js; + } + code &&= stringToPDFString(code).replaceAll("\x00", ""); + if (code) { + list.push(code); + } + } + _collectJS(entry.getRaw("Next"), xref, list, parents); + } + if (parent) { + parents.remove(parent); + } +} +function collectActions(xref, dict, eventType) { + const actions = Object.create(null); + const additionalActionsDicts = getInheritableProperty({ + dict, + key: "AA", + stopWhenFound: false + }); + if (additionalActionsDicts) { + for (let i = additionalActionsDicts.length - 1; i >= 0; i--) { + const additionalActions = additionalActionsDicts[i]; + if (!(additionalActions instanceof Dict)) { + continue; + } + for (const key of additionalActions.getKeys()) { + const action = eventType[key]; + if (!action) { + continue; + } + const actionDict = additionalActions.getRaw(key); + const parents = new RefSet(); + const list = []; + _collectJS(actionDict, xref, list, parents); + if (list.length > 0) { + actions[action] = list; + } + } + } + } + if (dict.has("A")) { + const actionDict = dict.get("A"); + const parents = new RefSet(); + const list = []; + _collectJS(actionDict, xref, list, parents); + if (list.length > 0) { + actions.Action = list; + } + } + return objectSize(actions) > 0 ? actions : null; +} +const XMLEntities = { + 0x3c: "<", + 0x3e: ">", + 0x26: "&", + 0x22: """, + 0x27: "'" +}; +function* codePointIter(str) { + for (let i = 0, ii = str.length; i < ii; i++) { + const char = str.codePointAt(i); + if (char > 0xd7ff && (char < 0xe000 || char > 0xfffd)) { + i++; + } + yield char; + } +} +function encodeToXmlString(str) { + const buffer = []; + let start = 0; + for (let i = 0, ii = str.length; i < ii; i++) { + const char = str.codePointAt(i); + if (0x20 <= char && char <= 0x7e) { + const entity = XMLEntities[char]; + if (entity) { + if (start < i) { + buffer.push(str.substring(start, i)); + } + buffer.push(entity); + start = i + 1; + } + } else { + if (start < i) { + buffer.push(str.substring(start, i)); + } + buffer.push(`&#x${char.toString(16).toUpperCase()};`); + if (char > 0xd7ff && (char < 0xe000 || char > 0xfffd)) { + i++; + } + start = i + 1; + } + } + if (buffer.length === 0) { + return str; + } + if (start < str.length) { + buffer.push(str.substring(start, str.length)); + } + return buffer.join(""); +} +function validateFontName(fontFamily, mustWarn = false) { + const m = /^("|').*("|')$/.exec(fontFamily); + if (m && m[1] === m[2]) { + const re = new RegExp(`[^\\\\]${m[1]}`); + if (re.test(fontFamily.slice(1, -1))) { + if (mustWarn) { + warn(`FontFamily contains unescaped ${m[1]}: ${fontFamily}.`); + } + return false; + } + } else { + for (const ident of fontFamily.split(/[ \t]+/)) { + if (/^(\d|(-(\d|-)))/.test(ident) || !/^[\w-\\]+$/.test(ident)) { + if (mustWarn) { + warn(`FontFamily contains invalid : ${fontFamily}.`); + } + return false; + } + } + } + return true; +} +function validateCSSFont(cssFontInfo) { + const DEFAULT_CSS_FONT_OBLIQUE = "14"; + const DEFAULT_CSS_FONT_WEIGHT = "400"; + const CSS_FONT_WEIGHT_VALUES = new Set(["100", "200", "300", "400", "500", "600", "700", "800", "900", "1000", "normal", "bold", "bolder", "lighter"]); + const { + fontFamily, + fontWeight, + italicAngle + } = cssFontInfo; + if (!validateFontName(fontFamily, true)) { + return false; + } + const weight = fontWeight ? fontWeight.toString() : ""; + cssFontInfo.fontWeight = CSS_FONT_WEIGHT_VALUES.has(weight) ? weight : DEFAULT_CSS_FONT_WEIGHT; + const angle = parseFloat(italicAngle); + cssFontInfo.italicAngle = isNaN(angle) || angle < -90 || angle > 90 ? DEFAULT_CSS_FONT_OBLIQUE : italicAngle.toString(); + return true; +} +function recoverJsURL(str) { + const URL_OPEN_METHODS = ["app.launchURL", "window.open", "xfa.host.gotoURL"]; + const regex = new RegExp("^\\s*(" + URL_OPEN_METHODS.join("|").replaceAll(".", "\\.") + ")\\((?:'|\")([^'\"]*)(?:'|\")(?:,\\s*(\\w+)\\)|\\))", "i"); + const jsUrl = regex.exec(str); + if (jsUrl?.[2]) { + return { + url: jsUrl[2], + newWindow: jsUrl[1] === "app.launchURL" && jsUrl[3] === "true" + }; + } + return null; +} +function numberToString(value) { + if (Number.isInteger(value)) { + return value.toString(); + } + const roundedValue = Math.round(value * 100); + if (roundedValue % 100 === 0) { + return (roundedValue / 100).toString(); + } + if (roundedValue % 10 === 0) { + return value.toFixed(1); + } + return value.toFixed(2); +} +function getNewAnnotationsMap(annotationStorage) { + if (!annotationStorage) { + return null; + } + const newAnnotationsByPage = new Map(); + for (const [key, value] of annotationStorage) { + if (!key.startsWith(AnnotationEditorPrefix)) { + continue; + } + let annotations = newAnnotationsByPage.get(value.pageIndex); + if (!annotations) { + annotations = []; + newAnnotationsByPage.set(value.pageIndex, annotations); + } + annotations.push(value); + } + return newAnnotationsByPage.size > 0 ? newAnnotationsByPage : null; +} +function stringToAsciiOrUTF16BE(str) { + return isAscii(str) ? str : stringToUTF16String(str, true); +} +function isAscii(str) { + return /^[\x00-\x7F]*$/.test(str); +} +function stringToUTF16HexString(str) { + const buf = []; + for (let i = 0, ii = str.length; i < ii; i++) { + const char = str.charCodeAt(i); + buf.push(hexNumbers[char >> 8 & 0xff], hexNumbers[char & 0xff]); + } + return buf.join(""); +} +function stringToUTF16String(str, bigEndian = false) { + const buf = []; + if (bigEndian) { + buf.push("\xFE\xFF"); + } + for (let i = 0, ii = str.length; i < ii; i++) { + const char = str.charCodeAt(i); + buf.push(String.fromCharCode(char >> 8 & 0xff), String.fromCharCode(char & 0xff)); + } + return buf.join(""); +} +function getRotationMatrix(rotation, width, height) { + switch (rotation) { + case 90: + return [0, 1, -1, 0, width, 0]; + case 180: + return [-1, 0, 0, -1, width, height]; + case 270: + return [0, -1, 1, 0, 0, height]; + default: + throw new Error("Invalid rotation"); + } +} +function getSizeInBytes(x) { + return Math.ceil(Math.ceil(Math.log2(1 + x)) / 8); +} + +;// ./src/core/stream.js + + +class Stream extends BaseStream { + constructor(arrayBuffer, start, length, dict) { + super(); + this.bytes = arrayBuffer instanceof Uint8Array ? arrayBuffer : new Uint8Array(arrayBuffer); + this.start = start || 0; + this.pos = this.start; + this.end = start + length || this.bytes.length; + this.dict = dict; + } + get length() { + return this.end - this.start; + } + get isEmpty() { + return this.length === 0; + } + getByte() { + if (this.pos >= this.end) { + return -1; + } + return this.bytes[this.pos++]; + } + getBytes(length) { + const bytes = this.bytes; + const pos = this.pos; + const strEnd = this.end; + if (!length) { + return bytes.subarray(pos, strEnd); + } + let end = pos + length; + if (end > strEnd) { + end = strEnd; + } + this.pos = end; + return bytes.subarray(pos, end); + } + getByteRange(begin, end) { + if (begin < 0) { + begin = 0; + } + if (end > this.end) { + end = this.end; + } + return this.bytes.subarray(begin, end); + } + reset() { + this.pos = this.start; + } + moveStart() { + this.start = this.pos; + } + makeSubStream(start, length, dict = null) { + return new Stream(this.bytes.buffer, start, length, dict); + } +} +class StringStream extends Stream { + constructor(str) { + super(stringToBytes(str)); + } +} +class NullStream extends Stream { + constructor() { + super(new Uint8Array(0)); + } +} + +;// ./src/core/chunked_stream.js + + + +class ChunkedStream extends Stream { + constructor(length, chunkSize, manager) { + super(new Uint8Array(length), 0, length, null); + this.chunkSize = chunkSize; + this._loadedChunks = new Set(); + this.numChunks = Math.ceil(length / chunkSize); + this.manager = manager; + this.progressiveDataLength = 0; + this.lastSuccessfulEnsureByteChunk = -1; + } + getMissingChunks() { + const chunks = []; + for (let chunk = 0, n = this.numChunks; chunk < n; ++chunk) { + if (!this._loadedChunks.has(chunk)) { + chunks.push(chunk); + } + } + return chunks; + } + get numChunksLoaded() { + return this._loadedChunks.size; + } + get isDataLoaded() { + return this.numChunksLoaded === this.numChunks; + } + onReceiveData(begin, chunk) { + const chunkSize = this.chunkSize; + if (begin % chunkSize !== 0) { + throw new Error(`Bad begin offset: ${begin}`); + } + const end = begin + chunk.byteLength; + if (end % chunkSize !== 0 && end !== this.bytes.length) { + throw new Error(`Bad end offset: ${end}`); + } + this.bytes.set(new Uint8Array(chunk), begin); + const beginChunk = Math.floor(begin / chunkSize); + const endChunk = Math.floor((end - 1) / chunkSize) + 1; + for (let curChunk = beginChunk; curChunk < endChunk; ++curChunk) { + this._loadedChunks.add(curChunk); + } + } + onReceiveProgressiveData(data) { + let position = this.progressiveDataLength; + const beginChunk = Math.floor(position / this.chunkSize); + this.bytes.set(new Uint8Array(data), position); + position += data.byteLength; + this.progressiveDataLength = position; + const endChunk = position >= this.end ? this.numChunks : Math.floor(position / this.chunkSize); + for (let curChunk = beginChunk; curChunk < endChunk; ++curChunk) { + this._loadedChunks.add(curChunk); + } + } + ensureByte(pos) { + if (pos < this.progressiveDataLength) { + return; + } + const chunk = Math.floor(pos / this.chunkSize); + if (chunk > this.numChunks) { + return; + } + if (chunk === this.lastSuccessfulEnsureByteChunk) { + return; + } + if (!this._loadedChunks.has(chunk)) { + throw new MissingDataException(pos, pos + 1); + } + this.lastSuccessfulEnsureByteChunk = chunk; + } + ensureRange(begin, end) { + if (begin >= end) { + return; + } + if (end <= this.progressiveDataLength) { + return; + } + const beginChunk = Math.floor(begin / this.chunkSize); + if (beginChunk > this.numChunks) { + return; + } + const endChunk = Math.min(Math.floor((end - 1) / this.chunkSize) + 1, this.numChunks); + for (let chunk = beginChunk; chunk < endChunk; ++chunk) { + if (!this._loadedChunks.has(chunk)) { + throw new MissingDataException(begin, end); + } + } + } + nextEmptyChunk(beginChunk) { + const numChunks = this.numChunks; + for (let i = 0; i < numChunks; ++i) { + const chunk = (beginChunk + i) % numChunks; + if (!this._loadedChunks.has(chunk)) { + return chunk; + } + } + return null; + } + hasChunk(chunk) { + return this._loadedChunks.has(chunk); + } + getByte() { + const pos = this.pos; + if (pos >= this.end) { + return -1; + } + if (pos >= this.progressiveDataLength) { + this.ensureByte(pos); + } + return this.bytes[this.pos++]; + } + getBytes(length) { + const bytes = this.bytes; + const pos = this.pos; + const strEnd = this.end; + if (!length) { + if (strEnd > this.progressiveDataLength) { + this.ensureRange(pos, strEnd); + } + return bytes.subarray(pos, strEnd); + } + let end = pos + length; + if (end > strEnd) { + end = strEnd; + } + if (end > this.progressiveDataLength) { + this.ensureRange(pos, end); + } + this.pos = end; + return bytes.subarray(pos, end); + } + getByteRange(begin, end) { + if (begin < 0) { + begin = 0; + } + if (end > this.end) { + end = this.end; + } + if (end > this.progressiveDataLength) { + this.ensureRange(begin, end); + } + return this.bytes.subarray(begin, end); + } + makeSubStream(start, length, dict = null) { + if (length) { + if (start + length > this.progressiveDataLength) { + this.ensureRange(start, start + length); + } + } else if (start >= this.progressiveDataLength) { + this.ensureByte(start); + } + function ChunkedStreamSubstream() {} + ChunkedStreamSubstream.prototype = Object.create(this); + ChunkedStreamSubstream.prototype.getMissingChunks = function () { + const chunkSize = this.chunkSize; + const beginChunk = Math.floor(this.start / chunkSize); + const endChunk = Math.floor((this.end - 1) / chunkSize) + 1; + const missingChunks = []; + for (let chunk = beginChunk; chunk < endChunk; ++chunk) { + if (!this._loadedChunks.has(chunk)) { + missingChunks.push(chunk); + } + } + return missingChunks; + }; + Object.defineProperty(ChunkedStreamSubstream.prototype, "isDataLoaded", { + get() { + if (this.numChunksLoaded === this.numChunks) { + return true; + } + return this.getMissingChunks().length === 0; + }, + configurable: true + }); + const subStream = new ChunkedStreamSubstream(); + subStream.pos = subStream.start = start; + subStream.end = start + length || this.end; + subStream.dict = dict; + return subStream; + } + getBaseStreams() { + return [this]; + } +} +class ChunkedStreamManager { + constructor(pdfNetworkStream, args) { + this.length = args.length; + this.chunkSize = args.rangeChunkSize; + this.stream = new ChunkedStream(this.length, this.chunkSize, this); + this.pdfNetworkStream = pdfNetworkStream; + this.disableAutoFetch = args.disableAutoFetch; + this.msgHandler = args.msgHandler; + this.currRequestId = 0; + this._chunksNeededByRequest = new Map(); + this._requestsByChunk = new Map(); + this._promisesByRequest = new Map(); + this.progressiveDataLength = 0; + this.aborted = false; + this._loadedStreamCapability = Promise.withResolvers(); + } + sendRequest(begin, end) { + const rangeReader = this.pdfNetworkStream.getRangeReader(begin, end); + if (!rangeReader.isStreamingSupported) { + rangeReader.onProgress = this.onProgress.bind(this); + } + let chunks = [], + loaded = 0; + return new Promise((resolve, reject) => { + const readChunk = ({ + value, + done + }) => { + try { + if (done) { + const chunkData = arrayBuffersToBytes(chunks); + chunks = null; + resolve(chunkData); + return; + } + loaded += value.byteLength; + if (rangeReader.isStreamingSupported) { + this.onProgress({ + loaded + }); + } + chunks.push(value); + rangeReader.read().then(readChunk, reject); + } catch (e) { + reject(e); + } + }; + rangeReader.read().then(readChunk, reject); + }).then(data => { + if (this.aborted) { + return; + } + this.onReceiveData({ + chunk: data, + begin + }); + }); + } + requestAllChunks(noFetch = false) { + if (!noFetch) { + const missingChunks = this.stream.getMissingChunks(); + this._requestChunks(missingChunks); + } + return this._loadedStreamCapability.promise; + } + _requestChunks(chunks) { + const requestId = this.currRequestId++; + const chunksNeeded = new Set(); + this._chunksNeededByRequest.set(requestId, chunksNeeded); + for (const chunk of chunks) { + if (!this.stream.hasChunk(chunk)) { + chunksNeeded.add(chunk); + } + } + if (chunksNeeded.size === 0) { + return Promise.resolve(); + } + const capability = Promise.withResolvers(); + this._promisesByRequest.set(requestId, capability); + const chunksToRequest = []; + for (const chunk of chunksNeeded) { + let requestIds = this._requestsByChunk.get(chunk); + if (!requestIds) { + requestIds = []; + this._requestsByChunk.set(chunk, requestIds); + chunksToRequest.push(chunk); + } + requestIds.push(requestId); + } + if (chunksToRequest.length > 0) { + const groupedChunksToRequest = this.groupChunks(chunksToRequest); + for (const groupedChunk of groupedChunksToRequest) { + const begin = groupedChunk.beginChunk * this.chunkSize; + const end = Math.min(groupedChunk.endChunk * this.chunkSize, this.length); + this.sendRequest(begin, end).catch(capability.reject); + } + } + return capability.promise.catch(reason => { + if (this.aborted) { + return; + } + throw reason; + }); + } + getStream() { + return this.stream; + } + requestRange(begin, end) { + end = Math.min(end, this.length); + const beginChunk = this.getBeginChunk(begin); + const endChunk = this.getEndChunk(end); + const chunks = []; + for (let chunk = beginChunk; chunk < endChunk; ++chunk) { + chunks.push(chunk); + } + return this._requestChunks(chunks); + } + requestRanges(ranges = []) { + const chunksToRequest = []; + for (const range of ranges) { + const beginChunk = this.getBeginChunk(range.begin); + const endChunk = this.getEndChunk(range.end); + for (let chunk = beginChunk; chunk < endChunk; ++chunk) { + if (!chunksToRequest.includes(chunk)) { + chunksToRequest.push(chunk); + } + } + } + chunksToRequest.sort(function (a, b) { + return a - b; + }); + return this._requestChunks(chunksToRequest); + } + groupChunks(chunks) { + const groupedChunks = []; + let beginChunk = -1; + let prevChunk = -1; + for (let i = 0, ii = chunks.length; i < ii; ++i) { + const chunk = chunks[i]; + if (beginChunk < 0) { + beginChunk = chunk; + } + if (prevChunk >= 0 && prevChunk + 1 !== chunk) { + groupedChunks.push({ + beginChunk, + endChunk: prevChunk + 1 + }); + beginChunk = chunk; + } + if (i + 1 === chunks.length) { + groupedChunks.push({ + beginChunk, + endChunk: chunk + 1 + }); + } + prevChunk = chunk; + } + return groupedChunks; + } + onProgress(args) { + this.msgHandler.send("DocProgress", { + loaded: this.stream.numChunksLoaded * this.chunkSize + args.loaded, + total: this.length + }); + } + onReceiveData(args) { + const chunk = args.chunk; + const isProgressive = args.begin === undefined; + const begin = isProgressive ? this.progressiveDataLength : args.begin; + const end = begin + chunk.byteLength; + const beginChunk = Math.floor(begin / this.chunkSize); + const endChunk = end < this.length ? Math.floor(end / this.chunkSize) : Math.ceil(end / this.chunkSize); + if (isProgressive) { + this.stream.onReceiveProgressiveData(chunk); + this.progressiveDataLength = end; + } else { + this.stream.onReceiveData(begin, chunk); + } + if (this.stream.isDataLoaded) { + this._loadedStreamCapability.resolve(this.stream); + } + const loadedRequests = []; + for (let curChunk = beginChunk; curChunk < endChunk; ++curChunk) { + const requestIds = this._requestsByChunk.get(curChunk); + if (!requestIds) { + continue; + } + this._requestsByChunk.delete(curChunk); + for (const requestId of requestIds) { + const chunksNeeded = this._chunksNeededByRequest.get(requestId); + if (chunksNeeded.has(curChunk)) { + chunksNeeded.delete(curChunk); + } + if (chunksNeeded.size > 0) { + continue; + } + loadedRequests.push(requestId); + } + } + if (!this.disableAutoFetch && this._requestsByChunk.size === 0) { + let nextEmptyChunk; + if (this.stream.numChunksLoaded === 1) { + const lastChunk = this.stream.numChunks - 1; + if (!this.stream.hasChunk(lastChunk)) { + nextEmptyChunk = lastChunk; + } + } else { + nextEmptyChunk = this.stream.nextEmptyChunk(endChunk); + } + if (Number.isInteger(nextEmptyChunk)) { + this._requestChunks([nextEmptyChunk]); + } + } + for (const requestId of loadedRequests) { + const capability = this._promisesByRequest.get(requestId); + this._promisesByRequest.delete(requestId); + capability.resolve(); + } + this.msgHandler.send("DocProgress", { + loaded: this.stream.numChunksLoaded * this.chunkSize, + total: this.length + }); + } + onError(err) { + this._loadedStreamCapability.reject(err); + } + getBeginChunk(begin) { + return Math.floor(begin / this.chunkSize); + } + getEndChunk(end) { + return Math.floor((end - 1) / this.chunkSize) + 1; + } + abort(reason) { + this.aborted = true; + this.pdfNetworkStream?.cancelAllRequests(reason); + for (const capability of this._promisesByRequest.values()) { + capability.reject(reason); + } + } +} + +;// ./src/core/colorspace.js + + + + +function resizeRgbImage(src, dest, w1, h1, w2, h2, alpha01) { + const COMPONENTS = 3; + alpha01 = alpha01 !== 1 ? 0 : alpha01; + const xRatio = w1 / w2; + const yRatio = h1 / h2; + let newIndex = 0, + oldIndex; + const xScaled = new Uint16Array(w2); + const w1Scanline = w1 * COMPONENTS; + for (let i = 0; i < w2; i++) { + xScaled[i] = Math.floor(i * xRatio) * COMPONENTS; + } + for (let i = 0; i < h2; i++) { + const py = Math.floor(i * yRatio) * w1Scanline; + for (let j = 0; j < w2; j++) { + oldIndex = py + xScaled[j]; + dest[newIndex++] = src[oldIndex++]; + dest[newIndex++] = src[oldIndex++]; + dest[newIndex++] = src[oldIndex++]; + newIndex += alpha01; + } + } +} +function resizeRgbaImage(src, dest, w1, h1, w2, h2, alpha01) { + const xRatio = w1 / w2; + const yRatio = h1 / h2; + let newIndex = 0; + const xScaled = new Uint16Array(w2); + if (alpha01 === 1) { + for (let i = 0; i < w2; i++) { + xScaled[i] = Math.floor(i * xRatio); + } + const src32 = new Uint32Array(src.buffer); + const dest32 = new Uint32Array(dest.buffer); + const rgbMask = FeatureTest.isLittleEndian ? 0x00ffffff : 0xffffff00; + for (let i = 0; i < h2; i++) { + const buf = src32.subarray(Math.floor(i * yRatio) * w1); + for (let j = 0; j < w2; j++) { + dest32[newIndex++] |= buf[xScaled[j]] & rgbMask; + } + } + } else { + const COMPONENTS = 4; + const w1Scanline = w1 * COMPONENTS; + for (let i = 0; i < w2; i++) { + xScaled[i] = Math.floor(i * xRatio) * COMPONENTS; + } + for (let i = 0; i < h2; i++) { + const buf = src.subarray(Math.floor(i * yRatio) * w1Scanline); + for (let j = 0; j < w2; j++) { + const oldIndex = xScaled[j]; + dest[newIndex++] = buf[oldIndex]; + dest[newIndex++] = buf[oldIndex + 1]; + dest[newIndex++] = buf[oldIndex + 2]; + } + } + } +} +function copyRgbaImage(src, dest, alpha01) { + if (alpha01 === 1) { + const src32 = new Uint32Array(src.buffer); + const dest32 = new Uint32Array(dest.buffer); + const rgbMask = FeatureTest.isLittleEndian ? 0x00ffffff : 0xffffff00; + for (let i = 0, ii = src32.length; i < ii; i++) { + dest32[i] |= src32[i] & rgbMask; + } + } else { + let j = 0; + for (let i = 0, ii = src.length; i < ii; i += 4) { + dest[j++] = src[i]; + dest[j++] = src[i + 1]; + dest[j++] = src[i + 2]; + } + } +} +class ColorSpace { + constructor(name, numComps) { + this.name = name; + this.numComps = numComps; + } + getRgb(src, srcOffset) { + const rgb = new Uint8ClampedArray(3); + this.getRgbItem(src, srcOffset, rgb, 0); + return rgb; + } + getRgbItem(src, srcOffset, dest, destOffset) { + unreachable("Should not call ColorSpace.getRgbItem"); + } + getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { + unreachable("Should not call ColorSpace.getRgbBuffer"); + } + getOutputLength(inputLength, alpha01) { + unreachable("Should not call ColorSpace.getOutputLength"); + } + isPassthrough(bits) { + return false; + } + isDefaultDecode(decodeMap, bpc) { + return ColorSpace.isDefaultDecode(decodeMap, this.numComps); + } + fillRgb(dest, originalWidth, originalHeight, width, height, actualHeight, bpc, comps, alpha01) { + const count = originalWidth * originalHeight; + let rgbBuf = null; + const numComponentColors = 1 << bpc; + const needsResizing = originalHeight !== height || originalWidth !== width; + if (this.isPassthrough(bpc)) { + rgbBuf = comps; + } else if (this.numComps === 1 && count > numComponentColors && this.name !== "DeviceGray" && this.name !== "DeviceRGB") { + const allColors = bpc <= 8 ? new Uint8Array(numComponentColors) : new Uint16Array(numComponentColors); + for (let i = 0; i < numComponentColors; i++) { + allColors[i] = i; + } + const colorMap = new Uint8ClampedArray(numComponentColors * 3); + this.getRgbBuffer(allColors, 0, numComponentColors, colorMap, 0, bpc, 0); + if (!needsResizing) { + let destPos = 0; + for (let i = 0; i < count; ++i) { + const key = comps[i] * 3; + dest[destPos++] = colorMap[key]; + dest[destPos++] = colorMap[key + 1]; + dest[destPos++] = colorMap[key + 2]; + destPos += alpha01; + } + } else { + rgbBuf = new Uint8Array(count * 3); + let rgbPos = 0; + for (let i = 0; i < count; ++i) { + const key = comps[i] * 3; + rgbBuf[rgbPos++] = colorMap[key]; + rgbBuf[rgbPos++] = colorMap[key + 1]; + rgbBuf[rgbPos++] = colorMap[key + 2]; + } + } + } else if (!needsResizing) { + this.getRgbBuffer(comps, 0, width * actualHeight, dest, 0, bpc, alpha01); + } else { + rgbBuf = new Uint8ClampedArray(count * 3); + this.getRgbBuffer(comps, 0, count, rgbBuf, 0, bpc, 0); + } + if (rgbBuf) { + if (needsResizing) { + resizeRgbImage(rgbBuf, dest, originalWidth, originalHeight, width, height, alpha01); + } else { + let destPos = 0, + rgbPos = 0; + for (let i = 0, ii = width * actualHeight; i < ii; i++) { + dest[destPos++] = rgbBuf[rgbPos++]; + dest[destPos++] = rgbBuf[rgbPos++]; + dest[destPos++] = rgbBuf[rgbPos++]; + destPos += alpha01; + } + } + } + } + get usesZeroToOneRange() { + return shadow(this, "usesZeroToOneRange", true); + } + static _cache(cacheKey, xref, localColorSpaceCache, parsedColorSpace) { + if (!localColorSpaceCache) { + throw new Error('ColorSpace._cache - expected "localColorSpaceCache" argument.'); + } + if (!parsedColorSpace) { + throw new Error('ColorSpace._cache - expected "parsedColorSpace" argument.'); + } + let csName, csRef; + if (cacheKey instanceof Ref) { + csRef = cacheKey; + cacheKey = xref.fetch(cacheKey); + } + if (cacheKey instanceof Name) { + csName = cacheKey.name; + } + if (csName || csRef) { + localColorSpaceCache.set(csName, csRef, parsedColorSpace); + } + } + static getCached(cacheKey, xref, localColorSpaceCache) { + if (!localColorSpaceCache) { + throw new Error('ColorSpace.getCached - expected "localColorSpaceCache" argument.'); + } + if (cacheKey instanceof Ref) { + const localColorSpace = localColorSpaceCache.getByRef(cacheKey); + if (localColorSpace) { + return localColorSpace; + } + try { + cacheKey = xref.fetch(cacheKey); + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + } + } + if (cacheKey instanceof Name) { + const localColorSpace = localColorSpaceCache.getByName(cacheKey.name); + if (localColorSpace) { + return localColorSpace; + } + } + return null; + } + static async parseAsync({ + cs, + xref, + resources = null, + pdfFunctionFactory, + localColorSpaceCache + }) { + const parsedColorSpace = this._parse(cs, xref, resources, pdfFunctionFactory); + this._cache(cs, xref, localColorSpaceCache, parsedColorSpace); + return parsedColorSpace; + } + static parse({ + cs, + xref, + resources = null, + pdfFunctionFactory, + localColorSpaceCache + }) { + const cachedColorSpace = this.getCached(cs, xref, localColorSpaceCache); + if (cachedColorSpace) { + return cachedColorSpace; + } + const parsedColorSpace = this._parse(cs, xref, resources, pdfFunctionFactory); + this._cache(cs, xref, localColorSpaceCache, parsedColorSpace); + return parsedColorSpace; + } + static _parse(cs, xref, resources = null, pdfFunctionFactory) { + cs = xref.fetchIfRef(cs); + if (cs instanceof Name) { + switch (cs.name) { + case "G": + case "DeviceGray": + return this.singletons.gray; + case "RGB": + case "DeviceRGB": + return this.singletons.rgb; + case "DeviceRGBA": + return this.singletons.rgba; + case "CMYK": + case "DeviceCMYK": + return this.singletons.cmyk; + case "Pattern": + return new PatternCS(null); + default: + if (resources instanceof Dict) { + const colorSpaces = resources.get("ColorSpace"); + if (colorSpaces instanceof Dict) { + const resourcesCS = colorSpaces.get(cs.name); + if (resourcesCS) { + if (resourcesCS instanceof Name) { + return this._parse(resourcesCS, xref, resources, pdfFunctionFactory); + } + cs = resourcesCS; + break; + } + } + } + warn(`Unrecognized ColorSpace: ${cs.name}`); + return this.singletons.gray; + } + } + if (Array.isArray(cs)) { + const mode = xref.fetchIfRef(cs[0]).name; + let params, numComps, baseCS, whitePoint, blackPoint, gamma; + switch (mode) { + case "G": + case "DeviceGray": + return this.singletons.gray; + case "RGB": + case "DeviceRGB": + return this.singletons.rgb; + case "CMYK": + case "DeviceCMYK": + return this.singletons.cmyk; + case "CalGray": + params = xref.fetchIfRef(cs[1]); + whitePoint = params.getArray("WhitePoint"); + blackPoint = params.getArray("BlackPoint"); + gamma = params.get("Gamma"); + return new CalGrayCS(whitePoint, blackPoint, gamma); + case "CalRGB": + params = xref.fetchIfRef(cs[1]); + whitePoint = params.getArray("WhitePoint"); + blackPoint = params.getArray("BlackPoint"); + gamma = params.getArray("Gamma"); + const matrix = params.getArray("Matrix"); + return new CalRGBCS(whitePoint, blackPoint, gamma, matrix); + case "ICCBased": + const stream = xref.fetchIfRef(cs[1]); + const dict = stream.dict; + numComps = dict.get("N"); + const alt = dict.get("Alternate"); + if (alt) { + const altCS = this._parse(alt, xref, resources, pdfFunctionFactory); + if (altCS.numComps === numComps) { + return altCS; + } + warn("ICCBased color space: Ignoring incorrect /Alternate entry."); + } + if (numComps === 1) { + return this.singletons.gray; + } else if (numComps === 3) { + return this.singletons.rgb; + } else if (numComps === 4) { + return this.singletons.cmyk; + } + break; + case "Pattern": + baseCS = cs[1] || null; + if (baseCS) { + baseCS = this._parse(baseCS, xref, resources, pdfFunctionFactory); + } + return new PatternCS(baseCS); + case "I": + case "Indexed": + baseCS = this._parse(cs[1], xref, resources, pdfFunctionFactory); + const hiVal = Math.max(0, Math.min(xref.fetchIfRef(cs[2]), 255)); + const lookup = xref.fetchIfRef(cs[3]); + return new IndexedCS(baseCS, hiVal, lookup); + case "Separation": + case "DeviceN": + const name = xref.fetchIfRef(cs[1]); + numComps = Array.isArray(name) ? name.length : 1; + baseCS = this._parse(cs[2], xref, resources, pdfFunctionFactory); + const tintFn = pdfFunctionFactory.create(cs[3]); + return new AlternateCS(numComps, baseCS, tintFn); + case "Lab": + params = xref.fetchIfRef(cs[1]); + whitePoint = params.getArray("WhitePoint"); + blackPoint = params.getArray("BlackPoint"); + const range = params.getArray("Range"); + return new LabCS(whitePoint, blackPoint, range); + default: + warn(`Unimplemented ColorSpace object: ${mode}`); + return this.singletons.gray; + } + } + warn(`Unrecognized ColorSpace object: ${cs}`); + return this.singletons.gray; + } + static isDefaultDecode(decode, numComps) { + if (!Array.isArray(decode)) { + return true; + } + if (numComps * 2 !== decode.length) { + warn("The decode map is not the correct length"); + return true; + } + for (let i = 0, ii = decode.length; i < ii; i += 2) { + if (decode[i] !== 0 || decode[i + 1] !== 1) { + return false; + } + } + return true; + } + static get singletons() { + return shadow(this, "singletons", { + get gray() { + return shadow(this, "gray", new DeviceGrayCS()); + }, + get rgb() { + return shadow(this, "rgb", new DeviceRgbCS()); + }, + get rgba() { + return shadow(this, "rgba", new DeviceRgbaCS()); + }, + get cmyk() { + return shadow(this, "cmyk", new DeviceCmykCS()); + } + }); + } +} +class AlternateCS extends ColorSpace { + constructor(numComps, base, tintFn) { + super("Alternate", numComps); + this.base = base; + this.tintFn = tintFn; + this.tmpBuf = new Float32Array(base.numComps); + } + getRgbItem(src, srcOffset, dest, destOffset) { + const tmpBuf = this.tmpBuf; + this.tintFn(src, srcOffset, tmpBuf, 0); + this.base.getRgbItem(tmpBuf, 0, dest, destOffset); + } + getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { + const tintFn = this.tintFn; + const base = this.base; + const scale = 1 / ((1 << bits) - 1); + const baseNumComps = base.numComps; + const usesZeroToOneRange = base.usesZeroToOneRange; + const isPassthrough = (base.isPassthrough(8) || !usesZeroToOneRange) && alpha01 === 0; + let pos = isPassthrough ? destOffset : 0; + const baseBuf = isPassthrough ? dest : new Uint8ClampedArray(baseNumComps * count); + const numComps = this.numComps; + const scaled = new Float32Array(numComps); + const tinted = new Float32Array(baseNumComps); + let i, j; + for (i = 0; i < count; i++) { + for (j = 0; j < numComps; j++) { + scaled[j] = src[srcOffset++] * scale; + } + tintFn(scaled, 0, tinted, 0); + if (usesZeroToOneRange) { + for (j = 0; j < baseNumComps; j++) { + baseBuf[pos++] = tinted[j] * 255; + } + } else { + base.getRgbItem(tinted, 0, baseBuf, pos); + pos += baseNumComps; + } + } + if (!isPassthrough) { + base.getRgbBuffer(baseBuf, 0, count, dest, destOffset, 8, alpha01); + } + } + getOutputLength(inputLength, alpha01) { + return this.base.getOutputLength(inputLength * this.base.numComps / this.numComps, alpha01); + } +} +class PatternCS extends ColorSpace { + constructor(baseCS) { + super("Pattern", null); + this.base = baseCS; + } + isDefaultDecode(decodeMap, bpc) { + unreachable("Should not call PatternCS.isDefaultDecode"); + } +} +class IndexedCS extends ColorSpace { + constructor(base, highVal, lookup) { + super("Indexed", 1); + this.base = base; + const length = base.numComps * (highVal + 1); + this.lookup = new Uint8Array(length); + if (lookup instanceof BaseStream) { + const bytes = lookup.getBytes(length); + this.lookup.set(bytes); + } else if (typeof lookup === "string") { + for (let i = 0; i < length; ++i) { + this.lookup[i] = lookup.charCodeAt(i) & 0xff; + } + } else { + throw new FormatError(`IndexedCS - unrecognized lookup table: ${lookup}`); + } + } + getRgbItem(src, srcOffset, dest, destOffset) { + const numComps = this.base.numComps; + const start = src[srcOffset] * numComps; + this.base.getRgbBuffer(this.lookup, start, 1, dest, destOffset, 8, 0); + } + getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { + const base = this.base; + const numComps = base.numComps; + const outputDelta = base.getOutputLength(numComps, alpha01); + const lookup = this.lookup; + for (let i = 0; i < count; ++i) { + const lookupPos = src[srcOffset++] * numComps; + base.getRgbBuffer(lookup, lookupPos, 1, dest, destOffset, 8, alpha01); + destOffset += outputDelta; + } + } + getOutputLength(inputLength, alpha01) { + return this.base.getOutputLength(inputLength * this.base.numComps, alpha01); + } + isDefaultDecode(decodeMap, bpc) { + if (!Array.isArray(decodeMap)) { + return true; + } + if (decodeMap.length !== 2) { + warn("Decode map length is not correct"); + return true; + } + if (!Number.isInteger(bpc) || bpc < 1) { + warn("Bits per component is not correct"); + return true; + } + return decodeMap[0] === 0 && decodeMap[1] === (1 << bpc) - 1; + } +} +class DeviceGrayCS extends ColorSpace { + constructor() { + super("DeviceGray", 1); + } + getRgbItem(src, srcOffset, dest, destOffset) { + const c = src[srcOffset] * 255; + dest[destOffset] = dest[destOffset + 1] = dest[destOffset + 2] = c; + } + getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { + const scale = 255 / ((1 << bits) - 1); + let j = srcOffset, + q = destOffset; + for (let i = 0; i < count; ++i) { + const c = scale * src[j++]; + dest[q++] = c; + dest[q++] = c; + dest[q++] = c; + q += alpha01; + } + } + getOutputLength(inputLength, alpha01) { + return inputLength * (3 + alpha01); + } +} +class DeviceRgbCS extends ColorSpace { + constructor() { + super("DeviceRGB", 3); + } + getRgbItem(src, srcOffset, dest, destOffset) { + dest[destOffset] = src[srcOffset] * 255; + dest[destOffset + 1] = src[srcOffset + 1] * 255; + dest[destOffset + 2] = src[srcOffset + 2] * 255; + } + getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { + if (bits === 8 && alpha01 === 0) { + dest.set(src.subarray(srcOffset, srcOffset + count * 3), destOffset); + return; + } + const scale = 255 / ((1 << bits) - 1); + let j = srcOffset, + q = destOffset; + for (let i = 0; i < count; ++i) { + dest[q++] = scale * src[j++]; + dest[q++] = scale * src[j++]; + dest[q++] = scale * src[j++]; + q += alpha01; + } + } + getOutputLength(inputLength, alpha01) { + return inputLength * (3 + alpha01) / 3 | 0; + } + isPassthrough(bits) { + return bits === 8; + } +} +class DeviceRgbaCS extends ColorSpace { + constructor() { + super("DeviceRGBA", 4); + } + getOutputLength(inputLength, _alpha01) { + return inputLength * 4; + } + isPassthrough(bits) { + return bits === 8; + } + fillRgb(dest, originalWidth, originalHeight, width, height, actualHeight, bpc, comps, alpha01) { + if (originalHeight !== height || originalWidth !== width) { + resizeRgbaImage(comps, dest, originalWidth, originalHeight, width, height, alpha01); + } else { + copyRgbaImage(comps, dest, alpha01); + } + } +} +class DeviceCmykCS extends ColorSpace { + constructor() { + super("DeviceCMYK", 4); + } + #toRgb(src, srcOffset, srcScale, dest, destOffset) { + const c = src[srcOffset] * srcScale; + const m = src[srcOffset + 1] * srcScale; + const y = src[srcOffset + 2] * srcScale; + const k = src[srcOffset + 3] * srcScale; + dest[destOffset] = 255 + c * (-4.387332384609988 * c + 54.48615194189176 * m + 18.82290502165302 * y + 212.25662451639585 * k + -285.2331026137004) + m * (1.7149763477362134 * m - 5.6096736904047315 * y + -17.873870861415444 * k - 5.497006427196366) + y * (-2.5217340131683033 * y - 21.248923337353073 * k + 17.5119270841813) + k * (-21.86122147463605 * k - 189.48180835922747); + dest[destOffset + 1] = 255 + c * (8.841041422036149 * c + 60.118027045597366 * m + 6.871425592049007 * y + 31.159100130055922 * k + -79.2970844816548) + m * (-15.310361306967817 * m + 17.575251261109482 * y + 131.35250912493976 * k - 190.9453302588951) + y * (4.444339102852739 * y + 9.8632861493405 * k - 24.86741582555878) + k * (-20.737325471181034 * k - 187.80453709719578); + dest[destOffset + 2] = 255 + c * (0.8842522430003296 * c + 8.078677503112928 * m + 30.89978309703729 * y - 0.23883238689178934 * k + -14.183576799673286) + m * (10.49593273432072 * m + 63.02378494754052 * y + 50.606957656360734 * k - 112.23884253719248) + y * (0.03296041114873217 * y + 115.60384449646641 * k + -193.58209356861505) + k * (-22.33816807309886 * k - 180.12613974708367); + } + getRgbItem(src, srcOffset, dest, destOffset) { + this.#toRgb(src, srcOffset, 1, dest, destOffset); + } + getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { + const scale = 1 / ((1 << bits) - 1); + for (let i = 0; i < count; i++) { + this.#toRgb(src, srcOffset, scale, dest, destOffset); + srcOffset += 4; + destOffset += 3 + alpha01; + } + } + getOutputLength(inputLength, alpha01) { + return inputLength / 4 * (3 + alpha01) | 0; + } +} +class CalGrayCS extends ColorSpace { + constructor(whitePoint, blackPoint, gamma) { + super("CalGray", 1); + if (!whitePoint) { + throw new FormatError("WhitePoint missing - required for color space CalGray"); + } + [this.XW, this.YW, this.ZW] = whitePoint; + [this.XB, this.YB, this.ZB] = blackPoint || [0, 0, 0]; + this.G = gamma || 1; + if (this.XW < 0 || this.ZW < 0 || this.YW !== 1) { + throw new FormatError(`Invalid WhitePoint components for ${this.name}, no fallback available`); + } + if (this.XB < 0 || this.YB < 0 || this.ZB < 0) { + info(`Invalid BlackPoint for ${this.name}, falling back to default.`); + this.XB = this.YB = this.ZB = 0; + } + if (this.XB !== 0 || this.YB !== 0 || this.ZB !== 0) { + warn(`${this.name}, BlackPoint: XB: ${this.XB}, YB: ${this.YB}, ` + `ZB: ${this.ZB}, only default values are supported.`); + } + if (this.G < 1) { + info(`Invalid Gamma: ${this.G} for ${this.name}, falling back to default.`); + this.G = 1; + } + } + #toRgb(src, srcOffset, dest, destOffset, scale) { + const A = src[srcOffset] * scale; + const AG = A ** this.G; + const L = this.YW * AG; + const val = Math.max(295.8 * L ** 0.3333333333333333 - 40.8, 0); + dest[destOffset] = val; + dest[destOffset + 1] = val; + dest[destOffset + 2] = val; + } + getRgbItem(src, srcOffset, dest, destOffset) { + this.#toRgb(src, srcOffset, dest, destOffset, 1); + } + getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { + const scale = 1 / ((1 << bits) - 1); + for (let i = 0; i < count; ++i) { + this.#toRgb(src, srcOffset, dest, destOffset, scale); + srcOffset += 1; + destOffset += 3 + alpha01; + } + } + getOutputLength(inputLength, alpha01) { + return inputLength * (3 + alpha01); + } +} +class CalRGBCS extends ColorSpace { + static #BRADFORD_SCALE_MATRIX = new Float32Array([0.8951, 0.2664, -0.1614, -0.7502, 1.7135, 0.0367, 0.0389, -0.0685, 1.0296]); + static #BRADFORD_SCALE_INVERSE_MATRIX = new Float32Array([0.9869929, -0.1470543, 0.1599627, 0.4323053, 0.5183603, 0.0492912, -0.0085287, 0.0400428, 0.9684867]); + static #SRGB_D65_XYZ_TO_RGB_MATRIX = new Float32Array([3.2404542, -1.5371385, -0.4985314, -0.9692660, 1.8760108, 0.0415560, 0.0556434, -0.2040259, 1.0572252]); + static #FLAT_WHITEPOINT_MATRIX = new Float32Array([1, 1, 1]); + static #tempNormalizeMatrix = new Float32Array(3); + static #tempConvertMatrix1 = new Float32Array(3); + static #tempConvertMatrix2 = new Float32Array(3); + static #DECODE_L_CONSTANT = ((8 + 16) / 116) ** 3 / 8.0; + constructor(whitePoint, blackPoint, gamma, matrix) { + super("CalRGB", 3); + if (!whitePoint) { + throw new FormatError("WhitePoint missing - required for color space CalRGB"); + } + const [XW, YW, ZW] = this.whitePoint = whitePoint; + const [XB, YB, ZB] = this.blackPoint = blackPoint || new Float32Array(3); + [this.GR, this.GG, this.GB] = gamma || new Float32Array([1, 1, 1]); + [this.MXA, this.MYA, this.MZA, this.MXB, this.MYB, this.MZB, this.MXC, this.MYC, this.MZC] = matrix || new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]); + if (XW < 0 || ZW < 0 || YW !== 1) { + throw new FormatError(`Invalid WhitePoint components for ${this.name}, no fallback available`); + } + if (XB < 0 || YB < 0 || ZB < 0) { + info(`Invalid BlackPoint for ${this.name} [${XB}, ${YB}, ${ZB}], ` + "falling back to default."); + this.blackPoint = new Float32Array(3); + } + if (this.GR < 0 || this.GG < 0 || this.GB < 0) { + info(`Invalid Gamma [${this.GR}, ${this.GG}, ${this.GB}] for ` + `${this.name}, falling back to default.`); + this.GR = this.GG = this.GB = 1; + } + } + #matrixProduct(a, b, result) { + result[0] = a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; + result[1] = a[3] * b[0] + a[4] * b[1] + a[5] * b[2]; + result[2] = a[6] * b[0] + a[7] * b[1] + a[8] * b[2]; + } + #toFlat(sourceWhitePoint, LMS, result) { + result[0] = LMS[0] * 1 / sourceWhitePoint[0]; + result[1] = LMS[1] * 1 / sourceWhitePoint[1]; + result[2] = LMS[2] * 1 / sourceWhitePoint[2]; + } + #toD65(sourceWhitePoint, LMS, result) { + const D65X = 0.95047; + const D65Y = 1; + const D65Z = 1.08883; + result[0] = LMS[0] * D65X / sourceWhitePoint[0]; + result[1] = LMS[1] * D65Y / sourceWhitePoint[1]; + result[2] = LMS[2] * D65Z / sourceWhitePoint[2]; + } + #sRGBTransferFunction(color) { + if (color <= 0.0031308) { + return this.#adjustToRange(0, 1, 12.92 * color); + } + if (color >= 0.99554525) { + return 1; + } + return this.#adjustToRange(0, 1, (1 + 0.055) * color ** (1 / 2.4) - 0.055); + } + #adjustToRange(min, max, value) { + return Math.max(min, Math.min(max, value)); + } + #decodeL(L) { + if (L < 0) { + return -this.#decodeL(-L); + } + if (L > 8.0) { + return ((L + 16) / 116) ** 3; + } + return L * CalRGBCS.#DECODE_L_CONSTANT; + } + #compensateBlackPoint(sourceBlackPoint, XYZ_Flat, result) { + if (sourceBlackPoint[0] === 0 && sourceBlackPoint[1] === 0 && sourceBlackPoint[2] === 0) { + result[0] = XYZ_Flat[0]; + result[1] = XYZ_Flat[1]; + result[2] = XYZ_Flat[2]; + return; + } + const zeroDecodeL = this.#decodeL(0); + const X_DST = zeroDecodeL; + const X_SRC = this.#decodeL(sourceBlackPoint[0]); + const Y_DST = zeroDecodeL; + const Y_SRC = this.#decodeL(sourceBlackPoint[1]); + const Z_DST = zeroDecodeL; + const Z_SRC = this.#decodeL(sourceBlackPoint[2]); + const X_Scale = (1 - X_DST) / (1 - X_SRC); + const X_Offset = 1 - X_Scale; + const Y_Scale = (1 - Y_DST) / (1 - Y_SRC); + const Y_Offset = 1 - Y_Scale; + const Z_Scale = (1 - Z_DST) / (1 - Z_SRC); + const Z_Offset = 1 - Z_Scale; + result[0] = XYZ_Flat[0] * X_Scale + X_Offset; + result[1] = XYZ_Flat[1] * Y_Scale + Y_Offset; + result[2] = XYZ_Flat[2] * Z_Scale + Z_Offset; + } + #normalizeWhitePointToFlat(sourceWhitePoint, XYZ_In, result) { + if (sourceWhitePoint[0] === 1 && sourceWhitePoint[2] === 1) { + result[0] = XYZ_In[0]; + result[1] = XYZ_In[1]; + result[2] = XYZ_In[2]; + return; + } + const LMS = result; + this.#matrixProduct(CalRGBCS.#BRADFORD_SCALE_MATRIX, XYZ_In, LMS); + const LMS_Flat = CalRGBCS.#tempNormalizeMatrix; + this.#toFlat(sourceWhitePoint, LMS, LMS_Flat); + this.#matrixProduct(CalRGBCS.#BRADFORD_SCALE_INVERSE_MATRIX, LMS_Flat, result); + } + #normalizeWhitePointToD65(sourceWhitePoint, XYZ_In, result) { + const LMS = result; + this.#matrixProduct(CalRGBCS.#BRADFORD_SCALE_MATRIX, XYZ_In, LMS); + const LMS_D65 = CalRGBCS.#tempNormalizeMatrix; + this.#toD65(sourceWhitePoint, LMS, LMS_D65); + this.#matrixProduct(CalRGBCS.#BRADFORD_SCALE_INVERSE_MATRIX, LMS_D65, result); + } + #toRgb(src, srcOffset, dest, destOffset, scale) { + const A = this.#adjustToRange(0, 1, src[srcOffset] * scale); + const B = this.#adjustToRange(0, 1, src[srcOffset + 1] * scale); + const C = this.#adjustToRange(0, 1, src[srcOffset + 2] * scale); + const AGR = A === 1 ? 1 : A ** this.GR; + const BGG = B === 1 ? 1 : B ** this.GG; + const CGB = C === 1 ? 1 : C ** this.GB; + const X = this.MXA * AGR + this.MXB * BGG + this.MXC * CGB; + const Y = this.MYA * AGR + this.MYB * BGG + this.MYC * CGB; + const Z = this.MZA * AGR + this.MZB * BGG + this.MZC * CGB; + const XYZ = CalRGBCS.#tempConvertMatrix1; + XYZ[0] = X; + XYZ[1] = Y; + XYZ[2] = Z; + const XYZ_Flat = CalRGBCS.#tempConvertMatrix2; + this.#normalizeWhitePointToFlat(this.whitePoint, XYZ, XYZ_Flat); + const XYZ_Black = CalRGBCS.#tempConvertMatrix1; + this.#compensateBlackPoint(this.blackPoint, XYZ_Flat, XYZ_Black); + const XYZ_D65 = CalRGBCS.#tempConvertMatrix2; + this.#normalizeWhitePointToD65(CalRGBCS.#FLAT_WHITEPOINT_MATRIX, XYZ_Black, XYZ_D65); + const SRGB = CalRGBCS.#tempConvertMatrix1; + this.#matrixProduct(CalRGBCS.#SRGB_D65_XYZ_TO_RGB_MATRIX, XYZ_D65, SRGB); + dest[destOffset] = this.#sRGBTransferFunction(SRGB[0]) * 255; + dest[destOffset + 1] = this.#sRGBTransferFunction(SRGB[1]) * 255; + dest[destOffset + 2] = this.#sRGBTransferFunction(SRGB[2]) * 255; + } + getRgbItem(src, srcOffset, dest, destOffset) { + this.#toRgb(src, srcOffset, dest, destOffset, 1); + } + getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { + const scale = 1 / ((1 << bits) - 1); + for (let i = 0; i < count; ++i) { + this.#toRgb(src, srcOffset, dest, destOffset, scale); + srcOffset += 3; + destOffset += 3 + alpha01; + } + } + getOutputLength(inputLength, alpha01) { + return inputLength * (3 + alpha01) / 3 | 0; + } +} +class LabCS extends ColorSpace { + constructor(whitePoint, blackPoint, range) { + super("Lab", 3); + if (!whitePoint) { + throw new FormatError("WhitePoint missing - required for color space Lab"); + } + [this.XW, this.YW, this.ZW] = whitePoint; + [this.amin, this.amax, this.bmin, this.bmax] = range || [-100, 100, -100, 100]; + [this.XB, this.YB, this.ZB] = blackPoint || [0, 0, 0]; + if (this.XW < 0 || this.ZW < 0 || this.YW !== 1) { + throw new FormatError("Invalid WhitePoint components, no fallback available"); + } + if (this.XB < 0 || this.YB < 0 || this.ZB < 0) { + info("Invalid BlackPoint, falling back to default"); + this.XB = this.YB = this.ZB = 0; + } + if (this.amin > this.amax || this.bmin > this.bmax) { + info("Invalid Range, falling back to defaults"); + this.amin = -100; + this.amax = 100; + this.bmin = -100; + this.bmax = 100; + } + } + #fn_g(x) { + return x >= 6 / 29 ? x ** 3 : 108 / 841 * (x - 4 / 29); + } + #decode(value, high1, low2, high2) { + return low2 + value * (high2 - low2) / high1; + } + #toRgb(src, srcOffset, maxVal, dest, destOffset) { + let Ls = src[srcOffset]; + let as = src[srcOffset + 1]; + let bs = src[srcOffset + 2]; + if (maxVal !== false) { + Ls = this.#decode(Ls, maxVal, 0, 100); + as = this.#decode(as, maxVal, this.amin, this.amax); + bs = this.#decode(bs, maxVal, this.bmin, this.bmax); + } + if (as > this.amax) { + as = this.amax; + } else if (as < this.amin) { + as = this.amin; + } + if (bs > this.bmax) { + bs = this.bmax; + } else if (bs < this.bmin) { + bs = this.bmin; + } + const M = (Ls + 16) / 116; + const L = M + as / 500; + const N = M - bs / 200; + const X = this.XW * this.#fn_g(L); + const Y = this.YW * this.#fn_g(M); + const Z = this.ZW * this.#fn_g(N); + let r, g, b; + if (this.ZW < 1) { + r = X * 3.1339 + Y * -1.617 + Z * -0.4906; + g = X * -0.9785 + Y * 1.916 + Z * 0.0333; + b = X * 0.072 + Y * -0.229 + Z * 1.4057; + } else { + r = X * 3.2406 + Y * -1.5372 + Z * -0.4986; + g = X * -0.9689 + Y * 1.8758 + Z * 0.0415; + b = X * 0.0557 + Y * -0.204 + Z * 1.057; + } + dest[destOffset] = Math.sqrt(r) * 255; + dest[destOffset + 1] = Math.sqrt(g) * 255; + dest[destOffset + 2] = Math.sqrt(b) * 255; + } + getRgbItem(src, srcOffset, dest, destOffset) { + this.#toRgb(src, srcOffset, false, dest, destOffset); + } + getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { + const maxVal = (1 << bits) - 1; + for (let i = 0; i < count; i++) { + this.#toRgb(src, srcOffset, maxVal, dest, destOffset); + srcOffset += 3; + destOffset += 3 + alpha01; + } + } + getOutputLength(inputLength, alpha01) { + return inputLength * (3 + alpha01) / 3 | 0; + } + isDefaultDecode(decodeMap, bpc) { + return true; + } + get usesZeroToOneRange() { + return shadow(this, "usesZeroToOneRange", false); + } +} + +;// ./src/core/binary_cmap.js + +function hexToInt(a, size) { + let n = 0; + for (let i = 0; i <= size; i++) { + n = n << 8 | a[i]; + } + return n >>> 0; +} +function hexToStr(a, size) { + if (size === 1) { + return String.fromCharCode(a[0], a[1]); + } + if (size === 3) { + return String.fromCharCode(a[0], a[1], a[2], a[3]); + } + return String.fromCharCode(...a.subarray(0, size + 1)); +} +function addHex(a, b, size) { + let c = 0; + for (let i = size; i >= 0; i--) { + c += a[i] + b[i]; + a[i] = c & 255; + c >>= 8; + } +} +function incHex(a, size) { + let c = 1; + for (let i = size; i >= 0 && c > 0; i--) { + c += a[i]; + a[i] = c & 255; + c >>= 8; + } +} +const MAX_NUM_SIZE = 16; +const MAX_ENCODED_NUM_SIZE = 19; +class BinaryCMapStream { + constructor(data) { + this.buffer = data; + this.pos = 0; + this.end = data.length; + this.tmpBuf = new Uint8Array(MAX_ENCODED_NUM_SIZE); + } + readByte() { + if (this.pos >= this.end) { + return -1; + } + return this.buffer[this.pos++]; + } + readNumber() { + let n = 0; + let last; + do { + const b = this.readByte(); + if (b < 0) { + throw new FormatError("unexpected EOF in bcmap"); + } + last = !(b & 0x80); + n = n << 7 | b & 0x7f; + } while (!last); + return n; + } + readSigned() { + const n = this.readNumber(); + return n & 1 ? ~(n >>> 1) : n >>> 1; + } + readHex(num, size) { + num.set(this.buffer.subarray(this.pos, this.pos + size + 1)); + this.pos += size + 1; + } + readHexNumber(num, size) { + let last; + const stack = this.tmpBuf; + let sp = 0; + do { + const b = this.readByte(); + if (b < 0) { + throw new FormatError("unexpected EOF in bcmap"); + } + last = !(b & 0x80); + stack[sp++] = b & 0x7f; + } while (!last); + let i = size, + buffer = 0, + bufferSize = 0; + while (i >= 0) { + while (bufferSize < 8 && stack.length > 0) { + buffer |= stack[--sp] << bufferSize; + bufferSize += 7; + } + num[i] = buffer & 255; + i--; + buffer >>= 8; + bufferSize -= 8; + } + } + readHexSigned(num, size) { + this.readHexNumber(num, size); + const sign = num[size] & 1 ? 255 : 0; + let c = 0; + for (let i = 0; i <= size; i++) { + c = (c & 1) << 8 | num[i]; + num[i] = c >> 1 ^ sign; + } + } + readString() { + const len = this.readNumber(), + buf = new Array(len); + for (let i = 0; i < len; i++) { + buf[i] = this.readNumber(); + } + return String.fromCharCode(...buf); + } +} +class BinaryCMapReader { + async process(data, cMap, extend) { + const stream = new BinaryCMapStream(data); + const header = stream.readByte(); + cMap.vertical = !!(header & 1); + let useCMap = null; + const start = new Uint8Array(MAX_NUM_SIZE); + const end = new Uint8Array(MAX_NUM_SIZE); + const char = new Uint8Array(MAX_NUM_SIZE); + const charCode = new Uint8Array(MAX_NUM_SIZE); + const tmp = new Uint8Array(MAX_NUM_SIZE); + let code; + let b; + while ((b = stream.readByte()) >= 0) { + const type = b >> 5; + if (type === 7) { + switch (b & 0x1f) { + case 0: + stream.readString(); + break; + case 1: + useCMap = stream.readString(); + break; + } + continue; + } + const sequence = !!(b & 0x10); + const dataSize = b & 15; + if (dataSize + 1 > MAX_NUM_SIZE) { + throw new Error("BinaryCMapReader.process: Invalid dataSize."); + } + const ucs2DataSize = 1; + const subitemsCount = stream.readNumber(); + switch (type) { + case 0: + stream.readHex(start, dataSize); + stream.readHexNumber(end, dataSize); + addHex(end, start, dataSize); + cMap.addCodespaceRange(dataSize + 1, hexToInt(start, dataSize), hexToInt(end, dataSize)); + for (let i = 1; i < subitemsCount; i++) { + incHex(end, dataSize); + stream.readHexNumber(start, dataSize); + addHex(start, end, dataSize); + stream.readHexNumber(end, dataSize); + addHex(end, start, dataSize); + cMap.addCodespaceRange(dataSize + 1, hexToInt(start, dataSize), hexToInt(end, dataSize)); + } + break; + case 1: + stream.readHex(start, dataSize); + stream.readHexNumber(end, dataSize); + addHex(end, start, dataSize); + stream.readNumber(); + for (let i = 1; i < subitemsCount; i++) { + incHex(end, dataSize); + stream.readHexNumber(start, dataSize); + addHex(start, end, dataSize); + stream.readHexNumber(end, dataSize); + addHex(end, start, dataSize); + stream.readNumber(); + } + break; + case 2: + stream.readHex(char, dataSize); + code = stream.readNumber(); + cMap.mapOne(hexToInt(char, dataSize), code); + for (let i = 1; i < subitemsCount; i++) { + incHex(char, dataSize); + if (!sequence) { + stream.readHexNumber(tmp, dataSize); + addHex(char, tmp, dataSize); + } + code = stream.readSigned() + (code + 1); + cMap.mapOne(hexToInt(char, dataSize), code); + } + break; + case 3: + stream.readHex(start, dataSize); + stream.readHexNumber(end, dataSize); + addHex(end, start, dataSize); + code = stream.readNumber(); + cMap.mapCidRange(hexToInt(start, dataSize), hexToInt(end, dataSize), code); + for (let i = 1; i < subitemsCount; i++) { + incHex(end, dataSize); + if (!sequence) { + stream.readHexNumber(start, dataSize); + addHex(start, end, dataSize); + } else { + start.set(end); + } + stream.readHexNumber(end, dataSize); + addHex(end, start, dataSize); + code = stream.readNumber(); + cMap.mapCidRange(hexToInt(start, dataSize), hexToInt(end, dataSize), code); + } + break; + case 4: + stream.readHex(char, ucs2DataSize); + stream.readHex(charCode, dataSize); + cMap.mapOne(hexToInt(char, ucs2DataSize), hexToStr(charCode, dataSize)); + for (let i = 1; i < subitemsCount; i++) { + incHex(char, ucs2DataSize); + if (!sequence) { + stream.readHexNumber(tmp, ucs2DataSize); + addHex(char, tmp, ucs2DataSize); + } + incHex(charCode, dataSize); + stream.readHexSigned(tmp, dataSize); + addHex(charCode, tmp, dataSize); + cMap.mapOne(hexToInt(char, ucs2DataSize), hexToStr(charCode, dataSize)); + } + break; + case 5: + stream.readHex(start, ucs2DataSize); + stream.readHexNumber(end, ucs2DataSize); + addHex(end, start, ucs2DataSize); + stream.readHex(charCode, dataSize); + cMap.mapBfRange(hexToInt(start, ucs2DataSize), hexToInt(end, ucs2DataSize), hexToStr(charCode, dataSize)); + for (let i = 1; i < subitemsCount; i++) { + incHex(end, ucs2DataSize); + if (!sequence) { + stream.readHexNumber(start, ucs2DataSize); + addHex(start, end, ucs2DataSize); + } else { + start.set(end); + } + stream.readHexNumber(end, ucs2DataSize); + addHex(end, start, ucs2DataSize); + stream.readHex(charCode, dataSize); + cMap.mapBfRange(hexToInt(start, ucs2DataSize), hexToInt(end, ucs2DataSize), hexToStr(charCode, dataSize)); + } + break; + default: + throw new Error(`BinaryCMapReader.process - unknown type: ${type}`); + } + } + if (useCMap) { + return extend(useCMap); + } + return cMap; + } +} + +;// ./src/core/decode_stream.js + + +const emptyBuffer = new Uint8Array(0); +class DecodeStream extends BaseStream { + constructor(maybeMinBufferLength) { + super(); + this._rawMinBufferLength = maybeMinBufferLength || 0; + this.pos = 0; + this.bufferLength = 0; + this.eof = false; + this.buffer = emptyBuffer; + this.minBufferLength = 512; + if (maybeMinBufferLength) { + while (this.minBufferLength < maybeMinBufferLength) { + this.minBufferLength *= 2; + } + } + } + get isEmpty() { + while (!this.eof && this.bufferLength === 0) { + this.readBlock(); + } + return this.bufferLength === 0; + } + ensureBuffer(requested) { + const buffer = this.buffer; + if (requested <= buffer.byteLength) { + return buffer; + } + let size = this.minBufferLength; + while (size < requested) { + size *= 2; + } + const buffer2 = new Uint8Array(size); + buffer2.set(buffer); + return this.buffer = buffer2; + } + getByte() { + const pos = this.pos; + while (this.bufferLength <= pos) { + if (this.eof) { + return -1; + } + this.readBlock(); + } + return this.buffer[this.pos++]; + } + getBytes(length, decoderOptions = null) { + const pos = this.pos; + let end; + if (length) { + this.ensureBuffer(pos + length); + end = pos + length; + while (!this.eof && this.bufferLength < end) { + this.readBlock(decoderOptions); + } + const bufEnd = this.bufferLength; + if (end > bufEnd) { + end = bufEnd; + } + } else { + while (!this.eof) { + this.readBlock(decoderOptions); + } + end = this.bufferLength; + } + this.pos = end; + return this.buffer.subarray(pos, end); + } + async getImageData(length, decoderOptions = null) { + if (!this.canAsyncDecodeImageFromBuffer) { + return this.getBytes(length, decoderOptions); + } + const data = await this.stream.asyncGetBytes(); + return this.decodeImage(data, decoderOptions); + } + reset() { + this.pos = 0; + } + makeSubStream(start, length, dict = null) { + if (length === undefined) { + while (!this.eof) { + this.readBlock(); + } + } else { + const end = start + length; + while (this.bufferLength <= end && !this.eof) { + this.readBlock(); + } + } + return new Stream(this.buffer, start, length, dict); + } + getBaseStreams() { + return this.str ? this.str.getBaseStreams() : null; + } +} +class StreamsSequenceStream extends DecodeStream { + constructor(streams, onError = null) { + streams = streams.filter(s => s instanceof BaseStream); + let maybeLength = 0; + for (const stream of streams) { + maybeLength += stream instanceof DecodeStream ? stream._rawMinBufferLength : stream.length; + } + super(maybeLength); + this.streams = streams; + this._onError = onError; + } + readBlock() { + const streams = this.streams; + if (streams.length === 0) { + this.eof = true; + return; + } + const stream = streams.shift(); + let chunk; + try { + chunk = stream.getBytes(); + } catch (reason) { + if (this._onError) { + this._onError(reason, stream.dict?.objId); + return; + } + throw reason; + } + const bufferLength = this.bufferLength; + const newLength = bufferLength + chunk.length; + const buffer = this.ensureBuffer(newLength); + buffer.set(chunk, bufferLength); + this.bufferLength = newLength; + } + getBaseStreams() { + const baseStreamsBuf = []; + for (const stream of this.streams) { + const baseStreams = stream.getBaseStreams(); + if (baseStreams) { + baseStreamsBuf.push(...baseStreams); + } + } + return baseStreamsBuf.length > 0 ? baseStreamsBuf : null; + } +} + +;// ./src/core/ascii_85_stream.js + + +class Ascii85Stream extends DecodeStream { + constructor(str, maybeLength) { + if (maybeLength) { + maybeLength *= 0.8; + } + super(maybeLength); + this.str = str; + this.dict = str.dict; + this.input = new Uint8Array(5); + } + readBlock() { + const TILDA_CHAR = 0x7e; + const Z_LOWER_CHAR = 0x7a; + const EOF = -1; + const str = this.str; + let c = str.getByte(); + while (isWhiteSpace(c)) { + c = str.getByte(); + } + if (c === EOF || c === TILDA_CHAR) { + this.eof = true; + return; + } + const bufferLength = this.bufferLength; + let buffer, i; + if (c === Z_LOWER_CHAR) { + buffer = this.ensureBuffer(bufferLength + 4); + for (i = 0; i < 4; ++i) { + buffer[bufferLength + i] = 0; + } + this.bufferLength += 4; + } else { + const input = this.input; + input[0] = c; + for (i = 1; i < 5; ++i) { + c = str.getByte(); + while (isWhiteSpace(c)) { + c = str.getByte(); + } + input[i] = c; + if (c === EOF || c === TILDA_CHAR) { + break; + } + } + buffer = this.ensureBuffer(bufferLength + i - 1); + this.bufferLength += i - 1; + if (i < 5) { + for (; i < 5; ++i) { + input[i] = 0x21 + 84; + } + this.eof = true; + } + let t = 0; + for (i = 0; i < 5; ++i) { + t = t * 85 + (input[i] - 0x21); + } + for (i = 3; i >= 0; --i) { + buffer[bufferLength + i] = t & 0xff; + t >>= 8; + } + } + } +} + +;// ./src/core/ascii_hex_stream.js + +class AsciiHexStream extends DecodeStream { + constructor(str, maybeLength) { + if (maybeLength) { + maybeLength *= 0.5; + } + super(maybeLength); + this.str = str; + this.dict = str.dict; + this.firstDigit = -1; + } + readBlock() { + const UPSTREAM_BLOCK_SIZE = 8000; + const bytes = this.str.getBytes(UPSTREAM_BLOCK_SIZE); + if (!bytes.length) { + this.eof = true; + return; + } + const maxDecodeLength = bytes.length + 1 >> 1; + const buffer = this.ensureBuffer(this.bufferLength + maxDecodeLength); + let bufferLength = this.bufferLength; + let firstDigit = this.firstDigit; + for (const ch of bytes) { + let digit; + if (ch >= 0x30 && ch <= 0x39) { + digit = ch & 0x0f; + } else if (ch >= 0x41 && ch <= 0x46 || ch >= 0x61 && ch <= 0x66) { + digit = (ch & 0x0f) + 9; + } else if (ch === 0x3e) { + this.eof = true; + break; + } else { + continue; + } + if (firstDigit < 0) { + firstDigit = digit; + } else { + buffer[bufferLength++] = firstDigit << 4 | digit; + firstDigit = -1; + } + } + if (firstDigit >= 0 && this.eof) { + buffer[bufferLength++] = firstDigit << 4; + firstDigit = -1; + } + this.firstDigit = firstDigit; + this.bufferLength = bufferLength; + } +} + +;// ./src/core/ccitt.js + +const ccittEOL = -2; +const ccittEOF = -1; +const twoDimPass = 0; +const twoDimHoriz = 1; +const twoDimVert0 = 2; +const twoDimVertR1 = 3; +const twoDimVertL1 = 4; +const twoDimVertR2 = 5; +const twoDimVertL2 = 6; +const twoDimVertR3 = 7; +const twoDimVertL3 = 8; +const twoDimTable = [[-1, -1], [-1, -1], [7, twoDimVertL3], [7, twoDimVertR3], [6, twoDimVertL2], [6, twoDimVertL2], [6, twoDimVertR2], [6, twoDimVertR2], [4, twoDimPass], [4, twoDimPass], [4, twoDimPass], [4, twoDimPass], [4, twoDimPass], [4, twoDimPass], [4, twoDimPass], [4, twoDimPass], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0]]; +const whiteTable1 = [[-1, -1], [12, ccittEOL], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [11, 1792], [11, 1792], [12, 1984], [12, 2048], [12, 2112], [12, 2176], [12, 2240], [12, 2304], [11, 1856], [11, 1856], [11, 1920], [11, 1920], [12, 2368], [12, 2432], [12, 2496], [12, 2560]]; +const whiteTable2 = [[-1, -1], [-1, -1], [-1, -1], [-1, -1], [8, 29], [8, 29], [8, 30], [8, 30], [8, 45], [8, 45], [8, 46], [8, 46], [7, 22], [7, 22], [7, 22], [7, 22], [7, 23], [7, 23], [7, 23], [7, 23], [8, 47], [8, 47], [8, 48], [8, 48], [6, 13], [6, 13], [6, 13], [6, 13], [6, 13], [6, 13], [6, 13], [6, 13], [7, 20], [7, 20], [7, 20], [7, 20], [8, 33], [8, 33], [8, 34], [8, 34], [8, 35], [8, 35], [8, 36], [8, 36], [8, 37], [8, 37], [8, 38], [8, 38], [7, 19], [7, 19], [7, 19], [7, 19], [8, 31], [8, 31], [8, 32], [8, 32], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [6, 12], [6, 12], [6, 12], [6, 12], [6, 12], [6, 12], [6, 12], [6, 12], [8, 53], [8, 53], [8, 54], [8, 54], [7, 26], [7, 26], [7, 26], [7, 26], [8, 39], [8, 39], [8, 40], [8, 40], [8, 41], [8, 41], [8, 42], [8, 42], [8, 43], [8, 43], [8, 44], [8, 44], [7, 21], [7, 21], [7, 21], [7, 21], [7, 28], [7, 28], [7, 28], [7, 28], [8, 61], [8, 61], [8, 62], [8, 62], [8, 63], [8, 63], [8, 0], [8, 0], [8, 320], [8, 320], [8, 384], [8, 384], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [7, 27], [7, 27], [7, 27], [7, 27], [8, 59], [8, 59], [8, 60], [8, 60], [9, 1472], [9, 1536], [9, 1600], [9, 1728], [7, 18], [7, 18], [7, 18], [7, 18], [7, 24], [7, 24], [7, 24], [7, 24], [8, 49], [8, 49], [8, 50], [8, 50], [8, 51], [8, 51], [8, 52], [8, 52], [7, 25], [7, 25], [7, 25], [7, 25], [8, 55], [8, 55], [8, 56], [8, 56], [8, 57], [8, 57], [8, 58], [8, 58], [6, 192], [6, 192], [6, 192], [6, 192], [6, 192], [6, 192], [6, 192], [6, 192], [6, 1664], [6, 1664], [6, 1664], [6, 1664], [6, 1664], [6, 1664], [6, 1664], [6, 1664], [8, 448], [8, 448], [8, 512], [8, 512], [9, 704], [9, 768], [8, 640], [8, 640], [8, 576], [8, 576], [9, 832], [9, 896], [9, 960], [9, 1024], [9, 1088], [9, 1152], [9, 1216], [9, 1280], [9, 1344], [9, 1408], [7, 256], [7, 256], [7, 256], [7, 256], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [6, 16], [6, 16], [6, 16], [6, 16], [6, 16], [6, 16], [6, 16], [6, 16], [6, 17], [6, 17], [6, 17], [6, 17], [6, 17], [6, 17], [6, 17], [6, 17], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [6, 14], [6, 14], [6, 14], [6, 14], [6, 14], [6, 14], [6, 14], [6, 14], [6, 15], [6, 15], [6, 15], [6, 15], [6, 15], [6, 15], [6, 15], [6, 15], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7]]; +const blackTable1 = [[-1, -1], [-1, -1], [12, ccittEOL], [12, ccittEOL], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [11, 1792], [11, 1792], [11, 1792], [11, 1792], [12, 1984], [12, 1984], [12, 2048], [12, 2048], [12, 2112], [12, 2112], [12, 2176], [12, 2176], [12, 2240], [12, 2240], [12, 2304], [12, 2304], [11, 1856], [11, 1856], [11, 1856], [11, 1856], [11, 1920], [11, 1920], [11, 1920], [11, 1920], [12, 2368], [12, 2368], [12, 2432], [12, 2432], [12, 2496], [12, 2496], [12, 2560], [12, 2560], [10, 18], [10, 18], [10, 18], [10, 18], [10, 18], [10, 18], [10, 18], [10, 18], [12, 52], [12, 52], [13, 640], [13, 704], [13, 768], [13, 832], [12, 55], [12, 55], [12, 56], [12, 56], [13, 1280], [13, 1344], [13, 1408], [13, 1472], [12, 59], [12, 59], [12, 60], [12, 60], [13, 1536], [13, 1600], [11, 24], [11, 24], [11, 24], [11, 24], [11, 25], [11, 25], [11, 25], [11, 25], [13, 1664], [13, 1728], [12, 320], [12, 320], [12, 384], [12, 384], [12, 448], [12, 448], [13, 512], [13, 576], [12, 53], [12, 53], [12, 54], [12, 54], [13, 896], [13, 960], [13, 1024], [13, 1088], [13, 1152], [13, 1216], [10, 64], [10, 64], [10, 64], [10, 64], [10, 64], [10, 64], [10, 64], [10, 64]]; +const blackTable2 = [[8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [11, 23], [11, 23], [12, 50], [12, 51], [12, 44], [12, 45], [12, 46], [12, 47], [12, 57], [12, 58], [12, 61], [12, 256], [10, 16], [10, 16], [10, 16], [10, 16], [10, 17], [10, 17], [10, 17], [10, 17], [12, 48], [12, 49], [12, 62], [12, 63], [12, 30], [12, 31], [12, 32], [12, 33], [12, 40], [12, 41], [11, 22], [11, 22], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [9, 15], [9, 15], [9, 15], [9, 15], [9, 15], [9, 15], [9, 15], [9, 15], [12, 128], [12, 192], [12, 26], [12, 27], [12, 28], [12, 29], [11, 19], [11, 19], [11, 20], [11, 20], [12, 34], [12, 35], [12, 36], [12, 37], [12, 38], [12, 39], [11, 21], [11, 21], [12, 42], [12, 43], [10, 0], [10, 0], [10, 0], [10, 0], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12]]; +const blackTable3 = [[-1, -1], [-1, -1], [-1, -1], [-1, -1], [6, 9], [6, 8], [5, 7], [5, 7], [4, 6], [4, 6], [4, 6], [4, 6], [4, 5], [4, 5], [4, 5], [4, 5], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2]]; +class CCITTFaxDecoder { + constructor(source, options = {}) { + if (typeof source?.next !== "function") { + throw new Error('CCITTFaxDecoder - invalid "source" parameter.'); + } + this.source = source; + this.eof = false; + this.encoding = options.K || 0; + this.eoline = options.EndOfLine || false; + this.byteAlign = options.EncodedByteAlign || false; + this.columns = options.Columns || 1728; + this.rows = options.Rows || 0; + this.eoblock = options.EndOfBlock ?? true; + this.black = options.BlackIs1 || false; + this.codingLine = new Uint32Array(this.columns + 1); + this.refLine = new Uint32Array(this.columns + 2); + this.codingLine[0] = this.columns; + this.codingPos = 0; + this.row = 0; + this.nextLine2D = this.encoding < 0; + this.inputBits = 0; + this.inputBuf = 0; + this.outputBits = 0; + this.rowsDone = false; + let code1; + while ((code1 = this._lookBits(12)) === 0) { + this._eatBits(1); + } + if (code1 === 1) { + this._eatBits(12); + } + if (this.encoding > 0) { + this.nextLine2D = !this._lookBits(1); + this._eatBits(1); + } + } + readNextChar() { + if (this.eof) { + return -1; + } + const refLine = this.refLine; + const codingLine = this.codingLine; + const columns = this.columns; + let refPos, blackPixels, bits, i; + if (this.outputBits === 0) { + if (this.rowsDone) { + this.eof = true; + } + if (this.eof) { + return -1; + } + this.err = false; + let code1, code2, code3; + if (this.nextLine2D) { + for (i = 0; codingLine[i] < columns; ++i) { + refLine[i] = codingLine[i]; + } + refLine[i++] = columns; + refLine[i] = columns; + codingLine[0] = 0; + this.codingPos = 0; + refPos = 0; + blackPixels = 0; + while (codingLine[this.codingPos] < columns) { + code1 = this._getTwoDimCode(); + switch (code1) { + case twoDimPass: + this._addPixels(refLine[refPos + 1], blackPixels); + if (refLine[refPos + 1] < columns) { + refPos += 2; + } + break; + case twoDimHoriz: + code1 = code2 = 0; + if (blackPixels) { + do { + code1 += code3 = this._getBlackCode(); + } while (code3 >= 64); + do { + code2 += code3 = this._getWhiteCode(); + } while (code3 >= 64); + } else { + do { + code1 += code3 = this._getWhiteCode(); + } while (code3 >= 64); + do { + code2 += code3 = this._getBlackCode(); + } while (code3 >= 64); + } + this._addPixels(codingLine[this.codingPos] + code1, blackPixels); + if (codingLine[this.codingPos] < columns) { + this._addPixels(codingLine[this.codingPos] + code2, blackPixels ^ 1); + } + while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { + refPos += 2; + } + break; + case twoDimVertR3: + this._addPixels(refLine[refPos] + 3, blackPixels); + blackPixels ^= 1; + if (codingLine[this.codingPos] < columns) { + ++refPos; + while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { + refPos += 2; + } + } + break; + case twoDimVertR2: + this._addPixels(refLine[refPos] + 2, blackPixels); + blackPixels ^= 1; + if (codingLine[this.codingPos] < columns) { + ++refPos; + while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { + refPos += 2; + } + } + break; + case twoDimVertR1: + this._addPixels(refLine[refPos] + 1, blackPixels); + blackPixels ^= 1; + if (codingLine[this.codingPos] < columns) { + ++refPos; + while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { + refPos += 2; + } + } + break; + case twoDimVert0: + this._addPixels(refLine[refPos], blackPixels); + blackPixels ^= 1; + if (codingLine[this.codingPos] < columns) { + ++refPos; + while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { + refPos += 2; + } + } + break; + case twoDimVertL3: + this._addPixelsNeg(refLine[refPos] - 3, blackPixels); + blackPixels ^= 1; + if (codingLine[this.codingPos] < columns) { + if (refPos > 0) { + --refPos; + } else { + ++refPos; + } + while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { + refPos += 2; + } + } + break; + case twoDimVertL2: + this._addPixelsNeg(refLine[refPos] - 2, blackPixels); + blackPixels ^= 1; + if (codingLine[this.codingPos] < columns) { + if (refPos > 0) { + --refPos; + } else { + ++refPos; + } + while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { + refPos += 2; + } + } + break; + case twoDimVertL1: + this._addPixelsNeg(refLine[refPos] - 1, blackPixels); + blackPixels ^= 1; + if (codingLine[this.codingPos] < columns) { + if (refPos > 0) { + --refPos; + } else { + ++refPos; + } + while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { + refPos += 2; + } + } + break; + case ccittEOF: + this._addPixels(columns, 0); + this.eof = true; + break; + default: + info("bad 2d code"); + this._addPixels(columns, 0); + this.err = true; + } + } + } else { + codingLine[0] = 0; + this.codingPos = 0; + blackPixels = 0; + while (codingLine[this.codingPos] < columns) { + code1 = 0; + if (blackPixels) { + do { + code1 += code3 = this._getBlackCode(); + } while (code3 >= 64); + } else { + do { + code1 += code3 = this._getWhiteCode(); + } while (code3 >= 64); + } + this._addPixels(codingLine[this.codingPos] + code1, blackPixels); + blackPixels ^= 1; + } + } + let gotEOL = false; + if (this.byteAlign) { + this.inputBits &= ~7; + } + if (!this.eoblock && this.row === this.rows - 1) { + this.rowsDone = true; + } else { + code1 = this._lookBits(12); + if (this.eoline) { + while (code1 !== ccittEOF && code1 !== 1) { + this._eatBits(1); + code1 = this._lookBits(12); + } + } else { + while (code1 === 0) { + this._eatBits(1); + code1 = this._lookBits(12); + } + } + if (code1 === 1) { + this._eatBits(12); + gotEOL = true; + } else if (code1 === ccittEOF) { + this.eof = true; + } + } + if (!this.eof && this.encoding > 0 && !this.rowsDone) { + this.nextLine2D = !this._lookBits(1); + this._eatBits(1); + } + if (this.eoblock && gotEOL && this.byteAlign) { + code1 = this._lookBits(12); + if (code1 === 1) { + this._eatBits(12); + if (this.encoding > 0) { + this._lookBits(1); + this._eatBits(1); + } + if (this.encoding >= 0) { + for (i = 0; i < 4; ++i) { + code1 = this._lookBits(12); + if (code1 !== 1) { + info("bad rtc code: " + code1); + } + this._eatBits(12); + if (this.encoding > 0) { + this._lookBits(1); + this._eatBits(1); + } + } + } + this.eof = true; + } + } else if (this.err && this.eoline) { + while (true) { + code1 = this._lookBits(13); + if (code1 === ccittEOF) { + this.eof = true; + return -1; + } + if (code1 >> 1 === 1) { + break; + } + this._eatBits(1); + } + this._eatBits(12); + if (this.encoding > 0) { + this._eatBits(1); + this.nextLine2D = !(code1 & 1); + } + } + this.outputBits = codingLine[0] > 0 ? codingLine[this.codingPos = 0] : codingLine[this.codingPos = 1]; + this.row++; + } + let c; + if (this.outputBits >= 8) { + c = this.codingPos & 1 ? 0 : 0xff; + this.outputBits -= 8; + if (this.outputBits === 0 && codingLine[this.codingPos] < columns) { + this.codingPos++; + this.outputBits = codingLine[this.codingPos] - codingLine[this.codingPos - 1]; + } + } else { + bits = 8; + c = 0; + do { + if (typeof this.outputBits !== "number") { + throw new FormatError('Invalid /CCITTFaxDecode data, "outputBits" must be a number.'); + } + if (this.outputBits > bits) { + c <<= bits; + if (!(this.codingPos & 1)) { + c |= 0xff >> 8 - bits; + } + this.outputBits -= bits; + bits = 0; + } else { + c <<= this.outputBits; + if (!(this.codingPos & 1)) { + c |= 0xff >> 8 - this.outputBits; + } + bits -= this.outputBits; + this.outputBits = 0; + if (codingLine[this.codingPos] < columns) { + this.codingPos++; + this.outputBits = codingLine[this.codingPos] - codingLine[this.codingPos - 1]; + } else if (bits > 0) { + c <<= bits; + bits = 0; + } + } + } while (bits); + } + if (this.black) { + c ^= 0xff; + } + return c; + } + _addPixels(a1, blackPixels) { + const codingLine = this.codingLine; + let codingPos = this.codingPos; + if (a1 > codingLine[codingPos]) { + if (a1 > this.columns) { + info("row is wrong length"); + this.err = true; + a1 = this.columns; + } + if (codingPos & 1 ^ blackPixels) { + ++codingPos; + } + codingLine[codingPos] = a1; + } + this.codingPos = codingPos; + } + _addPixelsNeg(a1, blackPixels) { + const codingLine = this.codingLine; + let codingPos = this.codingPos; + if (a1 > codingLine[codingPos]) { + if (a1 > this.columns) { + info("row is wrong length"); + this.err = true; + a1 = this.columns; + } + if (codingPos & 1 ^ blackPixels) { + ++codingPos; + } + codingLine[codingPos] = a1; + } else if (a1 < codingLine[codingPos]) { + if (a1 < 0) { + info("invalid code"); + this.err = true; + a1 = 0; + } + while (codingPos > 0 && a1 < codingLine[codingPos - 1]) { + --codingPos; + } + codingLine[codingPos] = a1; + } + this.codingPos = codingPos; + } + _findTableCode(start, end, table, limit) { + const limitValue = limit || 0; + for (let i = start; i <= end; ++i) { + let code = this._lookBits(i); + if (code === ccittEOF) { + return [true, 1, false]; + } + if (i < end) { + code <<= end - i; + } + if (!limitValue || code >= limitValue) { + const p = table[code - limitValue]; + if (p[0] === i) { + this._eatBits(i); + return [true, p[1], true]; + } + } + } + return [false, 0, false]; + } + _getTwoDimCode() { + let code = 0; + let p; + if (this.eoblock) { + code = this._lookBits(7); + p = twoDimTable[code]; + if (p?.[0] > 0) { + this._eatBits(p[0]); + return p[1]; + } + } else { + const result = this._findTableCode(1, 7, twoDimTable); + if (result[0] && result[2]) { + return result[1]; + } + } + info("Bad two dim code"); + return ccittEOF; + } + _getWhiteCode() { + let code = 0; + let p; + if (this.eoblock) { + code = this._lookBits(12); + if (code === ccittEOF) { + return 1; + } + p = code >> 5 === 0 ? whiteTable1[code] : whiteTable2[code >> 3]; + if (p[0] > 0) { + this._eatBits(p[0]); + return p[1]; + } + } else { + let result = this._findTableCode(1, 9, whiteTable2); + if (result[0]) { + return result[1]; + } + result = this._findTableCode(11, 12, whiteTable1); + if (result[0]) { + return result[1]; + } + } + info("bad white code"); + this._eatBits(1); + return 1; + } + _getBlackCode() { + let code, p; + if (this.eoblock) { + code = this._lookBits(13); + if (code === ccittEOF) { + return 1; + } + if (code >> 7 === 0) { + p = blackTable1[code]; + } else if (code >> 9 === 0 && code >> 7 !== 0) { + p = blackTable2[(code >> 1) - 64]; + } else { + p = blackTable3[code >> 7]; + } + if (p[0] > 0) { + this._eatBits(p[0]); + return p[1]; + } + } else { + let result = this._findTableCode(2, 6, blackTable3); + if (result[0]) { + return result[1]; + } + result = this._findTableCode(7, 12, blackTable2, 64); + if (result[0]) { + return result[1]; + } + result = this._findTableCode(10, 13, blackTable1); + if (result[0]) { + return result[1]; + } + } + info("bad black code"); + this._eatBits(1); + return 1; + } + _lookBits(n) { + let c; + while (this.inputBits < n) { + if ((c = this.source.next()) === -1) { + if (this.inputBits === 0) { + return ccittEOF; + } + return this.inputBuf << n - this.inputBits & 0xffff >> 16 - n; + } + this.inputBuf = this.inputBuf << 8 | c; + this.inputBits += 8; + } + return this.inputBuf >> this.inputBits - n & 0xffff >> 16 - n; + } + _eatBits(n) { + if ((this.inputBits -= n) < 0) { + this.inputBits = 0; + } + } +} + +;// ./src/core/ccitt_stream.js + + + +class CCITTFaxStream extends DecodeStream { + constructor(str, maybeLength, params) { + super(maybeLength); + this.str = str; + this.dict = str.dict; + if (!(params instanceof Dict)) { + params = Dict.empty; + } + const source = { + next() { + return str.getByte(); + } + }; + this.ccittFaxDecoder = new CCITTFaxDecoder(source, { + K: params.get("K"), + EndOfLine: params.get("EndOfLine"), + EncodedByteAlign: params.get("EncodedByteAlign"), + Columns: params.get("Columns"), + Rows: params.get("Rows"), + EndOfBlock: params.get("EndOfBlock"), + BlackIs1: params.get("BlackIs1") + }); + } + readBlock() { + while (!this.eof) { + const c = this.ccittFaxDecoder.readNextChar(); + if (c === -1) { + this.eof = true; + return; + } + this.ensureBuffer(this.bufferLength + 1); + this.buffer[this.bufferLength++] = c; + } + } +} + +;// ./src/core/flate_stream.js + + + +const codeLenCodeMap = new Int32Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]); +const lengthDecode = new Int32Array([0x00003, 0x00004, 0x00005, 0x00006, 0x00007, 0x00008, 0x00009, 0x0000a, 0x1000b, 0x1000d, 0x1000f, 0x10011, 0x20013, 0x20017, 0x2001b, 0x2001f, 0x30023, 0x3002b, 0x30033, 0x3003b, 0x40043, 0x40053, 0x40063, 0x40073, 0x50083, 0x500a3, 0x500c3, 0x500e3, 0x00102, 0x00102, 0x00102]); +const distDecode = new Int32Array([0x00001, 0x00002, 0x00003, 0x00004, 0x10005, 0x10007, 0x20009, 0x2000d, 0x30011, 0x30019, 0x40021, 0x40031, 0x50041, 0x50061, 0x60081, 0x600c1, 0x70101, 0x70181, 0x80201, 0x80301, 0x90401, 0x90601, 0xa0801, 0xa0c01, 0xb1001, 0xb1801, 0xc2001, 0xc3001, 0xd4001, 0xd6001]); +const fixedLitCodeTab = [new Int32Array([0x70100, 0x80050, 0x80010, 0x80118, 0x70110, 0x80070, 0x80030, 0x900c0, 0x70108, 0x80060, 0x80020, 0x900a0, 0x80000, 0x80080, 0x80040, 0x900e0, 0x70104, 0x80058, 0x80018, 0x90090, 0x70114, 0x80078, 0x80038, 0x900d0, 0x7010c, 0x80068, 0x80028, 0x900b0, 0x80008, 0x80088, 0x80048, 0x900f0, 0x70102, 0x80054, 0x80014, 0x8011c, 0x70112, 0x80074, 0x80034, 0x900c8, 0x7010a, 0x80064, 0x80024, 0x900a8, 0x80004, 0x80084, 0x80044, 0x900e8, 0x70106, 0x8005c, 0x8001c, 0x90098, 0x70116, 0x8007c, 0x8003c, 0x900d8, 0x7010e, 0x8006c, 0x8002c, 0x900b8, 0x8000c, 0x8008c, 0x8004c, 0x900f8, 0x70101, 0x80052, 0x80012, 0x8011a, 0x70111, 0x80072, 0x80032, 0x900c4, 0x70109, 0x80062, 0x80022, 0x900a4, 0x80002, 0x80082, 0x80042, 0x900e4, 0x70105, 0x8005a, 0x8001a, 0x90094, 0x70115, 0x8007a, 0x8003a, 0x900d4, 0x7010d, 0x8006a, 0x8002a, 0x900b4, 0x8000a, 0x8008a, 0x8004a, 0x900f4, 0x70103, 0x80056, 0x80016, 0x8011e, 0x70113, 0x80076, 0x80036, 0x900cc, 0x7010b, 0x80066, 0x80026, 0x900ac, 0x80006, 0x80086, 0x80046, 0x900ec, 0x70107, 0x8005e, 0x8001e, 0x9009c, 0x70117, 0x8007e, 0x8003e, 0x900dc, 0x7010f, 0x8006e, 0x8002e, 0x900bc, 0x8000e, 0x8008e, 0x8004e, 0x900fc, 0x70100, 0x80051, 0x80011, 0x80119, 0x70110, 0x80071, 0x80031, 0x900c2, 0x70108, 0x80061, 0x80021, 0x900a2, 0x80001, 0x80081, 0x80041, 0x900e2, 0x70104, 0x80059, 0x80019, 0x90092, 0x70114, 0x80079, 0x80039, 0x900d2, 0x7010c, 0x80069, 0x80029, 0x900b2, 0x80009, 0x80089, 0x80049, 0x900f2, 0x70102, 0x80055, 0x80015, 0x8011d, 0x70112, 0x80075, 0x80035, 0x900ca, 0x7010a, 0x80065, 0x80025, 0x900aa, 0x80005, 0x80085, 0x80045, 0x900ea, 0x70106, 0x8005d, 0x8001d, 0x9009a, 0x70116, 0x8007d, 0x8003d, 0x900da, 0x7010e, 0x8006d, 0x8002d, 0x900ba, 0x8000d, 0x8008d, 0x8004d, 0x900fa, 0x70101, 0x80053, 0x80013, 0x8011b, 0x70111, 0x80073, 0x80033, 0x900c6, 0x70109, 0x80063, 0x80023, 0x900a6, 0x80003, 0x80083, 0x80043, 0x900e6, 0x70105, 0x8005b, 0x8001b, 0x90096, 0x70115, 0x8007b, 0x8003b, 0x900d6, 0x7010d, 0x8006b, 0x8002b, 0x900b6, 0x8000b, 0x8008b, 0x8004b, 0x900f6, 0x70103, 0x80057, 0x80017, 0x8011f, 0x70113, 0x80077, 0x80037, 0x900ce, 0x7010b, 0x80067, 0x80027, 0x900ae, 0x80007, 0x80087, 0x80047, 0x900ee, 0x70107, 0x8005f, 0x8001f, 0x9009e, 0x70117, 0x8007f, 0x8003f, 0x900de, 0x7010f, 0x8006f, 0x8002f, 0x900be, 0x8000f, 0x8008f, 0x8004f, 0x900fe, 0x70100, 0x80050, 0x80010, 0x80118, 0x70110, 0x80070, 0x80030, 0x900c1, 0x70108, 0x80060, 0x80020, 0x900a1, 0x80000, 0x80080, 0x80040, 0x900e1, 0x70104, 0x80058, 0x80018, 0x90091, 0x70114, 0x80078, 0x80038, 0x900d1, 0x7010c, 0x80068, 0x80028, 0x900b1, 0x80008, 0x80088, 0x80048, 0x900f1, 0x70102, 0x80054, 0x80014, 0x8011c, 0x70112, 0x80074, 0x80034, 0x900c9, 0x7010a, 0x80064, 0x80024, 0x900a9, 0x80004, 0x80084, 0x80044, 0x900e9, 0x70106, 0x8005c, 0x8001c, 0x90099, 0x70116, 0x8007c, 0x8003c, 0x900d9, 0x7010e, 0x8006c, 0x8002c, 0x900b9, 0x8000c, 0x8008c, 0x8004c, 0x900f9, 0x70101, 0x80052, 0x80012, 0x8011a, 0x70111, 0x80072, 0x80032, 0x900c5, 0x70109, 0x80062, 0x80022, 0x900a5, 0x80002, 0x80082, 0x80042, 0x900e5, 0x70105, 0x8005a, 0x8001a, 0x90095, 0x70115, 0x8007a, 0x8003a, 0x900d5, 0x7010d, 0x8006a, 0x8002a, 0x900b5, 0x8000a, 0x8008a, 0x8004a, 0x900f5, 0x70103, 0x80056, 0x80016, 0x8011e, 0x70113, 0x80076, 0x80036, 0x900cd, 0x7010b, 0x80066, 0x80026, 0x900ad, 0x80006, 0x80086, 0x80046, 0x900ed, 0x70107, 0x8005e, 0x8001e, 0x9009d, 0x70117, 0x8007e, 0x8003e, 0x900dd, 0x7010f, 0x8006e, 0x8002e, 0x900bd, 0x8000e, 0x8008e, 0x8004e, 0x900fd, 0x70100, 0x80051, 0x80011, 0x80119, 0x70110, 0x80071, 0x80031, 0x900c3, 0x70108, 0x80061, 0x80021, 0x900a3, 0x80001, 0x80081, 0x80041, 0x900e3, 0x70104, 0x80059, 0x80019, 0x90093, 0x70114, 0x80079, 0x80039, 0x900d3, 0x7010c, 0x80069, 0x80029, 0x900b3, 0x80009, 0x80089, 0x80049, 0x900f3, 0x70102, 0x80055, 0x80015, 0x8011d, 0x70112, 0x80075, 0x80035, 0x900cb, 0x7010a, 0x80065, 0x80025, 0x900ab, 0x80005, 0x80085, 0x80045, 0x900eb, 0x70106, 0x8005d, 0x8001d, 0x9009b, 0x70116, 0x8007d, 0x8003d, 0x900db, 0x7010e, 0x8006d, 0x8002d, 0x900bb, 0x8000d, 0x8008d, 0x8004d, 0x900fb, 0x70101, 0x80053, 0x80013, 0x8011b, 0x70111, 0x80073, 0x80033, 0x900c7, 0x70109, 0x80063, 0x80023, 0x900a7, 0x80003, 0x80083, 0x80043, 0x900e7, 0x70105, 0x8005b, 0x8001b, 0x90097, 0x70115, 0x8007b, 0x8003b, 0x900d7, 0x7010d, 0x8006b, 0x8002b, 0x900b7, 0x8000b, 0x8008b, 0x8004b, 0x900f7, 0x70103, 0x80057, 0x80017, 0x8011f, 0x70113, 0x80077, 0x80037, 0x900cf, 0x7010b, 0x80067, 0x80027, 0x900af, 0x80007, 0x80087, 0x80047, 0x900ef, 0x70107, 0x8005f, 0x8001f, 0x9009f, 0x70117, 0x8007f, 0x8003f, 0x900df, 0x7010f, 0x8006f, 0x8002f, 0x900bf, 0x8000f, 0x8008f, 0x8004f, 0x900ff]), 9]; +const fixedDistCodeTab = [new Int32Array([0x50000, 0x50010, 0x50008, 0x50018, 0x50004, 0x50014, 0x5000c, 0x5001c, 0x50002, 0x50012, 0x5000a, 0x5001a, 0x50006, 0x50016, 0x5000e, 0x00000, 0x50001, 0x50011, 0x50009, 0x50019, 0x50005, 0x50015, 0x5000d, 0x5001d, 0x50003, 0x50013, 0x5000b, 0x5001b, 0x50007, 0x50017, 0x5000f, 0x00000]), 5]; +class FlateStream extends DecodeStream { + constructor(str, maybeLength) { + super(maybeLength); + this.str = str; + this.dict = str.dict; + const cmf = str.getByte(); + const flg = str.getByte(); + if (cmf === -1 || flg === -1) { + throw new FormatError(`Invalid header in flate stream: ${cmf}, ${flg}`); + } + if ((cmf & 0x0f) !== 0x08) { + throw new FormatError(`Unknown compression method in flate stream: ${cmf}, ${flg}`); + } + if (((cmf << 8) + flg) % 31 !== 0) { + throw new FormatError(`Bad FCHECK in flate stream: ${cmf}, ${flg}`); + } + if (flg & 0x20) { + throw new FormatError(`FDICT bit set in flate stream: ${cmf}, ${flg}`); + } + this.codeSize = 0; + this.codeBuf = 0; + } + async getImageData(length, _decoderOptions) { + const data = await this.asyncGetBytes(); + return data?.subarray(0, length) || this.getBytes(length); + } + async asyncGetBytes() { + this.str.reset(); + const bytes = this.str.getBytes(); + try { + const { + readable, + writable + } = new DecompressionStream("deflate"); + const writer = writable.getWriter(); + await writer.ready; + writer.write(bytes).then(async () => { + await writer.ready; + await writer.close(); + }).catch(() => {}); + const chunks = []; + let totalLength = 0; + for await (const chunk of readable) { + chunks.push(chunk); + totalLength += chunk.byteLength; + } + const data = new Uint8Array(totalLength); + let offset = 0; + for (const chunk of chunks) { + data.set(chunk, offset); + offset += chunk.byteLength; + } + return data; + } catch { + this.str = new Stream(bytes, 2, bytes.length, this.str.dict); + this.reset(); + return null; + } + } + get isAsync() { + return true; + } + getBits(bits) { + const str = this.str; + let codeSize = this.codeSize; + let codeBuf = this.codeBuf; + let b; + while (codeSize < bits) { + if ((b = str.getByte()) === -1) { + throw new FormatError("Bad encoding in flate stream"); + } + codeBuf |= b << codeSize; + codeSize += 8; + } + b = codeBuf & (1 << bits) - 1; + this.codeBuf = codeBuf >> bits; + this.codeSize = codeSize -= bits; + return b; + } + getCode(table) { + const str = this.str; + const codes = table[0]; + const maxLen = table[1]; + let codeSize = this.codeSize; + let codeBuf = this.codeBuf; + let b; + while (codeSize < maxLen) { + if ((b = str.getByte()) === -1) { + break; + } + codeBuf |= b << codeSize; + codeSize += 8; + } + const code = codes[codeBuf & (1 << maxLen) - 1]; + const codeLen = code >> 16; + const codeVal = code & 0xffff; + if (codeLen < 1 || codeSize < codeLen) { + throw new FormatError("Bad encoding in flate stream"); + } + this.codeBuf = codeBuf >> codeLen; + this.codeSize = codeSize - codeLen; + return codeVal; + } + generateHuffmanTable(lengths) { + const n = lengths.length; + let maxLen = 0; + let i; + for (i = 0; i < n; ++i) { + if (lengths[i] > maxLen) { + maxLen = lengths[i]; + } + } + const size = 1 << maxLen; + const codes = new Int32Array(size); + for (let len = 1, code = 0, skip = 2; len <= maxLen; ++len, code <<= 1, skip <<= 1) { + for (let val = 0; val < n; ++val) { + if (lengths[val] === len) { + let code2 = 0; + let t = code; + for (i = 0; i < len; ++i) { + code2 = code2 << 1 | t & 1; + t >>= 1; + } + for (i = code2; i < size; i += skip) { + codes[i] = len << 16 | val; + } + ++code; + } + } + } + return [codes, maxLen]; + } + #endsStreamOnError(err) { + info(err); + this.eof = true; + } + readBlock() { + let buffer, hdr, len; + const str = this.str; + try { + hdr = this.getBits(3); + } catch (ex) { + this.#endsStreamOnError(ex.message); + return; + } + if (hdr & 1) { + this.eof = true; + } + hdr >>= 1; + if (hdr === 0) { + let b; + if ((b = str.getByte()) === -1) { + this.#endsStreamOnError("Bad block header in flate stream"); + return; + } + let blockLen = b; + if ((b = str.getByte()) === -1) { + this.#endsStreamOnError("Bad block header in flate stream"); + return; + } + blockLen |= b << 8; + if ((b = str.getByte()) === -1) { + this.#endsStreamOnError("Bad block header in flate stream"); + return; + } + let check = b; + if ((b = str.getByte()) === -1) { + this.#endsStreamOnError("Bad block header in flate stream"); + return; + } + check |= b << 8; + if (check !== (~blockLen & 0xffff) && (blockLen !== 0 || check !== 0)) { + throw new FormatError("Bad uncompressed block length in flate stream"); + } + this.codeBuf = 0; + this.codeSize = 0; + const bufferLength = this.bufferLength, + end = bufferLength + blockLen; + buffer = this.ensureBuffer(end); + this.bufferLength = end; + if (blockLen === 0) { + if (str.peekByte() === -1) { + this.eof = true; + } + } else { + const block = str.getBytes(blockLen); + buffer.set(block, bufferLength); + if (block.length < blockLen) { + this.eof = true; + } + } + return; + } + let litCodeTable; + let distCodeTable; + if (hdr === 1) { + litCodeTable = fixedLitCodeTab; + distCodeTable = fixedDistCodeTab; + } else if (hdr === 2) { + const numLitCodes = this.getBits(5) + 257; + const numDistCodes = this.getBits(5) + 1; + const numCodeLenCodes = this.getBits(4) + 4; + const codeLenCodeLengths = new Uint8Array(codeLenCodeMap.length); + let i; + for (i = 0; i < numCodeLenCodes; ++i) { + codeLenCodeLengths[codeLenCodeMap[i]] = this.getBits(3); + } + const codeLenCodeTab = this.generateHuffmanTable(codeLenCodeLengths); + len = 0; + i = 0; + const codes = numLitCodes + numDistCodes; + const codeLengths = new Uint8Array(codes); + let bitsLength, bitsOffset, what; + while (i < codes) { + const code = this.getCode(codeLenCodeTab); + if (code === 16) { + bitsLength = 2; + bitsOffset = 3; + what = len; + } else if (code === 17) { + bitsLength = 3; + bitsOffset = 3; + what = len = 0; + } else if (code === 18) { + bitsLength = 7; + bitsOffset = 11; + what = len = 0; + } else { + codeLengths[i++] = len = code; + continue; + } + let repeatLength = this.getBits(bitsLength) + bitsOffset; + while (repeatLength-- > 0) { + codeLengths[i++] = what; + } + } + litCodeTable = this.generateHuffmanTable(codeLengths.subarray(0, numLitCodes)); + distCodeTable = this.generateHuffmanTable(codeLengths.subarray(numLitCodes, codes)); + } else { + throw new FormatError("Unknown block type in flate stream"); + } + buffer = this.buffer; + let limit = buffer ? buffer.length : 0; + let pos = this.bufferLength; + while (true) { + let code1 = this.getCode(litCodeTable); + if (code1 < 256) { + if (pos + 1 >= limit) { + buffer = this.ensureBuffer(pos + 1); + limit = buffer.length; + } + buffer[pos++] = code1; + continue; + } + if (code1 === 256) { + this.bufferLength = pos; + return; + } + code1 -= 257; + code1 = lengthDecode[code1]; + let code2 = code1 >> 16; + if (code2 > 0) { + code2 = this.getBits(code2); + } + len = (code1 & 0xffff) + code2; + code1 = this.getCode(distCodeTable); + code1 = distDecode[code1]; + code2 = code1 >> 16; + if (code2 > 0) { + code2 = this.getBits(code2); + } + const dist = (code1 & 0xffff) + code2; + if (pos + len >= limit) { + buffer = this.ensureBuffer(pos + len); + limit = buffer.length; + } + for (let k = 0; k < len; ++k, ++pos) { + buffer[pos] = buffer[pos - dist]; + } + } + } +} + +;// ./src/core/arithmetic_decoder.js +const QeTable = [{ + qe: 0x5601, + nmps: 1, + nlps: 1, + switchFlag: 1 +}, { + qe: 0x3401, + nmps: 2, + nlps: 6, + switchFlag: 0 +}, { + qe: 0x1801, + nmps: 3, + nlps: 9, + switchFlag: 0 +}, { + qe: 0x0ac1, + nmps: 4, + nlps: 12, + switchFlag: 0 +}, { + qe: 0x0521, + nmps: 5, + nlps: 29, + switchFlag: 0 +}, { + qe: 0x0221, + nmps: 38, + nlps: 33, + switchFlag: 0 +}, { + qe: 0x5601, + nmps: 7, + nlps: 6, + switchFlag: 1 +}, { + qe: 0x5401, + nmps: 8, + nlps: 14, + switchFlag: 0 +}, { + qe: 0x4801, + nmps: 9, + nlps: 14, + switchFlag: 0 +}, { + qe: 0x3801, + nmps: 10, + nlps: 14, + switchFlag: 0 +}, { + qe: 0x3001, + nmps: 11, + nlps: 17, + switchFlag: 0 +}, { + qe: 0x2401, + nmps: 12, + nlps: 18, + switchFlag: 0 +}, { + qe: 0x1c01, + nmps: 13, + nlps: 20, + switchFlag: 0 +}, { + qe: 0x1601, + nmps: 29, + nlps: 21, + switchFlag: 0 +}, { + qe: 0x5601, + nmps: 15, + nlps: 14, + switchFlag: 1 +}, { + qe: 0x5401, + nmps: 16, + nlps: 14, + switchFlag: 0 +}, { + qe: 0x5101, + nmps: 17, + nlps: 15, + switchFlag: 0 +}, { + qe: 0x4801, + nmps: 18, + nlps: 16, + switchFlag: 0 +}, { + qe: 0x3801, + nmps: 19, + nlps: 17, + switchFlag: 0 +}, { + qe: 0x3401, + nmps: 20, + nlps: 18, + switchFlag: 0 +}, { + qe: 0x3001, + nmps: 21, + nlps: 19, + switchFlag: 0 +}, { + qe: 0x2801, + nmps: 22, + nlps: 19, + switchFlag: 0 +}, { + qe: 0x2401, + nmps: 23, + nlps: 20, + switchFlag: 0 +}, { + qe: 0x2201, + nmps: 24, + nlps: 21, + switchFlag: 0 +}, { + qe: 0x1c01, + nmps: 25, + nlps: 22, + switchFlag: 0 +}, { + qe: 0x1801, + nmps: 26, + nlps: 23, + switchFlag: 0 +}, { + qe: 0x1601, + nmps: 27, + nlps: 24, + switchFlag: 0 +}, { + qe: 0x1401, + nmps: 28, + nlps: 25, + switchFlag: 0 +}, { + qe: 0x1201, + nmps: 29, + nlps: 26, + switchFlag: 0 +}, { + qe: 0x1101, + nmps: 30, + nlps: 27, + switchFlag: 0 +}, { + qe: 0x0ac1, + nmps: 31, + nlps: 28, + switchFlag: 0 +}, { + qe: 0x09c1, + nmps: 32, + nlps: 29, + switchFlag: 0 +}, { + qe: 0x08a1, + nmps: 33, + nlps: 30, + switchFlag: 0 +}, { + qe: 0x0521, + nmps: 34, + nlps: 31, + switchFlag: 0 +}, { + qe: 0x0441, + nmps: 35, + nlps: 32, + switchFlag: 0 +}, { + qe: 0x02a1, + nmps: 36, + nlps: 33, + switchFlag: 0 +}, { + qe: 0x0221, + nmps: 37, + nlps: 34, + switchFlag: 0 +}, { + qe: 0x0141, + nmps: 38, + nlps: 35, + switchFlag: 0 +}, { + qe: 0x0111, + nmps: 39, + nlps: 36, + switchFlag: 0 +}, { + qe: 0x0085, + nmps: 40, + nlps: 37, + switchFlag: 0 +}, { + qe: 0x0049, + nmps: 41, + nlps: 38, + switchFlag: 0 +}, { + qe: 0x0025, + nmps: 42, + nlps: 39, + switchFlag: 0 +}, { + qe: 0x0015, + nmps: 43, + nlps: 40, + switchFlag: 0 +}, { + qe: 0x0009, + nmps: 44, + nlps: 41, + switchFlag: 0 +}, { + qe: 0x0005, + nmps: 45, + nlps: 42, + switchFlag: 0 +}, { + qe: 0x0001, + nmps: 45, + nlps: 43, + switchFlag: 0 +}, { + qe: 0x5601, + nmps: 46, + nlps: 46, + switchFlag: 0 +}]; +class ArithmeticDecoder { + constructor(data, start, end) { + this.data = data; + this.bp = start; + this.dataEnd = end; + this.chigh = data[start]; + this.clow = 0; + this.byteIn(); + this.chigh = this.chigh << 7 & 0xffff | this.clow >> 9 & 0x7f; + this.clow = this.clow << 7 & 0xffff; + this.ct -= 7; + this.a = 0x8000; + } + byteIn() { + const data = this.data; + let bp = this.bp; + if (data[bp] === 0xff) { + if (data[bp + 1] > 0x8f) { + this.clow += 0xff00; + this.ct = 8; + } else { + bp++; + this.clow += data[bp] << 9; + this.ct = 7; + this.bp = bp; + } + } else { + bp++; + this.clow += bp < this.dataEnd ? data[bp] << 8 : 0xff00; + this.ct = 8; + this.bp = bp; + } + if (this.clow > 0xffff) { + this.chigh += this.clow >> 16; + this.clow &= 0xffff; + } + } + readBit(contexts, pos) { + let cx_index = contexts[pos] >> 1, + cx_mps = contexts[pos] & 1; + const qeTableIcx = QeTable[cx_index]; + const qeIcx = qeTableIcx.qe; + let d; + let a = this.a - qeIcx; + if (this.chigh < qeIcx) { + if (a < qeIcx) { + a = qeIcx; + d = cx_mps; + cx_index = qeTableIcx.nmps; + } else { + a = qeIcx; + d = 1 ^ cx_mps; + if (qeTableIcx.switchFlag === 1) { + cx_mps = d; + } + cx_index = qeTableIcx.nlps; + } + } else { + this.chigh -= qeIcx; + if ((a & 0x8000) !== 0) { + this.a = a; + return cx_mps; + } + if (a < qeIcx) { + d = 1 ^ cx_mps; + if (qeTableIcx.switchFlag === 1) { + cx_mps = d; + } + cx_index = qeTableIcx.nlps; + } else { + d = cx_mps; + cx_index = qeTableIcx.nmps; + } + } + do { + if (this.ct === 0) { + this.byteIn(); + } + a <<= 1; + this.chigh = this.chigh << 1 & 0xffff | this.clow >> 15 & 1; + this.clow = this.clow << 1 & 0xffff; + this.ct--; + } while ((a & 0x8000) === 0); + this.a = a; + contexts[pos] = cx_index << 1 | cx_mps; + return d; + } +} + +;// ./src/core/jbig2.js + + + + +class Jbig2Error extends BaseException { + constructor(msg) { + super(msg, "Jbig2Error"); + } +} +class ContextCache { + getContexts(id) { + if (id in this) { + return this[id]; + } + return this[id] = new Int8Array(1 << 16); + } +} +class DecodingContext { + constructor(data, start, end) { + this.data = data; + this.start = start; + this.end = end; + } + get decoder() { + const decoder = new ArithmeticDecoder(this.data, this.start, this.end); + return shadow(this, "decoder", decoder); + } + get contextCache() { + const cache = new ContextCache(); + return shadow(this, "contextCache", cache); + } +} +function decodeInteger(contextCache, procedure, decoder) { + const contexts = contextCache.getContexts(procedure); + let prev = 1; + function readBits(length) { + let v = 0; + for (let i = 0; i < length; i++) { + const bit = decoder.readBit(contexts, prev); + prev = prev < 256 ? prev << 1 | bit : (prev << 1 | bit) & 511 | 256; + v = v << 1 | bit; + } + return v >>> 0; + } + const sign = readBits(1); + const value = readBits(1) ? readBits(1) ? readBits(1) ? readBits(1) ? readBits(1) ? readBits(32) + 4436 : readBits(12) + 340 : readBits(8) + 84 : readBits(6) + 20 : readBits(4) + 4 : readBits(2); + let signedValue; + if (sign === 0) { + signedValue = value; + } else if (value > 0) { + signedValue = -value; + } + if (signedValue >= MIN_INT_32 && signedValue <= MAX_INT_32) { + return signedValue; + } + return null; +} +function decodeIAID(contextCache, decoder, codeLength) { + const contexts = contextCache.getContexts("IAID"); + let prev = 1; + for (let i = 0; i < codeLength; i++) { + const bit = decoder.readBit(contexts, prev); + prev = prev << 1 | bit; + } + if (codeLength < 31) { + return prev & (1 << codeLength) - 1; + } + return prev & 0x7fffffff; +} +const SegmentTypes = ["SymbolDictionary", null, null, null, "IntermediateTextRegion", null, "ImmediateTextRegion", "ImmediateLosslessTextRegion", null, null, null, null, null, null, null, null, "PatternDictionary", null, null, null, "IntermediateHalftoneRegion", null, "ImmediateHalftoneRegion", "ImmediateLosslessHalftoneRegion", null, null, null, null, null, null, null, null, null, null, null, null, "IntermediateGenericRegion", null, "ImmediateGenericRegion", "ImmediateLosslessGenericRegion", "IntermediateGenericRefinementRegion", null, "ImmediateGenericRefinementRegion", "ImmediateLosslessGenericRefinementRegion", null, null, null, null, "PageInformation", "EndOfPage", "EndOfStripe", "EndOfFile", "Profiles", "Tables", null, null, null, null, null, null, null, null, "Extension"]; +const CodingTemplates = [[{ + x: -1, + y: -2 +}, { + x: 0, + y: -2 +}, { + x: 1, + y: -2 +}, { + x: -2, + y: -1 +}, { + x: -1, + y: -1 +}, { + x: 0, + y: -1 +}, { + x: 1, + y: -1 +}, { + x: 2, + y: -1 +}, { + x: -4, + y: 0 +}, { + x: -3, + y: 0 +}, { + x: -2, + y: 0 +}, { + x: -1, + y: 0 +}], [{ + x: -1, + y: -2 +}, { + x: 0, + y: -2 +}, { + x: 1, + y: -2 +}, { + x: 2, + y: -2 +}, { + x: -2, + y: -1 +}, { + x: -1, + y: -1 +}, { + x: 0, + y: -1 +}, { + x: 1, + y: -1 +}, { + x: 2, + y: -1 +}, { + x: -3, + y: 0 +}, { + x: -2, + y: 0 +}, { + x: -1, + y: 0 +}], [{ + x: -1, + y: -2 +}, { + x: 0, + y: -2 +}, { + x: 1, + y: -2 +}, { + x: -2, + y: -1 +}, { + x: -1, + y: -1 +}, { + x: 0, + y: -1 +}, { + x: 1, + y: -1 +}, { + x: -2, + y: 0 +}, { + x: -1, + y: 0 +}], [{ + x: -3, + y: -1 +}, { + x: -2, + y: -1 +}, { + x: -1, + y: -1 +}, { + x: 0, + y: -1 +}, { + x: 1, + y: -1 +}, { + x: -4, + y: 0 +}, { + x: -3, + y: 0 +}, { + x: -2, + y: 0 +}, { + x: -1, + y: 0 +}]]; +const RefinementTemplates = [{ + coding: [{ + x: 0, + y: -1 + }, { + x: 1, + y: -1 + }, { + x: -1, + y: 0 + }], + reference: [{ + x: 0, + y: -1 + }, { + x: 1, + y: -1 + }, { + x: -1, + y: 0 + }, { + x: 0, + y: 0 + }, { + x: 1, + y: 0 + }, { + x: -1, + y: 1 + }, { + x: 0, + y: 1 + }, { + x: 1, + y: 1 + }] +}, { + coding: [{ + x: -1, + y: -1 + }, { + x: 0, + y: -1 + }, { + x: 1, + y: -1 + }, { + x: -1, + y: 0 + }], + reference: [{ + x: 0, + y: -1 + }, { + x: -1, + y: 0 + }, { + x: 0, + y: 0 + }, { + x: 1, + y: 0 + }, { + x: 0, + y: 1 + }, { + x: 1, + y: 1 + }] +}]; +const ReusedContexts = [0x9b25, 0x0795, 0x00e5, 0x0195]; +const RefinementReusedContexts = [0x0020, 0x0008]; +function decodeBitmapTemplate0(width, height, decodingContext) { + const decoder = decodingContext.decoder; + const contexts = decodingContext.contextCache.getContexts("GB"); + const bitmap = []; + let contextLabel, i, j, pixel, row, row1, row2; + const OLD_PIXEL_MASK = 0x7bf7; + for (i = 0; i < height; i++) { + row = bitmap[i] = new Uint8Array(width); + row1 = i < 1 ? row : bitmap[i - 1]; + row2 = i < 2 ? row : bitmap[i - 2]; + contextLabel = row2[0] << 13 | row2[1] << 12 | row2[2] << 11 | row1[0] << 7 | row1[1] << 6 | row1[2] << 5 | row1[3] << 4; + for (j = 0; j < width; j++) { + row[j] = pixel = decoder.readBit(contexts, contextLabel); + contextLabel = (contextLabel & OLD_PIXEL_MASK) << 1 | (j + 3 < width ? row2[j + 3] << 11 : 0) | (j + 4 < width ? row1[j + 4] << 4 : 0) | pixel; + } + } + return bitmap; +} +function decodeBitmap(mmr, width, height, templateIndex, prediction, skip, at, decodingContext) { + if (mmr) { + const input = new Reader(decodingContext.data, decodingContext.start, decodingContext.end); + return decodeMMRBitmap(input, width, height, false); + } + if (templateIndex === 0 && !skip && !prediction && at.length === 4 && at[0].x === 3 && at[0].y === -1 && at[1].x === -3 && at[1].y === -1 && at[2].x === 2 && at[2].y === -2 && at[3].x === -2 && at[3].y === -2) { + return decodeBitmapTemplate0(width, height, decodingContext); + } + const useskip = !!skip; + const template = CodingTemplates[templateIndex].concat(at); + template.sort(function (a, b) { + return a.y - b.y || a.x - b.x; + }); + const templateLength = template.length; + const templateX = new Int8Array(templateLength); + const templateY = new Int8Array(templateLength); + const changingTemplateEntries = []; + let reuseMask = 0, + minX = 0, + maxX = 0, + minY = 0; + let c, k; + for (k = 0; k < templateLength; k++) { + templateX[k] = template[k].x; + templateY[k] = template[k].y; + minX = Math.min(minX, template[k].x); + maxX = Math.max(maxX, template[k].x); + minY = Math.min(minY, template[k].y); + if (k < templateLength - 1 && template[k].y === template[k + 1].y && template[k].x === template[k + 1].x - 1) { + reuseMask |= 1 << templateLength - 1 - k; + } else { + changingTemplateEntries.push(k); + } + } + const changingEntriesLength = changingTemplateEntries.length; + const changingTemplateX = new Int8Array(changingEntriesLength); + const changingTemplateY = new Int8Array(changingEntriesLength); + const changingTemplateBit = new Uint16Array(changingEntriesLength); + for (c = 0; c < changingEntriesLength; c++) { + k = changingTemplateEntries[c]; + changingTemplateX[c] = template[k].x; + changingTemplateY[c] = template[k].y; + changingTemplateBit[c] = 1 << templateLength - 1 - k; + } + const sbb_left = -minX; + const sbb_top = -minY; + const sbb_right = width - maxX; + const pseudoPixelContext = ReusedContexts[templateIndex]; + let row = new Uint8Array(width); + const bitmap = []; + const decoder = decodingContext.decoder; + const contexts = decodingContext.contextCache.getContexts("GB"); + let ltp = 0, + j, + i0, + j0, + contextLabel = 0, + bit, + shift; + for (let i = 0; i < height; i++) { + if (prediction) { + const sltp = decoder.readBit(contexts, pseudoPixelContext); + ltp ^= sltp; + if (ltp) { + bitmap.push(row); + continue; + } + } + row = new Uint8Array(row); + bitmap.push(row); + for (j = 0; j < width; j++) { + if (useskip && skip[i][j]) { + row[j] = 0; + continue; + } + if (j >= sbb_left && j < sbb_right && i >= sbb_top) { + contextLabel = contextLabel << 1 & reuseMask; + for (k = 0; k < changingEntriesLength; k++) { + i0 = i + changingTemplateY[k]; + j0 = j + changingTemplateX[k]; + bit = bitmap[i0][j0]; + if (bit) { + bit = changingTemplateBit[k]; + contextLabel |= bit; + } + } + } else { + contextLabel = 0; + shift = templateLength - 1; + for (k = 0; k < templateLength; k++, shift--) { + j0 = j + templateX[k]; + if (j0 >= 0 && j0 < width) { + i0 = i + templateY[k]; + if (i0 >= 0) { + bit = bitmap[i0][j0]; + if (bit) { + contextLabel |= bit << shift; + } + } + } + } + } + const pixel = decoder.readBit(contexts, contextLabel); + row[j] = pixel; + } + } + return bitmap; +} +function decodeRefinement(width, height, templateIndex, referenceBitmap, offsetX, offsetY, prediction, at, decodingContext) { + let codingTemplate = RefinementTemplates[templateIndex].coding; + if (templateIndex === 0) { + codingTemplate = codingTemplate.concat([at[0]]); + } + const codingTemplateLength = codingTemplate.length; + const codingTemplateX = new Int32Array(codingTemplateLength); + const codingTemplateY = new Int32Array(codingTemplateLength); + let k; + for (k = 0; k < codingTemplateLength; k++) { + codingTemplateX[k] = codingTemplate[k].x; + codingTemplateY[k] = codingTemplate[k].y; + } + let referenceTemplate = RefinementTemplates[templateIndex].reference; + if (templateIndex === 0) { + referenceTemplate = referenceTemplate.concat([at[1]]); + } + const referenceTemplateLength = referenceTemplate.length; + const referenceTemplateX = new Int32Array(referenceTemplateLength); + const referenceTemplateY = new Int32Array(referenceTemplateLength); + for (k = 0; k < referenceTemplateLength; k++) { + referenceTemplateX[k] = referenceTemplate[k].x; + referenceTemplateY[k] = referenceTemplate[k].y; + } + const referenceWidth = referenceBitmap[0].length; + const referenceHeight = referenceBitmap.length; + const pseudoPixelContext = RefinementReusedContexts[templateIndex]; + const bitmap = []; + const decoder = decodingContext.decoder; + const contexts = decodingContext.contextCache.getContexts("GR"); + let ltp = 0; + for (let i = 0; i < height; i++) { + if (prediction) { + const sltp = decoder.readBit(contexts, pseudoPixelContext); + ltp ^= sltp; + if (ltp) { + throw new Jbig2Error("prediction is not supported"); + } + } + const row = new Uint8Array(width); + bitmap.push(row); + for (let j = 0; j < width; j++) { + let i0, j0; + let contextLabel = 0; + for (k = 0; k < codingTemplateLength; k++) { + i0 = i + codingTemplateY[k]; + j0 = j + codingTemplateX[k]; + if (i0 < 0 || j0 < 0 || j0 >= width) { + contextLabel <<= 1; + } else { + contextLabel = contextLabel << 1 | bitmap[i0][j0]; + } + } + for (k = 0; k < referenceTemplateLength; k++) { + i0 = i + referenceTemplateY[k] - offsetY; + j0 = j + referenceTemplateX[k] - offsetX; + if (i0 < 0 || i0 >= referenceHeight || j0 < 0 || j0 >= referenceWidth) { + contextLabel <<= 1; + } else { + contextLabel = contextLabel << 1 | referenceBitmap[i0][j0]; + } + } + const pixel = decoder.readBit(contexts, contextLabel); + row[j] = pixel; + } + } + return bitmap; +} +function decodeSymbolDictionary(huffman, refinement, symbols, numberOfNewSymbols, numberOfExportedSymbols, huffmanTables, templateIndex, at, refinementTemplateIndex, refinementAt, decodingContext, huffmanInput) { + if (huffman && refinement) { + throw new Jbig2Error("symbol refinement with Huffman is not supported"); + } + const newSymbols = []; + let currentHeight = 0; + let symbolCodeLength = log2(symbols.length + numberOfNewSymbols); + const decoder = decodingContext.decoder; + const contextCache = decodingContext.contextCache; + let tableB1, symbolWidths; + if (huffman) { + tableB1 = getStandardTable(1); + symbolWidths = []; + symbolCodeLength = Math.max(symbolCodeLength, 1); + } + while (newSymbols.length < numberOfNewSymbols) { + const deltaHeight = huffman ? huffmanTables.tableDeltaHeight.decode(huffmanInput) : decodeInteger(contextCache, "IADH", decoder); + currentHeight += deltaHeight; + let currentWidth = 0, + totalWidth = 0; + const firstSymbol = huffman ? symbolWidths.length : 0; + while (true) { + const deltaWidth = huffman ? huffmanTables.tableDeltaWidth.decode(huffmanInput) : decodeInteger(contextCache, "IADW", decoder); + if (deltaWidth === null) { + break; + } + currentWidth += deltaWidth; + totalWidth += currentWidth; + let bitmap; + if (refinement) { + const numberOfInstances = decodeInteger(contextCache, "IAAI", decoder); + if (numberOfInstances > 1) { + bitmap = decodeTextRegion(huffman, refinement, currentWidth, currentHeight, 0, numberOfInstances, 1, symbols.concat(newSymbols), symbolCodeLength, 0, 0, 1, 0, huffmanTables, refinementTemplateIndex, refinementAt, decodingContext, 0, huffmanInput); + } else { + const symbolId = decodeIAID(contextCache, decoder, symbolCodeLength); + const rdx = decodeInteger(contextCache, "IARDX", decoder); + const rdy = decodeInteger(contextCache, "IARDY", decoder); + const symbol = symbolId < symbols.length ? symbols[symbolId] : newSymbols[symbolId - symbols.length]; + bitmap = decodeRefinement(currentWidth, currentHeight, refinementTemplateIndex, symbol, rdx, rdy, false, refinementAt, decodingContext); + } + newSymbols.push(bitmap); + } else if (huffman) { + symbolWidths.push(currentWidth); + } else { + bitmap = decodeBitmap(false, currentWidth, currentHeight, templateIndex, false, null, at, decodingContext); + newSymbols.push(bitmap); + } + } + if (huffman && !refinement) { + const bitmapSize = huffmanTables.tableBitmapSize.decode(huffmanInput); + huffmanInput.byteAlign(); + let collectiveBitmap; + if (bitmapSize === 0) { + collectiveBitmap = readUncompressedBitmap(huffmanInput, totalWidth, currentHeight); + } else { + const originalEnd = huffmanInput.end; + const bitmapEnd = huffmanInput.position + bitmapSize; + huffmanInput.end = bitmapEnd; + collectiveBitmap = decodeMMRBitmap(huffmanInput, totalWidth, currentHeight, false); + huffmanInput.end = originalEnd; + huffmanInput.position = bitmapEnd; + } + const numberOfSymbolsDecoded = symbolWidths.length; + if (firstSymbol === numberOfSymbolsDecoded - 1) { + newSymbols.push(collectiveBitmap); + } else { + let i, + y, + xMin = 0, + xMax, + bitmapWidth, + symbolBitmap; + for (i = firstSymbol; i < numberOfSymbolsDecoded; i++) { + bitmapWidth = symbolWidths[i]; + xMax = xMin + bitmapWidth; + symbolBitmap = []; + for (y = 0; y < currentHeight; y++) { + symbolBitmap.push(collectiveBitmap[y].subarray(xMin, xMax)); + } + newSymbols.push(symbolBitmap); + xMin = xMax; + } + } + } + } + const exportedSymbols = [], + flags = []; + let currentFlag = false, + i, + ii; + const totalSymbolsLength = symbols.length + numberOfNewSymbols; + while (flags.length < totalSymbolsLength) { + let runLength = huffman ? tableB1.decode(huffmanInput) : decodeInteger(contextCache, "IAEX", decoder); + while (runLength--) { + flags.push(currentFlag); + } + currentFlag = !currentFlag; + } + for (i = 0, ii = symbols.length; i < ii; i++) { + if (flags[i]) { + exportedSymbols.push(symbols[i]); + } + } + for (let j = 0; j < numberOfNewSymbols; i++, j++) { + if (flags[i]) { + exportedSymbols.push(newSymbols[j]); + } + } + return exportedSymbols; +} +function decodeTextRegion(huffman, refinement, width, height, defaultPixelValue, numberOfSymbolInstances, stripSize, inputSymbols, symbolCodeLength, transposed, dsOffset, referenceCorner, combinationOperator, huffmanTables, refinementTemplateIndex, refinementAt, decodingContext, logStripSize, huffmanInput) { + if (huffman && refinement) { + throw new Jbig2Error("refinement with Huffman is not supported"); + } + const bitmap = []; + let i, row; + for (i = 0; i < height; i++) { + row = new Uint8Array(width); + if (defaultPixelValue) { + for (let j = 0; j < width; j++) { + row[j] = defaultPixelValue; + } + } + bitmap.push(row); + } + const decoder = decodingContext.decoder; + const contextCache = decodingContext.contextCache; + let stripT = huffman ? -huffmanTables.tableDeltaT.decode(huffmanInput) : -decodeInteger(contextCache, "IADT", decoder); + let firstS = 0; + i = 0; + while (i < numberOfSymbolInstances) { + const deltaT = huffman ? huffmanTables.tableDeltaT.decode(huffmanInput) : decodeInteger(contextCache, "IADT", decoder); + stripT += deltaT; + const deltaFirstS = huffman ? huffmanTables.tableFirstS.decode(huffmanInput) : decodeInteger(contextCache, "IAFS", decoder); + firstS += deltaFirstS; + let currentS = firstS; + do { + let currentT = 0; + if (stripSize > 1) { + currentT = huffman ? huffmanInput.readBits(logStripSize) : decodeInteger(contextCache, "IAIT", decoder); + } + const t = stripSize * stripT + currentT; + const symbolId = huffman ? huffmanTables.symbolIDTable.decode(huffmanInput) : decodeIAID(contextCache, decoder, symbolCodeLength); + const applyRefinement = refinement && (huffman ? huffmanInput.readBit() : decodeInteger(contextCache, "IARI", decoder)); + let symbolBitmap = inputSymbols[symbolId]; + let symbolWidth = symbolBitmap[0].length; + let symbolHeight = symbolBitmap.length; + if (applyRefinement) { + const rdw = decodeInteger(contextCache, "IARDW", decoder); + const rdh = decodeInteger(contextCache, "IARDH", decoder); + const rdx = decodeInteger(contextCache, "IARDX", decoder); + const rdy = decodeInteger(contextCache, "IARDY", decoder); + symbolWidth += rdw; + symbolHeight += rdh; + symbolBitmap = decodeRefinement(symbolWidth, symbolHeight, refinementTemplateIndex, symbolBitmap, (rdw >> 1) + rdx, (rdh >> 1) + rdy, false, refinementAt, decodingContext); + } + let increment = 0; + if (!transposed) { + if (referenceCorner > 1) { + currentS += symbolWidth - 1; + } else { + increment = symbolWidth - 1; + } + } else if (!(referenceCorner & 1)) { + currentS += symbolHeight - 1; + } else { + increment = symbolHeight - 1; + } + const offsetT = t - (referenceCorner & 1 ? 0 : symbolHeight - 1); + const offsetS = currentS - (referenceCorner & 2 ? symbolWidth - 1 : 0); + let s2, t2, symbolRow; + if (transposed) { + for (s2 = 0; s2 < symbolHeight; s2++) { + row = bitmap[offsetS + s2]; + if (!row) { + continue; + } + symbolRow = symbolBitmap[s2]; + const maxWidth = Math.min(width - offsetT, symbolWidth); + switch (combinationOperator) { + case 0: + for (t2 = 0; t2 < maxWidth; t2++) { + row[offsetT + t2] |= symbolRow[t2]; + } + break; + case 2: + for (t2 = 0; t2 < maxWidth; t2++) { + row[offsetT + t2] ^= symbolRow[t2]; + } + break; + default: + throw new Jbig2Error(`operator ${combinationOperator} is not supported`); + } + } + } else { + for (t2 = 0; t2 < symbolHeight; t2++) { + row = bitmap[offsetT + t2]; + if (!row) { + continue; + } + symbolRow = symbolBitmap[t2]; + switch (combinationOperator) { + case 0: + for (s2 = 0; s2 < symbolWidth; s2++) { + row[offsetS + s2] |= symbolRow[s2]; + } + break; + case 2: + for (s2 = 0; s2 < symbolWidth; s2++) { + row[offsetS + s2] ^= symbolRow[s2]; + } + break; + default: + throw new Jbig2Error(`operator ${combinationOperator} is not supported`); + } + } + } + i++; + const deltaS = huffman ? huffmanTables.tableDeltaS.decode(huffmanInput) : decodeInteger(contextCache, "IADS", decoder); + if (deltaS === null) { + break; + } + currentS += increment + deltaS + dsOffset; + } while (true); + } + return bitmap; +} +function decodePatternDictionary(mmr, patternWidth, patternHeight, maxPatternIndex, template, decodingContext) { + const at = []; + if (!mmr) { + at.push({ + x: -patternWidth, + y: 0 + }); + if (template === 0) { + at.push({ + x: -3, + y: -1 + }, { + x: 2, + y: -2 + }, { + x: -2, + y: -2 + }); + } + } + const collectiveWidth = (maxPatternIndex + 1) * patternWidth; + const collectiveBitmap = decodeBitmap(mmr, collectiveWidth, patternHeight, template, false, null, at, decodingContext); + const patterns = []; + for (let i = 0; i <= maxPatternIndex; i++) { + const patternBitmap = []; + const xMin = patternWidth * i; + const xMax = xMin + patternWidth; + for (let y = 0; y < patternHeight; y++) { + patternBitmap.push(collectiveBitmap[y].subarray(xMin, xMax)); + } + patterns.push(patternBitmap); + } + return patterns; +} +function decodeHalftoneRegion(mmr, patterns, template, regionWidth, regionHeight, defaultPixelValue, enableSkip, combinationOperator, gridWidth, gridHeight, gridOffsetX, gridOffsetY, gridVectorX, gridVectorY, decodingContext) { + const skip = null; + if (enableSkip) { + throw new Jbig2Error("skip is not supported"); + } + if (combinationOperator !== 0) { + throw new Jbig2Error(`operator "${combinationOperator}" is not supported in halftone region`); + } + const regionBitmap = []; + let i, j, row; + for (i = 0; i < regionHeight; i++) { + row = new Uint8Array(regionWidth); + if (defaultPixelValue) { + for (j = 0; j < regionWidth; j++) { + row[j] = defaultPixelValue; + } + } + regionBitmap.push(row); + } + const numberOfPatterns = patterns.length; + const pattern0 = patterns[0]; + const patternWidth = pattern0[0].length, + patternHeight = pattern0.length; + const bitsPerValue = log2(numberOfPatterns); + const at = []; + if (!mmr) { + at.push({ + x: template <= 1 ? 3 : 2, + y: -1 + }); + if (template === 0) { + at.push({ + x: -3, + y: -1 + }, { + x: 2, + y: -2 + }, { + x: -2, + y: -2 + }); + } + } + const grayScaleBitPlanes = []; + let mmrInput, bitmap; + if (mmr) { + mmrInput = new Reader(decodingContext.data, decodingContext.start, decodingContext.end); + } + for (i = bitsPerValue - 1; i >= 0; i--) { + if (mmr) { + bitmap = decodeMMRBitmap(mmrInput, gridWidth, gridHeight, true); + } else { + bitmap = decodeBitmap(false, gridWidth, gridHeight, template, false, skip, at, decodingContext); + } + grayScaleBitPlanes[i] = bitmap; + } + let mg, ng, bit, patternIndex, patternBitmap, x, y, patternRow, regionRow; + for (mg = 0; mg < gridHeight; mg++) { + for (ng = 0; ng < gridWidth; ng++) { + bit = 0; + patternIndex = 0; + for (j = bitsPerValue - 1; j >= 0; j--) { + bit ^= grayScaleBitPlanes[j][mg][ng]; + patternIndex |= bit << j; + } + patternBitmap = patterns[patternIndex]; + x = gridOffsetX + mg * gridVectorY + ng * gridVectorX >> 8; + y = gridOffsetY + mg * gridVectorX - ng * gridVectorY >> 8; + if (x >= 0 && x + patternWidth <= regionWidth && y >= 0 && y + patternHeight <= regionHeight) { + for (i = 0; i < patternHeight; i++) { + regionRow = regionBitmap[y + i]; + patternRow = patternBitmap[i]; + for (j = 0; j < patternWidth; j++) { + regionRow[x + j] |= patternRow[j]; + } + } + } else { + let regionX, regionY; + for (i = 0; i < patternHeight; i++) { + regionY = y + i; + if (regionY < 0 || regionY >= regionHeight) { + continue; + } + regionRow = regionBitmap[regionY]; + patternRow = patternBitmap[i]; + for (j = 0; j < patternWidth; j++) { + regionX = x + j; + if (regionX >= 0 && regionX < regionWidth) { + regionRow[regionX] |= patternRow[j]; + } + } + } + } + } + } + return regionBitmap; +} +function readSegmentHeader(data, start) { + const segmentHeader = {}; + segmentHeader.number = readUint32(data, start); + const flags = data[start + 4]; + const segmentType = flags & 0x3f; + if (!SegmentTypes[segmentType]) { + throw new Jbig2Error("invalid segment type: " + segmentType); + } + segmentHeader.type = segmentType; + segmentHeader.typeName = SegmentTypes[segmentType]; + segmentHeader.deferredNonRetain = !!(flags & 0x80); + const pageAssociationFieldSize = !!(flags & 0x40); + const referredFlags = data[start + 5]; + let referredToCount = referredFlags >> 5 & 7; + const retainBits = [referredFlags & 31]; + let position = start + 6; + if (referredFlags === 7) { + referredToCount = readUint32(data, position - 1) & 0x1fffffff; + position += 3; + let bytes = referredToCount + 7 >> 3; + retainBits[0] = data[position++]; + while (--bytes > 0) { + retainBits.push(data[position++]); + } + } else if (referredFlags === 5 || referredFlags === 6) { + throw new Jbig2Error("invalid referred-to flags"); + } + segmentHeader.retainBits = retainBits; + let referredToSegmentNumberSize = 4; + if (segmentHeader.number <= 256) { + referredToSegmentNumberSize = 1; + } else if (segmentHeader.number <= 65536) { + referredToSegmentNumberSize = 2; + } + const referredTo = []; + let i, ii; + for (i = 0; i < referredToCount; i++) { + let number; + if (referredToSegmentNumberSize === 1) { + number = data[position]; + } else if (referredToSegmentNumberSize === 2) { + number = readUint16(data, position); + } else { + number = readUint32(data, position); + } + referredTo.push(number); + position += referredToSegmentNumberSize; + } + segmentHeader.referredTo = referredTo; + if (!pageAssociationFieldSize) { + segmentHeader.pageAssociation = data[position++]; + } else { + segmentHeader.pageAssociation = readUint32(data, position); + position += 4; + } + segmentHeader.length = readUint32(data, position); + position += 4; + if (segmentHeader.length === 0xffffffff) { + if (segmentType === 38) { + const genericRegionInfo = readRegionSegmentInformation(data, position); + const genericRegionSegmentFlags = data[position + RegionSegmentInformationFieldLength]; + const genericRegionMmr = !!(genericRegionSegmentFlags & 1); + const searchPatternLength = 6; + const searchPattern = new Uint8Array(searchPatternLength); + if (!genericRegionMmr) { + searchPattern[0] = 0xff; + searchPattern[1] = 0xac; + } + searchPattern[2] = genericRegionInfo.height >>> 24 & 0xff; + searchPattern[3] = genericRegionInfo.height >> 16 & 0xff; + searchPattern[4] = genericRegionInfo.height >> 8 & 0xff; + searchPattern[5] = genericRegionInfo.height & 0xff; + for (i = position, ii = data.length; i < ii; i++) { + let j = 0; + while (j < searchPatternLength && searchPattern[j] === data[i + j]) { + j++; + } + if (j === searchPatternLength) { + segmentHeader.length = i + searchPatternLength; + break; + } + } + if (segmentHeader.length === 0xffffffff) { + throw new Jbig2Error("segment end was not found"); + } + } else { + throw new Jbig2Error("invalid unknown segment length"); + } + } + segmentHeader.headerEnd = position; + return segmentHeader; +} +function readSegments(header, data, start, end) { + const segments = []; + let position = start; + while (position < end) { + const segmentHeader = readSegmentHeader(data, position); + position = segmentHeader.headerEnd; + const segment = { + header: segmentHeader, + data + }; + if (!header.randomAccess) { + segment.start = position; + position += segmentHeader.length; + segment.end = position; + } + segments.push(segment); + if (segmentHeader.type === 51) { + break; + } + } + if (header.randomAccess) { + for (let i = 0, ii = segments.length; i < ii; i++) { + segments[i].start = position; + position += segments[i].header.length; + segments[i].end = position; + } + } + return segments; +} +function readRegionSegmentInformation(data, start) { + return { + width: readUint32(data, start), + height: readUint32(data, start + 4), + x: readUint32(data, start + 8), + y: readUint32(data, start + 12), + combinationOperator: data[start + 16] & 7 + }; +} +const RegionSegmentInformationFieldLength = 17; +function processSegment(segment, visitor) { + const header = segment.header; + const data = segment.data, + end = segment.end; + let position = segment.start; + let args, at, i, atLength; + switch (header.type) { + case 0: + const dictionary = {}; + const dictionaryFlags = readUint16(data, position); + dictionary.huffman = !!(dictionaryFlags & 1); + dictionary.refinement = !!(dictionaryFlags & 2); + dictionary.huffmanDHSelector = dictionaryFlags >> 2 & 3; + dictionary.huffmanDWSelector = dictionaryFlags >> 4 & 3; + dictionary.bitmapSizeSelector = dictionaryFlags >> 6 & 1; + dictionary.aggregationInstancesSelector = dictionaryFlags >> 7 & 1; + dictionary.bitmapCodingContextUsed = !!(dictionaryFlags & 256); + dictionary.bitmapCodingContextRetained = !!(dictionaryFlags & 512); + dictionary.template = dictionaryFlags >> 10 & 3; + dictionary.refinementTemplate = dictionaryFlags >> 12 & 1; + position += 2; + if (!dictionary.huffman) { + atLength = dictionary.template === 0 ? 4 : 1; + at = []; + for (i = 0; i < atLength; i++) { + at.push({ + x: readInt8(data, position), + y: readInt8(data, position + 1) + }); + position += 2; + } + dictionary.at = at; + } + if (dictionary.refinement && !dictionary.refinementTemplate) { + at = []; + for (i = 0; i < 2; i++) { + at.push({ + x: readInt8(data, position), + y: readInt8(data, position + 1) + }); + position += 2; + } + dictionary.refinementAt = at; + } + dictionary.numberOfExportedSymbols = readUint32(data, position); + position += 4; + dictionary.numberOfNewSymbols = readUint32(data, position); + position += 4; + args = [dictionary, header.number, header.referredTo, data, position, end]; + break; + case 6: + case 7: + const textRegion = {}; + textRegion.info = readRegionSegmentInformation(data, position); + position += RegionSegmentInformationFieldLength; + const textRegionSegmentFlags = readUint16(data, position); + position += 2; + textRegion.huffman = !!(textRegionSegmentFlags & 1); + textRegion.refinement = !!(textRegionSegmentFlags & 2); + textRegion.logStripSize = textRegionSegmentFlags >> 2 & 3; + textRegion.stripSize = 1 << textRegion.logStripSize; + textRegion.referenceCorner = textRegionSegmentFlags >> 4 & 3; + textRegion.transposed = !!(textRegionSegmentFlags & 64); + textRegion.combinationOperator = textRegionSegmentFlags >> 7 & 3; + textRegion.defaultPixelValue = textRegionSegmentFlags >> 9 & 1; + textRegion.dsOffset = textRegionSegmentFlags << 17 >> 27; + textRegion.refinementTemplate = textRegionSegmentFlags >> 15 & 1; + if (textRegion.huffman) { + const textRegionHuffmanFlags = readUint16(data, position); + position += 2; + textRegion.huffmanFS = textRegionHuffmanFlags & 3; + textRegion.huffmanDS = textRegionHuffmanFlags >> 2 & 3; + textRegion.huffmanDT = textRegionHuffmanFlags >> 4 & 3; + textRegion.huffmanRefinementDW = textRegionHuffmanFlags >> 6 & 3; + textRegion.huffmanRefinementDH = textRegionHuffmanFlags >> 8 & 3; + textRegion.huffmanRefinementDX = textRegionHuffmanFlags >> 10 & 3; + textRegion.huffmanRefinementDY = textRegionHuffmanFlags >> 12 & 3; + textRegion.huffmanRefinementSizeSelector = !!(textRegionHuffmanFlags & 0x4000); + } + if (textRegion.refinement && !textRegion.refinementTemplate) { + at = []; + for (i = 0; i < 2; i++) { + at.push({ + x: readInt8(data, position), + y: readInt8(data, position + 1) + }); + position += 2; + } + textRegion.refinementAt = at; + } + textRegion.numberOfSymbolInstances = readUint32(data, position); + position += 4; + args = [textRegion, header.referredTo, data, position, end]; + break; + case 16: + const patternDictionary = {}; + const patternDictionaryFlags = data[position++]; + patternDictionary.mmr = !!(patternDictionaryFlags & 1); + patternDictionary.template = patternDictionaryFlags >> 1 & 3; + patternDictionary.patternWidth = data[position++]; + patternDictionary.patternHeight = data[position++]; + patternDictionary.maxPatternIndex = readUint32(data, position); + position += 4; + args = [patternDictionary, header.number, data, position, end]; + break; + case 22: + case 23: + const halftoneRegion = {}; + halftoneRegion.info = readRegionSegmentInformation(data, position); + position += RegionSegmentInformationFieldLength; + const halftoneRegionFlags = data[position++]; + halftoneRegion.mmr = !!(halftoneRegionFlags & 1); + halftoneRegion.template = halftoneRegionFlags >> 1 & 3; + halftoneRegion.enableSkip = !!(halftoneRegionFlags & 8); + halftoneRegion.combinationOperator = halftoneRegionFlags >> 4 & 7; + halftoneRegion.defaultPixelValue = halftoneRegionFlags >> 7 & 1; + halftoneRegion.gridWidth = readUint32(data, position); + position += 4; + halftoneRegion.gridHeight = readUint32(data, position); + position += 4; + halftoneRegion.gridOffsetX = readUint32(data, position) & 0xffffffff; + position += 4; + halftoneRegion.gridOffsetY = readUint32(data, position) & 0xffffffff; + position += 4; + halftoneRegion.gridVectorX = readUint16(data, position); + position += 2; + halftoneRegion.gridVectorY = readUint16(data, position); + position += 2; + args = [halftoneRegion, header.referredTo, data, position, end]; + break; + case 38: + case 39: + const genericRegion = {}; + genericRegion.info = readRegionSegmentInformation(data, position); + position += RegionSegmentInformationFieldLength; + const genericRegionSegmentFlags = data[position++]; + genericRegion.mmr = !!(genericRegionSegmentFlags & 1); + genericRegion.template = genericRegionSegmentFlags >> 1 & 3; + genericRegion.prediction = !!(genericRegionSegmentFlags & 8); + if (!genericRegion.mmr) { + atLength = genericRegion.template === 0 ? 4 : 1; + at = []; + for (i = 0; i < atLength; i++) { + at.push({ + x: readInt8(data, position), + y: readInt8(data, position + 1) + }); + position += 2; + } + genericRegion.at = at; + } + args = [genericRegion, data, position, end]; + break; + case 48: + const pageInfo = { + width: readUint32(data, position), + height: readUint32(data, position + 4), + resolutionX: readUint32(data, position + 8), + resolutionY: readUint32(data, position + 12) + }; + if (pageInfo.height === 0xffffffff) { + delete pageInfo.height; + } + const pageSegmentFlags = data[position + 16]; + readUint16(data, position + 17); + pageInfo.lossless = !!(pageSegmentFlags & 1); + pageInfo.refinement = !!(pageSegmentFlags & 2); + pageInfo.defaultPixelValue = pageSegmentFlags >> 2 & 1; + pageInfo.combinationOperator = pageSegmentFlags >> 3 & 3; + pageInfo.requiresBuffer = !!(pageSegmentFlags & 32); + pageInfo.combinationOperatorOverride = !!(pageSegmentFlags & 64); + args = [pageInfo]; + break; + case 49: + break; + case 50: + break; + case 51: + break; + case 53: + args = [header.number, data, position, end]; + break; + case 62: + break; + default: + throw new Jbig2Error(`segment type ${header.typeName}(${header.type}) is not implemented`); + } + const callbackName = "on" + header.typeName; + if (callbackName in visitor) { + visitor[callbackName].apply(visitor, args); + } +} +function processSegments(segments, visitor) { + for (let i = 0, ii = segments.length; i < ii; i++) { + processSegment(segments[i], visitor); + } +} +function parseJbig2Chunks(chunks) { + const visitor = new SimpleSegmentVisitor(); + for (let i = 0, ii = chunks.length; i < ii; i++) { + const chunk = chunks[i]; + const segments = readSegments({}, chunk.data, chunk.start, chunk.end); + processSegments(segments, visitor); + } + return visitor.buffer; +} +function parseJbig2(data) { + throw new Error("Not implemented: parseJbig2"); +} +class SimpleSegmentVisitor { + onPageInformation(info) { + this.currentPageInfo = info; + const rowSize = info.width + 7 >> 3; + const buffer = new Uint8ClampedArray(rowSize * info.height); + if (info.defaultPixelValue) { + buffer.fill(0xff); + } + this.buffer = buffer; + } + drawBitmap(regionInfo, bitmap) { + const pageInfo = this.currentPageInfo; + const width = regionInfo.width, + height = regionInfo.height; + const rowSize = pageInfo.width + 7 >> 3; + const combinationOperator = pageInfo.combinationOperatorOverride ? regionInfo.combinationOperator : pageInfo.combinationOperator; + const buffer = this.buffer; + const mask0 = 128 >> (regionInfo.x & 7); + let offset0 = regionInfo.y * rowSize + (regionInfo.x >> 3); + let i, j, mask, offset; + switch (combinationOperator) { + case 0: + for (i = 0; i < height; i++) { + mask = mask0; + offset = offset0; + for (j = 0; j < width; j++) { + if (bitmap[i][j]) { + buffer[offset] |= mask; + } + mask >>= 1; + if (!mask) { + mask = 128; + offset++; + } + } + offset0 += rowSize; + } + break; + case 2: + for (i = 0; i < height; i++) { + mask = mask0; + offset = offset0; + for (j = 0; j < width; j++) { + if (bitmap[i][j]) { + buffer[offset] ^= mask; + } + mask >>= 1; + if (!mask) { + mask = 128; + offset++; + } + } + offset0 += rowSize; + } + break; + default: + throw new Jbig2Error(`operator ${combinationOperator} is not supported`); + } + } + onImmediateGenericRegion(region, data, start, end) { + const regionInfo = region.info; + const decodingContext = new DecodingContext(data, start, end); + const bitmap = decodeBitmap(region.mmr, regionInfo.width, regionInfo.height, region.template, region.prediction, null, region.at, decodingContext); + this.drawBitmap(regionInfo, bitmap); + } + onImmediateLosslessGenericRegion() { + this.onImmediateGenericRegion(...arguments); + } + onSymbolDictionary(dictionary, currentSegment, referredSegments, data, start, end) { + let huffmanTables, huffmanInput; + if (dictionary.huffman) { + huffmanTables = getSymbolDictionaryHuffmanTables(dictionary, referredSegments, this.customTables); + huffmanInput = new Reader(data, start, end); + } + let symbols = this.symbols; + if (!symbols) { + this.symbols = symbols = {}; + } + const inputSymbols = []; + for (const referredSegment of referredSegments) { + const referredSymbols = symbols[referredSegment]; + if (referredSymbols) { + inputSymbols.push(...referredSymbols); + } + } + const decodingContext = new DecodingContext(data, start, end); + symbols[currentSegment] = decodeSymbolDictionary(dictionary.huffman, dictionary.refinement, inputSymbols, dictionary.numberOfNewSymbols, dictionary.numberOfExportedSymbols, huffmanTables, dictionary.template, dictionary.at, dictionary.refinementTemplate, dictionary.refinementAt, decodingContext, huffmanInput); + } + onImmediateTextRegion(region, referredSegments, data, start, end) { + const regionInfo = region.info; + let huffmanTables, huffmanInput; + const symbols = this.symbols; + const inputSymbols = []; + for (const referredSegment of referredSegments) { + const referredSymbols = symbols[referredSegment]; + if (referredSymbols) { + inputSymbols.push(...referredSymbols); + } + } + const symbolCodeLength = log2(inputSymbols.length); + if (region.huffman) { + huffmanInput = new Reader(data, start, end); + huffmanTables = getTextRegionHuffmanTables(region, referredSegments, this.customTables, inputSymbols.length, huffmanInput); + } + const decodingContext = new DecodingContext(data, start, end); + const bitmap = decodeTextRegion(region.huffman, region.refinement, regionInfo.width, regionInfo.height, region.defaultPixelValue, region.numberOfSymbolInstances, region.stripSize, inputSymbols, symbolCodeLength, region.transposed, region.dsOffset, region.referenceCorner, region.combinationOperator, huffmanTables, region.refinementTemplate, region.refinementAt, decodingContext, region.logStripSize, huffmanInput); + this.drawBitmap(regionInfo, bitmap); + } + onImmediateLosslessTextRegion() { + this.onImmediateTextRegion(...arguments); + } + onPatternDictionary(dictionary, currentSegment, data, start, end) { + let patterns = this.patterns; + if (!patterns) { + this.patterns = patterns = {}; + } + const decodingContext = new DecodingContext(data, start, end); + patterns[currentSegment] = decodePatternDictionary(dictionary.mmr, dictionary.patternWidth, dictionary.patternHeight, dictionary.maxPatternIndex, dictionary.template, decodingContext); + } + onImmediateHalftoneRegion(region, referredSegments, data, start, end) { + const patterns = this.patterns[referredSegments[0]]; + const regionInfo = region.info; + const decodingContext = new DecodingContext(data, start, end); + const bitmap = decodeHalftoneRegion(region.mmr, patterns, region.template, regionInfo.width, regionInfo.height, region.defaultPixelValue, region.enableSkip, region.combinationOperator, region.gridWidth, region.gridHeight, region.gridOffsetX, region.gridOffsetY, region.gridVectorX, region.gridVectorY, decodingContext); + this.drawBitmap(regionInfo, bitmap); + } + onImmediateLosslessHalftoneRegion() { + this.onImmediateHalftoneRegion(...arguments); + } + onTables(currentSegment, data, start, end) { + let customTables = this.customTables; + if (!customTables) { + this.customTables = customTables = {}; + } + customTables[currentSegment] = decodeTablesSegment(data, start, end); + } +} +class HuffmanLine { + constructor(lineData) { + if (lineData.length === 2) { + this.isOOB = true; + this.rangeLow = 0; + this.prefixLength = lineData[0]; + this.rangeLength = 0; + this.prefixCode = lineData[1]; + this.isLowerRange = false; + } else { + this.isOOB = false; + this.rangeLow = lineData[0]; + this.prefixLength = lineData[1]; + this.rangeLength = lineData[2]; + this.prefixCode = lineData[3]; + this.isLowerRange = lineData[4] === "lower"; + } + } +} +class HuffmanTreeNode { + constructor(line) { + this.children = []; + if (line) { + this.isLeaf = true; + this.rangeLength = line.rangeLength; + this.rangeLow = line.rangeLow; + this.isLowerRange = line.isLowerRange; + this.isOOB = line.isOOB; + } else { + this.isLeaf = false; + } + } + buildTree(line, shift) { + const bit = line.prefixCode >> shift & 1; + if (shift <= 0) { + this.children[bit] = new HuffmanTreeNode(line); + } else { + let node = this.children[bit]; + if (!node) { + this.children[bit] = node = new HuffmanTreeNode(null); + } + node.buildTree(line, shift - 1); + } + } + decodeNode(reader) { + if (this.isLeaf) { + if (this.isOOB) { + return null; + } + const htOffset = reader.readBits(this.rangeLength); + return this.rangeLow + (this.isLowerRange ? -htOffset : htOffset); + } + const node = this.children[reader.readBit()]; + if (!node) { + throw new Jbig2Error("invalid Huffman data"); + } + return node.decodeNode(reader); + } +} +class HuffmanTable { + constructor(lines, prefixCodesDone) { + if (!prefixCodesDone) { + this.assignPrefixCodes(lines); + } + this.rootNode = new HuffmanTreeNode(null); + for (let i = 0, ii = lines.length; i < ii; i++) { + const line = lines[i]; + if (line.prefixLength > 0) { + this.rootNode.buildTree(line, line.prefixLength - 1); + } + } + } + decode(reader) { + return this.rootNode.decodeNode(reader); + } + assignPrefixCodes(lines) { + const linesLength = lines.length; + let prefixLengthMax = 0; + for (let i = 0; i < linesLength; i++) { + prefixLengthMax = Math.max(prefixLengthMax, lines[i].prefixLength); + } + const histogram = new Uint32Array(prefixLengthMax + 1); + for (let i = 0; i < linesLength; i++) { + histogram[lines[i].prefixLength]++; + } + let currentLength = 1, + firstCode = 0, + currentCode, + currentTemp, + line; + histogram[0] = 0; + while (currentLength <= prefixLengthMax) { + firstCode = firstCode + histogram[currentLength - 1] << 1; + currentCode = firstCode; + currentTemp = 0; + while (currentTemp < linesLength) { + line = lines[currentTemp]; + if (line.prefixLength === currentLength) { + line.prefixCode = currentCode; + currentCode++; + } + currentTemp++; + } + currentLength++; + } + } +} +function decodeTablesSegment(data, start, end) { + const flags = data[start]; + const lowestValue = readUint32(data, start + 1) & 0xffffffff; + const highestValue = readUint32(data, start + 5) & 0xffffffff; + const reader = new Reader(data, start + 9, end); + const prefixSizeBits = (flags >> 1 & 7) + 1; + const rangeSizeBits = (flags >> 4 & 7) + 1; + const lines = []; + let prefixLength, + rangeLength, + currentRangeLow = lowestValue; + do { + prefixLength = reader.readBits(prefixSizeBits); + rangeLength = reader.readBits(rangeSizeBits); + lines.push(new HuffmanLine([currentRangeLow, prefixLength, rangeLength, 0])); + currentRangeLow += 1 << rangeLength; + } while (currentRangeLow < highestValue); + prefixLength = reader.readBits(prefixSizeBits); + lines.push(new HuffmanLine([lowestValue - 1, prefixLength, 32, 0, "lower"])); + prefixLength = reader.readBits(prefixSizeBits); + lines.push(new HuffmanLine([highestValue, prefixLength, 32, 0])); + if (flags & 1) { + prefixLength = reader.readBits(prefixSizeBits); + lines.push(new HuffmanLine([prefixLength, 0])); + } + return new HuffmanTable(lines, false); +} +const standardTablesCache = {}; +function getStandardTable(number) { + let table = standardTablesCache[number]; + if (table) { + return table; + } + let lines; + switch (number) { + case 1: + lines = [[0, 1, 4, 0x0], [16, 2, 8, 0x2], [272, 3, 16, 0x6], [65808, 3, 32, 0x7]]; + break; + case 2: + lines = [[0, 1, 0, 0x0], [1, 2, 0, 0x2], [2, 3, 0, 0x6], [3, 4, 3, 0xe], [11, 5, 6, 0x1e], [75, 6, 32, 0x3e], [6, 0x3f]]; + break; + case 3: + lines = [[-256, 8, 8, 0xfe], [0, 1, 0, 0x0], [1, 2, 0, 0x2], [2, 3, 0, 0x6], [3, 4, 3, 0xe], [11, 5, 6, 0x1e], [-257, 8, 32, 0xff, "lower"], [75, 7, 32, 0x7e], [6, 0x3e]]; + break; + case 4: + lines = [[1, 1, 0, 0x0], [2, 2, 0, 0x2], [3, 3, 0, 0x6], [4, 4, 3, 0xe], [12, 5, 6, 0x1e], [76, 5, 32, 0x1f]]; + break; + case 5: + lines = [[-255, 7, 8, 0x7e], [1, 1, 0, 0x0], [2, 2, 0, 0x2], [3, 3, 0, 0x6], [4, 4, 3, 0xe], [12, 5, 6, 0x1e], [-256, 7, 32, 0x7f, "lower"], [76, 6, 32, 0x3e]]; + break; + case 6: + lines = [[-2048, 5, 10, 0x1c], [-1024, 4, 9, 0x8], [-512, 4, 8, 0x9], [-256, 4, 7, 0xa], [-128, 5, 6, 0x1d], [-64, 5, 5, 0x1e], [-32, 4, 5, 0xb], [0, 2, 7, 0x0], [128, 3, 7, 0x2], [256, 3, 8, 0x3], [512, 4, 9, 0xc], [1024, 4, 10, 0xd], [-2049, 6, 32, 0x3e, "lower"], [2048, 6, 32, 0x3f]]; + break; + case 7: + lines = [[-1024, 4, 9, 0x8], [-512, 3, 8, 0x0], [-256, 4, 7, 0x9], [-128, 5, 6, 0x1a], [-64, 5, 5, 0x1b], [-32, 4, 5, 0xa], [0, 4, 5, 0xb], [32, 5, 5, 0x1c], [64, 5, 6, 0x1d], [128, 4, 7, 0xc], [256, 3, 8, 0x1], [512, 3, 9, 0x2], [1024, 3, 10, 0x3], [-1025, 5, 32, 0x1e, "lower"], [2048, 5, 32, 0x1f]]; + break; + case 8: + lines = [[-15, 8, 3, 0xfc], [-7, 9, 1, 0x1fc], [-5, 8, 1, 0xfd], [-3, 9, 0, 0x1fd], [-2, 7, 0, 0x7c], [-1, 4, 0, 0xa], [0, 2, 1, 0x0], [2, 5, 0, 0x1a], [3, 6, 0, 0x3a], [4, 3, 4, 0x4], [20, 6, 1, 0x3b], [22, 4, 4, 0xb], [38, 4, 5, 0xc], [70, 5, 6, 0x1b], [134, 5, 7, 0x1c], [262, 6, 7, 0x3c], [390, 7, 8, 0x7d], [646, 6, 10, 0x3d], [-16, 9, 32, 0x1fe, "lower"], [1670, 9, 32, 0x1ff], [2, 0x1]]; + break; + case 9: + lines = [[-31, 8, 4, 0xfc], [-15, 9, 2, 0x1fc], [-11, 8, 2, 0xfd], [-7, 9, 1, 0x1fd], [-5, 7, 1, 0x7c], [-3, 4, 1, 0xa], [-1, 3, 1, 0x2], [1, 3, 1, 0x3], [3, 5, 1, 0x1a], [5, 6, 1, 0x3a], [7, 3, 5, 0x4], [39, 6, 2, 0x3b], [43, 4, 5, 0xb], [75, 4, 6, 0xc], [139, 5, 7, 0x1b], [267, 5, 8, 0x1c], [523, 6, 8, 0x3c], [779, 7, 9, 0x7d], [1291, 6, 11, 0x3d], [-32, 9, 32, 0x1fe, "lower"], [3339, 9, 32, 0x1ff], [2, 0x0]]; + break; + case 10: + lines = [[-21, 7, 4, 0x7a], [-5, 8, 0, 0xfc], [-4, 7, 0, 0x7b], [-3, 5, 0, 0x18], [-2, 2, 2, 0x0], [2, 5, 0, 0x19], [3, 6, 0, 0x36], [4, 7, 0, 0x7c], [5, 8, 0, 0xfd], [6, 2, 6, 0x1], [70, 5, 5, 0x1a], [102, 6, 5, 0x37], [134, 6, 6, 0x38], [198, 6, 7, 0x39], [326, 6, 8, 0x3a], [582, 6, 9, 0x3b], [1094, 6, 10, 0x3c], [2118, 7, 11, 0x7d], [-22, 8, 32, 0xfe, "lower"], [4166, 8, 32, 0xff], [2, 0x2]]; + break; + case 11: + lines = [[1, 1, 0, 0x0], [2, 2, 1, 0x2], [4, 4, 0, 0xc], [5, 4, 1, 0xd], [7, 5, 1, 0x1c], [9, 5, 2, 0x1d], [13, 6, 2, 0x3c], [17, 7, 2, 0x7a], [21, 7, 3, 0x7b], [29, 7, 4, 0x7c], [45, 7, 5, 0x7d], [77, 7, 6, 0x7e], [141, 7, 32, 0x7f]]; + break; + case 12: + lines = [[1, 1, 0, 0x0], [2, 2, 0, 0x2], [3, 3, 1, 0x6], [5, 5, 0, 0x1c], [6, 5, 1, 0x1d], [8, 6, 1, 0x3c], [10, 7, 0, 0x7a], [11, 7, 1, 0x7b], [13, 7, 2, 0x7c], [17, 7, 3, 0x7d], [25, 7, 4, 0x7e], [41, 8, 5, 0xfe], [73, 8, 32, 0xff]]; + break; + case 13: + lines = [[1, 1, 0, 0x0], [2, 3, 0, 0x4], [3, 4, 0, 0xc], [4, 5, 0, 0x1c], [5, 4, 1, 0xd], [7, 3, 3, 0x5], [15, 6, 1, 0x3a], [17, 6, 2, 0x3b], [21, 6, 3, 0x3c], [29, 6, 4, 0x3d], [45, 6, 5, 0x3e], [77, 7, 6, 0x7e], [141, 7, 32, 0x7f]]; + break; + case 14: + lines = [[-2, 3, 0, 0x4], [-1, 3, 0, 0x5], [0, 1, 0, 0x0], [1, 3, 0, 0x6], [2, 3, 0, 0x7]]; + break; + case 15: + lines = [[-24, 7, 4, 0x7c], [-8, 6, 2, 0x3c], [-4, 5, 1, 0x1c], [-2, 4, 0, 0xc], [-1, 3, 0, 0x4], [0, 1, 0, 0x0], [1, 3, 0, 0x5], [2, 4, 0, 0xd], [3, 5, 1, 0x1d], [5, 6, 2, 0x3d], [9, 7, 4, 0x7d], [-25, 7, 32, 0x7e, "lower"], [25, 7, 32, 0x7f]]; + break; + default: + throw new Jbig2Error(`standard table B.${number} does not exist`); + } + for (let i = 0, ii = lines.length; i < ii; i++) { + lines[i] = new HuffmanLine(lines[i]); + } + table = new HuffmanTable(lines, true); + standardTablesCache[number] = table; + return table; +} +class Reader { + constructor(data, start, end) { + this.data = data; + this.start = start; + this.end = end; + this.position = start; + this.shift = -1; + this.currentByte = 0; + } + readBit() { + if (this.shift < 0) { + if (this.position >= this.end) { + throw new Jbig2Error("end of data while reading bit"); + } + this.currentByte = this.data[this.position++]; + this.shift = 7; + } + const bit = this.currentByte >> this.shift & 1; + this.shift--; + return bit; + } + readBits(numBits) { + let result = 0, + i; + for (i = numBits - 1; i >= 0; i--) { + result |= this.readBit() << i; + } + return result; + } + byteAlign() { + this.shift = -1; + } + next() { + if (this.position >= this.end) { + return -1; + } + return this.data[this.position++]; + } +} +function getCustomHuffmanTable(index, referredTo, customTables) { + let currentIndex = 0; + for (let i = 0, ii = referredTo.length; i < ii; i++) { + const table = customTables[referredTo[i]]; + if (table) { + if (index === currentIndex) { + return table; + } + currentIndex++; + } + } + throw new Jbig2Error("can't find custom Huffman table"); +} +function getTextRegionHuffmanTables(textRegion, referredTo, customTables, numberOfSymbols, reader) { + const codes = []; + for (let i = 0; i <= 34; i++) { + const codeLength = reader.readBits(4); + codes.push(new HuffmanLine([i, codeLength, 0, 0])); + } + const runCodesTable = new HuffmanTable(codes, false); + codes.length = 0; + for (let i = 0; i < numberOfSymbols;) { + const codeLength = runCodesTable.decode(reader); + if (codeLength >= 32) { + let repeatedLength, numberOfRepeats, j; + switch (codeLength) { + case 32: + if (i === 0) { + throw new Jbig2Error("no previous value in symbol ID table"); + } + numberOfRepeats = reader.readBits(2) + 3; + repeatedLength = codes[i - 1].prefixLength; + break; + case 33: + numberOfRepeats = reader.readBits(3) + 3; + repeatedLength = 0; + break; + case 34: + numberOfRepeats = reader.readBits(7) + 11; + repeatedLength = 0; + break; + default: + throw new Jbig2Error("invalid code length in symbol ID table"); + } + for (j = 0; j < numberOfRepeats; j++) { + codes.push(new HuffmanLine([i, repeatedLength, 0, 0])); + i++; + } + } else { + codes.push(new HuffmanLine([i, codeLength, 0, 0])); + i++; + } + } + reader.byteAlign(); + const symbolIDTable = new HuffmanTable(codes, false); + let customIndex = 0, + tableFirstS, + tableDeltaS, + tableDeltaT; + switch (textRegion.huffmanFS) { + case 0: + case 1: + tableFirstS = getStandardTable(textRegion.huffmanFS + 6); + break; + case 3: + tableFirstS = getCustomHuffmanTable(customIndex, referredTo, customTables); + customIndex++; + break; + default: + throw new Jbig2Error("invalid Huffman FS selector"); + } + switch (textRegion.huffmanDS) { + case 0: + case 1: + case 2: + tableDeltaS = getStandardTable(textRegion.huffmanDS + 8); + break; + case 3: + tableDeltaS = getCustomHuffmanTable(customIndex, referredTo, customTables); + customIndex++; + break; + default: + throw new Jbig2Error("invalid Huffman DS selector"); + } + switch (textRegion.huffmanDT) { + case 0: + case 1: + case 2: + tableDeltaT = getStandardTable(textRegion.huffmanDT + 11); + break; + case 3: + tableDeltaT = getCustomHuffmanTable(customIndex, referredTo, customTables); + customIndex++; + break; + default: + throw new Jbig2Error("invalid Huffman DT selector"); + } + if (textRegion.refinement) { + throw new Jbig2Error("refinement with Huffman is not supported"); + } + return { + symbolIDTable, + tableFirstS, + tableDeltaS, + tableDeltaT + }; +} +function getSymbolDictionaryHuffmanTables(dictionary, referredTo, customTables) { + let customIndex = 0, + tableDeltaHeight, + tableDeltaWidth; + switch (dictionary.huffmanDHSelector) { + case 0: + case 1: + tableDeltaHeight = getStandardTable(dictionary.huffmanDHSelector + 4); + break; + case 3: + tableDeltaHeight = getCustomHuffmanTable(customIndex, referredTo, customTables); + customIndex++; + break; + default: + throw new Jbig2Error("invalid Huffman DH selector"); + } + switch (dictionary.huffmanDWSelector) { + case 0: + case 1: + tableDeltaWidth = getStandardTable(dictionary.huffmanDWSelector + 2); + break; + case 3: + tableDeltaWidth = getCustomHuffmanTable(customIndex, referredTo, customTables); + customIndex++; + break; + default: + throw new Jbig2Error("invalid Huffman DW selector"); + } + let tableBitmapSize, tableAggregateInstances; + if (dictionary.bitmapSizeSelector) { + tableBitmapSize = getCustomHuffmanTable(customIndex, referredTo, customTables); + customIndex++; + } else { + tableBitmapSize = getStandardTable(1); + } + if (dictionary.aggregationInstancesSelector) { + tableAggregateInstances = getCustomHuffmanTable(customIndex, referredTo, customTables); + } else { + tableAggregateInstances = getStandardTable(1); + } + return { + tableDeltaHeight, + tableDeltaWidth, + tableBitmapSize, + tableAggregateInstances + }; +} +function readUncompressedBitmap(reader, width, height) { + const bitmap = []; + for (let y = 0; y < height; y++) { + const row = new Uint8Array(width); + bitmap.push(row); + for (let x = 0; x < width; x++) { + row[x] = reader.readBit(); + } + reader.byteAlign(); + } + return bitmap; +} +function decodeMMRBitmap(input, width, height, endOfBlock) { + const params = { + K: -1, + Columns: width, + Rows: height, + BlackIs1: true, + EndOfBlock: endOfBlock + }; + const decoder = new CCITTFaxDecoder(input, params); + const bitmap = []; + let currentByte, + eof = false; + for (let y = 0; y < height; y++) { + const row = new Uint8Array(width); + bitmap.push(row); + let shift = -1; + for (let x = 0; x < width; x++) { + if (shift < 0) { + currentByte = decoder.readNextChar(); + if (currentByte === -1) { + currentByte = 0; + eof = true; + } + shift = 7; + } + row[x] = currentByte >> shift & 1; + shift--; + } + } + if (endOfBlock && !eof) { + const lookForEOFLimit = 5; + for (let i = 0; i < lookForEOFLimit; i++) { + if (decoder.readNextChar() === -1) { + break; + } + } + } + return bitmap; +} +class Jbig2Image { + parseChunks(chunks) { + return parseJbig2Chunks(chunks); + } + parse(data) { + throw new Error("Not implemented: Jbig2Image.parse"); + } +} + +;// ./src/core/jbig2_stream.js + + + + + +class Jbig2Stream extends DecodeStream { + constructor(stream, maybeLength, params) { + super(maybeLength); + this.stream = stream; + this.dict = stream.dict; + this.maybeLength = maybeLength; + this.params = params; + } + get bytes() { + return shadow(this, "bytes", this.stream.getBytes(this.maybeLength)); + } + ensureBuffer(requested) {} + readBlock() { + this.decodeImage(); + } + decodeImage(bytes) { + if (this.eof) { + return this.buffer; + } + bytes ||= this.bytes; + const jbig2Image = new Jbig2Image(); + const chunks = []; + if (this.params instanceof Dict) { + const globalsStream = this.params.get("JBIG2Globals"); + if (globalsStream instanceof BaseStream) { + const globals = globalsStream.getBytes(); + chunks.push({ + data: globals, + start: 0, + end: globals.length + }); + } + } + chunks.push({ + data: bytes, + start: 0, + end: bytes.length + }); + const data = jbig2Image.parseChunks(chunks); + const dataLength = data.length; + for (let i = 0; i < dataLength; i++) { + data[i] ^= 0xff; + } + this.buffer = data; + this.bufferLength = dataLength; + this.eof = true; + return this.buffer; + } + get canAsyncDecodeImageFromBuffer() { + return this.stream.isAsync; + } +} + +;// ./src/shared/image_utils.js + +function convertToRGBA(params) { + switch (params.kind) { + case ImageKind.GRAYSCALE_1BPP: + return convertBlackAndWhiteToRGBA(params); + case ImageKind.RGB_24BPP: + return convertRGBToRGBA(params); + } + return null; +} +function convertBlackAndWhiteToRGBA({ + src, + srcPos = 0, + dest, + width, + height, + nonBlackColor = 0xffffffff, + inverseDecode = false +}) { + const black = FeatureTest.isLittleEndian ? 0xff000000 : 0x000000ff; + const [zeroMapping, oneMapping] = inverseDecode ? [nonBlackColor, black] : [black, nonBlackColor]; + const widthInSource = width >> 3; + const widthRemainder = width & 7; + const srcLength = src.length; + dest = new Uint32Array(dest.buffer); + let destPos = 0; + for (let i = 0; i < height; i++) { + for (const max = srcPos + widthInSource; srcPos < max; srcPos++) { + const elem = srcPos < srcLength ? src[srcPos] : 255; + dest[destPos++] = elem & 0b10000000 ? oneMapping : zeroMapping; + dest[destPos++] = elem & 0b1000000 ? oneMapping : zeroMapping; + dest[destPos++] = elem & 0b100000 ? oneMapping : zeroMapping; + dest[destPos++] = elem & 0b10000 ? oneMapping : zeroMapping; + dest[destPos++] = elem & 0b1000 ? oneMapping : zeroMapping; + dest[destPos++] = elem & 0b100 ? oneMapping : zeroMapping; + dest[destPos++] = elem & 0b10 ? oneMapping : zeroMapping; + dest[destPos++] = elem & 0b1 ? oneMapping : zeroMapping; + } + if (widthRemainder === 0) { + continue; + } + const elem = srcPos < srcLength ? src[srcPos++] : 255; + for (let j = 0; j < widthRemainder; j++) { + dest[destPos++] = elem & 1 << 7 - j ? oneMapping : zeroMapping; + } + } + return { + srcPos, + destPos + }; +} +function convertRGBToRGBA({ + src, + srcPos = 0, + dest, + destPos = 0, + width, + height +}) { + let i = 0; + const len = width * height * 3; + const len32 = len >> 2; + const src32 = new Uint32Array(src.buffer, srcPos, len32); + if (FeatureTest.isLittleEndian) { + for (; i < len32 - 2; i += 3, destPos += 4) { + const s1 = src32[i]; + const s2 = src32[i + 1]; + const s3 = src32[i + 2]; + dest[destPos] = s1 | 0xff000000; + dest[destPos + 1] = s1 >>> 24 | s2 << 8 | 0xff000000; + dest[destPos + 2] = s2 >>> 16 | s3 << 16 | 0xff000000; + dest[destPos + 3] = s3 >>> 8 | 0xff000000; + } + for (let j = i * 4, jj = srcPos + len; j < jj; j += 3) { + dest[destPos++] = src[j] | src[j + 1] << 8 | src[j + 2] << 16 | 0xff000000; + } + } else { + for (; i < len32 - 2; i += 3, destPos += 4) { + const s1 = src32[i]; + const s2 = src32[i + 1]; + const s3 = src32[i + 2]; + dest[destPos] = s1 | 0xff; + dest[destPos + 1] = s1 << 24 | s2 >>> 8 | 0xff; + dest[destPos + 2] = s2 << 16 | s3 >>> 16 | 0xff; + dest[destPos + 3] = s3 << 8 | 0xff; + } + for (let j = i * 4, jj = srcPos + len; j < jj; j += 3) { + dest[destPos++] = src[j] << 24 | src[j + 1] << 16 | src[j + 2] << 8 | 0xff; + } + } + return { + srcPos: srcPos + len, + destPos + }; +} +function grayToRGBA(src, dest) { + if (FeatureTest.isLittleEndian) { + for (let i = 0, ii = src.length; i < ii; i++) { + dest[i] = src[i] * 0x10101 | 0xff000000; + } + } else { + for (let i = 0, ii = src.length; i < ii; i++) { + dest[i] = src[i] * 0x1010100 | 0x000000ff; + } + } +} + +;// ./src/core/jpg.js + + + +class JpegError extends BaseException { + constructor(msg) { + super(msg, "JpegError"); + } +} +class DNLMarkerError extends BaseException { + constructor(message, scanLines) { + super(message, "DNLMarkerError"); + this.scanLines = scanLines; + } +} +class EOIMarkerError extends BaseException { + constructor(msg) { + super(msg, "EOIMarkerError"); + } +} +const dctZigZag = new Uint8Array([0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, 12, 19, 26, 33, 40, 48, 41, 34, 27, 20, 13, 6, 7, 14, 21, 28, 35, 42, 49, 56, 57, 50, 43, 36, 29, 22, 15, 23, 30, 37, 44, 51, 58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63]); +const dctCos1 = 4017; +const dctSin1 = 799; +const dctCos3 = 3406; +const dctSin3 = 2276; +const dctCos6 = 1567; +const dctSin6 = 3784; +const dctSqrt2 = 5793; +const dctSqrt1d2 = 2896; +function buildHuffmanTable(codeLengths, values) { + let k = 0, + i, + j, + length = 16; + while (length > 0 && !codeLengths[length - 1]) { + length--; + } + const code = [{ + children: [], + index: 0 + }]; + let p = code[0], + q; + for (i = 0; i < length; i++) { + for (j = 0; j < codeLengths[i]; j++) { + p = code.pop(); + p.children[p.index] = values[k]; + while (p.index > 0) { + p = code.pop(); + } + p.index++; + code.push(p); + while (code.length <= i) { + code.push(q = { + children: [], + index: 0 + }); + p.children[p.index] = q.children; + p = q; + } + k++; + } + if (i + 1 < length) { + code.push(q = { + children: [], + index: 0 + }); + p.children[p.index] = q.children; + p = q; + } + } + return code[0].children; +} +function getBlockBufferOffset(component, row, col) { + return 64 * ((component.blocksPerLine + 1) * row + col); +} +function decodeScan(data, offset, frame, components, resetInterval, spectralStart, spectralEnd, successivePrev, successive, parseDNLMarker = false) { + const mcusPerLine = frame.mcusPerLine; + const progressive = frame.progressive; + const startOffset = offset; + let bitsData = 0, + bitsCount = 0; + function readBit() { + if (bitsCount > 0) { + bitsCount--; + return bitsData >> bitsCount & 1; + } + bitsData = data[offset++]; + if (bitsData === 0xff) { + const nextByte = data[offset++]; + if (nextByte) { + if (nextByte === 0xdc && parseDNLMarker) { + offset += 2; + const scanLines = readUint16(data, offset); + offset += 2; + if (scanLines > 0 && scanLines !== frame.scanLines) { + throw new DNLMarkerError("Found DNL marker (0xFFDC) while parsing scan data", scanLines); + } + } else if (nextByte === 0xd9) { + if (parseDNLMarker) { + const maybeScanLines = blockRow * (frame.precision === 8 ? 8 : 0); + if (maybeScanLines > 0 && Math.round(frame.scanLines / maybeScanLines) >= 5) { + throw new DNLMarkerError("Found EOI marker (0xFFD9) while parsing scan data, " + "possibly caused by incorrect `scanLines` parameter", maybeScanLines); + } + } + throw new EOIMarkerError("Found EOI marker (0xFFD9) while parsing scan data"); + } + throw new JpegError(`unexpected marker ${(bitsData << 8 | nextByte).toString(16)}`); + } + } + bitsCount = 7; + return bitsData >>> 7; + } + function decodeHuffman(tree) { + let node = tree; + while (true) { + node = node[readBit()]; + switch (typeof node) { + case "number": + return node; + case "object": + continue; + } + throw new JpegError("invalid huffman sequence"); + } + } + function receive(length) { + let n = 0; + while (length > 0) { + n = n << 1 | readBit(); + length--; + } + return n; + } + function receiveAndExtend(length) { + if (length === 1) { + return readBit() === 1 ? 1 : -1; + } + const n = receive(length); + if (n >= 1 << length - 1) { + return n; + } + return n + (-1 << length) + 1; + } + function decodeBaseline(component, blockOffset) { + const t = decodeHuffman(component.huffmanTableDC); + const diff = t === 0 ? 0 : receiveAndExtend(t); + component.blockData[blockOffset] = component.pred += diff; + let k = 1; + while (k < 64) { + const rs = decodeHuffman(component.huffmanTableAC); + const s = rs & 15, + r = rs >> 4; + if (s === 0) { + if (r < 15) { + break; + } + k += 16; + continue; + } + k += r; + const z = dctZigZag[k]; + component.blockData[blockOffset + z] = receiveAndExtend(s); + k++; + } + } + function decodeDCFirst(component, blockOffset) { + const t = decodeHuffman(component.huffmanTableDC); + const diff = t === 0 ? 0 : receiveAndExtend(t) << successive; + component.blockData[blockOffset] = component.pred += diff; + } + function decodeDCSuccessive(component, blockOffset) { + component.blockData[blockOffset] |= readBit() << successive; + } + let eobrun = 0; + function decodeACFirst(component, blockOffset) { + if (eobrun > 0) { + eobrun--; + return; + } + let k = spectralStart; + const e = spectralEnd; + while (k <= e) { + const rs = decodeHuffman(component.huffmanTableAC); + const s = rs & 15, + r = rs >> 4; + if (s === 0) { + if (r < 15) { + eobrun = receive(r) + (1 << r) - 1; + break; + } + k += 16; + continue; + } + k += r; + const z = dctZigZag[k]; + component.blockData[blockOffset + z] = receiveAndExtend(s) * (1 << successive); + k++; + } + } + let successiveACState = 0, + successiveACNextValue; + function decodeACSuccessive(component, blockOffset) { + let k = spectralStart; + const e = spectralEnd; + let r = 0; + let s; + let rs; + while (k <= e) { + const offsetZ = blockOffset + dctZigZag[k]; + const sign = component.blockData[offsetZ] < 0 ? -1 : 1; + switch (successiveACState) { + case 0: + rs = decodeHuffman(component.huffmanTableAC); + s = rs & 15; + r = rs >> 4; + if (s === 0) { + if (r < 15) { + eobrun = receive(r) + (1 << r); + successiveACState = 4; + } else { + r = 16; + successiveACState = 1; + } + } else { + if (s !== 1) { + throw new JpegError("invalid ACn encoding"); + } + successiveACNextValue = receiveAndExtend(s); + successiveACState = r ? 2 : 3; + } + continue; + case 1: + case 2: + if (component.blockData[offsetZ]) { + component.blockData[offsetZ] += sign * (readBit() << successive); + } else { + r--; + if (r === 0) { + successiveACState = successiveACState === 2 ? 3 : 0; + } + } + break; + case 3: + if (component.blockData[offsetZ]) { + component.blockData[offsetZ] += sign * (readBit() << successive); + } else { + component.blockData[offsetZ] = successiveACNextValue << successive; + successiveACState = 0; + } + break; + case 4: + if (component.blockData[offsetZ]) { + component.blockData[offsetZ] += sign * (readBit() << successive); + } + break; + } + k++; + } + if (successiveACState === 4) { + eobrun--; + if (eobrun === 0) { + successiveACState = 0; + } + } + } + let blockRow = 0; + function decodeMcu(component, decode, mcu, row, col) { + const mcuRow = mcu / mcusPerLine | 0; + const mcuCol = mcu % mcusPerLine; + blockRow = mcuRow * component.v + row; + const blockCol = mcuCol * component.h + col; + const blockOffset = getBlockBufferOffset(component, blockRow, blockCol); + decode(component, blockOffset); + } + function decodeBlock(component, decode, mcu) { + blockRow = mcu / component.blocksPerLine | 0; + const blockCol = mcu % component.blocksPerLine; + const blockOffset = getBlockBufferOffset(component, blockRow, blockCol); + decode(component, blockOffset); + } + const componentsLength = components.length; + let component, i, j, k, n; + let decodeFn; + if (progressive) { + if (spectralStart === 0) { + decodeFn = successivePrev === 0 ? decodeDCFirst : decodeDCSuccessive; + } else { + decodeFn = successivePrev === 0 ? decodeACFirst : decodeACSuccessive; + } + } else { + decodeFn = decodeBaseline; + } + let mcu = 0, + fileMarker; + const mcuExpected = componentsLength === 1 ? components[0].blocksPerLine * components[0].blocksPerColumn : mcusPerLine * frame.mcusPerColumn; + let h, v; + while (mcu <= mcuExpected) { + const mcuToRead = resetInterval ? Math.min(mcuExpected - mcu, resetInterval) : mcuExpected; + if (mcuToRead > 0) { + for (i = 0; i < componentsLength; i++) { + components[i].pred = 0; + } + eobrun = 0; + if (componentsLength === 1) { + component = components[0]; + for (n = 0; n < mcuToRead; n++) { + decodeBlock(component, decodeFn, mcu); + mcu++; + } + } else { + for (n = 0; n < mcuToRead; n++) { + for (i = 0; i < componentsLength; i++) { + component = components[i]; + h = component.h; + v = component.v; + for (j = 0; j < v; j++) { + for (k = 0; k < h; k++) { + decodeMcu(component, decodeFn, mcu, j, k); + } + } + } + mcu++; + } + } + } + bitsCount = 0; + fileMarker = findNextFileMarker(data, offset); + if (!fileMarker) { + break; + } + if (fileMarker.invalid) { + const partialMsg = mcuToRead > 0 ? "unexpected" : "excessive"; + warn(`decodeScan - ${partialMsg} MCU data, current marker is: ${fileMarker.invalid}`); + offset = fileMarker.offset; + } + if (fileMarker.marker >= 0xffd0 && fileMarker.marker <= 0xffd7) { + offset += 2; + } else { + break; + } + } + return offset - startOffset; +} +function quantizeAndInverse(component, blockBufferOffset, p) { + const qt = component.quantizationTable, + blockData = component.blockData; + let v0, v1, v2, v3, v4, v5, v6, v7; + let p0, p1, p2, p3, p4, p5, p6, p7; + let t; + if (!qt) { + throw new JpegError("missing required Quantization Table."); + } + for (let row = 0; row < 64; row += 8) { + p0 = blockData[blockBufferOffset + row]; + p1 = blockData[blockBufferOffset + row + 1]; + p2 = blockData[blockBufferOffset + row + 2]; + p3 = blockData[blockBufferOffset + row + 3]; + p4 = blockData[blockBufferOffset + row + 4]; + p5 = blockData[blockBufferOffset + row + 5]; + p6 = blockData[blockBufferOffset + row + 6]; + p7 = blockData[blockBufferOffset + row + 7]; + p0 *= qt[row]; + if ((p1 | p2 | p3 | p4 | p5 | p6 | p7) === 0) { + t = dctSqrt2 * p0 + 512 >> 10; + p[row] = t; + p[row + 1] = t; + p[row + 2] = t; + p[row + 3] = t; + p[row + 4] = t; + p[row + 5] = t; + p[row + 6] = t; + p[row + 7] = t; + continue; + } + p1 *= qt[row + 1]; + p2 *= qt[row + 2]; + p3 *= qt[row + 3]; + p4 *= qt[row + 4]; + p5 *= qt[row + 5]; + p6 *= qt[row + 6]; + p7 *= qt[row + 7]; + v0 = dctSqrt2 * p0 + 128 >> 8; + v1 = dctSqrt2 * p4 + 128 >> 8; + v2 = p2; + v3 = p6; + v4 = dctSqrt1d2 * (p1 - p7) + 128 >> 8; + v7 = dctSqrt1d2 * (p1 + p7) + 128 >> 8; + v5 = p3 << 4; + v6 = p5 << 4; + v0 = v0 + v1 + 1 >> 1; + v1 = v0 - v1; + t = v2 * dctSin6 + v3 * dctCos6 + 128 >> 8; + v2 = v2 * dctCos6 - v3 * dctSin6 + 128 >> 8; + v3 = t; + v4 = v4 + v6 + 1 >> 1; + v6 = v4 - v6; + v7 = v7 + v5 + 1 >> 1; + v5 = v7 - v5; + v0 = v0 + v3 + 1 >> 1; + v3 = v0 - v3; + v1 = v1 + v2 + 1 >> 1; + v2 = v1 - v2; + t = v4 * dctSin3 + v7 * dctCos3 + 2048 >> 12; + v4 = v4 * dctCos3 - v7 * dctSin3 + 2048 >> 12; + v7 = t; + t = v5 * dctSin1 + v6 * dctCos1 + 2048 >> 12; + v5 = v5 * dctCos1 - v6 * dctSin1 + 2048 >> 12; + v6 = t; + p[row] = v0 + v7; + p[row + 7] = v0 - v7; + p[row + 1] = v1 + v6; + p[row + 6] = v1 - v6; + p[row + 2] = v2 + v5; + p[row + 5] = v2 - v5; + p[row + 3] = v3 + v4; + p[row + 4] = v3 - v4; + } + for (let col = 0; col < 8; ++col) { + p0 = p[col]; + p1 = p[col + 8]; + p2 = p[col + 16]; + p3 = p[col + 24]; + p4 = p[col + 32]; + p5 = p[col + 40]; + p6 = p[col + 48]; + p7 = p[col + 56]; + if ((p1 | p2 | p3 | p4 | p5 | p6 | p7) === 0) { + t = dctSqrt2 * p0 + 8192 >> 14; + if (t < -2040) { + t = 0; + } else if (t >= 2024) { + t = 255; + } else { + t = t + 2056 >> 4; + } + blockData[blockBufferOffset + col] = t; + blockData[blockBufferOffset + col + 8] = t; + blockData[blockBufferOffset + col + 16] = t; + blockData[blockBufferOffset + col + 24] = t; + blockData[blockBufferOffset + col + 32] = t; + blockData[blockBufferOffset + col + 40] = t; + blockData[blockBufferOffset + col + 48] = t; + blockData[blockBufferOffset + col + 56] = t; + continue; + } + v0 = dctSqrt2 * p0 + 2048 >> 12; + v1 = dctSqrt2 * p4 + 2048 >> 12; + v2 = p2; + v3 = p6; + v4 = dctSqrt1d2 * (p1 - p7) + 2048 >> 12; + v7 = dctSqrt1d2 * (p1 + p7) + 2048 >> 12; + v5 = p3; + v6 = p5; + v0 = (v0 + v1 + 1 >> 1) + 4112; + v1 = v0 - v1; + t = v2 * dctSin6 + v3 * dctCos6 + 2048 >> 12; + v2 = v2 * dctCos6 - v3 * dctSin6 + 2048 >> 12; + v3 = t; + v4 = v4 + v6 + 1 >> 1; + v6 = v4 - v6; + v7 = v7 + v5 + 1 >> 1; + v5 = v7 - v5; + v0 = v0 + v3 + 1 >> 1; + v3 = v0 - v3; + v1 = v1 + v2 + 1 >> 1; + v2 = v1 - v2; + t = v4 * dctSin3 + v7 * dctCos3 + 2048 >> 12; + v4 = v4 * dctCos3 - v7 * dctSin3 + 2048 >> 12; + v7 = t; + t = v5 * dctSin1 + v6 * dctCos1 + 2048 >> 12; + v5 = v5 * dctCos1 - v6 * dctSin1 + 2048 >> 12; + v6 = t; + p0 = v0 + v7; + p7 = v0 - v7; + p1 = v1 + v6; + p6 = v1 - v6; + p2 = v2 + v5; + p5 = v2 - v5; + p3 = v3 + v4; + p4 = v3 - v4; + if (p0 < 16) { + p0 = 0; + } else if (p0 >= 4080) { + p0 = 255; + } else { + p0 >>= 4; + } + if (p1 < 16) { + p1 = 0; + } else if (p1 >= 4080) { + p1 = 255; + } else { + p1 >>= 4; + } + if (p2 < 16) { + p2 = 0; + } else if (p2 >= 4080) { + p2 = 255; + } else { + p2 >>= 4; + } + if (p3 < 16) { + p3 = 0; + } else if (p3 >= 4080) { + p3 = 255; + } else { + p3 >>= 4; + } + if (p4 < 16) { + p4 = 0; + } else if (p4 >= 4080) { + p4 = 255; + } else { + p4 >>= 4; + } + if (p5 < 16) { + p5 = 0; + } else if (p5 >= 4080) { + p5 = 255; + } else { + p5 >>= 4; + } + if (p6 < 16) { + p6 = 0; + } else if (p6 >= 4080) { + p6 = 255; + } else { + p6 >>= 4; + } + if (p7 < 16) { + p7 = 0; + } else if (p7 >= 4080) { + p7 = 255; + } else { + p7 >>= 4; + } + blockData[blockBufferOffset + col] = p0; + blockData[blockBufferOffset + col + 8] = p1; + blockData[blockBufferOffset + col + 16] = p2; + blockData[blockBufferOffset + col + 24] = p3; + blockData[blockBufferOffset + col + 32] = p4; + blockData[blockBufferOffset + col + 40] = p5; + blockData[blockBufferOffset + col + 48] = p6; + blockData[blockBufferOffset + col + 56] = p7; + } +} +function buildComponentData(frame, component) { + const blocksPerLine = component.blocksPerLine; + const blocksPerColumn = component.blocksPerColumn; + const computationBuffer = new Int16Array(64); + for (let blockRow = 0; blockRow < blocksPerColumn; blockRow++) { + for (let blockCol = 0; blockCol < blocksPerLine; blockCol++) { + const offset = getBlockBufferOffset(component, blockRow, blockCol); + quantizeAndInverse(component, offset, computationBuffer); + } + } + return component.blockData; +} +function findNextFileMarker(data, currentPos, startPos = currentPos) { + const maxPos = data.length - 1; + let newPos = startPos < currentPos ? startPos : currentPos; + if (currentPos >= maxPos) { + return null; + } + const currentMarker = readUint16(data, currentPos); + if (currentMarker >= 0xffc0 && currentMarker <= 0xfffe) { + return { + invalid: null, + marker: currentMarker, + offset: currentPos + }; + } + let newMarker = readUint16(data, newPos); + while (!(newMarker >= 0xffc0 && newMarker <= 0xfffe)) { + if (++newPos >= maxPos) { + return null; + } + newMarker = readUint16(data, newPos); + } + return { + invalid: currentMarker.toString(16), + marker: newMarker, + offset: newPos + }; +} +function prepareComponents(frame) { + const mcusPerLine = Math.ceil(frame.samplesPerLine / 8 / frame.maxH); + const mcusPerColumn = Math.ceil(frame.scanLines / 8 / frame.maxV); + for (const component of frame.components) { + const blocksPerLine = Math.ceil(Math.ceil(frame.samplesPerLine / 8) * component.h / frame.maxH); + const blocksPerColumn = Math.ceil(Math.ceil(frame.scanLines / 8) * component.v / frame.maxV); + const blocksPerLineForMcu = mcusPerLine * component.h; + const blocksPerColumnForMcu = mcusPerColumn * component.v; + const blocksBufferSize = 64 * blocksPerColumnForMcu * (blocksPerLineForMcu + 1); + component.blockData = new Int16Array(blocksBufferSize); + component.blocksPerLine = blocksPerLine; + component.blocksPerColumn = blocksPerColumn; + } + frame.mcusPerLine = mcusPerLine; + frame.mcusPerColumn = mcusPerColumn; +} +function readDataBlock(data, offset) { + const length = readUint16(data, offset); + offset += 2; + let endOffset = offset + length - 2; + const fileMarker = findNextFileMarker(data, endOffset, offset); + if (fileMarker?.invalid) { + warn("readDataBlock - incorrect length, current marker is: " + fileMarker.invalid); + endOffset = fileMarker.offset; + } + const array = data.subarray(offset, endOffset); + offset += array.length; + return { + appData: array, + newOffset: offset + }; +} +function skipData(data, offset) { + const length = readUint16(data, offset); + offset += 2; + const endOffset = offset + length - 2; + const fileMarker = findNextFileMarker(data, endOffset, offset); + if (fileMarker?.invalid) { + return fileMarker.offset; + } + return endOffset; +} +class JpegImage { + constructor({ + decodeTransform = null, + colorTransform = -1 + } = {}) { + this._decodeTransform = decodeTransform; + this._colorTransform = colorTransform; + } + static canUseImageDecoder(data, colorTransform = -1) { + let offset = 0; + let numComponents = null; + let fileMarker = readUint16(data, offset); + offset += 2; + if (fileMarker !== 0xffd8) { + throw new JpegError("SOI not found"); + } + fileMarker = readUint16(data, offset); + offset += 2; + markerLoop: while (fileMarker !== 0xffd9) { + switch (fileMarker) { + case 0xffc0: + case 0xffc1: + case 0xffc2: + numComponents = data[offset + (2 + 1 + 2 + 2)]; + break markerLoop; + case 0xffff: + if (data[offset] !== 0xff) { + offset--; + } + break; + } + offset = skipData(data, offset); + fileMarker = readUint16(data, offset); + offset += 2; + } + if (numComponents === 4) { + return false; + } + if (numComponents === 3 && colorTransform === 0) { + return false; + } + return true; + } + parse(data, { + dnlScanLines = null + } = {}) { + let offset = 0; + let jfif = null; + let adobe = null; + let frame, resetInterval; + let numSOSMarkers = 0; + const quantizationTables = []; + const huffmanTablesAC = [], + huffmanTablesDC = []; + let fileMarker = readUint16(data, offset); + offset += 2; + if (fileMarker !== 0xffd8) { + throw new JpegError("SOI not found"); + } + fileMarker = readUint16(data, offset); + offset += 2; + markerLoop: while (fileMarker !== 0xffd9) { + let i, j, l; + switch (fileMarker) { + case 0xffe0: + case 0xffe1: + case 0xffe2: + case 0xffe3: + case 0xffe4: + case 0xffe5: + case 0xffe6: + case 0xffe7: + case 0xffe8: + case 0xffe9: + case 0xffea: + case 0xffeb: + case 0xffec: + case 0xffed: + case 0xffee: + case 0xffef: + case 0xfffe: + const { + appData, + newOffset + } = readDataBlock(data, offset); + offset = newOffset; + if (fileMarker === 0xffe0) { + if (appData[0] === 0x4a && appData[1] === 0x46 && appData[2] === 0x49 && appData[3] === 0x46 && appData[4] === 0) { + jfif = { + version: { + major: appData[5], + minor: appData[6] + }, + densityUnits: appData[7], + xDensity: appData[8] << 8 | appData[9], + yDensity: appData[10] << 8 | appData[11], + thumbWidth: appData[12], + thumbHeight: appData[13], + thumbData: appData.subarray(14, 14 + 3 * appData[12] * appData[13]) + }; + } + } + if (fileMarker === 0xffee) { + if (appData[0] === 0x41 && appData[1] === 0x64 && appData[2] === 0x6f && appData[3] === 0x62 && appData[4] === 0x65) { + adobe = { + version: appData[5] << 8 | appData[6], + flags0: appData[7] << 8 | appData[8], + flags1: appData[9] << 8 | appData[10], + transformCode: appData[11] + }; + } + } + break; + case 0xffdb: + const quantizationTablesLength = readUint16(data, offset); + offset += 2; + const quantizationTablesEnd = quantizationTablesLength + offset - 2; + let z; + while (offset < quantizationTablesEnd) { + const quantizationTableSpec = data[offset++]; + const tableData = new Uint16Array(64); + if (quantizationTableSpec >> 4 === 0) { + for (j = 0; j < 64; j++) { + z = dctZigZag[j]; + tableData[z] = data[offset++]; + } + } else if (quantizationTableSpec >> 4 === 1) { + for (j = 0; j < 64; j++) { + z = dctZigZag[j]; + tableData[z] = readUint16(data, offset); + offset += 2; + } + } else { + throw new JpegError("DQT - invalid table spec"); + } + quantizationTables[quantizationTableSpec & 15] = tableData; + } + break; + case 0xffc0: + case 0xffc1: + case 0xffc2: + if (frame) { + throw new JpegError("Only single frame JPEGs supported"); + } + offset += 2; + frame = {}; + frame.extended = fileMarker === 0xffc1; + frame.progressive = fileMarker === 0xffc2; + frame.precision = data[offset++]; + const sofScanLines = readUint16(data, offset); + offset += 2; + frame.scanLines = dnlScanLines || sofScanLines; + frame.samplesPerLine = readUint16(data, offset); + offset += 2; + frame.components = []; + frame.componentIds = {}; + const componentsCount = data[offset++]; + let maxH = 0, + maxV = 0; + for (i = 0; i < componentsCount; i++) { + const componentId = data[offset]; + const h = data[offset + 1] >> 4; + const v = data[offset + 1] & 15; + if (maxH < h) { + maxH = h; + } + if (maxV < v) { + maxV = v; + } + const qId = data[offset + 2]; + l = frame.components.push({ + h, + v, + quantizationId: qId, + quantizationTable: null + }); + frame.componentIds[componentId] = l - 1; + offset += 3; + } + frame.maxH = maxH; + frame.maxV = maxV; + prepareComponents(frame); + break; + case 0xffc4: + const huffmanLength = readUint16(data, offset); + offset += 2; + for (i = 2; i < huffmanLength;) { + const huffmanTableSpec = data[offset++]; + const codeLengths = new Uint8Array(16); + let codeLengthSum = 0; + for (j = 0; j < 16; j++, offset++) { + codeLengthSum += codeLengths[j] = data[offset]; + } + const huffmanValues = new Uint8Array(codeLengthSum); + for (j = 0; j < codeLengthSum; j++, offset++) { + huffmanValues[j] = data[offset]; + } + i += 17 + codeLengthSum; + (huffmanTableSpec >> 4 === 0 ? huffmanTablesDC : huffmanTablesAC)[huffmanTableSpec & 15] = buildHuffmanTable(codeLengths, huffmanValues); + } + break; + case 0xffdd: + offset += 2; + resetInterval = readUint16(data, offset); + offset += 2; + break; + case 0xffda: + const parseDNLMarker = ++numSOSMarkers === 1 && !dnlScanLines; + offset += 2; + const selectorsCount = data[offset++], + components = []; + for (i = 0; i < selectorsCount; i++) { + const index = data[offset++]; + const componentIndex = frame.componentIds[index]; + const component = frame.components[componentIndex]; + component.index = index; + const tableSpec = data[offset++]; + component.huffmanTableDC = huffmanTablesDC[tableSpec >> 4]; + component.huffmanTableAC = huffmanTablesAC[tableSpec & 15]; + components.push(component); + } + const spectralStart = data[offset++], + spectralEnd = data[offset++], + successiveApproximation = data[offset++]; + try { + const processed = decodeScan(data, offset, frame, components, resetInterval, spectralStart, spectralEnd, successiveApproximation >> 4, successiveApproximation & 15, parseDNLMarker); + offset += processed; + } catch (ex) { + if (ex instanceof DNLMarkerError) { + warn(`${ex.message} -- attempting to re-parse the JPEG image.`); + return this.parse(data, { + dnlScanLines: ex.scanLines + }); + } else if (ex instanceof EOIMarkerError) { + warn(`${ex.message} -- ignoring the rest of the image data.`); + break markerLoop; + } + throw ex; + } + break; + case 0xffdc: + offset += 4; + break; + case 0xffff: + if (data[offset] !== 0xff) { + offset--; + } + break; + default: + const nextFileMarker = findNextFileMarker(data, offset - 2, offset - 3); + if (nextFileMarker?.invalid) { + warn("JpegImage.parse - unexpected data, current marker is: " + nextFileMarker.invalid); + offset = nextFileMarker.offset; + break; + } + if (!nextFileMarker || offset >= data.length - 1) { + warn("JpegImage.parse - reached the end of the image data " + "without finding an EOI marker (0xFFD9)."); + break markerLoop; + } + throw new JpegError("JpegImage.parse - unknown marker: " + fileMarker.toString(16)); + } + fileMarker = readUint16(data, offset); + offset += 2; + } + if (!frame) { + throw new JpegError("JpegImage.parse - no frame data found."); + } + this.width = frame.samplesPerLine; + this.height = frame.scanLines; + this.jfif = jfif; + this.adobe = adobe; + this.components = []; + for (const component of frame.components) { + const quantizationTable = quantizationTables[component.quantizationId]; + if (quantizationTable) { + component.quantizationTable = quantizationTable; + } + this.components.push({ + index: component.index, + output: buildComponentData(frame, component), + scaleX: component.h / frame.maxH, + scaleY: component.v / frame.maxV, + blocksPerLine: component.blocksPerLine, + blocksPerColumn: component.blocksPerColumn + }); + } + this.numComponents = this.components.length; + return undefined; + } + _getLinearizedBlockData(width, height, isSourcePDF = false) { + const scaleX = this.width / width, + scaleY = this.height / height; + let component, componentScaleX, componentScaleY, blocksPerScanline; + let x, y, i, j, k; + let index; + let offset = 0; + let output; + const numComponents = this.components.length; + const dataLength = width * height * numComponents; + const data = new Uint8ClampedArray(dataLength); + const xScaleBlockOffset = new Uint32Array(width); + const mask3LSB = 0xfffffff8; + let lastComponentScaleX; + for (i = 0; i < numComponents; i++) { + component = this.components[i]; + componentScaleX = component.scaleX * scaleX; + componentScaleY = component.scaleY * scaleY; + offset = i; + output = component.output; + blocksPerScanline = component.blocksPerLine + 1 << 3; + if (componentScaleX !== lastComponentScaleX) { + for (x = 0; x < width; x++) { + j = 0 | x * componentScaleX; + xScaleBlockOffset[x] = (j & mask3LSB) << 3 | j & 7; + } + lastComponentScaleX = componentScaleX; + } + for (y = 0; y < height; y++) { + j = 0 | y * componentScaleY; + index = blocksPerScanline * (j & mask3LSB) | (j & 7) << 3; + for (x = 0; x < width; x++) { + data[offset] = output[index + xScaleBlockOffset[x]]; + offset += numComponents; + } + } + } + let transform = this._decodeTransform; + if (!isSourcePDF && numComponents === 4 && !transform) { + transform = new Int32Array([-256, 255, -256, 255, -256, 255, -256, 255]); + } + if (transform) { + for (i = 0; i < dataLength;) { + for (j = 0, k = 0; j < numComponents; j++, i++, k += 2) { + data[i] = (data[i] * transform[k] >> 8) + transform[k + 1]; + } + } + } + return data; + } + get _isColorConversionNeeded() { + if (this.adobe) { + return !!this.adobe.transformCode; + } + if (this.numComponents === 3) { + if (this._colorTransform === 0) { + return false; + } else if (this.components[0].index === 0x52 && this.components[1].index === 0x47 && this.components[2].index === 0x42) { + return false; + } + return true; + } + if (this._colorTransform === 1) { + return true; + } + return false; + } + _convertYccToRgb(data) { + let Y, Cb, Cr; + for (let i = 0, length = data.length; i < length; i += 3) { + Y = data[i]; + Cb = data[i + 1]; + Cr = data[i + 2]; + data[i] = Y - 179.456 + 1.402 * Cr; + data[i + 1] = Y + 135.459 - 0.344 * Cb - 0.714 * Cr; + data[i + 2] = Y - 226.816 + 1.772 * Cb; + } + return data; + } + _convertYccToRgba(data, out) { + for (let i = 0, j = 0, length = data.length; i < length; i += 3, j += 4) { + const Y = data[i]; + const Cb = data[i + 1]; + const Cr = data[i + 2]; + out[j] = Y - 179.456 + 1.402 * Cr; + out[j + 1] = Y + 135.459 - 0.344 * Cb - 0.714 * Cr; + out[j + 2] = Y - 226.816 + 1.772 * Cb; + out[j + 3] = 255; + } + return out; + } + _convertYcckToRgb(data) { + let Y, Cb, Cr, k; + let offset = 0; + for (let i = 0, length = data.length; i < length; i += 4) { + Y = data[i]; + Cb = data[i + 1]; + Cr = data[i + 2]; + k = data[i + 3]; + data[offset++] = -122.67195406894 + Cb * (-6.60635669420364e-5 * Cb + 0.000437130475926232 * Cr - 5.4080610064599e-5 * Y + 0.00048449797120281 * k - 0.154362151871126) + Cr * (-0.000957964378445773 * Cr + 0.000817076911346625 * Y - 0.00477271405408747 * k + 1.53380253221734) + Y * (0.000961250184130688 * Y - 0.00266257332283933 * k + 0.48357088451265) + k * (-0.000336197177618394 * k + 0.484791561490776); + data[offset++] = 107.268039397724 + Cb * (2.19927104525741e-5 * Cb - 0.000640992018297945 * Cr + 0.000659397001245577 * Y + 0.000426105652938837 * k - 0.176491792462875) + Cr * (-0.000778269941513683 * Cr + 0.00130872261408275 * Y + 0.000770482631801132 * k - 0.151051492775562) + Y * (0.00126935368114843 * Y - 0.00265090189010898 * k + 0.25802910206845) + k * (-0.000318913117588328 * k - 0.213742400323665); + data[offset++] = -20.810012546947 + Cb * (-0.000570115196973677 * Cb - 2.63409051004589e-5 * Cr + 0.0020741088115012 * Y - 0.00288260236853442 * k + 0.814272968359295) + Cr * (-1.53496057440975e-5 * Cr - 0.000132689043961446 * Y + 0.000560833691242812 * k - 0.195152027534049) + Y * (0.00174418132927582 * Y - 0.00255243321439347 * k + 0.116935020465145) + k * (-0.000343531996510555 * k + 0.24165260232407); + } + return data.subarray(0, offset); + } + _convertYcckToRgba(data) { + for (let i = 0, length = data.length; i < length; i += 4) { + const Y = data[i]; + const Cb = data[i + 1]; + const Cr = data[i + 2]; + const k = data[i + 3]; + data[i] = -122.67195406894 + Cb * (-6.60635669420364e-5 * Cb + 0.000437130475926232 * Cr - 5.4080610064599e-5 * Y + 0.00048449797120281 * k - 0.154362151871126) + Cr * (-0.000957964378445773 * Cr + 0.000817076911346625 * Y - 0.00477271405408747 * k + 1.53380253221734) + Y * (0.000961250184130688 * Y - 0.00266257332283933 * k + 0.48357088451265) + k * (-0.000336197177618394 * k + 0.484791561490776); + data[i + 1] = 107.268039397724 + Cb * (2.19927104525741e-5 * Cb - 0.000640992018297945 * Cr + 0.000659397001245577 * Y + 0.000426105652938837 * k - 0.176491792462875) + Cr * (-0.000778269941513683 * Cr + 0.00130872261408275 * Y + 0.000770482631801132 * k - 0.151051492775562) + Y * (0.00126935368114843 * Y - 0.00265090189010898 * k + 0.25802910206845) + k * (-0.000318913117588328 * k - 0.213742400323665); + data[i + 2] = -20.810012546947 + Cb * (-0.000570115196973677 * Cb - 2.63409051004589e-5 * Cr + 0.0020741088115012 * Y - 0.00288260236853442 * k + 0.814272968359295) + Cr * (-1.53496057440975e-5 * Cr - 0.000132689043961446 * Y + 0.000560833691242812 * k - 0.195152027534049) + Y * (0.00174418132927582 * Y - 0.00255243321439347 * k + 0.116935020465145) + k * (-0.000343531996510555 * k + 0.24165260232407); + data[i + 3] = 255; + } + return data; + } + _convertYcckToCmyk(data) { + let Y, Cb, Cr; + for (let i = 0, length = data.length; i < length; i += 4) { + Y = data[i]; + Cb = data[i + 1]; + Cr = data[i + 2]; + data[i] = 434.456 - Y - 1.402 * Cr; + data[i + 1] = 119.541 - Y + 0.344 * Cb + 0.714 * Cr; + data[i + 2] = 481.816 - Y - 1.772 * Cb; + } + return data; + } + _convertCmykToRgb(data) { + let c, m, y, k; + let offset = 0; + for (let i = 0, length = data.length; i < length; i += 4) { + c = data[i]; + m = data[i + 1]; + y = data[i + 2]; + k = data[i + 3]; + data[offset++] = 255 + c * (-0.00006747147073602441 * c + 0.0008379262121013727 * m + 0.0002894718188643294 * y + 0.003264231057537806 * k - 1.1185611867203937) + m * (0.000026374107616089405 * m - 0.00008626949158638572 * y - 0.0002748769067499491 * k - 0.02155688794978967) + y * (-0.00003878099212869363 * y - 0.0003267808279485286 * k + 0.0686742238595345) - k * (0.0003361971776183937 * k + 0.7430659151342254); + data[offset++] = 255 + c * (0.00013596372813588848 * c + 0.000924537132573585 * m + 0.00010567359618683593 * y + 0.0004791864687436512 * k - 0.3109689587515875) + m * (-0.00023545346108370344 * m + 0.0002702845253534714 * y + 0.0020200308977307156 * k - 0.7488052167015494) + y * (0.00006834815998235662 * y + 0.00015168452363460973 * k - 0.09751927774728933) - k * (0.0003189131175883281 * k + 0.7364883807733168); + data[offset++] = 255 + c * (0.000013598650411385307 * c + 0.00012423956175490851 * m + 0.0004751985097583589 * y - 0.0000036729317476630422 * k - 0.05562186980264034) + m * (0.00016141380598724676 * m + 0.0009692239130725186 * y + 0.0007782692450036253 * k - 0.44015232367526463) + y * (5.068882914068769e-7 * y + 0.0017778369011375071 * k - 0.7591454649749609) - k * (0.0003435319965105553 * k + 0.7063770186160144); + } + return data.subarray(0, offset); + } + _convertCmykToRgba(data) { + for (let i = 0, length = data.length; i < length; i += 4) { + const c = data[i]; + const m = data[i + 1]; + const y = data[i + 2]; + const k = data[i + 3]; + data[i] = 255 + c * (-0.00006747147073602441 * c + 0.0008379262121013727 * m + 0.0002894718188643294 * y + 0.003264231057537806 * k - 1.1185611867203937) + m * (0.000026374107616089405 * m - 0.00008626949158638572 * y - 0.0002748769067499491 * k - 0.02155688794978967) + y * (-0.00003878099212869363 * y - 0.0003267808279485286 * k + 0.0686742238595345) - k * (0.0003361971776183937 * k + 0.7430659151342254); + data[i + 1] = 255 + c * (0.00013596372813588848 * c + 0.000924537132573585 * m + 0.00010567359618683593 * y + 0.0004791864687436512 * k - 0.3109689587515875) + m * (-0.00023545346108370344 * m + 0.0002702845253534714 * y + 0.0020200308977307156 * k - 0.7488052167015494) + y * (0.00006834815998235662 * y + 0.00015168452363460973 * k - 0.09751927774728933) - k * (0.0003189131175883281 * k + 0.7364883807733168); + data[i + 2] = 255 + c * (0.000013598650411385307 * c + 0.00012423956175490851 * m + 0.0004751985097583589 * y - 0.0000036729317476630422 * k - 0.05562186980264034) + m * (0.00016141380598724676 * m + 0.0009692239130725186 * y + 0.0007782692450036253 * k - 0.44015232367526463) + y * (5.068882914068769e-7 * y + 0.0017778369011375071 * k - 0.7591454649749609) - k * (0.0003435319965105553 * k + 0.7063770186160144); + data[i + 3] = 255; + } + return data; + } + getData({ + width, + height, + forceRGBA = false, + forceRGB = false, + isSourcePDF = false + }) { + if (this.numComponents > 4) { + throw new JpegError("Unsupported color mode"); + } + const data = this._getLinearizedBlockData(width, height, isSourcePDF); + if (this.numComponents === 1 && (forceRGBA || forceRGB)) { + const len = data.length * (forceRGBA ? 4 : 3); + const rgbaData = new Uint8ClampedArray(len); + let offset = 0; + if (forceRGBA) { + grayToRGBA(data, new Uint32Array(rgbaData.buffer)); + } else { + for (const grayColor of data) { + rgbaData[offset++] = grayColor; + rgbaData[offset++] = grayColor; + rgbaData[offset++] = grayColor; + } + } + return rgbaData; + } else if (this.numComponents === 3 && this._isColorConversionNeeded) { + if (forceRGBA) { + const rgbaData = new Uint8ClampedArray(data.length / 3 * 4); + return this._convertYccToRgba(data, rgbaData); + } + return this._convertYccToRgb(data); + } else if (this.numComponents === 4) { + if (this._isColorConversionNeeded) { + if (forceRGBA) { + return this._convertYcckToRgba(data); + } + if (forceRGB) { + return this._convertYcckToRgb(data); + } + return this._convertYcckToCmyk(data); + } else if (forceRGBA) { + return this._convertCmykToRgba(data); + } else if (forceRGB) { + return this._convertCmykToRgb(data); + } + } + return data; + } +} + +;// ./src/core/jpeg_stream.js + + + + +class JpegStream extends DecodeStream { + static #isImageDecoderSupported = FeatureTest.isImageDecoderSupported; + constructor(stream, maybeLength, params) { + super(maybeLength); + this.stream = stream; + this.dict = stream.dict; + this.maybeLength = maybeLength; + this.params = params; + } + static get canUseImageDecoder() { + return shadow(this, "canUseImageDecoder", this.#isImageDecoderSupported ? ImageDecoder.isTypeSupported("image/jpeg") : Promise.resolve(false)); + } + static setOptions({ + isImageDecoderSupported = false + }) { + this.#isImageDecoderSupported = isImageDecoderSupported; + } + get bytes() { + return shadow(this, "bytes", this.stream.getBytes(this.maybeLength)); + } + ensureBuffer(requested) {} + readBlock() { + this.decodeImage(); + } + get jpegOptions() { + const jpegOptions = { + decodeTransform: undefined, + colorTransform: undefined + }; + const decodeArr = this.dict.getArray("D", "Decode"); + if ((this.forceRGBA || this.forceRGB) && Array.isArray(decodeArr)) { + const bitsPerComponent = this.dict.get("BPC", "BitsPerComponent") || 8; + const decodeArrLength = decodeArr.length; + const transform = new Int32Array(decodeArrLength); + let transformNeeded = false; + const maxValue = (1 << bitsPerComponent) - 1; + for (let i = 0; i < decodeArrLength; i += 2) { + transform[i] = (decodeArr[i + 1] - decodeArr[i]) * 256 | 0; + transform[i + 1] = decodeArr[i] * maxValue | 0; + if (transform[i] !== 256 || transform[i + 1] !== 0) { + transformNeeded = true; + } + } + if (transformNeeded) { + jpegOptions.decodeTransform = transform; + } + } + if (this.params instanceof Dict) { + const colorTransform = this.params.get("ColorTransform"); + if (Number.isInteger(colorTransform)) { + jpegOptions.colorTransform = colorTransform; + } + } + return shadow(this, "jpegOptions", jpegOptions); + } + #skipUselessBytes(data) { + for (let i = 0, ii = data.length - 1; i < ii; i++) { + if (data[i] === 0xff && data[i + 1] === 0xd8) { + if (i > 0) { + data = data.subarray(i); + } + break; + } + } + return data; + } + decodeImage(bytes) { + if (this.eof) { + return this.buffer; + } + bytes = this.#skipUselessBytes(bytes || this.bytes); + const jpegImage = new JpegImage(this.jpegOptions); + jpegImage.parse(bytes); + const data = jpegImage.getData({ + width: this.drawWidth, + height: this.drawHeight, + forceRGBA: this.forceRGBA, + forceRGB: this.forceRGB, + isSourcePDF: true + }); + this.buffer = data; + this.bufferLength = data.length; + this.eof = true; + return this.buffer; + } + get canAsyncDecodeImageFromBuffer() { + return this.stream.isAsync; + } + async getTransferableImage() { + if (!(await JpegStream.canUseImageDecoder)) { + return null; + } + const jpegOptions = this.jpegOptions; + if (jpegOptions.decodeTransform) { + return null; + } + let decoder; + try { + const bytes = this.canAsyncDecodeImageFromBuffer && (await this.stream.asyncGetBytes()) || this.bytes; + if (!bytes) { + return null; + } + const data = this.#skipUselessBytes(bytes); + if (!JpegImage.canUseImageDecoder(data, jpegOptions.colorTransform)) { + return null; + } + decoder = new ImageDecoder({ + data, + type: "image/jpeg", + preferAnimation: false + }); + return (await decoder.decode()).image; + } catch (reason) { + warn(`getTransferableImage - failed: "${reason}".`); + return null; + } finally { + decoder?.close(); + } + } +} + +;// ./external/openjpeg/openjpeg.js +var OpenJPEG = (() => { + var _scriptName = typeof document != 'undefined' ? document.currentScript?.src : undefined; + return function (moduleArg = {}) { + var moduleRtn; + var Module = moduleArg; + var readyPromiseResolve, readyPromiseReject; + var readyPromise = new Promise((resolve, reject) => { + readyPromiseResolve = resolve; + readyPromiseReject = reject; + }); + var ENVIRONMENT_IS_WEB = true; + var ENVIRONMENT_IS_WORKER = false; + Module.decode = function (bytes, { + numComponents = 4, + isIndexedColormap = false, + smaskInData = false + }) { + const size = bytes.length; + const ptr = Module._malloc(size); + Module.HEAPU8.set(bytes, ptr); + const ret = Module._jp2_decode(ptr, size, numComponents > 0 ? numComponents : 0, !!isIndexedColormap, !!smaskInData); + Module._free(ptr); + if (ret) { + const { + errorMessages + } = Module; + if (errorMessages) { + delete Module.errorMessages; + return errorMessages; + } + return "Unknown error"; + } + const { + imageData + } = Module; + Module.imageData = null; + return imageData; + }; + var moduleOverrides = Object.assign({}, Module); + var arguments_ = []; + var thisProgram = "./this.program"; + var quit_ = (status, toThrow) => { + throw toThrow; + }; + var scriptDirectory = ""; + var readAsync, readBinary; + if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) { + if (ENVIRONMENT_IS_WORKER) { + scriptDirectory = self.location.href; + } else if (typeof document != "undefined" && document.currentScript) { + scriptDirectory = document.currentScript.src; + } + if (_scriptName) { + scriptDirectory = _scriptName; + } + if (scriptDirectory.startsWith("blob:")) { + scriptDirectory = ""; + } else { + scriptDirectory = scriptDirectory.substr(0, scriptDirectory.replace(/[?#].*/, "").lastIndexOf("/") + 1); + } + readAsync = url => fetch(url, { + credentials: "same-origin" + }).then(response => { + if (response.ok) { + return response.arrayBuffer(); + } + return Promise.reject(new Error(response.status + " : " + response.url)); + }); + } else {} + var out = Module["print"] || console.log.bind(console); + var err = Module["printErr"] || console.error.bind(console); + Object.assign(Module, moduleOverrides); + moduleOverrides = null; + if (Module["arguments"]) arguments_ = Module["arguments"]; + if (Module["thisProgram"]) thisProgram = Module["thisProgram"]; + var wasmBinary = Module["wasmBinary"]; + function intArrayFromBase64(s) { + var decoded = atob(s); + var bytes = new Uint8Array(decoded.length); + for (var i = 0; i < decoded.length; ++i) { + bytes[i] = decoded.charCodeAt(i); + } + return bytes; + } + function tryParseAsDataURI(filename) { + if (!isDataURI(filename)) { + return; + } + return intArrayFromBase64(filename.slice(dataURIPrefix.length)); + } + var wasmMemory; + var ABORT = false; + var EXITSTATUS; + var HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64; + function updateMemoryViews() { + var b = wasmMemory.buffer; + Module["HEAP8"] = HEAP8 = new Int8Array(b); + Module["HEAP16"] = HEAP16 = new Int16Array(b); + Module["HEAPU8"] = HEAPU8 = new Uint8Array(b); + Module["HEAPU16"] = HEAPU16 = new Uint16Array(b); + Module["HEAP32"] = HEAP32 = new Int32Array(b); + Module["HEAPU32"] = HEAPU32 = new Uint32Array(b); + Module["HEAPF32"] = HEAPF32 = new Float32Array(b); + Module["HEAPF64"] = HEAPF64 = new Float64Array(b); + } + var __ATPRERUN__ = []; + var __ATINIT__ = []; + var __ATPOSTRUN__ = []; + var runtimeInitialized = false; + function preRun() { + if (Module["preRun"]) { + if (typeof Module["preRun"] == "function") Module["preRun"] = [Module["preRun"]]; + while (Module["preRun"].length) { + addOnPreRun(Module["preRun"].shift()); + } + } + callRuntimeCallbacks(__ATPRERUN__); + } + function initRuntime() { + runtimeInitialized = true; + callRuntimeCallbacks(__ATINIT__); + } + function postRun() { + if (Module["postRun"]) { + if (typeof Module["postRun"] == "function") Module["postRun"] = [Module["postRun"]]; + while (Module["postRun"].length) { + addOnPostRun(Module["postRun"].shift()); + } + } + callRuntimeCallbacks(__ATPOSTRUN__); + } + function addOnPreRun(cb) { + __ATPRERUN__.unshift(cb); + } + function addOnInit(cb) { + __ATINIT__.unshift(cb); + } + function addOnPostRun(cb) { + __ATPOSTRUN__.unshift(cb); + } + var runDependencies = 0; + var runDependencyWatcher = null; + var dependenciesFulfilled = null; + function addRunDependency(id) { + runDependencies++; + Module["monitorRunDependencies"]?.(runDependencies); + } + function removeRunDependency(id) { + runDependencies--; + Module["monitorRunDependencies"]?.(runDependencies); + if (runDependencies == 0) { + if (runDependencyWatcher !== null) { + clearInterval(runDependencyWatcher); + runDependencyWatcher = null; + } + if (dependenciesFulfilled) { + var callback = dependenciesFulfilled; + dependenciesFulfilled = null; + callback(); + } + } + } + function abort(what) { + Module["onAbort"]?.(what); + what = "Aborted(" + what + ")"; + err(what); + ABORT = true; + what += ". Build with -sASSERTIONS for more info."; + var e = new WebAssembly.RuntimeError(what); + readyPromiseReject(e); + throw e; + } + var dataURIPrefix = "data:application/octet-stream;base64,"; + var isDataURI = filename => filename.startsWith(dataURIPrefix); + function findWasmBinary() { + var f = "data:application/octet-stream;base64,AGFzbQEAAAAB2QEcYAN/f38Bf2AEf39/fwF/YAF/AGACf38AYAF/AX9gA39/fwBgAn9/AX9gBH9/f38AYAN/fn8BfmAFf39/f38Bf2AAAGACfn8Bf2ADf35/AX9gAn5/AX5gBX9/f39/AGAHf39/f39/fwF/YAl/f39/f39/f38Bf2ALf39/f39/f39/f38Bf2AGf39/f39/AX9gAAF/YAZ/f39/f38AYAZ/fH9/f38Bf2ACf3wBf2AIf39/f39/f38AYAh/f39/f39/fwF/YAd/f39/f39/AGACfH8BfGACf3wAAnMTAWEBYQACAWEBYgABAWEBYwAFAWEBZAACAWEBZQAOAWEBZgAHAWEBZwADAWEBaAAHAWEBaQAFAWEBagAJAWEBawACAWEBbAAKAWEBbQAKAWEBbgAWAWEBbwAEAWEBcAAGAWEBcQAGAWEBcgAEAWEBcwADA80BywEHAgUABgQABQYEAQUEDgUXBgICAgIABhAGEQQCCwwSAgUCBAcEAhMDFAMCAgYCGAMHBQAABAMBCgkJAwAJBgEEBAUFEw8BAQMAAwYCEAQUGQIHBgMHBwEBAgAECgYaBwQEDw4DBgQABAICAgAGBgABAQEBAQEBAQAAAAAABgMCAgIDAwMDAwoKAgIbAAMVCAQEAAgDAwkECAsNAAgAAQEBAQEBAQEBDAAEBAUJD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iABLQACOgACIAIgAS0AAzoAAyABQQRqIQEgAkEEaiICIARNDQALCyACIANJBEADQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADRw0ACwsgAAswAQF/AkAgAEUNACABRQ0AQQggACABbCIBECkiAARAIABBACABEBkaCyAAIQILIAILEQAgAEUEQEEADwtBCCAAECkL8gICAn8BfgJAIAJFDQAgACABOgAAIAAgAmoiA0EBayABOgAAIAJBA0kNACAAIAE6AAIgACABOgABIANBA2sgAToAACADQQJrIAE6AAAgAkEHSQ0AIAAgAToAAyADQQRrIAE6AAAgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBBGsgATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQQhrIAE2AgAgAkEMayABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkEQayABNgIAIAJBFGsgATYCACACQRhrIAE2AgAgAkEcayABNgIAIAQgA0EEcUEYciIEayICQSBJDQAgAa1CgYCAgBB+IQUgAyAEaiEBA0AgASAFNwMYIAEgBTcDECABIAU3AwggASAFNwMAIAFBIGohASACQSBrIgJBH0sNAAsLIAALJwEBfyMAQRBrIgMkACADIAI2AgwgACABIAJBAEEAEHUgA0EQaiQAC+gFAQl/IAFFBEBBAA8LAn8gAEUEQEEIIAEQKQwBCyABRQRAIAAQFEEADAELAkAgAUFHSw0AIAACf0EIIAFBA2pBfHEgAUEITRsiB0EIaiEBAkACfwJAIABBBGsiCiIEKAIAIgUgBGoiAigCACIJIAIgCWoiCEEEaygCAEcEQCAIIAEgBGoiA0EQak8EQCACKAIEIgUgAigCCCICNgIIIAIgBTYCBCADIAggA2siAjYCACADIAJBfHFqQQRrIAJBAXI2AgAgAwJ/IAMoAgBBCGsiAkH/AE0EQCACQQN2QQFrDAELIAJBHSACZyIFa3ZBBHMgBUECdGtB7gBqIAJB/x9NDQAaQT8gAkEeIAVrdkECcyAFQQF0a0HHAGoiA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GAQHFBgMADRyABQYCwA09xRQRAIAAgAUE/cUGAAXI6AAIgACABQQx2QeABcjoAACAAIAFBBnZBP3FBgAFyOgABQQMPCyABQYCABGtB//8/TQRAIAAgAUE/cUGAAXI6AAMgACABQRJ2QfABcjoAACAAIAFBBnZBP3FBgAFyOgACIAAgAUEMdkE/cUGAAXI6AAFBBA8LC0HUzQFBGTYCAEF/DwsgACABOgAAQQELfgIBfwF+IAC9IgNCNIinQf8PcSICQf8PRwR8IAJFBEAgASAARAAAAAAAAAAAYQR/QQAFIABEAAAAAAAA8EOiIAEQcCEAIAEoAgBBQGoLNgIAIAAPCyABIAJB/gdrNgIAIANC/////////4eAf4NCgICAgICAgPA/hL8FIAALC7wCAAJAAkACQAJAAkACQAJAAkACQAJAAkAgAUEJaw4SAAgJCggJAQIDBAoJCgoICQUGBwsgAiACKAIAIgFBBGo2AgAgACABKAIANgIADwsgAiACKAIAIgFBBGo2AgAgACABMgEANwMADwsgAiACKAIAIgFBBGo2AgAgACABMwEANwMADwsgAiACKAIAIgFBBGo2AgAgACABMAAANwMADwsgAiACKAIAIgFBBGo2AgAgACABMQAANwMADwsgAiACKAIAQQdqQXhxIgFBCGo2AgAgACABKwMAOQMADwsgACACIAMRAwALDwsgAiACKAIAIgFBBGo2AgAgACABNAIANwMADwsgAiACKAIAIgFBBGo2AgAgACABNQIANwMADwsgAiACKAIAQQdqQXhxIgFBCGo2AgAgACABKQMANwMAC28BBX8gACgCACIDLAAAQTBrIgFBCUsEQEEADwsDQEF/IQQgAkHMmbPmAE0EQEF/IAEgAkEKbCIFaiABIAVB/////wdzSxshBAsgACADQQFqIgU2AgAgAywAASAEIQIgBSEDQTBrIgFBCkkNAAsgAgtJAQF/AkBBAUEsEBciAQRAIAFBADYCEAJAIABBAEwEQCABQQFBCBAXIgA2AiQgAEUNAQwDCyABQQA2AgwLIAEQFAtBACEBCyABC64UAhJ/An4jAEFAaiIIJAAgCCABNgI8IAhBJ2ohFyAIQShqIRICQAJAAkACQANA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oQBRg0BC0ICIREgACgCTA0AIAEoAhxBAkYNACAAKAKAASINIAAoAoQBbCIDBH4gA0EBcSEEIAAoAuABKAIoIQcCQCADQQFGBEBBACEDQgAhEQwBCyADQX5xIQZBACEDQgAhEQNAIAcgA0EobGoiCCgCBCIKBEAgCCgCECAKQRhsakEIaykDACISIBEgESASUxshEQsgByADQQFyQShsaiIIKAIEIgoEQCAIKAIQIApBGGxqQQhrKQMAIhIgESARIBJTGyERCyADQQJqIQMgBUECaiIFIAZHDQALCwJAIARFDQAgByADQShsaiIDKAIEIgVFDQAgAygCECAFQRhsakEIaykDACISIBEgESASUxshEQsgEUICfAVCAgshEUEAIQQCQCAAKAIgIgYgACgCKCIOTw0AIAAoAiQiCCAAKAIcIgVNDQAgBSAIIAVrIgpBfHEiC2ohByAAKALgASgCKCEPIApBBEkhEANAIA8gBiANbEEobGohDAJAAkAgEARAIAUhAwwBC/0MAAAAAAAAAAAAAAAAAAAAACAE/RwAIRNBACEEA0AgDCAEIAVqQShsaiIDQfwAaiADQdQAaiADQSxqIANBBGr9XAIA/VYCAAH9VgIAAv1WAgADIBP9rgEhEyAEQQRqIgQgC0cNAAsgEyATIBP9DQgJCgsMDQ4PAAECAwABAgP9rgEiEyATIBP9DQQFBgcAAQIDAAECAwABAgP9rgH9GwAhBCAHIQMgCiALRg0BCwNAIAwgA0EobGooAgQgBGohBCADQQFqIgMgCEcNAAsLIAZBAWoiBiAORw0ACwsgACAEQQN0EBgiBzYCWCAERQ0AIAdFDQBBACEEAkAgACgCICIGIAAoAigiA08NACAAKAIkIgUgACgCHE0NAANAIAUgACgCHCIHSwRAIAAoAuABKAIoIAAoAoABIAZsQShsaiENA0AgDSAHQShsaiIIKAIEIgMEQCADQQNxIQogCCgCECEFQQAhCwJAIANBBEkEQEEAIQMMAQsgA0F8cSEOQQAhA0EAIQwDQCAEQQN0IgggACgCWGogBSADQRhsaikDADcDACAAKAJYIAhqIAUgA0EBckEYbGopAwA3AwggACgCWCAIaiAFIANB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cAAAAHAAAABwAEGAygELHXEAAABxAAAAcAAAAHAAAAAAAAAAcAAAAAAAAABxAEGoywELCVBwAQAAAAAABQBBvMsBCwFrAEHUywELCmwAAABtAAAAuGsAQezLAQsBAgBB/MsBCwj//////////wBBwMwBCwEFAEHMzAELAW4AQeTMAQsObAAAAG8AAADIawAAAAQAQfzMAQsBAQBBjM0BCwX/////Cg=="; + return f; + } + var wasmBinaryFile; + function getBinarySync(file) { + if (file == wasmBinaryFile && wasmBinary) { + return new Uint8Array(wasmBinary); + } + var binary = tryParseAsDataURI(file); + if (binary) { + return binary; + } + if (readBinary) { + return readBinary(file); + } + throw 'sync fetching of the wasm failed: you can preload it to Module["wasmBinary"] manually, or emcc.py will do that for you when generating HTML (but not JS)'; + } + function instantiateSync(file, info) { + var module; + var binary = getBinarySync(file); + module = new WebAssembly.Module(binary); + var instance = new WebAssembly.Instance(module, info); + return [instance, module]; + } + function getWasmImports() { + return { + a: wasmImports + }; + } + function createWasm() { + function receiveInstance(instance, module) { + wasmExports = instance.exports; + wasmMemory = wasmExports["t"]; + updateMemoryViews(); + addOnInit(wasmExports["u"]); + removeRunDependency("wasm-instantiate"); + return wasmExports; + } + addRunDependency("wasm-instantiate"); + var info = getWasmImports(); + if (Module["instantiateWasm"]) { + try { + return Module["instantiateWasm"](info, receiveInstance); + } catch (e) { + err(`Module.instantiateWasm callback failed with error: ${e}`); + readyPromiseReject(e); + } + } + wasmBinaryFile ??= findWasmBinary(); + var result = instantiateSync(wasmBinaryFile, info); + return receiveInstance(result[0]); + } + class ExitStatus { + name = "ExitStatus"; + constructor(status) { + this.message = `Program terminated with exit(${status})`; + this.status = status; + } + } + var callRuntimeCallbacks = callbacks => { + while (callbacks.length > 0) { + callbacks.shift()(Module); + } + }; + var noExitRuntime = Module["noExitRuntime"] || true; + var __abort_js = () => abort(""); + var __emscripten_memcpy_js = (dest, src, num) => HEAPU8.copyWithin(dest, src, src + num); + var runtimeKeepaliveCounter = 0; + var __emscripten_runtime_keepalive_clear = () => { + noExitRuntime = false; + runtimeKeepaliveCounter = 0; + }; + var timers = {}; + var handleException = e => { + if (e instanceof ExitStatus || e == "unwind") { + return EXITSTATUS; + } + quit_(1, e); + }; + var keepRuntimeAlive = () => noExitRuntime || runtimeKeepaliveCounter > 0; + var _proc_exit = code => { + EXITSTATUS = code; + if (!keepRuntimeAlive()) { + Module["onExit"]?.(code); + ABORT = true; + } + quit_(code, new ExitStatus(code)); + }; + var exitJS = (status, implicit) => { + EXITSTATUS = status; + _proc_exit(status); + }; + var _exit = exitJS; + var maybeExit = () => { + if (!keepRuntimeAlive()) { + try { + _exit(EXITSTATUS); + } catch (e) { + handleException(e); + } + } + }; + var callUserCallback = func => { + if (ABORT) { + return; + } + try { + func(); + maybeExit(); + } catch (e) { + handleException(e); + } + }; + var _emscripten_get_now = () => performance.now(); + var __setitimer_js = (which, timeout_ms) => { + if (timers[which]) { + clearTimeout(timers[which].id); + delete timers[which]; + } + if (!timeout_ms) return 0; + var id = setTimeout(() => { + delete timers[which]; + callUserCallback(() => __emscripten_timeout(which, _emscripten_get_now())); + }, timeout_ms); + timers[which] = { + id, + timeout_ms + }; + return 0; + }; + function _copy_pixels_1(compG_ptr, nb_pixels) { + compG_ptr >>= 2; + const imageData = Module.imageData = new Uint8ClampedArray(nb_pixels); + const compG = Module.HEAP32.subarray(compG_ptr, compG_ptr + nb_pixels); + imageData.set(compG); + } + function _copy_pixels_3(compR_ptr, compG_ptr, compB_ptr, nb_pixels) { + compR_ptr >>= 2; + compG_ptr >>= 2; + compB_ptr >>= 2; + const imageData = Module.imageData = new Uint8ClampedArray(nb_pixels * 3); + const compR = Module.HEAP32.subarray(compR_ptr, compR_ptr + nb_pixels); + const compG = Module.HEAP32.subarray(compG_ptr, compG_ptr + nb_pixels); + const compB = Module.HEAP32.subarray(compB_ptr, compB_ptr + nb_pixels); + for (let i = 0; i < nb_pixels; i++) { + imageData[3 * i] = compR[i]; + imageData[3 * i + 1] = compG[i]; + imageData[3 * i + 2] = compB[i]; + } + } + function _copy_pixels_4(compR_ptr, compG_ptr, compB_ptr, compA_ptr, nb_pixels) { + compR_ptr >>= 2; + compG_ptr >>= 2; + compB_ptr >>= 2; + compA_ptr >>= 2; + const imageData = Module.imageData = new Uint8ClampedArray(nb_pixels * 4); + const compR = Module.HEAP32.subarray(compR_ptr, compR_ptr + nb_pixels); + const compG = Module.HEAP32.subarray(compG_ptr, compG_ptr + nb_pixels); + const compB = Module.HEAP32.subarray(compB_ptr, compB_ptr + nb_pixels); + const compA = Module.HEAP32.subarray(compA_ptr, compA_ptr + nb_pixels); + for (let i = 0; i < nb_pixels; i++) { + imageData[4 * i] = compR[i]; + imageData[4 * i + 1] = compG[i]; + imageData[4 * i + 2] = compB[i]; + imageData[4 * i + 3] = compA[i]; + } + } + var getHeapMax = () => 2147483648; + var alignMemory = (size, alignment) => Math.ceil(size / alignment) * alignment; + var growMemory = size => { + var b = wasmMemory.buffer; + var pages = (size - b.byteLength + 65535) / 65536 | 0; + try { + wasmMemory.grow(pages); + updateMemoryViews(); + return 1; + } catch (e) {} + }; + var _emscripten_resize_heap = requestedSize => { + var oldSize = HEAPU8.length; + requestedSize >>>= 0; + var maxHeapSize = getHeapMax(); + if (requestedSize > maxHeapSize) { + return false; + } + for (var cutDown = 1; cutDown <= 4; cutDown *= 2) { + var overGrownHeapSize = oldSize * (1 + .2 / cutDown); + overGrownHeapSize = Math.min(overGrownHeapSize, requestedSize + 100663296); + var newSize = Math.min(maxHeapSize, alignMemory(Math.max(requestedSize, overGrownHeapSize), 65536)); + var replacement = growMemory(newSize); + if (replacement) { + return true; + } + } + return false; + }; + var ENV = {}; + var getExecutableName = () => thisProgram || "./this.program"; + var getEnvStrings = () => { + if (!getEnvStrings.strings) { + var lang = (typeof navigator == "object" && navigator.languages && navigator.languages[0] || "C").replace("-", "_") + ".UTF-8"; + var env = { + USER: "web_user", + LOGNAME: "web_user", + PATH: "/", + PWD: "/", + HOME: "/home/web_user", + LANG: lang, + _: getExecutableName() + }; + for (var x in ENV) { + if (ENV[x] === undefined) delete env[x];else env[x] = ENV[x]; + } + var strings = []; + for (var x in env) { + strings.push(`${x}=${env[x]}`); + } + getEnvStrings.strings = strings; + } + return getEnvStrings.strings; + }; + var stringToAscii = (str, buffer) => { + for (var i = 0; i < str.length; ++i) { + HEAP8[buffer++] = str.charCodeAt(i); + } + HEAP8[buffer] = 0; + }; + var _environ_get = (__environ, environ_buf) => { + var bufSize = 0; + getEnvStrings().forEach((string, i) => { + var ptr = environ_buf + bufSize; + HEAPU32[__environ + i * 4 >> 2] = ptr; + stringToAscii(string, ptr); + bufSize += string.length + 1; + }); + return 0; + }; + var _environ_sizes_get = (penviron_count, penviron_buf_size) => { + var strings = getEnvStrings(); + HEAPU32[penviron_count >> 2] = strings.length; + var bufSize = 0; + strings.forEach(string => bufSize += string.length + 1); + HEAPU32[penviron_buf_size >> 2] = bufSize; + return 0; + }; + var _fd_close = fd => 52; + var convertI32PairToI53Checked = (lo, hi) => hi + 2097152 >>> 0 < 4194305 - !!lo ? (lo >>> 0) + hi * 4294967296 : NaN; + function _fd_seek(fd, offset_low, offset_high, whence, newOffset) { + var offset = convertI32PairToI53Checked(offset_low, offset_high); + return 70; + } + var printCharBuffers = [null, [], []]; + var UTF8Decoder = typeof TextDecoder != "undefined" ? new TextDecoder() : undefined; + var UTF8ArrayToString = (heapOrArray, idx = 0, maxBytesToRead = NaN) => { + var endIdx = idx + maxBytesToRead; + var endPtr = idx; + while (heapOrArray[endPtr] && !(endPtr >= endIdx)) ++endPtr; + if (endPtr - idx > 16 && heapOrArray.buffer && UTF8Decoder) { + return UTF8Decoder.decode(heapOrArray.subarray(idx, endPtr)); + } + var str = ""; + while (idx < endPtr) { + var u0 = heapOrArray[idx++]; + if (!(u0 & 128)) { + str += String.fromCharCode(u0); + continue; + } + var u1 = heapOrArray[idx++] & 63; + if ((u0 & 224) == 192) { + str += String.fromCharCode((u0 & 31) << 6 | u1); + continue; + } + var u2 = heapOrArray[idx++] & 63; + if ((u0 & 240) == 224) { + u0 = (u0 & 15) << 12 | u1 << 6 | u2; + } else { + u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | heapOrArray[idx++] & 63; + } + if (u0 < 65536) { + str += String.fromCharCode(u0); + } else { + var ch = u0 - 65536; + str += String.fromCharCode(55296 | ch >> 10, 56320 | ch & 1023); + } + } + return str; + }; + var printChar = (stream, curr) => { + var buffer = printCharBuffers[stream]; + if (curr === 0 || curr === 10) { + (stream === 1 ? out : err)(UTF8ArrayToString(buffer)); + buffer.length = 0; + } else { + buffer.push(curr); + } + }; + var UTF8ToString = (ptr, maxBytesToRead) => ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : ""; + var _fd_write = (fd, iov, iovcnt, pnum) => { + var num = 0; + for (var i = 0; i < iovcnt; i++) { + var ptr = HEAPU32[iov >> 2]; + var len = HEAPU32[iov + 4 >> 2]; + iov += 8; + for (var j = 0; j < len; j++) { + printChar(fd, HEAPU8[ptr + j]); + } + num += len; + } + HEAPU32[pnum >> 2] = num; + return 0; + }; + function _gray_to_rgba(compG_ptr, nb_pixels) { + compG_ptr >>= 2; + const imageData = Module.imageData = new Uint8ClampedArray(nb_pixels * 4); + const compG = Module.HEAP32.subarray(compG_ptr, compG_ptr + nb_pixels); + for (let i = 0; i < nb_pixels; i++) { + imageData[4 * i] = imageData[4 * i + 1] = imageData[4 * i + 2] = compG[i]; + imageData[4 * i + 3] = 255; + } + } + function _graya_to_rgba(compG_ptr, compA_ptr, nb_pixels) { + compG_ptr >>= 2; + compA_ptr >>= 2; + const imageData = Module.imageData = new Uint8ClampedArray(nb_pixels * 4); + const compG = Module.HEAP32.subarray(compG_ptr, compG_ptr + nb_pixels); + const compA = Module.HEAP32.subarray(compA_ptr, compA_ptr + nb_pixels); + for (let i = 0; i < nb_pixels; i++) { + imageData[4 * i] = imageData[4 * i + 1] = imageData[4 * i + 2] = compG[i]; + imageData[4 * i + 3] = compA[i]; + } + } + function _jsPrintWarning(message_ptr) { + const message = UTF8ToString(message_ptr); + (Module.warn || console.warn)(`OpenJPEG: ${message}`); + } + function _rgb_to_rgba(compR_ptr, compG_ptr, compB_ptr, nb_pixels) { + compR_ptr >>= 2; + compG_ptr >>= 2; + compB_ptr >>= 2; + const imageData = Module.imageData = new Uint8ClampedArray(nb_pixels * 4); + const compR = Module.HEAP32.subarray(compR_ptr, compR_ptr + nb_pixels); + const compG = Module.HEAP32.subarray(compG_ptr, compG_ptr + nb_pixels); + const compB = Module.HEAP32.subarray(compB_ptr, compB_ptr + nb_pixels); + for (let i = 0; i < nb_pixels; i++) { + imageData[4 * i] = compR[i]; + imageData[4 * i + 1] = compG[i]; + imageData[4 * i + 2] = compB[i]; + imageData[4 * i + 3] = 255; + } + } + function _storeErrorMessage(message_ptr) { + const message = UTF8ToString(message_ptr); + if (!Module.errorMessages) { + Module.errorMessages = message; + } else { + Module.errorMessages += "\n" + message; + } + } + var wasmImports = { + m: __abort_js, + c: __emscripten_memcpy_js, + l: __emscripten_runtime_keepalive_clear, + n: __setitimer_js, + g: _copy_pixels_1, + f: _copy_pixels_3, + e: _copy_pixels_4, + o: _emscripten_resize_heap, + p: _environ_get, + q: _environ_sizes_get, + r: _fd_close, + j: _fd_seek, + b: _fd_write, + s: _gray_to_rgba, + i: _graya_to_rgba, + d: _jsPrintWarning, + k: _proc_exit, + h: _rgb_to_rgba, + a: _storeErrorMessage + }; + var wasmExports = createWasm(); + var ___wasm_call_ctors = wasmExports["u"]; + var _malloc = Module["_malloc"] = wasmExports["v"]; + var _free = Module["_free"] = wasmExports["w"]; + var _jp2_decode = Module["_jp2_decode"] = wasmExports["y"]; + var __emscripten_timeout = wasmExports["z"]; + var calledRun; + dependenciesFulfilled = function runCaller() { + if (!calledRun) run(); + if (!calledRun) dependenciesFulfilled = runCaller; + }; + function run() { + if (runDependencies > 0) { + return; + } + preRun(); + if (runDependencies > 0) { + return; + } + function doRun() { + if (calledRun) return; + calledRun = true; + Module["calledRun"] = true; + if (ABORT) return; + initRuntime(); + readyPromiseResolve(Module); + Module["onRuntimeInitialized"]?.(); + postRun(); + } + if (Module["setStatus"]) { + Module["setStatus"]("Running..."); + setTimeout(() => { + setTimeout(() => Module["setStatus"](""), 1); + doRun(); + }, 1); + } else { + doRun(); + } + } + if (Module["preInit"]) { + if (typeof Module["preInit"] == "function") Module["preInit"] = [Module["preInit"]]; + while (Module["preInit"].length > 0) { + Module["preInit"].pop()(); + } + } + run(); + moduleRtn = Module; + return moduleRtn; + }; +})(); +/* harmony default export */ const openjpeg = (OpenJPEG); +;// ./src/core/jpx.js + + + +class JpxError extends BaseException { + constructor(msg) { + super(msg, "JpxError"); + } +} +class JpxImage { + static #module = null; + static decode(data, decoderOptions) { + decoderOptions ||= {}; + this.#module ||= openjpeg({ + warn: warn + }); + const imageData = this.#module.decode(data, decoderOptions); + if (typeof imageData === "string") { + throw new JpxError(imageData); + } + return imageData; + } + static cleanup() { + this.#module = null; + } + static parseImageProperties(stream) { + let newByte = stream.getByte(); + while (newByte >= 0) { + const oldByte = newByte; + newByte = stream.getByte(); + const code = oldByte << 8 | newByte; + if (code === 0xff51) { + stream.skip(4); + const Xsiz = stream.getInt32() >>> 0; + const Ysiz = stream.getInt32() >>> 0; + const XOsiz = stream.getInt32() >>> 0; + const YOsiz = stream.getInt32() >>> 0; + stream.skip(16); + const Csiz = stream.getUint16(); + return { + width: Xsiz - XOsiz, + height: Ysiz - YOsiz, + bitsPerComponent: 8, + componentsCount: Csiz + }; + } + } + throw new JpxError("No size marker found in JPX stream"); + } +} + +;// ./src/core/jpx_stream.js + + + +class JpxStream extends DecodeStream { + constructor(stream, maybeLength, params) { + super(maybeLength); + this.stream = stream; + this.dict = stream.dict; + this.maybeLength = maybeLength; + this.params = params; + } + get bytes() { + return shadow(this, "bytes", this.stream.getBytes(this.maybeLength)); + } + ensureBuffer(requested) {} + readBlock(decoderOptions) { + this.decodeImage(null, decoderOptions); + } + decodeImage(bytes, decoderOptions) { + if (this.eof) { + return this.buffer; + } + bytes ||= this.bytes; + this.buffer = JpxImage.decode(bytes, decoderOptions); + this.bufferLength = this.buffer.length; + this.eof = true; + return this.buffer; + } + get canAsyncDecodeImageFromBuffer() { + return this.stream.isAsync; + } +} + +;// ./src/core/lzw_stream.js + +class LZWStream extends DecodeStream { + constructor(str, maybeLength, earlyChange) { + super(maybeLength); + this.str = str; + this.dict = str.dict; + this.cachedData = 0; + this.bitsCached = 0; + const maxLzwDictionarySize = 4096; + const lzwState = { + earlyChange, + codeLength: 9, + nextCode: 258, + dictionaryValues: new Uint8Array(maxLzwDictionarySize), + dictionaryLengths: new Uint16Array(maxLzwDictionarySize), + dictionaryPrevCodes: new Uint16Array(maxLzwDictionarySize), + currentSequence: new Uint8Array(maxLzwDictionarySize), + currentSequenceLength: 0 + }; + for (let i = 0; i < 256; ++i) { + lzwState.dictionaryValues[i] = i; + lzwState.dictionaryLengths[i] = 1; + } + this.lzwState = lzwState; + } + readBits(n) { + let bitsCached = this.bitsCached; + let cachedData = this.cachedData; + while (bitsCached < n) { + const c = this.str.getByte(); + if (c === -1) { + this.eof = true; + return null; + } + cachedData = cachedData << 8 | c; + bitsCached += 8; + } + this.bitsCached = bitsCached -= n; + this.cachedData = cachedData; + this.lastCode = null; + return cachedData >>> bitsCached & (1 << n) - 1; + } + readBlock() { + const blockSize = 512, + decodedSizeDelta = blockSize; + let estimatedDecodedSize = blockSize * 2; + let i, j, q; + const lzwState = this.lzwState; + if (!lzwState) { + return; + } + const earlyChange = lzwState.earlyChange; + let nextCode = lzwState.nextCode; + const dictionaryValues = lzwState.dictionaryValues; + const dictionaryLengths = lzwState.dictionaryLengths; + const dictionaryPrevCodes = lzwState.dictionaryPrevCodes; + let codeLength = lzwState.codeLength; + let prevCode = lzwState.prevCode; + const currentSequence = lzwState.currentSequence; + let currentSequenceLength = lzwState.currentSequenceLength; + let decodedLength = 0; + let currentBufferLength = this.bufferLength; + let buffer = this.ensureBuffer(this.bufferLength + estimatedDecodedSize); + for (i = 0; i < blockSize; i++) { + const code = this.readBits(codeLength); + const hasPrev = currentSequenceLength > 0; + if (code < 256) { + currentSequence[0] = code; + currentSequenceLength = 1; + } else if (code >= 258) { + if (code < nextCode) { + currentSequenceLength = dictionaryLengths[code]; + for (j = currentSequenceLength - 1, q = code; j >= 0; j--) { + currentSequence[j] = dictionaryValues[q]; + q = dictionaryPrevCodes[q]; + } + } else { + currentSequence[currentSequenceLength++] = currentSequence[0]; + } + } else if (code === 256) { + codeLength = 9; + nextCode = 258; + currentSequenceLength = 0; + continue; + } else { + this.eof = true; + delete this.lzwState; + break; + } + if (hasPrev) { + dictionaryPrevCodes[nextCode] = prevCode; + dictionaryLengths[nextCode] = dictionaryLengths[prevCode] + 1; + dictionaryValues[nextCode] = currentSequence[0]; + nextCode++; + codeLength = nextCode + earlyChange & nextCode + earlyChange - 1 ? codeLength : Math.min(Math.log(nextCode + earlyChange) / 0.6931471805599453 + 1, 12) | 0; + } + prevCode = code; + decodedLength += currentSequenceLength; + if (estimatedDecodedSize < decodedLength) { + do { + estimatedDecodedSize += decodedSizeDelta; + } while (estimatedDecodedSize < decodedLength); + buffer = this.ensureBuffer(this.bufferLength + estimatedDecodedSize); + } + for (j = 0; j < currentSequenceLength; j++) { + buffer[currentBufferLength++] = currentSequence[j]; + } + } + lzwState.nextCode = nextCode; + lzwState.codeLength = codeLength; + lzwState.prevCode = prevCode; + lzwState.currentSequenceLength = currentSequenceLength; + this.bufferLength = currentBufferLength; + } +} + +;// ./src/core/predictor_stream.js + + + +class PredictorStream extends DecodeStream { + constructor(str, maybeLength, params) { + super(maybeLength); + if (!(params instanceof Dict)) { + return str; + } + const predictor = this.predictor = params.get("Predictor") || 1; + if (predictor <= 1) { + return str; + } + if (predictor !== 2 && (predictor < 10 || predictor > 15)) { + throw new FormatError(`Unsupported predictor: ${predictor}`); + } + this.readBlock = predictor === 2 ? this.readBlockTiff : this.readBlockPng; + this.str = str; + this.dict = str.dict; + const colors = this.colors = params.get("Colors") || 1; + const bits = this.bits = params.get("BPC", "BitsPerComponent") || 8; + const columns = this.columns = params.get("Columns") || 1; + this.pixBytes = colors * bits + 7 >> 3; + this.rowBytes = columns * colors * bits + 7 >> 3; + return this; + } + readBlockTiff() { + const rowBytes = this.rowBytes; + const bufferLength = this.bufferLength; + const buffer = this.ensureBuffer(bufferLength + rowBytes); + const bits = this.bits; + const colors = this.colors; + const rawBytes = this.str.getBytes(rowBytes); + this.eof = !rawBytes.length; + if (this.eof) { + return; + } + let inbuf = 0, + outbuf = 0; + let inbits = 0, + outbits = 0; + let pos = bufferLength; + let i; + if (bits === 1 && colors === 1) { + for (i = 0; i < rowBytes; ++i) { + let c = rawBytes[i] ^ inbuf; + c ^= c >> 1; + c ^= c >> 2; + c ^= c >> 4; + inbuf = (c & 1) << 7; + buffer[pos++] = c; + } + } else if (bits === 8) { + for (i = 0; i < colors; ++i) { + buffer[pos++] = rawBytes[i]; + } + for (; i < rowBytes; ++i) { + buffer[pos] = buffer[pos - colors] + rawBytes[i]; + pos++; + } + } else if (bits === 16) { + const bytesPerPixel = colors * 2; + for (i = 0; i < bytesPerPixel; ++i) { + buffer[pos++] = rawBytes[i]; + } + for (; i < rowBytes; i += 2) { + const sum = ((rawBytes[i] & 0xff) << 8) + (rawBytes[i + 1] & 0xff) + ((buffer[pos - bytesPerPixel] & 0xff) << 8) + (buffer[pos - bytesPerPixel + 1] & 0xff); + buffer[pos++] = sum >> 8 & 0xff; + buffer[pos++] = sum & 0xff; + } + } else { + const compArray = new Uint8Array(colors + 1); + const bitMask = (1 << bits) - 1; + let j = 0, + k = bufferLength; + const columns = this.columns; + for (i = 0; i < columns; ++i) { + for (let kk = 0; kk < colors; ++kk) { + if (inbits < bits) { + inbuf = inbuf << 8 | rawBytes[j++] & 0xff; + inbits += 8; + } + compArray[kk] = compArray[kk] + (inbuf >> inbits - bits) & bitMask; + inbits -= bits; + outbuf = outbuf << bits | compArray[kk]; + outbits += bits; + if (outbits >= 8) { + buffer[k++] = outbuf >> outbits - 8 & 0xff; + outbits -= 8; + } + } + } + if (outbits > 0) { + buffer[k++] = (outbuf << 8 - outbits) + (inbuf & (1 << 8 - outbits) - 1); + } + } + this.bufferLength += rowBytes; + } + readBlockPng() { + const rowBytes = this.rowBytes; + const pixBytes = this.pixBytes; + const predictor = this.str.getByte(); + const rawBytes = this.str.getBytes(rowBytes); + this.eof = !rawBytes.length; + if (this.eof) { + return; + } + const bufferLength = this.bufferLength; + const buffer = this.ensureBuffer(bufferLength + rowBytes); + let prevRow = buffer.subarray(bufferLength - rowBytes, bufferLength); + if (prevRow.length === 0) { + prevRow = new Uint8Array(rowBytes); + } + let i, + j = bufferLength, + up, + c; + switch (predictor) { + case 0: + for (i = 0; i < rowBytes; ++i) { + buffer[j++] = rawBytes[i]; + } + break; + case 1: + for (i = 0; i < pixBytes; ++i) { + buffer[j++] = rawBytes[i]; + } + for (; i < rowBytes; ++i) { + buffer[j] = buffer[j - pixBytes] + rawBytes[i] & 0xff; + j++; + } + break; + case 2: + for (i = 0; i < rowBytes; ++i) { + buffer[j++] = prevRow[i] + rawBytes[i] & 0xff; + } + break; + case 3: + for (i = 0; i < pixBytes; ++i) { + buffer[j++] = (prevRow[i] >> 1) + rawBytes[i]; + } + for (; i < rowBytes; ++i) { + buffer[j] = (prevRow[i] + buffer[j - pixBytes] >> 1) + rawBytes[i] & 0xff; + j++; + } + break; + case 4: + for (i = 0; i < pixBytes; ++i) { + up = prevRow[i]; + c = rawBytes[i]; + buffer[j++] = up + c; + } + for (; i < rowBytes; ++i) { + up = prevRow[i]; + const upLeft = prevRow[i - pixBytes]; + const left = buffer[j - pixBytes]; + const p = left + up - upLeft; + let pa = p - left; + if (pa < 0) { + pa = -pa; + } + let pb = p - up; + if (pb < 0) { + pb = -pb; + } + let pc = p - upLeft; + if (pc < 0) { + pc = -pc; + } + c = rawBytes[i]; + if (pa <= pb && pa <= pc) { + buffer[j++] = left + c; + } else if (pb <= pc) { + buffer[j++] = up + c; + } else { + buffer[j++] = upLeft + c; + } + } + break; + default: + throw new FormatError(`Unsupported predictor: ${predictor}`); + } + this.bufferLength += rowBytes; + } +} + +;// ./src/core/run_length_stream.js + +class RunLengthStream extends DecodeStream { + constructor(str, maybeLength) { + super(maybeLength); + this.str = str; + this.dict = str.dict; + } + readBlock() { + const repeatHeader = this.str.getBytes(2); + if (!repeatHeader || repeatHeader.length < 2 || repeatHeader[0] === 128) { + this.eof = true; + return; + } + let buffer; + let bufferLength = this.bufferLength; + let n = repeatHeader[0]; + if (n < 128) { + buffer = this.ensureBuffer(bufferLength + n + 1); + buffer[bufferLength++] = repeatHeader[1]; + if (n > 0) { + const source = this.str.getBytes(n); + buffer.set(source, bufferLength); + bufferLength += n; + } + } else { + n = 257 - n; + const b = repeatHeader[1]; + buffer = this.ensureBuffer(bufferLength + n + 1); + for (let i = 0; i < n; i++) { + buffer[bufferLength++] = b; + } + } + this.bufferLength = bufferLength; + } +} + +;// ./src/core/parser.js + + + + + + + + + + + + + + +const MAX_LENGTH_TO_CACHE = 1000; +function getInlineImageCacheKey(bytes) { + const strBuf = [], + ii = bytes.length; + let i = 0; + while (i < ii - 1) { + strBuf.push(bytes[i++] << 8 | bytes[i++]); + } + if (i < ii) { + strBuf.push(bytes[i]); + } + return ii + "_" + String.fromCharCode.apply(null, strBuf); +} +class Parser { + constructor({ + lexer, + xref, + allowStreams = false, + recoveryMode = false + }) { + this.lexer = lexer; + this.xref = xref; + this.allowStreams = allowStreams; + this.recoveryMode = recoveryMode; + this.imageCache = Object.create(null); + this._imageId = 0; + this.refill(); + } + refill() { + this.buf1 = this.lexer.getObj(); + this.buf2 = this.lexer.getObj(); + } + shift() { + if (this.buf2 instanceof Cmd && this.buf2.cmd === "ID") { + this.buf1 = this.buf2; + this.buf2 = null; + } else { + this.buf1 = this.buf2; + this.buf2 = this.lexer.getObj(); + } + } + tryShift() { + try { + this.shift(); + return true; + } catch (e) { + if (e instanceof MissingDataException) { + throw e; + } + return false; + } + } + getObj(cipherTransform = null) { + const buf1 = this.buf1; + this.shift(); + if (buf1 instanceof Cmd) { + switch (buf1.cmd) { + case "BI": + return this.makeInlineImage(cipherTransform); + case "[": + const array = []; + while (!isCmd(this.buf1, "]") && this.buf1 !== EOF) { + array.push(this.getObj(cipherTransform)); + } + if (this.buf1 === EOF) { + if (this.recoveryMode) { + return array; + } + throw new ParserEOFException("End of file inside array."); + } + this.shift(); + return array; + case "<<": + const dict = new Dict(this.xref); + while (!isCmd(this.buf1, ">>") && this.buf1 !== EOF) { + if (!(this.buf1 instanceof Name)) { + info("Malformed dictionary: key must be a name object"); + this.shift(); + continue; + } + const key = this.buf1.name; + this.shift(); + if (this.buf1 === EOF) { + break; + } + dict.set(key, this.getObj(cipherTransform)); + } + if (this.buf1 === EOF) { + if (this.recoveryMode) { + return dict; + } + throw new ParserEOFException("End of file inside dictionary."); + } + if (isCmd(this.buf2, "stream")) { + return this.allowStreams ? this.makeStream(dict, cipherTransform) : dict; + } + this.shift(); + return dict; + default: + return buf1; + } + } + if (Number.isInteger(buf1)) { + if (Number.isInteger(this.buf1) && isCmd(this.buf2, "R")) { + const ref = Ref.get(buf1, this.buf1); + this.shift(); + this.shift(); + return ref; + } + return buf1; + } + if (typeof buf1 === "string") { + if (cipherTransform) { + return cipherTransform.decryptString(buf1); + } + return buf1; + } + return buf1; + } + findDefaultInlineStreamEnd(stream) { + const E = 0x45, + I = 0x49, + SPACE = 0x20, + LF = 0xa, + CR = 0xd, + NUL = 0x0; + const { + knownCommands + } = this.lexer, + startPos = stream.pos, + n = 15; + let state = 0, + ch, + maybeEIPos; + while ((ch = stream.getByte()) !== -1) { + if (state === 0) { + state = ch === E ? 1 : 0; + } else if (state === 1) { + state = ch === I ? 2 : 0; + } else { + if (ch === SPACE || ch === LF || ch === CR) { + maybeEIPos = stream.pos; + const followingBytes = stream.peekBytes(n); + const ii = followingBytes.length; + if (ii === 0) { + break; + } + for (let i = 0; i < ii; i++) { + ch = followingBytes[i]; + if (ch === NUL && followingBytes[i + 1] !== NUL) { + continue; + } + if (ch !== LF && ch !== CR && (ch < SPACE || ch > 0x7f)) { + state = 0; + break; + } + } + if (state !== 2) { + continue; + } + if (!knownCommands) { + warn("findDefaultInlineStreamEnd - `lexer.knownCommands` is undefined."); + continue; + } + const tmpLexer = new Lexer(new Stream(followingBytes.slice()), knownCommands); + tmpLexer._hexStringWarn = () => {}; + let numArgs = 0; + while (true) { + const nextObj = tmpLexer.getObj(); + if (nextObj === EOF) { + state = 0; + break; + } + if (nextObj instanceof Cmd) { + const knownCommand = knownCommands[nextObj.cmd]; + if (!knownCommand) { + state = 0; + break; + } else if (knownCommand.variableArgs ? numArgs <= knownCommand.numArgs : numArgs === knownCommand.numArgs) { + break; + } + numArgs = 0; + continue; + } + numArgs++; + } + if (state === 2) { + break; + } + } else { + state = 0; + } + } + } + if (ch === -1) { + warn("findDefaultInlineStreamEnd: " + "Reached the end of the stream without finding a valid EI marker"); + if (maybeEIPos) { + warn('... trying to recover by using the last "EI" occurrence.'); + stream.skip(-(stream.pos - maybeEIPos)); + } + } + let endOffset = 4; + stream.skip(-endOffset); + ch = stream.peekByte(); + stream.skip(endOffset); + if (!isWhiteSpace(ch)) { + endOffset--; + } + return stream.pos - endOffset - startPos; + } + findDCTDecodeInlineStreamEnd(stream) { + const startPos = stream.pos; + let foundEOI = false, + b, + markerLength; + while ((b = stream.getByte()) !== -1) { + if (b !== 0xff) { + continue; + } + switch (stream.getByte()) { + case 0x00: + break; + case 0xff: + stream.skip(-1); + break; + case 0xd9: + foundEOI = true; + break; + case 0xc0: + case 0xc1: + case 0xc2: + case 0xc3: + case 0xc5: + case 0xc6: + case 0xc7: + case 0xc9: + case 0xca: + case 0xcb: + case 0xcd: + case 0xce: + case 0xcf: + case 0xc4: + case 0xcc: + case 0xda: + case 0xdb: + case 0xdc: + case 0xdd: + case 0xde: + case 0xdf: + case 0xe0: + case 0xe1: + case 0xe2: + case 0xe3: + case 0xe4: + case 0xe5: + case 0xe6: + case 0xe7: + case 0xe8: + case 0xe9: + case 0xea: + case 0xeb: + case 0xec: + case 0xed: + case 0xee: + case 0xef: + case 0xfe: + markerLength = stream.getUint16(); + if (markerLength > 2) { + stream.skip(markerLength - 2); + } else { + stream.skip(-2); + } + break; + } + if (foundEOI) { + break; + } + } + const length = stream.pos - startPos; + if (b === -1) { + warn("Inline DCTDecode image stream: " + "EOI marker not found, searching for /EI/ instead."); + stream.skip(-length); + return this.findDefaultInlineStreamEnd(stream); + } + this.inlineStreamSkipEI(stream); + return length; + } + findASCII85DecodeInlineStreamEnd(stream) { + const TILDE = 0x7e, + GT = 0x3e; + const startPos = stream.pos; + let ch; + while ((ch = stream.getByte()) !== -1) { + if (ch === TILDE) { + const tildePos = stream.pos; + ch = stream.peekByte(); + while (isWhiteSpace(ch)) { + stream.skip(); + ch = stream.peekByte(); + } + if (ch === GT) { + stream.skip(); + break; + } + if (stream.pos > tildePos) { + const maybeEI = stream.peekBytes(2); + if (maybeEI[0] === 0x45 && maybeEI[1] === 0x49) { + break; + } + } + } + } + const length = stream.pos - startPos; + if (ch === -1) { + warn("Inline ASCII85Decode image stream: " + "EOD marker not found, searching for /EI/ instead."); + stream.skip(-length); + return this.findDefaultInlineStreamEnd(stream); + } + this.inlineStreamSkipEI(stream); + return length; + } + findASCIIHexDecodeInlineStreamEnd(stream) { + const GT = 0x3e; + const startPos = stream.pos; + let ch; + while ((ch = stream.getByte()) !== -1) { + if (ch === GT) { + break; + } + } + const length = stream.pos - startPos; + if (ch === -1) { + warn("Inline ASCIIHexDecode image stream: " + "EOD marker not found, searching for /EI/ instead."); + stream.skip(-length); + return this.findDefaultInlineStreamEnd(stream); + } + this.inlineStreamSkipEI(stream); + return length; + } + inlineStreamSkipEI(stream) { + const E = 0x45, + I = 0x49; + let state = 0, + ch; + while ((ch = stream.getByte()) !== -1) { + if (state === 0) { + state = ch === E ? 1 : 0; + } else if (state === 1) { + state = ch === I ? 2 : 0; + } else if (state === 2) { + break; + } + } + } + makeInlineImage(cipherTransform) { + const lexer = this.lexer; + const stream = lexer.stream; + const dictMap = Object.create(null); + let dictLength; + while (!isCmd(this.buf1, "ID") && this.buf1 !== EOF) { + if (!(this.buf1 instanceof Name)) { + throw new FormatError("Dictionary key must be a name object"); + } + const key = this.buf1.name; + this.shift(); + if (this.buf1 === EOF) { + break; + } + dictMap[key] = this.getObj(cipherTransform); + } + if (lexer.beginInlineImagePos !== -1) { + dictLength = stream.pos - lexer.beginInlineImagePos; + } + const filter = this.xref.fetchIfRef(dictMap.F || dictMap.Filter); + let filterName; + if (filter instanceof Name) { + filterName = filter.name; + } else if (Array.isArray(filter)) { + const filterZero = this.xref.fetchIfRef(filter[0]); + if (filterZero instanceof Name) { + filterName = filterZero.name; + } + } + const startPos = stream.pos; + let length; + switch (filterName) { + case "DCT": + case "DCTDecode": + length = this.findDCTDecodeInlineStreamEnd(stream); + break; + case "A85": + case "ASCII85Decode": + length = this.findASCII85DecodeInlineStreamEnd(stream); + break; + case "AHx": + case "ASCIIHexDecode": + length = this.findASCIIHexDecodeInlineStreamEnd(stream); + break; + default: + length = this.findDefaultInlineStreamEnd(stream); + } + let cacheKey; + if (length < MAX_LENGTH_TO_CACHE && dictLength > 0) { + const initialStreamPos = stream.pos; + stream.pos = lexer.beginInlineImagePos; + cacheKey = getInlineImageCacheKey(stream.getBytes(dictLength + length)); + stream.pos = initialStreamPos; + const cacheEntry = this.imageCache[cacheKey]; + if (cacheEntry !== undefined) { + this.buf2 = Cmd.get("EI"); + this.shift(); + cacheEntry.reset(); + return cacheEntry; + } + } + const dict = new Dict(this.xref); + for (const key in dictMap) { + dict.set(key, dictMap[key]); + } + let imageStream = stream.makeSubStream(startPos, length, dict); + if (cipherTransform) { + imageStream = cipherTransform.createStream(imageStream, length); + } + imageStream = this.filter(imageStream, dict, length); + imageStream.dict = dict; + if (cacheKey !== undefined) { + imageStream.cacheKey = `inline_img_${++this._imageId}`; + this.imageCache[cacheKey] = imageStream; + } + this.buf2 = Cmd.get("EI"); + this.shift(); + return imageStream; + } + #findStreamLength(startPos) { + const { + stream + } = this.lexer; + stream.pos = startPos; + const SCAN_BLOCK_LENGTH = 2048; + const signatureLength = "endstream".length; + const END_SIGNATURE = new Uint8Array([0x65, 0x6e, 0x64]); + const endLength = END_SIGNATURE.length; + const PARTIAL_SIGNATURE = [new Uint8Array([0x73, 0x74, 0x72, 0x65, 0x61, 0x6d]), new Uint8Array([0x73, 0x74, 0x65, 0x61, 0x6d]), new Uint8Array([0x73, 0x74, 0x72, 0x65, 0x61])]; + const normalLength = signatureLength - endLength; + while (stream.pos < stream.end) { + const scanBytes = stream.peekBytes(SCAN_BLOCK_LENGTH); + const scanLength = scanBytes.length - signatureLength; + if (scanLength <= 0) { + break; + } + let pos = 0; + while (pos < scanLength) { + let j = 0; + while (j < endLength && scanBytes[pos + j] === END_SIGNATURE[j]) { + j++; + } + if (j >= endLength) { + let found = false; + for (const part of PARTIAL_SIGNATURE) { + const partLen = part.length; + let k = 0; + while (k < partLen && scanBytes[pos + j + k] === part[k]) { + k++; + } + if (k >= normalLength) { + found = true; + break; + } + if (k >= partLen) { + const lastByte = scanBytes[pos + j + k]; + if (isWhiteSpace(lastByte)) { + info(`Found "${bytesToString([...END_SIGNATURE, ...part])}" when ` + "searching for endstream command."); + found = true; + } + break; + } + } + if (found) { + stream.pos += pos; + return stream.pos - startPos; + } + } + pos++; + } + stream.pos += scanLength; + } + return -1; + } + makeStream(dict, cipherTransform) { + const lexer = this.lexer; + let stream = lexer.stream; + lexer.skipToNextLine(); + const startPos = stream.pos - 1; + let length = dict.get("Length"); + if (!Number.isInteger(length)) { + info(`Bad length "${length && length.toString()}" in stream.`); + length = 0; + } + stream.pos = startPos + length; + lexer.nextChar(); + if (this.tryShift() && isCmd(this.buf2, "endstream")) { + this.shift(); + } else { + length = this.#findStreamLength(startPos); + if (length < 0) { + throw new FormatError("Missing endstream command."); + } + lexer.nextChar(); + this.shift(); + this.shift(); + } + this.shift(); + stream = stream.makeSubStream(startPos, length, dict); + if (cipherTransform) { + stream = cipherTransform.createStream(stream, length); + } + stream = this.filter(stream, dict, length); + stream.dict = dict; + return stream; + } + filter(stream, dict, length) { + let filter = dict.get("F", "Filter"); + let params = dict.get("DP", "DecodeParms"); + if (filter instanceof Name) { + if (Array.isArray(params)) { + warn("/DecodeParms should not be an Array, when /Filter is a Name."); + } + return this.makeFilter(stream, filter.name, length, params); + } + let maybeLength = length; + if (Array.isArray(filter)) { + const filterArray = filter; + const paramsArray = params; + for (let i = 0, ii = filterArray.length; i < ii; ++i) { + filter = this.xref.fetchIfRef(filterArray[i]); + if (!(filter instanceof Name)) { + throw new FormatError(`Bad filter name "${filter}"`); + } + params = null; + if (Array.isArray(paramsArray) && i in paramsArray) { + params = this.xref.fetchIfRef(paramsArray[i]); + } + stream = this.makeFilter(stream, filter.name, maybeLength, params); + maybeLength = null; + } + } + return stream; + } + makeFilter(stream, name, maybeLength, params) { + if (maybeLength === 0) { + warn(`Empty "${name}" stream.`); + return new NullStream(); + } + try { + switch (name) { + case "Fl": + case "FlateDecode": + if (params) { + return new PredictorStream(new FlateStream(stream, maybeLength), maybeLength, params); + } + return new FlateStream(stream, maybeLength); + case "LZW": + case "LZWDecode": + let earlyChange = 1; + if (params) { + if (params.has("EarlyChange")) { + earlyChange = params.get("EarlyChange"); + } + return new PredictorStream(new LZWStream(stream, maybeLength, earlyChange), maybeLength, params); + } + return new LZWStream(stream, maybeLength, earlyChange); + case "DCT": + case "DCTDecode": + return new JpegStream(stream, maybeLength, params); + case "JPX": + case "JPXDecode": + return new JpxStream(stream, maybeLength, params); + case "A85": + case "ASCII85Decode": + return new Ascii85Stream(stream, maybeLength); + case "AHx": + case "ASCIIHexDecode": + return new AsciiHexStream(stream, maybeLength); + case "CCF": + case "CCITTFaxDecode": + return new CCITTFaxStream(stream, maybeLength, params); + case "RL": + case "RunLengthDecode": + return new RunLengthStream(stream, maybeLength); + case "JBIG2Decode": + return new Jbig2Stream(stream, maybeLength, params); + } + warn(`Filter "${name}" is not supported.`); + return stream; + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + warn(`Invalid stream: "${ex}"`); + return new NullStream(); + } + } +} +const specialChars = [1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 2, 0, 0, 2, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; +function toHexDigit(ch) { + if (ch >= 0x30 && ch <= 0x39) { + return ch & 0x0f; + } + if (ch >= 0x41 && ch <= 0x46 || ch >= 0x61 && ch <= 0x66) { + return (ch & 0x0f) + 9; + } + return -1; +} +class Lexer { + constructor(stream, knownCommands = null) { + this.stream = stream; + this.nextChar(); + this.strBuf = []; + this.knownCommands = knownCommands; + this._hexStringNumWarn = 0; + this.beginInlineImagePos = -1; + } + nextChar() { + return this.currentChar = this.stream.getByte(); + } + peekChar() { + return this.stream.peekByte(); + } + getNumber() { + let ch = this.currentChar; + let eNotation = false; + let divideBy = 0; + let sign = 1; + if (ch === 0x2d) { + sign = -1; + ch = this.nextChar(); + if (ch === 0x2d) { + ch = this.nextChar(); + } + } else if (ch === 0x2b) { + ch = this.nextChar(); + } + if (ch === 0x0a || ch === 0x0d) { + do { + ch = this.nextChar(); + } while (ch === 0x0a || ch === 0x0d); + } + if (ch === 0x2e) { + divideBy = 10; + ch = this.nextChar(); + } + if (ch < 0x30 || ch > 0x39) { + const msg = `Invalid number: ${String.fromCharCode(ch)} (charCode ${ch})`; + if (isWhiteSpace(ch) || ch === -1) { + info(`Lexer.getNumber - "${msg}".`); + return 0; + } + throw new FormatError(msg); + } + let baseValue = ch - 0x30; + let powerValue = 0; + let powerValueSign = 1; + while ((ch = this.nextChar()) >= 0) { + if (ch >= 0x30 && ch <= 0x39) { + const currentDigit = ch - 0x30; + if (eNotation) { + powerValue = powerValue * 10 + currentDigit; + } else { + if (divideBy !== 0) { + divideBy *= 10; + } + baseValue = baseValue * 10 + currentDigit; + } + } else if (ch === 0x2e) { + if (divideBy === 0) { + divideBy = 1; + } else { + break; + } + } else if (ch === 0x2d) { + warn("Badly formatted number: minus sign in the middle"); + } else if (ch === 0x45 || ch === 0x65) { + ch = this.peekChar(); + if (ch === 0x2b || ch === 0x2d) { + powerValueSign = ch === 0x2d ? -1 : 1; + this.nextChar(); + } else if (ch < 0x30 || ch > 0x39) { + break; + } + eNotation = true; + } else { + break; + } + } + if (divideBy !== 0) { + baseValue /= divideBy; + } + if (eNotation) { + baseValue *= 10 ** (powerValueSign * powerValue); + } + return sign * baseValue; + } + getString() { + let numParen = 1; + let done = false; + const strBuf = this.strBuf; + strBuf.length = 0; + let ch = this.nextChar(); + while (true) { + let charBuffered = false; + switch (ch | 0) { + case -1: + warn("Unterminated string"); + done = true; + break; + case 0x28: + ++numParen; + strBuf.push("("); + break; + case 0x29: + if (--numParen === 0) { + this.nextChar(); + done = true; + } else { + strBuf.push(")"); + } + break; + case 0x5c: + ch = this.nextChar(); + switch (ch) { + case -1: + warn("Unterminated string"); + done = true; + break; + case 0x6e: + strBuf.push("\n"); + break; + case 0x72: + strBuf.push("\r"); + break; + case 0x74: + strBuf.push("\t"); + break; + case 0x62: + strBuf.push("\b"); + break; + case 0x66: + strBuf.push("\f"); + break; + case 0x5c: + case 0x28: + case 0x29: + strBuf.push(String.fromCharCode(ch)); + break; + case 0x30: + case 0x31: + case 0x32: + case 0x33: + case 0x34: + case 0x35: + case 0x36: + case 0x37: + let x = ch & 0x0f; + ch = this.nextChar(); + charBuffered = true; + if (ch >= 0x30 && ch <= 0x37) { + x = (x << 3) + (ch & 0x0f); + ch = this.nextChar(); + if (ch >= 0x30 && ch <= 0x37) { + charBuffered = false; + x = (x << 3) + (ch & 0x0f); + } + } + strBuf.push(String.fromCharCode(x)); + break; + case 0x0d: + if (this.peekChar() === 0x0a) { + this.nextChar(); + } + break; + case 0x0a: + break; + default: + strBuf.push(String.fromCharCode(ch)); + break; + } + break; + default: + strBuf.push(String.fromCharCode(ch)); + break; + } + if (done) { + break; + } + if (!charBuffered) { + ch = this.nextChar(); + } + } + return strBuf.join(""); + } + getName() { + let ch, previousCh; + const strBuf = this.strBuf; + strBuf.length = 0; + while ((ch = this.nextChar()) >= 0 && !specialChars[ch]) { + if (ch === 0x23) { + ch = this.nextChar(); + if (specialChars[ch]) { + warn("Lexer_getName: " + "NUMBER SIGN (#) should be followed by a hexadecimal number."); + strBuf.push("#"); + break; + } + const x = toHexDigit(ch); + if (x !== -1) { + previousCh = ch; + ch = this.nextChar(); + const x2 = toHexDigit(ch); + if (x2 === -1) { + warn(`Lexer_getName: Illegal digit (${String.fromCharCode(ch)}) ` + "in hexadecimal number."); + strBuf.push("#", String.fromCharCode(previousCh)); + if (specialChars[ch]) { + break; + } + strBuf.push(String.fromCharCode(ch)); + continue; + } + strBuf.push(String.fromCharCode(x << 4 | x2)); + } else { + strBuf.push("#", String.fromCharCode(ch)); + } + } else { + strBuf.push(String.fromCharCode(ch)); + } + } + if (strBuf.length > 127) { + warn(`Name token is longer than allowed by the spec: ${strBuf.length}`); + } + return Name.get(strBuf.join("")); + } + _hexStringWarn(ch) { + const MAX_HEX_STRING_NUM_WARN = 5; + if (this._hexStringNumWarn++ === MAX_HEX_STRING_NUM_WARN) { + warn("getHexString - ignoring additional invalid characters."); + return; + } + if (this._hexStringNumWarn > MAX_HEX_STRING_NUM_WARN) { + return; + } + warn(`getHexString - ignoring invalid character: ${ch}`); + } + getHexString() { + const strBuf = this.strBuf; + strBuf.length = 0; + let ch = this.currentChar; + let firstDigit = -1, + digit = -1; + this._hexStringNumWarn = 0; + while (true) { + if (ch < 0) { + warn("Unterminated hex string"); + break; + } else if (ch === 0x3e) { + this.nextChar(); + break; + } else if (specialChars[ch] === 1) { + ch = this.nextChar(); + continue; + } else { + digit = toHexDigit(ch); + if (digit === -1) { + this._hexStringWarn(ch); + } else if (firstDigit === -1) { + firstDigit = digit; + } else { + strBuf.push(String.fromCharCode(firstDigit << 4 | digit)); + firstDigit = -1; + } + ch = this.nextChar(); + } + } + if (firstDigit !== -1) { + strBuf.push(String.fromCharCode(firstDigit << 4)); + } + return strBuf.join(""); + } + getObj() { + let comment = false; + let ch = this.currentChar; + while (true) { + if (ch < 0) { + return EOF; + } + if (comment) { + if (ch === 0x0a || ch === 0x0d) { + comment = false; + } + } else if (ch === 0x25) { + comment = true; + } else if (specialChars[ch] !== 1) { + break; + } + ch = this.nextChar(); + } + switch (ch | 0) { + case 0x30: + case 0x31: + case 0x32: + case 0x33: + case 0x34: + case 0x35: + case 0x36: + case 0x37: + case 0x38: + case 0x39: + case 0x2b: + case 0x2d: + case 0x2e: + return this.getNumber(); + case 0x28: + return this.getString(); + case 0x2f: + return this.getName(); + case 0x5b: + this.nextChar(); + return Cmd.get("["); + case 0x5d: + this.nextChar(); + return Cmd.get("]"); + case 0x3c: + ch = this.nextChar(); + if (ch === 0x3c) { + this.nextChar(); + return Cmd.get("<<"); + } + return this.getHexString(); + case 0x3e: + ch = this.nextChar(); + if (ch === 0x3e) { + this.nextChar(); + return Cmd.get(">>"); + } + return Cmd.get(">"); + case 0x7b: + this.nextChar(); + return Cmd.get("{"); + case 0x7d: + this.nextChar(); + return Cmd.get("}"); + case 0x29: + this.nextChar(); + throw new FormatError(`Illegal character: ${ch}`); + } + let str = String.fromCharCode(ch); + if (ch < 0x20 || ch > 0x7f) { + const nextCh = this.peekChar(); + if (nextCh >= 0x20 && nextCh <= 0x7f) { + this.nextChar(); + return Cmd.get(str); + } + } + const knownCommands = this.knownCommands; + let knownCommandFound = knownCommands?.[str] !== undefined; + while ((ch = this.nextChar()) >= 0 && !specialChars[ch]) { + const possibleCommand = str + String.fromCharCode(ch); + if (knownCommandFound && knownCommands[possibleCommand] === undefined) { + break; + } + if (str.length === 128) { + throw new FormatError(`Command token too long: ${str.length}`); + } + str = possibleCommand; + knownCommandFound = knownCommands?.[str] !== undefined; + } + if (str === "true") { + return true; + } + if (str === "false") { + return false; + } + if (str === "null") { + return null; + } + if (str === "BI") { + this.beginInlineImagePos = this.stream.pos; + } + return Cmd.get(str); + } + skipToNextLine() { + let ch = this.currentChar; + while (ch >= 0) { + if (ch === 0x0d) { + ch = this.nextChar(); + if (ch === 0x0a) { + this.nextChar(); + } + break; + } else if (ch === 0x0a) { + this.nextChar(); + break; + } + ch = this.nextChar(); + } + } +} +class Linearization { + static create(stream) { + function getInt(linDict, name, allowZeroValue = false) { + const obj = linDict.get(name); + if (Number.isInteger(obj) && (allowZeroValue ? obj >= 0 : obj > 0)) { + return obj; + } + throw new Error(`The "${name}" parameter in the linearization ` + "dictionary is invalid."); + } + function getHints(linDict) { + const hints = linDict.get("H"); + let hintsLength; + if (Array.isArray(hints) && ((hintsLength = hints.length) === 2 || hintsLength === 4)) { + for (let index = 0; index < hintsLength; index++) { + const hint = hints[index]; + if (!(Number.isInteger(hint) && hint > 0)) { + throw new Error(`Hint (${index}) in the linearization dictionary is invalid.`); + } + } + return hints; + } + throw new Error("Hint array in the linearization dictionary is invalid."); + } + const parser = new Parser({ + lexer: new Lexer(stream), + xref: null + }); + const obj1 = parser.getObj(); + const obj2 = parser.getObj(); + const obj3 = parser.getObj(); + const linDict = parser.getObj(); + let obj, length; + if (!(Number.isInteger(obj1) && Number.isInteger(obj2) && isCmd(obj3, "obj") && linDict instanceof Dict && typeof (obj = linDict.get("Linearized")) === "number" && obj > 0)) { + return null; + } else if ((length = getInt(linDict, "L")) !== stream.length) { + throw new Error('The "L" parameter in the linearization dictionary ' + "does not equal the stream length."); + } + return { + length, + hints: getHints(linDict), + objectNumberFirst: getInt(linDict, "O"), + endFirst: getInt(linDict, "E"), + numPages: getInt(linDict, "N"), + mainXRefEntriesOffset: getInt(linDict, "T"), + pageFirst: linDict.has("P") ? getInt(linDict, "P", true) : 0 + }; + } +} + +;// ./src/core/cmap.js + + + + + + + +const BUILT_IN_CMAPS = ["Adobe-GB1-UCS2", "Adobe-CNS1-UCS2", "Adobe-Japan1-UCS2", "Adobe-Korea1-UCS2", "78-EUC-H", "78-EUC-V", "78-H", "78-RKSJ-H", "78-RKSJ-V", "78-V", "78ms-RKSJ-H", "78ms-RKSJ-V", "83pv-RKSJ-H", "90ms-RKSJ-H", "90ms-RKSJ-V", "90msp-RKSJ-H", "90msp-RKSJ-V", "90pv-RKSJ-H", "90pv-RKSJ-V", "Add-H", "Add-RKSJ-H", "Add-RKSJ-V", "Add-V", "Adobe-CNS1-0", "Adobe-CNS1-1", "Adobe-CNS1-2", "Adobe-CNS1-3", "Adobe-CNS1-4", "Adobe-CNS1-5", "Adobe-CNS1-6", "Adobe-GB1-0", "Adobe-GB1-1", "Adobe-GB1-2", "Adobe-GB1-3", "Adobe-GB1-4", "Adobe-GB1-5", "Adobe-Japan1-0", "Adobe-Japan1-1", "Adobe-Japan1-2", "Adobe-Japan1-3", "Adobe-Japan1-4", "Adobe-Japan1-5", "Adobe-Japan1-6", "Adobe-Korea1-0", "Adobe-Korea1-1", "Adobe-Korea1-2", "B5-H", "B5-V", "B5pc-H", "B5pc-V", "CNS-EUC-H", "CNS-EUC-V", "CNS1-H", "CNS1-V", "CNS2-H", "CNS2-V", "ETHK-B5-H", "ETHK-B5-V", "ETen-B5-H", "ETen-B5-V", "ETenms-B5-H", "ETenms-B5-V", "EUC-H", "EUC-V", "Ext-H", "Ext-RKSJ-H", "Ext-RKSJ-V", "Ext-V", "GB-EUC-H", "GB-EUC-V", "GB-H", "GB-V", "GBK-EUC-H", "GBK-EUC-V", "GBK2K-H", "GBK2K-V", "GBKp-EUC-H", "GBKp-EUC-V", "GBT-EUC-H", "GBT-EUC-V", "GBT-H", "GBT-V", "GBTpc-EUC-H", "GBTpc-EUC-V", "GBpc-EUC-H", "GBpc-EUC-V", "H", "HKdla-B5-H", "HKdla-B5-V", "HKdlb-B5-H", "HKdlb-B5-V", "HKgccs-B5-H", "HKgccs-B5-V", "HKm314-B5-H", "HKm314-B5-V", "HKm471-B5-H", "HKm471-B5-V", "HKscs-B5-H", "HKscs-B5-V", "Hankaku", "Hiragana", "KSC-EUC-H", "KSC-EUC-V", "KSC-H", "KSC-Johab-H", "KSC-Johab-V", "KSC-V", "KSCms-UHC-H", "KSCms-UHC-HW-H", "KSCms-UHC-HW-V", "KSCms-UHC-V", "KSCpc-EUC-H", "KSCpc-EUC-V", "Katakana", "NWP-H", "NWP-V", "RKSJ-H", "RKSJ-V", "Roman", "UniCNS-UCS2-H", "UniCNS-UCS2-V", "UniCNS-UTF16-H", "UniCNS-UTF16-V", "UniCNS-UTF32-H", "UniCNS-UTF32-V", "UniCNS-UTF8-H", "UniCNS-UTF8-V", "UniGB-UCS2-H", "UniGB-UCS2-V", "UniGB-UTF16-H", "UniGB-UTF16-V", "UniGB-UTF32-H", "UniGB-UTF32-V", "UniGB-UTF8-H", "UniGB-UTF8-V", "UniJIS-UCS2-H", "UniJIS-UCS2-HW-H", "UniJIS-UCS2-HW-V", "UniJIS-UCS2-V", "UniJIS-UTF16-H", "UniJIS-UTF16-V", "UniJIS-UTF32-H", "UniJIS-UTF32-V", "UniJIS-UTF8-H", "UniJIS-UTF8-V", "UniJIS2004-UTF16-H", "UniJIS2004-UTF16-V", "UniJIS2004-UTF32-H", "UniJIS2004-UTF32-V", "UniJIS2004-UTF8-H", "UniJIS2004-UTF8-V", "UniJISPro-UCS2-HW-V", "UniJISPro-UCS2-V", "UniJISPro-UTF8-V", "UniJISX0213-UTF32-H", "UniJISX0213-UTF32-V", "UniJISX02132004-UTF32-H", "UniJISX02132004-UTF32-V", "UniKS-UCS2-H", "UniKS-UCS2-V", "UniKS-UTF16-H", "UniKS-UTF16-V", "UniKS-UTF32-H", "UniKS-UTF32-V", "UniKS-UTF8-H", "UniKS-UTF8-V", "V", "WP-Symbol"]; +const MAX_MAP_RANGE = 2 ** 24 - 1; +class CMap { + constructor(builtInCMap = false) { + this.codespaceRanges = [[], [], [], []]; + this.numCodespaceRanges = 0; + this._map = []; + this.name = ""; + this.vertical = false; + this.useCMap = null; + this.builtInCMap = builtInCMap; + } + addCodespaceRange(n, low, high) { + this.codespaceRanges[n - 1].push(low, high); + this.numCodespaceRanges++; + } + mapCidRange(low, high, dstLow) { + if (high - low > MAX_MAP_RANGE) { + throw new Error("mapCidRange - ignoring data above MAX_MAP_RANGE."); + } + while (low <= high) { + this._map[low++] = dstLow++; + } + } + mapBfRange(low, high, dstLow) { + if (high - low > MAX_MAP_RANGE) { + throw new Error("mapBfRange - ignoring data above MAX_MAP_RANGE."); + } + const lastByte = dstLow.length - 1; + while (low <= high) { + this._map[low++] = dstLow; + const nextCharCode = dstLow.charCodeAt(lastByte) + 1; + if (nextCharCode > 0xff) { + dstLow = dstLow.substring(0, lastByte - 1) + String.fromCharCode(dstLow.charCodeAt(lastByte - 1) + 1) + "\x00"; + continue; + } + dstLow = dstLow.substring(0, lastByte) + String.fromCharCode(nextCharCode); + } + } + mapBfRangeToArray(low, high, array) { + if (high - low > MAX_MAP_RANGE) { + throw new Error("mapBfRangeToArray - ignoring data above MAX_MAP_RANGE."); + } + const ii = array.length; + let i = 0; + while (low <= high && i < ii) { + this._map[low] = array[i++]; + ++low; + } + } + mapOne(src, dst) { + this._map[src] = dst; + } + lookup(code) { + return this._map[code]; + } + contains(code) { + return this._map[code] !== undefined; + } + forEach(callback) { + const map = this._map; + const length = map.length; + if (length <= 0x10000) { + for (let i = 0; i < length; i++) { + if (map[i] !== undefined) { + callback(i, map[i]); + } + } + } else { + for (const i in map) { + callback(i, map[i]); + } + } + } + charCodeOf(value) { + const map = this._map; + if (map.length <= 0x10000) { + return map.indexOf(value); + } + for (const charCode in map) { + if (map[charCode] === value) { + return charCode | 0; + } + } + return -1; + } + getMap() { + return this._map; + } + readCharCode(str, offset, out) { + let c = 0; + const codespaceRanges = this.codespaceRanges; + for (let n = 0, nn = codespaceRanges.length; n < nn; n++) { + c = (c << 8 | str.charCodeAt(offset + n)) >>> 0; + const codespaceRange = codespaceRanges[n]; + for (let k = 0, kk = codespaceRange.length; k < kk;) { + const low = codespaceRange[k++]; + const high = codespaceRange[k++]; + if (c >= low && c <= high) { + out.charcode = c; + out.length = n + 1; + return; + } + } + } + out.charcode = 0; + out.length = 1; + } + getCharCodeLength(charCode) { + const codespaceRanges = this.codespaceRanges; + for (let n = 0, nn = codespaceRanges.length; n < nn; n++) { + const codespaceRange = codespaceRanges[n]; + for (let k = 0, kk = codespaceRange.length; k < kk;) { + const low = codespaceRange[k++]; + const high = codespaceRange[k++]; + if (charCode >= low && charCode <= high) { + return n + 1; + } + } + } + return 1; + } + get length() { + return this._map.length; + } + get isIdentityCMap() { + if (!(this.name === "Identity-H" || this.name === "Identity-V")) { + return false; + } + if (this._map.length !== 0x10000) { + return false; + } + for (let i = 0; i < 0x10000; i++) { + if (this._map[i] !== i) { + return false; + } + } + return true; + } +} +class IdentityCMap extends CMap { + constructor(vertical, n) { + super(); + this.vertical = vertical; + this.addCodespaceRange(n, 0, 0xffff); + } + mapCidRange(low, high, dstLow) { + unreachable("should not call mapCidRange"); + } + mapBfRange(low, high, dstLow) { + unreachable("should not call mapBfRange"); + } + mapBfRangeToArray(low, high, array) { + unreachable("should not call mapBfRangeToArray"); + } + mapOne(src, dst) { + unreachable("should not call mapCidOne"); + } + lookup(code) { + return Number.isInteger(code) && code <= 0xffff ? code : undefined; + } + contains(code) { + return Number.isInteger(code) && code <= 0xffff; + } + forEach(callback) { + for (let i = 0; i <= 0xffff; i++) { + callback(i, i); + } + } + charCodeOf(value) { + return Number.isInteger(value) && value <= 0xffff ? value : -1; + } + getMap() { + const map = new Array(0x10000); + for (let i = 0; i <= 0xffff; i++) { + map[i] = i; + } + return map; + } + get length() { + return 0x10000; + } + get isIdentityCMap() { + unreachable("should not access .isIdentityCMap"); + } +} +function strToInt(str) { + let a = 0; + for (let i = 0; i < str.length; i++) { + a = a << 8 | str.charCodeAt(i); + } + return a >>> 0; +} +function expectString(obj) { + if (typeof obj !== "string") { + throw new FormatError("Malformed CMap: expected string."); + } +} +function expectInt(obj) { + if (!Number.isInteger(obj)) { + throw new FormatError("Malformed CMap: expected int."); + } +} +function parseBfChar(cMap, lexer) { + while (true) { + let obj = lexer.getObj(); + if (obj === EOF) { + break; + } + if (isCmd(obj, "endbfchar")) { + return; + } + expectString(obj); + const src = strToInt(obj); + obj = lexer.getObj(); + expectString(obj); + const dst = obj; + cMap.mapOne(src, dst); + } +} +function parseBfRange(cMap, lexer) { + while (true) { + let obj = lexer.getObj(); + if (obj === EOF) { + break; + } + if (isCmd(obj, "endbfrange")) { + return; + } + expectString(obj); + const low = strToInt(obj); + obj = lexer.getObj(); + expectString(obj); + const high = strToInt(obj); + obj = lexer.getObj(); + if (Number.isInteger(obj) || typeof obj === "string") { + const dstLow = Number.isInteger(obj) ? String.fromCharCode(obj) : obj; + cMap.mapBfRange(low, high, dstLow); + } else if (isCmd(obj, "[")) { + obj = lexer.getObj(); + const array = []; + while (!isCmd(obj, "]") && obj !== EOF) { + array.push(obj); + obj = lexer.getObj(); + } + cMap.mapBfRangeToArray(low, high, array); + } else { + break; + } + } + throw new FormatError("Invalid bf range."); +} +function parseCidChar(cMap, lexer) { + while (true) { + let obj = lexer.getObj(); + if (obj === EOF) { + break; + } + if (isCmd(obj, "endcidchar")) { + return; + } + expectString(obj); + const src = strToInt(obj); + obj = lexer.getObj(); + expectInt(obj); + const dst = obj; + cMap.mapOne(src, dst); + } +} +function parseCidRange(cMap, lexer) { + while (true) { + let obj = lexer.getObj(); + if (obj === EOF) { + break; + } + if (isCmd(obj, "endcidrange")) { + return; + } + expectString(obj); + const low = strToInt(obj); + obj = lexer.getObj(); + expectString(obj); + const high = strToInt(obj); + obj = lexer.getObj(); + expectInt(obj); + const dstLow = obj; + cMap.mapCidRange(low, high, dstLow); + } +} +function parseCodespaceRange(cMap, lexer) { + while (true) { + let obj = lexer.getObj(); + if (obj === EOF) { + break; + } + if (isCmd(obj, "endcodespacerange")) { + return; + } + if (typeof obj !== "string") { + break; + } + const low = strToInt(obj); + obj = lexer.getObj(); + if (typeof obj !== "string") { + break; + } + const high = strToInt(obj); + cMap.addCodespaceRange(obj.length, low, high); + } + throw new FormatError("Invalid codespace range."); +} +function parseWMode(cMap, lexer) { + const obj = lexer.getObj(); + if (Number.isInteger(obj)) { + cMap.vertical = !!obj; + } +} +function parseCMapName(cMap, lexer) { + const obj = lexer.getObj(); + if (obj instanceof Name) { + cMap.name = obj.name; + } +} +async function parseCMap(cMap, lexer, fetchBuiltInCMap, useCMap) { + let previous, embeddedUseCMap; + objLoop: while (true) { + try { + const obj = lexer.getObj(); + if (obj === EOF) { + break; + } else if (obj instanceof Name) { + if (obj.name === "WMode") { + parseWMode(cMap, lexer); + } else if (obj.name === "CMapName") { + parseCMapName(cMap, lexer); + } + previous = obj; + } else if (obj instanceof Cmd) { + switch (obj.cmd) { + case "endcmap": + break objLoop; + case "usecmap": + if (previous instanceof Name) { + embeddedUseCMap = previous.name; + } + break; + case "begincodespacerange": + parseCodespaceRange(cMap, lexer); + break; + case "beginbfchar": + parseBfChar(cMap, lexer); + break; + case "begincidchar": + parseCidChar(cMap, lexer); + break; + case "beginbfrange": + parseBfRange(cMap, lexer); + break; + case "begincidrange": + parseCidRange(cMap, lexer); + break; + } + } + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + warn("Invalid cMap data: " + ex); + continue; + } + } + if (!useCMap && embeddedUseCMap) { + useCMap = embeddedUseCMap; + } + if (useCMap) { + return extendCMap(cMap, fetchBuiltInCMap, useCMap); + } + return cMap; +} +async function extendCMap(cMap, fetchBuiltInCMap, useCMap) { + cMap.useCMap = await createBuiltInCMap(useCMap, fetchBuiltInCMap); + if (cMap.numCodespaceRanges === 0) { + const useCodespaceRanges = cMap.useCMap.codespaceRanges; + for (let i = 0; i < useCodespaceRanges.length; i++) { + cMap.codespaceRanges[i] = useCodespaceRanges[i].slice(); + } + cMap.numCodespaceRanges = cMap.useCMap.numCodespaceRanges; + } + cMap.useCMap.forEach(function (key, value) { + if (!cMap.contains(key)) { + cMap.mapOne(key, value); + } + }); + return cMap; +} +async function createBuiltInCMap(name, fetchBuiltInCMap) { + if (name === "Identity-H") { + return new IdentityCMap(false, 2); + } else if (name === "Identity-V") { + return new IdentityCMap(true, 2); + } + if (!BUILT_IN_CMAPS.includes(name)) { + throw new Error("Unknown CMap name: " + name); + } + if (!fetchBuiltInCMap) { + throw new Error("Built-in CMap parameters are not provided."); + } + const { + cMapData, + isCompressed + } = await fetchBuiltInCMap(name); + const cMap = new CMap(true); + if (isCompressed) { + return new BinaryCMapReader().process(cMapData, cMap, useCMap => extendCMap(cMap, fetchBuiltInCMap, useCMap)); + } + const lexer = new Lexer(new Stream(cMapData)); + return parseCMap(cMap, lexer, fetchBuiltInCMap, null); +} +class CMapFactory { + static async create({ + encoding, + fetchBuiltInCMap, + useCMap + }) { + if (encoding instanceof Name) { + return createBuiltInCMap(encoding.name, fetchBuiltInCMap); + } else if (encoding instanceof BaseStream) { + const parsedCMap = await parseCMap(new CMap(), new Lexer(encoding), fetchBuiltInCMap, useCMap); + if (parsedCMap.isIdentityCMap) { + return createBuiltInCMap(parsedCMap.name, fetchBuiltInCMap); + } + return parsedCMap; + } + throw new Error("Encoding required."); + } +} + +;// ./src/core/charsets.js +const ISOAdobeCharset = [".notdef", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quoteright", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "quoteleft", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "exclamdown", "cent", "sterling", "fraction", "yen", "florin", "section", "currency", "quotesingle", "quotedblleft", "guillemotleft", "guilsinglleft", "guilsinglright", "fi", "fl", "endash", "dagger", "daggerdbl", "periodcentered", "paragraph", "bullet", "quotesinglbase", "quotedblbase", "quotedblright", "guillemotright", "ellipsis", "perthousand", "questiondown", "grave", "acute", "circumflex", "tilde", "macron", "breve", "dotaccent", "dieresis", "ring", "cedilla", "hungarumlaut", "ogonek", "caron", "emdash", "AE", "ordfeminine", "Lslash", "Oslash", "OE", "ordmasculine", "ae", "dotlessi", "lslash", "oslash", "oe", "germandbls", "onesuperior", "logicalnot", "mu", "trademark", "Eth", "onehalf", "plusminus", "Thorn", "onequarter", "divide", "brokenbar", "degree", "thorn", "threequarters", "twosuperior", "registered", "minus", "eth", "multiply", "threesuperior", "copyright", "Aacute", "Acircumflex", "Adieresis", "Agrave", "Aring", "Atilde", "Ccedilla", "Eacute", "Ecircumflex", "Edieresis", "Egrave", "Iacute", "Icircumflex", "Idieresis", "Igrave", "Ntilde", "Oacute", "Ocircumflex", "Odieresis", "Ograve", "Otilde", "Scaron", "Uacute", "Ucircumflex", "Udieresis", "Ugrave", "Yacute", "Ydieresis", "Zcaron", "aacute", "acircumflex", "adieresis", "agrave", "aring", "atilde", "ccedilla", "eacute", "ecircumflex", "edieresis", "egrave", "iacute", "icircumflex", "idieresis", "igrave", "ntilde", "oacute", "ocircumflex", "odieresis", "ograve", "otilde", "scaron", "uacute", "ucircumflex", "udieresis", "ugrave", "yacute", "ydieresis", "zcaron"]; +const ExpertCharset = [".notdef", "space", "exclamsmall", "Hungarumlautsmall", "dollaroldstyle", "dollarsuperior", "ampersandsmall", "Acutesmall", "parenleftsuperior", "parenrightsuperior", "twodotenleader", "onedotenleader", "comma", "hyphen", "period", "fraction", "zerooldstyle", "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", "fiveoldstyle", "sixoldstyle", "sevenoldstyle", "eightoldstyle", "nineoldstyle", "colon", "semicolon", "commasuperior", "threequartersemdash", "periodsuperior", "questionsmall", "asuperior", "bsuperior", "centsuperior", "dsuperior", "esuperior", "isuperior", "lsuperior", "msuperior", "nsuperior", "osuperior", "rsuperior", "ssuperior", "tsuperior", "ff", "fi", "fl", "ffi", "ffl", "parenleftinferior", "parenrightinferior", "Circumflexsmall", "hyphensuperior", "Gravesmall", "Asmall", "Bsmall", "Csmall", "Dsmall", "Esmall", "Fsmall", "Gsmall", "Hsmall", "Ismall", "Jsmall", "Ksmall", "Lsmall", "Msmall", "Nsmall", "Osmall", "Psmall", "Qsmall", "Rsmall", "Ssmall", "Tsmall", "Usmall", "Vsmall", "Wsmall", "Xsmall", "Ysmall", "Zsmall", "colonmonetary", "onefitted", "rupiah", "Tildesmall", "exclamdownsmall", "centoldstyle", "Lslashsmall", "Scaronsmall", "Zcaronsmall", "Dieresissmall", "Brevesmall", "Caronsmall", "Dotaccentsmall", "Macronsmall", "figuredash", "hypheninferior", "Ogoneksmall", "Ringsmall", "Cedillasmall", "onequarter", "onehalf", "threequarters", "questiondownsmall", "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird", "twothirds", "zerosuperior", "onesuperior", "twosuperior", "threesuperior", "foursuperior", "fivesuperior", "sixsuperior", "sevensuperior", "eightsuperior", "ninesuperior", "zeroinferior", "oneinferior", "twoinferior", "threeinferior", "fourinferior", "fiveinferior", "sixinferior", "seveninferior", "eightinferior", "nineinferior", "centinferior", "dollarinferior", "periodinferior", "commainferior", "Agravesmall", "Aacutesmall", "Acircumflexsmall", "Atildesmall", "Adieresissmall", "Aringsmall", "AEsmall", "Ccedillasmall", "Egravesmall", "Eacutesmall", "Ecircumflexsmall", "Edieresissmall", "Igravesmall", "Iacutesmall", "Icircumflexsmall", "Idieresissmall", "Ethsmall", "Ntildesmall", "Ogravesmall", "Oacutesmall", "Ocircumflexsmall", "Otildesmall", "Odieresissmall", "OEsmall", "Oslashsmall", "Ugravesmall", "Uacutesmall", "Ucircumflexsmall", "Udieresissmall", "Yacutesmall", "Thornsmall", "Ydieresissmall"]; +const ExpertSubsetCharset = [".notdef", "space", "dollaroldstyle", "dollarsuperior", "parenleftsuperior", "parenrightsuperior", "twodotenleader", "onedotenleader", "comma", "hyphen", "period", "fraction", "zerooldstyle", "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", "fiveoldstyle", "sixoldstyle", "sevenoldstyle", "eightoldstyle", "nineoldstyle", "colon", "semicolon", "commasuperior", "threequartersemdash", "periodsuperior", "asuperior", "bsuperior", "centsuperior", "dsuperior", "esuperior", "isuperior", "lsuperior", "msuperior", "nsuperior", "osuperior", "rsuperior", "ssuperior", "tsuperior", "ff", "fi", "fl", "ffi", "ffl", "parenleftinferior", "parenrightinferior", "hyphensuperior", "colonmonetary", "onefitted", "rupiah", "centoldstyle", "figuredash", "hypheninferior", "onequarter", "onehalf", "threequarters", "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird", "twothirds", "zerosuperior", "onesuperior", "twosuperior", "threesuperior", "foursuperior", "fivesuperior", "sixsuperior", "sevensuperior", "eightsuperior", "ninesuperior", "zeroinferior", "oneinferior", "twoinferior", "threeinferior", "fourinferior", "fiveinferior", "sixinferior", "seveninferior", "eightinferior", "nineinferior", "centinferior", "dollarinferior", "periodinferior", "commainferior"]; + +;// ./src/core/encodings.js +const ExpertEncoding = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "exclamsmall", "Hungarumlautsmall", "", "dollaroldstyle", "dollarsuperior", "ampersandsmall", "Acutesmall", "parenleftsuperior", "parenrightsuperior", "twodotenleader", "onedotenleader", "comma", "hyphen", "period", "fraction", "zerooldstyle", "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", "fiveoldstyle", "sixoldstyle", "sevenoldstyle", "eightoldstyle", "nineoldstyle", "colon", "semicolon", "commasuperior", "threequartersemdash", "periodsuperior", "questionsmall", "", "asuperior", "bsuperior", "centsuperior", "dsuperior", "esuperior", "", "", "", "isuperior", "", "", "lsuperior", "msuperior", "nsuperior", "osuperior", "", "", "rsuperior", "ssuperior", "tsuperior", "", "ff", "fi", "fl", "ffi", "ffl", "parenleftinferior", "", "parenrightinferior", "Circumflexsmall", "hyphensuperior", "Gravesmall", "Asmall", "Bsmall", "Csmall", "Dsmall", "Esmall", "Fsmall", "Gsmall", "Hsmall", "Ismall", "Jsmall", "Ksmall", "Lsmall", "Msmall", "Nsmall", "Osmall", "Psmall", "Qsmall", "Rsmall", "Ssmall", "Tsmall", "Usmall", "Vsmall", "Wsmall", "Xsmall", "Ysmall", "Zsmall", "colonmonetary", "onefitted", "rupiah", "Tildesmall", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "exclamdownsmall", "centoldstyle", "Lslashsmall", "", "", "Scaronsmall", "Zcaronsmall", "Dieresissmall", "Brevesmall", "Caronsmall", "", "Dotaccentsmall", "", "", "Macronsmall", "", "", "figuredash", "hypheninferior", "", "", "Ogoneksmall", "Ringsmall", "Cedillasmall", "", "", "", "onequarter", "onehalf", "threequarters", "questiondownsmall", "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird", "twothirds", "", "", "zerosuperior", "onesuperior", "twosuperior", "threesuperior", "foursuperior", "fivesuperior", "sixsuperior", "sevensuperior", "eightsuperior", "ninesuperior", "zeroinferior", "oneinferior", "twoinferior", "threeinferior", "fourinferior", "fiveinferior", "sixinferior", "seveninferior", "eightinferior", "nineinferior", "centinferior", "dollarinferior", "periodinferior", "commainferior", "Agravesmall", "Aacutesmall", "Acircumflexsmall", "Atildesmall", "Adieresissmall", "Aringsmall", "AEsmall", "Ccedillasmall", "Egravesmall", "Eacutesmall", "Ecircumflexsmall", "Edieresissmall", "Igravesmall", "Iacutesmall", "Icircumflexsmall", "Idieresissmall", "Ethsmall", "Ntildesmall", "Ogravesmall", "Oacutesmall", "Ocircumflexsmall", "Otildesmall", "Odieresissmall", "OEsmall", "Oslashsmall", "Ugravesmall", "Uacutesmall", "Ucircumflexsmall", "Udieresissmall", "Yacutesmall", "Thornsmall", "Ydieresissmall"]; +const MacExpertEncoding = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "exclamsmall", "Hungarumlautsmall", "centoldstyle", "dollaroldstyle", "dollarsuperior", "ampersandsmall", "Acutesmall", "parenleftsuperior", "parenrightsuperior", "twodotenleader", "onedotenleader", "comma", "hyphen", "period", "fraction", "zerooldstyle", "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", "fiveoldstyle", "sixoldstyle", "sevenoldstyle", "eightoldstyle", "nineoldstyle", "colon", "semicolon", "", "threequartersemdash", "", "questionsmall", "", "", "", "", "Ethsmall", "", "", "onequarter", "onehalf", "threequarters", "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird", "twothirds", "", "", "", "", "", "", "ff", "fi", "fl", "ffi", "ffl", "parenleftinferior", "", "parenrightinferior", "Circumflexsmall", "hypheninferior", "Gravesmall", "Asmall", "Bsmall", "Csmall", "Dsmall", "Esmall", "Fsmall", "Gsmall", "Hsmall", "Ismall", "Jsmall", "Ksmall", "Lsmall", "Msmall", "Nsmall", "Osmall", "Psmall", "Qsmall", "Rsmall", "Ssmall", "Tsmall", "Usmall", "Vsmall", "Wsmall", "Xsmall", "Ysmall", "Zsmall", "colonmonetary", "onefitted", "rupiah", "Tildesmall", "", "", "asuperior", "centsuperior", "", "", "", "", "Aacutesmall", "Agravesmall", "Acircumflexsmall", "Adieresissmall", "Atildesmall", "Aringsmall", "Ccedillasmall", "Eacutesmall", "Egravesmall", "Ecircumflexsmall", "Edieresissmall", "Iacutesmall", "Igravesmall", "Icircumflexsmall", "Idieresissmall", "Ntildesmall", "Oacutesmall", "Ogravesmall", "Ocircumflexsmall", "Odieresissmall", "Otildesmall", "Uacutesmall", "Ugravesmall", "Ucircumflexsmall", "Udieresissmall", "", "eightsuperior", "fourinferior", "threeinferior", "sixinferior", "eightinferior", "seveninferior", "Scaronsmall", "", "centinferior", "twoinferior", "", "Dieresissmall", "", "Caronsmall", "osuperior", "fiveinferior", "", "commainferior", "periodinferior", "Yacutesmall", "", "dollarinferior", "", "", "Thornsmall", "", "nineinferior", "zeroinferior", "Zcaronsmall", "AEsmall", "Oslashsmall", "questiondownsmall", "oneinferior", "Lslashsmall", "", "", "", "", "", "", "Cedillasmall", "", "", "", "", "", "OEsmall", "figuredash", "hyphensuperior", "", "", "", "", "exclamdownsmall", "", "Ydieresissmall", "", "onesuperior", "twosuperior", "threesuperior", "foursuperior", "fivesuperior", "sixsuperior", "sevensuperior", "ninesuperior", "zerosuperior", "", "esuperior", "rsuperior", "tsuperior", "", "", "isuperior", "ssuperior", "dsuperior", "", "", "", "", "", "lsuperior", "Ogoneksmall", "Brevesmall", "Macronsmall", "bsuperior", "nsuperior", "msuperior", "commasuperior", "periodsuperior", "Dotaccentsmall", "Ringsmall", "", "", "", ""]; +const MacRomanEncoding = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "grave", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "", "Adieresis", "Aring", "Ccedilla", "Eacute", "Ntilde", "Odieresis", "Udieresis", "aacute", "agrave", "acircumflex", "adieresis", "atilde", "aring", "ccedilla", "eacute", "egrave", "ecircumflex", "edieresis", "iacute", "igrave", "icircumflex", "idieresis", "ntilde", "oacute", "ograve", "ocircumflex", "odieresis", "otilde", "uacute", "ugrave", "ucircumflex", "udieresis", "dagger", "degree", "cent", "sterling", "section", "bullet", "paragraph", "germandbls", "registered", "copyright", "trademark", "acute", "dieresis", "notequal", "AE", "Oslash", "infinity", "plusminus", "lessequal", "greaterequal", "yen", "mu", "partialdiff", "summation", "product", "pi", "integral", "ordfeminine", "ordmasculine", "Omega", "ae", "oslash", "questiondown", "exclamdown", "logicalnot", "radical", "florin", "approxequal", "Delta", "guillemotleft", "guillemotright", "ellipsis", "space", "Agrave", "Atilde", "Otilde", "OE", "oe", "endash", "emdash", "quotedblleft", "quotedblright", "quoteleft", "quoteright", "divide", "lozenge", "ydieresis", "Ydieresis", "fraction", "currency", "guilsinglleft", "guilsinglright", "fi", "fl", "daggerdbl", "periodcentered", "quotesinglbase", "quotedblbase", "perthousand", "Acircumflex", "Ecircumflex", "Aacute", "Edieresis", "Egrave", "Iacute", "Icircumflex", "Idieresis", "Igrave", "Oacute", "Ocircumflex", "apple", "Ograve", "Uacute", "Ucircumflex", "Ugrave", "dotlessi", "circumflex", "tilde", "macron", "breve", "dotaccent", "ring", "cedilla", "hungarumlaut", "ogonek", "caron"]; +const StandardEncoding = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quoteright", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "quoteleft", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "exclamdown", "cent", "sterling", "fraction", "yen", "florin", "section", "currency", "quotesingle", "quotedblleft", "guillemotleft", "guilsinglleft", "guilsinglright", "fi", "fl", "", "endash", "dagger", "daggerdbl", "periodcentered", "", "paragraph", "bullet", "quotesinglbase", "quotedblbase", "quotedblright", "guillemotright", "ellipsis", "perthousand", "", "questiondown", "", "grave", "acute", "circumflex", "tilde", "macron", "breve", "dotaccent", "dieresis", "", "ring", "cedilla", "", "hungarumlaut", "ogonek", "caron", "emdash", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "AE", "", "ordfeminine", "", "", "", "", "Lslash", "Oslash", "OE", "ordmasculine", "", "", "", "", "", "ae", "", "", "", "dotlessi", "", "", "lslash", "oslash", "oe", "germandbls", "", "", "", ""]; +const WinAnsiEncoding = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "grave", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "bullet", "Euro", "bullet", "quotesinglbase", "florin", "quotedblbase", "ellipsis", "dagger", "daggerdbl", "circumflex", "perthousand", "Scaron", "guilsinglleft", "OE", "bullet", "Zcaron", "bullet", "bullet", "quoteleft", "quoteright", "quotedblleft", "quotedblright", "bullet", "endash", "emdash", "tilde", "trademark", "scaron", "guilsinglright", "oe", "bullet", "zcaron", "Ydieresis", "space", "exclamdown", "cent", "sterling", "currency", "yen", "brokenbar", "section", "dieresis", "copyright", "ordfeminine", "guillemotleft", "logicalnot", "hyphen", "registered", "macron", "degree", "plusminus", "twosuperior", "threesuperior", "acute", "mu", "paragraph", "periodcentered", "cedilla", "onesuperior", "ordmasculine", "guillemotright", "onequarter", "onehalf", "threequarters", "questiondown", "Agrave", "Aacute", "Acircumflex", "Atilde", "Adieresis", "Aring", "AE", "Ccedilla", "Egrave", "Eacute", "Ecircumflex", "Edieresis", "Igrave", "Iacute", "Icircumflex", "Idieresis", "Eth", "Ntilde", "Ograve", "Oacute", "Ocircumflex", "Otilde", "Odieresis", "multiply", "Oslash", "Ugrave", "Uacute", "Ucircumflex", "Udieresis", "Yacute", "Thorn", "germandbls", "agrave", "aacute", "acircumflex", "atilde", "adieresis", "aring", "ae", "ccedilla", "egrave", "eacute", "ecircumflex", "edieresis", "igrave", "iacute", "icircumflex", "idieresis", "eth", "ntilde", "ograve", "oacute", "ocircumflex", "otilde", "odieresis", "divide", "oslash", "ugrave", "uacute", "ucircumflex", "udieresis", "yacute", "thorn", "ydieresis"]; +const SymbolSetEncoding = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "exclam", "universal", "numbersign", "existential", "percent", "ampersand", "suchthat", "parenleft", "parenright", "asteriskmath", "plus", "comma", "minus", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "congruent", "Alpha", "Beta", "Chi", "Delta", "Epsilon", "Phi", "Gamma", "Eta", "Iota", "theta1", "Kappa", "Lambda", "Mu", "Nu", "Omicron", "Pi", "Theta", "Rho", "Sigma", "Tau", "Upsilon", "sigma1", "Omega", "Xi", "Psi", "Zeta", "bracketleft", "therefore", "bracketright", "perpendicular", "underscore", "radicalex", "alpha", "beta", "chi", "delta", "epsilon", "phi", "gamma", "eta", "iota", "phi1", "kappa", "lambda", "mu", "nu", "omicron", "pi", "theta", "rho", "sigma", "tau", "upsilon", "omega1", "omega", "xi", "psi", "zeta", "braceleft", "bar", "braceright", "similar", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "Euro", "Upsilon1", "minute", "lessequal", "fraction", "infinity", "florin", "club", "diamond", "heart", "spade", "arrowboth", "arrowleft", "arrowup", "arrowright", "arrowdown", "degree", "plusminus", "second", "greaterequal", "multiply", "proportional", "partialdiff", "bullet", "divide", "notequal", "equivalence", "approxequal", "ellipsis", "arrowvertex", "arrowhorizex", "carriagereturn", "aleph", "Ifraktur", "Rfraktur", "weierstrass", "circlemultiply", "circleplus", "emptyset", "intersection", "union", "propersuperset", "reflexsuperset", "notsubset", "propersubset", "reflexsubset", "element", "notelement", "angle", "gradient", "registerserif", "copyrightserif", "trademarkserif", "product", "radical", "dotmath", "logicalnot", "logicaland", "logicalor", "arrowdblboth", "arrowdblleft", "arrowdblup", "arrowdblright", "arrowdbldown", "lozenge", "angleleft", "registersans", "copyrightsans", "trademarksans", "summation", "parenlefttp", "parenleftex", "parenleftbt", "bracketlefttp", "bracketleftex", "bracketleftbt", "bracelefttp", "braceleftmid", "braceleftbt", "braceex", "", "angleright", "integral", "integraltp", "integralex", "integralbt", "parenrighttp", "parenrightex", "parenrightbt", "bracketrighttp", "bracketrightex", "bracketrightbt", "bracerighttp", "bracerightmid", "bracerightbt", ""]; +const ZapfDingbatsEncoding = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "a1", "a2", "a202", "a3", "a4", "a5", "a119", "a118", "a117", "a11", "a12", "a13", "a14", "a15", "a16", "a105", "a17", "a18", "a19", "a20", "a21", "a22", "a23", "a24", "a25", "a26", "a27", "a28", "a6", "a7", "a8", "a9", "a10", "a29", "a30", "a31", "a32", "a33", "a34", "a35", "a36", "a37", "a38", "a39", "a40", "a41", "a42", "a43", "a44", "a45", "a46", "a47", "a48", "a49", "a50", "a51", "a52", "a53", "a54", "a55", "a56", "a57", "a58", "a59", "a60", "a61", "a62", "a63", "a64", "a65", "a66", "a67", "a68", "a69", "a70", "a71", "a72", "a73", "a74", "a203", "a75", "a204", "a76", "a77", "a78", "a79", "a81", "a82", "a83", "a84", "a97", "a98", "a99", "a100", "", "a89", "a90", "a93", "a94", "a91", "a92", "a205", "a85", "a206", "a86", "a87", "a88", "a95", "a96", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "a101", "a102", "a103", "a104", "a106", "a107", "a108", "a112", "a111", "a110", "a109", "a120", "a121", "a122", "a123", "a124", "a125", "a126", "a127", "a128", "a129", "a130", "a131", "a132", "a133", "a134", "a135", "a136", "a137", "a138", "a139", "a140", "a141", "a142", "a143", "a144", "a145", "a146", "a147", "a148", "a149", "a150", "a151", "a152", "a153", "a154", "a155", "a156", "a157", "a158", "a159", "a160", "a161", "a163", "a164", "a196", "a165", "a192", "a166", "a167", "a168", "a169", "a170", "a171", "a172", "a173", "a162", "a174", "a175", "a176", "a177", "a178", "a179", "a193", "a180", "a199", "a181", "a200", "a182", "", "a201", "a183", "a184", "a197", "a185", "a194", "a198", "a186", "a195", "a187", "a188", "a189", "a190", "a191", ""]; +function getEncoding(encodingName) { + switch (encodingName) { + case "WinAnsiEncoding": + return WinAnsiEncoding; + case "StandardEncoding": + return StandardEncoding; + case "MacRomanEncoding": + return MacRomanEncoding; + case "SymbolSetEncoding": + return SymbolSetEncoding; + case "ZapfDingbatsEncoding": + return ZapfDingbatsEncoding; + case "ExpertEncoding": + return ExpertEncoding; + case "MacExpertEncoding": + return MacExpertEncoding; + default: + return null; + } +} + +;// ./src/core/cff_parser.js + + + +const MAX_SUBR_NESTING = 10; +const CFFStandardStrings = [".notdef", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quoteright", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "quoteleft", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "exclamdown", "cent", "sterling", "fraction", "yen", "florin", "section", "currency", "quotesingle", "quotedblleft", "guillemotleft", "guilsinglleft", "guilsinglright", "fi", "fl", "endash", "dagger", "daggerdbl", "periodcentered", "paragraph", "bullet", "quotesinglbase", "quotedblbase", "quotedblright", "guillemotright", "ellipsis", "perthousand", "questiondown", "grave", "acute", "circumflex", "tilde", "macron", "breve", "dotaccent", "dieresis", "ring", "cedilla", "hungarumlaut", "ogonek", "caron", "emdash", "AE", "ordfeminine", "Lslash", "Oslash", "OE", "ordmasculine", "ae", "dotlessi", "lslash", "oslash", "oe", "germandbls", "onesuperior", "logicalnot", "mu", "trademark", "Eth", "onehalf", "plusminus", "Thorn", "onequarter", "divide", "brokenbar", "degree", "thorn", "threequarters", "twosuperior", "registered", "minus", "eth", "multiply", "threesuperior", "copyright", "Aacute", "Acircumflex", "Adieresis", "Agrave", "Aring", "Atilde", "Ccedilla", "Eacute", "Ecircumflex", "Edieresis", "Egrave", "Iacute", "Icircumflex", "Idieresis", "Igrave", "Ntilde", "Oacute", "Ocircumflex", "Odieresis", "Ograve", "Otilde", "Scaron", "Uacute", "Ucircumflex", "Udieresis", "Ugrave", "Yacute", "Ydieresis", "Zcaron", "aacute", "acircumflex", "adieresis", "agrave", "aring", "atilde", "ccedilla", "eacute", "ecircumflex", "edieresis", "egrave", "iacute", "icircumflex", "idieresis", "igrave", "ntilde", "oacute", "ocircumflex", "odieresis", "ograve", "otilde", "scaron", "uacute", "ucircumflex", "udieresis", "ugrave", "yacute", "ydieresis", "zcaron", "exclamsmall", "Hungarumlautsmall", "dollaroldstyle", "dollarsuperior", "ampersandsmall", "Acutesmall", "parenleftsuperior", "parenrightsuperior", "twodotenleader", "onedotenleader", "zerooldstyle", "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", "fiveoldstyle", "sixoldstyle", "sevenoldstyle", "eightoldstyle", "nineoldstyle", "commasuperior", "threequartersemdash", "periodsuperior", "questionsmall", "asuperior", "bsuperior", "centsuperior", "dsuperior", "esuperior", "isuperior", "lsuperior", "msuperior", "nsuperior", "osuperior", "rsuperior", "ssuperior", "tsuperior", "ff", "ffi", "ffl", "parenleftinferior", "parenrightinferior", "Circumflexsmall", "hyphensuperior", "Gravesmall", "Asmall", "Bsmall", "Csmall", "Dsmall", "Esmall", "Fsmall", "Gsmall", "Hsmall", "Ismall", "Jsmall", "Ksmall", "Lsmall", "Msmall", "Nsmall", "Osmall", "Psmall", "Qsmall", "Rsmall", "Ssmall", "Tsmall", "Usmall", "Vsmall", "Wsmall", "Xsmall", "Ysmall", "Zsmall", "colonmonetary", "onefitted", "rupiah", "Tildesmall", "exclamdownsmall", "centoldstyle", "Lslashsmall", "Scaronsmall", "Zcaronsmall", "Dieresissmall", "Brevesmall", "Caronsmall", "Dotaccentsmall", "Macronsmall", "figuredash", "hypheninferior", "Ogoneksmall", "Ringsmall", "Cedillasmall", "questiondownsmall", "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird", "twothirds", "zerosuperior", "foursuperior", "fivesuperior", "sixsuperior", "sevensuperior", "eightsuperior", "ninesuperior", "zeroinferior", "oneinferior", "twoinferior", "threeinferior", "fourinferior", "fiveinferior", "sixinferior", "seveninferior", "eightinferior", "nineinferior", "centinferior", "dollarinferior", "periodinferior", "commainferior", "Agravesmall", "Aacutesmall", "Acircumflexsmall", "Atildesmall", "Adieresissmall", "Aringsmall", "AEsmall", "Ccedillasmall", "Egravesmall", "Eacutesmall", "Ecircumflexsmall", "Edieresissmall", "Igravesmall", "Iacutesmall", "Icircumflexsmall", "Idieresissmall", "Ethsmall", "Ntildesmall", "Ogravesmall", "Oacutesmall", "Ocircumflexsmall", "Otildesmall", "Odieresissmall", "OEsmall", "Oslashsmall", "Ugravesmall", "Uacutesmall", "Ucircumflexsmall", "Udieresissmall", "Yacutesmall", "Thornsmall", "Ydieresissmall", "001.000", "001.001", "001.002", "001.003", "Black", "Bold", "Book", "Light", "Medium", "Regular", "Roman", "Semibold"]; +const NUM_STANDARD_CFF_STRINGS = 391; +const CharstringValidationData = [null, { + id: "hstem", + min: 2, + stackClearing: true, + stem: true +}, null, { + id: "vstem", + min: 2, + stackClearing: true, + stem: true +}, { + id: "vmoveto", + min: 1, + stackClearing: true +}, { + id: "rlineto", + min: 2, + resetStack: true +}, { + id: "hlineto", + min: 1, + resetStack: true +}, { + id: "vlineto", + min: 1, + resetStack: true +}, { + id: "rrcurveto", + min: 6, + resetStack: true +}, null, { + id: "callsubr", + min: 1, + undefStack: true +}, { + id: "return", + min: 0, + undefStack: true +}, null, null, { + id: "endchar", + min: 0, + stackClearing: true +}, null, null, null, { + id: "hstemhm", + min: 2, + stackClearing: true, + stem: true +}, { + id: "hintmask", + min: 0, + stackClearing: true +}, { + id: "cntrmask", + min: 0, + stackClearing: true +}, { + id: "rmoveto", + min: 2, + stackClearing: true +}, { + id: "hmoveto", + min: 1, + stackClearing: true +}, { + id: "vstemhm", + min: 2, + stackClearing: true, + stem: true +}, { + id: "rcurveline", + min: 8, + resetStack: true +}, { + id: "rlinecurve", + min: 8, + resetStack: true +}, { + id: "vvcurveto", + min: 4, + resetStack: true +}, { + id: "hhcurveto", + min: 4, + resetStack: true +}, null, { + id: "callgsubr", + min: 1, + undefStack: true +}, { + id: "vhcurveto", + min: 4, + resetStack: true +}, { + id: "hvcurveto", + min: 4, + resetStack: true +}]; +const CharstringValidationData12 = [null, null, null, { + id: "and", + min: 2, + stackDelta: -1 +}, { + id: "or", + min: 2, + stackDelta: -1 +}, { + id: "not", + min: 1, + stackDelta: 0 +}, null, null, null, { + id: "abs", + min: 1, + stackDelta: 0 +}, { + id: "add", + min: 2, + stackDelta: -1, + stackFn(stack, index) { + stack[index - 2] = stack[index - 2] + stack[index - 1]; + } +}, { + id: "sub", + min: 2, + stackDelta: -1, + stackFn(stack, index) { + stack[index - 2] = stack[index - 2] - stack[index - 1]; + } +}, { + id: "div", + min: 2, + stackDelta: -1, + stackFn(stack, index) { + stack[index - 2] = stack[index - 2] / stack[index - 1]; + } +}, null, { + id: "neg", + min: 1, + stackDelta: 0, + stackFn(stack, index) { + stack[index - 1] = -stack[index - 1]; + } +}, { + id: "eq", + min: 2, + stackDelta: -1 +}, null, null, { + id: "drop", + min: 1, + stackDelta: -1 +}, null, { + id: "put", + min: 2, + stackDelta: -2 +}, { + id: "get", + min: 1, + stackDelta: 0 +}, { + id: "ifelse", + min: 4, + stackDelta: -3 +}, { + id: "random", + min: 0, + stackDelta: 1 +}, { + id: "mul", + min: 2, + stackDelta: -1, + stackFn(stack, index) { + stack[index - 2] = stack[index - 2] * stack[index - 1]; + } +}, null, { + id: "sqrt", + min: 1, + stackDelta: 0 +}, { + id: "dup", + min: 1, + stackDelta: 1 +}, { + id: "exch", + min: 2, + stackDelta: 0 +}, { + id: "index", + min: 2, + stackDelta: 0 +}, { + id: "roll", + min: 3, + stackDelta: -2 +}, null, null, null, { + id: "hflex", + min: 7, + resetStack: true +}, { + id: "flex", + min: 13, + resetStack: true +}, { + id: "hflex1", + min: 9, + resetStack: true +}, { + id: "flex1", + min: 11, + resetStack: true +}]; +class CFFParser { + constructor(file, properties, seacAnalysisEnabled) { + this.bytes = file.getBytes(); + this.properties = properties; + this.seacAnalysisEnabled = !!seacAnalysisEnabled; + } + parse() { + const properties = this.properties; + const cff = new CFF(); + this.cff = cff; + const header = this.parseHeader(); + const nameIndex = this.parseIndex(header.endPos); + const topDictIndex = this.parseIndex(nameIndex.endPos); + const stringIndex = this.parseIndex(topDictIndex.endPos); + const globalSubrIndex = this.parseIndex(stringIndex.endPos); + const topDictParsed = this.parseDict(topDictIndex.obj.get(0)); + const topDict = this.createDict(CFFTopDict, topDictParsed, cff.strings); + cff.header = header.obj; + cff.names = this.parseNameIndex(nameIndex.obj); + cff.strings = this.parseStringIndex(stringIndex.obj); + cff.topDict = topDict; + cff.globalSubrIndex = globalSubrIndex.obj; + this.parsePrivateDict(cff.topDict); + cff.isCIDFont = topDict.hasName("ROS"); + const charStringOffset = topDict.getByName("CharStrings"); + const charStringIndex = this.parseIndex(charStringOffset).obj; + const fontMatrix = topDict.getByName("FontMatrix"); + if (fontMatrix) { + properties.fontMatrix = fontMatrix; + } + const fontBBox = topDict.getByName("FontBBox"); + if (fontBBox) { + properties.ascent = Math.max(fontBBox[3], fontBBox[1]); + properties.descent = Math.min(fontBBox[1], fontBBox[3]); + properties.ascentScaled = true; + } + let charset, encoding; + if (cff.isCIDFont) { + const fdArrayIndex = this.parseIndex(topDict.getByName("FDArray")).obj; + for (let i = 0, ii = fdArrayIndex.count; i < ii; ++i) { + const dictRaw = fdArrayIndex.get(i); + const fontDict = this.createDict(CFFTopDict, this.parseDict(dictRaw), cff.strings); + this.parsePrivateDict(fontDict); + cff.fdArray.push(fontDict); + } + encoding = null; + charset = this.parseCharsets(topDict.getByName("charset"), charStringIndex.count, cff.strings, true); + cff.fdSelect = this.parseFDSelect(topDict.getByName("FDSelect"), charStringIndex.count); + } else { + charset = this.parseCharsets(topDict.getByName("charset"), charStringIndex.count, cff.strings, false); + encoding = this.parseEncoding(topDict.getByName("Encoding"), properties, cff.strings, charset.charset); + } + cff.charset = charset; + cff.encoding = encoding; + const charStringsAndSeacs = this.parseCharStrings({ + charStrings: charStringIndex, + localSubrIndex: topDict.privateDict.subrsIndex, + globalSubrIndex: globalSubrIndex.obj, + fdSelect: cff.fdSelect, + fdArray: cff.fdArray, + privateDict: topDict.privateDict + }); + cff.charStrings = charStringsAndSeacs.charStrings; + cff.seacs = charStringsAndSeacs.seacs; + cff.widths = charStringsAndSeacs.widths; + return cff; + } + parseHeader() { + let bytes = this.bytes; + const bytesLength = bytes.length; + let offset = 0; + while (offset < bytesLength && bytes[offset] !== 1) { + ++offset; + } + if (offset >= bytesLength) { + throw new FormatError("Invalid CFF header"); + } + if (offset !== 0) { + info("cff data is shifted"); + bytes = bytes.subarray(offset); + this.bytes = bytes; + } + const major = bytes[0]; + const minor = bytes[1]; + const hdrSize = bytes[2]; + const offSize = bytes[3]; + const header = new CFFHeader(major, minor, hdrSize, offSize); + return { + obj: header, + endPos: hdrSize + }; + } + parseDict(dict) { + let pos = 0; + function parseOperand() { + let value = dict[pos++]; + if (value === 30) { + return parseFloatOperand(); + } else if (value === 28) { + value = dict[pos++]; + value = (value << 24 | dict[pos++] << 16) >> 16; + return value; + } else if (value === 29) { + value = dict[pos++]; + value = value << 8 | dict[pos++]; + value = value << 8 | dict[pos++]; + value = value << 8 | dict[pos++]; + return value; + } else if (value >= 32 && value <= 246) { + return value - 139; + } else if (value >= 247 && value <= 250) { + return (value - 247) * 256 + dict[pos++] + 108; + } else if (value >= 251 && value <= 254) { + return -((value - 251) * 256) - dict[pos++] - 108; + } + warn('CFFParser_parseDict: "' + value + '" is a reserved command.'); + return NaN; + } + function parseFloatOperand() { + let str = ""; + const eof = 15; + const lookup = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ".", "E", "E-", null, "-"]; + const length = dict.length; + while (pos < length) { + const b = dict[pos++]; + const b1 = b >> 4; + const b2 = b & 15; + if (b1 === eof) { + break; + } + str += lookup[b1]; + if (b2 === eof) { + break; + } + str += lookup[b2]; + } + return parseFloat(str); + } + let operands = []; + const entries = []; + pos = 0; + const end = dict.length; + while (pos < end) { + let b = dict[pos]; + if (b <= 21) { + if (b === 12) { + b = b << 8 | dict[++pos]; + } + entries.push([b, operands]); + operands = []; + ++pos; + } else { + operands.push(parseOperand()); + } + } + return entries; + } + parseIndex(pos) { + const cffIndex = new CFFIndex(); + const bytes = this.bytes; + const count = bytes[pos++] << 8 | bytes[pos++]; + const offsets = []; + let end = pos; + let i, ii; + if (count !== 0) { + const offsetSize = bytes[pos++]; + const startPos = pos + (count + 1) * offsetSize - 1; + for (i = 0, ii = count + 1; i < ii; ++i) { + let offset = 0; + for (let j = 0; j < offsetSize; ++j) { + offset <<= 8; + offset += bytes[pos++]; + } + offsets.push(startPos + offset); + } + end = offsets[count]; + } + for (i = 0, ii = offsets.length - 1; i < ii; ++i) { + const offsetStart = offsets[i]; + const offsetEnd = offsets[i + 1]; + cffIndex.add(bytes.subarray(offsetStart, offsetEnd)); + } + return { + obj: cffIndex, + endPos: end + }; + } + parseNameIndex(index) { + const names = []; + for (let i = 0, ii = index.count; i < ii; ++i) { + const name = index.get(i); + names.push(bytesToString(name)); + } + return names; + } + parseStringIndex(index) { + const strings = new CFFStrings(); + for (let i = 0, ii = index.count; i < ii; ++i) { + const data = index.get(i); + strings.add(bytesToString(data)); + } + return strings; + } + createDict(Type, dict, strings) { + const cffDict = new Type(strings); + for (const [key, value] of dict) { + cffDict.setByKey(key, value); + } + return cffDict; + } + parseCharString(state, data, localSubrIndex, globalSubrIndex) { + if (!data || state.callDepth > MAX_SUBR_NESTING) { + return false; + } + let stackSize = state.stackSize; + const stack = state.stack; + let length = data.length; + for (let j = 0; j < length;) { + const value = data[j++]; + let validationCommand = null; + if (value === 12) { + const q = data[j++]; + if (q === 0) { + data[j - 2] = 139; + data[j - 1] = 22; + stackSize = 0; + } else { + validationCommand = CharstringValidationData12[q]; + } + } else if (value === 28) { + stack[stackSize] = (data[j] << 24 | data[j + 1] << 16) >> 16; + j += 2; + stackSize++; + } else if (value === 14) { + if (stackSize >= 4) { + stackSize -= 4; + if (this.seacAnalysisEnabled) { + state.seac = stack.slice(stackSize, stackSize + 4); + return false; + } + } + validationCommand = CharstringValidationData[value]; + } else if (value >= 32 && value <= 246) { + stack[stackSize] = value - 139; + stackSize++; + } else if (value >= 247 && value <= 254) { + stack[stackSize] = value < 251 ? (value - 247 << 8) + data[j] + 108 : -(value - 251 << 8) - data[j] - 108; + j++; + stackSize++; + } else if (value === 255) { + stack[stackSize] = (data[j] << 24 | data[j + 1] << 16 | data[j + 2] << 8 | data[j + 3]) / 65536; + j += 4; + stackSize++; + } else if (value === 19 || value === 20) { + state.hints += stackSize >> 1; + if (state.hints === 0) { + data.copyWithin(j - 1, j, -1); + j -= 1; + length -= 1; + continue; + } + j += state.hints + 7 >> 3; + stackSize %= 2; + validationCommand = CharstringValidationData[value]; + } else if (value === 10 || value === 29) { + const subrsIndex = value === 10 ? localSubrIndex : globalSubrIndex; + if (!subrsIndex) { + validationCommand = CharstringValidationData[value]; + warn("Missing subrsIndex for " + validationCommand.id); + return false; + } + let bias = 32768; + if (subrsIndex.count < 1240) { + bias = 107; + } else if (subrsIndex.count < 33900) { + bias = 1131; + } + const subrNumber = stack[--stackSize] + bias; + if (subrNumber < 0 || subrNumber >= subrsIndex.count || isNaN(subrNumber)) { + validationCommand = CharstringValidationData[value]; + warn("Out of bounds subrIndex for " + validationCommand.id); + return false; + } + state.stackSize = stackSize; + state.callDepth++; + const valid = this.parseCharString(state, subrsIndex.get(subrNumber), localSubrIndex, globalSubrIndex); + if (!valid) { + return false; + } + state.callDepth--; + stackSize = state.stackSize; + continue; + } else if (value === 11) { + state.stackSize = stackSize; + return true; + } else if (value === 0 && j === data.length) { + data[j - 1] = 14; + validationCommand = CharstringValidationData[14]; + } else if (value === 9) { + data.copyWithin(j - 1, j, -1); + j -= 1; + length -= 1; + continue; + } else { + validationCommand = CharstringValidationData[value]; + } + if (validationCommand) { + if (validationCommand.stem) { + state.hints += stackSize >> 1; + if (value === 3 || value === 23) { + state.hasVStems = true; + } else if (state.hasVStems && (value === 1 || value === 18)) { + warn("CFF stem hints are in wrong order"); + data[j - 1] = value === 1 ? 3 : 23; + } + } + if ("min" in validationCommand) { + if (!state.undefStack && stackSize < validationCommand.min) { + warn("Not enough parameters for " + validationCommand.id + "; actual: " + stackSize + ", expected: " + validationCommand.min); + if (stackSize === 0) { + data[j - 1] = 14; + return true; + } + return false; + } + } + if (state.firstStackClearing && validationCommand.stackClearing) { + state.firstStackClearing = false; + stackSize -= validationCommand.min; + if (stackSize >= 2 && validationCommand.stem) { + stackSize %= 2; + } else if (stackSize > 1) { + warn("Found too many parameters for stack-clearing command"); + } + if (stackSize > 0) { + state.width = stack[stackSize - 1]; + } + } + if ("stackDelta" in validationCommand) { + if ("stackFn" in validationCommand) { + validationCommand.stackFn(stack, stackSize); + } + stackSize += validationCommand.stackDelta; + } else if (validationCommand.stackClearing) { + stackSize = 0; + } else if (validationCommand.resetStack) { + stackSize = 0; + state.undefStack = false; + } else if (validationCommand.undefStack) { + stackSize = 0; + state.undefStack = true; + state.firstStackClearing = false; + } + } + } + if (length < data.length) { + data.fill(14, length); + } + state.stackSize = stackSize; + return true; + } + parseCharStrings({ + charStrings, + localSubrIndex, + globalSubrIndex, + fdSelect, + fdArray, + privateDict + }) { + const seacs = []; + const widths = []; + const count = charStrings.count; + for (let i = 0; i < count; i++) { + const charstring = charStrings.get(i); + const state = { + callDepth: 0, + stackSize: 0, + stack: [], + undefStack: true, + hints: 0, + firstStackClearing: true, + seac: null, + width: null, + hasVStems: false + }; + let valid = true; + let localSubrToUse = null; + let privateDictToUse = privateDict; + if (fdSelect && fdArray.length) { + const fdIndex = fdSelect.getFDIndex(i); + if (fdIndex === -1) { + warn("Glyph index is not in fd select."); + valid = false; + } + if (fdIndex >= fdArray.length) { + warn("Invalid fd index for glyph index."); + valid = false; + } + if (valid) { + privateDictToUse = fdArray[fdIndex].privateDict; + localSubrToUse = privateDictToUse.subrsIndex; + } + } else if (localSubrIndex) { + localSubrToUse = localSubrIndex; + } + if (valid) { + valid = this.parseCharString(state, charstring, localSubrToUse, globalSubrIndex); + } + if (state.width !== null) { + const nominalWidth = privateDictToUse.getByName("nominalWidthX"); + widths[i] = nominalWidth + state.width; + } else { + const defaultWidth = privateDictToUse.getByName("defaultWidthX"); + widths[i] = defaultWidth; + } + if (state.seac !== null) { + seacs[i] = state.seac; + } + if (!valid) { + charStrings.set(i, new Uint8Array([14])); + } + } + return { + charStrings, + seacs, + widths + }; + } + emptyPrivateDictionary(parentDict) { + const privateDict = this.createDict(CFFPrivateDict, [], parentDict.strings); + parentDict.setByKey(18, [0, 0]); + parentDict.privateDict = privateDict; + } + parsePrivateDict(parentDict) { + if (!parentDict.hasName("Private")) { + this.emptyPrivateDictionary(parentDict); + return; + } + const privateOffset = parentDict.getByName("Private"); + if (!Array.isArray(privateOffset) || privateOffset.length !== 2) { + parentDict.removeByName("Private"); + return; + } + const size = privateOffset[0]; + const offset = privateOffset[1]; + if (size === 0 || offset >= this.bytes.length) { + this.emptyPrivateDictionary(parentDict); + return; + } + const privateDictEnd = offset + size; + const dictData = this.bytes.subarray(offset, privateDictEnd); + const dict = this.parseDict(dictData); + const privateDict = this.createDict(CFFPrivateDict, dict, parentDict.strings); + parentDict.privateDict = privateDict; + if (privateDict.getByName("ExpansionFactor") === 0) { + privateDict.setByName("ExpansionFactor", 0.06); + } + if (!privateDict.getByName("Subrs")) { + return; + } + const subrsOffset = privateDict.getByName("Subrs"); + const relativeOffset = offset + subrsOffset; + if (subrsOffset === 0 || relativeOffset >= this.bytes.length) { + this.emptyPrivateDictionary(parentDict); + return; + } + const subrsIndex = this.parseIndex(relativeOffset); + privateDict.subrsIndex = subrsIndex.obj; + } + parseCharsets(pos, length, strings, cid) { + if (pos === 0) { + return new CFFCharset(true, CFFCharsetPredefinedTypes.ISO_ADOBE, ISOAdobeCharset); + } else if (pos === 1) { + return new CFFCharset(true, CFFCharsetPredefinedTypes.EXPERT, ExpertCharset); + } else if (pos === 2) { + return new CFFCharset(true, CFFCharsetPredefinedTypes.EXPERT_SUBSET, ExpertSubsetCharset); + } + const bytes = this.bytes; + const start = pos; + const format = bytes[pos++]; + const charset = [cid ? 0 : ".notdef"]; + let id, count, i; + length -= 1; + switch (format) { + case 0: + for (i = 0; i < length; i++) { + id = bytes[pos++] << 8 | bytes[pos++]; + charset.push(cid ? id : strings.get(id)); + } + break; + case 1: + while (charset.length <= length) { + id = bytes[pos++] << 8 | bytes[pos++]; + count = bytes[pos++]; + for (i = 0; i <= count; i++) { + charset.push(cid ? id++ : strings.get(id++)); + } + } + break; + case 2: + while (charset.length <= length) { + id = bytes[pos++] << 8 | bytes[pos++]; + count = bytes[pos++] << 8 | bytes[pos++]; + for (i = 0; i <= count; i++) { + charset.push(cid ? id++ : strings.get(id++)); + } + } + break; + default: + throw new FormatError("Unknown charset format"); + } + const end = pos; + const raw = bytes.subarray(start, end); + return new CFFCharset(false, format, charset, raw); + } + parseEncoding(pos, properties, strings, charset) { + const encoding = Object.create(null); + const bytes = this.bytes; + let predefined = false; + let format, i, ii; + let raw = null; + function readSupplement() { + const supplementsCount = bytes[pos++]; + for (i = 0; i < supplementsCount; i++) { + const code = bytes[pos++]; + const sid = (bytes[pos++] << 8) + (bytes[pos++] & 0xff); + encoding[code] = charset.indexOf(strings.get(sid)); + } + } + if (pos === 0 || pos === 1) { + predefined = true; + format = pos; + const baseEncoding = pos ? ExpertEncoding : StandardEncoding; + for (i = 0, ii = charset.length; i < ii; i++) { + const index = baseEncoding.indexOf(charset[i]); + if (index !== -1) { + encoding[index] = i; + } + } + } else { + const dataStart = pos; + format = bytes[pos++]; + switch (format & 0x7f) { + case 0: + const glyphsCount = bytes[pos++]; + for (i = 1; i <= glyphsCount; i++) { + encoding[bytes[pos++]] = i; + } + break; + case 1: + const rangesCount = bytes[pos++]; + let gid = 1; + for (i = 0; i < rangesCount; i++) { + const start = bytes[pos++]; + const left = bytes[pos++]; + for (let j = start; j <= start + left; j++) { + encoding[j] = gid++; + } + } + break; + default: + throw new FormatError(`Unknown encoding format: ${format} in CFF`); + } + const dataEnd = pos; + if (format & 0x80) { + bytes[dataStart] &= 0x7f; + readSupplement(); + } + raw = bytes.subarray(dataStart, dataEnd); + } + format &= 0x7f; + return new CFFEncoding(predefined, format, encoding, raw); + } + parseFDSelect(pos, length) { + const bytes = this.bytes; + const format = bytes[pos++]; + const fdSelect = []; + let i; + switch (format) { + case 0: + for (i = 0; i < length; ++i) { + const id = bytes[pos++]; + fdSelect.push(id); + } + break; + case 3: + const rangesCount = bytes[pos++] << 8 | bytes[pos++]; + for (i = 0; i < rangesCount; ++i) { + let first = bytes[pos++] << 8 | bytes[pos++]; + if (i === 0 && first !== 0) { + warn("parseFDSelect: The first range must have a first GID of 0" + " -- trying to recover."); + first = 0; + } + const fdIndex = bytes[pos++]; + const next = bytes[pos] << 8 | bytes[pos + 1]; + for (let j = first; j < next; ++j) { + fdSelect.push(fdIndex); + } + } + pos += 2; + break; + default: + throw new FormatError(`parseFDSelect: Unknown format "${format}".`); + } + if (fdSelect.length !== length) { + throw new FormatError("parseFDSelect: Invalid font data."); + } + return new CFFFDSelect(format, fdSelect); + } +} +class CFF { + constructor() { + this.header = null; + this.names = []; + this.topDict = null; + this.strings = new CFFStrings(); + this.globalSubrIndex = null; + this.encoding = null; + this.charset = null; + this.charStrings = null; + this.fdArray = []; + this.fdSelect = null; + this.isCIDFont = false; + } + duplicateFirstGlyph() { + if (this.charStrings.count >= 65535) { + warn("Not enough space in charstrings to duplicate first glyph."); + return; + } + const glyphZero = this.charStrings.get(0); + this.charStrings.add(glyphZero); + if (this.isCIDFont) { + this.fdSelect.fdSelect.push(this.fdSelect.fdSelect[0]); + } + } + hasGlyphId(id) { + if (id < 0 || id >= this.charStrings.count) { + return false; + } + const glyph = this.charStrings.get(id); + return glyph.length > 0; + } +} +class CFFHeader { + constructor(major, minor, hdrSize, offSize) { + this.major = major; + this.minor = minor; + this.hdrSize = hdrSize; + this.offSize = offSize; + } +} +class CFFStrings { + constructor() { + this.strings = []; + } + get(index) { + if (index >= 0 && index <= NUM_STANDARD_CFF_STRINGS - 1) { + return CFFStandardStrings[index]; + } + if (index - NUM_STANDARD_CFF_STRINGS <= this.strings.length) { + return this.strings[index - NUM_STANDARD_CFF_STRINGS]; + } + return CFFStandardStrings[0]; + } + getSID(str) { + let index = CFFStandardStrings.indexOf(str); + if (index !== -1) { + return index; + } + index = this.strings.indexOf(str); + if (index !== -1) { + return index + NUM_STANDARD_CFF_STRINGS; + } + return -1; + } + add(value) { + this.strings.push(value); + } + get count() { + return this.strings.length; + } +} +class CFFIndex { + constructor() { + this.objects = []; + this.length = 0; + } + add(data) { + this.length += data.length; + this.objects.push(data); + } + set(index, data) { + this.length += data.length - this.objects[index].length; + this.objects[index] = data; + } + get(index) { + return this.objects[index]; + } + get count() { + return this.objects.length; + } +} +class CFFDict { + constructor(tables, strings) { + this.keyToNameMap = tables.keyToNameMap; + this.nameToKeyMap = tables.nameToKeyMap; + this.defaults = tables.defaults; + this.types = tables.types; + this.opcodes = tables.opcodes; + this.order = tables.order; + this.strings = strings; + this.values = Object.create(null); + } + setByKey(key, value) { + if (!(key in this.keyToNameMap)) { + return false; + } + if (value.length === 0) { + return true; + } + for (const val of value) { + if (isNaN(val)) { + warn(`Invalid CFFDict value: "${value}" for key "${key}".`); + return true; + } + } + const type = this.types[key]; + if (type === "num" || type === "sid" || type === "offset") { + value = value[0]; + } + this.values[key] = value; + return true; + } + setByName(name, value) { + if (!(name in this.nameToKeyMap)) { + throw new FormatError(`Invalid dictionary name "${name}"`); + } + this.values[this.nameToKeyMap[name]] = value; + } + hasName(name) { + return this.nameToKeyMap[name] in this.values; + } + getByName(name) { + if (!(name in this.nameToKeyMap)) { + throw new FormatError(`Invalid dictionary name ${name}"`); + } + const key = this.nameToKeyMap[name]; + if (!(key in this.values)) { + return this.defaults[key]; + } + return this.values[key]; + } + removeByName(name) { + delete this.values[this.nameToKeyMap[name]]; + } + static createTables(layout) { + const tables = { + keyToNameMap: {}, + nameToKeyMap: {}, + defaults: {}, + types: {}, + opcodes: {}, + order: [] + }; + for (const entry of layout) { + const key = Array.isArray(entry[0]) ? (entry[0][0] << 8) + entry[0][1] : entry[0]; + tables.keyToNameMap[key] = entry[1]; + tables.nameToKeyMap[entry[1]] = key; + tables.types[key] = entry[2]; + tables.defaults[key] = entry[3]; + tables.opcodes[key] = Array.isArray(entry[0]) ? entry[0] : [entry[0]]; + tables.order.push(key); + } + return tables; + } +} +const CFFTopDictLayout = [[[12, 30], "ROS", ["sid", "sid", "num"], null], [[12, 20], "SyntheticBase", "num", null], [0, "version", "sid", null], [1, "Notice", "sid", null], [[12, 0], "Copyright", "sid", null], [2, "FullName", "sid", null], [3, "FamilyName", "sid", null], [4, "Weight", "sid", null], [[12, 1], "isFixedPitch", "num", 0], [[12, 2], "ItalicAngle", "num", 0], [[12, 3], "UnderlinePosition", "num", -100], [[12, 4], "UnderlineThickness", "num", 50], [[12, 5], "PaintType", "num", 0], [[12, 6], "CharstringType", "num", 2], [[12, 7], "FontMatrix", ["num", "num", "num", "num", "num", "num"], [0.001, 0, 0, 0.001, 0, 0]], [13, "UniqueID", "num", null], [5, "FontBBox", ["num", "num", "num", "num"], [0, 0, 0, 0]], [[12, 8], "StrokeWidth", "num", 0], [14, "XUID", "array", null], [15, "charset", "offset", 0], [16, "Encoding", "offset", 0], [17, "CharStrings", "offset", 0], [18, "Private", ["offset", "offset"], null], [[12, 21], "PostScript", "sid", null], [[12, 22], "BaseFontName", "sid", null], [[12, 23], "BaseFontBlend", "delta", null], [[12, 31], "CIDFontVersion", "num", 0], [[12, 32], "CIDFontRevision", "num", 0], [[12, 33], "CIDFontType", "num", 0], [[12, 34], "CIDCount", "num", 8720], [[12, 35], "UIDBase", "num", null], [[12, 37], "FDSelect", "offset", null], [[12, 36], "FDArray", "offset", null], [[12, 38], "FontName", "sid", null]]; +class CFFTopDict extends CFFDict { + static get tables() { + return shadow(this, "tables", this.createTables(CFFTopDictLayout)); + } + constructor(strings) { + super(CFFTopDict.tables, strings); + this.privateDict = null; + } +} +const CFFPrivateDictLayout = [[6, "BlueValues", "delta", null], [7, "OtherBlues", "delta", null], [8, "FamilyBlues", "delta", null], [9, "FamilyOtherBlues", "delta", null], [[12, 9], "BlueScale", "num", 0.039625], [[12, 10], "BlueShift", "num", 7], [[12, 11], "BlueFuzz", "num", 1], [10, "StdHW", "num", null], [11, "StdVW", "num", null], [[12, 12], "StemSnapH", "delta", null], [[12, 13], "StemSnapV", "delta", null], [[12, 14], "ForceBold", "num", 0], [[12, 17], "LanguageGroup", "num", 0], [[12, 18], "ExpansionFactor", "num", 0.06], [[12, 19], "initialRandomSeed", "num", 0], [20, "defaultWidthX", "num", 0], [21, "nominalWidthX", "num", 0], [19, "Subrs", "offset", null]]; +class CFFPrivateDict extends CFFDict { + static get tables() { + return shadow(this, "tables", this.createTables(CFFPrivateDictLayout)); + } + constructor(strings) { + super(CFFPrivateDict.tables, strings); + this.subrsIndex = null; + } +} +const CFFCharsetPredefinedTypes = { + ISO_ADOBE: 0, + EXPERT: 1, + EXPERT_SUBSET: 2 +}; +class CFFCharset { + constructor(predefined, format, charset, raw) { + this.predefined = predefined; + this.format = format; + this.charset = charset; + this.raw = raw; + } +} +class CFFEncoding { + constructor(predefined, format, encoding, raw) { + this.predefined = predefined; + this.format = format; + this.encoding = encoding; + this.raw = raw; + } +} +class CFFFDSelect { + constructor(format, fdSelect) { + this.format = format; + this.fdSelect = fdSelect; + } + getFDIndex(glyphIndex) { + if (glyphIndex < 0 || glyphIndex >= this.fdSelect.length) { + return -1; + } + return this.fdSelect[glyphIndex]; + } +} +class CFFOffsetTracker { + constructor() { + this.offsets = Object.create(null); + } + isTracking(key) { + return key in this.offsets; + } + track(key, location) { + if (key in this.offsets) { + throw new FormatError(`Already tracking location of ${key}`); + } + this.offsets[key] = location; + } + offset(value) { + for (const key in this.offsets) { + this.offsets[key] += value; + } + } + setEntryLocation(key, values, output) { + if (!(key in this.offsets)) { + throw new FormatError(`Not tracking location of ${key}`); + } + const data = output.data; + const dataOffset = this.offsets[key]; + const size = 5; + for (let i = 0, ii = values.length; i < ii; ++i) { + const offset0 = i * size + dataOffset; + const offset1 = offset0 + 1; + const offset2 = offset0 + 2; + const offset3 = offset0 + 3; + const offset4 = offset0 + 4; + if (data[offset0] !== 0x1d || data[offset1] !== 0 || data[offset2] !== 0 || data[offset3] !== 0 || data[offset4] !== 0) { + throw new FormatError("writing to an offset that is not empty"); + } + const value = values[i]; + data[offset0] = 0x1d; + data[offset1] = value >> 24 & 0xff; + data[offset2] = value >> 16 & 0xff; + data[offset3] = value >> 8 & 0xff; + data[offset4] = value & 0xff; + } + } +} +class CFFCompiler { + constructor(cff) { + this.cff = cff; + } + compile() { + const cff = this.cff; + const output = { + data: [], + length: 0, + add(data) { + try { + this.data.push(...data); + } catch { + this.data = this.data.concat(data); + } + this.length = this.data.length; + } + }; + const header = this.compileHeader(cff.header); + output.add(header); + const nameIndex = this.compileNameIndex(cff.names); + output.add(nameIndex); + if (cff.isCIDFont) { + if (cff.topDict.hasName("FontMatrix")) { + const base = cff.topDict.getByName("FontMatrix"); + cff.topDict.removeByName("FontMatrix"); + for (const subDict of cff.fdArray) { + let matrix = base.slice(0); + if (subDict.hasName("FontMatrix")) { + matrix = Util.transform(matrix, subDict.getByName("FontMatrix")); + } + subDict.setByName("FontMatrix", matrix); + } + } + } + const xuid = cff.topDict.getByName("XUID"); + if (xuid?.length > 16) { + cff.topDict.removeByName("XUID"); + } + cff.topDict.setByName("charset", 0); + let compiled = this.compileTopDicts([cff.topDict], output.length, cff.isCIDFont); + output.add(compiled.output); + const topDictTracker = compiled.trackers[0]; + const stringIndex = this.compileStringIndex(cff.strings.strings); + output.add(stringIndex); + const globalSubrIndex = this.compileIndex(cff.globalSubrIndex); + output.add(globalSubrIndex); + if (cff.encoding && cff.topDict.hasName("Encoding")) { + if (cff.encoding.predefined) { + topDictTracker.setEntryLocation("Encoding", [cff.encoding.format], output); + } else { + const encoding = this.compileEncoding(cff.encoding); + topDictTracker.setEntryLocation("Encoding", [output.length], output); + output.add(encoding); + } + } + const charset = this.compileCharset(cff.charset, cff.charStrings.count, cff.strings, cff.isCIDFont); + topDictTracker.setEntryLocation("charset", [output.length], output); + output.add(charset); + const charStrings = this.compileCharStrings(cff.charStrings); + topDictTracker.setEntryLocation("CharStrings", [output.length], output); + output.add(charStrings); + if (cff.isCIDFont) { + topDictTracker.setEntryLocation("FDSelect", [output.length], output); + const fdSelect = this.compileFDSelect(cff.fdSelect); + output.add(fdSelect); + compiled = this.compileTopDicts(cff.fdArray, output.length, true); + topDictTracker.setEntryLocation("FDArray", [output.length], output); + output.add(compiled.output); + const fontDictTrackers = compiled.trackers; + this.compilePrivateDicts(cff.fdArray, fontDictTrackers, output); + } + this.compilePrivateDicts([cff.topDict], [topDictTracker], output); + output.add([0]); + return output.data; + } + encodeNumber(value) { + if (Number.isInteger(value)) { + return this.encodeInteger(value); + } + return this.encodeFloat(value); + } + static get EncodeFloatRegExp() { + return shadow(this, "EncodeFloatRegExp", /\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/); + } + encodeFloat(num) { + let value = num.toString(); + const m = CFFCompiler.EncodeFloatRegExp.exec(value); + if (m) { + const epsilon = parseFloat("1e" + ((m[2] ? +m[2] : 0) + m[1].length)); + value = (Math.round(num * epsilon) / epsilon).toString(); + } + let nibbles = ""; + let i, ii; + for (i = 0, ii = value.length; i < ii; ++i) { + const a = value[i]; + if (a === "e") { + nibbles += value[++i] === "-" ? "c" : "b"; + } else if (a === ".") { + nibbles += "a"; + } else if (a === "-") { + nibbles += "e"; + } else { + nibbles += a; + } + } + nibbles += nibbles.length & 1 ? "f" : "ff"; + const out = [30]; + for (i = 0, ii = nibbles.length; i < ii; i += 2) { + out.push(parseInt(nibbles.substring(i, i + 2), 16)); + } + return out; + } + encodeInteger(value) { + let code; + if (value >= -107 && value <= 107) { + code = [value + 139]; + } else if (value >= 108 && value <= 1131) { + value -= 108; + code = [(value >> 8) + 247, value & 0xff]; + } else if (value >= -1131 && value <= -108) { + value = -value - 108; + code = [(value >> 8) + 251, value & 0xff]; + } else if (value >= -32768 && value <= 32767) { + code = [0x1c, value >> 8 & 0xff, value & 0xff]; + } else { + code = [0x1d, value >> 24 & 0xff, value >> 16 & 0xff, value >> 8 & 0xff, value & 0xff]; + } + return code; + } + compileHeader(header) { + return [header.major, header.minor, 4, header.offSize]; + } + compileNameIndex(names) { + const nameIndex = new CFFIndex(); + for (const name of names) { + const length = Math.min(name.length, 127); + let sanitizedName = new Array(length); + for (let j = 0; j < length; j++) { + let char = name[j]; + if (char < "!" || char > "~" || char === "[" || char === "]" || char === "(" || char === ")" || char === "{" || char === "}" || char === "<" || char === ">" || char === "/" || char === "%") { + char = "_"; + } + sanitizedName[j] = char; + } + sanitizedName = sanitizedName.join(""); + if (sanitizedName === "") { + sanitizedName = "Bad_Font_Name"; + } + nameIndex.add(stringToBytes(sanitizedName)); + } + return this.compileIndex(nameIndex); + } + compileTopDicts(dicts, length, removeCidKeys) { + const fontDictTrackers = []; + let fdArrayIndex = new CFFIndex(); + for (const fontDict of dicts) { + if (removeCidKeys) { + fontDict.removeByName("CIDFontVersion"); + fontDict.removeByName("CIDFontRevision"); + fontDict.removeByName("CIDFontType"); + fontDict.removeByName("CIDCount"); + fontDict.removeByName("UIDBase"); + } + const fontDictTracker = new CFFOffsetTracker(); + const fontDictData = this.compileDict(fontDict, fontDictTracker); + fontDictTrackers.push(fontDictTracker); + fdArrayIndex.add(fontDictData); + fontDictTracker.offset(length); + } + fdArrayIndex = this.compileIndex(fdArrayIndex, fontDictTrackers); + return { + trackers: fontDictTrackers, + output: fdArrayIndex + }; + } + compilePrivateDicts(dicts, trackers, output) { + for (let i = 0, ii = dicts.length; i < ii; ++i) { + const fontDict = dicts[i]; + const privateDict = fontDict.privateDict; + if (!privateDict || !fontDict.hasName("Private")) { + throw new FormatError("There must be a private dictionary."); + } + const privateDictTracker = new CFFOffsetTracker(); + const privateDictData = this.compileDict(privateDict, privateDictTracker); + let outputLength = output.length; + privateDictTracker.offset(outputLength); + if (!privateDictData.length) { + outputLength = 0; + } + trackers[i].setEntryLocation("Private", [privateDictData.length, outputLength], output); + output.add(privateDictData); + if (privateDict.subrsIndex && privateDict.hasName("Subrs")) { + const subrs = this.compileIndex(privateDict.subrsIndex); + privateDictTracker.setEntryLocation("Subrs", [privateDictData.length], output); + output.add(subrs); + } + } + } + compileDict(dict, offsetTracker) { + const out = []; + for (const key of dict.order) { + if (!(key in dict.values)) { + continue; + } + let values = dict.values[key]; + let types = dict.types[key]; + if (!Array.isArray(types)) { + types = [types]; + } + if (!Array.isArray(values)) { + values = [values]; + } + if (values.length === 0) { + continue; + } + for (let j = 0, jj = types.length; j < jj; ++j) { + const type = types[j]; + const value = values[j]; + switch (type) { + case "num": + case "sid": + out.push(...this.encodeNumber(value)); + break; + case "offset": + const name = dict.keyToNameMap[key]; + if (!offsetTracker.isTracking(name)) { + offsetTracker.track(name, out.length); + } + out.push(0x1d, 0, 0, 0, 0); + break; + case "array": + case "delta": + out.push(...this.encodeNumber(value)); + for (let k = 1, kk = values.length; k < kk; ++k) { + out.push(...this.encodeNumber(values[k])); + } + break; + default: + throw new FormatError(`Unknown data type of ${type}`); + } + } + out.push(...dict.opcodes[key]); + } + return out; + } + compileStringIndex(strings) { + const stringIndex = new CFFIndex(); + for (const string of strings) { + stringIndex.add(stringToBytes(string)); + } + return this.compileIndex(stringIndex); + } + compileCharStrings(charStrings) { + const charStringsIndex = new CFFIndex(); + for (let i = 0; i < charStrings.count; i++) { + const glyph = charStrings.get(i); + if (glyph.length === 0) { + charStringsIndex.add(new Uint8Array([0x8b, 0x0e])); + continue; + } + charStringsIndex.add(glyph); + } + return this.compileIndex(charStringsIndex); + } + compileCharset(charset, numGlyphs, strings, isCIDFont) { + let out; + const numGlyphsLessNotDef = numGlyphs - 1; + if (isCIDFont) { + out = new Uint8Array([2, 0, 0, numGlyphsLessNotDef >> 8 & 0xff, numGlyphsLessNotDef & 0xff]); + } else { + const length = 1 + numGlyphsLessNotDef * 2; + out = new Uint8Array(length); + out[0] = 0; + let charsetIndex = 0; + const numCharsets = charset.charset.length; + let warned = false; + for (let i = 1; i < out.length; i += 2) { + let sid = 0; + if (charsetIndex < numCharsets) { + const name = charset.charset[charsetIndex++]; + sid = strings.getSID(name); + if (sid === -1) { + sid = 0; + if (!warned) { + warned = true; + warn(`Couldn't find ${name} in CFF strings`); + } + } + } + out[i] = sid >> 8 & 0xff; + out[i + 1] = sid & 0xff; + } + } + return this.compileTypedArray(out); + } + compileEncoding(encoding) { + return this.compileTypedArray(encoding.raw); + } + compileFDSelect(fdSelect) { + const format = fdSelect.format; + let out, i; + switch (format) { + case 0: + out = new Uint8Array(1 + fdSelect.fdSelect.length); + out[0] = format; + for (i = 0; i < fdSelect.fdSelect.length; i++) { + out[i + 1] = fdSelect.fdSelect[i]; + } + break; + case 3: + const start = 0; + let lastFD = fdSelect.fdSelect[0]; + const ranges = [format, 0, 0, start >> 8 & 0xff, start & 0xff, lastFD]; + for (i = 1; i < fdSelect.fdSelect.length; i++) { + const currentFD = fdSelect.fdSelect[i]; + if (currentFD !== lastFD) { + ranges.push(i >> 8 & 0xff, i & 0xff, currentFD); + lastFD = currentFD; + } + } + const numRanges = (ranges.length - 3) / 3; + ranges[1] = numRanges >> 8 & 0xff; + ranges[2] = numRanges & 0xff; + ranges.push(i >> 8 & 0xff, i & 0xff); + out = new Uint8Array(ranges); + break; + } + return this.compileTypedArray(out); + } + compileTypedArray(data) { + return Array.from(data); + } + compileIndex(index, trackers = []) { + const objects = index.objects; + const count = objects.length; + if (count === 0) { + return [0, 0]; + } + const data = [count >> 8 & 0xff, count & 0xff]; + let lastOffset = 1, + i; + for (i = 0; i < count; ++i) { + lastOffset += objects[i].length; + } + let offsetSize; + if (lastOffset < 0x100) { + offsetSize = 1; + } else if (lastOffset < 0x10000) { + offsetSize = 2; + } else if (lastOffset < 0x1000000) { + offsetSize = 3; + } else { + offsetSize = 4; + } + data.push(offsetSize); + let relativeOffset = 1; + for (i = 0; i < count + 1; i++) { + if (offsetSize === 1) { + data.push(relativeOffset & 0xff); + } else if (offsetSize === 2) { + data.push(relativeOffset >> 8 & 0xff, relativeOffset & 0xff); + } else if (offsetSize === 3) { + data.push(relativeOffset >> 16 & 0xff, relativeOffset >> 8 & 0xff, relativeOffset & 0xff); + } else { + data.push(relativeOffset >>> 24 & 0xff, relativeOffset >> 16 & 0xff, relativeOffset >> 8 & 0xff, relativeOffset & 0xff); + } + if (objects[i]) { + relativeOffset += objects[i].length; + } + } + for (i = 0; i < count; i++) { + if (trackers[i]) { + trackers[i].offset(data.length); + } + data.push(...objects[i]); + } + return data; + } +} + +;// ./src/core/glyphlist.js + +const getGlyphsUnicode = getLookupTableFactory(function (t) { + t.A = 0x0041; + t.AE = 0x00c6; + t.AEacute = 0x01fc; + t.AEmacron = 0x01e2; + t.AEsmall = 0xf7e6; + t.Aacute = 0x00c1; + t.Aacutesmall = 0xf7e1; + t.Abreve = 0x0102; + t.Abreveacute = 0x1eae; + t.Abrevecyrillic = 0x04d0; + t.Abrevedotbelow = 0x1eb6; + t.Abrevegrave = 0x1eb0; + t.Abrevehookabove = 0x1eb2; + t.Abrevetilde = 0x1eb4; + t.Acaron = 0x01cd; + t.Acircle = 0x24b6; + t.Acircumflex = 0x00c2; + t.Acircumflexacute = 0x1ea4; + t.Acircumflexdotbelow = 0x1eac; + t.Acircumflexgrave = 0x1ea6; + t.Acircumflexhookabove = 0x1ea8; + t.Acircumflexsmall = 0xf7e2; + t.Acircumflextilde = 0x1eaa; + t.Acute = 0xf6c9; + t.Acutesmall = 0xf7b4; + t.Acyrillic = 0x0410; + t.Adblgrave = 0x0200; + t.Adieresis = 0x00c4; + t.Adieresiscyrillic = 0x04d2; + t.Adieresismacron = 0x01de; + t.Adieresissmall = 0xf7e4; + t.Adotbelow = 0x1ea0; + t.Adotmacron = 0x01e0; + t.Agrave = 0x00c0; + t.Agravesmall = 0xf7e0; + t.Ahookabove = 0x1ea2; + t.Aiecyrillic = 0x04d4; + t.Ainvertedbreve = 0x0202; + t.Alpha = 0x0391; + t.Alphatonos = 0x0386; + t.Amacron = 0x0100; + t.Amonospace = 0xff21; + t.Aogonek = 0x0104; + t.Aring = 0x00c5; + t.Aringacute = 0x01fa; + t.Aringbelow = 0x1e00; + t.Aringsmall = 0xf7e5; + t.Asmall = 0xf761; + t.Atilde = 0x00c3; + t.Atildesmall = 0xf7e3; + t.Aybarmenian = 0x0531; + t.B = 0x0042; + t.Bcircle = 0x24b7; + t.Bdotaccent = 0x1e02; + t.Bdotbelow = 0x1e04; + t.Becyrillic = 0x0411; + t.Benarmenian = 0x0532; + t.Beta = 0x0392; + t.Bhook = 0x0181; + t.Blinebelow = 0x1e06; + t.Bmonospace = 0xff22; + t.Brevesmall = 0xf6f4; + t.Bsmall = 0xf762; + t.Btopbar = 0x0182; + t.C = 0x0043; + t.Caarmenian = 0x053e; + t.Cacute = 0x0106; + t.Caron = 0xf6ca; + t.Caronsmall = 0xf6f5; + t.Ccaron = 0x010c; + t.Ccedilla = 0x00c7; + t.Ccedillaacute = 0x1e08; + t.Ccedillasmall = 0xf7e7; + t.Ccircle = 0x24b8; + t.Ccircumflex = 0x0108; + t.Cdot = 0x010a; + t.Cdotaccent = 0x010a; + t.Cedillasmall = 0xf7b8; + t.Chaarmenian = 0x0549; + t.Cheabkhasiancyrillic = 0x04bc; + t.Checyrillic = 0x0427; + t.Chedescenderabkhasiancyrillic = 0x04be; + t.Chedescendercyrillic = 0x04b6; + t.Chedieresiscyrillic = 0x04f4; + t.Cheharmenian = 0x0543; + t.Chekhakassiancyrillic = 0x04cb; + t.Cheverticalstrokecyrillic = 0x04b8; + t.Chi = 0x03a7; + t.Chook = 0x0187; + t.Circumflexsmall = 0xf6f6; + t.Cmonospace = 0xff23; + t.Coarmenian = 0x0551; + t.Csmall = 0xf763; + t.D = 0x0044; + t.DZ = 0x01f1; + t.DZcaron = 0x01c4; + t.Daarmenian = 0x0534; + t.Dafrican = 0x0189; + t.Dcaron = 0x010e; + t.Dcedilla = 0x1e10; + t.Dcircle = 0x24b9; + t.Dcircumflexbelow = 0x1e12; + t.Dcroat = 0x0110; + t.Ddotaccent = 0x1e0a; + t.Ddotbelow = 0x1e0c; + t.Decyrillic = 0x0414; + t.Deicoptic = 0x03ee; + t.Delta = 0x2206; + t.Deltagreek = 0x0394; + t.Dhook = 0x018a; + t.Dieresis = 0xf6cb; + t.DieresisAcute = 0xf6cc; + t.DieresisGrave = 0xf6cd; + t.Dieresissmall = 0xf7a8; + t.Digammagreek = 0x03dc; + t.Djecyrillic = 0x0402; + t.Dlinebelow = 0x1e0e; + t.Dmonospace = 0xff24; + t.Dotaccentsmall = 0xf6f7; + t.Dslash = 0x0110; + t.Dsmall = 0xf764; + t.Dtopbar = 0x018b; + t.Dz = 0x01f2; + t.Dzcaron = 0x01c5; + t.Dzeabkhasiancyrillic = 0x04e0; + t.Dzecyrillic = 0x0405; + t.Dzhecyrillic = 0x040f; + t.E = 0x0045; + t.Eacute = 0x00c9; + t.Eacutesmall = 0xf7e9; + t.Ebreve = 0x0114; + t.Ecaron = 0x011a; + t.Ecedillabreve = 0x1e1c; + t.Echarmenian = 0x0535; + t.Ecircle = 0x24ba; + t.Ecircumflex = 0x00ca; + t.Ecircumflexacute = 0x1ebe; + t.Ecircumflexbelow = 0x1e18; + t.Ecircumflexdotbelow = 0x1ec6; + t.Ecircumflexgrave = 0x1ec0; + t.Ecircumflexhookabove = 0x1ec2; + t.Ecircumflexsmall = 0xf7ea; + t.Ecircumflextilde = 0x1ec4; + t.Ecyrillic = 0x0404; + t.Edblgrave = 0x0204; + t.Edieresis = 0x00cb; + t.Edieresissmall = 0xf7eb; + t.Edot = 0x0116; + t.Edotaccent = 0x0116; + t.Edotbelow = 0x1eb8; + t.Efcyrillic = 0x0424; + t.Egrave = 0x00c8; + t.Egravesmall = 0xf7e8; + t.Eharmenian = 0x0537; + t.Ehookabove = 0x1eba; + t.Eightroman = 0x2167; + t.Einvertedbreve = 0x0206; + t.Eiotifiedcyrillic = 0x0464; + t.Elcyrillic = 0x041b; + t.Elevenroman = 0x216a; + t.Emacron = 0x0112; + t.Emacronacute = 0x1e16; + t.Emacrongrave = 0x1e14; + t.Emcyrillic = 0x041c; + t.Emonospace = 0xff25; + t.Encyrillic = 0x041d; + t.Endescendercyrillic = 0x04a2; + t.Eng = 0x014a; + t.Enghecyrillic = 0x04a4; + t.Enhookcyrillic = 0x04c7; + t.Eogonek = 0x0118; + t.Eopen = 0x0190; + t.Epsilon = 0x0395; + t.Epsilontonos = 0x0388; + t.Ercyrillic = 0x0420; + t.Ereversed = 0x018e; + t.Ereversedcyrillic = 0x042d; + t.Escyrillic = 0x0421; + t.Esdescendercyrillic = 0x04aa; + t.Esh = 0x01a9; + t.Esmall = 0xf765; + t.Eta = 0x0397; + t.Etarmenian = 0x0538; + t.Etatonos = 0x0389; + t.Eth = 0x00d0; + t.Ethsmall = 0xf7f0; + t.Etilde = 0x1ebc; + t.Etildebelow = 0x1e1a; + t.Euro = 0x20ac; + t.Ezh = 0x01b7; + t.Ezhcaron = 0x01ee; + t.Ezhreversed = 0x01b8; + t.F = 0x0046; + t.Fcircle = 0x24bb; + t.Fdotaccent = 0x1e1e; + t.Feharmenian = 0x0556; + t.Feicoptic = 0x03e4; + t.Fhook = 0x0191; + t.Fitacyrillic = 0x0472; + t.Fiveroman = 0x2164; + t.Fmonospace = 0xff26; + t.Fourroman = 0x2163; + t.Fsmall = 0xf766; + t.G = 0x0047; + t.GBsquare = 0x3387; + t.Gacute = 0x01f4; + t.Gamma = 0x0393; + t.Gammaafrican = 0x0194; + t.Gangiacoptic = 0x03ea; + t.Gbreve = 0x011e; + t.Gcaron = 0x01e6; + t.Gcedilla = 0x0122; + t.Gcircle = 0x24bc; + t.Gcircumflex = 0x011c; + t.Gcommaaccent = 0x0122; + t.Gdot = 0x0120; + t.Gdotaccent = 0x0120; + t.Gecyrillic = 0x0413; + t.Ghadarmenian = 0x0542; + t.Ghemiddlehookcyrillic = 0x0494; + t.Ghestrokecyrillic = 0x0492; + t.Gheupturncyrillic = 0x0490; + t.Ghook = 0x0193; + t.Gimarmenian = 0x0533; + t.Gjecyrillic = 0x0403; + t.Gmacron = 0x1e20; + t.Gmonospace = 0xff27; + t.Grave = 0xf6ce; + t.Gravesmall = 0xf760; + t.Gsmall = 0xf767; + t.Gsmallhook = 0x029b; + t.Gstroke = 0x01e4; + t.H = 0x0048; + t.H18533 = 0x25cf; + t.H18543 = 0x25aa; + t.H18551 = 0x25ab; + t.H22073 = 0x25a1; + t.HPsquare = 0x33cb; + t.Haabkhasiancyrillic = 0x04a8; + t.Hadescendercyrillic = 0x04b2; + t.Hardsigncyrillic = 0x042a; + t.Hbar = 0x0126; + t.Hbrevebelow = 0x1e2a; + t.Hcedilla = 0x1e28; + t.Hcircle = 0x24bd; + t.Hcircumflex = 0x0124; + t.Hdieresis = 0x1e26; + t.Hdotaccent = 0x1e22; + t.Hdotbelow = 0x1e24; + t.Hmonospace = 0xff28; + t.Hoarmenian = 0x0540; + t.Horicoptic = 0x03e8; + t.Hsmall = 0xf768; + t.Hungarumlaut = 0xf6cf; + t.Hungarumlautsmall = 0xf6f8; + t.Hzsquare = 0x3390; + t.I = 0x0049; + t.IAcyrillic = 0x042f; + t.IJ = 0x0132; + t.IUcyrillic = 0x042e; + t.Iacute = 0x00cd; + t.Iacutesmall = 0xf7ed; + t.Ibreve = 0x012c; + t.Icaron = 0x01cf; + t.Icircle = 0x24be; + t.Icircumflex = 0x00ce; + t.Icircumflexsmall = 0xf7ee; + t.Icyrillic = 0x0406; + t.Idblgrave = 0x0208; + t.Idieresis = 0x00cf; + t.Idieresisacute = 0x1e2e; + t.Idieresiscyrillic = 0x04e4; + t.Idieresissmall = 0xf7ef; + t.Idot = 0x0130; + t.Idotaccent = 0x0130; + t.Idotbelow = 0x1eca; + t.Iebrevecyrillic = 0x04d6; + t.Iecyrillic = 0x0415; + t.Ifraktur = 0x2111; + t.Igrave = 0x00cc; + t.Igravesmall = 0xf7ec; + t.Ihookabove = 0x1ec8; + t.Iicyrillic = 0x0418; + t.Iinvertedbreve = 0x020a; + t.Iishortcyrillic = 0x0419; + t.Imacron = 0x012a; + t.Imacroncyrillic = 0x04e2; + t.Imonospace = 0xff29; + t.Iniarmenian = 0x053b; + t.Iocyrillic = 0x0401; + t.Iogonek = 0x012e; + t.Iota = 0x0399; + t.Iotaafrican = 0x0196; + t.Iotadieresis = 0x03aa; + t.Iotatonos = 0x038a; + t.Ismall = 0xf769; + t.Istroke = 0x0197; + t.Itilde = 0x0128; + t.Itildebelow = 0x1e2c; + t.Izhitsacyrillic = 0x0474; + t.Izhitsadblgravecyrillic = 0x0476; + t.J = 0x004a; + t.Jaarmenian = 0x0541; + t.Jcircle = 0x24bf; + t.Jcircumflex = 0x0134; + t.Jecyrillic = 0x0408; + t.Jheharmenian = 0x054b; + t.Jmonospace = 0xff2a; + t.Jsmall = 0xf76a; + t.K = 0x004b; + t.KBsquare = 0x3385; + t.KKsquare = 0x33cd; + t.Kabashkircyrillic = 0x04a0; + t.Kacute = 0x1e30; + t.Kacyrillic = 0x041a; + t.Kadescendercyrillic = 0x049a; + t.Kahookcyrillic = 0x04c3; + t.Kappa = 0x039a; + t.Kastrokecyrillic = 0x049e; + t.Kaverticalstrokecyrillic = 0x049c; + t.Kcaron = 0x01e8; + t.Kcedilla = 0x0136; + t.Kcircle = 0x24c0; + t.Kcommaaccent = 0x0136; + t.Kdotbelow = 0x1e32; + t.Keharmenian = 0x0554; + t.Kenarmenian = 0x053f; + t.Khacyrillic = 0x0425; + t.Kheicoptic = 0x03e6; + t.Khook = 0x0198; + t.Kjecyrillic = 0x040c; + t.Klinebelow = 0x1e34; + t.Kmonospace = 0xff2b; + t.Koppacyrillic = 0x0480; + t.Koppagreek = 0x03de; + t.Ksicyrillic = 0x046e; + t.Ksmall = 0xf76b; + t.L = 0x004c; + t.LJ = 0x01c7; + t.LL = 0xf6bf; + t.Lacute = 0x0139; + t.Lambda = 0x039b; + t.Lcaron = 0x013d; + t.Lcedilla = 0x013b; + t.Lcircle = 0x24c1; + t.Lcircumflexbelow = 0x1e3c; + t.Lcommaaccent = 0x013b; + t.Ldot = 0x013f; + t.Ldotaccent = 0x013f; + t.Ldotbelow = 0x1e36; + t.Ldotbelowmacron = 0x1e38; + t.Liwnarmenian = 0x053c; + t.Lj = 0x01c8; + t.Ljecyrillic = 0x0409; + t.Llinebelow = 0x1e3a; + t.Lmonospace = 0xff2c; + t.Lslash = 0x0141; + t.Lslashsmall = 0xf6f9; + t.Lsmall = 0xf76c; + t.M = 0x004d; + t.MBsquare = 0x3386; + t.Macron = 0xf6d0; + t.Macronsmall = 0xf7af; + t.Macute = 0x1e3e; + t.Mcircle = 0x24c2; + t.Mdotaccent = 0x1e40; + t.Mdotbelow = 0x1e42; + t.Menarmenian = 0x0544; + t.Mmonospace = 0xff2d; + t.Msmall = 0xf76d; + t.Mturned = 0x019c; + t.Mu = 0x039c; + t.N = 0x004e; + t.NJ = 0x01ca; + t.Nacute = 0x0143; + t.Ncaron = 0x0147; + t.Ncedilla = 0x0145; + t.Ncircle = 0x24c3; + t.Ncircumflexbelow = 0x1e4a; + t.Ncommaaccent = 0x0145; + t.Ndotaccent = 0x1e44; + t.Ndotbelow = 0x1e46; + t.Nhookleft = 0x019d; + t.Nineroman = 0x2168; + t.Nj = 0x01cb; + t.Njecyrillic = 0x040a; + t.Nlinebelow = 0x1e48; + t.Nmonospace = 0xff2e; + t.Nowarmenian = 0x0546; + t.Nsmall = 0xf76e; + t.Ntilde = 0x00d1; + t.Ntildesmall = 0xf7f1; + t.Nu = 0x039d; + t.O = 0x004f; + t.OE = 0x0152; + t.OEsmall = 0xf6fa; + t.Oacute = 0x00d3; + t.Oacutesmall = 0xf7f3; + t.Obarredcyrillic = 0x04e8; + t.Obarreddieresiscyrillic = 0x04ea; + t.Obreve = 0x014e; + t.Ocaron = 0x01d1; + t.Ocenteredtilde = 0x019f; + t.Ocircle = 0x24c4; + t.Ocircumflex = 0x00d4; + t.Ocircumflexacute = 0x1ed0; + t.Ocircumflexdotbelow = 0x1ed8; + t.Ocircumflexgrave = 0x1ed2; + t.Ocircumflexhookabove = 0x1ed4; + t.Ocircumflexsmall = 0xf7f4; + t.Ocircumflextilde = 0x1ed6; + t.Ocyrillic = 0x041e; + t.Odblacute = 0x0150; + t.Odblgrave = 0x020c; + t.Odieresis = 0x00d6; + t.Odieresiscyrillic = 0x04e6; + t.Odieresissmall = 0xf7f6; + t.Odotbelow = 0x1ecc; + t.Ogoneksmall = 0xf6fb; + t.Ograve = 0x00d2; + t.Ogravesmall = 0xf7f2; + t.Oharmenian = 0x0555; + t.Ohm = 0x2126; + t.Ohookabove = 0x1ece; + t.Ohorn = 0x01a0; + t.Ohornacute = 0x1eda; + t.Ohorndotbelow = 0x1ee2; + t.Ohorngrave = 0x1edc; + t.Ohornhookabove = 0x1ede; + t.Ohorntilde = 0x1ee0; + t.Ohungarumlaut = 0x0150; + t.Oi = 0x01a2; + t.Oinvertedbreve = 0x020e; + t.Omacron = 0x014c; + t.Omacronacute = 0x1e52; + t.Omacrongrave = 0x1e50; + t.Omega = 0x2126; + t.Omegacyrillic = 0x0460; + t.Omegagreek = 0x03a9; + t.Omegaroundcyrillic = 0x047a; + t.Omegatitlocyrillic = 0x047c; + t.Omegatonos = 0x038f; + t.Omicron = 0x039f; + t.Omicrontonos = 0x038c; + t.Omonospace = 0xff2f; + t.Oneroman = 0x2160; + t.Oogonek = 0x01ea; + t.Oogonekmacron = 0x01ec; + t.Oopen = 0x0186; + t.Oslash = 0x00d8; + t.Oslashacute = 0x01fe; + t.Oslashsmall = 0xf7f8; + t.Osmall = 0xf76f; + t.Ostrokeacute = 0x01fe; + t.Otcyrillic = 0x047e; + t.Otilde = 0x00d5; + t.Otildeacute = 0x1e4c; + t.Otildedieresis = 0x1e4e; + t.Otildesmall = 0xf7f5; + t.P = 0x0050; + t.Pacute = 0x1e54; + t.Pcircle = 0x24c5; + t.Pdotaccent = 0x1e56; + t.Pecyrillic = 0x041f; + t.Peharmenian = 0x054a; + t.Pemiddlehookcyrillic = 0x04a6; + t.Phi = 0x03a6; + t.Phook = 0x01a4; + t.Pi = 0x03a0; + t.Piwrarmenian = 0x0553; + t.Pmonospace = 0xff30; + t.Psi = 0x03a8; + t.Psicyrillic = 0x0470; + t.Psmall = 0xf770; + t.Q = 0x0051; + t.Qcircle = 0x24c6; + t.Qmonospace = 0xff31; + t.Qsmall = 0xf771; + t.R = 0x0052; + t.Raarmenian = 0x054c; + t.Racute = 0x0154; + t.Rcaron = 0x0158; + t.Rcedilla = 0x0156; + t.Rcircle = 0x24c7; + t.Rcommaaccent = 0x0156; + t.Rdblgrave = 0x0210; + t.Rdotaccent = 0x1e58; + t.Rdotbelow = 0x1e5a; + t.Rdotbelowmacron = 0x1e5c; + t.Reharmenian = 0x0550; + t.Rfraktur = 0x211c; + t.Rho = 0x03a1; + t.Ringsmall = 0xf6fc; + t.Rinvertedbreve = 0x0212; + t.Rlinebelow = 0x1e5e; + t.Rmonospace = 0xff32; + t.Rsmall = 0xf772; + t.Rsmallinverted = 0x0281; + t.Rsmallinvertedsuperior = 0x02b6; + t.S = 0x0053; + t.SF010000 = 0x250c; + t.SF020000 = 0x2514; + t.SF030000 = 0x2510; + t.SF040000 = 0x2518; + t.SF050000 = 0x253c; + t.SF060000 = 0x252c; + t.SF070000 = 0x2534; + t.SF080000 = 0x251c; + t.SF090000 = 0x2524; + t.SF100000 = 0x2500; + t.SF110000 = 0x2502; + t.SF190000 = 0x2561; + t.SF200000 = 0x2562; + t.SF210000 = 0x2556; + t.SF220000 = 0x2555; + t.SF230000 = 0x2563; + t.SF240000 = 0x2551; + t.SF250000 = 0x2557; + t.SF260000 = 0x255d; + t.SF270000 = 0x255c; + t.SF280000 = 0x255b; + t.SF360000 = 0x255e; + t.SF370000 = 0x255f; + t.SF380000 = 0x255a; + t.SF390000 = 0x2554; + t.SF400000 = 0x2569; + t.SF410000 = 0x2566; + t.SF420000 = 0x2560; + t.SF430000 = 0x2550; + t.SF440000 = 0x256c; + t.SF450000 = 0x2567; + t.SF460000 = 0x2568; + t.SF470000 = 0x2564; + t.SF480000 = 0x2565; + t.SF490000 = 0x2559; + t.SF500000 = 0x2558; + t.SF510000 = 0x2552; + t.SF520000 = 0x2553; + t.SF530000 = 0x256b; + t.SF540000 = 0x256a; + t.Sacute = 0x015a; + t.Sacutedotaccent = 0x1e64; + t.Sampigreek = 0x03e0; + t.Scaron = 0x0160; + t.Scarondotaccent = 0x1e66; + t.Scaronsmall = 0xf6fd; + t.Scedilla = 0x015e; + t.Schwa = 0x018f; + t.Schwacyrillic = 0x04d8; + t.Schwadieresiscyrillic = 0x04da; + t.Scircle = 0x24c8; + t.Scircumflex = 0x015c; + t.Scommaaccent = 0x0218; + t.Sdotaccent = 0x1e60; + t.Sdotbelow = 0x1e62; + t.Sdotbelowdotaccent = 0x1e68; + t.Seharmenian = 0x054d; + t.Sevenroman = 0x2166; + t.Shaarmenian = 0x0547; + t.Shacyrillic = 0x0428; + t.Shchacyrillic = 0x0429; + t.Sheicoptic = 0x03e2; + t.Shhacyrillic = 0x04ba; + t.Shimacoptic = 0x03ec; + t.Sigma = 0x03a3; + t.Sixroman = 0x2165; + t.Smonospace = 0xff33; + t.Softsigncyrillic = 0x042c; + t.Ssmall = 0xf773; + t.Stigmagreek = 0x03da; + t.T = 0x0054; + t.Tau = 0x03a4; + t.Tbar = 0x0166; + t.Tcaron = 0x0164; + t.Tcedilla = 0x0162; + t.Tcircle = 0x24c9; + t.Tcircumflexbelow = 0x1e70; + t.Tcommaaccent = 0x0162; + t.Tdotaccent = 0x1e6a; + t.Tdotbelow = 0x1e6c; + t.Tecyrillic = 0x0422; + t.Tedescendercyrillic = 0x04ac; + t.Tenroman = 0x2169; + t.Tetsecyrillic = 0x04b4; + t.Theta = 0x0398; + t.Thook = 0x01ac; + t.Thorn = 0x00de; + t.Thornsmall = 0xf7fe; + t.Threeroman = 0x2162; + t.Tildesmall = 0xf6fe; + t.Tiwnarmenian = 0x054f; + t.Tlinebelow = 0x1e6e; + t.Tmonospace = 0xff34; + t.Toarmenian = 0x0539; + t.Tonefive = 0x01bc; + t.Tonesix = 0x0184; + t.Tonetwo = 0x01a7; + t.Tretroflexhook = 0x01ae; + t.Tsecyrillic = 0x0426; + t.Tshecyrillic = 0x040b; + t.Tsmall = 0xf774; + t.Twelveroman = 0x216b; + t.Tworoman = 0x2161; + t.U = 0x0055; + t.Uacute = 0x00da; + t.Uacutesmall = 0xf7fa; + t.Ubreve = 0x016c; + t.Ucaron = 0x01d3; + t.Ucircle = 0x24ca; + t.Ucircumflex = 0x00db; + t.Ucircumflexbelow = 0x1e76; + t.Ucircumflexsmall = 0xf7fb; + t.Ucyrillic = 0x0423; + t.Udblacute = 0x0170; + t.Udblgrave = 0x0214; + t.Udieresis = 0x00dc; + t.Udieresisacute = 0x01d7; + t.Udieresisbelow = 0x1e72; + t.Udieresiscaron = 0x01d9; + t.Udieresiscyrillic = 0x04f0; + t.Udieresisgrave = 0x01db; + t.Udieresismacron = 0x01d5; + t.Udieresissmall = 0xf7fc; + t.Udotbelow = 0x1ee4; + t.Ugrave = 0x00d9; + t.Ugravesmall = 0xf7f9; + t.Uhookabove = 0x1ee6; + t.Uhorn = 0x01af; + t.Uhornacute = 0x1ee8; + t.Uhorndotbelow = 0x1ef0; + t.Uhorngrave = 0x1eea; + t.Uhornhookabove = 0x1eec; + t.Uhorntilde = 0x1eee; + t.Uhungarumlaut = 0x0170; + t.Uhungarumlautcyrillic = 0x04f2; + t.Uinvertedbreve = 0x0216; + t.Ukcyrillic = 0x0478; + t.Umacron = 0x016a; + t.Umacroncyrillic = 0x04ee; + t.Umacrondieresis = 0x1e7a; + t.Umonospace = 0xff35; + t.Uogonek = 0x0172; + t.Upsilon = 0x03a5; + t.Upsilon1 = 0x03d2; + t.Upsilonacutehooksymbolgreek = 0x03d3; + t.Upsilonafrican = 0x01b1; + t.Upsilondieresis = 0x03ab; + t.Upsilondieresishooksymbolgreek = 0x03d4; + t.Upsilonhooksymbol = 0x03d2; + t.Upsilontonos = 0x038e; + t.Uring = 0x016e; + t.Ushortcyrillic = 0x040e; + t.Usmall = 0xf775; + t.Ustraightcyrillic = 0x04ae; + t.Ustraightstrokecyrillic = 0x04b0; + t.Utilde = 0x0168; + t.Utildeacute = 0x1e78; + t.Utildebelow = 0x1e74; + t.V = 0x0056; + t.Vcircle = 0x24cb; + t.Vdotbelow = 0x1e7e; + t.Vecyrillic = 0x0412; + t.Vewarmenian = 0x054e; + t.Vhook = 0x01b2; + t.Vmonospace = 0xff36; + t.Voarmenian = 0x0548; + t.Vsmall = 0xf776; + t.Vtilde = 0x1e7c; + t.W = 0x0057; + t.Wacute = 0x1e82; + t.Wcircle = 0x24cc; + t.Wcircumflex = 0x0174; + t.Wdieresis = 0x1e84; + t.Wdotaccent = 0x1e86; + t.Wdotbelow = 0x1e88; + t.Wgrave = 0x1e80; + t.Wmonospace = 0xff37; + t.Wsmall = 0xf777; + t.X = 0x0058; + t.Xcircle = 0x24cd; + t.Xdieresis = 0x1e8c; + t.Xdotaccent = 0x1e8a; + t.Xeharmenian = 0x053d; + t.Xi = 0x039e; + t.Xmonospace = 0xff38; + t.Xsmall = 0xf778; + t.Y = 0x0059; + t.Yacute = 0x00dd; + t.Yacutesmall = 0xf7fd; + t.Yatcyrillic = 0x0462; + t.Ycircle = 0x24ce; + t.Ycircumflex = 0x0176; + t.Ydieresis = 0x0178; + t.Ydieresissmall = 0xf7ff; + t.Ydotaccent = 0x1e8e; + t.Ydotbelow = 0x1ef4; + t.Yericyrillic = 0x042b; + t.Yerudieresiscyrillic = 0x04f8; + t.Ygrave = 0x1ef2; + t.Yhook = 0x01b3; + t.Yhookabove = 0x1ef6; + t.Yiarmenian = 0x0545; + t.Yicyrillic = 0x0407; + t.Yiwnarmenian = 0x0552; + t.Ymonospace = 0xff39; + t.Ysmall = 0xf779; + t.Ytilde = 0x1ef8; + t.Yusbigcyrillic = 0x046a; + t.Yusbigiotifiedcyrillic = 0x046c; + t.Yuslittlecyrillic = 0x0466; + t.Yuslittleiotifiedcyrillic = 0x0468; + t.Z = 0x005a; + t.Zaarmenian = 0x0536; + t.Zacute = 0x0179; + t.Zcaron = 0x017d; + t.Zcaronsmall = 0xf6ff; + t.Zcircle = 0x24cf; + t.Zcircumflex = 0x1e90; + t.Zdot = 0x017b; + t.Zdotaccent = 0x017b; + t.Zdotbelow = 0x1e92; + t.Zecyrillic = 0x0417; + t.Zedescendercyrillic = 0x0498; + t.Zedieresiscyrillic = 0x04de; + t.Zeta = 0x0396; + t.Zhearmenian = 0x053a; + t.Zhebrevecyrillic = 0x04c1; + t.Zhecyrillic = 0x0416; + t.Zhedescendercyrillic = 0x0496; + t.Zhedieresiscyrillic = 0x04dc; + t.Zlinebelow = 0x1e94; + t.Zmonospace = 0xff3a; + t.Zsmall = 0xf77a; + t.Zstroke = 0x01b5; + t.a = 0x0061; + t.aabengali = 0x0986; + t.aacute = 0x00e1; + t.aadeva = 0x0906; + t.aagujarati = 0x0a86; + t.aagurmukhi = 0x0a06; + t.aamatragurmukhi = 0x0a3e; + t.aarusquare = 0x3303; + t.aavowelsignbengali = 0x09be; + t.aavowelsigndeva = 0x093e; + t.aavowelsigngujarati = 0x0abe; + t.abbreviationmarkarmenian = 0x055f; + t.abbreviationsigndeva = 0x0970; + t.abengali = 0x0985; + t.abopomofo = 0x311a; + t.abreve = 0x0103; + t.abreveacute = 0x1eaf; + t.abrevecyrillic = 0x04d1; + t.abrevedotbelow = 0x1eb7; + t.abrevegrave = 0x1eb1; + t.abrevehookabove = 0x1eb3; + t.abrevetilde = 0x1eb5; + t.acaron = 0x01ce; + t.acircle = 0x24d0; + t.acircumflex = 0x00e2; + t.acircumflexacute = 0x1ea5; + t.acircumflexdotbelow = 0x1ead; + t.acircumflexgrave = 0x1ea7; + t.acircumflexhookabove = 0x1ea9; + t.acircumflextilde = 0x1eab; + t.acute = 0x00b4; + t.acutebelowcmb = 0x0317; + t.acutecmb = 0x0301; + t.acutecomb = 0x0301; + t.acutedeva = 0x0954; + t.acutelowmod = 0x02cf; + t.acutetonecmb = 0x0341; + t.acyrillic = 0x0430; + t.adblgrave = 0x0201; + t.addakgurmukhi = 0x0a71; + t.adeva = 0x0905; + t.adieresis = 0x00e4; + t.adieresiscyrillic = 0x04d3; + t.adieresismacron = 0x01df; + t.adotbelow = 0x1ea1; + t.adotmacron = 0x01e1; + t.ae = 0x00e6; + t.aeacute = 0x01fd; + t.aekorean = 0x3150; + t.aemacron = 0x01e3; + t.afii00208 = 0x2015; + t.afii08941 = 0x20a4; + t.afii10017 = 0x0410; + t.afii10018 = 0x0411; + t.afii10019 = 0x0412; + t.afii10020 = 0x0413; + t.afii10021 = 0x0414; + t.afii10022 = 0x0415; + t.afii10023 = 0x0401; + t.afii10024 = 0x0416; + t.afii10025 = 0x0417; + t.afii10026 = 0x0418; + t.afii10027 = 0x0419; + t.afii10028 = 0x041a; + t.afii10029 = 0x041b; + t.afii10030 = 0x041c; + t.afii10031 = 0x041d; + t.afii10032 = 0x041e; + t.afii10033 = 0x041f; + t.afii10034 = 0x0420; + t.afii10035 = 0x0421; + t.afii10036 = 0x0422; + t.afii10037 = 0x0423; + t.afii10038 = 0x0424; + t.afii10039 = 0x0425; + t.afii10040 = 0x0426; + t.afii10041 = 0x0427; + t.afii10042 = 0x0428; + t.afii10043 = 0x0429; + t.afii10044 = 0x042a; + t.afii10045 = 0x042b; + t.afii10046 = 0x042c; + t.afii10047 = 0x042d; + t.afii10048 = 0x042e; + t.afii10049 = 0x042f; + t.afii10050 = 0x0490; + t.afii10051 = 0x0402; + t.afii10052 = 0x0403; + t.afii10053 = 0x0404; + t.afii10054 = 0x0405; + t.afii10055 = 0x0406; + t.afii10056 = 0x0407; + t.afii10057 = 0x0408; + t.afii10058 = 0x0409; + t.afii10059 = 0x040a; + t.afii10060 = 0x040b; + t.afii10061 = 0x040c; + t.afii10062 = 0x040e; + t.afii10063 = 0xf6c4; + t.afii10064 = 0xf6c5; + t.afii10065 = 0x0430; + t.afii10066 = 0x0431; + t.afii10067 = 0x0432; + t.afii10068 = 0x0433; + t.afii10069 = 0x0434; + t.afii10070 = 0x0435; + t.afii10071 = 0x0451; + t.afii10072 = 0x0436; + t.afii10073 = 0x0437; + t.afii10074 = 0x0438; + t.afii10075 = 0x0439; + t.afii10076 = 0x043a; + t.afii10077 = 0x043b; + t.afii10078 = 0x043c; + t.afii10079 = 0x043d; + t.afii10080 = 0x043e; + t.afii10081 = 0x043f; + t.afii10082 = 0x0440; + t.afii10083 = 0x0441; + t.afii10084 = 0x0442; + t.afii10085 = 0x0443; + t.afii10086 = 0x0444; + t.afii10087 = 0x0445; + t.afii10088 = 0x0446; + t.afii10089 = 0x0447; + t.afii10090 = 0x0448; + t.afii10091 = 0x0449; + t.afii10092 = 0x044a; + t.afii10093 = 0x044b; + t.afii10094 = 0x044c; + t.afii10095 = 0x044d; + t.afii10096 = 0x044e; + t.afii10097 = 0x044f; + t.afii10098 = 0x0491; + t.afii10099 = 0x0452; + t.afii10100 = 0x0453; + t.afii10101 = 0x0454; + t.afii10102 = 0x0455; + t.afii10103 = 0x0456; + t.afii10104 = 0x0457; + t.afii10105 = 0x0458; + t.afii10106 = 0x0459; + t.afii10107 = 0x045a; + t.afii10108 = 0x045b; + t.afii10109 = 0x045c; + t.afii10110 = 0x045e; + t.afii10145 = 0x040f; + t.afii10146 = 0x0462; + t.afii10147 = 0x0472; + t.afii10148 = 0x0474; + t.afii10192 = 0xf6c6; + t.afii10193 = 0x045f; + t.afii10194 = 0x0463; + t.afii10195 = 0x0473; + t.afii10196 = 0x0475; + t.afii10831 = 0xf6c7; + t.afii10832 = 0xf6c8; + t.afii10846 = 0x04d9; + t.afii299 = 0x200e; + t.afii300 = 0x200f; + t.afii301 = 0x200d; + t.afii57381 = 0x066a; + t.afii57388 = 0x060c; + t.afii57392 = 0x0660; + t.afii57393 = 0x0661; + t.afii57394 = 0x0662; + t.afii57395 = 0x0663; + t.afii57396 = 0x0664; + t.afii57397 = 0x0665; + t.afii57398 = 0x0666; + t.afii57399 = 0x0667; + t.afii57400 = 0x0668; + t.afii57401 = 0x0669; + t.afii57403 = 0x061b; + t.afii57407 = 0x061f; + t.afii57409 = 0x0621; + t.afii57410 = 0x0622; + t.afii57411 = 0x0623; + t.afii57412 = 0x0624; + t.afii57413 = 0x0625; + t.afii57414 = 0x0626; + t.afii57415 = 0x0627; + t.afii57416 = 0x0628; + t.afii57417 = 0x0629; + t.afii57418 = 0x062a; + t.afii57419 = 0x062b; + t.afii57420 = 0x062c; + t.afii57421 = 0x062d; + t.afii57422 = 0x062e; + t.afii57423 = 0x062f; + t.afii57424 = 0x0630; + t.afii57425 = 0x0631; + t.afii57426 = 0x0632; + t.afii57427 = 0x0633; + t.afii57428 = 0x0634; + t.afii57429 = 0x0635; + t.afii57430 = 0x0636; + t.afii57431 = 0x0637; + t.afii57432 = 0x0638; + t.afii57433 = 0x0639; + t.afii57434 = 0x063a; + t.afii57440 = 0x0640; + t.afii57441 = 0x0641; + t.afii57442 = 0x0642; + t.afii57443 = 0x0643; + t.afii57444 = 0x0644; + t.afii57445 = 0x0645; + t.afii57446 = 0x0646; + t.afii57448 = 0x0648; + t.afii57449 = 0x0649; + t.afii57450 = 0x064a; + t.afii57451 = 0x064b; + t.afii57452 = 0x064c; + t.afii57453 = 0x064d; + t.afii57454 = 0x064e; + t.afii57455 = 0x064f; + t.afii57456 = 0x0650; + t.afii57457 = 0x0651; + t.afii57458 = 0x0652; + t.afii57470 = 0x0647; + t.afii57505 = 0x06a4; + t.afii57506 = 0x067e; + t.afii57507 = 0x0686; + t.afii57508 = 0x0698; + t.afii57509 = 0x06af; + t.afii57511 = 0x0679; + t.afii57512 = 0x0688; + t.afii57513 = 0x0691; + t.afii57514 = 0x06ba; + t.afii57519 = 0x06d2; + t.afii57534 = 0x06d5; + t.afii57636 = 0x20aa; + t.afii57645 = 0x05be; + t.afii57658 = 0x05c3; + t.afii57664 = 0x05d0; + t.afii57665 = 0x05d1; + t.afii57666 = 0x05d2; + t.afii57667 = 0x05d3; + t.afii57668 = 0x05d4; + t.afii57669 = 0x05d5; + t.afii57670 = 0x05d6; + t.afii57671 = 0x05d7; + t.afii57672 = 0x05d8; + t.afii57673 = 0x05d9; + t.afii57674 = 0x05da; + t.afii57675 = 0x05db; + t.afii57676 = 0x05dc; + t.afii57677 = 0x05dd; + t.afii57678 = 0x05de; + t.afii57679 = 0x05df; + t.afii57680 = 0x05e0; + t.afii57681 = 0x05e1; + t.afii57682 = 0x05e2; + t.afii57683 = 0x05e3; + t.afii57684 = 0x05e4; + t.afii57685 = 0x05e5; + t.afii57686 = 0x05e6; + t.afii57687 = 0x05e7; + t.afii57688 = 0x05e8; + t.afii57689 = 0x05e9; + t.afii57690 = 0x05ea; + t.afii57694 = 0xfb2a; + t.afii57695 = 0xfb2b; + t.afii57700 = 0xfb4b; + t.afii57705 = 0xfb1f; + t.afii57716 = 0x05f0; + t.afii57717 = 0x05f1; + t.afii57718 = 0x05f2; + t.afii57723 = 0xfb35; + t.afii57793 = 0x05b4; + t.afii57794 = 0x05b5; + t.afii57795 = 0x05b6; + t.afii57796 = 0x05bb; + t.afii57797 = 0x05b8; + t.afii57798 = 0x05b7; + t.afii57799 = 0x05b0; + t.afii57800 = 0x05b2; + t.afii57801 = 0x05b1; + t.afii57802 = 0x05b3; + t.afii57803 = 0x05c2; + t.afii57804 = 0x05c1; + t.afii57806 = 0x05b9; + t.afii57807 = 0x05bc; + t.afii57839 = 0x05bd; + t.afii57841 = 0x05bf; + t.afii57842 = 0x05c0; + t.afii57929 = 0x02bc; + t.afii61248 = 0x2105; + t.afii61289 = 0x2113; + t.afii61352 = 0x2116; + t.afii61573 = 0x202c; + t.afii61574 = 0x202d; + t.afii61575 = 0x202e; + t.afii61664 = 0x200c; + t.afii63167 = 0x066d; + t.afii64937 = 0x02bd; + t.agrave = 0x00e0; + t.agujarati = 0x0a85; + t.agurmukhi = 0x0a05; + t.ahiragana = 0x3042; + t.ahookabove = 0x1ea3; + t.aibengali = 0x0990; + t.aibopomofo = 0x311e; + t.aideva = 0x0910; + t.aiecyrillic = 0x04d5; + t.aigujarati = 0x0a90; + t.aigurmukhi = 0x0a10; + t.aimatragurmukhi = 0x0a48; + t.ainarabic = 0x0639; + t.ainfinalarabic = 0xfeca; + t.aininitialarabic = 0xfecb; + t.ainmedialarabic = 0xfecc; + t.ainvertedbreve = 0x0203; + t.aivowelsignbengali = 0x09c8; + t.aivowelsigndeva = 0x0948; + t.aivowelsigngujarati = 0x0ac8; + t.akatakana = 0x30a2; + t.akatakanahalfwidth = 0xff71; + t.akorean = 0x314f; + t.alef = 0x05d0; + t.alefarabic = 0x0627; + t.alefdageshhebrew = 0xfb30; + t.aleffinalarabic = 0xfe8e; + t.alefhamzaabovearabic = 0x0623; + t.alefhamzaabovefinalarabic = 0xfe84; + t.alefhamzabelowarabic = 0x0625; + t.alefhamzabelowfinalarabic = 0xfe88; + t.alefhebrew = 0x05d0; + t.aleflamedhebrew = 0xfb4f; + t.alefmaddaabovearabic = 0x0622; + t.alefmaddaabovefinalarabic = 0xfe82; + t.alefmaksuraarabic = 0x0649; + t.alefmaksurafinalarabic = 0xfef0; + t.alefmaksurainitialarabic = 0xfef3; + t.alefmaksuramedialarabic = 0xfef4; + t.alefpatahhebrew = 0xfb2e; + t.alefqamatshebrew = 0xfb2f; + t.aleph = 0x2135; + t.allequal = 0x224c; + t.alpha = 0x03b1; + t.alphatonos = 0x03ac; + t.amacron = 0x0101; + t.amonospace = 0xff41; + t.ampersand = 0x0026; + t.ampersandmonospace = 0xff06; + t.ampersandsmall = 0xf726; + t.amsquare = 0x33c2; + t.anbopomofo = 0x3122; + t.angbopomofo = 0x3124; + t.angbracketleft = 0x3008; + t.angbracketright = 0x3009; + t.angkhankhuthai = 0x0e5a; + t.angle = 0x2220; + t.anglebracketleft = 0x3008; + t.anglebracketleftvertical = 0xfe3f; + t.anglebracketright = 0x3009; + t.anglebracketrightvertical = 0xfe40; + t.angleleft = 0x2329; + t.angleright = 0x232a; + t.angstrom = 0x212b; + t.anoteleia = 0x0387; + t.anudattadeva = 0x0952; + t.anusvarabengali = 0x0982; + t.anusvaradeva = 0x0902; + t.anusvaragujarati = 0x0a82; + t.aogonek = 0x0105; + t.apaatosquare = 0x3300; + t.aparen = 0x249c; + t.apostrophearmenian = 0x055a; + t.apostrophemod = 0x02bc; + t.apple = 0xf8ff; + t.approaches = 0x2250; + t.approxequal = 0x2248; + t.approxequalorimage = 0x2252; + t.approximatelyequal = 0x2245; + t.araeaekorean = 0x318e; + t.araeakorean = 0x318d; + t.arc = 0x2312; + t.arighthalfring = 0x1e9a; + t.aring = 0x00e5; + t.aringacute = 0x01fb; + t.aringbelow = 0x1e01; + t.arrowboth = 0x2194; + t.arrowdashdown = 0x21e3; + t.arrowdashleft = 0x21e0; + t.arrowdashright = 0x21e2; + t.arrowdashup = 0x21e1; + t.arrowdblboth = 0x21d4; + t.arrowdbldown = 0x21d3; + t.arrowdblleft = 0x21d0; + t.arrowdblright = 0x21d2; + t.arrowdblup = 0x21d1; + t.arrowdown = 0x2193; + t.arrowdownleft = 0x2199; + t.arrowdownright = 0x2198; + t.arrowdownwhite = 0x21e9; + t.arrowheaddownmod = 0x02c5; + t.arrowheadleftmod = 0x02c2; + t.arrowheadrightmod = 0x02c3; + t.arrowheadupmod = 0x02c4; + t.arrowhorizex = 0xf8e7; + t.arrowleft = 0x2190; + t.arrowleftdbl = 0x21d0; + t.arrowleftdblstroke = 0x21cd; + t.arrowleftoverright = 0x21c6; + t.arrowleftwhite = 0x21e6; + t.arrowright = 0x2192; + t.arrowrightdblstroke = 0x21cf; + t.arrowrightheavy = 0x279e; + t.arrowrightoverleft = 0x21c4; + t.arrowrightwhite = 0x21e8; + t.arrowtableft = 0x21e4; + t.arrowtabright = 0x21e5; + t.arrowup = 0x2191; + t.arrowupdn = 0x2195; + t.arrowupdnbse = 0x21a8; + t.arrowupdownbase = 0x21a8; + t.arrowupleft = 0x2196; + t.arrowupleftofdown = 0x21c5; + t.arrowupright = 0x2197; + t.arrowupwhite = 0x21e7; + t.arrowvertex = 0xf8e6; + t.asciicircum = 0x005e; + t.asciicircummonospace = 0xff3e; + t.asciitilde = 0x007e; + t.asciitildemonospace = 0xff5e; + t.ascript = 0x0251; + t.ascriptturned = 0x0252; + t.asmallhiragana = 0x3041; + t.asmallkatakana = 0x30a1; + t.asmallkatakanahalfwidth = 0xff67; + t.asterisk = 0x002a; + t.asteriskaltonearabic = 0x066d; + t.asteriskarabic = 0x066d; + t.asteriskmath = 0x2217; + t.asteriskmonospace = 0xff0a; + t.asterisksmall = 0xfe61; + t.asterism = 0x2042; + t.asuperior = 0xf6e9; + t.asymptoticallyequal = 0x2243; + t.at = 0x0040; + t.atilde = 0x00e3; + t.atmonospace = 0xff20; + t.atsmall = 0xfe6b; + t.aturned = 0x0250; + t.aubengali = 0x0994; + t.aubopomofo = 0x3120; + t.audeva = 0x0914; + t.augujarati = 0x0a94; + t.augurmukhi = 0x0a14; + t.aulengthmarkbengali = 0x09d7; + t.aumatragurmukhi = 0x0a4c; + t.auvowelsignbengali = 0x09cc; + t.auvowelsigndeva = 0x094c; + t.auvowelsigngujarati = 0x0acc; + t.avagrahadeva = 0x093d; + t.aybarmenian = 0x0561; + t.ayin = 0x05e2; + t.ayinaltonehebrew = 0xfb20; + t.ayinhebrew = 0x05e2; + t.b = 0x0062; + t.babengali = 0x09ac; + t.backslash = 0x005c; + t.backslashmonospace = 0xff3c; + t.badeva = 0x092c; + t.bagujarati = 0x0aac; + t.bagurmukhi = 0x0a2c; + t.bahiragana = 0x3070; + t.bahtthai = 0x0e3f; + t.bakatakana = 0x30d0; + t.bar = 0x007c; + t.barmonospace = 0xff5c; + t.bbopomofo = 0x3105; + t.bcircle = 0x24d1; + t.bdotaccent = 0x1e03; + t.bdotbelow = 0x1e05; + t.beamedsixteenthnotes = 0x266c; + t.because = 0x2235; + t.becyrillic = 0x0431; + t.beharabic = 0x0628; + t.behfinalarabic = 0xfe90; + t.behinitialarabic = 0xfe91; + t.behiragana = 0x3079; + t.behmedialarabic = 0xfe92; + t.behmeeminitialarabic = 0xfc9f; + t.behmeemisolatedarabic = 0xfc08; + t.behnoonfinalarabic = 0xfc6d; + t.bekatakana = 0x30d9; + t.benarmenian = 0x0562; + t.bet = 0x05d1; + t.beta = 0x03b2; + t.betasymbolgreek = 0x03d0; + t.betdagesh = 0xfb31; + t.betdageshhebrew = 0xfb31; + t.bethebrew = 0x05d1; + t.betrafehebrew = 0xfb4c; + t.bhabengali = 0x09ad; + t.bhadeva = 0x092d; + t.bhagujarati = 0x0aad; + t.bhagurmukhi = 0x0a2d; + t.bhook = 0x0253; + t.bihiragana = 0x3073; + t.bikatakana = 0x30d3; + t.bilabialclick = 0x0298; + t.bindigurmukhi = 0x0a02; + t.birusquare = 0x3331; + t.blackcircle = 0x25cf; + t.blackdiamond = 0x25c6; + t.blackdownpointingtriangle = 0x25bc; + t.blackleftpointingpointer = 0x25c4; + t.blackleftpointingtriangle = 0x25c0; + t.blacklenticularbracketleft = 0x3010; + t.blacklenticularbracketleftvertical = 0xfe3b; + t.blacklenticularbracketright = 0x3011; + t.blacklenticularbracketrightvertical = 0xfe3c; + t.blacklowerlefttriangle = 0x25e3; + t.blacklowerrighttriangle = 0x25e2; + t.blackrectangle = 0x25ac; + t.blackrightpointingpointer = 0x25ba; + t.blackrightpointingtriangle = 0x25b6; + t.blacksmallsquare = 0x25aa; + t.blacksmilingface = 0x263b; + t.blacksquare = 0x25a0; + t.blackstar = 0x2605; + t.blackupperlefttriangle = 0x25e4; + t.blackupperrighttriangle = 0x25e5; + t.blackuppointingsmalltriangle = 0x25b4; + t.blackuppointingtriangle = 0x25b2; + t.blank = 0x2423; + t.blinebelow = 0x1e07; + t.block = 0x2588; + t.bmonospace = 0xff42; + t.bobaimaithai = 0x0e1a; + t.bohiragana = 0x307c; + t.bokatakana = 0x30dc; + t.bparen = 0x249d; + t.bqsquare = 0x33c3; + t.braceex = 0xf8f4; + t.braceleft = 0x007b; + t.braceleftbt = 0xf8f3; + t.braceleftmid = 0xf8f2; + t.braceleftmonospace = 0xff5b; + t.braceleftsmall = 0xfe5b; + t.bracelefttp = 0xf8f1; + t.braceleftvertical = 0xfe37; + t.braceright = 0x007d; + t.bracerightbt = 0xf8fe; + t.bracerightmid = 0xf8fd; + t.bracerightmonospace = 0xff5d; + t.bracerightsmall = 0xfe5c; + t.bracerighttp = 0xf8fc; + t.bracerightvertical = 0xfe38; + t.bracketleft = 0x005b; + t.bracketleftbt = 0xf8f0; + t.bracketleftex = 0xf8ef; + t.bracketleftmonospace = 0xff3b; + t.bracketlefttp = 0xf8ee; + t.bracketright = 0x005d; + t.bracketrightbt = 0xf8fb; + t.bracketrightex = 0xf8fa; + t.bracketrightmonospace = 0xff3d; + t.bracketrighttp = 0xf8f9; + t.breve = 0x02d8; + t.brevebelowcmb = 0x032e; + t.brevecmb = 0x0306; + t.breveinvertedbelowcmb = 0x032f; + t.breveinvertedcmb = 0x0311; + t.breveinverteddoublecmb = 0x0361; + t.bridgebelowcmb = 0x032a; + t.bridgeinvertedbelowcmb = 0x033a; + t.brokenbar = 0x00a6; + t.bstroke = 0x0180; + t.bsuperior = 0xf6ea; + t.btopbar = 0x0183; + t.buhiragana = 0x3076; + t.bukatakana = 0x30d6; + t.bullet = 0x2022; + t.bulletinverse = 0x25d8; + t.bulletoperator = 0x2219; + t.bullseye = 0x25ce; + t.c = 0x0063; + t.caarmenian = 0x056e; + t.cabengali = 0x099a; + t.cacute = 0x0107; + t.cadeva = 0x091a; + t.cagujarati = 0x0a9a; + t.cagurmukhi = 0x0a1a; + t.calsquare = 0x3388; + t.candrabindubengali = 0x0981; + t.candrabinducmb = 0x0310; + t.candrabindudeva = 0x0901; + t.candrabindugujarati = 0x0a81; + t.capslock = 0x21ea; + t.careof = 0x2105; + t.caron = 0x02c7; + t.caronbelowcmb = 0x032c; + t.caroncmb = 0x030c; + t.carriagereturn = 0x21b5; + t.cbopomofo = 0x3118; + t.ccaron = 0x010d; + t.ccedilla = 0x00e7; + t.ccedillaacute = 0x1e09; + t.ccircle = 0x24d2; + t.ccircumflex = 0x0109; + t.ccurl = 0x0255; + t.cdot = 0x010b; + t.cdotaccent = 0x010b; + t.cdsquare = 0x33c5; + t.cedilla = 0x00b8; + t.cedillacmb = 0x0327; + t.cent = 0x00a2; + t.centigrade = 0x2103; + t.centinferior = 0xf6df; + t.centmonospace = 0xffe0; + t.centoldstyle = 0xf7a2; + t.centsuperior = 0xf6e0; + t.chaarmenian = 0x0579; + t.chabengali = 0x099b; + t.chadeva = 0x091b; + t.chagujarati = 0x0a9b; + t.chagurmukhi = 0x0a1b; + t.chbopomofo = 0x3114; + t.cheabkhasiancyrillic = 0x04bd; + t.checkmark = 0x2713; + t.checyrillic = 0x0447; + t.chedescenderabkhasiancyrillic = 0x04bf; + t.chedescendercyrillic = 0x04b7; + t.chedieresiscyrillic = 0x04f5; + t.cheharmenian = 0x0573; + t.chekhakassiancyrillic = 0x04cc; + t.cheverticalstrokecyrillic = 0x04b9; + t.chi = 0x03c7; + t.chieuchacirclekorean = 0x3277; + t.chieuchaparenkorean = 0x3217; + t.chieuchcirclekorean = 0x3269; + t.chieuchkorean = 0x314a; + t.chieuchparenkorean = 0x3209; + t.chochangthai = 0x0e0a; + t.chochanthai = 0x0e08; + t.chochingthai = 0x0e09; + t.chochoethai = 0x0e0c; + t.chook = 0x0188; + t.cieucacirclekorean = 0x3276; + t.cieucaparenkorean = 0x3216; + t.cieuccirclekorean = 0x3268; + t.cieuckorean = 0x3148; + t.cieucparenkorean = 0x3208; + t.cieucuparenkorean = 0x321c; + t.circle = 0x25cb; + t.circlecopyrt = 0x00a9; + t.circlemultiply = 0x2297; + t.circleot = 0x2299; + t.circleplus = 0x2295; + t.circlepostalmark = 0x3036; + t.circlewithlefthalfblack = 0x25d0; + t.circlewithrighthalfblack = 0x25d1; + t.circumflex = 0x02c6; + t.circumflexbelowcmb = 0x032d; + t.circumflexcmb = 0x0302; + t.clear = 0x2327; + t.clickalveolar = 0x01c2; + t.clickdental = 0x01c0; + t.clicklateral = 0x01c1; + t.clickretroflex = 0x01c3; + t.club = 0x2663; + t.clubsuitblack = 0x2663; + t.clubsuitwhite = 0x2667; + t.cmcubedsquare = 0x33a4; + t.cmonospace = 0xff43; + t.cmsquaredsquare = 0x33a0; + t.coarmenian = 0x0581; + t.colon = 0x003a; + t.colonmonetary = 0x20a1; + t.colonmonospace = 0xff1a; + t.colonsign = 0x20a1; + t.colonsmall = 0xfe55; + t.colontriangularhalfmod = 0x02d1; + t.colontriangularmod = 0x02d0; + t.comma = 0x002c; + t.commaabovecmb = 0x0313; + t.commaaboverightcmb = 0x0315; + t.commaaccent = 0xf6c3; + t.commaarabic = 0x060c; + t.commaarmenian = 0x055d; + t.commainferior = 0xf6e1; + t.commamonospace = 0xff0c; + t.commareversedabovecmb = 0x0314; + t.commareversedmod = 0x02bd; + t.commasmall = 0xfe50; + t.commasuperior = 0xf6e2; + t.commaturnedabovecmb = 0x0312; + t.commaturnedmod = 0x02bb; + t.compass = 0x263c; + t.congruent = 0x2245; + t.contourintegral = 0x222e; + t.control = 0x2303; + t.controlACK = 0x0006; + t.controlBEL = 0x0007; + t.controlBS = 0x0008; + t.controlCAN = 0x0018; + t.controlCR = 0x000d; + t.controlDC1 = 0x0011; + t.controlDC2 = 0x0012; + t.controlDC3 = 0x0013; + t.controlDC4 = 0x0014; + t.controlDEL = 0x007f; + t.controlDLE = 0x0010; + t.controlEM = 0x0019; + t.controlENQ = 0x0005; + t.controlEOT = 0x0004; + t.controlESC = 0x001b; + t.controlETB = 0x0017; + t.controlETX = 0x0003; + t.controlFF = 0x000c; + t.controlFS = 0x001c; + t.controlGS = 0x001d; + t.controlHT = 0x0009; + t.controlLF = 0x000a; + t.controlNAK = 0x0015; + t.controlNULL = 0x0000; + t.controlRS = 0x001e; + t.controlSI = 0x000f; + t.controlSO = 0x000e; + t.controlSOT = 0x0002; + t.controlSTX = 0x0001; + t.controlSUB = 0x001a; + t.controlSYN = 0x0016; + t.controlUS = 0x001f; + t.controlVT = 0x000b; + t.copyright = 0x00a9; + t.copyrightsans = 0xf8e9; + t.copyrightserif = 0xf6d9; + t.cornerbracketleft = 0x300c; + t.cornerbracketlefthalfwidth = 0xff62; + t.cornerbracketleftvertical = 0xfe41; + t.cornerbracketright = 0x300d; + t.cornerbracketrighthalfwidth = 0xff63; + t.cornerbracketrightvertical = 0xfe42; + t.corporationsquare = 0x337f; + t.cosquare = 0x33c7; + t.coverkgsquare = 0x33c6; + t.cparen = 0x249e; + t.cruzeiro = 0x20a2; + t.cstretched = 0x0297; + t.curlyand = 0x22cf; + t.curlyor = 0x22ce; + t.currency = 0x00a4; + t.cyrBreve = 0xf6d1; + t.cyrFlex = 0xf6d2; + t.cyrbreve = 0xf6d4; + t.cyrflex = 0xf6d5; + t.d = 0x0064; + t.daarmenian = 0x0564; + t.dabengali = 0x09a6; + t.dadarabic = 0x0636; + t.dadeva = 0x0926; + t.dadfinalarabic = 0xfebe; + t.dadinitialarabic = 0xfebf; + t.dadmedialarabic = 0xfec0; + t.dagesh = 0x05bc; + t.dageshhebrew = 0x05bc; + t.dagger = 0x2020; + t.daggerdbl = 0x2021; + t.dagujarati = 0x0aa6; + t.dagurmukhi = 0x0a26; + t.dahiragana = 0x3060; + t.dakatakana = 0x30c0; + t.dalarabic = 0x062f; + t.dalet = 0x05d3; + t.daletdagesh = 0xfb33; + t.daletdageshhebrew = 0xfb33; + t.dalethebrew = 0x05d3; + t.dalfinalarabic = 0xfeaa; + t.dammaarabic = 0x064f; + t.dammalowarabic = 0x064f; + t.dammatanaltonearabic = 0x064c; + t.dammatanarabic = 0x064c; + t.danda = 0x0964; + t.dargahebrew = 0x05a7; + t.dargalefthebrew = 0x05a7; + t.dasiapneumatacyrilliccmb = 0x0485; + t.dblGrave = 0xf6d3; + t.dblanglebracketleft = 0x300a; + t.dblanglebracketleftvertical = 0xfe3d; + t.dblanglebracketright = 0x300b; + t.dblanglebracketrightvertical = 0xfe3e; + t.dblarchinvertedbelowcmb = 0x032b; + t.dblarrowleft = 0x21d4; + t.dblarrowright = 0x21d2; + t.dbldanda = 0x0965; + t.dblgrave = 0xf6d6; + t.dblgravecmb = 0x030f; + t.dblintegral = 0x222c; + t.dbllowline = 0x2017; + t.dbllowlinecmb = 0x0333; + t.dbloverlinecmb = 0x033f; + t.dblprimemod = 0x02ba; + t.dblverticalbar = 0x2016; + t.dblverticallineabovecmb = 0x030e; + t.dbopomofo = 0x3109; + t.dbsquare = 0x33c8; + t.dcaron = 0x010f; + t.dcedilla = 0x1e11; + t.dcircle = 0x24d3; + t.dcircumflexbelow = 0x1e13; + t.dcroat = 0x0111; + t.ddabengali = 0x09a1; + t.ddadeva = 0x0921; + t.ddagujarati = 0x0aa1; + t.ddagurmukhi = 0x0a21; + t.ddalarabic = 0x0688; + t.ddalfinalarabic = 0xfb89; + t.dddhadeva = 0x095c; + t.ddhabengali = 0x09a2; + t.ddhadeva = 0x0922; + t.ddhagujarati = 0x0aa2; + t.ddhagurmukhi = 0x0a22; + t.ddotaccent = 0x1e0b; + t.ddotbelow = 0x1e0d; + t.decimalseparatorarabic = 0x066b; + t.decimalseparatorpersian = 0x066b; + t.decyrillic = 0x0434; + t.degree = 0x00b0; + t.dehihebrew = 0x05ad; + t.dehiragana = 0x3067; + t.deicoptic = 0x03ef; + t.dekatakana = 0x30c7; + t.deleteleft = 0x232b; + t.deleteright = 0x2326; + t.delta = 0x03b4; + t.deltaturned = 0x018d; + t.denominatorminusonenumeratorbengali = 0x09f8; + t.dezh = 0x02a4; + t.dhabengali = 0x09a7; + t.dhadeva = 0x0927; + t.dhagujarati = 0x0aa7; + t.dhagurmukhi = 0x0a27; + t.dhook = 0x0257; + t.dialytikatonos = 0x0385; + t.dialytikatonoscmb = 0x0344; + t.diamond = 0x2666; + t.diamondsuitwhite = 0x2662; + t.dieresis = 0x00a8; + t.dieresisacute = 0xf6d7; + t.dieresisbelowcmb = 0x0324; + t.dieresiscmb = 0x0308; + t.dieresisgrave = 0xf6d8; + t.dieresistonos = 0x0385; + t.dihiragana = 0x3062; + t.dikatakana = 0x30c2; + t.dittomark = 0x3003; + t.divide = 0x00f7; + t.divides = 0x2223; + t.divisionslash = 0x2215; + t.djecyrillic = 0x0452; + t.dkshade = 0x2593; + t.dlinebelow = 0x1e0f; + t.dlsquare = 0x3397; + t.dmacron = 0x0111; + t.dmonospace = 0xff44; + t.dnblock = 0x2584; + t.dochadathai = 0x0e0e; + t.dodekthai = 0x0e14; + t.dohiragana = 0x3069; + t.dokatakana = 0x30c9; + t.dollar = 0x0024; + t.dollarinferior = 0xf6e3; + t.dollarmonospace = 0xff04; + t.dollaroldstyle = 0xf724; + t.dollarsmall = 0xfe69; + t.dollarsuperior = 0xf6e4; + t.dong = 0x20ab; + t.dorusquare = 0x3326; + t.dotaccent = 0x02d9; + t.dotaccentcmb = 0x0307; + t.dotbelowcmb = 0x0323; + t.dotbelowcomb = 0x0323; + t.dotkatakana = 0x30fb; + t.dotlessi = 0x0131; + t.dotlessj = 0xf6be; + t.dotlessjstrokehook = 0x0284; + t.dotmath = 0x22c5; + t.dottedcircle = 0x25cc; + t.doubleyodpatah = 0xfb1f; + t.doubleyodpatahhebrew = 0xfb1f; + t.downtackbelowcmb = 0x031e; + t.downtackmod = 0x02d5; + t.dparen = 0x249f; + t.dsuperior = 0xf6eb; + t.dtail = 0x0256; + t.dtopbar = 0x018c; + t.duhiragana = 0x3065; + t.dukatakana = 0x30c5; + t.dz = 0x01f3; + t.dzaltone = 0x02a3; + t.dzcaron = 0x01c6; + t.dzcurl = 0x02a5; + t.dzeabkhasiancyrillic = 0x04e1; + t.dzecyrillic = 0x0455; + t.dzhecyrillic = 0x045f; + t.e = 0x0065; + t.eacute = 0x00e9; + t.earth = 0x2641; + t.ebengali = 0x098f; + t.ebopomofo = 0x311c; + t.ebreve = 0x0115; + t.ecandradeva = 0x090d; + t.ecandragujarati = 0x0a8d; + t.ecandravowelsigndeva = 0x0945; + t.ecandravowelsigngujarati = 0x0ac5; + t.ecaron = 0x011b; + t.ecedillabreve = 0x1e1d; + t.echarmenian = 0x0565; + t.echyiwnarmenian = 0x0587; + t.ecircle = 0x24d4; + t.ecircumflex = 0x00ea; + t.ecircumflexacute = 0x1ebf; + t.ecircumflexbelow = 0x1e19; + t.ecircumflexdotbelow = 0x1ec7; + t.ecircumflexgrave = 0x1ec1; + t.ecircumflexhookabove = 0x1ec3; + t.ecircumflextilde = 0x1ec5; + t.ecyrillic = 0x0454; + t.edblgrave = 0x0205; + t.edeva = 0x090f; + t.edieresis = 0x00eb; + t.edot = 0x0117; + t.edotaccent = 0x0117; + t.edotbelow = 0x1eb9; + t.eegurmukhi = 0x0a0f; + t.eematragurmukhi = 0x0a47; + t.efcyrillic = 0x0444; + t.egrave = 0x00e8; + t.egujarati = 0x0a8f; + t.eharmenian = 0x0567; + t.ehbopomofo = 0x311d; + t.ehiragana = 0x3048; + t.ehookabove = 0x1ebb; + t.eibopomofo = 0x311f; + t.eight = 0x0038; + t.eightarabic = 0x0668; + t.eightbengali = 0x09ee; + t.eightcircle = 0x2467; + t.eightcircleinversesansserif = 0x2791; + t.eightdeva = 0x096e; + t.eighteencircle = 0x2471; + t.eighteenparen = 0x2485; + t.eighteenperiod = 0x2499; + t.eightgujarati = 0x0aee; + t.eightgurmukhi = 0x0a6e; + t.eighthackarabic = 0x0668; + t.eighthangzhou = 0x3028; + t.eighthnotebeamed = 0x266b; + t.eightideographicparen = 0x3227; + t.eightinferior = 0x2088; + t.eightmonospace = 0xff18; + t.eightoldstyle = 0xf738; + t.eightparen = 0x247b; + t.eightperiod = 0x248f; + t.eightpersian = 0x06f8; + t.eightroman = 0x2177; + t.eightsuperior = 0x2078; + t.eightthai = 0x0e58; + t.einvertedbreve = 0x0207; + t.eiotifiedcyrillic = 0x0465; + t.ekatakana = 0x30a8; + t.ekatakanahalfwidth = 0xff74; + t.ekonkargurmukhi = 0x0a74; + t.ekorean = 0x3154; + t.elcyrillic = 0x043b; + t.element = 0x2208; + t.elevencircle = 0x246a; + t.elevenparen = 0x247e; + t.elevenperiod = 0x2492; + t.elevenroman = 0x217a; + t.ellipsis = 0x2026; + t.ellipsisvertical = 0x22ee; + t.emacron = 0x0113; + t.emacronacute = 0x1e17; + t.emacrongrave = 0x1e15; + t.emcyrillic = 0x043c; + t.emdash = 0x2014; + t.emdashvertical = 0xfe31; + t.emonospace = 0xff45; + t.emphasismarkarmenian = 0x055b; + t.emptyset = 0x2205; + t.enbopomofo = 0x3123; + t.encyrillic = 0x043d; + t.endash = 0x2013; + t.endashvertical = 0xfe32; + t.endescendercyrillic = 0x04a3; + t.eng = 0x014b; + t.engbopomofo = 0x3125; + t.enghecyrillic = 0x04a5; + t.enhookcyrillic = 0x04c8; + t.enspace = 0x2002; + t.eogonek = 0x0119; + t.eokorean = 0x3153; + t.eopen = 0x025b; + t.eopenclosed = 0x029a; + t.eopenreversed = 0x025c; + t.eopenreversedclosed = 0x025e; + t.eopenreversedhook = 0x025d; + t.eparen = 0x24a0; + t.epsilon = 0x03b5; + t.epsilontonos = 0x03ad; + t.equal = 0x003d; + t.equalmonospace = 0xff1d; + t.equalsmall = 0xfe66; + t.equalsuperior = 0x207c; + t.equivalence = 0x2261; + t.erbopomofo = 0x3126; + t.ercyrillic = 0x0440; + t.ereversed = 0x0258; + t.ereversedcyrillic = 0x044d; + t.escyrillic = 0x0441; + t.esdescendercyrillic = 0x04ab; + t.esh = 0x0283; + t.eshcurl = 0x0286; + t.eshortdeva = 0x090e; + t.eshortvowelsigndeva = 0x0946; + t.eshreversedloop = 0x01aa; + t.eshsquatreversed = 0x0285; + t.esmallhiragana = 0x3047; + t.esmallkatakana = 0x30a7; + t.esmallkatakanahalfwidth = 0xff6a; + t.estimated = 0x212e; + t.esuperior = 0xf6ec; + t.eta = 0x03b7; + t.etarmenian = 0x0568; + t.etatonos = 0x03ae; + t.eth = 0x00f0; + t.etilde = 0x1ebd; + t.etildebelow = 0x1e1b; + t.etnahtafoukhhebrew = 0x0591; + t.etnahtafoukhlefthebrew = 0x0591; + t.etnahtahebrew = 0x0591; + t.etnahtalefthebrew = 0x0591; + t.eturned = 0x01dd; + t.eukorean = 0x3161; + t.euro = 0x20ac; + t.evowelsignbengali = 0x09c7; + t.evowelsigndeva = 0x0947; + t.evowelsigngujarati = 0x0ac7; + t.exclam = 0x0021; + t.exclamarmenian = 0x055c; + t.exclamdbl = 0x203c; + t.exclamdown = 0x00a1; + t.exclamdownsmall = 0xf7a1; + t.exclammonospace = 0xff01; + t.exclamsmall = 0xf721; + t.existential = 0x2203; + t.ezh = 0x0292; + t.ezhcaron = 0x01ef; + t.ezhcurl = 0x0293; + t.ezhreversed = 0x01b9; + t.ezhtail = 0x01ba; + t.f = 0x0066; + t.fadeva = 0x095e; + t.fagurmukhi = 0x0a5e; + t.fahrenheit = 0x2109; + t.fathaarabic = 0x064e; + t.fathalowarabic = 0x064e; + t.fathatanarabic = 0x064b; + t.fbopomofo = 0x3108; + t.fcircle = 0x24d5; + t.fdotaccent = 0x1e1f; + t.feharabic = 0x0641; + t.feharmenian = 0x0586; + t.fehfinalarabic = 0xfed2; + t.fehinitialarabic = 0xfed3; + t.fehmedialarabic = 0xfed4; + t.feicoptic = 0x03e5; + t.female = 0x2640; + t.ff = 0xfb00; + t.f_f = 0xfb00; + t.ffi = 0xfb03; + t.f_f_i = 0xfb03; + t.ffl = 0xfb04; + t.f_f_l = 0xfb04; + t.fi = 0xfb01; + t.f_i = 0xfb01; + t.fifteencircle = 0x246e; + t.fifteenparen = 0x2482; + t.fifteenperiod = 0x2496; + t.figuredash = 0x2012; + t.filledbox = 0x25a0; + t.filledrect = 0x25ac; + t.finalkaf = 0x05da; + t.finalkafdagesh = 0xfb3a; + t.finalkafdageshhebrew = 0xfb3a; + t.finalkafhebrew = 0x05da; + t.finalmem = 0x05dd; + t.finalmemhebrew = 0x05dd; + t.finalnun = 0x05df; + t.finalnunhebrew = 0x05df; + t.finalpe = 0x05e3; + t.finalpehebrew = 0x05e3; + t.finaltsadi = 0x05e5; + t.finaltsadihebrew = 0x05e5; + t.firsttonechinese = 0x02c9; + t.fisheye = 0x25c9; + t.fitacyrillic = 0x0473; + t.five = 0x0035; + t.fivearabic = 0x0665; + t.fivebengali = 0x09eb; + t.fivecircle = 0x2464; + t.fivecircleinversesansserif = 0x278e; + t.fivedeva = 0x096b; + t.fiveeighths = 0x215d; + t.fivegujarati = 0x0aeb; + t.fivegurmukhi = 0x0a6b; + t.fivehackarabic = 0x0665; + t.fivehangzhou = 0x3025; + t.fiveideographicparen = 0x3224; + t.fiveinferior = 0x2085; + t.fivemonospace = 0xff15; + t.fiveoldstyle = 0xf735; + t.fiveparen = 0x2478; + t.fiveperiod = 0x248c; + t.fivepersian = 0x06f5; + t.fiveroman = 0x2174; + t.fivesuperior = 0x2075; + t.fivethai = 0x0e55; + t.fl = 0xfb02; + t.f_l = 0xfb02; + t.florin = 0x0192; + t.fmonospace = 0xff46; + t.fmsquare = 0x3399; + t.fofanthai = 0x0e1f; + t.fofathai = 0x0e1d; + t.fongmanthai = 0x0e4f; + t.forall = 0x2200; + t.four = 0x0034; + t.fourarabic = 0x0664; + t.fourbengali = 0x09ea; + t.fourcircle = 0x2463; + t.fourcircleinversesansserif = 0x278d; + t.fourdeva = 0x096a; + t.fourgujarati = 0x0aea; + t.fourgurmukhi = 0x0a6a; + t.fourhackarabic = 0x0664; + t.fourhangzhou = 0x3024; + t.fourideographicparen = 0x3223; + t.fourinferior = 0x2084; + t.fourmonospace = 0xff14; + t.fournumeratorbengali = 0x09f7; + t.fouroldstyle = 0xf734; + t.fourparen = 0x2477; + t.fourperiod = 0x248b; + t.fourpersian = 0x06f4; + t.fourroman = 0x2173; + t.foursuperior = 0x2074; + t.fourteencircle = 0x246d; + t.fourteenparen = 0x2481; + t.fourteenperiod = 0x2495; + t.fourthai = 0x0e54; + t.fourthtonechinese = 0x02cb; + t.fparen = 0x24a1; + t.fraction = 0x2044; + t.franc = 0x20a3; + t.g = 0x0067; + t.gabengali = 0x0997; + t.gacute = 0x01f5; + t.gadeva = 0x0917; + t.gafarabic = 0x06af; + t.gaffinalarabic = 0xfb93; + t.gafinitialarabic = 0xfb94; + t.gafmedialarabic = 0xfb95; + t.gagujarati = 0x0a97; + t.gagurmukhi = 0x0a17; + t.gahiragana = 0x304c; + t.gakatakana = 0x30ac; + t.gamma = 0x03b3; + t.gammalatinsmall = 0x0263; + t.gammasuperior = 0x02e0; + t.gangiacoptic = 0x03eb; + t.gbopomofo = 0x310d; + t.gbreve = 0x011f; + t.gcaron = 0x01e7; + t.gcedilla = 0x0123; + t.gcircle = 0x24d6; + t.gcircumflex = 0x011d; + t.gcommaaccent = 0x0123; + t.gdot = 0x0121; + t.gdotaccent = 0x0121; + t.gecyrillic = 0x0433; + t.gehiragana = 0x3052; + t.gekatakana = 0x30b2; + t.geometricallyequal = 0x2251; + t.gereshaccenthebrew = 0x059c; + t.gereshhebrew = 0x05f3; + t.gereshmuqdamhebrew = 0x059d; + t.germandbls = 0x00df; + t.gershayimaccenthebrew = 0x059e; + t.gershayimhebrew = 0x05f4; + t.getamark = 0x3013; + t.ghabengali = 0x0998; + t.ghadarmenian = 0x0572; + t.ghadeva = 0x0918; + t.ghagujarati = 0x0a98; + t.ghagurmukhi = 0x0a18; + t.ghainarabic = 0x063a; + t.ghainfinalarabic = 0xfece; + t.ghaininitialarabic = 0xfecf; + t.ghainmedialarabic = 0xfed0; + t.ghemiddlehookcyrillic = 0x0495; + t.ghestrokecyrillic = 0x0493; + t.gheupturncyrillic = 0x0491; + t.ghhadeva = 0x095a; + t.ghhagurmukhi = 0x0a5a; + t.ghook = 0x0260; + t.ghzsquare = 0x3393; + t.gihiragana = 0x304e; + t.gikatakana = 0x30ae; + t.gimarmenian = 0x0563; + t.gimel = 0x05d2; + t.gimeldagesh = 0xfb32; + t.gimeldageshhebrew = 0xfb32; + t.gimelhebrew = 0x05d2; + t.gjecyrillic = 0x0453; + t.glottalinvertedstroke = 0x01be; + t.glottalstop = 0x0294; + t.glottalstopinverted = 0x0296; + t.glottalstopmod = 0x02c0; + t.glottalstopreversed = 0x0295; + t.glottalstopreversedmod = 0x02c1; + t.glottalstopreversedsuperior = 0x02e4; + t.glottalstopstroke = 0x02a1; + t.glottalstopstrokereversed = 0x02a2; + t.gmacron = 0x1e21; + t.gmonospace = 0xff47; + t.gohiragana = 0x3054; + t.gokatakana = 0x30b4; + t.gparen = 0x24a2; + t.gpasquare = 0x33ac; + t.gradient = 0x2207; + t.grave = 0x0060; + t.gravebelowcmb = 0x0316; + t.gravecmb = 0x0300; + t.gravecomb = 0x0300; + t.gravedeva = 0x0953; + t.gravelowmod = 0x02ce; + t.gravemonospace = 0xff40; + t.gravetonecmb = 0x0340; + t.greater = 0x003e; + t.greaterequal = 0x2265; + t.greaterequalorless = 0x22db; + t.greatermonospace = 0xff1e; + t.greaterorequivalent = 0x2273; + t.greaterorless = 0x2277; + t.greateroverequal = 0x2267; + t.greatersmall = 0xfe65; + t.gscript = 0x0261; + t.gstroke = 0x01e5; + t.guhiragana = 0x3050; + t.guillemotleft = 0x00ab; + t.guillemotright = 0x00bb; + t.guilsinglleft = 0x2039; + t.guilsinglright = 0x203a; + t.gukatakana = 0x30b0; + t.guramusquare = 0x3318; + t.gysquare = 0x33c9; + t.h = 0x0068; + t.haabkhasiancyrillic = 0x04a9; + t.haaltonearabic = 0x06c1; + t.habengali = 0x09b9; + t.hadescendercyrillic = 0x04b3; + t.hadeva = 0x0939; + t.hagujarati = 0x0ab9; + t.hagurmukhi = 0x0a39; + t.haharabic = 0x062d; + t.hahfinalarabic = 0xfea2; + t.hahinitialarabic = 0xfea3; + t.hahiragana = 0x306f; + t.hahmedialarabic = 0xfea4; + t.haitusquare = 0x332a; + t.hakatakana = 0x30cf; + t.hakatakanahalfwidth = 0xff8a; + t.halantgurmukhi = 0x0a4d; + t.hamzaarabic = 0x0621; + t.hamzalowarabic = 0x0621; + t.hangulfiller = 0x3164; + t.hardsigncyrillic = 0x044a; + t.harpoonleftbarbup = 0x21bc; + t.harpoonrightbarbup = 0x21c0; + t.hasquare = 0x33ca; + t.hatafpatah = 0x05b2; + t.hatafpatah16 = 0x05b2; + t.hatafpatah23 = 0x05b2; + t.hatafpatah2f = 0x05b2; + t.hatafpatahhebrew = 0x05b2; + t.hatafpatahnarrowhebrew = 0x05b2; + t.hatafpatahquarterhebrew = 0x05b2; + t.hatafpatahwidehebrew = 0x05b2; + t.hatafqamats = 0x05b3; + t.hatafqamats1b = 0x05b3; + t.hatafqamats28 = 0x05b3; + t.hatafqamats34 = 0x05b3; + t.hatafqamatshebrew = 0x05b3; + t.hatafqamatsnarrowhebrew = 0x05b3; + t.hatafqamatsquarterhebrew = 0x05b3; + t.hatafqamatswidehebrew = 0x05b3; + t.hatafsegol = 0x05b1; + t.hatafsegol17 = 0x05b1; + t.hatafsegol24 = 0x05b1; + t.hatafsegol30 = 0x05b1; + t.hatafsegolhebrew = 0x05b1; + t.hatafsegolnarrowhebrew = 0x05b1; + t.hatafsegolquarterhebrew = 0x05b1; + t.hatafsegolwidehebrew = 0x05b1; + t.hbar = 0x0127; + t.hbopomofo = 0x310f; + t.hbrevebelow = 0x1e2b; + t.hcedilla = 0x1e29; + t.hcircle = 0x24d7; + t.hcircumflex = 0x0125; + t.hdieresis = 0x1e27; + t.hdotaccent = 0x1e23; + t.hdotbelow = 0x1e25; + t.he = 0x05d4; + t.heart = 0x2665; + t.heartsuitblack = 0x2665; + t.heartsuitwhite = 0x2661; + t.hedagesh = 0xfb34; + t.hedageshhebrew = 0xfb34; + t.hehaltonearabic = 0x06c1; + t.heharabic = 0x0647; + t.hehebrew = 0x05d4; + t.hehfinalaltonearabic = 0xfba7; + t.hehfinalalttwoarabic = 0xfeea; + t.hehfinalarabic = 0xfeea; + t.hehhamzaabovefinalarabic = 0xfba5; + t.hehhamzaaboveisolatedarabic = 0xfba4; + t.hehinitialaltonearabic = 0xfba8; + t.hehinitialarabic = 0xfeeb; + t.hehiragana = 0x3078; + t.hehmedialaltonearabic = 0xfba9; + t.hehmedialarabic = 0xfeec; + t.heiseierasquare = 0x337b; + t.hekatakana = 0x30d8; + t.hekatakanahalfwidth = 0xff8d; + t.hekutaarusquare = 0x3336; + t.henghook = 0x0267; + t.herutusquare = 0x3339; + t.het = 0x05d7; + t.hethebrew = 0x05d7; + t.hhook = 0x0266; + t.hhooksuperior = 0x02b1; + t.hieuhacirclekorean = 0x327b; + t.hieuhaparenkorean = 0x321b; + t.hieuhcirclekorean = 0x326d; + t.hieuhkorean = 0x314e; + t.hieuhparenkorean = 0x320d; + t.hihiragana = 0x3072; + t.hikatakana = 0x30d2; + t.hikatakanahalfwidth = 0xff8b; + t.hiriq = 0x05b4; + t.hiriq14 = 0x05b4; + t.hiriq21 = 0x05b4; + t.hiriq2d = 0x05b4; + t.hiriqhebrew = 0x05b4; + t.hiriqnarrowhebrew = 0x05b4; + t.hiriqquarterhebrew = 0x05b4; + t.hiriqwidehebrew = 0x05b4; + t.hlinebelow = 0x1e96; + t.hmonospace = 0xff48; + t.hoarmenian = 0x0570; + t.hohipthai = 0x0e2b; + t.hohiragana = 0x307b; + t.hokatakana = 0x30db; + t.hokatakanahalfwidth = 0xff8e; + t.holam = 0x05b9; + t.holam19 = 0x05b9; + t.holam26 = 0x05b9; + t.holam32 = 0x05b9; + t.holamhebrew = 0x05b9; + t.holamnarrowhebrew = 0x05b9; + t.holamquarterhebrew = 0x05b9; + t.holamwidehebrew = 0x05b9; + t.honokhukthai = 0x0e2e; + t.hookabovecomb = 0x0309; + t.hookcmb = 0x0309; + t.hookpalatalizedbelowcmb = 0x0321; + t.hookretroflexbelowcmb = 0x0322; + t.hoonsquare = 0x3342; + t.horicoptic = 0x03e9; + t.horizontalbar = 0x2015; + t.horncmb = 0x031b; + t.hotsprings = 0x2668; + t.house = 0x2302; + t.hparen = 0x24a3; + t.hsuperior = 0x02b0; + t.hturned = 0x0265; + t.huhiragana = 0x3075; + t.huiitosquare = 0x3333; + t.hukatakana = 0x30d5; + t.hukatakanahalfwidth = 0xff8c; + t.hungarumlaut = 0x02dd; + t.hungarumlautcmb = 0x030b; + t.hv = 0x0195; + t.hyphen = 0x002d; + t.hypheninferior = 0xf6e5; + t.hyphenmonospace = 0xff0d; + t.hyphensmall = 0xfe63; + t.hyphensuperior = 0xf6e6; + t.hyphentwo = 0x2010; + t.i = 0x0069; + t.iacute = 0x00ed; + t.iacyrillic = 0x044f; + t.ibengali = 0x0987; + t.ibopomofo = 0x3127; + t.ibreve = 0x012d; + t.icaron = 0x01d0; + t.icircle = 0x24d8; + t.icircumflex = 0x00ee; + t.icyrillic = 0x0456; + t.idblgrave = 0x0209; + t.ideographearthcircle = 0x328f; + t.ideographfirecircle = 0x328b; + t.ideographicallianceparen = 0x323f; + t.ideographiccallparen = 0x323a; + t.ideographiccentrecircle = 0x32a5; + t.ideographicclose = 0x3006; + t.ideographiccomma = 0x3001; + t.ideographiccommaleft = 0xff64; + t.ideographiccongratulationparen = 0x3237; + t.ideographiccorrectcircle = 0x32a3; + t.ideographicearthparen = 0x322f; + t.ideographicenterpriseparen = 0x323d; + t.ideographicexcellentcircle = 0x329d; + t.ideographicfestivalparen = 0x3240; + t.ideographicfinancialcircle = 0x3296; + t.ideographicfinancialparen = 0x3236; + t.ideographicfireparen = 0x322b; + t.ideographichaveparen = 0x3232; + t.ideographichighcircle = 0x32a4; + t.ideographiciterationmark = 0x3005; + t.ideographiclaborcircle = 0x3298; + t.ideographiclaborparen = 0x3238; + t.ideographicleftcircle = 0x32a7; + t.ideographiclowcircle = 0x32a6; + t.ideographicmedicinecircle = 0x32a9; + t.ideographicmetalparen = 0x322e; + t.ideographicmoonparen = 0x322a; + t.ideographicnameparen = 0x3234; + t.ideographicperiod = 0x3002; + t.ideographicprintcircle = 0x329e; + t.ideographicreachparen = 0x3243; + t.ideographicrepresentparen = 0x3239; + t.ideographicresourceparen = 0x323e; + t.ideographicrightcircle = 0x32a8; + t.ideographicsecretcircle = 0x3299; + t.ideographicselfparen = 0x3242; + t.ideographicsocietyparen = 0x3233; + t.ideographicspace = 0x3000; + t.ideographicspecialparen = 0x3235; + t.ideographicstockparen = 0x3231; + t.ideographicstudyparen = 0x323b; + t.ideographicsunparen = 0x3230; + t.ideographicsuperviseparen = 0x323c; + t.ideographicwaterparen = 0x322c; + t.ideographicwoodparen = 0x322d; + t.ideographiczero = 0x3007; + t.ideographmetalcircle = 0x328e; + t.ideographmooncircle = 0x328a; + t.ideographnamecircle = 0x3294; + t.ideographsuncircle = 0x3290; + t.ideographwatercircle = 0x328c; + t.ideographwoodcircle = 0x328d; + t.ideva = 0x0907; + t.idieresis = 0x00ef; + t.idieresisacute = 0x1e2f; + t.idieresiscyrillic = 0x04e5; + t.idotbelow = 0x1ecb; + t.iebrevecyrillic = 0x04d7; + t.iecyrillic = 0x0435; + t.ieungacirclekorean = 0x3275; + t.ieungaparenkorean = 0x3215; + t.ieungcirclekorean = 0x3267; + t.ieungkorean = 0x3147; + t.ieungparenkorean = 0x3207; + t.igrave = 0x00ec; + t.igujarati = 0x0a87; + t.igurmukhi = 0x0a07; + t.ihiragana = 0x3044; + t.ihookabove = 0x1ec9; + t.iibengali = 0x0988; + t.iicyrillic = 0x0438; + t.iideva = 0x0908; + t.iigujarati = 0x0a88; + t.iigurmukhi = 0x0a08; + t.iimatragurmukhi = 0x0a40; + t.iinvertedbreve = 0x020b; + t.iishortcyrillic = 0x0439; + t.iivowelsignbengali = 0x09c0; + t.iivowelsigndeva = 0x0940; + t.iivowelsigngujarati = 0x0ac0; + t.ij = 0x0133; + t.ikatakana = 0x30a4; + t.ikatakanahalfwidth = 0xff72; + t.ikorean = 0x3163; + t.ilde = 0x02dc; + t.iluyhebrew = 0x05ac; + t.imacron = 0x012b; + t.imacroncyrillic = 0x04e3; + t.imageorapproximatelyequal = 0x2253; + t.imatragurmukhi = 0x0a3f; + t.imonospace = 0xff49; + t.increment = 0x2206; + t.infinity = 0x221e; + t.iniarmenian = 0x056b; + t.integral = 0x222b; + t.integralbottom = 0x2321; + t.integralbt = 0x2321; + t.integralex = 0xf8f5; + t.integraltop = 0x2320; + t.integraltp = 0x2320; + t.intersection = 0x2229; + t.intisquare = 0x3305; + t.invbullet = 0x25d8; + t.invcircle = 0x25d9; + t.invsmileface = 0x263b; + t.iocyrillic = 0x0451; + t.iogonek = 0x012f; + t.iota = 0x03b9; + t.iotadieresis = 0x03ca; + t.iotadieresistonos = 0x0390; + t.iotalatin = 0x0269; + t.iotatonos = 0x03af; + t.iparen = 0x24a4; + t.irigurmukhi = 0x0a72; + t.ismallhiragana = 0x3043; + t.ismallkatakana = 0x30a3; + t.ismallkatakanahalfwidth = 0xff68; + t.issharbengali = 0x09fa; + t.istroke = 0x0268; + t.isuperior = 0xf6ed; + t.iterationhiragana = 0x309d; + t.iterationkatakana = 0x30fd; + t.itilde = 0x0129; + t.itildebelow = 0x1e2d; + t.iubopomofo = 0x3129; + t.iucyrillic = 0x044e; + t.ivowelsignbengali = 0x09bf; + t.ivowelsigndeva = 0x093f; + t.ivowelsigngujarati = 0x0abf; + t.izhitsacyrillic = 0x0475; + t.izhitsadblgravecyrillic = 0x0477; + t.j = 0x006a; + t.jaarmenian = 0x0571; + t.jabengali = 0x099c; + t.jadeva = 0x091c; + t.jagujarati = 0x0a9c; + t.jagurmukhi = 0x0a1c; + t.jbopomofo = 0x3110; + t.jcaron = 0x01f0; + t.jcircle = 0x24d9; + t.jcircumflex = 0x0135; + t.jcrossedtail = 0x029d; + t.jdotlessstroke = 0x025f; + t.jecyrillic = 0x0458; + t.jeemarabic = 0x062c; + t.jeemfinalarabic = 0xfe9e; + t.jeeminitialarabic = 0xfe9f; + t.jeemmedialarabic = 0xfea0; + t.jeharabic = 0x0698; + t.jehfinalarabic = 0xfb8b; + t.jhabengali = 0x099d; + t.jhadeva = 0x091d; + t.jhagujarati = 0x0a9d; + t.jhagurmukhi = 0x0a1d; + t.jheharmenian = 0x057b; + t.jis = 0x3004; + t.jmonospace = 0xff4a; + t.jparen = 0x24a5; + t.jsuperior = 0x02b2; + t.k = 0x006b; + t.kabashkircyrillic = 0x04a1; + t.kabengali = 0x0995; + t.kacute = 0x1e31; + t.kacyrillic = 0x043a; + t.kadescendercyrillic = 0x049b; + t.kadeva = 0x0915; + t.kaf = 0x05db; + t.kafarabic = 0x0643; + t.kafdagesh = 0xfb3b; + t.kafdageshhebrew = 0xfb3b; + t.kaffinalarabic = 0xfeda; + t.kafhebrew = 0x05db; + t.kafinitialarabic = 0xfedb; + t.kafmedialarabic = 0xfedc; + t.kafrafehebrew = 0xfb4d; + t.kagujarati = 0x0a95; + t.kagurmukhi = 0x0a15; + t.kahiragana = 0x304b; + t.kahookcyrillic = 0x04c4; + t.kakatakana = 0x30ab; + t.kakatakanahalfwidth = 0xff76; + t.kappa = 0x03ba; + t.kappasymbolgreek = 0x03f0; + t.kapyeounmieumkorean = 0x3171; + t.kapyeounphieuphkorean = 0x3184; + t.kapyeounpieupkorean = 0x3178; + t.kapyeounssangpieupkorean = 0x3179; + t.karoriisquare = 0x330d; + t.kashidaautoarabic = 0x0640; + t.kashidaautonosidebearingarabic = 0x0640; + t.kasmallkatakana = 0x30f5; + t.kasquare = 0x3384; + t.kasraarabic = 0x0650; + t.kasratanarabic = 0x064d; + t.kastrokecyrillic = 0x049f; + t.katahiraprolongmarkhalfwidth = 0xff70; + t.kaverticalstrokecyrillic = 0x049d; + t.kbopomofo = 0x310e; + t.kcalsquare = 0x3389; + t.kcaron = 0x01e9; + t.kcedilla = 0x0137; + t.kcircle = 0x24da; + t.kcommaaccent = 0x0137; + t.kdotbelow = 0x1e33; + t.keharmenian = 0x0584; + t.kehiragana = 0x3051; + t.kekatakana = 0x30b1; + t.kekatakanahalfwidth = 0xff79; + t.kenarmenian = 0x056f; + t.kesmallkatakana = 0x30f6; + t.kgreenlandic = 0x0138; + t.khabengali = 0x0996; + t.khacyrillic = 0x0445; + t.khadeva = 0x0916; + t.khagujarati = 0x0a96; + t.khagurmukhi = 0x0a16; + t.khaharabic = 0x062e; + t.khahfinalarabic = 0xfea6; + t.khahinitialarabic = 0xfea7; + t.khahmedialarabic = 0xfea8; + t.kheicoptic = 0x03e7; + t.khhadeva = 0x0959; + t.khhagurmukhi = 0x0a59; + t.khieukhacirclekorean = 0x3278; + t.khieukhaparenkorean = 0x3218; + t.khieukhcirclekorean = 0x326a; + t.khieukhkorean = 0x314b; + t.khieukhparenkorean = 0x320a; + t.khokhaithai = 0x0e02; + t.khokhonthai = 0x0e05; + t.khokhuatthai = 0x0e03; + t.khokhwaithai = 0x0e04; + t.khomutthai = 0x0e5b; + t.khook = 0x0199; + t.khorakhangthai = 0x0e06; + t.khzsquare = 0x3391; + t.kihiragana = 0x304d; + t.kikatakana = 0x30ad; + t.kikatakanahalfwidth = 0xff77; + t.kiroguramusquare = 0x3315; + t.kiromeetorusquare = 0x3316; + t.kirosquare = 0x3314; + t.kiyeokacirclekorean = 0x326e; + t.kiyeokaparenkorean = 0x320e; + t.kiyeokcirclekorean = 0x3260; + t.kiyeokkorean = 0x3131; + t.kiyeokparenkorean = 0x3200; + t.kiyeoksioskorean = 0x3133; + t.kjecyrillic = 0x045c; + t.klinebelow = 0x1e35; + t.klsquare = 0x3398; + t.kmcubedsquare = 0x33a6; + t.kmonospace = 0xff4b; + t.kmsquaredsquare = 0x33a2; + t.kohiragana = 0x3053; + t.kohmsquare = 0x33c0; + t.kokaithai = 0x0e01; + t.kokatakana = 0x30b3; + t.kokatakanahalfwidth = 0xff7a; + t.kooposquare = 0x331e; + t.koppacyrillic = 0x0481; + t.koreanstandardsymbol = 0x327f; + t.koroniscmb = 0x0343; + t.kparen = 0x24a6; + t.kpasquare = 0x33aa; + t.ksicyrillic = 0x046f; + t.ktsquare = 0x33cf; + t.kturned = 0x029e; + t.kuhiragana = 0x304f; + t.kukatakana = 0x30af; + t.kukatakanahalfwidth = 0xff78; + t.kvsquare = 0x33b8; + t.kwsquare = 0x33be; + t.l = 0x006c; + t.labengali = 0x09b2; + t.lacute = 0x013a; + t.ladeva = 0x0932; + t.lagujarati = 0x0ab2; + t.lagurmukhi = 0x0a32; + t.lakkhangyaothai = 0x0e45; + t.lamaleffinalarabic = 0xfefc; + t.lamalefhamzaabovefinalarabic = 0xfef8; + t.lamalefhamzaaboveisolatedarabic = 0xfef7; + t.lamalefhamzabelowfinalarabic = 0xfefa; + t.lamalefhamzabelowisolatedarabic = 0xfef9; + t.lamalefisolatedarabic = 0xfefb; + t.lamalefmaddaabovefinalarabic = 0xfef6; + t.lamalefmaddaaboveisolatedarabic = 0xfef5; + t.lamarabic = 0x0644; + t.lambda = 0x03bb; + t.lambdastroke = 0x019b; + t.lamed = 0x05dc; + t.lameddagesh = 0xfb3c; + t.lameddageshhebrew = 0xfb3c; + t.lamedhebrew = 0x05dc; + t.lamfinalarabic = 0xfede; + t.lamhahinitialarabic = 0xfcca; + t.laminitialarabic = 0xfedf; + t.lamjeeminitialarabic = 0xfcc9; + t.lamkhahinitialarabic = 0xfccb; + t.lamlamhehisolatedarabic = 0xfdf2; + t.lammedialarabic = 0xfee0; + t.lammeemhahinitialarabic = 0xfd88; + t.lammeeminitialarabic = 0xfccc; + t.largecircle = 0x25ef; + t.lbar = 0x019a; + t.lbelt = 0x026c; + t.lbopomofo = 0x310c; + t.lcaron = 0x013e; + t.lcedilla = 0x013c; + t.lcircle = 0x24db; + t.lcircumflexbelow = 0x1e3d; + t.lcommaaccent = 0x013c; + t.ldot = 0x0140; + t.ldotaccent = 0x0140; + t.ldotbelow = 0x1e37; + t.ldotbelowmacron = 0x1e39; + t.leftangleabovecmb = 0x031a; + t.lefttackbelowcmb = 0x0318; + t.less = 0x003c; + t.lessequal = 0x2264; + t.lessequalorgreater = 0x22da; + t.lessmonospace = 0xff1c; + t.lessorequivalent = 0x2272; + t.lessorgreater = 0x2276; + t.lessoverequal = 0x2266; + t.lesssmall = 0xfe64; + t.lezh = 0x026e; + t.lfblock = 0x258c; + t.lhookretroflex = 0x026d; + t.lira = 0x20a4; + t.liwnarmenian = 0x056c; + t.lj = 0x01c9; + t.ljecyrillic = 0x0459; + t.ll = 0xf6c0; + t.lladeva = 0x0933; + t.llagujarati = 0x0ab3; + t.llinebelow = 0x1e3b; + t.llladeva = 0x0934; + t.llvocalicbengali = 0x09e1; + t.llvocalicdeva = 0x0961; + t.llvocalicvowelsignbengali = 0x09e3; + t.llvocalicvowelsigndeva = 0x0963; + t.lmiddletilde = 0x026b; + t.lmonospace = 0xff4c; + t.lmsquare = 0x33d0; + t.lochulathai = 0x0e2c; + t.logicaland = 0x2227; + t.logicalnot = 0x00ac; + t.logicalnotreversed = 0x2310; + t.logicalor = 0x2228; + t.lolingthai = 0x0e25; + t.longs = 0x017f; + t.lowlinecenterline = 0xfe4e; + t.lowlinecmb = 0x0332; + t.lowlinedashed = 0xfe4d; + t.lozenge = 0x25ca; + t.lparen = 0x24a7; + t.lslash = 0x0142; + t.lsquare = 0x2113; + t.lsuperior = 0xf6ee; + t.ltshade = 0x2591; + t.luthai = 0x0e26; + t.lvocalicbengali = 0x098c; + t.lvocalicdeva = 0x090c; + t.lvocalicvowelsignbengali = 0x09e2; + t.lvocalicvowelsigndeva = 0x0962; + t.lxsquare = 0x33d3; + t.m = 0x006d; + t.mabengali = 0x09ae; + t.macron = 0x00af; + t.macronbelowcmb = 0x0331; + t.macroncmb = 0x0304; + t.macronlowmod = 0x02cd; + t.macronmonospace = 0xffe3; + t.macute = 0x1e3f; + t.madeva = 0x092e; + t.magujarati = 0x0aae; + t.magurmukhi = 0x0a2e; + t.mahapakhhebrew = 0x05a4; + t.mahapakhlefthebrew = 0x05a4; + t.mahiragana = 0x307e; + t.maichattawalowleftthai = 0xf895; + t.maichattawalowrightthai = 0xf894; + t.maichattawathai = 0x0e4b; + t.maichattawaupperleftthai = 0xf893; + t.maieklowleftthai = 0xf88c; + t.maieklowrightthai = 0xf88b; + t.maiekthai = 0x0e48; + t.maiekupperleftthai = 0xf88a; + t.maihanakatleftthai = 0xf884; + t.maihanakatthai = 0x0e31; + t.maitaikhuleftthai = 0xf889; + t.maitaikhuthai = 0x0e47; + t.maitholowleftthai = 0xf88f; + t.maitholowrightthai = 0xf88e; + t.maithothai = 0x0e49; + t.maithoupperleftthai = 0xf88d; + t.maitrilowleftthai = 0xf892; + t.maitrilowrightthai = 0xf891; + t.maitrithai = 0x0e4a; + t.maitriupperleftthai = 0xf890; + t.maiyamokthai = 0x0e46; + t.makatakana = 0x30de; + t.makatakanahalfwidth = 0xff8f; + t.male = 0x2642; + t.mansyonsquare = 0x3347; + t.maqafhebrew = 0x05be; + t.mars = 0x2642; + t.masoracirclehebrew = 0x05af; + t.masquare = 0x3383; + t.mbopomofo = 0x3107; + t.mbsquare = 0x33d4; + t.mcircle = 0x24dc; + t.mcubedsquare = 0x33a5; + t.mdotaccent = 0x1e41; + t.mdotbelow = 0x1e43; + t.meemarabic = 0x0645; + t.meemfinalarabic = 0xfee2; + t.meeminitialarabic = 0xfee3; + t.meemmedialarabic = 0xfee4; + t.meemmeeminitialarabic = 0xfcd1; + t.meemmeemisolatedarabic = 0xfc48; + t.meetorusquare = 0x334d; + t.mehiragana = 0x3081; + t.meizierasquare = 0x337e; + t.mekatakana = 0x30e1; + t.mekatakanahalfwidth = 0xff92; + t.mem = 0x05de; + t.memdagesh = 0xfb3e; + t.memdageshhebrew = 0xfb3e; + t.memhebrew = 0x05de; + t.menarmenian = 0x0574; + t.merkhahebrew = 0x05a5; + t.merkhakefulahebrew = 0x05a6; + t.merkhakefulalefthebrew = 0x05a6; + t.merkhalefthebrew = 0x05a5; + t.mhook = 0x0271; + t.mhzsquare = 0x3392; + t.middledotkatakanahalfwidth = 0xff65; + t.middot = 0x00b7; + t.mieumacirclekorean = 0x3272; + t.mieumaparenkorean = 0x3212; + t.mieumcirclekorean = 0x3264; + t.mieumkorean = 0x3141; + t.mieumpansioskorean = 0x3170; + t.mieumparenkorean = 0x3204; + t.mieumpieupkorean = 0x316e; + t.mieumsioskorean = 0x316f; + t.mihiragana = 0x307f; + t.mikatakana = 0x30df; + t.mikatakanahalfwidth = 0xff90; + t.minus = 0x2212; + t.minusbelowcmb = 0x0320; + t.minuscircle = 0x2296; + t.minusmod = 0x02d7; + t.minusplus = 0x2213; + t.minute = 0x2032; + t.miribaarusquare = 0x334a; + t.mirisquare = 0x3349; + t.mlonglegturned = 0x0270; + t.mlsquare = 0x3396; + t.mmcubedsquare = 0x33a3; + t.mmonospace = 0xff4d; + t.mmsquaredsquare = 0x339f; + t.mohiragana = 0x3082; + t.mohmsquare = 0x33c1; + t.mokatakana = 0x30e2; + t.mokatakanahalfwidth = 0xff93; + t.molsquare = 0x33d6; + t.momathai = 0x0e21; + t.moverssquare = 0x33a7; + t.moverssquaredsquare = 0x33a8; + t.mparen = 0x24a8; + t.mpasquare = 0x33ab; + t.mssquare = 0x33b3; + t.msuperior = 0xf6ef; + t.mturned = 0x026f; + t.mu = 0x00b5; + t.mu1 = 0x00b5; + t.muasquare = 0x3382; + t.muchgreater = 0x226b; + t.muchless = 0x226a; + t.mufsquare = 0x338c; + t.mugreek = 0x03bc; + t.mugsquare = 0x338d; + t.muhiragana = 0x3080; + t.mukatakana = 0x30e0; + t.mukatakanahalfwidth = 0xff91; + t.mulsquare = 0x3395; + t.multiply = 0x00d7; + t.mumsquare = 0x339b; + t.munahhebrew = 0x05a3; + t.munahlefthebrew = 0x05a3; + t.musicalnote = 0x266a; + t.musicalnotedbl = 0x266b; + t.musicflatsign = 0x266d; + t.musicsharpsign = 0x266f; + t.mussquare = 0x33b2; + t.muvsquare = 0x33b6; + t.muwsquare = 0x33bc; + t.mvmegasquare = 0x33b9; + t.mvsquare = 0x33b7; + t.mwmegasquare = 0x33bf; + t.mwsquare = 0x33bd; + t.n = 0x006e; + t.nabengali = 0x09a8; + t.nabla = 0x2207; + t.nacute = 0x0144; + t.nadeva = 0x0928; + t.nagujarati = 0x0aa8; + t.nagurmukhi = 0x0a28; + t.nahiragana = 0x306a; + t.nakatakana = 0x30ca; + t.nakatakanahalfwidth = 0xff85; + t.napostrophe = 0x0149; + t.nasquare = 0x3381; + t.nbopomofo = 0x310b; + t.nbspace = 0x00a0; + t.ncaron = 0x0148; + t.ncedilla = 0x0146; + t.ncircle = 0x24dd; + t.ncircumflexbelow = 0x1e4b; + t.ncommaaccent = 0x0146; + t.ndotaccent = 0x1e45; + t.ndotbelow = 0x1e47; + t.nehiragana = 0x306d; + t.nekatakana = 0x30cd; + t.nekatakanahalfwidth = 0xff88; + t.newsheqelsign = 0x20aa; + t.nfsquare = 0x338b; + t.ngabengali = 0x0999; + t.ngadeva = 0x0919; + t.ngagujarati = 0x0a99; + t.ngagurmukhi = 0x0a19; + t.ngonguthai = 0x0e07; + t.nhiragana = 0x3093; + t.nhookleft = 0x0272; + t.nhookretroflex = 0x0273; + t.nieunacirclekorean = 0x326f; + t.nieunaparenkorean = 0x320f; + t.nieuncieuckorean = 0x3135; + t.nieuncirclekorean = 0x3261; + t.nieunhieuhkorean = 0x3136; + t.nieunkorean = 0x3134; + t.nieunpansioskorean = 0x3168; + t.nieunparenkorean = 0x3201; + t.nieunsioskorean = 0x3167; + t.nieuntikeutkorean = 0x3166; + t.nihiragana = 0x306b; + t.nikatakana = 0x30cb; + t.nikatakanahalfwidth = 0xff86; + t.nikhahitleftthai = 0xf899; + t.nikhahitthai = 0x0e4d; + t.nine = 0x0039; + t.ninearabic = 0x0669; + t.ninebengali = 0x09ef; + t.ninecircle = 0x2468; + t.ninecircleinversesansserif = 0x2792; + t.ninedeva = 0x096f; + t.ninegujarati = 0x0aef; + t.ninegurmukhi = 0x0a6f; + t.ninehackarabic = 0x0669; + t.ninehangzhou = 0x3029; + t.nineideographicparen = 0x3228; + t.nineinferior = 0x2089; + t.ninemonospace = 0xff19; + t.nineoldstyle = 0xf739; + t.nineparen = 0x247c; + t.nineperiod = 0x2490; + t.ninepersian = 0x06f9; + t.nineroman = 0x2178; + t.ninesuperior = 0x2079; + t.nineteencircle = 0x2472; + t.nineteenparen = 0x2486; + t.nineteenperiod = 0x249a; + t.ninethai = 0x0e59; + t.nj = 0x01cc; + t.njecyrillic = 0x045a; + t.nkatakana = 0x30f3; + t.nkatakanahalfwidth = 0xff9d; + t.nlegrightlong = 0x019e; + t.nlinebelow = 0x1e49; + t.nmonospace = 0xff4e; + t.nmsquare = 0x339a; + t.nnabengali = 0x09a3; + t.nnadeva = 0x0923; + t.nnagujarati = 0x0aa3; + t.nnagurmukhi = 0x0a23; + t.nnnadeva = 0x0929; + t.nohiragana = 0x306e; + t.nokatakana = 0x30ce; + t.nokatakanahalfwidth = 0xff89; + t.nonbreakingspace = 0x00a0; + t.nonenthai = 0x0e13; + t.nonuthai = 0x0e19; + t.noonarabic = 0x0646; + t.noonfinalarabic = 0xfee6; + t.noonghunnaarabic = 0x06ba; + t.noonghunnafinalarabic = 0xfb9f; + t.nooninitialarabic = 0xfee7; + t.noonjeeminitialarabic = 0xfcd2; + t.noonjeemisolatedarabic = 0xfc4b; + t.noonmedialarabic = 0xfee8; + t.noonmeeminitialarabic = 0xfcd5; + t.noonmeemisolatedarabic = 0xfc4e; + t.noonnoonfinalarabic = 0xfc8d; + t.notcontains = 0x220c; + t.notelement = 0x2209; + t.notelementof = 0x2209; + t.notequal = 0x2260; + t.notgreater = 0x226f; + t.notgreaternorequal = 0x2271; + t.notgreaternorless = 0x2279; + t.notidentical = 0x2262; + t.notless = 0x226e; + t.notlessnorequal = 0x2270; + t.notparallel = 0x2226; + t.notprecedes = 0x2280; + t.notsubset = 0x2284; + t.notsucceeds = 0x2281; + t.notsuperset = 0x2285; + t.nowarmenian = 0x0576; + t.nparen = 0x24a9; + t.nssquare = 0x33b1; + t.nsuperior = 0x207f; + t.ntilde = 0x00f1; + t.nu = 0x03bd; + t.nuhiragana = 0x306c; + t.nukatakana = 0x30cc; + t.nukatakanahalfwidth = 0xff87; + t.nuktabengali = 0x09bc; + t.nuktadeva = 0x093c; + t.nuktagujarati = 0x0abc; + t.nuktagurmukhi = 0x0a3c; + t.numbersign = 0x0023; + t.numbersignmonospace = 0xff03; + t.numbersignsmall = 0xfe5f; + t.numeralsigngreek = 0x0374; + t.numeralsignlowergreek = 0x0375; + t.numero = 0x2116; + t.nun = 0x05e0; + t.nundagesh = 0xfb40; + t.nundageshhebrew = 0xfb40; + t.nunhebrew = 0x05e0; + t.nvsquare = 0x33b5; + t.nwsquare = 0x33bb; + t.nyabengali = 0x099e; + t.nyadeva = 0x091e; + t.nyagujarati = 0x0a9e; + t.nyagurmukhi = 0x0a1e; + t.o = 0x006f; + t.oacute = 0x00f3; + t.oangthai = 0x0e2d; + t.obarred = 0x0275; + t.obarredcyrillic = 0x04e9; + t.obarreddieresiscyrillic = 0x04eb; + t.obengali = 0x0993; + t.obopomofo = 0x311b; + t.obreve = 0x014f; + t.ocandradeva = 0x0911; + t.ocandragujarati = 0x0a91; + t.ocandravowelsigndeva = 0x0949; + t.ocandravowelsigngujarati = 0x0ac9; + t.ocaron = 0x01d2; + t.ocircle = 0x24de; + t.ocircumflex = 0x00f4; + t.ocircumflexacute = 0x1ed1; + t.ocircumflexdotbelow = 0x1ed9; + t.ocircumflexgrave = 0x1ed3; + t.ocircumflexhookabove = 0x1ed5; + t.ocircumflextilde = 0x1ed7; + t.ocyrillic = 0x043e; + t.odblacute = 0x0151; + t.odblgrave = 0x020d; + t.odeva = 0x0913; + t.odieresis = 0x00f6; + t.odieresiscyrillic = 0x04e7; + t.odotbelow = 0x1ecd; + t.oe = 0x0153; + t.oekorean = 0x315a; + t.ogonek = 0x02db; + t.ogonekcmb = 0x0328; + t.ograve = 0x00f2; + t.ogujarati = 0x0a93; + t.oharmenian = 0x0585; + t.ohiragana = 0x304a; + t.ohookabove = 0x1ecf; + t.ohorn = 0x01a1; + t.ohornacute = 0x1edb; + t.ohorndotbelow = 0x1ee3; + t.ohorngrave = 0x1edd; + t.ohornhookabove = 0x1edf; + t.ohorntilde = 0x1ee1; + t.ohungarumlaut = 0x0151; + t.oi = 0x01a3; + t.oinvertedbreve = 0x020f; + t.okatakana = 0x30aa; + t.okatakanahalfwidth = 0xff75; + t.okorean = 0x3157; + t.olehebrew = 0x05ab; + t.omacron = 0x014d; + t.omacronacute = 0x1e53; + t.omacrongrave = 0x1e51; + t.omdeva = 0x0950; + t.omega = 0x03c9; + t.omega1 = 0x03d6; + t.omegacyrillic = 0x0461; + t.omegalatinclosed = 0x0277; + t.omegaroundcyrillic = 0x047b; + t.omegatitlocyrillic = 0x047d; + t.omegatonos = 0x03ce; + t.omgujarati = 0x0ad0; + t.omicron = 0x03bf; + t.omicrontonos = 0x03cc; + t.omonospace = 0xff4f; + t.one = 0x0031; + t.onearabic = 0x0661; + t.onebengali = 0x09e7; + t.onecircle = 0x2460; + t.onecircleinversesansserif = 0x278a; + t.onedeva = 0x0967; + t.onedotenleader = 0x2024; + t.oneeighth = 0x215b; + t.onefitted = 0xf6dc; + t.onegujarati = 0x0ae7; + t.onegurmukhi = 0x0a67; + t.onehackarabic = 0x0661; + t.onehalf = 0x00bd; + t.onehangzhou = 0x3021; + t.oneideographicparen = 0x3220; + t.oneinferior = 0x2081; + t.onemonospace = 0xff11; + t.onenumeratorbengali = 0x09f4; + t.oneoldstyle = 0xf731; + t.oneparen = 0x2474; + t.oneperiod = 0x2488; + t.onepersian = 0x06f1; + t.onequarter = 0x00bc; + t.oneroman = 0x2170; + t.onesuperior = 0x00b9; + t.onethai = 0x0e51; + t.onethird = 0x2153; + t.oogonek = 0x01eb; + t.oogonekmacron = 0x01ed; + t.oogurmukhi = 0x0a13; + t.oomatragurmukhi = 0x0a4b; + t.oopen = 0x0254; + t.oparen = 0x24aa; + t.openbullet = 0x25e6; + t.option = 0x2325; + t.ordfeminine = 0x00aa; + t.ordmasculine = 0x00ba; + t.orthogonal = 0x221f; + t.oshortdeva = 0x0912; + t.oshortvowelsigndeva = 0x094a; + t.oslash = 0x00f8; + t.oslashacute = 0x01ff; + t.osmallhiragana = 0x3049; + t.osmallkatakana = 0x30a9; + t.osmallkatakanahalfwidth = 0xff6b; + t.ostrokeacute = 0x01ff; + t.osuperior = 0xf6f0; + t.otcyrillic = 0x047f; + t.otilde = 0x00f5; + t.otildeacute = 0x1e4d; + t.otildedieresis = 0x1e4f; + t.oubopomofo = 0x3121; + t.overline = 0x203e; + t.overlinecenterline = 0xfe4a; + t.overlinecmb = 0x0305; + t.overlinedashed = 0xfe49; + t.overlinedblwavy = 0xfe4c; + t.overlinewavy = 0xfe4b; + t.overscore = 0x00af; + t.ovowelsignbengali = 0x09cb; + t.ovowelsigndeva = 0x094b; + t.ovowelsigngujarati = 0x0acb; + t.p = 0x0070; + t.paampssquare = 0x3380; + t.paasentosquare = 0x332b; + t.pabengali = 0x09aa; + t.pacute = 0x1e55; + t.padeva = 0x092a; + t.pagedown = 0x21df; + t.pageup = 0x21de; + t.pagujarati = 0x0aaa; + t.pagurmukhi = 0x0a2a; + t.pahiragana = 0x3071; + t.paiyannoithai = 0x0e2f; + t.pakatakana = 0x30d1; + t.palatalizationcyrilliccmb = 0x0484; + t.palochkacyrillic = 0x04c0; + t.pansioskorean = 0x317f; + t.paragraph = 0x00b6; + t.parallel = 0x2225; + t.parenleft = 0x0028; + t.parenleftaltonearabic = 0xfd3e; + t.parenleftbt = 0xf8ed; + t.parenleftex = 0xf8ec; + t.parenleftinferior = 0x208d; + t.parenleftmonospace = 0xff08; + t.parenleftsmall = 0xfe59; + t.parenleftsuperior = 0x207d; + t.parenlefttp = 0xf8eb; + t.parenleftvertical = 0xfe35; + t.parenright = 0x0029; + t.parenrightaltonearabic = 0xfd3f; + t.parenrightbt = 0xf8f8; + t.parenrightex = 0xf8f7; + t.parenrightinferior = 0x208e; + t.parenrightmonospace = 0xff09; + t.parenrightsmall = 0xfe5a; + t.parenrightsuperior = 0x207e; + t.parenrighttp = 0xf8f6; + t.parenrightvertical = 0xfe36; + t.partialdiff = 0x2202; + t.paseqhebrew = 0x05c0; + t.pashtahebrew = 0x0599; + t.pasquare = 0x33a9; + t.patah = 0x05b7; + t.patah11 = 0x05b7; + t.patah1d = 0x05b7; + t.patah2a = 0x05b7; + t.patahhebrew = 0x05b7; + t.patahnarrowhebrew = 0x05b7; + t.patahquarterhebrew = 0x05b7; + t.patahwidehebrew = 0x05b7; + t.pazerhebrew = 0x05a1; + t.pbopomofo = 0x3106; + t.pcircle = 0x24df; + t.pdotaccent = 0x1e57; + t.pe = 0x05e4; + t.pecyrillic = 0x043f; + t.pedagesh = 0xfb44; + t.pedageshhebrew = 0xfb44; + t.peezisquare = 0x333b; + t.pefinaldageshhebrew = 0xfb43; + t.peharabic = 0x067e; + t.peharmenian = 0x057a; + t.pehebrew = 0x05e4; + t.pehfinalarabic = 0xfb57; + t.pehinitialarabic = 0xfb58; + t.pehiragana = 0x307a; + t.pehmedialarabic = 0xfb59; + t.pekatakana = 0x30da; + t.pemiddlehookcyrillic = 0x04a7; + t.perafehebrew = 0xfb4e; + t.percent = 0x0025; + t.percentarabic = 0x066a; + t.percentmonospace = 0xff05; + t.percentsmall = 0xfe6a; + t.period = 0x002e; + t.periodarmenian = 0x0589; + t.periodcentered = 0x00b7; + t.periodhalfwidth = 0xff61; + t.periodinferior = 0xf6e7; + t.periodmonospace = 0xff0e; + t.periodsmall = 0xfe52; + t.periodsuperior = 0xf6e8; + t.perispomenigreekcmb = 0x0342; + t.perpendicular = 0x22a5; + t.perthousand = 0x2030; + t.peseta = 0x20a7; + t.pfsquare = 0x338a; + t.phabengali = 0x09ab; + t.phadeva = 0x092b; + t.phagujarati = 0x0aab; + t.phagurmukhi = 0x0a2b; + t.phi = 0x03c6; + t.phi1 = 0x03d5; + t.phieuphacirclekorean = 0x327a; + t.phieuphaparenkorean = 0x321a; + t.phieuphcirclekorean = 0x326c; + t.phieuphkorean = 0x314d; + t.phieuphparenkorean = 0x320c; + t.philatin = 0x0278; + t.phinthuthai = 0x0e3a; + t.phisymbolgreek = 0x03d5; + t.phook = 0x01a5; + t.phophanthai = 0x0e1e; + t.phophungthai = 0x0e1c; + t.phosamphaothai = 0x0e20; + t.pi = 0x03c0; + t.pieupacirclekorean = 0x3273; + t.pieupaparenkorean = 0x3213; + t.pieupcieuckorean = 0x3176; + t.pieupcirclekorean = 0x3265; + t.pieupkiyeokkorean = 0x3172; + t.pieupkorean = 0x3142; + t.pieupparenkorean = 0x3205; + t.pieupsioskiyeokkorean = 0x3174; + t.pieupsioskorean = 0x3144; + t.pieupsiostikeutkorean = 0x3175; + t.pieupthieuthkorean = 0x3177; + t.pieuptikeutkorean = 0x3173; + t.pihiragana = 0x3074; + t.pikatakana = 0x30d4; + t.pisymbolgreek = 0x03d6; + t.piwrarmenian = 0x0583; + t.planckover2pi = 0x210f; + t.planckover2pi1 = 0x210f; + t.plus = 0x002b; + t.plusbelowcmb = 0x031f; + t.pluscircle = 0x2295; + t.plusminus = 0x00b1; + t.plusmod = 0x02d6; + t.plusmonospace = 0xff0b; + t.plussmall = 0xfe62; + t.plussuperior = 0x207a; + t.pmonospace = 0xff50; + t.pmsquare = 0x33d8; + t.pohiragana = 0x307d; + t.pointingindexdownwhite = 0x261f; + t.pointingindexleftwhite = 0x261c; + t.pointingindexrightwhite = 0x261e; + t.pointingindexupwhite = 0x261d; + t.pokatakana = 0x30dd; + t.poplathai = 0x0e1b; + t.postalmark = 0x3012; + t.postalmarkface = 0x3020; + t.pparen = 0x24ab; + t.precedes = 0x227a; + t.prescription = 0x211e; + t.primemod = 0x02b9; + t.primereversed = 0x2035; + t.product = 0x220f; + t.projective = 0x2305; + t.prolongedkana = 0x30fc; + t.propellor = 0x2318; + t.propersubset = 0x2282; + t.propersuperset = 0x2283; + t.proportion = 0x2237; + t.proportional = 0x221d; + t.psi = 0x03c8; + t.psicyrillic = 0x0471; + t.psilipneumatacyrilliccmb = 0x0486; + t.pssquare = 0x33b0; + t.puhiragana = 0x3077; + t.pukatakana = 0x30d7; + t.pvsquare = 0x33b4; + t.pwsquare = 0x33ba; + t.q = 0x0071; + t.qadeva = 0x0958; + t.qadmahebrew = 0x05a8; + t.qafarabic = 0x0642; + t.qaffinalarabic = 0xfed6; + t.qafinitialarabic = 0xfed7; + t.qafmedialarabic = 0xfed8; + t.qamats = 0x05b8; + t.qamats10 = 0x05b8; + t.qamats1a = 0x05b8; + t.qamats1c = 0x05b8; + t.qamats27 = 0x05b8; + t.qamats29 = 0x05b8; + t.qamats33 = 0x05b8; + t.qamatsde = 0x05b8; + t.qamatshebrew = 0x05b8; + t.qamatsnarrowhebrew = 0x05b8; + t.qamatsqatanhebrew = 0x05b8; + t.qamatsqatannarrowhebrew = 0x05b8; + t.qamatsqatanquarterhebrew = 0x05b8; + t.qamatsqatanwidehebrew = 0x05b8; + t.qamatsquarterhebrew = 0x05b8; + t.qamatswidehebrew = 0x05b8; + t.qarneyparahebrew = 0x059f; + t.qbopomofo = 0x3111; + t.qcircle = 0x24e0; + t.qhook = 0x02a0; + t.qmonospace = 0xff51; + t.qof = 0x05e7; + t.qofdagesh = 0xfb47; + t.qofdageshhebrew = 0xfb47; + t.qofhebrew = 0x05e7; + t.qparen = 0x24ac; + t.quarternote = 0x2669; + t.qubuts = 0x05bb; + t.qubuts18 = 0x05bb; + t.qubuts25 = 0x05bb; + t.qubuts31 = 0x05bb; + t.qubutshebrew = 0x05bb; + t.qubutsnarrowhebrew = 0x05bb; + t.qubutsquarterhebrew = 0x05bb; + t.qubutswidehebrew = 0x05bb; + t.question = 0x003f; + t.questionarabic = 0x061f; + t.questionarmenian = 0x055e; + t.questiondown = 0x00bf; + t.questiondownsmall = 0xf7bf; + t.questiongreek = 0x037e; + t.questionmonospace = 0xff1f; + t.questionsmall = 0xf73f; + t.quotedbl = 0x0022; + t.quotedblbase = 0x201e; + t.quotedblleft = 0x201c; + t.quotedblmonospace = 0xff02; + t.quotedblprime = 0x301e; + t.quotedblprimereversed = 0x301d; + t.quotedblright = 0x201d; + t.quoteleft = 0x2018; + t.quoteleftreversed = 0x201b; + t.quotereversed = 0x201b; + t.quoteright = 0x2019; + t.quoterightn = 0x0149; + t.quotesinglbase = 0x201a; + t.quotesingle = 0x0027; + t.quotesinglemonospace = 0xff07; + t.r = 0x0072; + t.raarmenian = 0x057c; + t.rabengali = 0x09b0; + t.racute = 0x0155; + t.radeva = 0x0930; + t.radical = 0x221a; + t.radicalex = 0xf8e5; + t.radoverssquare = 0x33ae; + t.radoverssquaredsquare = 0x33af; + t.radsquare = 0x33ad; + t.rafe = 0x05bf; + t.rafehebrew = 0x05bf; + t.ragujarati = 0x0ab0; + t.ragurmukhi = 0x0a30; + t.rahiragana = 0x3089; + t.rakatakana = 0x30e9; + t.rakatakanahalfwidth = 0xff97; + t.ralowerdiagonalbengali = 0x09f1; + t.ramiddlediagonalbengali = 0x09f0; + t.ramshorn = 0x0264; + t.ratio = 0x2236; + t.rbopomofo = 0x3116; + t.rcaron = 0x0159; + t.rcedilla = 0x0157; + t.rcircle = 0x24e1; + t.rcommaaccent = 0x0157; + t.rdblgrave = 0x0211; + t.rdotaccent = 0x1e59; + t.rdotbelow = 0x1e5b; + t.rdotbelowmacron = 0x1e5d; + t.referencemark = 0x203b; + t.reflexsubset = 0x2286; + t.reflexsuperset = 0x2287; + t.registered = 0x00ae; + t.registersans = 0xf8e8; + t.registerserif = 0xf6da; + t.reharabic = 0x0631; + t.reharmenian = 0x0580; + t.rehfinalarabic = 0xfeae; + t.rehiragana = 0x308c; + t.rekatakana = 0x30ec; + t.rekatakanahalfwidth = 0xff9a; + t.resh = 0x05e8; + t.reshdageshhebrew = 0xfb48; + t.reshhebrew = 0x05e8; + t.reversedtilde = 0x223d; + t.reviahebrew = 0x0597; + t.reviamugrashhebrew = 0x0597; + t.revlogicalnot = 0x2310; + t.rfishhook = 0x027e; + t.rfishhookreversed = 0x027f; + t.rhabengali = 0x09dd; + t.rhadeva = 0x095d; + t.rho = 0x03c1; + t.rhook = 0x027d; + t.rhookturned = 0x027b; + t.rhookturnedsuperior = 0x02b5; + t.rhosymbolgreek = 0x03f1; + t.rhotichookmod = 0x02de; + t.rieulacirclekorean = 0x3271; + t.rieulaparenkorean = 0x3211; + t.rieulcirclekorean = 0x3263; + t.rieulhieuhkorean = 0x3140; + t.rieulkiyeokkorean = 0x313a; + t.rieulkiyeoksioskorean = 0x3169; + t.rieulkorean = 0x3139; + t.rieulmieumkorean = 0x313b; + t.rieulpansioskorean = 0x316c; + t.rieulparenkorean = 0x3203; + t.rieulphieuphkorean = 0x313f; + t.rieulpieupkorean = 0x313c; + t.rieulpieupsioskorean = 0x316b; + t.rieulsioskorean = 0x313d; + t.rieulthieuthkorean = 0x313e; + t.rieultikeutkorean = 0x316a; + t.rieulyeorinhieuhkorean = 0x316d; + t.rightangle = 0x221f; + t.righttackbelowcmb = 0x0319; + t.righttriangle = 0x22bf; + t.rihiragana = 0x308a; + t.rikatakana = 0x30ea; + t.rikatakanahalfwidth = 0xff98; + t.ring = 0x02da; + t.ringbelowcmb = 0x0325; + t.ringcmb = 0x030a; + t.ringhalfleft = 0x02bf; + t.ringhalfleftarmenian = 0x0559; + t.ringhalfleftbelowcmb = 0x031c; + t.ringhalfleftcentered = 0x02d3; + t.ringhalfright = 0x02be; + t.ringhalfrightbelowcmb = 0x0339; + t.ringhalfrightcentered = 0x02d2; + t.rinvertedbreve = 0x0213; + t.rittorusquare = 0x3351; + t.rlinebelow = 0x1e5f; + t.rlongleg = 0x027c; + t.rlonglegturned = 0x027a; + t.rmonospace = 0xff52; + t.rohiragana = 0x308d; + t.rokatakana = 0x30ed; + t.rokatakanahalfwidth = 0xff9b; + t.roruathai = 0x0e23; + t.rparen = 0x24ad; + t.rrabengali = 0x09dc; + t.rradeva = 0x0931; + t.rragurmukhi = 0x0a5c; + t.rreharabic = 0x0691; + t.rrehfinalarabic = 0xfb8d; + t.rrvocalicbengali = 0x09e0; + t.rrvocalicdeva = 0x0960; + t.rrvocalicgujarati = 0x0ae0; + t.rrvocalicvowelsignbengali = 0x09c4; + t.rrvocalicvowelsigndeva = 0x0944; + t.rrvocalicvowelsigngujarati = 0x0ac4; + t.rsuperior = 0xf6f1; + t.rtblock = 0x2590; + t.rturned = 0x0279; + t.rturnedsuperior = 0x02b4; + t.ruhiragana = 0x308b; + t.rukatakana = 0x30eb; + t.rukatakanahalfwidth = 0xff99; + t.rupeemarkbengali = 0x09f2; + t.rupeesignbengali = 0x09f3; + t.rupiah = 0xf6dd; + t.ruthai = 0x0e24; + t.rvocalicbengali = 0x098b; + t.rvocalicdeva = 0x090b; + t.rvocalicgujarati = 0x0a8b; + t.rvocalicvowelsignbengali = 0x09c3; + t.rvocalicvowelsigndeva = 0x0943; + t.rvocalicvowelsigngujarati = 0x0ac3; + t.s = 0x0073; + t.sabengali = 0x09b8; + t.sacute = 0x015b; + t.sacutedotaccent = 0x1e65; + t.sadarabic = 0x0635; + t.sadeva = 0x0938; + t.sadfinalarabic = 0xfeba; + t.sadinitialarabic = 0xfebb; + t.sadmedialarabic = 0xfebc; + t.sagujarati = 0x0ab8; + t.sagurmukhi = 0x0a38; + t.sahiragana = 0x3055; + t.sakatakana = 0x30b5; + t.sakatakanahalfwidth = 0xff7b; + t.sallallahoualayhewasallamarabic = 0xfdfa; + t.samekh = 0x05e1; + t.samekhdagesh = 0xfb41; + t.samekhdageshhebrew = 0xfb41; + t.samekhhebrew = 0x05e1; + t.saraaathai = 0x0e32; + t.saraaethai = 0x0e41; + t.saraaimaimalaithai = 0x0e44; + t.saraaimaimuanthai = 0x0e43; + t.saraamthai = 0x0e33; + t.saraathai = 0x0e30; + t.saraethai = 0x0e40; + t.saraiileftthai = 0xf886; + t.saraiithai = 0x0e35; + t.saraileftthai = 0xf885; + t.saraithai = 0x0e34; + t.saraothai = 0x0e42; + t.saraueeleftthai = 0xf888; + t.saraueethai = 0x0e37; + t.saraueleftthai = 0xf887; + t.sarauethai = 0x0e36; + t.sarauthai = 0x0e38; + t.sarauuthai = 0x0e39; + t.sbopomofo = 0x3119; + t.scaron = 0x0161; + t.scarondotaccent = 0x1e67; + t.scedilla = 0x015f; + t.schwa = 0x0259; + t.schwacyrillic = 0x04d9; + t.schwadieresiscyrillic = 0x04db; + t.schwahook = 0x025a; + t.scircle = 0x24e2; + t.scircumflex = 0x015d; + t.scommaaccent = 0x0219; + t.sdotaccent = 0x1e61; + t.sdotbelow = 0x1e63; + t.sdotbelowdotaccent = 0x1e69; + t.seagullbelowcmb = 0x033c; + t.second = 0x2033; + t.secondtonechinese = 0x02ca; + t.section = 0x00a7; + t.seenarabic = 0x0633; + t.seenfinalarabic = 0xfeb2; + t.seeninitialarabic = 0xfeb3; + t.seenmedialarabic = 0xfeb4; + t.segol = 0x05b6; + t.segol13 = 0x05b6; + t.segol1f = 0x05b6; + t.segol2c = 0x05b6; + t.segolhebrew = 0x05b6; + t.segolnarrowhebrew = 0x05b6; + t.segolquarterhebrew = 0x05b6; + t.segoltahebrew = 0x0592; + t.segolwidehebrew = 0x05b6; + t.seharmenian = 0x057d; + t.sehiragana = 0x305b; + t.sekatakana = 0x30bb; + t.sekatakanahalfwidth = 0xff7e; + t.semicolon = 0x003b; + t.semicolonarabic = 0x061b; + t.semicolonmonospace = 0xff1b; + t.semicolonsmall = 0xfe54; + t.semivoicedmarkkana = 0x309c; + t.semivoicedmarkkanahalfwidth = 0xff9f; + t.sentisquare = 0x3322; + t.sentosquare = 0x3323; + t.seven = 0x0037; + t.sevenarabic = 0x0667; + t.sevenbengali = 0x09ed; + t.sevencircle = 0x2466; + t.sevencircleinversesansserif = 0x2790; + t.sevendeva = 0x096d; + t.seveneighths = 0x215e; + t.sevengujarati = 0x0aed; + t.sevengurmukhi = 0x0a6d; + t.sevenhackarabic = 0x0667; + t.sevenhangzhou = 0x3027; + t.sevenideographicparen = 0x3226; + t.seveninferior = 0x2087; + t.sevenmonospace = 0xff17; + t.sevenoldstyle = 0xf737; + t.sevenparen = 0x247a; + t.sevenperiod = 0x248e; + t.sevenpersian = 0x06f7; + t.sevenroman = 0x2176; + t.sevensuperior = 0x2077; + t.seventeencircle = 0x2470; + t.seventeenparen = 0x2484; + t.seventeenperiod = 0x2498; + t.seventhai = 0x0e57; + t.sfthyphen = 0x00ad; + t.shaarmenian = 0x0577; + t.shabengali = 0x09b6; + t.shacyrillic = 0x0448; + t.shaddaarabic = 0x0651; + t.shaddadammaarabic = 0xfc61; + t.shaddadammatanarabic = 0xfc5e; + t.shaddafathaarabic = 0xfc60; + t.shaddakasraarabic = 0xfc62; + t.shaddakasratanarabic = 0xfc5f; + t.shade = 0x2592; + t.shadedark = 0x2593; + t.shadelight = 0x2591; + t.shademedium = 0x2592; + t.shadeva = 0x0936; + t.shagujarati = 0x0ab6; + t.shagurmukhi = 0x0a36; + t.shalshelethebrew = 0x0593; + t.shbopomofo = 0x3115; + t.shchacyrillic = 0x0449; + t.sheenarabic = 0x0634; + t.sheenfinalarabic = 0xfeb6; + t.sheeninitialarabic = 0xfeb7; + t.sheenmedialarabic = 0xfeb8; + t.sheicoptic = 0x03e3; + t.sheqel = 0x20aa; + t.sheqelhebrew = 0x20aa; + t.sheva = 0x05b0; + t.sheva115 = 0x05b0; + t.sheva15 = 0x05b0; + t.sheva22 = 0x05b0; + t.sheva2e = 0x05b0; + t.shevahebrew = 0x05b0; + t.shevanarrowhebrew = 0x05b0; + t.shevaquarterhebrew = 0x05b0; + t.shevawidehebrew = 0x05b0; + t.shhacyrillic = 0x04bb; + t.shimacoptic = 0x03ed; + t.shin = 0x05e9; + t.shindagesh = 0xfb49; + t.shindageshhebrew = 0xfb49; + t.shindageshshindot = 0xfb2c; + t.shindageshshindothebrew = 0xfb2c; + t.shindageshsindot = 0xfb2d; + t.shindageshsindothebrew = 0xfb2d; + t.shindothebrew = 0x05c1; + t.shinhebrew = 0x05e9; + t.shinshindot = 0xfb2a; + t.shinshindothebrew = 0xfb2a; + t.shinsindot = 0xfb2b; + t.shinsindothebrew = 0xfb2b; + t.shook = 0x0282; + t.sigma = 0x03c3; + t.sigma1 = 0x03c2; + t.sigmafinal = 0x03c2; + t.sigmalunatesymbolgreek = 0x03f2; + t.sihiragana = 0x3057; + t.sikatakana = 0x30b7; + t.sikatakanahalfwidth = 0xff7c; + t.siluqhebrew = 0x05bd; + t.siluqlefthebrew = 0x05bd; + t.similar = 0x223c; + t.sindothebrew = 0x05c2; + t.siosacirclekorean = 0x3274; + t.siosaparenkorean = 0x3214; + t.sioscieuckorean = 0x317e; + t.sioscirclekorean = 0x3266; + t.sioskiyeokkorean = 0x317a; + t.sioskorean = 0x3145; + t.siosnieunkorean = 0x317b; + t.siosparenkorean = 0x3206; + t.siospieupkorean = 0x317d; + t.siostikeutkorean = 0x317c; + t.six = 0x0036; + t.sixarabic = 0x0666; + t.sixbengali = 0x09ec; + t.sixcircle = 0x2465; + t.sixcircleinversesansserif = 0x278f; + t.sixdeva = 0x096c; + t.sixgujarati = 0x0aec; + t.sixgurmukhi = 0x0a6c; + t.sixhackarabic = 0x0666; + t.sixhangzhou = 0x3026; + t.sixideographicparen = 0x3225; + t.sixinferior = 0x2086; + t.sixmonospace = 0xff16; + t.sixoldstyle = 0xf736; + t.sixparen = 0x2479; + t.sixperiod = 0x248d; + t.sixpersian = 0x06f6; + t.sixroman = 0x2175; + t.sixsuperior = 0x2076; + t.sixteencircle = 0x246f; + t.sixteencurrencydenominatorbengali = 0x09f9; + t.sixteenparen = 0x2483; + t.sixteenperiod = 0x2497; + t.sixthai = 0x0e56; + t.slash = 0x002f; + t.slashmonospace = 0xff0f; + t.slong = 0x017f; + t.slongdotaccent = 0x1e9b; + t.smileface = 0x263a; + t.smonospace = 0xff53; + t.sofpasuqhebrew = 0x05c3; + t.softhyphen = 0x00ad; + t.softsigncyrillic = 0x044c; + t.sohiragana = 0x305d; + t.sokatakana = 0x30bd; + t.sokatakanahalfwidth = 0xff7f; + t.soliduslongoverlaycmb = 0x0338; + t.solidusshortoverlaycmb = 0x0337; + t.sorusithai = 0x0e29; + t.sosalathai = 0x0e28; + t.sosothai = 0x0e0b; + t.sosuathai = 0x0e2a; + t.space = 0x0020; + t.spacehackarabic = 0x0020; + t.spade = 0x2660; + t.spadesuitblack = 0x2660; + t.spadesuitwhite = 0x2664; + t.sparen = 0x24ae; + t.squarebelowcmb = 0x033b; + t.squarecc = 0x33c4; + t.squarecm = 0x339d; + t.squarediagonalcrosshatchfill = 0x25a9; + t.squarehorizontalfill = 0x25a4; + t.squarekg = 0x338f; + t.squarekm = 0x339e; + t.squarekmcapital = 0x33ce; + t.squareln = 0x33d1; + t.squarelog = 0x33d2; + t.squaremg = 0x338e; + t.squaremil = 0x33d5; + t.squaremm = 0x339c; + t.squaremsquared = 0x33a1; + t.squareorthogonalcrosshatchfill = 0x25a6; + t.squareupperlefttolowerrightfill = 0x25a7; + t.squareupperrighttolowerleftfill = 0x25a8; + t.squareverticalfill = 0x25a5; + t.squarewhitewithsmallblack = 0x25a3; + t.srsquare = 0x33db; + t.ssabengali = 0x09b7; + t.ssadeva = 0x0937; + t.ssagujarati = 0x0ab7; + t.ssangcieuckorean = 0x3149; + t.ssanghieuhkorean = 0x3185; + t.ssangieungkorean = 0x3180; + t.ssangkiyeokkorean = 0x3132; + t.ssangnieunkorean = 0x3165; + t.ssangpieupkorean = 0x3143; + t.ssangsioskorean = 0x3146; + t.ssangtikeutkorean = 0x3138; + t.ssuperior = 0xf6f2; + t.sterling = 0x00a3; + t.sterlingmonospace = 0xffe1; + t.strokelongoverlaycmb = 0x0336; + t.strokeshortoverlaycmb = 0x0335; + t.subset = 0x2282; + t.subsetnotequal = 0x228a; + t.subsetorequal = 0x2286; + t.succeeds = 0x227b; + t.suchthat = 0x220b; + t.suhiragana = 0x3059; + t.sukatakana = 0x30b9; + t.sukatakanahalfwidth = 0xff7d; + t.sukunarabic = 0x0652; + t.summation = 0x2211; + t.sun = 0x263c; + t.superset = 0x2283; + t.supersetnotequal = 0x228b; + t.supersetorequal = 0x2287; + t.svsquare = 0x33dc; + t.syouwaerasquare = 0x337c; + t.t = 0x0074; + t.tabengali = 0x09a4; + t.tackdown = 0x22a4; + t.tackleft = 0x22a3; + t.tadeva = 0x0924; + t.tagujarati = 0x0aa4; + t.tagurmukhi = 0x0a24; + t.taharabic = 0x0637; + t.tahfinalarabic = 0xfec2; + t.tahinitialarabic = 0xfec3; + t.tahiragana = 0x305f; + t.tahmedialarabic = 0xfec4; + t.taisyouerasquare = 0x337d; + t.takatakana = 0x30bf; + t.takatakanahalfwidth = 0xff80; + t.tatweelarabic = 0x0640; + t.tau = 0x03c4; + t.tav = 0x05ea; + t.tavdages = 0xfb4a; + t.tavdagesh = 0xfb4a; + t.tavdageshhebrew = 0xfb4a; + t.tavhebrew = 0x05ea; + t.tbar = 0x0167; + t.tbopomofo = 0x310a; + t.tcaron = 0x0165; + t.tccurl = 0x02a8; + t.tcedilla = 0x0163; + t.tcheharabic = 0x0686; + t.tchehfinalarabic = 0xfb7b; + t.tchehinitialarabic = 0xfb7c; + t.tchehmedialarabic = 0xfb7d; + t.tcircle = 0x24e3; + t.tcircumflexbelow = 0x1e71; + t.tcommaaccent = 0x0163; + t.tdieresis = 0x1e97; + t.tdotaccent = 0x1e6b; + t.tdotbelow = 0x1e6d; + t.tecyrillic = 0x0442; + t.tedescendercyrillic = 0x04ad; + t.teharabic = 0x062a; + t.tehfinalarabic = 0xfe96; + t.tehhahinitialarabic = 0xfca2; + t.tehhahisolatedarabic = 0xfc0c; + t.tehinitialarabic = 0xfe97; + t.tehiragana = 0x3066; + t.tehjeeminitialarabic = 0xfca1; + t.tehjeemisolatedarabic = 0xfc0b; + t.tehmarbutaarabic = 0x0629; + t.tehmarbutafinalarabic = 0xfe94; + t.tehmedialarabic = 0xfe98; + t.tehmeeminitialarabic = 0xfca4; + t.tehmeemisolatedarabic = 0xfc0e; + t.tehnoonfinalarabic = 0xfc73; + t.tekatakana = 0x30c6; + t.tekatakanahalfwidth = 0xff83; + t.telephone = 0x2121; + t.telephoneblack = 0x260e; + t.telishagedolahebrew = 0x05a0; + t.telishaqetanahebrew = 0x05a9; + t.tencircle = 0x2469; + t.tenideographicparen = 0x3229; + t.tenparen = 0x247d; + t.tenperiod = 0x2491; + t.tenroman = 0x2179; + t.tesh = 0x02a7; + t.tet = 0x05d8; + t.tetdagesh = 0xfb38; + t.tetdageshhebrew = 0xfb38; + t.tethebrew = 0x05d8; + t.tetsecyrillic = 0x04b5; + t.tevirhebrew = 0x059b; + t.tevirlefthebrew = 0x059b; + t.thabengali = 0x09a5; + t.thadeva = 0x0925; + t.thagujarati = 0x0aa5; + t.thagurmukhi = 0x0a25; + t.thalarabic = 0x0630; + t.thalfinalarabic = 0xfeac; + t.thanthakhatlowleftthai = 0xf898; + t.thanthakhatlowrightthai = 0xf897; + t.thanthakhatthai = 0x0e4c; + t.thanthakhatupperleftthai = 0xf896; + t.theharabic = 0x062b; + t.thehfinalarabic = 0xfe9a; + t.thehinitialarabic = 0xfe9b; + t.thehmedialarabic = 0xfe9c; + t.thereexists = 0x2203; + t.therefore = 0x2234; + t.theta = 0x03b8; + t.theta1 = 0x03d1; + t.thetasymbolgreek = 0x03d1; + t.thieuthacirclekorean = 0x3279; + t.thieuthaparenkorean = 0x3219; + t.thieuthcirclekorean = 0x326b; + t.thieuthkorean = 0x314c; + t.thieuthparenkorean = 0x320b; + t.thirteencircle = 0x246c; + t.thirteenparen = 0x2480; + t.thirteenperiod = 0x2494; + t.thonangmonthothai = 0x0e11; + t.thook = 0x01ad; + t.thophuthaothai = 0x0e12; + t.thorn = 0x00fe; + t.thothahanthai = 0x0e17; + t.thothanthai = 0x0e10; + t.thothongthai = 0x0e18; + t.thothungthai = 0x0e16; + t.thousandcyrillic = 0x0482; + t.thousandsseparatorarabic = 0x066c; + t.thousandsseparatorpersian = 0x066c; + t.three = 0x0033; + t.threearabic = 0x0663; + t.threebengali = 0x09e9; + t.threecircle = 0x2462; + t.threecircleinversesansserif = 0x278c; + t.threedeva = 0x0969; + t.threeeighths = 0x215c; + t.threegujarati = 0x0ae9; + t.threegurmukhi = 0x0a69; + t.threehackarabic = 0x0663; + t.threehangzhou = 0x3023; + t.threeideographicparen = 0x3222; + t.threeinferior = 0x2083; + t.threemonospace = 0xff13; + t.threenumeratorbengali = 0x09f6; + t.threeoldstyle = 0xf733; + t.threeparen = 0x2476; + t.threeperiod = 0x248a; + t.threepersian = 0x06f3; + t.threequarters = 0x00be; + t.threequartersemdash = 0xf6de; + t.threeroman = 0x2172; + t.threesuperior = 0x00b3; + t.threethai = 0x0e53; + t.thzsquare = 0x3394; + t.tihiragana = 0x3061; + t.tikatakana = 0x30c1; + t.tikatakanahalfwidth = 0xff81; + t.tikeutacirclekorean = 0x3270; + t.tikeutaparenkorean = 0x3210; + t.tikeutcirclekorean = 0x3262; + t.tikeutkorean = 0x3137; + t.tikeutparenkorean = 0x3202; + t.tilde = 0x02dc; + t.tildebelowcmb = 0x0330; + t.tildecmb = 0x0303; + t.tildecomb = 0x0303; + t.tildedoublecmb = 0x0360; + t.tildeoperator = 0x223c; + t.tildeoverlaycmb = 0x0334; + t.tildeverticalcmb = 0x033e; + t.timescircle = 0x2297; + t.tipehahebrew = 0x0596; + t.tipehalefthebrew = 0x0596; + t.tippigurmukhi = 0x0a70; + t.titlocyrilliccmb = 0x0483; + t.tiwnarmenian = 0x057f; + t.tlinebelow = 0x1e6f; + t.tmonospace = 0xff54; + t.toarmenian = 0x0569; + t.tohiragana = 0x3068; + t.tokatakana = 0x30c8; + t.tokatakanahalfwidth = 0xff84; + t.tonebarextrahighmod = 0x02e5; + t.tonebarextralowmod = 0x02e9; + t.tonebarhighmod = 0x02e6; + t.tonebarlowmod = 0x02e8; + t.tonebarmidmod = 0x02e7; + t.tonefive = 0x01bd; + t.tonesix = 0x0185; + t.tonetwo = 0x01a8; + t.tonos = 0x0384; + t.tonsquare = 0x3327; + t.topatakthai = 0x0e0f; + t.tortoiseshellbracketleft = 0x3014; + t.tortoiseshellbracketleftsmall = 0xfe5d; + t.tortoiseshellbracketleftvertical = 0xfe39; + t.tortoiseshellbracketright = 0x3015; + t.tortoiseshellbracketrightsmall = 0xfe5e; + t.tortoiseshellbracketrightvertical = 0xfe3a; + t.totaothai = 0x0e15; + t.tpalatalhook = 0x01ab; + t.tparen = 0x24af; + t.trademark = 0x2122; + t.trademarksans = 0xf8ea; + t.trademarkserif = 0xf6db; + t.tretroflexhook = 0x0288; + t.triagdn = 0x25bc; + t.triaglf = 0x25c4; + t.triagrt = 0x25ba; + t.triagup = 0x25b2; + t.ts = 0x02a6; + t.tsadi = 0x05e6; + t.tsadidagesh = 0xfb46; + t.tsadidageshhebrew = 0xfb46; + t.tsadihebrew = 0x05e6; + t.tsecyrillic = 0x0446; + t.tsere = 0x05b5; + t.tsere12 = 0x05b5; + t.tsere1e = 0x05b5; + t.tsere2b = 0x05b5; + t.tserehebrew = 0x05b5; + t.tserenarrowhebrew = 0x05b5; + t.tserequarterhebrew = 0x05b5; + t.tserewidehebrew = 0x05b5; + t.tshecyrillic = 0x045b; + t.tsuperior = 0xf6f3; + t.ttabengali = 0x099f; + t.ttadeva = 0x091f; + t.ttagujarati = 0x0a9f; + t.ttagurmukhi = 0x0a1f; + t.tteharabic = 0x0679; + t.ttehfinalarabic = 0xfb67; + t.ttehinitialarabic = 0xfb68; + t.ttehmedialarabic = 0xfb69; + t.tthabengali = 0x09a0; + t.tthadeva = 0x0920; + t.tthagujarati = 0x0aa0; + t.tthagurmukhi = 0x0a20; + t.tturned = 0x0287; + t.tuhiragana = 0x3064; + t.tukatakana = 0x30c4; + t.tukatakanahalfwidth = 0xff82; + t.tusmallhiragana = 0x3063; + t.tusmallkatakana = 0x30c3; + t.tusmallkatakanahalfwidth = 0xff6f; + t.twelvecircle = 0x246b; + t.twelveparen = 0x247f; + t.twelveperiod = 0x2493; + t.twelveroman = 0x217b; + t.twentycircle = 0x2473; + t.twentyhangzhou = 0x5344; + t.twentyparen = 0x2487; + t.twentyperiod = 0x249b; + t.two = 0x0032; + t.twoarabic = 0x0662; + t.twobengali = 0x09e8; + t.twocircle = 0x2461; + t.twocircleinversesansserif = 0x278b; + t.twodeva = 0x0968; + t.twodotenleader = 0x2025; + t.twodotleader = 0x2025; + t.twodotleadervertical = 0xfe30; + t.twogujarati = 0x0ae8; + t.twogurmukhi = 0x0a68; + t.twohackarabic = 0x0662; + t.twohangzhou = 0x3022; + t.twoideographicparen = 0x3221; + t.twoinferior = 0x2082; + t.twomonospace = 0xff12; + t.twonumeratorbengali = 0x09f5; + t.twooldstyle = 0xf732; + t.twoparen = 0x2475; + t.twoperiod = 0x2489; + t.twopersian = 0x06f2; + t.tworoman = 0x2171; + t.twostroke = 0x01bb; + t.twosuperior = 0x00b2; + t.twothai = 0x0e52; + t.twothirds = 0x2154; + t.u = 0x0075; + t.uacute = 0x00fa; + t.ubar = 0x0289; + t.ubengali = 0x0989; + t.ubopomofo = 0x3128; + t.ubreve = 0x016d; + t.ucaron = 0x01d4; + t.ucircle = 0x24e4; + t.ucircumflex = 0x00fb; + t.ucircumflexbelow = 0x1e77; + t.ucyrillic = 0x0443; + t.udattadeva = 0x0951; + t.udblacute = 0x0171; + t.udblgrave = 0x0215; + t.udeva = 0x0909; + t.udieresis = 0x00fc; + t.udieresisacute = 0x01d8; + t.udieresisbelow = 0x1e73; + t.udieresiscaron = 0x01da; + t.udieresiscyrillic = 0x04f1; + t.udieresisgrave = 0x01dc; + t.udieresismacron = 0x01d6; + t.udotbelow = 0x1ee5; + t.ugrave = 0x00f9; + t.ugujarati = 0x0a89; + t.ugurmukhi = 0x0a09; + t.uhiragana = 0x3046; + t.uhookabove = 0x1ee7; + t.uhorn = 0x01b0; + t.uhornacute = 0x1ee9; + t.uhorndotbelow = 0x1ef1; + t.uhorngrave = 0x1eeb; + t.uhornhookabove = 0x1eed; + t.uhorntilde = 0x1eef; + t.uhungarumlaut = 0x0171; + t.uhungarumlautcyrillic = 0x04f3; + t.uinvertedbreve = 0x0217; + t.ukatakana = 0x30a6; + t.ukatakanahalfwidth = 0xff73; + t.ukcyrillic = 0x0479; + t.ukorean = 0x315c; + t.umacron = 0x016b; + t.umacroncyrillic = 0x04ef; + t.umacrondieresis = 0x1e7b; + t.umatragurmukhi = 0x0a41; + t.umonospace = 0xff55; + t.underscore = 0x005f; + t.underscoredbl = 0x2017; + t.underscoremonospace = 0xff3f; + t.underscorevertical = 0xfe33; + t.underscorewavy = 0xfe4f; + t.union = 0x222a; + t.universal = 0x2200; + t.uogonek = 0x0173; + t.uparen = 0x24b0; + t.upblock = 0x2580; + t.upperdothebrew = 0x05c4; + t.upsilon = 0x03c5; + t.upsilondieresis = 0x03cb; + t.upsilondieresistonos = 0x03b0; + t.upsilonlatin = 0x028a; + t.upsilontonos = 0x03cd; + t.uptackbelowcmb = 0x031d; + t.uptackmod = 0x02d4; + t.uragurmukhi = 0x0a73; + t.uring = 0x016f; + t.ushortcyrillic = 0x045e; + t.usmallhiragana = 0x3045; + t.usmallkatakana = 0x30a5; + t.usmallkatakanahalfwidth = 0xff69; + t.ustraightcyrillic = 0x04af; + t.ustraightstrokecyrillic = 0x04b1; + t.utilde = 0x0169; + t.utildeacute = 0x1e79; + t.utildebelow = 0x1e75; + t.uubengali = 0x098a; + t.uudeva = 0x090a; + t.uugujarati = 0x0a8a; + t.uugurmukhi = 0x0a0a; + t.uumatragurmukhi = 0x0a42; + t.uuvowelsignbengali = 0x09c2; + t.uuvowelsigndeva = 0x0942; + t.uuvowelsigngujarati = 0x0ac2; + t.uvowelsignbengali = 0x09c1; + t.uvowelsigndeva = 0x0941; + t.uvowelsigngujarati = 0x0ac1; + t.v = 0x0076; + t.vadeva = 0x0935; + t.vagujarati = 0x0ab5; + t.vagurmukhi = 0x0a35; + t.vakatakana = 0x30f7; + t.vav = 0x05d5; + t.vavdagesh = 0xfb35; + t.vavdagesh65 = 0xfb35; + t.vavdageshhebrew = 0xfb35; + t.vavhebrew = 0x05d5; + t.vavholam = 0xfb4b; + t.vavholamhebrew = 0xfb4b; + t.vavvavhebrew = 0x05f0; + t.vavyodhebrew = 0x05f1; + t.vcircle = 0x24e5; + t.vdotbelow = 0x1e7f; + t.vecyrillic = 0x0432; + t.veharabic = 0x06a4; + t.vehfinalarabic = 0xfb6b; + t.vehinitialarabic = 0xfb6c; + t.vehmedialarabic = 0xfb6d; + t.vekatakana = 0x30f9; + t.venus = 0x2640; + t.verticalbar = 0x007c; + t.verticallineabovecmb = 0x030d; + t.verticallinebelowcmb = 0x0329; + t.verticallinelowmod = 0x02cc; + t.verticallinemod = 0x02c8; + t.vewarmenian = 0x057e; + t.vhook = 0x028b; + t.vikatakana = 0x30f8; + t.viramabengali = 0x09cd; + t.viramadeva = 0x094d; + t.viramagujarati = 0x0acd; + t.visargabengali = 0x0983; + t.visargadeva = 0x0903; + t.visargagujarati = 0x0a83; + t.vmonospace = 0xff56; + t.voarmenian = 0x0578; + t.voicediterationhiragana = 0x309e; + t.voicediterationkatakana = 0x30fe; + t.voicedmarkkana = 0x309b; + t.voicedmarkkanahalfwidth = 0xff9e; + t.vokatakana = 0x30fa; + t.vparen = 0x24b1; + t.vtilde = 0x1e7d; + t.vturned = 0x028c; + t.vuhiragana = 0x3094; + t.vukatakana = 0x30f4; + t.w = 0x0077; + t.wacute = 0x1e83; + t.waekorean = 0x3159; + t.wahiragana = 0x308f; + t.wakatakana = 0x30ef; + t.wakatakanahalfwidth = 0xff9c; + t.wakorean = 0x3158; + t.wasmallhiragana = 0x308e; + t.wasmallkatakana = 0x30ee; + t.wattosquare = 0x3357; + t.wavedash = 0x301c; + t.wavyunderscorevertical = 0xfe34; + t.wawarabic = 0x0648; + t.wawfinalarabic = 0xfeee; + t.wawhamzaabovearabic = 0x0624; + t.wawhamzaabovefinalarabic = 0xfe86; + t.wbsquare = 0x33dd; + t.wcircle = 0x24e6; + t.wcircumflex = 0x0175; + t.wdieresis = 0x1e85; + t.wdotaccent = 0x1e87; + t.wdotbelow = 0x1e89; + t.wehiragana = 0x3091; + t.weierstrass = 0x2118; + t.wekatakana = 0x30f1; + t.wekorean = 0x315e; + t.weokorean = 0x315d; + t.wgrave = 0x1e81; + t.whitebullet = 0x25e6; + t.whitecircle = 0x25cb; + t.whitecircleinverse = 0x25d9; + t.whitecornerbracketleft = 0x300e; + t.whitecornerbracketleftvertical = 0xfe43; + t.whitecornerbracketright = 0x300f; + t.whitecornerbracketrightvertical = 0xfe44; + t.whitediamond = 0x25c7; + t.whitediamondcontainingblacksmalldiamond = 0x25c8; + t.whitedownpointingsmalltriangle = 0x25bf; + t.whitedownpointingtriangle = 0x25bd; + t.whiteleftpointingsmalltriangle = 0x25c3; + t.whiteleftpointingtriangle = 0x25c1; + t.whitelenticularbracketleft = 0x3016; + t.whitelenticularbracketright = 0x3017; + t.whiterightpointingsmalltriangle = 0x25b9; + t.whiterightpointingtriangle = 0x25b7; + t.whitesmallsquare = 0x25ab; + t.whitesmilingface = 0x263a; + t.whitesquare = 0x25a1; + t.whitestar = 0x2606; + t.whitetelephone = 0x260f; + t.whitetortoiseshellbracketleft = 0x3018; + t.whitetortoiseshellbracketright = 0x3019; + t.whiteuppointingsmalltriangle = 0x25b5; + t.whiteuppointingtriangle = 0x25b3; + t.wihiragana = 0x3090; + t.wikatakana = 0x30f0; + t.wikorean = 0x315f; + t.wmonospace = 0xff57; + t.wohiragana = 0x3092; + t.wokatakana = 0x30f2; + t.wokatakanahalfwidth = 0xff66; + t.won = 0x20a9; + t.wonmonospace = 0xffe6; + t.wowaenthai = 0x0e27; + t.wparen = 0x24b2; + t.wring = 0x1e98; + t.wsuperior = 0x02b7; + t.wturned = 0x028d; + t.wynn = 0x01bf; + t.x = 0x0078; + t.xabovecmb = 0x033d; + t.xbopomofo = 0x3112; + t.xcircle = 0x24e7; + t.xdieresis = 0x1e8d; + t.xdotaccent = 0x1e8b; + t.xeharmenian = 0x056d; + t.xi = 0x03be; + t.xmonospace = 0xff58; + t.xparen = 0x24b3; + t.xsuperior = 0x02e3; + t.y = 0x0079; + t.yaadosquare = 0x334e; + t.yabengali = 0x09af; + t.yacute = 0x00fd; + t.yadeva = 0x092f; + t.yaekorean = 0x3152; + t.yagujarati = 0x0aaf; + t.yagurmukhi = 0x0a2f; + t.yahiragana = 0x3084; + t.yakatakana = 0x30e4; + t.yakatakanahalfwidth = 0xff94; + t.yakorean = 0x3151; + t.yamakkanthai = 0x0e4e; + t.yasmallhiragana = 0x3083; + t.yasmallkatakana = 0x30e3; + t.yasmallkatakanahalfwidth = 0xff6c; + t.yatcyrillic = 0x0463; + t.ycircle = 0x24e8; + t.ycircumflex = 0x0177; + t.ydieresis = 0x00ff; + t.ydotaccent = 0x1e8f; + t.ydotbelow = 0x1ef5; + t.yeharabic = 0x064a; + t.yehbarreearabic = 0x06d2; + t.yehbarreefinalarabic = 0xfbaf; + t.yehfinalarabic = 0xfef2; + t.yehhamzaabovearabic = 0x0626; + t.yehhamzaabovefinalarabic = 0xfe8a; + t.yehhamzaaboveinitialarabic = 0xfe8b; + t.yehhamzaabovemedialarabic = 0xfe8c; + t.yehinitialarabic = 0xfef3; + t.yehmedialarabic = 0xfef4; + t.yehmeeminitialarabic = 0xfcdd; + t.yehmeemisolatedarabic = 0xfc58; + t.yehnoonfinalarabic = 0xfc94; + t.yehthreedotsbelowarabic = 0x06d1; + t.yekorean = 0x3156; + t.yen = 0x00a5; + t.yenmonospace = 0xffe5; + t.yeokorean = 0x3155; + t.yeorinhieuhkorean = 0x3186; + t.yerahbenyomohebrew = 0x05aa; + t.yerahbenyomolefthebrew = 0x05aa; + t.yericyrillic = 0x044b; + t.yerudieresiscyrillic = 0x04f9; + t.yesieungkorean = 0x3181; + t.yesieungpansioskorean = 0x3183; + t.yesieungsioskorean = 0x3182; + t.yetivhebrew = 0x059a; + t.ygrave = 0x1ef3; + t.yhook = 0x01b4; + t.yhookabove = 0x1ef7; + t.yiarmenian = 0x0575; + t.yicyrillic = 0x0457; + t.yikorean = 0x3162; + t.yinyang = 0x262f; + t.yiwnarmenian = 0x0582; + t.ymonospace = 0xff59; + t.yod = 0x05d9; + t.yoddagesh = 0xfb39; + t.yoddageshhebrew = 0xfb39; + t.yodhebrew = 0x05d9; + t.yodyodhebrew = 0x05f2; + t.yodyodpatahhebrew = 0xfb1f; + t.yohiragana = 0x3088; + t.yoikorean = 0x3189; + t.yokatakana = 0x30e8; + t.yokatakanahalfwidth = 0xff96; + t.yokorean = 0x315b; + t.yosmallhiragana = 0x3087; + t.yosmallkatakana = 0x30e7; + t.yosmallkatakanahalfwidth = 0xff6e; + t.yotgreek = 0x03f3; + t.yoyaekorean = 0x3188; + t.yoyakorean = 0x3187; + t.yoyakthai = 0x0e22; + t.yoyingthai = 0x0e0d; + t.yparen = 0x24b4; + t.ypogegrammeni = 0x037a; + t.ypogegrammenigreekcmb = 0x0345; + t.yr = 0x01a6; + t.yring = 0x1e99; + t.ysuperior = 0x02b8; + t.ytilde = 0x1ef9; + t.yturned = 0x028e; + t.yuhiragana = 0x3086; + t.yuikorean = 0x318c; + t.yukatakana = 0x30e6; + t.yukatakanahalfwidth = 0xff95; + t.yukorean = 0x3160; + t.yusbigcyrillic = 0x046b; + t.yusbigiotifiedcyrillic = 0x046d; + t.yuslittlecyrillic = 0x0467; + t.yuslittleiotifiedcyrillic = 0x0469; + t.yusmallhiragana = 0x3085; + t.yusmallkatakana = 0x30e5; + t.yusmallkatakanahalfwidth = 0xff6d; + t.yuyekorean = 0x318b; + t.yuyeokorean = 0x318a; + t.yyabengali = 0x09df; + t.yyadeva = 0x095f; + t.z = 0x007a; + t.zaarmenian = 0x0566; + t.zacute = 0x017a; + t.zadeva = 0x095b; + t.zagurmukhi = 0x0a5b; + t.zaharabic = 0x0638; + t.zahfinalarabic = 0xfec6; + t.zahinitialarabic = 0xfec7; + t.zahiragana = 0x3056; + t.zahmedialarabic = 0xfec8; + t.zainarabic = 0x0632; + t.zainfinalarabic = 0xfeb0; + t.zakatakana = 0x30b6; + t.zaqefgadolhebrew = 0x0595; + t.zaqefqatanhebrew = 0x0594; + t.zarqahebrew = 0x0598; + t.zayin = 0x05d6; + t.zayindagesh = 0xfb36; + t.zayindageshhebrew = 0xfb36; + t.zayinhebrew = 0x05d6; + t.zbopomofo = 0x3117; + t.zcaron = 0x017e; + t.zcircle = 0x24e9; + t.zcircumflex = 0x1e91; + t.zcurl = 0x0291; + t.zdot = 0x017c; + t.zdotaccent = 0x017c; + t.zdotbelow = 0x1e93; + t.zecyrillic = 0x0437; + t.zedescendercyrillic = 0x0499; + t.zedieresiscyrillic = 0x04df; + t.zehiragana = 0x305c; + t.zekatakana = 0x30bc; + t.zero = 0x0030; + t.zeroarabic = 0x0660; + t.zerobengali = 0x09e6; + t.zerodeva = 0x0966; + t.zerogujarati = 0x0ae6; + t.zerogurmukhi = 0x0a66; + t.zerohackarabic = 0x0660; + t.zeroinferior = 0x2080; + t.zeromonospace = 0xff10; + t.zerooldstyle = 0xf730; + t.zeropersian = 0x06f0; + t.zerosuperior = 0x2070; + t.zerothai = 0x0e50; + t.zerowidthjoiner = 0xfeff; + t.zerowidthnonjoiner = 0x200c; + t.zerowidthspace = 0x200b; + t.zeta = 0x03b6; + t.zhbopomofo = 0x3113; + t.zhearmenian = 0x056a; + t.zhebrevecyrillic = 0x04c2; + t.zhecyrillic = 0x0436; + t.zhedescendercyrillic = 0x0497; + t.zhedieresiscyrillic = 0x04dd; + t.zihiragana = 0x3058; + t.zikatakana = 0x30b8; + t.zinorhebrew = 0x05ae; + t.zlinebelow = 0x1e95; + t.zmonospace = 0xff5a; + t.zohiragana = 0x305e; + t.zokatakana = 0x30be; + t.zparen = 0x24b5; + t.zretroflexhook = 0x0290; + t.zstroke = 0x01b6; + t.zuhiragana = 0x305a; + t.zukatakana = 0x30ba; + t[".notdef"] = 0x0000; + t.angbracketleftbig = 0x2329; + t.angbracketleftBig = 0x2329; + t.angbracketleftbigg = 0x2329; + t.angbracketleftBigg = 0x2329; + t.angbracketrightBig = 0x232a; + t.angbracketrightbig = 0x232a; + t.angbracketrightBigg = 0x232a; + t.angbracketrightbigg = 0x232a; + t.arrowhookleft = 0x21aa; + t.arrowhookright = 0x21a9; + t.arrowlefttophalf = 0x21bc; + t.arrowleftbothalf = 0x21bd; + t.arrownortheast = 0x2197; + t.arrownorthwest = 0x2196; + t.arrowrighttophalf = 0x21c0; + t.arrowrightbothalf = 0x21c1; + t.arrowsoutheast = 0x2198; + t.arrowsouthwest = 0x2199; + t.backslashbig = 0x2216; + t.backslashBig = 0x2216; + t.backslashBigg = 0x2216; + t.backslashbigg = 0x2216; + t.bardbl = 0x2016; + t.bracehtipdownleft = 0xfe37; + t.bracehtipdownright = 0xfe37; + t.bracehtipupleft = 0xfe38; + t.bracehtipupright = 0xfe38; + t.braceleftBig = 0x007b; + t.braceleftbig = 0x007b; + t.braceleftbigg = 0x007b; + t.braceleftBigg = 0x007b; + t.bracerightBig = 0x007d; + t.bracerightbig = 0x007d; + t.bracerightbigg = 0x007d; + t.bracerightBigg = 0x007d; + t.bracketleftbig = 0x005b; + t.bracketleftBig = 0x005b; + t.bracketleftbigg = 0x005b; + t.bracketleftBigg = 0x005b; + t.bracketrightBig = 0x005d; + t.bracketrightbig = 0x005d; + t.bracketrightbigg = 0x005d; + t.bracketrightBigg = 0x005d; + t.ceilingleftbig = 0x2308; + t.ceilingleftBig = 0x2308; + t.ceilingleftBigg = 0x2308; + t.ceilingleftbigg = 0x2308; + t.ceilingrightbig = 0x2309; + t.ceilingrightBig = 0x2309; + t.ceilingrightbigg = 0x2309; + t.ceilingrightBigg = 0x2309; + t.circledotdisplay = 0x2299; + t.circledottext = 0x2299; + t.circlemultiplydisplay = 0x2297; + t.circlemultiplytext = 0x2297; + t.circleplusdisplay = 0x2295; + t.circleplustext = 0x2295; + t.contintegraldisplay = 0x222e; + t.contintegraltext = 0x222e; + t.coproductdisplay = 0x2210; + t.coproducttext = 0x2210; + t.floorleftBig = 0x230a; + t.floorleftbig = 0x230a; + t.floorleftbigg = 0x230a; + t.floorleftBigg = 0x230a; + t.floorrightbig = 0x230b; + t.floorrightBig = 0x230b; + t.floorrightBigg = 0x230b; + t.floorrightbigg = 0x230b; + t.hatwide = 0x0302; + t.hatwider = 0x0302; + t.hatwidest = 0x0302; + t.intercal = 0x1d40; + t.integraldisplay = 0x222b; + t.integraltext = 0x222b; + t.intersectiondisplay = 0x22c2; + t.intersectiontext = 0x22c2; + t.logicalanddisplay = 0x2227; + t.logicalandtext = 0x2227; + t.logicalordisplay = 0x2228; + t.logicalortext = 0x2228; + t.parenleftBig = 0x0028; + t.parenleftbig = 0x0028; + t.parenleftBigg = 0x0028; + t.parenleftbigg = 0x0028; + t.parenrightBig = 0x0029; + t.parenrightbig = 0x0029; + t.parenrightBigg = 0x0029; + t.parenrightbigg = 0x0029; + t.prime = 0x2032; + t.productdisplay = 0x220f; + t.producttext = 0x220f; + t.radicalbig = 0x221a; + t.radicalBig = 0x221a; + t.radicalBigg = 0x221a; + t.radicalbigg = 0x221a; + t.radicalbt = 0x221a; + t.radicaltp = 0x221a; + t.radicalvertex = 0x221a; + t.slashbig = 0x002f; + t.slashBig = 0x002f; + t.slashBigg = 0x002f; + t.slashbigg = 0x002f; + t.summationdisplay = 0x2211; + t.summationtext = 0x2211; + t.tildewide = 0x02dc; + t.tildewider = 0x02dc; + t.tildewidest = 0x02dc; + t.uniondisplay = 0x22c3; + t.unionmultidisplay = 0x228e; + t.unionmultitext = 0x228e; + t.unionsqdisplay = 0x2294; + t.unionsqtext = 0x2294; + t.uniontext = 0x22c3; + t.vextenddouble = 0x2225; + t.vextendsingle = 0x2223; +}); +const getDingbatsGlyphsUnicode = getLookupTableFactory(function (t) { + t.space = 0x0020; + t.a1 = 0x2701; + t.a2 = 0x2702; + t.a202 = 0x2703; + t.a3 = 0x2704; + t.a4 = 0x260e; + t.a5 = 0x2706; + t.a119 = 0x2707; + t.a118 = 0x2708; + t.a117 = 0x2709; + t.a11 = 0x261b; + t.a12 = 0x261e; + t.a13 = 0x270c; + t.a14 = 0x270d; + t.a15 = 0x270e; + t.a16 = 0x270f; + t.a105 = 0x2710; + t.a17 = 0x2711; + t.a18 = 0x2712; + t.a19 = 0x2713; + t.a20 = 0x2714; + t.a21 = 0x2715; + t.a22 = 0x2716; + t.a23 = 0x2717; + t.a24 = 0x2718; + t.a25 = 0x2719; + t.a26 = 0x271a; + t.a27 = 0x271b; + t.a28 = 0x271c; + t.a6 = 0x271d; + t.a7 = 0x271e; + t.a8 = 0x271f; + t.a9 = 0x2720; + t.a10 = 0x2721; + t.a29 = 0x2722; + t.a30 = 0x2723; + t.a31 = 0x2724; + t.a32 = 0x2725; + t.a33 = 0x2726; + t.a34 = 0x2727; + t.a35 = 0x2605; + t.a36 = 0x2729; + t.a37 = 0x272a; + t.a38 = 0x272b; + t.a39 = 0x272c; + t.a40 = 0x272d; + t.a41 = 0x272e; + t.a42 = 0x272f; + t.a43 = 0x2730; + t.a44 = 0x2731; + t.a45 = 0x2732; + t.a46 = 0x2733; + t.a47 = 0x2734; + t.a48 = 0x2735; + t.a49 = 0x2736; + t.a50 = 0x2737; + t.a51 = 0x2738; + t.a52 = 0x2739; + t.a53 = 0x273a; + t.a54 = 0x273b; + t.a55 = 0x273c; + t.a56 = 0x273d; + t.a57 = 0x273e; + t.a58 = 0x273f; + t.a59 = 0x2740; + t.a60 = 0x2741; + t.a61 = 0x2742; + t.a62 = 0x2743; + t.a63 = 0x2744; + t.a64 = 0x2745; + t.a65 = 0x2746; + t.a66 = 0x2747; + t.a67 = 0x2748; + t.a68 = 0x2749; + t.a69 = 0x274a; + t.a70 = 0x274b; + t.a71 = 0x25cf; + t.a72 = 0x274d; + t.a73 = 0x25a0; + t.a74 = 0x274f; + t.a203 = 0x2750; + t.a75 = 0x2751; + t.a204 = 0x2752; + t.a76 = 0x25b2; + t.a77 = 0x25bc; + t.a78 = 0x25c6; + t.a79 = 0x2756; + t.a81 = 0x25d7; + t.a82 = 0x2758; + t.a83 = 0x2759; + t.a84 = 0x275a; + t.a97 = 0x275b; + t.a98 = 0x275c; + t.a99 = 0x275d; + t.a100 = 0x275e; + t.a101 = 0x2761; + t.a102 = 0x2762; + t.a103 = 0x2763; + t.a104 = 0x2764; + t.a106 = 0x2765; + t.a107 = 0x2766; + t.a108 = 0x2767; + t.a112 = 0x2663; + t.a111 = 0x2666; + t.a110 = 0x2665; + t.a109 = 0x2660; + t.a120 = 0x2460; + t.a121 = 0x2461; + t.a122 = 0x2462; + t.a123 = 0x2463; + t.a124 = 0x2464; + t.a125 = 0x2465; + t.a126 = 0x2466; + t.a127 = 0x2467; + t.a128 = 0x2468; + t.a129 = 0x2469; + t.a130 = 0x2776; + t.a131 = 0x2777; + t.a132 = 0x2778; + t.a133 = 0x2779; + t.a134 = 0x277a; + t.a135 = 0x277b; + t.a136 = 0x277c; + t.a137 = 0x277d; + t.a138 = 0x277e; + t.a139 = 0x277f; + t.a140 = 0x2780; + t.a141 = 0x2781; + t.a142 = 0x2782; + t.a143 = 0x2783; + t.a144 = 0x2784; + t.a145 = 0x2785; + t.a146 = 0x2786; + t.a147 = 0x2787; + t.a148 = 0x2788; + t.a149 = 0x2789; + t.a150 = 0x278a; + t.a151 = 0x278b; + t.a152 = 0x278c; + t.a153 = 0x278d; + t.a154 = 0x278e; + t.a155 = 0x278f; + t.a156 = 0x2790; + t.a157 = 0x2791; + t.a158 = 0x2792; + t.a159 = 0x2793; + t.a160 = 0x2794; + t.a161 = 0x2192; + t.a163 = 0x2194; + t.a164 = 0x2195; + t.a196 = 0x2798; + t.a165 = 0x2799; + t.a192 = 0x279a; + t.a166 = 0x279b; + t.a167 = 0x279c; + t.a168 = 0x279d; + t.a169 = 0x279e; + t.a170 = 0x279f; + t.a171 = 0x27a0; + t.a172 = 0x27a1; + t.a173 = 0x27a2; + t.a162 = 0x27a3; + t.a174 = 0x27a4; + t.a175 = 0x27a5; + t.a176 = 0x27a6; + t.a177 = 0x27a7; + t.a178 = 0x27a8; + t.a179 = 0x27a9; + t.a193 = 0x27aa; + t.a180 = 0x27ab; + t.a199 = 0x27ac; + t.a181 = 0x27ad; + t.a200 = 0x27ae; + t.a182 = 0x27af; + t.a201 = 0x27b1; + t.a183 = 0x27b2; + t.a184 = 0x27b3; + t.a197 = 0x27b4; + t.a185 = 0x27b5; + t.a194 = 0x27b6; + t.a198 = 0x27b7; + t.a186 = 0x27b8; + t.a195 = 0x27b9; + t.a187 = 0x27ba; + t.a188 = 0x27bb; + t.a189 = 0x27bc; + t.a190 = 0x27bd; + t.a191 = 0x27be; + t.a89 = 0x2768; + t.a90 = 0x2769; + t.a93 = 0x276a; + t.a94 = 0x276b; + t.a91 = 0x276c; + t.a92 = 0x276d; + t.a205 = 0x276e; + t.a85 = 0x276f; + t.a206 = 0x2770; + t.a86 = 0x2771; + t.a87 = 0x2772; + t.a88 = 0x2773; + t.a95 = 0x2774; + t.a96 = 0x2775; + t[".notdef"] = 0x0000; +}); + +;// ./src/core/unicode.js + +const getSpecialPUASymbols = getLookupTableFactory(function (t) { + t[63721] = 0x00a9; + t[63193] = 0x00a9; + t[63720] = 0x00ae; + t[63194] = 0x00ae; + t[63722] = 0x2122; + t[63195] = 0x2122; + t[63729] = 0x23a7; + t[63730] = 0x23a8; + t[63731] = 0x23a9; + t[63740] = 0x23ab; + t[63741] = 0x23ac; + t[63742] = 0x23ad; + t[63726] = 0x23a1; + t[63727] = 0x23a2; + t[63728] = 0x23a3; + t[63737] = 0x23a4; + t[63738] = 0x23a5; + t[63739] = 0x23a6; + t[63723] = 0x239b; + t[63724] = 0x239c; + t[63725] = 0x239d; + t[63734] = 0x239e; + t[63735] = 0x239f; + t[63736] = 0x23a0; +}); +function mapSpecialUnicodeValues(code) { + if (code >= 0xfff0 && code <= 0xffff) { + return 0; + } else if (code >= 0xf600 && code <= 0xf8ff) { + return getSpecialPUASymbols()[code] || code; + } else if (code === 0x00ad) { + return 0x002d; + } + return code; +} +function getUnicodeForGlyph(name, glyphsUnicodeMap) { + let unicode = glyphsUnicodeMap[name]; + if (unicode !== undefined) { + return unicode; + } + if (!name) { + return -1; + } + if (name[0] === "u") { + const nameLen = name.length; + let hexStr; + if (nameLen === 7 && name[1] === "n" && name[2] === "i") { + hexStr = name.substring(3); + } else if (nameLen >= 5 && nameLen <= 7) { + hexStr = name.substring(1); + } else { + return -1; + } + if (hexStr === hexStr.toUpperCase()) { + unicode = parseInt(hexStr, 16); + if (unicode >= 0) { + return unicode; + } + } + } + return -1; +} +const UnicodeRanges = [[0x0000, 0x007f], [0x0080, 0x00ff], [0x0100, 0x017f], [0x0180, 0x024f], [0x0250, 0x02af, 0x1d00, 0x1d7f, 0x1d80, 0x1dbf], [0x02b0, 0x02ff, 0xa700, 0xa71f], [0x0300, 0x036f, 0x1dc0, 0x1dff], [0x0370, 0x03ff], [0x2c80, 0x2cff], [0x0400, 0x04ff, 0x0500, 0x052f, 0x2de0, 0x2dff, 0xa640, 0xa69f], [0x0530, 0x058f], [0x0590, 0x05ff], [0xa500, 0xa63f], [0x0600, 0x06ff, 0x0750, 0x077f], [0x07c0, 0x07ff], [0x0900, 0x097f], [0x0980, 0x09ff], [0x0a00, 0x0a7f], [0x0a80, 0x0aff], [0x0b00, 0x0b7f], [0x0b80, 0x0bff], [0x0c00, 0x0c7f], [0x0c80, 0x0cff], [0x0d00, 0x0d7f], [0x0e00, 0x0e7f], [0x0e80, 0x0eff], [0x10a0, 0x10ff, 0x2d00, 0x2d2f], [0x1b00, 0x1b7f], [0x1100, 0x11ff], [0x1e00, 0x1eff, 0x2c60, 0x2c7f, 0xa720, 0xa7ff], [0x1f00, 0x1fff], [0x2000, 0x206f, 0x2e00, 0x2e7f], [0x2070, 0x209f], [0x20a0, 0x20cf], [0x20d0, 0x20ff], [0x2100, 0x214f], [0x2150, 0x218f], [0x2190, 0x21ff, 0x27f0, 0x27ff, 0x2900, 0x297f, 0x2b00, 0x2bff], [0x2200, 0x22ff, 0x2a00, 0x2aff, 0x27c0, 0x27ef, 0x2980, 0x29ff], [0x2300, 0x23ff], [0x2400, 0x243f], [0x2440, 0x245f], [0x2460, 0x24ff], [0x2500, 0x257f], [0x2580, 0x259f], [0x25a0, 0x25ff], [0x2600, 0x26ff], [0x2700, 0x27bf], [0x3000, 0x303f], [0x3040, 0x309f], [0x30a0, 0x30ff, 0x31f0, 0x31ff], [0x3100, 0x312f, 0x31a0, 0x31bf], [0x3130, 0x318f], [0xa840, 0xa87f], [0x3200, 0x32ff], [0x3300, 0x33ff], [0xac00, 0xd7af], [0xd800, 0xdfff], [0x10900, 0x1091f], [0x4e00, 0x9fff, 0x2e80, 0x2eff, 0x2f00, 0x2fdf, 0x2ff0, 0x2fff, 0x3400, 0x4dbf, 0x20000, 0x2a6df, 0x3190, 0x319f], [0xe000, 0xf8ff], [0x31c0, 0x31ef, 0xf900, 0xfaff, 0x2f800, 0x2fa1f], [0xfb00, 0xfb4f], [0xfb50, 0xfdff], [0xfe20, 0xfe2f], [0xfe10, 0xfe1f], [0xfe50, 0xfe6f], [0xfe70, 0xfeff], [0xff00, 0xffef], [0xfff0, 0xffff], [0x0f00, 0x0fff], [0x0700, 0x074f], [0x0780, 0x07bf], [0x0d80, 0x0dff], [0x1000, 0x109f], [0x1200, 0x137f, 0x1380, 0x139f, 0x2d80, 0x2ddf], [0x13a0, 0x13ff], [0x1400, 0x167f], [0x1680, 0x169f], [0x16a0, 0x16ff], [0x1780, 0x17ff], [0x1800, 0x18af], [0x2800, 0x28ff], [0xa000, 0xa48f], [0x1700, 0x171f, 0x1720, 0x173f, 0x1740, 0x175f, 0x1760, 0x177f], [0x10300, 0x1032f], [0x10330, 0x1034f], [0x10400, 0x1044f], [0x1d000, 0x1d0ff, 0x1d100, 0x1d1ff, 0x1d200, 0x1d24f], [0x1d400, 0x1d7ff], [0xff000, 0xffffd], [0xfe00, 0xfe0f, 0xe0100, 0xe01ef], [0xe0000, 0xe007f], [0x1900, 0x194f], [0x1950, 0x197f], [0x1980, 0x19df], [0x1a00, 0x1a1f], [0x2c00, 0x2c5f], [0x2d30, 0x2d7f], [0x4dc0, 0x4dff], [0xa800, 0xa82f], [0x10000, 0x1007f, 0x10080, 0x100ff, 0x10100, 0x1013f], [0x10140, 0x1018f], [0x10380, 0x1039f], [0x103a0, 0x103df], [0x10450, 0x1047f], [0x10480, 0x104af], [0x10800, 0x1083f], [0x10a00, 0x10a5f], [0x1d300, 0x1d35f], [0x12000, 0x123ff, 0x12400, 0x1247f], [0x1d360, 0x1d37f], [0x1b80, 0x1bbf], [0x1c00, 0x1c4f], [0x1c50, 0x1c7f], [0xa880, 0xa8df], [0xa900, 0xa92f], [0xa930, 0xa95f], [0xaa00, 0xaa5f], [0x10190, 0x101cf], [0x101d0, 0x101ff], [0x102a0, 0x102df, 0x10280, 0x1029f, 0x10920, 0x1093f], [0x1f030, 0x1f09f, 0x1f000, 0x1f02f]]; +function getUnicodeRangeFor(value, lastPosition = -1) { + if (lastPosition !== -1) { + const range = UnicodeRanges[lastPosition]; + for (let i = 0, ii = range.length; i < ii; i += 2) { + if (value >= range[i] && value <= range[i + 1]) { + return lastPosition; + } + } + } + for (let i = 0, ii = UnicodeRanges.length; i < ii; i++) { + const range = UnicodeRanges[i]; + for (let j = 0, jj = range.length; j < jj; j += 2) { + if (value >= range[j] && value <= range[j + 1]) { + return i; + } + } + } + return -1; +} +const SpecialCharRegExp = new RegExp("^(\\s)|(\\p{Mn})|(\\p{Cf})$", "u"); +const CategoryCache = new Map(); +function getCharUnicodeCategory(char) { + const cachedCategory = CategoryCache.get(char); + if (cachedCategory) { + return cachedCategory; + } + const groups = char.match(SpecialCharRegExp); + const category = { + isWhitespace: !!groups?.[1], + isZeroWidthDiacritic: !!groups?.[2], + isInvisibleFormatMark: !!groups?.[3] + }; + CategoryCache.set(char, category); + return category; +} +function clearUnicodeCaches() { + CategoryCache.clear(); +} + +;// ./src/core/fonts_utils.js + + + + + +const SEAC_ANALYSIS_ENABLED = true; +const FontFlags = { + FixedPitch: 1, + Serif: 2, + Symbolic: 4, + Script: 8, + Nonsymbolic: 32, + Italic: 64, + AllCap: 65536, + SmallCap: 131072, + ForceBold: 262144 +}; +const MacStandardGlyphOrdering = [".notdef", ".null", "nonmarkingreturn", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "grave", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "Adieresis", "Aring", "Ccedilla", "Eacute", "Ntilde", "Odieresis", "Udieresis", "aacute", "agrave", "acircumflex", "adieresis", "atilde", "aring", "ccedilla", "eacute", "egrave", "ecircumflex", "edieresis", "iacute", "igrave", "icircumflex", "idieresis", "ntilde", "oacute", "ograve", "ocircumflex", "odieresis", "otilde", "uacute", "ugrave", "ucircumflex", "udieresis", "dagger", "degree", "cent", "sterling", "section", "bullet", "paragraph", "germandbls", "registered", "copyright", "trademark", "acute", "dieresis", "notequal", "AE", "Oslash", "infinity", "plusminus", "lessequal", "greaterequal", "yen", "mu", "partialdiff", "summation", "product", "pi", "integral", "ordfeminine", "ordmasculine", "Omega", "ae", "oslash", "questiondown", "exclamdown", "logicalnot", "radical", "florin", "approxequal", "Delta", "guillemotleft", "guillemotright", "ellipsis", "nonbreakingspace", "Agrave", "Atilde", "Otilde", "OE", "oe", "endash", "emdash", "quotedblleft", "quotedblright", "quoteleft", "quoteright", "divide", "lozenge", "ydieresis", "Ydieresis", "fraction", "currency", "guilsinglleft", "guilsinglright", "fi", "fl", "daggerdbl", "periodcentered", "quotesinglbase", "quotedblbase", "perthousand", "Acircumflex", "Ecircumflex", "Aacute", "Edieresis", "Egrave", "Iacute", "Icircumflex", "Idieresis", "Igrave", "Oacute", "Ocircumflex", "apple", "Ograve", "Uacute", "Ucircumflex", "Ugrave", "dotlessi", "circumflex", "tilde", "macron", "breve", "dotaccent", "ring", "cedilla", "hungarumlaut", "ogonek", "caron", "Lslash", "lslash", "Scaron", "scaron", "Zcaron", "zcaron", "brokenbar", "Eth", "eth", "Yacute", "yacute", "Thorn", "thorn", "minus", "multiply", "onesuperior", "twosuperior", "threesuperior", "onehalf", "onequarter", "threequarters", "franc", "Gbreve", "gbreve", "Idotaccent", "Scedilla", "scedilla", "Cacute", "cacute", "Ccaron", "ccaron", "dcroat"]; +function recoverGlyphName(name, glyphsUnicodeMap) { + if (glyphsUnicodeMap[name] !== undefined) { + return name; + } + const unicode = getUnicodeForGlyph(name, glyphsUnicodeMap); + if (unicode !== -1) { + for (const key in glyphsUnicodeMap) { + if (glyphsUnicodeMap[key] === unicode) { + return key; + } + } + } + info("Unable to recover a standard glyph name for: " + name); + return name; +} +function type1FontGlyphMapping(properties, builtInEncoding, glyphNames) { + const charCodeToGlyphId = Object.create(null); + let glyphId, charCode, baseEncoding; + const isSymbolicFont = !!(properties.flags & FontFlags.Symbolic); + if (properties.isInternalFont) { + baseEncoding = builtInEncoding; + for (charCode = 0; charCode < baseEncoding.length; charCode++) { + glyphId = glyphNames.indexOf(baseEncoding[charCode]); + charCodeToGlyphId[charCode] = glyphId >= 0 ? glyphId : 0; + } + } else if (properties.baseEncodingName) { + baseEncoding = getEncoding(properties.baseEncodingName); + for (charCode = 0; charCode < baseEncoding.length; charCode++) { + glyphId = glyphNames.indexOf(baseEncoding[charCode]); + charCodeToGlyphId[charCode] = glyphId >= 0 ? glyphId : 0; + } + } else if (isSymbolicFont) { + for (charCode in builtInEncoding) { + charCodeToGlyphId[charCode] = builtInEncoding[charCode]; + } + } else { + baseEncoding = StandardEncoding; + for (charCode = 0; charCode < baseEncoding.length; charCode++) { + glyphId = glyphNames.indexOf(baseEncoding[charCode]); + charCodeToGlyphId[charCode] = glyphId >= 0 ? glyphId : 0; + } + } + const differences = properties.differences; + let glyphsUnicodeMap; + if (differences) { + for (charCode in differences) { + const glyphName = differences[charCode]; + glyphId = glyphNames.indexOf(glyphName); + if (glyphId === -1) { + if (!glyphsUnicodeMap) { + glyphsUnicodeMap = getGlyphsUnicode(); + } + const standardGlyphName = recoverGlyphName(glyphName, glyphsUnicodeMap); + if (standardGlyphName !== glyphName) { + glyphId = glyphNames.indexOf(standardGlyphName); + } + } + charCodeToGlyphId[charCode] = glyphId >= 0 ? glyphId : 0; + } + } + return charCodeToGlyphId; +} +function normalizeFontName(name) { + return name.replaceAll(/[,_]/g, "-").replaceAll(/\s/g, ""); +} +const getVerticalPresentationForm = getLookupTableFactory(t => { + t[0x2013] = 0xfe32; + t[0x2014] = 0xfe31; + t[0x2025] = 0xfe30; + t[0x2026] = 0xfe19; + t[0x3001] = 0xfe11; + t[0x3002] = 0xfe12; + t[0x3008] = 0xfe3f; + t[0x3009] = 0xfe40; + t[0x300a] = 0xfe3d; + t[0x300b] = 0xfe3e; + t[0x300c] = 0xfe41; + t[0x300d] = 0xfe42; + t[0x300e] = 0xfe43; + t[0x300f] = 0xfe44; + t[0x3010] = 0xfe3b; + t[0x3011] = 0xfe3c; + t[0x3014] = 0xfe39; + t[0x3015] = 0xfe3a; + t[0x3016] = 0xfe17; + t[0x3017] = 0xfe18; + t[0xfe4f] = 0xfe34; + t[0xff01] = 0xfe15; + t[0xff08] = 0xfe35; + t[0xff09] = 0xfe36; + t[0xff0c] = 0xfe10; + t[0xff1a] = 0xfe13; + t[0xff1b] = 0xfe14; + t[0xff1f] = 0xfe16; + t[0xff3b] = 0xfe47; + t[0xff3d] = 0xfe48; + t[0xff3f] = 0xfe33; + t[0xff5b] = 0xfe37; + t[0xff5d] = 0xfe38; +}); + +;// ./src/core/standard_fonts.js + + +const getStdFontMap = getLookupTableFactory(function (t) { + t["Times-Roman"] = "Times-Roman"; + t.Helvetica = "Helvetica"; + t.Courier = "Courier"; + t.Symbol = "Symbol"; + t["Times-Bold"] = "Times-Bold"; + t["Helvetica-Bold"] = "Helvetica-Bold"; + t["Courier-Bold"] = "Courier-Bold"; + t.ZapfDingbats = "ZapfDingbats"; + t["Times-Italic"] = "Times-Italic"; + t["Helvetica-Oblique"] = "Helvetica-Oblique"; + t["Courier-Oblique"] = "Courier-Oblique"; + t["Times-BoldItalic"] = "Times-BoldItalic"; + t["Helvetica-BoldOblique"] = "Helvetica-BoldOblique"; + t["Courier-BoldOblique"] = "Courier-BoldOblique"; + t.ArialNarrow = "Helvetica"; + t["ArialNarrow-Bold"] = "Helvetica-Bold"; + t["ArialNarrow-BoldItalic"] = "Helvetica-BoldOblique"; + t["ArialNarrow-Italic"] = "Helvetica-Oblique"; + t.ArialBlack = "Helvetica"; + t["ArialBlack-Bold"] = "Helvetica-Bold"; + t["ArialBlack-BoldItalic"] = "Helvetica-BoldOblique"; + t["ArialBlack-Italic"] = "Helvetica-Oblique"; + t["Arial-Black"] = "Helvetica"; + t["Arial-Black-Bold"] = "Helvetica-Bold"; + t["Arial-Black-BoldItalic"] = "Helvetica-BoldOblique"; + t["Arial-Black-Italic"] = "Helvetica-Oblique"; + t.Arial = "Helvetica"; + t["Arial-Bold"] = "Helvetica-Bold"; + t["Arial-BoldItalic"] = "Helvetica-BoldOblique"; + t["Arial-Italic"] = "Helvetica-Oblique"; + t.ArialMT = "Helvetica"; + t["Arial-BoldItalicMT"] = "Helvetica-BoldOblique"; + t["Arial-BoldMT"] = "Helvetica-Bold"; + t["Arial-ItalicMT"] = "Helvetica-Oblique"; + t["Arial-BoldItalicMT-BoldItalic"] = "Helvetica-BoldOblique"; + t["Arial-BoldMT-Bold"] = "Helvetica-Bold"; + t["Arial-ItalicMT-Italic"] = "Helvetica-Oblique"; + t.ArialUnicodeMS = "Helvetica"; + t["ArialUnicodeMS-Bold"] = "Helvetica-Bold"; + t["ArialUnicodeMS-BoldItalic"] = "Helvetica-BoldOblique"; + t["ArialUnicodeMS-Italic"] = "Helvetica-Oblique"; + t["Courier-BoldItalic"] = "Courier-BoldOblique"; + t["Courier-Italic"] = "Courier-Oblique"; + t.CourierNew = "Courier"; + t["CourierNew-Bold"] = "Courier-Bold"; + t["CourierNew-BoldItalic"] = "Courier-BoldOblique"; + t["CourierNew-Italic"] = "Courier-Oblique"; + t["CourierNewPS-BoldItalicMT"] = "Courier-BoldOblique"; + t["CourierNewPS-BoldMT"] = "Courier-Bold"; + t["CourierNewPS-ItalicMT"] = "Courier-Oblique"; + t.CourierNewPSMT = "Courier"; + t["Helvetica-BoldItalic"] = "Helvetica-BoldOblique"; + t["Helvetica-Italic"] = "Helvetica-Oblique"; + t["HelveticaLTStd-Bold"] = "Helvetica-Bold"; + t["Symbol-Bold"] = "Symbol"; + t["Symbol-BoldItalic"] = "Symbol"; + t["Symbol-Italic"] = "Symbol"; + t.TimesNewRoman = "Times-Roman"; + t["TimesNewRoman-Bold"] = "Times-Bold"; + t["TimesNewRoman-BoldItalic"] = "Times-BoldItalic"; + t["TimesNewRoman-Italic"] = "Times-Italic"; + t.TimesNewRomanPS = "Times-Roman"; + t["TimesNewRomanPS-Bold"] = "Times-Bold"; + t["TimesNewRomanPS-BoldItalic"] = "Times-BoldItalic"; + t["TimesNewRomanPS-BoldItalicMT"] = "Times-BoldItalic"; + t["TimesNewRomanPS-BoldMT"] = "Times-Bold"; + t["TimesNewRomanPS-Italic"] = "Times-Italic"; + t["TimesNewRomanPS-ItalicMT"] = "Times-Italic"; + t.TimesNewRomanPSMT = "Times-Roman"; + t["TimesNewRomanPSMT-Bold"] = "Times-Bold"; + t["TimesNewRomanPSMT-BoldItalic"] = "Times-BoldItalic"; + t["TimesNewRomanPSMT-Italic"] = "Times-Italic"; +}); +const getFontNameToFileMap = getLookupTableFactory(function (t) { + t.Courier = "FoxitFixed.pfb"; + t["Courier-Bold"] = "FoxitFixedBold.pfb"; + t["Courier-BoldOblique"] = "FoxitFixedBoldItalic.pfb"; + t["Courier-Oblique"] = "FoxitFixedItalic.pfb"; + t.Helvetica = "LiberationSans-Regular.ttf"; + t["Helvetica-Bold"] = "LiberationSans-Bold.ttf"; + t["Helvetica-BoldOblique"] = "LiberationSans-BoldItalic.ttf"; + t["Helvetica-Oblique"] = "LiberationSans-Italic.ttf"; + t["Times-Roman"] = "FoxitSerif.pfb"; + t["Times-Bold"] = "FoxitSerifBold.pfb"; + t["Times-BoldItalic"] = "FoxitSerifBoldItalic.pfb"; + t["Times-Italic"] = "FoxitSerifItalic.pfb"; + t.Symbol = "FoxitSymbol.pfb"; + t.ZapfDingbats = "FoxitDingbats.pfb"; + t["LiberationSans-Regular"] = "LiberationSans-Regular.ttf"; + t["LiberationSans-Bold"] = "LiberationSans-Bold.ttf"; + t["LiberationSans-Italic"] = "LiberationSans-Italic.ttf"; + t["LiberationSans-BoldItalic"] = "LiberationSans-BoldItalic.ttf"; +}); +const getNonStdFontMap = getLookupTableFactory(function (t) { + t.Calibri = "Helvetica"; + t["Calibri-Bold"] = "Helvetica-Bold"; + t["Calibri-BoldItalic"] = "Helvetica-BoldOblique"; + t["Calibri-Italic"] = "Helvetica-Oblique"; + t.CenturyGothic = "Helvetica"; + t["CenturyGothic-Bold"] = "Helvetica-Bold"; + t["CenturyGothic-BoldItalic"] = "Helvetica-BoldOblique"; + t["CenturyGothic-Italic"] = "Helvetica-Oblique"; + t.ComicSansMS = "Comic Sans MS"; + t["ComicSansMS-Bold"] = "Comic Sans MS-Bold"; + t["ComicSansMS-BoldItalic"] = "Comic Sans MS-BoldItalic"; + t["ComicSansMS-Italic"] = "Comic Sans MS-Italic"; + t.GillSansMT = "Helvetica"; + t["GillSansMT-Bold"] = "Helvetica-Bold"; + t["GillSansMT-BoldItalic"] = "Helvetica-BoldOblique"; + t["GillSansMT-Italic"] = "Helvetica-Oblique"; + t.Impact = "Helvetica"; + t["ItcSymbol-Bold"] = "Helvetica-Bold"; + t["ItcSymbol-BoldItalic"] = "Helvetica-BoldOblique"; + t["ItcSymbol-Book"] = "Helvetica"; + t["ItcSymbol-BookItalic"] = "Helvetica-Oblique"; + t["ItcSymbol-Medium"] = "Helvetica"; + t["ItcSymbol-MediumItalic"] = "Helvetica-Oblique"; + t.LucidaConsole = "Courier"; + t["LucidaConsole-Bold"] = "Courier-Bold"; + t["LucidaConsole-BoldItalic"] = "Courier-BoldOblique"; + t["LucidaConsole-Italic"] = "Courier-Oblique"; + t["LucidaSans-Demi"] = "Helvetica-Bold"; + t["MS-Gothic"] = "MS Gothic"; + t["MS-Gothic-Bold"] = "MS Gothic-Bold"; + t["MS-Gothic-BoldItalic"] = "MS Gothic-BoldItalic"; + t["MS-Gothic-Italic"] = "MS Gothic-Italic"; + t["MS-Mincho"] = "MS Mincho"; + t["MS-Mincho-Bold"] = "MS Mincho-Bold"; + t["MS-Mincho-BoldItalic"] = "MS Mincho-BoldItalic"; + t["MS-Mincho-Italic"] = "MS Mincho-Italic"; + t["MS-PGothic"] = "MS PGothic"; + t["MS-PGothic-Bold"] = "MS PGothic-Bold"; + t["MS-PGothic-BoldItalic"] = "MS PGothic-BoldItalic"; + t["MS-PGothic-Italic"] = "MS PGothic-Italic"; + t["MS-PMincho"] = "MS PMincho"; + t["MS-PMincho-Bold"] = "MS PMincho-Bold"; + t["MS-PMincho-BoldItalic"] = "MS PMincho-BoldItalic"; + t["MS-PMincho-Italic"] = "MS PMincho-Italic"; + t.NuptialScript = "Times-Italic"; + t.SegoeUISymbol = "Helvetica"; +}); +const getSerifFonts = getLookupTableFactory(function (t) { + t["Adobe Jenson"] = true; + t["Adobe Text"] = true; + t.Albertus = true; + t.Aldus = true; + t.Alexandria = true; + t.Algerian = true; + t["American Typewriter"] = true; + t.Antiqua = true; + t.Apex = true; + t.Arno = true; + t.Aster = true; + t.Aurora = true; + t.Baskerville = true; + t.Bell = true; + t.Bembo = true; + t["Bembo Schoolbook"] = true; + t.Benguiat = true; + t["Berkeley Old Style"] = true; + t["Bernhard Modern"] = true; + t["Berthold City"] = true; + t.Bodoni = true; + t["Bauer Bodoni"] = true; + t["Book Antiqua"] = true; + t.Bookman = true; + t["Bordeaux Roman"] = true; + t["Californian FB"] = true; + t.Calisto = true; + t.Calvert = true; + t.Capitals = true; + t.Cambria = true; + t.Cartier = true; + t.Caslon = true; + t.Catull = true; + t.Centaur = true; + t["Century Old Style"] = true; + t["Century Schoolbook"] = true; + t.Chaparral = true; + t["Charis SIL"] = true; + t.Cheltenham = true; + t["Cholla Slab"] = true; + t.Clarendon = true; + t.Clearface = true; + t.Cochin = true; + t.Colonna = true; + t["Computer Modern"] = true; + t["Concrete Roman"] = true; + t.Constantia = true; + t["Cooper Black"] = true; + t.Corona = true; + t.Ecotype = true; + t.Egyptienne = true; + t.Elephant = true; + t.Excelsior = true; + t.Fairfield = true; + t["FF Scala"] = true; + t.Folkard = true; + t.Footlight = true; + t.FreeSerif = true; + t["Friz Quadrata"] = true; + t.Garamond = true; + t.Gentium = true; + t.Georgia = true; + t.Gloucester = true; + t["Goudy Old Style"] = true; + t["Goudy Schoolbook"] = true; + t["Goudy Pro Font"] = true; + t.Granjon = true; + t["Guardian Egyptian"] = true; + t.Heather = true; + t.Hercules = true; + t["High Tower Text"] = true; + t.Hiroshige = true; + t["Hoefler Text"] = true; + t["Humana Serif"] = true; + t.Imprint = true; + t["Ionic No. 5"] = true; + t.Janson = true; + t.Joanna = true; + t.Korinna = true; + t.Lexicon = true; + t.LiberationSerif = true; + t["Liberation Serif"] = true; + t["Linux Libertine"] = true; + t.Literaturnaya = true; + t.Lucida = true; + t["Lucida Bright"] = true; + t.Melior = true; + t.Memphis = true; + t.Miller = true; + t.Minion = true; + t.Modern = true; + t["Mona Lisa"] = true; + t["Mrs Eaves"] = true; + t["MS Serif"] = true; + t["Museo Slab"] = true; + t["New York"] = true; + t["Nimbus Roman"] = true; + t["NPS Rawlinson Roadway"] = true; + t.NuptialScript = true; + t.Palatino = true; + t.Perpetua = true; + t.Plantin = true; + t["Plantin Schoolbook"] = true; + t.Playbill = true; + t["Poor Richard"] = true; + t["Rawlinson Roadway"] = true; + t.Renault = true; + t.Requiem = true; + t.Rockwell = true; + t.Roman = true; + t["Rotis Serif"] = true; + t.Sabon = true; + t.Scala = true; + t.Seagull = true; + t.Sistina = true; + t.Souvenir = true; + t.STIX = true; + t["Stone Informal"] = true; + t["Stone Serif"] = true; + t.Sylfaen = true; + t.Times = true; + t.Trajan = true; + t["Trinité"] = true; + t["Trump Mediaeval"] = true; + t.Utopia = true; + t["Vale Type"] = true; + t["Bitstream Vera"] = true; + t["Vera Serif"] = true; + t.Versailles = true; + t.Wanted = true; + t.Weiss = true; + t["Wide Latin"] = true; + t.Windsor = true; + t.XITS = true; +}); +const getSymbolsFonts = getLookupTableFactory(function (t) { + t.Dingbats = true; + t.Symbol = true; + t.ZapfDingbats = true; + t.Wingdings = true; + t["Wingdings-Bold"] = true; + t["Wingdings-Regular"] = true; +}); +const getGlyphMapForStandardFonts = getLookupTableFactory(function (t) { + t[2] = 10; + t[3] = 32; + t[4] = 33; + t[5] = 34; + t[6] = 35; + t[7] = 36; + t[8] = 37; + t[9] = 38; + t[10] = 39; + t[11] = 40; + t[12] = 41; + t[13] = 42; + t[14] = 43; + t[15] = 44; + t[16] = 45; + t[17] = 46; + t[18] = 47; + t[19] = 48; + t[20] = 49; + t[21] = 50; + t[22] = 51; + t[23] = 52; + t[24] = 53; + t[25] = 54; + t[26] = 55; + t[27] = 56; + t[28] = 57; + t[29] = 58; + t[30] = 894; + t[31] = 60; + t[32] = 61; + t[33] = 62; + t[34] = 63; + t[35] = 64; + t[36] = 65; + t[37] = 66; + t[38] = 67; + t[39] = 68; + t[40] = 69; + t[41] = 70; + t[42] = 71; + t[43] = 72; + t[44] = 73; + t[45] = 74; + t[46] = 75; + t[47] = 76; + t[48] = 77; + t[49] = 78; + t[50] = 79; + t[51] = 80; + t[52] = 81; + t[53] = 82; + t[54] = 83; + t[55] = 84; + t[56] = 85; + t[57] = 86; + t[58] = 87; + t[59] = 88; + t[60] = 89; + t[61] = 90; + t[62] = 91; + t[63] = 92; + t[64] = 93; + t[65] = 94; + t[66] = 95; + t[67] = 96; + t[68] = 97; + t[69] = 98; + t[70] = 99; + t[71] = 100; + t[72] = 101; + t[73] = 102; + t[74] = 103; + t[75] = 104; + t[76] = 105; + t[77] = 106; + t[78] = 107; + t[79] = 108; + t[80] = 109; + t[81] = 110; + t[82] = 111; + t[83] = 112; + t[84] = 113; + t[85] = 114; + t[86] = 115; + t[87] = 116; + t[88] = 117; + t[89] = 118; + t[90] = 119; + t[91] = 120; + t[92] = 121; + t[93] = 122; + t[94] = 123; + t[95] = 124; + t[96] = 125; + t[97] = 126; + t[98] = 196; + t[99] = 197; + t[100] = 199; + t[101] = 201; + t[102] = 209; + t[103] = 214; + t[104] = 220; + t[105] = 225; + t[106] = 224; + t[107] = 226; + t[108] = 228; + t[109] = 227; + t[110] = 229; + t[111] = 231; + t[112] = 233; + t[113] = 232; + t[114] = 234; + t[115] = 235; + t[116] = 237; + t[117] = 236; + t[118] = 238; + t[119] = 239; + t[120] = 241; + t[121] = 243; + t[122] = 242; + t[123] = 244; + t[124] = 246; + t[125] = 245; + t[126] = 250; + t[127] = 249; + t[128] = 251; + t[129] = 252; + t[130] = 8224; + t[131] = 176; + t[132] = 162; + t[133] = 163; + t[134] = 167; + t[135] = 8226; + t[136] = 182; + t[137] = 223; + t[138] = 174; + t[139] = 169; + t[140] = 8482; + t[141] = 180; + t[142] = 168; + t[143] = 8800; + t[144] = 198; + t[145] = 216; + t[146] = 8734; + t[147] = 177; + t[148] = 8804; + t[149] = 8805; + t[150] = 165; + t[151] = 181; + t[152] = 8706; + t[153] = 8721; + t[154] = 8719; + t[156] = 8747; + t[157] = 170; + t[158] = 186; + t[159] = 8486; + t[160] = 230; + t[161] = 248; + t[162] = 191; + t[163] = 161; + t[164] = 172; + t[165] = 8730; + t[166] = 402; + t[167] = 8776; + t[168] = 8710; + t[169] = 171; + t[170] = 187; + t[171] = 8230; + t[179] = 8220; + t[180] = 8221; + t[181] = 8216; + t[182] = 8217; + t[200] = 193; + t[203] = 205; + t[207] = 211; + t[210] = 218; + t[223] = 711; + t[224] = 321; + t[225] = 322; + t[226] = 352; + t[227] = 353; + t[228] = 381; + t[229] = 382; + t[233] = 221; + t[234] = 253; + t[252] = 263; + t[253] = 268; + t[254] = 269; + t[258] = 258; + t[260] = 260; + t[261] = 261; + t[265] = 280; + t[266] = 281; + t[267] = 282; + t[268] = 283; + t[269] = 313; + t[275] = 323; + t[276] = 324; + t[278] = 328; + t[283] = 344; + t[284] = 345; + t[285] = 346; + t[286] = 347; + t[292] = 367; + t[295] = 377; + t[296] = 378; + t[298] = 380; + t[305] = 963; + t[306] = 964; + t[307] = 966; + t[308] = 8215; + t[309] = 8252; + t[310] = 8319; + t[311] = 8359; + t[312] = 8592; + t[313] = 8593; + t[337] = 9552; + t[493] = 1039; + t[494] = 1040; + t[672] = 1488; + t[673] = 1489; + t[674] = 1490; + t[675] = 1491; + t[676] = 1492; + t[677] = 1493; + t[678] = 1494; + t[679] = 1495; + t[680] = 1496; + t[681] = 1497; + t[682] = 1498; + t[683] = 1499; + t[684] = 1500; + t[685] = 1501; + t[686] = 1502; + t[687] = 1503; + t[688] = 1504; + t[689] = 1505; + t[690] = 1506; + t[691] = 1507; + t[692] = 1508; + t[693] = 1509; + t[694] = 1510; + t[695] = 1511; + t[696] = 1512; + t[697] = 1513; + t[698] = 1514; + t[705] = 1524; + t[706] = 8362; + t[710] = 64288; + t[711] = 64298; + t[759] = 1617; + t[761] = 1776; + t[763] = 1778; + t[775] = 1652; + t[777] = 1764; + t[778] = 1780; + t[779] = 1781; + t[780] = 1782; + t[782] = 771; + t[783] = 64726; + t[786] = 8363; + t[788] = 8532; + t[790] = 768; + t[791] = 769; + t[792] = 768; + t[795] = 803; + t[797] = 64336; + t[798] = 64337; + t[799] = 64342; + t[800] = 64343; + t[801] = 64344; + t[802] = 64345; + t[803] = 64362; + t[804] = 64363; + t[805] = 64364; + t[2424] = 7821; + t[2425] = 7822; + t[2426] = 7823; + t[2427] = 7824; + t[2428] = 7825; + t[2429] = 7826; + t[2430] = 7827; + t[2433] = 7682; + t[2678] = 8045; + t[2679] = 8046; + t[2830] = 1552; + t[2838] = 686; + t[2840] = 751; + t[2842] = 753; + t[2843] = 754; + t[2844] = 755; + t[2846] = 757; + t[2856] = 767; + t[2857] = 848; + t[2858] = 849; + t[2862] = 853; + t[2863] = 854; + t[2864] = 855; + t[2865] = 861; + t[2866] = 862; + t[2906] = 7460; + t[2908] = 7462; + t[2909] = 7463; + t[2910] = 7464; + t[2912] = 7466; + t[2913] = 7467; + t[2914] = 7468; + t[2916] = 7470; + t[2917] = 7471; + t[2918] = 7472; + t[2920] = 7474; + t[2921] = 7475; + t[2922] = 7476; + t[2924] = 7478; + t[2925] = 7479; + t[2926] = 7480; + t[2928] = 7482; + t[2929] = 7483; + t[2930] = 7484; + t[2932] = 7486; + t[2933] = 7487; + t[2934] = 7488; + t[2936] = 7490; + t[2937] = 7491; + t[2938] = 7492; + t[2940] = 7494; + t[2941] = 7495; + t[2942] = 7496; + t[2944] = 7498; + t[2946] = 7500; + t[2948] = 7502; + t[2950] = 7504; + t[2951] = 7505; + t[2952] = 7506; + t[2954] = 7508; + t[2955] = 7509; + t[2956] = 7510; + t[2958] = 7512; + t[2959] = 7513; + t[2960] = 7514; + t[2962] = 7516; + t[2963] = 7517; + t[2964] = 7518; + t[2966] = 7520; + t[2967] = 7521; + t[2968] = 7522; + t[2970] = 7524; + t[2971] = 7525; + t[2972] = 7526; + t[2974] = 7528; + t[2975] = 7529; + t[2976] = 7530; + t[2978] = 1537; + t[2979] = 1538; + t[2980] = 1539; + t[2982] = 1549; + t[2983] = 1551; + t[2984] = 1552; + t[2986] = 1554; + t[2987] = 1555; + t[2988] = 1556; + t[2990] = 1623; + t[2991] = 1624; + t[2995] = 1775; + t[2999] = 1791; + t[3002] = 64290; + t[3003] = 64291; + t[3004] = 64292; + t[3006] = 64294; + t[3007] = 64295; + t[3008] = 64296; + t[3011] = 1900; + t[3014] = 8223; + t[3015] = 8244; + t[3017] = 7532; + t[3018] = 7533; + t[3019] = 7534; + t[3075] = 7590; + t[3076] = 7591; + t[3079] = 7594; + t[3080] = 7595; + t[3083] = 7598; + t[3084] = 7599; + t[3087] = 7602; + t[3088] = 7603; + t[3091] = 7606; + t[3092] = 7607; + t[3095] = 7610; + t[3096] = 7611; + t[3099] = 7614; + t[3100] = 7615; + t[3103] = 7618; + t[3104] = 7619; + t[3107] = 8337; + t[3108] = 8338; + t[3116] = 1884; + t[3119] = 1885; + t[3120] = 1885; + t[3123] = 1886; + t[3124] = 1886; + t[3127] = 1887; + t[3128] = 1887; + t[3131] = 1888; + t[3132] = 1888; + t[3135] = 1889; + t[3136] = 1889; + t[3139] = 1890; + t[3140] = 1890; + t[3143] = 1891; + t[3144] = 1891; + t[3147] = 1892; + t[3148] = 1892; + t[3153] = 580; + t[3154] = 581; + t[3157] = 584; + t[3158] = 585; + t[3161] = 588; + t[3162] = 589; + t[3165] = 891; + t[3166] = 892; + t[3169] = 1274; + t[3170] = 1275; + t[3173] = 1278; + t[3174] = 1279; + t[3181] = 7622; + t[3182] = 7623; + t[3282] = 11799; + t[3316] = 578; + t[3379] = 42785; + t[3393] = 1159; + t[3416] = 8377; +}); +const getSupplementalGlyphMapForArialBlack = getLookupTableFactory(function (t) { + t[227] = 322; + t[264] = 261; + t[291] = 346; +}); +const getSupplementalGlyphMapForCalibri = getLookupTableFactory(function (t) { + t[1] = 32; + t[4] = 65; + t[5] = 192; + t[6] = 193; + t[9] = 196; + t[17] = 66; + t[18] = 67; + t[21] = 268; + t[24] = 68; + t[28] = 69; + t[29] = 200; + t[30] = 201; + t[32] = 282; + t[38] = 70; + t[39] = 71; + t[44] = 72; + t[47] = 73; + t[48] = 204; + t[49] = 205; + t[58] = 74; + t[60] = 75; + t[62] = 76; + t[68] = 77; + t[69] = 78; + t[75] = 79; + t[76] = 210; + t[80] = 214; + t[87] = 80; + t[89] = 81; + t[90] = 82; + t[92] = 344; + t[94] = 83; + t[97] = 352; + t[100] = 84; + t[104] = 85; + t[109] = 220; + t[115] = 86; + t[116] = 87; + t[121] = 88; + t[122] = 89; + t[124] = 221; + t[127] = 90; + t[129] = 381; + t[258] = 97; + t[259] = 224; + t[260] = 225; + t[263] = 228; + t[268] = 261; + t[271] = 98; + t[272] = 99; + t[273] = 263; + t[275] = 269; + t[282] = 100; + t[286] = 101; + t[287] = 232; + t[288] = 233; + t[290] = 283; + t[295] = 281; + t[296] = 102; + t[336] = 103; + t[346] = 104; + t[349] = 105; + t[350] = 236; + t[351] = 237; + t[361] = 106; + t[364] = 107; + t[367] = 108; + t[371] = 322; + t[373] = 109; + t[374] = 110; + t[381] = 111; + t[382] = 242; + t[383] = 243; + t[386] = 246; + t[393] = 112; + t[395] = 113; + t[396] = 114; + t[398] = 345; + t[400] = 115; + t[401] = 347; + t[403] = 353; + t[410] = 116; + t[437] = 117; + t[442] = 252; + t[448] = 118; + t[449] = 119; + t[454] = 120; + t[455] = 121; + t[457] = 253; + t[460] = 122; + t[462] = 382; + t[463] = 380; + t[853] = 44; + t[855] = 58; + t[856] = 46; + t[876] = 47; + t[878] = 45; + t[882] = 45; + t[894] = 40; + t[895] = 41; + t[896] = 91; + t[897] = 93; + t[923] = 64; + t[1004] = 48; + t[1005] = 49; + t[1006] = 50; + t[1007] = 51; + t[1008] = 52; + t[1009] = 53; + t[1010] = 54; + t[1011] = 55; + t[1012] = 56; + t[1013] = 57; + t[1081] = 37; + t[1085] = 43; + t[1086] = 45; +}); +function getStandardFontName(name) { + const fontName = normalizeFontName(name); + const stdFontMap = getStdFontMap(); + return stdFontMap[fontName]; +} +function isKnownFontName(name) { + const fontName = normalizeFontName(name); + return !!(getStdFontMap()[fontName] || getNonStdFontMap()[fontName] || getSerifFonts()[fontName] || getSymbolsFonts()[fontName]); +} + +;// ./src/core/to_unicode_map.js + +class ToUnicodeMap { + constructor(cmap = []) { + this._map = cmap; + } + get length() { + return this._map.length; + } + forEach(callback) { + for (const charCode in this._map) { + callback(charCode, this._map[charCode].codePointAt(0)); + } + } + has(i) { + return this._map[i] !== undefined; + } + get(i) { + return this._map[i]; + } + charCodeOf(value) { + const map = this._map; + if (map.length <= 0x10000) { + return map.indexOf(value); + } + for (const charCode in map) { + if (map[charCode] === value) { + return charCode | 0; + } + } + return -1; + } + amend(map) { + for (const charCode in map) { + this._map[charCode] = map[charCode]; + } + } +} +class IdentityToUnicodeMap { + constructor(firstChar, lastChar) { + this.firstChar = firstChar; + this.lastChar = lastChar; + } + get length() { + return this.lastChar + 1 - this.firstChar; + } + forEach(callback) { + for (let i = this.firstChar, ii = this.lastChar; i <= ii; i++) { + callback(i, i); + } + } + has(i) { + return this.firstChar <= i && i <= this.lastChar; + } + get(i) { + if (this.firstChar <= i && i <= this.lastChar) { + return String.fromCharCode(i); + } + return undefined; + } + charCodeOf(v) { + return Number.isInteger(v) && v >= this.firstChar && v <= this.lastChar ? v : -1; + } + amend(map) { + unreachable("Should not call amend()"); + } +} + +;// ./src/core/cff_font.js + + + +class CFFFont { + constructor(file, properties) { + this.properties = properties; + const parser = new CFFParser(file, properties, SEAC_ANALYSIS_ENABLED); + this.cff = parser.parse(); + this.cff.duplicateFirstGlyph(); + const compiler = new CFFCompiler(this.cff); + this.seacs = this.cff.seacs; + try { + this.data = compiler.compile(); + } catch { + warn("Failed to compile font " + properties.loadedName); + this.data = file; + } + this._createBuiltInEncoding(); + } + get numGlyphs() { + return this.cff.charStrings.count; + } + getCharset() { + return this.cff.charset.charset; + } + getGlyphMapping() { + const cff = this.cff; + const properties = this.properties; + const { + cidToGidMap, + cMap + } = properties; + const charsets = cff.charset.charset; + let charCodeToGlyphId; + let glyphId; + if (properties.composite) { + let invCidToGidMap; + if (cidToGidMap?.length > 0) { + invCidToGidMap = Object.create(null); + for (let i = 0, ii = cidToGidMap.length; i < ii; i++) { + const gid = cidToGidMap[i]; + if (gid !== undefined) { + invCidToGidMap[gid] = i; + } + } + } + charCodeToGlyphId = Object.create(null); + let charCode; + if (cff.isCIDFont) { + for (glyphId = 0; glyphId < charsets.length; glyphId++) { + const cid = charsets[glyphId]; + charCode = cMap.charCodeOf(cid); + if (invCidToGidMap?.[charCode] !== undefined) { + charCode = invCidToGidMap[charCode]; + } + charCodeToGlyphId[charCode] = glyphId; + } + } else { + for (glyphId = 0; glyphId < cff.charStrings.count; glyphId++) { + charCode = cMap.charCodeOf(glyphId); + charCodeToGlyphId[charCode] = glyphId; + } + } + return charCodeToGlyphId; + } + let encoding = cff.encoding ? cff.encoding.encoding : null; + if (properties.isInternalFont) { + encoding = properties.defaultEncoding; + } + charCodeToGlyphId = type1FontGlyphMapping(properties, encoding, charsets); + return charCodeToGlyphId; + } + hasGlyphId(id) { + return this.cff.hasGlyphId(id); + } + _createBuiltInEncoding() { + const { + charset, + encoding + } = this.cff; + if (!charset || !encoding) { + return; + } + const charsets = charset.charset, + encodings = encoding.encoding; + const map = []; + for (const charCode in encodings) { + const glyphId = encodings[charCode]; + if (glyphId >= 0) { + const glyphName = charsets[glyphId]; + if (glyphName) { + map[charCode] = glyphName; + } + } + } + if (map.length > 0) { + this.properties.builtInEncoding = map; + } + } +} + +;// ./src/core/font_renderer.js + + + + + + +function getUint32(data, offset) { + return (data[offset] << 24 | data[offset + 1] << 16 | data[offset + 2] << 8 | data[offset + 3]) >>> 0; +} +function getUint16(data, offset) { + return data[offset] << 8 | data[offset + 1]; +} +function getInt16(data, offset) { + return (data[offset] << 24 | data[offset + 1] << 16) >> 16; +} +function getInt8(data, offset) { + return data[offset] << 24 >> 24; +} +function getFloat214(data, offset) { + return getInt16(data, offset) / 16384; +} +function getSubroutineBias(subrs) { + const numSubrs = subrs.length; + let bias = 32768; + if (numSubrs < 1240) { + bias = 107; + } else if (numSubrs < 33900) { + bias = 1131; + } + return bias; +} +function parseCmap(data, start, end) { + const offset = getUint16(data, start + 2) === 1 ? getUint32(data, start + 8) : getUint32(data, start + 16); + const format = getUint16(data, start + offset); + let ranges, p, i; + if (format === 4) { + getUint16(data, start + offset + 2); + const segCount = getUint16(data, start + offset + 6) >> 1; + p = start + offset + 14; + ranges = []; + for (i = 0; i < segCount; i++, p += 2) { + ranges[i] = { + end: getUint16(data, p) + }; + } + p += 2; + for (i = 0; i < segCount; i++, p += 2) { + ranges[i].start = getUint16(data, p); + } + for (i = 0; i < segCount; i++, p += 2) { + ranges[i].idDelta = getUint16(data, p); + } + for (i = 0; i < segCount; i++, p += 2) { + let idOffset = getUint16(data, p); + if (idOffset === 0) { + continue; + } + ranges[i].ids = []; + for (let j = 0, jj = ranges[i].end - ranges[i].start + 1; j < jj; j++) { + ranges[i].ids[j] = getUint16(data, p + idOffset); + idOffset += 2; + } + } + return ranges; + } else if (format === 12) { + const groups = getUint32(data, start + offset + 12); + p = start + offset + 16; + ranges = []; + for (i = 0; i < groups; i++) { + start = getUint32(data, p); + ranges.push({ + start, + end: getUint32(data, p + 4), + idDelta: getUint32(data, p + 8) - start + }); + p += 12; + } + return ranges; + } + throw new FormatError(`unsupported cmap: ${format}`); +} +function parseCff(data, start, end, seacAnalysisEnabled) { + const properties = {}; + const parser = new CFFParser(new Stream(data, start, end - start), properties, seacAnalysisEnabled); + const cff = parser.parse(); + return { + glyphs: cff.charStrings.objects, + subrs: cff.topDict.privateDict?.subrsIndex?.objects, + gsubrs: cff.globalSubrIndex?.objects, + isCFFCIDFont: cff.isCIDFont, + fdSelect: cff.fdSelect, + fdArray: cff.fdArray + }; +} +function parseGlyfTable(glyf, loca, isGlyphLocationsLong) { + let itemSize, itemDecode; + if (isGlyphLocationsLong) { + itemSize = 4; + itemDecode = getUint32; + } else { + itemSize = 2; + itemDecode = (data, offset) => 2 * getUint16(data, offset); + } + const glyphs = []; + let startOffset = itemDecode(loca, 0); + for (let j = itemSize; j < loca.length; j += itemSize) { + const endOffset = itemDecode(loca, j); + glyphs.push(glyf.subarray(startOffset, endOffset)); + startOffset = endOffset; + } + return glyphs; +} +function lookupCmap(ranges, unicode) { + const code = unicode.codePointAt(0); + let gid = 0, + l = 0, + r = ranges.length - 1; + while (l < r) { + const c = l + r + 1 >> 1; + if (code < ranges[c].start) { + r = c - 1; + } else { + l = c; + } + } + if (ranges[l].start <= code && code <= ranges[l].end) { + gid = ranges[l].idDelta + (ranges[l].ids ? ranges[l].ids[code - ranges[l].start] : code) & 0xffff; + } + return { + charCode: code, + glyphId: gid + }; +} +function compileGlyf(code, cmds, font) { + function moveTo(x, y) { + cmds.add("M", [x, y]); + } + function lineTo(x, y) { + cmds.add("L", [x, y]); + } + function quadraticCurveTo(xa, ya, x, y) { + cmds.add("Q", [xa, ya, x, y]); + } + let i = 0; + const numberOfContours = getInt16(code, i); + let flags; + let x = 0, + y = 0; + i += 10; + if (numberOfContours < 0) { + do { + flags = getUint16(code, i); + const glyphIndex = getUint16(code, i + 2); + i += 4; + let arg1, arg2; + if (flags & 0x01) { + if (flags & 0x02) { + arg1 = getInt16(code, i); + arg2 = getInt16(code, i + 2); + } else { + arg1 = getUint16(code, i); + arg2 = getUint16(code, i + 2); + } + i += 4; + } else if (flags & 0x02) { + arg1 = getInt8(code, i++); + arg2 = getInt8(code, i++); + } else { + arg1 = code[i++]; + arg2 = code[i++]; + } + if (flags & 0x02) { + x = arg1; + y = arg2; + } else { + x = 0; + y = 0; + } + let scaleX = 1, + scaleY = 1, + scale01 = 0, + scale10 = 0; + if (flags & 0x08) { + scaleX = scaleY = getFloat214(code, i); + i += 2; + } else if (flags & 0x40) { + scaleX = getFloat214(code, i); + scaleY = getFloat214(code, i + 2); + i += 4; + } else if (flags & 0x80) { + scaleX = getFloat214(code, i); + scale01 = getFloat214(code, i + 2); + scale10 = getFloat214(code, i + 4); + scaleY = getFloat214(code, i + 6); + i += 8; + } + const subglyph = font.glyphs[glyphIndex]; + if (subglyph) { + cmds.save(); + cmds.transform([scaleX, scale01, scale10, scaleY, x, y]); + if (!(flags & 0x02)) {} + compileGlyf(subglyph, cmds, font); + cmds.restore(); + } + } while (flags & 0x20); + } else { + const endPtsOfContours = []; + let j, jj; + for (j = 0; j < numberOfContours; j++) { + endPtsOfContours.push(getUint16(code, i)); + i += 2; + } + const instructionLength = getUint16(code, i); + i += 2 + instructionLength; + const numberOfPoints = endPtsOfContours.at(-1) + 1; + const points = []; + while (points.length < numberOfPoints) { + flags = code[i++]; + let repeat = 1; + if (flags & 0x08) { + repeat += code[i++]; + } + while (repeat-- > 0) { + points.push({ + flags + }); + } + } + for (j = 0; j < numberOfPoints; j++) { + switch (points[j].flags & 0x12) { + case 0x00: + x += getInt16(code, i); + i += 2; + break; + case 0x02: + x -= code[i++]; + break; + case 0x12: + x += code[i++]; + break; + } + points[j].x = x; + } + for (j = 0; j < numberOfPoints; j++) { + switch (points[j].flags & 0x24) { + case 0x00: + y += getInt16(code, i); + i += 2; + break; + case 0x04: + y -= code[i++]; + break; + case 0x24: + y += code[i++]; + break; + } + points[j].y = y; + } + let startPoint = 0; + for (i = 0; i < numberOfContours; i++) { + const endPoint = endPtsOfContours[i]; + const contour = points.slice(startPoint, endPoint + 1); + if (contour[0].flags & 1) { + contour.push(contour[0]); + } else if (contour.at(-1).flags & 1) { + contour.unshift(contour.at(-1)); + } else { + const p = { + flags: 1, + x: (contour[0].x + contour.at(-1).x) / 2, + y: (contour[0].y + contour.at(-1).y) / 2 + }; + contour.unshift(p); + contour.push(p); + } + moveTo(contour[0].x, contour[0].y); + for (j = 1, jj = contour.length; j < jj; j++) { + if (contour[j].flags & 1) { + lineTo(contour[j].x, contour[j].y); + } else if (contour[j + 1].flags & 1) { + quadraticCurveTo(contour[j].x, contour[j].y, contour[j + 1].x, contour[j + 1].y); + j++; + } else { + quadraticCurveTo(contour[j].x, contour[j].y, (contour[j].x + contour[j + 1].x) / 2, (contour[j].y + contour[j + 1].y) / 2); + } + } + startPoint = endPoint + 1; + } + } +} +function compileCharString(charStringCode, cmds, font, glyphId) { + function moveTo(x, y) { + cmds.add("M", [x, y]); + } + function lineTo(x, y) { + cmds.add("L", [x, y]); + } + function bezierCurveTo(x1, y1, x2, y2, x, y) { + cmds.add("C", [x1, y1, x2, y2, x, y]); + } + const stack = []; + let x = 0, + y = 0; + let stems = 0; + function parse(code) { + let i = 0; + while (i < code.length) { + let stackClean = false; + let v = code[i++]; + let xa, xb, ya, yb, y1, y2, y3, n, subrCode; + switch (v) { + case 1: + stems += stack.length >> 1; + stackClean = true; + break; + case 3: + stems += stack.length >> 1; + stackClean = true; + break; + case 4: + y += stack.pop(); + moveTo(x, y); + stackClean = true; + break; + case 5: + while (stack.length > 0) { + x += stack.shift(); + y += stack.shift(); + lineTo(x, y); + } + break; + case 6: + while (stack.length > 0) { + x += stack.shift(); + lineTo(x, y); + if (stack.length === 0) { + break; + } + y += stack.shift(); + lineTo(x, y); + } + break; + case 7: + while (stack.length > 0) { + y += stack.shift(); + lineTo(x, y); + if (stack.length === 0) { + break; + } + x += stack.shift(); + lineTo(x, y); + } + break; + case 8: + while (stack.length > 0) { + xa = x + stack.shift(); + ya = y + stack.shift(); + xb = xa + stack.shift(); + yb = ya + stack.shift(); + x = xb + stack.shift(); + y = yb + stack.shift(); + bezierCurveTo(xa, ya, xb, yb, x, y); + } + break; + case 10: + n = stack.pop(); + subrCode = null; + if (font.isCFFCIDFont) { + const fdIndex = font.fdSelect.getFDIndex(glyphId); + if (fdIndex >= 0 && fdIndex < font.fdArray.length) { + const fontDict = font.fdArray[fdIndex]; + let subrs; + if (fontDict.privateDict?.subrsIndex) { + subrs = fontDict.privateDict.subrsIndex.objects; + } + if (subrs) { + n += getSubroutineBias(subrs); + subrCode = subrs[n]; + } + } else { + warn("Invalid fd index for glyph index."); + } + } else { + subrCode = font.subrs[n + font.subrsBias]; + } + if (subrCode) { + parse(subrCode); + } + break; + case 11: + return; + case 12: + v = code[i++]; + switch (v) { + case 34: + xa = x + stack.shift(); + xb = xa + stack.shift(); + y1 = y + stack.shift(); + x = xb + stack.shift(); + bezierCurveTo(xa, y, xb, y1, x, y1); + xa = x + stack.shift(); + xb = xa + stack.shift(); + x = xb + stack.shift(); + bezierCurveTo(xa, y1, xb, y, x, y); + break; + case 35: + xa = x + stack.shift(); + ya = y + stack.shift(); + xb = xa + stack.shift(); + yb = ya + stack.shift(); + x = xb + stack.shift(); + y = yb + stack.shift(); + bezierCurveTo(xa, ya, xb, yb, x, y); + xa = x + stack.shift(); + ya = y + stack.shift(); + xb = xa + stack.shift(); + yb = ya + stack.shift(); + x = xb + stack.shift(); + y = yb + stack.shift(); + bezierCurveTo(xa, ya, xb, yb, x, y); + stack.pop(); + break; + case 36: + xa = x + stack.shift(); + y1 = y + stack.shift(); + xb = xa + stack.shift(); + y2 = y1 + stack.shift(); + x = xb + stack.shift(); + bezierCurveTo(xa, y1, xb, y2, x, y2); + xa = x + stack.shift(); + xb = xa + stack.shift(); + y3 = y2 + stack.shift(); + x = xb + stack.shift(); + bezierCurveTo(xa, y2, xb, y3, x, y); + break; + case 37: + const x0 = x, + y0 = y; + xa = x + stack.shift(); + ya = y + stack.shift(); + xb = xa + stack.shift(); + yb = ya + stack.shift(); + x = xb + stack.shift(); + y = yb + stack.shift(); + bezierCurveTo(xa, ya, xb, yb, x, y); + xa = x + stack.shift(); + ya = y + stack.shift(); + xb = xa + stack.shift(); + yb = ya + stack.shift(); + x = xb; + y = yb; + if (Math.abs(x - x0) > Math.abs(y - y0)) { + x += stack.shift(); + } else { + y += stack.shift(); + } + bezierCurveTo(xa, ya, xb, yb, x, y); + break; + default: + throw new FormatError(`unknown operator: 12 ${v}`); + } + break; + case 14: + if (stack.length >= 4) { + const achar = stack.pop(); + const bchar = stack.pop(); + y = stack.pop(); + x = stack.pop(); + cmds.save(); + cmds.translate(x, y); + let cmap = lookupCmap(font.cmap, String.fromCharCode(font.glyphNameMap[StandardEncoding[achar]])); + compileCharString(font.glyphs[cmap.glyphId], cmds, font, cmap.glyphId); + cmds.restore(); + cmap = lookupCmap(font.cmap, String.fromCharCode(font.glyphNameMap[StandardEncoding[bchar]])); + compileCharString(font.glyphs[cmap.glyphId], cmds, font, cmap.glyphId); + } + return; + case 18: + stems += stack.length >> 1; + stackClean = true; + break; + case 19: + stems += stack.length >> 1; + i += stems + 7 >> 3; + stackClean = true; + break; + case 20: + stems += stack.length >> 1; + i += stems + 7 >> 3; + stackClean = true; + break; + case 21: + y += stack.pop(); + x += stack.pop(); + moveTo(x, y); + stackClean = true; + break; + case 22: + x += stack.pop(); + moveTo(x, y); + stackClean = true; + break; + case 23: + stems += stack.length >> 1; + stackClean = true; + break; + case 24: + while (stack.length > 2) { + xa = x + stack.shift(); + ya = y + stack.shift(); + xb = xa + stack.shift(); + yb = ya + stack.shift(); + x = xb + stack.shift(); + y = yb + stack.shift(); + bezierCurveTo(xa, ya, xb, yb, x, y); + } + x += stack.shift(); + y += stack.shift(); + lineTo(x, y); + break; + case 25: + while (stack.length > 6) { + x += stack.shift(); + y += stack.shift(); + lineTo(x, y); + } + xa = x + stack.shift(); + ya = y + stack.shift(); + xb = xa + stack.shift(); + yb = ya + stack.shift(); + x = xb + stack.shift(); + y = yb + stack.shift(); + bezierCurveTo(xa, ya, xb, yb, x, y); + break; + case 26: + if (stack.length % 2) { + x += stack.shift(); + } + while (stack.length > 0) { + xa = x; + ya = y + stack.shift(); + xb = xa + stack.shift(); + yb = ya + stack.shift(); + x = xb; + y = yb + stack.shift(); + bezierCurveTo(xa, ya, xb, yb, x, y); + } + break; + case 27: + if (stack.length % 2) { + y += stack.shift(); + } + while (stack.length > 0) { + xa = x + stack.shift(); + ya = y; + xb = xa + stack.shift(); + yb = ya + stack.shift(); + x = xb + stack.shift(); + y = yb; + bezierCurveTo(xa, ya, xb, yb, x, y); + } + break; + case 28: + stack.push((code[i] << 24 | code[i + 1] << 16) >> 16); + i += 2; + break; + case 29: + n = stack.pop() + font.gsubrsBias; + subrCode = font.gsubrs[n]; + if (subrCode) { + parse(subrCode); + } + break; + case 30: + while (stack.length > 0) { + xa = x; + ya = y + stack.shift(); + xb = xa + stack.shift(); + yb = ya + stack.shift(); + x = xb + stack.shift(); + y = yb + (stack.length === 1 ? stack.shift() : 0); + bezierCurveTo(xa, ya, xb, yb, x, y); + if (stack.length === 0) { + break; + } + xa = x + stack.shift(); + ya = y; + xb = xa + stack.shift(); + yb = ya + stack.shift(); + y = yb + stack.shift(); + x = xb + (stack.length === 1 ? stack.shift() : 0); + bezierCurveTo(xa, ya, xb, yb, x, y); + } + break; + case 31: + while (stack.length > 0) { + xa = x + stack.shift(); + ya = y; + xb = xa + stack.shift(); + yb = ya + stack.shift(); + y = yb + stack.shift(); + x = xb + (stack.length === 1 ? stack.shift() : 0); + bezierCurveTo(xa, ya, xb, yb, x, y); + if (stack.length === 0) { + break; + } + xa = x; + ya = y + stack.shift(); + xb = xa + stack.shift(); + yb = ya + stack.shift(); + x = xb + stack.shift(); + y = yb + (stack.length === 1 ? stack.shift() : 0); + bezierCurveTo(xa, ya, xb, yb, x, y); + } + break; + default: + if (v < 32) { + throw new FormatError(`unknown operator: ${v}`); + } + if (v < 247) { + stack.push(v - 139); + } else if (v < 251) { + stack.push((v - 247) * 256 + code[i++] + 108); + } else if (v < 255) { + stack.push(-(v - 251) * 256 - code[i++] - 108); + } else { + stack.push((code[i] << 24 | code[i + 1] << 16 | code[i + 2] << 8 | code[i + 3]) / 65536); + i += 4; + } + break; + } + if (stackClean) { + stack.length = 0; + } + } + } + parse(charStringCode); +} +const NOOP = ""; +class Commands { + cmds = []; + transformStack = []; + currentTransform = [1, 0, 0, 1, 0, 0]; + add(cmd, args) { + if (args) { + const [a, b, c, d, e, f] = this.currentTransform; + for (let i = 0, ii = args.length; i < ii; i += 2) { + const x = args[i]; + const y = args[i + 1]; + args[i] = a * x + c * y + e; + args[i + 1] = b * x + d * y + f; + } + this.cmds.push(`${cmd}${args.join(" ")}`); + } else { + this.cmds.push(cmd); + } + } + transform(transf) { + this.currentTransform = Util.transform(this.currentTransform, transf); + } + translate(x, y) { + this.transform([1, 0, 0, 1, x, y]); + } + save() { + this.transformStack.push(this.currentTransform.slice()); + } + restore() { + this.currentTransform = this.transformStack.pop() || [1, 0, 0, 1, 0, 0]; + } + getSVG() { + return this.cmds.join(""); + } +} +class CompiledFont { + constructor(fontMatrix) { + this.fontMatrix = fontMatrix; + this.compiledGlyphs = Object.create(null); + this.compiledCharCodeToGlyphId = Object.create(null); + } + getPathJs(unicode) { + const { + charCode, + glyphId + } = lookupCmap(this.cmap, unicode); + let fn = this.compiledGlyphs[glyphId], + compileEx; + if (fn === undefined) { + try { + fn = this.compileGlyph(this.glyphs[glyphId], glyphId); + } catch (ex) { + fn = NOOP; + compileEx = ex; + } + this.compiledGlyphs[glyphId] = fn; + } + this.compiledCharCodeToGlyphId[charCode] ??= glyphId; + if (compileEx) { + throw compileEx; + } + return fn; + } + compileGlyph(code, glyphId) { + if (!code?.length || code[0] === 14) { + return NOOP; + } + let fontMatrix = this.fontMatrix; + if (this.isCFFCIDFont) { + const fdIndex = this.fdSelect.getFDIndex(glyphId); + if (fdIndex >= 0 && fdIndex < this.fdArray.length) { + const fontDict = this.fdArray[fdIndex]; + fontMatrix = fontDict.getByName("FontMatrix") || FONT_IDENTITY_MATRIX; + } else { + warn("Invalid fd index for glyph index."); + } + } + assert(isNumberArray(fontMatrix, 6), "Expected a valid fontMatrix."); + const cmds = new Commands(); + cmds.transform(fontMatrix.slice()); + this.compileGlyphImpl(code, cmds, glyphId); + cmds.add("Z"); + return cmds.getSVG(); + } + compileGlyphImpl() { + unreachable("Children classes should implement this."); + } + hasBuiltPath(unicode) { + const { + charCode, + glyphId + } = lookupCmap(this.cmap, unicode); + return this.compiledGlyphs[glyphId] !== undefined && this.compiledCharCodeToGlyphId[charCode] !== undefined; + } +} +class TrueTypeCompiled extends CompiledFont { + constructor(glyphs, cmap, fontMatrix) { + super(fontMatrix || [0.000488, 0, 0, 0.000488, 0, 0]); + this.glyphs = glyphs; + this.cmap = cmap; + } + compileGlyphImpl(code, cmds) { + compileGlyf(code, cmds, this); + } +} +class Type2Compiled extends CompiledFont { + constructor(cffInfo, cmap, fontMatrix) { + super(fontMatrix || [0.001, 0, 0, 0.001, 0, 0]); + this.glyphs = cffInfo.glyphs; + this.gsubrs = cffInfo.gsubrs || []; + this.subrs = cffInfo.subrs || []; + this.cmap = cmap; + this.glyphNameMap = getGlyphsUnicode(); + this.gsubrsBias = getSubroutineBias(this.gsubrs); + this.subrsBias = getSubroutineBias(this.subrs); + this.isCFFCIDFont = cffInfo.isCFFCIDFont; + this.fdSelect = cffInfo.fdSelect; + this.fdArray = cffInfo.fdArray; + } + compileGlyphImpl(code, cmds, glyphId) { + compileCharString(code, cmds, this, glyphId); + } +} +class FontRendererFactory { + static create(font, seacAnalysisEnabled) { + const data = new Uint8Array(font.data); + let cmap, glyf, loca, cff, indexToLocFormat, unitsPerEm; + const numTables = getUint16(data, 4); + for (let i = 0, p = 12; i < numTables; i++, p += 16) { + const tag = bytesToString(data.subarray(p, p + 4)); + const offset = getUint32(data, p + 8); + const length = getUint32(data, p + 12); + switch (tag) { + case "cmap": + cmap = parseCmap(data, offset, offset + length); + break; + case "glyf": + glyf = data.subarray(offset, offset + length); + break; + case "loca": + loca = data.subarray(offset, offset + length); + break; + case "head": + unitsPerEm = getUint16(data, offset + 18); + indexToLocFormat = getUint16(data, offset + 50); + break; + case "CFF ": + cff = parseCff(data, offset, offset + length, seacAnalysisEnabled); + break; + } + } + if (glyf) { + const fontMatrix = !unitsPerEm ? font.fontMatrix : [1 / unitsPerEm, 0, 0, 1 / unitsPerEm, 0, 0]; + return new TrueTypeCompiled(parseGlyfTable(glyf, loca, indexToLocFormat), cmap, fontMatrix); + } + return new Type2Compiled(cff, cmap, font.fontMatrix); + } +} + +;// ./src/core/metrics.js + +const getMetrics = getLookupTableFactory(function (t) { + t.Courier = 600; + t["Courier-Bold"] = 600; + t["Courier-BoldOblique"] = 600; + t["Courier-Oblique"] = 600; + t.Helvetica = getLookupTableFactory(function (t) { + t.space = 278; + t.exclam = 278; + t.quotedbl = 355; + t.numbersign = 556; + t.dollar = 556; + t.percent = 889; + t.ampersand = 667; + t.quoteright = 222; + t.parenleft = 333; + t.parenright = 333; + t.asterisk = 389; + t.plus = 584; + t.comma = 278; + t.hyphen = 333; + t.period = 278; + t.slash = 278; + t.zero = 556; + t.one = 556; + t.two = 556; + t.three = 556; + t.four = 556; + t.five = 556; + t.six = 556; + t.seven = 556; + t.eight = 556; + t.nine = 556; + t.colon = 278; + t.semicolon = 278; + t.less = 584; + t.equal = 584; + t.greater = 584; + t.question = 556; + t.at = 1015; + t.A = 667; + t.B = 667; + t.C = 722; + t.D = 722; + t.E = 667; + t.F = 611; + t.G = 778; + t.H = 722; + t.I = 278; + t.J = 500; + t.K = 667; + t.L = 556; + t.M = 833; + t.N = 722; + t.O = 778; + t.P = 667; + t.Q = 778; + t.R = 722; + t.S = 667; + t.T = 611; + t.U = 722; + t.V = 667; + t.W = 944; + t.X = 667; + t.Y = 667; + t.Z = 611; + t.bracketleft = 278; + t.backslash = 278; + t.bracketright = 278; + t.asciicircum = 469; + t.underscore = 556; + t.quoteleft = 222; + t.a = 556; + t.b = 556; + t.c = 500; + t.d = 556; + t.e = 556; + t.f = 278; + t.g = 556; + t.h = 556; + t.i = 222; + t.j = 222; + t.k = 500; + t.l = 222; + t.m = 833; + t.n = 556; + t.o = 556; + t.p = 556; + t.q = 556; + t.r = 333; + t.s = 500; + t.t = 278; + t.u = 556; + t.v = 500; + t.w = 722; + t.x = 500; + t.y = 500; + t.z = 500; + t.braceleft = 334; + t.bar = 260; + t.braceright = 334; + t.asciitilde = 584; + t.exclamdown = 333; + t.cent = 556; + t.sterling = 556; + t.fraction = 167; + t.yen = 556; + t.florin = 556; + t.section = 556; + t.currency = 556; + t.quotesingle = 191; + t.quotedblleft = 333; + t.guillemotleft = 556; + t.guilsinglleft = 333; + t.guilsinglright = 333; + t.fi = 500; + t.fl = 500; + t.endash = 556; + t.dagger = 556; + t.daggerdbl = 556; + t.periodcentered = 278; + t.paragraph = 537; + t.bullet = 350; + t.quotesinglbase = 222; + t.quotedblbase = 333; + t.quotedblright = 333; + t.guillemotright = 556; + t.ellipsis = 1000; + t.perthousand = 1000; + t.questiondown = 611; + t.grave = 333; + t.acute = 333; + t.circumflex = 333; + t.tilde = 333; + t.macron = 333; + t.breve = 333; + t.dotaccent = 333; + t.dieresis = 333; + t.ring = 333; + t.cedilla = 333; + t.hungarumlaut = 333; + t.ogonek = 333; + t.caron = 333; + t.emdash = 1000; + t.AE = 1000; + t.ordfeminine = 370; + t.Lslash = 556; + t.Oslash = 778; + t.OE = 1000; + t.ordmasculine = 365; + t.ae = 889; + t.dotlessi = 278; + t.lslash = 222; + t.oslash = 611; + t.oe = 944; + t.germandbls = 611; + t.Idieresis = 278; + t.eacute = 556; + t.abreve = 556; + t.uhungarumlaut = 556; + t.ecaron = 556; + t.Ydieresis = 667; + t.divide = 584; + t.Yacute = 667; + t.Acircumflex = 667; + t.aacute = 556; + t.Ucircumflex = 722; + t.yacute = 500; + t.scommaaccent = 500; + t.ecircumflex = 556; + t.Uring = 722; + t.Udieresis = 722; + t.aogonek = 556; + t.Uacute = 722; + t.uogonek = 556; + t.Edieresis = 667; + t.Dcroat = 722; + t.commaaccent = 250; + t.copyright = 737; + t.Emacron = 667; + t.ccaron = 500; + t.aring = 556; + t.Ncommaaccent = 722; + t.lacute = 222; + t.agrave = 556; + t.Tcommaaccent = 611; + t.Cacute = 722; + t.atilde = 556; + t.Edotaccent = 667; + t.scaron = 500; + t.scedilla = 500; + t.iacute = 278; + t.lozenge = 471; + t.Rcaron = 722; + t.Gcommaaccent = 778; + t.ucircumflex = 556; + t.acircumflex = 556; + t.Amacron = 667; + t.rcaron = 333; + t.ccedilla = 500; + t.Zdotaccent = 611; + t.Thorn = 667; + t.Omacron = 778; + t.Racute = 722; + t.Sacute = 667; + t.dcaron = 643; + t.Umacron = 722; + t.uring = 556; + t.threesuperior = 333; + t.Ograve = 778; + t.Agrave = 667; + t.Abreve = 667; + t.multiply = 584; + t.uacute = 556; + t.Tcaron = 611; + t.partialdiff = 476; + t.ydieresis = 500; + t.Nacute = 722; + t.icircumflex = 278; + t.Ecircumflex = 667; + t.adieresis = 556; + t.edieresis = 556; + t.cacute = 500; + t.nacute = 556; + t.umacron = 556; + t.Ncaron = 722; + t.Iacute = 278; + t.plusminus = 584; + t.brokenbar = 260; + t.registered = 737; + t.Gbreve = 778; + t.Idotaccent = 278; + t.summation = 600; + t.Egrave = 667; + t.racute = 333; + t.omacron = 556; + t.Zacute = 611; + t.Zcaron = 611; + t.greaterequal = 549; + t.Eth = 722; + t.Ccedilla = 722; + t.lcommaaccent = 222; + t.tcaron = 317; + t.eogonek = 556; + t.Uogonek = 722; + t.Aacute = 667; + t.Adieresis = 667; + t.egrave = 556; + t.zacute = 500; + t.iogonek = 222; + t.Oacute = 778; + t.oacute = 556; + t.amacron = 556; + t.sacute = 500; + t.idieresis = 278; + t.Ocircumflex = 778; + t.Ugrave = 722; + t.Delta = 612; + t.thorn = 556; + t.twosuperior = 333; + t.Odieresis = 778; + t.mu = 556; + t.igrave = 278; + t.ohungarumlaut = 556; + t.Eogonek = 667; + t.dcroat = 556; + t.threequarters = 834; + t.Scedilla = 667; + t.lcaron = 299; + t.Kcommaaccent = 667; + t.Lacute = 556; + t.trademark = 1000; + t.edotaccent = 556; + t.Igrave = 278; + t.Imacron = 278; + t.Lcaron = 556; + t.onehalf = 834; + t.lessequal = 549; + t.ocircumflex = 556; + t.ntilde = 556; + t.Uhungarumlaut = 722; + t.Eacute = 667; + t.emacron = 556; + t.gbreve = 556; + t.onequarter = 834; + t.Scaron = 667; + t.Scommaaccent = 667; + t.Ohungarumlaut = 778; + t.degree = 400; + t.ograve = 556; + t.Ccaron = 722; + t.ugrave = 556; + t.radical = 453; + t.Dcaron = 722; + t.rcommaaccent = 333; + t.Ntilde = 722; + t.otilde = 556; + t.Rcommaaccent = 722; + t.Lcommaaccent = 556; + t.Atilde = 667; + t.Aogonek = 667; + t.Aring = 667; + t.Otilde = 778; + t.zdotaccent = 500; + t.Ecaron = 667; + t.Iogonek = 278; + t.kcommaaccent = 500; + t.minus = 584; + t.Icircumflex = 278; + t.ncaron = 556; + t.tcommaaccent = 278; + t.logicalnot = 584; + t.odieresis = 556; + t.udieresis = 556; + t.notequal = 549; + t.gcommaaccent = 556; + t.eth = 556; + t.zcaron = 500; + t.ncommaaccent = 556; + t.onesuperior = 333; + t.imacron = 278; + t.Euro = 556; + }); + t["Helvetica-Bold"] = getLookupTableFactory(function (t) { + t.space = 278; + t.exclam = 333; + t.quotedbl = 474; + t.numbersign = 556; + t.dollar = 556; + t.percent = 889; + t.ampersand = 722; + t.quoteright = 278; + t.parenleft = 333; + t.parenright = 333; + t.asterisk = 389; + t.plus = 584; + t.comma = 278; + t.hyphen = 333; + t.period = 278; + t.slash = 278; + t.zero = 556; + t.one = 556; + t.two = 556; + t.three = 556; + t.four = 556; + t.five = 556; + t.six = 556; + t.seven = 556; + t.eight = 556; + t.nine = 556; + t.colon = 333; + t.semicolon = 333; + t.less = 584; + t.equal = 584; + t.greater = 584; + t.question = 611; + t.at = 975; + t.A = 722; + t.B = 722; + t.C = 722; + t.D = 722; + t.E = 667; + t.F = 611; + t.G = 778; + t.H = 722; + t.I = 278; + t.J = 556; + t.K = 722; + t.L = 611; + t.M = 833; + t.N = 722; + t.O = 778; + t.P = 667; + t.Q = 778; + t.R = 722; + t.S = 667; + t.T = 611; + t.U = 722; + t.V = 667; + t.W = 944; + t.X = 667; + t.Y = 667; + t.Z = 611; + t.bracketleft = 333; + t.backslash = 278; + t.bracketright = 333; + t.asciicircum = 584; + t.underscore = 556; + t.quoteleft = 278; + t.a = 556; + t.b = 611; + t.c = 556; + t.d = 611; + t.e = 556; + t.f = 333; + t.g = 611; + t.h = 611; + t.i = 278; + t.j = 278; + t.k = 556; + t.l = 278; + t.m = 889; + t.n = 611; + t.o = 611; + t.p = 611; + t.q = 611; + t.r = 389; + t.s = 556; + t.t = 333; + t.u = 611; + t.v = 556; + t.w = 778; + t.x = 556; + t.y = 556; + t.z = 500; + t.braceleft = 389; + t.bar = 280; + t.braceright = 389; + t.asciitilde = 584; + t.exclamdown = 333; + t.cent = 556; + t.sterling = 556; + t.fraction = 167; + t.yen = 556; + t.florin = 556; + t.section = 556; + t.currency = 556; + t.quotesingle = 238; + t.quotedblleft = 500; + t.guillemotleft = 556; + t.guilsinglleft = 333; + t.guilsinglright = 333; + t.fi = 611; + t.fl = 611; + t.endash = 556; + t.dagger = 556; + t.daggerdbl = 556; + t.periodcentered = 278; + t.paragraph = 556; + t.bullet = 350; + t.quotesinglbase = 278; + t.quotedblbase = 500; + t.quotedblright = 500; + t.guillemotright = 556; + t.ellipsis = 1000; + t.perthousand = 1000; + t.questiondown = 611; + t.grave = 333; + t.acute = 333; + t.circumflex = 333; + t.tilde = 333; + t.macron = 333; + t.breve = 333; + t.dotaccent = 333; + t.dieresis = 333; + t.ring = 333; + t.cedilla = 333; + t.hungarumlaut = 333; + t.ogonek = 333; + t.caron = 333; + t.emdash = 1000; + t.AE = 1000; + t.ordfeminine = 370; + t.Lslash = 611; + t.Oslash = 778; + t.OE = 1000; + t.ordmasculine = 365; + t.ae = 889; + t.dotlessi = 278; + t.lslash = 278; + t.oslash = 611; + t.oe = 944; + t.germandbls = 611; + t.Idieresis = 278; + t.eacute = 556; + t.abreve = 556; + t.uhungarumlaut = 611; + t.ecaron = 556; + t.Ydieresis = 667; + t.divide = 584; + t.Yacute = 667; + t.Acircumflex = 722; + t.aacute = 556; + t.Ucircumflex = 722; + t.yacute = 556; + t.scommaaccent = 556; + t.ecircumflex = 556; + t.Uring = 722; + t.Udieresis = 722; + t.aogonek = 556; + t.Uacute = 722; + t.uogonek = 611; + t.Edieresis = 667; + t.Dcroat = 722; + t.commaaccent = 250; + t.copyright = 737; + t.Emacron = 667; + t.ccaron = 556; + t.aring = 556; + t.Ncommaaccent = 722; + t.lacute = 278; + t.agrave = 556; + t.Tcommaaccent = 611; + t.Cacute = 722; + t.atilde = 556; + t.Edotaccent = 667; + t.scaron = 556; + t.scedilla = 556; + t.iacute = 278; + t.lozenge = 494; + t.Rcaron = 722; + t.Gcommaaccent = 778; + t.ucircumflex = 611; + t.acircumflex = 556; + t.Amacron = 722; + t.rcaron = 389; + t.ccedilla = 556; + t.Zdotaccent = 611; + t.Thorn = 667; + t.Omacron = 778; + t.Racute = 722; + t.Sacute = 667; + t.dcaron = 743; + t.Umacron = 722; + t.uring = 611; + t.threesuperior = 333; + t.Ograve = 778; + t.Agrave = 722; + t.Abreve = 722; + t.multiply = 584; + t.uacute = 611; + t.Tcaron = 611; + t.partialdiff = 494; + t.ydieresis = 556; + t.Nacute = 722; + t.icircumflex = 278; + t.Ecircumflex = 667; + t.adieresis = 556; + t.edieresis = 556; + t.cacute = 556; + t.nacute = 611; + t.umacron = 611; + t.Ncaron = 722; + t.Iacute = 278; + t.plusminus = 584; + t.brokenbar = 280; + t.registered = 737; + t.Gbreve = 778; + t.Idotaccent = 278; + t.summation = 600; + t.Egrave = 667; + t.racute = 389; + t.omacron = 611; + t.Zacute = 611; + t.Zcaron = 611; + t.greaterequal = 549; + t.Eth = 722; + t.Ccedilla = 722; + t.lcommaaccent = 278; + t.tcaron = 389; + t.eogonek = 556; + t.Uogonek = 722; + t.Aacute = 722; + t.Adieresis = 722; + t.egrave = 556; + t.zacute = 500; + t.iogonek = 278; + t.Oacute = 778; + t.oacute = 611; + t.amacron = 556; + t.sacute = 556; + t.idieresis = 278; + t.Ocircumflex = 778; + t.Ugrave = 722; + t.Delta = 612; + t.thorn = 611; + t.twosuperior = 333; + t.Odieresis = 778; + t.mu = 611; + t.igrave = 278; + t.ohungarumlaut = 611; + t.Eogonek = 667; + t.dcroat = 611; + t.threequarters = 834; + t.Scedilla = 667; + t.lcaron = 400; + t.Kcommaaccent = 722; + t.Lacute = 611; + t.trademark = 1000; + t.edotaccent = 556; + t.Igrave = 278; + t.Imacron = 278; + t.Lcaron = 611; + t.onehalf = 834; + t.lessequal = 549; + t.ocircumflex = 611; + t.ntilde = 611; + t.Uhungarumlaut = 722; + t.Eacute = 667; + t.emacron = 556; + t.gbreve = 611; + t.onequarter = 834; + t.Scaron = 667; + t.Scommaaccent = 667; + t.Ohungarumlaut = 778; + t.degree = 400; + t.ograve = 611; + t.Ccaron = 722; + t.ugrave = 611; + t.radical = 549; + t.Dcaron = 722; + t.rcommaaccent = 389; + t.Ntilde = 722; + t.otilde = 611; + t.Rcommaaccent = 722; + t.Lcommaaccent = 611; + t.Atilde = 722; + t.Aogonek = 722; + t.Aring = 722; + t.Otilde = 778; + t.zdotaccent = 500; + t.Ecaron = 667; + t.Iogonek = 278; + t.kcommaaccent = 556; + t.minus = 584; + t.Icircumflex = 278; + t.ncaron = 611; + t.tcommaaccent = 333; + t.logicalnot = 584; + t.odieresis = 611; + t.udieresis = 611; + t.notequal = 549; + t.gcommaaccent = 611; + t.eth = 611; + t.zcaron = 500; + t.ncommaaccent = 611; + t.onesuperior = 333; + t.imacron = 278; + t.Euro = 556; + }); + t["Helvetica-BoldOblique"] = getLookupTableFactory(function (t) { + t.space = 278; + t.exclam = 333; + t.quotedbl = 474; + t.numbersign = 556; + t.dollar = 556; + t.percent = 889; + t.ampersand = 722; + t.quoteright = 278; + t.parenleft = 333; + t.parenright = 333; + t.asterisk = 389; + t.plus = 584; + t.comma = 278; + t.hyphen = 333; + t.period = 278; + t.slash = 278; + t.zero = 556; + t.one = 556; + t.two = 556; + t.three = 556; + t.four = 556; + t.five = 556; + t.six = 556; + t.seven = 556; + t.eight = 556; + t.nine = 556; + t.colon = 333; + t.semicolon = 333; + t.less = 584; + t.equal = 584; + t.greater = 584; + t.question = 611; + t.at = 975; + t.A = 722; + t.B = 722; + t.C = 722; + t.D = 722; + t.E = 667; + t.F = 611; + t.G = 778; + t.H = 722; + t.I = 278; + t.J = 556; + t.K = 722; + t.L = 611; + t.M = 833; + t.N = 722; + t.O = 778; + t.P = 667; + t.Q = 778; + t.R = 722; + t.S = 667; + t.T = 611; + t.U = 722; + t.V = 667; + t.W = 944; + t.X = 667; + t.Y = 667; + t.Z = 611; + t.bracketleft = 333; + t.backslash = 278; + t.bracketright = 333; + t.asciicircum = 584; + t.underscore = 556; + t.quoteleft = 278; + t.a = 556; + t.b = 611; + t.c = 556; + t.d = 611; + t.e = 556; + t.f = 333; + t.g = 611; + t.h = 611; + t.i = 278; + t.j = 278; + t.k = 556; + t.l = 278; + t.m = 889; + t.n = 611; + t.o = 611; + t.p = 611; + t.q = 611; + t.r = 389; + t.s = 556; + t.t = 333; + t.u = 611; + t.v = 556; + t.w = 778; + t.x = 556; + t.y = 556; + t.z = 500; + t.braceleft = 389; + t.bar = 280; + t.braceright = 389; + t.asciitilde = 584; + t.exclamdown = 333; + t.cent = 556; + t.sterling = 556; + t.fraction = 167; + t.yen = 556; + t.florin = 556; + t.section = 556; + t.currency = 556; + t.quotesingle = 238; + t.quotedblleft = 500; + t.guillemotleft = 556; + t.guilsinglleft = 333; + t.guilsinglright = 333; + t.fi = 611; + t.fl = 611; + t.endash = 556; + t.dagger = 556; + t.daggerdbl = 556; + t.periodcentered = 278; + t.paragraph = 556; + t.bullet = 350; + t.quotesinglbase = 278; + t.quotedblbase = 500; + t.quotedblright = 500; + t.guillemotright = 556; + t.ellipsis = 1000; + t.perthousand = 1000; + t.questiondown = 611; + t.grave = 333; + t.acute = 333; + t.circumflex = 333; + t.tilde = 333; + t.macron = 333; + t.breve = 333; + t.dotaccent = 333; + t.dieresis = 333; + t.ring = 333; + t.cedilla = 333; + t.hungarumlaut = 333; + t.ogonek = 333; + t.caron = 333; + t.emdash = 1000; + t.AE = 1000; + t.ordfeminine = 370; + t.Lslash = 611; + t.Oslash = 778; + t.OE = 1000; + t.ordmasculine = 365; + t.ae = 889; + t.dotlessi = 278; + t.lslash = 278; + t.oslash = 611; + t.oe = 944; + t.germandbls = 611; + t.Idieresis = 278; + t.eacute = 556; + t.abreve = 556; + t.uhungarumlaut = 611; + t.ecaron = 556; + t.Ydieresis = 667; + t.divide = 584; + t.Yacute = 667; + t.Acircumflex = 722; + t.aacute = 556; + t.Ucircumflex = 722; + t.yacute = 556; + t.scommaaccent = 556; + t.ecircumflex = 556; + t.Uring = 722; + t.Udieresis = 722; + t.aogonek = 556; + t.Uacute = 722; + t.uogonek = 611; + t.Edieresis = 667; + t.Dcroat = 722; + t.commaaccent = 250; + t.copyright = 737; + t.Emacron = 667; + t.ccaron = 556; + t.aring = 556; + t.Ncommaaccent = 722; + t.lacute = 278; + t.agrave = 556; + t.Tcommaaccent = 611; + t.Cacute = 722; + t.atilde = 556; + t.Edotaccent = 667; + t.scaron = 556; + t.scedilla = 556; + t.iacute = 278; + t.lozenge = 494; + t.Rcaron = 722; + t.Gcommaaccent = 778; + t.ucircumflex = 611; + t.acircumflex = 556; + t.Amacron = 722; + t.rcaron = 389; + t.ccedilla = 556; + t.Zdotaccent = 611; + t.Thorn = 667; + t.Omacron = 778; + t.Racute = 722; + t.Sacute = 667; + t.dcaron = 743; + t.Umacron = 722; + t.uring = 611; + t.threesuperior = 333; + t.Ograve = 778; + t.Agrave = 722; + t.Abreve = 722; + t.multiply = 584; + t.uacute = 611; + t.Tcaron = 611; + t.partialdiff = 494; + t.ydieresis = 556; + t.Nacute = 722; + t.icircumflex = 278; + t.Ecircumflex = 667; + t.adieresis = 556; + t.edieresis = 556; + t.cacute = 556; + t.nacute = 611; + t.umacron = 611; + t.Ncaron = 722; + t.Iacute = 278; + t.plusminus = 584; + t.brokenbar = 280; + t.registered = 737; + t.Gbreve = 778; + t.Idotaccent = 278; + t.summation = 600; + t.Egrave = 667; + t.racute = 389; + t.omacron = 611; + t.Zacute = 611; + t.Zcaron = 611; + t.greaterequal = 549; + t.Eth = 722; + t.Ccedilla = 722; + t.lcommaaccent = 278; + t.tcaron = 389; + t.eogonek = 556; + t.Uogonek = 722; + t.Aacute = 722; + t.Adieresis = 722; + t.egrave = 556; + t.zacute = 500; + t.iogonek = 278; + t.Oacute = 778; + t.oacute = 611; + t.amacron = 556; + t.sacute = 556; + t.idieresis = 278; + t.Ocircumflex = 778; + t.Ugrave = 722; + t.Delta = 612; + t.thorn = 611; + t.twosuperior = 333; + t.Odieresis = 778; + t.mu = 611; + t.igrave = 278; + t.ohungarumlaut = 611; + t.Eogonek = 667; + t.dcroat = 611; + t.threequarters = 834; + t.Scedilla = 667; + t.lcaron = 400; + t.Kcommaaccent = 722; + t.Lacute = 611; + t.trademark = 1000; + t.edotaccent = 556; + t.Igrave = 278; + t.Imacron = 278; + t.Lcaron = 611; + t.onehalf = 834; + t.lessequal = 549; + t.ocircumflex = 611; + t.ntilde = 611; + t.Uhungarumlaut = 722; + t.Eacute = 667; + t.emacron = 556; + t.gbreve = 611; + t.onequarter = 834; + t.Scaron = 667; + t.Scommaaccent = 667; + t.Ohungarumlaut = 778; + t.degree = 400; + t.ograve = 611; + t.Ccaron = 722; + t.ugrave = 611; + t.radical = 549; + t.Dcaron = 722; + t.rcommaaccent = 389; + t.Ntilde = 722; + t.otilde = 611; + t.Rcommaaccent = 722; + t.Lcommaaccent = 611; + t.Atilde = 722; + t.Aogonek = 722; + t.Aring = 722; + t.Otilde = 778; + t.zdotaccent = 500; + t.Ecaron = 667; + t.Iogonek = 278; + t.kcommaaccent = 556; + t.minus = 584; + t.Icircumflex = 278; + t.ncaron = 611; + t.tcommaaccent = 333; + t.logicalnot = 584; + t.odieresis = 611; + t.udieresis = 611; + t.notequal = 549; + t.gcommaaccent = 611; + t.eth = 611; + t.zcaron = 500; + t.ncommaaccent = 611; + t.onesuperior = 333; + t.imacron = 278; + t.Euro = 556; + }); + t["Helvetica-Oblique"] = getLookupTableFactory(function (t) { + t.space = 278; + t.exclam = 278; + t.quotedbl = 355; + t.numbersign = 556; + t.dollar = 556; + t.percent = 889; + t.ampersand = 667; + t.quoteright = 222; + t.parenleft = 333; + t.parenright = 333; + t.asterisk = 389; + t.plus = 584; + t.comma = 278; + t.hyphen = 333; + t.period = 278; + t.slash = 278; + t.zero = 556; + t.one = 556; + t.two = 556; + t.three = 556; + t.four = 556; + t.five = 556; + t.six = 556; + t.seven = 556; + t.eight = 556; + t.nine = 556; + t.colon = 278; + t.semicolon = 278; + t.less = 584; + t.equal = 584; + t.greater = 584; + t.question = 556; + t.at = 1015; + t.A = 667; + t.B = 667; + t.C = 722; + t.D = 722; + t.E = 667; + t.F = 611; + t.G = 778; + t.H = 722; + t.I = 278; + t.J = 500; + t.K = 667; + t.L = 556; + t.M = 833; + t.N = 722; + t.O = 778; + t.P = 667; + t.Q = 778; + t.R = 722; + t.S = 667; + t.T = 611; + t.U = 722; + t.V = 667; + t.W = 944; + t.X = 667; + t.Y = 667; + t.Z = 611; + t.bracketleft = 278; + t.backslash = 278; + t.bracketright = 278; + t.asciicircum = 469; + t.underscore = 556; + t.quoteleft = 222; + t.a = 556; + t.b = 556; + t.c = 500; + t.d = 556; + t.e = 556; + t.f = 278; + t.g = 556; + t.h = 556; + t.i = 222; + t.j = 222; + t.k = 500; + t.l = 222; + t.m = 833; + t.n = 556; + t.o = 556; + t.p = 556; + t.q = 556; + t.r = 333; + t.s = 500; + t.t = 278; + t.u = 556; + t.v = 500; + t.w = 722; + t.x = 500; + t.y = 500; + t.z = 500; + t.braceleft = 334; + t.bar = 260; + t.braceright = 334; + t.asciitilde = 584; + t.exclamdown = 333; + t.cent = 556; + t.sterling = 556; + t.fraction = 167; + t.yen = 556; + t.florin = 556; + t.section = 556; + t.currency = 556; + t.quotesingle = 191; + t.quotedblleft = 333; + t.guillemotleft = 556; + t.guilsinglleft = 333; + t.guilsinglright = 333; + t.fi = 500; + t.fl = 500; + t.endash = 556; + t.dagger = 556; + t.daggerdbl = 556; + t.periodcentered = 278; + t.paragraph = 537; + t.bullet = 350; + t.quotesinglbase = 222; + t.quotedblbase = 333; + t.quotedblright = 333; + t.guillemotright = 556; + t.ellipsis = 1000; + t.perthousand = 1000; + t.questiondown = 611; + t.grave = 333; + t.acute = 333; + t.circumflex = 333; + t.tilde = 333; + t.macron = 333; + t.breve = 333; + t.dotaccent = 333; + t.dieresis = 333; + t.ring = 333; + t.cedilla = 333; + t.hungarumlaut = 333; + t.ogonek = 333; + t.caron = 333; + t.emdash = 1000; + t.AE = 1000; + t.ordfeminine = 370; + t.Lslash = 556; + t.Oslash = 778; + t.OE = 1000; + t.ordmasculine = 365; + t.ae = 889; + t.dotlessi = 278; + t.lslash = 222; + t.oslash = 611; + t.oe = 944; + t.germandbls = 611; + t.Idieresis = 278; + t.eacute = 556; + t.abreve = 556; + t.uhungarumlaut = 556; + t.ecaron = 556; + t.Ydieresis = 667; + t.divide = 584; + t.Yacute = 667; + t.Acircumflex = 667; + t.aacute = 556; + t.Ucircumflex = 722; + t.yacute = 500; + t.scommaaccent = 500; + t.ecircumflex = 556; + t.Uring = 722; + t.Udieresis = 722; + t.aogonek = 556; + t.Uacute = 722; + t.uogonek = 556; + t.Edieresis = 667; + t.Dcroat = 722; + t.commaaccent = 250; + t.copyright = 737; + t.Emacron = 667; + t.ccaron = 500; + t.aring = 556; + t.Ncommaaccent = 722; + t.lacute = 222; + t.agrave = 556; + t.Tcommaaccent = 611; + t.Cacute = 722; + t.atilde = 556; + t.Edotaccent = 667; + t.scaron = 500; + t.scedilla = 500; + t.iacute = 278; + t.lozenge = 471; + t.Rcaron = 722; + t.Gcommaaccent = 778; + t.ucircumflex = 556; + t.acircumflex = 556; + t.Amacron = 667; + t.rcaron = 333; + t.ccedilla = 500; + t.Zdotaccent = 611; + t.Thorn = 667; + t.Omacron = 778; + t.Racute = 722; + t.Sacute = 667; + t.dcaron = 643; + t.Umacron = 722; + t.uring = 556; + t.threesuperior = 333; + t.Ograve = 778; + t.Agrave = 667; + t.Abreve = 667; + t.multiply = 584; + t.uacute = 556; + t.Tcaron = 611; + t.partialdiff = 476; + t.ydieresis = 500; + t.Nacute = 722; + t.icircumflex = 278; + t.Ecircumflex = 667; + t.adieresis = 556; + t.edieresis = 556; + t.cacute = 500; + t.nacute = 556; + t.umacron = 556; + t.Ncaron = 722; + t.Iacute = 278; + t.plusminus = 584; + t.brokenbar = 260; + t.registered = 737; + t.Gbreve = 778; + t.Idotaccent = 278; + t.summation = 600; + t.Egrave = 667; + t.racute = 333; + t.omacron = 556; + t.Zacute = 611; + t.Zcaron = 611; + t.greaterequal = 549; + t.Eth = 722; + t.Ccedilla = 722; + t.lcommaaccent = 222; + t.tcaron = 317; + t.eogonek = 556; + t.Uogonek = 722; + t.Aacute = 667; + t.Adieresis = 667; + t.egrave = 556; + t.zacute = 500; + t.iogonek = 222; + t.Oacute = 778; + t.oacute = 556; + t.amacron = 556; + t.sacute = 500; + t.idieresis = 278; + t.Ocircumflex = 778; + t.Ugrave = 722; + t.Delta = 612; + t.thorn = 556; + t.twosuperior = 333; + t.Odieresis = 778; + t.mu = 556; + t.igrave = 278; + t.ohungarumlaut = 556; + t.Eogonek = 667; + t.dcroat = 556; + t.threequarters = 834; + t.Scedilla = 667; + t.lcaron = 299; + t.Kcommaaccent = 667; + t.Lacute = 556; + t.trademark = 1000; + t.edotaccent = 556; + t.Igrave = 278; + t.Imacron = 278; + t.Lcaron = 556; + t.onehalf = 834; + t.lessequal = 549; + t.ocircumflex = 556; + t.ntilde = 556; + t.Uhungarumlaut = 722; + t.Eacute = 667; + t.emacron = 556; + t.gbreve = 556; + t.onequarter = 834; + t.Scaron = 667; + t.Scommaaccent = 667; + t.Ohungarumlaut = 778; + t.degree = 400; + t.ograve = 556; + t.Ccaron = 722; + t.ugrave = 556; + t.radical = 453; + t.Dcaron = 722; + t.rcommaaccent = 333; + t.Ntilde = 722; + t.otilde = 556; + t.Rcommaaccent = 722; + t.Lcommaaccent = 556; + t.Atilde = 667; + t.Aogonek = 667; + t.Aring = 667; + t.Otilde = 778; + t.zdotaccent = 500; + t.Ecaron = 667; + t.Iogonek = 278; + t.kcommaaccent = 500; + t.minus = 584; + t.Icircumflex = 278; + t.ncaron = 556; + t.tcommaaccent = 278; + t.logicalnot = 584; + t.odieresis = 556; + t.udieresis = 556; + t.notequal = 549; + t.gcommaaccent = 556; + t.eth = 556; + t.zcaron = 500; + t.ncommaaccent = 556; + t.onesuperior = 333; + t.imacron = 278; + t.Euro = 556; + }); + t.Symbol = getLookupTableFactory(function (t) { + t.space = 250; + t.exclam = 333; + t.universal = 713; + t.numbersign = 500; + t.existential = 549; + t.percent = 833; + t.ampersand = 778; + t.suchthat = 439; + t.parenleft = 333; + t.parenright = 333; + t.asteriskmath = 500; + t.plus = 549; + t.comma = 250; + t.minus = 549; + t.period = 250; + t.slash = 278; + t.zero = 500; + t.one = 500; + t.two = 500; + t.three = 500; + t.four = 500; + t.five = 500; + t.six = 500; + t.seven = 500; + t.eight = 500; + t.nine = 500; + t.colon = 278; + t.semicolon = 278; + t.less = 549; + t.equal = 549; + t.greater = 549; + t.question = 444; + t.congruent = 549; + t.Alpha = 722; + t.Beta = 667; + t.Chi = 722; + t.Delta = 612; + t.Epsilon = 611; + t.Phi = 763; + t.Gamma = 603; + t.Eta = 722; + t.Iota = 333; + t.theta1 = 631; + t.Kappa = 722; + t.Lambda = 686; + t.Mu = 889; + t.Nu = 722; + t.Omicron = 722; + t.Pi = 768; + t.Theta = 741; + t.Rho = 556; + t.Sigma = 592; + t.Tau = 611; + t.Upsilon = 690; + t.sigma1 = 439; + t.Omega = 768; + t.Xi = 645; + t.Psi = 795; + t.Zeta = 611; + t.bracketleft = 333; + t.therefore = 863; + t.bracketright = 333; + t.perpendicular = 658; + t.underscore = 500; + t.radicalex = 500; + t.alpha = 631; + t.beta = 549; + t.chi = 549; + t.delta = 494; + t.epsilon = 439; + t.phi = 521; + t.gamma = 411; + t.eta = 603; + t.iota = 329; + t.phi1 = 603; + t.kappa = 549; + t.lambda = 549; + t.mu = 576; + t.nu = 521; + t.omicron = 549; + t.pi = 549; + t.theta = 521; + t.rho = 549; + t.sigma = 603; + t.tau = 439; + t.upsilon = 576; + t.omega1 = 713; + t.omega = 686; + t.xi = 493; + t.psi = 686; + t.zeta = 494; + t.braceleft = 480; + t.bar = 200; + t.braceright = 480; + t.similar = 549; + t.Euro = 750; + t.Upsilon1 = 620; + t.minute = 247; + t.lessequal = 549; + t.fraction = 167; + t.infinity = 713; + t.florin = 500; + t.club = 753; + t.diamond = 753; + t.heart = 753; + t.spade = 753; + t.arrowboth = 1042; + t.arrowleft = 987; + t.arrowup = 603; + t.arrowright = 987; + t.arrowdown = 603; + t.degree = 400; + t.plusminus = 549; + t.second = 411; + t.greaterequal = 549; + t.multiply = 549; + t.proportional = 713; + t.partialdiff = 494; + t.bullet = 460; + t.divide = 549; + t.notequal = 549; + t.equivalence = 549; + t.approxequal = 549; + t.ellipsis = 1000; + t.arrowvertex = 603; + t.arrowhorizex = 1000; + t.carriagereturn = 658; + t.aleph = 823; + t.Ifraktur = 686; + t.Rfraktur = 795; + t.weierstrass = 987; + t.circlemultiply = 768; + t.circleplus = 768; + t.emptyset = 823; + t.intersection = 768; + t.union = 768; + t.propersuperset = 713; + t.reflexsuperset = 713; + t.notsubset = 713; + t.propersubset = 713; + t.reflexsubset = 713; + t.element = 713; + t.notelement = 713; + t.angle = 768; + t.gradient = 713; + t.registerserif = 790; + t.copyrightserif = 790; + t.trademarkserif = 890; + t.product = 823; + t.radical = 549; + t.dotmath = 250; + t.logicalnot = 713; + t.logicaland = 603; + t.logicalor = 603; + t.arrowdblboth = 1042; + t.arrowdblleft = 987; + t.arrowdblup = 603; + t.arrowdblright = 987; + t.arrowdbldown = 603; + t.lozenge = 494; + t.angleleft = 329; + t.registersans = 790; + t.copyrightsans = 790; + t.trademarksans = 786; + t.summation = 713; + t.parenlefttp = 384; + t.parenleftex = 384; + t.parenleftbt = 384; + t.bracketlefttp = 384; + t.bracketleftex = 384; + t.bracketleftbt = 384; + t.bracelefttp = 494; + t.braceleftmid = 494; + t.braceleftbt = 494; + t.braceex = 494; + t.angleright = 329; + t.integral = 274; + t.integraltp = 686; + t.integralex = 686; + t.integralbt = 686; + t.parenrighttp = 384; + t.parenrightex = 384; + t.parenrightbt = 384; + t.bracketrighttp = 384; + t.bracketrightex = 384; + t.bracketrightbt = 384; + t.bracerighttp = 494; + t.bracerightmid = 494; + t.bracerightbt = 494; + t.apple = 790; + }); + t["Times-Roman"] = getLookupTableFactory(function (t) { + t.space = 250; + t.exclam = 333; + t.quotedbl = 408; + t.numbersign = 500; + t.dollar = 500; + t.percent = 833; + t.ampersand = 778; + t.quoteright = 333; + t.parenleft = 333; + t.parenright = 333; + t.asterisk = 500; + t.plus = 564; + t.comma = 250; + t.hyphen = 333; + t.period = 250; + t.slash = 278; + t.zero = 500; + t.one = 500; + t.two = 500; + t.three = 500; + t.four = 500; + t.five = 500; + t.six = 500; + t.seven = 500; + t.eight = 500; + t.nine = 500; + t.colon = 278; + t.semicolon = 278; + t.less = 564; + t.equal = 564; + t.greater = 564; + t.question = 444; + t.at = 921; + t.A = 722; + t.B = 667; + t.C = 667; + t.D = 722; + t.E = 611; + t.F = 556; + t.G = 722; + t.H = 722; + t.I = 333; + t.J = 389; + t.K = 722; + t.L = 611; + t.M = 889; + t.N = 722; + t.O = 722; + t.P = 556; + t.Q = 722; + t.R = 667; + t.S = 556; + t.T = 611; + t.U = 722; + t.V = 722; + t.W = 944; + t.X = 722; + t.Y = 722; + t.Z = 611; + t.bracketleft = 333; + t.backslash = 278; + t.bracketright = 333; + t.asciicircum = 469; + t.underscore = 500; + t.quoteleft = 333; + t.a = 444; + t.b = 500; + t.c = 444; + t.d = 500; + t.e = 444; + t.f = 333; + t.g = 500; + t.h = 500; + t.i = 278; + t.j = 278; + t.k = 500; + t.l = 278; + t.m = 778; + t.n = 500; + t.o = 500; + t.p = 500; + t.q = 500; + t.r = 333; + t.s = 389; + t.t = 278; + t.u = 500; + t.v = 500; + t.w = 722; + t.x = 500; + t.y = 500; + t.z = 444; + t.braceleft = 480; + t.bar = 200; + t.braceright = 480; + t.asciitilde = 541; + t.exclamdown = 333; + t.cent = 500; + t.sterling = 500; + t.fraction = 167; + t.yen = 500; + t.florin = 500; + t.section = 500; + t.currency = 500; + t.quotesingle = 180; + t.quotedblleft = 444; + t.guillemotleft = 500; + t.guilsinglleft = 333; + t.guilsinglright = 333; + t.fi = 556; + t.fl = 556; + t.endash = 500; + t.dagger = 500; + t.daggerdbl = 500; + t.periodcentered = 250; + t.paragraph = 453; + t.bullet = 350; + t.quotesinglbase = 333; + t.quotedblbase = 444; + t.quotedblright = 444; + t.guillemotright = 500; + t.ellipsis = 1000; + t.perthousand = 1000; + t.questiondown = 444; + t.grave = 333; + t.acute = 333; + t.circumflex = 333; + t.tilde = 333; + t.macron = 333; + t.breve = 333; + t.dotaccent = 333; + t.dieresis = 333; + t.ring = 333; + t.cedilla = 333; + t.hungarumlaut = 333; + t.ogonek = 333; + t.caron = 333; + t.emdash = 1000; + t.AE = 889; + t.ordfeminine = 276; + t.Lslash = 611; + t.Oslash = 722; + t.OE = 889; + t.ordmasculine = 310; + t.ae = 667; + t.dotlessi = 278; + t.lslash = 278; + t.oslash = 500; + t.oe = 722; + t.germandbls = 500; + t.Idieresis = 333; + t.eacute = 444; + t.abreve = 444; + t.uhungarumlaut = 500; + t.ecaron = 444; + t.Ydieresis = 722; + t.divide = 564; + t.Yacute = 722; + t.Acircumflex = 722; + t.aacute = 444; + t.Ucircumflex = 722; + t.yacute = 500; + t.scommaaccent = 389; + t.ecircumflex = 444; + t.Uring = 722; + t.Udieresis = 722; + t.aogonek = 444; + t.Uacute = 722; + t.uogonek = 500; + t.Edieresis = 611; + t.Dcroat = 722; + t.commaaccent = 250; + t.copyright = 760; + t.Emacron = 611; + t.ccaron = 444; + t.aring = 444; + t.Ncommaaccent = 722; + t.lacute = 278; + t.agrave = 444; + t.Tcommaaccent = 611; + t.Cacute = 667; + t.atilde = 444; + t.Edotaccent = 611; + t.scaron = 389; + t.scedilla = 389; + t.iacute = 278; + t.lozenge = 471; + t.Rcaron = 667; + t.Gcommaaccent = 722; + t.ucircumflex = 500; + t.acircumflex = 444; + t.Amacron = 722; + t.rcaron = 333; + t.ccedilla = 444; + t.Zdotaccent = 611; + t.Thorn = 556; + t.Omacron = 722; + t.Racute = 667; + t.Sacute = 556; + t.dcaron = 588; + t.Umacron = 722; + t.uring = 500; + t.threesuperior = 300; + t.Ograve = 722; + t.Agrave = 722; + t.Abreve = 722; + t.multiply = 564; + t.uacute = 500; + t.Tcaron = 611; + t.partialdiff = 476; + t.ydieresis = 500; + t.Nacute = 722; + t.icircumflex = 278; + t.Ecircumflex = 611; + t.adieresis = 444; + t.edieresis = 444; + t.cacute = 444; + t.nacute = 500; + t.umacron = 500; + t.Ncaron = 722; + t.Iacute = 333; + t.plusminus = 564; + t.brokenbar = 200; + t.registered = 760; + t.Gbreve = 722; + t.Idotaccent = 333; + t.summation = 600; + t.Egrave = 611; + t.racute = 333; + t.omacron = 500; + t.Zacute = 611; + t.Zcaron = 611; + t.greaterequal = 549; + t.Eth = 722; + t.Ccedilla = 667; + t.lcommaaccent = 278; + t.tcaron = 326; + t.eogonek = 444; + t.Uogonek = 722; + t.Aacute = 722; + t.Adieresis = 722; + t.egrave = 444; + t.zacute = 444; + t.iogonek = 278; + t.Oacute = 722; + t.oacute = 500; + t.amacron = 444; + t.sacute = 389; + t.idieresis = 278; + t.Ocircumflex = 722; + t.Ugrave = 722; + t.Delta = 612; + t.thorn = 500; + t.twosuperior = 300; + t.Odieresis = 722; + t.mu = 500; + t.igrave = 278; + t.ohungarumlaut = 500; + t.Eogonek = 611; + t.dcroat = 500; + t.threequarters = 750; + t.Scedilla = 556; + t.lcaron = 344; + t.Kcommaaccent = 722; + t.Lacute = 611; + t.trademark = 980; + t.edotaccent = 444; + t.Igrave = 333; + t.Imacron = 333; + t.Lcaron = 611; + t.onehalf = 750; + t.lessequal = 549; + t.ocircumflex = 500; + t.ntilde = 500; + t.Uhungarumlaut = 722; + t.Eacute = 611; + t.emacron = 444; + t.gbreve = 500; + t.onequarter = 750; + t.Scaron = 556; + t.Scommaaccent = 556; + t.Ohungarumlaut = 722; + t.degree = 400; + t.ograve = 500; + t.Ccaron = 667; + t.ugrave = 500; + t.radical = 453; + t.Dcaron = 722; + t.rcommaaccent = 333; + t.Ntilde = 722; + t.otilde = 500; + t.Rcommaaccent = 667; + t.Lcommaaccent = 611; + t.Atilde = 722; + t.Aogonek = 722; + t.Aring = 722; + t.Otilde = 722; + t.zdotaccent = 444; + t.Ecaron = 611; + t.Iogonek = 333; + t.kcommaaccent = 500; + t.minus = 564; + t.Icircumflex = 333; + t.ncaron = 500; + t.tcommaaccent = 278; + t.logicalnot = 564; + t.odieresis = 500; + t.udieresis = 500; + t.notequal = 549; + t.gcommaaccent = 500; + t.eth = 500; + t.zcaron = 444; + t.ncommaaccent = 500; + t.onesuperior = 300; + t.imacron = 278; + t.Euro = 500; + }); + t["Times-Bold"] = getLookupTableFactory(function (t) { + t.space = 250; + t.exclam = 333; + t.quotedbl = 555; + t.numbersign = 500; + t.dollar = 500; + t.percent = 1000; + t.ampersand = 833; + t.quoteright = 333; + t.parenleft = 333; + t.parenright = 333; + t.asterisk = 500; + t.plus = 570; + t.comma = 250; + t.hyphen = 333; + t.period = 250; + t.slash = 278; + t.zero = 500; + t.one = 500; + t.two = 500; + t.three = 500; + t.four = 500; + t.five = 500; + t.six = 500; + t.seven = 500; + t.eight = 500; + t.nine = 500; + t.colon = 333; + t.semicolon = 333; + t.less = 570; + t.equal = 570; + t.greater = 570; + t.question = 500; + t.at = 930; + t.A = 722; + t.B = 667; + t.C = 722; + t.D = 722; + t.E = 667; + t.F = 611; + t.G = 778; + t.H = 778; + t.I = 389; + t.J = 500; + t.K = 778; + t.L = 667; + t.M = 944; + t.N = 722; + t.O = 778; + t.P = 611; + t.Q = 778; + t.R = 722; + t.S = 556; + t.T = 667; + t.U = 722; + t.V = 722; + t.W = 1000; + t.X = 722; + t.Y = 722; + t.Z = 667; + t.bracketleft = 333; + t.backslash = 278; + t.bracketright = 333; + t.asciicircum = 581; + t.underscore = 500; + t.quoteleft = 333; + t.a = 500; + t.b = 556; + t.c = 444; + t.d = 556; + t.e = 444; + t.f = 333; + t.g = 500; + t.h = 556; + t.i = 278; + t.j = 333; + t.k = 556; + t.l = 278; + t.m = 833; + t.n = 556; + t.o = 500; + t.p = 556; + t.q = 556; + t.r = 444; + t.s = 389; + t.t = 333; + t.u = 556; + t.v = 500; + t.w = 722; + t.x = 500; + t.y = 500; + t.z = 444; + t.braceleft = 394; + t.bar = 220; + t.braceright = 394; + t.asciitilde = 520; + t.exclamdown = 333; + t.cent = 500; + t.sterling = 500; + t.fraction = 167; + t.yen = 500; + t.florin = 500; + t.section = 500; + t.currency = 500; + t.quotesingle = 278; + t.quotedblleft = 500; + t.guillemotleft = 500; + t.guilsinglleft = 333; + t.guilsinglright = 333; + t.fi = 556; + t.fl = 556; + t.endash = 500; + t.dagger = 500; + t.daggerdbl = 500; + t.periodcentered = 250; + t.paragraph = 540; + t.bullet = 350; + t.quotesinglbase = 333; + t.quotedblbase = 500; + t.quotedblright = 500; + t.guillemotright = 500; + t.ellipsis = 1000; + t.perthousand = 1000; + t.questiondown = 500; + t.grave = 333; + t.acute = 333; + t.circumflex = 333; + t.tilde = 333; + t.macron = 333; + t.breve = 333; + t.dotaccent = 333; + t.dieresis = 333; + t.ring = 333; + t.cedilla = 333; + t.hungarumlaut = 333; + t.ogonek = 333; + t.caron = 333; + t.emdash = 1000; + t.AE = 1000; + t.ordfeminine = 300; + t.Lslash = 667; + t.Oslash = 778; + t.OE = 1000; + t.ordmasculine = 330; + t.ae = 722; + t.dotlessi = 278; + t.lslash = 278; + t.oslash = 500; + t.oe = 722; + t.germandbls = 556; + t.Idieresis = 389; + t.eacute = 444; + t.abreve = 500; + t.uhungarumlaut = 556; + t.ecaron = 444; + t.Ydieresis = 722; + t.divide = 570; + t.Yacute = 722; + t.Acircumflex = 722; + t.aacute = 500; + t.Ucircumflex = 722; + t.yacute = 500; + t.scommaaccent = 389; + t.ecircumflex = 444; + t.Uring = 722; + t.Udieresis = 722; + t.aogonek = 500; + t.Uacute = 722; + t.uogonek = 556; + t.Edieresis = 667; + t.Dcroat = 722; + t.commaaccent = 250; + t.copyright = 747; + t.Emacron = 667; + t.ccaron = 444; + t.aring = 500; + t.Ncommaaccent = 722; + t.lacute = 278; + t.agrave = 500; + t.Tcommaaccent = 667; + t.Cacute = 722; + t.atilde = 500; + t.Edotaccent = 667; + t.scaron = 389; + t.scedilla = 389; + t.iacute = 278; + t.lozenge = 494; + t.Rcaron = 722; + t.Gcommaaccent = 778; + t.ucircumflex = 556; + t.acircumflex = 500; + t.Amacron = 722; + t.rcaron = 444; + t.ccedilla = 444; + t.Zdotaccent = 667; + t.Thorn = 611; + t.Omacron = 778; + t.Racute = 722; + t.Sacute = 556; + t.dcaron = 672; + t.Umacron = 722; + t.uring = 556; + t.threesuperior = 300; + t.Ograve = 778; + t.Agrave = 722; + t.Abreve = 722; + t.multiply = 570; + t.uacute = 556; + t.Tcaron = 667; + t.partialdiff = 494; + t.ydieresis = 500; + t.Nacute = 722; + t.icircumflex = 278; + t.Ecircumflex = 667; + t.adieresis = 500; + t.edieresis = 444; + t.cacute = 444; + t.nacute = 556; + t.umacron = 556; + t.Ncaron = 722; + t.Iacute = 389; + t.plusminus = 570; + t.brokenbar = 220; + t.registered = 747; + t.Gbreve = 778; + t.Idotaccent = 389; + t.summation = 600; + t.Egrave = 667; + t.racute = 444; + t.omacron = 500; + t.Zacute = 667; + t.Zcaron = 667; + t.greaterequal = 549; + t.Eth = 722; + t.Ccedilla = 722; + t.lcommaaccent = 278; + t.tcaron = 416; + t.eogonek = 444; + t.Uogonek = 722; + t.Aacute = 722; + t.Adieresis = 722; + t.egrave = 444; + t.zacute = 444; + t.iogonek = 278; + t.Oacute = 778; + t.oacute = 500; + t.amacron = 500; + t.sacute = 389; + t.idieresis = 278; + t.Ocircumflex = 778; + t.Ugrave = 722; + t.Delta = 612; + t.thorn = 556; + t.twosuperior = 300; + t.Odieresis = 778; + t.mu = 556; + t.igrave = 278; + t.ohungarumlaut = 500; + t.Eogonek = 667; + t.dcroat = 556; + t.threequarters = 750; + t.Scedilla = 556; + t.lcaron = 394; + t.Kcommaaccent = 778; + t.Lacute = 667; + t.trademark = 1000; + t.edotaccent = 444; + t.Igrave = 389; + t.Imacron = 389; + t.Lcaron = 667; + t.onehalf = 750; + t.lessequal = 549; + t.ocircumflex = 500; + t.ntilde = 556; + t.Uhungarumlaut = 722; + t.Eacute = 667; + t.emacron = 444; + t.gbreve = 500; + t.onequarter = 750; + t.Scaron = 556; + t.Scommaaccent = 556; + t.Ohungarumlaut = 778; + t.degree = 400; + t.ograve = 500; + t.Ccaron = 722; + t.ugrave = 556; + t.radical = 549; + t.Dcaron = 722; + t.rcommaaccent = 444; + t.Ntilde = 722; + t.otilde = 500; + t.Rcommaaccent = 722; + t.Lcommaaccent = 667; + t.Atilde = 722; + t.Aogonek = 722; + t.Aring = 722; + t.Otilde = 778; + t.zdotaccent = 444; + t.Ecaron = 667; + t.Iogonek = 389; + t.kcommaaccent = 556; + t.minus = 570; + t.Icircumflex = 389; + t.ncaron = 556; + t.tcommaaccent = 333; + t.logicalnot = 570; + t.odieresis = 500; + t.udieresis = 556; + t.notequal = 549; + t.gcommaaccent = 500; + t.eth = 500; + t.zcaron = 444; + t.ncommaaccent = 556; + t.onesuperior = 300; + t.imacron = 278; + t.Euro = 500; + }); + t["Times-BoldItalic"] = getLookupTableFactory(function (t) { + t.space = 250; + t.exclam = 389; + t.quotedbl = 555; + t.numbersign = 500; + t.dollar = 500; + t.percent = 833; + t.ampersand = 778; + t.quoteright = 333; + t.parenleft = 333; + t.parenright = 333; + t.asterisk = 500; + t.plus = 570; + t.comma = 250; + t.hyphen = 333; + t.period = 250; + t.slash = 278; + t.zero = 500; + t.one = 500; + t.two = 500; + t.three = 500; + t.four = 500; + t.five = 500; + t.six = 500; + t.seven = 500; + t.eight = 500; + t.nine = 500; + t.colon = 333; + t.semicolon = 333; + t.less = 570; + t.equal = 570; + t.greater = 570; + t.question = 500; + t.at = 832; + t.A = 667; + t.B = 667; + t.C = 667; + t.D = 722; + t.E = 667; + t.F = 667; + t.G = 722; + t.H = 778; + t.I = 389; + t.J = 500; + t.K = 667; + t.L = 611; + t.M = 889; + t.N = 722; + t.O = 722; + t.P = 611; + t.Q = 722; + t.R = 667; + t.S = 556; + t.T = 611; + t.U = 722; + t.V = 667; + t.W = 889; + t.X = 667; + t.Y = 611; + t.Z = 611; + t.bracketleft = 333; + t.backslash = 278; + t.bracketright = 333; + t.asciicircum = 570; + t.underscore = 500; + t.quoteleft = 333; + t.a = 500; + t.b = 500; + t.c = 444; + t.d = 500; + t.e = 444; + t.f = 333; + t.g = 500; + t.h = 556; + t.i = 278; + t.j = 278; + t.k = 500; + t.l = 278; + t.m = 778; + t.n = 556; + t.o = 500; + t.p = 500; + t.q = 500; + t.r = 389; + t.s = 389; + t.t = 278; + t.u = 556; + t.v = 444; + t.w = 667; + t.x = 500; + t.y = 444; + t.z = 389; + t.braceleft = 348; + t.bar = 220; + t.braceright = 348; + t.asciitilde = 570; + t.exclamdown = 389; + t.cent = 500; + t.sterling = 500; + t.fraction = 167; + t.yen = 500; + t.florin = 500; + t.section = 500; + t.currency = 500; + t.quotesingle = 278; + t.quotedblleft = 500; + t.guillemotleft = 500; + t.guilsinglleft = 333; + t.guilsinglright = 333; + t.fi = 556; + t.fl = 556; + t.endash = 500; + t.dagger = 500; + t.daggerdbl = 500; + t.periodcentered = 250; + t.paragraph = 500; + t.bullet = 350; + t.quotesinglbase = 333; + t.quotedblbase = 500; + t.quotedblright = 500; + t.guillemotright = 500; + t.ellipsis = 1000; + t.perthousand = 1000; + t.questiondown = 500; + t.grave = 333; + t.acute = 333; + t.circumflex = 333; + t.tilde = 333; + t.macron = 333; + t.breve = 333; + t.dotaccent = 333; + t.dieresis = 333; + t.ring = 333; + t.cedilla = 333; + t.hungarumlaut = 333; + t.ogonek = 333; + t.caron = 333; + t.emdash = 1000; + t.AE = 944; + t.ordfeminine = 266; + t.Lslash = 611; + t.Oslash = 722; + t.OE = 944; + t.ordmasculine = 300; + t.ae = 722; + t.dotlessi = 278; + t.lslash = 278; + t.oslash = 500; + t.oe = 722; + t.germandbls = 500; + t.Idieresis = 389; + t.eacute = 444; + t.abreve = 500; + t.uhungarumlaut = 556; + t.ecaron = 444; + t.Ydieresis = 611; + t.divide = 570; + t.Yacute = 611; + t.Acircumflex = 667; + t.aacute = 500; + t.Ucircumflex = 722; + t.yacute = 444; + t.scommaaccent = 389; + t.ecircumflex = 444; + t.Uring = 722; + t.Udieresis = 722; + t.aogonek = 500; + t.Uacute = 722; + t.uogonek = 556; + t.Edieresis = 667; + t.Dcroat = 722; + t.commaaccent = 250; + t.copyright = 747; + t.Emacron = 667; + t.ccaron = 444; + t.aring = 500; + t.Ncommaaccent = 722; + t.lacute = 278; + t.agrave = 500; + t.Tcommaaccent = 611; + t.Cacute = 667; + t.atilde = 500; + t.Edotaccent = 667; + t.scaron = 389; + t.scedilla = 389; + t.iacute = 278; + t.lozenge = 494; + t.Rcaron = 667; + t.Gcommaaccent = 722; + t.ucircumflex = 556; + t.acircumflex = 500; + t.Amacron = 667; + t.rcaron = 389; + t.ccedilla = 444; + t.Zdotaccent = 611; + t.Thorn = 611; + t.Omacron = 722; + t.Racute = 667; + t.Sacute = 556; + t.dcaron = 608; + t.Umacron = 722; + t.uring = 556; + t.threesuperior = 300; + t.Ograve = 722; + t.Agrave = 667; + t.Abreve = 667; + t.multiply = 570; + t.uacute = 556; + t.Tcaron = 611; + t.partialdiff = 494; + t.ydieresis = 444; + t.Nacute = 722; + t.icircumflex = 278; + t.Ecircumflex = 667; + t.adieresis = 500; + t.edieresis = 444; + t.cacute = 444; + t.nacute = 556; + t.umacron = 556; + t.Ncaron = 722; + t.Iacute = 389; + t.plusminus = 570; + t.brokenbar = 220; + t.registered = 747; + t.Gbreve = 722; + t.Idotaccent = 389; + t.summation = 600; + t.Egrave = 667; + t.racute = 389; + t.omacron = 500; + t.Zacute = 611; + t.Zcaron = 611; + t.greaterequal = 549; + t.Eth = 722; + t.Ccedilla = 667; + t.lcommaaccent = 278; + t.tcaron = 366; + t.eogonek = 444; + t.Uogonek = 722; + t.Aacute = 667; + t.Adieresis = 667; + t.egrave = 444; + t.zacute = 389; + t.iogonek = 278; + t.Oacute = 722; + t.oacute = 500; + t.amacron = 500; + t.sacute = 389; + t.idieresis = 278; + t.Ocircumflex = 722; + t.Ugrave = 722; + t.Delta = 612; + t.thorn = 500; + t.twosuperior = 300; + t.Odieresis = 722; + t.mu = 576; + t.igrave = 278; + t.ohungarumlaut = 500; + t.Eogonek = 667; + t.dcroat = 500; + t.threequarters = 750; + t.Scedilla = 556; + t.lcaron = 382; + t.Kcommaaccent = 667; + t.Lacute = 611; + t.trademark = 1000; + t.edotaccent = 444; + t.Igrave = 389; + t.Imacron = 389; + t.Lcaron = 611; + t.onehalf = 750; + t.lessequal = 549; + t.ocircumflex = 500; + t.ntilde = 556; + t.Uhungarumlaut = 722; + t.Eacute = 667; + t.emacron = 444; + t.gbreve = 500; + t.onequarter = 750; + t.Scaron = 556; + t.Scommaaccent = 556; + t.Ohungarumlaut = 722; + t.degree = 400; + t.ograve = 500; + t.Ccaron = 667; + t.ugrave = 556; + t.radical = 549; + t.Dcaron = 722; + t.rcommaaccent = 389; + t.Ntilde = 722; + t.otilde = 500; + t.Rcommaaccent = 667; + t.Lcommaaccent = 611; + t.Atilde = 667; + t.Aogonek = 667; + t.Aring = 667; + t.Otilde = 722; + t.zdotaccent = 389; + t.Ecaron = 667; + t.Iogonek = 389; + t.kcommaaccent = 500; + t.minus = 606; + t.Icircumflex = 389; + t.ncaron = 556; + t.tcommaaccent = 278; + t.logicalnot = 606; + t.odieresis = 500; + t.udieresis = 556; + t.notequal = 549; + t.gcommaaccent = 500; + t.eth = 500; + t.zcaron = 389; + t.ncommaaccent = 556; + t.onesuperior = 300; + t.imacron = 278; + t.Euro = 500; + }); + t["Times-Italic"] = getLookupTableFactory(function (t) { + t.space = 250; + t.exclam = 333; + t.quotedbl = 420; + t.numbersign = 500; + t.dollar = 500; + t.percent = 833; + t.ampersand = 778; + t.quoteright = 333; + t.parenleft = 333; + t.parenright = 333; + t.asterisk = 500; + t.plus = 675; + t.comma = 250; + t.hyphen = 333; + t.period = 250; + t.slash = 278; + t.zero = 500; + t.one = 500; + t.two = 500; + t.three = 500; + t.four = 500; + t.five = 500; + t.six = 500; + t.seven = 500; + t.eight = 500; + t.nine = 500; + t.colon = 333; + t.semicolon = 333; + t.less = 675; + t.equal = 675; + t.greater = 675; + t.question = 500; + t.at = 920; + t.A = 611; + t.B = 611; + t.C = 667; + t.D = 722; + t.E = 611; + t.F = 611; + t.G = 722; + t.H = 722; + t.I = 333; + t.J = 444; + t.K = 667; + t.L = 556; + t.M = 833; + t.N = 667; + t.O = 722; + t.P = 611; + t.Q = 722; + t.R = 611; + t.S = 500; + t.T = 556; + t.U = 722; + t.V = 611; + t.W = 833; + t.X = 611; + t.Y = 556; + t.Z = 556; + t.bracketleft = 389; + t.backslash = 278; + t.bracketright = 389; + t.asciicircum = 422; + t.underscore = 500; + t.quoteleft = 333; + t.a = 500; + t.b = 500; + t.c = 444; + t.d = 500; + t.e = 444; + t.f = 278; + t.g = 500; + t.h = 500; + t.i = 278; + t.j = 278; + t.k = 444; + t.l = 278; + t.m = 722; + t.n = 500; + t.o = 500; + t.p = 500; + t.q = 500; + t.r = 389; + t.s = 389; + t.t = 278; + t.u = 500; + t.v = 444; + t.w = 667; + t.x = 444; + t.y = 444; + t.z = 389; + t.braceleft = 400; + t.bar = 275; + t.braceright = 400; + t.asciitilde = 541; + t.exclamdown = 389; + t.cent = 500; + t.sterling = 500; + t.fraction = 167; + t.yen = 500; + t.florin = 500; + t.section = 500; + t.currency = 500; + t.quotesingle = 214; + t.quotedblleft = 556; + t.guillemotleft = 500; + t.guilsinglleft = 333; + t.guilsinglright = 333; + t.fi = 500; + t.fl = 500; + t.endash = 500; + t.dagger = 500; + t.daggerdbl = 500; + t.periodcentered = 250; + t.paragraph = 523; + t.bullet = 350; + t.quotesinglbase = 333; + t.quotedblbase = 556; + t.quotedblright = 556; + t.guillemotright = 500; + t.ellipsis = 889; + t.perthousand = 1000; + t.questiondown = 500; + t.grave = 333; + t.acute = 333; + t.circumflex = 333; + t.tilde = 333; + t.macron = 333; + t.breve = 333; + t.dotaccent = 333; + t.dieresis = 333; + t.ring = 333; + t.cedilla = 333; + t.hungarumlaut = 333; + t.ogonek = 333; + t.caron = 333; + t.emdash = 889; + t.AE = 889; + t.ordfeminine = 276; + t.Lslash = 556; + t.Oslash = 722; + t.OE = 944; + t.ordmasculine = 310; + t.ae = 667; + t.dotlessi = 278; + t.lslash = 278; + t.oslash = 500; + t.oe = 667; + t.germandbls = 500; + t.Idieresis = 333; + t.eacute = 444; + t.abreve = 500; + t.uhungarumlaut = 500; + t.ecaron = 444; + t.Ydieresis = 556; + t.divide = 675; + t.Yacute = 556; + t.Acircumflex = 611; + t.aacute = 500; + t.Ucircumflex = 722; + t.yacute = 444; + t.scommaaccent = 389; + t.ecircumflex = 444; + t.Uring = 722; + t.Udieresis = 722; + t.aogonek = 500; + t.Uacute = 722; + t.uogonek = 500; + t.Edieresis = 611; + t.Dcroat = 722; + t.commaaccent = 250; + t.copyright = 760; + t.Emacron = 611; + t.ccaron = 444; + t.aring = 500; + t.Ncommaaccent = 667; + t.lacute = 278; + t.agrave = 500; + t.Tcommaaccent = 556; + t.Cacute = 667; + t.atilde = 500; + t.Edotaccent = 611; + t.scaron = 389; + t.scedilla = 389; + t.iacute = 278; + t.lozenge = 471; + t.Rcaron = 611; + t.Gcommaaccent = 722; + t.ucircumflex = 500; + t.acircumflex = 500; + t.Amacron = 611; + t.rcaron = 389; + t.ccedilla = 444; + t.Zdotaccent = 556; + t.Thorn = 611; + t.Omacron = 722; + t.Racute = 611; + t.Sacute = 500; + t.dcaron = 544; + t.Umacron = 722; + t.uring = 500; + t.threesuperior = 300; + t.Ograve = 722; + t.Agrave = 611; + t.Abreve = 611; + t.multiply = 675; + t.uacute = 500; + t.Tcaron = 556; + t.partialdiff = 476; + t.ydieresis = 444; + t.Nacute = 667; + t.icircumflex = 278; + t.Ecircumflex = 611; + t.adieresis = 500; + t.edieresis = 444; + t.cacute = 444; + t.nacute = 500; + t.umacron = 500; + t.Ncaron = 667; + t.Iacute = 333; + t.plusminus = 675; + t.brokenbar = 275; + t.registered = 760; + t.Gbreve = 722; + t.Idotaccent = 333; + t.summation = 600; + t.Egrave = 611; + t.racute = 389; + t.omacron = 500; + t.Zacute = 556; + t.Zcaron = 556; + t.greaterequal = 549; + t.Eth = 722; + t.Ccedilla = 667; + t.lcommaaccent = 278; + t.tcaron = 300; + t.eogonek = 444; + t.Uogonek = 722; + t.Aacute = 611; + t.Adieresis = 611; + t.egrave = 444; + t.zacute = 389; + t.iogonek = 278; + t.Oacute = 722; + t.oacute = 500; + t.amacron = 500; + t.sacute = 389; + t.idieresis = 278; + t.Ocircumflex = 722; + t.Ugrave = 722; + t.Delta = 612; + t.thorn = 500; + t.twosuperior = 300; + t.Odieresis = 722; + t.mu = 500; + t.igrave = 278; + t.ohungarumlaut = 500; + t.Eogonek = 611; + t.dcroat = 500; + t.threequarters = 750; + t.Scedilla = 500; + t.lcaron = 300; + t.Kcommaaccent = 667; + t.Lacute = 556; + t.trademark = 980; + t.edotaccent = 444; + t.Igrave = 333; + t.Imacron = 333; + t.Lcaron = 611; + t.onehalf = 750; + t.lessequal = 549; + t.ocircumflex = 500; + t.ntilde = 500; + t.Uhungarumlaut = 722; + t.Eacute = 611; + t.emacron = 444; + t.gbreve = 500; + t.onequarter = 750; + t.Scaron = 500; + t.Scommaaccent = 500; + t.Ohungarumlaut = 722; + t.degree = 400; + t.ograve = 500; + t.Ccaron = 667; + t.ugrave = 500; + t.radical = 453; + t.Dcaron = 722; + t.rcommaaccent = 389; + t.Ntilde = 667; + t.otilde = 500; + t.Rcommaaccent = 611; + t.Lcommaaccent = 556; + t.Atilde = 611; + t.Aogonek = 611; + t.Aring = 611; + t.Otilde = 722; + t.zdotaccent = 389; + t.Ecaron = 611; + t.Iogonek = 333; + t.kcommaaccent = 444; + t.minus = 675; + t.Icircumflex = 333; + t.ncaron = 500; + t.tcommaaccent = 278; + t.logicalnot = 675; + t.odieresis = 500; + t.udieresis = 500; + t.notequal = 549; + t.gcommaaccent = 500; + t.eth = 500; + t.zcaron = 389; + t.ncommaaccent = 500; + t.onesuperior = 300; + t.imacron = 278; + t.Euro = 500; + }); + t.ZapfDingbats = getLookupTableFactory(function (t) { + t.space = 278; + t.a1 = 974; + t.a2 = 961; + t.a202 = 974; + t.a3 = 980; + t.a4 = 719; + t.a5 = 789; + t.a119 = 790; + t.a118 = 791; + t.a117 = 690; + t.a11 = 960; + t.a12 = 939; + t.a13 = 549; + t.a14 = 855; + t.a15 = 911; + t.a16 = 933; + t.a105 = 911; + t.a17 = 945; + t.a18 = 974; + t.a19 = 755; + t.a20 = 846; + t.a21 = 762; + t.a22 = 761; + t.a23 = 571; + t.a24 = 677; + t.a25 = 763; + t.a26 = 760; + t.a27 = 759; + t.a28 = 754; + t.a6 = 494; + t.a7 = 552; + t.a8 = 537; + t.a9 = 577; + t.a10 = 692; + t.a29 = 786; + t.a30 = 788; + t.a31 = 788; + t.a32 = 790; + t.a33 = 793; + t.a34 = 794; + t.a35 = 816; + t.a36 = 823; + t.a37 = 789; + t.a38 = 841; + t.a39 = 823; + t.a40 = 833; + t.a41 = 816; + t.a42 = 831; + t.a43 = 923; + t.a44 = 744; + t.a45 = 723; + t.a46 = 749; + t.a47 = 790; + t.a48 = 792; + t.a49 = 695; + t.a50 = 776; + t.a51 = 768; + t.a52 = 792; + t.a53 = 759; + t.a54 = 707; + t.a55 = 708; + t.a56 = 682; + t.a57 = 701; + t.a58 = 826; + t.a59 = 815; + t.a60 = 789; + t.a61 = 789; + t.a62 = 707; + t.a63 = 687; + t.a64 = 696; + t.a65 = 689; + t.a66 = 786; + t.a67 = 787; + t.a68 = 713; + t.a69 = 791; + t.a70 = 785; + t.a71 = 791; + t.a72 = 873; + t.a73 = 761; + t.a74 = 762; + t.a203 = 762; + t.a75 = 759; + t.a204 = 759; + t.a76 = 892; + t.a77 = 892; + t.a78 = 788; + t.a79 = 784; + t.a81 = 438; + t.a82 = 138; + t.a83 = 277; + t.a84 = 415; + t.a97 = 392; + t.a98 = 392; + t.a99 = 668; + t.a100 = 668; + t.a89 = 390; + t.a90 = 390; + t.a93 = 317; + t.a94 = 317; + t.a91 = 276; + t.a92 = 276; + t.a205 = 509; + t.a85 = 509; + t.a206 = 410; + t.a86 = 410; + t.a87 = 234; + t.a88 = 234; + t.a95 = 334; + t.a96 = 334; + t.a101 = 732; + t.a102 = 544; + t.a103 = 544; + t.a104 = 910; + t.a106 = 667; + t.a107 = 760; + t.a108 = 760; + t.a112 = 776; + t.a111 = 595; + t.a110 = 694; + t.a109 = 626; + t.a120 = 788; + t.a121 = 788; + t.a122 = 788; + t.a123 = 788; + t.a124 = 788; + t.a125 = 788; + t.a126 = 788; + t.a127 = 788; + t.a128 = 788; + t.a129 = 788; + t.a130 = 788; + t.a131 = 788; + t.a132 = 788; + t.a133 = 788; + t.a134 = 788; + t.a135 = 788; + t.a136 = 788; + t.a137 = 788; + t.a138 = 788; + t.a139 = 788; + t.a140 = 788; + t.a141 = 788; + t.a142 = 788; + t.a143 = 788; + t.a144 = 788; + t.a145 = 788; + t.a146 = 788; + t.a147 = 788; + t.a148 = 788; + t.a149 = 788; + t.a150 = 788; + t.a151 = 788; + t.a152 = 788; + t.a153 = 788; + t.a154 = 788; + t.a155 = 788; + t.a156 = 788; + t.a157 = 788; + t.a158 = 788; + t.a159 = 788; + t.a160 = 894; + t.a161 = 838; + t.a163 = 1016; + t.a164 = 458; + t.a196 = 748; + t.a165 = 924; + t.a192 = 748; + t.a166 = 918; + t.a167 = 927; + t.a168 = 928; + t.a169 = 928; + t.a170 = 834; + t.a171 = 873; + t.a172 = 828; + t.a173 = 924; + t.a162 = 924; + t.a174 = 917; + t.a175 = 930; + t.a176 = 931; + t.a177 = 463; + t.a178 = 883; + t.a179 = 836; + t.a193 = 836; + t.a180 = 867; + t.a199 = 867; + t.a181 = 696; + t.a200 = 696; + t.a182 = 874; + t.a201 = 874; + t.a183 = 760; + t.a184 = 946; + t.a197 = 771; + t.a185 = 865; + t.a194 = 771; + t.a198 = 888; + t.a186 = 967; + t.a195 = 888; + t.a187 = 831; + t.a188 = 873; + t.a189 = 927; + t.a190 = 970; + t.a191 = 918; + }); +}); +const getFontBasicMetrics = getLookupTableFactory(function (t) { + t.Courier = { + ascent: 629, + descent: -157, + capHeight: 562, + xHeight: -426 + }; + t["Courier-Bold"] = { + ascent: 629, + descent: -157, + capHeight: 562, + xHeight: 439 + }; + t["Courier-Oblique"] = { + ascent: 629, + descent: -157, + capHeight: 562, + xHeight: 426 + }; + t["Courier-BoldOblique"] = { + ascent: 629, + descent: -157, + capHeight: 562, + xHeight: 426 + }; + t.Helvetica = { + ascent: 718, + descent: -207, + capHeight: 718, + xHeight: 523 + }; + t["Helvetica-Bold"] = { + ascent: 718, + descent: -207, + capHeight: 718, + xHeight: 532 + }; + t["Helvetica-Oblique"] = { + ascent: 718, + descent: -207, + capHeight: 718, + xHeight: 523 + }; + t["Helvetica-BoldOblique"] = { + ascent: 718, + descent: -207, + capHeight: 718, + xHeight: 532 + }; + t["Times-Roman"] = { + ascent: 683, + descent: -217, + capHeight: 662, + xHeight: 450 + }; + t["Times-Bold"] = { + ascent: 683, + descent: -217, + capHeight: 676, + xHeight: 461 + }; + t["Times-Italic"] = { + ascent: 683, + descent: -217, + capHeight: 653, + xHeight: 441 + }; + t["Times-BoldItalic"] = { + ascent: 683, + descent: -217, + capHeight: 669, + xHeight: 462 + }; + t.Symbol = { + ascent: Math.NaN, + descent: Math.NaN, + capHeight: Math.NaN, + xHeight: Math.NaN + }; + t.ZapfDingbats = { + ascent: Math.NaN, + descent: Math.NaN, + capHeight: Math.NaN, + xHeight: Math.NaN + }; +}); + +;// ./src/core/glyf.js +const ON_CURVE_POINT = 1 << 0; +const X_SHORT_VECTOR = 1 << 1; +const Y_SHORT_VECTOR = 1 << 2; +const REPEAT_FLAG = 1 << 3; +const X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR = 1 << 4; +const Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR = 1 << 5; +const OVERLAP_SIMPLE = 1 << 6; +const ARG_1_AND_2_ARE_WORDS = 1 << 0; +const ARGS_ARE_XY_VALUES = 1 << 1; +const WE_HAVE_A_SCALE = 1 << 3; +const MORE_COMPONENTS = 1 << 5; +const WE_HAVE_AN_X_AND_Y_SCALE = 1 << 6; +const WE_HAVE_A_TWO_BY_TWO = 1 << 7; +const WE_HAVE_INSTRUCTIONS = 1 << 8; +class GlyfTable { + constructor({ + glyfTable, + isGlyphLocationsLong, + locaTable, + numGlyphs + }) { + this.glyphs = []; + const loca = new DataView(locaTable.buffer, locaTable.byteOffset, locaTable.byteLength); + const glyf = new DataView(glyfTable.buffer, glyfTable.byteOffset, glyfTable.byteLength); + const offsetSize = isGlyphLocationsLong ? 4 : 2; + let prev = isGlyphLocationsLong ? loca.getUint32(0) : 2 * loca.getUint16(0); + let pos = 0; + for (let i = 0; i < numGlyphs; i++) { + pos += offsetSize; + const next = isGlyphLocationsLong ? loca.getUint32(pos) : 2 * loca.getUint16(pos); + if (next === prev) { + this.glyphs.push(new Glyph({})); + continue; + } + const glyph = Glyph.parse(prev, glyf); + this.glyphs.push(glyph); + prev = next; + } + } + getSize() { + return this.glyphs.reduce((a, g) => { + const size = g.getSize(); + return a + (size + 3 & ~3); + }, 0); + } + write() { + const totalSize = this.getSize(); + const glyfTable = new DataView(new ArrayBuffer(totalSize)); + const isLocationLong = totalSize > 0x1fffe; + const offsetSize = isLocationLong ? 4 : 2; + const locaTable = new DataView(new ArrayBuffer((this.glyphs.length + 1) * offsetSize)); + if (isLocationLong) { + locaTable.setUint32(0, 0); + } else { + locaTable.setUint16(0, 0); + } + let pos = 0; + let locaIndex = 0; + for (const glyph of this.glyphs) { + pos += glyph.write(pos, glyfTable); + pos = pos + 3 & ~3; + locaIndex += offsetSize; + if (isLocationLong) { + locaTable.setUint32(locaIndex, pos); + } else { + locaTable.setUint16(locaIndex, pos >> 1); + } + } + return { + isLocationLong, + loca: new Uint8Array(locaTable.buffer), + glyf: new Uint8Array(glyfTable.buffer) + }; + } + scale(factors) { + for (let i = 0, ii = this.glyphs.length; i < ii; i++) { + this.glyphs[i].scale(factors[i]); + } + } +} +class Glyph { + constructor({ + header = null, + simple = null, + composites = null + }) { + this.header = header; + this.simple = simple; + this.composites = composites; + } + static parse(pos, glyf) { + const [read, header] = GlyphHeader.parse(pos, glyf); + pos += read; + if (header.numberOfContours < 0) { + const composites = []; + while (true) { + const [n, composite] = CompositeGlyph.parse(pos, glyf); + pos += n; + composites.push(composite); + if (!(composite.flags & MORE_COMPONENTS)) { + break; + } + } + return new Glyph({ + header, + composites + }); + } + const simple = SimpleGlyph.parse(pos, glyf, header.numberOfContours); + return new Glyph({ + header, + simple + }); + } + getSize() { + if (!this.header) { + return 0; + } + const size = this.simple ? this.simple.getSize() : this.composites.reduce((a, c) => a + c.getSize(), 0); + return this.header.getSize() + size; + } + write(pos, buf) { + if (!this.header) { + return 0; + } + const spos = pos; + pos += this.header.write(pos, buf); + if (this.simple) { + pos += this.simple.write(pos, buf); + } else { + for (const composite of this.composites) { + pos += composite.write(pos, buf); + } + } + return pos - spos; + } + scale(factor) { + if (!this.header) { + return; + } + const xMiddle = (this.header.xMin + this.header.xMax) / 2; + this.header.scale(xMiddle, factor); + if (this.simple) { + this.simple.scale(xMiddle, factor); + } else { + for (const composite of this.composites) { + composite.scale(xMiddle, factor); + } + } + } +} +class GlyphHeader { + constructor({ + numberOfContours, + xMin, + yMin, + xMax, + yMax + }) { + this.numberOfContours = numberOfContours; + this.xMin = xMin; + this.yMin = yMin; + this.xMax = xMax; + this.yMax = yMax; + } + static parse(pos, glyf) { + return [10, new GlyphHeader({ + numberOfContours: glyf.getInt16(pos), + xMin: glyf.getInt16(pos + 2), + yMin: glyf.getInt16(pos + 4), + xMax: glyf.getInt16(pos + 6), + yMax: glyf.getInt16(pos + 8) + })]; + } + getSize() { + return 10; + } + write(pos, buf) { + buf.setInt16(pos, this.numberOfContours); + buf.setInt16(pos + 2, this.xMin); + buf.setInt16(pos + 4, this.yMin); + buf.setInt16(pos + 6, this.xMax); + buf.setInt16(pos + 8, this.yMax); + return 10; + } + scale(x, factor) { + this.xMin = Math.round(x + (this.xMin - x) * factor); + this.xMax = Math.round(x + (this.xMax - x) * factor); + } +} +class Contour { + constructor({ + flags, + xCoordinates, + yCoordinates + }) { + this.xCoordinates = xCoordinates; + this.yCoordinates = yCoordinates; + this.flags = flags; + } +} +class SimpleGlyph { + constructor({ + contours, + instructions + }) { + this.contours = contours; + this.instructions = instructions; + } + static parse(pos, glyf, numberOfContours) { + const endPtsOfContours = []; + for (let i = 0; i < numberOfContours; i++) { + const endPt = glyf.getUint16(pos); + pos += 2; + endPtsOfContours.push(endPt); + } + const numberOfPt = endPtsOfContours[numberOfContours - 1] + 1; + const instructionLength = glyf.getUint16(pos); + pos += 2; + const instructions = new Uint8Array(glyf).slice(pos, pos + instructionLength); + pos += instructionLength; + const flags = []; + for (let i = 0; i < numberOfPt; pos++, i++) { + let flag = glyf.getUint8(pos); + flags.push(flag); + if (flag & REPEAT_FLAG) { + const count = glyf.getUint8(++pos); + flag ^= REPEAT_FLAG; + for (let m = 0; m < count; m++) { + flags.push(flag); + } + i += count; + } + } + const allXCoordinates = []; + let xCoordinates = []; + let yCoordinates = []; + let pointFlags = []; + const contours = []; + let endPtsOfContoursIndex = 0; + let lastCoordinate = 0; + for (let i = 0; i < numberOfPt; i++) { + const flag = flags[i]; + if (flag & X_SHORT_VECTOR) { + const x = glyf.getUint8(pos++); + lastCoordinate += flag & X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR ? x : -x; + xCoordinates.push(lastCoordinate); + } else if (flag & X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR) { + xCoordinates.push(lastCoordinate); + } else { + lastCoordinate += glyf.getInt16(pos); + pos += 2; + xCoordinates.push(lastCoordinate); + } + if (endPtsOfContours[endPtsOfContoursIndex] === i) { + endPtsOfContoursIndex++; + allXCoordinates.push(xCoordinates); + xCoordinates = []; + } + } + lastCoordinate = 0; + endPtsOfContoursIndex = 0; + for (let i = 0; i < numberOfPt; i++) { + const flag = flags[i]; + if (flag & Y_SHORT_VECTOR) { + const y = glyf.getUint8(pos++); + lastCoordinate += flag & Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR ? y : -y; + yCoordinates.push(lastCoordinate); + } else if (flag & Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR) { + yCoordinates.push(lastCoordinate); + } else { + lastCoordinate += glyf.getInt16(pos); + pos += 2; + yCoordinates.push(lastCoordinate); + } + pointFlags.push(flag & ON_CURVE_POINT | flag & OVERLAP_SIMPLE); + if (endPtsOfContours[endPtsOfContoursIndex] === i) { + xCoordinates = allXCoordinates[endPtsOfContoursIndex]; + endPtsOfContoursIndex++; + contours.push(new Contour({ + flags: pointFlags, + xCoordinates, + yCoordinates + })); + yCoordinates = []; + pointFlags = []; + } + } + return new SimpleGlyph({ + contours, + instructions + }); + } + getSize() { + let size = this.contours.length * 2 + 2 + this.instructions.length; + let lastX = 0; + let lastY = 0; + for (const contour of this.contours) { + size += contour.flags.length; + for (let i = 0, ii = contour.xCoordinates.length; i < ii; i++) { + const x = contour.xCoordinates[i]; + const y = contour.yCoordinates[i]; + let abs = Math.abs(x - lastX); + if (abs > 255) { + size += 2; + } else if (abs > 0) { + size += 1; + } + lastX = x; + abs = Math.abs(y - lastY); + if (abs > 255) { + size += 2; + } else if (abs > 0) { + size += 1; + } + lastY = y; + } + } + return size; + } + write(pos, buf) { + const spos = pos; + const xCoordinates = []; + const yCoordinates = []; + const flags = []; + let lastX = 0; + let lastY = 0; + for (const contour of this.contours) { + for (let i = 0, ii = contour.xCoordinates.length; i < ii; i++) { + let flag = contour.flags[i]; + const x = contour.xCoordinates[i]; + let delta = x - lastX; + if (delta === 0) { + flag |= X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR; + xCoordinates.push(0); + } else { + const abs = Math.abs(delta); + if (abs <= 255) { + flag |= delta >= 0 ? X_SHORT_VECTOR | X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR : X_SHORT_VECTOR; + xCoordinates.push(abs); + } else { + xCoordinates.push(delta); + } + } + lastX = x; + const y = contour.yCoordinates[i]; + delta = y - lastY; + if (delta === 0) { + flag |= Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR; + yCoordinates.push(0); + } else { + const abs = Math.abs(delta); + if (abs <= 255) { + flag |= delta >= 0 ? Y_SHORT_VECTOR | Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR : Y_SHORT_VECTOR; + yCoordinates.push(abs); + } else { + yCoordinates.push(delta); + } + } + lastY = y; + flags.push(flag); + } + buf.setUint16(pos, xCoordinates.length - 1); + pos += 2; + } + buf.setUint16(pos, this.instructions.length); + pos += 2; + if (this.instructions.length) { + new Uint8Array(buf.buffer, 0, buf.buffer.byteLength).set(this.instructions, pos); + pos += this.instructions.length; + } + for (const flag of flags) { + buf.setUint8(pos++, flag); + } + for (let i = 0, ii = xCoordinates.length; i < ii; i++) { + const x = xCoordinates[i]; + const flag = flags[i]; + if (flag & X_SHORT_VECTOR) { + buf.setUint8(pos++, x); + } else if (!(flag & X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR)) { + buf.setInt16(pos, x); + pos += 2; + } + } + for (let i = 0, ii = yCoordinates.length; i < ii; i++) { + const y = yCoordinates[i]; + const flag = flags[i]; + if (flag & Y_SHORT_VECTOR) { + buf.setUint8(pos++, y); + } else if (!(flag & Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR)) { + buf.setInt16(pos, y); + pos += 2; + } + } + return pos - spos; + } + scale(x, factor) { + for (const contour of this.contours) { + if (contour.xCoordinates.length === 0) { + continue; + } + for (let i = 0, ii = contour.xCoordinates.length; i < ii; i++) { + contour.xCoordinates[i] = Math.round(x + (contour.xCoordinates[i] - x) * factor); + } + } + } +} +class CompositeGlyph { + constructor({ + flags, + glyphIndex, + argument1, + argument2, + transf, + instructions + }) { + this.flags = flags; + this.glyphIndex = glyphIndex; + this.argument1 = argument1; + this.argument2 = argument2; + this.transf = transf; + this.instructions = instructions; + } + static parse(pos, glyf) { + const spos = pos; + const transf = []; + let flags = glyf.getUint16(pos); + const glyphIndex = glyf.getUint16(pos + 2); + pos += 4; + let argument1, argument2; + if (flags & ARG_1_AND_2_ARE_WORDS) { + if (flags & ARGS_ARE_XY_VALUES) { + argument1 = glyf.getInt16(pos); + argument2 = glyf.getInt16(pos + 2); + } else { + argument1 = glyf.getUint16(pos); + argument2 = glyf.getUint16(pos + 2); + } + pos += 4; + flags ^= ARG_1_AND_2_ARE_WORDS; + } else { + if (flags & ARGS_ARE_XY_VALUES) { + argument1 = glyf.getInt8(pos); + argument2 = glyf.getInt8(pos + 1); + } else { + argument1 = glyf.getUint8(pos); + argument2 = glyf.getUint8(pos + 1); + } + pos += 2; + } + if (flags & WE_HAVE_A_SCALE) { + transf.push(glyf.getUint16(pos)); + pos += 2; + } else if (flags & WE_HAVE_AN_X_AND_Y_SCALE) { + transf.push(glyf.getUint16(pos), glyf.getUint16(pos + 2)); + pos += 4; + } else if (flags & WE_HAVE_A_TWO_BY_TWO) { + transf.push(glyf.getUint16(pos), glyf.getUint16(pos + 2), glyf.getUint16(pos + 4), glyf.getUint16(pos + 6)); + pos += 8; + } + let instructions = null; + if (flags & WE_HAVE_INSTRUCTIONS) { + const instructionLength = glyf.getUint16(pos); + pos += 2; + instructions = new Uint8Array(glyf).slice(pos, pos + instructionLength); + pos += instructionLength; + } + return [pos - spos, new CompositeGlyph({ + flags, + glyphIndex, + argument1, + argument2, + transf, + instructions + })]; + } + getSize() { + let size = 2 + 2 + this.transf.length * 2; + if (this.flags & WE_HAVE_INSTRUCTIONS) { + size += 2 + this.instructions.length; + } + size += 2; + if (this.flags & 2) { + if (!(this.argument1 >= -128 && this.argument1 <= 127 && this.argument2 >= -128 && this.argument2 <= 127)) { + size += 2; + } + } else if (!(this.argument1 >= 0 && this.argument1 <= 255 && this.argument2 >= 0 && this.argument2 <= 255)) { + size += 2; + } + return size; + } + write(pos, buf) { + const spos = pos; + if (this.flags & ARGS_ARE_XY_VALUES) { + if (!(this.argument1 >= -128 && this.argument1 <= 127 && this.argument2 >= -128 && this.argument2 <= 127)) { + this.flags |= ARG_1_AND_2_ARE_WORDS; + } + } else if (!(this.argument1 >= 0 && this.argument1 <= 255 && this.argument2 >= 0 && this.argument2 <= 255)) { + this.flags |= ARG_1_AND_2_ARE_WORDS; + } + buf.setUint16(pos, this.flags); + buf.setUint16(pos + 2, this.glyphIndex); + pos += 4; + if (this.flags & ARG_1_AND_2_ARE_WORDS) { + if (this.flags & ARGS_ARE_XY_VALUES) { + buf.setInt16(pos, this.argument1); + buf.setInt16(pos + 2, this.argument2); + } else { + buf.setUint16(pos, this.argument1); + buf.setUint16(pos + 2, this.argument2); + } + pos += 4; + } else { + buf.setUint8(pos, this.argument1); + buf.setUint8(pos + 1, this.argument2); + pos += 2; + } + if (this.flags & WE_HAVE_INSTRUCTIONS) { + buf.setUint16(pos, this.instructions.length); + pos += 2; + if (this.instructions.length) { + new Uint8Array(buf.buffer, 0, buf.buffer.byteLength).set(this.instructions, pos); + pos += this.instructions.length; + } + } + return pos - spos; + } + scale(x, factor) {} +} + +;// ./src/core/opentype_file_builder.js + + +function writeInt16(dest, offset, num) { + dest[offset] = num >> 8 & 0xff; + dest[offset + 1] = num & 0xff; +} +function writeInt32(dest, offset, num) { + dest[offset] = num >> 24 & 0xff; + dest[offset + 1] = num >> 16 & 0xff; + dest[offset + 2] = num >> 8 & 0xff; + dest[offset + 3] = num & 0xff; +} +function writeData(dest, offset, data) { + if (data instanceof Uint8Array) { + dest.set(data, offset); + } else if (typeof data === "string") { + for (let i = 0, ii = data.length; i < ii; i++) { + dest[offset++] = data.charCodeAt(i) & 0xff; + } + } else { + for (const num of data) { + dest[offset++] = num & 0xff; + } + } +} +const OTF_HEADER_SIZE = 12; +const OTF_TABLE_ENTRY_SIZE = 16; +class OpenTypeFileBuilder { + constructor(sfnt) { + this.sfnt = sfnt; + this.tables = Object.create(null); + } + static getSearchParams(entriesCount, entrySize) { + let maxPower2 = 1, + log2 = 0; + while ((maxPower2 ^ entriesCount) > maxPower2) { + maxPower2 <<= 1; + log2++; + } + const searchRange = maxPower2 * entrySize; + return { + range: searchRange, + entry: log2, + rangeShift: entrySize * entriesCount - searchRange + }; + } + toArray() { + let sfnt = this.sfnt; + const tables = this.tables; + const tablesNames = Object.keys(tables); + tablesNames.sort(); + const numTables = tablesNames.length; + let i, j, jj, table, tableName; + let offset = OTF_HEADER_SIZE + numTables * OTF_TABLE_ENTRY_SIZE; + const tableOffsets = [offset]; + for (i = 0; i < numTables; i++) { + table = tables[tablesNames[i]]; + const paddedLength = (table.length + 3 & ~3) >>> 0; + offset += paddedLength; + tableOffsets.push(offset); + } + const file = new Uint8Array(offset); + for (i = 0; i < numTables; i++) { + table = tables[tablesNames[i]]; + writeData(file, tableOffsets[i], table); + } + if (sfnt === "true") { + sfnt = string32(0x00010000); + } + file[0] = sfnt.charCodeAt(0) & 0xff; + file[1] = sfnt.charCodeAt(1) & 0xff; + file[2] = sfnt.charCodeAt(2) & 0xff; + file[3] = sfnt.charCodeAt(3) & 0xff; + writeInt16(file, 4, numTables); + const searchParams = OpenTypeFileBuilder.getSearchParams(numTables, 16); + writeInt16(file, 6, searchParams.range); + writeInt16(file, 8, searchParams.entry); + writeInt16(file, 10, searchParams.rangeShift); + offset = OTF_HEADER_SIZE; + for (i = 0; i < numTables; i++) { + tableName = tablesNames[i]; + file[offset] = tableName.charCodeAt(0) & 0xff; + file[offset + 1] = tableName.charCodeAt(1) & 0xff; + file[offset + 2] = tableName.charCodeAt(2) & 0xff; + file[offset + 3] = tableName.charCodeAt(3) & 0xff; + let checksum = 0; + for (j = tableOffsets[i], jj = tableOffsets[i + 1]; j < jj; j += 4) { + const quad = readUint32(file, j); + checksum = checksum + quad >>> 0; + } + writeInt32(file, offset + 4, checksum); + writeInt32(file, offset + 8, tableOffsets[i]); + writeInt32(file, offset + 12, tables[tableName].length); + offset += OTF_TABLE_ENTRY_SIZE; + } + return file; + } + addTable(tag, data) { + if (tag in this.tables) { + throw new Error("Table " + tag + " already exists"); + } + this.tables[tag] = data; + } +} + +;// ./src/core/type1_parser.js + + + + +const HINTING_ENABLED = false; +const COMMAND_MAP = { + hstem: [1], + vstem: [3], + vmoveto: [4], + rlineto: [5], + hlineto: [6], + vlineto: [7], + rrcurveto: [8], + callsubr: [10], + flex: [12, 35], + drop: [12, 18], + endchar: [14], + rmoveto: [21], + hmoveto: [22], + vhcurveto: [30], + hvcurveto: [31] +}; +class Type1CharString { + constructor() { + this.width = 0; + this.lsb = 0; + this.flexing = false; + this.output = []; + this.stack = []; + } + convert(encoded, subrs, seacAnalysisEnabled) { + const count = encoded.length; + let error = false; + let wx, sbx, subrNumber; + for (let i = 0; i < count; i++) { + let value = encoded[i]; + if (value < 32) { + if (value === 12) { + value = (value << 8) + encoded[++i]; + } + switch (value) { + case 1: + if (!HINTING_ENABLED) { + this.stack = []; + break; + } + error = this.executeCommand(2, COMMAND_MAP.hstem); + break; + case 3: + if (!HINTING_ENABLED) { + this.stack = []; + break; + } + error = this.executeCommand(2, COMMAND_MAP.vstem); + break; + case 4: + if (this.flexing) { + if (this.stack.length < 1) { + error = true; + break; + } + const dy = this.stack.pop(); + this.stack.push(0, dy); + break; + } + error = this.executeCommand(1, COMMAND_MAP.vmoveto); + break; + case 5: + error = this.executeCommand(2, COMMAND_MAP.rlineto); + break; + case 6: + error = this.executeCommand(1, COMMAND_MAP.hlineto); + break; + case 7: + error = this.executeCommand(1, COMMAND_MAP.vlineto); + break; + case 8: + error = this.executeCommand(6, COMMAND_MAP.rrcurveto); + break; + case 9: + this.stack = []; + break; + case 10: + if (this.stack.length < 1) { + error = true; + break; + } + subrNumber = this.stack.pop(); + if (!subrs[subrNumber]) { + error = true; + break; + } + error = this.convert(subrs[subrNumber], subrs, seacAnalysisEnabled); + break; + case 11: + return error; + case 13: + if (this.stack.length < 2) { + error = true; + break; + } + wx = this.stack.pop(); + sbx = this.stack.pop(); + this.lsb = sbx; + this.width = wx; + this.stack.push(wx, sbx); + error = this.executeCommand(2, COMMAND_MAP.hmoveto); + break; + case 14: + this.output.push(COMMAND_MAP.endchar[0]); + break; + case 21: + if (this.flexing) { + break; + } + error = this.executeCommand(2, COMMAND_MAP.rmoveto); + break; + case 22: + if (this.flexing) { + this.stack.push(0); + break; + } + error = this.executeCommand(1, COMMAND_MAP.hmoveto); + break; + case 30: + error = this.executeCommand(4, COMMAND_MAP.vhcurveto); + break; + case 31: + error = this.executeCommand(4, COMMAND_MAP.hvcurveto); + break; + case (12 << 8) + 0: + this.stack = []; + break; + case (12 << 8) + 1: + if (!HINTING_ENABLED) { + this.stack = []; + break; + } + error = this.executeCommand(2, COMMAND_MAP.vstem); + break; + case (12 << 8) + 2: + if (!HINTING_ENABLED) { + this.stack = []; + break; + } + error = this.executeCommand(2, COMMAND_MAP.hstem); + break; + case (12 << 8) + 6: + if (seacAnalysisEnabled) { + const asb = this.stack.at(-5); + this.seac = this.stack.splice(-4, 4); + this.seac[0] += this.lsb - asb; + error = this.executeCommand(0, COMMAND_MAP.endchar); + } else { + error = this.executeCommand(4, COMMAND_MAP.endchar); + } + break; + case (12 << 8) + 7: + if (this.stack.length < 4) { + error = true; + break; + } + this.stack.pop(); + wx = this.stack.pop(); + const sby = this.stack.pop(); + sbx = this.stack.pop(); + this.lsb = sbx; + this.width = wx; + this.stack.push(wx, sbx, sby); + error = this.executeCommand(3, COMMAND_MAP.rmoveto); + break; + case (12 << 8) + 12: + if (this.stack.length < 2) { + error = true; + break; + } + const num2 = this.stack.pop(); + const num1 = this.stack.pop(); + this.stack.push(num1 / num2); + break; + case (12 << 8) + 16: + if (this.stack.length < 2) { + error = true; + break; + } + subrNumber = this.stack.pop(); + const numArgs = this.stack.pop(); + if (subrNumber === 0 && numArgs === 3) { + const flexArgs = this.stack.splice(-17, 17); + this.stack.push(flexArgs[2] + flexArgs[0], flexArgs[3] + flexArgs[1], flexArgs[4], flexArgs[5], flexArgs[6], flexArgs[7], flexArgs[8], flexArgs[9], flexArgs[10], flexArgs[11], flexArgs[12], flexArgs[13], flexArgs[14]); + error = this.executeCommand(13, COMMAND_MAP.flex, true); + this.flexing = false; + this.stack.push(flexArgs[15], flexArgs[16]); + } else if (subrNumber === 1 && numArgs === 0) { + this.flexing = true; + } + break; + case (12 << 8) + 17: + break; + case (12 << 8) + 33: + this.stack = []; + break; + default: + warn('Unknown type 1 charstring command of "' + value + '"'); + break; + } + if (error) { + break; + } + continue; + } else if (value <= 246) { + value -= 139; + } else if (value <= 250) { + value = (value - 247) * 256 + encoded[++i] + 108; + } else if (value <= 254) { + value = -((value - 251) * 256) - encoded[++i] - 108; + } else { + value = (encoded[++i] & 0xff) << 24 | (encoded[++i] & 0xff) << 16 | (encoded[++i] & 0xff) << 8 | (encoded[++i] & 0xff) << 0; + } + this.stack.push(value); + } + return error; + } + executeCommand(howManyArgs, command, keepStack) { + const stackLength = this.stack.length; + if (howManyArgs > stackLength) { + return true; + } + const start = stackLength - howManyArgs; + for (let i = start; i < stackLength; i++) { + let value = this.stack[i]; + if (Number.isInteger(value)) { + this.output.push(28, value >> 8 & 0xff, value & 0xff); + } else { + value = 65536 * value | 0; + this.output.push(255, value >> 24 & 0xff, value >> 16 & 0xff, value >> 8 & 0xff, value & 0xff); + } + } + this.output.push(...command); + if (keepStack) { + this.stack.splice(start, howManyArgs); + } else { + this.stack.length = 0; + } + return false; + } +} +const EEXEC_ENCRYPT_KEY = 55665; +const CHAR_STRS_ENCRYPT_KEY = 4330; +function isHexDigit(code) { + return code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102; +} +function decrypt(data, key, discardNumber) { + if (discardNumber >= data.length) { + return new Uint8Array(0); + } + const c1 = 52845, + c2 = 22719; + let r = key | 0, + i, + j; + for (i = 0; i < discardNumber; i++) { + r = (data[i] + r) * c1 + c2 & (1 << 16) - 1; + } + const count = data.length - discardNumber; + const decrypted = new Uint8Array(count); + for (i = discardNumber, j = 0; j < count; i++, j++) { + const value = data[i]; + decrypted[j] = value ^ r >> 8; + r = (value + r) * c1 + c2 & (1 << 16) - 1; + } + return decrypted; +} +function decryptAscii(data, key, discardNumber) { + const c1 = 52845, + c2 = 22719; + let r = key | 0; + const count = data.length, + maybeLength = count >>> 1; + const decrypted = new Uint8Array(maybeLength); + let i, j; + for (i = 0, j = 0; i < count; i++) { + const digit1 = data[i]; + if (!isHexDigit(digit1)) { + continue; + } + i++; + let digit2; + while (i < count && !isHexDigit(digit2 = data[i])) { + i++; + } + if (i < count) { + const value = parseInt(String.fromCharCode(digit1, digit2), 16); + decrypted[j++] = value ^ r >> 8; + r = (value + r) * c1 + c2 & (1 << 16) - 1; + } + } + return decrypted.slice(discardNumber, j); +} +function isSpecial(c) { + return c === 0x2f || c === 0x5b || c === 0x5d || c === 0x7b || c === 0x7d || c === 0x28 || c === 0x29; +} +class Type1Parser { + constructor(stream, encrypted, seacAnalysisEnabled) { + if (encrypted) { + const data = stream.getBytes(); + const isBinary = !((isHexDigit(data[0]) || isWhiteSpace(data[0])) && isHexDigit(data[1]) && isHexDigit(data[2]) && isHexDigit(data[3]) && isHexDigit(data[4]) && isHexDigit(data[5]) && isHexDigit(data[6]) && isHexDigit(data[7])); + stream = new Stream(isBinary ? decrypt(data, EEXEC_ENCRYPT_KEY, 4) : decryptAscii(data, EEXEC_ENCRYPT_KEY, 4)); + } + this.seacAnalysisEnabled = !!seacAnalysisEnabled; + this.stream = stream; + this.nextChar(); + } + readNumberArray() { + this.getToken(); + const array = []; + while (true) { + const token = this.getToken(); + if (token === null || token === "]" || token === "}") { + break; + } + array.push(parseFloat(token || 0)); + } + return array; + } + readNumber() { + const token = this.getToken(); + return parseFloat(token || 0); + } + readInt() { + const token = this.getToken(); + return parseInt(token || 0, 10) | 0; + } + readBoolean() { + const token = this.getToken(); + return token === "true" ? 1 : 0; + } + nextChar() { + return this.currentChar = this.stream.getByte(); + } + prevChar() { + this.stream.skip(-2); + return this.currentChar = this.stream.getByte(); + } + getToken() { + let comment = false; + let ch = this.currentChar; + while (true) { + if (ch === -1) { + return null; + } + if (comment) { + if (ch === 0x0a || ch === 0x0d) { + comment = false; + } + } else if (ch === 0x25) { + comment = true; + } else if (!isWhiteSpace(ch)) { + break; + } + ch = this.nextChar(); + } + if (isSpecial(ch)) { + this.nextChar(); + return String.fromCharCode(ch); + } + let token = ""; + do { + token += String.fromCharCode(ch); + ch = this.nextChar(); + } while (ch >= 0 && !isWhiteSpace(ch) && !isSpecial(ch)); + return token; + } + readCharStrings(bytes, lenIV) { + if (lenIV === -1) { + return bytes; + } + return decrypt(bytes, CHAR_STRS_ENCRYPT_KEY, lenIV); + } + extractFontProgram(properties) { + const stream = this.stream; + const subrs = [], + charstrings = []; + const privateData = Object.create(null); + privateData.lenIV = 4; + const program = { + subrs: [], + charstrings: [], + properties: { + privateData + } + }; + let token, length, data, lenIV; + while ((token = this.getToken()) !== null) { + if (token !== "/") { + continue; + } + token = this.getToken(); + switch (token) { + case "CharStrings": + this.getToken(); + this.getToken(); + this.getToken(); + this.getToken(); + while (true) { + token = this.getToken(); + if (token === null || token === "end") { + break; + } + if (token !== "/") { + continue; + } + const glyph = this.getToken(); + length = this.readInt(); + this.getToken(); + data = length > 0 ? stream.getBytes(length) : new Uint8Array(0); + lenIV = program.properties.privateData.lenIV; + const encoded = this.readCharStrings(data, lenIV); + this.nextChar(); + token = this.getToken(); + if (token === "noaccess") { + this.getToken(); + } else if (token === "/") { + this.prevChar(); + } + charstrings.push({ + glyph, + encoded + }); + } + break; + case "Subrs": + this.readInt(); + this.getToken(); + while (this.getToken() === "dup") { + const index = this.readInt(); + length = this.readInt(); + this.getToken(); + data = length > 0 ? stream.getBytes(length) : new Uint8Array(0); + lenIV = program.properties.privateData.lenIV; + const encoded = this.readCharStrings(data, lenIV); + this.nextChar(); + token = this.getToken(); + if (token === "noaccess") { + this.getToken(); + } + subrs[index] = encoded; + } + break; + case "BlueValues": + case "OtherBlues": + case "FamilyBlues": + case "FamilyOtherBlues": + const blueArray = this.readNumberArray(); + if (blueArray.length > 0 && blueArray.length % 2 === 0 && HINTING_ENABLED) { + program.properties.privateData[token] = blueArray; + } + break; + case "StemSnapH": + case "StemSnapV": + program.properties.privateData[token] = this.readNumberArray(); + break; + case "StdHW": + case "StdVW": + program.properties.privateData[token] = this.readNumberArray()[0]; + break; + case "BlueShift": + case "lenIV": + case "BlueFuzz": + case "BlueScale": + case "LanguageGroup": + program.properties.privateData[token] = this.readNumber(); + break; + case "ExpansionFactor": + program.properties.privateData[token] = this.readNumber() || 0.06; + break; + case "ForceBold": + program.properties.privateData[token] = this.readBoolean(); + break; + } + } + for (const { + encoded, + glyph + } of charstrings) { + const charString = new Type1CharString(); + const error = charString.convert(encoded, subrs, this.seacAnalysisEnabled); + let output = charString.output; + if (error) { + output = [14]; + } + const charStringObject = { + glyphName: glyph, + charstring: output, + width: charString.width, + lsb: charString.lsb, + seac: charString.seac + }; + if (glyph === ".notdef") { + program.charstrings.unshift(charStringObject); + } else { + program.charstrings.push(charStringObject); + } + if (properties.builtInEncoding) { + const index = properties.builtInEncoding.indexOf(glyph); + if (index > -1 && properties.widths[index] === undefined && index >= properties.firstChar && index <= properties.lastChar) { + properties.widths[index] = charString.width; + } + } + } + return program; + } + extractFontHeader(properties) { + let token; + while ((token = this.getToken()) !== null) { + if (token !== "/") { + continue; + } + token = this.getToken(); + switch (token) { + case "FontMatrix": + const matrix = this.readNumberArray(); + properties.fontMatrix = matrix; + break; + case "Encoding": + const encodingArg = this.getToken(); + let encoding; + if (!/^\d+$/.test(encodingArg)) { + encoding = getEncoding(encodingArg); + } else { + encoding = []; + const size = parseInt(encodingArg, 10) | 0; + this.getToken(); + for (let j = 0; j < size; j++) { + token = this.getToken(); + while (token !== "dup" && token !== "def") { + token = this.getToken(); + if (token === null) { + return; + } + } + if (token === "def") { + break; + } + const index = this.readInt(); + this.getToken(); + const glyph = this.getToken(); + encoding[index] = glyph; + this.getToken(); + } + } + properties.builtInEncoding = encoding; + break; + case "FontBBox": + const fontBBox = this.readNumberArray(); + properties.ascent = Math.max(fontBBox[3], fontBBox[1]); + properties.descent = Math.min(fontBBox[1], fontBBox[3]); + properties.ascentScaled = true; + break; + } + } + } +} + +;// ./src/core/type1_font.js + + + + + + +function findBlock(streamBytes, signature, startIndex) { + const streamBytesLength = streamBytes.length; + const signatureLength = signature.length; + const scanLength = streamBytesLength - signatureLength; + let i = startIndex, + found = false; + while (i < scanLength) { + let j = 0; + while (j < signatureLength && streamBytes[i + j] === signature[j]) { + j++; + } + if (j >= signatureLength) { + i += j; + while (i < streamBytesLength && isWhiteSpace(streamBytes[i])) { + i++; + } + found = true; + break; + } + i++; + } + return { + found, + length: i + }; +} +function getHeaderBlock(stream, suggestedLength) { + const EEXEC_SIGNATURE = [0x65, 0x65, 0x78, 0x65, 0x63]; + const streamStartPos = stream.pos; + let headerBytes, headerBytesLength, block; + try { + headerBytes = stream.getBytes(suggestedLength); + headerBytesLength = headerBytes.length; + } catch {} + if (headerBytesLength === suggestedLength) { + block = findBlock(headerBytes, EEXEC_SIGNATURE, suggestedLength - 2 * EEXEC_SIGNATURE.length); + if (block.found && block.length === suggestedLength) { + return { + stream: new Stream(headerBytes), + length: suggestedLength + }; + } + } + warn('Invalid "Length1" property in Type1 font -- trying to recover.'); + stream.pos = streamStartPos; + const SCAN_BLOCK_LENGTH = 2048; + let actualLength; + while (true) { + const scanBytes = stream.peekBytes(SCAN_BLOCK_LENGTH); + block = findBlock(scanBytes, EEXEC_SIGNATURE, 0); + if (block.length === 0) { + break; + } + stream.pos += block.length; + if (block.found) { + actualLength = stream.pos - streamStartPos; + break; + } + } + stream.pos = streamStartPos; + if (actualLength) { + return { + stream: new Stream(stream.getBytes(actualLength)), + length: actualLength + }; + } + warn('Unable to recover "Length1" property in Type1 font -- using as is.'); + return { + stream: new Stream(stream.getBytes(suggestedLength)), + length: suggestedLength + }; +} +function getEexecBlock(stream, suggestedLength) { + const eexecBytes = stream.getBytes(); + if (eexecBytes.length === 0) { + throw new FormatError("getEexecBlock - no font program found."); + } + return { + stream: new Stream(eexecBytes), + length: eexecBytes.length + }; +} +class Type1Font { + constructor(name, file, properties) { + const PFB_HEADER_SIZE = 6; + let headerBlockLength = properties.length1; + let eexecBlockLength = properties.length2; + let pfbHeader = file.peekBytes(PFB_HEADER_SIZE); + const pfbHeaderPresent = pfbHeader[0] === 0x80 && pfbHeader[1] === 0x01; + if (pfbHeaderPresent) { + file.skip(PFB_HEADER_SIZE); + headerBlockLength = pfbHeader[5] << 24 | pfbHeader[4] << 16 | pfbHeader[3] << 8 | pfbHeader[2]; + } + const headerBlock = getHeaderBlock(file, headerBlockLength); + const headerBlockParser = new Type1Parser(headerBlock.stream, false, SEAC_ANALYSIS_ENABLED); + headerBlockParser.extractFontHeader(properties); + if (pfbHeaderPresent) { + pfbHeader = file.getBytes(PFB_HEADER_SIZE); + eexecBlockLength = pfbHeader[5] << 24 | pfbHeader[4] << 16 | pfbHeader[3] << 8 | pfbHeader[2]; + } + const eexecBlock = getEexecBlock(file, eexecBlockLength); + const eexecBlockParser = new Type1Parser(eexecBlock.stream, true, SEAC_ANALYSIS_ENABLED); + const data = eexecBlockParser.extractFontProgram(properties); + for (const key in data.properties) { + properties[key] = data.properties[key]; + } + const charstrings = data.charstrings; + const type2Charstrings = this.getType2Charstrings(charstrings); + const subrs = this.getType2Subrs(data.subrs); + this.charstrings = charstrings; + this.data = this.wrap(name, type2Charstrings, this.charstrings, subrs, properties); + this.seacs = this.getSeacs(data.charstrings); + } + get numGlyphs() { + return this.charstrings.length + 1; + } + getCharset() { + const charset = [".notdef"]; + for (const { + glyphName + } of this.charstrings) { + charset.push(glyphName); + } + return charset; + } + getGlyphMapping(properties) { + const charstrings = this.charstrings; + if (properties.composite) { + const charCodeToGlyphId = Object.create(null); + for (let glyphId = 0, charstringsLen = charstrings.length; glyphId < charstringsLen; glyphId++) { + const charCode = properties.cMap.charCodeOf(glyphId); + charCodeToGlyphId[charCode] = glyphId + 1; + } + return charCodeToGlyphId; + } + const glyphNames = [".notdef"]; + let builtInEncoding, glyphId; + for (glyphId = 0; glyphId < charstrings.length; glyphId++) { + glyphNames.push(charstrings[glyphId].glyphName); + } + const encoding = properties.builtInEncoding; + if (encoding) { + builtInEncoding = Object.create(null); + for (const charCode in encoding) { + glyphId = glyphNames.indexOf(encoding[charCode]); + if (glyphId >= 0) { + builtInEncoding[charCode] = glyphId; + } + } + } + return type1FontGlyphMapping(properties, builtInEncoding, glyphNames); + } + hasGlyphId(id) { + if (id < 0 || id >= this.numGlyphs) { + return false; + } + if (id === 0) { + return true; + } + const glyph = this.charstrings[id - 1]; + return glyph.charstring.length > 0; + } + getSeacs(charstrings) { + const seacMap = []; + for (let i = 0, ii = charstrings.length; i < ii; i++) { + const charstring = charstrings[i]; + if (charstring.seac) { + seacMap[i + 1] = charstring.seac; + } + } + return seacMap; + } + getType2Charstrings(type1Charstrings) { + const type2Charstrings = []; + for (const type1Charstring of type1Charstrings) { + type2Charstrings.push(type1Charstring.charstring); + } + return type2Charstrings; + } + getType2Subrs(type1Subrs) { + let bias = 0; + const count = type1Subrs.length; + if (count < 1133) { + bias = 107; + } else if (count < 33769) { + bias = 1131; + } else { + bias = 32768; + } + const type2Subrs = []; + let i; + for (i = 0; i < bias; i++) { + type2Subrs.push([0x0b]); + } + for (i = 0; i < count; i++) { + type2Subrs.push(type1Subrs[i]); + } + return type2Subrs; + } + wrap(name, glyphs, charstrings, subrs, properties) { + const cff = new CFF(); + cff.header = new CFFHeader(1, 0, 4, 4); + cff.names = [name]; + const topDict = new CFFTopDict(); + topDict.setByName("version", 391); + topDict.setByName("Notice", 392); + topDict.setByName("FullName", 393); + topDict.setByName("FamilyName", 394); + topDict.setByName("Weight", 395); + topDict.setByName("Encoding", null); + topDict.setByName("FontMatrix", properties.fontMatrix); + topDict.setByName("FontBBox", properties.bbox); + topDict.setByName("charset", null); + topDict.setByName("CharStrings", null); + topDict.setByName("Private", null); + cff.topDict = topDict; + const strings = new CFFStrings(); + strings.add("Version 0.11"); + strings.add("See original notice"); + strings.add(name); + strings.add(name); + strings.add("Medium"); + cff.strings = strings; + cff.globalSubrIndex = new CFFIndex(); + const count = glyphs.length; + const charsetArray = [".notdef"]; + let i, ii; + for (i = 0; i < count; i++) { + const glyphName = charstrings[i].glyphName; + const index = CFFStandardStrings.indexOf(glyphName); + if (index === -1) { + strings.add(glyphName); + } + charsetArray.push(glyphName); + } + cff.charset = new CFFCharset(false, 0, charsetArray); + const charStringsIndex = new CFFIndex(); + charStringsIndex.add([0x8b, 0x0e]); + for (i = 0; i < count; i++) { + charStringsIndex.add(glyphs[i]); + } + cff.charStrings = charStringsIndex; + const privateDict = new CFFPrivateDict(); + privateDict.setByName("Subrs", null); + const fields = ["BlueValues", "OtherBlues", "FamilyBlues", "FamilyOtherBlues", "StemSnapH", "StemSnapV", "BlueShift", "BlueFuzz", "BlueScale", "LanguageGroup", "ExpansionFactor", "ForceBold", "StdHW", "StdVW"]; + for (i = 0, ii = fields.length; i < ii; i++) { + const field = fields[i]; + if (!(field in properties.privateData)) { + continue; + } + const value = properties.privateData[field]; + if (Array.isArray(value)) { + for (let j = value.length - 1; j > 0; j--) { + value[j] -= value[j - 1]; + } + } + privateDict.setByName(field, value); + } + cff.topDict.privateDict = privateDict; + const subrIndex = new CFFIndex(); + for (i = 0, ii = subrs.length; i < ii; i++) { + subrIndex.add(subrs[i]); + } + privateDict.subrsIndex = subrIndex; + const compiler = new CFFCompiler(cff); + return compiler.compile(); + } +} + +;// ./src/core/fonts.js + + + + + + + + + + + + + + + + + +const PRIVATE_USE_AREAS = [[0xe000, 0xf8ff], [0x100000, 0x10fffd]]; +const PDF_GLYPH_SPACE_UNITS = 1000; +const EXPORT_DATA_PROPERTIES = ["ascent", "bbox", "black", "bold", "charProcOperatorList", "composite", "cssFontInfo", "data", "defaultVMetrics", "defaultWidth", "descent", "fallbackName", "fontMatrix", "isInvalidPDFjsFont", "isType3Font", "italic", "loadedName", "mimetype", "missingFile", "name", "remeasure", "subtype", "systemFontInfo", "type", "vertical"]; +const EXPORT_DATA_EXTRA_PROPERTIES = ["cMap", "defaultEncoding", "differences", "isMonospace", "isSerifFont", "isSymbolicFont", "seacMap", "toFontChar", "toUnicode", "vmetrics", "widths"]; +function adjustWidths(properties) { + if (!properties.fontMatrix) { + return; + } + if (properties.fontMatrix[0] === FONT_IDENTITY_MATRIX[0]) { + return; + } + const scale = 0.001 / properties.fontMatrix[0]; + const glyphsWidths = properties.widths; + for (const glyph in glyphsWidths) { + glyphsWidths[glyph] *= scale; + } + properties.defaultWidth *= scale; +} +function adjustTrueTypeToUnicode(properties, isSymbolicFont, nameRecords) { + if (properties.isInternalFont) { + return; + } + if (properties.hasIncludedToUnicodeMap) { + return; + } + if (properties.hasEncoding) { + return; + } + if (properties.toUnicode instanceof IdentityToUnicodeMap) { + return; + } + if (!isSymbolicFont) { + return; + } + if (nameRecords.length === 0) { + return; + } + if (properties.defaultEncoding === WinAnsiEncoding) { + return; + } + for (const r of nameRecords) { + if (!isWinNameRecord(r)) { + return; + } + } + const encoding = WinAnsiEncoding; + const toUnicode = [], + glyphsUnicodeMap = getGlyphsUnicode(); + for (const charCode in encoding) { + const glyphName = encoding[charCode]; + if (glyphName === "") { + continue; + } + const unicode = glyphsUnicodeMap[glyphName]; + if (unicode === undefined) { + continue; + } + toUnicode[charCode] = String.fromCharCode(unicode); + } + if (toUnicode.length > 0) { + properties.toUnicode.amend(toUnicode); + } +} +function adjustType1ToUnicode(properties, builtInEncoding) { + if (properties.isInternalFont) { + return; + } + if (properties.hasIncludedToUnicodeMap) { + return; + } + if (builtInEncoding === properties.defaultEncoding) { + return; + } + if (properties.toUnicode instanceof IdentityToUnicodeMap) { + return; + } + const toUnicode = [], + glyphsUnicodeMap = getGlyphsUnicode(); + for (const charCode in builtInEncoding) { + if (properties.hasEncoding) { + if (properties.baseEncodingName || properties.differences[charCode] !== undefined) { + continue; + } + } + const glyphName = builtInEncoding[charCode]; + const unicode = getUnicodeForGlyph(glyphName, glyphsUnicodeMap); + if (unicode !== -1) { + toUnicode[charCode] = String.fromCharCode(unicode); + } + } + if (toUnicode.length > 0) { + properties.toUnicode.amend(toUnicode); + } +} +function amendFallbackToUnicode(properties) { + if (!properties.fallbackToUnicode) { + return; + } + if (properties.toUnicode instanceof IdentityToUnicodeMap) { + return; + } + const toUnicode = []; + for (const charCode in properties.fallbackToUnicode) { + if (properties.toUnicode.has(charCode)) { + continue; + } + toUnicode[charCode] = properties.fallbackToUnicode[charCode]; + } + if (toUnicode.length > 0) { + properties.toUnicode.amend(toUnicode); + } +} +class fonts_Glyph { + constructor(originalCharCode, fontChar, unicode, accent, width, vmetric, operatorListId, isSpace, isInFont) { + this.originalCharCode = originalCharCode; + this.fontChar = fontChar; + this.unicode = unicode; + this.accent = accent; + this.width = width; + this.vmetric = vmetric; + this.operatorListId = operatorListId; + this.isSpace = isSpace; + this.isInFont = isInFont; + } + get category() { + return shadow(this, "category", getCharUnicodeCategory(this.unicode), true); + } +} +function int16(b0, b1) { + return (b0 << 8) + b1; +} +function writeSignedInt16(bytes, index, value) { + bytes[index + 1] = value; + bytes[index] = value >>> 8; +} +function signedInt16(b0, b1) { + const value = (b0 << 8) + b1; + return value & 1 << 15 ? value - 0x10000 : value; +} +function writeUint32(bytes, index, value) { + bytes[index + 3] = value & 0xff; + bytes[index + 2] = value >>> 8; + bytes[index + 1] = value >>> 16; + bytes[index] = value >>> 24; +} +function int32(b0, b1, b2, b3) { + return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3; +} +function string16(value) { + return String.fromCharCode(value >> 8 & 0xff, value & 0xff); +} +function safeString16(value) { + if (value > 0x7fff) { + value = 0x7fff; + } else if (value < -0x8000) { + value = -0x8000; + } + return String.fromCharCode(value >> 8 & 0xff, value & 0xff); +} +function isTrueTypeFile(file) { + const header = file.peekBytes(4); + return readUint32(header, 0) === 0x00010000 || bytesToString(header) === "true"; +} +function isTrueTypeCollectionFile(file) { + const header = file.peekBytes(4); + return bytesToString(header) === "ttcf"; +} +function isOpenTypeFile(file) { + const header = file.peekBytes(4); + return bytesToString(header) === "OTTO"; +} +function isType1File(file) { + const header = file.peekBytes(2); + if (header[0] === 0x25 && header[1] === 0x21) { + return true; + } + if (header[0] === 0x80 && header[1] === 0x01) { + return true; + } + return false; +} +function isCFFFile(file) { + const header = file.peekBytes(4); + if (header[0] >= 1 && header[3] >= 1 && header[3] <= 4) { + return true; + } + return false; +} +function getFontFileType(file, { + type, + subtype, + composite +}) { + let fileType, fileSubtype; + if (isTrueTypeFile(file) || isTrueTypeCollectionFile(file)) { + fileType = composite ? "CIDFontType2" : "TrueType"; + } else if (isOpenTypeFile(file)) { + fileType = composite ? "CIDFontType2" : "OpenType"; + } else if (isType1File(file)) { + if (composite) { + fileType = "CIDFontType0"; + } else { + fileType = type === "MMType1" ? "MMType1" : "Type1"; + } + } else if (isCFFFile(file)) { + if (composite) { + fileType = "CIDFontType0"; + fileSubtype = "CIDFontType0C"; + } else { + fileType = type === "MMType1" ? "MMType1" : "Type1"; + fileSubtype = "Type1C"; + } + } else { + warn("getFontFileType: Unable to detect correct font file Type/Subtype."); + fileType = type; + fileSubtype = subtype; + } + return [fileType, fileSubtype]; +} +function applyStandardFontGlyphMap(map, glyphMap) { + for (const charCode in glyphMap) { + map[+charCode] = glyphMap[charCode]; + } +} +function buildToFontChar(encoding, glyphsUnicodeMap, differences) { + const toFontChar = []; + let unicode; + for (let i = 0, ii = encoding.length; i < ii; i++) { + unicode = getUnicodeForGlyph(encoding[i], glyphsUnicodeMap); + if (unicode !== -1) { + toFontChar[i] = unicode; + } + } + for (const charCode in differences) { + unicode = getUnicodeForGlyph(differences[charCode], glyphsUnicodeMap); + if (unicode !== -1) { + toFontChar[+charCode] = unicode; + } + } + return toFontChar; +} +function isMacNameRecord(r) { + return r.platform === 1 && r.encoding === 0 && r.language === 0; +} +function isWinNameRecord(r) { + return r.platform === 3 && r.encoding === 1 && r.language === 0x409; +} +function convertCidString(charCode, cid, shouldThrow = false) { + switch (cid.length) { + case 1: + return cid.charCodeAt(0); + case 2: + return cid.charCodeAt(0) << 8 | cid.charCodeAt(1); + } + const msg = `Unsupported CID string (charCode ${charCode}): "${cid}".`; + if (shouldThrow) { + throw new FormatError(msg); + } + warn(msg); + return cid; +} +function adjustMapping(charCodeToGlyphId, hasGlyph, newGlyphZeroId, toUnicode) { + const newMap = Object.create(null); + const toUnicodeExtraMap = new Map(); + const toFontChar = []; + const usedGlyphIds = new Set(); + let privateUseAreaIndex = 0; + const privateUseOffetStart = PRIVATE_USE_AREAS[privateUseAreaIndex][0]; + let nextAvailableFontCharCode = privateUseOffetStart; + let privateUseOffetEnd = PRIVATE_USE_AREAS[privateUseAreaIndex][1]; + const isInPrivateArea = code => PRIVATE_USE_AREAS[0][0] <= code && code <= PRIVATE_USE_AREAS[0][1] || PRIVATE_USE_AREAS[1][0] <= code && code <= PRIVATE_USE_AREAS[1][1]; + for (const originalCharCode in charCodeToGlyphId) { + let glyphId = charCodeToGlyphId[originalCharCode]; + if (!hasGlyph(glyphId)) { + continue; + } + if (nextAvailableFontCharCode > privateUseOffetEnd) { + privateUseAreaIndex++; + if (privateUseAreaIndex >= PRIVATE_USE_AREAS.length) { + warn("Ran out of space in font private use area."); + break; + } + nextAvailableFontCharCode = PRIVATE_USE_AREAS[privateUseAreaIndex][0]; + privateUseOffetEnd = PRIVATE_USE_AREAS[privateUseAreaIndex][1]; + } + const fontCharCode = nextAvailableFontCharCode++; + if (glyphId === 0) { + glyphId = newGlyphZeroId; + } + let unicode = toUnicode.get(originalCharCode); + if (typeof unicode === "string") { + unicode = unicode.codePointAt(0); + } + if (unicode && !isInPrivateArea(unicode) && !usedGlyphIds.has(glyphId)) { + toUnicodeExtraMap.set(unicode, glyphId); + usedGlyphIds.add(glyphId); + } + newMap[fontCharCode] = glyphId; + toFontChar[originalCharCode] = fontCharCode; + } + return { + toFontChar, + charCodeToGlyphId: newMap, + toUnicodeExtraMap, + nextAvailableFontCharCode + }; +} +function getRanges(glyphs, toUnicodeExtraMap, numGlyphs) { + const codes = []; + for (const charCode in glyphs) { + if (glyphs[charCode] >= numGlyphs) { + continue; + } + codes.push({ + fontCharCode: charCode | 0, + glyphId: glyphs[charCode] + }); + } + if (toUnicodeExtraMap) { + for (const [unicode, glyphId] of toUnicodeExtraMap) { + if (glyphId >= numGlyphs) { + continue; + } + codes.push({ + fontCharCode: unicode, + glyphId + }); + } + } + if (codes.length === 0) { + codes.push({ + fontCharCode: 0, + glyphId: 0 + }); + } + codes.sort(function fontGetRangesSort(a, b) { + return a.fontCharCode - b.fontCharCode; + }); + const ranges = []; + const length = codes.length; + for (let n = 0; n < length;) { + const start = codes[n].fontCharCode; + const codeIndices = [codes[n].glyphId]; + ++n; + let end = start; + while (n < length && end + 1 === codes[n].fontCharCode) { + codeIndices.push(codes[n].glyphId); + ++end; + ++n; + if (end === 0xffff) { + break; + } + } + ranges.push([start, end, codeIndices]); + } + return ranges; +} +function createCmapTable(glyphs, toUnicodeExtraMap, numGlyphs) { + const ranges = getRanges(glyphs, toUnicodeExtraMap, numGlyphs); + const numTables = ranges.at(-1)[1] > 0xffff ? 2 : 1; + let cmap = "\x00\x00" + string16(numTables) + "\x00\x03" + "\x00\x01" + string32(4 + numTables * 8); + let i, ii, j, jj; + for (i = ranges.length - 1; i >= 0; --i) { + if (ranges[i][0] <= 0xffff) { + break; + } + } + const bmpLength = i + 1; + if (ranges[i][0] < 0xffff && ranges[i][1] === 0xffff) { + ranges[i][1] = 0xfffe; + } + const trailingRangesCount = ranges[i][1] < 0xffff ? 1 : 0; + const segCount = bmpLength + trailingRangesCount; + const searchParams = OpenTypeFileBuilder.getSearchParams(segCount, 2); + let startCount = ""; + let endCount = ""; + let idDeltas = ""; + let idRangeOffsets = ""; + let glyphsIds = ""; + let bias = 0; + let range, start, end, codes; + for (i = 0, ii = bmpLength; i < ii; i++) { + range = ranges[i]; + start = range[0]; + end = range[1]; + startCount += string16(start); + endCount += string16(end); + codes = range[2]; + let contiguous = true; + for (j = 1, jj = codes.length; j < jj; ++j) { + if (codes[j] !== codes[j - 1] + 1) { + contiguous = false; + break; + } + } + if (!contiguous) { + const offset = (segCount - i) * 2 + bias * 2; + bias += end - start + 1; + idDeltas += string16(0); + idRangeOffsets += string16(offset); + for (j = 0, jj = codes.length; j < jj; ++j) { + glyphsIds += string16(codes[j]); + } + } else { + const startCode = codes[0]; + idDeltas += string16(startCode - start & 0xffff); + idRangeOffsets += string16(0); + } + } + if (trailingRangesCount > 0) { + endCount += "\xFF\xFF"; + startCount += "\xFF\xFF"; + idDeltas += "\x00\x01"; + idRangeOffsets += "\x00\x00"; + } + const format314 = "\x00\x00" + string16(2 * segCount) + string16(searchParams.range) + string16(searchParams.entry) + string16(searchParams.rangeShift) + endCount + "\x00\x00" + startCount + idDeltas + idRangeOffsets + glyphsIds; + let format31012 = ""; + let header31012 = ""; + if (numTables > 1) { + cmap += "\x00\x03" + "\x00\x0A" + string32(4 + numTables * 8 + 4 + format314.length); + format31012 = ""; + for (i = 0, ii = ranges.length; i < ii; i++) { + range = ranges[i]; + start = range[0]; + codes = range[2]; + let code = codes[0]; + for (j = 1, jj = codes.length; j < jj; ++j) { + if (codes[j] !== codes[j - 1] + 1) { + end = range[0] + j - 1; + format31012 += string32(start) + string32(end) + string32(code); + start = end + 1; + code = codes[j]; + } + } + format31012 += string32(start) + string32(range[1]) + string32(code); + } + header31012 = "\x00\x0C" + "\x00\x00" + string32(format31012.length + 16) + "\x00\x00\x00\x00" + string32(format31012.length / 12); + } + return cmap + "\x00\x04" + string16(format314.length + 4) + format314 + header31012 + format31012; +} +function validateOS2Table(os2, file) { + file.pos = (file.start || 0) + os2.offset; + const version = file.getUint16(); + file.skip(60); + const selection = file.getUint16(); + if (version < 4 && selection & 0x0300) { + return false; + } + const firstChar = file.getUint16(); + const lastChar = file.getUint16(); + if (firstChar > lastChar) { + return false; + } + file.skip(6); + const usWinAscent = file.getUint16(); + if (usWinAscent === 0) { + return false; + } + os2.data[8] = os2.data[9] = 0; + return true; +} +function createOS2Table(properties, charstrings, override) { + override ||= { + unitsPerEm: 0, + yMax: 0, + yMin: 0, + ascent: 0, + descent: 0 + }; + let ulUnicodeRange1 = 0; + let ulUnicodeRange2 = 0; + let ulUnicodeRange3 = 0; + let ulUnicodeRange4 = 0; + let firstCharIndex = null; + let lastCharIndex = 0; + let position = -1; + if (charstrings) { + for (let code in charstrings) { + code |= 0; + if (firstCharIndex > code || !firstCharIndex) { + firstCharIndex = code; + } + if (lastCharIndex < code) { + lastCharIndex = code; + } + position = getUnicodeRangeFor(code, position); + if (position < 32) { + ulUnicodeRange1 |= 1 << position; + } else if (position < 64) { + ulUnicodeRange2 |= 1 << position - 32; + } else if (position < 96) { + ulUnicodeRange3 |= 1 << position - 64; + } else if (position < 123) { + ulUnicodeRange4 |= 1 << position - 96; + } else { + throw new FormatError("Unicode ranges Bits > 123 are reserved for internal usage"); + } + } + if (lastCharIndex > 0xffff) { + lastCharIndex = 0xffff; + } + } else { + firstCharIndex = 0; + lastCharIndex = 255; + } + const bbox = properties.bbox || [0, 0, 0, 0]; + const unitsPerEm = override.unitsPerEm || (properties.fontMatrix ? 1 / Math.max(...properties.fontMatrix.slice(0, 4).map(Math.abs)) : 1000); + const scale = properties.ascentScaled ? 1.0 : unitsPerEm / PDF_GLYPH_SPACE_UNITS; + const typoAscent = override.ascent || Math.round(scale * (properties.ascent || bbox[3])); + let typoDescent = override.descent || Math.round(scale * (properties.descent || bbox[1])); + if (typoDescent > 0 && properties.descent > 0 && bbox[1] < 0) { + typoDescent = -typoDescent; + } + const winAscent = override.yMax || typoAscent; + const winDescent = -override.yMin || -typoDescent; + return "\x00\x03" + "\x02\x24" + "\x01\xF4" + "\x00\x05" + "\x00\x00" + "\x02\x8A" + "\x02\xBB" + "\x00\x00" + "\x00\x8C" + "\x02\x8A" + "\x02\xBB" + "\x00\x00" + "\x01\xDF" + "\x00\x31" + "\x01\x02" + "\x00\x00" + "\x00\x00\x06" + String.fromCharCode(properties.fixedPitch ? 0x09 : 0x00) + "\x00\x00\x00\x00\x00\x00" + string32(ulUnicodeRange1) + string32(ulUnicodeRange2) + string32(ulUnicodeRange3) + string32(ulUnicodeRange4) + "\x2A\x32\x31\x2A" + string16(properties.italicAngle ? 1 : 0) + string16(firstCharIndex || properties.firstChar) + string16(lastCharIndex || properties.lastChar) + string16(typoAscent) + string16(typoDescent) + "\x00\x64" + string16(winAscent) + string16(winDescent) + "\x00\x00\x00\x00" + "\x00\x00\x00\x00" + string16(properties.xHeight) + string16(properties.capHeight) + string16(0) + string16(firstCharIndex || properties.firstChar) + "\x00\x03"; +} +function createPostTable(properties) { + const angle = Math.floor(properties.italicAngle * 2 ** 16); + return "\x00\x03\x00\x00" + string32(angle) + "\x00\x00" + "\x00\x00" + string32(properties.fixedPitch ? 1 : 0) + "\x00\x00\x00\x00" + "\x00\x00\x00\x00" + "\x00\x00\x00\x00" + "\x00\x00\x00\x00"; +} +function createPostscriptName(name) { + return name.replaceAll(/[^\x21-\x7E]|[[\](){}<>/%]/g, "").slice(0, 63); +} +function createNameTable(name, proto) { + if (!proto) { + proto = [[], []]; + } + const strings = [proto[0][0] || "Original licence", proto[0][1] || name, proto[0][2] || "Unknown", proto[0][3] || "uniqueID", proto[0][4] || name, proto[0][5] || "Version 0.11", proto[0][6] || createPostscriptName(name), proto[0][7] || "Unknown", proto[0][8] || "Unknown", proto[0][9] || "Unknown"]; + const stringsUnicode = []; + let i, ii, j, jj, str; + for (i = 0, ii = strings.length; i < ii; i++) { + str = proto[1][i] || strings[i]; + const strBufUnicode = []; + for (j = 0, jj = str.length; j < jj; j++) { + strBufUnicode.push(string16(str.charCodeAt(j))); + } + stringsUnicode.push(strBufUnicode.join("")); + } + const names = [strings, stringsUnicode]; + const platforms = ["\x00\x01", "\x00\x03"]; + const encodings = ["\x00\x00", "\x00\x01"]; + const languages = ["\x00\x00", "\x04\x09"]; + const namesRecordCount = strings.length * platforms.length; + let nameTable = "\x00\x00" + string16(namesRecordCount) + string16(namesRecordCount * 12 + 6); + let strOffset = 0; + for (i = 0, ii = platforms.length; i < ii; i++) { + const strs = names[i]; + for (j = 0, jj = strs.length; j < jj; j++) { + str = strs[j]; + const nameRecord = platforms[i] + encodings[i] + languages[i] + string16(j) + string16(str.length) + string16(strOffset); + nameTable += nameRecord; + strOffset += str.length; + } + } + nameTable += strings.join("") + stringsUnicode.join(""); + return nameTable; +} +class Font { + constructor(name, file, properties) { + this.name = name; + this.psName = null; + this.mimetype = null; + this.disableFontFace = false; + this.loadedName = properties.loadedName; + this.isType3Font = properties.isType3Font; + this.missingFile = false; + this.cssFontInfo = properties.cssFontInfo; + this._charsCache = Object.create(null); + this._glyphCache = Object.create(null); + let isSerifFont = !!(properties.flags & FontFlags.Serif); + if (!isSerifFont && !properties.isSimulatedFlags) { + const baseName = name.replaceAll(/[,_]/g, "-").split("-", 1)[0], + serifFonts = getSerifFonts(); + for (const namePart of baseName.split("+")) { + if (serifFonts[namePart]) { + isSerifFont = true; + break; + } + } + } + this.isSerifFont = isSerifFont; + this.isSymbolicFont = !!(properties.flags & FontFlags.Symbolic); + this.isMonospace = !!(properties.flags & FontFlags.FixedPitch); + let { + type, + subtype + } = properties; + this.type = type; + this.subtype = subtype; + this.systemFontInfo = properties.systemFontInfo; + const matches = name.match(/^InvalidPDFjsFont_(.*)_\d+$/); + this.isInvalidPDFjsFont = !!matches; + if (this.isInvalidPDFjsFont) { + this.fallbackName = matches[1]; + } else if (this.isMonospace) { + this.fallbackName = "monospace"; + } else if (this.isSerifFont) { + this.fallbackName = "serif"; + } else { + this.fallbackName = "sans-serif"; + } + if (this.systemFontInfo?.guessFallback) { + this.systemFontInfo.guessFallback = false; + this.systemFontInfo.css += `,${this.fallbackName}`; + } + this.differences = properties.differences; + this.widths = properties.widths; + this.defaultWidth = properties.defaultWidth; + this.composite = properties.composite; + this.cMap = properties.cMap; + this.capHeight = properties.capHeight / PDF_GLYPH_SPACE_UNITS; + this.ascent = properties.ascent / PDF_GLYPH_SPACE_UNITS; + this.descent = properties.descent / PDF_GLYPH_SPACE_UNITS; + this.lineHeight = this.ascent - this.descent; + this.fontMatrix = properties.fontMatrix; + this.bbox = properties.bbox; + this.defaultEncoding = properties.defaultEncoding; + this.toUnicode = properties.toUnicode; + this.toFontChar = []; + if (properties.type === "Type3") { + for (let charCode = 0; charCode < 256; charCode++) { + this.toFontChar[charCode] = this.differences[charCode] || properties.defaultEncoding[charCode]; + } + return; + } + this.cidEncoding = properties.cidEncoding || ""; + this.vertical = !!properties.vertical; + if (this.vertical) { + this.vmetrics = properties.vmetrics; + this.defaultVMetrics = properties.defaultVMetrics; + } + if (!file || file.isEmpty) { + if (file) { + warn('Font file is empty in "' + name + '" (' + this.loadedName + ")"); + } + this.fallbackToSystemFont(properties); + return; + } + [type, subtype] = getFontFileType(file, properties); + if (type !== this.type || subtype !== this.subtype) { + info("Inconsistent font file Type/SubType, expected: " + `${this.type}/${this.subtype} but found: ${type}/${subtype}.`); + } + let data; + try { + switch (type) { + case "MMType1": + info("MMType1 font (" + name + "), falling back to Type1."); + case "Type1": + case "CIDFontType0": + this.mimetype = "font/opentype"; + const cff = subtype === "Type1C" || subtype === "CIDFontType0C" ? new CFFFont(file, properties) : new Type1Font(name, file, properties); + adjustWidths(properties); + data = this.convert(name, cff, properties); + break; + case "OpenType": + case "TrueType": + case "CIDFontType2": + this.mimetype = "font/opentype"; + data = this.checkAndRepair(name, file, properties); + if (this.isOpenType) { + adjustWidths(properties); + type = "OpenType"; + } + break; + default: + throw new FormatError(`Font ${type} is not supported`); + } + } catch (e) { + warn(e); + this.fallbackToSystemFont(properties); + return; + } + amendFallbackToUnicode(properties); + this.data = data; + this.type = type; + this.subtype = subtype; + this.fontMatrix = properties.fontMatrix; + this.widths = properties.widths; + this.defaultWidth = properties.defaultWidth; + this.toUnicode = properties.toUnicode; + this.seacMap = properties.seacMap; + } + get renderer() { + const renderer = FontRendererFactory.create(this, SEAC_ANALYSIS_ENABLED); + return shadow(this, "renderer", renderer); + } + exportData(extraProperties = false) { + const exportDataProperties = extraProperties ? [...EXPORT_DATA_PROPERTIES, ...EXPORT_DATA_EXTRA_PROPERTIES] : EXPORT_DATA_PROPERTIES; + const data = Object.create(null); + let property, value; + for (property of exportDataProperties) { + value = this[property]; + if (value !== undefined) { + data[property] = value; + } + } + return data; + } + fallbackToSystemFont(properties) { + this.missingFile = true; + const { + name, + type + } = this; + let fontName = normalizeFontName(name); + const stdFontMap = getStdFontMap(), + nonStdFontMap = getNonStdFontMap(); + const isStandardFont = !!stdFontMap[fontName]; + const isMappedToStandardFont = !!(nonStdFontMap[fontName] && stdFontMap[nonStdFontMap[fontName]]); + fontName = stdFontMap[fontName] || nonStdFontMap[fontName] || fontName; + const fontBasicMetricsMap = getFontBasicMetrics(); + const metrics = fontBasicMetricsMap[fontName]; + if (metrics) { + if (isNaN(this.ascent)) { + this.ascent = metrics.ascent / PDF_GLYPH_SPACE_UNITS; + } + if (isNaN(this.descent)) { + this.descent = metrics.descent / PDF_GLYPH_SPACE_UNITS; + } + if (isNaN(this.capHeight)) { + this.capHeight = metrics.capHeight / PDF_GLYPH_SPACE_UNITS; + } + } + this.bold = /bold/gi.test(fontName); + this.italic = /oblique|italic/gi.test(fontName); + this.black = /Black/g.test(name); + const isNarrow = /Narrow/g.test(name); + this.remeasure = (!isStandardFont || isNarrow) && Object.keys(this.widths).length > 0; + if ((isStandardFont || isMappedToStandardFont) && type === "CIDFontType2" && this.cidEncoding.startsWith("Identity-")) { + const cidToGidMap = properties.cidToGidMap; + const map = []; + applyStandardFontGlyphMap(map, getGlyphMapForStandardFonts()); + if (/Arial-?Black/i.test(name)) { + applyStandardFontGlyphMap(map, getSupplementalGlyphMapForArialBlack()); + } else if (/Calibri/i.test(name)) { + applyStandardFontGlyphMap(map, getSupplementalGlyphMapForCalibri()); + } + if (cidToGidMap) { + for (const charCode in map) { + const cid = map[charCode]; + if (cidToGidMap[cid] !== undefined) { + map[+charCode] = cidToGidMap[cid]; + } + } + if (cidToGidMap.length !== this.toUnicode.length && properties.hasIncludedToUnicodeMap && this.toUnicode instanceof IdentityToUnicodeMap) { + this.toUnicode.forEach(function (charCode, unicodeCharCode) { + const cid = map[charCode]; + if (cidToGidMap[cid] === undefined) { + map[+charCode] = unicodeCharCode; + } + }); + } + } + if (!(this.toUnicode instanceof IdentityToUnicodeMap)) { + this.toUnicode.forEach(function (charCode, unicodeCharCode) { + map[+charCode] = unicodeCharCode; + }); + } + this.toFontChar = map; + this.toUnicode = new ToUnicodeMap(map); + } else if (/Symbol/i.test(fontName)) { + this.toFontChar = buildToFontChar(SymbolSetEncoding, getGlyphsUnicode(), this.differences); + } else if (/Dingbats/i.test(fontName)) { + this.toFontChar = buildToFontChar(ZapfDingbatsEncoding, getDingbatsGlyphsUnicode(), this.differences); + } else if (isStandardFont || isMappedToStandardFont) { + const map = buildToFontChar(this.defaultEncoding, getGlyphsUnicode(), this.differences); + if (type === "CIDFontType2" && !this.cidEncoding.startsWith("Identity-") && !(this.toUnicode instanceof IdentityToUnicodeMap)) { + this.toUnicode.forEach(function (charCode, unicodeCharCode) { + map[+charCode] = unicodeCharCode; + }); + } + this.toFontChar = map; + } else { + const glyphsUnicodeMap = getGlyphsUnicode(); + const map = []; + this.toUnicode.forEach((charCode, unicodeCharCode) => { + if (!this.composite) { + const glyphName = this.differences[charCode] || this.defaultEncoding[charCode]; + const unicode = getUnicodeForGlyph(glyphName, glyphsUnicodeMap); + if (unicode !== -1) { + unicodeCharCode = unicode; + } + } + map[+charCode] = unicodeCharCode; + }); + if (this.composite && this.toUnicode instanceof IdentityToUnicodeMap) { + if (/Tahoma|Verdana/i.test(name)) { + applyStandardFontGlyphMap(map, getGlyphMapForStandardFonts()); + } + } + this.toFontChar = map; + } + amendFallbackToUnicode(properties); + this.loadedName = fontName.split("-", 1)[0]; + } + checkAndRepair(name, font, properties) { + const VALID_TABLES = ["OS/2", "cmap", "head", "hhea", "hmtx", "maxp", "name", "post", "loca", "glyf", "fpgm", "prep", "cvt ", "CFF "]; + function readTables(file, numTables) { + const tables = Object.create(null); + tables["OS/2"] = null; + tables.cmap = null; + tables.head = null; + tables.hhea = null; + tables.hmtx = null; + tables.maxp = null; + tables.name = null; + tables.post = null; + for (let i = 0; i < numTables; i++) { + const table = readTableEntry(file); + if (!VALID_TABLES.includes(table.tag)) { + continue; + } + if (table.length === 0) { + continue; + } + tables[table.tag] = table; + } + return tables; + } + function readTableEntry(file) { + const tag = file.getString(4); + const checksum = file.getInt32() >>> 0; + const offset = file.getInt32() >>> 0; + const length = file.getInt32() >>> 0; + const previousPosition = file.pos; + file.pos = file.start || 0; + file.skip(offset); + const data = file.getBytes(length); + file.pos = previousPosition; + if (tag === "head") { + data[8] = data[9] = data[10] = data[11] = 0; + data[17] |= 0x20; + } + return { + tag, + checksum, + length, + offset, + data + }; + } + function readOpenTypeHeader(ttf) { + return { + version: ttf.getString(4), + numTables: ttf.getUint16(), + searchRange: ttf.getUint16(), + entrySelector: ttf.getUint16(), + rangeShift: ttf.getUint16() + }; + } + function readTrueTypeCollectionHeader(ttc) { + const ttcTag = ttc.getString(4); + assert(ttcTag === "ttcf", "Must be a TrueType Collection font."); + const majorVersion = ttc.getUint16(); + const minorVersion = ttc.getUint16(); + const numFonts = ttc.getInt32() >>> 0; + const offsetTable = []; + for (let i = 0; i < numFonts; i++) { + offsetTable.push(ttc.getInt32() >>> 0); + } + const header = { + ttcTag, + majorVersion, + minorVersion, + numFonts, + offsetTable + }; + switch (majorVersion) { + case 1: + return header; + case 2: + header.dsigTag = ttc.getInt32() >>> 0; + header.dsigLength = ttc.getInt32() >>> 0; + header.dsigOffset = ttc.getInt32() >>> 0; + return header; + } + throw new FormatError(`Invalid TrueType Collection majorVersion: ${majorVersion}.`); + } + function readTrueTypeCollectionData(ttc, fontName) { + const { + numFonts, + offsetTable + } = readTrueTypeCollectionHeader(ttc); + const fontNameParts = fontName.split("+"); + let fallbackData; + for (let i = 0; i < numFonts; i++) { + ttc.pos = (ttc.start || 0) + offsetTable[i]; + const potentialHeader = readOpenTypeHeader(ttc); + const potentialTables = readTables(ttc, potentialHeader.numTables); + if (!potentialTables.name) { + throw new FormatError('TrueType Collection font must contain a "name" table.'); + } + const [nameTable] = readNameTable(potentialTables.name); + for (let j = 0, jj = nameTable.length; j < jj; j++) { + for (let k = 0, kk = nameTable[j].length; k < kk; k++) { + const nameEntry = nameTable[j][k]?.replaceAll(/\s/g, ""); + if (!nameEntry) { + continue; + } + if (nameEntry === fontName) { + return { + header: potentialHeader, + tables: potentialTables + }; + } + if (fontNameParts.length < 2) { + continue; + } + for (const part of fontNameParts) { + if (nameEntry === part) { + fallbackData = { + name: part, + header: potentialHeader, + tables: potentialTables + }; + } + } + } + } + } + if (fallbackData) { + warn(`TrueType Collection does not contain "${fontName}" font, ` + `falling back to "${fallbackData.name}" font instead.`); + return { + header: fallbackData.header, + tables: fallbackData.tables + }; + } + throw new FormatError(`TrueType Collection does not contain "${fontName}" font.`); + } + function readCmapTable(cmap, file, isSymbolicFont, hasEncoding) { + if (!cmap) { + warn("No cmap table available."); + return { + platformId: -1, + encodingId: -1, + mappings: [], + hasShortCmap: false + }; + } + let segment; + let start = (file.start || 0) + cmap.offset; + file.pos = start; + file.skip(2); + const numTables = file.getUint16(); + let potentialTable; + let canBreak = false; + for (let i = 0; i < numTables; i++) { + const platformId = file.getUint16(); + const encodingId = file.getUint16(); + const offset = file.getInt32() >>> 0; + let useTable = false; + if (potentialTable?.platformId === platformId && potentialTable?.encodingId === encodingId) { + continue; + } + if (platformId === 0 && (encodingId === 0 || encodingId === 1 || encodingId === 3)) { + useTable = true; + } else if (platformId === 1 && encodingId === 0) { + useTable = true; + } else if (platformId === 3 && encodingId === 1 && (hasEncoding || !potentialTable)) { + useTable = true; + if (!isSymbolicFont) { + canBreak = true; + } + } else if (isSymbolicFont && platformId === 3 && encodingId === 0) { + useTable = true; + let correctlySorted = true; + if (i < numTables - 1) { + const nextBytes = file.peekBytes(2), + nextPlatformId = int16(nextBytes[0], nextBytes[1]); + if (nextPlatformId < platformId) { + correctlySorted = false; + } + } + if (correctlySorted) { + canBreak = true; + } + } + if (useTable) { + potentialTable = { + platformId, + encodingId, + offset + }; + } + if (canBreak) { + break; + } + } + if (potentialTable) { + file.pos = start + potentialTable.offset; + } + if (!potentialTable || file.peekByte() === -1) { + warn("Could not find a preferred cmap table."); + return { + platformId: -1, + encodingId: -1, + mappings: [], + hasShortCmap: false + }; + } + const format = file.getUint16(); + let hasShortCmap = false; + const mappings = []; + let j, glyphId; + if (format === 0) { + file.skip(2 + 2); + for (j = 0; j < 256; j++) { + const index = file.getByte(); + if (!index) { + continue; + } + mappings.push({ + charCode: j, + glyphId: index + }); + } + hasShortCmap = true; + } else if (format === 2) { + file.skip(2 + 2); + const subHeaderKeys = []; + let maxSubHeaderKey = 0; + for (let i = 0; i < 256; i++) { + const subHeaderKey = file.getUint16() >> 3; + subHeaderKeys.push(subHeaderKey); + maxSubHeaderKey = Math.max(subHeaderKey, maxSubHeaderKey); + } + const subHeaders = []; + for (let i = 0; i <= maxSubHeaderKey; i++) { + subHeaders.push({ + firstCode: file.getUint16(), + entryCount: file.getUint16(), + idDelta: signedInt16(file.getByte(), file.getByte()), + idRangePos: file.pos + file.getUint16() + }); + } + for (let i = 0; i < 256; i++) { + if (subHeaderKeys[i] === 0) { + file.pos = subHeaders[0].idRangePos + 2 * i; + glyphId = file.getUint16(); + mappings.push({ + charCode: i, + glyphId + }); + } else { + const s = subHeaders[subHeaderKeys[i]]; + for (j = 0; j < s.entryCount; j++) { + const charCode = (i << 8) + j + s.firstCode; + file.pos = s.idRangePos + 2 * j; + glyphId = file.getUint16(); + if (glyphId !== 0) { + glyphId = (glyphId + s.idDelta) % 65536; + } + mappings.push({ + charCode, + glyphId + }); + } + } + } + } else if (format === 4) { + file.skip(2 + 2); + const segCount = file.getUint16() >> 1; + file.skip(6); + const segments = []; + let segIndex; + for (segIndex = 0; segIndex < segCount; segIndex++) { + segments.push({ + end: file.getUint16() + }); + } + file.skip(2); + for (segIndex = 0; segIndex < segCount; segIndex++) { + segments[segIndex].start = file.getUint16(); + } + for (segIndex = 0; segIndex < segCount; segIndex++) { + segments[segIndex].delta = file.getUint16(); + } + let offsetsCount = 0, + offsetIndex; + for (segIndex = 0; segIndex < segCount; segIndex++) { + segment = segments[segIndex]; + const rangeOffset = file.getUint16(); + if (!rangeOffset) { + segment.offsetIndex = -1; + continue; + } + offsetIndex = (rangeOffset >> 1) - (segCount - segIndex); + segment.offsetIndex = offsetIndex; + offsetsCount = Math.max(offsetsCount, offsetIndex + segment.end - segment.start + 1); + } + const offsets = []; + for (j = 0; j < offsetsCount; j++) { + offsets.push(file.getUint16()); + } + for (segIndex = 0; segIndex < segCount; segIndex++) { + segment = segments[segIndex]; + start = segment.start; + const end = segment.end; + const delta = segment.delta; + offsetIndex = segment.offsetIndex; + for (j = start; j <= end; j++) { + if (j === 0xffff) { + continue; + } + glyphId = offsetIndex < 0 ? j : offsets[offsetIndex + j - start]; + glyphId = glyphId + delta & 0xffff; + mappings.push({ + charCode: j, + glyphId + }); + } + } + } else if (format === 6) { + file.skip(2 + 2); + const firstCode = file.getUint16(); + const entryCount = file.getUint16(); + for (j = 0; j < entryCount; j++) { + glyphId = file.getUint16(); + const charCode = firstCode + j; + mappings.push({ + charCode, + glyphId + }); + } + } else if (format === 12) { + file.skip(2 + 4 + 4); + const nGroups = file.getInt32() >>> 0; + for (j = 0; j < nGroups; j++) { + const startCharCode = file.getInt32() >>> 0; + const endCharCode = file.getInt32() >>> 0; + let glyphCode = file.getInt32() >>> 0; + for (let charCode = startCharCode; charCode <= endCharCode; charCode++) { + mappings.push({ + charCode, + glyphId: glyphCode++ + }); + } + } + } else { + warn("cmap table has unsupported format: " + format); + return { + platformId: -1, + encodingId: -1, + mappings: [], + hasShortCmap: false + }; + } + mappings.sort(function (a, b) { + return a.charCode - b.charCode; + }); + for (let i = 1; i < mappings.length; i++) { + if (mappings[i - 1].charCode === mappings[i].charCode) { + mappings.splice(i, 1); + i--; + } + } + return { + platformId: potentialTable.platformId, + encodingId: potentialTable.encodingId, + mappings, + hasShortCmap + }; + } + function sanitizeMetrics(file, header, metrics, headTable, numGlyphs, dupFirstEntry) { + if (!header) { + if (metrics) { + metrics.data = null; + } + return; + } + file.pos = (file.start || 0) + header.offset; + file.pos += 4; + file.pos += 2; + file.pos += 2; + file.pos += 2; + file.pos += 2; + file.pos += 2; + file.pos += 2; + file.pos += 2; + file.pos += 2; + file.pos += 2; + const caretOffset = file.getUint16(); + file.pos += 8; + file.pos += 2; + let numOfMetrics = file.getUint16(); + if (caretOffset !== 0) { + const macStyle = int16(headTable.data[44], headTable.data[45]); + if (!(macStyle & 2)) { + header.data[22] = 0; + header.data[23] = 0; + } + } + if (numOfMetrics > numGlyphs) { + info(`The numOfMetrics (${numOfMetrics}) should not be ` + `greater than the numGlyphs (${numGlyphs}).`); + numOfMetrics = numGlyphs; + header.data[34] = (numOfMetrics & 0xff00) >> 8; + header.data[35] = numOfMetrics & 0x00ff; + } + const numOfSidebearings = numGlyphs - numOfMetrics; + const numMissing = numOfSidebearings - (metrics.length - numOfMetrics * 4 >> 1); + if (numMissing > 0) { + const entries = new Uint8Array(metrics.length + numMissing * 2); + entries.set(metrics.data); + if (dupFirstEntry) { + entries[metrics.length] = metrics.data[2]; + entries[metrics.length + 1] = metrics.data[3]; + } + metrics.data = entries; + } + } + function sanitizeGlyph(source, sourceStart, sourceEnd, dest, destStart, hintsValid) { + const glyphProfile = { + length: 0, + sizeOfInstructions: 0 + }; + if (sourceStart < 0 || sourceStart >= source.length || sourceEnd > source.length || sourceEnd - sourceStart <= 12) { + return glyphProfile; + } + const glyf = source.subarray(sourceStart, sourceEnd); + const xMin = signedInt16(glyf[2], glyf[3]); + const yMin = signedInt16(glyf[4], glyf[5]); + const xMax = signedInt16(glyf[6], glyf[7]); + const yMax = signedInt16(glyf[8], glyf[9]); + if (xMin > xMax) { + writeSignedInt16(glyf, 2, xMax); + writeSignedInt16(glyf, 6, xMin); + } + if (yMin > yMax) { + writeSignedInt16(glyf, 4, yMax); + writeSignedInt16(glyf, 8, yMin); + } + const contoursCount = signedInt16(glyf[0], glyf[1]); + if (contoursCount < 0) { + if (contoursCount < -1) { + return glyphProfile; + } + dest.set(glyf, destStart); + glyphProfile.length = glyf.length; + return glyphProfile; + } + let i, + j = 10, + flagsCount = 0; + for (i = 0; i < contoursCount; i++) { + const endPoint = glyf[j] << 8 | glyf[j + 1]; + flagsCount = endPoint + 1; + j += 2; + } + const instructionsStart = j; + const instructionsLength = glyf[j] << 8 | glyf[j + 1]; + glyphProfile.sizeOfInstructions = instructionsLength; + j += 2 + instructionsLength; + const instructionsEnd = j; + let coordinatesLength = 0; + for (i = 0; i < flagsCount; i++) { + const flag = glyf[j++]; + if (flag & 0xc0) { + glyf[j - 1] = flag & 0x3f; + } + let xLength = 2; + if (flag & 2) { + xLength = 1; + } else if (flag & 16) { + xLength = 0; + } + let yLength = 2; + if (flag & 4) { + yLength = 1; + } else if (flag & 32) { + yLength = 0; + } + const xyLength = xLength + yLength; + coordinatesLength += xyLength; + if (flag & 8) { + const repeat = glyf[j++]; + if (repeat === 0) { + glyf[j - 1] ^= 8; + } + i += repeat; + coordinatesLength += repeat * xyLength; + } + } + if (coordinatesLength === 0) { + return glyphProfile; + } + let glyphDataLength = j + coordinatesLength; + if (glyphDataLength > glyf.length) { + return glyphProfile; + } + if (!hintsValid && instructionsLength > 0) { + dest.set(glyf.subarray(0, instructionsStart), destStart); + dest.set([0, 0], destStart + instructionsStart); + dest.set(glyf.subarray(instructionsEnd, glyphDataLength), destStart + instructionsStart + 2); + glyphDataLength -= instructionsLength; + if (glyf.length - glyphDataLength > 3) { + glyphDataLength = glyphDataLength + 3 & ~3; + } + glyphProfile.length = glyphDataLength; + return glyphProfile; + } + if (glyf.length - glyphDataLength > 3) { + glyphDataLength = glyphDataLength + 3 & ~3; + dest.set(glyf.subarray(0, glyphDataLength), destStart); + glyphProfile.length = glyphDataLength; + return glyphProfile; + } + dest.set(glyf, destStart); + glyphProfile.length = glyf.length; + return glyphProfile; + } + function sanitizeHead(head, numGlyphs, locaLength) { + const data = head.data; + const version = int32(data[0], data[1], data[2], data[3]); + if (version >> 16 !== 1) { + info("Attempting to fix invalid version in head table: " + version); + data[0] = 0; + data[1] = 1; + data[2] = 0; + data[3] = 0; + } + const indexToLocFormat = int16(data[50], data[51]); + if (indexToLocFormat < 0 || indexToLocFormat > 1) { + info("Attempting to fix invalid indexToLocFormat in head table: " + indexToLocFormat); + const numGlyphsPlusOne = numGlyphs + 1; + if (locaLength === numGlyphsPlusOne << 1) { + data[50] = 0; + data[51] = 0; + } else if (locaLength === numGlyphsPlusOne << 2) { + data[50] = 0; + data[51] = 1; + } else { + throw new FormatError("Could not fix indexToLocFormat: " + indexToLocFormat); + } + } + } + function sanitizeGlyphLocations(loca, glyf, numGlyphs, isGlyphLocationsLong, hintsValid, dupFirstEntry, maxSizeOfInstructions) { + let itemSize, itemDecode, itemEncode; + if (isGlyphLocationsLong) { + itemSize = 4; + itemDecode = function fontItemDecodeLong(data, offset) { + return data[offset] << 24 | data[offset + 1] << 16 | data[offset + 2] << 8 | data[offset + 3]; + }; + itemEncode = function fontItemEncodeLong(data, offset, value) { + data[offset] = value >>> 24 & 0xff; + data[offset + 1] = value >> 16 & 0xff; + data[offset + 2] = value >> 8 & 0xff; + data[offset + 3] = value & 0xff; + }; + } else { + itemSize = 2; + itemDecode = function fontItemDecode(data, offset) { + return data[offset] << 9 | data[offset + 1] << 1; + }; + itemEncode = function fontItemEncode(data, offset, value) { + data[offset] = value >> 9 & 0xff; + data[offset + 1] = value >> 1 & 0xff; + }; + } + const numGlyphsOut = dupFirstEntry ? numGlyphs + 1 : numGlyphs; + const locaDataSize = itemSize * (1 + numGlyphsOut); + const locaData = new Uint8Array(locaDataSize); + locaData.set(loca.data.subarray(0, locaDataSize)); + loca.data = locaData; + const oldGlyfData = glyf.data; + const oldGlyfDataLength = oldGlyfData.length; + const newGlyfData = new Uint8Array(oldGlyfDataLength); + let i, j; + const locaEntries = []; + for (i = 0, j = 0; i < numGlyphs + 1; i++, j += itemSize) { + let offset = itemDecode(locaData, j); + if (offset > oldGlyfDataLength) { + offset = oldGlyfDataLength; + } + locaEntries.push({ + index: i, + offset, + endOffset: 0 + }); + } + locaEntries.sort((a, b) => a.offset - b.offset); + for (i = 0; i < numGlyphs; i++) { + locaEntries[i].endOffset = locaEntries[i + 1].offset; + } + locaEntries.sort((a, b) => a.index - b.index); + for (i = 0; i < numGlyphs; i++) { + const { + offset, + endOffset + } = locaEntries[i]; + if (offset !== 0 || endOffset !== 0) { + break; + } + const nextOffset = locaEntries[i + 1].offset; + if (nextOffset === 0) { + continue; + } + locaEntries[i].endOffset = nextOffset; + break; + } + const last = locaEntries.at(-2); + if (last.offset !== 0 && last.endOffset === 0) { + last.endOffset = oldGlyfDataLength; + } + const missingGlyphs = Object.create(null); + let writeOffset = 0; + itemEncode(locaData, 0, writeOffset); + for (i = 0, j = itemSize; i < numGlyphs; i++, j += itemSize) { + const glyphProfile = sanitizeGlyph(oldGlyfData, locaEntries[i].offset, locaEntries[i].endOffset, newGlyfData, writeOffset, hintsValid); + const newLength = glyphProfile.length; + if (newLength === 0) { + missingGlyphs[i] = true; + } + if (glyphProfile.sizeOfInstructions > maxSizeOfInstructions) { + maxSizeOfInstructions = glyphProfile.sizeOfInstructions; + } + writeOffset += newLength; + itemEncode(locaData, j, writeOffset); + } + if (writeOffset === 0) { + const simpleGlyph = new Uint8Array([0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 0]); + for (i = 0, j = itemSize; i < numGlyphsOut; i++, j += itemSize) { + itemEncode(locaData, j, simpleGlyph.length); + } + glyf.data = simpleGlyph; + } else if (dupFirstEntry) { + const firstEntryLength = itemDecode(locaData, itemSize); + if (newGlyfData.length > firstEntryLength + writeOffset) { + glyf.data = newGlyfData.subarray(0, firstEntryLength + writeOffset); + } else { + glyf.data = new Uint8Array(firstEntryLength + writeOffset); + glyf.data.set(newGlyfData.subarray(0, writeOffset)); + } + glyf.data.set(newGlyfData.subarray(0, firstEntryLength), writeOffset); + itemEncode(loca.data, locaData.length - itemSize, writeOffset + firstEntryLength); + } else { + glyf.data = newGlyfData.subarray(0, writeOffset); + } + return { + missingGlyphs, + maxSizeOfInstructions + }; + } + function readPostScriptTable(post, propertiesObj, maxpNumGlyphs) { + const start = (font.start || 0) + post.offset; + font.pos = start; + const length = post.length, + end = start + length; + const version = font.getInt32(); + font.skip(28); + let glyphNames; + let valid = true; + let i; + switch (version) { + case 0x00010000: + glyphNames = MacStandardGlyphOrdering; + break; + case 0x00020000: + const numGlyphs = font.getUint16(); + if (numGlyphs !== maxpNumGlyphs) { + valid = false; + break; + } + const glyphNameIndexes = []; + for (i = 0; i < numGlyphs; ++i) { + const index = font.getUint16(); + if (index >= 32768) { + valid = false; + break; + } + glyphNameIndexes.push(index); + } + if (!valid) { + break; + } + const customNames = [], + strBuf = []; + while (font.pos < end) { + const stringLength = font.getByte(); + strBuf.length = stringLength; + for (i = 0; i < stringLength; ++i) { + strBuf[i] = String.fromCharCode(font.getByte()); + } + customNames.push(strBuf.join("")); + } + glyphNames = []; + for (i = 0; i < numGlyphs; ++i) { + const j = glyphNameIndexes[i]; + if (j < 258) { + glyphNames.push(MacStandardGlyphOrdering[j]); + continue; + } + glyphNames.push(customNames[j - 258]); + } + break; + case 0x00030000: + break; + default: + warn("Unknown/unsupported post table version " + version); + valid = false; + if (propertiesObj.defaultEncoding) { + glyphNames = propertiesObj.defaultEncoding; + } + break; + } + propertiesObj.glyphNames = glyphNames; + return valid; + } + function readNameTable(nameTable) { + const start = (font.start || 0) + nameTable.offset; + font.pos = start; + const names = [[], []], + records = []; + const length = nameTable.length, + end = start + length; + const format = font.getUint16(); + const FORMAT_0_HEADER_LENGTH = 6; + if (format !== 0 || length < FORMAT_0_HEADER_LENGTH) { + return [names, records]; + } + const numRecords = font.getUint16(); + const stringsStart = font.getUint16(); + const NAME_RECORD_LENGTH = 12; + let i, ii; + for (i = 0; i < numRecords && font.pos + NAME_RECORD_LENGTH <= end; i++) { + const r = { + platform: font.getUint16(), + encoding: font.getUint16(), + language: font.getUint16(), + name: font.getUint16(), + length: font.getUint16(), + offset: font.getUint16() + }; + if (isMacNameRecord(r) || isWinNameRecord(r)) { + records.push(r); + } + } + for (i = 0, ii = records.length; i < ii; i++) { + const record = records[i]; + if (record.length <= 0) { + continue; + } + const pos = start + stringsStart + record.offset; + if (pos + record.length > end) { + continue; + } + font.pos = pos; + const nameIndex = record.name; + if (record.encoding) { + let str = ""; + for (let j = 0, jj = record.length; j < jj; j += 2) { + str += String.fromCharCode(font.getUint16()); + } + names[1][nameIndex] = str; + } else { + names[0][nameIndex] = font.getString(record.length); + } + } + return [names, records]; + } + const TTOpsStackDeltas = [0, 0, 0, 0, 0, 0, 0, 0, -2, -2, -2, -2, 0, 0, -2, -5, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, 0, -1, -1, -1, -1, 1, -1, -999, 0, 1, 0, -1, -2, 0, -1, -2, -1, -1, 0, -1, -1, 0, 0, -999, -999, -1, -1, -1, -1, -2, -999, -2, -2, -999, 0, -2, -2, 0, 0, -2, 0, -2, 0, 0, 0, -2, -1, -1, 1, 1, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, 0, -1, -1, 0, -999, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, -999, -999, -999, -999, -999, -1, -1, -2, -2, 0, 0, 0, 0, -1, -1, -999, -2, -2, 0, 0, -1, -2, -2, 0, 0, 0, -1, -1, -1, -2]; + function sanitizeTTProgram(table, ttContext) { + let data = table.data; + let i = 0, + j, + n, + b, + funcId, + pc, + lastEndf = 0, + lastDeff = 0; + const stack = []; + const callstack = []; + const functionsCalled = []; + let tooComplexToFollowFunctions = ttContext.tooComplexToFollowFunctions; + let inFDEF = false, + ifLevel = 0, + inELSE = 0; + for (let ii = data.length; i < ii;) { + const op = data[i++]; + if (op === 0x40) { + n = data[i++]; + if (inFDEF || inELSE) { + i += n; + } else { + for (j = 0; j < n; j++) { + stack.push(data[i++]); + } + } + } else if (op === 0x41) { + n = data[i++]; + if (inFDEF || inELSE) { + i += n * 2; + } else { + for (j = 0; j < n; j++) { + b = data[i++]; + stack.push(b << 8 | data[i++]); + } + } + } else if ((op & 0xf8) === 0xb0) { + n = op - 0xb0 + 1; + if (inFDEF || inELSE) { + i += n; + } else { + for (j = 0; j < n; j++) { + stack.push(data[i++]); + } + } + } else if ((op & 0xf8) === 0xb8) { + n = op - 0xb8 + 1; + if (inFDEF || inELSE) { + i += n * 2; + } else { + for (j = 0; j < n; j++) { + b = data[i++]; + stack.push(signedInt16(b, data[i++])); + } + } + } else if (op === 0x2b && !tooComplexToFollowFunctions) { + if (!inFDEF && !inELSE) { + funcId = stack.at(-1); + if (isNaN(funcId)) { + info("TT: CALL empty stack (or invalid entry)."); + } else { + ttContext.functionsUsed[funcId] = true; + if (funcId in ttContext.functionsStackDeltas) { + const newStackLength = stack.length + ttContext.functionsStackDeltas[funcId]; + if (newStackLength < 0) { + warn("TT: CALL invalid functions stack delta."); + ttContext.hintsValid = false; + return; + } + stack.length = newStackLength; + } else if (funcId in ttContext.functionsDefined && !functionsCalled.includes(funcId)) { + callstack.push({ + data, + i, + stackTop: stack.length - 1 + }); + functionsCalled.push(funcId); + pc = ttContext.functionsDefined[funcId]; + if (!pc) { + warn("TT: CALL non-existent function"); + ttContext.hintsValid = false; + return; + } + data = pc.data; + i = pc.i; + } + } + } + } else if (op === 0x2c && !tooComplexToFollowFunctions) { + if (inFDEF || inELSE) { + warn("TT: nested FDEFs not allowed"); + tooComplexToFollowFunctions = true; + } + inFDEF = true; + lastDeff = i; + funcId = stack.pop(); + ttContext.functionsDefined[funcId] = { + data, + i + }; + } else if (op === 0x2d) { + if (inFDEF) { + inFDEF = false; + lastEndf = i; + } else { + pc = callstack.pop(); + if (!pc) { + warn("TT: ENDF bad stack"); + ttContext.hintsValid = false; + return; + } + funcId = functionsCalled.pop(); + data = pc.data; + i = pc.i; + ttContext.functionsStackDeltas[funcId] = stack.length - pc.stackTop; + } + } else if (op === 0x89) { + if (inFDEF || inELSE) { + warn("TT: nested IDEFs not allowed"); + tooComplexToFollowFunctions = true; + } + inFDEF = true; + lastDeff = i; + } else if (op === 0x58) { + ++ifLevel; + } else if (op === 0x1b) { + inELSE = ifLevel; + } else if (op === 0x59) { + if (inELSE === ifLevel) { + inELSE = 0; + } + --ifLevel; + } else if (op === 0x1c) { + if (!inFDEF && !inELSE) { + const offset = stack.at(-1); + if (offset > 0) { + i += offset - 1; + } + } + } + if (!inFDEF && !inELSE) { + let stackDelta = 0; + if (op <= 0x8e) { + stackDelta = TTOpsStackDeltas[op]; + } else if (op >= 0xc0 && op <= 0xdf) { + stackDelta = -1; + } else if (op >= 0xe0) { + stackDelta = -2; + } + if (op >= 0x71 && op <= 0x75) { + n = stack.pop(); + if (!isNaN(n)) { + stackDelta = -n * 2; + } + } + while (stackDelta < 0 && stack.length > 0) { + stack.pop(); + stackDelta++; + } + while (stackDelta > 0) { + stack.push(NaN); + stackDelta--; + } + } + } + ttContext.tooComplexToFollowFunctions = tooComplexToFollowFunctions; + const content = [data]; + if (i > data.length) { + content.push(new Uint8Array(i - data.length)); + } + if (lastDeff > lastEndf) { + warn("TT: complementing a missing function tail"); + content.push(new Uint8Array([0x22, 0x2d])); + } + foldTTTable(table, content); + } + function checkInvalidFunctions(ttContext, maxFunctionDefs) { + if (ttContext.tooComplexToFollowFunctions) { + return; + } + if (ttContext.functionsDefined.length > maxFunctionDefs) { + warn("TT: more functions defined than expected"); + ttContext.hintsValid = false; + return; + } + for (let j = 0, jj = ttContext.functionsUsed.length; j < jj; j++) { + if (j > maxFunctionDefs) { + warn("TT: invalid function id: " + j); + ttContext.hintsValid = false; + return; + } + if (ttContext.functionsUsed[j] && !ttContext.functionsDefined[j]) { + warn("TT: undefined function: " + j); + ttContext.hintsValid = false; + return; + } + } + } + function foldTTTable(table, content) { + if (content.length > 1) { + let newLength = 0; + let j, jj; + for (j = 0, jj = content.length; j < jj; j++) { + newLength += content[j].length; + } + newLength = newLength + 3 & ~3; + const result = new Uint8Array(newLength); + let pos = 0; + for (j = 0, jj = content.length; j < jj; j++) { + result.set(content[j], pos); + pos += content[j].length; + } + table.data = result; + table.length = newLength; + } + } + function sanitizeTTPrograms(fpgm, prep, cvt, maxFunctionDefs) { + const ttContext = { + functionsDefined: [], + functionsUsed: [], + functionsStackDeltas: [], + tooComplexToFollowFunctions: false, + hintsValid: true + }; + if (fpgm) { + sanitizeTTProgram(fpgm, ttContext); + } + if (prep) { + sanitizeTTProgram(prep, ttContext); + } + if (fpgm) { + checkInvalidFunctions(ttContext, maxFunctionDefs); + } + if (cvt && cvt.length & 1) { + const cvtData = new Uint8Array(cvt.length + 1); + cvtData.set(cvt.data); + cvt.data = cvtData; + } + return ttContext.hintsValid; + } + font = new Stream(new Uint8Array(font.getBytes())); + let header, tables; + if (isTrueTypeCollectionFile(font)) { + const ttcData = readTrueTypeCollectionData(font, this.name); + header = ttcData.header; + tables = ttcData.tables; + } else { + header = readOpenTypeHeader(font); + tables = readTables(font, header.numTables); + } + let cff, cffFile; + const isTrueType = !tables["CFF "]; + if (!isTrueType) { + const isComposite = properties.composite && (properties.cidToGidMap?.length > 0 || !(properties.cMap instanceof IdentityCMap)); + if (header.version === "OTTO" && !isComposite || !tables.head || !tables.hhea || !tables.maxp || !tables.post) { + cffFile = new Stream(tables["CFF "].data); + cff = new CFFFont(cffFile, properties); + adjustWidths(properties); + return this.convert(name, cff, properties); + } + delete tables.glyf; + delete tables.loca; + delete tables.fpgm; + delete tables.prep; + delete tables["cvt "]; + this.isOpenType = true; + } else { + if (!tables.loca) { + throw new FormatError('Required "loca" table is not found'); + } + if (!tables.glyf) { + warn('Required "glyf" table is not found -- trying to recover.'); + tables.glyf = { + tag: "glyf", + data: new Uint8Array(0) + }; + } + this.isOpenType = false; + } + if (!tables.maxp) { + throw new FormatError('Required "maxp" table is not found'); + } + font.pos = (font.start || 0) + tables.maxp.offset; + let version = font.getInt32(); + const numGlyphs = font.getUint16(); + if (version !== 0x00010000 && version !== 0x00005000) { + if (tables.maxp.length === 6) { + version = 0x0005000; + } else if (tables.maxp.length >= 32) { + version = 0x00010000; + } else { + throw new FormatError(`"maxp" table has a wrong version number`); + } + writeUint32(tables.maxp.data, 0, version); + } + if (properties.scaleFactors?.length === numGlyphs && isTrueType) { + const { + scaleFactors + } = properties; + const isGlyphLocationsLong = int16(tables.head.data[50], tables.head.data[51]); + const glyphs = new GlyfTable({ + glyfTable: tables.glyf.data, + isGlyphLocationsLong, + locaTable: tables.loca.data, + numGlyphs + }); + glyphs.scale(scaleFactors); + const { + glyf, + loca, + isLocationLong + } = glyphs.write(); + tables.glyf.data = glyf; + tables.loca.data = loca; + if (isLocationLong !== !!isGlyphLocationsLong) { + tables.head.data[50] = 0; + tables.head.data[51] = isLocationLong ? 1 : 0; + } + const metrics = tables.hmtx.data; + for (let i = 0; i < numGlyphs; i++) { + const j = 4 * i; + const advanceWidth = Math.round(scaleFactors[i] * int16(metrics[j], metrics[j + 1])); + metrics[j] = advanceWidth >> 8 & 0xff; + metrics[j + 1] = advanceWidth & 0xff; + const lsb = Math.round(scaleFactors[i] * signedInt16(metrics[j + 2], metrics[j + 3])); + writeSignedInt16(metrics, j + 2, lsb); + } + } + let numGlyphsOut = numGlyphs + 1; + let dupFirstEntry = true; + if (numGlyphsOut > 0xffff) { + dupFirstEntry = false; + numGlyphsOut = numGlyphs; + warn("Not enough space in glyfs to duplicate first glyph."); + } + let maxFunctionDefs = 0; + let maxSizeOfInstructions = 0; + if (version >= 0x00010000 && tables.maxp.length >= 32) { + font.pos += 8; + const maxZones = font.getUint16(); + if (maxZones > 2) { + tables.maxp.data[14] = 0; + tables.maxp.data[15] = 2; + } + font.pos += 4; + maxFunctionDefs = font.getUint16(); + font.pos += 4; + maxSizeOfInstructions = font.getUint16(); + } + tables.maxp.data[4] = numGlyphsOut >> 8; + tables.maxp.data[5] = numGlyphsOut & 255; + const hintsValid = sanitizeTTPrograms(tables.fpgm, tables.prep, tables["cvt "], maxFunctionDefs); + if (!hintsValid) { + delete tables.fpgm; + delete tables.prep; + delete tables["cvt "]; + } + sanitizeMetrics(font, tables.hhea, tables.hmtx, tables.head, numGlyphsOut, dupFirstEntry); + if (!tables.head) { + throw new FormatError('Required "head" table is not found'); + } + sanitizeHead(tables.head, numGlyphs, isTrueType ? tables.loca.length : 0); + let missingGlyphs = Object.create(null); + if (isTrueType) { + const isGlyphLocationsLong = int16(tables.head.data[50], tables.head.data[51]); + const glyphsInfo = sanitizeGlyphLocations(tables.loca, tables.glyf, numGlyphs, isGlyphLocationsLong, hintsValid, dupFirstEntry, maxSizeOfInstructions); + missingGlyphs = glyphsInfo.missingGlyphs; + if (version >= 0x00010000 && tables.maxp.length >= 32) { + tables.maxp.data[26] = glyphsInfo.maxSizeOfInstructions >> 8; + tables.maxp.data[27] = glyphsInfo.maxSizeOfInstructions & 255; + } + } + if (!tables.hhea) { + throw new FormatError('Required "hhea" table is not found'); + } + if (tables.hhea.data[10] === 0 && tables.hhea.data[11] === 0) { + tables.hhea.data[10] = 0xff; + tables.hhea.data[11] = 0xff; + } + const metricsOverride = { + unitsPerEm: int16(tables.head.data[18], tables.head.data[19]), + yMax: signedInt16(tables.head.data[42], tables.head.data[43]), + yMin: signedInt16(tables.head.data[38], tables.head.data[39]), + ascent: signedInt16(tables.hhea.data[4], tables.hhea.data[5]), + descent: signedInt16(tables.hhea.data[6], tables.hhea.data[7]), + lineGap: signedInt16(tables.hhea.data[8], tables.hhea.data[9]) + }; + this.ascent = metricsOverride.ascent / metricsOverride.unitsPerEm; + this.descent = metricsOverride.descent / metricsOverride.unitsPerEm; + this.lineGap = metricsOverride.lineGap / metricsOverride.unitsPerEm; + if (this.cssFontInfo?.lineHeight) { + this.lineHeight = this.cssFontInfo.metrics.lineHeight; + this.lineGap = this.cssFontInfo.metrics.lineGap; + } else { + this.lineHeight = this.ascent - this.descent + this.lineGap; + } + if (tables.post) { + readPostScriptTable(tables.post, properties, numGlyphs); + } + tables.post = { + tag: "post", + data: createPostTable(properties) + }; + const charCodeToGlyphId = Object.create(null); + function hasGlyph(glyphId) { + return !missingGlyphs[glyphId]; + } + if (properties.composite) { + const cidToGidMap = properties.cidToGidMap || []; + const isCidToGidMapEmpty = cidToGidMap.length === 0; + properties.cMap.forEach(function (charCode, cid) { + if (typeof cid === "string") { + cid = convertCidString(charCode, cid, true); + } + if (cid > 0xffff) { + throw new FormatError("Max size of CID is 65,535"); + } + let glyphId = -1; + if (isCidToGidMapEmpty) { + glyphId = cid; + } else if (cidToGidMap[cid] !== undefined) { + glyphId = cidToGidMap[cid]; + } + if (glyphId >= 0 && glyphId < numGlyphs && hasGlyph(glyphId)) { + charCodeToGlyphId[charCode] = glyphId; + } + }); + } else { + const cmapTable = readCmapTable(tables.cmap, font, this.isSymbolicFont, properties.hasEncoding); + const cmapPlatformId = cmapTable.platformId; + const cmapEncodingId = cmapTable.encodingId; + const cmapMappings = cmapTable.mappings; + let baseEncoding = [], + forcePostTable = false; + if (properties.hasEncoding && (properties.baseEncodingName === "MacRomanEncoding" || properties.baseEncodingName === "WinAnsiEncoding")) { + baseEncoding = getEncoding(properties.baseEncodingName); + } + if (properties.hasEncoding && !this.isSymbolicFont && (cmapPlatformId === 3 && cmapEncodingId === 1 || cmapPlatformId === 1 && cmapEncodingId === 0)) { + const glyphsUnicodeMap = getGlyphsUnicode(); + for (let charCode = 0; charCode < 256; charCode++) { + let glyphName; + if (this.differences[charCode] !== undefined) { + glyphName = this.differences[charCode]; + } else if (baseEncoding.length && baseEncoding[charCode] !== "") { + glyphName = baseEncoding[charCode]; + } else { + glyphName = StandardEncoding[charCode]; + } + if (!glyphName) { + continue; + } + const standardGlyphName = recoverGlyphName(glyphName, glyphsUnicodeMap); + let unicodeOrCharCode; + if (cmapPlatformId === 3 && cmapEncodingId === 1) { + unicodeOrCharCode = glyphsUnicodeMap[standardGlyphName]; + } else if (cmapPlatformId === 1 && cmapEncodingId === 0) { + unicodeOrCharCode = MacRomanEncoding.indexOf(standardGlyphName); + } + if (unicodeOrCharCode === undefined) { + if (!properties.glyphNames && properties.hasIncludedToUnicodeMap && !(this.toUnicode instanceof IdentityToUnicodeMap)) { + const unicode = this.toUnicode.get(charCode); + if (unicode) { + unicodeOrCharCode = unicode.codePointAt(0); + } + } + if (unicodeOrCharCode === undefined) { + continue; + } + } + for (const mapping of cmapMappings) { + if (mapping.charCode !== unicodeOrCharCode) { + continue; + } + charCodeToGlyphId[charCode] = mapping.glyphId; + break; + } + } + } else if (cmapPlatformId === 0) { + for (const mapping of cmapMappings) { + charCodeToGlyphId[mapping.charCode] = mapping.glyphId; + } + forcePostTable = true; + } else if (cmapPlatformId === 3 && cmapEncodingId === 0) { + for (const mapping of cmapMappings) { + let charCode = mapping.charCode; + if (charCode >= 0xf000 && charCode <= 0xf0ff) { + charCode &= 0xff; + } + charCodeToGlyphId[charCode] = mapping.glyphId; + } + } else { + for (const mapping of cmapMappings) { + charCodeToGlyphId[mapping.charCode] = mapping.glyphId; + } + } + if (properties.glyphNames && (baseEncoding.length || this.differences.length)) { + for (let i = 0; i < 256; ++i) { + if (!forcePostTable && charCodeToGlyphId[i] !== undefined) { + continue; + } + const glyphName = this.differences[i] || baseEncoding[i]; + if (!glyphName) { + continue; + } + const glyphId = properties.glyphNames.indexOf(glyphName); + if (glyphId > 0 && hasGlyph(glyphId)) { + charCodeToGlyphId[i] = glyphId; + } + } + } + } + if (charCodeToGlyphId.length === 0) { + charCodeToGlyphId[0] = 0; + } + let glyphZeroId = numGlyphsOut - 1; + if (!dupFirstEntry) { + glyphZeroId = 0; + } + if (!properties.cssFontInfo) { + const newMapping = adjustMapping(charCodeToGlyphId, hasGlyph, glyphZeroId, this.toUnicode); + this.toFontChar = newMapping.toFontChar; + tables.cmap = { + tag: "cmap", + data: createCmapTable(newMapping.charCodeToGlyphId, newMapping.toUnicodeExtraMap, numGlyphsOut) + }; + if (!tables["OS/2"] || !validateOS2Table(tables["OS/2"], font)) { + tables["OS/2"] = { + tag: "OS/2", + data: createOS2Table(properties, newMapping.charCodeToGlyphId, metricsOverride) + }; + } + } + if (!isTrueType) { + try { + cffFile = new Stream(tables["CFF "].data); + const parser = new CFFParser(cffFile, properties, SEAC_ANALYSIS_ENABLED); + cff = parser.parse(); + cff.duplicateFirstGlyph(); + const compiler = new CFFCompiler(cff); + tables["CFF "].data = compiler.compile(); + } catch { + warn("Failed to compile font " + properties.loadedName); + } + } + if (!tables.name) { + tables.name = { + tag: "name", + data: createNameTable(this.name) + }; + } else { + const [namePrototype, nameRecords] = readNameTable(tables.name); + tables.name.data = createNameTable(name, namePrototype); + this.psName = namePrototype[0][6] || null; + if (!properties.composite) { + adjustTrueTypeToUnicode(properties, this.isSymbolicFont, nameRecords); + } + } + const builder = new OpenTypeFileBuilder(header.version); + for (const tableTag in tables) { + builder.addTable(tableTag, tables[tableTag].data); + } + return builder.toArray(); + } + convert(fontName, font, properties) { + properties.fixedPitch = false; + if (properties.builtInEncoding) { + adjustType1ToUnicode(properties, properties.builtInEncoding); + } + let glyphZeroId = 1; + if (font instanceof CFFFont) { + glyphZeroId = font.numGlyphs - 1; + } + const mapping = font.getGlyphMapping(properties); + let newMapping = null; + let newCharCodeToGlyphId = mapping; + let toUnicodeExtraMap = null; + if (!properties.cssFontInfo) { + newMapping = adjustMapping(mapping, font.hasGlyphId.bind(font), glyphZeroId, this.toUnicode); + this.toFontChar = newMapping.toFontChar; + newCharCodeToGlyphId = newMapping.charCodeToGlyphId; + toUnicodeExtraMap = newMapping.toUnicodeExtraMap; + } + const numGlyphs = font.numGlyphs; + function getCharCodes(charCodeToGlyphId, glyphId) { + let charCodes = null; + for (const charCode in charCodeToGlyphId) { + if (glyphId === charCodeToGlyphId[charCode]) { + (charCodes ||= []).push(charCode | 0); + } + } + return charCodes; + } + function createCharCode(charCodeToGlyphId, glyphId) { + for (const charCode in charCodeToGlyphId) { + if (glyphId === charCodeToGlyphId[charCode]) { + return charCode | 0; + } + } + newMapping.charCodeToGlyphId[newMapping.nextAvailableFontCharCode] = glyphId; + return newMapping.nextAvailableFontCharCode++; + } + const seacs = font.seacs; + if (newMapping && SEAC_ANALYSIS_ENABLED && seacs?.length) { + const matrix = properties.fontMatrix || FONT_IDENTITY_MATRIX; + const charset = font.getCharset(); + const seacMap = Object.create(null); + for (let glyphId in seacs) { + glyphId |= 0; + const seac = seacs[glyphId]; + const baseGlyphName = StandardEncoding[seac[2]]; + const accentGlyphName = StandardEncoding[seac[3]]; + const baseGlyphId = charset.indexOf(baseGlyphName); + const accentGlyphId = charset.indexOf(accentGlyphName); + if (baseGlyphId < 0 || accentGlyphId < 0) { + continue; + } + const accentOffset = { + x: seac[0] * matrix[0] + seac[1] * matrix[2] + matrix[4], + y: seac[0] * matrix[1] + seac[1] * matrix[3] + matrix[5] + }; + const charCodes = getCharCodes(mapping, glyphId); + if (!charCodes) { + continue; + } + for (const charCode of charCodes) { + const charCodeToGlyphId = newMapping.charCodeToGlyphId; + const baseFontCharCode = createCharCode(charCodeToGlyphId, baseGlyphId); + const accentFontCharCode = createCharCode(charCodeToGlyphId, accentGlyphId); + seacMap[charCode] = { + baseFontCharCode, + accentFontCharCode, + accentOffset + }; + } + } + properties.seacMap = seacMap; + } + const unitsPerEm = properties.fontMatrix ? 1 / Math.max(...properties.fontMatrix.slice(0, 4).map(Math.abs)) : 1000; + const builder = new OpenTypeFileBuilder("\x4F\x54\x54\x4F"); + builder.addTable("CFF ", font.data); + builder.addTable("OS/2", createOS2Table(properties, newCharCodeToGlyphId)); + builder.addTable("cmap", createCmapTable(newCharCodeToGlyphId, toUnicodeExtraMap, numGlyphs)); + builder.addTable("head", "\x00\x01\x00\x00" + "\x00\x00\x10\x00" + "\x00\x00\x00\x00" + "\x5F\x0F\x3C\xF5" + "\x00\x00" + safeString16(unitsPerEm) + "\x00\x00\x00\x00\x9e\x0b\x7e\x27" + "\x00\x00\x00\x00\x9e\x0b\x7e\x27" + "\x00\x00" + safeString16(properties.descent) + "\x0F\xFF" + safeString16(properties.ascent) + string16(properties.italicAngle ? 2 : 0) + "\x00\x11" + "\x00\x00" + "\x00\x00" + "\x00\x00"); + builder.addTable("hhea", "\x00\x01\x00\x00" + safeString16(properties.ascent) + safeString16(properties.descent) + "\x00\x00" + "\xFF\xFF" + "\x00\x00" + "\x00\x00" + "\x00\x00" + safeString16(properties.capHeight) + safeString16(Math.tan(properties.italicAngle) * properties.xHeight) + "\x00\x00" + "\x00\x00" + "\x00\x00" + "\x00\x00" + "\x00\x00" + "\x00\x00" + string16(numGlyphs)); + builder.addTable("hmtx", function fontFieldsHmtx() { + const charstrings = font.charstrings; + const cffWidths = font.cff ? font.cff.widths : null; + let hmtx = "\x00\x00\x00\x00"; + for (let i = 1, ii = numGlyphs; i < ii; i++) { + let width = 0; + if (charstrings) { + const charstring = charstrings[i - 1]; + width = "width" in charstring ? charstring.width : 0; + } else if (cffWidths) { + width = Math.ceil(cffWidths[i] || 0); + } + hmtx += string16(width) + string16(0); + } + return hmtx; + }()); + builder.addTable("maxp", "\x00\x00\x50\x00" + string16(numGlyphs)); + builder.addTable("name", createNameTable(fontName)); + builder.addTable("post", createPostTable(properties)); + return builder.toArray(); + } + get _spaceWidth() { + const possibleSpaceReplacements = ["space", "minus", "one", "i", "I"]; + let width; + for (const glyphName of possibleSpaceReplacements) { + if (glyphName in this.widths) { + width = this.widths[glyphName]; + break; + } + const glyphsUnicodeMap = getGlyphsUnicode(); + const glyphUnicode = glyphsUnicodeMap[glyphName]; + let charcode = 0; + if (this.composite && this.cMap.contains(glyphUnicode)) { + charcode = this.cMap.lookup(glyphUnicode); + if (typeof charcode === "string") { + charcode = convertCidString(glyphUnicode, charcode); + } + } + if (!charcode && this.toUnicode) { + charcode = this.toUnicode.charCodeOf(glyphUnicode); + } + if (charcode <= 0) { + charcode = glyphUnicode; + } + width = this.widths[charcode]; + if (width) { + break; + } + } + return shadow(this, "_spaceWidth", width || this.defaultWidth); + } + _charToGlyph(charcode, isSpace = false) { + let glyph = this._glyphCache[charcode]; + if (glyph?.isSpace === isSpace) { + return glyph; + } + let fontCharCode, width, operatorListId; + let widthCode = charcode; + if (this.cMap?.contains(charcode)) { + widthCode = this.cMap.lookup(charcode); + if (typeof widthCode === "string") { + widthCode = convertCidString(charcode, widthCode); + } + } + width = this.widths[widthCode]; + if (typeof width !== "number") { + width = this.defaultWidth; + } + const vmetric = this.vmetrics?.[widthCode]; + let unicode = this.toUnicode.get(charcode) || charcode; + if (typeof unicode === "number") { + unicode = String.fromCharCode(unicode); + } + let isInFont = this.toFontChar[charcode] !== undefined; + fontCharCode = this.toFontChar[charcode] || charcode; + if (this.missingFile) { + const glyphName = this.differences[charcode] || this.defaultEncoding[charcode]; + if ((glyphName === ".notdef" || glyphName === "") && this.type === "Type1") { + fontCharCode = 0x20; + if (glyphName === "") { + width ||= this._spaceWidth; + unicode = String.fromCharCode(fontCharCode); + } + } + fontCharCode = mapSpecialUnicodeValues(fontCharCode); + } + if (this.isType3Font) { + operatorListId = fontCharCode; + } + let accent = null; + if (this.seacMap?.[charcode]) { + isInFont = true; + const seac = this.seacMap[charcode]; + fontCharCode = seac.baseFontCharCode; + accent = { + fontChar: String.fromCodePoint(seac.accentFontCharCode), + offset: seac.accentOffset + }; + } + let fontChar = ""; + if (typeof fontCharCode === "number") { + if (fontCharCode <= 0x10ffff) { + fontChar = String.fromCodePoint(fontCharCode); + } else { + warn(`charToGlyph - invalid fontCharCode: ${fontCharCode}`); + } + } + if (this.missingFile && this.vertical && fontChar.length === 1) { + const vertical = getVerticalPresentationForm()[fontChar.charCodeAt(0)]; + if (vertical) { + fontChar = unicode = String.fromCharCode(vertical); + } + } + glyph = new fonts_Glyph(charcode, fontChar, unicode, accent, width, vmetric, operatorListId, isSpace, isInFont); + return this._glyphCache[charcode] = glyph; + } + charsToGlyphs(chars) { + let glyphs = this._charsCache[chars]; + if (glyphs) { + return glyphs; + } + glyphs = []; + if (this.cMap) { + const c = Object.create(null), + ii = chars.length; + let i = 0; + while (i < ii) { + this.cMap.readCharCode(chars, i, c); + const { + charcode, + length + } = c; + i += length; + const glyph = this._charToGlyph(charcode, length === 1 && chars.charCodeAt(i - 1) === 0x20); + glyphs.push(glyph); + } + } else { + for (let i = 0, ii = chars.length; i < ii; ++i) { + const charcode = chars.charCodeAt(i); + const glyph = this._charToGlyph(charcode, charcode === 0x20); + glyphs.push(glyph); + } + } + return this._charsCache[chars] = glyphs; + } + getCharPositions(chars) { + const positions = []; + if (this.cMap) { + const c = Object.create(null); + let i = 0; + while (i < chars.length) { + this.cMap.readCharCode(chars, i, c); + const length = c.length; + positions.push([i, i + length]); + i += length; + } + } else { + for (let i = 0, ii = chars.length; i < ii; ++i) { + positions.push([i, i + 1]); + } + } + return positions; + } + get glyphCacheValues() { + return Object.values(this._glyphCache); + } + encodeString(str) { + const buffers = []; + const currentBuf = []; + const hasCurrentBufErrors = () => buffers.length % 2 === 1; + const getCharCode = this.toUnicode instanceof IdentityToUnicodeMap ? unicode => this.toUnicode.charCodeOf(unicode) : unicode => this.toUnicode.charCodeOf(String.fromCodePoint(unicode)); + for (let i = 0, ii = str.length; i < ii; i++) { + const unicode = str.codePointAt(i); + if (unicode > 0xd7ff && (unicode < 0xe000 || unicode > 0xfffd)) { + i++; + } + if (this.toUnicode) { + const charCode = getCharCode(unicode); + if (charCode !== -1) { + if (hasCurrentBufErrors()) { + buffers.push(currentBuf.join("")); + currentBuf.length = 0; + } + const charCodeLength = this.cMap ? this.cMap.getCharCodeLength(charCode) : 1; + for (let j = charCodeLength - 1; j >= 0; j--) { + currentBuf.push(String.fromCharCode(charCode >> 8 * j & 0xff)); + } + continue; + } + } + if (!hasCurrentBufErrors()) { + buffers.push(currentBuf.join("")); + currentBuf.length = 0; + } + currentBuf.push(String.fromCodePoint(unicode)); + } + buffers.push(currentBuf.join("")); + return buffers; + } +} +class ErrorFont { + constructor(error) { + this.error = error; + this.loadedName = "g_font_error"; + this.missingFile = true; + } + charsToGlyphs() { + return []; + } + encodeString(chars) { + return [chars]; + } + exportData(extraProperties = false) { + return { + error: this.error + }; + } +} + +;// ./src/core/pattern.js + + + + +const ShadingType = { + FUNCTION_BASED: 1, + AXIAL: 2, + RADIAL: 3, + FREE_FORM_MESH: 4, + LATTICE_FORM_MESH: 5, + COONS_PATCH_MESH: 6, + TENSOR_PATCH_MESH: 7 +}; +class Pattern { + constructor() { + unreachable("Cannot initialize Pattern."); + } + static parseShading(shading, xref, res, pdfFunctionFactory, localColorSpaceCache) { + const dict = shading instanceof BaseStream ? shading.dict : shading; + const type = dict.get("ShadingType"); + try { + switch (type) { + case ShadingType.AXIAL: + case ShadingType.RADIAL: + return new RadialAxialShading(dict, xref, res, pdfFunctionFactory, localColorSpaceCache); + case ShadingType.FREE_FORM_MESH: + case ShadingType.LATTICE_FORM_MESH: + case ShadingType.COONS_PATCH_MESH: + case ShadingType.TENSOR_PATCH_MESH: + return new MeshShading(shading, xref, res, pdfFunctionFactory, localColorSpaceCache); + default: + throw new FormatError("Unsupported ShadingType: " + type); + } + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + warn(ex); + return new DummyShading(); + } + } +} +class BaseShading { + static SMALL_NUMBER = 1e-6; + getIR() { + unreachable("Abstract method `getIR` called."); + } +} +class RadialAxialShading extends BaseShading { + constructor(dict, xref, resources, pdfFunctionFactory, localColorSpaceCache) { + super(); + this.shadingType = dict.get("ShadingType"); + let coordsLen = 0; + if (this.shadingType === ShadingType.AXIAL) { + coordsLen = 4; + } else if (this.shadingType === ShadingType.RADIAL) { + coordsLen = 6; + } + this.coordsArr = dict.getArray("Coords"); + if (!isNumberArray(this.coordsArr, coordsLen)) { + throw new FormatError("RadialAxialShading: Invalid /Coords array."); + } + const cs = ColorSpace.parse({ + cs: dict.getRaw("CS") || dict.getRaw("ColorSpace"), + xref, + resources, + pdfFunctionFactory, + localColorSpaceCache + }); + this.bbox = lookupNormalRect(dict.getArray("BBox"), null); + let t0 = 0.0, + t1 = 1.0; + const domainArr = dict.getArray("Domain"); + if (isNumberArray(domainArr, 2)) { + [t0, t1] = domainArr; + } + let extendStart = false, + extendEnd = false; + const extendArr = dict.getArray("Extend"); + if (isBooleanArray(extendArr, 2)) { + [extendStart, extendEnd] = extendArr; + } + if (this.shadingType === ShadingType.RADIAL && (!extendStart || !extendEnd)) { + const [x1, y1, r1, x2, y2, r2] = this.coordsArr; + const distance = Math.hypot(x1 - x2, y1 - y2); + if (r1 <= r2 + distance && r2 <= r1 + distance) { + warn("Unsupported radial gradient."); + } + } + this.extendStart = extendStart; + this.extendEnd = extendEnd; + const fnObj = dict.getRaw("Function"); + const fn = pdfFunctionFactory.createFromArray(fnObj); + const NUMBER_OF_SAMPLES = 840; + const step = (t1 - t0) / NUMBER_OF_SAMPLES; + const colorStops = this.colorStops = []; + if (t0 >= t1 || step <= 0) { + info("Bad shading domain."); + return; + } + const color = new Float32Array(cs.numComps), + ratio = new Float32Array(1); + let rgbColor; + let iBase = 0; + ratio[0] = t0; + fn(ratio, 0, color, 0); + let rgbBase = cs.getRgb(color, 0); + const cssColorBase = Util.makeHexColor(rgbBase[0], rgbBase[1], rgbBase[2]); + colorStops.push([0, cssColorBase]); + let iPrev = 1; + ratio[0] = t0 + step; + fn(ratio, 0, color, 0); + let rgbPrev = cs.getRgb(color, 0); + let maxSlopeR = rgbPrev[0] - rgbBase[0] + 1; + let maxSlopeG = rgbPrev[1] - rgbBase[1] + 1; + let maxSlopeB = rgbPrev[2] - rgbBase[2] + 1; + let minSlopeR = rgbPrev[0] - rgbBase[0] - 1; + let minSlopeG = rgbPrev[1] - rgbBase[1] - 1; + let minSlopeB = rgbPrev[2] - rgbBase[2] - 1; + for (let i = 2; i < NUMBER_OF_SAMPLES; i++) { + ratio[0] = t0 + i * step; + fn(ratio, 0, color, 0); + rgbColor = cs.getRgb(color, 0); + const run = i - iBase; + maxSlopeR = Math.min(maxSlopeR, (rgbColor[0] - rgbBase[0] + 1) / run); + maxSlopeG = Math.min(maxSlopeG, (rgbColor[1] - rgbBase[1] + 1) / run); + maxSlopeB = Math.min(maxSlopeB, (rgbColor[2] - rgbBase[2] + 1) / run); + minSlopeR = Math.max(minSlopeR, (rgbColor[0] - rgbBase[0] - 1) / run); + minSlopeG = Math.max(minSlopeG, (rgbColor[1] - rgbBase[1] - 1) / run); + minSlopeB = Math.max(minSlopeB, (rgbColor[2] - rgbBase[2] - 1) / run); + const slopesExist = minSlopeR <= maxSlopeR && minSlopeG <= maxSlopeG && minSlopeB <= maxSlopeB; + if (!slopesExist) { + const cssColor = Util.makeHexColor(rgbPrev[0], rgbPrev[1], rgbPrev[2]); + colorStops.push([iPrev / NUMBER_OF_SAMPLES, cssColor]); + maxSlopeR = rgbColor[0] - rgbPrev[0] + 1; + maxSlopeG = rgbColor[1] - rgbPrev[1] + 1; + maxSlopeB = rgbColor[2] - rgbPrev[2] + 1; + minSlopeR = rgbColor[0] - rgbPrev[0] - 1; + minSlopeG = rgbColor[1] - rgbPrev[1] - 1; + minSlopeB = rgbColor[2] - rgbPrev[2] - 1; + iBase = iPrev; + rgbBase = rgbPrev; + } + iPrev = i; + rgbPrev = rgbColor; + } + const cssColor = Util.makeHexColor(rgbPrev[0], rgbPrev[1], rgbPrev[2]); + colorStops.push([1, cssColor]); + let background = "transparent"; + if (dict.has("Background")) { + rgbColor = cs.getRgb(dict.get("Background"), 0); + background = Util.makeHexColor(rgbColor[0], rgbColor[1], rgbColor[2]); + } + if (!extendStart) { + colorStops.unshift([0, background]); + colorStops[1][0] += BaseShading.SMALL_NUMBER; + } + if (!extendEnd) { + colorStops.at(-1)[0] -= BaseShading.SMALL_NUMBER; + colorStops.push([1, background]); + } + this.colorStops = colorStops; + } + getIR() { + const { + coordsArr, + shadingType + } = this; + let type, p0, p1, r0, r1; + if (shadingType === ShadingType.AXIAL) { + p0 = [coordsArr[0], coordsArr[1]]; + p1 = [coordsArr[2], coordsArr[3]]; + r0 = null; + r1 = null; + type = "axial"; + } else if (shadingType === ShadingType.RADIAL) { + p0 = [coordsArr[0], coordsArr[1]]; + p1 = [coordsArr[3], coordsArr[4]]; + r0 = coordsArr[2]; + r1 = coordsArr[5]; + type = "radial"; + } else { + unreachable(`getPattern type unknown: ${shadingType}`); + } + return ["RadialAxial", type, this.bbox, this.colorStops, p0, p1, r0, r1]; + } +} +class MeshStreamReader { + constructor(stream, context) { + this.stream = stream; + this.context = context; + this.buffer = 0; + this.bufferLength = 0; + const numComps = context.numComps; + this.tmpCompsBuf = new Float32Array(numComps); + const csNumComps = context.colorSpace.numComps; + this.tmpCsCompsBuf = context.colorFn ? new Float32Array(csNumComps) : this.tmpCompsBuf; + } + get hasData() { + if (this.stream.end) { + return this.stream.pos < this.stream.end; + } + if (this.bufferLength > 0) { + return true; + } + const nextByte = this.stream.getByte(); + if (nextByte < 0) { + return false; + } + this.buffer = nextByte; + this.bufferLength = 8; + return true; + } + readBits(n) { + let buffer = this.buffer; + let bufferLength = this.bufferLength; + if (n === 32) { + if (bufferLength === 0) { + return (this.stream.getByte() << 24 | this.stream.getByte() << 16 | this.stream.getByte() << 8 | this.stream.getByte()) >>> 0; + } + buffer = buffer << 24 | this.stream.getByte() << 16 | this.stream.getByte() << 8 | this.stream.getByte(); + const nextByte = this.stream.getByte(); + this.buffer = nextByte & (1 << bufferLength) - 1; + return (buffer << 8 - bufferLength | (nextByte & 0xff) >> bufferLength) >>> 0; + } + if (n === 8 && bufferLength === 0) { + return this.stream.getByte(); + } + while (bufferLength < n) { + buffer = buffer << 8 | this.stream.getByte(); + bufferLength += 8; + } + bufferLength -= n; + this.bufferLength = bufferLength; + this.buffer = buffer & (1 << bufferLength) - 1; + return buffer >> bufferLength; + } + align() { + this.buffer = 0; + this.bufferLength = 0; + } + readFlag() { + return this.readBits(this.context.bitsPerFlag); + } + readCoordinate() { + const bitsPerCoordinate = this.context.bitsPerCoordinate; + const xi = this.readBits(bitsPerCoordinate); + const yi = this.readBits(bitsPerCoordinate); + const decode = this.context.decode; + const scale = bitsPerCoordinate < 32 ? 1 / ((1 << bitsPerCoordinate) - 1) : 2.3283064365386963e-10; + return [xi * scale * (decode[1] - decode[0]) + decode[0], yi * scale * (decode[3] - decode[2]) + decode[2]]; + } + readComponents() { + const numComps = this.context.numComps; + const bitsPerComponent = this.context.bitsPerComponent; + const scale = bitsPerComponent < 32 ? 1 / ((1 << bitsPerComponent) - 1) : 2.3283064365386963e-10; + const decode = this.context.decode; + const components = this.tmpCompsBuf; + for (let i = 0, j = 4; i < numComps; i++, j += 2) { + const ci = this.readBits(bitsPerComponent); + components[i] = ci * scale * (decode[j + 1] - decode[j]) + decode[j]; + } + const color = this.tmpCsCompsBuf; + if (this.context.colorFn) { + this.context.colorFn(components, 0, color, 0); + } + return this.context.colorSpace.getRgb(color, 0); + } +} +let bCache = Object.create(null); +function buildB(count) { + const lut = []; + for (let i = 0; i <= count; i++) { + const t = i / count, + t_ = 1 - t; + lut.push(new Float32Array([t_ ** 3, 3 * t * t_ ** 2, 3 * t ** 2 * t_, t ** 3])); + } + return lut; +} +function getB(count) { + return bCache[count] ||= buildB(count); +} +function clearPatternCaches() { + bCache = Object.create(null); +} +class MeshShading extends BaseShading { + static MIN_SPLIT_PATCH_CHUNKS_AMOUNT = 3; + static MAX_SPLIT_PATCH_CHUNKS_AMOUNT = 20; + static TRIANGLE_DENSITY = 20; + constructor(stream, xref, resources, pdfFunctionFactory, localColorSpaceCache) { + super(); + if (!(stream instanceof BaseStream)) { + throw new FormatError("Mesh data is not a stream"); + } + const dict = stream.dict; + this.shadingType = dict.get("ShadingType"); + this.bbox = lookupNormalRect(dict.getArray("BBox"), null); + const cs = ColorSpace.parse({ + cs: dict.getRaw("CS") || dict.getRaw("ColorSpace"), + xref, + resources, + pdfFunctionFactory, + localColorSpaceCache + }); + this.background = dict.has("Background") ? cs.getRgb(dict.get("Background"), 0) : null; + const fnObj = dict.getRaw("Function"); + const fn = fnObj ? pdfFunctionFactory.createFromArray(fnObj) : null; + this.coords = []; + this.colors = []; + this.figures = []; + const decodeContext = { + bitsPerCoordinate: dict.get("BitsPerCoordinate"), + bitsPerComponent: dict.get("BitsPerComponent"), + bitsPerFlag: dict.get("BitsPerFlag"), + decode: dict.getArray("Decode"), + colorFn: fn, + colorSpace: cs, + numComps: fn ? 1 : cs.numComps + }; + const reader = new MeshStreamReader(stream, decodeContext); + let patchMesh = false; + switch (this.shadingType) { + case ShadingType.FREE_FORM_MESH: + this._decodeType4Shading(reader); + break; + case ShadingType.LATTICE_FORM_MESH: + const verticesPerRow = dict.get("VerticesPerRow") | 0; + if (verticesPerRow < 2) { + throw new FormatError("Invalid VerticesPerRow"); + } + this._decodeType5Shading(reader, verticesPerRow); + break; + case ShadingType.COONS_PATCH_MESH: + this._decodeType6Shading(reader); + patchMesh = true; + break; + case ShadingType.TENSOR_PATCH_MESH: + this._decodeType7Shading(reader); + patchMesh = true; + break; + default: + unreachable("Unsupported mesh type."); + break; + } + if (patchMesh) { + this._updateBounds(); + for (let i = 0, ii = this.figures.length; i < ii; i++) { + this._buildFigureFromPatch(i); + } + } + this._updateBounds(); + this._packData(); + } + _decodeType4Shading(reader) { + const coords = this.coords; + const colors = this.colors; + const operators = []; + const ps = []; + let verticesLeft = 0; + while (reader.hasData) { + const f = reader.readFlag(); + const coord = reader.readCoordinate(); + const color = reader.readComponents(); + if (verticesLeft === 0) { + if (!(0 <= f && f <= 2)) { + throw new FormatError("Unknown type4 flag"); + } + switch (f) { + case 0: + verticesLeft = 3; + break; + case 1: + ps.push(ps.at(-2), ps.at(-1)); + verticesLeft = 1; + break; + case 2: + ps.push(ps.at(-3), ps.at(-1)); + verticesLeft = 1; + break; + } + operators.push(f); + } + ps.push(coords.length); + coords.push(coord); + colors.push(color); + verticesLeft--; + reader.align(); + } + this.figures.push({ + type: "triangles", + coords: new Int32Array(ps), + colors: new Int32Array(ps) + }); + } + _decodeType5Shading(reader, verticesPerRow) { + const coords = this.coords; + const colors = this.colors; + const ps = []; + while (reader.hasData) { + const coord = reader.readCoordinate(); + const color = reader.readComponents(); + ps.push(coords.length); + coords.push(coord); + colors.push(color); + } + this.figures.push({ + type: "lattice", + coords: new Int32Array(ps), + colors: new Int32Array(ps), + verticesPerRow + }); + } + _decodeType6Shading(reader) { + const coords = this.coords; + const colors = this.colors; + const ps = new Int32Array(16); + const cs = new Int32Array(4); + while (reader.hasData) { + const f = reader.readFlag(); + if (!(0 <= f && f <= 3)) { + throw new FormatError("Unknown type6 flag"); + } + const pi = coords.length; + for (let i = 0, ii = f !== 0 ? 8 : 12; i < ii; i++) { + coords.push(reader.readCoordinate()); + } + const ci = colors.length; + for (let i = 0, ii = f !== 0 ? 2 : 4; i < ii; i++) { + colors.push(reader.readComponents()); + } + let tmp1, tmp2, tmp3, tmp4; + switch (f) { + case 0: + ps[12] = pi + 3; + ps[13] = pi + 4; + ps[14] = pi + 5; + ps[15] = pi + 6; + ps[8] = pi + 2; + ps[11] = pi + 7; + ps[4] = pi + 1; + ps[7] = pi + 8; + ps[0] = pi; + ps[1] = pi + 11; + ps[2] = pi + 10; + ps[3] = pi + 9; + cs[2] = ci + 1; + cs[3] = ci + 2; + cs[0] = ci; + cs[1] = ci + 3; + break; + case 1: + tmp1 = ps[12]; + tmp2 = ps[13]; + tmp3 = ps[14]; + tmp4 = ps[15]; + ps[12] = tmp4; + ps[13] = pi + 0; + ps[14] = pi + 1; + ps[15] = pi + 2; + ps[8] = tmp3; + ps[11] = pi + 3; + ps[4] = tmp2; + ps[7] = pi + 4; + ps[0] = tmp1; + ps[1] = pi + 7; + ps[2] = pi + 6; + ps[3] = pi + 5; + tmp1 = cs[2]; + tmp2 = cs[3]; + cs[2] = tmp2; + cs[3] = ci; + cs[0] = tmp1; + cs[1] = ci + 1; + break; + case 2: + tmp1 = ps[15]; + tmp2 = ps[11]; + ps[12] = ps[3]; + ps[13] = pi + 0; + ps[14] = pi + 1; + ps[15] = pi + 2; + ps[8] = ps[7]; + ps[11] = pi + 3; + ps[4] = tmp2; + ps[7] = pi + 4; + ps[0] = tmp1; + ps[1] = pi + 7; + ps[2] = pi + 6; + ps[3] = pi + 5; + tmp1 = cs[3]; + cs[2] = cs[1]; + cs[3] = ci; + cs[0] = tmp1; + cs[1] = ci + 1; + break; + case 3: + ps[12] = ps[0]; + ps[13] = pi + 0; + ps[14] = pi + 1; + ps[15] = pi + 2; + ps[8] = ps[1]; + ps[11] = pi + 3; + ps[4] = ps[2]; + ps[7] = pi + 4; + ps[0] = ps[3]; + ps[1] = pi + 7; + ps[2] = pi + 6; + ps[3] = pi + 5; + cs[2] = cs[0]; + cs[3] = ci; + cs[0] = cs[1]; + cs[1] = ci + 1; + break; + } + ps[5] = coords.length; + coords.push([(-4 * coords[ps[0]][0] - coords[ps[15]][0] + 6 * (coords[ps[4]][0] + coords[ps[1]][0]) - 2 * (coords[ps[12]][0] + coords[ps[3]][0]) + 3 * (coords[ps[13]][0] + coords[ps[7]][0])) / 9, (-4 * coords[ps[0]][1] - coords[ps[15]][1] + 6 * (coords[ps[4]][1] + coords[ps[1]][1]) - 2 * (coords[ps[12]][1] + coords[ps[3]][1]) + 3 * (coords[ps[13]][1] + coords[ps[7]][1])) / 9]); + ps[6] = coords.length; + coords.push([(-4 * coords[ps[3]][0] - coords[ps[12]][0] + 6 * (coords[ps[2]][0] + coords[ps[7]][0]) - 2 * (coords[ps[0]][0] + coords[ps[15]][0]) + 3 * (coords[ps[4]][0] + coords[ps[14]][0])) / 9, (-4 * coords[ps[3]][1] - coords[ps[12]][1] + 6 * (coords[ps[2]][1] + coords[ps[7]][1]) - 2 * (coords[ps[0]][1] + coords[ps[15]][1]) + 3 * (coords[ps[4]][1] + coords[ps[14]][1])) / 9]); + ps[9] = coords.length; + coords.push([(-4 * coords[ps[12]][0] - coords[ps[3]][0] + 6 * (coords[ps[8]][0] + coords[ps[13]][0]) - 2 * (coords[ps[0]][0] + coords[ps[15]][0]) + 3 * (coords[ps[11]][0] + coords[ps[1]][0])) / 9, (-4 * coords[ps[12]][1] - coords[ps[3]][1] + 6 * (coords[ps[8]][1] + coords[ps[13]][1]) - 2 * (coords[ps[0]][1] + coords[ps[15]][1]) + 3 * (coords[ps[11]][1] + coords[ps[1]][1])) / 9]); + ps[10] = coords.length; + coords.push([(-4 * coords[ps[15]][0] - coords[ps[0]][0] + 6 * (coords[ps[11]][0] + coords[ps[14]][0]) - 2 * (coords[ps[12]][0] + coords[ps[3]][0]) + 3 * (coords[ps[2]][0] + coords[ps[8]][0])) / 9, (-4 * coords[ps[15]][1] - coords[ps[0]][1] + 6 * (coords[ps[11]][1] + coords[ps[14]][1]) - 2 * (coords[ps[12]][1] + coords[ps[3]][1]) + 3 * (coords[ps[2]][1] + coords[ps[8]][1])) / 9]); + this.figures.push({ + type: "patch", + coords: new Int32Array(ps), + colors: new Int32Array(cs) + }); + } + } + _decodeType7Shading(reader) { + const coords = this.coords; + const colors = this.colors; + const ps = new Int32Array(16); + const cs = new Int32Array(4); + while (reader.hasData) { + const f = reader.readFlag(); + if (!(0 <= f && f <= 3)) { + throw new FormatError("Unknown type7 flag"); + } + const pi = coords.length; + for (let i = 0, ii = f !== 0 ? 12 : 16; i < ii; i++) { + coords.push(reader.readCoordinate()); + } + const ci = colors.length; + for (let i = 0, ii = f !== 0 ? 2 : 4; i < ii; i++) { + colors.push(reader.readComponents()); + } + let tmp1, tmp2, tmp3, tmp4; + switch (f) { + case 0: + ps[12] = pi + 3; + ps[13] = pi + 4; + ps[14] = pi + 5; + ps[15] = pi + 6; + ps[8] = pi + 2; + ps[9] = pi + 13; + ps[10] = pi + 14; + ps[11] = pi + 7; + ps[4] = pi + 1; + ps[5] = pi + 12; + ps[6] = pi + 15; + ps[7] = pi + 8; + ps[0] = pi; + ps[1] = pi + 11; + ps[2] = pi + 10; + ps[3] = pi + 9; + cs[2] = ci + 1; + cs[3] = ci + 2; + cs[0] = ci; + cs[1] = ci + 3; + break; + case 1: + tmp1 = ps[12]; + tmp2 = ps[13]; + tmp3 = ps[14]; + tmp4 = ps[15]; + ps[12] = tmp4; + ps[13] = pi + 0; + ps[14] = pi + 1; + ps[15] = pi + 2; + ps[8] = tmp3; + ps[9] = pi + 9; + ps[10] = pi + 10; + ps[11] = pi + 3; + ps[4] = tmp2; + ps[5] = pi + 8; + ps[6] = pi + 11; + ps[7] = pi + 4; + ps[0] = tmp1; + ps[1] = pi + 7; + ps[2] = pi + 6; + ps[3] = pi + 5; + tmp1 = cs[2]; + tmp2 = cs[3]; + cs[2] = tmp2; + cs[3] = ci; + cs[0] = tmp1; + cs[1] = ci + 1; + break; + case 2: + tmp1 = ps[15]; + tmp2 = ps[11]; + ps[12] = ps[3]; + ps[13] = pi + 0; + ps[14] = pi + 1; + ps[15] = pi + 2; + ps[8] = ps[7]; + ps[9] = pi + 9; + ps[10] = pi + 10; + ps[11] = pi + 3; + ps[4] = tmp2; + ps[5] = pi + 8; + ps[6] = pi + 11; + ps[7] = pi + 4; + ps[0] = tmp1; + ps[1] = pi + 7; + ps[2] = pi + 6; + ps[3] = pi + 5; + tmp1 = cs[3]; + cs[2] = cs[1]; + cs[3] = ci; + cs[0] = tmp1; + cs[1] = ci + 1; + break; + case 3: + ps[12] = ps[0]; + ps[13] = pi + 0; + ps[14] = pi + 1; + ps[15] = pi + 2; + ps[8] = ps[1]; + ps[9] = pi + 9; + ps[10] = pi + 10; + ps[11] = pi + 3; + ps[4] = ps[2]; + ps[5] = pi + 8; + ps[6] = pi + 11; + ps[7] = pi + 4; + ps[0] = ps[3]; + ps[1] = pi + 7; + ps[2] = pi + 6; + ps[3] = pi + 5; + cs[2] = cs[0]; + cs[3] = ci; + cs[0] = cs[1]; + cs[1] = ci + 1; + break; + } + this.figures.push({ + type: "patch", + coords: new Int32Array(ps), + colors: new Int32Array(cs) + }); + } + } + _buildFigureFromPatch(index) { + const figure = this.figures[index]; + assert(figure.type === "patch", "Unexpected patch mesh figure"); + const coords = this.coords, + colors = this.colors; + const pi = figure.coords; + const ci = figure.colors; + const figureMinX = Math.min(coords[pi[0]][0], coords[pi[3]][0], coords[pi[12]][0], coords[pi[15]][0]); + const figureMinY = Math.min(coords[pi[0]][1], coords[pi[3]][1], coords[pi[12]][1], coords[pi[15]][1]); + const figureMaxX = Math.max(coords[pi[0]][0], coords[pi[3]][0], coords[pi[12]][0], coords[pi[15]][0]); + const figureMaxY = Math.max(coords[pi[0]][1], coords[pi[3]][1], coords[pi[12]][1], coords[pi[15]][1]); + let splitXBy = Math.ceil((figureMaxX - figureMinX) * MeshShading.TRIANGLE_DENSITY / (this.bounds[2] - this.bounds[0])); + splitXBy = Math.max(MeshShading.MIN_SPLIT_PATCH_CHUNKS_AMOUNT, Math.min(MeshShading.MAX_SPLIT_PATCH_CHUNKS_AMOUNT, splitXBy)); + let splitYBy = Math.ceil((figureMaxY - figureMinY) * MeshShading.TRIANGLE_DENSITY / (this.bounds[3] - this.bounds[1])); + splitYBy = Math.max(MeshShading.MIN_SPLIT_PATCH_CHUNKS_AMOUNT, Math.min(MeshShading.MAX_SPLIT_PATCH_CHUNKS_AMOUNT, splitYBy)); + const verticesPerRow = splitXBy + 1; + const figureCoords = new Int32Array((splitYBy + 1) * verticesPerRow); + const figureColors = new Int32Array((splitYBy + 1) * verticesPerRow); + let k = 0; + const cl = new Uint8Array(3), + cr = new Uint8Array(3); + const c0 = colors[ci[0]], + c1 = colors[ci[1]], + c2 = colors[ci[2]], + c3 = colors[ci[3]]; + const bRow = getB(splitYBy), + bCol = getB(splitXBy); + for (let row = 0; row <= splitYBy; row++) { + cl[0] = (c0[0] * (splitYBy - row) + c2[0] * row) / splitYBy | 0; + cl[1] = (c0[1] * (splitYBy - row) + c2[1] * row) / splitYBy | 0; + cl[2] = (c0[2] * (splitYBy - row) + c2[2] * row) / splitYBy | 0; + cr[0] = (c1[0] * (splitYBy - row) + c3[0] * row) / splitYBy | 0; + cr[1] = (c1[1] * (splitYBy - row) + c3[1] * row) / splitYBy | 0; + cr[2] = (c1[2] * (splitYBy - row) + c3[2] * row) / splitYBy | 0; + for (let col = 0; col <= splitXBy; col++, k++) { + if ((row === 0 || row === splitYBy) && (col === 0 || col === splitXBy)) { + continue; + } + let x = 0, + y = 0; + let q = 0; + for (let i = 0; i <= 3; i++) { + for (let j = 0; j <= 3; j++, q++) { + const m = bRow[row][i] * bCol[col][j]; + x += coords[pi[q]][0] * m; + y += coords[pi[q]][1] * m; + } + } + figureCoords[k] = coords.length; + coords.push([x, y]); + figureColors[k] = colors.length; + const newColor = new Uint8Array(3); + newColor[0] = (cl[0] * (splitXBy - col) + cr[0] * col) / splitXBy | 0; + newColor[1] = (cl[1] * (splitXBy - col) + cr[1] * col) / splitXBy | 0; + newColor[2] = (cl[2] * (splitXBy - col) + cr[2] * col) / splitXBy | 0; + colors.push(newColor); + } + } + figureCoords[0] = pi[0]; + figureColors[0] = ci[0]; + figureCoords[splitXBy] = pi[3]; + figureColors[splitXBy] = ci[1]; + figureCoords[verticesPerRow * splitYBy] = pi[12]; + figureColors[verticesPerRow * splitYBy] = ci[2]; + figureCoords[verticesPerRow * splitYBy + splitXBy] = pi[15]; + figureColors[verticesPerRow * splitYBy + splitXBy] = ci[3]; + this.figures[index] = { + type: "lattice", + coords: figureCoords, + colors: figureColors, + verticesPerRow + }; + } + _updateBounds() { + let minX = this.coords[0][0], + minY = this.coords[0][1], + maxX = minX, + maxY = minY; + for (let i = 1, ii = this.coords.length; i < ii; i++) { + const x = this.coords[i][0], + y = this.coords[i][1]; + minX = minX > x ? x : minX; + minY = minY > y ? y : minY; + maxX = maxX < x ? x : maxX; + maxY = maxY < y ? y : maxY; + } + this.bounds = [minX, minY, maxX, maxY]; + } + _packData() { + let i, ii, j, jj; + const coords = this.coords; + const coordsPacked = new Float32Array(coords.length * 2); + for (i = 0, j = 0, ii = coords.length; i < ii; i++) { + const xy = coords[i]; + coordsPacked[j++] = xy[0]; + coordsPacked[j++] = xy[1]; + } + this.coords = coordsPacked; + const colors = this.colors; + const colorsPacked = new Uint8Array(colors.length * 3); + for (i = 0, j = 0, ii = colors.length; i < ii; i++) { + const c = colors[i]; + colorsPacked[j++] = c[0]; + colorsPacked[j++] = c[1]; + colorsPacked[j++] = c[2]; + } + this.colors = colorsPacked; + const figures = this.figures; + for (i = 0, ii = figures.length; i < ii; i++) { + const figure = figures[i], + ps = figure.coords, + cs = figure.colors; + for (j = 0, jj = ps.length; j < jj; j++) { + ps[j] *= 2; + cs[j] *= 3; + } + } + } + getIR() { + const { + bounds + } = this; + if (bounds[2] - bounds[0] === 0 || bounds[3] - bounds[1] === 0) { + throw new FormatError(`Invalid MeshShading bounds: [${bounds}].`); + } + return ["Mesh", this.shadingType, this.coords, this.colors, this.figures, bounds, this.bbox, this.background]; + } +} +class DummyShading extends BaseShading { + getIR() { + return ["Dummy"]; + } +} +function getTilingPatternIR(operatorList, dict, color) { + const matrix = lookupMatrix(dict.getArray("Matrix"), IDENTITY_MATRIX); + const bbox = lookupNormalRect(dict.getArray("BBox"), null); + if (!bbox || bbox[2] - bbox[0] === 0 || bbox[3] - bbox[1] === 0) { + throw new FormatError(`Invalid getTilingPatternIR /BBox array.`); + } + const xstep = dict.get("XStep"); + if (typeof xstep !== "number") { + throw new FormatError(`Invalid getTilingPatternIR /XStep value.`); + } + const ystep = dict.get("YStep"); + if (typeof ystep !== "number") { + throw new FormatError(`Invalid getTilingPatternIR /YStep value.`); + } + const paintType = dict.get("PaintType"); + if (!Number.isInteger(paintType)) { + throw new FormatError(`Invalid getTilingPatternIR /PaintType value.`); + } + const tilingType = dict.get("TilingType"); + if (!Number.isInteger(tilingType)) { + throw new FormatError(`Invalid getTilingPatternIR /TilingType value.`); + } + return ["TilingPattern", color, operatorList, matrix, bbox, xstep, ystep, paintType, tilingType]; +} + +;// ./src/core/calibri_factors.js +const CalibriBoldFactors = [1.3877, 1, 1, 1, 0.97801, 0.92482, 0.89552, 0.91133, 0.81988, 0.97566, 0.98152, 0.93548, 0.93548, 1.2798, 0.85284, 0.92794, 1, 0.96134, 1.54657, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.82845, 0.82845, 0.85284, 0.85284, 0.85284, 0.75859, 0.92138, 0.83908, 0.7762, 0.73293, 0.87289, 0.73133, 0.7514, 0.81921, 0.87356, 0.95958, 0.59526, 0.75727, 0.69225, 1.04924, 0.9121, 0.86943, 0.79795, 0.88198, 0.77958, 0.70864, 0.81055, 0.90399, 0.88653, 0.96017, 0.82577, 0.77892, 0.78257, 0.97507, 1.54657, 0.97507, 0.85284, 0.89552, 0.90176, 0.88762, 0.8785, 0.75241, 0.8785, 0.90518, 0.95015, 0.77618, 0.8785, 0.88401, 0.91916, 0.86304, 0.88401, 0.91488, 0.8785, 0.8801, 0.8785, 0.8785, 0.91343, 0.7173, 1.04106, 0.8785, 0.85075, 0.95794, 0.82616, 0.85162, 0.79492, 0.88331, 1.69808, 0.88331, 0.85284, 0.97801, 0.89552, 0.91133, 0.89552, 0.91133, 1.7801, 0.89552, 1.24487, 1.13254, 1.12401, 0.96839, 0.85284, 0.68787, 0.70645, 0.85592, 0.90747, 1.01466, 1.0088, 0.90323, 1, 1.07463, 1, 0.91056, 0.75806, 1.19118, 0.96839, 0.78864, 0.82845, 0.84133, 0.75859, 0.83908, 0.83908, 0.83908, 0.83908, 0.83908, 0.83908, 0.77539, 0.73293, 0.73133, 0.73133, 0.73133, 0.73133, 0.95958, 0.95958, 0.95958, 0.95958, 0.88506, 0.9121, 0.86943, 0.86943, 0.86943, 0.86943, 0.86943, 0.85284, 0.87508, 0.90399, 0.90399, 0.90399, 0.90399, 0.77892, 0.79795, 0.90807, 0.88762, 0.88762, 0.88762, 0.88762, 0.88762, 0.88762, 0.8715, 0.75241, 0.90518, 0.90518, 0.90518, 0.90518, 0.88401, 0.88401, 0.88401, 0.88401, 0.8785, 0.8785, 0.8801, 0.8801, 0.8801, 0.8801, 0.8801, 0.90747, 0.89049, 0.8785, 0.8785, 0.8785, 0.8785, 0.85162, 0.8785, 0.85162, 0.83908, 0.88762, 0.83908, 0.88762, 0.83908, 0.88762, 0.73293, 0.75241, 0.73293, 0.75241, 0.73293, 0.75241, 0.73293, 0.75241, 0.87289, 0.83016, 0.88506, 0.93125, 0.73133, 0.90518, 0.73133, 0.90518, 0.73133, 0.90518, 0.73133, 0.90518, 0.73133, 0.90518, 0.81921, 0.77618, 0.81921, 0.77618, 0.81921, 0.77618, 1, 1, 0.87356, 0.8785, 0.91075, 0.89608, 0.95958, 0.88401, 0.95958, 0.88401, 0.95958, 0.88401, 0.95958, 0.88401, 0.95958, 0.88401, 0.76229, 0.90167, 0.59526, 0.91916, 1, 1, 0.86304, 0.69225, 0.88401, 1, 1, 0.70424, 0.79468, 0.91926, 0.88175, 0.70823, 0.94903, 0.9121, 0.8785, 1, 1, 0.9121, 0.8785, 0.87802, 0.88656, 0.8785, 0.86943, 0.8801, 0.86943, 0.8801, 0.86943, 0.8801, 0.87402, 0.89291, 0.77958, 0.91343, 1, 1, 0.77958, 0.91343, 0.70864, 0.7173, 0.70864, 0.7173, 0.70864, 0.7173, 0.70864, 0.7173, 1, 1, 0.81055, 0.75841, 0.81055, 1.06452, 0.90399, 0.8785, 0.90399, 0.8785, 0.90399, 0.8785, 0.90399, 0.8785, 0.90399, 0.8785, 0.90399, 0.8785, 0.96017, 0.95794, 0.77892, 0.85162, 0.77892, 0.78257, 0.79492, 0.78257, 0.79492, 0.78257, 0.79492, 0.9297, 0.56892, 0.83908, 0.88762, 0.77539, 0.8715, 0.87508, 0.89049, 1, 1, 0.81055, 1.04106, 1.20528, 1.20528, 1, 1.15543, 0.70674, 0.98387, 0.94721, 1.33431, 1.45894, 0.95161, 1.06303, 0.83908, 0.80352, 0.57184, 0.6965, 0.56289, 0.82001, 0.56029, 0.81235, 1.02988, 0.83908, 0.7762, 0.68156, 0.80367, 0.73133, 0.78257, 0.87356, 0.86943, 0.95958, 0.75727, 0.89019, 1.04924, 0.9121, 0.7648, 0.86943, 0.87356, 0.79795, 0.78275, 0.81055, 0.77892, 0.9762, 0.82577, 0.99819, 0.84896, 0.95958, 0.77892, 0.96108, 1.01407, 0.89049, 1.02988, 0.94211, 0.96108, 0.8936, 0.84021, 0.87842, 0.96399, 0.79109, 0.89049, 1.00813, 1.02988, 0.86077, 0.87445, 0.92099, 0.84723, 0.86513, 0.8801, 0.75638, 0.85714, 0.78216, 0.79586, 0.87965, 0.94211, 0.97747, 0.78287, 0.97926, 0.84971, 1.02988, 0.94211, 0.8801, 0.94211, 0.84971, 0.73133, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90264, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90518, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90548, 1, 1, 1, 1, 1, 1, 0.96017, 0.95794, 0.96017, 0.95794, 0.96017, 0.95794, 0.77892, 0.85162, 1, 1, 0.89552, 0.90527, 1, 0.90363, 0.92794, 0.92794, 0.92794, 0.92794, 0.87012, 0.87012, 0.87012, 0.89552, 0.89552, 1.42259, 0.71143, 1.06152, 1, 1, 1.03372, 1.03372, 0.97171, 1.4956, 2.2807, 0.93835, 0.83406, 0.91133, 0.84107, 0.91133, 1, 1, 1, 0.72021, 1, 1.23108, 0.83489, 0.88525, 0.88525, 0.81499, 0.90527, 1.81055, 0.90527, 1.81055, 1.31006, 1.53711, 0.94434, 1.08696, 1, 0.95018, 0.77192, 0.85284, 0.90747, 1.17534, 0.69825, 0.9716, 1.37077, 0.90747, 0.90747, 0.85356, 0.90747, 0.90747, 1.44947, 0.85284, 0.8941, 0.8941, 0.70572, 0.8, 0.70572, 0.70572, 0.70572, 0.70572, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.99862, 0.99862, 1, 1, 1, 1, 1, 1.08004, 0.91027, 1, 1, 1, 0.99862, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90727, 0.90727, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; +const CalibriBoldMetrics = { + lineHeight: 1.2207, + lineGap: 0.2207 +}; +const CalibriBoldItalicFactors = [1.3877, 1, 1, 1, 0.97801, 0.92482, 0.89552, 0.91133, 0.81988, 0.97566, 0.98152, 0.93548, 0.93548, 1.2798, 0.85284, 0.92794, 1, 0.96134, 1.56239, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.82845, 0.82845, 0.85284, 0.85284, 0.85284, 0.75859, 0.92138, 0.83908, 0.7762, 0.71805, 0.87289, 0.73133, 0.7514, 0.81921, 0.87356, 0.95958, 0.59526, 0.75727, 0.69225, 1.04924, 0.90872, 0.85938, 0.79795, 0.87068, 0.77958, 0.69766, 0.81055, 0.90399, 0.88653, 0.96068, 0.82577, 0.77892, 0.78257, 0.97507, 1.529, 0.97507, 0.85284, 0.89552, 0.90176, 0.94908, 0.86411, 0.74012, 0.86411, 0.88323, 0.95015, 0.86411, 0.86331, 0.88401, 0.91916, 0.86304, 0.88401, 0.9039, 0.86331, 0.86331, 0.86411, 0.86411, 0.90464, 0.70852, 1.04106, 0.86331, 0.84372, 0.95794, 0.82616, 0.84548, 0.79492, 0.88331, 1.69808, 0.88331, 0.85284, 0.97801, 0.89552, 0.91133, 0.89552, 0.91133, 1.7801, 0.89552, 1.24487, 1.13254, 1.19129, 0.96839, 0.85284, 0.68787, 0.70645, 0.85592, 0.90747, 1.01466, 1.0088, 0.90323, 1, 1.07463, 1, 0.91056, 0.75806, 1.19118, 0.96839, 0.78864, 0.82845, 0.84133, 0.75859, 0.83908, 0.83908, 0.83908, 0.83908, 0.83908, 0.83908, 0.77539, 0.71805, 0.73133, 0.73133, 0.73133, 0.73133, 0.95958, 0.95958, 0.95958, 0.95958, 0.88506, 0.90872, 0.85938, 0.85938, 0.85938, 0.85938, 0.85938, 0.85284, 0.87068, 0.90399, 0.90399, 0.90399, 0.90399, 0.77892, 0.79795, 0.90807, 0.94908, 0.94908, 0.94908, 0.94908, 0.94908, 0.94908, 0.85887, 0.74012, 0.88323, 0.88323, 0.88323, 0.88323, 0.88401, 0.88401, 0.88401, 0.88401, 0.8785, 0.86331, 0.86331, 0.86331, 0.86331, 0.86331, 0.86331, 0.90747, 0.89049, 0.86331, 0.86331, 0.86331, 0.86331, 0.84548, 0.86411, 0.84548, 0.83908, 0.94908, 0.83908, 0.94908, 0.83908, 0.94908, 0.71805, 0.74012, 0.71805, 0.74012, 0.71805, 0.74012, 0.71805, 0.74012, 0.87289, 0.79538, 0.88506, 0.92726, 0.73133, 0.88323, 0.73133, 0.88323, 0.73133, 0.88323, 0.73133, 0.88323, 0.73133, 0.88323, 0.81921, 0.86411, 0.81921, 0.86411, 0.81921, 0.86411, 1, 1, 0.87356, 0.86331, 0.91075, 0.8777, 0.95958, 0.88401, 0.95958, 0.88401, 0.95958, 0.88401, 0.95958, 0.88401, 0.95958, 0.88401, 0.76467, 0.90167, 0.59526, 0.91916, 1, 1, 0.86304, 0.69225, 0.88401, 1, 1, 0.70424, 0.77312, 0.91926, 0.88175, 0.70823, 0.94903, 0.90872, 0.86331, 1, 1, 0.90872, 0.86331, 0.86906, 0.88116, 0.86331, 0.85938, 0.86331, 0.85938, 0.86331, 0.85938, 0.86331, 0.87402, 0.86549, 0.77958, 0.90464, 1, 1, 0.77958, 0.90464, 0.69766, 0.70852, 0.69766, 0.70852, 0.69766, 0.70852, 0.69766, 0.70852, 1, 1, 0.81055, 0.75841, 0.81055, 1.06452, 0.90399, 0.86331, 0.90399, 0.86331, 0.90399, 0.86331, 0.90399, 0.86331, 0.90399, 0.86331, 0.90399, 0.86331, 0.96068, 0.95794, 0.77892, 0.84548, 0.77892, 0.78257, 0.79492, 0.78257, 0.79492, 0.78257, 0.79492, 0.9297, 0.56892, 0.83908, 0.94908, 0.77539, 0.85887, 0.87068, 0.89049, 1, 1, 0.81055, 1.04106, 1.20528, 1.20528, 1, 1.15543, 0.70088, 0.98387, 0.94721, 1.33431, 1.45894, 0.95161, 1.48387, 0.83908, 0.80352, 0.57118, 0.6965, 0.56347, 0.79179, 0.55853, 0.80346, 1.02988, 0.83908, 0.7762, 0.67174, 0.86036, 0.73133, 0.78257, 0.87356, 0.86441, 0.95958, 0.75727, 0.89019, 1.04924, 0.90872, 0.74889, 0.85938, 0.87891, 0.79795, 0.7957, 0.81055, 0.77892, 0.97447, 0.82577, 0.97466, 0.87179, 0.95958, 0.77892, 0.94252, 0.95612, 0.8753, 1.02988, 0.92733, 0.94252, 0.87411, 0.84021, 0.8728, 0.95612, 0.74081, 0.8753, 1.02189, 1.02988, 0.84814, 0.87445, 0.91822, 0.84723, 0.85668, 0.86331, 0.81344, 0.87581, 0.76422, 0.82046, 0.96057, 0.92733, 0.99375, 0.78022, 0.95452, 0.86015, 1.02988, 0.92733, 0.86331, 0.92733, 0.86015, 0.73133, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90631, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.88323, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.85174, 1, 1, 1, 1, 1, 1, 0.96068, 0.95794, 0.96068, 0.95794, 0.96068, 0.95794, 0.77892, 0.84548, 1, 1, 0.89552, 0.90527, 1, 0.90363, 0.92794, 0.92794, 0.92794, 0.89807, 0.87012, 0.87012, 0.87012, 0.89552, 0.89552, 1.42259, 0.71094, 1.06152, 1, 1, 1.03372, 1.03372, 0.97171, 1.4956, 2.2807, 0.92972, 0.83406, 0.91133, 0.83326, 0.91133, 1, 1, 1, 0.72021, 1, 1.23108, 0.83489, 0.88525, 0.88525, 0.81499, 0.90616, 1.81055, 0.90527, 1.81055, 1.3107, 1.53711, 0.94434, 1.08696, 1, 0.95018, 0.77192, 0.85284, 0.90747, 1.17534, 0.69825, 0.9716, 1.37077, 0.90747, 0.90747, 0.85356, 0.90747, 0.90747, 1.44947, 0.85284, 0.8941, 0.8941, 0.70572, 0.8, 0.70572, 0.70572, 0.70572, 0.70572, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.99862, 0.99862, 1, 1, 1, 1, 1, 1.08004, 0.91027, 1, 1, 1, 0.99862, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90727, 0.90727, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; +const CalibriBoldItalicMetrics = { + lineHeight: 1.2207, + lineGap: 0.2207 +}; +const CalibriItalicFactors = [1.3877, 1, 1, 1, 1.17223, 1.1293, 0.89552, 0.91133, 0.80395, 1.02269, 1.15601, 0.91056, 0.91056, 1.2798, 0.85284, 0.89807, 1, 0.90861, 1.39543, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.96309, 0.96309, 0.85284, 0.85284, 0.85284, 0.83319, 0.88071, 0.8675, 0.81552, 0.72346, 0.85193, 0.73206, 0.7522, 0.81105, 0.86275, 0.90685, 0.6377, 0.77892, 0.75593, 1.02638, 0.89249, 0.84118, 0.77452, 0.85374, 0.75186, 0.67789, 0.79776, 0.88844, 0.85066, 0.94309, 0.77818, 0.7306, 0.76659, 1.10369, 1.38313, 1.10369, 1.06139, 0.89552, 0.8739, 0.9245, 0.9245, 0.83203, 0.9245, 0.85865, 1.09842, 0.9245, 0.9245, 1.03297, 1.07692, 0.90918, 1.03297, 0.94959, 0.9245, 0.92274, 0.9245, 0.9245, 1.02933, 0.77832, 1.20562, 0.9245, 0.8916, 0.98986, 0.86621, 0.89453, 0.79004, 0.94152, 1.77256, 0.94152, 0.85284, 0.97801, 0.89552, 0.91133, 0.89552, 0.91133, 1.91729, 0.89552, 1.17889, 1.13254, 1.16359, 0.92098, 0.85284, 0.68787, 0.71353, 0.84737, 0.90747, 1.0088, 1.0044, 0.87683, 1, 1.09091, 1, 0.92229, 0.739, 1.15642, 0.92098, 0.76288, 0.80504, 0.80972, 0.75859, 0.8675, 0.8675, 0.8675, 0.8675, 0.8675, 0.8675, 0.76318, 0.72346, 0.73206, 0.73206, 0.73206, 0.73206, 0.90685, 0.90685, 0.90685, 0.90685, 0.86477, 0.89249, 0.84118, 0.84118, 0.84118, 0.84118, 0.84118, 0.85284, 0.84557, 0.88844, 0.88844, 0.88844, 0.88844, 0.7306, 0.77452, 0.86331, 0.9245, 0.9245, 0.9245, 0.9245, 0.9245, 0.9245, 0.84843, 0.83203, 0.85865, 0.85865, 0.85865, 0.85865, 0.82601, 0.82601, 0.82601, 0.82601, 0.94469, 0.9245, 0.92274, 0.92274, 0.92274, 0.92274, 0.92274, 0.90747, 0.86651, 0.9245, 0.9245, 0.9245, 0.9245, 0.89453, 0.9245, 0.89453, 0.8675, 0.9245, 0.8675, 0.9245, 0.8675, 0.9245, 0.72346, 0.83203, 0.72346, 0.83203, 0.72346, 0.83203, 0.72346, 0.83203, 0.85193, 0.8875, 0.86477, 0.99034, 0.73206, 0.85865, 0.73206, 0.85865, 0.73206, 0.85865, 0.73206, 0.85865, 0.73206, 0.85865, 0.81105, 0.9245, 0.81105, 0.9245, 0.81105, 0.9245, 1, 1, 0.86275, 0.9245, 0.90872, 0.93591, 0.90685, 0.82601, 0.90685, 0.82601, 0.90685, 0.82601, 0.90685, 1.03297, 0.90685, 0.82601, 0.77896, 1.05611, 0.6377, 1.07692, 1, 1, 0.90918, 0.75593, 1.03297, 1, 1, 0.76032, 0.9375, 0.98156, 0.93407, 0.77261, 1.11429, 0.89249, 0.9245, 1, 1, 0.89249, 0.9245, 0.92534, 0.86698, 0.9245, 0.84118, 0.92274, 0.84118, 0.92274, 0.84118, 0.92274, 0.8667, 0.86291, 0.75186, 1.02933, 1, 1, 0.75186, 1.02933, 0.67789, 0.77832, 0.67789, 0.77832, 0.67789, 0.77832, 0.67789, 0.77832, 1, 1, 0.79776, 0.97655, 0.79776, 1.23023, 0.88844, 0.9245, 0.88844, 0.9245, 0.88844, 0.9245, 0.88844, 0.9245, 0.88844, 0.9245, 0.88844, 0.9245, 0.94309, 0.98986, 0.7306, 0.89453, 0.7306, 0.76659, 0.79004, 0.76659, 0.79004, 0.76659, 0.79004, 1.09231, 0.54873, 0.8675, 0.9245, 0.76318, 0.84843, 0.84557, 0.86651, 1, 1, 0.79776, 1.20562, 1.18622, 1.18622, 1, 1.1437, 0.67009, 0.96334, 0.93695, 1.35191, 1.40909, 0.95161, 1.48387, 0.8675, 0.90861, 0.6192, 0.7363, 0.64824, 0.82411, 0.56321, 0.85696, 1.23516, 0.8675, 0.81552, 0.7286, 0.84134, 0.73206, 0.76659, 0.86275, 0.84369, 0.90685, 0.77892, 0.85871, 1.02638, 0.89249, 0.75828, 0.84118, 0.85984, 0.77452, 0.76466, 0.79776, 0.7306, 0.90782, 0.77818, 0.903, 0.87291, 0.90685, 0.7306, 0.99058, 1.03667, 0.94635, 1.23516, 0.9849, 0.99058, 0.92393, 0.8916, 0.942, 1.03667, 0.75026, 0.94635, 1.0297, 1.23516, 0.90918, 0.94048, 0.98217, 0.89746, 0.84153, 0.92274, 0.82507, 0.88832, 0.84438, 0.88178, 1.03525, 0.9849, 1.00225, 0.78086, 0.97248, 0.89404, 1.23516, 0.9849, 0.92274, 0.9849, 0.89404, 0.73206, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.89693, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.85865, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90933, 1, 1, 1, 1, 1, 1, 0.94309, 0.98986, 0.94309, 0.98986, 0.94309, 0.98986, 0.7306, 0.89453, 1, 1, 0.89552, 0.90527, 1, 0.90186, 1.12308, 1.12308, 1.12308, 1.12308, 1.2566, 1.2566, 1.2566, 0.89552, 0.89552, 1.42259, 0.68994, 1.03809, 1, 1, 1.0176, 1.0176, 1.11523, 1.4956, 2.01462, 0.97858, 0.82616, 0.91133, 0.83437, 0.91133, 1, 1, 1, 0.70508, 1, 1.23108, 0.79801, 0.84426, 0.84426, 0.774, 0.90572, 1.81055, 0.90749, 1.81055, 1.28809, 1.55469, 0.94434, 1.07806, 1, 0.97094, 0.7589, 0.85284, 0.90747, 1.19658, 0.69825, 0.97622, 1.33512, 0.90747, 0.90747, 0.85284, 0.90747, 0.90747, 1.44947, 0.85284, 0.8941, 0.8941, 0.70572, 0.8, 0.70572, 0.70572, 0.70572, 0.70572, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.99862, 0.99862, 1, 1, 1, 1, 1, 1.0336, 0.91027, 1, 1, 1, 0.99862, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.05859, 1.05859, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; +const CalibriItalicMetrics = { + lineHeight: 1.2207, + lineGap: 0.2207 +}; +const CalibriRegularFactors = [1.3877, 1, 1, 1, 1.17223, 1.1293, 0.89552, 0.91133, 0.80395, 1.02269, 1.15601, 0.91056, 0.91056, 1.2798, 0.85284, 0.89807, 1, 0.90861, 1.39016, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.96309, 0.96309, 0.85284, 0.85284, 0.85284, 0.83319, 0.88071, 0.8675, 0.81552, 0.73834, 0.85193, 0.73206, 0.7522, 0.81105, 0.86275, 0.90685, 0.6377, 0.77892, 0.75593, 1.02638, 0.89385, 0.85122, 0.77452, 0.86503, 0.75186, 0.68887, 0.79776, 0.88844, 0.85066, 0.94258, 0.77818, 0.7306, 0.76659, 1.10369, 1.39016, 1.10369, 1.06139, 0.89552, 0.8739, 0.86128, 0.94469, 0.8457, 0.94469, 0.89464, 1.09842, 0.84636, 0.94469, 1.03297, 1.07692, 0.90918, 1.03297, 0.95897, 0.94469, 0.9482, 0.94469, 0.94469, 1.04692, 0.78223, 1.20562, 0.94469, 0.90332, 0.98986, 0.86621, 0.90527, 0.79004, 0.94152, 1.77256, 0.94152, 0.85284, 0.97801, 0.89552, 0.91133, 0.89552, 0.91133, 1.91729, 0.89552, 1.17889, 1.13254, 1.08707, 0.92098, 0.85284, 0.68787, 0.71353, 0.84737, 0.90747, 1.0088, 1.0044, 0.87683, 1, 1.09091, 1, 0.92229, 0.739, 1.15642, 0.92098, 0.76288, 0.80504, 0.80972, 0.75859, 0.8675, 0.8675, 0.8675, 0.8675, 0.8675, 0.8675, 0.76318, 0.73834, 0.73206, 0.73206, 0.73206, 0.73206, 0.90685, 0.90685, 0.90685, 0.90685, 0.86477, 0.89385, 0.85122, 0.85122, 0.85122, 0.85122, 0.85122, 0.85284, 0.85311, 0.88844, 0.88844, 0.88844, 0.88844, 0.7306, 0.77452, 0.86331, 0.86128, 0.86128, 0.86128, 0.86128, 0.86128, 0.86128, 0.8693, 0.8457, 0.89464, 0.89464, 0.89464, 0.89464, 0.82601, 0.82601, 0.82601, 0.82601, 0.94469, 0.94469, 0.9482, 0.9482, 0.9482, 0.9482, 0.9482, 0.90747, 0.86651, 0.94469, 0.94469, 0.94469, 0.94469, 0.90527, 0.94469, 0.90527, 0.8675, 0.86128, 0.8675, 0.86128, 0.8675, 0.86128, 0.73834, 0.8457, 0.73834, 0.8457, 0.73834, 0.8457, 0.73834, 0.8457, 0.85193, 0.92454, 0.86477, 0.9921, 0.73206, 0.89464, 0.73206, 0.89464, 0.73206, 0.89464, 0.73206, 0.89464, 0.73206, 0.89464, 0.81105, 0.84636, 0.81105, 0.84636, 0.81105, 0.84636, 1, 1, 0.86275, 0.94469, 0.90872, 0.95786, 0.90685, 0.82601, 0.90685, 0.82601, 0.90685, 0.82601, 0.90685, 1.03297, 0.90685, 0.82601, 0.77741, 1.05611, 0.6377, 1.07692, 1, 1, 0.90918, 0.75593, 1.03297, 1, 1, 0.76032, 0.90452, 0.98156, 1.11842, 0.77261, 1.11429, 0.89385, 0.94469, 1, 1, 0.89385, 0.94469, 0.95877, 0.86901, 0.94469, 0.85122, 0.9482, 0.85122, 0.9482, 0.85122, 0.9482, 0.8667, 0.90016, 0.75186, 1.04692, 1, 1, 0.75186, 1.04692, 0.68887, 0.78223, 0.68887, 0.78223, 0.68887, 0.78223, 0.68887, 0.78223, 1, 1, 0.79776, 0.92188, 0.79776, 1.23023, 0.88844, 0.94469, 0.88844, 0.94469, 0.88844, 0.94469, 0.88844, 0.94469, 0.88844, 0.94469, 0.88844, 0.94469, 0.94258, 0.98986, 0.7306, 0.90527, 0.7306, 0.76659, 0.79004, 0.76659, 0.79004, 0.76659, 0.79004, 1.09231, 0.54873, 0.8675, 0.86128, 0.76318, 0.8693, 0.85311, 0.86651, 1, 1, 0.79776, 1.20562, 1.18622, 1.18622, 1, 1.1437, 0.67742, 0.96334, 0.93695, 1.35191, 1.40909, 0.95161, 1.48387, 0.86686, 0.90861, 0.62267, 0.74359, 0.65649, 0.85498, 0.56963, 0.88254, 1.23516, 0.8675, 0.81552, 0.75443, 0.84503, 0.73206, 0.76659, 0.86275, 0.85122, 0.90685, 0.77892, 0.85746, 1.02638, 0.89385, 0.75657, 0.85122, 0.86275, 0.77452, 0.74171, 0.79776, 0.7306, 0.95165, 0.77818, 0.89772, 0.88831, 0.90685, 0.7306, 0.98142, 1.02191, 0.96576, 1.23516, 0.99018, 0.98142, 0.9236, 0.89258, 0.94035, 1.02191, 0.78848, 0.96576, 0.9561, 1.23516, 0.90918, 0.92578, 0.95424, 0.89746, 0.83969, 0.9482, 0.80113, 0.89442, 0.85208, 0.86155, 0.98022, 0.99018, 1.00452, 0.81209, 0.99247, 0.89181, 1.23516, 0.99018, 0.9482, 0.99018, 0.89181, 0.73206, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.88844, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.89464, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.96766, 1, 1, 1, 1, 1, 1, 0.94258, 0.98986, 0.94258, 0.98986, 0.94258, 0.98986, 0.7306, 0.90527, 1, 1, 0.89552, 0.90527, 1, 0.90186, 1.12308, 1.12308, 1.12308, 1.12308, 1.2566, 1.2566, 1.2566, 0.89552, 0.89552, 1.42259, 0.69043, 1.03809, 1, 1, 1.0176, 1.0176, 1.11523, 1.4956, 2.01462, 0.99331, 0.82616, 0.91133, 0.84286, 0.91133, 1, 1, 1, 0.70508, 1, 1.23108, 0.79801, 0.84426, 0.84426, 0.774, 0.90527, 1.81055, 0.90527, 1.81055, 1.28809, 1.55469, 0.94434, 1.07806, 1, 0.97094, 0.7589, 0.85284, 0.90747, 1.19658, 0.69825, 0.97622, 1.33512, 0.90747, 0.90747, 0.85356, 0.90747, 0.90747, 1.44947, 0.85284, 0.8941, 0.8941, 0.70572, 0.8, 0.70572, 0.70572, 0.70572, 0.70572, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.99862, 0.99862, 1, 1, 1, 1, 1, 1.0336, 0.91027, 1, 1, 1, 0.99862, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.05859, 1.05859, 1, 1, 1, 1.07185, 0.99413, 0.96334, 1.08065, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; +const CalibriRegularMetrics = { + lineHeight: 1.2207, + lineGap: 0.2207 +}; + +;// ./src/core/helvetica_factors.js +const HelveticaBoldFactors = [0.76116, 1, 1, 1.0006, 0.99998, 0.99974, 0.99973, 0.99973, 0.99982, 0.99977, 1.00087, 0.99998, 0.99998, 0.99959, 1.00003, 1.0006, 0.99998, 1.0006, 1.0006, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99998, 1, 1.00003, 1.00003, 1.00003, 1.00026, 0.9999, 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00026, 1.00022, 0.99977, 1.0006, 0.99973, 0.99977, 1.00026, 0.99999, 0.99977, 1.00022, 1.00001, 1.00022, 0.99977, 1.00001, 1.00026, 0.99977, 1.00001, 1.00016, 1.00001, 1.00001, 1.00026, 0.99998, 1.0006, 0.99998, 1.00003, 0.99973, 0.99998, 0.99973, 1.00026, 0.99973, 1.00026, 0.99973, 0.99998, 1.00026, 1.00026, 1.0006, 1.0006, 0.99973, 1.0006, 0.99982, 1.00026, 1.00026, 1.00026, 1.00026, 0.99959, 0.99973, 0.99998, 1.00026, 0.99973, 1.00022, 0.99973, 0.99973, 1, 0.99959, 1.00077, 0.99959, 1.00003, 0.99998, 0.99973, 0.99973, 0.99973, 0.99973, 1.00077, 0.99973, 0.99998, 1.00025, 0.99968, 0.99973, 1.00003, 1.00025, 0.60299, 1.00024, 1.06409, 1, 1, 0.99998, 1, 0.99973, 1.0006, 0.99998, 1, 0.99936, 0.99973, 1.00002, 1.00002, 1.00002, 1.00026, 0.99977, 0.99977, 0.99977, 0.99977, 0.99977, 0.99977, 1, 0.99977, 1.00001, 1.00001, 1.00001, 1.00001, 1.0006, 1.0006, 1.0006, 1.0006, 0.99977, 0.99977, 1.00022, 1.00022, 1.00022, 1.00022, 1.00022, 1.00003, 1.00022, 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00001, 1.00026, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99982, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 1.06409, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 0.99973, 1.00026, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 1.03374, 0.99977, 1.00026, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.00042, 0.99973, 0.99973, 1.0006, 0.99977, 0.99973, 0.99973, 1.00026, 1.0006, 1.00026, 1.0006, 1.00026, 1.03828, 1.00026, 0.99999, 1.00026, 1.0006, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.9993, 0.9998, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 1, 1.00016, 0.99977, 0.99959, 0.99977, 0.99959, 0.99977, 0.99959, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00026, 0.99998, 1.00026, 0.8121, 1.00026, 0.99998, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 1.00016, 1.00022, 1.00001, 0.99973, 1.00001, 1.00026, 1, 1.00026, 1, 1.00026, 1, 1.0006, 0.99973, 0.99977, 0.99973, 1, 0.99982, 1.00022, 1.00026, 1.00001, 0.99973, 1.00026, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 1.00034, 0.99977, 1, 0.99997, 1.00026, 1.00078, 1.00036, 0.99973, 1.00013, 1.0006, 0.99977, 0.99977, 0.99988, 0.85148, 1.00001, 1.00026, 0.99977, 1.00022, 1.0006, 0.99977, 1.00001, 0.99999, 0.99977, 1.00069, 1.00022, 0.99977, 1.00001, 0.99984, 1.00026, 1.00001, 1.00024, 1.00001, 0.9999, 1, 1.0006, 1.00001, 1.00041, 0.99962, 1.00026, 1.0006, 0.99995, 1.00041, 0.99942, 0.99973, 0.99927, 1.00082, 0.99902, 1.00026, 1.00087, 1.0006, 1.00069, 0.99973, 0.99867, 0.99973, 0.9993, 1.00026, 1.00049, 1.00056, 1, 0.99988, 0.99935, 0.99995, 0.99954, 1.00055, 0.99945, 1.00032, 1.0006, 0.99995, 1.00026, 0.99995, 1.00032, 1.00001, 1.00008, 0.99971, 1.00019, 0.9994, 1.00001, 1.0006, 1.00044, 0.99973, 1.00023, 1.00047, 1, 0.99942, 0.99561, 0.99989, 1.00035, 0.99977, 1.00035, 0.99977, 1.00019, 0.99944, 1.00001, 1.00021, 0.99926, 1.00035, 1.00035, 0.99942, 1.00048, 0.99999, 0.99977, 1.00022, 1.00035, 1.00001, 0.99977, 1.00026, 0.99989, 1.00057, 1.00001, 0.99936, 1.00052, 1.00012, 0.99996, 1.00043, 1, 1.00035, 0.9994, 0.99976, 1.00035, 0.99973, 1.00052, 1.00041, 1.00119, 1.00037, 0.99973, 1.00002, 0.99986, 1.00041, 1.00041, 0.99902, 0.9996, 1.00034, 0.99999, 1.00026, 0.99999, 1.00026, 0.99973, 1.00052, 0.99973, 1, 0.99973, 1.00041, 1.00075, 0.9994, 1.0003, 0.99999, 1, 1.00041, 0.99955, 1, 0.99915, 0.99973, 0.99973, 1.00026, 1.00119, 0.99955, 0.99973, 1.0006, 0.99911, 1.0006, 1.00026, 0.99972, 1.00026, 0.99902, 1.00041, 0.99973, 0.99999, 1, 1, 1.00038, 1.0005, 1.00016, 1.00022, 1.00016, 1.00022, 1.00016, 1.00022, 1.00001, 0.99973, 1, 1, 0.99973, 1, 1, 0.99955, 1.0006, 1.0006, 1.0006, 1.0006, 1, 1, 1, 0.99973, 0.99973, 0.99972, 1, 1, 1.00106, 0.99999, 0.99998, 0.99998, 0.99999, 0.99998, 1.66475, 1, 0.99973, 0.99973, 1.00023, 0.99973, 0.99971, 1.00047, 1.00023, 1, 0.99991, 0.99984, 1.00002, 1.00002, 1.00002, 1.00002, 1, 1, 1, 1, 1, 1, 1, 0.99972, 1, 1.20985, 1.39713, 1.00003, 1.00031, 1.00015, 1, 0.99561, 1.00027, 1.00031, 1.00031, 0.99915, 1.00031, 1.00031, 0.99999, 1.00003, 0.99999, 0.99999, 1.41144, 1.6, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.40579, 1.40579, 1.36625, 0.99999, 1, 0.99861, 0.99861, 1, 1.00026, 1.00026, 1.00026, 1.00026, 0.99972, 0.99999, 0.99999, 0.99999, 0.99999, 1.40483, 1, 0.99977, 1.00054, 1, 1, 0.99953, 0.99962, 1.00042, 0.9995, 1, 1, 1, 1, 1, 1, 1, 1, 0.99998, 0.99998, 0.99998, 0.99998, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; +const HelveticaBoldMetrics = { + lineHeight: 1.2, + lineGap: 0.2 +}; +const HelveticaBoldItalicFactors = [0.76116, 1, 1, 1.0006, 0.99998, 0.99974, 0.99973, 0.99973, 0.99982, 0.99977, 1.00087, 0.99998, 0.99998, 0.99959, 1.00003, 1.0006, 0.99998, 1.0006, 1.0006, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99998, 1, 1.00003, 1.00003, 1.00003, 1.00026, 0.9999, 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00026, 1.00022, 0.99977, 1.0006, 0.99973, 0.99977, 1.00026, 0.99999, 0.99977, 1.00022, 1.00001, 1.00022, 0.99977, 1.00001, 1.00026, 0.99977, 1.00001, 1.00016, 1.00001, 1.00001, 1.00026, 0.99998, 1.0006, 0.99998, 1.00003, 0.99973, 0.99998, 0.99973, 1.00026, 0.99973, 1.00026, 0.99973, 0.99998, 1.00026, 1.00026, 1.0006, 1.0006, 0.99973, 1.0006, 0.99982, 1.00026, 1.00026, 1.00026, 1.00026, 0.99959, 0.99973, 0.99998, 1.00026, 0.99973, 1.00022, 0.99973, 0.99973, 1, 0.99959, 1.00077, 0.99959, 1.00003, 0.99998, 0.99973, 0.99973, 0.99973, 0.99973, 1.00077, 0.99973, 0.99998, 1.00025, 0.99968, 0.99973, 1.00003, 1.00025, 0.60299, 1.00024, 1.06409, 1, 1, 0.99998, 1, 0.99973, 1.0006, 0.99998, 1, 0.99936, 0.99973, 1.00002, 1.00002, 1.00002, 1.00026, 0.99977, 0.99977, 0.99977, 0.99977, 0.99977, 0.99977, 1, 0.99977, 1.00001, 1.00001, 1.00001, 1.00001, 1.0006, 1.0006, 1.0006, 1.0006, 0.99977, 0.99977, 1.00022, 1.00022, 1.00022, 1.00022, 1.00022, 1.00003, 1.00022, 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00001, 1.00026, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99982, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 1.06409, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 0.99973, 1.00026, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 1.0044, 0.99977, 1.00026, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 0.99971, 0.99973, 0.99973, 1.0006, 0.99977, 0.99973, 0.99973, 1.00026, 1.0006, 1.00026, 1.0006, 1.00026, 1.01011, 1.00026, 0.99999, 1.00026, 1.0006, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.9993, 0.9998, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 1, 1.00016, 0.99977, 0.99959, 0.99977, 0.99959, 0.99977, 0.99959, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00026, 0.99998, 1.00026, 0.8121, 1.00026, 0.99998, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 1.00016, 1.00022, 1.00001, 0.99973, 1.00001, 1.00026, 1, 1.00026, 1, 1.00026, 1, 1.0006, 0.99973, 0.99977, 0.99973, 1, 0.99982, 1.00022, 1.00026, 1.00001, 0.99973, 1.00026, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99977, 1, 1, 1.00026, 0.99969, 0.99972, 0.99981, 0.9998, 1.0006, 0.99977, 0.99977, 1.00022, 0.91155, 1.00001, 1.00026, 0.99977, 1.00022, 1.0006, 0.99977, 1.00001, 0.99999, 0.99977, 0.99966, 1.00022, 1.00032, 1.00001, 0.99944, 1.00026, 1.00001, 0.99968, 1.00001, 1.00047, 1, 1.0006, 1.00001, 0.99981, 1.00101, 1.00026, 1.0006, 0.99948, 0.99981, 1.00064, 0.99973, 0.99942, 1.00101, 1.00061, 1.00026, 1.00069, 1.0006, 1.00014, 0.99973, 1.01322, 0.99973, 1.00065, 1.00026, 1.00012, 0.99923, 1, 1.00064, 1.00076, 0.99948, 1.00055, 1.00063, 1.00007, 0.99943, 1.0006, 0.99948, 1.00026, 0.99948, 0.99943, 1.00001, 1.00001, 1.00029, 1.00038, 1.00035, 1.00001, 1.0006, 1.0006, 0.99973, 0.99978, 1.00001, 1.00057, 0.99989, 0.99967, 0.99964, 0.99967, 0.99977, 0.99999, 0.99977, 1.00038, 0.99977, 1.00001, 0.99973, 1.00066, 0.99967, 0.99967, 1.00041, 0.99998, 0.99999, 0.99977, 1.00022, 0.99967, 1.00001, 0.99977, 1.00026, 0.99964, 1.00031, 1.00001, 0.99999, 0.99999, 1, 1.00023, 1, 1, 0.99999, 1.00035, 1.00001, 0.99999, 0.99973, 0.99977, 0.99999, 1.00058, 0.99973, 0.99973, 0.99955, 0.9995, 1.00026, 1.00026, 1.00032, 0.99989, 1.00034, 0.99999, 1.00026, 1.00026, 1.00026, 0.99973, 0.45998, 0.99973, 1.00026, 0.99973, 1.00001, 0.99999, 0.99982, 0.99994, 0.99996, 1, 1.00042, 1.00044, 1.00029, 1.00023, 0.99973, 0.99973, 1.00026, 0.99949, 1.00002, 0.99973, 1.0006, 1.0006, 1.0006, 0.99975, 1.00026, 1.00026, 1.00032, 0.98685, 0.99973, 1.00026, 1, 1, 0.99966, 1.00044, 1.00016, 1.00022, 1.00016, 1.00022, 1.00016, 1.00022, 1.00001, 0.99973, 1, 1, 0.99973, 1, 1, 0.99955, 1.0006, 1.0006, 1.0006, 1.0006, 1, 1, 1, 0.99973, 0.99973, 0.99972, 1, 1, 1.00106, 0.99999, 0.99998, 0.99998, 0.99999, 0.99998, 1.66475, 1, 0.99973, 0.99973, 1, 0.99973, 0.99971, 0.99978, 1, 1, 0.99991, 0.99984, 1.00002, 1.00002, 1.00002, 1.00002, 1.00098, 1, 1, 1, 1.00049, 1, 1, 0.99972, 1, 1.20985, 1.39713, 1.00003, 1.00031, 1.00015, 1, 0.99561, 1.00027, 1.00031, 1.00031, 0.99915, 1.00031, 1.00031, 0.99999, 1.00003, 0.99999, 0.99999, 1.41144, 1.6, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.40579, 1.40579, 1.36625, 0.99999, 1, 0.99861, 0.99861, 1, 1.00026, 1.00026, 1.00026, 1.00026, 0.99972, 0.99999, 0.99999, 0.99999, 0.99999, 1.40483, 1, 0.99977, 1.00054, 1, 1, 0.99953, 0.99962, 1.00042, 0.9995, 1, 1, 1, 1, 1, 1, 1, 1, 0.99998, 0.99998, 0.99998, 0.99998, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; +const HelveticaBoldItalicMetrics = { + lineHeight: 1.35, + lineGap: 0.2 +}; +const HelveticaItalicFactors = [0.76116, 1, 1, 1.0006, 1.0006, 1.00006, 0.99973, 0.99973, 0.99982, 1.00001, 1.00043, 0.99998, 0.99998, 0.99959, 1.00003, 1.0006, 0.99998, 1.0006, 1.0006, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 1.0006, 1, 1.00003, 1.00003, 1.00003, 0.99973, 0.99987, 1.00001, 1.00001, 0.99977, 0.99977, 1.00001, 1.00026, 1.00022, 0.99977, 1.0006, 1, 1.00001, 0.99973, 0.99999, 0.99977, 1.00022, 1.00001, 1.00022, 0.99977, 1.00001, 1.00026, 0.99977, 1.00001, 1.00016, 1.00001, 1.00001, 1.00026, 1.0006, 1.0006, 1.0006, 0.99949, 0.99973, 0.99998, 0.99973, 0.99973, 1, 0.99973, 0.99973, 1.0006, 0.99973, 0.99973, 0.99924, 0.99924, 1, 0.99924, 0.99999, 0.99973, 0.99973, 0.99973, 0.99973, 0.99998, 1, 1.0006, 0.99973, 1, 0.99977, 1, 1, 1, 1.00005, 1.0009, 1.00005, 1.00003, 0.99998, 0.99973, 0.99973, 0.99973, 0.99973, 1.0009, 0.99973, 0.99998, 1.00025, 0.99968, 0.99973, 1.00003, 1.00025, 0.60299, 1.00024, 1.06409, 1, 1, 0.99998, 1, 0.9998, 1.0006, 0.99998, 1, 0.99936, 0.99973, 1.00002, 1.00002, 1.00002, 1.00026, 1.00001, 1.00001, 1.00001, 1.00001, 1.00001, 1.00001, 1, 0.99977, 1.00001, 1.00001, 1.00001, 1.00001, 1.0006, 1.0006, 1.0006, 1.0006, 0.99977, 0.99977, 1.00022, 1.00022, 1.00022, 1.00022, 1.00022, 1.00003, 1.00022, 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00001, 1.00026, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99982, 1, 0.99973, 0.99973, 0.99973, 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 1.06409, 1.00026, 0.99973, 0.99973, 0.99973, 0.99973, 1, 0.99973, 1, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 0.99977, 1, 0.99977, 1, 0.99977, 1, 0.99977, 1, 0.99977, 1.0288, 0.99977, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 0.99924, 1.0006, 1.0006, 0.99946, 1.00034, 1, 0.99924, 1.00001, 1, 1, 0.99973, 0.99924, 0.99973, 0.99924, 0.99973, 1.06311, 0.99973, 1.00024, 0.99973, 0.99924, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 1.00041, 0.9998, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1, 1.00016, 0.99977, 0.99998, 0.99977, 0.99998, 0.99977, 0.99998, 1.00001, 1, 1.00001, 1, 1.00001, 1, 1.00001, 1, 1.00026, 1.0006, 1.00026, 0.89547, 1.00026, 1.0006, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 1.00016, 0.99977, 1.00001, 1, 1.00001, 1.00026, 1, 1.00026, 1, 1.00026, 1, 0.99924, 0.99973, 1.00001, 0.99973, 1, 0.99982, 1.00022, 1.00026, 1.00001, 1, 1.00026, 1.0006, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 1.00001, 1, 1.00054, 0.99977, 1.00084, 1.00007, 0.99973, 1.00013, 0.99924, 1.00001, 1.00001, 0.99945, 0.91221, 1.00001, 1.00026, 0.99977, 1.00022, 1.0006, 1.00001, 1.00001, 0.99999, 0.99977, 0.99933, 1.00022, 1.00054, 1.00001, 1.00065, 1.00026, 1.00001, 1.0001, 1.00001, 1.00052, 1, 1.0006, 1.00001, 0.99945, 0.99897, 0.99968, 0.99924, 1.00036, 0.99945, 0.99949, 1, 1.0006, 0.99897, 0.99918, 0.99968, 0.99911, 0.99924, 1, 0.99962, 1.01487, 1, 1.0005, 0.99973, 1.00012, 1.00043, 1, 0.99995, 0.99994, 1.00036, 0.99947, 1.00019, 1.00063, 1.00025, 0.99924, 1.00036, 0.99973, 1.00036, 1.00025, 1.00001, 1.00001, 1.00027, 1.0001, 1.00068, 1.00001, 1.0006, 1.0006, 1, 1.00008, 0.99957, 0.99972, 0.9994, 0.99954, 0.99975, 1.00051, 1.00001, 1.00019, 1.00001, 1.0001, 0.99986, 1.00001, 1.00001, 1.00038, 0.99954, 0.99954, 0.9994, 1.00066, 0.99999, 0.99977, 1.00022, 1.00054, 1.00001, 0.99977, 1.00026, 0.99975, 1.0001, 1.00001, 0.99993, 0.9995, 0.99955, 1.00016, 0.99978, 0.99974, 1.00019, 1.00022, 0.99955, 1.00053, 0.99973, 1.00089, 1.00005, 0.99967, 1.00048, 0.99973, 1.00002, 1.00034, 0.99973, 0.99973, 0.99964, 1.00006, 1.00066, 0.99947, 0.99973, 0.98894, 0.99973, 1, 0.44898, 1, 0.99946, 1, 1.00039, 1.00082, 0.99991, 0.99991, 0.99985, 1.00022, 1.00023, 1.00061, 1.00006, 0.99966, 0.99973, 0.99973, 0.99973, 1.00019, 1.0008, 1, 0.99924, 0.99924, 0.99924, 0.99983, 1.00044, 0.99973, 0.99964, 0.98332, 1, 0.99973, 1, 1, 0.99962, 0.99895, 1.00016, 0.99977, 1.00016, 0.99977, 1.00016, 0.99977, 1.00001, 1, 1, 1, 0.99973, 1, 1, 0.99955, 0.99924, 0.99924, 0.99924, 0.99924, 0.99998, 0.99998, 0.99998, 0.99973, 0.99973, 0.99972, 1, 1, 1.00267, 0.99999, 0.99998, 0.99998, 1, 0.99998, 1.66475, 1, 0.99973, 0.99973, 1.00023, 0.99973, 1.00423, 0.99925, 0.99999, 1, 0.99991, 0.99984, 1.00002, 1.00002, 1.00002, 1.00002, 1.00049, 1, 1.00245, 1, 1, 1, 1, 0.96329, 1, 1.20985, 1.39713, 1.00003, 0.8254, 1.00015, 1, 1.00035, 1.00027, 1.00031, 1.00031, 1.00003, 1.00031, 1.00031, 0.99999, 1.00003, 0.99999, 0.99999, 1.41144, 1.6, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.40579, 1.40579, 1.36625, 0.99999, 1, 0.99861, 0.99861, 1, 1.00026, 1.00026, 1.00026, 1.00026, 0.95317, 0.99999, 0.99999, 0.99999, 0.99999, 1.40483, 1, 0.99977, 1.00054, 1, 1, 0.99953, 0.99962, 1.00042, 0.9995, 1, 1, 1, 1, 1, 1, 1, 1, 0.99998, 0.99998, 0.99998, 0.99998, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; +const HelveticaItalicMetrics = { + lineHeight: 1.35, + lineGap: 0.2 +}; +const HelveticaRegularFactors = [0.76116, 1, 1, 1.0006, 1.0006, 1.00006, 0.99973, 0.99973, 0.99982, 1.00001, 1.00043, 0.99998, 0.99998, 0.99959, 1.00003, 1.0006, 0.99998, 1.0006, 1.0006, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 1.0006, 1, 1.00003, 1.00003, 1.00003, 0.99973, 0.99987, 1.00001, 1.00001, 0.99977, 0.99977, 1.00001, 1.00026, 1.00022, 0.99977, 1.0006, 1, 1.00001, 0.99973, 0.99999, 0.99977, 1.00022, 1.00001, 1.00022, 0.99977, 1.00001, 1.00026, 0.99977, 1.00001, 1.00016, 1.00001, 1.00001, 1.00026, 1.0006, 1.0006, 1.0006, 0.99949, 0.99973, 0.99998, 0.99973, 0.99973, 1, 0.99973, 0.99973, 1.0006, 0.99973, 0.99973, 0.99924, 0.99924, 1, 0.99924, 0.99999, 0.99973, 0.99973, 0.99973, 0.99973, 0.99998, 1, 1.0006, 0.99973, 1, 0.99977, 1, 1, 1, 1.00005, 1.0009, 1.00005, 1.00003, 0.99998, 0.99973, 0.99973, 0.99973, 0.99973, 1.0009, 0.99973, 0.99998, 1.00025, 0.99968, 0.99973, 1.00003, 1.00025, 0.60299, 1.00024, 1.06409, 1, 1, 0.99998, 1, 0.9998, 1.0006, 0.99998, 1, 0.99936, 0.99973, 1.00002, 1.00002, 1.00002, 1.00026, 1.00001, 1.00001, 1.00001, 1.00001, 1.00001, 1.00001, 1, 0.99977, 1.00001, 1.00001, 1.00001, 1.00001, 1.0006, 1.0006, 1.0006, 1.0006, 0.99977, 0.99977, 1.00022, 1.00022, 1.00022, 1.00022, 1.00022, 1.00003, 1.00022, 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00001, 1.00026, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99982, 1, 0.99973, 0.99973, 0.99973, 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 1.06409, 1.00026, 0.99973, 0.99973, 0.99973, 0.99973, 1, 0.99973, 1, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 0.99977, 1, 0.99977, 1, 0.99977, 1, 0.99977, 1, 0.99977, 1.04596, 0.99977, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 0.99924, 1.0006, 1.0006, 1.00019, 1.00034, 1, 0.99924, 1.00001, 1, 1, 0.99973, 0.99924, 0.99973, 0.99924, 0.99973, 1.02572, 0.99973, 1.00005, 0.99973, 0.99924, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99999, 0.9998, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1, 1.00016, 0.99977, 0.99998, 0.99977, 0.99998, 0.99977, 0.99998, 1.00001, 1, 1.00001, 1, 1.00001, 1, 1.00001, 1, 1.00026, 1.0006, 1.00026, 0.84533, 1.00026, 1.0006, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 1.00016, 0.99977, 1.00001, 1, 1.00001, 1.00026, 1, 1.00026, 1, 1.00026, 1, 0.99924, 0.99973, 1.00001, 0.99973, 1, 0.99982, 1.00022, 1.00026, 1.00001, 1, 1.00026, 1.0006, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99928, 1, 0.99977, 1.00013, 1.00055, 0.99947, 0.99945, 0.99941, 0.99924, 1.00001, 1.00001, 1.0004, 0.91621, 1.00001, 1.00026, 0.99977, 1.00022, 1.0006, 1.00001, 1.00005, 0.99999, 0.99977, 1.00015, 1.00022, 0.99977, 1.00001, 0.99973, 1.00026, 1.00001, 1.00019, 1.00001, 0.99946, 1, 1.0006, 1.00001, 0.99978, 1.00045, 0.99973, 0.99924, 1.00023, 0.99978, 0.99966, 1, 1.00065, 1.00045, 1.00019, 0.99973, 0.99973, 0.99924, 1, 1, 0.96499, 1, 1.00055, 0.99973, 1.00008, 1.00027, 1, 0.9997, 0.99995, 1.00023, 0.99933, 1.00019, 1.00015, 1.00031, 0.99924, 1.00023, 0.99973, 1.00023, 1.00031, 1.00001, 0.99928, 1.00029, 1.00092, 1.00035, 1.00001, 1.0006, 1.0006, 1, 0.99988, 0.99975, 1, 1.00082, 0.99561, 0.9996, 1.00035, 1.00001, 0.99962, 1.00001, 1.00092, 0.99964, 1.00001, 0.99963, 0.99999, 1.00035, 1.00035, 1.00082, 0.99962, 0.99999, 0.99977, 1.00022, 1.00035, 1.00001, 0.99977, 1.00026, 0.9996, 0.99967, 1.00001, 1.00034, 1.00074, 1.00054, 1.00053, 1.00063, 0.99971, 0.99962, 1.00035, 0.99975, 0.99977, 0.99973, 1.00043, 0.99953, 1.0007, 0.99915, 0.99973, 1.00008, 0.99892, 1.00073, 1.00073, 1.00114, 0.99915, 1.00073, 0.99955, 0.99973, 1.00092, 0.99973, 1, 0.99998, 1, 1.0003, 1, 1.00043, 1.00001, 0.99969, 1.0003, 1, 1.00035, 1.00001, 0.9995, 1, 1.00092, 0.99973, 0.99973, 0.99973, 1.0007, 0.9995, 1, 0.99924, 1.0006, 0.99924, 0.99972, 1.00062, 0.99973, 1.00114, 1.00073, 1, 0.99955, 1, 1, 1.00047, 0.99968, 1.00016, 0.99977, 1.00016, 0.99977, 1.00016, 0.99977, 1.00001, 1, 1, 1, 0.99973, 1, 1, 0.99955, 0.99924, 0.99924, 0.99924, 0.99924, 0.99998, 0.99998, 0.99998, 0.99973, 0.99973, 0.99972, 1, 1, 1.00267, 0.99999, 0.99998, 0.99998, 1, 0.99998, 1.66475, 1, 0.99973, 0.99973, 1.00023, 0.99973, 0.99971, 0.99925, 1.00023, 1, 0.99991, 0.99984, 1.00002, 1.00002, 1.00002, 1.00002, 1, 1, 1, 1, 1, 1, 1, 0.96329, 1, 1.20985, 1.39713, 1.00003, 0.8254, 1.00015, 1, 1.00035, 1.00027, 1.00031, 1.00031, 0.99915, 1.00031, 1.00031, 0.99999, 1.00003, 0.99999, 0.99999, 1.41144, 1.6, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.40579, 1.40579, 1.36625, 0.99999, 1, 0.99861, 0.99861, 1, 1.00026, 1.00026, 1.00026, 1.00026, 0.95317, 0.99999, 0.99999, 0.99999, 0.99999, 1.40483, 1, 0.99977, 1.00054, 1, 1, 0.99953, 0.99962, 1.00042, 0.9995, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; +const HelveticaRegularMetrics = { + lineHeight: 1.2, + lineGap: 0.2 +}; + +;// ./src/core/liberationsans_widths.js +const LiberationSansBoldWidths = [365, 0, 333, 278, 333, 474, 556, 556, 889, 722, 238, 333, 333, 389, 584, 278, 333, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 333, 333, 584, 584, 584, 611, 975, 722, 722, 722, 722, 667, 611, 778, 722, 278, 556, 722, 611, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667, 611, 333, 278, 333, 584, 556, 333, 556, 611, 556, 611, 556, 333, 611, 611, 278, 278, 556, 278, 889, 611, 611, 611, 611, 389, 556, 333, 611, 556, 778, 556, 556, 500, 389, 280, 389, 584, 333, 556, 556, 556, 556, 280, 556, 333, 737, 370, 556, 584, 737, 552, 400, 549, 333, 333, 333, 576, 556, 278, 333, 333, 365, 556, 834, 834, 834, 611, 722, 722, 722, 722, 722, 722, 1000, 722, 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, 778, 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, 556, 889, 556, 556, 556, 556, 556, 278, 278, 278, 278, 611, 611, 611, 611, 611, 611, 611, 549, 611, 611, 611, 611, 611, 556, 611, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 719, 722, 611, 667, 556, 667, 556, 667, 556, 667, 556, 667, 556, 778, 611, 778, 611, 778, 611, 778, 611, 722, 611, 722, 611, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 785, 556, 556, 278, 722, 556, 556, 611, 278, 611, 278, 611, 385, 611, 479, 611, 278, 722, 611, 722, 611, 722, 611, 708, 723, 611, 778, 611, 778, 611, 778, 611, 1000, 944, 722, 389, 722, 389, 722, 389, 667, 556, 667, 556, 667, 556, 667, 556, 611, 333, 611, 479, 611, 333, 722, 611, 722, 611, 722, 611, 722, 611, 722, 611, 722, 611, 944, 778, 667, 556, 667, 611, 500, 611, 500, 611, 500, 278, 556, 722, 556, 1000, 889, 778, 611, 667, 556, 611, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 465, 722, 333, 853, 906, 474, 825, 927, 838, 278, 722, 722, 601, 719, 667, 611, 722, 778, 278, 722, 667, 833, 722, 644, 778, 722, 667, 600, 611, 667, 821, 667, 809, 802, 278, 667, 615, 451, 611, 278, 582, 615, 610, 556, 606, 475, 460, 611, 541, 278, 558, 556, 612, 556, 445, 611, 766, 619, 520, 684, 446, 582, 715, 576, 753, 845, 278, 582, 611, 582, 845, 667, 669, 885, 567, 711, 667, 278, 276, 556, 1094, 1062, 875, 610, 722, 622, 719, 722, 719, 722, 567, 712, 667, 904, 626, 719, 719, 610, 702, 833, 722, 778, 719, 667, 722, 611, 622, 854, 667, 730, 703, 1005, 1019, 870, 979, 719, 711, 1031, 719, 556, 618, 615, 417, 635, 556, 709, 497, 615, 615, 500, 635, 740, 604, 611, 604, 611, 556, 490, 556, 875, 556, 615, 581, 833, 844, 729, 854, 615, 552, 854, 583, 556, 556, 611, 417, 552, 556, 278, 281, 278, 969, 906, 611, 500, 615, 556, 604, 778, 611, 487, 447, 944, 778, 944, 778, 944, 778, 667, 556, 333, 333, 556, 1000, 1000, 552, 278, 278, 278, 278, 500, 500, 500, 556, 556, 350, 1000, 1000, 240, 479, 333, 333, 604, 333, 167, 396, 556, 556, 1094, 556, 885, 489, 1115, 1000, 768, 600, 834, 834, 834, 834, 1000, 500, 1000, 500, 1000, 500, 500, 494, 612, 823, 713, 584, 549, 713, 979, 722, 274, 549, 549, 583, 549, 549, 604, 584, 604, 604, 708, 625, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 729, 604, 604, 354, 354, 1000, 990, 990, 990, 990, 494, 604, 604, 604, 604, 354, 1021, 1052, 917, 750, 750, 531, 656, 594, 510, 500, 750, 750, 611, 611, 333, 333, 333, 333, 333, 333, 333, 333, 222, 222, 333, 333, 333, 333, 333, 333, 333, 333]; +const LiberationSansBoldMapping = [-1, -1, -1, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 402, 506, 507, 508, 509, 510, 511, 536, 537, 538, 539, 710, 711, 713, 728, 729, 730, 731, 732, 733, 900, 901, 902, 903, 904, 905, 906, 908, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1138, 1139, 1168, 1169, 7808, 7809, 7810, 7811, 7812, 7813, 7922, 7923, 8208, 8209, 8211, 8212, 8213, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8224, 8225, 8226, 8230, 8240, 8242, 8243, 8249, 8250, 8252, 8254, 8260, 8319, 8355, 8356, 8359, 8364, 8453, 8467, 8470, 8482, 8486, 8494, 8539, 8540, 8541, 8542, 8592, 8593, 8594, 8595, 8596, 8597, 8616, 8706, 8710, 8719, 8721, 8722, 8730, 8734, 8735, 8745, 8747, 8776, 8800, 8801, 8804, 8805, 8962, 8976, 8992, 8993, 9472, 9474, 9484, 9488, 9492, 9496, 9500, 9508, 9516, 9524, 9532, 9552, 9553, 9554, 9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 9565, 9566, 9567, 9568, 9569, 9570, 9571, 9572, 9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 9600, 9604, 9608, 9612, 9616, 9617, 9618, 9619, 9632, 9633, 9642, 9643, 9644, 9650, 9658, 9660, 9668, 9674, 9675, 9679, 9688, 9689, 9702, 9786, 9787, 9788, 9792, 9794, 9824, 9827, 9829, 9830, 9834, 9835, 9836, 61441, 61442, 61445, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]; +const LiberationSansBoldItalicWidths = [365, 0, 333, 278, 333, 474, 556, 556, 889, 722, 238, 333, 333, 389, 584, 278, 333, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 333, 333, 584, 584, 584, 611, 975, 722, 722, 722, 722, 667, 611, 778, 722, 278, 556, 722, 611, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667, 611, 333, 278, 333, 584, 556, 333, 556, 611, 556, 611, 556, 333, 611, 611, 278, 278, 556, 278, 889, 611, 611, 611, 611, 389, 556, 333, 611, 556, 778, 556, 556, 500, 389, 280, 389, 584, 333, 556, 556, 556, 556, 280, 556, 333, 737, 370, 556, 584, 737, 552, 400, 549, 333, 333, 333, 576, 556, 278, 333, 333, 365, 556, 834, 834, 834, 611, 722, 722, 722, 722, 722, 722, 1000, 722, 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, 778, 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, 556, 889, 556, 556, 556, 556, 556, 278, 278, 278, 278, 611, 611, 611, 611, 611, 611, 611, 549, 611, 611, 611, 611, 611, 556, 611, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 740, 722, 611, 667, 556, 667, 556, 667, 556, 667, 556, 667, 556, 778, 611, 778, 611, 778, 611, 778, 611, 722, 611, 722, 611, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 782, 556, 556, 278, 722, 556, 556, 611, 278, 611, 278, 611, 396, 611, 479, 611, 278, 722, 611, 722, 611, 722, 611, 708, 723, 611, 778, 611, 778, 611, 778, 611, 1000, 944, 722, 389, 722, 389, 722, 389, 667, 556, 667, 556, 667, 556, 667, 556, 611, 333, 611, 479, 611, 333, 722, 611, 722, 611, 722, 611, 722, 611, 722, 611, 722, 611, 944, 778, 667, 556, 667, 611, 500, 611, 500, 611, 500, 278, 556, 722, 556, 1000, 889, 778, 611, 667, 556, 611, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 722, 333, 854, 906, 473, 844, 930, 847, 278, 722, 722, 610, 671, 667, 611, 722, 778, 278, 722, 667, 833, 722, 657, 778, 718, 667, 590, 611, 667, 822, 667, 829, 781, 278, 667, 620, 479, 611, 278, 591, 620, 621, 556, 610, 479, 492, 611, 558, 278, 566, 556, 603, 556, 450, 611, 712, 605, 532, 664, 409, 591, 704, 578, 773, 834, 278, 591, 611, 591, 834, 667, 667, 886, 614, 719, 667, 278, 278, 556, 1094, 1042, 854, 622, 719, 677, 719, 722, 708, 722, 614, 722, 667, 927, 643, 719, 719, 615, 687, 833, 722, 778, 719, 667, 722, 611, 677, 781, 667, 729, 708, 979, 989, 854, 1000, 708, 719, 1042, 729, 556, 619, 604, 534, 618, 556, 736, 510, 611, 611, 507, 622, 740, 604, 611, 611, 611, 556, 889, 556, 885, 556, 646, 583, 889, 935, 707, 854, 594, 552, 865, 589, 556, 556, 611, 469, 563, 556, 278, 278, 278, 969, 906, 611, 507, 619, 556, 611, 778, 611, 575, 467, 944, 778, 944, 778, 944, 778, 667, 556, 333, 333, 556, 1000, 1000, 552, 278, 278, 278, 278, 500, 500, 500, 556, 556, 350, 1000, 1000, 240, 479, 333, 333, 604, 333, 167, 396, 556, 556, 1104, 556, 885, 516, 1146, 1000, 768, 600, 834, 834, 834, 834, 999, 500, 1000, 500, 1000, 500, 500, 494, 612, 823, 713, 584, 549, 713, 979, 722, 274, 549, 549, 583, 549, 549, 604, 584, 604, 604, 708, 625, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 729, 604, 604, 354, 354, 1000, 990, 990, 990, 990, 494, 604, 604, 604, 604, 354, 1021, 1052, 917, 750, 750, 531, 656, 594, 510, 500, 750, 750, 611, 611, 333, 333, 333, 333, 333, 333, 333, 333, 222, 222, 333, 333, 333, 333, 333, 333, 333, 333]; +const LiberationSansBoldItalicMapping = [-1, -1, -1, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 402, 506, 507, 508, 509, 510, 511, 536, 537, 538, 539, 710, 711, 713, 728, 729, 730, 731, 732, 733, 900, 901, 902, 903, 904, 905, 906, 908, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1138, 1139, 1168, 1169, 7808, 7809, 7810, 7811, 7812, 7813, 7922, 7923, 8208, 8209, 8211, 8212, 8213, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8224, 8225, 8226, 8230, 8240, 8242, 8243, 8249, 8250, 8252, 8254, 8260, 8319, 8355, 8356, 8359, 8364, 8453, 8467, 8470, 8482, 8486, 8494, 8539, 8540, 8541, 8542, 8592, 8593, 8594, 8595, 8596, 8597, 8616, 8706, 8710, 8719, 8721, 8722, 8730, 8734, 8735, 8745, 8747, 8776, 8800, 8801, 8804, 8805, 8962, 8976, 8992, 8993, 9472, 9474, 9484, 9488, 9492, 9496, 9500, 9508, 9516, 9524, 9532, 9552, 9553, 9554, 9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 9565, 9566, 9567, 9568, 9569, 9570, 9571, 9572, 9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 9600, 9604, 9608, 9612, 9616, 9617, 9618, 9619, 9632, 9633, 9642, 9643, 9644, 9650, 9658, 9660, 9668, 9674, 9675, 9679, 9688, 9689, 9702, 9786, 9787, 9788, 9792, 9794, 9824, 9827, 9829, 9830, 9834, 9835, 9836, 61441, 61442, 61445, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]; +const LiberationSansItalicWidths = [365, 0, 333, 278, 278, 355, 556, 556, 889, 667, 191, 333, 333, 389, 584, 278, 333, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 278, 278, 584, 584, 584, 556, 1015, 667, 667, 722, 722, 667, 611, 778, 722, 278, 500, 667, 556, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667, 611, 278, 278, 278, 469, 556, 333, 556, 556, 500, 556, 556, 278, 556, 556, 222, 222, 500, 222, 833, 556, 556, 556, 556, 333, 500, 278, 556, 500, 722, 500, 500, 500, 334, 260, 334, 584, 333, 556, 556, 556, 556, 260, 556, 333, 737, 370, 556, 584, 737, 552, 400, 549, 333, 333, 333, 576, 537, 278, 333, 333, 365, 556, 834, 834, 834, 611, 667, 667, 667, 667, 667, 667, 1000, 722, 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, 778, 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, 556, 889, 500, 556, 556, 556, 556, 278, 278, 278, 278, 556, 556, 556, 556, 556, 556, 556, 549, 611, 556, 556, 556, 556, 500, 556, 500, 667, 556, 667, 556, 667, 556, 722, 500, 722, 500, 722, 500, 722, 500, 722, 625, 722, 556, 667, 556, 667, 556, 667, 556, 667, 556, 667, 556, 778, 556, 778, 556, 778, 556, 778, 556, 722, 556, 722, 556, 278, 278, 278, 278, 278, 278, 278, 222, 278, 278, 733, 444, 500, 222, 667, 500, 500, 556, 222, 556, 222, 556, 281, 556, 400, 556, 222, 722, 556, 722, 556, 722, 556, 615, 723, 556, 778, 556, 778, 556, 778, 556, 1000, 944, 722, 333, 722, 333, 722, 333, 667, 500, 667, 500, 667, 500, 667, 500, 611, 278, 611, 354, 611, 278, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 944, 722, 667, 500, 667, 611, 500, 611, 500, 611, 500, 222, 556, 667, 556, 1000, 889, 778, 611, 667, 500, 611, 278, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 667, 278, 789, 846, 389, 794, 865, 775, 222, 667, 667, 570, 671, 667, 611, 722, 778, 278, 667, 667, 833, 722, 648, 778, 725, 667, 600, 611, 667, 837, 667, 831, 761, 278, 667, 570, 439, 555, 222, 550, 570, 571, 500, 556, 439, 463, 555, 542, 222, 500, 492, 548, 500, 447, 556, 670, 573, 486, 603, 374, 550, 652, 546, 728, 779, 222, 550, 556, 550, 779, 667, 667, 843, 544, 708, 667, 278, 278, 500, 1066, 982, 844, 589, 715, 639, 724, 667, 651, 667, 544, 704, 667, 917, 614, 715, 715, 589, 686, 833, 722, 778, 725, 667, 722, 611, 639, 795, 667, 727, 673, 920, 923, 805, 886, 651, 694, 1022, 682, 556, 562, 522, 493, 553, 556, 688, 465, 556, 556, 472, 564, 686, 550, 556, 556, 556, 500, 833, 500, 835, 500, 572, 518, 830, 851, 621, 736, 526, 492, 752, 534, 556, 556, 556, 378, 496, 500, 222, 222, 222, 910, 828, 556, 472, 565, 500, 556, 778, 556, 492, 339, 944, 722, 944, 722, 944, 722, 667, 500, 333, 333, 556, 1000, 1000, 552, 222, 222, 222, 222, 333, 333, 333, 556, 556, 350, 1000, 1000, 188, 354, 333, 333, 500, 333, 167, 365, 556, 556, 1094, 556, 885, 323, 1083, 1000, 768, 600, 834, 834, 834, 834, 1000, 500, 998, 500, 1000, 500, 500, 494, 612, 823, 713, 584, 549, 713, 979, 719, 274, 549, 549, 584, 549, 549, 604, 584, 604, 604, 708, 625, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 729, 604, 604, 354, 354, 1000, 990, 990, 990, 990, 494, 604, 604, 604, 604, 354, 1021, 1052, 917, 750, 750, 531, 656, 594, 510, 500, 750, 750, 500, 500, 333, 333, 333, 333, 333, 333, 333, 333, 222, 222, 294, 294, 324, 324, 316, 328, 398, 285]; +const LiberationSansItalicMapping = [-1, -1, -1, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 402, 506, 507, 508, 509, 510, 511, 536, 537, 538, 539, 710, 711, 713, 728, 729, 730, 731, 732, 733, 900, 901, 902, 903, 904, 905, 906, 908, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1138, 1139, 1168, 1169, 7808, 7809, 7810, 7811, 7812, 7813, 7922, 7923, 8208, 8209, 8211, 8212, 8213, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8224, 8225, 8226, 8230, 8240, 8242, 8243, 8249, 8250, 8252, 8254, 8260, 8319, 8355, 8356, 8359, 8364, 8453, 8467, 8470, 8482, 8486, 8494, 8539, 8540, 8541, 8542, 8592, 8593, 8594, 8595, 8596, 8597, 8616, 8706, 8710, 8719, 8721, 8722, 8730, 8734, 8735, 8745, 8747, 8776, 8800, 8801, 8804, 8805, 8962, 8976, 8992, 8993, 9472, 9474, 9484, 9488, 9492, 9496, 9500, 9508, 9516, 9524, 9532, 9552, 9553, 9554, 9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 9565, 9566, 9567, 9568, 9569, 9570, 9571, 9572, 9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 9600, 9604, 9608, 9612, 9616, 9617, 9618, 9619, 9632, 9633, 9642, 9643, 9644, 9650, 9658, 9660, 9668, 9674, 9675, 9679, 9688, 9689, 9702, 9786, 9787, 9788, 9792, 9794, 9824, 9827, 9829, 9830, 9834, 9835, 9836, 61441, 61442, 61445, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]; +const LiberationSansRegularWidths = [365, 0, 333, 278, 278, 355, 556, 556, 889, 667, 191, 333, 333, 389, 584, 278, 333, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 278, 278, 584, 584, 584, 556, 1015, 667, 667, 722, 722, 667, 611, 778, 722, 278, 500, 667, 556, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667, 611, 278, 278, 278, 469, 556, 333, 556, 556, 500, 556, 556, 278, 556, 556, 222, 222, 500, 222, 833, 556, 556, 556, 556, 333, 500, 278, 556, 500, 722, 500, 500, 500, 334, 260, 334, 584, 333, 556, 556, 556, 556, 260, 556, 333, 737, 370, 556, 584, 737, 552, 400, 549, 333, 333, 333, 576, 537, 278, 333, 333, 365, 556, 834, 834, 834, 611, 667, 667, 667, 667, 667, 667, 1000, 722, 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, 778, 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, 556, 889, 500, 556, 556, 556, 556, 278, 278, 278, 278, 556, 556, 556, 556, 556, 556, 556, 549, 611, 556, 556, 556, 556, 500, 556, 500, 667, 556, 667, 556, 667, 556, 722, 500, 722, 500, 722, 500, 722, 500, 722, 615, 722, 556, 667, 556, 667, 556, 667, 556, 667, 556, 667, 556, 778, 556, 778, 556, 778, 556, 778, 556, 722, 556, 722, 556, 278, 278, 278, 278, 278, 278, 278, 222, 278, 278, 735, 444, 500, 222, 667, 500, 500, 556, 222, 556, 222, 556, 292, 556, 334, 556, 222, 722, 556, 722, 556, 722, 556, 604, 723, 556, 778, 556, 778, 556, 778, 556, 1000, 944, 722, 333, 722, 333, 722, 333, 667, 500, 667, 500, 667, 500, 667, 500, 611, 278, 611, 375, 611, 278, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 944, 722, 667, 500, 667, 611, 500, 611, 500, 611, 500, 222, 556, 667, 556, 1000, 889, 778, 611, 667, 500, 611, 278, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 667, 278, 784, 838, 384, 774, 855, 752, 222, 667, 667, 551, 668, 667, 611, 722, 778, 278, 667, 668, 833, 722, 650, 778, 722, 667, 618, 611, 667, 798, 667, 835, 748, 278, 667, 578, 446, 556, 222, 547, 578, 575, 500, 557, 446, 441, 556, 556, 222, 500, 500, 576, 500, 448, 556, 690, 569, 482, 617, 395, 547, 648, 525, 713, 781, 222, 547, 556, 547, 781, 667, 667, 865, 542, 719, 667, 278, 278, 500, 1057, 1010, 854, 583, 722, 635, 719, 667, 656, 667, 542, 677, 667, 923, 604, 719, 719, 583, 656, 833, 722, 778, 719, 667, 722, 611, 635, 760, 667, 740, 667, 917, 938, 792, 885, 656, 719, 1010, 722, 556, 573, 531, 365, 583, 556, 669, 458, 559, 559, 438, 583, 688, 552, 556, 542, 556, 500, 458, 500, 823, 500, 573, 521, 802, 823, 625, 719, 521, 510, 750, 542, 556, 556, 556, 365, 510, 500, 222, 278, 222, 906, 812, 556, 438, 559, 500, 552, 778, 556, 489, 411, 944, 722, 944, 722, 944, 722, 667, 500, 333, 333, 556, 1000, 1000, 552, 222, 222, 222, 222, 333, 333, 333, 556, 556, 350, 1000, 1000, 188, 354, 333, 333, 500, 333, 167, 365, 556, 556, 1094, 556, 885, 323, 1073, 1000, 768, 600, 834, 834, 834, 834, 1000, 500, 1000, 500, 1000, 500, 500, 494, 612, 823, 713, 584, 549, 713, 979, 719, 274, 549, 549, 583, 549, 549, 604, 584, 604, 604, 708, 625, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 729, 604, 604, 354, 354, 1000, 990, 990, 990, 990, 494, 604, 604, 604, 604, 354, 1021, 1052, 917, 750, 750, 531, 656, 594, 510, 500, 750, 750, 500, 500, 333, 333, 333, 333, 333, 333, 333, 333, 222, 222, 294, 294, 324, 324, 316, 328, 398, 285]; +const LiberationSansRegularMapping = [-1, -1, -1, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 402, 506, 507, 508, 509, 510, 511, 536, 537, 538, 539, 710, 711, 713, 728, 729, 730, 731, 732, 733, 900, 901, 902, 903, 904, 905, 906, 908, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1138, 1139, 1168, 1169, 7808, 7809, 7810, 7811, 7812, 7813, 7922, 7923, 8208, 8209, 8211, 8212, 8213, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8224, 8225, 8226, 8230, 8240, 8242, 8243, 8249, 8250, 8252, 8254, 8260, 8319, 8355, 8356, 8359, 8364, 8453, 8467, 8470, 8482, 8486, 8494, 8539, 8540, 8541, 8542, 8592, 8593, 8594, 8595, 8596, 8597, 8616, 8706, 8710, 8719, 8721, 8722, 8730, 8734, 8735, 8745, 8747, 8776, 8800, 8801, 8804, 8805, 8962, 8976, 8992, 8993, 9472, 9474, 9484, 9488, 9492, 9496, 9500, 9508, 9516, 9524, 9532, 9552, 9553, 9554, 9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 9565, 9566, 9567, 9568, 9569, 9570, 9571, 9572, 9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 9600, 9604, 9608, 9612, 9616, 9617, 9618, 9619, 9632, 9633, 9642, 9643, 9644, 9650, 9658, 9660, 9668, 9674, 9675, 9679, 9688, 9689, 9702, 9786, 9787, 9788, 9792, 9794, 9824, 9827, 9829, 9830, 9834, 9835, 9836, 61441, 61442, 61445, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]; + +;// ./src/core/myriadpro_factors.js +const MyriadProBoldFactors = [1.36898, 1, 1, 0.72706, 0.80479, 0.83734, 0.98894, 0.99793, 0.9897, 0.93884, 0.86209, 0.94292, 0.94292, 1.16661, 1.02058, 0.93582, 0.96694, 0.93582, 1.19137, 0.99793, 0.99793, 0.99793, 0.99793, 0.99793, 0.99793, 0.99793, 0.99793, 0.99793, 0.99793, 0.78076, 0.78076, 1.02058, 1.02058, 1.02058, 0.72851, 0.78966, 0.90838, 0.83637, 0.82391, 0.96376, 0.80061, 0.86275, 0.8768, 0.95407, 1.0258, 0.73901, 0.85022, 0.83655, 1.0156, 0.95546, 0.92179, 0.87107, 0.92179, 0.82114, 0.8096, 0.89713, 0.94438, 0.95353, 0.94083, 0.91905, 0.90406, 0.9446, 0.94292, 1.18777, 0.94292, 1.02058, 0.89903, 0.90088, 0.94938, 0.97898, 0.81093, 0.97571, 0.94938, 1.024, 0.9577, 0.95933, 0.98621, 1.0474, 0.97455, 0.98981, 0.9672, 0.95933, 0.9446, 0.97898, 0.97407, 0.97646, 0.78036, 1.10208, 0.95442, 0.95298, 0.97579, 0.9332, 0.94039, 0.938, 0.80687, 1.01149, 0.80687, 1.02058, 0.80479, 0.99793, 0.99793, 0.99793, 0.99793, 1.01149, 1.00872, 0.90088, 0.91882, 1.0213, 0.8361, 1.02058, 0.62295, 0.54324, 0.89022, 1.08595, 1, 1, 0.90088, 1, 0.97455, 0.93582, 0.90088, 1, 1.05686, 0.8361, 0.99642, 0.99642, 0.99642, 0.72851, 0.90838, 0.90838, 0.90838, 0.90838, 0.90838, 0.90838, 0.868, 0.82391, 0.80061, 0.80061, 0.80061, 0.80061, 1.0258, 1.0258, 1.0258, 1.0258, 0.97484, 0.95546, 0.92179, 0.92179, 0.92179, 0.92179, 0.92179, 1.02058, 0.92179, 0.94438, 0.94438, 0.94438, 0.94438, 0.90406, 0.86958, 0.98225, 0.94938, 0.94938, 0.94938, 0.94938, 0.94938, 0.94938, 0.9031, 0.81093, 0.94938, 0.94938, 0.94938, 0.94938, 0.98621, 0.98621, 0.98621, 0.98621, 0.93969, 0.95933, 0.9446, 0.9446, 0.9446, 0.9446, 0.9446, 1.08595, 0.9446, 0.95442, 0.95442, 0.95442, 0.95442, 0.94039, 0.97898, 0.94039, 0.90838, 0.94938, 0.90838, 0.94938, 0.90838, 0.94938, 0.82391, 0.81093, 0.82391, 0.81093, 0.82391, 0.81093, 0.82391, 0.81093, 0.96376, 0.84313, 0.97484, 0.97571, 0.80061, 0.94938, 0.80061, 0.94938, 0.80061, 0.94938, 0.80061, 0.94938, 0.80061, 0.94938, 0.8768, 0.9577, 0.8768, 0.9577, 0.8768, 0.9577, 1, 1, 0.95407, 0.95933, 0.97069, 0.95933, 1.0258, 0.98621, 1.0258, 0.98621, 1.0258, 0.98621, 1.0258, 0.98621, 1.0258, 0.98621, 0.887, 1.01591, 0.73901, 1.0474, 1, 1, 0.97455, 0.83655, 0.98981, 1, 1, 0.83655, 0.73977, 0.83655, 0.73903, 0.84638, 1.033, 0.95546, 0.95933, 1, 1, 0.95546, 0.95933, 0.8271, 0.95417, 0.95933, 0.92179, 0.9446, 0.92179, 0.9446, 0.92179, 0.9446, 0.936, 0.91964, 0.82114, 0.97646, 1, 1, 0.82114, 0.97646, 0.8096, 0.78036, 0.8096, 0.78036, 1, 1, 0.8096, 0.78036, 1, 1, 0.89713, 0.77452, 0.89713, 1.10208, 0.94438, 0.95442, 0.94438, 0.95442, 0.94438, 0.95442, 0.94438, 0.95442, 0.94438, 0.95442, 0.94438, 0.95442, 0.94083, 0.97579, 0.90406, 0.94039, 0.90406, 0.9446, 0.938, 0.9446, 0.938, 0.9446, 0.938, 1, 0.99793, 0.90838, 0.94938, 0.868, 0.9031, 0.92179, 0.9446, 1, 1, 0.89713, 1.10208, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90989, 0.9358, 0.91945, 0.83181, 0.75261, 0.87992, 0.82976, 0.96034, 0.83689, 0.97268, 1.0078, 0.90838, 0.83637, 0.8019, 0.90157, 0.80061, 0.9446, 0.95407, 0.92436, 1.0258, 0.85022, 0.97153, 1.0156, 0.95546, 0.89192, 0.92179, 0.92361, 0.87107, 0.96318, 0.89713, 0.93704, 0.95638, 0.91905, 0.91709, 0.92796, 1.0258, 0.93704, 0.94836, 1.0373, 0.95933, 1.0078, 0.95871, 0.94836, 0.96174, 0.92601, 0.9498, 0.98607, 0.95776, 0.95933, 1.05453, 1.0078, 0.98275, 0.9314, 0.95617, 0.91701, 1.05993, 0.9446, 0.78367, 0.9553, 1, 0.86832, 1.0128, 0.95871, 0.99394, 0.87548, 0.96361, 0.86774, 1.0078, 0.95871, 0.9446, 0.95871, 0.86774, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.94083, 0.97579, 0.94083, 0.97579, 0.94083, 0.97579, 0.90406, 0.94039, 0.96694, 1, 0.89903, 1, 1, 1, 0.93582, 0.93582, 0.93582, 1, 0.908, 0.908, 0.918, 0.94219, 0.94219, 0.96544, 1, 1.285, 1, 1, 0.81079, 0.81079, 1, 1, 0.74854, 1, 1, 1, 1, 0.99793, 1, 1, 1, 0.65, 1, 1.36145, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.17173, 1, 0.80535, 0.76169, 1.02058, 1.0732, 1.05486, 1, 1, 1.30692, 1.08595, 1.08595, 1, 1.08595, 1.08595, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.16161, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; +const MyriadProBoldMetrics = { + lineHeight: 1.2, + lineGap: 0.2 +}; +const MyriadProBoldItalicFactors = [1.36898, 1, 1, 0.66227, 0.80779, 0.81625, 0.97276, 0.97276, 0.97733, 0.92222, 0.83266, 0.94292, 0.94292, 1.16148, 1.02058, 0.93582, 0.96694, 0.93582, 1.17337, 0.97276, 0.97276, 0.97276, 0.97276, 0.97276, 0.97276, 0.97276, 0.97276, 0.97276, 0.97276, 0.78076, 0.78076, 1.02058, 1.02058, 1.02058, 0.71541, 0.76813, 0.85576, 0.80591, 0.80729, 0.94299, 0.77512, 0.83655, 0.86523, 0.92222, 0.98621, 0.71743, 0.81698, 0.79726, 0.98558, 0.92222, 0.90637, 0.83809, 0.90637, 0.80729, 0.76463, 0.86275, 0.90699, 0.91605, 0.9154, 0.85308, 0.85458, 0.90531, 0.94292, 1.21296, 0.94292, 1.02058, 0.89903, 1.18616, 0.99613, 0.91677, 0.78216, 0.91677, 0.90083, 0.98796, 0.9135, 0.92168, 0.95381, 0.98981, 0.95298, 0.95381, 0.93459, 0.92168, 0.91513, 0.92004, 0.91677, 0.95077, 0.748, 1.04502, 0.91677, 0.92061, 0.94236, 0.89544, 0.89364, 0.9, 0.80687, 0.8578, 0.80687, 1.02058, 0.80779, 0.97276, 0.97276, 0.97276, 0.97276, 0.8578, 0.99973, 1.18616, 0.91339, 1.08074, 0.82891, 1.02058, 0.55509, 0.71526, 0.89022, 1.08595, 1, 1, 1.18616, 1, 0.96736, 0.93582, 1.18616, 1, 1.04864, 0.82711, 0.99043, 0.99043, 0.99043, 0.71541, 0.85576, 0.85576, 0.85576, 0.85576, 0.85576, 0.85576, 0.845, 0.80729, 0.77512, 0.77512, 0.77512, 0.77512, 0.98621, 0.98621, 0.98621, 0.98621, 0.95961, 0.92222, 0.90637, 0.90637, 0.90637, 0.90637, 0.90637, 1.02058, 0.90251, 0.90699, 0.90699, 0.90699, 0.90699, 0.85458, 0.83659, 0.94951, 0.99613, 0.99613, 0.99613, 0.99613, 0.99613, 0.99613, 0.85811, 0.78216, 0.90083, 0.90083, 0.90083, 0.90083, 0.95381, 0.95381, 0.95381, 0.95381, 0.9135, 0.92168, 0.91513, 0.91513, 0.91513, 0.91513, 0.91513, 1.08595, 0.91677, 0.91677, 0.91677, 0.91677, 0.91677, 0.89364, 0.92332, 0.89364, 0.85576, 0.99613, 0.85576, 0.99613, 0.85576, 0.99613, 0.80729, 0.78216, 0.80729, 0.78216, 0.80729, 0.78216, 0.80729, 0.78216, 0.94299, 0.76783, 0.95961, 0.91677, 0.77512, 0.90083, 0.77512, 0.90083, 0.77512, 0.90083, 0.77512, 0.90083, 0.77512, 0.90083, 0.86523, 0.9135, 0.86523, 0.9135, 0.86523, 0.9135, 1, 1, 0.92222, 0.92168, 0.92222, 0.92168, 0.98621, 0.95381, 0.98621, 0.95381, 0.98621, 0.95381, 0.98621, 0.95381, 0.98621, 0.95381, 0.86036, 0.97096, 0.71743, 0.98981, 1, 1, 0.95298, 0.79726, 0.95381, 1, 1, 0.79726, 0.6894, 0.79726, 0.74321, 0.81691, 1.0006, 0.92222, 0.92168, 1, 1, 0.92222, 0.92168, 0.79464, 0.92098, 0.92168, 0.90637, 0.91513, 0.90637, 0.91513, 0.90637, 0.91513, 0.909, 0.87514, 0.80729, 0.95077, 1, 1, 0.80729, 0.95077, 0.76463, 0.748, 0.76463, 0.748, 1, 1, 0.76463, 0.748, 1, 1, 0.86275, 0.72651, 0.86275, 1.04502, 0.90699, 0.91677, 0.90699, 0.91677, 0.90699, 0.91677, 0.90699, 0.91677, 0.90699, 0.91677, 0.90699, 0.91677, 0.9154, 0.94236, 0.85458, 0.89364, 0.85458, 0.90531, 0.9, 0.90531, 0.9, 0.90531, 0.9, 1, 0.97276, 0.85576, 0.99613, 0.845, 0.85811, 0.90251, 0.91677, 1, 1, 0.86275, 1.04502, 1.18616, 1.18616, 1.18616, 1.18616, 1.18616, 1.18616, 1.18616, 1.18616, 1.18616, 1.00899, 1.30628, 0.85576, 0.80178, 0.66862, 0.7927, 0.69323, 0.88127, 0.72459, 0.89711, 0.95381, 0.85576, 0.80591, 0.7805, 0.94729, 0.77512, 0.90531, 0.92222, 0.90637, 0.98621, 0.81698, 0.92655, 0.98558, 0.92222, 0.85359, 0.90637, 0.90976, 0.83809, 0.94523, 0.86275, 0.83509, 0.93157, 0.85308, 0.83392, 0.92346, 0.98621, 0.83509, 0.92886, 0.91324, 0.92168, 0.95381, 0.90646, 0.92886, 0.90557, 0.86847, 0.90276, 0.91324, 0.86842, 0.92168, 0.99531, 0.95381, 0.9224, 0.85408, 0.92699, 0.86847, 1.0051, 0.91513, 0.80487, 0.93481, 1, 0.88159, 1.05214, 0.90646, 0.97355, 0.81539, 0.89398, 0.85923, 0.95381, 0.90646, 0.91513, 0.90646, 0.85923, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.9154, 0.94236, 0.9154, 0.94236, 0.9154, 0.94236, 0.85458, 0.89364, 0.96694, 1, 0.89903, 1, 1, 1, 0.91782, 0.91782, 0.91782, 1, 0.896, 0.896, 0.896, 0.9332, 0.9332, 0.95973, 1, 1.26, 1, 1, 0.80479, 0.80178, 1, 1, 0.85633, 1, 1, 1, 1, 0.97276, 1, 1, 1, 0.698, 1, 1.36145, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.14542, 1, 0.79199, 0.78694, 1.02058, 1.03493, 1.05486, 1, 1, 1.23026, 1.08595, 1.08595, 1, 1.08595, 1.08595, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.20006, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; +const MyriadProBoldItalicMetrics = { + lineHeight: 1.2, + lineGap: 0.2 +}; +const MyriadProItalicFactors = [1.36898, 1, 1, 0.65507, 0.84943, 0.85639, 0.88465, 0.88465, 0.86936, 0.88307, 0.86948, 0.85283, 0.85283, 1.06383, 1.02058, 0.75945, 0.9219, 0.75945, 1.17337, 0.88465, 0.88465, 0.88465, 0.88465, 0.88465, 0.88465, 0.88465, 0.88465, 0.88465, 0.88465, 0.75945, 0.75945, 1.02058, 1.02058, 1.02058, 0.69046, 0.70926, 0.85158, 0.77812, 0.76852, 0.89591, 0.70466, 0.76125, 0.80094, 0.86822, 0.83864, 0.728, 0.77212, 0.79475, 0.93637, 0.87514, 0.8588, 0.76013, 0.8588, 0.72421, 0.69866, 0.77598, 0.85991, 0.80811, 0.87832, 0.78112, 0.77512, 0.8562, 1.0222, 1.18417, 1.0222, 1.27014, 0.89903, 1.15012, 0.93859, 0.94399, 0.846, 0.94399, 0.81453, 1.0186, 0.94219, 0.96017, 1.03075, 1.02175, 0.912, 1.03075, 0.96998, 0.96017, 0.93859, 0.94399, 0.94399, 0.95493, 0.746, 1.12658, 0.94578, 0.91, 0.979, 0.882, 0.882, 0.83, 0.85034, 0.83537, 0.85034, 1.02058, 0.70869, 0.88465, 0.88465, 0.88465, 0.88465, 0.83537, 0.90083, 1.15012, 0.9161, 0.94565, 0.73541, 1.02058, 0.53609, 0.69353, 0.79519, 1.08595, 1, 1, 1.15012, 1, 0.91974, 0.75945, 1.15012, 1, 0.9446, 0.73361, 0.9005, 0.9005, 0.9005, 0.62864, 0.85158, 0.85158, 0.85158, 0.85158, 0.85158, 0.85158, 0.773, 0.76852, 0.70466, 0.70466, 0.70466, 0.70466, 0.83864, 0.83864, 0.83864, 0.83864, 0.90561, 0.87514, 0.8588, 0.8588, 0.8588, 0.8588, 0.8588, 1.02058, 0.85751, 0.85991, 0.85991, 0.85991, 0.85991, 0.77512, 0.76013, 0.88075, 0.93859, 0.93859, 0.93859, 0.93859, 0.93859, 0.93859, 0.8075, 0.846, 0.81453, 0.81453, 0.81453, 0.81453, 0.82424, 0.82424, 0.82424, 0.82424, 0.9278, 0.96017, 0.93859, 0.93859, 0.93859, 0.93859, 0.93859, 1.08595, 0.8562, 0.94578, 0.94578, 0.94578, 0.94578, 0.882, 0.94578, 0.882, 0.85158, 0.93859, 0.85158, 0.93859, 0.85158, 0.93859, 0.76852, 0.846, 0.76852, 0.846, 0.76852, 0.846, 0.76852, 0.846, 0.89591, 0.8544, 0.90561, 0.94399, 0.70466, 0.81453, 0.70466, 0.81453, 0.70466, 0.81453, 0.70466, 0.81453, 0.70466, 0.81453, 0.80094, 0.94219, 0.80094, 0.94219, 0.80094, 0.94219, 1, 1, 0.86822, 0.96017, 0.86822, 0.96017, 0.83864, 0.82424, 0.83864, 0.82424, 0.83864, 0.82424, 0.83864, 1.03075, 0.83864, 0.82424, 0.81402, 1.02738, 0.728, 1.02175, 1, 1, 0.912, 0.79475, 1.03075, 1, 1, 0.79475, 0.83911, 0.79475, 0.66266, 0.80553, 1.06676, 0.87514, 0.96017, 1, 1, 0.87514, 0.96017, 0.86865, 0.87396, 0.96017, 0.8588, 0.93859, 0.8588, 0.93859, 0.8588, 0.93859, 0.867, 0.84759, 0.72421, 0.95493, 1, 1, 0.72421, 0.95493, 0.69866, 0.746, 0.69866, 0.746, 1, 1, 0.69866, 0.746, 1, 1, 0.77598, 0.88417, 0.77598, 1.12658, 0.85991, 0.94578, 0.85991, 0.94578, 0.85991, 0.94578, 0.85991, 0.94578, 0.85991, 0.94578, 0.85991, 0.94578, 0.87832, 0.979, 0.77512, 0.882, 0.77512, 0.8562, 0.83, 0.8562, 0.83, 0.8562, 0.83, 1, 0.88465, 0.85158, 0.93859, 0.773, 0.8075, 0.85751, 0.8562, 1, 1, 0.77598, 1.12658, 1.15012, 1.15012, 1.15012, 1.15012, 1.15012, 1.15313, 1.15012, 1.15012, 1.15012, 1.08106, 1.03901, 0.85158, 0.77025, 0.62264, 0.7646, 0.65351, 0.86026, 0.69461, 0.89947, 1.03075, 0.85158, 0.77812, 0.76449, 0.88836, 0.70466, 0.8562, 0.86822, 0.8588, 0.83864, 0.77212, 0.85308, 0.93637, 0.87514, 0.82352, 0.8588, 0.85701, 0.76013, 0.89058, 0.77598, 0.8156, 0.82565, 0.78112, 0.77899, 0.89386, 0.83864, 0.8156, 0.9486, 0.92388, 0.96186, 1.03075, 0.91123, 0.9486, 0.93298, 0.878, 0.93942, 0.92388, 0.84596, 0.96186, 0.95119, 1.03075, 0.922, 0.88787, 0.95829, 0.88, 0.93559, 0.93859, 0.78815, 0.93758, 1, 0.89217, 1.03737, 0.91123, 0.93969, 0.77487, 0.85769, 0.86799, 1.03075, 0.91123, 0.93859, 0.91123, 0.86799, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.87832, 0.979, 0.87832, 0.979, 0.87832, 0.979, 0.77512, 0.882, 0.9219, 1, 0.89903, 1, 1, 1, 0.87321, 0.87321, 0.87321, 1, 1.027, 1.027, 1.027, 0.86847, 0.86847, 0.79121, 1, 1.124, 1, 1, 0.73572, 0.73572, 1, 1, 0.85034, 1, 1, 1, 1, 0.88465, 1, 1, 1, 0.669, 1, 1.36145, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.04828, 1, 0.74948, 0.75187, 1.02058, 0.98391, 1.02119, 1, 1, 1.06233, 1.08595, 1.08595, 1, 1.08595, 1.08595, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.05233, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; +const MyriadProItalicMetrics = { + lineHeight: 1.2, + lineGap: 0.2 +}; +const MyriadProRegularFactors = [1.36898, 1, 1, 0.76305, 0.82784, 0.94935, 0.89364, 0.92241, 0.89073, 0.90706, 0.98472, 0.85283, 0.85283, 1.0664, 1.02058, 0.74505, 0.9219, 0.74505, 1.23456, 0.92241, 0.92241, 0.92241, 0.92241, 0.92241, 0.92241, 0.92241, 0.92241, 0.92241, 0.92241, 0.74505, 0.74505, 1.02058, 1.02058, 1.02058, 0.73002, 0.72601, 0.91755, 0.8126, 0.80314, 0.92222, 0.73764, 0.79726, 0.83051, 0.90284, 0.86023, 0.74, 0.8126, 0.84869, 0.96518, 0.91115, 0.8858, 0.79761, 0.8858, 0.74498, 0.73914, 0.81363, 0.89591, 0.83659, 0.89633, 0.85608, 0.8111, 0.90531, 1.0222, 1.22736, 1.0222, 1.27014, 0.89903, 0.90088, 0.86667, 1.0231, 0.896, 1.01411, 0.90083, 1.05099, 1.00512, 0.99793, 1.05326, 1.09377, 0.938, 1.06226, 1.00119, 0.99793, 0.98714, 1.0231, 1.01231, 0.98196, 0.792, 1.19137, 0.99074, 0.962, 1.01915, 0.926, 0.942, 0.856, 0.85034, 0.92006, 0.85034, 1.02058, 0.69067, 0.92241, 0.92241, 0.92241, 0.92241, 0.92006, 0.9332, 0.90088, 0.91882, 0.93484, 0.75339, 1.02058, 0.56866, 0.54324, 0.79519, 1.08595, 1, 1, 0.90088, 1, 0.95325, 0.74505, 0.90088, 1, 0.97198, 0.75339, 0.91009, 0.91009, 0.91009, 0.66466, 0.91755, 0.91755, 0.91755, 0.91755, 0.91755, 0.91755, 0.788, 0.80314, 0.73764, 0.73764, 0.73764, 0.73764, 0.86023, 0.86023, 0.86023, 0.86023, 0.92915, 0.91115, 0.8858, 0.8858, 0.8858, 0.8858, 0.8858, 1.02058, 0.8858, 0.89591, 0.89591, 0.89591, 0.89591, 0.8111, 0.79611, 0.89713, 0.86667, 0.86667, 0.86667, 0.86667, 0.86667, 0.86667, 0.86936, 0.896, 0.90083, 0.90083, 0.90083, 0.90083, 0.84224, 0.84224, 0.84224, 0.84224, 0.97276, 0.99793, 0.98714, 0.98714, 0.98714, 0.98714, 0.98714, 1.08595, 0.89876, 0.99074, 0.99074, 0.99074, 0.99074, 0.942, 1.0231, 0.942, 0.91755, 0.86667, 0.91755, 0.86667, 0.91755, 0.86667, 0.80314, 0.896, 0.80314, 0.896, 0.80314, 0.896, 0.80314, 0.896, 0.92222, 0.93372, 0.92915, 1.01411, 0.73764, 0.90083, 0.73764, 0.90083, 0.73764, 0.90083, 0.73764, 0.90083, 0.73764, 0.90083, 0.83051, 1.00512, 0.83051, 1.00512, 0.83051, 1.00512, 1, 1, 0.90284, 0.99793, 0.90976, 0.99793, 0.86023, 0.84224, 0.86023, 0.84224, 0.86023, 0.84224, 0.86023, 1.05326, 0.86023, 0.84224, 0.82873, 1.07469, 0.74, 1.09377, 1, 1, 0.938, 0.84869, 1.06226, 1, 1, 0.84869, 0.83704, 0.84869, 0.81441, 0.85588, 1.08927, 0.91115, 0.99793, 1, 1, 0.91115, 0.99793, 0.91887, 0.90991, 0.99793, 0.8858, 0.98714, 0.8858, 0.98714, 0.8858, 0.98714, 0.894, 0.91434, 0.74498, 0.98196, 1, 1, 0.74498, 0.98196, 0.73914, 0.792, 0.73914, 0.792, 1, 1, 0.73914, 0.792, 1, 1, 0.81363, 0.904, 0.81363, 1.19137, 0.89591, 0.99074, 0.89591, 0.99074, 0.89591, 0.99074, 0.89591, 0.99074, 0.89591, 0.99074, 0.89591, 0.99074, 0.89633, 1.01915, 0.8111, 0.942, 0.8111, 0.90531, 0.856, 0.90531, 0.856, 0.90531, 0.856, 1, 0.92241, 0.91755, 0.86667, 0.788, 0.86936, 0.8858, 0.89876, 1, 1, 0.81363, 1.19137, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90388, 1.03901, 0.92138, 0.78105, 0.7154, 0.86169, 0.80513, 0.94007, 0.82528, 0.98612, 1.06226, 0.91755, 0.8126, 0.81884, 0.92819, 0.73764, 0.90531, 0.90284, 0.8858, 0.86023, 0.8126, 0.91172, 0.96518, 0.91115, 0.83089, 0.8858, 0.87791, 0.79761, 0.89297, 0.81363, 0.88157, 0.89992, 0.85608, 0.81992, 0.94307, 0.86023, 0.88157, 0.95308, 0.98699, 0.99793, 1.06226, 0.95817, 0.95308, 0.97358, 0.928, 0.98088, 0.98699, 0.92761, 0.99793, 0.96017, 1.06226, 0.986, 0.944, 0.95978, 0.938, 0.96705, 0.98714, 0.80442, 0.98972, 1, 0.89762, 1.04552, 0.95817, 0.99007, 0.87064, 0.91879, 0.88888, 1.06226, 0.95817, 0.98714, 0.95817, 0.88888, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.89633, 1.01915, 0.89633, 1.01915, 0.89633, 1.01915, 0.8111, 0.942, 0.9219, 1, 0.89903, 1, 1, 1, 0.93173, 0.93173, 0.93173, 1, 1.06304, 1.06304, 1.06904, 0.89903, 0.89903, 0.80549, 1, 1.156, 1, 1, 0.76575, 0.76575, 1, 1, 0.72458, 1, 1, 1, 1, 0.92241, 1, 1, 1, 0.619, 1, 1.36145, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.07257, 1, 0.74705, 0.71119, 1.02058, 1.024, 1.02119, 1, 1, 1.1536, 1.08595, 1.08595, 1, 1.08595, 1.08595, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.05638, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; +const MyriadProRegularMetrics = { + lineHeight: 1.2, + lineGap: 0.2 +}; + +;// ./src/core/segoeui_factors.js +const SegoeuiBoldFactors = [1.76738, 1, 1, 0.99297, 0.9824, 1.04016, 1.06497, 1.03424, 0.97529, 1.17647, 1.23203, 1.1085, 1.1085, 1.16939, 1.2107, 0.9754, 1.21408, 0.9754, 1.59578, 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, 0.81378, 0.81378, 1.2107, 1.2107, 1.2107, 0.71703, 0.97847, 0.97363, 0.88776, 0.8641, 1.02096, 0.79795, 0.85132, 0.914, 1.06085, 1.1406, 0.8007, 0.89858, 0.83693, 1.14889, 1.09398, 0.97489, 0.92094, 0.97489, 0.90399, 0.84041, 0.95923, 1.00135, 1, 1.06467, 0.98243, 0.90996, 0.99361, 1.1085, 1.56942, 1.1085, 1.2107, 0.74627, 0.94282, 0.96752, 1.01519, 0.86304, 1.01359, 0.97278, 1.15103, 1.01359, 0.98561, 1.02285, 1.02285, 1.00527, 1.02285, 1.0302, 0.99041, 1.0008, 1.01519, 1.01359, 1.02258, 0.79104, 1.16862, 0.99041, 0.97454, 1.02511, 0.99298, 0.96752, 0.95801, 0.94856, 1.16579, 0.94856, 1.2107, 0.9824, 1.03424, 1.03424, 1, 1.03424, 1.16579, 0.8727, 1.3871, 1.18622, 1.10818, 1.04478, 1.2107, 1.18622, 0.75155, 0.94994, 1.28826, 1.21408, 1.21408, 0.91056, 1, 0.91572, 0.9754, 0.64663, 1.18328, 1.24866, 1.04478, 1.14169, 1.15749, 1.17389, 0.71703, 0.97363, 0.97363, 0.97363, 0.97363, 0.97363, 0.97363, 0.93506, 0.8641, 0.79795, 0.79795, 0.79795, 0.79795, 1.1406, 1.1406, 1.1406, 1.1406, 1.02096, 1.09398, 0.97426, 0.97426, 0.97426, 0.97426, 0.97426, 1.2107, 0.97489, 1.00135, 1.00135, 1.00135, 1.00135, 0.90996, 0.92094, 1.02798, 0.96752, 0.96752, 0.96752, 0.96752, 0.96752, 0.96752, 0.93136, 0.86304, 0.97278, 0.97278, 0.97278, 0.97278, 1.02285, 1.02285, 1.02285, 1.02285, 0.97122, 0.99041, 1, 1, 1, 1, 1, 1.28826, 1.0008, 0.99041, 0.99041, 0.99041, 0.99041, 0.96752, 1.01519, 0.96752, 0.97363, 0.96752, 0.97363, 0.96752, 0.97363, 0.96752, 0.8641, 0.86304, 0.8641, 0.86304, 0.8641, 0.86304, 0.8641, 0.86304, 1.02096, 1.03057, 1.02096, 1.03517, 0.79795, 0.97278, 0.79795, 0.97278, 0.79795, 0.97278, 0.79795, 0.97278, 0.79795, 0.97278, 0.914, 1.01359, 0.914, 1.01359, 0.914, 1.01359, 1, 1, 1.06085, 0.98561, 1.06085, 1.00879, 1.1406, 1.02285, 1.1406, 1.02285, 1.1406, 1.02285, 1.1406, 1.02285, 1.1406, 1.02285, 0.97138, 1.08692, 0.8007, 1.02285, 1, 1, 1.00527, 0.83693, 1.02285, 1, 1, 0.83693, 0.9455, 0.83693, 0.90418, 0.83693, 1.13005, 1.09398, 0.99041, 1, 1, 1.09398, 0.99041, 0.96692, 1.09251, 0.99041, 0.97489, 1.0008, 0.97489, 1.0008, 0.97489, 1.0008, 0.93994, 0.97931, 0.90399, 1.02258, 1, 1, 0.90399, 1.02258, 0.84041, 0.79104, 0.84041, 0.79104, 0.84041, 0.79104, 0.84041, 0.79104, 1, 1, 0.95923, 1.07034, 0.95923, 1.16862, 1.00135, 0.99041, 1.00135, 0.99041, 1.00135, 0.99041, 1.00135, 0.99041, 1.00135, 0.99041, 1.00135, 0.99041, 1.06467, 1.02511, 0.90996, 0.96752, 0.90996, 0.99361, 0.95801, 0.99361, 0.95801, 0.99361, 0.95801, 1.07733, 1.03424, 0.97363, 0.96752, 0.93506, 0.93136, 0.97489, 1.0008, 1, 1, 0.95923, 1.16862, 1.15103, 1.15103, 1.01173, 1.03959, 0.75953, 0.81378, 0.79912, 1.15103, 1.21994, 0.95161, 0.87815, 1.01149, 0.81525, 0.7676, 0.98167, 1.01134, 1.02546, 0.84097, 1.03089, 1.18102, 0.97363, 0.88776, 0.85134, 0.97826, 0.79795, 0.99361, 1.06085, 0.97489, 1.1406, 0.89858, 1.0388, 1.14889, 1.09398, 0.86039, 0.97489, 1.0595, 0.92094, 0.94793, 0.95923, 0.90996, 0.99346, 0.98243, 1.02112, 0.95493, 1.1406, 0.90996, 1.03574, 1.02597, 1.0008, 1.18102, 1.06628, 1.03574, 1.0192, 1.01932, 1.00886, 0.97531, 1.0106, 1.0008, 1.13189, 1.18102, 1.02277, 0.98683, 1.0016, 0.99561, 1.07237, 1.0008, 0.90434, 0.99921, 0.93803, 0.8965, 1.23085, 1.06628, 1.04983, 0.96268, 1.0499, 0.98439, 1.18102, 1.06628, 1.0008, 1.06628, 0.98439, 0.79795, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.09466, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.97278, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.02065, 1, 1, 1, 1, 1, 1, 1.06467, 1.02511, 1.06467, 1.02511, 1.06467, 1.02511, 0.90996, 0.96752, 1, 1.21408, 0.89903, 1, 1, 0.75155, 1.04394, 1.04394, 1.04394, 1.04394, 0.98633, 0.98633, 0.98633, 0.73047, 0.73047, 1.20642, 0.91211, 1.25635, 1.222, 1.02956, 1.03372, 1.03372, 0.96039, 1.24633, 1, 1.12454, 0.93503, 1.03424, 1.19687, 1.03424, 1, 1, 1, 0.771, 1, 1, 1.15749, 1.15749, 1.15749, 1.10948, 0.86279, 0.94434, 0.86279, 0.94434, 0.86182, 1, 1, 1.16897, 1, 0.96085, 0.90137, 1.2107, 1.18416, 1.13973, 0.69825, 0.9716, 2.10339, 1.29004, 1.29004, 1.21172, 1.29004, 1.29004, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.42603, 1, 0.99862, 0.99862, 1, 0.87025, 0.87025, 0.87025, 0.87025, 1.18874, 1.42603, 1, 1.42603, 1.42603, 0.99862, 1, 1, 1, 1, 1, 1.2886, 1.04315, 1.15296, 1.34163, 1, 1, 1, 1.09193, 1.09193, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; +const SegoeuiBoldMetrics = { + lineHeight: 1.33008, + lineGap: 0 +}; +const SegoeuiBoldItalicFactors = [1.76738, 1, 1, 0.98946, 1.03959, 1.04016, 1.02809, 1.036, 0.97639, 1.10953, 1.23203, 1.11144, 1.11144, 1.16939, 1.21237, 0.9754, 1.21261, 0.9754, 1.59754, 1.036, 1.036, 1.036, 1.036, 1.036, 1.036, 1.036, 1.036, 1.036, 1.036, 0.81378, 0.81378, 1.21237, 1.21237, 1.21237, 0.73541, 0.97847, 0.97363, 0.89723, 0.87897, 1.0426, 0.79429, 0.85292, 0.91149, 1.05815, 1.1406, 0.79631, 0.90128, 0.83853, 1.04396, 1.10615, 0.97552, 0.94436, 0.97552, 0.88641, 0.80527, 0.96083, 1.00135, 1, 1.06777, 0.9817, 0.91142, 0.99361, 1.11144, 1.57293, 1.11144, 1.21237, 0.74627, 1.31818, 1.06585, 0.97042, 0.83055, 0.97042, 0.93503, 1.1261, 0.97042, 0.97922, 1.14236, 0.94552, 1.01054, 1.14236, 1.02471, 0.97922, 0.94165, 0.97042, 0.97042, 1.0276, 0.78929, 1.1261, 0.97922, 0.95874, 1.02197, 0.98507, 0.96752, 0.97168, 0.95107, 1.16579, 0.95107, 1.21237, 1.03959, 1.036, 1.036, 1, 1.036, 1.16579, 0.87357, 1.31818, 1.18754, 1.26781, 1.05356, 1.21237, 1.18622, 0.79487, 0.94994, 1.29004, 1.24047, 1.24047, 1.31818, 1, 0.91484, 0.9754, 1.31818, 1.1349, 1.24866, 1.05356, 1.13934, 1.15574, 1.17389, 0.73541, 0.97363, 0.97363, 0.97363, 0.97363, 0.97363, 0.97363, 0.94385, 0.87897, 0.79429, 0.79429, 0.79429, 0.79429, 1.1406, 1.1406, 1.1406, 1.1406, 1.0426, 1.10615, 0.97552, 0.97552, 0.97552, 0.97552, 0.97552, 1.21237, 0.97552, 1.00135, 1.00135, 1.00135, 1.00135, 0.91142, 0.94436, 0.98721, 1.06585, 1.06585, 1.06585, 1.06585, 1.06585, 1.06585, 0.96705, 0.83055, 0.93503, 0.93503, 0.93503, 0.93503, 1.14236, 1.14236, 1.14236, 1.14236, 0.93125, 0.97922, 0.94165, 0.94165, 0.94165, 0.94165, 0.94165, 1.29004, 0.94165, 0.97922, 0.97922, 0.97922, 0.97922, 0.96752, 0.97042, 0.96752, 0.97363, 1.06585, 0.97363, 1.06585, 0.97363, 1.06585, 0.87897, 0.83055, 0.87897, 0.83055, 0.87897, 0.83055, 0.87897, 0.83055, 1.0426, 1.0033, 1.0426, 0.97042, 0.79429, 0.93503, 0.79429, 0.93503, 0.79429, 0.93503, 0.79429, 0.93503, 0.79429, 0.93503, 0.91149, 0.97042, 0.91149, 0.97042, 0.91149, 0.97042, 1, 1, 1.05815, 0.97922, 1.05815, 0.97922, 1.1406, 1.14236, 1.1406, 1.14236, 1.1406, 1.14236, 1.1406, 1.14236, 1.1406, 1.14236, 0.97441, 1.04302, 0.79631, 1.01582, 1, 1, 1.01054, 0.83853, 1.14236, 1, 1, 0.83853, 1.09125, 0.83853, 0.90418, 0.83853, 1.19508, 1.10615, 0.97922, 1, 1, 1.10615, 0.97922, 1.01034, 1.10466, 0.97922, 0.97552, 0.94165, 0.97552, 0.94165, 0.97552, 0.94165, 0.91602, 0.91981, 0.88641, 1.0276, 1, 1, 0.88641, 1.0276, 0.80527, 0.78929, 0.80527, 0.78929, 0.80527, 0.78929, 0.80527, 0.78929, 1, 1, 0.96083, 1.05403, 0.95923, 1.16862, 1.00135, 0.97922, 1.00135, 0.97922, 1.00135, 0.97922, 1.00135, 0.97922, 1.00135, 0.97922, 1.00135, 0.97922, 1.06777, 1.02197, 0.91142, 0.96752, 0.91142, 0.99361, 0.97168, 0.99361, 0.97168, 0.99361, 0.97168, 1.23199, 1.036, 0.97363, 1.06585, 0.94385, 0.96705, 0.97552, 0.94165, 1, 1, 0.96083, 1.1261, 1.31818, 1.31818, 1.31818, 1.31818, 1.31818, 1.31818, 1.31818, 1.31818, 1.31818, 0.95161, 1.27126, 1.00811, 0.83284, 0.77702, 0.99137, 0.95253, 1.0347, 0.86142, 1.07205, 1.14236, 0.97363, 0.89723, 0.86869, 1.09818, 0.79429, 0.99361, 1.05815, 0.97552, 1.1406, 0.90128, 1.06662, 1.04396, 1.10615, 0.84918, 0.97552, 1.04694, 0.94436, 0.98015, 0.96083, 0.91142, 1.00356, 0.9817, 1.01945, 0.98999, 1.1406, 0.91142, 1.04961, 0.9898, 1.00639, 1.14236, 1.07514, 1.04961, 0.99607, 1.02897, 1.008, 0.9898, 0.95134, 1.00639, 1.11121, 1.14236, 1.00518, 0.97981, 1.02186, 1, 1.08578, 0.94165, 0.99314, 0.98387, 0.93028, 0.93377, 1.35125, 1.07514, 1.10687, 0.93491, 1.04232, 1.00351, 1.14236, 1.07514, 0.94165, 1.07514, 1.00351, 0.79429, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.09097, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.93503, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.96609, 1, 1, 1, 1, 1, 1, 1.06777, 1.02197, 1.06777, 1.02197, 1.06777, 1.02197, 0.91142, 0.96752, 1, 1.21261, 0.89903, 1, 1, 0.75155, 1.04745, 1.04745, 1.04745, 1.04394, 0.98633, 0.98633, 0.98633, 0.72959, 0.72959, 1.20502, 0.91406, 1.26514, 1.222, 1.02956, 1.03372, 1.03372, 0.96039, 1.24633, 1, 1.09125, 0.93327, 1.03336, 1.16541, 1.036, 1, 1, 1, 0.771, 1, 1, 1.15574, 1.15574, 1.15574, 1.15574, 0.86364, 0.94434, 0.86279, 0.94434, 0.86224, 1, 1, 1.16798, 1, 0.96085, 0.90068, 1.21237, 1.18416, 1.13904, 0.69825, 0.9716, 2.10339, 1.29004, 1.29004, 1.21339, 1.29004, 1.29004, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.42603, 1, 0.99862, 0.99862, 1, 0.87025, 0.87025, 0.87025, 0.87025, 1.18775, 1.42603, 1, 1.42603, 1.42603, 0.99862, 1, 1, 1, 1, 1, 1.2886, 1.04315, 1.15296, 1.34163, 1, 1, 1, 1.13269, 1.13269, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; +const SegoeuiBoldItalicMetrics = { + lineHeight: 1.33008, + lineGap: 0 +}; +const SegoeuiItalicFactors = [1.76738, 1, 1, 0.98946, 1.14763, 1.05365, 1.06234, 0.96927, 0.92586, 1.15373, 1.18414, 0.91349, 0.91349, 1.07403, 1.17308, 0.78383, 1.20088, 0.78383, 1.42531, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.78383, 0.78383, 1.17308, 1.17308, 1.17308, 0.77349, 0.94565, 0.94729, 0.85944, 0.88506, 0.9858, 0.74817, 0.80016, 0.88449, 0.98039, 0.95782, 0.69238, 0.89898, 0.83231, 0.98183, 1.03989, 0.96924, 0.86237, 0.96924, 0.80595, 0.74524, 0.86091, 0.95402, 0.94143, 0.98448, 0.8858, 0.83089, 0.93285, 1.0949, 1.39016, 1.0949, 1.45994, 0.74627, 1.04839, 0.97454, 0.97454, 0.87207, 0.97454, 0.87533, 1.06151, 0.97454, 1.00176, 1.16484, 1.08132, 0.98047, 1.16484, 1.02989, 1.01054, 0.96225, 0.97454, 0.97454, 1.06598, 0.79004, 1.16344, 1.00351, 0.94629, 0.9973, 0.91016, 0.96777, 0.9043, 0.91082, 0.92481, 0.91082, 1.17308, 0.95748, 0.96927, 0.96927, 1, 0.96927, 0.92481, 0.80597, 1.04839, 1.23393, 1.1781, 0.9245, 1.17308, 1.20808, 0.63218, 0.94261, 1.24822, 1.09971, 1.09971, 1.04839, 1, 0.85273, 0.78032, 1.04839, 1.09971, 1.22326, 0.9245, 1.09836, 1.13525, 1.15222, 0.70424, 0.94729, 0.94729, 0.94729, 0.94729, 0.94729, 0.94729, 0.85498, 0.88506, 0.74817, 0.74817, 0.74817, 0.74817, 0.95782, 0.95782, 0.95782, 0.95782, 0.9858, 1.03989, 0.96924, 0.96924, 0.96924, 0.96924, 0.96924, 1.17308, 0.96924, 0.95402, 0.95402, 0.95402, 0.95402, 0.83089, 0.86237, 0.88409, 0.97454, 0.97454, 0.97454, 0.97454, 0.97454, 0.97454, 0.92916, 0.87207, 0.87533, 0.87533, 0.87533, 0.87533, 0.93146, 0.93146, 0.93146, 0.93146, 0.93854, 1.01054, 0.96225, 0.96225, 0.96225, 0.96225, 0.96225, 1.24822, 0.8761, 1.00351, 1.00351, 1.00351, 1.00351, 0.96777, 0.97454, 0.96777, 0.94729, 0.97454, 0.94729, 0.97454, 0.94729, 0.97454, 0.88506, 0.87207, 0.88506, 0.87207, 0.88506, 0.87207, 0.88506, 0.87207, 0.9858, 0.95391, 0.9858, 0.97454, 0.74817, 0.87533, 0.74817, 0.87533, 0.74817, 0.87533, 0.74817, 0.87533, 0.74817, 0.87533, 0.88449, 0.97454, 0.88449, 0.97454, 0.88449, 0.97454, 1, 1, 0.98039, 1.00176, 0.98039, 1.00176, 0.95782, 0.93146, 0.95782, 0.93146, 0.95782, 0.93146, 0.95782, 1.16484, 0.95782, 0.93146, 0.84421, 1.12761, 0.69238, 1.08132, 1, 1, 0.98047, 0.83231, 1.16484, 1, 1, 0.84723, 1.04861, 0.84723, 0.78755, 0.83231, 1.23736, 1.03989, 1.01054, 1, 1, 1.03989, 1.01054, 0.9857, 1.03849, 1.01054, 0.96924, 0.96225, 0.96924, 0.96225, 0.96924, 0.96225, 0.92383, 0.90171, 0.80595, 1.06598, 1, 1, 0.80595, 1.06598, 0.74524, 0.79004, 0.74524, 0.79004, 0.74524, 0.79004, 0.74524, 0.79004, 1, 1, 0.86091, 1.02759, 0.85771, 1.16344, 0.95402, 1.00351, 0.95402, 1.00351, 0.95402, 1.00351, 0.95402, 1.00351, 0.95402, 1.00351, 0.95402, 1.00351, 0.98448, 0.9973, 0.83089, 0.96777, 0.83089, 0.93285, 0.9043, 0.93285, 0.9043, 0.93285, 0.9043, 1.31868, 0.96927, 0.94729, 0.97454, 0.85498, 0.92916, 0.96924, 0.8761, 1, 1, 0.86091, 1.16344, 1.04839, 1.04839, 1.04839, 1.04839, 1.04839, 1.04839, 1.04839, 1.04839, 1.04839, 0.81965, 0.81965, 0.94729, 0.78032, 0.71022, 0.90883, 0.84171, 0.99877, 0.77596, 1.05734, 1.2, 0.94729, 0.85944, 0.82791, 0.9607, 0.74817, 0.93285, 0.98039, 0.96924, 0.95782, 0.89898, 0.98316, 0.98183, 1.03989, 0.78614, 0.96924, 0.97642, 0.86237, 0.86075, 0.86091, 0.83089, 0.90082, 0.8858, 0.97296, 1.01284, 0.95782, 0.83089, 1.0976, 1.04, 1.03342, 1.2, 1.0675, 1.0976, 0.98205, 1.03809, 1.05097, 1.04, 0.95364, 1.03342, 1.05401, 1.2, 1.02148, 1.0119, 1.04724, 1.0127, 1.02732, 0.96225, 0.8965, 0.97783, 0.93574, 0.94818, 1.30679, 1.0675, 1.11826, 0.99821, 1.0557, 1.0326, 1.2, 1.0675, 0.96225, 1.0675, 1.0326, 0.74817, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.03754, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.87533, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.98705, 1, 1, 1, 1, 1, 1, 0.98448, 0.9973, 0.98448, 0.9973, 0.98448, 0.9973, 0.83089, 0.96777, 1, 1.20088, 0.89903, 1, 1, 0.75155, 0.94945, 0.94945, 0.94945, 0.94945, 1.12317, 1.12317, 1.12317, 0.67603, 0.67603, 1.15621, 0.73584, 1.21191, 1.22135, 1.06483, 0.94868, 0.94868, 0.95996, 1.24633, 1, 1.07497, 0.87709, 0.96927, 1.01473, 0.96927, 1, 1, 1, 0.77295, 1, 1, 1.09836, 1.09836, 1.09836, 1.01522, 0.86321, 0.94434, 0.8649, 0.94434, 0.86182, 1, 1, 1.083, 1, 0.91578, 0.86438, 1.17308, 1.18416, 1.14589, 0.69825, 0.97622, 1.96791, 1.24822, 1.24822, 1.17308, 1.24822, 1.24822, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.42603, 1, 0.99862, 0.99862, 1, 0.87025, 0.87025, 0.87025, 0.87025, 1.17984, 1.42603, 1, 1.42603, 1.42603, 0.99862, 1, 1, 1, 1, 1, 1.2886, 1.04315, 1.15296, 1.34163, 1, 1, 1, 1.10742, 1.10742, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; +const SegoeuiItalicMetrics = { + lineHeight: 1.33008, + lineGap: 0 +}; +const SegoeuiRegularFactors = [1.76738, 1, 1, 0.98594, 1.02285, 1.10454, 1.06234, 0.96927, 0.92037, 1.19985, 1.2046, 0.90616, 0.90616, 1.07152, 1.1714, 0.78032, 1.20088, 0.78032, 1.40246, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.78032, 0.78032, 1.1714, 1.1714, 1.1714, 0.80597, 0.94084, 0.96706, 0.85944, 0.85734, 0.97093, 0.75842, 0.79936, 0.88198, 0.9831, 0.95782, 0.71387, 0.86969, 0.84636, 1.07796, 1.03584, 0.96924, 0.83968, 0.96924, 0.82826, 0.79649, 0.85771, 0.95132, 0.93119, 0.98965, 0.88433, 0.8287, 0.93365, 1.08612, 1.3638, 1.08612, 1.45786, 0.74627, 0.80499, 0.91484, 1.05707, 0.92383, 1.05882, 0.9403, 1.12654, 1.05882, 1.01756, 1.09011, 1.09011, 0.99414, 1.09011, 1.034, 1.01756, 1.05356, 1.05707, 1.05882, 1.04399, 0.84863, 1.21968, 1.01756, 0.95801, 1.00068, 0.91797, 0.96777, 0.9043, 0.90351, 0.92105, 0.90351, 1.1714, 0.85337, 0.96927, 0.96927, 0.99912, 0.96927, 0.92105, 0.80597, 1.2434, 1.20808, 1.05937, 0.90957, 1.1714, 1.20808, 0.75155, 0.94261, 1.24644, 1.09971, 1.09971, 0.84751, 1, 0.85273, 0.78032, 0.61584, 1.05425, 1.17914, 0.90957, 1.08665, 1.11593, 1.14169, 0.73381, 0.96706, 0.96706, 0.96706, 0.96706, 0.96706, 0.96706, 0.86035, 0.85734, 0.75842, 0.75842, 0.75842, 0.75842, 0.95782, 0.95782, 0.95782, 0.95782, 0.97093, 1.03584, 0.96924, 0.96924, 0.96924, 0.96924, 0.96924, 1.1714, 0.96924, 0.95132, 0.95132, 0.95132, 0.95132, 0.8287, 0.83968, 0.89049, 0.91484, 0.91484, 0.91484, 0.91484, 0.91484, 0.91484, 0.93575, 0.92383, 0.9403, 0.9403, 0.9403, 0.9403, 0.8717, 0.8717, 0.8717, 0.8717, 1.00527, 1.01756, 1.05356, 1.05356, 1.05356, 1.05356, 1.05356, 1.24644, 0.95923, 1.01756, 1.01756, 1.01756, 1.01756, 0.96777, 1.05707, 0.96777, 0.96706, 0.91484, 0.96706, 0.91484, 0.96706, 0.91484, 0.85734, 0.92383, 0.85734, 0.92383, 0.85734, 0.92383, 0.85734, 0.92383, 0.97093, 1.0969, 0.97093, 1.05882, 0.75842, 0.9403, 0.75842, 0.9403, 0.75842, 0.9403, 0.75842, 0.9403, 0.75842, 0.9403, 0.88198, 1.05882, 0.88198, 1.05882, 0.88198, 1.05882, 1, 1, 0.9831, 1.01756, 0.9831, 1.01756, 0.95782, 0.8717, 0.95782, 0.8717, 0.95782, 0.8717, 0.95782, 1.09011, 0.95782, 0.8717, 0.84784, 1.11551, 0.71387, 1.09011, 1, 1, 0.99414, 0.84636, 1.09011, 1, 1, 0.84636, 1.0536, 0.84636, 0.94298, 0.84636, 1.23297, 1.03584, 1.01756, 1, 1, 1.03584, 1.01756, 1.00323, 1.03444, 1.01756, 0.96924, 1.05356, 0.96924, 1.05356, 0.96924, 1.05356, 0.93066, 0.98293, 0.82826, 1.04399, 1, 1, 0.82826, 1.04399, 0.79649, 0.84863, 0.79649, 0.84863, 0.79649, 0.84863, 0.79649, 0.84863, 1, 1, 0.85771, 1.17318, 0.85771, 1.21968, 0.95132, 1.01756, 0.95132, 1.01756, 0.95132, 1.01756, 0.95132, 1.01756, 0.95132, 1.01756, 0.95132, 1.01756, 0.98965, 1.00068, 0.8287, 0.96777, 0.8287, 0.93365, 0.9043, 0.93365, 0.9043, 0.93365, 0.9043, 1.08571, 0.96927, 0.96706, 0.91484, 0.86035, 0.93575, 0.96924, 0.95923, 1, 1, 0.85771, 1.21968, 1.11437, 1.11437, 0.93109, 0.91202, 0.60411, 0.84164, 0.55572, 1.01173, 0.97361, 0.81818, 0.81818, 0.96635, 0.78032, 0.72727, 0.92366, 0.98601, 1.03405, 0.77968, 1.09799, 1.2, 0.96706, 0.85944, 0.85638, 0.96491, 0.75842, 0.93365, 0.9831, 0.96924, 0.95782, 0.86969, 0.94152, 1.07796, 1.03584, 0.78437, 0.96924, 0.98715, 0.83968, 0.83491, 0.85771, 0.8287, 0.94492, 0.88433, 0.9287, 1.0098, 0.95782, 0.8287, 1.0625, 0.98248, 1.03424, 1.2, 1.01071, 1.0625, 0.95246, 1.03809, 1.04912, 0.98248, 1.00221, 1.03424, 1.05443, 1.2, 1.04785, 0.99609, 1.00169, 1.05176, 0.99346, 1.05356, 0.9087, 1.03004, 0.95542, 0.93117, 1.23362, 1.01071, 1.07831, 1.02512, 1.05205, 1.03502, 1.2, 1.01071, 1.05356, 1.01071, 1.03502, 0.75842, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.03719, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.9403, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.04021, 1, 1, 1, 1, 1, 1, 0.98965, 1.00068, 0.98965, 1.00068, 0.98965, 1.00068, 0.8287, 0.96777, 1, 1.20088, 0.89903, 1, 1, 0.75155, 1.03077, 1.03077, 1.03077, 1.03077, 1.13196, 1.13196, 1.13196, 0.67428, 0.67428, 1.16039, 0.73291, 1.20996, 1.22135, 1.06483, 0.94868, 0.94868, 0.95996, 1.24633, 1, 1.07497, 0.87796, 0.96927, 1.01518, 0.96927, 1, 1, 1, 0.77295, 1, 1, 1.10539, 1.10539, 1.11358, 1.06967, 0.86279, 0.94434, 0.86279, 0.94434, 0.86182, 1, 1, 1.083, 1, 0.91578, 0.86507, 1.1714, 1.18416, 1.14589, 0.69825, 0.97622, 1.9697, 1.24822, 1.24822, 1.17238, 1.24822, 1.24822, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.42603, 1, 0.99862, 0.99862, 1, 0.87025, 0.87025, 0.87025, 0.87025, 1.18083, 1.42603, 1, 1.42603, 1.42603, 0.99862, 1, 1, 1, 1, 1, 1.2886, 1.04315, 1.15296, 1.34163, 1, 1, 1, 1.10938, 1.10938, 1, 1, 1, 1.05425, 1.09971, 1.09971, 1.09971, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; +const SegoeuiRegularMetrics = { + lineHeight: 1.33008, + lineGap: 0 +}; + +;// ./src/core/xfa_fonts.js + + + + + + + + +const getXFAFontMap = getLookupTableFactory(function (t) { + t["MyriadPro-Regular"] = t["PdfJS-Fallback-Regular"] = { + name: "LiberationSans-Regular", + factors: MyriadProRegularFactors, + baseWidths: LiberationSansRegularWidths, + baseMapping: LiberationSansRegularMapping, + metrics: MyriadProRegularMetrics + }; + t["MyriadPro-Bold"] = t["PdfJS-Fallback-Bold"] = { + name: "LiberationSans-Bold", + factors: MyriadProBoldFactors, + baseWidths: LiberationSansBoldWidths, + baseMapping: LiberationSansBoldMapping, + metrics: MyriadProBoldMetrics + }; + t["MyriadPro-It"] = t["MyriadPro-Italic"] = t["PdfJS-Fallback-Italic"] = { + name: "LiberationSans-Italic", + factors: MyriadProItalicFactors, + baseWidths: LiberationSansItalicWidths, + baseMapping: LiberationSansItalicMapping, + metrics: MyriadProItalicMetrics + }; + t["MyriadPro-BoldIt"] = t["MyriadPro-BoldItalic"] = t["PdfJS-Fallback-BoldItalic"] = { + name: "LiberationSans-BoldItalic", + factors: MyriadProBoldItalicFactors, + baseWidths: LiberationSansBoldItalicWidths, + baseMapping: LiberationSansBoldItalicMapping, + metrics: MyriadProBoldItalicMetrics + }; + t.ArialMT = t.Arial = t["Arial-Regular"] = { + name: "LiberationSans-Regular", + baseWidths: LiberationSansRegularWidths, + baseMapping: LiberationSansRegularMapping + }; + t["Arial-BoldMT"] = t["Arial-Bold"] = { + name: "LiberationSans-Bold", + baseWidths: LiberationSansBoldWidths, + baseMapping: LiberationSansBoldMapping + }; + t["Arial-ItalicMT"] = t["Arial-Italic"] = { + name: "LiberationSans-Italic", + baseWidths: LiberationSansItalicWidths, + baseMapping: LiberationSansItalicMapping + }; + t["Arial-BoldItalicMT"] = t["Arial-BoldItalic"] = { + name: "LiberationSans-BoldItalic", + baseWidths: LiberationSansBoldItalicWidths, + baseMapping: LiberationSansBoldItalicMapping + }; + t["Calibri-Regular"] = { + name: "LiberationSans-Regular", + factors: CalibriRegularFactors, + baseWidths: LiberationSansRegularWidths, + baseMapping: LiberationSansRegularMapping, + metrics: CalibriRegularMetrics + }; + t["Calibri-Bold"] = { + name: "LiberationSans-Bold", + factors: CalibriBoldFactors, + baseWidths: LiberationSansBoldWidths, + baseMapping: LiberationSansBoldMapping, + metrics: CalibriBoldMetrics + }; + t["Calibri-Italic"] = { + name: "LiberationSans-Italic", + factors: CalibriItalicFactors, + baseWidths: LiberationSansItalicWidths, + baseMapping: LiberationSansItalicMapping, + metrics: CalibriItalicMetrics + }; + t["Calibri-BoldItalic"] = { + name: "LiberationSans-BoldItalic", + factors: CalibriBoldItalicFactors, + baseWidths: LiberationSansBoldItalicWidths, + baseMapping: LiberationSansBoldItalicMapping, + metrics: CalibriBoldItalicMetrics + }; + t["Segoeui-Regular"] = { + name: "LiberationSans-Regular", + factors: SegoeuiRegularFactors, + baseWidths: LiberationSansRegularWidths, + baseMapping: LiberationSansRegularMapping, + metrics: SegoeuiRegularMetrics + }; + t["Segoeui-Bold"] = { + name: "LiberationSans-Bold", + factors: SegoeuiBoldFactors, + baseWidths: LiberationSansBoldWidths, + baseMapping: LiberationSansBoldMapping, + metrics: SegoeuiBoldMetrics + }; + t["Segoeui-Italic"] = { + name: "LiberationSans-Italic", + factors: SegoeuiItalicFactors, + baseWidths: LiberationSansItalicWidths, + baseMapping: LiberationSansItalicMapping, + metrics: SegoeuiItalicMetrics + }; + t["Segoeui-BoldItalic"] = { + name: "LiberationSans-BoldItalic", + factors: SegoeuiBoldItalicFactors, + baseWidths: LiberationSansBoldItalicWidths, + baseMapping: LiberationSansBoldItalicMapping, + metrics: SegoeuiBoldItalicMetrics + }; + t["Helvetica-Regular"] = t.Helvetica = { + name: "LiberationSans-Regular", + factors: HelveticaRegularFactors, + baseWidths: LiberationSansRegularWidths, + baseMapping: LiberationSansRegularMapping, + metrics: HelveticaRegularMetrics + }; + t["Helvetica-Bold"] = { + name: "LiberationSans-Bold", + factors: HelveticaBoldFactors, + baseWidths: LiberationSansBoldWidths, + baseMapping: LiberationSansBoldMapping, + metrics: HelveticaBoldMetrics + }; + t["Helvetica-Italic"] = { + name: "LiberationSans-Italic", + factors: HelveticaItalicFactors, + baseWidths: LiberationSansItalicWidths, + baseMapping: LiberationSansItalicMapping, + metrics: HelveticaItalicMetrics + }; + t["Helvetica-BoldItalic"] = { + name: "LiberationSans-BoldItalic", + factors: HelveticaBoldItalicFactors, + baseWidths: LiberationSansBoldItalicWidths, + baseMapping: LiberationSansBoldItalicMapping, + metrics: HelveticaBoldItalicMetrics + }; +}); +function getXfaFontName(name) { + const fontName = normalizeFontName(name); + const fontMap = getXFAFontMap(); + return fontMap[fontName]; +} +function getXfaFontWidths(name) { + const info = getXfaFontName(name); + if (!info) { + return null; + } + const { + baseWidths, + baseMapping, + factors + } = info; + const rescaledBaseWidths = !factors ? baseWidths : baseWidths.map((w, i) => w * factors[i]); + let currentCode = -2; + let currentArray; + const newWidths = []; + for (const [unicode, glyphIndex] of baseMapping.map((charUnicode, index) => [charUnicode, index]).sort(([unicode1], [unicode2]) => unicode1 - unicode2)) { + if (unicode === -1) { + continue; + } + if (unicode === currentCode + 1) { + currentArray.push(rescaledBaseWidths[glyphIndex]); + currentCode += 1; + } else { + currentCode = unicode; + currentArray = [rescaledBaseWidths[glyphIndex]]; + newWidths.push(unicode, currentArray); + } + } + return newWidths; +} +function getXfaFontDict(name) { + const widths = getXfaFontWidths(name); + const dict = new Dict(null); + dict.set("BaseFont", Name.get(name)); + dict.set("Type", Name.get("Font")); + dict.set("Subtype", Name.get("CIDFontType2")); + dict.set("Encoding", Name.get("Identity-H")); + dict.set("CIDToGIDMap", Name.get("Identity")); + dict.set("W", widths); + dict.set("FirstChar", widths[0]); + dict.set("LastChar", widths.at(-2) + widths.at(-1).length - 1); + const descriptor = new Dict(null); + dict.set("FontDescriptor", descriptor); + const systemInfo = new Dict(null); + systemInfo.set("Ordering", "Identity"); + systemInfo.set("Registry", "Adobe"); + systemInfo.set("Supplement", 0); + dict.set("CIDSystemInfo", systemInfo); + return dict; +} + +;// ./src/core/ps_parser.js + + + +class PostScriptParser { + constructor(lexer) { + this.lexer = lexer; + this.operators = []; + this.token = null; + this.prev = null; + } + nextToken() { + this.prev = this.token; + this.token = this.lexer.getToken(); + } + accept(type) { + if (this.token.type === type) { + this.nextToken(); + return true; + } + return false; + } + expect(type) { + if (this.accept(type)) { + return true; + } + throw new FormatError(`Unexpected symbol: found ${this.token.type} expected ${type}.`); + } + parse() { + this.nextToken(); + this.expect(PostScriptTokenTypes.LBRACE); + this.parseBlock(); + this.expect(PostScriptTokenTypes.RBRACE); + return this.operators; + } + parseBlock() { + while (true) { + if (this.accept(PostScriptTokenTypes.NUMBER)) { + this.operators.push(this.prev.value); + } else if (this.accept(PostScriptTokenTypes.OPERATOR)) { + this.operators.push(this.prev.value); + } else if (this.accept(PostScriptTokenTypes.LBRACE)) { + this.parseCondition(); + } else { + return; + } + } + } + parseCondition() { + const conditionLocation = this.operators.length; + this.operators.push(null, null); + this.parseBlock(); + this.expect(PostScriptTokenTypes.RBRACE); + if (this.accept(PostScriptTokenTypes.IF)) { + this.operators[conditionLocation] = this.operators.length; + this.operators[conditionLocation + 1] = "jz"; + } else if (this.accept(PostScriptTokenTypes.LBRACE)) { + const jumpLocation = this.operators.length; + this.operators.push(null, null); + const endOfTrue = this.operators.length; + this.parseBlock(); + this.expect(PostScriptTokenTypes.RBRACE); + this.expect(PostScriptTokenTypes.IFELSE); + this.operators[jumpLocation] = this.operators.length; + this.operators[jumpLocation + 1] = "j"; + this.operators[conditionLocation] = endOfTrue; + this.operators[conditionLocation + 1] = "jz"; + } else { + throw new FormatError("PS Function: error parsing conditional."); + } + } +} +const PostScriptTokenTypes = { + LBRACE: 0, + RBRACE: 1, + NUMBER: 2, + OPERATOR: 3, + IF: 4, + IFELSE: 5 +}; +class PostScriptToken { + static get opCache() { + return shadow(this, "opCache", Object.create(null)); + } + constructor(type, value) { + this.type = type; + this.value = value; + } + static getOperator(op) { + return PostScriptToken.opCache[op] ||= new PostScriptToken(PostScriptTokenTypes.OPERATOR, op); + } + static get LBRACE() { + return shadow(this, "LBRACE", new PostScriptToken(PostScriptTokenTypes.LBRACE, "{")); + } + static get RBRACE() { + return shadow(this, "RBRACE", new PostScriptToken(PostScriptTokenTypes.RBRACE, "}")); + } + static get IF() { + return shadow(this, "IF", new PostScriptToken(PostScriptTokenTypes.IF, "IF")); + } + static get IFELSE() { + return shadow(this, "IFELSE", new PostScriptToken(PostScriptTokenTypes.IFELSE, "IFELSE")); + } +} +class PostScriptLexer { + constructor(stream) { + this.stream = stream; + this.nextChar(); + this.strBuf = []; + } + nextChar() { + return this.currentChar = this.stream.getByte(); + } + getToken() { + let comment = false; + let ch = this.currentChar; + while (true) { + if (ch < 0) { + return EOF; + } + if (comment) { + if (ch === 0x0a || ch === 0x0d) { + comment = false; + } + } else if (ch === 0x25) { + comment = true; + } else if (!isWhiteSpace(ch)) { + break; + } + ch = this.nextChar(); + } + switch (ch | 0) { + case 0x30: + case 0x31: + case 0x32: + case 0x33: + case 0x34: + case 0x35: + case 0x36: + case 0x37: + case 0x38: + case 0x39: + case 0x2b: + case 0x2d: + case 0x2e: + return new PostScriptToken(PostScriptTokenTypes.NUMBER, this.getNumber()); + case 0x7b: + this.nextChar(); + return PostScriptToken.LBRACE; + case 0x7d: + this.nextChar(); + return PostScriptToken.RBRACE; + } + const strBuf = this.strBuf; + strBuf.length = 0; + strBuf[0] = String.fromCharCode(ch); + while ((ch = this.nextChar()) >= 0 && (ch >= 0x41 && ch <= 0x5a || ch >= 0x61 && ch <= 0x7a)) { + strBuf.push(String.fromCharCode(ch)); + } + const str = strBuf.join(""); + switch (str.toLowerCase()) { + case "if": + return PostScriptToken.IF; + case "ifelse": + return PostScriptToken.IFELSE; + default: + return PostScriptToken.getOperator(str); + } + } + getNumber() { + let ch = this.currentChar; + const strBuf = this.strBuf; + strBuf.length = 0; + strBuf[0] = String.fromCharCode(ch); + while ((ch = this.nextChar()) >= 0) { + if (ch >= 0x30 && ch <= 0x39 || ch === 0x2d || ch === 0x2e) { + strBuf.push(String.fromCharCode(ch)); + } else { + break; + } + } + const value = parseFloat(strBuf.join("")); + if (isNaN(value)) { + throw new FormatError(`Invalid floating point number: ${value}`); + } + return value; + } +} + +;// ./src/core/image_utils.js + + +class BaseLocalCache { + constructor(options) { + this._onlyRefs = options?.onlyRefs === true; + if (!this._onlyRefs) { + this._nameRefMap = new Map(); + this._imageMap = new Map(); + } + this._imageCache = new RefSetCache(); + } + getByName(name) { + if (this._onlyRefs) { + unreachable("Should not call `getByName` method."); + } + const ref = this._nameRefMap.get(name); + if (ref) { + return this.getByRef(ref); + } + return this._imageMap.get(name) || null; + } + getByRef(ref) { + return this._imageCache.get(ref) || null; + } + set(name, ref, data) { + unreachable("Abstract method `set` called."); + } +} +class LocalImageCache extends BaseLocalCache { + set(name, ref = null, data) { + if (typeof name !== "string") { + throw new Error('LocalImageCache.set - expected "name" argument.'); + } + if (ref) { + if (this._imageCache.has(ref)) { + return; + } + this._nameRefMap.set(name, ref); + this._imageCache.put(ref, data); + return; + } + if (this._imageMap.has(name)) { + return; + } + this._imageMap.set(name, data); + } +} +class LocalColorSpaceCache extends BaseLocalCache { + set(name = null, ref = null, data) { + if (typeof name !== "string" && !ref) { + throw new Error('LocalColorSpaceCache.set - expected "name" and/or "ref" argument.'); + } + if (ref) { + if (this._imageCache.has(ref)) { + return; + } + if (name !== null) { + this._nameRefMap.set(name, ref); + } + this._imageCache.put(ref, data); + return; + } + if (this._imageMap.has(name)) { + return; + } + this._imageMap.set(name, data); + } +} +class LocalFunctionCache extends BaseLocalCache { + constructor(options) { + super({ + onlyRefs: true + }); + } + set(name = null, ref, data) { + if (!ref) { + throw new Error('LocalFunctionCache.set - expected "ref" argument.'); + } + if (this._imageCache.has(ref)) { + return; + } + this._imageCache.put(ref, data); + } +} +class LocalGStateCache extends BaseLocalCache { + set(name, ref = null, data) { + if (typeof name !== "string") { + throw new Error('LocalGStateCache.set - expected "name" argument.'); + } + if (ref) { + if (this._imageCache.has(ref)) { + return; + } + this._nameRefMap.set(name, ref); + this._imageCache.put(ref, data); + return; + } + if (this._imageMap.has(name)) { + return; + } + this._imageMap.set(name, data); + } +} +class LocalTilingPatternCache extends BaseLocalCache { + constructor(options) { + super({ + onlyRefs: true + }); + } + set(name = null, ref, data) { + if (!ref) { + throw new Error('LocalTilingPatternCache.set - expected "ref" argument.'); + } + if (this._imageCache.has(ref)) { + return; + } + this._imageCache.put(ref, data); + } +} +class RegionalImageCache extends BaseLocalCache { + constructor(options) { + super({ + onlyRefs: true + }); + } + set(name = null, ref, data) { + if (!ref) { + throw new Error('RegionalImageCache.set - expected "ref" argument.'); + } + if (this._imageCache.has(ref)) { + return; + } + this._imageCache.put(ref, data); + } +} +class GlobalImageCache { + static NUM_PAGES_THRESHOLD = 2; + static MIN_IMAGES_TO_CACHE = 10; + static MAX_BYTE_SIZE = 5 * MAX_IMAGE_SIZE_TO_CACHE; + #decodeFailedSet = new RefSet(); + constructor() { + this._refCache = new RefSetCache(); + this._imageCache = new RefSetCache(); + } + get #byteSize() { + let byteSize = 0; + for (const imageData of this._imageCache) { + byteSize += imageData.byteSize; + } + return byteSize; + } + get #cacheLimitReached() { + if (this._imageCache.size < GlobalImageCache.MIN_IMAGES_TO_CACHE) { + return false; + } + if (this.#byteSize < GlobalImageCache.MAX_BYTE_SIZE) { + return false; + } + return true; + } + shouldCache(ref, pageIndex) { + let pageIndexSet = this._refCache.get(ref); + if (!pageIndexSet) { + pageIndexSet = new Set(); + this._refCache.put(ref, pageIndexSet); + } + pageIndexSet.add(pageIndex); + if (pageIndexSet.size < GlobalImageCache.NUM_PAGES_THRESHOLD) { + return false; + } + if (!this._imageCache.has(ref) && this.#cacheLimitReached) { + return false; + } + return true; + } + addDecodeFailed(ref) { + this.#decodeFailedSet.put(ref); + } + hasDecodeFailed(ref) { + return this.#decodeFailedSet.has(ref); + } + addByteSize(ref, byteSize) { + const imageData = this._imageCache.get(ref); + if (!imageData) { + return; + } + if (imageData.byteSize) { + return; + } + imageData.byteSize = byteSize; + } + getData(ref, pageIndex) { + const pageIndexSet = this._refCache.get(ref); + if (!pageIndexSet) { + return null; + } + if (pageIndexSet.size < GlobalImageCache.NUM_PAGES_THRESHOLD) { + return null; + } + const imageData = this._imageCache.get(ref); + if (!imageData) { + return null; + } + pageIndexSet.add(pageIndex); + return imageData; + } + setData(ref, data) { + if (!this._refCache.has(ref)) { + throw new Error('GlobalImageCache.setData - expected "shouldCache" to have been called.'); + } + if (this._imageCache.has(ref)) { + return; + } + if (this.#cacheLimitReached) { + warn("GlobalImageCache.setData - cache limit reached."); + return; + } + this._imageCache.put(ref, data); + } + clear(onlyData = false) { + if (!onlyData) { + this.#decodeFailedSet.clear(); + this._refCache.clear(); + } + this._imageCache.clear(); + } +} + +;// ./src/core/function.js + + + + + + +class PDFFunctionFactory { + constructor({ + xref, + isEvalSupported = true + }) { + this.xref = xref; + this.isEvalSupported = isEvalSupported !== false; + } + create(fn) { + const cachedFunction = this.getCached(fn); + if (cachedFunction) { + return cachedFunction; + } + const parsedFunction = PDFFunction.parse({ + xref: this.xref, + isEvalSupported: this.isEvalSupported, + fn: fn instanceof Ref ? this.xref.fetch(fn) : fn + }); + this._cache(fn, parsedFunction); + return parsedFunction; + } + createFromArray(fnObj) { + const cachedFunction = this.getCached(fnObj); + if (cachedFunction) { + return cachedFunction; + } + const parsedFunction = PDFFunction.parseArray({ + xref: this.xref, + isEvalSupported: this.isEvalSupported, + fnObj: fnObj instanceof Ref ? this.xref.fetch(fnObj) : fnObj + }); + this._cache(fnObj, parsedFunction); + return parsedFunction; + } + getCached(cacheKey) { + let fnRef; + if (cacheKey instanceof Ref) { + fnRef = cacheKey; + } else if (cacheKey instanceof Dict) { + fnRef = cacheKey.objId; + } else if (cacheKey instanceof BaseStream) { + fnRef = cacheKey.dict?.objId; + } + if (fnRef) { + const localFunction = this._localFunctionCache.getByRef(fnRef); + if (localFunction) { + return localFunction; + } + } + return null; + } + _cache(cacheKey, parsedFunction) { + if (!parsedFunction) { + throw new Error('PDFFunctionFactory._cache - expected "parsedFunction" argument.'); + } + let fnRef; + if (cacheKey instanceof Ref) { + fnRef = cacheKey; + } else if (cacheKey instanceof Dict) { + fnRef = cacheKey.objId; + } else if (cacheKey instanceof BaseStream) { + fnRef = cacheKey.dict?.objId; + } + if (fnRef) { + this._localFunctionCache.set(null, fnRef, parsedFunction); + } + } + get _localFunctionCache() { + return shadow(this, "_localFunctionCache", new LocalFunctionCache()); + } +} +function toNumberArray(arr) { + if (!Array.isArray(arr)) { + return null; + } + if (!isNumberArray(arr, null)) { + return arr.map(x => +x); + } + return arr; +} +class PDFFunction { + static getSampleArray(size, outputSize, bps, stream) { + let i, ii; + let length = 1; + for (i = 0, ii = size.length; i < ii; i++) { + length *= size[i]; + } + length *= outputSize; + const array = new Array(length); + let codeSize = 0; + let codeBuf = 0; + const sampleMul = 1.0 / (2.0 ** bps - 1); + const strBytes = stream.getBytes((length * bps + 7) / 8); + let strIdx = 0; + for (i = 0; i < length; i++) { + while (codeSize < bps) { + codeBuf <<= 8; + codeBuf |= strBytes[strIdx++]; + codeSize += 8; + } + codeSize -= bps; + array[i] = (codeBuf >> codeSize) * sampleMul; + codeBuf &= (1 << codeSize) - 1; + } + return array; + } + static parse({ + xref, + isEvalSupported, + fn + }) { + const dict = fn.dict || fn; + const typeNum = dict.get("FunctionType"); + switch (typeNum) { + case 0: + return this.constructSampled({ + xref, + isEvalSupported, + fn, + dict + }); + case 1: + break; + case 2: + return this.constructInterpolated({ + xref, + isEvalSupported, + dict + }); + case 3: + return this.constructStiched({ + xref, + isEvalSupported, + dict + }); + case 4: + return this.constructPostScript({ + xref, + isEvalSupported, + fn, + dict + }); + } + throw new FormatError("Unknown type of function"); + } + static parseArray({ + xref, + isEvalSupported, + fnObj + }) { + if (!Array.isArray(fnObj)) { + return this.parse({ + xref, + isEvalSupported, + fn: fnObj + }); + } + const fnArray = []; + for (const fn of fnObj) { + fnArray.push(this.parse({ + xref, + isEvalSupported, + fn: xref.fetchIfRef(fn) + })); + } + return function (src, srcOffset, dest, destOffset) { + for (let i = 0, ii = fnArray.length; i < ii; i++) { + fnArray[i](src, srcOffset, dest, destOffset + i); + } + }; + } + static constructSampled({ + xref, + isEvalSupported, + fn, + dict + }) { + function toMultiArray(arr) { + const inputLength = arr.length; + const out = []; + let index = 0; + for (let i = 0; i < inputLength; i += 2) { + out[index++] = [arr[i], arr[i + 1]]; + } + return out; + } + function interpolate(x, xmin, xmax, ymin, ymax) { + return ymin + (x - xmin) * ((ymax - ymin) / (xmax - xmin)); + } + let domain = toNumberArray(dict.getArray("Domain")); + let range = toNumberArray(dict.getArray("Range")); + if (!domain || !range) { + throw new FormatError("No domain or range"); + } + const inputSize = domain.length / 2; + const outputSize = range.length / 2; + domain = toMultiArray(domain); + range = toMultiArray(range); + const size = toNumberArray(dict.getArray("Size")); + const bps = dict.get("BitsPerSample"); + const order = dict.get("Order") || 1; + if (order !== 1) { + info("No support for cubic spline interpolation: " + order); + } + let encode = toNumberArray(dict.getArray("Encode")); + if (!encode) { + encode = []; + for (let i = 0; i < inputSize; ++i) { + encode.push([0, size[i] - 1]); + } + } else { + encode = toMultiArray(encode); + } + let decode = toNumberArray(dict.getArray("Decode")); + decode = !decode ? range : toMultiArray(decode); + const samples = this.getSampleArray(size, outputSize, bps, fn); + return function constructSampledFn(src, srcOffset, dest, destOffset) { + const cubeVertices = 1 << inputSize; + const cubeN = new Float64Array(cubeVertices); + const cubeVertex = new Uint32Array(cubeVertices); + let i, j; + for (j = 0; j < cubeVertices; j++) { + cubeN[j] = 1; + } + let k = outputSize, + pos = 1; + for (i = 0; i < inputSize; ++i) { + const domain_2i = domain[i][0]; + const domain_2i_1 = domain[i][1]; + const xi = Math.min(Math.max(src[srcOffset + i], domain_2i), domain_2i_1); + let e = interpolate(xi, domain_2i, domain_2i_1, encode[i][0], encode[i][1]); + const size_i = size[i]; + e = Math.min(Math.max(e, 0), size_i - 1); + const e0 = e < size_i - 1 ? Math.floor(e) : e - 1; + const n0 = e0 + 1 - e; + const n1 = e - e0; + const offset0 = e0 * k; + const offset1 = offset0 + k; + for (j = 0; j < cubeVertices; j++) { + if (j & pos) { + cubeN[j] *= n1; + cubeVertex[j] += offset1; + } else { + cubeN[j] *= n0; + cubeVertex[j] += offset0; + } + } + k *= size_i; + pos <<= 1; + } + for (j = 0; j < outputSize; ++j) { + let rj = 0; + for (i = 0; i < cubeVertices; i++) { + rj += samples[cubeVertex[i] + j] * cubeN[i]; + } + rj = interpolate(rj, 0, 1, decode[j][0], decode[j][1]); + dest[destOffset + j] = Math.min(Math.max(rj, range[j][0]), range[j][1]); + } + }; + } + static constructInterpolated({ + xref, + isEvalSupported, + dict + }) { + const c0 = toNumberArray(dict.getArray("C0")) || [0]; + const c1 = toNumberArray(dict.getArray("C1")) || [1]; + const n = dict.get("N"); + const diff = []; + for (let i = 0, ii = c0.length; i < ii; ++i) { + diff.push(c1[i] - c0[i]); + } + const length = diff.length; + return function constructInterpolatedFn(src, srcOffset, dest, destOffset) { + const x = n === 1 ? src[srcOffset] : src[srcOffset] ** n; + for (let j = 0; j < length; ++j) { + dest[destOffset + j] = c0[j] + x * diff[j]; + } + }; + } + static constructStiched({ + xref, + isEvalSupported, + dict + }) { + const domain = toNumberArray(dict.getArray("Domain")); + if (!domain) { + throw new FormatError("No domain"); + } + const inputSize = domain.length / 2; + if (inputSize !== 1) { + throw new FormatError("Bad domain for stiched function"); + } + const fns = []; + for (const fn of dict.get("Functions")) { + fns.push(this.parse({ + xref, + isEvalSupported, + fn: xref.fetchIfRef(fn) + })); + } + const bounds = toNumberArray(dict.getArray("Bounds")); + const encode = toNumberArray(dict.getArray("Encode")); + const tmpBuf = new Float32Array(1); + return function constructStichedFn(src, srcOffset, dest, destOffset) { + const clip = function constructStichedFromIRClip(v, min, max) { + if (v > max) { + v = max; + } else if (v < min) { + v = min; + } + return v; + }; + const v = clip(src[srcOffset], domain[0], domain[1]); + const length = bounds.length; + let i; + for (i = 0; i < length; ++i) { + if (v < bounds[i]) { + break; + } + } + let dmin = domain[0]; + if (i > 0) { + dmin = bounds[i - 1]; + } + let dmax = domain[1]; + if (i < bounds.length) { + dmax = bounds[i]; + } + const rmin = encode[2 * i]; + const rmax = encode[2 * i + 1]; + tmpBuf[0] = dmin === dmax ? rmin : rmin + (v - dmin) * (rmax - rmin) / (dmax - dmin); + fns[i](tmpBuf, 0, dest, destOffset); + }; + } + static constructPostScript({ + xref, + isEvalSupported, + fn, + dict + }) { + const domain = toNumberArray(dict.getArray("Domain")); + const range = toNumberArray(dict.getArray("Range")); + if (!domain) { + throw new FormatError("No domain."); + } + if (!range) { + throw new FormatError("No range."); + } + const lexer = new PostScriptLexer(fn); + const parser = new PostScriptParser(lexer); + const code = parser.parse(); + if (isEvalSupported && FeatureTest.isEvalSupported) { + const compiled = new PostScriptCompiler().compile(code, domain, range); + if (compiled) { + return new Function("src", "srcOffset", "dest", "destOffset", compiled); + } + } + info("Unable to compile PS function"); + const numOutputs = range.length >> 1; + const numInputs = domain.length >> 1; + const evaluator = new PostScriptEvaluator(code); + const cache = Object.create(null); + const MAX_CACHE_SIZE = 2048 * 4; + let cache_available = MAX_CACHE_SIZE; + const tmpBuf = new Float32Array(numInputs); + return function constructPostScriptFn(src, srcOffset, dest, destOffset) { + let i, value; + let key = ""; + const input = tmpBuf; + for (i = 0; i < numInputs; i++) { + value = src[srcOffset + i]; + input[i] = value; + key += value + "_"; + } + const cachedValue = cache[key]; + if (cachedValue !== undefined) { + dest.set(cachedValue, destOffset); + return; + } + const output = new Float32Array(numOutputs); + const stack = evaluator.execute(input); + const stackIndex = stack.length - numOutputs; + for (i = 0; i < numOutputs; i++) { + value = stack[stackIndex + i]; + let bound = range[i * 2]; + if (value < bound) { + value = bound; + } else { + bound = range[i * 2 + 1]; + if (value > bound) { + value = bound; + } + } + output[i] = value; + } + if (cache_available > 0) { + cache_available--; + cache[key] = output; + } + dest.set(output, destOffset); + }; + } +} +function isPDFFunction(v) { + let fnDict; + if (v instanceof Dict) { + fnDict = v; + } else if (v instanceof BaseStream) { + fnDict = v.dict; + } else { + return false; + } + return fnDict.has("FunctionType"); +} +class PostScriptStack { + static MAX_STACK_SIZE = 100; + constructor(initialStack) { + this.stack = initialStack ? Array.from(initialStack) : []; + } + push(value) { + if (this.stack.length >= PostScriptStack.MAX_STACK_SIZE) { + throw new Error("PostScript function stack overflow."); + } + this.stack.push(value); + } + pop() { + if (this.stack.length <= 0) { + throw new Error("PostScript function stack underflow."); + } + return this.stack.pop(); + } + copy(n) { + if (this.stack.length + n >= PostScriptStack.MAX_STACK_SIZE) { + throw new Error("PostScript function stack overflow."); + } + const stack = this.stack; + for (let i = stack.length - n, j = n - 1; j >= 0; j--, i++) { + stack.push(stack[i]); + } + } + index(n) { + this.push(this.stack[this.stack.length - n - 1]); + } + roll(n, p) { + const stack = this.stack; + const l = stack.length - n; + const r = stack.length - 1; + const c = l + (p - Math.floor(p / n) * n); + for (let i = l, j = r; i < j; i++, j--) { + const t = stack[i]; + stack[i] = stack[j]; + stack[j] = t; + } + for (let i = l, j = c - 1; i < j; i++, j--) { + const t = stack[i]; + stack[i] = stack[j]; + stack[j] = t; + } + for (let i = c, j = r; i < j; i++, j--) { + const t = stack[i]; + stack[i] = stack[j]; + stack[j] = t; + } + } +} +class PostScriptEvaluator { + constructor(operators) { + this.operators = operators; + } + execute(initialStack) { + const stack = new PostScriptStack(initialStack); + let counter = 0; + const operators = this.operators; + const length = operators.length; + let operator, a, b; + while (counter < length) { + operator = operators[counter++]; + if (typeof operator === "number") { + stack.push(operator); + continue; + } + switch (operator) { + case "jz": + b = stack.pop(); + a = stack.pop(); + if (!a) { + counter = b; + } + break; + case "j": + a = stack.pop(); + counter = a; + break; + case "abs": + a = stack.pop(); + stack.push(Math.abs(a)); + break; + case "add": + b = stack.pop(); + a = stack.pop(); + stack.push(a + b); + break; + case "and": + b = stack.pop(); + a = stack.pop(); + if (typeof a === "boolean" && typeof b === "boolean") { + stack.push(a && b); + } else { + stack.push(a & b); + } + break; + case "atan": + b = stack.pop(); + a = stack.pop(); + a = Math.atan2(a, b) / Math.PI * 180; + if (a < 0) { + a += 360; + } + stack.push(a); + break; + case "bitshift": + b = stack.pop(); + a = stack.pop(); + if (a > 0) { + stack.push(a << b); + } else { + stack.push(a >> b); + } + break; + case "ceiling": + a = stack.pop(); + stack.push(Math.ceil(a)); + break; + case "copy": + a = stack.pop(); + stack.copy(a); + break; + case "cos": + a = stack.pop(); + stack.push(Math.cos(a % 360 / 180 * Math.PI)); + break; + case "cvi": + a = stack.pop() | 0; + stack.push(a); + break; + case "cvr": + break; + case "div": + b = stack.pop(); + a = stack.pop(); + stack.push(a / b); + break; + case "dup": + stack.copy(1); + break; + case "eq": + b = stack.pop(); + a = stack.pop(); + stack.push(a === b); + break; + case "exch": + stack.roll(2, 1); + break; + case "exp": + b = stack.pop(); + a = stack.pop(); + stack.push(a ** b); + break; + case "false": + stack.push(false); + break; + case "floor": + a = stack.pop(); + stack.push(Math.floor(a)); + break; + case "ge": + b = stack.pop(); + a = stack.pop(); + stack.push(a >= b); + break; + case "gt": + b = stack.pop(); + a = stack.pop(); + stack.push(a > b); + break; + case "idiv": + b = stack.pop(); + a = stack.pop(); + stack.push(a / b | 0); + break; + case "index": + a = stack.pop(); + stack.index(a); + break; + case "le": + b = stack.pop(); + a = stack.pop(); + stack.push(a <= b); + break; + case "ln": + a = stack.pop(); + stack.push(Math.log(a)); + break; + case "log": + a = stack.pop(); + stack.push(Math.log10(a)); + break; + case "lt": + b = stack.pop(); + a = stack.pop(); + stack.push(a < b); + break; + case "mod": + b = stack.pop(); + a = stack.pop(); + stack.push(a % b); + break; + case "mul": + b = stack.pop(); + a = stack.pop(); + stack.push(a * b); + break; + case "ne": + b = stack.pop(); + a = stack.pop(); + stack.push(a !== b); + break; + case "neg": + a = stack.pop(); + stack.push(-a); + break; + case "not": + a = stack.pop(); + if (typeof a === "boolean") { + stack.push(!a); + } else { + stack.push(~a); + } + break; + case "or": + b = stack.pop(); + a = stack.pop(); + if (typeof a === "boolean" && typeof b === "boolean") { + stack.push(a || b); + } else { + stack.push(a | b); + } + break; + case "pop": + stack.pop(); + break; + case "roll": + b = stack.pop(); + a = stack.pop(); + stack.roll(a, b); + break; + case "round": + a = stack.pop(); + stack.push(Math.round(a)); + break; + case "sin": + a = stack.pop(); + stack.push(Math.sin(a % 360 / 180 * Math.PI)); + break; + case "sqrt": + a = stack.pop(); + stack.push(Math.sqrt(a)); + break; + case "sub": + b = stack.pop(); + a = stack.pop(); + stack.push(a - b); + break; + case "true": + stack.push(true); + break; + case "truncate": + a = stack.pop(); + a = a < 0 ? Math.ceil(a) : Math.floor(a); + stack.push(a); + break; + case "xor": + b = stack.pop(); + a = stack.pop(); + if (typeof a === "boolean" && typeof b === "boolean") { + stack.push(a !== b); + } else { + stack.push(a ^ b); + } + break; + default: + throw new FormatError(`Unknown operator ${operator}`); + } + } + return stack.stack; + } +} +class AstNode { + constructor(type) { + this.type = type; + } + visit(visitor) { + unreachable("abstract method"); + } +} +class AstArgument extends AstNode { + constructor(index, min, max) { + super("args"); + this.index = index; + this.min = min; + this.max = max; + } + visit(visitor) { + visitor.visitArgument(this); + } +} +class AstLiteral extends AstNode { + constructor(number) { + super("literal"); + this.number = number; + this.min = number; + this.max = number; + } + visit(visitor) { + visitor.visitLiteral(this); + } +} +class AstBinaryOperation extends AstNode { + constructor(op, arg1, arg2, min, max) { + super("binary"); + this.op = op; + this.arg1 = arg1; + this.arg2 = arg2; + this.min = min; + this.max = max; + } + visit(visitor) { + visitor.visitBinaryOperation(this); + } +} +class AstMin extends AstNode { + constructor(arg, max) { + super("max"); + this.arg = arg; + this.min = arg.min; + this.max = max; + } + visit(visitor) { + visitor.visitMin(this); + } +} +class AstVariable extends AstNode { + constructor(index, min, max) { + super("var"); + this.index = index; + this.min = min; + this.max = max; + } + visit(visitor) { + visitor.visitVariable(this); + } +} +class AstVariableDefinition extends AstNode { + constructor(variable, arg) { + super("definition"); + this.variable = variable; + this.arg = arg; + } + visit(visitor) { + visitor.visitVariableDefinition(this); + } +} +class ExpressionBuilderVisitor { + constructor() { + this.parts = []; + } + visitArgument(arg) { + this.parts.push("Math.max(", arg.min, ", Math.min(", arg.max, ", src[srcOffset + ", arg.index, "]))"); + } + visitVariable(variable) { + this.parts.push("v", variable.index); + } + visitLiteral(literal) { + this.parts.push(literal.number); + } + visitBinaryOperation(operation) { + this.parts.push("("); + operation.arg1.visit(this); + this.parts.push(" ", operation.op, " "); + operation.arg2.visit(this); + this.parts.push(")"); + } + visitVariableDefinition(definition) { + this.parts.push("var "); + definition.variable.visit(this); + this.parts.push(" = "); + definition.arg.visit(this); + this.parts.push(";"); + } + visitMin(max) { + this.parts.push("Math.min("); + max.arg.visit(this); + this.parts.push(", ", max.max, ")"); + } + toString() { + return this.parts.join(""); + } +} +function buildAddOperation(num1, num2) { + if (num2.type === "literal" && num2.number === 0) { + return num1; + } + if (num1.type === "literal" && num1.number === 0) { + return num2; + } + if (num2.type === "literal" && num1.type === "literal") { + return new AstLiteral(num1.number + num2.number); + } + return new AstBinaryOperation("+", num1, num2, num1.min + num2.min, num1.max + num2.max); +} +function buildMulOperation(num1, num2) { + if (num2.type === "literal") { + if (num2.number === 0) { + return new AstLiteral(0); + } else if (num2.number === 1) { + return num1; + } else if (num1.type === "literal") { + return new AstLiteral(num1.number * num2.number); + } + } + if (num1.type === "literal") { + if (num1.number === 0) { + return new AstLiteral(0); + } else if (num1.number === 1) { + return num2; + } + } + const min = Math.min(num1.min * num2.min, num1.min * num2.max, num1.max * num2.min, num1.max * num2.max); + const max = Math.max(num1.min * num2.min, num1.min * num2.max, num1.max * num2.min, num1.max * num2.max); + return new AstBinaryOperation("*", num1, num2, min, max); +} +function buildSubOperation(num1, num2) { + if (num2.type === "literal") { + if (num2.number === 0) { + return num1; + } else if (num1.type === "literal") { + return new AstLiteral(num1.number - num2.number); + } + } + if (num2.type === "binary" && num2.op === "-" && num1.type === "literal" && num1.number === 1 && num2.arg1.type === "literal" && num2.arg1.number === 1) { + return num2.arg2; + } + return new AstBinaryOperation("-", num1, num2, num1.min - num2.max, num1.max - num2.min); +} +function buildMinOperation(num1, max) { + if (num1.min >= max) { + return new AstLiteral(max); + } else if (num1.max <= max) { + return num1; + } + return new AstMin(num1, max); +} +class PostScriptCompiler { + compile(code, domain, range) { + const stack = []; + const instructions = []; + const inputSize = domain.length >> 1, + outputSize = range.length >> 1; + let lastRegister = 0; + let n, j; + let num1, num2, ast1, ast2, tmpVar, item; + for (let i = 0; i < inputSize; i++) { + stack.push(new AstArgument(i, domain[i * 2], domain[i * 2 + 1])); + } + for (let i = 0, ii = code.length; i < ii; i++) { + item = code[i]; + if (typeof item === "number") { + stack.push(new AstLiteral(item)); + continue; + } + switch (item) { + case "add": + if (stack.length < 2) { + return null; + } + num2 = stack.pop(); + num1 = stack.pop(); + stack.push(buildAddOperation(num1, num2)); + break; + case "cvr": + if (stack.length < 1) { + return null; + } + break; + case "mul": + if (stack.length < 2) { + return null; + } + num2 = stack.pop(); + num1 = stack.pop(); + stack.push(buildMulOperation(num1, num2)); + break; + case "sub": + if (stack.length < 2) { + return null; + } + num2 = stack.pop(); + num1 = stack.pop(); + stack.push(buildSubOperation(num1, num2)); + break; + case "exch": + if (stack.length < 2) { + return null; + } + ast1 = stack.pop(); + ast2 = stack.pop(); + stack.push(ast1, ast2); + break; + case "pop": + if (stack.length < 1) { + return null; + } + stack.pop(); + break; + case "index": + if (stack.length < 1) { + return null; + } + num1 = stack.pop(); + if (num1.type !== "literal") { + return null; + } + n = num1.number; + if (n < 0 || !Number.isInteger(n) || stack.length < n) { + return null; + } + ast1 = stack[stack.length - n - 1]; + if (ast1.type === "literal" || ast1.type === "var") { + stack.push(ast1); + break; + } + tmpVar = new AstVariable(lastRegister++, ast1.min, ast1.max); + stack[stack.length - n - 1] = tmpVar; + stack.push(tmpVar); + instructions.push(new AstVariableDefinition(tmpVar, ast1)); + break; + case "dup": + if (stack.length < 1) { + return null; + } + if (typeof code[i + 1] === "number" && code[i + 2] === "gt" && code[i + 3] === i + 7 && code[i + 4] === "jz" && code[i + 5] === "pop" && code[i + 6] === code[i + 1]) { + num1 = stack.pop(); + stack.push(buildMinOperation(num1, code[i + 1])); + i += 6; + break; + } + ast1 = stack.at(-1); + if (ast1.type === "literal" || ast1.type === "var") { + stack.push(ast1); + break; + } + tmpVar = new AstVariable(lastRegister++, ast1.min, ast1.max); + stack[stack.length - 1] = tmpVar; + stack.push(tmpVar); + instructions.push(new AstVariableDefinition(tmpVar, ast1)); + break; + case "roll": + if (stack.length < 2) { + return null; + } + num2 = stack.pop(); + num1 = stack.pop(); + if (num2.type !== "literal" || num1.type !== "literal") { + return null; + } + j = num2.number; + n = num1.number; + if (n <= 0 || !Number.isInteger(n) || !Number.isInteger(j) || stack.length < n) { + return null; + } + j = (j % n + n) % n; + if (j === 0) { + break; + } + stack.push(...stack.splice(stack.length - n, n - j)); + break; + default: + return null; + } + } + if (stack.length !== outputSize) { + return null; + } + const result = []; + for (const instruction of instructions) { + const statementBuilder = new ExpressionBuilderVisitor(); + instruction.visit(statementBuilder); + result.push(statementBuilder.toString()); + } + for (let i = 0, ii = stack.length; i < ii; i++) { + const expr = stack[i], + statementBuilder = new ExpressionBuilderVisitor(); + expr.visit(statementBuilder); + const min = range[i * 2], + max = range[i * 2 + 1]; + const out = [statementBuilder.toString()]; + if (min > expr.min) { + out.unshift("Math.max(", min, ", "); + out.push(")"); + } + if (max < expr.max) { + out.unshift("Math.min(", max, ", "); + out.push(")"); + } + out.unshift("dest[destOffset + ", i, "] = "); + out.push(";"); + result.push(out.join("")); + } + return result.join("\n"); + } +} + +;// ./src/core/bidi.js + +const baseTypes = ["BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "S", "B", "S", "WS", "B", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "B", "B", "B", "S", "WS", "ON", "ON", "ET", "ET", "ET", "ON", "ON", "ON", "ON", "ON", "ES", "CS", "ES", "CS", "CS", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "CS", "ON", "ON", "ON", "ON", "ON", "ON", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "ON", "ON", "ON", "ON", "ON", "ON", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "ON", "ON", "ON", "ON", "BN", "BN", "BN", "BN", "BN", "BN", "B", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "CS", "ON", "ET", "ET", "ET", "ET", "ON", "ON", "ON", "ON", "L", "ON", "ON", "BN", "ON", "ON", "ET", "ET", "EN", "EN", "ON", "L", "ON", "ON", "ON", "EN", "L", "ON", "ON", "ON", "ON", "ON", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "ON", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "ON", "L", "L", "L", "L", "L", "L", "L", "L"]; +const arabicTypes = ["AN", "AN", "AN", "AN", "AN", "AN", "ON", "ON", "AL", "ET", "ET", "AL", "CS", "AL", "ON", "ON", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "ET", "AN", "AN", "AL", "AL", "AL", "NSM", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AN", "ON", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "NSM", "NSM", "ON", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "AL", "AL", "AL", "AL", "AL", "AL"]; +function isOdd(i) { + return (i & 1) !== 0; +} +function isEven(i) { + return (i & 1) === 0; +} +function findUnequal(arr, start, value) { + let j, jj; + for (j = start, jj = arr.length; j < jj; ++j) { + if (arr[j] !== value) { + return j; + } + } + return j; +} +function setValues(arr, start, end, value) { + for (let j = start; j < end; ++j) { + arr[j] = value; + } +} +function reverseValues(arr, start, end) { + for (let i = start, j = end - 1; i < j; ++i, --j) { + const temp = arr[i]; + arr[i] = arr[j]; + arr[j] = temp; + } +} +function createBidiText(str, isLTR, vertical = false) { + let dir = "ltr"; + if (vertical) { + dir = "ttb"; + } else if (!isLTR) { + dir = "rtl"; + } + return { + str, + dir + }; +} +const chars = []; +const types = []; +function bidi(str, startLevel = -1, vertical = false) { + let isLTR = true; + const strLength = str.length; + if (strLength === 0 || vertical) { + return createBidiText(str, isLTR, vertical); + } + chars.length = strLength; + types.length = strLength; + let numBidi = 0; + let i, ii; + for (i = 0; i < strLength; ++i) { + chars[i] = str.charAt(i); + const charCode = str.charCodeAt(i); + let charType = "L"; + if (charCode <= 0x00ff) { + charType = baseTypes[charCode]; + } else if (0x0590 <= charCode && charCode <= 0x05f4) { + charType = "R"; + } else if (0x0600 <= charCode && charCode <= 0x06ff) { + charType = arabicTypes[charCode & 0xff]; + if (!charType) { + warn("Bidi: invalid Unicode character " + charCode.toString(16)); + } + } else if (0x0700 <= charCode && charCode <= 0x08ac || 0xfb50 <= charCode && charCode <= 0xfdff || 0xfe70 <= charCode && charCode <= 0xfeff) { + charType = "AL"; + } + if (charType === "R" || charType === "AL" || charType === "AN") { + numBidi++; + } + types[i] = charType; + } + if (numBidi === 0) { + isLTR = true; + return createBidiText(str, isLTR); + } + if (startLevel === -1) { + if (numBidi / strLength < 0.3 && strLength > 4) { + isLTR = true; + startLevel = 0; + } else { + isLTR = false; + startLevel = 1; + } + } + const levels = []; + for (i = 0; i < strLength; ++i) { + levels[i] = startLevel; + } + const e = isOdd(startLevel) ? "R" : "L"; + const sor = e; + const eor = sor; + let lastType = sor; + for (i = 0; i < strLength; ++i) { + if (types[i] === "NSM") { + types[i] = lastType; + } else { + lastType = types[i]; + } + } + lastType = sor; + let t; + for (i = 0; i < strLength; ++i) { + t = types[i]; + if (t === "EN") { + types[i] = lastType === "AL" ? "AN" : "EN"; + } else if (t === "R" || t === "L" || t === "AL") { + lastType = t; + } + } + for (i = 0; i < strLength; ++i) { + t = types[i]; + if (t === "AL") { + types[i] = "R"; + } + } + for (i = 1; i < strLength - 1; ++i) { + if (types[i] === "ES" && types[i - 1] === "EN" && types[i + 1] === "EN") { + types[i] = "EN"; + } + if (types[i] === "CS" && (types[i - 1] === "EN" || types[i - 1] === "AN") && types[i + 1] === types[i - 1]) { + types[i] = types[i - 1]; + } + } + for (i = 0; i < strLength; ++i) { + if (types[i] === "EN") { + for (let j = i - 1; j >= 0; --j) { + if (types[j] !== "ET") { + break; + } + types[j] = "EN"; + } + for (let j = i + 1; j < strLength; ++j) { + if (types[j] !== "ET") { + break; + } + types[j] = "EN"; + } + } + } + for (i = 0; i < strLength; ++i) { + t = types[i]; + if (t === "WS" || t === "ES" || t === "ET" || t === "CS") { + types[i] = "ON"; + } + } + lastType = sor; + for (i = 0; i < strLength; ++i) { + t = types[i]; + if (t === "EN") { + types[i] = lastType === "L" ? "L" : "EN"; + } else if (t === "R" || t === "L") { + lastType = t; + } + } + for (i = 0; i < strLength; ++i) { + if (types[i] === "ON") { + const end = findUnequal(types, i + 1, "ON"); + let before = sor; + if (i > 0) { + before = types[i - 1]; + } + let after = eor; + if (end + 1 < strLength) { + after = types[end + 1]; + } + if (before !== "L") { + before = "R"; + } + if (after !== "L") { + after = "R"; + } + if (before === after) { + setValues(types, i, end, before); + } + i = end - 1; + } + } + for (i = 0; i < strLength; ++i) { + if (types[i] === "ON") { + types[i] = e; + } + } + for (i = 0; i < strLength; ++i) { + t = types[i]; + if (isEven(levels[i])) { + if (t === "R") { + levels[i] += 1; + } else if (t === "AN" || t === "EN") { + levels[i] += 2; + } + } else if (t === "L" || t === "AN" || t === "EN") { + levels[i] += 1; + } + } + let highestLevel = -1; + let lowestOddLevel = 99; + let level; + for (i = 0, ii = levels.length; i < ii; ++i) { + level = levels[i]; + if (highestLevel < level) { + highestLevel = level; + } + if (lowestOddLevel > level && isOdd(level)) { + lowestOddLevel = level; + } + } + for (level = highestLevel; level >= lowestOddLevel; --level) { + let start = -1; + for (i = 0, ii = levels.length; i < ii; ++i) { + if (levels[i] < level) { + if (start >= 0) { + reverseValues(chars, start, i); + start = -1; + } + } else if (start < 0) { + start = i; + } + } + if (start >= 0) { + reverseValues(chars, start, levels.length); + } + } + for (i = 0, ii = chars.length; i < ii; ++i) { + const ch = chars[i]; + if (ch === "<" || ch === ">") { + chars[i] = ""; + } + } + return createBidiText(chars.join(""), isLTR); +} + +;// ./src/core/font_substitutions.js + + + +const NORMAL = { + style: "normal", + weight: "normal" +}; +const BOLD = { + style: "normal", + weight: "bold" +}; +const ITALIC = { + style: "italic", + weight: "normal" +}; +const BOLDITALIC = { + style: "italic", + weight: "bold" +}; +const substitutionMap = new Map([["Times-Roman", { + local: ["Times New Roman", "Times-Roman", "Times", "Liberation Serif", "Nimbus Roman", "Nimbus Roman L", "Tinos", "Thorndale", "TeX Gyre Termes", "FreeSerif", "Linux Libertine O", "Libertinus Serif", "DejaVu Serif", "Bitstream Vera Serif", "Ubuntu"], + style: NORMAL, + ultimate: "serif" +}], ["Times-Bold", { + alias: "Times-Roman", + style: BOLD, + ultimate: "serif" +}], ["Times-Italic", { + alias: "Times-Roman", + style: ITALIC, + ultimate: "serif" +}], ["Times-BoldItalic", { + alias: "Times-Roman", + style: BOLDITALIC, + ultimate: "serif" +}], ["Helvetica", { + local: ["Helvetica", "Helvetica Neue", "Arial", "Arial Nova", "Liberation Sans", "Arimo", "Nimbus Sans", "Nimbus Sans L", "A030", "TeX Gyre Heros", "FreeSans", "DejaVu Sans", "Albany", "Bitstream Vera Sans", "Arial Unicode MS", "Microsoft Sans Serif", "Apple Symbols", "Cantarell"], + path: "LiberationSans-Regular.ttf", + style: NORMAL, + ultimate: "sans-serif" +}], ["Helvetica-Bold", { + alias: "Helvetica", + path: "LiberationSans-Bold.ttf", + style: BOLD, + ultimate: "sans-serif" +}], ["Helvetica-Oblique", { + alias: "Helvetica", + path: "LiberationSans-Italic.ttf", + style: ITALIC, + ultimate: "sans-serif" +}], ["Helvetica-BoldOblique", { + alias: "Helvetica", + path: "LiberationSans-BoldItalic.ttf", + style: BOLDITALIC, + ultimate: "sans-serif" +}], ["Courier", { + local: ["Courier", "Courier New", "Liberation Mono", "Nimbus Mono", "Nimbus Mono L", "Cousine", "Cumberland", "TeX Gyre Cursor", "FreeMono", "Linux Libertine Mono O", "Libertinus Mono"], + style: NORMAL, + ultimate: "monospace" +}], ["Courier-Bold", { + alias: "Courier", + style: BOLD, + ultimate: "monospace" +}], ["Courier-Oblique", { + alias: "Courier", + style: ITALIC, + ultimate: "monospace" +}], ["Courier-BoldOblique", { + alias: "Courier", + style: BOLDITALIC, + ultimate: "monospace" +}], ["ArialBlack", { + local: ["Arial Black"], + style: { + style: "normal", + weight: "900" + }, + fallback: "Helvetica-Bold" +}], ["ArialBlack-Bold", { + alias: "ArialBlack" +}], ["ArialBlack-Italic", { + alias: "ArialBlack", + style: { + style: "italic", + weight: "900" + }, + fallback: "Helvetica-BoldOblique" +}], ["ArialBlack-BoldItalic", { + alias: "ArialBlack-Italic" +}], ["ArialNarrow", { + local: ["Arial Narrow", "Liberation Sans Narrow", "Helvetica Condensed", "Nimbus Sans Narrow", "TeX Gyre Heros Cn"], + style: NORMAL, + fallback: "Helvetica" +}], ["ArialNarrow-Bold", { + alias: "ArialNarrow", + style: BOLD, + fallback: "Helvetica-Bold" +}], ["ArialNarrow-Italic", { + alias: "ArialNarrow", + style: ITALIC, + fallback: "Helvetica-Oblique" +}], ["ArialNarrow-BoldItalic", { + alias: "ArialNarrow", + style: BOLDITALIC, + fallback: "Helvetica-BoldOblique" +}], ["Calibri", { + local: ["Calibri", "Carlito"], + style: NORMAL, + fallback: "Helvetica" +}], ["Calibri-Bold", { + alias: "Calibri", + style: BOLD, + fallback: "Helvetica-Bold" +}], ["Calibri-Italic", { + alias: "Calibri", + style: ITALIC, + fallback: "Helvetica-Oblique" +}], ["Calibri-BoldItalic", { + alias: "Calibri", + style: BOLDITALIC, + fallback: "Helvetica-BoldOblique" +}], ["Wingdings", { + local: ["Wingdings", "URW Dingbats"], + style: NORMAL +}], ["Wingdings-Regular", { + alias: "Wingdings" +}], ["Wingdings-Bold", { + alias: "Wingdings" +}]]); +const fontAliases = new Map([["Arial-Black", "ArialBlack"]]); +function getStyleToAppend(style) { + switch (style) { + case BOLD: + return "Bold"; + case ITALIC: + return "Italic"; + case BOLDITALIC: + return "Bold Italic"; + default: + if (style?.weight === "bold") { + return "Bold"; + } + if (style?.style === "italic") { + return "Italic"; + } + } + return ""; +} +function getFamilyName(str) { + const keywords = new Set(["thin", "extralight", "ultralight", "demilight", "semilight", "light", "book", "regular", "normal", "medium", "demibold", "semibold", "bold", "extrabold", "ultrabold", "black", "heavy", "extrablack", "ultrablack", "roman", "italic", "oblique", "ultracondensed", "extracondensed", "condensed", "semicondensed", "normal", "semiexpanded", "expanded", "extraexpanded", "ultraexpanded", "bolditalic"]); + return str.split(/[- ,+]+/g).filter(tok => !keywords.has(tok.toLowerCase())).join(" "); +} +function generateFont({ + alias, + local, + path, + fallback, + style, + ultimate +}, src, localFontPath, useFallback = true, usePath = true, append = "") { + const result = { + style: null, + ultimate: null + }; + if (local) { + const extra = append ? ` ${append}` : ""; + for (const name of local) { + src.push(`local(${name}${extra})`); + } + } + if (alias) { + const substitution = substitutionMap.get(alias); + const aliasAppend = append || getStyleToAppend(style); + Object.assign(result, generateFont(substitution, src, localFontPath, useFallback && !fallback, usePath && !path, aliasAppend)); + } + if (style) { + result.style = style; + } + if (ultimate) { + result.ultimate = ultimate; + } + if (useFallback && fallback) { + const fallbackInfo = substitutionMap.get(fallback); + const { + ultimate: fallbackUltimate + } = generateFont(fallbackInfo, src, localFontPath, useFallback, usePath && !path, append); + result.ultimate ||= fallbackUltimate; + } + if (usePath && path && localFontPath) { + src.push(`url(${localFontPath}${path})`); + } + return result; +} +function getFontSubstitution(systemFontCache, idFactory, localFontPath, baseFontName, standardFontName, type) { + if (baseFontName.startsWith("InvalidPDFjsFont_")) { + return null; + } + if ((type === "TrueType" || type === "Type1") && /^[A-Z]{6}\+/.test(baseFontName)) { + baseFontName = baseFontName.slice(7); + } + baseFontName = normalizeFontName(baseFontName); + const key = baseFontName; + let substitutionInfo = systemFontCache.get(key); + if (substitutionInfo) { + return substitutionInfo; + } + let substitution = substitutionMap.get(baseFontName); + if (!substitution) { + for (const [alias, subst] of fontAliases) { + if (baseFontName.startsWith(alias)) { + baseFontName = `${subst}${baseFontName.substring(alias.length)}`; + substitution = substitutionMap.get(baseFontName); + break; + } + } + } + let mustAddBaseFont = false; + if (!substitution) { + substitution = substitutionMap.get(standardFontName); + mustAddBaseFont = true; + } + const loadedName = `${idFactory.getDocId()}_s${idFactory.createFontId()}`; + if (!substitution) { + if (!validateFontName(baseFontName)) { + warn(`Cannot substitute the font because of its name: ${baseFontName}`); + systemFontCache.set(key, null); + return null; + } + const bold = /bold/gi.test(baseFontName); + const italic = /oblique|italic/gi.test(baseFontName); + const style = bold && italic && BOLDITALIC || bold && BOLD || italic && ITALIC || NORMAL; + substitutionInfo = { + css: `"${getFamilyName(baseFontName)}",${loadedName}`, + guessFallback: true, + loadedName, + baseFontName, + src: `local(${baseFontName})`, + style + }; + systemFontCache.set(key, substitutionInfo); + return substitutionInfo; + } + const src = []; + if (mustAddBaseFont && validateFontName(baseFontName)) { + src.push(`local(${baseFontName})`); + } + const { + style, + ultimate + } = generateFont(substitution, src, localFontPath); + const guessFallback = ultimate === null; + const fallback = guessFallback ? "" : `,${ultimate}`; + substitutionInfo = { + css: `"${getFamilyName(baseFontName)}",${loadedName}${fallback}`, + guessFallback, + loadedName, + baseFontName, + src: src.join(","), + style + }; + systemFontCache.set(key, substitutionInfo); + return substitutionInfo; +} + +;// ./src/core/image_resizer.js + + + +const MIN_IMAGE_DIM = 2048; +const MAX_IMAGE_DIM = 65537; +const MAX_ERROR = 128; +class ImageResizer { + static #goodSquareLength = MIN_IMAGE_DIM; + static #isImageDecoderSupported = FeatureTest.isImageDecoderSupported; + constructor(imgData, isMask) { + this._imgData = imgData; + this._isMask = isMask; + } + static get canUseImageDecoder() { + return shadow(this, "canUseImageDecoder", this.#isImageDecoderSupported ? ImageDecoder.isTypeSupported("image/bmp") : Promise.resolve(false)); + } + static needsToBeResized(width, height) { + if (width <= this.#goodSquareLength && height <= this.#goodSquareLength) { + return false; + } + const { + MAX_DIM + } = this; + if (width > MAX_DIM || height > MAX_DIM) { + return true; + } + const area = width * height; + if (this._hasMaxArea) { + return area > this.MAX_AREA; + } + if (area < this.#goodSquareLength ** 2) { + return false; + } + if (this._areGoodDims(width, height)) { + this.#goodSquareLength = Math.max(this.#goodSquareLength, Math.floor(Math.sqrt(width * height))); + return false; + } + this.#goodSquareLength = this._guessMax(this.#goodSquareLength, MAX_DIM, MAX_ERROR, 0); + const maxArea = this.MAX_AREA = this.#goodSquareLength ** 2; + return area > maxArea; + } + static get MAX_DIM() { + return shadow(this, "MAX_DIM", this._guessMax(MIN_IMAGE_DIM, MAX_IMAGE_DIM, 0, 1)); + } + static get MAX_AREA() { + this._hasMaxArea = true; + return shadow(this, "MAX_AREA", this._guessMax(this.#goodSquareLength, this.MAX_DIM, MAX_ERROR, 0) ** 2); + } + static set MAX_AREA(area) { + if (area >= 0) { + this._hasMaxArea = true; + shadow(this, "MAX_AREA", area); + } + } + static setOptions({ + canvasMaxAreaInBytes = -1, + isImageDecoderSupported = false + }) { + if (!this._hasMaxArea) { + this.MAX_AREA = canvasMaxAreaInBytes >> 2; + } + this.#isImageDecoderSupported = isImageDecoderSupported; + } + static _areGoodDims(width, height) { + try { + const canvas = new OffscreenCanvas(width, height); + const ctx = canvas.getContext("2d"); + ctx.fillRect(0, 0, 1, 1); + const opacity = ctx.getImageData(0, 0, 1, 1).data[3]; + canvas.width = canvas.height = 1; + return opacity !== 0; + } catch { + return false; + } + } + static _guessMax(start, end, tolerance, defaultHeight) { + while (start + tolerance + 1 < end) { + const middle = Math.floor((start + end) / 2); + const height = defaultHeight || middle; + if (this._areGoodDims(middle, height)) { + start = middle; + } else { + end = middle; + } + } + return start; + } + static async createImage(imgData, isMask = false) { + return new ImageResizer(imgData, isMask)._createImage(); + } + async _createImage() { + const { + _imgData: imgData + } = this; + const { + width, + height + } = imgData; + if (width * height * 4 > MAX_INT_32) { + const result = this.#rescaleImageData(); + if (result) { + return result; + } + } + const data = this._encodeBMP(); + let decoder, imagePromise; + if (await ImageResizer.canUseImageDecoder) { + decoder = new ImageDecoder({ + data, + type: "image/bmp", + preferAnimation: false, + transfer: [data.buffer] + }); + imagePromise = decoder.decode().catch(reason => { + warn(`BMP image decoding failed: ${reason}`); + return createImageBitmap(new Blob([this._encodeBMP().buffer], { + type: "image/bmp" + })); + }).finally(() => { + decoder.close(); + }); + } else { + imagePromise = createImageBitmap(new Blob([data.buffer], { + type: "image/bmp" + })); + } + const { + MAX_AREA, + MAX_DIM + } = ImageResizer; + const minFactor = Math.max(width / MAX_DIM, height / MAX_DIM, Math.sqrt(width * height / MAX_AREA)); + const firstFactor = Math.max(minFactor, 2); + const factor = Math.round(10 * (minFactor + 1.25)) / 10 / firstFactor; + const N = Math.floor(Math.log2(factor)); + const steps = new Array(N + 2).fill(2); + steps[0] = firstFactor; + steps.splice(-1, 1, factor / (1 << N)); + let newWidth = width; + let newHeight = height; + const result = await imagePromise; + let bitmap = result.image || result; + for (const step of steps) { + const prevWidth = newWidth; + const prevHeight = newHeight; + newWidth = Math.floor(newWidth / step) - 1; + newHeight = Math.floor(newHeight / step) - 1; + const canvas = new OffscreenCanvas(newWidth, newHeight); + const ctx = canvas.getContext("2d"); + ctx.drawImage(bitmap, 0, 0, prevWidth, prevHeight, 0, 0, newWidth, newHeight); + bitmap.close(); + bitmap = canvas.transferToImageBitmap(); + } + imgData.data = null; + imgData.bitmap = bitmap; + imgData.width = newWidth; + imgData.height = newHeight; + return imgData; + } + #rescaleImageData() { + const { + _imgData: imgData + } = this; + const { + data, + width, + height, + kind + } = imgData; + const rgbaSize = width * height * 4; + const K = Math.ceil(Math.log2(rgbaSize / MAX_INT_32)); + const newWidth = width >> K; + const newHeight = height >> K; + let rgbaData; + let maxHeight = height; + try { + rgbaData = new Uint8Array(rgbaSize); + } catch { + let n = Math.floor(Math.log2(rgbaSize + 1)); + while (true) { + try { + rgbaData = new Uint8Array(2 ** n - 1); + break; + } catch { + n -= 1; + } + } + maxHeight = Math.floor((2 ** n - 1) / (width * 4)); + const newSize = width * maxHeight * 4; + if (newSize < rgbaData.length) { + rgbaData = new Uint8Array(newSize); + } + } + const src32 = new Uint32Array(rgbaData.buffer); + const dest32 = new Uint32Array(newWidth * newHeight); + let srcPos = 0; + let newIndex = 0; + const step = Math.ceil(height / maxHeight); + const remainder = height % maxHeight === 0 ? height : height % maxHeight; + for (let k = 0; k < step; k++) { + const h = k < step - 1 ? maxHeight : remainder; + ({ + srcPos + } = convertToRGBA({ + kind, + src: data, + dest: src32, + width, + height: h, + inverseDecode: this._isMask, + srcPos + })); + for (let i = 0, ii = h >> K; i < ii; i++) { + const buf = src32.subarray((i << K) * width); + for (let j = 0; j < newWidth; j++) { + dest32[newIndex++] = buf[j << K]; + } + } + } + if (ImageResizer.needsToBeResized(newWidth, newHeight)) { + imgData.data = dest32; + imgData.width = newWidth; + imgData.height = newHeight; + imgData.kind = ImageKind.RGBA_32BPP; + return null; + } + const canvas = new OffscreenCanvas(newWidth, newHeight); + const ctx = canvas.getContext("2d", { + willReadFrequently: true + }); + ctx.putImageData(new ImageData(new Uint8ClampedArray(dest32.buffer), newWidth, newHeight), 0, 0); + imgData.data = null; + imgData.bitmap = canvas.transferToImageBitmap(); + imgData.width = newWidth; + imgData.height = newHeight; + return imgData; + } + _encodeBMP() { + const { + width, + height, + kind + } = this._imgData; + let data = this._imgData.data; + let bitPerPixel; + let colorTable = new Uint8Array(0); + let maskTable = colorTable; + let compression = 0; + switch (kind) { + case ImageKind.GRAYSCALE_1BPP: + { + bitPerPixel = 1; + colorTable = new Uint8Array(this._isMask ? [255, 255, 255, 255, 0, 0, 0, 0] : [0, 0, 0, 0, 255, 255, 255, 255]); + const rowLen = width + 7 >> 3; + const rowSize = rowLen + 3 & -4; + if (rowLen !== rowSize) { + const newData = new Uint8Array(rowSize * height); + let k = 0; + for (let i = 0, ii = height * rowLen; i < ii; i += rowLen, k += rowSize) { + newData.set(data.subarray(i, i + rowLen), k); + } + data = newData; + } + break; + } + case ImageKind.RGB_24BPP: + { + bitPerPixel = 24; + if (width & 3) { + const rowLen = 3 * width; + const rowSize = rowLen + 3 & -4; + const extraLen = rowSize - rowLen; + const newData = new Uint8Array(rowSize * height); + let k = 0; + for (let i = 0, ii = height * rowLen; i < ii; i += rowLen) { + const row = data.subarray(i, i + rowLen); + for (let j = 0; j < rowLen; j += 3) { + newData[k++] = row[j + 2]; + newData[k++] = row[j + 1]; + newData[k++] = row[j]; + } + k += extraLen; + } + data = newData; + } else { + for (let i = 0, ii = data.length; i < ii; i += 3) { + const tmp = data[i]; + data[i] = data[i + 2]; + data[i + 2] = tmp; + } + } + break; + } + case ImageKind.RGBA_32BPP: + bitPerPixel = 32; + compression = 3; + maskTable = new Uint8Array(4 + 4 + 4 + 4 + 52); + const view = new DataView(maskTable.buffer); + if (FeatureTest.isLittleEndian) { + view.setUint32(0, 0x000000ff, true); + view.setUint32(4, 0x0000ff00, true); + view.setUint32(8, 0x00ff0000, true); + view.setUint32(12, 0xff000000, true); + } else { + view.setUint32(0, 0xff000000, true); + view.setUint32(4, 0x00ff0000, true); + view.setUint32(8, 0x0000ff00, true); + view.setUint32(12, 0x000000ff, true); + } + break; + default: + throw new Error("invalid format"); + } + let i = 0; + const headerLength = 40 + maskTable.length; + const fileLength = 14 + headerLength + colorTable.length + data.length; + const bmpData = new Uint8Array(fileLength); + const view = new DataView(bmpData.buffer); + view.setUint16(i, 0x4d42, true); + i += 2; + view.setUint32(i, fileLength, true); + i += 4; + view.setUint32(i, 0, true); + i += 4; + view.setUint32(i, 14 + headerLength + colorTable.length, true); + i += 4; + view.setUint32(i, headerLength, true); + i += 4; + view.setInt32(i, width, true); + i += 4; + view.setInt32(i, -height, true); + i += 4; + view.setUint16(i, 1, true); + i += 2; + view.setUint16(i, bitPerPixel, true); + i += 2; + view.setUint32(i, compression, true); + i += 4; + view.setUint32(i, 0, true); + i += 4; + view.setInt32(i, 0, true); + i += 4; + view.setInt32(i, 0, true); + i += 4; + view.setUint32(i, colorTable.length / 4, true); + i += 4; + view.setUint32(i, 0, true); + i += 4; + bmpData.set(maskTable, i); + i += maskTable.length; + bmpData.set(colorTable, i); + i += colorTable.length; + bmpData.set(data, i); + return bmpData; + } +} + +;// ./src/shared/murmurhash3.js +const SEED = 0xc3d2e1f0; +const MASK_HIGH = 0xffff0000; +const MASK_LOW = 0xffff; +class MurmurHash3_64 { + constructor(seed) { + this.h1 = seed ? seed & 0xffffffff : SEED; + this.h2 = seed ? seed & 0xffffffff : SEED; + } + update(input) { + let data, length; + if (typeof input === "string") { + data = new Uint8Array(input.length * 2); + length = 0; + for (let i = 0, ii = input.length; i < ii; i++) { + const code = input.charCodeAt(i); + if (code <= 0xff) { + data[length++] = code; + } else { + data[length++] = code >>> 8; + data[length++] = code & 0xff; + } + } + } else if (ArrayBuffer.isView(input)) { + data = input.slice(); + length = data.byteLength; + } else { + throw new Error("Invalid data format, must be a string or TypedArray."); + } + const blockCounts = length >> 2; + const tailLength = length - blockCounts * 4; + const dataUint32 = new Uint32Array(data.buffer, 0, blockCounts); + let k1 = 0, + k2 = 0; + let h1 = this.h1, + h2 = this.h2; + const C1 = 0xcc9e2d51, + C2 = 0x1b873593; + const C1_LOW = C1 & MASK_LOW, + C2_LOW = C2 & MASK_LOW; + for (let i = 0; i < blockCounts; i++) { + if (i & 1) { + k1 = dataUint32[i]; + k1 = k1 * C1 & MASK_HIGH | k1 * C1_LOW & MASK_LOW; + k1 = k1 << 15 | k1 >>> 17; + k1 = k1 * C2 & MASK_HIGH | k1 * C2_LOW & MASK_LOW; + h1 ^= k1; + h1 = h1 << 13 | h1 >>> 19; + h1 = h1 * 5 + 0xe6546b64; + } else { + k2 = dataUint32[i]; + k2 = k2 * C1 & MASK_HIGH | k2 * C1_LOW & MASK_LOW; + k2 = k2 << 15 | k2 >>> 17; + k2 = k2 * C2 & MASK_HIGH | k2 * C2_LOW & MASK_LOW; + h2 ^= k2; + h2 = h2 << 13 | h2 >>> 19; + h2 = h2 * 5 + 0xe6546b64; + } + } + k1 = 0; + switch (tailLength) { + case 3: + k1 ^= data[blockCounts * 4 + 2] << 16; + case 2: + k1 ^= data[blockCounts * 4 + 1] << 8; + case 1: + k1 ^= data[blockCounts * 4]; + k1 = k1 * C1 & MASK_HIGH | k1 * C1_LOW & MASK_LOW; + k1 = k1 << 15 | k1 >>> 17; + k1 = k1 * C2 & MASK_HIGH | k1 * C2_LOW & MASK_LOW; + if (blockCounts & 1) { + h1 ^= k1; + } else { + h2 ^= k1; + } + } + this.h1 = h1; + this.h2 = h2; + } + hexdigest() { + let h1 = this.h1, + h2 = this.h2; + h1 ^= h2 >>> 1; + h1 = h1 * 0xed558ccd & MASK_HIGH | h1 * 0x8ccd & MASK_LOW; + h2 = h2 * 0xff51afd7 & MASK_HIGH | ((h2 << 16 | h1 >>> 16) * 0xafd7ed55 & MASK_HIGH) >>> 16; + h1 ^= h2 >>> 1; + h1 = h1 * 0x1a85ec53 & MASK_HIGH | h1 * 0xec53 & MASK_LOW; + h2 = h2 * 0xc4ceb9fe & MASK_HIGH | ((h2 << 16 | h1 >>> 16) * 0xb9fe1a85 & MASK_HIGH) >>> 16; + h1 ^= h2 >>> 1; + return (h1 >>> 0).toString(16).padStart(8, "0") + (h2 >>> 0).toString(16).padStart(8, "0"); + } +} + +;// ./src/core/operator_list.js + +function addState(parentState, pattern, checkFn, iterateFn, processFn) { + let state = parentState; + for (let i = 0, ii = pattern.length - 1; i < ii; i++) { + const item = pattern[i]; + state = state[item] ||= []; + } + state[pattern.at(-1)] = { + checkFn, + iterateFn, + processFn + }; +} +const InitialState = []; +addState(InitialState, [OPS.save, OPS.transform, OPS.paintInlineImageXObject, OPS.restore], null, function iterateInlineImageGroup(context, i) { + const fnArray = context.fnArray; + const iFirstSave = context.iCurr - 3; + const pos = (i - iFirstSave) % 4; + switch (pos) { + case 0: + return fnArray[i] === OPS.save; + case 1: + return fnArray[i] === OPS.transform; + case 2: + return fnArray[i] === OPS.paintInlineImageXObject; + case 3: + return fnArray[i] === OPS.restore; + } + throw new Error(`iterateInlineImageGroup - invalid pos: ${pos}`); +}, function foundInlineImageGroup(context, i) { + const MIN_IMAGES_IN_INLINE_IMAGES_BLOCK = 10; + const MAX_IMAGES_IN_INLINE_IMAGES_BLOCK = 200; + const MAX_WIDTH = 1000; + const IMAGE_PADDING = 1; + const fnArray = context.fnArray, + argsArray = context.argsArray; + const curr = context.iCurr; + const iFirstSave = curr - 3; + const iFirstTransform = curr - 2; + const iFirstPIIXO = curr - 1; + const count = Math.min(Math.floor((i - iFirstSave) / 4), MAX_IMAGES_IN_INLINE_IMAGES_BLOCK); + if (count < MIN_IMAGES_IN_INLINE_IMAGES_BLOCK) { + return i - (i - iFirstSave) % 4; + } + let maxX = 0; + const map = []; + let maxLineHeight = 0; + let currentX = IMAGE_PADDING, + currentY = IMAGE_PADDING; + for (let q = 0; q < count; q++) { + const transform = argsArray[iFirstTransform + (q << 2)]; + const img = argsArray[iFirstPIIXO + (q << 2)][0]; + if (currentX + img.width > MAX_WIDTH) { + maxX = Math.max(maxX, currentX); + currentY += maxLineHeight + 2 * IMAGE_PADDING; + currentX = 0; + maxLineHeight = 0; + } + map.push({ + transform, + x: currentX, + y: currentY, + w: img.width, + h: img.height + }); + currentX += img.width + 2 * IMAGE_PADDING; + maxLineHeight = Math.max(maxLineHeight, img.height); + } + const imgWidth = Math.max(maxX, currentX) + IMAGE_PADDING; + const imgHeight = currentY + maxLineHeight + IMAGE_PADDING; + const imgData = new Uint8Array(imgWidth * imgHeight * 4); + const imgRowSize = imgWidth << 2; + for (let q = 0; q < count; q++) { + const data = argsArray[iFirstPIIXO + (q << 2)][0].data; + const rowSize = map[q].w << 2; + let dataOffset = 0; + let offset = map[q].x + map[q].y * imgWidth << 2; + imgData.set(data.subarray(0, rowSize), offset - imgRowSize); + for (let k = 0, kk = map[q].h; k < kk; k++) { + imgData.set(data.subarray(dataOffset, dataOffset + rowSize), offset); + dataOffset += rowSize; + offset += imgRowSize; + } + imgData.set(data.subarray(dataOffset - rowSize, dataOffset), offset); + while (offset >= 0) { + data[offset - 4] = data[offset]; + data[offset - 3] = data[offset + 1]; + data[offset - 2] = data[offset + 2]; + data[offset - 1] = data[offset + 3]; + data[offset + rowSize] = data[offset + rowSize - 4]; + data[offset + rowSize + 1] = data[offset + rowSize - 3]; + data[offset + rowSize + 2] = data[offset + rowSize - 2]; + data[offset + rowSize + 3] = data[offset + rowSize - 1]; + offset -= imgRowSize; + } + } + const img = { + width: imgWidth, + height: imgHeight + }; + if (context.isOffscreenCanvasSupported) { + const canvas = new OffscreenCanvas(imgWidth, imgHeight); + const ctx = canvas.getContext("2d"); + ctx.putImageData(new ImageData(new Uint8ClampedArray(imgData.buffer), imgWidth, imgHeight), 0, 0); + img.bitmap = canvas.transferToImageBitmap(); + img.data = null; + } else { + img.kind = ImageKind.RGBA_32BPP; + img.data = imgData; + } + fnArray.splice(iFirstSave, count * 4, OPS.paintInlineImageXObjectGroup); + argsArray.splice(iFirstSave, count * 4, [img, map]); + return iFirstSave + 1; +}); +addState(InitialState, [OPS.save, OPS.transform, OPS.paintImageMaskXObject, OPS.restore], null, function iterateImageMaskGroup(context, i) { + const fnArray = context.fnArray; + const iFirstSave = context.iCurr - 3; + const pos = (i - iFirstSave) % 4; + switch (pos) { + case 0: + return fnArray[i] === OPS.save; + case 1: + return fnArray[i] === OPS.transform; + case 2: + return fnArray[i] === OPS.paintImageMaskXObject; + case 3: + return fnArray[i] === OPS.restore; + } + throw new Error(`iterateImageMaskGroup - invalid pos: ${pos}`); +}, function foundImageMaskGroup(context, i) { + const MIN_IMAGES_IN_MASKS_BLOCK = 10; + const MAX_IMAGES_IN_MASKS_BLOCK = 100; + const MAX_SAME_IMAGES_IN_MASKS_BLOCK = 1000; + const fnArray = context.fnArray, + argsArray = context.argsArray; + const curr = context.iCurr; + const iFirstSave = curr - 3; + const iFirstTransform = curr - 2; + const iFirstPIMXO = curr - 1; + let count = Math.floor((i - iFirstSave) / 4); + if (count < MIN_IMAGES_IN_MASKS_BLOCK) { + return i - (i - iFirstSave) % 4; + } + let isSameImage = false; + let iTransform, transformArgs; + const firstPIMXOArg0 = argsArray[iFirstPIMXO][0]; + const firstTransformArg0 = argsArray[iFirstTransform][0], + firstTransformArg1 = argsArray[iFirstTransform][1], + firstTransformArg2 = argsArray[iFirstTransform][2], + firstTransformArg3 = argsArray[iFirstTransform][3]; + if (firstTransformArg1 === firstTransformArg2) { + isSameImage = true; + iTransform = iFirstTransform + 4; + let iPIMXO = iFirstPIMXO + 4; + for (let q = 1; q < count; q++, iTransform += 4, iPIMXO += 4) { + transformArgs = argsArray[iTransform]; + if (argsArray[iPIMXO][0] !== firstPIMXOArg0 || transformArgs[0] !== firstTransformArg0 || transformArgs[1] !== firstTransformArg1 || transformArgs[2] !== firstTransformArg2 || transformArgs[3] !== firstTransformArg3) { + if (q < MIN_IMAGES_IN_MASKS_BLOCK) { + isSameImage = false; + } else { + count = q; + } + break; + } + } + } + if (isSameImage) { + count = Math.min(count, MAX_SAME_IMAGES_IN_MASKS_BLOCK); + const positions = new Float32Array(count * 2); + iTransform = iFirstTransform; + for (let q = 0; q < count; q++, iTransform += 4) { + transformArgs = argsArray[iTransform]; + positions[q << 1] = transformArgs[4]; + positions[(q << 1) + 1] = transformArgs[5]; + } + fnArray.splice(iFirstSave, count * 4, OPS.paintImageMaskXObjectRepeat); + argsArray.splice(iFirstSave, count * 4, [firstPIMXOArg0, firstTransformArg0, firstTransformArg1, firstTransformArg2, firstTransformArg3, positions]); + } else { + count = Math.min(count, MAX_IMAGES_IN_MASKS_BLOCK); + const images = []; + for (let q = 0; q < count; q++) { + transformArgs = argsArray[iFirstTransform + (q << 2)]; + const maskParams = argsArray[iFirstPIMXO + (q << 2)][0]; + images.push({ + data: maskParams.data, + width: maskParams.width, + height: maskParams.height, + interpolate: maskParams.interpolate, + count: maskParams.count, + transform: transformArgs + }); + } + fnArray.splice(iFirstSave, count * 4, OPS.paintImageMaskXObjectGroup); + argsArray.splice(iFirstSave, count * 4, [images]); + } + return iFirstSave + 1; +}); +addState(InitialState, [OPS.save, OPS.transform, OPS.paintImageXObject, OPS.restore], function (context) { + const argsArray = context.argsArray; + const iFirstTransform = context.iCurr - 2; + return argsArray[iFirstTransform][1] === 0 && argsArray[iFirstTransform][2] === 0; +}, function iterateImageGroup(context, i) { + const fnArray = context.fnArray, + argsArray = context.argsArray; + const iFirstSave = context.iCurr - 3; + const pos = (i - iFirstSave) % 4; + switch (pos) { + case 0: + return fnArray[i] === OPS.save; + case 1: + if (fnArray[i] !== OPS.transform) { + return false; + } + const iFirstTransform = context.iCurr - 2; + const firstTransformArg0 = argsArray[iFirstTransform][0]; + const firstTransformArg3 = argsArray[iFirstTransform][3]; + if (argsArray[i][0] !== firstTransformArg0 || argsArray[i][1] !== 0 || argsArray[i][2] !== 0 || argsArray[i][3] !== firstTransformArg3) { + return false; + } + return true; + case 2: + if (fnArray[i] !== OPS.paintImageXObject) { + return false; + } + const iFirstPIXO = context.iCurr - 1; + const firstPIXOArg0 = argsArray[iFirstPIXO][0]; + if (argsArray[i][0] !== firstPIXOArg0) { + return false; + } + return true; + case 3: + return fnArray[i] === OPS.restore; + } + throw new Error(`iterateImageGroup - invalid pos: ${pos}`); +}, function (context, i) { + const MIN_IMAGES_IN_BLOCK = 3; + const MAX_IMAGES_IN_BLOCK = 1000; + const fnArray = context.fnArray, + argsArray = context.argsArray; + const curr = context.iCurr; + const iFirstSave = curr - 3; + const iFirstTransform = curr - 2; + const iFirstPIXO = curr - 1; + const firstPIXOArg0 = argsArray[iFirstPIXO][0]; + const firstTransformArg0 = argsArray[iFirstTransform][0]; + const firstTransformArg3 = argsArray[iFirstTransform][3]; + const count = Math.min(Math.floor((i - iFirstSave) / 4), MAX_IMAGES_IN_BLOCK); + if (count < MIN_IMAGES_IN_BLOCK) { + return i - (i - iFirstSave) % 4; + } + const positions = new Float32Array(count * 2); + let iTransform = iFirstTransform; + for (let q = 0; q < count; q++, iTransform += 4) { + const transformArgs = argsArray[iTransform]; + positions[q << 1] = transformArgs[4]; + positions[(q << 1) + 1] = transformArgs[5]; + } + const args = [firstPIXOArg0, firstTransformArg0, firstTransformArg3, positions]; + fnArray.splice(iFirstSave, count * 4, OPS.paintImageXObjectRepeat); + argsArray.splice(iFirstSave, count * 4, args); + return iFirstSave + 1; +}); +addState(InitialState, [OPS.beginText, OPS.setFont, OPS.setTextMatrix, OPS.showText, OPS.endText], null, function iterateShowTextGroup(context, i) { + const fnArray = context.fnArray, + argsArray = context.argsArray; + const iFirstSave = context.iCurr - 4; + const pos = (i - iFirstSave) % 5; + switch (pos) { + case 0: + return fnArray[i] === OPS.beginText; + case 1: + return fnArray[i] === OPS.setFont; + case 2: + return fnArray[i] === OPS.setTextMatrix; + case 3: + if (fnArray[i] !== OPS.showText) { + return false; + } + const iFirstSetFont = context.iCurr - 3; + const firstSetFontArg0 = argsArray[iFirstSetFont][0]; + const firstSetFontArg1 = argsArray[iFirstSetFont][1]; + if (argsArray[i][0] !== firstSetFontArg0 || argsArray[i][1] !== firstSetFontArg1) { + return false; + } + return true; + case 4: + return fnArray[i] === OPS.endText; + } + throw new Error(`iterateShowTextGroup - invalid pos: ${pos}`); +}, function (context, i) { + const MIN_CHARS_IN_BLOCK = 3; + const MAX_CHARS_IN_BLOCK = 1000; + const fnArray = context.fnArray, + argsArray = context.argsArray; + const curr = context.iCurr; + const iFirstBeginText = curr - 4; + const iFirstSetFont = curr - 3; + const iFirstSetTextMatrix = curr - 2; + const iFirstShowText = curr - 1; + const iFirstEndText = curr; + const firstSetFontArg0 = argsArray[iFirstSetFont][0]; + const firstSetFontArg1 = argsArray[iFirstSetFont][1]; + let count = Math.min(Math.floor((i - iFirstBeginText) / 5), MAX_CHARS_IN_BLOCK); + if (count < MIN_CHARS_IN_BLOCK) { + return i - (i - iFirstBeginText) % 5; + } + let iFirst = iFirstBeginText; + if (iFirstBeginText >= 4 && fnArray[iFirstBeginText - 4] === fnArray[iFirstSetFont] && fnArray[iFirstBeginText - 3] === fnArray[iFirstSetTextMatrix] && fnArray[iFirstBeginText - 2] === fnArray[iFirstShowText] && fnArray[iFirstBeginText - 1] === fnArray[iFirstEndText] && argsArray[iFirstBeginText - 4][0] === firstSetFontArg0 && argsArray[iFirstBeginText - 4][1] === firstSetFontArg1) { + count++; + iFirst -= 5; + } + let iEndText = iFirst + 4; + for (let q = 1; q < count; q++) { + fnArray.splice(iEndText, 3); + argsArray.splice(iEndText, 3); + iEndText += 2; + } + return iEndText + 1; +}); +class NullOptimizer { + constructor(queue) { + this.queue = queue; + } + _optimize() {} + push(fn, args) { + this.queue.fnArray.push(fn); + this.queue.argsArray.push(args); + this._optimize(); + } + flush() {} + reset() {} +} +class QueueOptimizer extends NullOptimizer { + constructor(queue) { + super(queue); + this.state = null; + this.context = { + iCurr: 0, + fnArray: queue.fnArray, + argsArray: queue.argsArray, + isOffscreenCanvasSupported: false + }; + this.match = null; + this.lastProcessed = 0; + } + set isOffscreenCanvasSupported(value) { + this.context.isOffscreenCanvasSupported = value; + } + _optimize() { + const fnArray = this.queue.fnArray; + let i = this.lastProcessed, + ii = fnArray.length; + let state = this.state; + let match = this.match; + if (!state && !match && i + 1 === ii && !InitialState[fnArray[i]]) { + this.lastProcessed = ii; + return; + } + const context = this.context; + while (i < ii) { + if (match) { + const iterate = (0, match.iterateFn)(context, i); + if (iterate) { + i++; + continue; + } + i = (0, match.processFn)(context, i + 1); + ii = fnArray.length; + match = null; + state = null; + if (i >= ii) { + break; + } + } + state = (state || InitialState)[fnArray[i]]; + if (!state || Array.isArray(state)) { + i++; + continue; + } + context.iCurr = i; + i++; + if (state.checkFn && !(0, state.checkFn)(context)) { + state = null; + continue; + } + match = state; + state = null; + } + this.state = state; + this.match = match; + this.lastProcessed = i; + } + flush() { + while (this.match) { + const length = this.queue.fnArray.length; + this.lastProcessed = (0, this.match.processFn)(this.context, length); + this.match = null; + this.state = null; + this._optimize(); + } + } + reset() { + this.state = null; + this.match = null; + this.lastProcessed = 0; + } +} +class OperatorList { + static CHUNK_SIZE = 1000; + static CHUNK_SIZE_ABOUT = this.CHUNK_SIZE - 5; + constructor(intent = 0, streamSink) { + this._streamSink = streamSink; + this.fnArray = []; + this.argsArray = []; + this.optimizer = streamSink && !(intent & RenderingIntentFlag.OPLIST) ? new QueueOptimizer(this) : new NullOptimizer(this); + this.dependencies = new Set(); + this._totalLength = 0; + this.weight = 0; + this._resolved = streamSink ? null : Promise.resolve(); + } + set isOffscreenCanvasSupported(value) { + this.optimizer.isOffscreenCanvasSupported = value; + } + get length() { + return this.argsArray.length; + } + get ready() { + return this._resolved || this._streamSink.ready; + } + get totalLength() { + return this._totalLength + this.length; + } + addOp(fn, args) { + this.optimizer.push(fn, args); + this.weight++; + if (this._streamSink) { + if (this.weight >= OperatorList.CHUNK_SIZE) { + this.flush(); + } else if (this.weight >= OperatorList.CHUNK_SIZE_ABOUT && (fn === OPS.restore || fn === OPS.endText)) { + this.flush(); + } + } + } + addImageOps(fn, args, optionalContent, hasMask = false) { + if (hasMask) { + this.addOp(OPS.save); + this.addOp(OPS.setGState, [[["SMask", false]]]); + } + if (optionalContent !== undefined) { + this.addOp(OPS.beginMarkedContentProps, ["OC", optionalContent]); + } + this.addOp(fn, args); + if (optionalContent !== undefined) { + this.addOp(OPS.endMarkedContent, []); + } + if (hasMask) { + this.addOp(OPS.restore); + } + } + addDependency(dependency) { + if (this.dependencies.has(dependency)) { + return; + } + this.dependencies.add(dependency); + this.addOp(OPS.dependency, [dependency]); + } + addDependencies(dependencies) { + for (const dependency of dependencies) { + this.addDependency(dependency); + } + } + addOpList(opList) { + if (!(opList instanceof OperatorList)) { + warn('addOpList - ignoring invalid "opList" parameter.'); + return; + } + for (const dependency of opList.dependencies) { + this.dependencies.add(dependency); + } + for (let i = 0, ii = opList.length; i < ii; i++) { + this.addOp(opList.fnArray[i], opList.argsArray[i]); + } + } + getIR() { + return { + fnArray: this.fnArray, + argsArray: this.argsArray, + length: this.length + }; + } + get _transfers() { + const transfers = []; + const { + fnArray, + argsArray, + length + } = this; + for (let i = 0; i < length; i++) { + switch (fnArray[i]) { + case OPS.paintInlineImageXObject: + case OPS.paintInlineImageXObjectGroup: + case OPS.paintImageMaskXObject: + const arg = argsArray[i][0]; + if (!arg.cached && arg.data?.buffer instanceof ArrayBuffer) { + transfers.push(arg.data.buffer); + } + break; + } + } + return transfers; + } + flush(lastChunk = false, separateAnnots = null) { + this.optimizer.flush(); + const length = this.length; + this._totalLength += length; + this._streamSink.enqueue({ + fnArray: this.fnArray, + argsArray: this.argsArray, + lastChunk, + separateAnnots, + length + }, 1, this._transfers); + this.dependencies.clear(); + this.fnArray.length = 0; + this.argsArray.length = 0; + this.weight = 0; + this.optimizer.reset(); + } +} + +;// ./src/core/image.js + + + + + + + + + +function decodeAndClamp(value, addend, coefficient, max) { + value = addend + value * coefficient; + if (value < 0) { + value = 0; + } else if (value > max) { + value = max; + } + return value; +} +function resizeImageMask(src, bpc, w1, h1, w2, h2) { + const length = w2 * h2; + let dest; + if (bpc <= 8) { + dest = new Uint8Array(length); + } else if (bpc <= 16) { + dest = new Uint16Array(length); + } else { + dest = new Uint32Array(length); + } + const xRatio = w1 / w2; + const yRatio = h1 / h2; + let i, + j, + py, + newIndex = 0, + oldIndex; + const xScaled = new Uint16Array(w2); + const w1Scanline = w1; + for (i = 0; i < w2; i++) { + xScaled[i] = Math.floor(i * xRatio); + } + for (i = 0; i < h2; i++) { + py = Math.floor(i * yRatio) * w1Scanline; + for (j = 0; j < w2; j++) { + oldIndex = py + xScaled[j]; + dest[newIndex++] = src[oldIndex]; + } + } + return dest; +} +class PDFImage { + constructor({ + xref, + res, + image, + isInline = false, + smask = null, + mask = null, + isMask = false, + pdfFunctionFactory, + localColorSpaceCache + }) { + this.image = image; + const dict = image.dict; + const filter = dict.get("F", "Filter"); + let filterName; + if (filter instanceof Name) { + filterName = filter.name; + } else if (Array.isArray(filter)) { + const filterZero = xref.fetchIfRef(filter[0]); + if (filterZero instanceof Name) { + filterName = filterZero.name; + } + } + switch (filterName) { + case "JPXDecode": + ({ + width: image.width, + height: image.height, + componentsCount: image.numComps, + bitsPerComponent: image.bitsPerComponent + } = JpxImage.parseImageProperties(image.stream)); + image.stream.reset(); + this.jpxDecoderOptions = { + numComponents: 0, + isIndexedColormap: false, + smaskInData: dict.has("SMaskInData") + }; + break; + case "JBIG2Decode": + image.bitsPerComponent = 1; + image.numComps = 1; + break; + } + let width = dict.get("W", "Width"); + let height = dict.get("H", "Height"); + if (Number.isInteger(image.width) && image.width > 0 && Number.isInteger(image.height) && image.height > 0 && (image.width !== width || image.height !== height)) { + warn("PDFImage - using the Width/Height of the image data, " + "rather than the image dictionary."); + width = image.width; + height = image.height; + } + if (width < 1 || height < 1) { + throw new FormatError(`Invalid image width: ${width} or height: ${height}`); + } + this.width = width; + this.height = height; + this.interpolate = dict.get("I", "Interpolate"); + this.imageMask = dict.get("IM", "ImageMask") || false; + this.matte = dict.get("Matte") || false; + let bitsPerComponent = image.bitsPerComponent; + if (!bitsPerComponent) { + bitsPerComponent = dict.get("BPC", "BitsPerComponent"); + if (!bitsPerComponent) { + if (this.imageMask) { + bitsPerComponent = 1; + } else { + throw new FormatError(`Bits per component missing in image: ${this.imageMask}`); + } + } + } + this.bpc = bitsPerComponent; + if (!this.imageMask) { + let colorSpace = dict.getRaw("CS") || dict.getRaw("ColorSpace"); + const hasColorSpace = !!colorSpace; + if (!hasColorSpace) { + if (this.jpxDecoderOptions) { + colorSpace = Name.get("DeviceRGBA"); + } else { + switch (image.numComps) { + case 1: + colorSpace = Name.get("DeviceGray"); + break; + case 3: + colorSpace = Name.get("DeviceRGB"); + break; + case 4: + colorSpace = Name.get("DeviceCMYK"); + break; + default: + throw new Error(`Images with ${image.numComps} color components not supported.`); + } + } + } else if (this.jpxDecoderOptions?.smaskInData) { + colorSpace = Name.get("DeviceRGBA"); + } + this.colorSpace = ColorSpace.parse({ + cs: colorSpace, + xref, + resources: isInline ? res : null, + pdfFunctionFactory, + localColorSpaceCache + }); + this.numComps = this.colorSpace.numComps; + if (this.jpxDecoderOptions) { + this.jpxDecoderOptions.numComponents = hasColorSpace ? this.numComp : 0; + this.jpxDecoderOptions.isIndexedColormap = this.colorSpace.name === "Indexed"; + } + } + this.decode = dict.getArray("D", "Decode"); + this.needsDecode = false; + if (this.decode && (this.colorSpace && !this.colorSpace.isDefaultDecode(this.decode, bitsPerComponent) || isMask && !ColorSpace.isDefaultDecode(this.decode, 1))) { + this.needsDecode = true; + const max = (1 << bitsPerComponent) - 1; + this.decodeCoefficients = []; + this.decodeAddends = []; + const isIndexed = this.colorSpace?.name === "Indexed"; + for (let i = 0, j = 0; i < this.decode.length; i += 2, ++j) { + const dmin = this.decode[i]; + const dmax = this.decode[i + 1]; + this.decodeCoefficients[j] = isIndexed ? (dmax - dmin) / max : dmax - dmin; + this.decodeAddends[j] = isIndexed ? dmin : max * dmin; + } + } + if (smask) { + this.smask = new PDFImage({ + xref, + res, + image: smask, + isInline, + pdfFunctionFactory, + localColorSpaceCache + }); + } else if (mask) { + if (mask instanceof BaseStream) { + const maskDict = mask.dict, + imageMask = maskDict.get("IM", "ImageMask"); + if (!imageMask) { + warn("Ignoring /Mask in image without /ImageMask."); + } else { + this.mask = new PDFImage({ + xref, + res, + image: mask, + isInline, + isMask: true, + pdfFunctionFactory, + localColorSpaceCache + }); + } + } else { + this.mask = mask; + } + } + } + static async buildImage({ + xref, + res, + image, + isInline = false, + pdfFunctionFactory, + localColorSpaceCache + }) { + const imageData = image; + let smaskData = null; + let maskData = null; + const smask = image.dict.get("SMask"); + const mask = image.dict.get("Mask"); + if (smask) { + if (smask instanceof BaseStream) { + smaskData = smask; + } else { + warn("Unsupported /SMask format."); + } + } else if (mask) { + if (mask instanceof BaseStream || Array.isArray(mask)) { + maskData = mask; + } else { + warn("Unsupported /Mask format."); + } + } + return new PDFImage({ + xref, + res, + image: imageData, + isInline, + smask: smaskData, + mask: maskData, + pdfFunctionFactory, + localColorSpaceCache + }); + } + static createRawMask({ + imgArray, + width, + height, + imageIsFromDecodeStream, + inverseDecode, + interpolate + }) { + const computedLength = (width + 7 >> 3) * height; + const actualLength = imgArray.byteLength; + const haveFullData = computedLength === actualLength; + let data, i; + if (imageIsFromDecodeStream && (!inverseDecode || haveFullData)) { + data = imgArray; + } else if (!inverseDecode) { + data = new Uint8Array(imgArray); + } else { + data = new Uint8Array(computedLength); + data.set(imgArray); + data.fill(0xff, actualLength); + } + if (inverseDecode) { + for (i = 0; i < actualLength; i++) { + data[i] ^= 0xff; + } + } + return { + data, + width, + height, + interpolate + }; + } + static async createMask({ + imgArray, + width, + height, + imageIsFromDecodeStream, + inverseDecode, + interpolate, + isOffscreenCanvasSupported = false + }) { + const isSingleOpaquePixel = width === 1 && height === 1 && inverseDecode === (imgArray.length === 0 || !!(imgArray[0] & 128)); + if (isSingleOpaquePixel) { + return { + isSingleOpaquePixel + }; + } + if (isOffscreenCanvasSupported) { + if (ImageResizer.needsToBeResized(width, height)) { + const data = new Uint8ClampedArray(width * height * 4); + convertBlackAndWhiteToRGBA({ + src: imgArray, + dest: data, + width, + height, + nonBlackColor: 0, + inverseDecode + }); + return ImageResizer.createImage({ + kind: ImageKind.RGBA_32BPP, + data, + width, + height, + interpolate + }); + } + const canvas = new OffscreenCanvas(width, height); + const ctx = canvas.getContext("2d"); + const imgData = ctx.createImageData(width, height); + convertBlackAndWhiteToRGBA({ + src: imgArray, + dest: imgData.data, + width, + height, + nonBlackColor: 0, + inverseDecode + }); + ctx.putImageData(imgData, 0, 0); + const bitmap = canvas.transferToImageBitmap(); + return { + data: null, + width, + height, + interpolate, + bitmap + }; + } + return this.createRawMask({ + imgArray, + width, + height, + inverseDecode, + imageIsFromDecodeStream, + interpolate + }); + } + get drawWidth() { + return Math.max(this.width, this.smask?.width || 0, this.mask?.width || 0); + } + get drawHeight() { + return Math.max(this.height, this.smask?.height || 0, this.mask?.height || 0); + } + decodeBuffer(buffer) { + const bpc = this.bpc; + const numComps = this.numComps; + const decodeAddends = this.decodeAddends; + const decodeCoefficients = this.decodeCoefficients; + const max = (1 << bpc) - 1; + let i, ii; + if (bpc === 1) { + for (i = 0, ii = buffer.length; i < ii; i++) { + buffer[i] = +!buffer[i]; + } + return; + } + let index = 0; + for (i = 0, ii = this.width * this.height; i < ii; i++) { + for (let j = 0; j < numComps; j++) { + buffer[index] = decodeAndClamp(buffer[index], decodeAddends[j], decodeCoefficients[j], max); + index++; + } + } + } + getComponents(buffer) { + const bpc = this.bpc; + if (bpc === 8) { + return buffer; + } + const width = this.width; + const height = this.height; + const numComps = this.numComps; + const length = width * height * numComps; + let bufferPos = 0; + let output; + if (bpc <= 8) { + output = new Uint8Array(length); + } else if (bpc <= 16) { + output = new Uint16Array(length); + } else { + output = new Uint32Array(length); + } + const rowComps = width * numComps; + const max = (1 << bpc) - 1; + let i = 0, + ii, + buf; + if (bpc === 1) { + let mask, loop1End, loop2End; + for (let j = 0; j < height; j++) { + loop1End = i + (rowComps & ~7); + loop2End = i + rowComps; + while (i < loop1End) { + buf = buffer[bufferPos++]; + output[i] = buf >> 7 & 1; + output[i + 1] = buf >> 6 & 1; + output[i + 2] = buf >> 5 & 1; + output[i + 3] = buf >> 4 & 1; + output[i + 4] = buf >> 3 & 1; + output[i + 5] = buf >> 2 & 1; + output[i + 6] = buf >> 1 & 1; + output[i + 7] = buf & 1; + i += 8; + } + if (i < loop2End) { + buf = buffer[bufferPos++]; + mask = 128; + while (i < loop2End) { + output[i++] = +!!(buf & mask); + mask >>= 1; + } + } + } + } else { + let bits = 0; + buf = 0; + for (i = 0, ii = length; i < ii; ++i) { + if (i % rowComps === 0) { + buf = 0; + bits = 0; + } + while (bits < bpc) { + buf = buf << 8 | buffer[bufferPos++]; + bits += 8; + } + const remainingBits = bits - bpc; + let value = buf >> remainingBits; + if (value < 0) { + value = 0; + } else if (value > max) { + value = max; + } + output[i] = value; + buf &= (1 << remainingBits) - 1; + bits = remainingBits; + } + } + return output; + } + async fillOpacity(rgbaBuf, width, height, actualHeight, image) { + const smask = this.smask; + const mask = this.mask; + let alphaBuf, sw, sh, i, ii, j; + if (smask) { + sw = smask.width; + sh = smask.height; + alphaBuf = new Uint8ClampedArray(sw * sh); + await smask.fillGrayBuffer(alphaBuf); + if (sw !== width || sh !== height) { + alphaBuf = resizeImageMask(alphaBuf, smask.bpc, sw, sh, width, height); + } + } else if (mask) { + if (mask instanceof PDFImage) { + sw = mask.width; + sh = mask.height; + alphaBuf = new Uint8ClampedArray(sw * sh); + mask.numComps = 1; + await mask.fillGrayBuffer(alphaBuf); + for (i = 0, ii = sw * sh; i < ii; ++i) { + alphaBuf[i] = 255 - alphaBuf[i]; + } + if (sw !== width || sh !== height) { + alphaBuf = resizeImageMask(alphaBuf, mask.bpc, sw, sh, width, height); + } + } else if (Array.isArray(mask)) { + alphaBuf = new Uint8ClampedArray(width * height); + const numComps = this.numComps; + for (i = 0, ii = width * height; i < ii; ++i) { + let opacity = 0; + const imageOffset = i * numComps; + for (j = 0; j < numComps; ++j) { + const color = image[imageOffset + j]; + const maskOffset = j * 2; + if (color < mask[maskOffset] || color > mask[maskOffset + 1]) { + opacity = 255; + break; + } + } + alphaBuf[i] = opacity; + } + } else { + throw new FormatError("Unknown mask format."); + } + } + if (alphaBuf) { + for (i = 0, j = 3, ii = width * actualHeight; i < ii; ++i, j += 4) { + rgbaBuf[j] = alphaBuf[i]; + } + } else { + for (i = 0, j = 3, ii = width * actualHeight; i < ii; ++i, j += 4) { + rgbaBuf[j] = 255; + } + } + } + undoPreblend(buffer, width, height) { + const matte = this.smask?.matte; + if (!matte) { + return; + } + const matteRgb = this.colorSpace.getRgb(matte, 0); + const matteR = matteRgb[0]; + const matteG = matteRgb[1]; + const matteB = matteRgb[2]; + const length = width * height * 4; + for (let i = 0; i < length; i += 4) { + const alpha = buffer[i + 3]; + if (alpha === 0) { + buffer[i] = 255; + buffer[i + 1] = 255; + buffer[i + 2] = 255; + continue; + } + const k = 255 / alpha; + buffer[i] = (buffer[i] - matteR) * k + matteR; + buffer[i + 1] = (buffer[i + 1] - matteG) * k + matteG; + buffer[i + 2] = (buffer[i + 2] - matteB) * k + matteB; + } + } + async createImageData(forceRGBA = false, isOffscreenCanvasSupported = false) { + const drawWidth = this.drawWidth; + const drawHeight = this.drawHeight; + const imgData = { + width: drawWidth, + height: drawHeight, + interpolate: this.interpolate, + kind: 0, + data: null + }; + const numComps = this.numComps; + const originalWidth = this.width; + const originalHeight = this.height; + const bpc = this.bpc; + const rowBytes = originalWidth * numComps * bpc + 7 >> 3; + const mustBeResized = isOffscreenCanvasSupported && ImageResizer.needsToBeResized(drawWidth, drawHeight); + if (!this.smask && !this.mask && this.colorSpace.name === "DeviceRGBA") { + imgData.kind = ImageKind.RGBA_32BPP; + const imgArray = imgData.data = await this.getImageBytes(originalHeight * originalWidth * 4, {}); + if (isOffscreenCanvasSupported) { + if (!mustBeResized) { + return this.createBitmap(ImageKind.RGBA_32BPP, drawWidth, drawHeight, imgArray); + } + return ImageResizer.createImage(imgData, false); + } + return imgData; + } + if (!forceRGBA) { + let kind; + if (this.colorSpace.name === "DeviceGray" && bpc === 1) { + kind = ImageKind.GRAYSCALE_1BPP; + } else if (this.colorSpace.name === "DeviceRGB" && bpc === 8 && !this.needsDecode) { + kind = ImageKind.RGB_24BPP; + } + if (kind && !this.smask && !this.mask && drawWidth === originalWidth && drawHeight === originalHeight) { + const image = await this.#getImage(originalWidth, originalHeight); + if (image) { + return image; + } + const data = await this.getImageBytes(originalHeight * rowBytes, {}); + if (isOffscreenCanvasSupported) { + if (mustBeResized) { + return ImageResizer.createImage({ + data, + kind, + width: drawWidth, + height: drawHeight, + interpolate: this.interpolate + }, this.needsDecode); + } + return this.createBitmap(kind, originalWidth, originalHeight, data); + } + imgData.kind = kind; + imgData.data = data; + if (this.needsDecode) { + assert(kind === ImageKind.GRAYSCALE_1BPP, "PDFImage.createImageData: The image must be grayscale."); + const buffer = imgData.data; + for (let i = 0, ii = buffer.length; i < ii; i++) { + buffer[i] ^= 0xff; + } + } + return imgData; + } + if (this.image instanceof JpegStream && !this.smask && !this.mask && !this.needsDecode) { + let imageLength = originalHeight * rowBytes; + if (isOffscreenCanvasSupported && !mustBeResized) { + let isHandled = false; + switch (this.colorSpace.name) { + case "DeviceGray": + imageLength *= 4; + isHandled = true; + break; + case "DeviceRGB": + imageLength = imageLength / 3 * 4; + isHandled = true; + break; + case "DeviceCMYK": + isHandled = true; + break; + } + if (isHandled) { + const image = await this.#getImage(drawWidth, drawHeight); + if (image) { + return image; + } + const rgba = await this.getImageBytes(imageLength, { + drawWidth, + drawHeight, + forceRGBA: true + }); + return this.createBitmap(ImageKind.RGBA_32BPP, drawWidth, drawHeight, rgba); + } + } else { + switch (this.colorSpace.name) { + case "DeviceGray": + imageLength *= 3; + case "DeviceRGB": + case "DeviceCMYK": + imgData.kind = ImageKind.RGB_24BPP; + imgData.data = await this.getImageBytes(imageLength, { + drawWidth, + drawHeight, + forceRGB: true + }); + if (mustBeResized) { + return ImageResizer.createImage(imgData); + } + return imgData; + } + } + } + } + const imgArray = await this.getImageBytes(originalHeight * rowBytes, { + internal: true + }); + const actualHeight = 0 | imgArray.length / rowBytes * drawHeight / originalHeight; + const comps = this.getComponents(imgArray); + let alpha01, maybeUndoPreblend; + let canvas, ctx, canvasImgData, data; + if (isOffscreenCanvasSupported && !mustBeResized) { + canvas = new OffscreenCanvas(drawWidth, drawHeight); + ctx = canvas.getContext("2d"); + canvasImgData = ctx.createImageData(drawWidth, drawHeight); + data = canvasImgData.data; + } + imgData.kind = ImageKind.RGBA_32BPP; + if (!forceRGBA && !this.smask && !this.mask) { + if (!isOffscreenCanvasSupported || mustBeResized) { + imgData.kind = ImageKind.RGB_24BPP; + data = new Uint8ClampedArray(drawWidth * drawHeight * 3); + alpha01 = 0; + } else { + const arr = new Uint32Array(data.buffer); + arr.fill(FeatureTest.isLittleEndian ? 0xff000000 : 0x000000ff); + alpha01 = 1; + } + maybeUndoPreblend = false; + } else { + if (!isOffscreenCanvasSupported || mustBeResized) { + data = new Uint8ClampedArray(drawWidth * drawHeight * 4); + } + alpha01 = 1; + maybeUndoPreblend = true; + await this.fillOpacity(data, drawWidth, drawHeight, actualHeight, comps); + } + if (this.needsDecode) { + this.decodeBuffer(comps); + } + this.colorSpace.fillRgb(data, originalWidth, originalHeight, drawWidth, drawHeight, actualHeight, bpc, comps, alpha01); + if (maybeUndoPreblend) { + this.undoPreblend(data, drawWidth, actualHeight); + } + if (isOffscreenCanvasSupported && !mustBeResized) { + ctx.putImageData(canvasImgData, 0, 0); + const bitmap = canvas.transferToImageBitmap(); + return { + data: null, + width: drawWidth, + height: drawHeight, + bitmap, + interpolate: this.interpolate + }; + } + imgData.data = data; + if (mustBeResized) { + return ImageResizer.createImage(imgData); + } + return imgData; + } + async fillGrayBuffer(buffer) { + const numComps = this.numComps; + if (numComps !== 1) { + throw new FormatError(`Reading gray scale from a color image: ${numComps}`); + } + const width = this.width; + const height = this.height; + const bpc = this.bpc; + const rowBytes = width * numComps * bpc + 7 >> 3; + const imgArray = await this.getImageBytes(height * rowBytes, { + internal: true + }); + const comps = this.getComponents(imgArray); + let i, length; + if (bpc === 1) { + length = width * height; + if (this.needsDecode) { + for (i = 0; i < length; ++i) { + buffer[i] = comps[i] - 1 & 255; + } + } else { + for (i = 0; i < length; ++i) { + buffer[i] = -comps[i] & 255; + } + } + return; + } + if (this.needsDecode) { + this.decodeBuffer(comps); + } + length = width * height; + const scale = 255 / ((1 << bpc) - 1); + for (i = 0; i < length; ++i) { + buffer[i] = scale * comps[i]; + } + } + createBitmap(kind, width, height, src) { + const canvas = new OffscreenCanvas(width, height); + const ctx = canvas.getContext("2d"); + let imgData; + if (kind === ImageKind.RGBA_32BPP) { + imgData = new ImageData(src, width, height); + } else { + imgData = ctx.createImageData(width, height); + convertToRGBA({ + kind, + src, + dest: new Uint32Array(imgData.data.buffer), + width, + height, + inverseDecode: this.needsDecode + }); + } + ctx.putImageData(imgData, 0, 0); + const bitmap = canvas.transferToImageBitmap(); + return { + data: null, + width, + height, + bitmap, + interpolate: this.interpolate + }; + } + async #getImage(width, height) { + const bitmap = await this.image.getTransferableImage(); + if (!bitmap) { + return null; + } + return { + data: null, + width, + height, + bitmap, + interpolate: this.interpolate + }; + } + async getImageBytes(length, { + drawWidth, + drawHeight, + forceRGBA = false, + forceRGB = false, + internal = false + }) { + this.image.reset(); + this.image.drawWidth = drawWidth || this.width; + this.image.drawHeight = drawHeight || this.height; + this.image.forceRGBA = !!forceRGBA; + this.image.forceRGB = !!forceRGB; + const imageBytes = await this.image.getImageData(length, this.jpxDecoderOptions); + if (internal || this.image instanceof DecodeStream) { + return imageBytes; + } + assert(imageBytes instanceof Uint8Array, 'PDFImage.getImageBytes: Unsupported "imageBytes" type.'); + return new Uint8Array(imageBytes); + } +} + +;// ./src/core/evaluator.js + + + + + + + + + + + + + + + + + + + + + + + + + + + + +const DefaultPartialEvaluatorOptions = Object.freeze({ + maxImageSize: -1, + disableFontFace: false, + ignoreErrors: false, + isEvalSupported: true, + isOffscreenCanvasSupported: false, + isImageDecoderSupported: false, + canvasMaxAreaInBytes: -1, + fontExtraProperties: false, + useSystemFonts: true, + cMapUrl: null, + standardFontDataUrl: null +}); +const PatternType = { + TILING: 1, + SHADING: 2 +}; +const TEXT_CHUNK_BATCH_SIZE = 10; +const deferred = Promise.resolve(); +function normalizeBlendMode(value, parsingArray = false) { + if (Array.isArray(value)) { + for (const val of value) { + const maybeBM = normalizeBlendMode(val, true); + if (maybeBM) { + return maybeBM; + } + } + warn(`Unsupported blend mode Array: ${value}`); + return "source-over"; + } + if (!(value instanceof Name)) { + if (parsingArray) { + return null; + } + return "source-over"; + } + switch (value.name) { + case "Normal": + case "Compatible": + return "source-over"; + case "Multiply": + return "multiply"; + case "Screen": + return "screen"; + case "Overlay": + return "overlay"; + case "Darken": + return "darken"; + case "Lighten": + return "lighten"; + case "ColorDodge": + return "color-dodge"; + case "ColorBurn": + return "color-burn"; + case "HardLight": + return "hard-light"; + case "SoftLight": + return "soft-light"; + case "Difference": + return "difference"; + case "Exclusion": + return "exclusion"; + case "Hue": + return "hue"; + case "Saturation": + return "saturation"; + case "Color": + return "color"; + case "Luminosity": + return "luminosity"; + } + if (parsingArray) { + return null; + } + warn(`Unsupported blend mode: ${value.name}`); + return "source-over"; +} +function addLocallyCachedImageOps(opList, data) { + if (data.objId) { + opList.addDependency(data.objId); + } + opList.addImageOps(data.fn, data.args, data.optionalContent, data.hasMask); + if (data.fn === OPS.paintImageMaskXObject && data.args[0]?.count > 0) { + data.args[0].count++; + } +} +class TimeSlotManager { + static TIME_SLOT_DURATION_MS = 20; + static CHECK_TIME_EVERY = 100; + constructor() { + this.reset(); + } + check() { + if (++this.checked < TimeSlotManager.CHECK_TIME_EVERY) { + return false; + } + this.checked = 0; + return this.endTime <= Date.now(); + } + reset() { + this.endTime = Date.now() + TimeSlotManager.TIME_SLOT_DURATION_MS; + this.checked = 0; + } +} +class PartialEvaluator { + constructor({ + xref, + handler, + pageIndex, + idFactory, + fontCache, + builtInCMapCache, + standardFontDataCache, + globalImageCache, + systemFontCache, + options = null + }) { + this.xref = xref; + this.handler = handler; + this.pageIndex = pageIndex; + this.idFactory = idFactory; + this.fontCache = fontCache; + this.builtInCMapCache = builtInCMapCache; + this.standardFontDataCache = standardFontDataCache; + this.globalImageCache = globalImageCache; + this.systemFontCache = systemFontCache; + this.options = options || DefaultPartialEvaluatorOptions; + this.type3FontRefs = null; + this._regionalImageCache = new RegionalImageCache(); + this._fetchBuiltInCMapBound = this.fetchBuiltInCMap.bind(this); + ImageResizer.setOptions(this.options); + JpegStream.setOptions(this.options); + } + get _pdfFunctionFactory() { + const pdfFunctionFactory = new PDFFunctionFactory({ + xref: this.xref, + isEvalSupported: this.options.isEvalSupported + }); + return shadow(this, "_pdfFunctionFactory", pdfFunctionFactory); + } + get parsingType3Font() { + return !!this.type3FontRefs; + } + clone(newOptions = null) { + const newEvaluator = Object.create(this); + newEvaluator.options = Object.assign(Object.create(null), this.options, newOptions); + return newEvaluator; + } + hasBlendModes(resources, nonBlendModesSet) { + if (!(resources instanceof Dict)) { + return false; + } + if (resources.objId && nonBlendModesSet.has(resources.objId)) { + return false; + } + const processed = new RefSet(nonBlendModesSet); + if (resources.objId) { + processed.put(resources.objId); + } + const nodes = [resources], + xref = this.xref; + while (nodes.length) { + const node = nodes.shift(); + const graphicStates = node.get("ExtGState"); + if (graphicStates instanceof Dict) { + for (let graphicState of graphicStates.getRawValues()) { + if (graphicState instanceof Ref) { + if (processed.has(graphicState)) { + continue; + } + try { + graphicState = xref.fetch(graphicState); + } catch (ex) { + processed.put(graphicState); + info(`hasBlendModes - ignoring ExtGState: "${ex}".`); + continue; + } + } + if (!(graphicState instanceof Dict)) { + continue; + } + if (graphicState.objId) { + processed.put(graphicState.objId); + } + const bm = graphicState.get("BM"); + if (bm instanceof Name) { + if (bm.name !== "Normal") { + return true; + } + continue; + } + if (bm !== undefined && Array.isArray(bm)) { + for (const element of bm) { + if (element instanceof Name && element.name !== "Normal") { + return true; + } + } + } + } + } + const xObjects = node.get("XObject"); + if (!(xObjects instanceof Dict)) { + continue; + } + for (let xObject of xObjects.getRawValues()) { + if (xObject instanceof Ref) { + if (processed.has(xObject)) { + continue; + } + try { + xObject = xref.fetch(xObject); + } catch (ex) { + processed.put(xObject); + info(`hasBlendModes - ignoring XObject: "${ex}".`); + continue; + } + } + if (!(xObject instanceof BaseStream)) { + continue; + } + if (xObject.dict.objId) { + processed.put(xObject.dict.objId); + } + const xResources = xObject.dict.get("Resources"); + if (!(xResources instanceof Dict)) { + continue; + } + if (xResources.objId && processed.has(xResources.objId)) { + continue; + } + nodes.push(xResources); + if (xResources.objId) { + processed.put(xResources.objId); + } + } + } + for (const ref of processed) { + nonBlendModesSet.put(ref); + } + return false; + } + async #fetchData(url) { + const response = await fetch(url); + if (!response.ok) { + throw new Error(`Failed to fetch file "${url}" with "${response.statusText}".`); + } + return new Uint8Array(await response.arrayBuffer()); + } + async fetchBuiltInCMap(name) { + const cachedData = this.builtInCMapCache.get(name); + if (cachedData) { + return cachedData; + } + let data; + if (this.options.cMapUrl !== null) { + const cMapData = await this.#fetchData(`${this.options.cMapUrl}${name}.bcmap`); + data = { + cMapData, + isCompressed: true + }; + } else { + data = await this.handler.sendWithPromise("FetchBuiltInCMap", { + name + }); + } + this.builtInCMapCache.set(name, data); + return data; + } + async fetchStandardFontData(name) { + const cachedData = this.standardFontDataCache.get(name); + if (cachedData) { + return new Stream(cachedData); + } + if (this.options.useSystemFonts && name !== "Symbol" && name !== "ZapfDingbats") { + return null; + } + const standardFontNameToFileName = getFontNameToFileMap(), + filename = standardFontNameToFileName[name]; + let data; + try { + if (this.options.standardFontDataUrl !== null) { + data = await this.#fetchData(`${this.options.standardFontDataUrl}${filename}`); + } else { + data = await this.handler.sendWithPromise("FetchStandardFontData", { + filename + }); + } + } catch (ex) { + warn(ex); + return null; + } + this.standardFontDataCache.set(name, data); + return new Stream(data); + } + async buildFormXObject(resources, xobj, smask, operatorList, task, initialState, localColorSpaceCache) { + const dict = xobj.dict; + const matrix = lookupMatrix(dict.getArray("Matrix"), null); + const bbox = lookupNormalRect(dict.getArray("BBox"), null); + let optionalContent, groupOptions; + if (dict.has("OC")) { + optionalContent = await this.parseMarkedContentProps(dict.get("OC"), resources); + } + if (optionalContent !== undefined) { + operatorList.addOp(OPS.beginMarkedContentProps, ["OC", optionalContent]); + } + const group = dict.get("Group"); + if (group) { + groupOptions = { + matrix, + bbox, + smask, + isolated: false, + knockout: false + }; + const groupSubtype = group.get("S"); + let colorSpace = null; + if (isName(groupSubtype, "Transparency")) { + groupOptions.isolated = group.get("I") || false; + groupOptions.knockout = group.get("K") || false; + if (group.has("CS")) { + const cs = group.getRaw("CS"); + const cachedColorSpace = ColorSpace.getCached(cs, this.xref, localColorSpaceCache); + if (cachedColorSpace) { + colorSpace = cachedColorSpace; + } else { + colorSpace = await this.parseColorSpace({ + cs, + resources, + localColorSpaceCache + }); + } + } + } + if (smask?.backdrop) { + colorSpace ||= ColorSpace.singletons.rgb; + smask.backdrop = colorSpace.getRgb(smask.backdrop, 0); + } + operatorList.addOp(OPS.beginGroup, [groupOptions]); + } + const args = group ? [matrix, null] : [matrix, bbox]; + operatorList.addOp(OPS.paintFormXObjectBegin, args); + await this.getOperatorList({ + stream: xobj, + task, + resources: dict.get("Resources") || resources, + operatorList, + initialState + }); + operatorList.addOp(OPS.paintFormXObjectEnd, []); + if (group) { + operatorList.addOp(OPS.endGroup, [groupOptions]); + } + if (optionalContent !== undefined) { + operatorList.addOp(OPS.endMarkedContent, []); + } + } + _sendImgData(objId, imgData, cacheGlobally = false) { + const transfers = imgData ? [imgData.bitmap || imgData.data.buffer] : null; + if (this.parsingType3Font || cacheGlobally) { + return this.handler.send("commonobj", [objId, "Image", imgData], transfers); + } + return this.handler.send("obj", [objId, this.pageIndex, "Image", imgData], transfers); + } + async buildPaintImageXObject({ + resources, + image, + isInline = false, + operatorList, + cacheKey, + localImageCache, + localColorSpaceCache + }) { + const dict = image.dict; + const imageRef = dict.objId; + const w = dict.get("W", "Width"); + const h = dict.get("H", "Height"); + if (!(w && typeof w === "number") || !(h && typeof h === "number")) { + warn("Image dimensions are missing, or not numbers."); + return; + } + const maxImageSize = this.options.maxImageSize; + if (maxImageSize !== -1 && w * h > maxImageSize) { + const msg = "Image exceeded maximum allowed size and was removed."; + if (this.options.ignoreErrors) { + warn(msg); + return; + } + throw new Error(msg); + } + let optionalContent; + if (dict.has("OC")) { + optionalContent = await this.parseMarkedContentProps(dict.get("OC"), resources); + } + const imageMask = dict.get("IM", "ImageMask") || false; + let imgData, args; + if (imageMask) { + const interpolate = dict.get("I", "Interpolate"); + const bitStrideLength = w + 7 >> 3; + const imgArray = image.getBytes(bitStrideLength * h); + const decode = dict.getArray("D", "Decode"); + if (this.parsingType3Font) { + imgData = PDFImage.createRawMask({ + imgArray, + width: w, + height: h, + imageIsFromDecodeStream: image instanceof DecodeStream, + inverseDecode: decode?.[0] > 0, + interpolate + }); + imgData.cached = !!cacheKey; + args = [imgData]; + operatorList.addImageOps(OPS.paintImageMaskXObject, args, optionalContent); + if (cacheKey) { + const cacheData = { + fn: OPS.paintImageMaskXObject, + args, + optionalContent + }; + localImageCache.set(cacheKey, imageRef, cacheData); + if (imageRef) { + this._regionalImageCache.set(null, imageRef, cacheData); + } + } + return; + } + imgData = await PDFImage.createMask({ + imgArray, + width: w, + height: h, + imageIsFromDecodeStream: image instanceof DecodeStream, + inverseDecode: decode?.[0] > 0, + interpolate, + isOffscreenCanvasSupported: this.options.isOffscreenCanvasSupported + }); + if (imgData.isSingleOpaquePixel) { + operatorList.addImageOps(OPS.paintSolidColorImageMask, [], optionalContent); + if (cacheKey) { + const cacheData = { + fn: OPS.paintSolidColorImageMask, + args: [], + optionalContent + }; + localImageCache.set(cacheKey, imageRef, cacheData); + if (imageRef) { + this._regionalImageCache.set(null, imageRef, cacheData); + } + } + return; + } + const objId = `mask_${this.idFactory.createObjId()}`; + operatorList.addDependency(objId); + imgData.dataLen = imgData.bitmap ? imgData.width * imgData.height * 4 : imgData.data.length; + this._sendImgData(objId, imgData); + args = [{ + data: objId, + width: imgData.width, + height: imgData.height, + interpolate: imgData.interpolate, + count: 1 + }]; + operatorList.addImageOps(OPS.paintImageMaskXObject, args, optionalContent); + if (cacheKey) { + const cacheData = { + objId, + fn: OPS.paintImageMaskXObject, + args, + optionalContent + }; + localImageCache.set(cacheKey, imageRef, cacheData); + if (imageRef) { + this._regionalImageCache.set(null, imageRef, cacheData); + } + } + return; + } + const SMALL_IMAGE_DIMENSIONS = 200; + const hasMask = dict.has("SMask") || dict.has("Mask"); + if (isInline && w + h < SMALL_IMAGE_DIMENSIONS && !hasMask) { + try { + const imageObj = new PDFImage({ + xref: this.xref, + res: resources, + image, + isInline, + pdfFunctionFactory: this._pdfFunctionFactory, + localColorSpaceCache + }); + imgData = await imageObj.createImageData(true, false); + operatorList.isOffscreenCanvasSupported = this.options.isOffscreenCanvasSupported; + operatorList.addImageOps(OPS.paintInlineImageXObject, [imgData], optionalContent); + } catch (reason) { + const msg = `Unable to decode inline image: "${reason}".`; + if (!this.options.ignoreErrors) { + throw new Error(msg); + } + warn(msg); + } + return; + } + let objId = `img_${this.idFactory.createObjId()}`, + cacheGlobally = false; + if (this.parsingType3Font) { + objId = `${this.idFactory.getDocId()}_type3_${objId}`; + } else if (cacheKey && imageRef) { + cacheGlobally = this.globalImageCache.shouldCache(imageRef, this.pageIndex); + if (cacheGlobally) { + assert(!isInline, "Cannot cache an inline image globally."); + objId = `${this.idFactory.getDocId()}_${objId}`; + } + } + operatorList.addDependency(objId); + args = [objId, w, h]; + operatorList.addImageOps(OPS.paintImageXObject, args, optionalContent, hasMask); + if (cacheGlobally) { + if (this.globalImageCache.hasDecodeFailed(imageRef)) { + this.globalImageCache.setData(imageRef, { + objId, + fn: OPS.paintImageXObject, + args, + optionalContent, + hasMask, + byteSize: 0 + }); + this._sendImgData(objId, null, cacheGlobally); + return; + } + if (w * h > 250000 || hasMask) { + const localLength = await this.handler.sendWithPromise("commonobj", [objId, "CopyLocalImage", { + imageRef + }]); + if (localLength) { + this.globalImageCache.setData(imageRef, { + objId, + fn: OPS.paintImageXObject, + args, + optionalContent, + hasMask, + byteSize: 0 + }); + this.globalImageCache.addByteSize(imageRef, localLength); + return; + } + } + } + PDFImage.buildImage({ + xref: this.xref, + res: resources, + image, + isInline, + pdfFunctionFactory: this._pdfFunctionFactory, + localColorSpaceCache + }).then(async imageObj => { + imgData = await imageObj.createImageData(false, this.options.isOffscreenCanvasSupported); + imgData.dataLen = imgData.bitmap ? imgData.width * imgData.height * 4 : imgData.data.length; + imgData.ref = imageRef; + if (cacheGlobally) { + this.globalImageCache.addByteSize(imageRef, imgData.dataLen); + } + return this._sendImgData(objId, imgData, cacheGlobally); + }).catch(reason => { + warn(`Unable to decode image "${objId}": "${reason}".`); + if (imageRef) { + this.globalImageCache.addDecodeFailed(imageRef); + } + return this._sendImgData(objId, null, cacheGlobally); + }); + if (cacheKey) { + const cacheData = { + objId, + fn: OPS.paintImageXObject, + args, + optionalContent, + hasMask + }; + localImageCache.set(cacheKey, imageRef, cacheData); + if (imageRef) { + this._regionalImageCache.set(null, imageRef, cacheData); + if (cacheGlobally) { + this.globalImageCache.setData(imageRef, { + objId, + fn: OPS.paintImageXObject, + args, + optionalContent, + hasMask, + byteSize: 0 + }); + } + } + } + } + handleSMask(smask, resources, operatorList, task, stateManager, localColorSpaceCache) { + const smaskContent = smask.get("G"); + const smaskOptions = { + subtype: smask.get("S").name, + backdrop: smask.get("BC") + }; + const transferObj = smask.get("TR"); + if (isPDFFunction(transferObj)) { + const transferFn = this._pdfFunctionFactory.create(transferObj); + const transferMap = new Uint8Array(256); + const tmp = new Float32Array(1); + for (let i = 0; i < 256; i++) { + tmp[0] = i / 255; + transferFn(tmp, 0, tmp, 0); + transferMap[i] = tmp[0] * 255 | 0; + } + smaskOptions.transferMap = transferMap; + } + return this.buildFormXObject(resources, smaskContent, smaskOptions, operatorList, task, stateManager.state.clone(), localColorSpaceCache); + } + handleTransferFunction(tr) { + let transferArray; + if (Array.isArray(tr)) { + transferArray = tr; + } else if (isPDFFunction(tr)) { + transferArray = [tr]; + } else { + return null; + } + const transferMaps = []; + let numFns = 0, + numEffectfulFns = 0; + for (const entry of transferArray) { + const transferObj = this.xref.fetchIfRef(entry); + numFns++; + if (isName(transferObj, "Identity")) { + transferMaps.push(null); + continue; + } else if (!isPDFFunction(transferObj)) { + return null; + } + const transferFn = this._pdfFunctionFactory.create(transferObj); + const transferMap = new Uint8Array(256), + tmp = new Float32Array(1); + for (let j = 0; j < 256; j++) { + tmp[0] = j / 255; + transferFn(tmp, 0, tmp, 0); + transferMap[j] = tmp[0] * 255 | 0; + } + transferMaps.push(transferMap); + numEffectfulFns++; + } + if (!(numFns === 1 || numFns === 4)) { + return null; + } + if (numEffectfulFns === 0) { + return null; + } + return transferMaps; + } + handleTilingType(fn, color, resources, pattern, patternDict, operatorList, task, localTilingPatternCache) { + const tilingOpList = new OperatorList(); + const patternResources = Dict.merge({ + xref: this.xref, + dictArray: [patternDict.get("Resources"), resources] + }); + return this.getOperatorList({ + stream: pattern, + task, + resources: patternResources, + operatorList: tilingOpList + }).then(function () { + const operatorListIR = tilingOpList.getIR(); + const tilingPatternIR = getTilingPatternIR(operatorListIR, patternDict, color); + operatorList.addDependencies(tilingOpList.dependencies); + operatorList.addOp(fn, tilingPatternIR); + if (patternDict.objId) { + localTilingPatternCache.set(null, patternDict.objId, { + operatorListIR, + dict: patternDict + }); + } + }).catch(reason => { + if (reason instanceof AbortException) { + return; + } + if (this.options.ignoreErrors) { + warn(`handleTilingType - ignoring pattern: "${reason}".`); + return; + } + throw reason; + }); + } + async handleSetFont(resources, fontArgs, fontRef, operatorList, task, state, fallbackFontDict = null, cssFontInfo = null) { + const fontName = fontArgs?.[0] instanceof Name ? fontArgs[0].name : null; + let translated = await this.loadFont(fontName, fontRef, resources, fallbackFontDict, cssFontInfo); + if (translated.font.isType3Font) { + try { + await translated.loadType3Data(this, resources, task); + operatorList.addDependencies(translated.type3Dependencies); + } catch (reason) { + translated = new TranslatedFont({ + loadedName: "g_font_error", + font: new ErrorFont(`Type3 font load error: ${reason}`), + dict: translated.font, + evaluatorOptions: this.options + }); + } + } + state.font = translated.font; + translated.send(this.handler); + return translated.loadedName; + } + handleText(chars, state) { + const font = state.font; + const glyphs = font.charsToGlyphs(chars); + if (font.data) { + const isAddToPathSet = !!(state.textRenderingMode & TextRenderingMode.ADD_TO_PATH_FLAG); + if (isAddToPathSet || state.fillColorSpace.name === "Pattern" || font.disableFontFace || this.options.disableFontFace) { + PartialEvaluator.buildFontPaths(font, glyphs, this.handler, this.options); + } + } + return glyphs; + } + ensureStateFont(state) { + if (state.font) { + return; + } + const reason = new FormatError("Missing setFont (Tf) operator before text rendering operator."); + if (this.options.ignoreErrors) { + warn(`ensureStateFont: "${reason}".`); + return; + } + throw reason; + } + async setGState({ + resources, + gState, + operatorList, + cacheKey, + task, + stateManager, + localGStateCache, + localColorSpaceCache + }) { + const gStateRef = gState.objId; + let isSimpleGState = true; + const gStateObj = []; + let promise = Promise.resolve(); + for (const key of gState.getKeys()) { + const value = gState.get(key); + switch (key) { + case "Type": + break; + case "LW": + case "LC": + case "LJ": + case "ML": + case "D": + case "RI": + case "FL": + case "CA": + case "ca": + gStateObj.push([key, value]); + break; + case "Font": + isSimpleGState = false; + promise = promise.then(() => this.handleSetFont(resources, null, value[0], operatorList, task, stateManager.state).then(function (loadedName) { + operatorList.addDependency(loadedName); + gStateObj.push([key, [loadedName, value[1]]]); + })); + break; + case "BM": + gStateObj.push([key, normalizeBlendMode(value)]); + break; + case "SMask": + if (isName(value, "None")) { + gStateObj.push([key, false]); + break; + } + if (value instanceof Dict) { + isSimpleGState = false; + promise = promise.then(() => this.handleSMask(value, resources, operatorList, task, stateManager, localColorSpaceCache)); + gStateObj.push([key, true]); + } else { + warn("Unsupported SMask type"); + } + break; + case "TR": + const transferMaps = this.handleTransferFunction(value); + gStateObj.push([key, transferMaps]); + break; + case "OP": + case "op": + case "OPM": + case "BG": + case "BG2": + case "UCR": + case "UCR2": + case "TR2": + case "HT": + case "SM": + case "SA": + case "AIS": + case "TK": + info("graphic state operator " + key); + break; + default: + info("Unknown graphic state operator " + key); + break; + } + } + await promise; + if (gStateObj.length > 0) { + operatorList.addOp(OPS.setGState, [gStateObj]); + } + if (isSimpleGState) { + localGStateCache.set(cacheKey, gStateRef, gStateObj); + } + } + loadFont(fontName, font, resources, fallbackFontDict = null, cssFontInfo = null) { + const errorFont = async () => { + return new TranslatedFont({ + loadedName: "g_font_error", + font: new ErrorFont(`Font "${fontName}" is not available.`), + dict: font, + evaluatorOptions: this.options + }); + }; + let fontRef; + if (font) { + if (font instanceof Ref) { + fontRef = font; + } + } else { + const fontRes = resources.get("Font"); + if (fontRes) { + fontRef = fontRes.getRaw(fontName); + } + } + if (fontRef) { + if (this.type3FontRefs?.has(fontRef)) { + return errorFont(); + } + if (this.fontCache.has(fontRef)) { + return this.fontCache.get(fontRef); + } + try { + font = this.xref.fetchIfRef(fontRef); + } catch (ex) { + warn(`loadFont - lookup failed: "${ex}".`); + } + } + if (!(font instanceof Dict)) { + if (!this.options.ignoreErrors && !this.parsingType3Font) { + warn(`Font "${fontName}" is not available.`); + return errorFont(); + } + warn(`Font "${fontName}" is not available -- attempting to fallback to a default font.`); + font = fallbackFontDict || PartialEvaluator.fallbackFontDict; + } + if (font.cacheKey && this.fontCache.has(font.cacheKey)) { + return this.fontCache.get(font.cacheKey); + } + const { + promise, + resolve + } = Promise.withResolvers(); + let preEvaluatedFont; + try { + preEvaluatedFont = this.preEvaluateFont(font); + preEvaluatedFont.cssFontInfo = cssFontInfo; + } catch (reason) { + warn(`loadFont - preEvaluateFont failed: "${reason}".`); + return errorFont(); + } + const { + descriptor, + hash + } = preEvaluatedFont; + const fontRefIsRef = fontRef instanceof Ref; + let fontID; + if (hash && descriptor instanceof Dict) { + const fontAliases = descriptor.fontAliases ||= Object.create(null); + if (fontAliases[hash]) { + const aliasFontRef = fontAliases[hash].aliasRef; + if (fontRefIsRef && aliasFontRef && this.fontCache.has(aliasFontRef)) { + this.fontCache.putAlias(fontRef, aliasFontRef); + return this.fontCache.get(fontRef); + } + } else { + fontAliases[hash] = { + fontID: this.idFactory.createFontId() + }; + } + if (fontRefIsRef) { + fontAliases[hash].aliasRef = fontRef; + } + fontID = fontAliases[hash].fontID; + } else { + fontID = this.idFactory.createFontId(); + } + assert(fontID?.startsWith("f"), 'The "fontID" must be (correctly) defined.'); + if (fontRefIsRef) { + this.fontCache.put(fontRef, promise); + } else { + font.cacheKey = `cacheKey_${fontID}`; + this.fontCache.put(font.cacheKey, promise); + } + font.loadedName = `${this.idFactory.getDocId()}_${fontID}`; + this.translateFont(preEvaluatedFont).then(translatedFont => { + resolve(new TranslatedFont({ + loadedName: font.loadedName, + font: translatedFont, + dict: font, + evaluatorOptions: this.options + })); + }).catch(reason => { + warn(`loadFont - translateFont failed: "${reason}".`); + resolve(new TranslatedFont({ + loadedName: font.loadedName, + font: new ErrorFont(reason instanceof Error ? reason.message : reason), + dict: font, + evaluatorOptions: this.options + })); + }); + return promise; + } + buildPath(operatorList, fn, args, parsingText = false) { + const lastIndex = operatorList.length - 1; + if (!args) { + args = []; + } + if (lastIndex < 0 || operatorList.fnArray[lastIndex] !== OPS.constructPath) { + if (parsingText) { + warn(`Encountered path operator "${fn}" inside of a text object.`); + operatorList.addOp(OPS.save, null); + } + let minMax; + switch (fn) { + case OPS.rectangle: + const x = args[0] + args[2]; + const y = args[1] + args[3]; + minMax = [Math.min(args[0], x), Math.min(args[1], y), Math.max(args[0], x), Math.max(args[1], y)]; + break; + case OPS.moveTo: + case OPS.lineTo: + minMax = [args[0], args[1], args[0], args[1]]; + break; + default: + minMax = [Infinity, Infinity, -Infinity, -Infinity]; + break; + } + operatorList.addOp(OPS.constructPath, [[fn], args, minMax]); + if (parsingText) { + operatorList.addOp(OPS.restore, null); + } + } else { + const opArgs = operatorList.argsArray[lastIndex]; + opArgs[0].push(fn); + opArgs[1].push(...args); + const minMax = opArgs[2]; + switch (fn) { + case OPS.rectangle: + const x = args[0] + args[2]; + const y = args[1] + args[3]; + minMax[0] = Math.min(minMax[0], args[0], x); + minMax[1] = Math.min(minMax[1], args[1], y); + minMax[2] = Math.max(minMax[2], args[0], x); + minMax[3] = Math.max(minMax[3], args[1], y); + break; + case OPS.moveTo: + case OPS.lineTo: + minMax[0] = Math.min(minMax[0], args[0]); + minMax[1] = Math.min(minMax[1], args[1]); + minMax[2] = Math.max(minMax[2], args[0]); + minMax[3] = Math.max(minMax[3], args[1]); + break; + } + } + } + parseColorSpace({ + cs, + resources, + localColorSpaceCache + }) { + return ColorSpace.parseAsync({ + cs, + xref: this.xref, + resources, + pdfFunctionFactory: this._pdfFunctionFactory, + localColorSpaceCache + }).catch(reason => { + if (reason instanceof AbortException) { + return null; + } + if (this.options.ignoreErrors) { + warn(`parseColorSpace - ignoring ColorSpace: "${reason}".`); + return null; + } + throw reason; + }); + } + parseShading({ + shading, + resources, + localColorSpaceCache, + localShadingPatternCache + }) { + let id = localShadingPatternCache.get(shading); + if (id) { + return id; + } + let patternIR; + try { + const shadingFill = Pattern.parseShading(shading, this.xref, resources, this._pdfFunctionFactory, localColorSpaceCache); + patternIR = shadingFill.getIR(); + } catch (reason) { + if (reason instanceof AbortException) { + return null; + } + if (this.options.ignoreErrors) { + warn(`parseShading - ignoring shading: "${reason}".`); + localShadingPatternCache.set(shading, null); + return null; + } + throw reason; + } + id = `pattern_${this.idFactory.createObjId()}`; + if (this.parsingType3Font) { + id = `${this.idFactory.getDocId()}_type3_${id}`; + } + localShadingPatternCache.set(shading, id); + if (this.parsingType3Font) { + this.handler.send("commonobj", [id, "Pattern", patternIR]); + } else { + this.handler.send("obj", [id, this.pageIndex, "Pattern", patternIR]); + } + return id; + } + handleColorN(operatorList, fn, args, cs, patterns, resources, task, localColorSpaceCache, localTilingPatternCache, localShadingPatternCache) { + const patternName = args.pop(); + if (patternName instanceof Name) { + const rawPattern = patterns.getRaw(patternName.name); + const localTilingPattern = rawPattern instanceof Ref && localTilingPatternCache.getByRef(rawPattern); + if (localTilingPattern) { + try { + const color = cs.base ? cs.base.getRgb(args, 0) : null; + const tilingPatternIR = getTilingPatternIR(localTilingPattern.operatorListIR, localTilingPattern.dict, color); + operatorList.addOp(fn, tilingPatternIR); + return undefined; + } catch {} + } + const pattern = this.xref.fetchIfRef(rawPattern); + if (pattern) { + const dict = pattern instanceof BaseStream ? pattern.dict : pattern; + const typeNum = dict.get("PatternType"); + if (typeNum === PatternType.TILING) { + const color = cs.base ? cs.base.getRgb(args, 0) : null; + return this.handleTilingType(fn, color, resources, pattern, dict, operatorList, task, localTilingPatternCache); + } else if (typeNum === PatternType.SHADING) { + const shading = dict.get("Shading"); + const objId = this.parseShading({ + shading, + resources, + localColorSpaceCache, + localShadingPatternCache + }); + if (objId) { + const matrix = lookupMatrix(dict.getArray("Matrix"), null); + operatorList.addOp(fn, ["Shading", objId, matrix]); + } + return undefined; + } + throw new FormatError(`Unknown PatternType: ${typeNum}`); + } + } + throw new FormatError(`Unknown PatternName: ${patternName}`); + } + _parseVisibilityExpression(array, nestingCounter, currentResult) { + const MAX_NESTING = 10; + if (++nestingCounter > MAX_NESTING) { + warn("Visibility expression is too deeply nested"); + return; + } + const length = array.length; + const operator = this.xref.fetchIfRef(array[0]); + if (length < 2 || !(operator instanceof Name)) { + warn("Invalid visibility expression"); + return; + } + switch (operator.name) { + case "And": + case "Or": + case "Not": + currentResult.push(operator.name); + break; + default: + warn(`Invalid operator ${operator.name} in visibility expression`); + return; + } + for (let i = 1; i < length; i++) { + const raw = array[i]; + const object = this.xref.fetchIfRef(raw); + if (Array.isArray(object)) { + const nestedResult = []; + currentResult.push(nestedResult); + this._parseVisibilityExpression(object, nestingCounter, nestedResult); + } else if (raw instanceof Ref) { + currentResult.push(raw.toString()); + } + } + } + async parseMarkedContentProps(contentProperties, resources) { + let optionalContent; + if (contentProperties instanceof Name) { + const properties = resources.get("Properties"); + optionalContent = properties.get(contentProperties.name); + } else if (contentProperties instanceof Dict) { + optionalContent = contentProperties; + } else { + throw new FormatError("Optional content properties malformed."); + } + const optionalContentType = optionalContent.get("Type")?.name; + if (optionalContentType === "OCG") { + return { + type: optionalContentType, + id: optionalContent.objId + }; + } else if (optionalContentType === "OCMD") { + const expression = optionalContent.get("VE"); + if (Array.isArray(expression)) { + const result = []; + this._parseVisibilityExpression(expression, 0, result); + if (result.length > 0) { + return { + type: "OCMD", + expression: result + }; + } + } + const optionalContentGroups = optionalContent.get("OCGs"); + if (Array.isArray(optionalContentGroups) || optionalContentGroups instanceof Dict) { + const groupIds = []; + if (Array.isArray(optionalContentGroups)) { + for (const ocg of optionalContentGroups) { + groupIds.push(ocg.toString()); + } + } else { + groupIds.push(optionalContentGroups.objId); + } + return { + type: optionalContentType, + ids: groupIds, + policy: optionalContent.get("P") instanceof Name ? optionalContent.get("P").name : null, + expression: null + }; + } else if (optionalContentGroups instanceof Ref) { + return { + type: optionalContentType, + id: optionalContentGroups.toString() + }; + } + } + return null; + } + getOperatorList({ + stream, + task, + resources, + operatorList, + initialState = null, + fallbackFontDict = null + }) { + resources ||= Dict.empty; + initialState ||= new EvalState(); + if (!operatorList) { + throw new Error('getOperatorList: missing "operatorList" parameter'); + } + const self = this; + const xref = this.xref; + let parsingText = false; + const localImageCache = new LocalImageCache(); + const localColorSpaceCache = new LocalColorSpaceCache(); + const localGStateCache = new LocalGStateCache(); + const localTilingPatternCache = new LocalTilingPatternCache(); + const localShadingPatternCache = new Map(); + const xobjs = resources.get("XObject") || Dict.empty; + const patterns = resources.get("Pattern") || Dict.empty; + const stateManager = new StateManager(initialState); + const preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager); + const timeSlotManager = new TimeSlotManager(); + function closePendingRestoreOPS(argument) { + for (let i = 0, ii = preprocessor.savedStatesDepth; i < ii; i++) { + operatorList.addOp(OPS.restore, []); + } + } + return new Promise(function promiseBody(resolve, reject) { + const next = function (promise) { + Promise.all([promise, operatorList.ready]).then(function () { + try { + promiseBody(resolve, reject); + } catch (ex) { + reject(ex); + } + }, reject); + }; + task.ensureNotTerminated(); + timeSlotManager.reset(); + const operation = {}; + let stop, i, ii, cs, name, isValidName; + while (!(stop = timeSlotManager.check())) { + operation.args = null; + if (!preprocessor.read(operation)) { + break; + } + let args = operation.args; + let fn = operation.fn; + switch (fn | 0) { + case OPS.paintXObject: + isValidName = args[0] instanceof Name; + name = args[0].name; + if (isValidName) { + const localImage = localImageCache.getByName(name); + if (localImage) { + addLocallyCachedImageOps(operatorList, localImage); + args = null; + continue; + } + } + next(new Promise(function (resolveXObject, rejectXObject) { + if (!isValidName) { + throw new FormatError("XObject must be referred to by name."); + } + let xobj = xobjs.getRaw(name); + if (xobj instanceof Ref) { + const localImage = localImageCache.getByRef(xobj) || self._regionalImageCache.getByRef(xobj); + if (localImage) { + addLocallyCachedImageOps(operatorList, localImage); + resolveXObject(); + return; + } + const globalImage = self.globalImageCache.getData(xobj, self.pageIndex); + if (globalImage) { + operatorList.addDependency(globalImage.objId); + operatorList.addImageOps(globalImage.fn, globalImage.args, globalImage.optionalContent, globalImage.hasMask); + resolveXObject(); + return; + } + xobj = xref.fetch(xobj); + } + if (!(xobj instanceof BaseStream)) { + throw new FormatError("XObject should be a stream"); + } + const type = xobj.dict.get("Subtype"); + if (!(type instanceof Name)) { + throw new FormatError("XObject should have a Name subtype"); + } + if (type.name === "Form") { + stateManager.save(); + self.buildFormXObject(resources, xobj, null, operatorList, task, stateManager.state.clone(), localColorSpaceCache).then(function () { + stateManager.restore(); + resolveXObject(); + }, rejectXObject); + return; + } else if (type.name === "Image") { + self.buildPaintImageXObject({ + resources, + image: xobj, + operatorList, + cacheKey: name, + localImageCache, + localColorSpaceCache + }).then(resolveXObject, rejectXObject); + return; + } else if (type.name === "PS") { + info("Ignored XObject subtype PS"); + } else { + throw new FormatError(`Unhandled XObject subtype ${type.name}`); + } + resolveXObject(); + }).catch(function (reason) { + if (reason instanceof AbortException) { + return; + } + if (self.options.ignoreErrors) { + warn(`getOperatorList - ignoring XObject: "${reason}".`); + return; + } + throw reason; + })); + return; + case OPS.setFont: + const fontSize = args[1]; + next(self.handleSetFont(resources, args, null, operatorList, task, stateManager.state, fallbackFontDict).then(function (loadedName) { + operatorList.addDependency(loadedName); + operatorList.addOp(OPS.setFont, [loadedName, fontSize]); + })); + return; + case OPS.beginText: + parsingText = true; + break; + case OPS.endText: + parsingText = false; + break; + case OPS.endInlineImage: + const cacheKey = args[0].cacheKey; + if (cacheKey) { + const localImage = localImageCache.getByName(cacheKey); + if (localImage) { + addLocallyCachedImageOps(operatorList, localImage); + args = null; + continue; + } + } + next(self.buildPaintImageXObject({ + resources, + image: args[0], + isInline: true, + operatorList, + cacheKey, + localImageCache, + localColorSpaceCache + })); + return; + case OPS.showText: + if (!stateManager.state.font) { + self.ensureStateFont(stateManager.state); + continue; + } + args[0] = self.handleText(args[0], stateManager.state); + break; + case OPS.showSpacedText: + if (!stateManager.state.font) { + self.ensureStateFont(stateManager.state); + continue; + } + const combinedGlyphs = [], + state = stateManager.state; + for (const arrItem of args[0]) { + if (typeof arrItem === "string") { + combinedGlyphs.push(...self.handleText(arrItem, state)); + } else if (typeof arrItem === "number") { + combinedGlyphs.push(arrItem); + } + } + args[0] = combinedGlyphs; + fn = OPS.showText; + break; + case OPS.nextLineShowText: + if (!stateManager.state.font) { + self.ensureStateFont(stateManager.state); + continue; + } + operatorList.addOp(OPS.nextLine); + args[0] = self.handleText(args[0], stateManager.state); + fn = OPS.showText; + break; + case OPS.nextLineSetSpacingShowText: + if (!stateManager.state.font) { + self.ensureStateFont(stateManager.state); + continue; + } + operatorList.addOp(OPS.nextLine); + operatorList.addOp(OPS.setWordSpacing, [args.shift()]); + operatorList.addOp(OPS.setCharSpacing, [args.shift()]); + args[0] = self.handleText(args[0], stateManager.state); + fn = OPS.showText; + break; + case OPS.setTextRenderingMode: + stateManager.state.textRenderingMode = args[0]; + break; + case OPS.setFillColorSpace: + { + const cachedColorSpace = ColorSpace.getCached(args[0], xref, localColorSpaceCache); + if (cachedColorSpace) { + stateManager.state.fillColorSpace = cachedColorSpace; + continue; + } + next(self.parseColorSpace({ + cs: args[0], + resources, + localColorSpaceCache + }).then(function (colorSpace) { + stateManager.state.fillColorSpace = colorSpace || ColorSpace.singletons.gray; + })); + return; + } + case OPS.setStrokeColorSpace: + { + const cachedColorSpace = ColorSpace.getCached(args[0], xref, localColorSpaceCache); + if (cachedColorSpace) { + stateManager.state.strokeColorSpace = cachedColorSpace; + continue; + } + next(self.parseColorSpace({ + cs: args[0], + resources, + localColorSpaceCache + }).then(function (colorSpace) { + stateManager.state.strokeColorSpace = colorSpace || ColorSpace.singletons.gray; + })); + return; + } + case OPS.setFillColor: + cs = stateManager.state.fillColorSpace; + args = cs.getRgb(args, 0); + fn = OPS.setFillRGBColor; + break; + case OPS.setStrokeColor: + cs = stateManager.state.strokeColorSpace; + args = cs.getRgb(args, 0); + fn = OPS.setStrokeRGBColor; + break; + case OPS.setFillGray: + stateManager.state.fillColorSpace = ColorSpace.singletons.gray; + args = ColorSpace.singletons.gray.getRgb(args, 0); + fn = OPS.setFillRGBColor; + break; + case OPS.setStrokeGray: + stateManager.state.strokeColorSpace = ColorSpace.singletons.gray; + args = ColorSpace.singletons.gray.getRgb(args, 0); + fn = OPS.setStrokeRGBColor; + break; + case OPS.setFillCMYKColor: + stateManager.state.fillColorSpace = ColorSpace.singletons.cmyk; + args = ColorSpace.singletons.cmyk.getRgb(args, 0); + fn = OPS.setFillRGBColor; + break; + case OPS.setStrokeCMYKColor: + stateManager.state.strokeColorSpace = ColorSpace.singletons.cmyk; + args = ColorSpace.singletons.cmyk.getRgb(args, 0); + fn = OPS.setStrokeRGBColor; + break; + case OPS.setFillRGBColor: + stateManager.state.fillColorSpace = ColorSpace.singletons.rgb; + args = ColorSpace.singletons.rgb.getRgb(args, 0); + break; + case OPS.setStrokeRGBColor: + stateManager.state.strokeColorSpace = ColorSpace.singletons.rgb; + args = ColorSpace.singletons.rgb.getRgb(args, 0); + break; + case OPS.setFillColorN: + cs = stateManager.state.patternFillColorSpace; + if (!cs) { + if (isNumberArray(args, null)) { + args = ColorSpace.singletons.gray.getRgb(args, 0); + fn = OPS.setFillRGBColor; + break; + } + args = []; + fn = OPS.setFillTransparent; + break; + } + if (cs.name === "Pattern") { + next(self.handleColorN(operatorList, OPS.setFillColorN, args, cs, patterns, resources, task, localColorSpaceCache, localTilingPatternCache, localShadingPatternCache)); + return; + } + args = cs.getRgb(args, 0); + fn = OPS.setFillRGBColor; + break; + case OPS.setStrokeColorN: + cs = stateManager.state.patternStrokeColorSpace; + if (!cs) { + if (isNumberArray(args, null)) { + args = ColorSpace.singletons.gray.getRgb(args, 0); + fn = OPS.setStrokeRGBColor; + break; + } + args = []; + fn = OPS.setStrokeTransparent; + break; + } + if (cs.name === "Pattern") { + next(self.handleColorN(operatorList, OPS.setStrokeColorN, args, cs, patterns, resources, task, localColorSpaceCache, localTilingPatternCache, localShadingPatternCache)); + return; + } + args = cs.getRgb(args, 0); + fn = OPS.setStrokeRGBColor; + break; + case OPS.shadingFill: + let shading; + try { + const shadingRes = resources.get("Shading"); + if (!shadingRes) { + throw new FormatError("No shading resource found"); + } + shading = shadingRes.get(args[0].name); + if (!shading) { + throw new FormatError("No shading object found"); + } + } catch (reason) { + if (reason instanceof AbortException) { + continue; + } + if (self.options.ignoreErrors) { + warn(`getOperatorList - ignoring Shading: "${reason}".`); + continue; + } + throw reason; + } + const patternId = self.parseShading({ + shading, + resources, + localColorSpaceCache, + localShadingPatternCache + }); + if (!patternId) { + continue; + } + args = [patternId]; + fn = OPS.shadingFill; + break; + case OPS.setGState: + isValidName = args[0] instanceof Name; + name = args[0].name; + if (isValidName) { + const localGStateObj = localGStateCache.getByName(name); + if (localGStateObj) { + if (localGStateObj.length > 0) { + operatorList.addOp(OPS.setGState, [localGStateObj]); + } + args = null; + continue; + } + } + next(new Promise(function (resolveGState, rejectGState) { + if (!isValidName) { + throw new FormatError("GState must be referred to by name."); + } + const extGState = resources.get("ExtGState"); + if (!(extGState instanceof Dict)) { + throw new FormatError("ExtGState should be a dictionary."); + } + const gState = extGState.get(name); + if (!(gState instanceof Dict)) { + throw new FormatError("GState should be a dictionary."); + } + self.setGState({ + resources, + gState, + operatorList, + cacheKey: name, + task, + stateManager, + localGStateCache, + localColorSpaceCache + }).then(resolveGState, rejectGState); + }).catch(function (reason) { + if (reason instanceof AbortException) { + return; + } + if (self.options.ignoreErrors) { + warn(`getOperatorList - ignoring ExtGState: "${reason}".`); + return; + } + throw reason; + })); + return; + case OPS.moveTo: + case OPS.lineTo: + case OPS.curveTo: + case OPS.curveTo2: + case OPS.curveTo3: + case OPS.closePath: + case OPS.rectangle: + self.buildPath(operatorList, fn, args, parsingText); + continue; + case OPS.markPoint: + case OPS.markPointProps: + case OPS.beginCompat: + case OPS.endCompat: + continue; + case OPS.beginMarkedContentProps: + if (!(args[0] instanceof Name)) { + warn(`Expected name for beginMarkedContentProps arg0=${args[0]}`); + operatorList.addOp(OPS.beginMarkedContentProps, ["OC", null]); + continue; + } + if (args[0].name === "OC") { + next(self.parseMarkedContentProps(args[1], resources).then(data => { + operatorList.addOp(OPS.beginMarkedContentProps, ["OC", data]); + }).catch(reason => { + if (reason instanceof AbortException) { + return; + } + if (self.options.ignoreErrors) { + warn(`getOperatorList - ignoring beginMarkedContentProps: "${reason}".`); + operatorList.addOp(OPS.beginMarkedContentProps, ["OC", null]); + return; + } + throw reason; + })); + return; + } + args = [args[0].name, args[1] instanceof Dict ? args[1].get("MCID") : null]; + break; + case OPS.beginMarkedContent: + case OPS.endMarkedContent: + default: + if (args !== null) { + for (i = 0, ii = args.length; i < ii; i++) { + if (args[i] instanceof Dict) { + break; + } + } + if (i < ii) { + warn("getOperatorList - ignoring operator: " + fn); + continue; + } + } + } + operatorList.addOp(fn, args); + } + if (stop) { + next(deferred); + return; + } + closePendingRestoreOPS(); + resolve(); + }).catch(reason => { + if (reason instanceof AbortException) { + return; + } + if (this.options.ignoreErrors) { + warn(`getOperatorList - ignoring errors during "${task.name}" ` + `task: "${reason}".`); + closePendingRestoreOPS(); + return; + } + throw reason; + }); + } + getTextContent({ + stream, + task, + resources, + stateManager = null, + includeMarkedContent = false, + sink, + seenStyles = new Set(), + viewBox, + lang = null, + markedContentData = null, + disableNormalization = false, + keepWhiteSpace = false + }) { + resources ||= Dict.empty; + stateManager ||= new StateManager(new TextState()); + if (includeMarkedContent) { + markedContentData ||= { + level: 0 + }; + } + const textContent = { + items: [], + styles: Object.create(null), + lang + }; + const textContentItem = { + initialized: false, + str: [], + totalWidth: 0, + totalHeight: 0, + width: 0, + height: 0, + vertical: false, + prevTransform: null, + textAdvanceScale: 0, + spaceInFlowMin: 0, + spaceInFlowMax: 0, + trackingSpaceMin: Infinity, + negativeSpaceMax: -Infinity, + notASpace: -Infinity, + transform: null, + fontName: null, + hasEOL: false + }; + const twoLastChars = [" ", " "]; + let twoLastCharsPos = 0; + function saveLastChar(char) { + const nextPos = (twoLastCharsPos + 1) % 2; + const ret = twoLastChars[twoLastCharsPos] !== " " && twoLastChars[nextPos] === " "; + twoLastChars[twoLastCharsPos] = char; + twoLastCharsPos = nextPos; + return !keepWhiteSpace && ret; + } + function shouldAddWhitepsace() { + return !keepWhiteSpace && twoLastChars[twoLastCharsPos] !== " " && twoLastChars[(twoLastCharsPos + 1) % 2] === " "; + } + function resetLastChars() { + twoLastChars[0] = twoLastChars[1] = " "; + twoLastCharsPos = 0; + } + const TRACKING_SPACE_FACTOR = 0.102; + const NOT_A_SPACE_FACTOR = 0.03; + const NEGATIVE_SPACE_FACTOR = -0.2; + const SPACE_IN_FLOW_MIN_FACTOR = 0.102; + const SPACE_IN_FLOW_MAX_FACTOR = 0.6; + const VERTICAL_SHIFT_RATIO = 0.25; + const self = this; + const xref = this.xref; + const showSpacedTextBuffer = []; + let xobjs = null; + const emptyXObjectCache = new LocalImageCache(); + const emptyGStateCache = new LocalGStateCache(); + const preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager); + let textState; + function pushWhitespace({ + width = 0, + height = 0, + transform = textContentItem.prevTransform, + fontName = textContentItem.fontName + }) { + textContent.items.push({ + str: " ", + dir: "ltr", + width, + height, + transform, + fontName, + hasEOL: false + }); + } + function getCurrentTextTransform() { + const font = textState.font; + const tsm = [textState.fontSize * textState.textHScale, 0, 0, textState.fontSize, 0, textState.textRise]; + if (font.isType3Font && (textState.fontSize <= 1 || font.isCharBBox) && !isArrayEqual(textState.fontMatrix, FONT_IDENTITY_MATRIX)) { + const glyphHeight = font.bbox[3] - font.bbox[1]; + if (glyphHeight > 0) { + tsm[3] *= glyphHeight * textState.fontMatrix[3]; + } + } + return Util.transform(textState.ctm, Util.transform(textState.textMatrix, tsm)); + } + function ensureTextContentItem() { + if (textContentItem.initialized) { + return textContentItem; + } + const { + font, + loadedName + } = textState; + if (!seenStyles.has(loadedName)) { + seenStyles.add(loadedName); + textContent.styles[loadedName] = { + fontFamily: font.fallbackName, + ascent: font.ascent, + descent: font.descent, + vertical: font.vertical + }; + if (self.options.fontExtraProperties && font.systemFontInfo) { + const style = textContent.styles[loadedName]; + style.fontSubstitution = font.systemFontInfo.css; + style.fontSubstitutionLoadedName = font.systemFontInfo.loadedName; + } + } + textContentItem.fontName = loadedName; + const trm = textContentItem.transform = getCurrentTextTransform(); + if (!font.vertical) { + textContentItem.width = textContentItem.totalWidth = 0; + textContentItem.height = textContentItem.totalHeight = Math.hypot(trm[2], trm[3]); + textContentItem.vertical = false; + } else { + textContentItem.width = textContentItem.totalWidth = Math.hypot(trm[0], trm[1]); + textContentItem.height = textContentItem.totalHeight = 0; + textContentItem.vertical = true; + } + const scaleLineX = Math.hypot(textState.textLineMatrix[0], textState.textLineMatrix[1]); + const scaleCtmX = Math.hypot(textState.ctm[0], textState.ctm[1]); + textContentItem.textAdvanceScale = scaleCtmX * scaleLineX; + const { + fontSize + } = textState; + textContentItem.trackingSpaceMin = fontSize * TRACKING_SPACE_FACTOR; + textContentItem.notASpace = fontSize * NOT_A_SPACE_FACTOR; + textContentItem.negativeSpaceMax = fontSize * NEGATIVE_SPACE_FACTOR; + textContentItem.spaceInFlowMin = fontSize * SPACE_IN_FLOW_MIN_FACTOR; + textContentItem.spaceInFlowMax = fontSize * SPACE_IN_FLOW_MAX_FACTOR; + textContentItem.hasEOL = false; + textContentItem.initialized = true; + return textContentItem; + } + function updateAdvanceScale() { + if (!textContentItem.initialized) { + return; + } + const scaleLineX = Math.hypot(textState.textLineMatrix[0], textState.textLineMatrix[1]); + const scaleCtmX = Math.hypot(textState.ctm[0], textState.ctm[1]); + const scaleFactor = scaleCtmX * scaleLineX; + if (scaleFactor === textContentItem.textAdvanceScale) { + return; + } + if (!textContentItem.vertical) { + textContentItem.totalWidth += textContentItem.width * textContentItem.textAdvanceScale; + textContentItem.width = 0; + } else { + textContentItem.totalHeight += textContentItem.height * textContentItem.textAdvanceScale; + textContentItem.height = 0; + } + textContentItem.textAdvanceScale = scaleFactor; + } + function runBidiTransform(textChunk) { + let text = textChunk.str.join(""); + if (!disableNormalization) { + text = normalizeUnicode(text); + } + const bidiResult = bidi(text, -1, textChunk.vertical); + return { + str: bidiResult.str, + dir: bidiResult.dir, + width: Math.abs(textChunk.totalWidth), + height: Math.abs(textChunk.totalHeight), + transform: textChunk.transform, + fontName: textChunk.fontName, + hasEOL: textChunk.hasEOL + }; + } + async function handleSetFont(fontName, fontRef) { + const translated = await self.loadFont(fontName, fontRef, resources); + if (translated.font.isType3Font) { + try { + await translated.loadType3Data(self, resources, task); + } catch {} + } + textState.loadedName = translated.loadedName; + textState.font = translated.font; + textState.fontMatrix = translated.font.fontMatrix || FONT_IDENTITY_MATRIX; + } + function applyInverseRotation(x, y, matrix) { + const scale = Math.hypot(matrix[0], matrix[1]); + return [(matrix[0] * x + matrix[1] * y) / scale, (matrix[2] * x + matrix[3] * y) / scale]; + } + function compareWithLastPosition(glyphWidth) { + const currentTransform = getCurrentTextTransform(); + let posX = currentTransform[4]; + let posY = currentTransform[5]; + if (textState.font?.vertical) { + if (posX < viewBox[0] || posX > viewBox[2] || posY + glyphWidth < viewBox[1] || posY > viewBox[3]) { + return false; + } + } else if (posX + glyphWidth < viewBox[0] || posX > viewBox[2] || posY < viewBox[1] || posY > viewBox[3]) { + return false; + } + if (!textState.font || !textContentItem.prevTransform) { + return true; + } + let lastPosX = textContentItem.prevTransform[4]; + let lastPosY = textContentItem.prevTransform[5]; + if (lastPosX === posX && lastPosY === posY) { + return true; + } + let rotate = -1; + if (currentTransform[0] && currentTransform[1] === 0 && currentTransform[2] === 0) { + rotate = currentTransform[0] > 0 ? 0 : 180; + } else if (currentTransform[1] && currentTransform[0] === 0 && currentTransform[3] === 0) { + rotate = currentTransform[1] > 0 ? 90 : 270; + } + switch (rotate) { + case 0: + break; + case 90: + [posX, posY] = [posY, posX]; + [lastPosX, lastPosY] = [lastPosY, lastPosX]; + break; + case 180: + [posX, posY, lastPosX, lastPosY] = [-posX, -posY, -lastPosX, -lastPosY]; + break; + case 270: + [posX, posY] = [-posY, -posX]; + [lastPosX, lastPosY] = [-lastPosY, -lastPosX]; + break; + default: + [posX, posY] = applyInverseRotation(posX, posY, currentTransform); + [lastPosX, lastPosY] = applyInverseRotation(lastPosX, lastPosY, textContentItem.prevTransform); + } + if (textState.font.vertical) { + const advanceY = (lastPosY - posY) / textContentItem.textAdvanceScale; + const advanceX = posX - lastPosX; + const textOrientation = Math.sign(textContentItem.height); + if (advanceY < textOrientation * textContentItem.negativeSpaceMax) { + if (Math.abs(advanceX) > 0.5 * textContentItem.width) { + appendEOL(); + return true; + } + resetLastChars(); + flushTextContentItem(); + return true; + } + if (Math.abs(advanceX) > textContentItem.width) { + appendEOL(); + return true; + } + if (advanceY <= textOrientation * textContentItem.notASpace) { + resetLastChars(); + } + if (advanceY <= textOrientation * textContentItem.trackingSpaceMin) { + if (shouldAddWhitepsace()) { + resetLastChars(); + flushTextContentItem(); + pushWhitespace({ + height: Math.abs(advanceY) + }); + } else { + textContentItem.height += advanceY; + } + } else if (!addFakeSpaces(advanceY, textContentItem.prevTransform, textOrientation)) { + if (textContentItem.str.length === 0) { + resetLastChars(); + pushWhitespace({ + height: Math.abs(advanceY) + }); + } else { + textContentItem.height += advanceY; + } + } + if (Math.abs(advanceX) > textContentItem.width * VERTICAL_SHIFT_RATIO) { + flushTextContentItem(); + } + return true; + } + const advanceX = (posX - lastPosX) / textContentItem.textAdvanceScale; + const advanceY = posY - lastPosY; + const textOrientation = Math.sign(textContentItem.width); + if (advanceX < textOrientation * textContentItem.negativeSpaceMax) { + if (Math.abs(advanceY) > 0.5 * textContentItem.height) { + appendEOL(); + return true; + } + resetLastChars(); + flushTextContentItem(); + return true; + } + if (Math.abs(advanceY) > textContentItem.height) { + appendEOL(); + return true; + } + if (advanceX <= textOrientation * textContentItem.notASpace) { + resetLastChars(); + } + if (advanceX <= textOrientation * textContentItem.trackingSpaceMin) { + if (shouldAddWhitepsace()) { + resetLastChars(); + flushTextContentItem(); + pushWhitespace({ + width: Math.abs(advanceX) + }); + } else { + textContentItem.width += advanceX; + } + } else if (!addFakeSpaces(advanceX, textContentItem.prevTransform, textOrientation)) { + if (textContentItem.str.length === 0) { + resetLastChars(); + pushWhitespace({ + width: Math.abs(advanceX) + }); + } else { + textContentItem.width += advanceX; + } + } + if (Math.abs(advanceY) > textContentItem.height * VERTICAL_SHIFT_RATIO) { + flushTextContentItem(); + } + return true; + } + function buildTextContentItem({ + chars, + extraSpacing + }) { + const font = textState.font; + if (!chars) { + const charSpacing = textState.charSpacing + extraSpacing; + if (charSpacing) { + if (!font.vertical) { + textState.translateTextMatrix(charSpacing * textState.textHScale, 0); + } else { + textState.translateTextMatrix(0, -charSpacing); + } + } + if (keepWhiteSpace) { + compareWithLastPosition(0); + } + return; + } + const glyphs = font.charsToGlyphs(chars); + const scale = textState.fontMatrix[0] * textState.fontSize; + for (let i = 0, ii = glyphs.length; i < ii; i++) { + const glyph = glyphs[i]; + const { + category + } = glyph; + if (category.isInvisibleFormatMark) { + continue; + } + let charSpacing = textState.charSpacing + (i + 1 === ii ? extraSpacing : 0); + let glyphWidth = glyph.width; + if (font.vertical) { + glyphWidth = glyph.vmetric ? glyph.vmetric[0] : -glyphWidth; + } + let scaledDim = glyphWidth * scale; + if (!keepWhiteSpace && category.isWhitespace) { + if (!font.vertical) { + charSpacing += scaledDim + textState.wordSpacing; + textState.translateTextMatrix(charSpacing * textState.textHScale, 0); + } else { + charSpacing += -scaledDim + textState.wordSpacing; + textState.translateTextMatrix(0, -charSpacing); + } + saveLastChar(" "); + continue; + } + if (!category.isZeroWidthDiacritic && !compareWithLastPosition(scaledDim)) { + if (!font.vertical) { + textState.translateTextMatrix(scaledDim * textState.textHScale, 0); + } else { + textState.translateTextMatrix(0, scaledDim); + } + continue; + } + const textChunk = ensureTextContentItem(); + if (category.isZeroWidthDiacritic) { + scaledDim = 0; + } + if (!font.vertical) { + scaledDim *= textState.textHScale; + textState.translateTextMatrix(scaledDim, 0); + textChunk.width += scaledDim; + } else { + textState.translateTextMatrix(0, scaledDim); + scaledDim = Math.abs(scaledDim); + textChunk.height += scaledDim; + } + if (scaledDim) { + textChunk.prevTransform = getCurrentTextTransform(); + } + const glyphUnicode = glyph.unicode; + if (saveLastChar(glyphUnicode)) { + textChunk.str.push(" "); + } + textChunk.str.push(glyphUnicode); + if (charSpacing) { + if (!font.vertical) { + textState.translateTextMatrix(charSpacing * textState.textHScale, 0); + } else { + textState.translateTextMatrix(0, -charSpacing); + } + } + } + } + function appendEOL() { + resetLastChars(); + if (textContentItem.initialized) { + textContentItem.hasEOL = true; + flushTextContentItem(); + } else { + textContent.items.push({ + str: "", + dir: "ltr", + width: 0, + height: 0, + transform: getCurrentTextTransform(), + fontName: textState.loadedName, + hasEOL: true + }); + } + } + function addFakeSpaces(width, transf, textOrientation) { + if (textOrientation * textContentItem.spaceInFlowMin <= width && width <= textOrientation * textContentItem.spaceInFlowMax) { + if (textContentItem.initialized) { + resetLastChars(); + textContentItem.str.push(" "); + } + return false; + } + const fontName = textContentItem.fontName; + let height = 0; + if (textContentItem.vertical) { + height = width; + width = 0; + } + flushTextContentItem(); + resetLastChars(); + pushWhitespace({ + width: Math.abs(width), + height: Math.abs(height), + transform: transf || getCurrentTextTransform(), + fontName + }); + return true; + } + function flushTextContentItem() { + if (!textContentItem.initialized || !textContentItem.str) { + return; + } + if (!textContentItem.vertical) { + textContentItem.totalWidth += textContentItem.width * textContentItem.textAdvanceScale; + } else { + textContentItem.totalHeight += textContentItem.height * textContentItem.textAdvanceScale; + } + textContent.items.push(runBidiTransform(textContentItem)); + textContentItem.initialized = false; + textContentItem.str.length = 0; + } + function enqueueChunk(batch = false) { + const length = textContent.items.length; + if (length === 0) { + return; + } + if (batch && length < TEXT_CHUNK_BATCH_SIZE) { + return; + } + sink.enqueue(textContent, length); + textContent.items = []; + textContent.styles = Object.create(null); + } + const timeSlotManager = new TimeSlotManager(); + return new Promise(function promiseBody(resolve, reject) { + const next = function (promise) { + enqueueChunk(true); + Promise.all([promise, sink.ready]).then(function () { + try { + promiseBody(resolve, reject); + } catch (ex) { + reject(ex); + } + }, reject); + }; + task.ensureNotTerminated(); + timeSlotManager.reset(); + const operation = {}; + let stop, + name, + isValidName, + args = []; + while (!(stop = timeSlotManager.check())) { + args.length = 0; + operation.args = args; + if (!preprocessor.read(operation)) { + break; + } + const previousState = textState; + textState = stateManager.state; + const fn = operation.fn; + args = operation.args; + switch (fn | 0) { + case OPS.setFont: + const fontNameArg = args[0].name, + fontSizeArg = args[1]; + if (textState.font && fontNameArg === textState.fontName && fontSizeArg === textState.fontSize) { + break; + } + flushTextContentItem(); + textState.fontName = fontNameArg; + textState.fontSize = fontSizeArg; + next(handleSetFont(fontNameArg, null)); + return; + case OPS.setTextRise: + textState.textRise = args[0]; + break; + case OPS.setHScale: + textState.textHScale = args[0] / 100; + break; + case OPS.setLeading: + textState.leading = args[0]; + break; + case OPS.moveText: + textState.translateTextLineMatrix(args[0], args[1]); + textState.textMatrix = textState.textLineMatrix.slice(); + break; + case OPS.setLeadingMoveText: + textState.leading = -args[1]; + textState.translateTextLineMatrix(args[0], args[1]); + textState.textMatrix = textState.textLineMatrix.slice(); + break; + case OPS.nextLine: + textState.carriageReturn(); + break; + case OPS.setTextMatrix: + textState.setTextMatrix(args[0], args[1], args[2], args[3], args[4], args[5]); + textState.setTextLineMatrix(args[0], args[1], args[2], args[3], args[4], args[5]); + updateAdvanceScale(); + break; + case OPS.setCharSpacing: + textState.charSpacing = args[0]; + break; + case OPS.setWordSpacing: + textState.wordSpacing = args[0]; + break; + case OPS.beginText: + textState.textMatrix = IDENTITY_MATRIX.slice(); + textState.textLineMatrix = IDENTITY_MATRIX.slice(); + break; + case OPS.showSpacedText: + if (!stateManager.state.font) { + self.ensureStateFont(stateManager.state); + continue; + } + const spaceFactor = (textState.font.vertical ? 1 : -1) * textState.fontSize / 1000; + const elements = args[0]; + for (let i = 0, ii = elements.length; i < ii; i++) { + const item = elements[i]; + if (typeof item === "string") { + showSpacedTextBuffer.push(item); + } else if (typeof item === "number" && item !== 0) { + const str = showSpacedTextBuffer.join(""); + showSpacedTextBuffer.length = 0; + buildTextContentItem({ + chars: str, + extraSpacing: item * spaceFactor + }); + } + } + if (showSpacedTextBuffer.length > 0) { + const str = showSpacedTextBuffer.join(""); + showSpacedTextBuffer.length = 0; + buildTextContentItem({ + chars: str, + extraSpacing: 0 + }); + } + break; + case OPS.showText: + if (!stateManager.state.font) { + self.ensureStateFont(stateManager.state); + continue; + } + buildTextContentItem({ + chars: args[0], + extraSpacing: 0 + }); + break; + case OPS.nextLineShowText: + if (!stateManager.state.font) { + self.ensureStateFont(stateManager.state); + continue; + } + textState.carriageReturn(); + buildTextContentItem({ + chars: args[0], + extraSpacing: 0 + }); + break; + case OPS.nextLineSetSpacingShowText: + if (!stateManager.state.font) { + self.ensureStateFont(stateManager.state); + continue; + } + textState.wordSpacing = args[0]; + textState.charSpacing = args[1]; + textState.carriageReturn(); + buildTextContentItem({ + chars: args[2], + extraSpacing: 0 + }); + break; + case OPS.paintXObject: + flushTextContentItem(); + xobjs ??= resources.get("XObject") || Dict.empty; + isValidName = args[0] instanceof Name; + name = args[0].name; + if (isValidName && emptyXObjectCache.getByName(name)) { + break; + } + next(new Promise(function (resolveXObject, rejectXObject) { + if (!isValidName) { + throw new FormatError("XObject must be referred to by name."); + } + let xobj = xobjs.getRaw(name); + if (xobj instanceof Ref) { + if (emptyXObjectCache.getByRef(xobj)) { + resolveXObject(); + return; + } + const globalImage = self.globalImageCache.getData(xobj, self.pageIndex); + if (globalImage) { + resolveXObject(); + return; + } + xobj = xref.fetch(xobj); + } + if (!(xobj instanceof BaseStream)) { + throw new FormatError("XObject should be a stream"); + } + const type = xobj.dict.get("Subtype"); + if (!(type instanceof Name)) { + throw new FormatError("XObject should have a Name subtype"); + } + if (type.name !== "Form") { + emptyXObjectCache.set(name, xobj.dict.objId, true); + resolveXObject(); + return; + } + const currentState = stateManager.state.clone(); + const xObjStateManager = new StateManager(currentState); + const matrix = lookupMatrix(xobj.dict.getArray("Matrix"), null); + if (matrix) { + xObjStateManager.transform(matrix); + } + enqueueChunk(); + const sinkWrapper = { + enqueueInvoked: false, + enqueue(chunk, size) { + this.enqueueInvoked = true; + sink.enqueue(chunk, size); + }, + get desiredSize() { + return sink.desiredSize; + }, + get ready() { + return sink.ready; + } + }; + self.getTextContent({ + stream: xobj, + task, + resources: xobj.dict.get("Resources") || resources, + stateManager: xObjStateManager, + includeMarkedContent, + sink: sinkWrapper, + seenStyles, + viewBox, + lang, + markedContentData, + disableNormalization, + keepWhiteSpace + }).then(function () { + if (!sinkWrapper.enqueueInvoked) { + emptyXObjectCache.set(name, xobj.dict.objId, true); + } + resolveXObject(); + }, rejectXObject); + }).catch(function (reason) { + if (reason instanceof AbortException) { + return; + } + if (self.options.ignoreErrors) { + warn(`getTextContent - ignoring XObject: "${reason}".`); + return; + } + throw reason; + })); + return; + case OPS.setGState: + isValidName = args[0] instanceof Name; + name = args[0].name; + if (isValidName && emptyGStateCache.getByName(name)) { + break; + } + next(new Promise(function (resolveGState, rejectGState) { + if (!isValidName) { + throw new FormatError("GState must be referred to by name."); + } + const extGState = resources.get("ExtGState"); + if (!(extGState instanceof Dict)) { + throw new FormatError("ExtGState should be a dictionary."); + } + const gState = extGState.get(name); + if (!(gState instanceof Dict)) { + throw new FormatError("GState should be a dictionary."); + } + const gStateFont = gState.get("Font"); + if (!gStateFont) { + emptyGStateCache.set(name, gState.objId, true); + resolveGState(); + return; + } + flushTextContentItem(); + textState.fontName = null; + textState.fontSize = gStateFont[1]; + handleSetFont(null, gStateFont[0]).then(resolveGState, rejectGState); + }).catch(function (reason) { + if (reason instanceof AbortException) { + return; + } + if (self.options.ignoreErrors) { + warn(`getTextContent - ignoring ExtGState: "${reason}".`); + return; + } + throw reason; + })); + return; + case OPS.beginMarkedContent: + flushTextContentItem(); + if (includeMarkedContent) { + markedContentData.level++; + textContent.items.push({ + type: "beginMarkedContent", + tag: args[0] instanceof Name ? args[0].name : null + }); + } + break; + case OPS.beginMarkedContentProps: + flushTextContentItem(); + if (includeMarkedContent) { + markedContentData.level++; + let mcid = null; + if (args[1] instanceof Dict) { + mcid = args[1].get("MCID"); + } + textContent.items.push({ + type: "beginMarkedContentProps", + id: Number.isInteger(mcid) ? `${self.idFactory.getPageObjId()}_mc${mcid}` : null, + tag: args[0] instanceof Name ? args[0].name : null + }); + } + break; + case OPS.endMarkedContent: + flushTextContentItem(); + if (includeMarkedContent) { + if (markedContentData.level === 0) { + break; + } + markedContentData.level--; + textContent.items.push({ + type: "endMarkedContent" + }); + } + break; + case OPS.restore: + if (previousState && (previousState.font !== textState.font || previousState.fontSize !== textState.fontSize || previousState.fontName !== textState.fontName)) { + flushTextContentItem(); + } + break; + } + if (textContent.items.length >= sink.desiredSize) { + stop = true; + break; + } + } + if (stop) { + next(deferred); + return; + } + flushTextContentItem(); + enqueueChunk(); + resolve(); + }).catch(reason => { + if (reason instanceof AbortException) { + return; + } + if (this.options.ignoreErrors) { + warn(`getTextContent - ignoring errors during "${task.name}" ` + `task: "${reason}".`); + flushTextContentItem(); + enqueueChunk(); + return; + } + throw reason; + }); + } + async extractDataStructures(dict, properties) { + const xref = this.xref; + let cidToGidBytes; + const toUnicodePromise = this.readToUnicode(properties.toUnicode); + if (properties.composite) { + const cidSystemInfo = dict.get("CIDSystemInfo"); + if (cidSystemInfo instanceof Dict) { + properties.cidSystemInfo = { + registry: stringToPDFString(cidSystemInfo.get("Registry")), + ordering: stringToPDFString(cidSystemInfo.get("Ordering")), + supplement: cidSystemInfo.get("Supplement") + }; + } + try { + const cidToGidMap = dict.get("CIDToGIDMap"); + if (cidToGidMap instanceof BaseStream) { + cidToGidBytes = cidToGidMap.getBytes(); + } + } catch (ex) { + if (!this.options.ignoreErrors) { + throw ex; + } + warn(`extractDataStructures - ignoring CIDToGIDMap data: "${ex}".`); + } + } + const differences = []; + let baseEncodingName = null; + let encoding; + if (dict.has("Encoding")) { + encoding = dict.get("Encoding"); + if (encoding instanceof Dict) { + baseEncodingName = encoding.get("BaseEncoding"); + baseEncodingName = baseEncodingName instanceof Name ? baseEncodingName.name : null; + if (encoding.has("Differences")) { + const diffEncoding = encoding.get("Differences"); + let index = 0; + for (const entry of diffEncoding) { + const data = xref.fetchIfRef(entry); + if (typeof data === "number") { + index = data; + } else if (data instanceof Name) { + differences[index++] = data.name; + } else { + throw new FormatError(`Invalid entry in 'Differences' array: ${data}`); + } + } + } + } else if (encoding instanceof Name) { + baseEncodingName = encoding.name; + } else { + const msg = "Encoding is not a Name nor a Dict"; + if (!this.options.ignoreErrors) { + throw new FormatError(msg); + } + warn(msg); + } + if (baseEncodingName !== "MacRomanEncoding" && baseEncodingName !== "MacExpertEncoding" && baseEncodingName !== "WinAnsiEncoding") { + baseEncodingName = null; + } + } + const nonEmbeddedFont = !properties.file || properties.isInternalFont, + isSymbolsFontName = getSymbolsFonts()[properties.name]; + if (baseEncodingName && nonEmbeddedFont && isSymbolsFontName) { + baseEncodingName = null; + } + if (baseEncodingName) { + properties.defaultEncoding = getEncoding(baseEncodingName); + } else { + const isSymbolicFont = !!(properties.flags & FontFlags.Symbolic); + const isNonsymbolicFont = !!(properties.flags & FontFlags.Nonsymbolic); + encoding = StandardEncoding; + if (properties.type === "TrueType" && !isNonsymbolicFont) { + encoding = WinAnsiEncoding; + } + if (isSymbolicFont || isSymbolsFontName) { + encoding = MacRomanEncoding; + if (nonEmbeddedFont) { + if (/Symbol/i.test(properties.name)) { + encoding = SymbolSetEncoding; + } else if (/Dingbats/i.test(properties.name)) { + encoding = ZapfDingbatsEncoding; + } else if (/Wingdings/i.test(properties.name)) { + encoding = WinAnsiEncoding; + } + } + } + properties.defaultEncoding = encoding; + } + properties.differences = differences; + properties.baseEncodingName = baseEncodingName; + properties.hasEncoding = !!baseEncodingName || differences.length > 0; + properties.dict = dict; + properties.toUnicode = await toUnicodePromise; + const builtToUnicode = await this.buildToUnicode(properties); + properties.toUnicode = builtToUnicode; + if (cidToGidBytes) { + properties.cidToGidMap = this.readCidToGidMap(cidToGidBytes, builtToUnicode); + } + return properties; + } + _simpleFontToUnicode(properties, forceGlyphs = false) { + assert(!properties.composite, "Must be a simple font."); + const toUnicode = []; + const encoding = properties.defaultEncoding.slice(); + const baseEncodingName = properties.baseEncodingName; + const differences = properties.differences; + for (const charcode in differences) { + const glyphName = differences[charcode]; + if (glyphName === ".notdef") { + continue; + } + encoding[charcode] = glyphName; + } + const glyphsUnicodeMap = getGlyphsUnicode(); + for (const charcode in encoding) { + let glyphName = encoding[charcode]; + if (glyphName === "") { + continue; + } + let unicode = glyphsUnicodeMap[glyphName]; + if (unicode !== undefined) { + toUnicode[charcode] = String.fromCharCode(unicode); + continue; + } + let code = 0; + switch (glyphName[0]) { + case "G": + if (glyphName.length === 3) { + code = parseInt(glyphName.substring(1), 16); + } + break; + case "g": + if (glyphName.length === 5) { + code = parseInt(glyphName.substring(1), 16); + } + break; + case "C": + case "c": + if (glyphName.length >= 3 && glyphName.length <= 4) { + const codeStr = glyphName.substring(1); + if (forceGlyphs) { + code = parseInt(codeStr, 16); + break; + } + code = +codeStr; + if (Number.isNaN(code) && Number.isInteger(parseInt(codeStr, 16))) { + return this._simpleFontToUnicode(properties, true); + } + } + break; + case "u": + unicode = getUnicodeForGlyph(glyphName, glyphsUnicodeMap); + if (unicode !== -1) { + code = unicode; + } + break; + default: + switch (glyphName) { + case "f_h": + case "f_t": + case "T_h": + toUnicode[charcode] = glyphName.replaceAll("_", ""); + continue; + } + break; + } + if (code > 0 && code <= 0x10ffff && Number.isInteger(code)) { + if (baseEncodingName && code === +charcode) { + const baseEncoding = getEncoding(baseEncodingName); + if (baseEncoding && (glyphName = baseEncoding[charcode])) { + toUnicode[charcode] = String.fromCharCode(glyphsUnicodeMap[glyphName]); + continue; + } + } + toUnicode[charcode] = String.fromCodePoint(code); + } + } + return toUnicode; + } + async buildToUnicode(properties) { + properties.hasIncludedToUnicodeMap = properties.toUnicode?.length > 0; + if (properties.hasIncludedToUnicodeMap) { + if (!properties.composite && properties.hasEncoding) { + properties.fallbackToUnicode = this._simpleFontToUnicode(properties); + } + return properties.toUnicode; + } + if (!properties.composite) { + return new ToUnicodeMap(this._simpleFontToUnicode(properties)); + } + if (properties.composite && (properties.cMap.builtInCMap && !(properties.cMap instanceof IdentityCMap) || properties.cidSystemInfo?.registry === "Adobe" && (properties.cidSystemInfo.ordering === "GB1" || properties.cidSystemInfo.ordering === "CNS1" || properties.cidSystemInfo.ordering === "Japan1" || properties.cidSystemInfo.ordering === "Korea1"))) { + const { + registry, + ordering + } = properties.cidSystemInfo; + const ucs2CMapName = Name.get(`${registry}-${ordering}-UCS2`); + const ucs2CMap = await CMapFactory.create({ + encoding: ucs2CMapName, + fetchBuiltInCMap: this._fetchBuiltInCMapBound, + useCMap: null + }); + const toUnicode = [], + buf = []; + properties.cMap.forEach(function (charcode, cid) { + if (cid > 0xffff) { + throw new FormatError("Max size of CID is 65,535"); + } + const ucs2 = ucs2CMap.lookup(cid); + if (ucs2) { + buf.length = 0; + for (let i = 0, ii = ucs2.length; i < ii; i += 2) { + buf.push((ucs2.charCodeAt(i) << 8) + ucs2.charCodeAt(i + 1)); + } + toUnicode[charcode] = String.fromCharCode(...buf); + } + }); + return new ToUnicodeMap(toUnicode); + } + return new IdentityToUnicodeMap(properties.firstChar, properties.lastChar); + } + async readToUnicode(cmapObj) { + if (!cmapObj) { + return null; + } + if (cmapObj instanceof Name) { + const cmap = await CMapFactory.create({ + encoding: cmapObj, + fetchBuiltInCMap: this._fetchBuiltInCMapBound, + useCMap: null + }); + if (cmap instanceof IdentityCMap) { + return new IdentityToUnicodeMap(0, 0xffff); + } + return new ToUnicodeMap(cmap.getMap()); + } + if (cmapObj instanceof BaseStream) { + try { + const cmap = await CMapFactory.create({ + encoding: cmapObj, + fetchBuiltInCMap: this._fetchBuiltInCMapBound, + useCMap: null + }); + if (cmap instanceof IdentityCMap) { + return new IdentityToUnicodeMap(0, 0xffff); + } + const map = new Array(cmap.length); + cmap.forEach(function (charCode, token) { + if (typeof token === "number") { + map[charCode] = String.fromCodePoint(token); + return; + } + if (token.length % 2 !== 0) { + token = "\u0000" + token; + } + const str = []; + for (let k = 0; k < token.length; k += 2) { + const w1 = token.charCodeAt(k) << 8 | token.charCodeAt(k + 1); + if ((w1 & 0xf800) !== 0xd800) { + str.push(w1); + continue; + } + k += 2; + const w2 = token.charCodeAt(k) << 8 | token.charCodeAt(k + 1); + str.push(((w1 & 0x3ff) << 10) + (w2 & 0x3ff) + 0x10000); + } + map[charCode] = String.fromCodePoint(...str); + }); + return new ToUnicodeMap(map); + } catch (reason) { + if (reason instanceof AbortException) { + return null; + } + if (this.options.ignoreErrors) { + warn(`readToUnicode - ignoring ToUnicode data: "${reason}".`); + return null; + } + throw reason; + } + } + return null; + } + readCidToGidMap(glyphsData, toUnicode) { + const result = []; + for (let j = 0, jj = glyphsData.length; j < jj; j++) { + const glyphID = glyphsData[j++] << 8 | glyphsData[j]; + const code = j >> 1; + if (glyphID === 0 && !toUnicode.has(code)) { + continue; + } + result[code] = glyphID; + } + return result; + } + extractWidths(dict, descriptor, properties) { + const xref = this.xref; + let glyphsWidths = []; + let defaultWidth = 0; + const glyphsVMetrics = []; + let defaultVMetrics; + if (properties.composite) { + const dw = dict.get("DW"); + defaultWidth = typeof dw === "number" ? Math.ceil(dw) : 1000; + const widths = dict.get("W"); + if (Array.isArray(widths)) { + for (let i = 0, ii = widths.length; i < ii; i++) { + let start = xref.fetchIfRef(widths[i++]); + if (!Number.isInteger(start)) { + break; + } + const code = xref.fetchIfRef(widths[i]); + if (Array.isArray(code)) { + for (const c of code) { + const width = xref.fetchIfRef(c); + if (typeof width === "number") { + glyphsWidths[start] = width; + } + start++; + } + } else if (Number.isInteger(code)) { + const width = xref.fetchIfRef(widths[++i]); + if (typeof width !== "number") { + continue; + } + for (let j = start; j <= code; j++) { + glyphsWidths[j] = width; + } + } else { + break; + } + } + } + if (properties.vertical) { + const dw2 = dict.getArray("DW2"); + let vmetrics = isNumberArray(dw2, 2) ? dw2 : [880, -1000]; + defaultVMetrics = [vmetrics[1], defaultWidth * 0.5, vmetrics[0]]; + vmetrics = dict.get("W2"); + if (Array.isArray(vmetrics)) { + for (let i = 0, ii = vmetrics.length; i < ii; i++) { + let start = xref.fetchIfRef(vmetrics[i++]); + if (!Number.isInteger(start)) { + break; + } + const code = xref.fetchIfRef(vmetrics[i]); + if (Array.isArray(code)) { + for (let j = 0, jj = code.length; j < jj; j++) { + const vmetric = [xref.fetchIfRef(code[j++]), xref.fetchIfRef(code[j++]), xref.fetchIfRef(code[j])]; + if (isNumberArray(vmetric, null)) { + glyphsVMetrics[start] = vmetric; + } + start++; + } + } else if (Number.isInteger(code)) { + const vmetric = [xref.fetchIfRef(vmetrics[++i]), xref.fetchIfRef(vmetrics[++i]), xref.fetchIfRef(vmetrics[++i])]; + if (!isNumberArray(vmetric, null)) { + continue; + } + for (let j = start; j <= code; j++) { + glyphsVMetrics[j] = vmetric; + } + } else { + break; + } + } + } + } + } else { + const widths = dict.get("Widths"); + if (Array.isArray(widths)) { + let j = properties.firstChar; + for (const w of widths) { + const width = xref.fetchIfRef(w); + if (typeof width === "number") { + glyphsWidths[j] = width; + } + j++; + } + const missingWidth = descriptor.get("MissingWidth"); + defaultWidth = typeof missingWidth === "number" ? missingWidth : 0; + } else { + const baseFontName = dict.get("BaseFont"); + if (baseFontName instanceof Name) { + const metrics = this.getBaseFontMetrics(baseFontName.name); + glyphsWidths = this.buildCharCodeToWidth(metrics.widths, properties); + defaultWidth = metrics.defaultWidth; + } + } + } + let isMonospace = true; + let firstWidth = defaultWidth; + for (const glyph in glyphsWidths) { + const glyphWidth = glyphsWidths[glyph]; + if (!glyphWidth) { + continue; + } + if (!firstWidth) { + firstWidth = glyphWidth; + continue; + } + if (firstWidth !== glyphWidth) { + isMonospace = false; + break; + } + } + if (isMonospace) { + properties.flags |= FontFlags.FixedPitch; + } else { + properties.flags &= ~FontFlags.FixedPitch; + } + properties.defaultWidth = defaultWidth; + properties.widths = glyphsWidths; + properties.defaultVMetrics = defaultVMetrics; + properties.vmetrics = glyphsVMetrics; + } + isSerifFont(baseFontName) { + const fontNameWoStyle = baseFontName.split("-", 1)[0]; + return fontNameWoStyle in getSerifFonts() || /serif/gi.test(fontNameWoStyle); + } + getBaseFontMetrics(name) { + let defaultWidth = 0; + let widths = Object.create(null); + let monospace = false; + const stdFontMap = getStdFontMap(); + let lookupName = stdFontMap[name] || name; + const Metrics = getMetrics(); + if (!(lookupName in Metrics)) { + lookupName = this.isSerifFont(name) ? "Times-Roman" : "Helvetica"; + } + const glyphWidths = Metrics[lookupName]; + if (typeof glyphWidths === "number") { + defaultWidth = glyphWidths; + monospace = true; + } else { + widths = glyphWidths(); + } + return { + defaultWidth, + monospace, + widths + }; + } + buildCharCodeToWidth(widthsByGlyphName, properties) { + const widths = Object.create(null); + const differences = properties.differences; + const encoding = properties.defaultEncoding; + for (let charCode = 0; charCode < 256; charCode++) { + if (charCode in differences && widthsByGlyphName[differences[charCode]]) { + widths[charCode] = widthsByGlyphName[differences[charCode]]; + continue; + } + if (charCode in encoding && widthsByGlyphName[encoding[charCode]]) { + widths[charCode] = widthsByGlyphName[encoding[charCode]]; + continue; + } + } + return widths; + } + preEvaluateFont(dict) { + const baseDict = dict; + let type = dict.get("Subtype"); + if (!(type instanceof Name)) { + throw new FormatError("invalid font Subtype"); + } + let composite = false; + let hash; + if (type.name === "Type0") { + const df = dict.get("DescendantFonts"); + if (!df) { + throw new FormatError("Descendant fonts are not specified"); + } + dict = Array.isArray(df) ? this.xref.fetchIfRef(df[0]) : df; + if (!(dict instanceof Dict)) { + throw new FormatError("Descendant font is not a dictionary."); + } + type = dict.get("Subtype"); + if (!(type instanceof Name)) { + throw new FormatError("invalid font Subtype"); + } + composite = true; + } + let firstChar = dict.get("FirstChar"); + if (!Number.isInteger(firstChar)) { + firstChar = 0; + } + let lastChar = dict.get("LastChar"); + if (!Number.isInteger(lastChar)) { + lastChar = composite ? 0xffff : 0xff; + } + const descriptor = dict.get("FontDescriptor"); + const toUnicode = dict.get("ToUnicode") || baseDict.get("ToUnicode"); + if (descriptor) { + hash = new MurmurHash3_64(); + const encoding = baseDict.getRaw("Encoding"); + if (encoding instanceof Name) { + hash.update(encoding.name); + } else if (encoding instanceof Ref) { + hash.update(encoding.toString()); + } else if (encoding instanceof Dict) { + for (const entry of encoding.getRawValues()) { + if (entry instanceof Name) { + hash.update(entry.name); + } else if (entry instanceof Ref) { + hash.update(entry.toString()); + } else if (Array.isArray(entry)) { + const diffLength = entry.length, + diffBuf = new Array(diffLength); + for (let j = 0; j < diffLength; j++) { + const diffEntry = entry[j]; + if (diffEntry instanceof Name) { + diffBuf[j] = diffEntry.name; + } else if (typeof diffEntry === "number" || diffEntry instanceof Ref) { + diffBuf[j] = diffEntry.toString(); + } + } + hash.update(diffBuf.join()); + } + } + } + hash.update(`${firstChar}-${lastChar}`); + if (toUnicode instanceof BaseStream) { + const stream = toUnicode.str || toUnicode; + const uint8array = stream.buffer ? new Uint8Array(stream.buffer.buffer, 0, stream.bufferLength) : new Uint8Array(stream.bytes.buffer, stream.start, stream.end - stream.start); + hash.update(uint8array); + } else if (toUnicode instanceof Name) { + hash.update(toUnicode.name); + } + const widths = dict.get("Widths") || baseDict.get("Widths"); + if (Array.isArray(widths)) { + const widthsBuf = []; + for (const entry of widths) { + if (typeof entry === "number" || entry instanceof Ref) { + widthsBuf.push(entry.toString()); + } + } + hash.update(widthsBuf.join()); + } + if (composite) { + hash.update("compositeFont"); + const compositeWidths = dict.get("W") || baseDict.get("W"); + if (Array.isArray(compositeWidths)) { + const widthsBuf = []; + for (const entry of compositeWidths) { + if (typeof entry === "number" || entry instanceof Ref) { + widthsBuf.push(entry.toString()); + } else if (Array.isArray(entry)) { + const subWidthsBuf = []; + for (const element of entry) { + if (typeof element === "number" || element instanceof Ref) { + subWidthsBuf.push(element.toString()); + } + } + widthsBuf.push(`[${subWidthsBuf.join()}]`); + } + } + hash.update(widthsBuf.join()); + } + const cidToGidMap = dict.getRaw("CIDToGIDMap") || baseDict.getRaw("CIDToGIDMap"); + if (cidToGidMap instanceof Name) { + hash.update(cidToGidMap.name); + } else if (cidToGidMap instanceof Ref) { + hash.update(cidToGidMap.toString()); + } else if (cidToGidMap instanceof BaseStream) { + hash.update(cidToGidMap.peekBytes()); + } + } + } + return { + descriptor, + dict, + baseDict, + composite, + type: type.name, + firstChar, + lastChar, + toUnicode, + hash: hash ? hash.hexdigest() : "" + }; + } + async translateFont({ + descriptor, + dict, + baseDict, + composite, + type, + firstChar, + lastChar, + toUnicode, + cssFontInfo + }) { + const isType3Font = type === "Type3"; + if (!descriptor) { + if (isType3Font) { + const bbox = lookupNormalRect(dict.getArray("FontBBox"), [0, 0, 0, 0]); + descriptor = new Dict(null); + descriptor.set("FontName", Name.get(type)); + descriptor.set("FontBBox", bbox); + } else { + let baseFontName = dict.get("BaseFont"); + if (!(baseFontName instanceof Name)) { + throw new FormatError("Base font is not specified"); + } + baseFontName = baseFontName.name.replaceAll(/[,_]/g, "-"); + const metrics = this.getBaseFontMetrics(baseFontName); + const fontNameWoStyle = baseFontName.split("-", 1)[0]; + const flags = (this.isSerifFont(fontNameWoStyle) ? FontFlags.Serif : 0) | (metrics.monospace ? FontFlags.FixedPitch : 0) | (getSymbolsFonts()[fontNameWoStyle] ? FontFlags.Symbolic : FontFlags.Nonsymbolic); + const properties = { + type, + name: baseFontName, + loadedName: baseDict.loadedName, + systemFontInfo: null, + widths: metrics.widths, + defaultWidth: metrics.defaultWidth, + isSimulatedFlags: true, + flags, + firstChar, + lastChar, + toUnicode, + xHeight: 0, + capHeight: 0, + italicAngle: 0, + isType3Font + }; + const widths = dict.get("Widths"); + const standardFontName = getStandardFontName(baseFontName); + let file = null; + if (standardFontName) { + file = await this.fetchStandardFontData(standardFontName); + properties.isInternalFont = !!file; + } + if (!properties.isInternalFont && this.options.useSystemFonts) { + properties.systemFontInfo = getFontSubstitution(this.systemFontCache, this.idFactory, this.options.standardFontDataUrl, baseFontName, standardFontName, type); + } + const newProperties = await this.extractDataStructures(dict, properties); + if (Array.isArray(widths)) { + const glyphWidths = []; + let j = firstChar; + for (const w of widths) { + const width = this.xref.fetchIfRef(w); + if (typeof width === "number") { + glyphWidths[j] = width; + } + j++; + } + newProperties.widths = glyphWidths; + } else { + newProperties.widths = this.buildCharCodeToWidth(metrics.widths, newProperties); + } + return new Font(baseFontName, file, newProperties); + } + } + let fontName = descriptor.get("FontName"); + let baseFont = dict.get("BaseFont"); + if (typeof fontName === "string") { + fontName = Name.get(fontName); + } + if (typeof baseFont === "string") { + baseFont = Name.get(baseFont); + } + const fontNameStr = fontName?.name; + const baseFontStr = baseFont?.name; + if (!isType3Font && fontNameStr !== baseFontStr) { + info(`The FontDescriptor's FontName is "${fontNameStr}" but ` + `should be the same as the Font's BaseFont "${baseFontStr}".`); + if (fontNameStr && baseFontStr && (baseFontStr.startsWith(fontNameStr) || !isKnownFontName(fontNameStr) && isKnownFontName(baseFontStr))) { + fontName = null; + } + } + fontName ||= baseFont; + if (!(fontName instanceof Name)) { + throw new FormatError("invalid font name"); + } + let fontFile, subtype, length1, length2, length3; + try { + fontFile = descriptor.get("FontFile", "FontFile2", "FontFile3"); + if (fontFile) { + if (!(fontFile instanceof BaseStream)) { + throw new FormatError("FontFile should be a stream"); + } else if (fontFile.isEmpty) { + throw new FormatError("FontFile is empty"); + } + } + } catch (ex) { + if (!this.options.ignoreErrors) { + throw ex; + } + warn(`translateFont - fetching "${fontName.name}" font file: "${ex}".`); + fontFile = null; + } + let isInternalFont = false; + let glyphScaleFactors = null; + let systemFontInfo = null; + if (fontFile) { + if (fontFile.dict) { + const subtypeEntry = fontFile.dict.get("Subtype"); + if (subtypeEntry instanceof Name) { + subtype = subtypeEntry.name; + } + length1 = fontFile.dict.get("Length1"); + length2 = fontFile.dict.get("Length2"); + length3 = fontFile.dict.get("Length3"); + } + } else if (cssFontInfo) { + const standardFontName = getXfaFontName(fontName.name); + if (standardFontName) { + cssFontInfo.fontFamily = `${cssFontInfo.fontFamily}-PdfJS-XFA`; + cssFontInfo.metrics = standardFontName.metrics || null; + glyphScaleFactors = standardFontName.factors || null; + fontFile = await this.fetchStandardFontData(standardFontName.name); + isInternalFont = !!fontFile; + baseDict = dict = getXfaFontDict(fontName.name); + composite = true; + } + } else if (!isType3Font) { + const standardFontName = getStandardFontName(fontName.name); + if (standardFontName) { + fontFile = await this.fetchStandardFontData(standardFontName); + isInternalFont = !!fontFile; + } + if (!isInternalFont && this.options.useSystemFonts) { + systemFontInfo = getFontSubstitution(this.systemFontCache, this.idFactory, this.options.standardFontDataUrl, fontName.name, standardFontName, type); + } + } + const fontMatrix = lookupMatrix(dict.getArray("FontMatrix"), FONT_IDENTITY_MATRIX); + const bbox = lookupNormalRect(descriptor.getArray("FontBBox") || dict.getArray("FontBBox"), undefined); + let ascent = descriptor.get("Ascent"); + if (typeof ascent !== "number") { + ascent = undefined; + } + let descent = descriptor.get("Descent"); + if (typeof descent !== "number") { + descent = undefined; + } + let xHeight = descriptor.get("XHeight"); + if (typeof xHeight !== "number") { + xHeight = 0; + } + let capHeight = descriptor.get("CapHeight"); + if (typeof capHeight !== "number") { + capHeight = 0; + } + let flags = descriptor.get("Flags"); + if (!Number.isInteger(flags)) { + flags = 0; + } + let italicAngle = descriptor.get("ItalicAngle"); + if (typeof italicAngle !== "number") { + italicAngle = 0; + } + const properties = { + type, + name: fontName.name, + subtype, + file: fontFile, + length1, + length2, + length3, + isInternalFont, + loadedName: baseDict.loadedName, + composite, + fixedPitch: false, + fontMatrix, + firstChar, + lastChar, + toUnicode, + bbox, + ascent, + descent, + xHeight, + capHeight, + flags, + italicAngle, + isType3Font, + cssFontInfo, + scaleFactors: glyphScaleFactors, + systemFontInfo + }; + if (composite) { + const cidEncoding = baseDict.get("Encoding"); + if (cidEncoding instanceof Name) { + properties.cidEncoding = cidEncoding.name; + } + const cMap = await CMapFactory.create({ + encoding: cidEncoding, + fetchBuiltInCMap: this._fetchBuiltInCMapBound, + useCMap: null + }); + properties.cMap = cMap; + properties.vertical = properties.cMap.vertical; + } + const newProperties = await this.extractDataStructures(dict, properties); + this.extractWidths(dict, descriptor, newProperties); + return new Font(fontName.name, fontFile, newProperties); + } + static buildFontPaths(font, glyphs, handler, evaluatorOptions) { + function buildPath(fontChar) { + const glyphName = `${font.loadedName}_path_${fontChar}`; + try { + if (font.renderer.hasBuiltPath(fontChar)) { + return; + } + handler.send("commonobj", [glyphName, "FontPath", font.renderer.getPathJs(fontChar)]); + } catch (reason) { + if (evaluatorOptions.ignoreErrors) { + warn(`buildFontPaths - ignoring ${glyphName} glyph: "${reason}".`); + return; + } + throw reason; + } + } + for (const glyph of glyphs) { + buildPath(glyph.fontChar); + const accent = glyph.accent; + if (accent?.fontChar) { + buildPath(accent.fontChar); + } + } + } + static get fallbackFontDict() { + const dict = new Dict(); + dict.set("BaseFont", Name.get("Helvetica")); + dict.set("Type", Name.get("FallbackType")); + dict.set("Subtype", Name.get("FallbackType")); + dict.set("Encoding", Name.get("WinAnsiEncoding")); + return shadow(this, "fallbackFontDict", dict); + } +} +class TranslatedFont { + constructor({ + loadedName, + font, + dict, + evaluatorOptions + }) { + this.loadedName = loadedName; + this.font = font; + this.dict = dict; + this._evaluatorOptions = evaluatorOptions || DefaultPartialEvaluatorOptions; + this.type3Loaded = null; + this.type3Dependencies = font.isType3Font ? new Set() : null; + this.sent = false; + } + send(handler) { + if (this.sent) { + return; + } + this.sent = true; + handler.send("commonobj", [this.loadedName, "Font", this.font.exportData(this._evaluatorOptions.fontExtraProperties)]); + } + fallback(handler) { + if (!this.font.data) { + return; + } + this.font.disableFontFace = true; + PartialEvaluator.buildFontPaths(this.font, this.font.glyphCacheValues, handler, this._evaluatorOptions); + } + loadType3Data(evaluator, resources, task) { + if (this.type3Loaded) { + return this.type3Loaded; + } + if (!this.font.isType3Font) { + throw new Error("Must be a Type3 font."); + } + const type3Evaluator = evaluator.clone({ + ignoreErrors: false + }); + const type3FontRefs = new RefSet(evaluator.type3FontRefs); + if (this.dict.objId && !type3FontRefs.has(this.dict.objId)) { + type3FontRefs.put(this.dict.objId); + } + type3Evaluator.type3FontRefs = type3FontRefs; + const translatedFont = this.font, + type3Dependencies = this.type3Dependencies; + let loadCharProcsPromise = Promise.resolve(); + const charProcs = this.dict.get("CharProcs"); + const fontResources = this.dict.get("Resources") || resources; + const charProcOperatorList = Object.create(null); + const fontBBox = Util.normalizeRect(translatedFont.bbox || [0, 0, 0, 0]), + width = fontBBox[2] - fontBBox[0], + height = fontBBox[3] - fontBBox[1]; + const fontBBoxSize = Math.hypot(width, height); + for (const key of charProcs.getKeys()) { + loadCharProcsPromise = loadCharProcsPromise.then(() => { + const glyphStream = charProcs.get(key); + const operatorList = new OperatorList(); + return type3Evaluator.getOperatorList({ + stream: glyphStream, + task, + resources: fontResources, + operatorList + }).then(() => { + if (operatorList.fnArray[0] === OPS.setCharWidthAndBounds) { + this._removeType3ColorOperators(operatorList, fontBBoxSize); + } + charProcOperatorList[key] = operatorList.getIR(); + for (const dependency of operatorList.dependencies) { + type3Dependencies.add(dependency); + } + }).catch(function (reason) { + warn(`Type3 font resource "${key}" is not available.`); + const dummyOperatorList = new OperatorList(); + charProcOperatorList[key] = dummyOperatorList.getIR(); + }); + }); + } + this.type3Loaded = loadCharProcsPromise.then(() => { + translatedFont.charProcOperatorList = charProcOperatorList; + if (this._bbox) { + translatedFont.isCharBBox = true; + translatedFont.bbox = this._bbox; + } + }); + return this.type3Loaded; + } + _removeType3ColorOperators(operatorList, fontBBoxSize = NaN) { + const charBBox = Util.normalizeRect(operatorList.argsArray[0].slice(2)), + width = charBBox[2] - charBBox[0], + height = charBBox[3] - charBBox[1]; + const charBBoxSize = Math.hypot(width, height); + if (width === 0 || height === 0) { + operatorList.fnArray.splice(0, 1); + operatorList.argsArray.splice(0, 1); + } else if (fontBBoxSize === 0 || Math.round(charBBoxSize / fontBBoxSize) >= 10) { + if (!this._bbox) { + this._bbox = [Infinity, Infinity, -Infinity, -Infinity]; + } + this._bbox[0] = Math.min(this._bbox[0], charBBox[0]); + this._bbox[1] = Math.min(this._bbox[1], charBBox[1]); + this._bbox[2] = Math.max(this._bbox[2], charBBox[2]); + this._bbox[3] = Math.max(this._bbox[3], charBBox[3]); + } + let i = 0, + ii = operatorList.length; + while (i < ii) { + switch (operatorList.fnArray[i]) { + case OPS.setCharWidthAndBounds: + break; + case OPS.setStrokeColorSpace: + case OPS.setFillColorSpace: + case OPS.setStrokeColor: + case OPS.setStrokeColorN: + case OPS.setFillColor: + case OPS.setFillColorN: + case OPS.setStrokeGray: + case OPS.setFillGray: + case OPS.setStrokeRGBColor: + case OPS.setFillRGBColor: + case OPS.setStrokeCMYKColor: + case OPS.setFillCMYKColor: + case OPS.shadingFill: + case OPS.setRenderingIntent: + operatorList.fnArray.splice(i, 1); + operatorList.argsArray.splice(i, 1); + ii--; + continue; + case OPS.setGState: + const [gStateObj] = operatorList.argsArray[i]; + let j = 0, + jj = gStateObj.length; + while (j < jj) { + const [gStateKey] = gStateObj[j]; + switch (gStateKey) { + case "TR": + case "TR2": + case "HT": + case "BG": + case "BG2": + case "UCR": + case "UCR2": + gStateObj.splice(j, 1); + jj--; + continue; + } + j++; + } + break; + } + i++; + } + } +} +class StateManager { + constructor(initialState = new EvalState()) { + this.state = initialState; + this.stateStack = []; + } + save() { + const old = this.state; + this.stateStack.push(this.state); + this.state = old.clone(); + } + restore() { + const prev = this.stateStack.pop(); + if (prev) { + this.state = prev; + } + } + transform(args) { + this.state.ctm = Util.transform(this.state.ctm, args); + } +} +class TextState { + constructor() { + this.ctm = new Float32Array(IDENTITY_MATRIX); + this.fontName = null; + this.fontSize = 0; + this.loadedName = null; + this.font = null; + this.fontMatrix = FONT_IDENTITY_MATRIX; + this.textMatrix = IDENTITY_MATRIX.slice(); + this.textLineMatrix = IDENTITY_MATRIX.slice(); + this.charSpacing = 0; + this.wordSpacing = 0; + this.leading = 0; + this.textHScale = 1; + this.textRise = 0; + } + setTextMatrix(a, b, c, d, e, f) { + const m = this.textMatrix; + m[0] = a; + m[1] = b; + m[2] = c; + m[3] = d; + m[4] = e; + m[5] = f; + } + setTextLineMatrix(a, b, c, d, e, f) { + const m = this.textLineMatrix; + m[0] = a; + m[1] = b; + m[2] = c; + m[3] = d; + m[4] = e; + m[5] = f; + } + translateTextMatrix(x, y) { + const m = this.textMatrix; + m[4] = m[0] * x + m[2] * y + m[4]; + m[5] = m[1] * x + m[3] * y + m[5]; + } + translateTextLineMatrix(x, y) { + const m = this.textLineMatrix; + m[4] = m[0] * x + m[2] * y + m[4]; + m[5] = m[1] * x + m[3] * y + m[5]; + } + carriageReturn() { + this.translateTextLineMatrix(0, -this.leading); + this.textMatrix = this.textLineMatrix.slice(); + } + clone() { + const clone = Object.create(this); + clone.textMatrix = this.textMatrix.slice(); + clone.textLineMatrix = this.textLineMatrix.slice(); + clone.fontMatrix = this.fontMatrix.slice(); + return clone; + } +} +class EvalState { + constructor() { + this.ctm = new Float32Array(IDENTITY_MATRIX); + this.font = null; + this.textRenderingMode = TextRenderingMode.FILL; + this._fillColorSpace = ColorSpace.singletons.gray; + this._strokeColorSpace = ColorSpace.singletons.gray; + this.patternFillColorSpace = null; + this.patternStrokeColorSpace = null; + } + get fillColorSpace() { + return this._fillColorSpace; + } + set fillColorSpace(colorSpace) { + this._fillColorSpace = this.patternFillColorSpace = colorSpace; + } + get strokeColorSpace() { + return this._strokeColorSpace; + } + set strokeColorSpace(colorSpace) { + this._strokeColorSpace = this.patternStrokeColorSpace = colorSpace; + } + clone() { + return Object.create(this); + } +} +class EvaluatorPreprocessor { + static get opMap() { + return shadow(this, "opMap", Object.assign(Object.create(null), { + w: { + id: OPS.setLineWidth, + numArgs: 1, + variableArgs: false + }, + J: { + id: OPS.setLineCap, + numArgs: 1, + variableArgs: false + }, + j: { + id: OPS.setLineJoin, + numArgs: 1, + variableArgs: false + }, + M: { + id: OPS.setMiterLimit, + numArgs: 1, + variableArgs: false + }, + d: { + id: OPS.setDash, + numArgs: 2, + variableArgs: false + }, + ri: { + id: OPS.setRenderingIntent, + numArgs: 1, + variableArgs: false + }, + i: { + id: OPS.setFlatness, + numArgs: 1, + variableArgs: false + }, + gs: { + id: OPS.setGState, + numArgs: 1, + variableArgs: false + }, + q: { + id: OPS.save, + numArgs: 0, + variableArgs: false + }, + Q: { + id: OPS.restore, + numArgs: 0, + variableArgs: false + }, + cm: { + id: OPS.transform, + numArgs: 6, + variableArgs: false + }, + m: { + id: OPS.moveTo, + numArgs: 2, + variableArgs: false + }, + l: { + id: OPS.lineTo, + numArgs: 2, + variableArgs: false + }, + c: { + id: OPS.curveTo, + numArgs: 6, + variableArgs: false + }, + v: { + id: OPS.curveTo2, + numArgs: 4, + variableArgs: false + }, + y: { + id: OPS.curveTo3, + numArgs: 4, + variableArgs: false + }, + h: { + id: OPS.closePath, + numArgs: 0, + variableArgs: false + }, + re: { + id: OPS.rectangle, + numArgs: 4, + variableArgs: false + }, + S: { + id: OPS.stroke, + numArgs: 0, + variableArgs: false + }, + s: { + id: OPS.closeStroke, + numArgs: 0, + variableArgs: false + }, + f: { + id: OPS.fill, + numArgs: 0, + variableArgs: false + }, + F: { + id: OPS.fill, + numArgs: 0, + variableArgs: false + }, + "f*": { + id: OPS.eoFill, + numArgs: 0, + variableArgs: false + }, + B: { + id: OPS.fillStroke, + numArgs: 0, + variableArgs: false + }, + "B*": { + id: OPS.eoFillStroke, + numArgs: 0, + variableArgs: false + }, + b: { + id: OPS.closeFillStroke, + numArgs: 0, + variableArgs: false + }, + "b*": { + id: OPS.closeEOFillStroke, + numArgs: 0, + variableArgs: false + }, + n: { + id: OPS.endPath, + numArgs: 0, + variableArgs: false + }, + W: { + id: OPS.clip, + numArgs: 0, + variableArgs: false + }, + "W*": { + id: OPS.eoClip, + numArgs: 0, + variableArgs: false + }, + BT: { + id: OPS.beginText, + numArgs: 0, + variableArgs: false + }, + ET: { + id: OPS.endText, + numArgs: 0, + variableArgs: false + }, + Tc: { + id: OPS.setCharSpacing, + numArgs: 1, + variableArgs: false + }, + Tw: { + id: OPS.setWordSpacing, + numArgs: 1, + variableArgs: false + }, + Tz: { + id: OPS.setHScale, + numArgs: 1, + variableArgs: false + }, + TL: { + id: OPS.setLeading, + numArgs: 1, + variableArgs: false + }, + Tf: { + id: OPS.setFont, + numArgs: 2, + variableArgs: false + }, + Tr: { + id: OPS.setTextRenderingMode, + numArgs: 1, + variableArgs: false + }, + Ts: { + id: OPS.setTextRise, + numArgs: 1, + variableArgs: false + }, + Td: { + id: OPS.moveText, + numArgs: 2, + variableArgs: false + }, + TD: { + id: OPS.setLeadingMoveText, + numArgs: 2, + variableArgs: false + }, + Tm: { + id: OPS.setTextMatrix, + numArgs: 6, + variableArgs: false + }, + "T*": { + id: OPS.nextLine, + numArgs: 0, + variableArgs: false + }, + Tj: { + id: OPS.showText, + numArgs: 1, + variableArgs: false + }, + TJ: { + id: OPS.showSpacedText, + numArgs: 1, + variableArgs: false + }, + "'": { + id: OPS.nextLineShowText, + numArgs: 1, + variableArgs: false + }, + '"': { + id: OPS.nextLineSetSpacingShowText, + numArgs: 3, + variableArgs: false + }, + d0: { + id: OPS.setCharWidth, + numArgs: 2, + variableArgs: false + }, + d1: { + id: OPS.setCharWidthAndBounds, + numArgs: 6, + variableArgs: false + }, + CS: { + id: OPS.setStrokeColorSpace, + numArgs: 1, + variableArgs: false + }, + cs: { + id: OPS.setFillColorSpace, + numArgs: 1, + variableArgs: false + }, + SC: { + id: OPS.setStrokeColor, + numArgs: 4, + variableArgs: true + }, + SCN: { + id: OPS.setStrokeColorN, + numArgs: 33, + variableArgs: true + }, + sc: { + id: OPS.setFillColor, + numArgs: 4, + variableArgs: true + }, + scn: { + id: OPS.setFillColorN, + numArgs: 33, + variableArgs: true + }, + G: { + id: OPS.setStrokeGray, + numArgs: 1, + variableArgs: false + }, + g: { + id: OPS.setFillGray, + numArgs: 1, + variableArgs: false + }, + RG: { + id: OPS.setStrokeRGBColor, + numArgs: 3, + variableArgs: false + }, + rg: { + id: OPS.setFillRGBColor, + numArgs: 3, + variableArgs: false + }, + K: { + id: OPS.setStrokeCMYKColor, + numArgs: 4, + variableArgs: false + }, + k: { + id: OPS.setFillCMYKColor, + numArgs: 4, + variableArgs: false + }, + sh: { + id: OPS.shadingFill, + numArgs: 1, + variableArgs: false + }, + BI: { + id: OPS.beginInlineImage, + numArgs: 0, + variableArgs: false + }, + ID: { + id: OPS.beginImageData, + numArgs: 0, + variableArgs: false + }, + EI: { + id: OPS.endInlineImage, + numArgs: 1, + variableArgs: false + }, + Do: { + id: OPS.paintXObject, + numArgs: 1, + variableArgs: false + }, + MP: { + id: OPS.markPoint, + numArgs: 1, + variableArgs: false + }, + DP: { + id: OPS.markPointProps, + numArgs: 2, + variableArgs: false + }, + BMC: { + id: OPS.beginMarkedContent, + numArgs: 1, + variableArgs: false + }, + BDC: { + id: OPS.beginMarkedContentProps, + numArgs: 2, + variableArgs: false + }, + EMC: { + id: OPS.endMarkedContent, + numArgs: 0, + variableArgs: false + }, + BX: { + id: OPS.beginCompat, + numArgs: 0, + variableArgs: false + }, + EX: { + id: OPS.endCompat, + numArgs: 0, + variableArgs: false + }, + BM: null, + BD: null, + true: null, + fa: null, + fal: null, + fals: null, + false: null, + nu: null, + nul: null, + null: null + })); + } + static MAX_INVALID_PATH_OPS = 10; + constructor(stream, xref, stateManager = new StateManager()) { + this.parser = new Parser({ + lexer: new Lexer(stream, EvaluatorPreprocessor.opMap), + xref + }); + this.stateManager = stateManager; + this.nonProcessedArgs = []; + this._isPathOp = false; + this._numInvalidPathOPS = 0; + } + get savedStatesDepth() { + return this.stateManager.stateStack.length; + } + read(operation) { + let args = operation.args; + while (true) { + const obj = this.parser.getObj(); + if (obj instanceof Cmd) { + const cmd = obj.cmd; + const opSpec = EvaluatorPreprocessor.opMap[cmd]; + if (!opSpec) { + warn(`Unknown command "${cmd}".`); + continue; + } + const fn = opSpec.id; + const numArgs = opSpec.numArgs; + let argsLength = args !== null ? args.length : 0; + if (!this._isPathOp) { + this._numInvalidPathOPS = 0; + } + this._isPathOp = fn >= OPS.moveTo && fn <= OPS.endPath; + if (!opSpec.variableArgs) { + if (argsLength !== numArgs) { + const nonProcessedArgs = this.nonProcessedArgs; + while (argsLength > numArgs) { + nonProcessedArgs.push(args.shift()); + argsLength--; + } + while (argsLength < numArgs && nonProcessedArgs.length !== 0) { + if (args === null) { + args = []; + } + args.unshift(nonProcessedArgs.pop()); + argsLength++; + } + } + if (argsLength < numArgs) { + const partialMsg = `command ${cmd}: expected ${numArgs} args, ` + `but received ${argsLength} args.`; + if (this._isPathOp && ++this._numInvalidPathOPS > EvaluatorPreprocessor.MAX_INVALID_PATH_OPS) { + throw new FormatError(`Invalid ${partialMsg}`); + } + warn(`Skipping ${partialMsg}`); + if (args !== null) { + args.length = 0; + } + continue; + } + } else if (argsLength > numArgs) { + info(`Command ${cmd}: expected [0, ${numArgs}] args, ` + `but received ${argsLength} args.`); + } + this.preprocessCommand(fn, args); + operation.fn = fn; + operation.args = args; + return true; + } + if (obj === EOF) { + return false; + } + if (obj !== null) { + if (args === null) { + args = []; + } + args.push(obj); + if (args.length > 33) { + throw new FormatError("Too many arguments"); + } + } + } + } + preprocessCommand(fn, args) { + switch (fn | 0) { + case OPS.save: + this.stateManager.save(); + break; + case OPS.restore: + this.stateManager.restore(); + break; + case OPS.transform: + this.stateManager.transform(args); + break; + } + } +} + +;// ./src/core/default_appearance.js + + + + + + + + +class DefaultAppearanceEvaluator extends EvaluatorPreprocessor { + constructor(str) { + super(new StringStream(str)); + } + parse() { + const operation = { + fn: 0, + args: [] + }; + const result = { + fontSize: 0, + fontName: "", + fontColor: new Uint8ClampedArray(3) + }; + try { + while (true) { + operation.args.length = 0; + if (!this.read(operation)) { + break; + } + if (this.savedStatesDepth !== 0) { + continue; + } + const { + fn, + args + } = operation; + switch (fn | 0) { + case OPS.setFont: + const [fontName, fontSize] = args; + if (fontName instanceof Name) { + result.fontName = fontName.name; + } + if (typeof fontSize === "number" && fontSize > 0) { + result.fontSize = fontSize; + } + break; + case OPS.setFillRGBColor: + ColorSpace.singletons.rgb.getRgbItem(args, 0, result.fontColor, 0); + break; + case OPS.setFillGray: + ColorSpace.singletons.gray.getRgbItem(args, 0, result.fontColor, 0); + break; + case OPS.setFillCMYKColor: + ColorSpace.singletons.cmyk.getRgbItem(args, 0, result.fontColor, 0); + break; + } + } + } catch (reason) { + warn(`parseDefaultAppearance - ignoring errors: "${reason}".`); + } + return result; + } +} +function parseDefaultAppearance(str) { + return new DefaultAppearanceEvaluator(str).parse(); +} +class AppearanceStreamEvaluator extends EvaluatorPreprocessor { + constructor(stream, evaluatorOptions, xref) { + super(stream); + this.stream = stream; + this.evaluatorOptions = evaluatorOptions; + this.xref = xref; + this.resources = stream.dict?.get("Resources"); + } + parse() { + const operation = { + fn: 0, + args: [] + }; + let result = { + scaleFactor: 1, + fontSize: 0, + fontName: "", + fontColor: new Uint8ClampedArray(3), + fillColorSpace: ColorSpace.singletons.gray + }; + let breakLoop = false; + const stack = []; + try { + while (true) { + operation.args.length = 0; + if (breakLoop || !this.read(operation)) { + break; + } + const { + fn, + args + } = operation; + switch (fn | 0) { + case OPS.save: + stack.push({ + scaleFactor: result.scaleFactor, + fontSize: result.fontSize, + fontName: result.fontName, + fontColor: result.fontColor.slice(), + fillColorSpace: result.fillColorSpace + }); + break; + case OPS.restore: + result = stack.pop() || result; + break; + case OPS.setTextMatrix: + result.scaleFactor *= Math.hypot(args[0], args[1]); + break; + case OPS.setFont: + const [fontName, fontSize] = args; + if (fontName instanceof Name) { + result.fontName = fontName.name; + } + if (typeof fontSize === "number" && fontSize > 0) { + result.fontSize = fontSize * result.scaleFactor; + } + break; + case OPS.setFillColorSpace: + result.fillColorSpace = ColorSpace.parse({ + cs: args[0], + xref: this.xref, + resources: this.resources, + pdfFunctionFactory: this._pdfFunctionFactory, + localColorSpaceCache: this._localColorSpaceCache + }); + break; + case OPS.setFillColor: + const cs = result.fillColorSpace; + cs.getRgbItem(args, 0, result.fontColor, 0); + break; + case OPS.setFillRGBColor: + ColorSpace.singletons.rgb.getRgbItem(args, 0, result.fontColor, 0); + break; + case OPS.setFillGray: + ColorSpace.singletons.gray.getRgbItem(args, 0, result.fontColor, 0); + break; + case OPS.setFillCMYKColor: + ColorSpace.singletons.cmyk.getRgbItem(args, 0, result.fontColor, 0); + break; + case OPS.showText: + case OPS.showSpacedText: + case OPS.nextLineShowText: + case OPS.nextLineSetSpacingShowText: + breakLoop = true; + break; + } + } + } catch (reason) { + warn(`parseAppearanceStream - ignoring errors: "${reason}".`); + } + this.stream.reset(); + delete result.scaleFactor; + delete result.fillColorSpace; + return result; + } + get _localColorSpaceCache() { + return shadow(this, "_localColorSpaceCache", new LocalColorSpaceCache()); + } + get _pdfFunctionFactory() { + const pdfFunctionFactory = new PDFFunctionFactory({ + xref: this.xref, + isEvalSupported: this.evaluatorOptions.isEvalSupported + }); + return shadow(this, "_pdfFunctionFactory", pdfFunctionFactory); + } +} +function parseAppearanceStream(stream, evaluatorOptions, xref) { + return new AppearanceStreamEvaluator(stream, evaluatorOptions, xref).parse(); +} +function getPdfColor(color, isFill) { + if (color[0] === color[1] && color[1] === color[2]) { + const gray = color[0] / 255; + return `${numberToString(gray)} ${isFill ? "g" : "G"}`; + } + return Array.from(color, c => numberToString(c / 255)).join(" ") + ` ${isFill ? "rg" : "RG"}`; +} +function createDefaultAppearance({ + fontSize, + fontName, + fontColor +}) { + return `/${escapePDFName(fontName)} ${fontSize} Tf ${getPdfColor(fontColor, true)}`; +} +class FakeUnicodeFont { + constructor(xref, fontFamily) { + this.xref = xref; + this.widths = null; + this.firstChar = Infinity; + this.lastChar = -Infinity; + this.fontFamily = fontFamily; + const canvas = new OffscreenCanvas(1, 1); + this.ctxMeasure = canvas.getContext("2d", { + willReadFrequently: true + }); + if (!FakeUnicodeFont._fontNameId) { + FakeUnicodeFont._fontNameId = 1; + } + this.fontName = Name.get(`InvalidPDFjsFont_${fontFamily}_${FakeUnicodeFont._fontNameId++}`); + } + get fontDescriptorRef() { + if (!FakeUnicodeFont._fontDescriptorRef) { + const fontDescriptor = new Dict(this.xref); + fontDescriptor.set("Type", Name.get("FontDescriptor")); + fontDescriptor.set("FontName", this.fontName); + fontDescriptor.set("FontFamily", "MyriadPro Regular"); + fontDescriptor.set("FontBBox", [0, 0, 0, 0]); + fontDescriptor.set("FontStretch", Name.get("Normal")); + fontDescriptor.set("FontWeight", 400); + fontDescriptor.set("ItalicAngle", 0); + FakeUnicodeFont._fontDescriptorRef = this.xref.getNewPersistentRef(fontDescriptor); + } + return FakeUnicodeFont._fontDescriptorRef; + } + get descendantFontRef() { + const descendantFont = new Dict(this.xref); + descendantFont.set("BaseFont", this.fontName); + descendantFont.set("Type", Name.get("Font")); + descendantFont.set("Subtype", Name.get("CIDFontType0")); + descendantFont.set("CIDToGIDMap", Name.get("Identity")); + descendantFont.set("FirstChar", this.firstChar); + descendantFont.set("LastChar", this.lastChar); + descendantFont.set("FontDescriptor", this.fontDescriptorRef); + descendantFont.set("DW", 1000); + const widths = []; + const chars = [...this.widths.entries()].sort(); + let currentChar = null; + let currentWidths = null; + for (const [char, width] of chars) { + if (!currentChar) { + currentChar = char; + currentWidths = [width]; + continue; + } + if (char === currentChar + currentWidths.length) { + currentWidths.push(width); + } else { + widths.push(currentChar, currentWidths); + currentChar = char; + currentWidths = [width]; + } + } + if (currentChar) { + widths.push(currentChar, currentWidths); + } + descendantFont.set("W", widths); + const cidSystemInfo = new Dict(this.xref); + cidSystemInfo.set("Ordering", "Identity"); + cidSystemInfo.set("Registry", "Adobe"); + cidSystemInfo.set("Supplement", 0); + descendantFont.set("CIDSystemInfo", cidSystemInfo); + return this.xref.getNewPersistentRef(descendantFont); + } + get baseFontRef() { + const baseFont = new Dict(this.xref); + baseFont.set("BaseFont", this.fontName); + baseFont.set("Type", Name.get("Font")); + baseFont.set("Subtype", Name.get("Type0")); + baseFont.set("Encoding", Name.get("Identity-H")); + baseFont.set("DescendantFonts", [this.descendantFontRef]); + baseFont.set("ToUnicode", Name.get("Identity-H")); + return this.xref.getNewPersistentRef(baseFont); + } + get resources() { + const resources = new Dict(this.xref); + const font = new Dict(this.xref); + font.set(this.fontName.name, this.baseFontRef); + resources.set("Font", font); + return resources; + } + _createContext() { + this.widths = new Map(); + this.ctxMeasure.font = `1000px ${this.fontFamily}`; + return this.ctxMeasure; + } + createFontResources(text) { + const ctx = this._createContext(); + for (const line of text.split(/\r\n?|\n/)) { + for (const char of line.split("")) { + const code = char.charCodeAt(0); + if (this.widths.has(code)) { + continue; + } + const metrics = ctx.measureText(char); + const width = Math.ceil(metrics.width); + this.widths.set(code, width); + this.firstChar = Math.min(code, this.firstChar); + this.lastChar = Math.max(code, this.lastChar); + } + } + return this.resources; + } + static getFirstPositionInfo(rect, rotation, fontSize) { + const [x1, y1, x2, y2] = rect; + let w = x2 - x1; + let h = y2 - y1; + if (rotation % 180 !== 0) { + [w, h] = [h, w]; + } + const lineHeight = LINE_FACTOR * fontSize; + const lineDescent = LINE_DESCENT_FACTOR * fontSize; + return { + coords: [0, h + lineDescent - lineHeight], + bbox: [0, 0, w, h], + matrix: rotation !== 0 ? getRotationMatrix(rotation, h, lineHeight) : undefined + }; + } + createAppearance(text, rect, rotation, fontSize, bgColor, strokeAlpha) { + const ctx = this._createContext(); + const lines = []; + let maxWidth = -Infinity; + for (const line of text.split(/\r\n?|\n/)) { + lines.push(line); + const lineWidth = ctx.measureText(line).width; + maxWidth = Math.max(maxWidth, lineWidth); + for (const code of codePointIter(line)) { + const char = String.fromCodePoint(code); + let width = this.widths.get(code); + if (width === undefined) { + const metrics = ctx.measureText(char); + width = Math.ceil(metrics.width); + this.widths.set(code, width); + this.firstChar = Math.min(code, this.firstChar); + this.lastChar = Math.max(code, this.lastChar); + } + } + } + maxWidth *= fontSize / 1000; + const [x1, y1, x2, y2] = rect; + let w = x2 - x1; + let h = y2 - y1; + if (rotation % 180 !== 0) { + [w, h] = [h, w]; + } + let hscale = 1; + if (maxWidth > w) { + hscale = w / maxWidth; + } + let vscale = 1; + const lineHeight = LINE_FACTOR * fontSize; + const lineDescent = LINE_DESCENT_FACTOR * fontSize; + const maxHeight = lineHeight * lines.length; + if (maxHeight > h) { + vscale = h / maxHeight; + } + const fscale = Math.min(hscale, vscale); + const newFontSize = fontSize * fscale; + const buffer = ["q", `0 0 ${numberToString(w)} ${numberToString(h)} re W n`, `BT`, `1 0 0 1 0 ${numberToString(h + lineDescent)} Tm 0 Tc ${getPdfColor(bgColor, true)}`, `/${this.fontName.name} ${numberToString(newFontSize)} Tf`]; + const { + resources + } = this; + strokeAlpha = typeof strokeAlpha === "number" && strokeAlpha >= 0 && strokeAlpha <= 1 ? strokeAlpha : 1; + if (strokeAlpha !== 1) { + buffer.push("/R0 gs"); + const extGState = new Dict(this.xref); + const r0 = new Dict(this.xref); + r0.set("ca", strokeAlpha); + r0.set("CA", strokeAlpha); + r0.set("Type", Name.get("ExtGState")); + extGState.set("R0", r0); + resources.set("ExtGState", extGState); + } + const vShift = numberToString(lineHeight); + for (const line of lines) { + buffer.push(`0 -${vShift} Td <${stringToUTF16HexString(line)}> Tj`); + } + buffer.push("ET", "Q"); + const appearance = buffer.join("\n"); + const appearanceStreamDict = new Dict(this.xref); + appearanceStreamDict.set("Subtype", Name.get("Form")); + appearanceStreamDict.set("Type", Name.get("XObject")); + appearanceStreamDict.set("BBox", [0, 0, w, h]); + appearanceStreamDict.set("Length", appearance.length); + appearanceStreamDict.set("Resources", resources); + if (rotation) { + const matrix = getRotationMatrix(rotation, w, h); + appearanceStreamDict.set("Matrix", matrix); + } + const ap = new StringStream(appearance); + ap.dict = appearanceStreamDict; + return ap; + } +} + +;// ./src/core/name_number_tree.js + + +class NameOrNumberTree { + constructor(root, xref, type) { + this.root = root; + this.xref = xref; + this._type = type; + } + getAll() { + const map = new Map(); + if (!this.root) { + return map; + } + const xref = this.xref; + const processed = new RefSet(); + processed.put(this.root); + const queue = [this.root]; + while (queue.length > 0) { + const obj = xref.fetchIfRef(queue.shift()); + if (!(obj instanceof Dict)) { + continue; + } + if (obj.has("Kids")) { + const kids = obj.get("Kids"); + if (!Array.isArray(kids)) { + continue; + } + for (const kid of kids) { + if (processed.has(kid)) { + throw new FormatError(`Duplicate entry in "${this._type}" tree.`); + } + queue.push(kid); + processed.put(kid); + } + continue; + } + const entries = obj.get(this._type); + if (!Array.isArray(entries)) { + continue; + } + for (let i = 0, ii = entries.length; i < ii; i += 2) { + map.set(xref.fetchIfRef(entries[i]), xref.fetchIfRef(entries[i + 1])); + } + } + return map; + } + getRaw(key) { + if (!this.root) { + return null; + } + const xref = this.xref; + let kidsOrEntries = xref.fetchIfRef(this.root); + let loopCount = 0; + const MAX_LEVELS = 10; + while (kidsOrEntries.has("Kids")) { + if (++loopCount > MAX_LEVELS) { + warn(`Search depth limit reached for "${this._type}" tree.`); + return null; + } + const kids = kidsOrEntries.get("Kids"); + if (!Array.isArray(kids)) { + return null; + } + let l = 0, + r = kids.length - 1; + while (l <= r) { + const m = l + r >> 1; + const kid = xref.fetchIfRef(kids[m]); + const limits = kid.get("Limits"); + if (key < xref.fetchIfRef(limits[0])) { + r = m - 1; + } else if (key > xref.fetchIfRef(limits[1])) { + l = m + 1; + } else { + kidsOrEntries = kid; + break; + } + } + if (l > r) { + return null; + } + } + const entries = kidsOrEntries.get(this._type); + if (Array.isArray(entries)) { + let l = 0, + r = entries.length - 2; + while (l <= r) { + const tmp = l + r >> 1, + m = tmp + (tmp & 1); + const currentKey = xref.fetchIfRef(entries[m]); + if (key < currentKey) { + r = m - 2; + } else if (key > currentKey) { + l = m + 2; + } else { + return entries[m + 1]; + } + } + } + return null; + } + get(key) { + return this.xref.fetchIfRef(this.getRaw(key)); + } +} +class NameTree extends NameOrNumberTree { + constructor(root, xref) { + super(root, xref, "Names"); + } +} +class NumberTree extends NameOrNumberTree { + constructor(root, xref) { + super(root, xref, "Nums"); + } +} + +;// ./src/core/cleanup_helper.js + + + + +function clearGlobalCaches() { + clearPatternCaches(); + clearPrimitiveCaches(); + clearUnicodeCaches(); + JpxImage.cleanup(); +} + +;// ./src/core/file_spec.js + + + +function pickPlatformItem(dict) { + if (!(dict instanceof Dict)) { + return null; + } + if (dict.has("UF")) { + return dict.get("UF"); + } else if (dict.has("F")) { + return dict.get("F"); + } else if (dict.has("Unix")) { + return dict.get("Unix"); + } else if (dict.has("Mac")) { + return dict.get("Mac"); + } else if (dict.has("DOS")) { + return dict.get("DOS"); + } + return null; +} +function stripPath(str) { + return str.substring(str.lastIndexOf("/") + 1); +} +class FileSpec { + #contentAvailable = false; + constructor(root, xref, skipContent = false) { + if (!(root instanceof Dict)) { + return; + } + this.xref = xref; + this.root = root; + if (root.has("FS")) { + this.fs = root.get("FS"); + } + if (root.has("RF")) { + warn("Related file specifications are not supported"); + } + if (!skipContent) { + if (root.has("EF")) { + this.#contentAvailable = true; + } else { + warn("Non-embedded file specifications are not supported"); + } + } + } + get filename() { + let filename = ""; + const item = pickPlatformItem(this.root); + if (item && typeof item === "string") { + filename = stringToPDFString(item).replaceAll("\\\\", "\\").replaceAll("\\/", "/").replaceAll("\\", "/"); + } + return shadow(this, "filename", filename || "unnamed"); + } + get content() { + if (!this.#contentAvailable) { + return null; + } + this._contentRef ||= pickPlatformItem(this.root?.get("EF")); + let content = null; + if (this._contentRef) { + const fileObj = this.xref.fetchIfRef(this._contentRef); + if (fileObj instanceof BaseStream) { + content = fileObj.getBytes(); + } else { + warn("Embedded file specification points to non-existing/invalid content"); + } + } else { + warn("Embedded file specification does not have any content"); + } + return content; + } + get description() { + let description = ""; + const desc = this.root?.get("Desc"); + if (desc && typeof desc === "string") { + description = stringToPDFString(desc); + } + return shadow(this, "description", description); + } + get serializable() { + return { + rawFilename: this.filename, + filename: stripPath(this.filename), + content: this.content, + description: this.description + }; + } +} + +;// ./src/core/xml_parser.js + +const XMLParserErrorCode = { + NoError: 0, + EndOfDocument: -1, + UnterminatedCdat: -2, + UnterminatedXmlDeclaration: -3, + UnterminatedDoctypeDeclaration: -4, + UnterminatedComment: -5, + MalformedElement: -6, + OutOfMemory: -7, + UnterminatedAttributeValue: -8, + UnterminatedElement: -9, + ElementNeverBegun: -10 +}; +function isWhitespace(s, index) { + const ch = s[index]; + return ch === " " || ch === "\n" || ch === "\r" || ch === "\t"; +} +function isWhitespaceString(s) { + for (let i = 0, ii = s.length; i < ii; i++) { + if (!isWhitespace(s, i)) { + return false; + } + } + return true; +} +class XMLParserBase { + _resolveEntities(s) { + return s.replaceAll(/&([^;]+);/g, (all, entity) => { + if (entity.substring(0, 2) === "#x") { + return String.fromCodePoint(parseInt(entity.substring(2), 16)); + } else if (entity.substring(0, 1) === "#") { + return String.fromCodePoint(parseInt(entity.substring(1), 10)); + } + switch (entity) { + case "lt": + return "<"; + case "gt": + return ">"; + case "amp": + return "&"; + case "quot": + return '"'; + case "apos": + return "'"; + } + return this.onResolveEntity(entity); + }); + } + _parseContent(s, start) { + const attributes = []; + let pos = start; + function skipWs() { + while (pos < s.length && isWhitespace(s, pos)) { + ++pos; + } + } + while (pos < s.length && !isWhitespace(s, pos) && s[pos] !== ">" && s[pos] !== "/") { + ++pos; + } + const name = s.substring(start, pos); + skipWs(); + while (pos < s.length && s[pos] !== ">" && s[pos] !== "/" && s[pos] !== "?") { + skipWs(); + let attrName = "", + attrValue = ""; + while (pos < s.length && !isWhitespace(s, pos) && s[pos] !== "=") { + attrName += s[pos]; + ++pos; + } + skipWs(); + if (s[pos] !== "=") { + return null; + } + ++pos; + skipWs(); + const attrEndChar = s[pos]; + if (attrEndChar !== '"' && attrEndChar !== "'") { + return null; + } + const attrEndIndex = s.indexOf(attrEndChar, ++pos); + if (attrEndIndex < 0) { + return null; + } + attrValue = s.substring(pos, attrEndIndex); + attributes.push({ + name: attrName, + value: this._resolveEntities(attrValue) + }); + pos = attrEndIndex + 1; + skipWs(); + } + return { + name, + attributes, + parsed: pos - start + }; + } + _parseProcessingInstruction(s, start) { + let pos = start; + function skipWs() { + while (pos < s.length && isWhitespace(s, pos)) { + ++pos; + } + } + while (pos < s.length && !isWhitespace(s, pos) && s[pos] !== ">" && s[pos] !== "?" && s[pos] !== "/") { + ++pos; + } + const name = s.substring(start, pos); + skipWs(); + const attrStart = pos; + while (pos < s.length && (s[pos] !== "?" || s[pos + 1] !== ">")) { + ++pos; + } + const value = s.substring(attrStart, pos); + return { + name, + value, + parsed: pos - start + }; + } + parseXml(s) { + let i = 0; + while (i < s.length) { + const ch = s[i]; + let j = i; + if (ch === "<") { + ++j; + const ch2 = s[j]; + let q; + switch (ch2) { + case "/": + ++j; + q = s.indexOf(">", j); + if (q < 0) { + this.onError(XMLParserErrorCode.UnterminatedElement); + return; + } + this.onEndElement(s.substring(j, q)); + j = q + 1; + break; + case "?": + ++j; + const pi = this._parseProcessingInstruction(s, j); + if (s.substring(j + pi.parsed, j + pi.parsed + 2) !== "?>") { + this.onError(XMLParserErrorCode.UnterminatedXmlDeclaration); + return; + } + this.onPi(pi.name, pi.value); + j += pi.parsed + 2; + break; + case "!": + if (s.substring(j + 1, j + 3) === "--") { + q = s.indexOf("-->", j + 3); + if (q < 0) { + this.onError(XMLParserErrorCode.UnterminatedComment); + return; + } + this.onComment(s.substring(j + 3, q)); + j = q + 3; + } else if (s.substring(j + 1, j + 8) === "[CDATA[") { + q = s.indexOf("]]>", j + 8); + if (q < 0) { + this.onError(XMLParserErrorCode.UnterminatedCdat); + return; + } + this.onCdata(s.substring(j + 8, q)); + j = q + 3; + } else if (s.substring(j + 1, j + 8) === "DOCTYPE") { + const q2 = s.indexOf("[", j + 8); + let complexDoctype = false; + q = s.indexOf(">", j + 8); + if (q < 0) { + this.onError(XMLParserErrorCode.UnterminatedDoctypeDeclaration); + return; + } + if (q2 > 0 && q > q2) { + q = s.indexOf("]>", j + 8); + if (q < 0) { + this.onError(XMLParserErrorCode.UnterminatedDoctypeDeclaration); + return; + } + complexDoctype = true; + } + const doctypeContent = s.substring(j + 8, q + (complexDoctype ? 1 : 0)); + this.onDoctype(doctypeContent); + j = q + (complexDoctype ? 2 : 1); + } else { + this.onError(XMLParserErrorCode.MalformedElement); + return; + } + break; + default: + const content = this._parseContent(s, j); + if (content === null) { + this.onError(XMLParserErrorCode.MalformedElement); + return; + } + let isClosed = false; + if (s.substring(j + content.parsed, j + content.parsed + 2) === "/>") { + isClosed = true; + } else if (s.substring(j + content.parsed, j + content.parsed + 1) !== ">") { + this.onError(XMLParserErrorCode.UnterminatedElement); + return; + } + this.onBeginElement(content.name, content.attributes, isClosed); + j += content.parsed + (isClosed ? 2 : 1); + break; + } + } else { + while (j < s.length && s[j] !== "<") { + j++; + } + const text = s.substring(i, j); + this.onText(this._resolveEntities(text)); + } + i = j; + } + } + onResolveEntity(name) { + return `&${name};`; + } + onPi(name, value) {} + onComment(text) {} + onCdata(text) {} + onDoctype(doctypeContent) {} + onText(text) {} + onBeginElement(name, attributes, isEmpty) {} + onEndElement(name) {} + onError(code) {} +} +class SimpleDOMNode { + constructor(nodeName, nodeValue) { + this.nodeName = nodeName; + this.nodeValue = nodeValue; + Object.defineProperty(this, "parentNode", { + value: null, + writable: true + }); + } + get firstChild() { + return this.childNodes?.[0]; + } + get nextSibling() { + const childNodes = this.parentNode.childNodes; + if (!childNodes) { + return undefined; + } + const index = childNodes.indexOf(this); + if (index === -1) { + return undefined; + } + return childNodes[index + 1]; + } + get textContent() { + if (!this.childNodes) { + return this.nodeValue || ""; + } + return this.childNodes.map(function (child) { + return child.textContent; + }).join(""); + } + get children() { + return this.childNodes || []; + } + hasChildNodes() { + return this.childNodes?.length > 0; + } + searchNode(paths, pos) { + if (pos >= paths.length) { + return this; + } + const component = paths[pos]; + if (component.name.startsWith("#") && pos < paths.length - 1) { + return this.searchNode(paths, pos + 1); + } + const stack = []; + let node = this; + while (true) { + if (component.name === node.nodeName) { + if (component.pos === 0) { + const res = node.searchNode(paths, pos + 1); + if (res !== null) { + return res; + } + } else if (stack.length === 0) { + return null; + } else { + const [parent] = stack.pop(); + let siblingPos = 0; + for (const child of parent.childNodes) { + if (component.name === child.nodeName) { + if (siblingPos === component.pos) { + return child.searchNode(paths, pos + 1); + } + siblingPos++; + } + } + return node.searchNode(paths, pos + 1); + } + } + if (node.childNodes?.length > 0) { + stack.push([node, 0]); + node = node.childNodes[0]; + } else if (stack.length === 0) { + return null; + } else { + while (stack.length !== 0) { + const [parent, currentPos] = stack.pop(); + const newPos = currentPos + 1; + if (newPos < parent.childNodes.length) { + stack.push([parent, newPos]); + node = parent.childNodes[newPos]; + break; + } + } + if (stack.length === 0) { + return null; + } + } + } + } + dump(buffer) { + if (this.nodeName === "#text") { + buffer.push(encodeToXmlString(this.nodeValue)); + return; + } + buffer.push(`<${this.nodeName}`); + if (this.attributes) { + for (const attribute of this.attributes) { + buffer.push(` ${attribute.name}="${encodeToXmlString(attribute.value)}"`); + } + } + if (this.hasChildNodes()) { + buffer.push(">"); + for (const child of this.childNodes) { + child.dump(buffer); + } + buffer.push(``); + } else if (this.nodeValue) { + buffer.push(`>${encodeToXmlString(this.nodeValue)}`); + } else { + buffer.push("/>"); + } + } +} +class SimpleXMLParser extends XMLParserBase { + constructor({ + hasAttributes = false, + lowerCaseName = false + }) { + super(); + this._currentFragment = null; + this._stack = null; + this._errorCode = XMLParserErrorCode.NoError; + this._hasAttributes = hasAttributes; + this._lowerCaseName = lowerCaseName; + } + parseFromString(data) { + this._currentFragment = []; + this._stack = []; + this._errorCode = XMLParserErrorCode.NoError; + this.parseXml(data); + if (this._errorCode !== XMLParserErrorCode.NoError) { + return undefined; + } + const [documentElement] = this._currentFragment; + if (!documentElement) { + return undefined; + } + return { + documentElement + }; + } + onText(text) { + if (isWhitespaceString(text)) { + return; + } + const node = new SimpleDOMNode("#text", text); + this._currentFragment.push(node); + } + onCdata(text) { + const node = new SimpleDOMNode("#text", text); + this._currentFragment.push(node); + } + onBeginElement(name, attributes, isEmpty) { + if (this._lowerCaseName) { + name = name.toLowerCase(); + } + const node = new SimpleDOMNode(name); + node.childNodes = []; + if (this._hasAttributes) { + node.attributes = attributes; + } + this._currentFragment.push(node); + if (isEmpty) { + return; + } + this._stack.push(this._currentFragment); + this._currentFragment = node.childNodes; + } + onEndElement(name) { + this._currentFragment = this._stack.pop() || []; + const lastElement = this._currentFragment.at(-1); + if (!lastElement) { + return null; + } + for (const childNode of lastElement.childNodes) { + childNode.parentNode = lastElement; + } + return lastElement; + } + onError(code) { + this._errorCode = code; + } +} + +;// ./src/core/metadata_parser.js + +class MetadataParser { + constructor(data) { + data = this._repair(data); + const parser = new SimpleXMLParser({ + lowerCaseName: true + }); + const xmlDocument = parser.parseFromString(data); + this._metadataMap = new Map(); + this._data = data; + if (xmlDocument) { + this._parse(xmlDocument); + } + } + _repair(data) { + return data.replace(/^[^<]+/, "").replaceAll(/>\\376\\377([^<]+)/g, function (all, codes) { + const bytes = codes.replaceAll(/\\([0-3])([0-7])([0-7])/g, function (code, d1, d2, d3) { + return String.fromCharCode(d1 * 64 + d2 * 8 + d3 * 1); + }).replaceAll(/&(amp|apos|gt|lt|quot);/g, function (str, name) { + switch (name) { + case "amp": + return "&"; + case "apos": + return "'"; + case "gt": + return ">"; + case "lt": + return "<"; + case "quot": + return '"'; + } + throw new Error(`_repair: ${name} isn't defined.`); + }); + const charBuf = [">"]; + for (let i = 0, ii = bytes.length; i < ii; i += 2) { + const code = bytes.charCodeAt(i) * 256 + bytes.charCodeAt(i + 1); + if (code >= 32 && code < 127 && code !== 60 && code !== 62 && code !== 38) { + charBuf.push(String.fromCharCode(code)); + } else { + charBuf.push("&#x" + (0x10000 + code).toString(16).substring(1) + ";"); + } + } + return charBuf.join(""); + }); + } + _getSequence(entry) { + const name = entry.nodeName; + if (name !== "rdf:bag" && name !== "rdf:seq" && name !== "rdf:alt") { + return null; + } + return entry.childNodes.filter(node => node.nodeName === "rdf:li"); + } + _parseArray(entry) { + if (!entry.hasChildNodes()) { + return; + } + const [seqNode] = entry.childNodes; + const sequence = this._getSequence(seqNode) || []; + this._metadataMap.set(entry.nodeName, sequence.map(node => node.textContent.trim())); + } + _parse(xmlDocument) { + let rdf = xmlDocument.documentElement; + if (rdf.nodeName !== "rdf:rdf") { + rdf = rdf.firstChild; + while (rdf && rdf.nodeName !== "rdf:rdf") { + rdf = rdf.nextSibling; + } + } + if (!rdf || rdf.nodeName !== "rdf:rdf" || !rdf.hasChildNodes()) { + return; + } + for (const desc of rdf.childNodes) { + if (desc.nodeName !== "rdf:description") { + continue; + } + for (const entry of desc.childNodes) { + const name = entry.nodeName; + switch (name) { + case "#text": + continue; + case "dc:creator": + case "dc:subject": + this._parseArray(entry); + continue; + } + this._metadataMap.set(name, entry.textContent.trim()); + } + } + } + get serializable() { + return { + parsedData: this._metadataMap, + rawData: this._data + }; + } +} + +;// ./src/core/struct_tree.js + + + + +const MAX_DEPTH = 40; +const StructElementType = { + PAGE_CONTENT: 1, + STREAM_CONTENT: 2, + OBJECT: 3, + ANNOTATION: 4, + ELEMENT: 5 +}; +class StructTreeRoot { + constructor(rootDict, rootRef) { + this.dict = rootDict; + this.ref = rootRef instanceof Ref ? rootRef : null; + this.roleMap = new Map(); + this.structParentIds = null; + } + init() { + this.readRoleMap(); + } + #addIdToPage(pageRef, id, type) { + if (!(pageRef instanceof Ref) || id < 0) { + return; + } + this.structParentIds ||= new RefSetCache(); + let ids = this.structParentIds.get(pageRef); + if (!ids) { + ids = []; + this.structParentIds.put(pageRef, ids); + } + ids.push([id, type]); + } + addAnnotationIdToPage(pageRef, id) { + this.#addIdToPage(pageRef, id, StructElementType.ANNOTATION); + } + readRoleMap() { + const roleMapDict = this.dict.get("RoleMap"); + if (!(roleMapDict instanceof Dict)) { + return; + } + for (const [key, value] of roleMapDict) { + if (value instanceof Name) { + this.roleMap.set(key, value.name); + } + } + } + static async canCreateStructureTree({ + catalogRef, + pdfManager, + newAnnotationsByPage + }) { + if (!(catalogRef instanceof Ref)) { + warn("Cannot save the struct tree: no catalog reference."); + return false; + } + let nextKey = 0; + let hasNothingToUpdate = true; + for (const [pageIndex, elements] of newAnnotationsByPage) { + const { + ref: pageRef + } = await pdfManager.getPage(pageIndex); + if (!(pageRef instanceof Ref)) { + warn(`Cannot save the struct tree: page ${pageIndex} has no ref.`); + hasNothingToUpdate = true; + break; + } + for (const element of elements) { + if (element.accessibilityData?.type) { + element.parentTreeId = nextKey++; + hasNothingToUpdate = false; + } + } + } + if (hasNothingToUpdate) { + for (const elements of newAnnotationsByPage.values()) { + for (const element of elements) { + delete element.parentTreeId; + } + } + return false; + } + return true; + } + static async createStructureTree({ + newAnnotationsByPage, + xref, + catalogRef, + pdfManager, + changes + }) { + const root = pdfManager.catalog.cloneDict(); + const cache = new RefSetCache(); + cache.put(catalogRef, root); + const structTreeRootRef = xref.getNewTemporaryRef(); + root.set("StructTreeRoot", structTreeRootRef); + const structTreeRoot = new Dict(xref); + structTreeRoot.set("Type", Name.get("StructTreeRoot")); + const parentTreeRef = xref.getNewTemporaryRef(); + structTreeRoot.set("ParentTree", parentTreeRef); + const kids = []; + structTreeRoot.set("K", kids); + cache.put(structTreeRootRef, structTreeRoot); + const parentTree = new Dict(xref); + const nums = []; + parentTree.set("Nums", nums); + const nextKey = await this.#writeKids({ + newAnnotationsByPage, + structTreeRootRef, + structTreeRoot: null, + kids, + nums, + xref, + pdfManager, + changes, + cache + }); + structTreeRoot.set("ParentTreeNextKey", nextKey); + cache.put(parentTreeRef, parentTree); + for (const [ref, obj] of cache.items()) { + changes.put(ref, { + data: obj + }); + } + } + async canUpdateStructTree({ + pdfManager, + xref, + newAnnotationsByPage + }) { + if (!this.ref) { + warn("Cannot update the struct tree: no root reference."); + return false; + } + let nextKey = this.dict.get("ParentTreeNextKey"); + if (!Number.isInteger(nextKey) || nextKey < 0) { + warn("Cannot update the struct tree: invalid next key."); + return false; + } + const parentTree = this.dict.get("ParentTree"); + if (!(parentTree instanceof Dict)) { + warn("Cannot update the struct tree: ParentTree isn't a dict."); + return false; + } + const nums = parentTree.get("Nums"); + if (!Array.isArray(nums)) { + warn("Cannot update the struct tree: nums isn't an array."); + return false; + } + const numberTree = new NumberTree(parentTree, xref); + for (const pageIndex of newAnnotationsByPage.keys()) { + const { + pageDict + } = await pdfManager.getPage(pageIndex); + if (!pageDict.has("StructParents")) { + continue; + } + const id = pageDict.get("StructParents"); + if (!Number.isInteger(id) || !Array.isArray(numberTree.get(id))) { + warn(`Cannot save the struct tree: page ${pageIndex} has a wrong id.`); + return false; + } + } + let hasNothingToUpdate = true; + for (const [pageIndex, elements] of newAnnotationsByPage) { + const { + pageDict + } = await pdfManager.getPage(pageIndex); + StructTreeRoot.#collectParents({ + elements, + xref: this.dict.xref, + pageDict, + numberTree + }); + for (const element of elements) { + if (element.accessibilityData?.type) { + if (!(element.accessibilityData.structParent >= 0)) { + element.parentTreeId = nextKey++; + } + hasNothingToUpdate = false; + } + } + } + if (hasNothingToUpdate) { + for (const elements of newAnnotationsByPage.values()) { + for (const element of elements) { + delete element.parentTreeId; + delete element.structTreeParent; + } + } + return false; + } + return true; + } + async updateStructureTree({ + newAnnotationsByPage, + pdfManager, + changes + }) { + const xref = this.dict.xref; + const structTreeRoot = this.dict.clone(); + const structTreeRootRef = this.ref; + const cache = new RefSetCache(); + cache.put(structTreeRootRef, structTreeRoot); + let parentTreeRef = structTreeRoot.getRaw("ParentTree"); + let parentTree; + if (parentTreeRef instanceof Ref) { + parentTree = xref.fetch(parentTreeRef); + } else { + parentTree = parentTreeRef; + parentTreeRef = xref.getNewTemporaryRef(); + structTreeRoot.set("ParentTree", parentTreeRef); + } + parentTree = parentTree.clone(); + cache.put(parentTreeRef, parentTree); + let nums = parentTree.getRaw("Nums"); + let numsRef = null; + if (nums instanceof Ref) { + numsRef = nums; + nums = xref.fetch(numsRef); + } + nums = nums.slice(); + if (!numsRef) { + parentTree.set("Nums", nums); + } + const newNextKey = await StructTreeRoot.#writeKids({ + newAnnotationsByPage, + structTreeRootRef, + structTreeRoot: this, + kids: null, + nums, + xref, + pdfManager, + changes, + cache + }); + if (newNextKey === -1) { + return; + } + structTreeRoot.set("ParentTreeNextKey", newNextKey); + if (numsRef) { + cache.put(numsRef, nums); + } + for (const [ref, obj] of cache.items()) { + changes.put(ref, { + data: obj + }); + } + } + static async #writeKids({ + newAnnotationsByPage, + structTreeRootRef, + structTreeRoot, + kids, + nums, + xref, + pdfManager, + changes, + cache + }) { + const objr = Name.get("OBJR"); + let nextKey = -1; + let structTreePageObjs; + for (const [pageIndex, elements] of newAnnotationsByPage) { + const page = await pdfManager.getPage(pageIndex); + const { + ref: pageRef + } = page; + const isPageRef = pageRef instanceof Ref; + for (const { + accessibilityData, + ref, + parentTreeId, + structTreeParent + } of elements) { + if (!accessibilityData?.type) { + continue; + } + const { + structParent + } = accessibilityData; + if (structTreeRoot && Number.isInteger(structParent) && structParent >= 0) { + let objs = (structTreePageObjs ||= new Map()).get(pageIndex); + if (objs === undefined) { + const structTreePage = new StructTreePage(structTreeRoot, page.pageDict); + objs = structTreePage.collectObjects(pageRef); + structTreePageObjs.set(pageIndex, objs); + } + const objRef = objs?.get(structParent); + if (objRef) { + const tagDict = xref.fetch(objRef).clone(); + StructTreeRoot.#writeProperties(tagDict, accessibilityData); + changes.put(objRef, { + data: tagDict + }); + continue; + } + } + nextKey = Math.max(nextKey, parentTreeId); + const tagRef = xref.getNewTemporaryRef(); + const tagDict = new Dict(xref); + StructTreeRoot.#writeProperties(tagDict, accessibilityData); + await this.#updateParentTag({ + structTreeParent, + tagDict, + newTagRef: tagRef, + structTreeRootRef, + fallbackKids: kids, + xref, + cache + }); + const objDict = new Dict(xref); + tagDict.set("K", objDict); + objDict.set("Type", objr); + if (isPageRef) { + objDict.set("Pg", pageRef); + } + objDict.set("Obj", ref); + cache.put(tagRef, tagDict); + nums.push(parentTreeId, tagRef); + } + } + return nextKey + 1; + } + static #writeProperties(tagDict, { + type, + title, + lang, + alt, + expanded, + actualText + }) { + tagDict.set("S", Name.get(type)); + if (title) { + tagDict.set("T", stringToAsciiOrUTF16BE(title)); + } + if (lang) { + tagDict.set("Lang", stringToAsciiOrUTF16BE(lang)); + } + if (alt) { + tagDict.set("Alt", stringToAsciiOrUTF16BE(alt)); + } + if (expanded) { + tagDict.set("E", stringToAsciiOrUTF16BE(expanded)); + } + if (actualText) { + tagDict.set("ActualText", stringToAsciiOrUTF16BE(actualText)); + } + } + static #collectParents({ + elements, + xref, + pageDict, + numberTree + }) { + const idToElements = new Map(); + for (const element of elements) { + if (element.structTreeParentId) { + const id = parseInt(element.structTreeParentId.split("_mc")[1], 10); + let elems = idToElements.get(id); + if (!elems) { + elems = []; + idToElements.set(id, elems); + } + elems.push(element); + } + } + const id = pageDict.get("StructParents"); + if (!Number.isInteger(id)) { + return; + } + const parentArray = numberTree.get(id); + const updateElement = (kid, pageKid, kidRef) => { + const elems = idToElements.get(kid); + if (elems) { + const parentRef = pageKid.getRaw("P"); + const parentDict = xref.fetchIfRef(parentRef); + if (parentRef instanceof Ref && parentDict instanceof Dict) { + const params = { + ref: kidRef, + dict: pageKid + }; + for (const element of elems) { + element.structTreeParent = params; + } + } + return true; + } + return false; + }; + for (const kidRef of parentArray) { + if (!(kidRef instanceof Ref)) { + continue; + } + const pageKid = xref.fetch(kidRef); + const k = pageKid.get("K"); + if (Number.isInteger(k)) { + updateElement(k, pageKid, kidRef); + continue; + } + if (!Array.isArray(k)) { + continue; + } + for (let kid of k) { + kid = xref.fetchIfRef(kid); + if (Number.isInteger(kid) && updateElement(kid, pageKid, kidRef)) { + break; + } + if (!(kid instanceof Dict)) { + continue; + } + if (!isName(kid.get("Type"), "MCR")) { + break; + } + const mcid = kid.get("MCID"); + if (Number.isInteger(mcid) && updateElement(mcid, pageKid, kidRef)) { + break; + } + } + } + } + static async #updateParentTag({ + structTreeParent, + tagDict, + newTagRef, + structTreeRootRef, + fallbackKids, + xref, + cache + }) { + let ref = null; + let parentRef; + if (structTreeParent) { + ({ + ref + } = structTreeParent); + parentRef = structTreeParent.dict.getRaw("P") || structTreeRootRef; + } else { + parentRef = structTreeRootRef; + } + tagDict.set("P", parentRef); + const parentDict = xref.fetchIfRef(parentRef); + if (!parentDict) { + fallbackKids.push(newTagRef); + return; + } + let cachedParentDict = cache.get(parentRef); + if (!cachedParentDict) { + cachedParentDict = parentDict.clone(); + cache.put(parentRef, cachedParentDict); + } + const parentKidsRaw = cachedParentDict.getRaw("K"); + let cachedParentKids = parentKidsRaw instanceof Ref ? cache.get(parentKidsRaw) : null; + if (!cachedParentKids) { + cachedParentKids = xref.fetchIfRef(parentKidsRaw); + cachedParentKids = Array.isArray(cachedParentKids) ? cachedParentKids.slice() : [parentKidsRaw]; + const parentKidsRef = xref.getNewTemporaryRef(); + cachedParentDict.set("K", parentKidsRef); + cache.put(parentKidsRef, cachedParentKids); + } + const index = cachedParentKids.indexOf(ref); + cachedParentKids.splice(index >= 0 ? index + 1 : cachedParentKids.length, 0, newTagRef); + } +} +class StructElementNode { + constructor(tree, dict) { + this.tree = tree; + this.dict = dict; + this.kids = []; + this.parseKids(); + } + get role() { + const nameObj = this.dict.get("S"); + const name = nameObj instanceof Name ? nameObj.name : ""; + const { + root + } = this.tree; + if (root.roleMap.has(name)) { + return root.roleMap.get(name); + } + return name; + } + parseKids() { + let pageObjId = null; + const objRef = this.dict.getRaw("Pg"); + if (objRef instanceof Ref) { + pageObjId = objRef.toString(); + } + const kids = this.dict.get("K"); + if (Array.isArray(kids)) { + for (const kid of kids) { + const element = this.parseKid(pageObjId, kid); + if (element) { + this.kids.push(element); + } + } + } else { + const element = this.parseKid(pageObjId, kids); + if (element) { + this.kids.push(element); + } + } + } + parseKid(pageObjId, kid) { + if (Number.isInteger(kid)) { + if (this.tree.pageDict.objId !== pageObjId) { + return null; + } + return new StructElement({ + type: StructElementType.PAGE_CONTENT, + mcid: kid, + pageObjId + }); + } + let kidDict = null; + if (kid instanceof Ref) { + kidDict = this.dict.xref.fetch(kid); + } else if (kid instanceof Dict) { + kidDict = kid; + } + if (!kidDict) { + return null; + } + const pageRef = kidDict.getRaw("Pg"); + if (pageRef instanceof Ref) { + pageObjId = pageRef.toString(); + } + const type = kidDict.get("Type") instanceof Name ? kidDict.get("Type").name : null; + if (type === "MCR") { + if (this.tree.pageDict.objId !== pageObjId) { + return null; + } + const kidRef = kidDict.getRaw("Stm"); + return new StructElement({ + type: StructElementType.STREAM_CONTENT, + refObjId: kidRef instanceof Ref ? kidRef.toString() : null, + pageObjId, + mcid: kidDict.get("MCID") + }); + } + if (type === "OBJR") { + if (this.tree.pageDict.objId !== pageObjId) { + return null; + } + const kidRef = kidDict.getRaw("Obj"); + return new StructElement({ + type: StructElementType.OBJECT, + refObjId: kidRef instanceof Ref ? kidRef.toString() : null, + pageObjId + }); + } + return new StructElement({ + type: StructElementType.ELEMENT, + dict: kidDict + }); + } +} +class StructElement { + constructor({ + type, + dict = null, + mcid = null, + pageObjId = null, + refObjId = null + }) { + this.type = type; + this.dict = dict; + this.mcid = mcid; + this.pageObjId = pageObjId; + this.refObjId = refObjId; + this.parentNode = null; + } +} +class StructTreePage { + constructor(structTreeRoot, pageDict) { + this.root = structTreeRoot; + this.rootDict = structTreeRoot ? structTreeRoot.dict : null; + this.pageDict = pageDict; + this.nodes = []; + } + collectObjects(pageRef) { + if (!this.root || !this.rootDict || !(pageRef instanceof Ref)) { + return null; + } + const parentTree = this.rootDict.get("ParentTree"); + if (!parentTree) { + return null; + } + const ids = this.root.structParentIds?.get(pageRef); + if (!ids) { + return null; + } + const map = new Map(); + const numberTree = new NumberTree(parentTree, this.rootDict.xref); + for (const [elemId] of ids) { + const obj = numberTree.getRaw(elemId); + if (obj instanceof Ref) { + map.set(elemId, obj); + } + } + return map; + } + parse(pageRef) { + if (!this.root || !this.rootDict || !(pageRef instanceof Ref)) { + return; + } + const parentTree = this.rootDict.get("ParentTree"); + if (!parentTree) { + return; + } + const id = this.pageDict.get("StructParents"); + const ids = this.root.structParentIds?.get(pageRef); + if (!Number.isInteger(id) && !ids) { + return; + } + const map = new Map(); + const numberTree = new NumberTree(parentTree, this.rootDict.xref); + if (Number.isInteger(id)) { + const parentArray = numberTree.get(id); + if (Array.isArray(parentArray)) { + for (const ref of parentArray) { + if (ref instanceof Ref) { + this.addNode(this.rootDict.xref.fetch(ref), map); + } + } + } + } + if (!ids) { + return; + } + for (const [elemId, type] of ids) { + const obj = numberTree.get(elemId); + if (obj) { + const elem = this.addNode(this.rootDict.xref.fetchIfRef(obj), map); + if (elem?.kids?.length === 1 && elem.kids[0].type === StructElementType.OBJECT) { + elem.kids[0].type = type; + } + } + } + } + addNode(dict, map, level = 0) { + if (level > MAX_DEPTH) { + warn("StructTree MAX_DEPTH reached."); + return null; + } + if (!(dict instanceof Dict)) { + return null; + } + if (map.has(dict)) { + return map.get(dict); + } + const element = new StructElementNode(this, dict); + map.set(dict, element); + const parent = dict.get("P"); + if (!parent || isName(parent.get("Type"), "StructTreeRoot")) { + if (!this.addTopLevelNode(dict, element)) { + map.delete(dict); + } + return element; + } + const parentNode = this.addNode(parent, map, level + 1); + if (!parentNode) { + return element; + } + let save = false; + for (const kid of parentNode.kids) { + if (kid.type === StructElementType.ELEMENT && kid.dict === dict) { + kid.parentNode = element; + save = true; + } + } + if (!save) { + map.delete(dict); + } + return element; + } + addTopLevelNode(dict, element) { + const obj = this.rootDict.get("K"); + if (!obj) { + return false; + } + if (obj instanceof Dict) { + if (obj.objId !== dict.objId) { + return false; + } + this.nodes[0] = element; + return true; + } + if (!Array.isArray(obj)) { + return true; + } + let save = false; + for (let i = 0; i < obj.length; i++) { + const kidRef = obj[i]; + if (kidRef?.toString() === dict.objId) { + this.nodes[i] = element; + save = true; + } + } + return save; + } + get serializable() { + function nodeToSerializable(node, parent, level = 0) { + if (level > MAX_DEPTH) { + warn("StructTree too deep to be fully serialized."); + return; + } + const obj = Object.create(null); + obj.role = node.role; + obj.children = []; + parent.children.push(obj); + let alt = node.dict.get("Alt"); + if (typeof alt !== "string") { + alt = node.dict.get("ActualText"); + } + if (typeof alt === "string") { + obj.alt = stringToPDFString(alt); + } + const a = node.dict.get("A"); + if (a instanceof Dict) { + const bbox = lookupNormalRect(a.getArray("BBox"), null); + if (bbox) { + obj.bbox = bbox; + } else { + const width = a.get("Width"); + const height = a.get("Height"); + if (typeof width === "number" && width > 0 && typeof height === "number" && height > 0) { + obj.bbox = [0, 0, width, height]; + } + } + } + const lang = node.dict.get("Lang"); + if (typeof lang === "string") { + obj.lang = stringToPDFString(lang); + } + for (const kid of node.kids) { + const kidElement = kid.type === StructElementType.ELEMENT ? kid.parentNode : null; + if (kidElement) { + nodeToSerializable(kidElement, obj, level + 1); + continue; + } else if (kid.type === StructElementType.PAGE_CONTENT || kid.type === StructElementType.STREAM_CONTENT) { + obj.children.push({ + type: "content", + id: `p${kid.pageObjId}_mc${kid.mcid}` + }); + } else if (kid.type === StructElementType.OBJECT) { + obj.children.push({ + type: "object", + id: kid.refObjId + }); + } else if (kid.type === StructElementType.ANNOTATION) { + obj.children.push({ + type: "annotation", + id: `${AnnotationPrefix}${kid.refObjId}` + }); + } + } + } + const root = Object.create(null); + root.children = []; + root.role = "Root"; + for (const child of this.nodes) { + if (!child) { + continue; + } + nodeToSerializable(child, root); + } + return root; + } +} + +;// ./src/core/catalog.js + + + + + + + + + + + +function isValidExplicitDest(dest) { + if (!Array.isArray(dest) || dest.length < 2) { + return false; + } + const [page, zoom, ...args] = dest; + if (!(page instanceof Ref) && !Number.isInteger(page)) { + return false; + } + if (!(zoom instanceof Name)) { + return false; + } + const argsLen = args.length; + let allowNull = true; + switch (zoom.name) { + case "XYZ": + if (argsLen < 2 || argsLen > 3) { + return false; + } + break; + case "Fit": + case "FitB": + return argsLen === 0; + case "FitH": + case "FitBH": + case "FitV": + case "FitBV": + if (argsLen > 1) { + return false; + } + break; + case "FitR": + if (argsLen !== 4) { + return false; + } + allowNull = false; + break; + default: + return false; + } + for (const arg of args) { + if (!(typeof arg === "number" || allowNull && arg === null)) { + return false; + } + } + return true; +} +function fetchDest(dest) { + if (dest instanceof Dict) { + dest = dest.get("D"); + } + return isValidExplicitDest(dest) ? dest : null; +} +function fetchRemoteDest(action) { + let dest = action.get("D"); + if (dest) { + if (dest instanceof Name) { + dest = dest.name; + } + if (typeof dest === "string") { + return stringToPDFString(dest); + } else if (isValidExplicitDest(dest)) { + return JSON.stringify(dest); + } + } + return null; +} +class Catalog { + constructor(pdfManager, xref) { + this.pdfManager = pdfManager; + this.xref = xref; + this._catDict = xref.getCatalogObj(); + if (!(this._catDict instanceof Dict)) { + throw new FormatError("Catalog object is not a dictionary."); + } + this.toplevelPagesDict; + this._actualNumPages = null; + this.fontCache = new RefSetCache(); + this.builtInCMapCache = new Map(); + this.standardFontDataCache = new Map(); + this.globalImageCache = new GlobalImageCache(); + this.pageKidsCountCache = new RefSetCache(); + this.pageIndexCache = new RefSetCache(); + this.pageDictCache = new RefSetCache(); + this.nonBlendModesSet = new RefSet(); + this.systemFontCache = new Map(); + } + cloneDict() { + return this._catDict.clone(); + } + get version() { + const version = this._catDict.get("Version"); + if (version instanceof Name) { + if (PDF_VERSION_REGEXP.test(version.name)) { + return shadow(this, "version", version.name); + } + warn(`Invalid PDF catalog version: ${version.name}`); + } + return shadow(this, "version", null); + } + get lang() { + const lang = this._catDict.get("Lang"); + return shadow(this, "lang", lang && typeof lang === "string" ? stringToPDFString(lang) : null); + } + get needsRendering() { + const needsRendering = this._catDict.get("NeedsRendering"); + return shadow(this, "needsRendering", typeof needsRendering === "boolean" ? needsRendering : false); + } + get collection() { + let collection = null; + try { + const obj = this._catDict.get("Collection"); + if (obj instanceof Dict && obj.size > 0) { + collection = obj; + } + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + info("Cannot fetch Collection entry; assuming no collection is present."); + } + return shadow(this, "collection", collection); + } + get acroForm() { + let acroForm = null; + try { + const obj = this._catDict.get("AcroForm"); + if (obj instanceof Dict && obj.size > 0) { + acroForm = obj; + } + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + info("Cannot fetch AcroForm entry; assuming no forms are present."); + } + return shadow(this, "acroForm", acroForm); + } + get acroFormRef() { + const value = this._catDict.getRaw("AcroForm"); + return shadow(this, "acroFormRef", value instanceof Ref ? value : null); + } + get metadata() { + const streamRef = this._catDict.getRaw("Metadata"); + if (!(streamRef instanceof Ref)) { + return shadow(this, "metadata", null); + } + let metadata = null; + try { + const stream = this.xref.fetch(streamRef, !this.xref.encrypt?.encryptMetadata); + if (stream instanceof BaseStream && stream.dict instanceof Dict) { + const type = stream.dict.get("Type"); + const subtype = stream.dict.get("Subtype"); + if (isName(type, "Metadata") && isName(subtype, "XML")) { + const data = stringToUTF8String(stream.getString()); + if (data) { + metadata = new MetadataParser(data).serializable; + } + } + } + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + info(`Skipping invalid Metadata: "${ex}".`); + } + return shadow(this, "metadata", metadata); + } + get markInfo() { + let markInfo = null; + try { + markInfo = this._readMarkInfo(); + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + warn("Unable to read mark info."); + } + return shadow(this, "markInfo", markInfo); + } + _readMarkInfo() { + const obj = this._catDict.get("MarkInfo"); + if (!(obj instanceof Dict)) { + return null; + } + const markInfo = { + Marked: false, + UserProperties: false, + Suspects: false + }; + for (const key in markInfo) { + const value = obj.get(key); + if (typeof value === "boolean") { + markInfo[key] = value; + } + } + return markInfo; + } + get structTreeRoot() { + let structTree = null; + try { + structTree = this._readStructTreeRoot(); + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + warn("Unable read to structTreeRoot info."); + } + return shadow(this, "structTreeRoot", structTree); + } + _readStructTreeRoot() { + const rawObj = this._catDict.getRaw("StructTreeRoot"); + const obj = this.xref.fetchIfRef(rawObj); + if (!(obj instanceof Dict)) { + return null; + } + const root = new StructTreeRoot(obj, rawObj); + root.init(); + return root; + } + get toplevelPagesDict() { + const pagesObj = this._catDict.get("Pages"); + if (!(pagesObj instanceof Dict)) { + throw new FormatError("Invalid top-level pages dictionary."); + } + return shadow(this, "toplevelPagesDict", pagesObj); + } + get documentOutline() { + let obj = null; + try { + obj = this._readDocumentOutline(); + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + warn("Unable to read document outline."); + } + return shadow(this, "documentOutline", obj); + } + _readDocumentOutline() { + let obj = this._catDict.get("Outlines"); + if (!(obj instanceof Dict)) { + return null; + } + obj = obj.getRaw("First"); + if (!(obj instanceof Ref)) { + return null; + } + const root = { + items: [] + }; + const queue = [{ + obj, + parent: root + }]; + const processed = new RefSet(); + processed.put(obj); + const xref = this.xref, + blackColor = new Uint8ClampedArray(3); + while (queue.length > 0) { + const i = queue.shift(); + const outlineDict = xref.fetchIfRef(i.obj); + if (outlineDict === null) { + continue; + } + if (!outlineDict.has("Title")) { + warn("Invalid outline item encountered."); + } + const data = { + url: null, + dest: null, + action: null + }; + Catalog.parseDestDictionary({ + destDict: outlineDict, + resultObj: data, + docBaseUrl: this.baseUrl, + docAttachments: this.attachments + }); + const title = outlineDict.get("Title"); + const flags = outlineDict.get("F") || 0; + const color = outlineDict.getArray("C"); + const count = outlineDict.get("Count"); + let rgbColor = blackColor; + if (isNumberArray(color, 3) && (color[0] !== 0 || color[1] !== 0 || color[2] !== 0)) { + rgbColor = ColorSpace.singletons.rgb.getRgb(color, 0); + } + const outlineItem = { + action: data.action, + attachment: data.attachment, + dest: data.dest, + url: data.url, + unsafeUrl: data.unsafeUrl, + newWindow: data.newWindow, + setOCGState: data.setOCGState, + title: typeof title === "string" ? stringToPDFString(title) : "", + color: rgbColor, + count: Number.isInteger(count) ? count : undefined, + bold: !!(flags & 2), + italic: !!(flags & 1), + items: [] + }; + i.parent.items.push(outlineItem); + obj = outlineDict.getRaw("First"); + if (obj instanceof Ref && !processed.has(obj)) { + queue.push({ + obj, + parent: outlineItem + }); + processed.put(obj); + } + obj = outlineDict.getRaw("Next"); + if (obj instanceof Ref && !processed.has(obj)) { + queue.push({ + obj, + parent: i.parent + }); + processed.put(obj); + } + } + return root.items.length > 0 ? root.items : null; + } + get permissions() { + let permissions = null; + try { + permissions = this._readPermissions(); + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + warn("Unable to read permissions."); + } + return shadow(this, "permissions", permissions); + } + _readPermissions() { + const encrypt = this.xref.trailer.get("Encrypt"); + if (!(encrypt instanceof Dict)) { + return null; + } + let flags = encrypt.get("P"); + if (typeof flags !== "number") { + return null; + } + flags += 2 ** 32; + const permissions = []; + for (const key in PermissionFlag) { + const value = PermissionFlag[key]; + if (flags & value) { + permissions.push(value); + } + } + return permissions; + } + get optionalContentConfig() { + let config = null; + try { + const properties = this._catDict.get("OCProperties"); + if (!properties) { + return shadow(this, "optionalContentConfig", null); + } + const defaultConfig = properties.get("D"); + if (!defaultConfig) { + return shadow(this, "optionalContentConfig", null); + } + const groupsData = properties.get("OCGs"); + if (!Array.isArray(groupsData)) { + return shadow(this, "optionalContentConfig", null); + } + const groupRefCache = new RefSetCache(); + for (const groupRef of groupsData) { + if (!(groupRef instanceof Ref) || groupRefCache.has(groupRef)) { + continue; + } + groupRefCache.put(groupRef, this.#readOptionalContentGroup(groupRef)); + } + config = this.#readOptionalContentConfig(defaultConfig, groupRefCache); + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + warn(`Unable to read optional content config: ${ex}`); + } + return shadow(this, "optionalContentConfig", config); + } + #readOptionalContentGroup(groupRef) { + const group = this.xref.fetch(groupRef); + const obj = { + id: groupRef.toString(), + name: null, + intent: null, + usage: { + print: null, + view: null + }, + rbGroups: [] + }; + const name = group.get("Name"); + if (typeof name === "string") { + obj.name = stringToPDFString(name); + } + let intent = group.getArray("Intent"); + if (!Array.isArray(intent)) { + intent = [intent]; + } + if (intent.every(i => i instanceof Name)) { + obj.intent = intent.map(i => i.name); + } + const usage = group.get("Usage"); + if (!(usage instanceof Dict)) { + return obj; + } + const usageObj = obj.usage; + const print = usage.get("Print"); + if (print instanceof Dict) { + const printState = print.get("PrintState"); + if (printState instanceof Name) { + switch (printState.name) { + case "ON": + case "OFF": + usageObj.print = { + printState: printState.name + }; + } + } + } + const view = usage.get("View"); + if (view instanceof Dict) { + const viewState = view.get("ViewState"); + if (viewState instanceof Name) { + switch (viewState.name) { + case "ON": + case "OFF": + usageObj.view = { + viewState: viewState.name + }; + } + } + } + return obj; + } + #readOptionalContentConfig(config, groupRefCache) { + function parseOnOff(refs) { + const onParsed = []; + if (Array.isArray(refs)) { + for (const value of refs) { + if (value instanceof Ref && groupRefCache.has(value)) { + onParsed.push(value.toString()); + } + } + } + return onParsed; + } + function parseOrder(refs, nestedLevels = 0) { + if (!Array.isArray(refs)) { + return null; + } + const order = []; + for (const value of refs) { + if (value instanceof Ref && groupRefCache.has(value)) { + parsedOrderRefs.put(value); + order.push(value.toString()); + continue; + } + const nestedOrder = parseNestedOrder(value, nestedLevels); + if (nestedOrder) { + order.push(nestedOrder); + } + } + if (nestedLevels > 0) { + return order; + } + const hiddenGroups = []; + for (const [groupRef] of groupRefCache.items()) { + if (parsedOrderRefs.has(groupRef)) { + continue; + } + hiddenGroups.push(groupRef.toString()); + } + if (hiddenGroups.length) { + order.push({ + name: null, + order: hiddenGroups + }); + } + return order; + } + function parseNestedOrder(ref, nestedLevels) { + if (++nestedLevels > MAX_NESTED_LEVELS) { + warn("parseNestedOrder - reached MAX_NESTED_LEVELS."); + return null; + } + const value = xref.fetchIfRef(ref); + if (!Array.isArray(value)) { + return null; + } + const nestedName = xref.fetchIfRef(value[0]); + if (typeof nestedName !== "string") { + return null; + } + const nestedOrder = parseOrder(value.slice(1), nestedLevels); + if (!nestedOrder?.length) { + return null; + } + return { + name: stringToPDFString(nestedName), + order: nestedOrder + }; + } + function parseRBGroups(rbGroups) { + if (!Array.isArray(rbGroups)) { + return; + } + for (const value of rbGroups) { + const rbGroup = xref.fetchIfRef(value); + if (!Array.isArray(rbGroup) || !rbGroup.length) { + continue; + } + const parsedRbGroup = new Set(); + for (const ref of rbGroup) { + if (ref instanceof Ref && groupRefCache.has(ref) && !parsedRbGroup.has(ref.toString())) { + parsedRbGroup.add(ref.toString()); + groupRefCache.get(ref).rbGroups.push(parsedRbGroup); + } + } + } + } + const xref = this.xref, + parsedOrderRefs = new RefSet(), + MAX_NESTED_LEVELS = 10; + parseRBGroups(config.get("RBGroups")); + return { + name: typeof config.get("Name") === "string" ? stringToPDFString(config.get("Name")) : null, + creator: typeof config.get("Creator") === "string" ? stringToPDFString(config.get("Creator")) : null, + baseState: config.get("BaseState") instanceof Name ? config.get("BaseState").name : null, + on: parseOnOff(config.get("ON")), + off: parseOnOff(config.get("OFF")), + order: parseOrder(config.get("Order")), + groups: [...groupRefCache] + }; + } + setActualNumPages(num = null) { + this._actualNumPages = num; + } + get hasActualNumPages() { + return this._actualNumPages !== null; + } + get _pagesCount() { + const obj = this.toplevelPagesDict.get("Count"); + if (!Number.isInteger(obj)) { + throw new FormatError("Page count in top-level pages dictionary is not an integer."); + } + return shadow(this, "_pagesCount", obj); + } + get numPages() { + return this.hasActualNumPages ? this._actualNumPages : this._pagesCount; + } + get destinations() { + const obj = this._readDests(), + dests = Object.create(null); + if (obj instanceof NameTree) { + for (const [key, value] of obj.getAll()) { + const dest = fetchDest(value); + if (dest) { + dests[stringToPDFString(key)] = dest; + } + } + } else if (obj instanceof Dict) { + for (const [key, value] of obj) { + const dest = fetchDest(value); + if (dest) { + dests[key] = dest; + } + } + } + return shadow(this, "destinations", dests); + } + getDestination(id) { + const obj = this._readDests(); + if (obj instanceof NameTree) { + const dest = fetchDest(obj.get(id)); + if (dest) { + return dest; + } + const allDest = this.destinations[id]; + if (allDest) { + warn(`Found "${id}" at an incorrect position in the NameTree.`); + return allDest; + } + } else if (obj instanceof Dict) { + const dest = fetchDest(obj.get(id)); + if (dest) { + return dest; + } + } + return null; + } + _readDests() { + const obj = this._catDict.get("Names"); + if (obj?.has("Dests")) { + return new NameTree(obj.getRaw("Dests"), this.xref); + } else if (this._catDict.has("Dests")) { + return this._catDict.get("Dests"); + } + return undefined; + } + get pageLabels() { + let obj = null; + try { + obj = this._readPageLabels(); + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + warn("Unable to read page labels."); + } + return shadow(this, "pageLabels", obj); + } + _readPageLabels() { + const obj = this._catDict.getRaw("PageLabels"); + if (!obj) { + return null; + } + const pageLabels = new Array(this.numPages); + let style = null, + prefix = ""; + const numberTree = new NumberTree(obj, this.xref); + const nums = numberTree.getAll(); + let currentLabel = "", + currentIndex = 1; + for (let i = 0, ii = this.numPages; i < ii; i++) { + const labelDict = nums.get(i); + if (labelDict !== undefined) { + if (!(labelDict instanceof Dict)) { + throw new FormatError("PageLabel is not a dictionary."); + } + if (labelDict.has("Type") && !isName(labelDict.get("Type"), "PageLabel")) { + throw new FormatError("Invalid type in PageLabel dictionary."); + } + if (labelDict.has("S")) { + const s = labelDict.get("S"); + if (!(s instanceof Name)) { + throw new FormatError("Invalid style in PageLabel dictionary."); + } + style = s.name; + } else { + style = null; + } + if (labelDict.has("P")) { + const p = labelDict.get("P"); + if (typeof p !== "string") { + throw new FormatError("Invalid prefix in PageLabel dictionary."); + } + prefix = stringToPDFString(p); + } else { + prefix = ""; + } + if (labelDict.has("St")) { + const st = labelDict.get("St"); + if (!(Number.isInteger(st) && st >= 1)) { + throw new FormatError("Invalid start in PageLabel dictionary."); + } + currentIndex = st; + } else { + currentIndex = 1; + } + } + switch (style) { + case "D": + currentLabel = currentIndex; + break; + case "R": + case "r": + currentLabel = toRomanNumerals(currentIndex, style === "r"); + break; + case "A": + case "a": + const LIMIT = 26; + const A_UPPER_CASE = 0x41, + A_LOWER_CASE = 0x61; + const baseCharCode = style === "a" ? A_LOWER_CASE : A_UPPER_CASE; + const letterIndex = currentIndex - 1; + const character = String.fromCharCode(baseCharCode + letterIndex % LIMIT); + currentLabel = character.repeat(Math.floor(letterIndex / LIMIT) + 1); + break; + default: + if (style) { + throw new FormatError(`Invalid style "${style}" in PageLabel dictionary.`); + } + currentLabel = ""; + } + pageLabels[i] = prefix + currentLabel; + currentIndex++; + } + return pageLabels; + } + get pageLayout() { + const obj = this._catDict.get("PageLayout"); + let pageLayout = ""; + if (obj instanceof Name) { + switch (obj.name) { + case "SinglePage": + case "OneColumn": + case "TwoColumnLeft": + case "TwoColumnRight": + case "TwoPageLeft": + case "TwoPageRight": + pageLayout = obj.name; + } + } + return shadow(this, "pageLayout", pageLayout); + } + get pageMode() { + const obj = this._catDict.get("PageMode"); + let pageMode = "UseNone"; + if (obj instanceof Name) { + switch (obj.name) { + case "UseNone": + case "UseOutlines": + case "UseThumbs": + case "FullScreen": + case "UseOC": + case "UseAttachments": + pageMode = obj.name; + } + } + return shadow(this, "pageMode", pageMode); + } + get viewerPreferences() { + const obj = this._catDict.get("ViewerPreferences"); + if (!(obj instanceof Dict)) { + return shadow(this, "viewerPreferences", null); + } + let prefs = null; + for (const key of obj.getKeys()) { + const value = obj.get(key); + let prefValue; + switch (key) { + case "HideToolbar": + case "HideMenubar": + case "HideWindowUI": + case "FitWindow": + case "CenterWindow": + case "DisplayDocTitle": + case "PickTrayByPDFSize": + if (typeof value === "boolean") { + prefValue = value; + } + break; + case "NonFullScreenPageMode": + if (value instanceof Name) { + switch (value.name) { + case "UseNone": + case "UseOutlines": + case "UseThumbs": + case "UseOC": + prefValue = value.name; + break; + default: + prefValue = "UseNone"; + } + } + break; + case "Direction": + if (value instanceof Name) { + switch (value.name) { + case "L2R": + case "R2L": + prefValue = value.name; + break; + default: + prefValue = "L2R"; + } + } + break; + case "ViewArea": + case "ViewClip": + case "PrintArea": + case "PrintClip": + if (value instanceof Name) { + switch (value.name) { + case "MediaBox": + case "CropBox": + case "BleedBox": + case "TrimBox": + case "ArtBox": + prefValue = value.name; + break; + default: + prefValue = "CropBox"; + } + } + break; + case "PrintScaling": + if (value instanceof Name) { + switch (value.name) { + case "None": + case "AppDefault": + prefValue = value.name; + break; + default: + prefValue = "AppDefault"; + } + } + break; + case "Duplex": + if (value instanceof Name) { + switch (value.name) { + case "Simplex": + case "DuplexFlipShortEdge": + case "DuplexFlipLongEdge": + prefValue = value.name; + break; + default: + prefValue = "None"; + } + } + break; + case "PrintPageRange": + if (Array.isArray(value) && value.length % 2 === 0) { + const isValid = value.every((page, i, arr) => Number.isInteger(page) && page > 0 && (i === 0 || page >= arr[i - 1]) && page <= this.numPages); + if (isValid) { + prefValue = value; + } + } + break; + case "NumCopies": + if (Number.isInteger(value) && value > 0) { + prefValue = value; + } + break; + default: + warn(`Ignoring non-standard key in ViewerPreferences: ${key}.`); + continue; + } + if (prefValue === undefined) { + warn(`Bad value, for key "${key}", in ViewerPreferences: ${value}.`); + continue; + } + if (!prefs) { + prefs = Object.create(null); + } + prefs[key] = prefValue; + } + return shadow(this, "viewerPreferences", prefs); + } + get openAction() { + const obj = this._catDict.get("OpenAction"); + const openAction = Object.create(null); + if (obj instanceof Dict) { + const destDict = new Dict(this.xref); + destDict.set("A", obj); + const resultObj = { + url: null, + dest: null, + action: null + }; + Catalog.parseDestDictionary({ + destDict, + resultObj + }); + if (Array.isArray(resultObj.dest)) { + openAction.dest = resultObj.dest; + } else if (resultObj.action) { + openAction.action = resultObj.action; + } + } else if (Array.isArray(obj)) { + openAction.dest = obj; + } + return shadow(this, "openAction", objectSize(openAction) > 0 ? openAction : null); + } + get attachments() { + const obj = this._catDict.get("Names"); + let attachments = null; + if (obj instanceof Dict && obj.has("EmbeddedFiles")) { + const nameTree = new NameTree(obj.getRaw("EmbeddedFiles"), this.xref); + for (const [key, value] of nameTree.getAll()) { + const fs = new FileSpec(value, this.xref); + if (!attachments) { + attachments = Object.create(null); + } + attachments[stringToPDFString(key)] = fs.serializable; + } + } + return shadow(this, "attachments", attachments); + } + get xfaImages() { + const obj = this._catDict.get("Names"); + let xfaImages = null; + if (obj instanceof Dict && obj.has("XFAImages")) { + const nameTree = new NameTree(obj.getRaw("XFAImages"), this.xref); + for (const [key, value] of nameTree.getAll()) { + if (!xfaImages) { + xfaImages = new Dict(this.xref); + } + xfaImages.set(stringToPDFString(key), value); + } + } + return shadow(this, "xfaImages", xfaImages); + } + _collectJavaScript() { + const obj = this._catDict.get("Names"); + let javaScript = null; + function appendIfJavaScriptDict(name, jsDict) { + if (!(jsDict instanceof Dict)) { + return; + } + if (!isName(jsDict.get("S"), "JavaScript")) { + return; + } + let js = jsDict.get("JS"); + if (js instanceof BaseStream) { + js = js.getString(); + } else if (typeof js !== "string") { + return; + } + js = stringToPDFString(js).replaceAll("\x00", ""); + if (js) { + (javaScript ||= new Map()).set(name, js); + } + } + if (obj instanceof Dict && obj.has("JavaScript")) { + const nameTree = new NameTree(obj.getRaw("JavaScript"), this.xref); + for (const [key, value] of nameTree.getAll()) { + appendIfJavaScriptDict(stringToPDFString(key), value); + } + } + const openAction = this._catDict.get("OpenAction"); + if (openAction) { + appendIfJavaScriptDict("OpenAction", openAction); + } + return javaScript; + } + get jsActions() { + const javaScript = this._collectJavaScript(); + let actions = collectActions(this.xref, this._catDict, DocumentActionEventType); + if (javaScript) { + actions ||= Object.create(null); + for (const [key, val] of javaScript) { + if (key in actions) { + actions[key].push(val); + } else { + actions[key] = [val]; + } + } + } + return shadow(this, "jsActions", actions); + } + async fontFallback(id, handler) { + const translatedFonts = await Promise.all(this.fontCache); + for (const translatedFont of translatedFonts) { + if (translatedFont.loadedName === id) { + translatedFont.fallback(handler); + return; + } + } + } + async cleanup(manuallyTriggered = false) { + clearGlobalCaches(); + this.globalImageCache.clear(manuallyTriggered); + this.pageKidsCountCache.clear(); + this.pageIndexCache.clear(); + this.pageDictCache.clear(); + this.nonBlendModesSet.clear(); + const translatedFonts = await Promise.all(this.fontCache); + for (const { + dict + } of translatedFonts) { + delete dict.cacheKey; + } + this.fontCache.clear(); + this.builtInCMapCache.clear(); + this.standardFontDataCache.clear(); + this.systemFontCache.clear(); + } + async getPageDict(pageIndex) { + const nodesToVisit = [this.toplevelPagesDict]; + const visitedNodes = new RefSet(); + const pagesRef = this._catDict.getRaw("Pages"); + if (pagesRef instanceof Ref) { + visitedNodes.put(pagesRef); + } + const xref = this.xref, + pageKidsCountCache = this.pageKidsCountCache, + pageIndexCache = this.pageIndexCache, + pageDictCache = this.pageDictCache; + let currentPageIndex = 0; + while (nodesToVisit.length) { + const currentNode = nodesToVisit.pop(); + if (currentNode instanceof Ref) { + const count = pageKidsCountCache.get(currentNode); + if (count >= 0 && currentPageIndex + count <= pageIndex) { + currentPageIndex += count; + continue; + } + if (visitedNodes.has(currentNode)) { + throw new FormatError("Pages tree contains circular reference."); + } + visitedNodes.put(currentNode); + const obj = await (pageDictCache.get(currentNode) || xref.fetchAsync(currentNode)); + if (obj instanceof Dict) { + let type = obj.getRaw("Type"); + if (type instanceof Ref) { + type = await xref.fetchAsync(type); + } + if (isName(type, "Page") || !obj.has("Kids")) { + if (!pageKidsCountCache.has(currentNode)) { + pageKidsCountCache.put(currentNode, 1); + } + if (!pageIndexCache.has(currentNode)) { + pageIndexCache.put(currentNode, currentPageIndex); + } + if (currentPageIndex === pageIndex) { + return [obj, currentNode]; + } + currentPageIndex++; + continue; + } + } + nodesToVisit.push(obj); + continue; + } + if (!(currentNode instanceof Dict)) { + throw new FormatError("Page dictionary kid reference points to wrong type of object."); + } + const { + objId + } = currentNode; + let count = currentNode.getRaw("Count"); + if (count instanceof Ref) { + count = await xref.fetchAsync(count); + } + if (Number.isInteger(count) && count >= 0) { + if (objId && !pageKidsCountCache.has(objId)) { + pageKidsCountCache.put(objId, count); + } + if (currentPageIndex + count <= pageIndex) { + currentPageIndex += count; + continue; + } + } + let kids = currentNode.getRaw("Kids"); + if (kids instanceof Ref) { + kids = await xref.fetchAsync(kids); + } + if (!Array.isArray(kids)) { + let type = currentNode.getRaw("Type"); + if (type instanceof Ref) { + type = await xref.fetchAsync(type); + } + if (isName(type, "Page") || !currentNode.has("Kids")) { + if (currentPageIndex === pageIndex) { + return [currentNode, null]; + } + currentPageIndex++; + continue; + } + throw new FormatError("Page dictionary kids object is not an array."); + } + for (let last = kids.length - 1; last >= 0; last--) { + const lastKid = kids[last]; + nodesToVisit.push(lastKid); + if (currentNode === this.toplevelPagesDict && lastKid instanceof Ref && !pageDictCache.has(lastKid)) { + pageDictCache.put(lastKid, xref.fetchAsync(lastKid)); + } + } + } + throw new Error(`Page index ${pageIndex} not found.`); + } + async getAllPageDicts(recoveryMode = false) { + const { + ignoreErrors + } = this.pdfManager.evaluatorOptions; + const queue = [{ + currentNode: this.toplevelPagesDict, + posInKids: 0 + }]; + const visitedNodes = new RefSet(); + const pagesRef = this._catDict.getRaw("Pages"); + if (pagesRef instanceof Ref) { + visitedNodes.put(pagesRef); + } + const map = new Map(), + xref = this.xref, + pageIndexCache = this.pageIndexCache; + let pageIndex = 0; + function addPageDict(pageDict, pageRef) { + if (pageRef && !pageIndexCache.has(pageRef)) { + pageIndexCache.put(pageRef, pageIndex); + } + map.set(pageIndex++, [pageDict, pageRef]); + } + function addPageError(error) { + if (error instanceof XRefEntryException && !recoveryMode) { + throw error; + } + if (recoveryMode && ignoreErrors && pageIndex === 0) { + warn(`getAllPageDicts - Skipping invalid first page: "${error}".`); + error = Dict.empty; + } + map.set(pageIndex++, [error, null]); + } + while (queue.length > 0) { + const queueItem = queue.at(-1); + const { + currentNode, + posInKids + } = queueItem; + let kids = currentNode.getRaw("Kids"); + if (kids instanceof Ref) { + try { + kids = await xref.fetchAsync(kids); + } catch (ex) { + addPageError(ex); + break; + } + } + if (!Array.isArray(kids)) { + addPageError(new FormatError("Page dictionary kids object is not an array.")); + break; + } + if (posInKids >= kids.length) { + queue.pop(); + continue; + } + const kidObj = kids[posInKids]; + let obj; + if (kidObj instanceof Ref) { + if (visitedNodes.has(kidObj)) { + addPageError(new FormatError("Pages tree contains circular reference.")); + break; + } + visitedNodes.put(kidObj); + try { + obj = await xref.fetchAsync(kidObj); + } catch (ex) { + addPageError(ex); + break; + } + } else { + obj = kidObj; + } + if (!(obj instanceof Dict)) { + addPageError(new FormatError("Page dictionary kid reference points to wrong type of object.")); + break; + } + let type = obj.getRaw("Type"); + if (type instanceof Ref) { + try { + type = await xref.fetchAsync(type); + } catch (ex) { + addPageError(ex); + break; + } + } + if (isName(type, "Page") || !obj.has("Kids")) { + addPageDict(obj, kidObj instanceof Ref ? kidObj : null); + } else { + queue.push({ + currentNode: obj, + posInKids: 0 + }); + } + queueItem.posInKids++; + } + return map; + } + getPageIndex(pageRef) { + const cachedPageIndex = this.pageIndexCache.get(pageRef); + if (cachedPageIndex !== undefined) { + return Promise.resolve(cachedPageIndex); + } + const xref = this.xref; + function pagesBeforeRef(kidRef) { + let total = 0, + parentRef; + return xref.fetchAsync(kidRef).then(function (node) { + if (isRefsEqual(kidRef, pageRef) && !isDict(node, "Page") && !(node instanceof Dict && !node.has("Type") && node.has("Contents"))) { + throw new FormatError("The reference does not point to a /Page dictionary."); + } + if (!node) { + return null; + } + if (!(node instanceof Dict)) { + throw new FormatError("Node must be a dictionary."); + } + parentRef = node.getRaw("Parent"); + return node.getAsync("Parent"); + }).then(function (parent) { + if (!parent) { + return null; + } + if (!(parent instanceof Dict)) { + throw new FormatError("Parent must be a dictionary."); + } + return parent.getAsync("Kids"); + }).then(function (kids) { + if (!kids) { + return null; + } + const kidPromises = []; + let found = false; + for (const kid of kids) { + if (!(kid instanceof Ref)) { + throw new FormatError("Kid must be a reference."); + } + if (isRefsEqual(kid, kidRef)) { + found = true; + break; + } + kidPromises.push(xref.fetchAsync(kid).then(function (obj) { + if (!(obj instanceof Dict)) { + throw new FormatError("Kid node must be a dictionary."); + } + if (obj.has("Count")) { + total += obj.get("Count"); + } else { + total++; + } + })); + } + if (!found) { + throw new FormatError("Kid reference not found in parent's kids."); + } + return Promise.all(kidPromises).then(function () { + return [total, parentRef]; + }); + }); + } + let total = 0; + const next = ref => pagesBeforeRef(ref).then(args => { + if (!args) { + this.pageIndexCache.put(pageRef, total); + return total; + } + const [count, parentRef] = args; + total += count; + return next(parentRef); + }); + return next(pageRef); + } + get baseUrl() { + const uri = this._catDict.get("URI"); + if (uri instanceof Dict) { + const base = uri.get("Base"); + if (typeof base === "string") { + const absoluteUrl = createValidAbsoluteUrl(base, null, { + tryConvertEncoding: true + }); + if (absoluteUrl) { + return shadow(this, "baseUrl", absoluteUrl.href); + } + } + } + return shadow(this, "baseUrl", this.pdfManager.docBaseUrl); + } + static parseDestDictionary({ + destDict, + resultObj, + docBaseUrl = null, + docAttachments = null + }) { + if (!(destDict instanceof Dict)) { + warn("parseDestDictionary: `destDict` must be a dictionary."); + return; + } + let action = destDict.get("A"), + url, + dest; + if (!(action instanceof Dict)) { + if (destDict.has("Dest")) { + action = destDict.get("Dest"); + } else { + action = destDict.get("AA"); + if (action instanceof Dict) { + if (action.has("D")) { + action = action.get("D"); + } else if (action.has("U")) { + action = action.get("U"); + } + } + } + } + if (action instanceof Dict) { + const actionType = action.get("S"); + if (!(actionType instanceof Name)) { + warn("parseDestDictionary: Invalid type in Action dictionary."); + return; + } + const actionName = actionType.name; + switch (actionName) { + case "ResetForm": + const flags = action.get("Flags"); + const include = ((typeof flags === "number" ? flags : 0) & 1) === 0; + const fields = []; + const refs = []; + for (const obj of action.get("Fields") || []) { + if (obj instanceof Ref) { + refs.push(obj.toString()); + } else if (typeof obj === "string") { + fields.push(stringToPDFString(obj)); + } + } + resultObj.resetForm = { + fields, + refs, + include + }; + break; + case "URI": + url = action.get("URI"); + if (url instanceof Name) { + url = "/" + url.name; + } + break; + case "GoTo": + dest = action.get("D"); + break; + case "Launch": + case "GoToR": + const urlDict = action.get("F"); + if (urlDict instanceof Dict) { + const fs = new FileSpec(urlDict, null, true); + const { + rawFilename + } = fs.serializable; + url = rawFilename; + } else if (typeof urlDict === "string") { + url = urlDict; + } + const remoteDest = fetchRemoteDest(action); + if (remoteDest && typeof url === "string") { + url = url.split("#", 1)[0] + "#" + remoteDest; + } + const newWindow = action.get("NewWindow"); + if (typeof newWindow === "boolean") { + resultObj.newWindow = newWindow; + } + break; + case "GoToE": + const target = action.get("T"); + let attachment; + if (docAttachments && target instanceof Dict) { + const relationship = target.get("R"); + const name = target.get("N"); + if (isName(relationship, "C") && typeof name === "string") { + attachment = docAttachments[stringToPDFString(name)]; + } + } + if (attachment) { + resultObj.attachment = attachment; + const attachmentDest = fetchRemoteDest(action); + if (attachmentDest) { + resultObj.attachmentDest = attachmentDest; + } + } else { + warn(`parseDestDictionary - unimplemented "GoToE" action.`); + } + break; + case "Named": + const namedAction = action.get("N"); + if (namedAction instanceof Name) { + resultObj.action = namedAction.name; + } + break; + case "SetOCGState": + const state = action.get("State"); + const preserveRB = action.get("PreserveRB"); + if (!Array.isArray(state) || state.length === 0) { + break; + } + const stateArr = []; + for (const elem of state) { + if (elem instanceof Name) { + switch (elem.name) { + case "ON": + case "OFF": + case "Toggle": + stateArr.push(elem.name); + break; + } + } else if (elem instanceof Ref) { + stateArr.push(elem.toString()); + } + } + if (stateArr.length !== state.length) { + break; + } + resultObj.setOCGState = { + state: stateArr, + preserveRB: typeof preserveRB === "boolean" ? preserveRB : true + }; + break; + case "JavaScript": + const jsAction = action.get("JS"); + let js; + if (jsAction instanceof BaseStream) { + js = jsAction.getString(); + } else if (typeof jsAction === "string") { + js = jsAction; + } + const jsURL = js && recoverJsURL(stringToPDFString(js)); + if (jsURL) { + url = jsURL.url; + resultObj.newWindow = jsURL.newWindow; + break; + } + default: + if (actionName === "JavaScript" || actionName === "SubmitForm") { + break; + } + warn(`parseDestDictionary - unsupported action: "${actionName}".`); + break; + } + } else if (destDict.has("Dest")) { + dest = destDict.get("Dest"); + } + if (typeof url === "string") { + const absoluteUrl = createValidAbsoluteUrl(url, docBaseUrl, { + addDefaultProtocol: true, + tryConvertEncoding: true + }); + if (absoluteUrl) { + resultObj.url = absoluteUrl.href; + } + resultObj.unsafeUrl = url; + } + if (dest) { + if (dest instanceof Name) { + dest = dest.name; + } + if (typeof dest === "string") { + resultObj.dest = stringToPDFString(dest); + } else if (isValidExplicitDest(dest)) { + resultObj.dest = dest; + } + } + } +} + +;// ./src/core/object_loader.js + + + + +function mayHaveChildren(value) { + return value instanceof Ref || value instanceof Dict || value instanceof BaseStream || Array.isArray(value); +} +function addChildren(node, nodesToVisit) { + if (node instanceof Dict) { + node = node.getRawValues(); + } else if (node instanceof BaseStream) { + node = node.dict.getRawValues(); + } else if (!Array.isArray(node)) { + return; + } + for (const rawValue of node) { + if (mayHaveChildren(rawValue)) { + nodesToVisit.push(rawValue); + } + } +} +class ObjectLoader { + constructor(dict, keys, xref) { + this.dict = dict; + this.keys = keys; + this.xref = xref; + this.refSet = null; + } + async load() { + if (this.xref.stream.isDataLoaded) { + return undefined; + } + const { + keys, + dict + } = this; + this.refSet = new RefSet(); + const nodesToVisit = []; + for (const key of keys) { + const rawValue = dict.getRaw(key); + if (rawValue !== undefined) { + nodesToVisit.push(rawValue); + } + } + return this._walk(nodesToVisit); + } + async _walk(nodesToVisit) { + const nodesToRevisit = []; + const pendingRequests = []; + while (nodesToVisit.length) { + let currentNode = nodesToVisit.pop(); + if (currentNode instanceof Ref) { + if (this.refSet.has(currentNode)) { + continue; + } + try { + this.refSet.put(currentNode); + currentNode = this.xref.fetch(currentNode); + } catch (ex) { + if (!(ex instanceof MissingDataException)) { + warn(`ObjectLoader._walk - requesting all data: "${ex}".`); + this.refSet = null; + const { + manager + } = this.xref.stream; + return manager.requestAllChunks(); + } + nodesToRevisit.push(currentNode); + pendingRequests.push({ + begin: ex.begin, + end: ex.end + }); + } + } + if (currentNode instanceof BaseStream) { + const baseStreams = currentNode.getBaseStreams(); + if (baseStreams) { + let foundMissingData = false; + for (const stream of baseStreams) { + if (stream.isDataLoaded) { + continue; + } + foundMissingData = true; + pendingRequests.push({ + begin: stream.start, + end: stream.end + }); + } + if (foundMissingData) { + nodesToRevisit.push(currentNode); + } + } + } + addChildren(currentNode, nodesToVisit); + } + if (pendingRequests.length) { + await this.xref.stream.manager.requestRanges(pendingRequests); + for (const node of nodesToRevisit) { + if (node instanceof Ref) { + this.refSet.remove(node); + } + } + return this._walk(nodesToRevisit); + } + this.refSet = null; + return undefined; + } +} + +;// ./src/core/xfa/symbol_utils.js +const $acceptWhitespace = Symbol(); +const $addHTML = Symbol(); +const $appendChild = Symbol(); +const $childrenToHTML = Symbol(); +const $clean = Symbol(); +const $cleanPage = Symbol(); +const $cleanup = Symbol(); +const $clone = Symbol(); +const $consumed = Symbol(); +const $content = Symbol("content"); +const $data = Symbol("data"); +const $dump = Symbol(); +const $extra = Symbol("extra"); +const $finalize = Symbol(); +const $flushHTML = Symbol(); +const $getAttributeIt = Symbol(); +const $getAttributes = Symbol(); +const $getAvailableSpace = Symbol(); +const $getChildrenByClass = Symbol(); +const $getChildrenByName = Symbol(); +const $getChildrenByNameIt = Symbol(); +const $getDataValue = Symbol(); +const $getExtra = Symbol(); +const $getRealChildrenByNameIt = Symbol(); +const $getChildren = Symbol(); +const $getContainedChildren = Symbol(); +const $getNextPage = Symbol(); +const $getSubformParent = Symbol(); +const $getParent = Symbol(); +const $getTemplateRoot = Symbol(); +const $globalData = Symbol(); +const $hasSettableValue = Symbol(); +const $ids = Symbol(); +const $indexOf = Symbol(); +const $insertAt = Symbol(); +const $isCDATAXml = Symbol(); +const $isBindable = Symbol(); +const $isDataValue = Symbol(); +const $isDescendent = Symbol(); +const $isNsAgnostic = Symbol(); +const $isSplittable = Symbol(); +const $isThereMoreWidth = Symbol(); +const $isTransparent = Symbol(); +const $isUsable = Symbol(); +const $lastAttribute = Symbol(); +const $namespaceId = Symbol("namespaceId"); +const $nodeName = Symbol("nodeName"); +const $nsAttributes = Symbol(); +const $onChild = Symbol(); +const $onChildCheck = Symbol(); +const $onText = Symbol(); +const $pushGlyphs = Symbol(); +const $popPara = Symbol(); +const $pushPara = Symbol(); +const $removeChild = Symbol(); +const $root = Symbol("root"); +const $resolvePrototypes = Symbol(); +const $searchNode = Symbol(); +const $setId = Symbol(); +const $setSetAttributes = Symbol(); +const $setValue = Symbol(); +const $tabIndex = Symbol(); +const $text = Symbol(); +const $toPages = Symbol(); +const $toHTML = Symbol(); +const $toString = Symbol(); +const $toStyle = Symbol(); +const $uid = Symbol("uid"); + +;// ./src/core/xfa/namespaces.js +const $buildXFAObject = Symbol(); +const NamespaceIds = { + config: { + id: 0, + check: ns => ns.startsWith("http://www.xfa.org/schema/xci/") + }, + connectionSet: { + id: 1, + check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-connection-set/") + }, + datasets: { + id: 2, + check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-data/") + }, + form: { + id: 3, + check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-form/") + }, + localeSet: { + id: 4, + check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-locale-set/") + }, + pdf: { + id: 5, + check: ns => ns === "http://ns.adobe.com/xdp/pdf/" + }, + signature: { + id: 6, + check: ns => ns === "http://www.w3.org/2000/09/xmldsig#" + }, + sourceSet: { + id: 7, + check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-source-set/") + }, + stylesheet: { + id: 8, + check: ns => ns === "http://www.w3.org/1999/XSL/Transform" + }, + template: { + id: 9, + check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-template/") + }, + xdc: { + id: 10, + check: ns => ns.startsWith("http://www.xfa.org/schema/xdc/") + }, + xdp: { + id: 11, + check: ns => ns === "http://ns.adobe.com/xdp/" + }, + xfdf: { + id: 12, + check: ns => ns === "http://ns.adobe.com/xfdf/" + }, + xhtml: { + id: 13, + check: ns => ns === "http://www.w3.org/1999/xhtml" + }, + xmpmeta: { + id: 14, + check: ns => ns === "http://ns.adobe.com/xmpmeta/" + } +}; + +;// ./src/core/xfa/utils.js + +const dimConverters = { + pt: x => x, + cm: x => x / 2.54 * 72, + mm: x => x / (10 * 2.54) * 72, + in: x => x * 72, + px: x => x +}; +const measurementPattern = /([+-]?\d+\.?\d*)(.*)/; +function stripQuotes(str) { + if (str.startsWith("'") || str.startsWith('"')) { + return str.slice(1, -1); + } + return str; +} +function getInteger({ + data, + defaultValue, + validate +}) { + if (!data) { + return defaultValue; + } + data = data.trim(); + const n = parseInt(data, 10); + if (!isNaN(n) && validate(n)) { + return n; + } + return defaultValue; +} +function getFloat({ + data, + defaultValue, + validate +}) { + if (!data) { + return defaultValue; + } + data = data.trim(); + const n = parseFloat(data); + if (!isNaN(n) && validate(n)) { + return n; + } + return defaultValue; +} +function getKeyword({ + data, + defaultValue, + validate +}) { + if (!data) { + return defaultValue; + } + data = data.trim(); + if (validate(data)) { + return data; + } + return defaultValue; +} +function getStringOption(data, options) { + return getKeyword({ + data, + defaultValue: options[0], + validate: k => options.includes(k) + }); +} +function getMeasurement(str, def = "0") { + def ||= "0"; + if (!str) { + return getMeasurement(def); + } + const match = str.trim().match(measurementPattern); + if (!match) { + return getMeasurement(def); + } + const [, valueStr, unit] = match; + const value = parseFloat(valueStr); + if (isNaN(value)) { + return getMeasurement(def); + } + if (value === 0) { + return 0; + } + const conv = dimConverters[unit]; + if (conv) { + return conv(value); + } + return value; +} +function getRatio(data) { + if (!data) { + return { + num: 1, + den: 1 + }; + } + const ratio = data.trim().split(/\s*:\s*/).map(x => parseFloat(x)).filter(x => !isNaN(x)); + if (ratio.length === 1) { + ratio.push(1); + } + if (ratio.length === 0) { + return { + num: 1, + den: 1 + }; + } + const [num, den] = ratio; + return { + num, + den + }; +} +function getRelevant(data) { + if (!data) { + return []; + } + return data.trim().split(/\s+/).map(e => ({ + excluded: e[0] === "-", + viewname: e.substring(1) + })); +} +function getColor(data, def = [0, 0, 0]) { + let [r, g, b] = def; + if (!data) { + return { + r, + g, + b + }; + } + const color = data.trim().split(/\s*,\s*/).map(c => Math.min(Math.max(0, parseInt(c.trim(), 10)), 255)).map(c => isNaN(c) ? 0 : c); + if (color.length < 3) { + return { + r, + g, + b + }; + } + [r, g, b] = color; + return { + r, + g, + b + }; +} +function getBBox(data) { + const def = -1; + if (!data) { + return { + x: def, + y: def, + width: def, + height: def + }; + } + const bbox = data.trim().split(/\s*,\s*/).map(m => getMeasurement(m, "-1")); + if (bbox.length < 4 || bbox[2] < 0 || bbox[3] < 0) { + return { + x: def, + y: def, + width: def, + height: def + }; + } + const [x, y, width, height] = bbox; + return { + x, + y, + width, + height + }; +} +class HTMLResult { + static get FAILURE() { + return shadow(this, "FAILURE", new HTMLResult(false, null, null, null)); + } + static get EMPTY() { + return shadow(this, "EMPTY", new HTMLResult(true, null, null, null)); + } + constructor(success, html, bbox, breakNode) { + this.success = success; + this.html = html; + this.bbox = bbox; + this.breakNode = breakNode; + } + isBreak() { + return !!this.breakNode; + } + static breakNode(node) { + return new HTMLResult(false, null, null, node); + } + static success(html, bbox = null) { + return new HTMLResult(true, html, bbox, null); + } +} + +;// ./src/core/xfa/fonts.js + + + +class FontFinder { + constructor(pdfFonts) { + this.fonts = new Map(); + this.cache = new Map(); + this.warned = new Set(); + this.defaultFont = null; + this.add(pdfFonts); + } + add(pdfFonts, reallyMissingFonts = null) { + for (const pdfFont of pdfFonts) { + this.addPdfFont(pdfFont); + } + for (const pdfFont of this.fonts.values()) { + if (!pdfFont.regular) { + pdfFont.regular = pdfFont.italic || pdfFont.bold || pdfFont.bolditalic; + } + } + if (!reallyMissingFonts || reallyMissingFonts.size === 0) { + return; + } + const myriad = this.fonts.get("PdfJS-Fallback-PdfJS-XFA"); + for (const missing of reallyMissingFonts) { + this.fonts.set(missing, myriad); + } + } + addPdfFont(pdfFont) { + const cssFontInfo = pdfFont.cssFontInfo; + const name = cssFontInfo.fontFamily; + let font = this.fonts.get(name); + if (!font) { + font = Object.create(null); + this.fonts.set(name, font); + if (!this.defaultFont) { + this.defaultFont = font; + } + } + let property = ""; + const fontWeight = parseFloat(cssFontInfo.fontWeight); + if (parseFloat(cssFontInfo.italicAngle) !== 0) { + property = fontWeight >= 700 ? "bolditalic" : "italic"; + } else if (fontWeight >= 700) { + property = "bold"; + } + if (!property) { + if (pdfFont.name.includes("Bold") || pdfFont.psName?.includes("Bold")) { + property = "bold"; + } + if (pdfFont.name.includes("Italic") || pdfFont.name.endsWith("It") || pdfFont.psName?.includes("Italic") || pdfFont.psName?.endsWith("It")) { + property += "italic"; + } + } + if (!property) { + property = "regular"; + } + font[property] = pdfFont; + } + getDefault() { + return this.defaultFont; + } + find(fontName, mustWarn = true) { + let font = this.fonts.get(fontName) || this.cache.get(fontName); + if (font) { + return font; + } + const pattern = /,|-|_| |bolditalic|bold|italic|regular|it/gi; + let name = fontName.replaceAll(pattern, ""); + font = this.fonts.get(name); + if (font) { + this.cache.set(fontName, font); + return font; + } + name = name.toLowerCase(); + const maybe = []; + for (const [family, pdfFont] of this.fonts.entries()) { + if (family.replaceAll(pattern, "").toLowerCase().startsWith(name)) { + maybe.push(pdfFont); + } + } + if (maybe.length === 0) { + for (const [, pdfFont] of this.fonts.entries()) { + if (pdfFont.regular.name?.replaceAll(pattern, "").toLowerCase().startsWith(name)) { + maybe.push(pdfFont); + } + } + } + if (maybe.length === 0) { + name = name.replaceAll(/psmt|mt/gi, ""); + for (const [family, pdfFont] of this.fonts.entries()) { + if (family.replaceAll(pattern, "").toLowerCase().startsWith(name)) { + maybe.push(pdfFont); + } + } + } + if (maybe.length === 0) { + for (const pdfFont of this.fonts.values()) { + if (pdfFont.regular.name?.replaceAll(pattern, "").toLowerCase().startsWith(name)) { + maybe.push(pdfFont); + } + } + } + if (maybe.length >= 1) { + if (maybe.length !== 1 && mustWarn) { + warn(`XFA - Too many choices to guess the correct font: ${fontName}`); + } + this.cache.set(fontName, maybe[0]); + return maybe[0]; + } + if (mustWarn && !this.warned.has(fontName)) { + this.warned.add(fontName); + warn(`XFA - Cannot find the font: ${fontName}`); + } + return null; + } +} +function selectFont(xfaFont, typeface) { + if (xfaFont.posture === "italic") { + if (xfaFont.weight === "bold") { + return typeface.bolditalic; + } + return typeface.italic; + } else if (xfaFont.weight === "bold") { + return typeface.bold; + } + return typeface.regular; +} +function fonts_getMetrics(xfaFont, real = false) { + let pdfFont = null; + if (xfaFont) { + const name = stripQuotes(xfaFont.typeface); + const typeface = xfaFont[$globalData].fontFinder.find(name); + pdfFont = selectFont(xfaFont, typeface); + } + if (!pdfFont) { + return { + lineHeight: 12, + lineGap: 2, + lineNoGap: 10 + }; + } + const size = xfaFont.size || 10; + const lineHeight = pdfFont.lineHeight ? Math.max(real ? 0 : 1.2, pdfFont.lineHeight) : 1.2; + const lineGap = pdfFont.lineGap === undefined ? 0.2 : pdfFont.lineGap; + return { + lineHeight: lineHeight * size, + lineGap: lineGap * size, + lineNoGap: Math.max(1, lineHeight - lineGap) * size + }; +} + +;// ./src/core/xfa/text.js + +const WIDTH_FACTOR = 1.02; +class FontInfo { + constructor(xfaFont, margin, lineHeight, fontFinder) { + this.lineHeight = lineHeight; + this.paraMargin = margin || { + top: 0, + bottom: 0, + left: 0, + right: 0 + }; + if (!xfaFont) { + [this.pdfFont, this.xfaFont] = this.defaultFont(fontFinder); + return; + } + this.xfaFont = { + typeface: xfaFont.typeface, + posture: xfaFont.posture, + weight: xfaFont.weight, + size: xfaFont.size, + letterSpacing: xfaFont.letterSpacing + }; + const typeface = fontFinder.find(xfaFont.typeface); + if (!typeface) { + [this.pdfFont, this.xfaFont] = this.defaultFont(fontFinder); + return; + } + this.pdfFont = selectFont(xfaFont, typeface); + if (!this.pdfFont) { + [this.pdfFont, this.xfaFont] = this.defaultFont(fontFinder); + } + } + defaultFont(fontFinder) { + const font = fontFinder.find("Helvetica", false) || fontFinder.find("Myriad Pro", false) || fontFinder.find("Arial", false) || fontFinder.getDefault(); + if (font?.regular) { + const pdfFont = font.regular; + const info = pdfFont.cssFontInfo; + const xfaFont = { + typeface: info.fontFamily, + posture: "normal", + weight: "normal", + size: 10, + letterSpacing: 0 + }; + return [pdfFont, xfaFont]; + } + const xfaFont = { + typeface: "Courier", + posture: "normal", + weight: "normal", + size: 10, + letterSpacing: 0 + }; + return [null, xfaFont]; + } +} +class FontSelector { + constructor(defaultXfaFont, defaultParaMargin, defaultLineHeight, fontFinder) { + this.fontFinder = fontFinder; + this.stack = [new FontInfo(defaultXfaFont, defaultParaMargin, defaultLineHeight, fontFinder)]; + } + pushData(xfaFont, margin, lineHeight) { + const lastFont = this.stack.at(-1); + for (const name of ["typeface", "posture", "weight", "size", "letterSpacing"]) { + if (!xfaFont[name]) { + xfaFont[name] = lastFont.xfaFont[name]; + } + } + for (const name of ["top", "bottom", "left", "right"]) { + if (isNaN(margin[name])) { + margin[name] = lastFont.paraMargin[name]; + } + } + const fontInfo = new FontInfo(xfaFont, margin, lineHeight || lastFont.lineHeight, this.fontFinder); + if (!fontInfo.pdfFont) { + fontInfo.pdfFont = lastFont.pdfFont; + } + this.stack.push(fontInfo); + } + popFont() { + this.stack.pop(); + } + topFont() { + return this.stack.at(-1); + } +} +class TextMeasure { + constructor(defaultXfaFont, defaultParaMargin, defaultLineHeight, fonts) { + this.glyphs = []; + this.fontSelector = new FontSelector(defaultXfaFont, defaultParaMargin, defaultLineHeight, fonts); + this.extraHeight = 0; + } + pushData(xfaFont, margin, lineHeight) { + this.fontSelector.pushData(xfaFont, margin, lineHeight); + } + popFont(xfaFont) { + return this.fontSelector.popFont(); + } + addPara() { + const lastFont = this.fontSelector.topFont(); + this.extraHeight += lastFont.paraMargin.top + lastFont.paraMargin.bottom; + } + addString(str) { + if (!str) { + return; + } + const lastFont = this.fontSelector.topFont(); + const fontSize = lastFont.xfaFont.size; + if (lastFont.pdfFont) { + const letterSpacing = lastFont.xfaFont.letterSpacing; + const pdfFont = lastFont.pdfFont; + const fontLineHeight = pdfFont.lineHeight || 1.2; + const lineHeight = lastFont.lineHeight || Math.max(1.2, fontLineHeight) * fontSize; + const lineGap = pdfFont.lineGap === undefined ? 0.2 : pdfFont.lineGap; + const noGap = fontLineHeight - lineGap; + const firstLineHeight = Math.max(1, noGap) * fontSize; + const scale = fontSize / 1000; + const fallbackWidth = pdfFont.defaultWidth || pdfFont.charsToGlyphs(" ")[0].width; + for (const line of str.split(/[\u2029\n]/)) { + const encodedLine = pdfFont.encodeString(line).join(""); + const glyphs = pdfFont.charsToGlyphs(encodedLine); + for (const glyph of glyphs) { + const width = glyph.width || fallbackWidth; + this.glyphs.push([width * scale + letterSpacing, lineHeight, firstLineHeight, glyph.unicode, false]); + } + this.glyphs.push([0, 0, 0, "\n", true]); + } + this.glyphs.pop(); + return; + } + for (const line of str.split(/[\u2029\n]/)) { + for (const char of line.split("")) { + this.glyphs.push([fontSize, 1.2 * fontSize, fontSize, char, false]); + } + this.glyphs.push([0, 0, 0, "\n", true]); + } + this.glyphs.pop(); + } + compute(maxWidth) { + let lastSpacePos = -1, + lastSpaceWidth = 0, + width = 0, + height = 0, + currentLineWidth = 0, + currentLineHeight = 0; + let isBroken = false; + let isFirstLine = true; + for (let i = 0, ii = this.glyphs.length; i < ii; i++) { + const [glyphWidth, lineHeight, firstLineHeight, char, isEOL] = this.glyphs[i]; + const isSpace = char === " "; + const glyphHeight = isFirstLine ? firstLineHeight : lineHeight; + if (isEOL) { + width = Math.max(width, currentLineWidth); + currentLineWidth = 0; + height += currentLineHeight; + currentLineHeight = glyphHeight; + lastSpacePos = -1; + lastSpaceWidth = 0; + isFirstLine = false; + continue; + } + if (isSpace) { + if (currentLineWidth + glyphWidth > maxWidth) { + width = Math.max(width, currentLineWidth); + currentLineWidth = 0; + height += currentLineHeight; + currentLineHeight = glyphHeight; + lastSpacePos = -1; + lastSpaceWidth = 0; + isBroken = true; + isFirstLine = false; + } else { + currentLineHeight = Math.max(glyphHeight, currentLineHeight); + lastSpaceWidth = currentLineWidth; + currentLineWidth += glyphWidth; + lastSpacePos = i; + } + continue; + } + if (currentLineWidth + glyphWidth > maxWidth) { + height += currentLineHeight; + currentLineHeight = glyphHeight; + if (lastSpacePos !== -1) { + i = lastSpacePos; + width = Math.max(width, lastSpaceWidth); + currentLineWidth = 0; + lastSpacePos = -1; + lastSpaceWidth = 0; + } else { + width = Math.max(width, currentLineWidth); + currentLineWidth = glyphWidth; + } + isBroken = true; + isFirstLine = false; + continue; + } + currentLineWidth += glyphWidth; + currentLineHeight = Math.max(glyphHeight, currentLineHeight); + } + width = Math.max(width, currentLineWidth); + height += currentLineHeight + this.extraHeight; + return { + width: WIDTH_FACTOR * width, + height, + isBroken + }; + } +} + +;// ./src/core/xfa/som.js + + +const namePattern = /^[^.[]+/; +const indexPattern = /^[^\]]+/; +const operators = { + dot: 0, + dotDot: 1, + dotHash: 2, + dotBracket: 3, + dotParen: 4 +}; +const shortcuts = new Map([["$data", (root, current) => root.datasets ? root.datasets.data : root], ["$record", (root, current) => (root.datasets ? root.datasets.data : root)[$getChildren]()[0]], ["$template", (root, current) => root.template], ["$connectionSet", (root, current) => root.connectionSet], ["$form", (root, current) => root.form], ["$layout", (root, current) => root.layout], ["$host", (root, current) => root.host], ["$dataWindow", (root, current) => root.dataWindow], ["$event", (root, current) => root.event], ["!", (root, current) => root.datasets], ["$xfa", (root, current) => root], ["xfa", (root, current) => root], ["$", (root, current) => current]]); +const somCache = new WeakMap(); +function parseIndex(index) { + index = index.trim(); + if (index === "*") { + return Infinity; + } + return parseInt(index, 10) || 0; +} +function parseExpression(expr, dotDotAllowed, noExpr = true) { + let match = expr.match(namePattern); + if (!match) { + return null; + } + let [name] = match; + const parsed = [{ + name, + cacheName: "." + name, + index: 0, + js: null, + formCalc: null, + operator: operators.dot + }]; + let pos = name.length; + while (pos < expr.length) { + const spos = pos; + const char = expr.charAt(pos++); + if (char === "[") { + match = expr.slice(pos).match(indexPattern); + if (!match) { + warn("XFA - Invalid index in SOM expression"); + return null; + } + parsed.at(-1).index = parseIndex(match[0]); + pos += match[0].length + 1; + continue; + } + let operator; + switch (expr.charAt(pos)) { + case ".": + if (!dotDotAllowed) { + return null; + } + pos++; + operator = operators.dotDot; + break; + case "#": + pos++; + operator = operators.dotHash; + break; + case "[": + if (noExpr) { + warn("XFA - SOM expression contains a FormCalc subexpression which is not supported for now."); + return null; + } + operator = operators.dotBracket; + break; + case "(": + if (noExpr) { + warn("XFA - SOM expression contains a JavaScript subexpression which is not supported for now."); + return null; + } + operator = operators.dotParen; + break; + default: + operator = operators.dot; + break; + } + match = expr.slice(pos).match(namePattern); + if (!match) { + break; + } + [name] = match; + pos += name.length; + parsed.push({ + name, + cacheName: expr.slice(spos, pos), + operator, + index: 0, + js: null, + formCalc: null + }); + } + return parsed; +} +function searchNode(root, container, expr, dotDotAllowed = true, useCache = true) { + const parsed = parseExpression(expr, dotDotAllowed); + if (!parsed) { + return null; + } + const fn = shortcuts.get(parsed[0].name); + let i = 0; + let isQualified; + if (fn) { + isQualified = true; + root = [fn(root, container)]; + i = 1; + } else { + isQualified = container === null; + root = [container || root]; + } + for (let ii = parsed.length; i < ii; i++) { + const { + name, + cacheName, + operator, + index + } = parsed[i]; + const nodes = []; + for (const node of root) { + if (!node.isXFAObject) { + continue; + } + let children, cached; + if (useCache) { + cached = somCache.get(node); + if (!cached) { + cached = new Map(); + somCache.set(node, cached); + } + children = cached.get(cacheName); + } + if (!children) { + switch (operator) { + case operators.dot: + children = node[$getChildrenByName](name, false); + break; + case operators.dotDot: + children = node[$getChildrenByName](name, true); + break; + case operators.dotHash: + children = node[$getChildrenByClass](name); + children = children.isXFAObjectArray ? children.children : [children]; + break; + default: + break; + } + if (useCache) { + cached.set(cacheName, children); + } + } + if (children.length > 0) { + nodes.push(children); + } + } + if (nodes.length === 0 && !isQualified && i === 0) { + const parent = container[$getParent](); + container = parent; + if (!container) { + return null; + } + i = -1; + root = [container]; + continue; + } + root = isFinite(index) ? nodes.filter(node => index < node.length).map(node => node[index]) : nodes.flat(); + } + if (root.length === 0) { + return null; + } + return root; +} +function createDataNode(root, container, expr) { + const parsed = parseExpression(expr); + if (!parsed) { + return null; + } + if (parsed.some(x => x.operator === operators.dotDot)) { + return null; + } + const fn = shortcuts.get(parsed[0].name); + let i = 0; + if (fn) { + root = fn(root, container); + i = 1; + } else { + root = container || root; + } + for (let ii = parsed.length; i < ii; i++) { + const { + name, + operator, + index + } = parsed[i]; + if (!isFinite(index)) { + parsed[i].index = 0; + return root.createNodes(parsed.slice(i)); + } + let children; + switch (operator) { + case operators.dot: + children = root[$getChildrenByName](name, false); + break; + case operators.dotDot: + children = root[$getChildrenByName](name, true); + break; + case operators.dotHash: + children = root[$getChildrenByClass](name); + children = children.isXFAObjectArray ? children.children : [children]; + break; + default: + break; + } + if (children.length === 0) { + return root.createNodes(parsed.slice(i)); + } + if (index < children.length) { + const child = children[index]; + if (!child.isXFAObject) { + warn(`XFA - Cannot create a node.`); + return null; + } + root = child; + } else { + parsed[i].index = index - children.length; + return root.createNodes(parsed.slice(i)); + } + } + return null; +} + +;// ./src/core/xfa/xfa_object.js + + + + + + +const _applyPrototype = Symbol(); +const _attributes = Symbol(); +const _attributeNames = Symbol(); +const _children = Symbol("_children"); +const _cloneAttribute = Symbol(); +const _dataValue = Symbol(); +const _defaultValue = Symbol(); +const _filteredChildrenGenerator = Symbol(); +const _getPrototype = Symbol(); +const _getUnsetAttributes = Symbol(); +const _hasChildren = Symbol(); +const _max = Symbol(); +const _options = Symbol(); +const _parent = Symbol("parent"); +const _resolvePrototypesHelper = Symbol(); +const _setAttributes = Symbol(); +const _validator = Symbol(); +let uid = 0; +const NS_DATASETS = NamespaceIds.datasets.id; +class XFAObject { + constructor(nsId, name, hasChildren = false) { + this[$namespaceId] = nsId; + this[$nodeName] = name; + this[_hasChildren] = hasChildren; + this[_parent] = null; + this[_children] = []; + this[$uid] = `${name}${uid++}`; + this[$globalData] = null; + } + get isXFAObject() { + return true; + } + get isXFAObjectArray() { + return false; + } + createNodes(path) { + let root = this, + node = null; + for (const { + name, + index + } of path) { + for (let i = 0, ii = isFinite(index) ? index : 0; i <= ii; i++) { + const nsId = root[$namespaceId] === NS_DATASETS ? -1 : root[$namespaceId]; + node = new XmlObject(nsId, name); + root[$appendChild](node); + } + root = node; + } + return node; + } + [$onChild](child) { + if (!this[_hasChildren] || !this[$onChildCheck](child)) { + return false; + } + const name = child[$nodeName]; + const node = this[name]; + if (node instanceof XFAObjectArray) { + if (node.push(child)) { + this[$appendChild](child); + return true; + } + } else { + if (node !== null) { + this[$removeChild](node); + } + this[name] = child; + this[$appendChild](child); + return true; + } + let id = ""; + if (this.id) { + id = ` (id: ${this.id})`; + } else if (this.name) { + id = ` (name: ${this.name} ${this.h.value})`; + } + warn(`XFA - node "${this[$nodeName]}"${id} has already enough "${name}"!`); + return false; + } + [$onChildCheck](child) { + return this.hasOwnProperty(child[$nodeName]) && child[$namespaceId] === this[$namespaceId]; + } + [$isNsAgnostic]() { + return false; + } + [$acceptWhitespace]() { + return false; + } + [$isCDATAXml]() { + return false; + } + [$isBindable]() { + return false; + } + [$popPara]() { + if (this.para) { + this[$getTemplateRoot]()[$extra].paraStack.pop(); + } + } + [$pushPara]() { + this[$getTemplateRoot]()[$extra].paraStack.push(this.para); + } + [$setId](ids) { + if (this.id && this[$namespaceId] === NamespaceIds.template.id) { + ids.set(this.id, this); + } + } + [$getTemplateRoot]() { + return this[$globalData].template; + } + [$isSplittable]() { + return false; + } + [$isThereMoreWidth]() { + return false; + } + [$appendChild](child) { + child[_parent] = this; + this[_children].push(child); + if (!child[$globalData] && this[$globalData]) { + child[$globalData] = this[$globalData]; + } + } + [$removeChild](child) { + const i = this[_children].indexOf(child); + this[_children].splice(i, 1); + } + [$hasSettableValue]() { + return this.hasOwnProperty("value"); + } + [$setValue](_) {} + [$onText](_) {} + [$finalize]() {} + [$clean](builder) { + delete this[_hasChildren]; + if (this[$cleanup]) { + builder.clean(this[$cleanup]); + delete this[$cleanup]; + } + } + [$indexOf](child) { + return this[_children].indexOf(child); + } + [$insertAt](i, child) { + child[_parent] = this; + this[_children].splice(i, 0, child); + if (!child[$globalData] && this[$globalData]) { + child[$globalData] = this[$globalData]; + } + } + [$isTransparent]() { + return !this.name; + } + [$lastAttribute]() { + return ""; + } + [$text]() { + if (this[_children].length === 0) { + return this[$content]; + } + return this[_children].map(c => c[$text]()).join(""); + } + get [_attributeNames]() { + const proto = Object.getPrototypeOf(this); + if (!proto._attributes) { + const attributes = proto._attributes = new Set(); + for (const name of Object.getOwnPropertyNames(this)) { + if (this[name] === null || this[name] instanceof XFAObject || this[name] instanceof XFAObjectArray) { + break; + } + attributes.add(name); + } + } + return shadow(this, _attributeNames, proto._attributes); + } + [$isDescendent](parent) { + let node = this; + while (node) { + if (node === parent) { + return true; + } + node = node[$getParent](); + } + return false; + } + [$getParent]() { + return this[_parent]; + } + [$getSubformParent]() { + return this[$getParent](); + } + [$getChildren](name = null) { + if (!name) { + return this[_children]; + } + return this[name]; + } + [$dump]() { + const dumped = Object.create(null); + if (this[$content]) { + dumped.$content = this[$content]; + } + for (const name of Object.getOwnPropertyNames(this)) { + const value = this[name]; + if (value === null) { + continue; + } + if (value instanceof XFAObject) { + dumped[name] = value[$dump](); + } else if (value instanceof XFAObjectArray) { + if (!value.isEmpty()) { + dumped[name] = value.dump(); + } + } else { + dumped[name] = value; + } + } + return dumped; + } + [$toStyle]() { + return null; + } + [$toHTML]() { + return HTMLResult.EMPTY; + } + *[$getContainedChildren]() { + for (const node of this[$getChildren]()) { + yield node; + } + } + *[_filteredChildrenGenerator](filter, include) { + for (const node of this[$getContainedChildren]()) { + if (!filter || include === filter.has(node[$nodeName])) { + const availableSpace = this[$getAvailableSpace](); + const res = node[$toHTML](availableSpace); + if (!res.success) { + this[$extra].failingNode = node; + } + yield res; + } + } + } + [$flushHTML]() { + return null; + } + [$addHTML](html, bbox) { + this[$extra].children.push(html); + } + [$getAvailableSpace]() {} + [$childrenToHTML]({ + filter = null, + include = true + }) { + if (!this[$extra].generator) { + this[$extra].generator = this[_filteredChildrenGenerator](filter, include); + } else { + const availableSpace = this[$getAvailableSpace](); + const res = this[$extra].failingNode[$toHTML](availableSpace); + if (!res.success) { + return res; + } + if (res.html) { + this[$addHTML](res.html, res.bbox); + } + delete this[$extra].failingNode; + } + while (true) { + const gen = this[$extra].generator.next(); + if (gen.done) { + break; + } + const res = gen.value; + if (!res.success) { + return res; + } + if (res.html) { + this[$addHTML](res.html, res.bbox); + } + } + this[$extra].generator = null; + return HTMLResult.EMPTY; + } + [$setSetAttributes](attributes) { + this[_setAttributes] = new Set(Object.keys(attributes)); + } + [_getUnsetAttributes](protoAttributes) { + const allAttr = this[_attributeNames]; + const setAttr = this[_setAttributes]; + return [...protoAttributes].filter(x => allAttr.has(x) && !setAttr.has(x)); + } + [$resolvePrototypes](ids, ancestors = new Set()) { + for (const child of this[_children]) { + child[_resolvePrototypesHelper](ids, ancestors); + } + } + [_resolvePrototypesHelper](ids, ancestors) { + const proto = this[_getPrototype](ids, ancestors); + if (proto) { + this[_applyPrototype](proto, ids, ancestors); + } else { + this[$resolvePrototypes](ids, ancestors); + } + } + [_getPrototype](ids, ancestors) { + const { + use, + usehref + } = this; + if (!use && !usehref) { + return null; + } + let proto = null; + let somExpression = null; + let id = null; + let ref = use; + if (usehref) { + ref = usehref; + if (usehref.startsWith("#som(") && usehref.endsWith(")")) { + somExpression = usehref.slice("#som(".length, -1); + } else if (usehref.startsWith(".#som(") && usehref.endsWith(")")) { + somExpression = usehref.slice(".#som(".length, -1); + } else if (usehref.startsWith("#")) { + id = usehref.slice(1); + } else if (usehref.startsWith(".#")) { + id = usehref.slice(2); + } + } else if (use.startsWith("#")) { + id = use.slice(1); + } else { + somExpression = use; + } + this.use = this.usehref = ""; + if (id) { + proto = ids.get(id); + } else { + proto = searchNode(ids.get($root), this, somExpression, true, false); + if (proto) { + proto = proto[0]; + } + } + if (!proto) { + warn(`XFA - Invalid prototype reference: ${ref}.`); + return null; + } + if (proto[$nodeName] !== this[$nodeName]) { + warn(`XFA - Incompatible prototype: ${proto[$nodeName]} !== ${this[$nodeName]}.`); + return null; + } + if (ancestors.has(proto)) { + warn(`XFA - Cycle detected in prototypes use.`); + return null; + } + ancestors.add(proto); + const protoProto = proto[_getPrototype](ids, ancestors); + if (protoProto) { + proto[_applyPrototype](protoProto, ids, ancestors); + } + proto[$resolvePrototypes](ids, ancestors); + ancestors.delete(proto); + return proto; + } + [_applyPrototype](proto, ids, ancestors) { + if (ancestors.has(proto)) { + warn(`XFA - Cycle detected in prototypes use.`); + return; + } + if (!this[$content] && proto[$content]) { + this[$content] = proto[$content]; + } + const newAncestors = new Set(ancestors); + newAncestors.add(proto); + for (const unsetAttrName of this[_getUnsetAttributes](proto[_setAttributes])) { + this[unsetAttrName] = proto[unsetAttrName]; + if (this[_setAttributes]) { + this[_setAttributes].add(unsetAttrName); + } + } + for (const name of Object.getOwnPropertyNames(this)) { + if (this[_attributeNames].has(name)) { + continue; + } + const value = this[name]; + const protoValue = proto[name]; + if (value instanceof XFAObjectArray) { + for (const child of value[_children]) { + child[_resolvePrototypesHelper](ids, ancestors); + } + for (let i = value[_children].length, ii = protoValue[_children].length; i < ii; i++) { + const child = proto[_children][i][$clone](); + if (value.push(child)) { + child[_parent] = this; + this[_children].push(child); + child[_resolvePrototypesHelper](ids, ancestors); + } else { + break; + } + } + continue; + } + if (value !== null) { + value[$resolvePrototypes](ids, ancestors); + if (protoValue) { + value[_applyPrototype](protoValue, ids, ancestors); + } + continue; + } + if (protoValue !== null) { + const child = protoValue[$clone](); + child[_parent] = this; + this[name] = child; + this[_children].push(child); + child[_resolvePrototypesHelper](ids, ancestors); + } + } + } + static [_cloneAttribute](obj) { + if (Array.isArray(obj)) { + return obj.map(x => XFAObject[_cloneAttribute](x)); + } + if (typeof obj === "object" && obj !== null) { + return Object.assign({}, obj); + } + return obj; + } + [$clone]() { + const clone = Object.create(Object.getPrototypeOf(this)); + for (const $symbol of Object.getOwnPropertySymbols(this)) { + try { + clone[$symbol] = this[$symbol]; + } catch { + shadow(clone, $symbol, this[$symbol]); + } + } + clone[$uid] = `${clone[$nodeName]}${uid++}`; + clone[_children] = []; + for (const name of Object.getOwnPropertyNames(this)) { + if (this[_attributeNames].has(name)) { + clone[name] = XFAObject[_cloneAttribute](this[name]); + continue; + } + const value = this[name]; + clone[name] = value instanceof XFAObjectArray ? new XFAObjectArray(value[_max]) : null; + } + for (const child of this[_children]) { + const name = child[$nodeName]; + const clonedChild = child[$clone](); + clone[_children].push(clonedChild); + clonedChild[_parent] = clone; + if (clone[name] === null) { + clone[name] = clonedChild; + } else { + clone[name][_children].push(clonedChild); + } + } + return clone; + } + [$getChildren](name = null) { + if (!name) { + return this[_children]; + } + return this[_children].filter(c => c[$nodeName] === name); + } + [$getChildrenByClass](name) { + return this[name]; + } + [$getChildrenByName](name, allTransparent, first = true) { + return Array.from(this[$getChildrenByNameIt](name, allTransparent, first)); + } + *[$getChildrenByNameIt](name, allTransparent, first = true) { + if (name === "parent") { + yield this[_parent]; + return; + } + for (const child of this[_children]) { + if (child[$nodeName] === name) { + yield child; + } + if (child.name === name) { + yield child; + } + if (allTransparent || child[$isTransparent]()) { + yield* child[$getChildrenByNameIt](name, allTransparent, false); + } + } + if (first && this[_attributeNames].has(name)) { + yield new XFAAttribute(this, name, this[name]); + } + } +} +class XFAObjectArray { + constructor(max = Infinity) { + this[_max] = max; + this[_children] = []; + } + get isXFAObject() { + return false; + } + get isXFAObjectArray() { + return true; + } + push(child) { + const len = this[_children].length; + if (len <= this[_max]) { + this[_children].push(child); + return true; + } + warn(`XFA - node "${child[$nodeName]}" accepts no more than ${this[_max]} children`); + return false; + } + isEmpty() { + return this[_children].length === 0; + } + dump() { + return this[_children].length === 1 ? this[_children][0][$dump]() : this[_children].map(x => x[$dump]()); + } + [$clone]() { + const clone = new XFAObjectArray(this[_max]); + clone[_children] = this[_children].map(c => c[$clone]()); + return clone; + } + get children() { + return this[_children]; + } + clear() { + this[_children].length = 0; + } +} +class XFAAttribute { + constructor(node, name, value) { + this[_parent] = node; + this[$nodeName] = name; + this[$content] = value; + this[$consumed] = false; + this[$uid] = `attribute${uid++}`; + } + [$getParent]() { + return this[_parent]; + } + [$isDataValue]() { + return true; + } + [$getDataValue]() { + return this[$content].trim(); + } + [$setValue](value) { + value = value.value || ""; + this[$content] = value.toString(); + } + [$text]() { + return this[$content]; + } + [$isDescendent](parent) { + return this[_parent] === parent || this[_parent][$isDescendent](parent); + } +} +class XmlObject extends XFAObject { + constructor(nsId, name, attributes = {}) { + super(nsId, name); + this[$content] = ""; + this[_dataValue] = null; + if (name !== "#text") { + const map = new Map(); + this[_attributes] = map; + for (const [attrName, value] of Object.entries(attributes)) { + map.set(attrName, new XFAAttribute(this, attrName, value)); + } + if (attributes.hasOwnProperty($nsAttributes)) { + const dataNode = attributes[$nsAttributes].xfa.dataNode; + if (dataNode !== undefined) { + if (dataNode === "dataGroup") { + this[_dataValue] = false; + } else if (dataNode === "dataValue") { + this[_dataValue] = true; + } + } + } + } + this[$consumed] = false; + } + [$toString](buf) { + const tagName = this[$nodeName]; + if (tagName === "#text") { + buf.push(encodeToXmlString(this[$content])); + return; + } + const utf8TagName = utf8StringToString(tagName); + const prefix = this[$namespaceId] === NS_DATASETS ? "xfa:" : ""; + buf.push(`<${prefix}${utf8TagName}`); + for (const [name, value] of this[_attributes].entries()) { + const utf8Name = utf8StringToString(name); + buf.push(` ${utf8Name}="${encodeToXmlString(value[$content])}"`); + } + if (this[_dataValue] !== null) { + if (this[_dataValue]) { + buf.push(` xfa:dataNode="dataValue"`); + } else { + buf.push(` xfa:dataNode="dataGroup"`); + } + } + if (!this[$content] && this[_children].length === 0) { + buf.push("/>"); + return; + } + buf.push(">"); + if (this[$content]) { + if (typeof this[$content] === "string") { + buf.push(encodeToXmlString(this[$content])); + } else { + this[$content][$toString](buf); + } + } else { + for (const child of this[_children]) { + child[$toString](buf); + } + } + buf.push(``); + } + [$onChild](child) { + if (this[$content]) { + const node = new XmlObject(this[$namespaceId], "#text"); + this[$appendChild](node); + node[$content] = this[$content]; + this[$content] = ""; + } + this[$appendChild](child); + return true; + } + [$onText](str) { + this[$content] += str; + } + [$finalize]() { + if (this[$content] && this[_children].length > 0) { + const node = new XmlObject(this[$namespaceId], "#text"); + this[$appendChild](node); + node[$content] = this[$content]; + delete this[$content]; + } + } + [$toHTML]() { + if (this[$nodeName] === "#text") { + return HTMLResult.success({ + name: "#text", + value: this[$content] + }); + } + return HTMLResult.EMPTY; + } + [$getChildren](name = null) { + if (!name) { + return this[_children]; + } + return this[_children].filter(c => c[$nodeName] === name); + } + [$getAttributes]() { + return this[_attributes]; + } + [$getChildrenByClass](name) { + const value = this[_attributes].get(name); + if (value !== undefined) { + return value; + } + return this[$getChildren](name); + } + *[$getChildrenByNameIt](name, allTransparent) { + const value = this[_attributes].get(name); + if (value) { + yield value; + } + for (const child of this[_children]) { + if (child[$nodeName] === name) { + yield child; + } + if (allTransparent) { + yield* child[$getChildrenByNameIt](name, allTransparent); + } + } + } + *[$getAttributeIt](name, skipConsumed) { + const value = this[_attributes].get(name); + if (value && (!skipConsumed || !value[$consumed])) { + yield value; + } + for (const child of this[_children]) { + yield* child[$getAttributeIt](name, skipConsumed); + } + } + *[$getRealChildrenByNameIt](name, allTransparent, skipConsumed) { + for (const child of this[_children]) { + if (child[$nodeName] === name && (!skipConsumed || !child[$consumed])) { + yield child; + } + if (allTransparent) { + yield* child[$getRealChildrenByNameIt](name, allTransparent, skipConsumed); + } + } + } + [$isDataValue]() { + if (this[_dataValue] === null) { + return this[_children].length === 0 || this[_children][0][$namespaceId] === NamespaceIds.xhtml.id; + } + return this[_dataValue]; + } + [$getDataValue]() { + if (this[_dataValue] === null) { + if (this[_children].length === 0) { + return this[$content].trim(); + } + if (this[_children][0][$namespaceId] === NamespaceIds.xhtml.id) { + return this[_children][0][$text]().trim(); + } + return null; + } + return this[$content].trim(); + } + [$setValue](value) { + value = value.value || ""; + this[$content] = value.toString(); + } + [$dump](hasNS = false) { + const dumped = Object.create(null); + if (hasNS) { + dumped.$ns = this[$namespaceId]; + } + if (this[$content]) { + dumped.$content = this[$content]; + } + dumped.$name = this[$nodeName]; + dumped.children = []; + for (const child of this[_children]) { + dumped.children.push(child[$dump](hasNS)); + } + dumped.attributes = Object.create(null); + for (const [name, value] of this[_attributes]) { + dumped.attributes[name] = value[$content]; + } + return dumped; + } +} +class ContentObject extends XFAObject { + constructor(nsId, name) { + super(nsId, name); + this[$content] = ""; + } + [$onText](text) { + this[$content] += text; + } + [$finalize]() {} +} +class OptionObject extends ContentObject { + constructor(nsId, name, options) { + super(nsId, name); + this[_options] = options; + } + [$finalize]() { + this[$content] = getKeyword({ + data: this[$content], + defaultValue: this[_options][0], + validate: k => this[_options].includes(k) + }); + } + [$clean](builder) { + super[$clean](builder); + delete this[_options]; + } +} +class StringObject extends ContentObject { + [$finalize]() { + this[$content] = this[$content].trim(); + } +} +class IntegerObject extends ContentObject { + constructor(nsId, name, defaultValue, validator) { + super(nsId, name); + this[_defaultValue] = defaultValue; + this[_validator] = validator; + } + [$finalize]() { + this[$content] = getInteger({ + data: this[$content], + defaultValue: this[_defaultValue], + validate: this[_validator] + }); + } + [$clean](builder) { + super[$clean](builder); + delete this[_defaultValue]; + delete this[_validator]; + } +} +class Option01 extends IntegerObject { + constructor(nsId, name) { + super(nsId, name, 0, n => n === 1); + } +} +class Option10 extends IntegerObject { + constructor(nsId, name) { + super(nsId, name, 1, n => n === 0); + } +} + +;// ./src/core/xfa/html_utils.js + + + + + + +function measureToString(m) { + if (typeof m === "string") { + return "0px"; + } + return Number.isInteger(m) ? `${m}px` : `${m.toFixed(2)}px`; +} +const converters = { + anchorType(node, style) { + const parent = node[$getSubformParent](); + if (!parent || parent.layout && parent.layout !== "position") { + return; + } + if (!("transform" in style)) { + style.transform = ""; + } + switch (node.anchorType) { + case "bottomCenter": + style.transform += "translate(-50%, -100%)"; + break; + case "bottomLeft": + style.transform += "translate(0,-100%)"; + break; + case "bottomRight": + style.transform += "translate(-100%,-100%)"; + break; + case "middleCenter": + style.transform += "translate(-50%,-50%)"; + break; + case "middleLeft": + style.transform += "translate(0,-50%)"; + break; + case "middleRight": + style.transform += "translate(-100%,-50%)"; + break; + case "topCenter": + style.transform += "translate(-50%,0)"; + break; + case "topRight": + style.transform += "translate(-100%,0)"; + break; + } + }, + dimensions(node, style) { + const parent = node[$getSubformParent](); + let width = node.w; + const height = node.h; + if (parent.layout?.includes("row")) { + const extra = parent[$extra]; + const colSpan = node.colSpan; + let w; + if (colSpan === -1) { + w = extra.columnWidths.slice(extra.currentColumn).reduce((a, x) => a + x, 0); + extra.currentColumn = 0; + } else { + w = extra.columnWidths.slice(extra.currentColumn, extra.currentColumn + colSpan).reduce((a, x) => a + x, 0); + extra.currentColumn = (extra.currentColumn + node.colSpan) % extra.columnWidths.length; + } + if (!isNaN(w)) { + width = node.w = w; + } + } + style.width = width !== "" ? measureToString(width) : "auto"; + style.height = height !== "" ? measureToString(height) : "auto"; + }, + position(node, style) { + const parent = node[$getSubformParent](); + if (parent?.layout && parent.layout !== "position") { + return; + } + style.position = "absolute"; + style.left = measureToString(node.x); + style.top = measureToString(node.y); + }, + rotate(node, style) { + if (node.rotate) { + if (!("transform" in style)) { + style.transform = ""; + } + style.transform += `rotate(-${node.rotate}deg)`; + style.transformOrigin = "top left"; + } + }, + presence(node, style) { + switch (node.presence) { + case "invisible": + style.visibility = "hidden"; + break; + case "hidden": + case "inactive": + style.display = "none"; + break; + } + }, + hAlign(node, style) { + if (node[$nodeName] === "para") { + switch (node.hAlign) { + case "justifyAll": + style.textAlign = "justify-all"; + break; + case "radix": + style.textAlign = "left"; + break; + default: + style.textAlign = node.hAlign; + } + } else { + switch (node.hAlign) { + case "left": + style.alignSelf = "start"; + break; + case "center": + style.alignSelf = "center"; + break; + case "right": + style.alignSelf = "end"; + break; + } + } + }, + margin(node, style) { + if (node.margin) { + style.margin = node.margin[$toStyle]().margin; + } + } +}; +function setMinMaxDimensions(node, style) { + const parent = node[$getSubformParent](); + if (parent.layout === "position") { + if (node.minW > 0) { + style.minWidth = measureToString(node.minW); + } + if (node.maxW > 0) { + style.maxWidth = measureToString(node.maxW); + } + if (node.minH > 0) { + style.minHeight = measureToString(node.minH); + } + if (node.maxH > 0) { + style.maxHeight = measureToString(node.maxH); + } + } +} +function layoutText(text, xfaFont, margin, lineHeight, fontFinder, width) { + const measure = new TextMeasure(xfaFont, margin, lineHeight, fontFinder); + if (typeof text === "string") { + measure.addString(text); + } else { + text[$pushGlyphs](measure); + } + return measure.compute(width); +} +function layoutNode(node, availableSpace) { + let height = null; + let width = null; + let isBroken = false; + if ((!node.w || !node.h) && node.value) { + let marginH = 0; + let marginV = 0; + if (node.margin) { + marginH = node.margin.leftInset + node.margin.rightInset; + marginV = node.margin.topInset + node.margin.bottomInset; + } + let lineHeight = null; + let margin = null; + if (node.para) { + margin = Object.create(null); + lineHeight = node.para.lineHeight === "" ? null : node.para.lineHeight; + margin.top = node.para.spaceAbove === "" ? 0 : node.para.spaceAbove; + margin.bottom = node.para.spaceBelow === "" ? 0 : node.para.spaceBelow; + margin.left = node.para.marginLeft === "" ? 0 : node.para.marginLeft; + margin.right = node.para.marginRight === "" ? 0 : node.para.marginRight; + } + let font = node.font; + if (!font) { + const root = node[$getTemplateRoot](); + let parent = node[$getParent](); + while (parent && parent !== root) { + if (parent.font) { + font = parent.font; + break; + } + parent = parent[$getParent](); + } + } + const maxWidth = (node.w || availableSpace.width) - marginH; + const fontFinder = node[$globalData].fontFinder; + if (node.value.exData && node.value.exData[$content] && node.value.exData.contentType === "text/html") { + const res = layoutText(node.value.exData[$content], font, margin, lineHeight, fontFinder, maxWidth); + width = res.width; + height = res.height; + isBroken = res.isBroken; + } else { + const text = node.value[$text](); + if (text) { + const res = layoutText(text, font, margin, lineHeight, fontFinder, maxWidth); + width = res.width; + height = res.height; + isBroken = res.isBroken; + } + } + if (width !== null && !node.w) { + width += marginH; + } + if (height !== null && !node.h) { + height += marginV; + } + } + return { + w: width, + h: height, + isBroken + }; +} +function computeBbox(node, html, availableSpace) { + let bbox; + if (node.w !== "" && node.h !== "") { + bbox = [node.x, node.y, node.w, node.h]; + } else { + if (!availableSpace) { + return null; + } + let width = node.w; + if (width === "") { + if (node.maxW === 0) { + const parent = node[$getSubformParent](); + width = parent.layout === "position" && parent.w !== "" ? 0 : node.minW; + } else { + width = Math.min(node.maxW, availableSpace.width); + } + html.attributes.style.width = measureToString(width); + } + let height = node.h; + if (height === "") { + if (node.maxH === 0) { + const parent = node[$getSubformParent](); + height = parent.layout === "position" && parent.h !== "" ? 0 : node.minH; + } else { + height = Math.min(node.maxH, availableSpace.height); + } + html.attributes.style.height = measureToString(height); + } + bbox = [node.x, node.y, width, height]; + } + return bbox; +} +function fixDimensions(node) { + const parent = node[$getSubformParent](); + if (parent.layout?.includes("row")) { + const extra = parent[$extra]; + const colSpan = node.colSpan; + let width; + if (colSpan === -1) { + width = extra.columnWidths.slice(extra.currentColumn).reduce((a, w) => a + w, 0); + } else { + width = extra.columnWidths.slice(extra.currentColumn, extra.currentColumn + colSpan).reduce((a, w) => a + w, 0); + } + if (!isNaN(width)) { + node.w = width; + } + } + if (parent.layout && parent.layout !== "position") { + node.x = node.y = 0; + } + if (node.layout === "table") { + if (node.w === "" && Array.isArray(node.columnWidths)) { + node.w = node.columnWidths.reduce((a, x) => a + x, 0); + } + } +} +function layoutClass(node) { + switch (node.layout) { + case "position": + return "xfaPosition"; + case "lr-tb": + return "xfaLrTb"; + case "rl-row": + return "xfaRlRow"; + case "rl-tb": + return "xfaRlTb"; + case "row": + return "xfaRow"; + case "table": + return "xfaTable"; + case "tb": + return "xfaTb"; + default: + return "xfaPosition"; + } +} +function toStyle(node, ...names) { + const style = Object.create(null); + for (const name of names) { + const value = node[name]; + if (value === null) { + continue; + } + if (converters.hasOwnProperty(name)) { + converters[name](node, style); + continue; + } + if (value instanceof XFAObject) { + const newStyle = value[$toStyle](); + if (newStyle) { + Object.assign(style, newStyle); + } else { + warn(`(DEBUG) - XFA - style for ${name} not implemented yet`); + } + } + } + return style; +} +function createWrapper(node, html) { + const { + attributes + } = html; + const { + style + } = attributes; + const wrapper = { + name: "div", + attributes: { + class: ["xfaWrapper"], + style: Object.create(null) + }, + children: [] + }; + attributes.class.push("xfaWrapped"); + if (node.border) { + const { + widths, + insets + } = node.border[$extra]; + let width, height; + let top = insets[0]; + let left = insets[3]; + const insetsH = insets[0] + insets[2]; + const insetsW = insets[1] + insets[3]; + switch (node.border.hand) { + case "even": + top -= widths[0] / 2; + left -= widths[3] / 2; + width = `calc(100% + ${(widths[1] + widths[3]) / 2 - insetsW}px)`; + height = `calc(100% + ${(widths[0] + widths[2]) / 2 - insetsH}px)`; + break; + case "left": + top -= widths[0]; + left -= widths[3]; + width = `calc(100% + ${widths[1] + widths[3] - insetsW}px)`; + height = `calc(100% + ${widths[0] + widths[2] - insetsH}px)`; + break; + case "right": + width = insetsW ? `calc(100% - ${insetsW}px)` : "100%"; + height = insetsH ? `calc(100% - ${insetsH}px)` : "100%"; + break; + } + const classNames = ["xfaBorder"]; + if (isPrintOnly(node.border)) { + classNames.push("xfaPrintOnly"); + } + const border = { + name: "div", + attributes: { + class: classNames, + style: { + top: `${top}px`, + left: `${left}px`, + width, + height + } + }, + children: [] + }; + for (const key of ["border", "borderWidth", "borderColor", "borderRadius", "borderStyle"]) { + if (style[key] !== undefined) { + border.attributes.style[key] = style[key]; + delete style[key]; + } + } + wrapper.children.push(border, html); + } else { + wrapper.children.push(html); + } + for (const key of ["background", "backgroundClip", "top", "left", "width", "height", "minWidth", "minHeight", "maxWidth", "maxHeight", "transform", "transformOrigin", "visibility"]) { + if (style[key] !== undefined) { + wrapper.attributes.style[key] = style[key]; + delete style[key]; + } + } + wrapper.attributes.style.position = style.position === "absolute" ? "absolute" : "relative"; + delete style.position; + if (style.alignSelf) { + wrapper.attributes.style.alignSelf = style.alignSelf; + delete style.alignSelf; + } + return wrapper; +} +function fixTextIndent(styles) { + const indent = getMeasurement(styles.textIndent, "0px"); + if (indent >= 0) { + return; + } + const align = styles.textAlign === "right" ? "right" : "left"; + const name = "padding" + (align === "left" ? "Left" : "Right"); + const padding = getMeasurement(styles[name], "0px"); + styles[name] = `${padding - indent}px`; +} +function setAccess(node, classNames) { + switch (node.access) { + case "nonInteractive": + classNames.push("xfaNonInteractive"); + break; + case "readOnly": + classNames.push("xfaReadOnly"); + break; + case "protected": + classNames.push("xfaDisabled"); + break; + } +} +function isPrintOnly(node) { + return node.relevant.length > 0 && !node.relevant[0].excluded && node.relevant[0].viewname === "print"; +} +function getCurrentPara(node) { + const stack = node[$getTemplateRoot]()[$extra].paraStack; + return stack.length ? stack.at(-1) : null; +} +function setPara(node, nodeStyle, value) { + if (value.attributes.class?.includes("xfaRich")) { + if (nodeStyle) { + if (node.h === "") { + nodeStyle.height = "auto"; + } + if (node.w === "") { + nodeStyle.width = "auto"; + } + } + const para = getCurrentPara(node); + if (para) { + const valueStyle = value.attributes.style; + valueStyle.display = "flex"; + valueStyle.flexDirection = "column"; + switch (para.vAlign) { + case "top": + valueStyle.justifyContent = "start"; + break; + case "bottom": + valueStyle.justifyContent = "end"; + break; + case "middle": + valueStyle.justifyContent = "center"; + break; + } + const paraStyle = para[$toStyle](); + for (const [key, val] of Object.entries(paraStyle)) { + if (!(key in valueStyle)) { + valueStyle[key] = val; + } + } + } + } +} +function setFontFamily(xfaFont, node, fontFinder, style) { + if (!fontFinder) { + delete style.fontFamily; + return; + } + const name = stripQuotes(xfaFont.typeface); + style.fontFamily = `"${name}"`; + const typeface = fontFinder.find(name); + if (typeface) { + const { + fontFamily + } = typeface.regular.cssFontInfo; + if (fontFamily !== name) { + style.fontFamily = `"${fontFamily}"`; + } + const para = getCurrentPara(node); + if (para && para.lineHeight !== "") { + return; + } + if (style.lineHeight) { + return; + } + const pdfFont = selectFont(xfaFont, typeface); + if (pdfFont) { + style.lineHeight = Math.max(1.2, pdfFont.lineHeight); + } + } +} +function fixURL(str) { + const absoluteUrl = createValidAbsoluteUrl(str, null, { + addDefaultProtocol: true, + tryConvertEncoding: true + }); + return absoluteUrl ? absoluteUrl.href : null; +} + +;// ./src/core/xfa/layout.js + + +function createLine(node, children) { + return { + name: "div", + attributes: { + class: [node.layout === "lr-tb" ? "xfaLr" : "xfaRl"] + }, + children + }; +} +function flushHTML(node) { + if (!node[$extra]) { + return null; + } + const attributes = node[$extra].attributes; + const html = { + name: "div", + attributes, + children: node[$extra].children + }; + if (node[$extra].failingNode) { + const htmlFromFailing = node[$extra].failingNode[$flushHTML](); + if (htmlFromFailing) { + if (node.layout.endsWith("-tb")) { + html.children.push(createLine(node, [htmlFromFailing])); + } else { + html.children.push(htmlFromFailing); + } + } + } + if (html.children.length === 0) { + return null; + } + return html; +} +function addHTML(node, html, bbox) { + const extra = node[$extra]; + const availableSpace = extra.availableSpace; + const [x, y, w, h] = bbox; + switch (node.layout) { + case "position": + { + extra.width = Math.max(extra.width, x + w); + extra.height = Math.max(extra.height, y + h); + extra.children.push(html); + break; + } + case "lr-tb": + case "rl-tb": + if (!extra.line || extra.attempt === 1) { + extra.line = createLine(node, []); + extra.children.push(extra.line); + extra.numberInLine = 0; + } + extra.numberInLine += 1; + extra.line.children.push(html); + if (extra.attempt === 0) { + extra.currentWidth += w; + extra.height = Math.max(extra.height, extra.prevHeight + h); + } else { + extra.currentWidth = w; + extra.prevHeight = extra.height; + extra.height += h; + extra.attempt = 0; + } + extra.width = Math.max(extra.width, extra.currentWidth); + break; + case "rl-row": + case "row": + { + extra.children.push(html); + extra.width += w; + extra.height = Math.max(extra.height, h); + const height = measureToString(extra.height); + for (const child of extra.children) { + child.attributes.style.height = height; + } + break; + } + case "table": + { + extra.width = Math.min(availableSpace.width, Math.max(extra.width, w)); + extra.height += h; + extra.children.push(html); + break; + } + case "tb": + { + extra.width = Math.min(availableSpace.width, Math.max(extra.width, w)); + extra.height += h; + extra.children.push(html); + break; + } + } +} +function getAvailableSpace(node) { + const availableSpace = node[$extra].availableSpace; + const marginV = node.margin ? node.margin.topInset + node.margin.bottomInset : 0; + const marginH = node.margin ? node.margin.leftInset + node.margin.rightInset : 0; + switch (node.layout) { + case "lr-tb": + case "rl-tb": + if (node[$extra].attempt === 0) { + return { + width: availableSpace.width - marginH - node[$extra].currentWidth, + height: availableSpace.height - marginV - node[$extra].prevHeight + }; + } + return { + width: availableSpace.width - marginH, + height: availableSpace.height - marginV - node[$extra].height + }; + case "rl-row": + case "row": + const width = node[$extra].columnWidths.slice(node[$extra].currentColumn).reduce((a, x) => a + x); + return { + width, + height: availableSpace.height - marginH + }; + case "table": + case "tb": + return { + width: availableSpace.width - marginH, + height: availableSpace.height - marginV - node[$extra].height + }; + case "position": + default: + return availableSpace; + } +} +function getTransformedBBox(node) { + let w = node.w === "" ? NaN : node.w; + let h = node.h === "" ? NaN : node.h; + let [centerX, centerY] = [0, 0]; + switch (node.anchorType || "") { + case "bottomCenter": + [centerX, centerY] = [w / 2, h]; + break; + case "bottomLeft": + [centerX, centerY] = [0, h]; + break; + case "bottomRight": + [centerX, centerY] = [w, h]; + break; + case "middleCenter": + [centerX, centerY] = [w / 2, h / 2]; + break; + case "middleLeft": + [centerX, centerY] = [0, h / 2]; + break; + case "middleRight": + [centerX, centerY] = [w, h / 2]; + break; + case "topCenter": + [centerX, centerY] = [w / 2, 0]; + break; + case "topRight": + [centerX, centerY] = [w, 0]; + break; + } + let x, y; + switch (node.rotate || 0) { + case 0: + [x, y] = [-centerX, -centerY]; + break; + case 90: + [x, y] = [-centerY, centerX]; + [w, h] = [h, -w]; + break; + case 180: + [x, y] = [centerX, centerY]; + [w, h] = [-w, -h]; + break; + case 270: + [x, y] = [centerY, -centerX]; + [w, h] = [-h, w]; + break; + } + return [node.x + x + Math.min(0, w), node.y + y + Math.min(0, h), Math.abs(w), Math.abs(h)]; +} +function checkDimensions(node, space) { + if (node[$getTemplateRoot]()[$extra].firstUnsplittable === null) { + return true; + } + if (node.w === 0 || node.h === 0) { + return true; + } + const ERROR = 2; + const parent = node[$getSubformParent](); + const attempt = parent[$extra]?.attempt || 0; + const [, y, w, h] = getTransformedBBox(node); + switch (parent.layout) { + case "lr-tb": + case "rl-tb": + if (attempt === 0) { + if (!node[$getTemplateRoot]()[$extra].noLayoutFailure) { + if (node.h !== "" && Math.round(h - space.height) > ERROR) { + return false; + } + if (node.w !== "") { + if (Math.round(w - space.width) <= ERROR) { + return true; + } + if (parent[$extra].numberInLine === 0) { + return space.height > ERROR; + } + return false; + } + return space.width > ERROR; + } + if (node.w !== "") { + return Math.round(w - space.width) <= ERROR; + } + return space.width > ERROR; + } + if (node[$getTemplateRoot]()[$extra].noLayoutFailure) { + return true; + } + if (node.h !== "" && Math.round(h - space.height) > ERROR) { + return false; + } + if (node.w === "" || Math.round(w - space.width) <= ERROR) { + return space.height > ERROR; + } + if (parent[$isThereMoreWidth]()) { + return false; + } + return space.height > ERROR; + case "table": + case "tb": + if (node[$getTemplateRoot]()[$extra].noLayoutFailure) { + return true; + } + if (node.h !== "" && !node[$isSplittable]()) { + return Math.round(h - space.height) <= ERROR; + } + if (node.w === "" || Math.round(w - space.width) <= ERROR) { + return space.height > ERROR; + } + if (parent[$isThereMoreWidth]()) { + return false; + } + return space.height > ERROR; + case "position": + if (node[$getTemplateRoot]()[$extra].noLayoutFailure) { + return true; + } + if (node.h === "" || Math.round(h + y - space.height) <= ERROR) { + return true; + } + const area = node[$getTemplateRoot]()[$extra].currentContentArea; + return h + y > area.h; + case "rl-row": + case "row": + if (node[$getTemplateRoot]()[$extra].noLayoutFailure) { + return true; + } + if (node.h !== "") { + return Math.round(h - space.height) <= ERROR; + } + return true; + default: + return true; + } +} + +;// ./src/core/xfa/template.js + + + + + + + + + + +const TEMPLATE_NS_ID = NamespaceIds.template.id; +const SVG_NS = "http://www.w3.org/2000/svg"; +const MAX_ATTEMPTS_FOR_LRTB_LAYOUT = 2; +const MAX_EMPTY_PAGES = 3; +const DEFAULT_TAB_INDEX = 5000; +const HEADING_PATTERN = /^H(\d+)$/; +const MIMES = new Set(["image/gif", "image/jpeg", "image/jpg", "image/pjpeg", "image/png", "image/apng", "image/x-png", "image/bmp", "image/x-ms-bmp", "image/tiff", "image/tif", "application/octet-stream"]); +const IMAGES_HEADERS = [[[0x42, 0x4d], "image/bmp"], [[0xff, 0xd8, 0xff], "image/jpeg"], [[0x49, 0x49, 0x2a, 0x00], "image/tiff"], [[0x4d, 0x4d, 0x00, 0x2a], "image/tiff"], [[0x47, 0x49, 0x46, 0x38, 0x39, 0x61], "image/gif"], [[0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a], "image/png"]]; +function getBorderDims(node) { + if (!node || !node.border) { + return { + w: 0, + h: 0 + }; + } + const borderExtra = node.border[$getExtra](); + if (!borderExtra) { + return { + w: 0, + h: 0 + }; + } + return { + w: borderExtra.widths[0] + borderExtra.widths[2] + borderExtra.insets[0] + borderExtra.insets[2], + h: borderExtra.widths[1] + borderExtra.widths[3] + borderExtra.insets[1] + borderExtra.insets[3] + }; +} +function hasMargin(node) { + return node.margin && (node.margin.topInset || node.margin.rightInset || node.margin.bottomInset || node.margin.leftInset); +} +function _setValue(templateNode, value) { + if (!templateNode.value) { + const nodeValue = new Value({}); + templateNode[$appendChild](nodeValue); + templateNode.value = nodeValue; + } + templateNode.value[$setValue](value); +} +function* getContainedChildren(node) { + for (const child of node[$getChildren]()) { + if (child instanceof SubformSet) { + yield* child[$getContainedChildren](); + continue; + } + yield child; + } +} +function isRequired(node) { + return node.validate?.nullTest === "error"; +} +function setTabIndex(node) { + while (node) { + if (!node.traversal) { + node[$tabIndex] = node[$getParent]()[$tabIndex]; + return; + } + if (node[$tabIndex]) { + return; + } + let next = null; + for (const child of node.traversal[$getChildren]()) { + if (child.operation === "next") { + next = child; + break; + } + } + if (!next || !next.ref) { + node[$tabIndex] = node[$getParent]()[$tabIndex]; + return; + } + const root = node[$getTemplateRoot](); + node[$tabIndex] = ++root[$tabIndex]; + const ref = root[$searchNode](next.ref, node); + if (!ref) { + return; + } + node = ref[0]; + } +} +function applyAssist(obj, attributes) { + const assist = obj.assist; + if (assist) { + const assistTitle = assist[$toHTML](); + if (assistTitle) { + attributes.title = assistTitle; + } + const role = assist.role; + const match = role.match(HEADING_PATTERN); + if (match) { + const ariaRole = "heading"; + const ariaLevel = match[1]; + attributes.role = ariaRole; + attributes["aria-level"] = ariaLevel; + } + } + if (obj.layout === "table") { + attributes.role = "table"; + } else if (obj.layout === "row") { + attributes.role = "row"; + } else { + const parent = obj[$getParent](); + if (parent.layout === "row") { + attributes.role = parent.assist?.role === "TH" ? "columnheader" : "cell"; + } + } +} +function ariaLabel(obj) { + if (!obj.assist) { + return null; + } + const assist = obj.assist; + if (assist.speak && assist.speak[$content] !== "") { + return assist.speak[$content]; + } + if (assist.toolTip) { + return assist.toolTip[$content]; + } + return null; +} +function valueToHtml(value) { + return HTMLResult.success({ + name: "div", + attributes: { + class: ["xfaRich"], + style: Object.create(null) + }, + children: [{ + name: "span", + attributes: { + style: Object.create(null) + }, + value + }] + }); +} +function setFirstUnsplittable(node) { + const root = node[$getTemplateRoot](); + if (root[$extra].firstUnsplittable === null) { + root[$extra].firstUnsplittable = node; + root[$extra].noLayoutFailure = true; + } +} +function unsetFirstUnsplittable(node) { + const root = node[$getTemplateRoot](); + if (root[$extra].firstUnsplittable === node) { + root[$extra].noLayoutFailure = false; + } +} +function handleBreak(node) { + if (node[$extra]) { + return false; + } + node[$extra] = Object.create(null); + if (node.targetType === "auto") { + return false; + } + const root = node[$getTemplateRoot](); + let target = null; + if (node.target) { + target = root[$searchNode](node.target, node[$getParent]()); + if (!target) { + return false; + } + target = target[0]; + } + const { + currentPageArea, + currentContentArea + } = root[$extra]; + if (node.targetType === "pageArea") { + if (!(target instanceof PageArea)) { + target = null; + } + if (node.startNew) { + node[$extra].target = target || currentPageArea; + return true; + } else if (target && target !== currentPageArea) { + node[$extra].target = target; + return true; + } + return false; + } + if (!(target instanceof ContentArea)) { + target = null; + } + const pageArea = target && target[$getParent](); + let index; + let nextPageArea = pageArea; + if (node.startNew) { + if (target) { + const contentAreas = pageArea.contentArea.children; + const indexForCurrent = contentAreas.indexOf(currentContentArea); + const indexForTarget = contentAreas.indexOf(target); + if (indexForCurrent !== -1 && indexForCurrent < indexForTarget) { + nextPageArea = null; + } + index = indexForTarget - 1; + } else { + index = currentPageArea.contentArea.children.indexOf(currentContentArea); + } + } else if (target && target !== currentContentArea) { + const contentAreas = pageArea.contentArea.children; + index = contentAreas.indexOf(target) - 1; + nextPageArea = pageArea === currentPageArea ? null : pageArea; + } else { + return false; + } + node[$extra].target = nextPageArea; + node[$extra].index = index; + return true; +} +function handleOverflow(node, extraNode, space) { + const root = node[$getTemplateRoot](); + const saved = root[$extra].noLayoutFailure; + const savedMethod = extraNode[$getSubformParent]; + extraNode[$getSubformParent] = () => node; + root[$extra].noLayoutFailure = true; + const res = extraNode[$toHTML](space); + node[$addHTML](res.html, res.bbox); + root[$extra].noLayoutFailure = saved; + extraNode[$getSubformParent] = savedMethod; +} +class AppearanceFilter extends StringObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "appearanceFilter"); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Arc extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "arc", true); + this.circular = getInteger({ + data: attributes.circular, + defaultValue: 0, + validate: x => x === 1 + }); + this.hand = getStringOption(attributes.hand, ["even", "left", "right"]); + this.id = attributes.id || ""; + this.startAngle = getFloat({ + data: attributes.startAngle, + defaultValue: 0, + validate: x => true + }); + this.sweepAngle = getFloat({ + data: attributes.sweepAngle, + defaultValue: 360, + validate: x => true + }); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.edge = null; + this.fill = null; + } + [$toHTML]() { + const edge = this.edge || new Edge({}); + const edgeStyle = edge[$toStyle](); + const style = Object.create(null); + if (this.fill?.presence === "visible") { + Object.assign(style, this.fill[$toStyle]()); + } else { + style.fill = "transparent"; + } + style.strokeWidth = measureToString(edge.presence === "visible" ? edge.thickness : 0); + style.stroke = edgeStyle.color; + let arc; + const attributes = { + xmlns: SVG_NS, + style: { + width: "100%", + height: "100%", + overflow: "visible" + } + }; + if (this.sweepAngle === 360) { + arc = { + name: "ellipse", + attributes: { + xmlns: SVG_NS, + cx: "50%", + cy: "50%", + rx: "50%", + ry: "50%", + style + } + }; + } else { + const startAngle = this.startAngle * Math.PI / 180; + const sweepAngle = this.sweepAngle * Math.PI / 180; + const largeArc = this.sweepAngle > 180 ? 1 : 0; + const [x1, y1, x2, y2] = [50 * (1 + Math.cos(startAngle)), 50 * (1 - Math.sin(startAngle)), 50 * (1 + Math.cos(startAngle + sweepAngle)), 50 * (1 - Math.sin(startAngle + sweepAngle))]; + arc = { + name: "path", + attributes: { + xmlns: SVG_NS, + d: `M ${x1} ${y1} A 50 50 0 ${largeArc} 0 ${x2} ${y2}`, + vectorEffect: "non-scaling-stroke", + style + } + }; + Object.assign(attributes, { + viewBox: "0 0 100 100", + preserveAspectRatio: "none" + }); + } + const svg = { + name: "svg", + children: [arc], + attributes + }; + const parent = this[$getParent]()[$getParent](); + if (hasMargin(parent)) { + return HTMLResult.success({ + name: "div", + attributes: { + style: { + display: "inline", + width: "100%", + height: "100%" + } + }, + children: [svg] + }); + } + svg.attributes.style.position = "absolute"; + return HTMLResult.success(svg); + } +} +class Area extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "area", true); + this.colSpan = getInteger({ + data: attributes.colSpan, + defaultValue: 1, + validate: n => n >= 1 || n === -1 + }); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.relevant = getRelevant(attributes.relevant); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.x = getMeasurement(attributes.x, "0pt"); + this.y = getMeasurement(attributes.y, "0pt"); + this.desc = null; + this.extras = null; + this.area = new XFAObjectArray(); + this.draw = new XFAObjectArray(); + this.exObject = new XFAObjectArray(); + this.exclGroup = new XFAObjectArray(); + this.field = new XFAObjectArray(); + this.subform = new XFAObjectArray(); + this.subformSet = new XFAObjectArray(); + } + *[$getContainedChildren]() { + yield* getContainedChildren(this); + } + [$isTransparent]() { + return true; + } + [$isBindable]() { + return true; + } + [$addHTML](html, bbox) { + const [x, y, w, h] = bbox; + this[$extra].width = Math.max(this[$extra].width, x + w); + this[$extra].height = Math.max(this[$extra].height, y + h); + this[$extra].children.push(html); + } + [$getAvailableSpace]() { + return this[$extra].availableSpace; + } + [$toHTML](availableSpace) { + const style = toStyle(this, "position"); + const attributes = { + style, + id: this[$uid], + class: ["xfaArea"] + }; + if (isPrintOnly(this)) { + attributes.class.push("xfaPrintOnly"); + } + if (this.name) { + attributes.xfaName = this.name; + } + const children = []; + this[$extra] = { + children, + width: 0, + height: 0, + availableSpace + }; + const result = this[$childrenToHTML]({ + filter: new Set(["area", "draw", "field", "exclGroup", "subform", "subformSet"]), + include: true + }); + if (!result.success) { + if (result.isBreak()) { + return result; + } + delete this[$extra]; + return HTMLResult.FAILURE; + } + style.width = measureToString(this[$extra].width); + style.height = measureToString(this[$extra].height); + const html = { + name: "div", + attributes, + children + }; + const bbox = [this.x, this.y, this[$extra].width, this[$extra].height]; + delete this[$extra]; + return HTMLResult.success(html, bbox); + } +} +class Assist extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "assist", true); + this.id = attributes.id || ""; + this.role = attributes.role || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.speak = null; + this.toolTip = null; + } + [$toHTML]() { + return this.toolTip?.[$content] || null; + } +} +class Barcode extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "barcode", true); + this.charEncoding = getKeyword({ + data: attributes.charEncoding ? attributes.charEncoding.toLowerCase() : "", + defaultValue: "", + validate: k => ["utf-8", "big-five", "fontspecific", "gbk", "gb-18030", "gb-2312", "ksc-5601", "none", "shift-jis", "ucs-2", "utf-16"].includes(k) || k.match(/iso-8859-\d{2}/) + }); + this.checksum = getStringOption(attributes.checksum, ["none", "1mod10", "1mod10_1mod11", "2mod10", "auto"]); + this.dataColumnCount = getInteger({ + data: attributes.dataColumnCount, + defaultValue: -1, + validate: x => x >= 0 + }); + this.dataLength = getInteger({ + data: attributes.dataLength, + defaultValue: -1, + validate: x => x >= 0 + }); + this.dataPrep = getStringOption(attributes.dataPrep, ["none", "flateCompress"]); + this.dataRowCount = getInteger({ + data: attributes.dataRowCount, + defaultValue: -1, + validate: x => x >= 0 + }); + this.endChar = attributes.endChar || ""; + this.errorCorrectionLevel = getInteger({ + data: attributes.errorCorrectionLevel, + defaultValue: -1, + validate: x => x >= 0 && x <= 8 + }); + this.id = attributes.id || ""; + this.moduleHeight = getMeasurement(attributes.moduleHeight, "5mm"); + this.moduleWidth = getMeasurement(attributes.moduleWidth, "0.25mm"); + this.printCheckDigit = getInteger({ + data: attributes.printCheckDigit, + defaultValue: 0, + validate: x => x === 1 + }); + this.rowColumnRatio = getRatio(attributes.rowColumnRatio); + this.startChar = attributes.startChar || ""; + this.textLocation = getStringOption(attributes.textLocation, ["below", "above", "aboveEmbedded", "belowEmbedded", "none"]); + this.truncate = getInteger({ + data: attributes.truncate, + defaultValue: 0, + validate: x => x === 1 + }); + this.type = getStringOption(attributes.type ? attributes.type.toLowerCase() : "", ["aztec", "codabar", "code2of5industrial", "code2of5interleaved", "code2of5matrix", "code2of5standard", "code3of9", "code3of9extended", "code11", "code49", "code93", "code128", "code128a", "code128b", "code128c", "code128sscc", "datamatrix", "ean8", "ean8add2", "ean8add5", "ean13", "ean13add2", "ean13add5", "ean13pwcd", "fim", "logmars", "maxicode", "msi", "pdf417", "pdf417macro", "plessey", "postauscust2", "postauscust3", "postausreplypaid", "postausstandard", "postukrm4scc", "postusdpbc", "postusimb", "postusstandard", "postus5zip", "qrcode", "rfid", "rss14", "rss14expanded", "rss14limited", "rss14stacked", "rss14stackedomni", "rss14truncated", "telepen", "ucc128", "ucc128random", "ucc128sscc", "upca", "upcaadd2", "upcaadd5", "upcapwcd", "upce", "upceadd2", "upceadd5", "upcean2", "upcean5", "upsmaxicode"]); + this.upsMode = getStringOption(attributes.upsMode, ["usCarrier", "internationalCarrier", "secureSymbol", "standardSymbol"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.wideNarrowRatio = getRatio(attributes.wideNarrowRatio); + this.encrypt = null; + this.extras = null; + } +} +class Bind extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "bind", true); + this.match = getStringOption(attributes.match, ["once", "dataRef", "global", "none"]); + this.ref = attributes.ref || ""; + this.picture = null; + } +} +class BindItems extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "bindItems"); + this.connection = attributes.connection || ""; + this.labelRef = attributes.labelRef || ""; + this.ref = attributes.ref || ""; + this.valueRef = attributes.valueRef || ""; + } +} +class Bookend extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "bookend"); + this.id = attributes.id || ""; + this.leader = attributes.leader || ""; + this.trailer = attributes.trailer || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class BooleanElement extends Option01 { + constructor(attributes) { + super(TEMPLATE_NS_ID, "boolean"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } + [$toHTML](availableSpace) { + return valueToHtml(this[$content] === 1 ? "1" : "0"); + } +} +class Border extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "border", true); + this.break = getStringOption(attributes.break, ["close", "open"]); + this.hand = getStringOption(attributes.hand, ["even", "left", "right"]); + this.id = attributes.id || ""; + this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]); + this.relevant = getRelevant(attributes.relevant); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.corner = new XFAObjectArray(4); + this.edge = new XFAObjectArray(4); + this.extras = null; + this.fill = null; + this.margin = null; + } + [$getExtra]() { + if (!this[$extra]) { + const edges = this.edge.children.slice(); + if (edges.length < 4) { + const defaultEdge = edges.at(-1) || new Edge({}); + for (let i = edges.length; i < 4; i++) { + edges.push(defaultEdge); + } + } + const widths = edges.map(edge => edge.thickness); + const insets = [0, 0, 0, 0]; + if (this.margin) { + insets[0] = this.margin.topInset; + insets[1] = this.margin.rightInset; + insets[2] = this.margin.bottomInset; + insets[3] = this.margin.leftInset; + } + this[$extra] = { + widths, + insets, + edges + }; + } + return this[$extra]; + } + [$toStyle]() { + const { + edges + } = this[$getExtra](); + const edgeStyles = edges.map(node => { + const style = node[$toStyle](); + style.color ||= "#000000"; + return style; + }); + const style = Object.create(null); + if (this.margin) { + Object.assign(style, this.margin[$toStyle]()); + } + if (this.fill?.presence === "visible") { + Object.assign(style, this.fill[$toStyle]()); + } + if (this.corner.children.some(node => node.radius !== 0)) { + const cornerStyles = this.corner.children.map(node => node[$toStyle]()); + if (cornerStyles.length === 2 || cornerStyles.length === 3) { + const last = cornerStyles.at(-1); + for (let i = cornerStyles.length; i < 4; i++) { + cornerStyles.push(last); + } + } + style.borderRadius = cornerStyles.map(s => s.radius).join(" "); + } + switch (this.presence) { + case "invisible": + case "hidden": + style.borderStyle = ""; + break; + case "inactive": + style.borderStyle = "none"; + break; + default: + style.borderStyle = edgeStyles.map(s => s.style).join(" "); + break; + } + style.borderWidth = edgeStyles.map(s => s.width).join(" "); + style.borderColor = edgeStyles.map(s => s.color).join(" "); + return style; + } +} +class Break extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "break", true); + this.after = getStringOption(attributes.after, ["auto", "contentArea", "pageArea", "pageEven", "pageOdd"]); + this.afterTarget = attributes.afterTarget || ""; + this.before = getStringOption(attributes.before, ["auto", "contentArea", "pageArea", "pageEven", "pageOdd"]); + this.beforeTarget = attributes.beforeTarget || ""; + this.bookendLeader = attributes.bookendLeader || ""; + this.bookendTrailer = attributes.bookendTrailer || ""; + this.id = attributes.id || ""; + this.overflowLeader = attributes.overflowLeader || ""; + this.overflowTarget = attributes.overflowTarget || ""; + this.overflowTrailer = attributes.overflowTrailer || ""; + this.startNew = getInteger({ + data: attributes.startNew, + defaultValue: 0, + validate: x => x === 1 + }); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + } +} +class BreakAfter extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "breakAfter", true); + this.id = attributes.id || ""; + this.leader = attributes.leader || ""; + this.startNew = getInteger({ + data: attributes.startNew, + defaultValue: 0, + validate: x => x === 1 + }); + this.target = attributes.target || ""; + this.targetType = getStringOption(attributes.targetType, ["auto", "contentArea", "pageArea"]); + this.trailer = attributes.trailer || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.script = null; + } +} +class BreakBefore extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "breakBefore", true); + this.id = attributes.id || ""; + this.leader = attributes.leader || ""; + this.startNew = getInteger({ + data: attributes.startNew, + defaultValue: 0, + validate: x => x === 1 + }); + this.target = attributes.target || ""; + this.targetType = getStringOption(attributes.targetType, ["auto", "contentArea", "pageArea"]); + this.trailer = attributes.trailer || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.script = null; + } + [$toHTML](availableSpace) { + this[$extra] = {}; + return HTMLResult.FAILURE; + } +} +class Button extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "button", true); + this.highlight = getStringOption(attributes.highlight, ["inverted", "none", "outline", "push"]); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + } + [$toHTML](availableSpace) { + const parent = this[$getParent](); + const grandpa = parent[$getParent](); + const htmlButton = { + name: "button", + attributes: { + id: this[$uid], + class: ["xfaButton"], + style: {} + }, + children: [] + }; + for (const event of grandpa.event.children) { + if (event.activity !== "click" || !event.script) { + continue; + } + const jsURL = recoverJsURL(event.script[$content]); + if (!jsURL) { + continue; + } + const href = fixURL(jsURL.url); + if (!href) { + continue; + } + htmlButton.children.push({ + name: "a", + attributes: { + id: "link" + this[$uid], + href, + newWindow: jsURL.newWindow, + class: ["xfaLink"], + style: {} + }, + children: [] + }); + } + return HTMLResult.success(htmlButton); + } +} +class Calculate extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "calculate", true); + this.id = attributes.id || ""; + this.override = getStringOption(attributes.override, ["disabled", "error", "ignore", "warning"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + this.message = null; + this.script = null; + } +} +class Caption extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "caption", true); + this.id = attributes.id || ""; + this.placement = getStringOption(attributes.placement, ["left", "bottom", "inline", "right", "top"]); + this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]); + this.reserve = Math.ceil(getMeasurement(attributes.reserve)); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + this.font = null; + this.margin = null; + this.para = null; + this.value = null; + } + [$setValue](value) { + _setValue(this, value); + } + [$getExtra](availableSpace) { + if (!this[$extra]) { + let { + width, + height + } = availableSpace; + switch (this.placement) { + case "left": + case "right": + case "inline": + width = this.reserve <= 0 ? width : this.reserve; + break; + case "top": + case "bottom": + height = this.reserve <= 0 ? height : this.reserve; + break; + } + this[$extra] = layoutNode(this, { + width, + height + }); + } + return this[$extra]; + } + [$toHTML](availableSpace) { + if (!this.value) { + return HTMLResult.EMPTY; + } + this[$pushPara](); + const value = this.value[$toHTML](availableSpace).html; + if (!value) { + this[$popPara](); + return HTMLResult.EMPTY; + } + const savedReserve = this.reserve; + if (this.reserve <= 0) { + const { + w, + h + } = this[$getExtra](availableSpace); + switch (this.placement) { + case "left": + case "right": + case "inline": + this.reserve = w; + break; + case "top": + case "bottom": + this.reserve = h; + break; + } + } + const children = []; + if (typeof value === "string") { + children.push({ + name: "#text", + value + }); + } else { + children.push(value); + } + const style = toStyle(this, "font", "margin", "visibility"); + switch (this.placement) { + case "left": + case "right": + if (this.reserve > 0) { + style.width = measureToString(this.reserve); + } + break; + case "top": + case "bottom": + if (this.reserve > 0) { + style.height = measureToString(this.reserve); + } + break; + } + setPara(this, null, value); + this[$popPara](); + this.reserve = savedReserve; + return HTMLResult.success({ + name: "div", + attributes: { + style, + class: ["xfaCaption"] + }, + children + }); + } +} +class Certificate extends StringObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "certificate"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Certificates extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "certificates", true); + this.credentialServerPolicy = getStringOption(attributes.credentialServerPolicy, ["optional", "required"]); + this.id = attributes.id || ""; + this.url = attributes.url || ""; + this.urlPolicy = attributes.urlPolicy || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.encryption = null; + this.issuers = null; + this.keyUsage = null; + this.oids = null; + this.signing = null; + this.subjectDNs = null; + } +} +class CheckButton extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "checkButton", true); + this.id = attributes.id || ""; + this.mark = getStringOption(attributes.mark, ["default", "check", "circle", "cross", "diamond", "square", "star"]); + this.shape = getStringOption(attributes.shape, ["square", "round"]); + this.size = getMeasurement(attributes.size, "10pt"); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.border = null; + this.extras = null; + this.margin = null; + } + [$toHTML](availableSpace) { + const style = toStyle("margin"); + const size = measureToString(this.size); + style.width = style.height = size; + let type; + let className; + let groupId; + const field = this[$getParent]()[$getParent](); + const items = field.items.children.length && field.items.children[0][$toHTML]().html || []; + const exportedValue = { + on: (items[0] !== undefined ? items[0] : "on").toString(), + off: (items[1] !== undefined ? items[1] : "off").toString() + }; + const value = field.value?.[$text]() || "off"; + const checked = value === exportedValue.on || undefined; + const container = field[$getSubformParent](); + const fieldId = field[$uid]; + let dataId; + if (container instanceof ExclGroup) { + groupId = container[$uid]; + type = "radio"; + className = "xfaRadio"; + dataId = container[$data]?.[$uid] || container[$uid]; + } else { + type = "checkbox"; + className = "xfaCheckbox"; + dataId = field[$data]?.[$uid] || field[$uid]; + } + const input = { + name: "input", + attributes: { + class: [className], + style, + fieldId, + dataId, + type, + checked, + xfaOn: exportedValue.on, + xfaOff: exportedValue.off, + "aria-label": ariaLabel(field), + "aria-required": false + } + }; + if (groupId) { + input.attributes.name = groupId; + } + if (isRequired(field)) { + input.attributes["aria-required"] = true; + input.attributes.required = true; + } + return HTMLResult.success({ + name: "label", + attributes: { + class: ["xfaLabel"] + }, + children: [input] + }); + } +} +class ChoiceList extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "choiceList", true); + this.commitOn = getStringOption(attributes.commitOn, ["select", "exit"]); + this.id = attributes.id || ""; + this.open = getStringOption(attributes.open, ["userControl", "always", "multiSelect", "onEntry"]); + this.textEntry = getInteger({ + data: attributes.textEntry, + defaultValue: 0, + validate: x => x === 1 + }); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.border = null; + this.extras = null; + this.margin = null; + } + [$toHTML](availableSpace) { + const style = toStyle(this, "border", "margin"); + const ui = this[$getParent](); + const field = ui[$getParent](); + const fontSize = field.font?.size || 10; + const optionStyle = { + fontSize: `calc(${fontSize}px * var(--scale-factor))` + }; + const children = []; + if (field.items.children.length > 0) { + const items = field.items; + let displayedIndex = 0; + let saveIndex = 0; + if (items.children.length === 2) { + displayedIndex = items.children[0].save; + saveIndex = 1 - displayedIndex; + } + const displayed = items.children[displayedIndex][$toHTML]().html; + const values = items.children[saveIndex][$toHTML]().html; + let selected = false; + const value = field.value?.[$text]() || ""; + for (let i = 0, ii = displayed.length; i < ii; i++) { + const option = { + name: "option", + attributes: { + value: values[i] || displayed[i], + style: optionStyle + }, + value: displayed[i] + }; + if (values[i] === value) { + option.attributes.selected = selected = true; + } + children.push(option); + } + if (!selected) { + children.splice(0, 0, { + name: "option", + attributes: { + hidden: true, + selected: true + }, + value: " " + }); + } + } + const selectAttributes = { + class: ["xfaSelect"], + fieldId: field[$uid], + dataId: field[$data]?.[$uid] || field[$uid], + style, + "aria-label": ariaLabel(field), + "aria-required": false + }; + if (isRequired(field)) { + selectAttributes["aria-required"] = true; + selectAttributes.required = true; + } + if (this.open === "multiSelect") { + selectAttributes.multiple = true; + } + return HTMLResult.success({ + name: "label", + attributes: { + class: ["xfaLabel"] + }, + children: [{ + name: "select", + children, + attributes: selectAttributes + }] + }); + } +} +class Color extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "color", true); + this.cSpace = getStringOption(attributes.cSpace, ["SRGB"]); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.value = attributes.value ? getColor(attributes.value) : ""; + this.extras = null; + } + [$hasSettableValue]() { + return false; + } + [$toStyle]() { + return this.value ? Util.makeHexColor(this.value.r, this.value.g, this.value.b) : null; + } +} +class Comb extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "comb"); + this.id = attributes.id || ""; + this.numberOfCells = getInteger({ + data: attributes.numberOfCells, + defaultValue: 0, + validate: x => x >= 0 + }); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Connect extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "connect", true); + this.connection = attributes.connection || ""; + this.id = attributes.id || ""; + this.ref = attributes.ref || ""; + this.usage = getStringOption(attributes.usage, ["exportAndImport", "exportOnly", "importOnly"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.picture = null; + } +} +class ContentArea extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "contentArea", true); + this.h = getMeasurement(attributes.h); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.relevant = getRelevant(attributes.relevant); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.w = getMeasurement(attributes.w); + this.x = getMeasurement(attributes.x, "0pt"); + this.y = getMeasurement(attributes.y, "0pt"); + this.desc = null; + this.extras = null; + } + [$toHTML](availableSpace) { + const left = measureToString(this.x); + const top = measureToString(this.y); + const style = { + left, + top, + width: measureToString(this.w), + height: measureToString(this.h) + }; + const classNames = ["xfaContentarea"]; + if (isPrintOnly(this)) { + classNames.push("xfaPrintOnly"); + } + return HTMLResult.success({ + name: "div", + children: [], + attributes: { + style, + class: classNames, + id: this[$uid] + } + }); + } +} +class Corner extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "corner", true); + this.id = attributes.id || ""; + this.inverted = getInteger({ + data: attributes.inverted, + defaultValue: 0, + validate: x => x === 1 + }); + this.join = getStringOption(attributes.join, ["square", "round"]); + this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]); + this.radius = getMeasurement(attributes.radius); + this.stroke = getStringOption(attributes.stroke, ["solid", "dashDot", "dashDotDot", "dashed", "dotted", "embossed", "etched", "lowered", "raised"]); + this.thickness = getMeasurement(attributes.thickness, "0.5pt"); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.color = null; + this.extras = null; + } + [$toStyle]() { + const style = toStyle(this, "visibility"); + style.radius = measureToString(this.join === "square" ? 0 : this.radius); + return style; + } +} +class DateElement extends ContentObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "date"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } + [$finalize]() { + const date = this[$content].trim(); + this[$content] = date ? new Date(date) : null; + } + [$toHTML](availableSpace) { + return valueToHtml(this[$content] ? this[$content].toString() : ""); + } +} +class DateTime extends ContentObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "dateTime"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } + [$finalize]() { + const date = this[$content].trim(); + this[$content] = date ? new Date(date) : null; + } + [$toHTML](availableSpace) { + return valueToHtml(this[$content] ? this[$content].toString() : ""); + } +} +class DateTimeEdit extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "dateTimeEdit", true); + this.hScrollPolicy = getStringOption(attributes.hScrollPolicy, ["auto", "off", "on"]); + this.id = attributes.id || ""; + this.picker = getStringOption(attributes.picker, ["host", "none"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.border = null; + this.comb = null; + this.extras = null; + this.margin = null; + } + [$toHTML](availableSpace) { + const style = toStyle(this, "border", "font", "margin"); + const field = this[$getParent]()[$getParent](); + const html = { + name: "input", + attributes: { + type: "text", + fieldId: field[$uid], + dataId: field[$data]?.[$uid] || field[$uid], + class: ["xfaTextfield"], + style, + "aria-label": ariaLabel(field), + "aria-required": false + } + }; + if (isRequired(field)) { + html.attributes["aria-required"] = true; + html.attributes.required = true; + } + return HTMLResult.success({ + name: "label", + attributes: { + class: ["xfaLabel"] + }, + children: [html] + }); + } +} +class Decimal extends ContentObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "decimal"); + this.fracDigits = getInteger({ + data: attributes.fracDigits, + defaultValue: 2, + validate: x => true + }); + this.id = attributes.id || ""; + this.leadDigits = getInteger({ + data: attributes.leadDigits, + defaultValue: -1, + validate: x => true + }); + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } + [$finalize]() { + const number = parseFloat(this[$content].trim()); + this[$content] = isNaN(number) ? null : number; + } + [$toHTML](availableSpace) { + return valueToHtml(this[$content] !== null ? this[$content].toString() : ""); + } +} +class DefaultUi extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "defaultUi", true); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + } +} +class Desc extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "desc", true); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.boolean = new XFAObjectArray(); + this.date = new XFAObjectArray(); + this.dateTime = new XFAObjectArray(); + this.decimal = new XFAObjectArray(); + this.exData = new XFAObjectArray(); + this.float = new XFAObjectArray(); + this.image = new XFAObjectArray(); + this.integer = new XFAObjectArray(); + this.text = new XFAObjectArray(); + this.time = new XFAObjectArray(); + } +} +class DigestMethod extends OptionObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "digestMethod", ["", "SHA1", "SHA256", "SHA512", "RIPEMD160"]); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class DigestMethods extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "digestMethods", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.digestMethod = new XFAObjectArray(); + } +} +class Draw extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "draw", true); + this.anchorType = getStringOption(attributes.anchorType, ["topLeft", "bottomCenter", "bottomLeft", "bottomRight", "middleCenter", "middleLeft", "middleRight", "topCenter", "topRight"]); + this.colSpan = getInteger({ + data: attributes.colSpan, + defaultValue: 1, + validate: n => n >= 1 || n === -1 + }); + this.h = attributes.h ? getMeasurement(attributes.h) : ""; + this.hAlign = getStringOption(attributes.hAlign, ["left", "center", "justify", "justifyAll", "radix", "right"]); + this.id = attributes.id || ""; + this.locale = attributes.locale || ""; + this.maxH = getMeasurement(attributes.maxH, "0pt"); + this.maxW = getMeasurement(attributes.maxW, "0pt"); + this.minH = getMeasurement(attributes.minH, "0pt"); + this.minW = getMeasurement(attributes.minW, "0pt"); + this.name = attributes.name || ""; + this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]); + this.relevant = getRelevant(attributes.relevant); + this.rotate = getInteger({ + data: attributes.rotate, + defaultValue: 0, + validate: x => x % 90 === 0 + }); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.w = attributes.w ? getMeasurement(attributes.w) : ""; + this.x = getMeasurement(attributes.x, "0pt"); + this.y = getMeasurement(attributes.y, "0pt"); + this.assist = null; + this.border = null; + this.caption = null; + this.desc = null; + this.extras = null; + this.font = null; + this.keep = null; + this.margin = null; + this.para = null; + this.traversal = null; + this.ui = null; + this.value = null; + this.setProperty = new XFAObjectArray(); + } + [$setValue](value) { + _setValue(this, value); + } + [$toHTML](availableSpace) { + setTabIndex(this); + if (this.presence === "hidden" || this.presence === "inactive") { + return HTMLResult.EMPTY; + } + fixDimensions(this); + this[$pushPara](); + const savedW = this.w; + const savedH = this.h; + const { + w, + h, + isBroken + } = layoutNode(this, availableSpace); + if (w && this.w === "") { + if (isBroken && this[$getSubformParent]()[$isThereMoreWidth]()) { + this[$popPara](); + return HTMLResult.FAILURE; + } + this.w = w; + } + if (h && this.h === "") { + this.h = h; + } + setFirstUnsplittable(this); + if (!checkDimensions(this, availableSpace)) { + this.w = savedW; + this.h = savedH; + this[$popPara](); + return HTMLResult.FAILURE; + } + unsetFirstUnsplittable(this); + const style = toStyle(this, "font", "hAlign", "dimensions", "position", "presence", "rotate", "anchorType", "border", "margin"); + setMinMaxDimensions(this, style); + if (style.margin) { + style.padding = style.margin; + delete style.margin; + } + const classNames = ["xfaDraw"]; + if (this.font) { + classNames.push("xfaFont"); + } + if (isPrintOnly(this)) { + classNames.push("xfaPrintOnly"); + } + const attributes = { + style, + id: this[$uid], + class: classNames + }; + if (this.name) { + attributes.xfaName = this.name; + } + const html = { + name: "div", + attributes, + children: [] + }; + applyAssist(this, attributes); + const bbox = computeBbox(this, html, availableSpace); + const value = this.value ? this.value[$toHTML](availableSpace).html : null; + if (value === null) { + this.w = savedW; + this.h = savedH; + this[$popPara](); + return HTMLResult.success(createWrapper(this, html), bbox); + } + html.children.push(value); + setPara(this, style, value); + this.w = savedW; + this.h = savedH; + this[$popPara](); + return HTMLResult.success(createWrapper(this, html), bbox); + } +} +class Edge extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "edge", true); + this.cap = getStringOption(attributes.cap, ["square", "butt", "round"]); + this.id = attributes.id || ""; + this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]); + this.stroke = getStringOption(attributes.stroke, ["solid", "dashDot", "dashDotDot", "dashed", "dotted", "embossed", "etched", "lowered", "raised"]); + this.thickness = getMeasurement(attributes.thickness, "0.5pt"); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.color = null; + this.extras = null; + } + [$toStyle]() { + const style = toStyle(this, "visibility"); + Object.assign(style, { + linecap: this.cap, + width: measureToString(this.thickness), + color: this.color ? this.color[$toStyle]() : "#000000", + style: "" + }); + if (this.presence !== "visible") { + style.style = "none"; + } else { + switch (this.stroke) { + case "solid": + style.style = "solid"; + break; + case "dashDot": + style.style = "dashed"; + break; + case "dashDotDot": + style.style = "dashed"; + break; + case "dashed": + style.style = "dashed"; + break; + case "dotted": + style.style = "dotted"; + break; + case "embossed": + style.style = "ridge"; + break; + case "etched": + style.style = "groove"; + break; + case "lowered": + style.style = "inset"; + break; + case "raised": + style.style = "outset"; + break; + } + } + return style; + } +} +class Encoding extends OptionObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "encoding", ["adbe.x509.rsa_sha1", "adbe.pkcs7.detached", "adbe.pkcs7.sha1"]); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Encodings extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "encodings", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.encoding = new XFAObjectArray(); + } +} +class Encrypt extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "encrypt", true); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.certificate = null; + } +} +class EncryptData extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "encryptData", true); + this.id = attributes.id || ""; + this.operation = getStringOption(attributes.operation, ["encrypt", "decrypt"]); + this.target = attributes.target || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.filter = null; + this.manifest = null; + } +} +class Encryption extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "encryption", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.certificate = new XFAObjectArray(); + } +} +class EncryptionMethod extends OptionObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "encryptionMethod", ["", "AES256-CBC", "TRIPLEDES-CBC", "AES128-CBC", "AES192-CBC"]); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class EncryptionMethods extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "encryptionMethods", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.encryptionMethod = new XFAObjectArray(); + } +} +class Event extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "event", true); + this.activity = getStringOption(attributes.activity, ["click", "change", "docClose", "docReady", "enter", "exit", "full", "indexChange", "initialize", "mouseDown", "mouseEnter", "mouseExit", "mouseUp", "postExecute", "postOpen", "postPrint", "postSave", "postSign", "postSubmit", "preExecute", "preOpen", "prePrint", "preSave", "preSign", "preSubmit", "ready", "validationState"]); + this.id = attributes.id || ""; + this.listen = getStringOption(attributes.listen, ["refOnly", "refAndDescendents"]); + this.name = attributes.name || ""; + this.ref = attributes.ref || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + this.encryptData = null; + this.execute = null; + this.script = null; + this.signData = null; + this.submit = null; + } +} +class ExData extends ContentObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "exData"); + this.contentType = attributes.contentType || ""; + this.href = attributes.href || ""; + this.id = attributes.id || ""; + this.maxLength = getInteger({ + data: attributes.maxLength, + defaultValue: -1, + validate: x => x >= -1 + }); + this.name = attributes.name || ""; + this.rid = attributes.rid || ""; + this.transferEncoding = getStringOption(attributes.transferEncoding, ["none", "base64", "package"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } + [$isCDATAXml]() { + return this.contentType === "text/html"; + } + [$onChild](child) { + if (this.contentType === "text/html" && child[$namespaceId] === NamespaceIds.xhtml.id) { + this[$content] = child; + return true; + } + if (this.contentType === "text/xml") { + this[$content] = child; + return true; + } + return false; + } + [$toHTML](availableSpace) { + if (this.contentType !== "text/html" || !this[$content]) { + return HTMLResult.EMPTY; + } + return this[$content][$toHTML](availableSpace); + } +} +class ExObject extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "exObject", true); + this.archive = attributes.archive || ""; + this.classId = attributes.classId || ""; + this.codeBase = attributes.codeBase || ""; + this.codeType = attributes.codeType || ""; + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + this.boolean = new XFAObjectArray(); + this.date = new XFAObjectArray(); + this.dateTime = new XFAObjectArray(); + this.decimal = new XFAObjectArray(); + this.exData = new XFAObjectArray(); + this.exObject = new XFAObjectArray(); + this.float = new XFAObjectArray(); + this.image = new XFAObjectArray(); + this.integer = new XFAObjectArray(); + this.text = new XFAObjectArray(); + this.time = new XFAObjectArray(); + } +} +class ExclGroup extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "exclGroup", true); + this.access = getStringOption(attributes.access, ["open", "nonInteractive", "protected", "readOnly"]); + this.accessKey = attributes.accessKey || ""; + this.anchorType = getStringOption(attributes.anchorType, ["topLeft", "bottomCenter", "bottomLeft", "bottomRight", "middleCenter", "middleLeft", "middleRight", "topCenter", "topRight"]); + this.colSpan = getInteger({ + data: attributes.colSpan, + defaultValue: 1, + validate: n => n >= 1 || n === -1 + }); + this.h = attributes.h ? getMeasurement(attributes.h) : ""; + this.hAlign = getStringOption(attributes.hAlign, ["left", "center", "justify", "justifyAll", "radix", "right"]); + this.id = attributes.id || ""; + this.layout = getStringOption(attributes.layout, ["position", "lr-tb", "rl-row", "rl-tb", "row", "table", "tb"]); + this.maxH = getMeasurement(attributes.maxH, "0pt"); + this.maxW = getMeasurement(attributes.maxW, "0pt"); + this.minH = getMeasurement(attributes.minH, "0pt"); + this.minW = getMeasurement(attributes.minW, "0pt"); + this.name = attributes.name || ""; + this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]); + this.relevant = getRelevant(attributes.relevant); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.w = attributes.w ? getMeasurement(attributes.w) : ""; + this.x = getMeasurement(attributes.x, "0pt"); + this.y = getMeasurement(attributes.y, "0pt"); + this.assist = null; + this.bind = null; + this.border = null; + this.calculate = null; + this.caption = null; + this.desc = null; + this.extras = null; + this.margin = null; + this.para = null; + this.traversal = null; + this.validate = null; + this.connect = new XFAObjectArray(); + this.event = new XFAObjectArray(); + this.field = new XFAObjectArray(); + this.setProperty = new XFAObjectArray(); + } + [$isBindable]() { + return true; + } + [$hasSettableValue]() { + return true; + } + [$setValue](value) { + for (const field of this.field.children) { + if (!field.value) { + const nodeValue = new Value({}); + field[$appendChild](nodeValue); + field.value = nodeValue; + } + field.value[$setValue](value); + } + } + [$isThereMoreWidth]() { + return this.layout.endsWith("-tb") && this[$extra].attempt === 0 && this[$extra].numberInLine > 0 || this[$getParent]()[$isThereMoreWidth](); + } + [$isSplittable]() { + const parent = this[$getSubformParent](); + if (!parent[$isSplittable]()) { + return false; + } + if (this[$extra]._isSplittable !== undefined) { + return this[$extra]._isSplittable; + } + if (this.layout === "position" || this.layout.includes("row")) { + this[$extra]._isSplittable = false; + return false; + } + if (parent.layout?.endsWith("-tb") && parent[$extra].numberInLine !== 0) { + return false; + } + this[$extra]._isSplittable = true; + return true; + } + [$flushHTML]() { + return flushHTML(this); + } + [$addHTML](html, bbox) { + addHTML(this, html, bbox); + } + [$getAvailableSpace]() { + return getAvailableSpace(this); + } + [$toHTML](availableSpace) { + setTabIndex(this); + if (this.presence === "hidden" || this.presence === "inactive" || this.h === 0 || this.w === 0) { + return HTMLResult.EMPTY; + } + fixDimensions(this); + const children = []; + const attributes = { + id: this[$uid], + class: [] + }; + setAccess(this, attributes.class); + if (!this[$extra]) { + this[$extra] = Object.create(null); + } + Object.assign(this[$extra], { + children, + attributes, + attempt: 0, + line: null, + numberInLine: 0, + availableSpace: { + width: Math.min(this.w || Infinity, availableSpace.width), + height: Math.min(this.h || Infinity, availableSpace.height) + }, + width: 0, + height: 0, + prevHeight: 0, + currentWidth: 0 + }); + const isSplittable = this[$isSplittable](); + if (!isSplittable) { + setFirstUnsplittable(this); + } + if (!checkDimensions(this, availableSpace)) { + return HTMLResult.FAILURE; + } + const filter = new Set(["field"]); + if (this.layout.includes("row")) { + const columnWidths = this[$getSubformParent]().columnWidths; + if (Array.isArray(columnWidths) && columnWidths.length > 0) { + this[$extra].columnWidths = columnWidths; + this[$extra].currentColumn = 0; + } + } + const style = toStyle(this, "anchorType", "dimensions", "position", "presence", "border", "margin", "hAlign"); + const classNames = ["xfaExclgroup"]; + const cl = layoutClass(this); + if (cl) { + classNames.push(cl); + } + if (isPrintOnly(this)) { + classNames.push("xfaPrintOnly"); + } + attributes.style = style; + attributes.class = classNames; + if (this.name) { + attributes.xfaName = this.name; + } + this[$pushPara](); + const isLrTb = this.layout === "lr-tb" || this.layout === "rl-tb"; + const maxRun = isLrTb ? MAX_ATTEMPTS_FOR_LRTB_LAYOUT : 1; + for (; this[$extra].attempt < maxRun; this[$extra].attempt++) { + if (isLrTb && this[$extra].attempt === MAX_ATTEMPTS_FOR_LRTB_LAYOUT - 1) { + this[$extra].numberInLine = 0; + } + const result = this[$childrenToHTML]({ + filter, + include: true + }); + if (result.success) { + break; + } + if (result.isBreak()) { + this[$popPara](); + return result; + } + if (isLrTb && this[$extra].attempt === 0 && this[$extra].numberInLine === 0 && !this[$getTemplateRoot]()[$extra].noLayoutFailure) { + this[$extra].attempt = maxRun; + break; + } + } + this[$popPara](); + if (!isSplittable) { + unsetFirstUnsplittable(this); + } + if (this[$extra].attempt === maxRun) { + if (!isSplittable) { + delete this[$extra]; + } + return HTMLResult.FAILURE; + } + let marginH = 0; + let marginV = 0; + if (this.margin) { + marginH = this.margin.leftInset + this.margin.rightInset; + marginV = this.margin.topInset + this.margin.bottomInset; + } + const width = Math.max(this[$extra].width + marginH, this.w || 0); + const height = Math.max(this[$extra].height + marginV, this.h || 0); + const bbox = [this.x, this.y, width, height]; + if (this.w === "") { + style.width = measureToString(width); + } + if (this.h === "") { + style.height = measureToString(height); + } + const html = { + name: "div", + attributes, + children + }; + applyAssist(this, attributes); + delete this[$extra]; + return HTMLResult.success(createWrapper(this, html), bbox); + } +} +class Execute extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "execute"); + this.connection = attributes.connection || ""; + this.executeType = getStringOption(attributes.executeType, ["import", "remerge"]); + this.id = attributes.id || ""; + this.runAt = getStringOption(attributes.runAt, ["client", "both", "server"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Extras extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "extras", true); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.boolean = new XFAObjectArray(); + this.date = new XFAObjectArray(); + this.dateTime = new XFAObjectArray(); + this.decimal = new XFAObjectArray(); + this.exData = new XFAObjectArray(); + this.extras = new XFAObjectArray(); + this.float = new XFAObjectArray(); + this.image = new XFAObjectArray(); + this.integer = new XFAObjectArray(); + this.text = new XFAObjectArray(); + this.time = new XFAObjectArray(); + } +} +class Field extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "field", true); + this.access = getStringOption(attributes.access, ["open", "nonInteractive", "protected", "readOnly"]); + this.accessKey = attributes.accessKey || ""; + this.anchorType = getStringOption(attributes.anchorType, ["topLeft", "bottomCenter", "bottomLeft", "bottomRight", "middleCenter", "middleLeft", "middleRight", "topCenter", "topRight"]); + this.colSpan = getInteger({ + data: attributes.colSpan, + defaultValue: 1, + validate: n => n >= 1 || n === -1 + }); + this.h = attributes.h ? getMeasurement(attributes.h) : ""; + this.hAlign = getStringOption(attributes.hAlign, ["left", "center", "justify", "justifyAll", "radix", "right"]); + this.id = attributes.id || ""; + this.locale = attributes.locale || ""; + this.maxH = getMeasurement(attributes.maxH, "0pt"); + this.maxW = getMeasurement(attributes.maxW, "0pt"); + this.minH = getMeasurement(attributes.minH, "0pt"); + this.minW = getMeasurement(attributes.minW, "0pt"); + this.name = attributes.name || ""; + this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]); + this.relevant = getRelevant(attributes.relevant); + this.rotate = getInteger({ + data: attributes.rotate, + defaultValue: 0, + validate: x => x % 90 === 0 + }); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.w = attributes.w ? getMeasurement(attributes.w) : ""; + this.x = getMeasurement(attributes.x, "0pt"); + this.y = getMeasurement(attributes.y, "0pt"); + this.assist = null; + this.bind = null; + this.border = null; + this.calculate = null; + this.caption = null; + this.desc = null; + this.extras = null; + this.font = null; + this.format = null; + this.items = new XFAObjectArray(2); + this.keep = null; + this.margin = null; + this.para = null; + this.traversal = null; + this.ui = null; + this.validate = null; + this.value = null; + this.bindItems = new XFAObjectArray(); + this.connect = new XFAObjectArray(); + this.event = new XFAObjectArray(); + this.setProperty = new XFAObjectArray(); + } + [$isBindable]() { + return true; + } + [$setValue](value) { + _setValue(this, value); + } + [$toHTML](availableSpace) { + setTabIndex(this); + if (!this.ui) { + this.ui = new Ui({}); + this.ui[$globalData] = this[$globalData]; + this[$appendChild](this.ui); + let node; + switch (this.items.children.length) { + case 0: + node = new TextEdit({}); + this.ui.textEdit = node; + break; + case 1: + node = new CheckButton({}); + this.ui.checkButton = node; + break; + case 2: + node = new ChoiceList({}); + this.ui.choiceList = node; + break; + } + this.ui[$appendChild](node); + } + if (!this.ui || this.presence === "hidden" || this.presence === "inactive" || this.h === 0 || this.w === 0) { + return HTMLResult.EMPTY; + } + if (this.caption) { + delete this.caption[$extra]; + } + this[$pushPara](); + const caption = this.caption ? this.caption[$toHTML](availableSpace).html : null; + const savedW = this.w; + const savedH = this.h; + let marginH = 0; + let marginV = 0; + if (this.margin) { + marginH = this.margin.leftInset + this.margin.rightInset; + marginV = this.margin.topInset + this.margin.bottomInset; + } + let borderDims = null; + if (this.w === "" || this.h === "") { + let width = null; + let height = null; + let uiW = 0; + let uiH = 0; + if (this.ui.checkButton) { + uiW = uiH = this.ui.checkButton.size; + } else { + const { + w, + h + } = layoutNode(this, availableSpace); + if (w !== null) { + uiW = w; + uiH = h; + } else { + uiH = fonts_getMetrics(this.font, true).lineNoGap; + } + } + borderDims = getBorderDims(this.ui[$getExtra]()); + uiW += borderDims.w; + uiH += borderDims.h; + if (this.caption) { + const { + w, + h, + isBroken + } = this.caption[$getExtra](availableSpace); + if (isBroken && this[$getSubformParent]()[$isThereMoreWidth]()) { + this[$popPara](); + return HTMLResult.FAILURE; + } + width = w; + height = h; + switch (this.caption.placement) { + case "left": + case "right": + case "inline": + width += uiW; + break; + case "top": + case "bottom": + height += uiH; + break; + } + } else { + width = uiW; + height = uiH; + } + if (width && this.w === "") { + width += marginH; + this.w = Math.min(this.maxW <= 0 ? Infinity : this.maxW, this.minW + 1 < width ? width : this.minW); + } + if (height && this.h === "") { + height += marginV; + this.h = Math.min(this.maxH <= 0 ? Infinity : this.maxH, this.minH + 1 < height ? height : this.minH); + } + } + this[$popPara](); + fixDimensions(this); + setFirstUnsplittable(this); + if (!checkDimensions(this, availableSpace)) { + this.w = savedW; + this.h = savedH; + this[$popPara](); + return HTMLResult.FAILURE; + } + unsetFirstUnsplittable(this); + const style = toStyle(this, "font", "dimensions", "position", "rotate", "anchorType", "presence", "margin", "hAlign"); + setMinMaxDimensions(this, style); + const classNames = ["xfaField"]; + if (this.font) { + classNames.push("xfaFont"); + } + if (isPrintOnly(this)) { + classNames.push("xfaPrintOnly"); + } + const attributes = { + style, + id: this[$uid], + class: classNames + }; + if (style.margin) { + style.padding = style.margin; + delete style.margin; + } + setAccess(this, classNames); + if (this.name) { + attributes.xfaName = this.name; + } + const children = []; + const html = { + name: "div", + attributes, + children + }; + applyAssist(this, attributes); + const borderStyle = this.border ? this.border[$toStyle]() : null; + const bbox = computeBbox(this, html, availableSpace); + const ui = this.ui[$toHTML]().html; + if (!ui) { + Object.assign(style, borderStyle); + return HTMLResult.success(createWrapper(this, html), bbox); + } + if (this[$tabIndex]) { + if (ui.children?.[0]) { + ui.children[0].attributes.tabindex = this[$tabIndex]; + } else { + ui.attributes.tabindex = this[$tabIndex]; + } + } + if (!ui.attributes.style) { + ui.attributes.style = Object.create(null); + } + let aElement = null; + if (this.ui.button) { + if (ui.children.length === 1) { + [aElement] = ui.children.splice(0, 1); + } + Object.assign(ui.attributes.style, borderStyle); + } else { + Object.assign(style, borderStyle); + } + children.push(ui); + if (this.value) { + if (this.ui.imageEdit) { + ui.children.push(this.value[$toHTML]().html); + } else if (!this.ui.button) { + let value = ""; + if (this.value.exData) { + value = this.value.exData[$text](); + } else if (this.value.text) { + value = this.value.text[$getExtra](); + } else { + const htmlValue = this.value[$toHTML]().html; + if (htmlValue !== null) { + value = htmlValue.children[0].value; + } + } + if (this.ui.textEdit && this.value.text?.maxChars) { + ui.children[0].attributes.maxLength = this.value.text.maxChars; + } + if (value) { + if (this.ui.numericEdit) { + value = parseFloat(value); + value = isNaN(value) ? "" : value.toString(); + } + if (ui.children[0].name === "textarea") { + ui.children[0].attributes.textContent = value; + } else { + ui.children[0].attributes.value = value; + } + } + } + } + if (!this.ui.imageEdit && ui.children?.[0] && this.h) { + borderDims = borderDims || getBorderDims(this.ui[$getExtra]()); + let captionHeight = 0; + if (this.caption && ["top", "bottom"].includes(this.caption.placement)) { + captionHeight = this.caption.reserve; + if (captionHeight <= 0) { + captionHeight = this.caption[$getExtra](availableSpace).h; + } + const inputHeight = this.h - captionHeight - marginV - borderDims.h; + ui.children[0].attributes.style.height = measureToString(inputHeight); + } else { + ui.children[0].attributes.style.height = "100%"; + } + } + if (aElement) { + ui.children.push(aElement); + } + if (!caption) { + if (ui.attributes.class) { + ui.attributes.class.push("xfaLeft"); + } + this.w = savedW; + this.h = savedH; + return HTMLResult.success(createWrapper(this, html), bbox); + } + if (this.ui.button) { + if (style.padding) { + delete style.padding; + } + if (caption.name === "div") { + caption.name = "span"; + } + ui.children.push(caption); + return HTMLResult.success(html, bbox); + } else if (this.ui.checkButton) { + caption.attributes.class[0] = "xfaCaptionForCheckButton"; + } + if (!ui.attributes.class) { + ui.attributes.class = []; + } + ui.children.splice(0, 0, caption); + switch (this.caption.placement) { + case "left": + ui.attributes.class.push("xfaLeft"); + break; + case "right": + ui.attributes.class.push("xfaRight"); + break; + case "top": + ui.attributes.class.push("xfaTop"); + break; + case "bottom": + ui.attributes.class.push("xfaBottom"); + break; + case "inline": + ui.attributes.class.push("xfaLeft"); + break; + } + this.w = savedW; + this.h = savedH; + return HTMLResult.success(createWrapper(this, html), bbox); + } +} +class Fill extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "fill", true); + this.id = attributes.id || ""; + this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.color = null; + this.extras = null; + this.linear = null; + this.pattern = null; + this.radial = null; + this.solid = null; + this.stipple = null; + } + [$toStyle]() { + const parent = this[$getParent](); + const grandpa = parent[$getParent](); + const ggrandpa = grandpa[$getParent](); + const style = Object.create(null); + let propName = "color"; + let altPropName = propName; + if (parent instanceof Border) { + propName = "background-color"; + altPropName = "background"; + if (ggrandpa instanceof Ui) { + style.backgroundColor = "white"; + } + } + if (parent instanceof Rectangle || parent instanceof Arc) { + propName = altPropName = "fill"; + style.fill = "white"; + } + for (const name of Object.getOwnPropertyNames(this)) { + if (name === "extras" || name === "color") { + continue; + } + const obj = this[name]; + if (!(obj instanceof XFAObject)) { + continue; + } + const color = obj[$toStyle](this.color); + if (color) { + style[color.startsWith("#") ? propName : altPropName] = color; + } + return style; + } + if (this.color?.value) { + const color = this.color[$toStyle](); + style[color.startsWith("#") ? propName : altPropName] = color; + } + return style; + } +} +class Filter extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "filter", true); + this.addRevocationInfo = getStringOption(attributes.addRevocationInfo, ["", "required", "optional", "none"]); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.version = getInteger({ + data: this.version, + defaultValue: 5, + validate: x => x >= 1 && x <= 5 + }); + this.appearanceFilter = null; + this.certificates = null; + this.digestMethods = null; + this.encodings = null; + this.encryptionMethods = null; + this.handler = null; + this.lockDocument = null; + this.mdp = null; + this.reasons = null; + this.timeStamp = null; + } +} +class Float extends ContentObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "float"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } + [$finalize]() { + const number = parseFloat(this[$content].trim()); + this[$content] = isNaN(number) ? null : number; + } + [$toHTML](availableSpace) { + return valueToHtml(this[$content] !== null ? this[$content].toString() : ""); + } +} +class template_Font extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "font", true); + this.baselineShift = getMeasurement(attributes.baselineShift); + this.fontHorizontalScale = getFloat({ + data: attributes.fontHorizontalScale, + defaultValue: 100, + validate: x => x >= 0 + }); + this.fontVerticalScale = getFloat({ + data: attributes.fontVerticalScale, + defaultValue: 100, + validate: x => x >= 0 + }); + this.id = attributes.id || ""; + this.kerningMode = getStringOption(attributes.kerningMode, ["none", "pair"]); + this.letterSpacing = getMeasurement(attributes.letterSpacing, "0"); + this.lineThrough = getInteger({ + data: attributes.lineThrough, + defaultValue: 0, + validate: x => x === 1 || x === 2 + }); + this.lineThroughPeriod = getStringOption(attributes.lineThroughPeriod, ["all", "word"]); + this.overline = getInteger({ + data: attributes.overline, + defaultValue: 0, + validate: x => x === 1 || x === 2 + }); + this.overlinePeriod = getStringOption(attributes.overlinePeriod, ["all", "word"]); + this.posture = getStringOption(attributes.posture, ["normal", "italic"]); + this.size = getMeasurement(attributes.size, "10pt"); + this.typeface = attributes.typeface || "Courier"; + this.underline = getInteger({ + data: attributes.underline, + defaultValue: 0, + validate: x => x === 1 || x === 2 + }); + this.underlinePeriod = getStringOption(attributes.underlinePeriod, ["all", "word"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.weight = getStringOption(attributes.weight, ["normal", "bold"]); + this.extras = null; + this.fill = null; + } + [$clean](builder) { + super[$clean](builder); + this[$globalData].usedTypefaces.add(this.typeface); + } + [$toStyle]() { + const style = toStyle(this, "fill"); + const color = style.color; + if (color) { + if (color === "#000000") { + delete style.color; + } else if (!color.startsWith("#")) { + style.background = color; + style.backgroundClip = "text"; + style.color = "transparent"; + } + } + if (this.baselineShift) { + style.verticalAlign = measureToString(this.baselineShift); + } + style.fontKerning = this.kerningMode === "none" ? "none" : "normal"; + style.letterSpacing = measureToString(this.letterSpacing); + if (this.lineThrough !== 0) { + style.textDecoration = "line-through"; + if (this.lineThrough === 2) { + style.textDecorationStyle = "double"; + } + } + if (this.overline !== 0) { + style.textDecoration = "overline"; + if (this.overline === 2) { + style.textDecorationStyle = "double"; + } + } + style.fontStyle = this.posture; + style.fontSize = measureToString(0.99 * this.size); + setFontFamily(this, this, this[$globalData].fontFinder, style); + if (this.underline !== 0) { + style.textDecoration = "underline"; + if (this.underline === 2) { + style.textDecorationStyle = "double"; + } + } + style.fontWeight = this.weight; + return style; + } +} +class Format extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "format", true); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + this.picture = null; + } +} +class Handler extends StringObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "handler"); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Hyphenation extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "hyphenation"); + this.excludeAllCaps = getInteger({ + data: attributes.excludeAllCaps, + defaultValue: 0, + validate: x => x === 1 + }); + this.excludeInitialCap = getInteger({ + data: attributes.excludeInitialCap, + defaultValue: 0, + validate: x => x === 1 + }); + this.hyphenate = getInteger({ + data: attributes.hyphenate, + defaultValue: 0, + validate: x => x === 1 + }); + this.id = attributes.id || ""; + this.pushCharacterCount = getInteger({ + data: attributes.pushCharacterCount, + defaultValue: 3, + validate: x => x >= 0 + }); + this.remainCharacterCount = getInteger({ + data: attributes.remainCharacterCount, + defaultValue: 3, + validate: x => x >= 0 + }); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.wordCharacterCount = getInteger({ + data: attributes.wordCharacterCount, + defaultValue: 7, + validate: x => x >= 0 + }); + } +} +class Image extends StringObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "image"); + this.aspect = getStringOption(attributes.aspect, ["fit", "actual", "height", "none", "width"]); + this.contentType = attributes.contentType || ""; + this.href = attributes.href || ""; + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.transferEncoding = getStringOption(attributes.transferEncoding, ["base64", "none", "package"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } + [$toHTML]() { + if (this.contentType && !MIMES.has(this.contentType.toLowerCase())) { + return HTMLResult.EMPTY; + } + let buffer = this[$globalData].images && this[$globalData].images.get(this.href); + if (!buffer && (this.href || !this[$content])) { + return HTMLResult.EMPTY; + } + if (!buffer && this.transferEncoding === "base64") { + buffer = fromBase64Util(this[$content]); + } + if (!buffer) { + return HTMLResult.EMPTY; + } + if (!this.contentType) { + for (const [header, type] of IMAGES_HEADERS) { + if (buffer.length > header.length && header.every((x, i) => x === buffer[i])) { + this.contentType = type; + break; + } + } + if (!this.contentType) { + return HTMLResult.EMPTY; + } + } + const blob = new Blob([buffer], { + type: this.contentType + }); + let style; + switch (this.aspect) { + case "fit": + case "actual": + break; + case "height": + style = { + height: "100%", + objectFit: "fill" + }; + break; + case "none": + style = { + width: "100%", + height: "100%", + objectFit: "fill" + }; + break; + case "width": + style = { + width: "100%", + objectFit: "fill" + }; + break; + } + const parent = this[$getParent](); + return HTMLResult.success({ + name: "img", + attributes: { + class: ["xfaImage"], + style, + src: URL.createObjectURL(blob), + alt: parent ? ariaLabel(parent[$getParent]()) : null + } + }); + } +} +class ImageEdit extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "imageEdit", true); + this.data = getStringOption(attributes.data, ["link", "embed"]); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.border = null; + this.extras = null; + this.margin = null; + } + [$toHTML](availableSpace) { + if (this.data === "embed") { + return HTMLResult.success({ + name: "div", + children: [], + attributes: {} + }); + } + return HTMLResult.EMPTY; + } +} +class Integer extends ContentObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "integer"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } + [$finalize]() { + const number = parseInt(this[$content].trim(), 10); + this[$content] = isNaN(number) ? null : number; + } + [$toHTML](availableSpace) { + return valueToHtml(this[$content] !== null ? this[$content].toString() : ""); + } +} +class Issuers extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "issuers", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.certificate = new XFAObjectArray(); + } +} +class Items extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "items", true); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]); + this.ref = attributes.ref || ""; + this.save = getInteger({ + data: attributes.save, + defaultValue: 0, + validate: x => x === 1 + }); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.boolean = new XFAObjectArray(); + this.date = new XFAObjectArray(); + this.dateTime = new XFAObjectArray(); + this.decimal = new XFAObjectArray(); + this.exData = new XFAObjectArray(); + this.float = new XFAObjectArray(); + this.image = new XFAObjectArray(); + this.integer = new XFAObjectArray(); + this.text = new XFAObjectArray(); + this.time = new XFAObjectArray(); + } + [$toHTML]() { + const output = []; + for (const child of this[$getChildren]()) { + output.push(child[$text]()); + } + return HTMLResult.success(output); + } +} +class Keep extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "keep", true); + this.id = attributes.id || ""; + const options = ["none", "contentArea", "pageArea"]; + this.intact = getStringOption(attributes.intact, options); + this.next = getStringOption(attributes.next, options); + this.previous = getStringOption(attributes.previous, options); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + } +} +class KeyUsage extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "keyUsage"); + const options = ["", "yes", "no"]; + this.crlSign = getStringOption(attributes.crlSign, options); + this.dataEncipherment = getStringOption(attributes.dataEncipherment, options); + this.decipherOnly = getStringOption(attributes.decipherOnly, options); + this.digitalSignature = getStringOption(attributes.digitalSignature, options); + this.encipherOnly = getStringOption(attributes.encipherOnly, options); + this.id = attributes.id || ""; + this.keyAgreement = getStringOption(attributes.keyAgreement, options); + this.keyCertSign = getStringOption(attributes.keyCertSign, options); + this.keyEncipherment = getStringOption(attributes.keyEncipherment, options); + this.nonRepudiation = getStringOption(attributes.nonRepudiation, options); + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Line extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "line", true); + this.hand = getStringOption(attributes.hand, ["even", "left", "right"]); + this.id = attributes.id || ""; + this.slope = getStringOption(attributes.slope, ["\\", "/"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.edge = null; + } + [$toHTML]() { + const parent = this[$getParent]()[$getParent](); + const edge = this.edge || new Edge({}); + const edgeStyle = edge[$toStyle](); + const style = Object.create(null); + const thickness = edge.presence === "visible" ? edge.thickness : 0; + style.strokeWidth = measureToString(thickness); + style.stroke = edgeStyle.color; + let x1, y1, x2, y2; + let width = "100%"; + let height = "100%"; + if (parent.w <= thickness) { + [x1, y1, x2, y2] = ["50%", 0, "50%", "100%"]; + width = style.strokeWidth; + } else if (parent.h <= thickness) { + [x1, y1, x2, y2] = [0, "50%", "100%", "50%"]; + height = style.strokeWidth; + } else if (this.slope === "\\") { + [x1, y1, x2, y2] = [0, 0, "100%", "100%"]; + } else { + [x1, y1, x2, y2] = [0, "100%", "100%", 0]; + } + const line = { + name: "line", + attributes: { + xmlns: SVG_NS, + x1, + y1, + x2, + y2, + style + } + }; + const svg = { + name: "svg", + children: [line], + attributes: { + xmlns: SVG_NS, + width, + height, + style: { + overflow: "visible" + } + } + }; + if (hasMargin(parent)) { + return HTMLResult.success({ + name: "div", + attributes: { + style: { + display: "inline", + width: "100%", + height: "100%" + } + }, + children: [svg] + }); + } + svg.attributes.style.position = "absolute"; + return HTMLResult.success(svg); + } +} +class Linear extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "linear", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["toRight", "toBottom", "toLeft", "toTop"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.color = null; + this.extras = null; + } + [$toStyle](startColor) { + startColor = startColor ? startColor[$toStyle]() : "#FFFFFF"; + const transf = this.type.replace(/([RBLT])/, " $1").toLowerCase(); + const endColor = this.color ? this.color[$toStyle]() : "#000000"; + return `linear-gradient(${transf}, ${startColor}, ${endColor})`; + } +} +class LockDocument extends ContentObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "lockDocument"); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } + [$finalize]() { + this[$content] = getStringOption(this[$content], ["auto", "0", "1"]); + } +} +class Manifest extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "manifest", true); + this.action = getStringOption(attributes.action, ["include", "all", "exclude"]); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + this.ref = new XFAObjectArray(); + } +} +class Margin extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "margin", true); + this.bottomInset = getMeasurement(attributes.bottomInset, "0"); + this.id = attributes.id || ""; + this.leftInset = getMeasurement(attributes.leftInset, "0"); + this.rightInset = getMeasurement(attributes.rightInset, "0"); + this.topInset = getMeasurement(attributes.topInset, "0"); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + } + [$toStyle]() { + return { + margin: measureToString(this.topInset) + " " + measureToString(this.rightInset) + " " + measureToString(this.bottomInset) + " " + measureToString(this.leftInset) + }; + } +} +class Mdp extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "mdp"); + this.id = attributes.id || ""; + this.permissions = getInteger({ + data: attributes.permissions, + defaultValue: 2, + validate: x => x === 1 || x === 3 + }); + this.signatureType = getStringOption(attributes.signatureType, ["filler", "author"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Medium extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "medium"); + this.id = attributes.id || ""; + this.imagingBBox = getBBox(attributes.imagingBBox); + this.long = getMeasurement(attributes.long); + this.orientation = getStringOption(attributes.orientation, ["portrait", "landscape"]); + this.short = getMeasurement(attributes.short); + this.stock = attributes.stock || ""; + this.trayIn = getStringOption(attributes.trayIn, ["auto", "delegate", "pageFront"]); + this.trayOut = getStringOption(attributes.trayOut, ["auto", "delegate"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Message extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "message", true); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.text = new XFAObjectArray(); + } +} +class NumericEdit extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "numericEdit", true); + this.hScrollPolicy = getStringOption(attributes.hScrollPolicy, ["auto", "off", "on"]); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.border = null; + this.comb = null; + this.extras = null; + this.margin = null; + } + [$toHTML](availableSpace) { + const style = toStyle(this, "border", "font", "margin"); + const field = this[$getParent]()[$getParent](); + const html = { + name: "input", + attributes: { + type: "text", + fieldId: field[$uid], + dataId: field[$data]?.[$uid] || field[$uid], + class: ["xfaTextfield"], + style, + "aria-label": ariaLabel(field), + "aria-required": false + } + }; + if (isRequired(field)) { + html.attributes["aria-required"] = true; + html.attributes.required = true; + } + return HTMLResult.success({ + name: "label", + attributes: { + class: ["xfaLabel"] + }, + children: [html] + }); + } +} +class Occur extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "occur", true); + this.id = attributes.id || ""; + this.initial = attributes.initial !== "" ? getInteger({ + data: attributes.initial, + defaultValue: "", + validate: x => true + }) : ""; + this.max = attributes.max !== "" ? getInteger({ + data: attributes.max, + defaultValue: 1, + validate: x => true + }) : ""; + this.min = attributes.min !== "" ? getInteger({ + data: attributes.min, + defaultValue: 1, + validate: x => true + }) : ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + } + [$clean]() { + const parent = this[$getParent](); + const originalMin = this.min; + if (this.min === "") { + this.min = parent instanceof PageArea || parent instanceof PageSet ? 0 : 1; + } + if (this.max === "") { + if (originalMin === "") { + this.max = parent instanceof PageArea || parent instanceof PageSet ? -1 : 1; + } else { + this.max = this.min; + } + } + if (this.max !== -1 && this.max < this.min) { + this.max = this.min; + } + if (this.initial === "") { + this.initial = parent instanceof Template ? 1 : this.min; + } + } +} +class Oid extends StringObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "oid"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Oids extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "oids", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.oid = new XFAObjectArray(); + } +} +class Overflow extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "overflow"); + this.id = attributes.id || ""; + this.leader = attributes.leader || ""; + this.target = attributes.target || ""; + this.trailer = attributes.trailer || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } + [$getExtra]() { + if (!this[$extra]) { + const parent = this[$getParent](); + const root = this[$getTemplateRoot](); + const target = root[$searchNode](this.target, parent); + const leader = root[$searchNode](this.leader, parent); + const trailer = root[$searchNode](this.trailer, parent); + this[$extra] = { + target: target?.[0] || null, + leader: leader?.[0] || null, + trailer: trailer?.[0] || null, + addLeader: false, + addTrailer: false + }; + } + return this[$extra]; + } +} +class PageArea extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "pageArea", true); + this.blankOrNotBlank = getStringOption(attributes.blankOrNotBlank, ["any", "blank", "notBlank"]); + this.id = attributes.id || ""; + this.initialNumber = getInteger({ + data: attributes.initialNumber, + defaultValue: 1, + validate: x => true + }); + this.name = attributes.name || ""; + this.numbered = getInteger({ + data: attributes.numbered, + defaultValue: 1, + validate: x => true + }); + this.oddOrEven = getStringOption(attributes.oddOrEven, ["any", "even", "odd"]); + this.pagePosition = getStringOption(attributes.pagePosition, ["any", "first", "last", "only", "rest"]); + this.relevant = getRelevant(attributes.relevant); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.desc = null; + this.extras = null; + this.medium = null; + this.occur = null; + this.area = new XFAObjectArray(); + this.contentArea = new XFAObjectArray(); + this.draw = new XFAObjectArray(); + this.exclGroup = new XFAObjectArray(); + this.field = new XFAObjectArray(); + this.subform = new XFAObjectArray(); + } + [$isUsable]() { + if (!this[$extra]) { + this[$extra] = { + numberOfUse: 0 + }; + return true; + } + return !this.occur || this.occur.max === -1 || this[$extra].numberOfUse < this.occur.max; + } + [$cleanPage]() { + delete this[$extra]; + } + [$getNextPage]() { + if (!this[$extra]) { + this[$extra] = { + numberOfUse: 0 + }; + } + const parent = this[$getParent](); + if (parent.relation === "orderedOccurrence") { + if (this[$isUsable]()) { + this[$extra].numberOfUse += 1; + return this; + } + } + return parent[$getNextPage](); + } + [$getAvailableSpace]() { + return this[$extra].space || { + width: 0, + height: 0 + }; + } + [$toHTML]() { + if (!this[$extra]) { + this[$extra] = { + numberOfUse: 1 + }; + } + const children = []; + this[$extra].children = children; + const style = Object.create(null); + if (this.medium && this.medium.short && this.medium.long) { + style.width = measureToString(this.medium.short); + style.height = measureToString(this.medium.long); + this[$extra].space = { + width: this.medium.short, + height: this.medium.long + }; + if (this.medium.orientation === "landscape") { + const x = style.width; + style.width = style.height; + style.height = x; + this[$extra].space = { + width: this.medium.long, + height: this.medium.short + }; + } + } else { + warn("XFA - No medium specified in pageArea: please file a bug."); + } + this[$childrenToHTML]({ + filter: new Set(["area", "draw", "field", "subform"]), + include: true + }); + this[$childrenToHTML]({ + filter: new Set(["contentArea"]), + include: true + }); + return HTMLResult.success({ + name: "div", + children, + attributes: { + class: ["xfaPage"], + id: this[$uid], + style, + xfaName: this.name + } + }); + } +} +class PageSet extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "pageSet", true); + this.duplexImposition = getStringOption(attributes.duplexImposition, ["longEdge", "shortEdge"]); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.relation = getStringOption(attributes.relation, ["orderedOccurrence", "duplexPaginated", "simplexPaginated"]); + this.relevant = getRelevant(attributes.relevant); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + this.occur = null; + this.pageArea = new XFAObjectArray(); + this.pageSet = new XFAObjectArray(); + } + [$cleanPage]() { + for (const page of this.pageArea.children) { + page[$cleanPage](); + } + for (const page of this.pageSet.children) { + page[$cleanPage](); + } + } + [$isUsable]() { + return !this.occur || this.occur.max === -1 || this[$extra].numberOfUse < this.occur.max; + } + [$getNextPage]() { + if (!this[$extra]) { + this[$extra] = { + numberOfUse: 1, + pageIndex: -1, + pageSetIndex: -1 + }; + } + if (this.relation === "orderedOccurrence") { + if (this[$extra].pageIndex + 1 < this.pageArea.children.length) { + this[$extra].pageIndex += 1; + const pageArea = this.pageArea.children[this[$extra].pageIndex]; + return pageArea[$getNextPage](); + } + if (this[$extra].pageSetIndex + 1 < this.pageSet.children.length) { + this[$extra].pageSetIndex += 1; + return this.pageSet.children[this[$extra].pageSetIndex][$getNextPage](); + } + if (this[$isUsable]()) { + this[$extra].numberOfUse += 1; + this[$extra].pageIndex = -1; + this[$extra].pageSetIndex = -1; + return this[$getNextPage](); + } + const parent = this[$getParent](); + if (parent instanceof PageSet) { + return parent[$getNextPage](); + } + this[$cleanPage](); + return this[$getNextPage](); + } + const pageNumber = this[$getTemplateRoot]()[$extra].pageNumber; + const parity = pageNumber % 2 === 0 ? "even" : "odd"; + const position = pageNumber === 0 ? "first" : "rest"; + let page = this.pageArea.children.find(p => p.oddOrEven === parity && p.pagePosition === position); + if (page) { + return page; + } + page = this.pageArea.children.find(p => p.oddOrEven === "any" && p.pagePosition === position); + if (page) { + return page; + } + page = this.pageArea.children.find(p => p.oddOrEven === "any" && p.pagePosition === "any"); + if (page) { + return page; + } + return this.pageArea.children[0]; + } +} +class Para extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "para", true); + this.hAlign = getStringOption(attributes.hAlign, ["left", "center", "justify", "justifyAll", "radix", "right"]); + this.id = attributes.id || ""; + this.lineHeight = attributes.lineHeight ? getMeasurement(attributes.lineHeight, "0pt") : ""; + this.marginLeft = attributes.marginLeft ? getMeasurement(attributes.marginLeft, "0pt") : ""; + this.marginRight = attributes.marginRight ? getMeasurement(attributes.marginRight, "0pt") : ""; + this.orphans = getInteger({ + data: attributes.orphans, + defaultValue: 0, + validate: x => x >= 0 + }); + this.preserve = attributes.preserve || ""; + this.radixOffset = attributes.radixOffset ? getMeasurement(attributes.radixOffset, "0pt") : ""; + this.spaceAbove = attributes.spaceAbove ? getMeasurement(attributes.spaceAbove, "0pt") : ""; + this.spaceBelow = attributes.spaceBelow ? getMeasurement(attributes.spaceBelow, "0pt") : ""; + this.tabDefault = attributes.tabDefault ? getMeasurement(this.tabDefault) : ""; + this.tabStops = (attributes.tabStops || "").trim().split(/\s+/).map((x, i) => i % 2 === 1 ? getMeasurement(x) : x); + this.textIndent = attributes.textIndent ? getMeasurement(attributes.textIndent, "0pt") : ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.vAlign = getStringOption(attributes.vAlign, ["top", "bottom", "middle"]); + this.widows = getInteger({ + data: attributes.widows, + defaultValue: 0, + validate: x => x >= 0 + }); + this.hyphenation = null; + } + [$toStyle]() { + const style = toStyle(this, "hAlign"); + if (this.marginLeft !== "") { + style.paddingLeft = measureToString(this.marginLeft); + } + if (this.marginRight !== "") { + style.paddingRight = measureToString(this.marginRight); + } + if (this.spaceAbove !== "") { + style.paddingTop = measureToString(this.spaceAbove); + } + if (this.spaceBelow !== "") { + style.paddingBottom = measureToString(this.spaceBelow); + } + if (this.textIndent !== "") { + style.textIndent = measureToString(this.textIndent); + fixTextIndent(style); + } + if (this.lineHeight > 0) { + style.lineHeight = measureToString(this.lineHeight); + } + if (this.tabDefault !== "") { + style.tabSize = measureToString(this.tabDefault); + } + if (this.tabStops.length > 0) {} + if (this.hyphenatation) { + Object.assign(style, this.hyphenatation[$toStyle]()); + } + return style; + } +} +class PasswordEdit extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "passwordEdit", true); + this.hScrollPolicy = getStringOption(attributes.hScrollPolicy, ["auto", "off", "on"]); + this.id = attributes.id || ""; + this.passwordChar = attributes.passwordChar || "*"; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.border = null; + this.extras = null; + this.margin = null; + } +} +class template_Pattern extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "pattern", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["crossHatch", "crossDiagonal", "diagonalLeft", "diagonalRight", "horizontal", "vertical"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.color = null; + this.extras = null; + } + [$toStyle](startColor) { + startColor = startColor ? startColor[$toStyle]() : "#FFFFFF"; + const endColor = this.color ? this.color[$toStyle]() : "#000000"; + const width = 5; + const cmd = "repeating-linear-gradient"; + const colors = `${startColor},${startColor} ${width}px,${endColor} ${width}px,${endColor} ${2 * width}px`; + switch (this.type) { + case "crossHatch": + return `${cmd}(to top,${colors}) ${cmd}(to right,${colors})`; + case "crossDiagonal": + return `${cmd}(45deg,${colors}) ${cmd}(-45deg,${colors})`; + case "diagonalLeft": + return `${cmd}(45deg,${colors})`; + case "diagonalRight": + return `${cmd}(-45deg,${colors})`; + case "horizontal": + return `${cmd}(to top,${colors})`; + case "vertical": + return `${cmd}(to right,${colors})`; + } + return ""; + } +} +class Picture extends StringObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "picture"); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Proto extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "proto", true); + this.appearanceFilter = new XFAObjectArray(); + this.arc = new XFAObjectArray(); + this.area = new XFAObjectArray(); + this.assist = new XFAObjectArray(); + this.barcode = new XFAObjectArray(); + this.bindItems = new XFAObjectArray(); + this.bookend = new XFAObjectArray(); + this.boolean = new XFAObjectArray(); + this.border = new XFAObjectArray(); + this.break = new XFAObjectArray(); + this.breakAfter = new XFAObjectArray(); + this.breakBefore = new XFAObjectArray(); + this.button = new XFAObjectArray(); + this.calculate = new XFAObjectArray(); + this.caption = new XFAObjectArray(); + this.certificate = new XFAObjectArray(); + this.certificates = new XFAObjectArray(); + this.checkButton = new XFAObjectArray(); + this.choiceList = new XFAObjectArray(); + this.color = new XFAObjectArray(); + this.comb = new XFAObjectArray(); + this.connect = new XFAObjectArray(); + this.contentArea = new XFAObjectArray(); + this.corner = new XFAObjectArray(); + this.date = new XFAObjectArray(); + this.dateTime = new XFAObjectArray(); + this.dateTimeEdit = new XFAObjectArray(); + this.decimal = new XFAObjectArray(); + this.defaultUi = new XFAObjectArray(); + this.desc = new XFAObjectArray(); + this.digestMethod = new XFAObjectArray(); + this.digestMethods = new XFAObjectArray(); + this.draw = new XFAObjectArray(); + this.edge = new XFAObjectArray(); + this.encoding = new XFAObjectArray(); + this.encodings = new XFAObjectArray(); + this.encrypt = new XFAObjectArray(); + this.encryptData = new XFAObjectArray(); + this.encryption = new XFAObjectArray(); + this.encryptionMethod = new XFAObjectArray(); + this.encryptionMethods = new XFAObjectArray(); + this.event = new XFAObjectArray(); + this.exData = new XFAObjectArray(); + this.exObject = new XFAObjectArray(); + this.exclGroup = new XFAObjectArray(); + this.execute = new XFAObjectArray(); + this.extras = new XFAObjectArray(); + this.field = new XFAObjectArray(); + this.fill = new XFAObjectArray(); + this.filter = new XFAObjectArray(); + this.float = new XFAObjectArray(); + this.font = new XFAObjectArray(); + this.format = new XFAObjectArray(); + this.handler = new XFAObjectArray(); + this.hyphenation = new XFAObjectArray(); + this.image = new XFAObjectArray(); + this.imageEdit = new XFAObjectArray(); + this.integer = new XFAObjectArray(); + this.issuers = new XFAObjectArray(); + this.items = new XFAObjectArray(); + this.keep = new XFAObjectArray(); + this.keyUsage = new XFAObjectArray(); + this.line = new XFAObjectArray(); + this.linear = new XFAObjectArray(); + this.lockDocument = new XFAObjectArray(); + this.manifest = new XFAObjectArray(); + this.margin = new XFAObjectArray(); + this.mdp = new XFAObjectArray(); + this.medium = new XFAObjectArray(); + this.message = new XFAObjectArray(); + this.numericEdit = new XFAObjectArray(); + this.occur = new XFAObjectArray(); + this.oid = new XFAObjectArray(); + this.oids = new XFAObjectArray(); + this.overflow = new XFAObjectArray(); + this.pageArea = new XFAObjectArray(); + this.pageSet = new XFAObjectArray(); + this.para = new XFAObjectArray(); + this.passwordEdit = new XFAObjectArray(); + this.pattern = new XFAObjectArray(); + this.picture = new XFAObjectArray(); + this.radial = new XFAObjectArray(); + this.reason = new XFAObjectArray(); + this.reasons = new XFAObjectArray(); + this.rectangle = new XFAObjectArray(); + this.ref = new XFAObjectArray(); + this.script = new XFAObjectArray(); + this.setProperty = new XFAObjectArray(); + this.signData = new XFAObjectArray(); + this.signature = new XFAObjectArray(); + this.signing = new XFAObjectArray(); + this.solid = new XFAObjectArray(); + this.speak = new XFAObjectArray(); + this.stipple = new XFAObjectArray(); + this.subform = new XFAObjectArray(); + this.subformSet = new XFAObjectArray(); + this.subjectDN = new XFAObjectArray(); + this.subjectDNs = new XFAObjectArray(); + this.submit = new XFAObjectArray(); + this.text = new XFAObjectArray(); + this.textEdit = new XFAObjectArray(); + this.time = new XFAObjectArray(); + this.timeStamp = new XFAObjectArray(); + this.toolTip = new XFAObjectArray(); + this.traversal = new XFAObjectArray(); + this.traverse = new XFAObjectArray(); + this.ui = new XFAObjectArray(); + this.validate = new XFAObjectArray(); + this.value = new XFAObjectArray(); + this.variables = new XFAObjectArray(); + } +} +class Radial extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "radial", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["toEdge", "toCenter"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.color = null; + this.extras = null; + } + [$toStyle](startColor) { + startColor = startColor ? startColor[$toStyle]() : "#FFFFFF"; + const endColor = this.color ? this.color[$toStyle]() : "#000000"; + const colors = this.type === "toEdge" ? `${startColor},${endColor}` : `${endColor},${startColor}`; + return `radial-gradient(circle at center, ${colors})`; + } +} +class Reason extends StringObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "reason"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Reasons extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "reasons", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.reason = new XFAObjectArray(); + } +} +class Rectangle extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "rectangle", true); + this.hand = getStringOption(attributes.hand, ["even", "left", "right"]); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.corner = new XFAObjectArray(4); + this.edge = new XFAObjectArray(4); + this.fill = null; + } + [$toHTML]() { + const edge = this.edge.children.length ? this.edge.children[0] : new Edge({}); + const edgeStyle = edge[$toStyle](); + const style = Object.create(null); + if (this.fill?.presence === "visible") { + Object.assign(style, this.fill[$toStyle]()); + } else { + style.fill = "transparent"; + } + style.strokeWidth = measureToString(edge.presence === "visible" ? edge.thickness : 0); + style.stroke = edgeStyle.color; + const corner = this.corner.children.length ? this.corner.children[0] : new Corner({}); + const cornerStyle = corner[$toStyle](); + const rect = { + name: "rect", + attributes: { + xmlns: SVG_NS, + width: "100%", + height: "100%", + x: 0, + y: 0, + rx: cornerStyle.radius, + ry: cornerStyle.radius, + style + } + }; + const svg = { + name: "svg", + children: [rect], + attributes: { + xmlns: SVG_NS, + style: { + overflow: "visible" + }, + width: "100%", + height: "100%" + } + }; + const parent = this[$getParent]()[$getParent](); + if (hasMargin(parent)) { + return HTMLResult.success({ + name: "div", + attributes: { + style: { + display: "inline", + width: "100%", + height: "100%" + } + }, + children: [svg] + }); + } + svg.attributes.style.position = "absolute"; + return HTMLResult.success(svg); + } +} +class RefElement extends StringObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "ref"); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Script extends StringObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "script"); + this.binding = attributes.binding || ""; + this.contentType = attributes.contentType || ""; + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.runAt = getStringOption(attributes.runAt, ["client", "both", "server"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class SetProperty extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "setProperty"); + this.connection = attributes.connection || ""; + this.ref = attributes.ref || ""; + this.target = attributes.target || ""; + } +} +class SignData extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "signData", true); + this.id = attributes.id || ""; + this.operation = getStringOption(attributes.operation, ["sign", "clear", "verify"]); + this.ref = attributes.ref || ""; + this.target = attributes.target || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.filter = null; + this.manifest = null; + } +} +class Signature extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "signature", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["PDF1.3", "PDF1.6"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.border = null; + this.extras = null; + this.filter = null; + this.manifest = null; + this.margin = null; + } +} +class Signing extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "signing", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.certificate = new XFAObjectArray(); + } +} +class Solid extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "solid", true); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + } + [$toStyle](startColor) { + return startColor ? startColor[$toStyle]() : "#FFFFFF"; + } +} +class Speak extends StringObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "speak"); + this.disable = getInteger({ + data: attributes.disable, + defaultValue: 0, + validate: x => x === 1 + }); + this.id = attributes.id || ""; + this.priority = getStringOption(attributes.priority, ["custom", "caption", "name", "toolTip"]); + this.rid = attributes.rid || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Stipple extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "stipple", true); + this.id = attributes.id || ""; + this.rate = getInteger({ + data: attributes.rate, + defaultValue: 50, + validate: x => x >= 0 && x <= 100 + }); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.color = null; + this.extras = null; + } + [$toStyle](bgColor) { + const alpha = this.rate / 100; + return Util.makeHexColor(Math.round(bgColor.value.r * (1 - alpha) + this.value.r * alpha), Math.round(bgColor.value.g * (1 - alpha) + this.value.g * alpha), Math.round(bgColor.value.b * (1 - alpha) + this.value.b * alpha)); + } +} +class Subform extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "subform", true); + this.access = getStringOption(attributes.access, ["open", "nonInteractive", "protected", "readOnly"]); + this.allowMacro = getInteger({ + data: attributes.allowMacro, + defaultValue: 0, + validate: x => x === 1 + }); + this.anchorType = getStringOption(attributes.anchorType, ["topLeft", "bottomCenter", "bottomLeft", "bottomRight", "middleCenter", "middleLeft", "middleRight", "topCenter", "topRight"]); + this.colSpan = getInteger({ + data: attributes.colSpan, + defaultValue: 1, + validate: n => n >= 1 || n === -1 + }); + this.columnWidths = (attributes.columnWidths || "").trim().split(/\s+/).map(x => x === "-1" ? -1 : getMeasurement(x)); + this.h = attributes.h ? getMeasurement(attributes.h) : ""; + this.hAlign = getStringOption(attributes.hAlign, ["left", "center", "justify", "justifyAll", "radix", "right"]); + this.id = attributes.id || ""; + this.layout = getStringOption(attributes.layout, ["position", "lr-tb", "rl-row", "rl-tb", "row", "table", "tb"]); + this.locale = attributes.locale || ""; + this.maxH = getMeasurement(attributes.maxH, "0pt"); + this.maxW = getMeasurement(attributes.maxW, "0pt"); + this.mergeMode = getStringOption(attributes.mergeMode, ["consumeData", "matchTemplate"]); + this.minH = getMeasurement(attributes.minH, "0pt"); + this.minW = getMeasurement(attributes.minW, "0pt"); + this.name = attributes.name || ""; + this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]); + this.relevant = getRelevant(attributes.relevant); + this.restoreState = getStringOption(attributes.restoreState, ["manual", "auto"]); + this.scope = getStringOption(attributes.scope, ["name", "none"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.w = attributes.w ? getMeasurement(attributes.w) : ""; + this.x = getMeasurement(attributes.x, "0pt"); + this.y = getMeasurement(attributes.y, "0pt"); + this.assist = null; + this.bind = null; + this.bookend = null; + this.border = null; + this.break = null; + this.calculate = null; + this.desc = null; + this.extras = null; + this.keep = null; + this.margin = null; + this.occur = null; + this.overflow = null; + this.pageSet = null; + this.para = null; + this.traversal = null; + this.validate = null; + this.variables = null; + this.area = new XFAObjectArray(); + this.breakAfter = new XFAObjectArray(); + this.breakBefore = new XFAObjectArray(); + this.connect = new XFAObjectArray(); + this.draw = new XFAObjectArray(); + this.event = new XFAObjectArray(); + this.exObject = new XFAObjectArray(); + this.exclGroup = new XFAObjectArray(); + this.field = new XFAObjectArray(); + this.proto = new XFAObjectArray(); + this.setProperty = new XFAObjectArray(); + this.subform = new XFAObjectArray(); + this.subformSet = new XFAObjectArray(); + } + [$getSubformParent]() { + const parent = this[$getParent](); + if (parent instanceof SubformSet) { + return parent[$getSubformParent](); + } + return parent; + } + [$isBindable]() { + return true; + } + [$isThereMoreWidth]() { + return this.layout.endsWith("-tb") && this[$extra].attempt === 0 && this[$extra].numberInLine > 0 || this[$getParent]()[$isThereMoreWidth](); + } + *[$getContainedChildren]() { + yield* getContainedChildren(this); + } + [$flushHTML]() { + return flushHTML(this); + } + [$addHTML](html, bbox) { + addHTML(this, html, bbox); + } + [$getAvailableSpace]() { + return getAvailableSpace(this); + } + [$isSplittable]() { + const parent = this[$getSubformParent](); + if (!parent[$isSplittable]()) { + return false; + } + if (this[$extra]._isSplittable !== undefined) { + return this[$extra]._isSplittable; + } + if (this.layout === "position" || this.layout.includes("row")) { + this[$extra]._isSplittable = false; + return false; + } + if (this.keep && this.keep.intact !== "none") { + this[$extra]._isSplittable = false; + return false; + } + if (parent.layout?.endsWith("-tb") && parent[$extra].numberInLine !== 0) { + return false; + } + this[$extra]._isSplittable = true; + return true; + } + [$toHTML](availableSpace) { + setTabIndex(this); + if (this.break) { + if (this.break.after !== "auto" || this.break.afterTarget !== "") { + const node = new BreakAfter({ + targetType: this.break.after, + target: this.break.afterTarget, + startNew: this.break.startNew.toString() + }); + node[$globalData] = this[$globalData]; + this[$appendChild](node); + this.breakAfter.push(node); + } + if (this.break.before !== "auto" || this.break.beforeTarget !== "") { + const node = new BreakBefore({ + targetType: this.break.before, + target: this.break.beforeTarget, + startNew: this.break.startNew.toString() + }); + node[$globalData] = this[$globalData]; + this[$appendChild](node); + this.breakBefore.push(node); + } + if (this.break.overflowTarget !== "") { + const node = new Overflow({ + target: this.break.overflowTarget, + leader: this.break.overflowLeader, + trailer: this.break.overflowTrailer + }); + node[$globalData] = this[$globalData]; + this[$appendChild](node); + this.overflow.push(node); + } + this[$removeChild](this.break); + this.break = null; + } + if (this.presence === "hidden" || this.presence === "inactive") { + return HTMLResult.EMPTY; + } + if (this.breakBefore.children.length > 1 || this.breakAfter.children.length > 1) { + warn("XFA - Several breakBefore or breakAfter in subforms: please file a bug."); + } + if (this.breakBefore.children.length >= 1) { + const breakBefore = this.breakBefore.children[0]; + if (handleBreak(breakBefore)) { + return HTMLResult.breakNode(breakBefore); + } + } + if (this[$extra]?.afterBreakAfter) { + return HTMLResult.EMPTY; + } + fixDimensions(this); + const children = []; + const attributes = { + id: this[$uid], + class: [] + }; + setAccess(this, attributes.class); + if (!this[$extra]) { + this[$extra] = Object.create(null); + } + Object.assign(this[$extra], { + children, + line: null, + attributes, + attempt: 0, + numberInLine: 0, + availableSpace: { + width: Math.min(this.w || Infinity, availableSpace.width), + height: Math.min(this.h || Infinity, availableSpace.height) + }, + width: 0, + height: 0, + prevHeight: 0, + currentWidth: 0 + }); + const root = this[$getTemplateRoot](); + const savedNoLayoutFailure = root[$extra].noLayoutFailure; + const isSplittable = this[$isSplittable](); + if (!isSplittable) { + setFirstUnsplittable(this); + } + if (!checkDimensions(this, availableSpace)) { + return HTMLResult.FAILURE; + } + const filter = new Set(["area", "draw", "exclGroup", "field", "subform", "subformSet"]); + if (this.layout.includes("row")) { + const columnWidths = this[$getSubformParent]().columnWidths; + if (Array.isArray(columnWidths) && columnWidths.length > 0) { + this[$extra].columnWidths = columnWidths; + this[$extra].currentColumn = 0; + } + } + const style = toStyle(this, "anchorType", "dimensions", "position", "presence", "border", "margin", "hAlign"); + const classNames = ["xfaSubform"]; + const cl = layoutClass(this); + if (cl) { + classNames.push(cl); + } + attributes.style = style; + attributes.class = classNames; + if (this.name) { + attributes.xfaName = this.name; + } + if (this.overflow) { + const overflowExtra = this.overflow[$getExtra](); + if (overflowExtra.addLeader) { + overflowExtra.addLeader = false; + handleOverflow(this, overflowExtra.leader, availableSpace); + } + } + this[$pushPara](); + const isLrTb = this.layout === "lr-tb" || this.layout === "rl-tb"; + const maxRun = isLrTb ? MAX_ATTEMPTS_FOR_LRTB_LAYOUT : 1; + for (; this[$extra].attempt < maxRun; this[$extra].attempt++) { + if (isLrTb && this[$extra].attempt === MAX_ATTEMPTS_FOR_LRTB_LAYOUT - 1) { + this[$extra].numberInLine = 0; + } + const result = this[$childrenToHTML]({ + filter, + include: true + }); + if (result.success) { + break; + } + if (result.isBreak()) { + this[$popPara](); + return result; + } + if (isLrTb && this[$extra].attempt === 0 && this[$extra].numberInLine === 0 && !root[$extra].noLayoutFailure) { + this[$extra].attempt = maxRun; + break; + } + } + this[$popPara](); + if (!isSplittable) { + unsetFirstUnsplittable(this); + } + root[$extra].noLayoutFailure = savedNoLayoutFailure; + if (this[$extra].attempt === maxRun) { + if (this.overflow) { + this[$getTemplateRoot]()[$extra].overflowNode = this.overflow; + } + if (!isSplittable) { + delete this[$extra]; + } + return HTMLResult.FAILURE; + } + if (this.overflow) { + const overflowExtra = this.overflow[$getExtra](); + if (overflowExtra.addTrailer) { + overflowExtra.addTrailer = false; + handleOverflow(this, overflowExtra.trailer, availableSpace); + } + } + let marginH = 0; + let marginV = 0; + if (this.margin) { + marginH = this.margin.leftInset + this.margin.rightInset; + marginV = this.margin.topInset + this.margin.bottomInset; + } + const width = Math.max(this[$extra].width + marginH, this.w || 0); + const height = Math.max(this[$extra].height + marginV, this.h || 0); + const bbox = [this.x, this.y, width, height]; + if (this.w === "") { + style.width = measureToString(width); + } + if (this.h === "") { + style.height = measureToString(height); + } + if ((style.width === "0px" || style.height === "0px") && children.length === 0) { + return HTMLResult.EMPTY; + } + const html = { + name: "div", + attributes, + children + }; + applyAssist(this, attributes); + const result = HTMLResult.success(createWrapper(this, html), bbox); + if (this.breakAfter.children.length >= 1) { + const breakAfter = this.breakAfter.children[0]; + if (handleBreak(breakAfter)) { + this[$extra].afterBreakAfter = result; + return HTMLResult.breakNode(breakAfter); + } + } + delete this[$extra]; + return result; + } +} +class SubformSet extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "subformSet", true); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.relation = getStringOption(attributes.relation, ["ordered", "choice", "unordered"]); + this.relevant = getRelevant(attributes.relevant); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.bookend = null; + this.break = null; + this.desc = null; + this.extras = null; + this.occur = null; + this.overflow = null; + this.breakAfter = new XFAObjectArray(); + this.breakBefore = new XFAObjectArray(); + this.subform = new XFAObjectArray(); + this.subformSet = new XFAObjectArray(); + } + *[$getContainedChildren]() { + yield* getContainedChildren(this); + } + [$getSubformParent]() { + let parent = this[$getParent](); + while (!(parent instanceof Subform)) { + parent = parent[$getParent](); + } + return parent; + } + [$isBindable]() { + return true; + } +} +class SubjectDN extends ContentObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "subjectDN"); + this.delimiter = attributes.delimiter || ","; + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } + [$finalize]() { + this[$content] = new Map(this[$content].split(this.delimiter).map(kv => { + kv = kv.split("=", 2); + kv[0] = kv[0].trim(); + return kv; + })); + } +} +class SubjectDNs extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "subjectDNs", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.subjectDN = new XFAObjectArray(); + } +} +class Submit extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "submit", true); + this.embedPDF = getInteger({ + data: attributes.embedPDF, + defaultValue: 0, + validate: x => x === 1 + }); + this.format = getStringOption(attributes.format, ["xdp", "formdata", "pdf", "urlencoded", "xfd", "xml"]); + this.id = attributes.id || ""; + this.target = attributes.target || ""; + this.textEncoding = getKeyword({ + data: attributes.textEncoding ? attributes.textEncoding.toLowerCase() : "", + defaultValue: "", + validate: k => ["utf-8", "big-five", "fontspecific", "gbk", "gb-18030", "gb-2312", "ksc-5601", "none", "shift-jis", "ucs-2", "utf-16"].includes(k) || k.match(/iso-8859-\d{2}/) + }); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.xdpContent = attributes.xdpContent || ""; + this.encrypt = null; + this.encryptData = new XFAObjectArray(); + this.signData = new XFAObjectArray(); + } +} +class Template extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "template", true); + this.baseProfile = getStringOption(attributes.baseProfile, ["full", "interactiveForms"]); + this.extras = null; + this.subform = new XFAObjectArray(); + } + [$finalize]() { + if (this.subform.children.length === 0) { + warn("XFA - No subforms in template node."); + } + if (this.subform.children.length >= 2) { + warn("XFA - Several subforms in template node: please file a bug."); + } + this[$tabIndex] = DEFAULT_TAB_INDEX; + } + [$isSplittable]() { + return true; + } + [$searchNode](expr, container) { + if (expr.startsWith("#")) { + return [this[$ids].get(expr.slice(1))]; + } + return searchNode(this, container, expr, true, true); + } + *[$toPages]() { + if (!this.subform.children.length) { + return HTMLResult.success({ + name: "div", + children: [] + }); + } + this[$extra] = { + overflowNode: null, + firstUnsplittable: null, + currentContentArea: null, + currentPageArea: null, + noLayoutFailure: false, + pageNumber: 1, + pagePosition: "first", + oddOrEven: "odd", + blankOrNotBlank: "nonBlank", + paraStack: [] + }; + const root = this.subform.children[0]; + root.pageSet[$cleanPage](); + const pageAreas = root.pageSet.pageArea.children; + const mainHtml = { + name: "div", + children: [] + }; + let pageArea = null; + let breakBefore = null; + let breakBeforeTarget = null; + if (root.breakBefore.children.length >= 1) { + breakBefore = root.breakBefore.children[0]; + breakBeforeTarget = breakBefore.target; + } else if (root.subform.children.length >= 1 && root.subform.children[0].breakBefore.children.length >= 1) { + breakBefore = root.subform.children[0].breakBefore.children[0]; + breakBeforeTarget = breakBefore.target; + } else if (root.break?.beforeTarget) { + breakBefore = root.break; + breakBeforeTarget = breakBefore.beforeTarget; + } else if (root.subform.children.length >= 1 && root.subform.children[0].break?.beforeTarget) { + breakBefore = root.subform.children[0].break; + breakBeforeTarget = breakBefore.beforeTarget; + } + if (breakBefore) { + const target = this[$searchNode](breakBeforeTarget, breakBefore[$getParent]()); + if (target instanceof PageArea) { + pageArea = target; + breakBefore[$extra] = {}; + } + } + if (!pageArea) { + pageArea = pageAreas[0]; + } + pageArea[$extra] = { + numberOfUse: 1 + }; + const pageAreaParent = pageArea[$getParent](); + pageAreaParent[$extra] = { + numberOfUse: 1, + pageIndex: pageAreaParent.pageArea.children.indexOf(pageArea), + pageSetIndex: 0 + }; + let targetPageArea; + let leader = null; + let trailer = null; + let hasSomething = true; + let hasSomethingCounter = 0; + let startIndex = 0; + while (true) { + if (!hasSomething) { + mainHtml.children.pop(); + if (++hasSomethingCounter === MAX_EMPTY_PAGES) { + warn("XFA - Something goes wrong: please file a bug."); + return mainHtml; + } + } else { + hasSomethingCounter = 0; + } + targetPageArea = null; + this[$extra].currentPageArea = pageArea; + const page = pageArea[$toHTML]().html; + mainHtml.children.push(page); + if (leader) { + this[$extra].noLayoutFailure = true; + page.children.push(leader[$toHTML](pageArea[$extra].space).html); + leader = null; + } + if (trailer) { + this[$extra].noLayoutFailure = true; + page.children.push(trailer[$toHTML](pageArea[$extra].space).html); + trailer = null; + } + const contentAreas = pageArea.contentArea.children; + const htmlContentAreas = page.children.filter(node => node.attributes.class.includes("xfaContentarea")); + hasSomething = false; + this[$extra].firstUnsplittable = null; + this[$extra].noLayoutFailure = false; + const flush = index => { + const html = root[$flushHTML](); + if (html) { + hasSomething ||= html.children?.length > 0; + htmlContentAreas[index].children.push(html); + } + }; + for (let i = startIndex, ii = contentAreas.length; i < ii; i++) { + const contentArea = this[$extra].currentContentArea = contentAreas[i]; + const space = { + width: contentArea.w, + height: contentArea.h + }; + startIndex = 0; + if (leader) { + htmlContentAreas[i].children.push(leader[$toHTML](space).html); + leader = null; + } + if (trailer) { + htmlContentAreas[i].children.push(trailer[$toHTML](space).html); + trailer = null; + } + const html = root[$toHTML](space); + if (html.success) { + if (html.html) { + hasSomething ||= html.html.children?.length > 0; + htmlContentAreas[i].children.push(html.html); + } else if (!hasSomething && mainHtml.children.length > 1) { + mainHtml.children.pop(); + } + return mainHtml; + } + if (html.isBreak()) { + const node = html.breakNode; + flush(i); + if (node.targetType === "auto") { + continue; + } + if (node.leader) { + leader = this[$searchNode](node.leader, node[$getParent]()); + leader = leader ? leader[0] : null; + } + if (node.trailer) { + trailer = this[$searchNode](node.trailer, node[$getParent]()); + trailer = trailer ? trailer[0] : null; + } + if (node.targetType === "pageArea") { + targetPageArea = node[$extra].target; + i = Infinity; + } else if (!node[$extra].target) { + i = node[$extra].index; + } else { + targetPageArea = node[$extra].target; + startIndex = node[$extra].index + 1; + i = Infinity; + } + continue; + } + if (this[$extra].overflowNode) { + const node = this[$extra].overflowNode; + this[$extra].overflowNode = null; + const overflowExtra = node[$getExtra](); + const target = overflowExtra.target; + overflowExtra.addLeader = overflowExtra.leader !== null; + overflowExtra.addTrailer = overflowExtra.trailer !== null; + flush(i); + const currentIndex = i; + i = Infinity; + if (target instanceof PageArea) { + targetPageArea = target; + } else if (target instanceof ContentArea) { + const index = contentAreas.indexOf(target); + if (index !== -1) { + if (index > currentIndex) { + i = index - 1; + } else { + startIndex = index; + } + } else { + targetPageArea = target[$getParent](); + startIndex = targetPageArea.contentArea.children.indexOf(target); + } + } + continue; + } + flush(i); + } + this[$extra].pageNumber += 1; + if (targetPageArea) { + if (targetPageArea[$isUsable]()) { + targetPageArea[$extra].numberOfUse += 1; + } else { + targetPageArea = null; + } + } + pageArea = targetPageArea || pageArea[$getNextPage](); + yield null; + } + } +} +class Text extends ContentObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "text"); + this.id = attributes.id || ""; + this.maxChars = getInteger({ + data: attributes.maxChars, + defaultValue: 0, + validate: x => x >= 0 + }); + this.name = attributes.name || ""; + this.rid = attributes.rid || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } + [$acceptWhitespace]() { + return true; + } + [$onChild](child) { + if (child[$namespaceId] === NamespaceIds.xhtml.id) { + this[$content] = child; + return true; + } + warn(`XFA - Invalid content in Text: ${child[$nodeName]}.`); + return false; + } + [$onText](str) { + if (this[$content] instanceof XFAObject) { + return; + } + super[$onText](str); + } + [$finalize]() { + if (typeof this[$content] === "string") { + this[$content] = this[$content].replaceAll("\r\n", "\n"); + } + } + [$getExtra]() { + if (typeof this[$content] === "string") { + return this[$content].split(/[\u2029\u2028\n]/).reduce((acc, line) => { + if (line) { + acc.push(line); + } + return acc; + }, []).join("\n"); + } + return this[$content][$text](); + } + [$toHTML](availableSpace) { + if (typeof this[$content] === "string") { + const html = valueToHtml(this[$content]).html; + if (this[$content].includes("\u2029")) { + html.name = "div"; + html.children = []; + this[$content].split("\u2029").map(para => para.split(/[\u2028\n]/).reduce((acc, line) => { + acc.push({ + name: "span", + value: line + }, { + name: "br" + }); + return acc; + }, [])).forEach(lines => { + html.children.push({ + name: "p", + children: lines + }); + }); + } else if (/[\u2028\n]/.test(this[$content])) { + html.name = "div"; + html.children = []; + this[$content].split(/[\u2028\n]/).forEach(line => { + html.children.push({ + name: "span", + value: line + }, { + name: "br" + }); + }); + } + return HTMLResult.success(html); + } + return this[$content][$toHTML](availableSpace); + } +} +class TextEdit extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "textEdit", true); + this.allowRichText = getInteger({ + data: attributes.allowRichText, + defaultValue: 0, + validate: x => x === 1 + }); + this.hScrollPolicy = getStringOption(attributes.hScrollPolicy, ["auto", "off", "on"]); + this.id = attributes.id || ""; + this.multiLine = getInteger({ + data: attributes.multiLine, + defaultValue: "", + validate: x => x === 0 || x === 1 + }); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.vScrollPolicy = getStringOption(attributes.vScrollPolicy, ["auto", "off", "on"]); + this.border = null; + this.comb = null; + this.extras = null; + this.margin = null; + } + [$toHTML](availableSpace) { + const style = toStyle(this, "border", "font", "margin"); + let html; + const field = this[$getParent]()[$getParent](); + if (this.multiLine === "") { + this.multiLine = field instanceof Draw ? 1 : 0; + } + if (this.multiLine === 1) { + html = { + name: "textarea", + attributes: { + dataId: field[$data]?.[$uid] || field[$uid], + fieldId: field[$uid], + class: ["xfaTextfield"], + style, + "aria-label": ariaLabel(field), + "aria-required": false + } + }; + } else { + html = { + name: "input", + attributes: { + type: "text", + dataId: field[$data]?.[$uid] || field[$uid], + fieldId: field[$uid], + class: ["xfaTextfield"], + style, + "aria-label": ariaLabel(field), + "aria-required": false + } + }; + } + if (isRequired(field)) { + html.attributes["aria-required"] = true; + html.attributes.required = true; + } + return HTMLResult.success({ + name: "label", + attributes: { + class: ["xfaLabel"] + }, + children: [html] + }); + } +} +class Time extends StringObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "time"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } + [$finalize]() { + const date = this[$content].trim(); + this[$content] = date ? new Date(date) : null; + } + [$toHTML](availableSpace) { + return valueToHtml(this[$content] ? this[$content].toString() : ""); + } +} +class TimeStamp extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "timeStamp"); + this.id = attributes.id || ""; + this.server = attributes.server || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class ToolTip extends StringObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "toolTip"); + this.id = attributes.id || ""; + this.rid = attributes.rid || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Traversal extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "traversal", true); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + this.traverse = new XFAObjectArray(); + } +} +class Traverse extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "traverse", true); + this.id = attributes.id || ""; + this.operation = getStringOption(attributes.operation, ["next", "back", "down", "first", "left", "right", "up"]); + this.ref = attributes.ref || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + this.script = null; + } + get name() { + return this.operation; + } + [$isTransparent]() { + return false; + } +} +class Ui extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "ui", true); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + this.picture = null; + this.barcode = null; + this.button = null; + this.checkButton = null; + this.choiceList = null; + this.dateTimeEdit = null; + this.defaultUi = null; + this.imageEdit = null; + this.numericEdit = null; + this.passwordEdit = null; + this.signature = null; + this.textEdit = null; + } + [$getExtra]() { + if (this[$extra] === undefined) { + for (const name of Object.getOwnPropertyNames(this)) { + if (name === "extras" || name === "picture") { + continue; + } + const obj = this[name]; + if (!(obj instanceof XFAObject)) { + continue; + } + this[$extra] = obj; + return obj; + } + this[$extra] = null; + } + return this[$extra]; + } + [$toHTML](availableSpace) { + const obj = this[$getExtra](); + if (obj) { + return obj[$toHTML](availableSpace); + } + return HTMLResult.EMPTY; + } +} +class Validate extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "validate", true); + this.formatTest = getStringOption(attributes.formatTest, ["warning", "disabled", "error"]); + this.id = attributes.id || ""; + this.nullTest = getStringOption(attributes.nullTest, ["disabled", "error", "warning"]); + this.scriptTest = getStringOption(attributes.scriptTest, ["error", "disabled", "warning"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + this.message = null; + this.picture = null; + this.script = null; + } +} +class Value extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "value", true); + this.id = attributes.id || ""; + this.override = getInteger({ + data: attributes.override, + defaultValue: 0, + validate: x => x === 1 + }); + this.relevant = getRelevant(attributes.relevant); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.arc = null; + this.boolean = null; + this.date = null; + this.dateTime = null; + this.decimal = null; + this.exData = null; + this.float = null; + this.image = null; + this.integer = null; + this.line = null; + this.rectangle = null; + this.text = null; + this.time = null; + } + [$setValue](value) { + const parent = this[$getParent](); + if (parent instanceof Field) { + if (parent.ui?.imageEdit) { + if (!this.image) { + this.image = new Image({}); + this[$appendChild](this.image); + } + this.image[$content] = value[$content]; + return; + } + } + const valueName = value[$nodeName]; + if (this[valueName] !== null) { + this[valueName][$content] = value[$content]; + return; + } + for (const name of Object.getOwnPropertyNames(this)) { + const obj = this[name]; + if (obj instanceof XFAObject) { + this[name] = null; + this[$removeChild](obj); + } + } + this[value[$nodeName]] = value; + this[$appendChild](value); + } + [$text]() { + if (this.exData) { + if (typeof this.exData[$content] === "string") { + return this.exData[$content].trim(); + } + return this.exData[$content][$text]().trim(); + } + for (const name of Object.getOwnPropertyNames(this)) { + if (name === "image") { + continue; + } + const obj = this[name]; + if (obj instanceof XFAObject) { + return (obj[$content] || "").toString().trim(); + } + } + return null; + } + [$toHTML](availableSpace) { + for (const name of Object.getOwnPropertyNames(this)) { + const obj = this[name]; + if (!(obj instanceof XFAObject)) { + continue; + } + return obj[$toHTML](availableSpace); + } + return HTMLResult.EMPTY; + } +} +class Variables extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "variables", true); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.boolean = new XFAObjectArray(); + this.date = new XFAObjectArray(); + this.dateTime = new XFAObjectArray(); + this.decimal = new XFAObjectArray(); + this.exData = new XFAObjectArray(); + this.float = new XFAObjectArray(); + this.image = new XFAObjectArray(); + this.integer = new XFAObjectArray(); + this.manifest = new XFAObjectArray(); + this.script = new XFAObjectArray(); + this.text = new XFAObjectArray(); + this.time = new XFAObjectArray(); + } + [$isTransparent]() { + return true; + } +} +class TemplateNamespace { + static [$buildXFAObject](name, attributes) { + if (TemplateNamespace.hasOwnProperty(name)) { + const node = TemplateNamespace[name](attributes); + node[$setSetAttributes](attributes); + return node; + } + return undefined; + } + static appearanceFilter(attrs) { + return new AppearanceFilter(attrs); + } + static arc(attrs) { + return new Arc(attrs); + } + static area(attrs) { + return new Area(attrs); + } + static assist(attrs) { + return new Assist(attrs); + } + static barcode(attrs) { + return new Barcode(attrs); + } + static bind(attrs) { + return new Bind(attrs); + } + static bindItems(attrs) { + return new BindItems(attrs); + } + static bookend(attrs) { + return new Bookend(attrs); + } + static boolean(attrs) { + return new BooleanElement(attrs); + } + static border(attrs) { + return new Border(attrs); + } + static break(attrs) { + return new Break(attrs); + } + static breakAfter(attrs) { + return new BreakAfter(attrs); + } + static breakBefore(attrs) { + return new BreakBefore(attrs); + } + static button(attrs) { + return new Button(attrs); + } + static calculate(attrs) { + return new Calculate(attrs); + } + static caption(attrs) { + return new Caption(attrs); + } + static certificate(attrs) { + return new Certificate(attrs); + } + static certificates(attrs) { + return new Certificates(attrs); + } + static checkButton(attrs) { + return new CheckButton(attrs); + } + static choiceList(attrs) { + return new ChoiceList(attrs); + } + static color(attrs) { + return new Color(attrs); + } + static comb(attrs) { + return new Comb(attrs); + } + static connect(attrs) { + return new Connect(attrs); + } + static contentArea(attrs) { + return new ContentArea(attrs); + } + static corner(attrs) { + return new Corner(attrs); + } + static date(attrs) { + return new DateElement(attrs); + } + static dateTime(attrs) { + return new DateTime(attrs); + } + static dateTimeEdit(attrs) { + return new DateTimeEdit(attrs); + } + static decimal(attrs) { + return new Decimal(attrs); + } + static defaultUi(attrs) { + return new DefaultUi(attrs); + } + static desc(attrs) { + return new Desc(attrs); + } + static digestMethod(attrs) { + return new DigestMethod(attrs); + } + static digestMethods(attrs) { + return new DigestMethods(attrs); + } + static draw(attrs) { + return new Draw(attrs); + } + static edge(attrs) { + return new Edge(attrs); + } + static encoding(attrs) { + return new Encoding(attrs); + } + static encodings(attrs) { + return new Encodings(attrs); + } + static encrypt(attrs) { + return new Encrypt(attrs); + } + static encryptData(attrs) { + return new EncryptData(attrs); + } + static encryption(attrs) { + return new Encryption(attrs); + } + static encryptionMethod(attrs) { + return new EncryptionMethod(attrs); + } + static encryptionMethods(attrs) { + return new EncryptionMethods(attrs); + } + static event(attrs) { + return new Event(attrs); + } + static exData(attrs) { + return new ExData(attrs); + } + static exObject(attrs) { + return new ExObject(attrs); + } + static exclGroup(attrs) { + return new ExclGroup(attrs); + } + static execute(attrs) { + return new Execute(attrs); + } + static extras(attrs) { + return new Extras(attrs); + } + static field(attrs) { + return new Field(attrs); + } + static fill(attrs) { + return new Fill(attrs); + } + static filter(attrs) { + return new Filter(attrs); + } + static float(attrs) { + return new Float(attrs); + } + static font(attrs) { + return new template_Font(attrs); + } + static format(attrs) { + return new Format(attrs); + } + static handler(attrs) { + return new Handler(attrs); + } + static hyphenation(attrs) { + return new Hyphenation(attrs); + } + static image(attrs) { + return new Image(attrs); + } + static imageEdit(attrs) { + return new ImageEdit(attrs); + } + static integer(attrs) { + return new Integer(attrs); + } + static issuers(attrs) { + return new Issuers(attrs); + } + static items(attrs) { + return new Items(attrs); + } + static keep(attrs) { + return new Keep(attrs); + } + static keyUsage(attrs) { + return new KeyUsage(attrs); + } + static line(attrs) { + return new Line(attrs); + } + static linear(attrs) { + return new Linear(attrs); + } + static lockDocument(attrs) { + return new LockDocument(attrs); + } + static manifest(attrs) { + return new Manifest(attrs); + } + static margin(attrs) { + return new Margin(attrs); + } + static mdp(attrs) { + return new Mdp(attrs); + } + static medium(attrs) { + return new Medium(attrs); + } + static message(attrs) { + return new Message(attrs); + } + static numericEdit(attrs) { + return new NumericEdit(attrs); + } + static occur(attrs) { + return new Occur(attrs); + } + static oid(attrs) { + return new Oid(attrs); + } + static oids(attrs) { + return new Oids(attrs); + } + static overflow(attrs) { + return new Overflow(attrs); + } + static pageArea(attrs) { + return new PageArea(attrs); + } + static pageSet(attrs) { + return new PageSet(attrs); + } + static para(attrs) { + return new Para(attrs); + } + static passwordEdit(attrs) { + return new PasswordEdit(attrs); + } + static pattern(attrs) { + return new template_Pattern(attrs); + } + static picture(attrs) { + return new Picture(attrs); + } + static proto(attrs) { + return new Proto(attrs); + } + static radial(attrs) { + return new Radial(attrs); + } + static reason(attrs) { + return new Reason(attrs); + } + static reasons(attrs) { + return new Reasons(attrs); + } + static rectangle(attrs) { + return new Rectangle(attrs); + } + static ref(attrs) { + return new RefElement(attrs); + } + static script(attrs) { + return new Script(attrs); + } + static setProperty(attrs) { + return new SetProperty(attrs); + } + static signData(attrs) { + return new SignData(attrs); + } + static signature(attrs) { + return new Signature(attrs); + } + static signing(attrs) { + return new Signing(attrs); + } + static solid(attrs) { + return new Solid(attrs); + } + static speak(attrs) { + return new Speak(attrs); + } + static stipple(attrs) { + return new Stipple(attrs); + } + static subform(attrs) { + return new Subform(attrs); + } + static subformSet(attrs) { + return new SubformSet(attrs); + } + static subjectDN(attrs) { + return new SubjectDN(attrs); + } + static subjectDNs(attrs) { + return new SubjectDNs(attrs); + } + static submit(attrs) { + return new Submit(attrs); + } + static template(attrs) { + return new Template(attrs); + } + static text(attrs) { + return new Text(attrs); + } + static textEdit(attrs) { + return new TextEdit(attrs); + } + static time(attrs) { + return new Time(attrs); + } + static timeStamp(attrs) { + return new TimeStamp(attrs); + } + static toolTip(attrs) { + return new ToolTip(attrs); + } + static traversal(attrs) { + return new Traversal(attrs); + } + static traverse(attrs) { + return new Traverse(attrs); + } + static ui(attrs) { + return new Ui(attrs); + } + static validate(attrs) { + return new Validate(attrs); + } + static value(attrs) { + return new Value(attrs); + } + static variables(attrs) { + return new Variables(attrs); + } +} + +;// ./src/core/xfa/bind.js + + + + + + +const bind_NS_DATASETS = NamespaceIds.datasets.id; +function createText(content) { + const node = new Text({}); + node[$content] = content; + return node; +} +class Binder { + constructor(root) { + this.root = root; + this.datasets = root.datasets; + this.data = root.datasets?.data || new XmlObject(NamespaceIds.datasets.id, "data"); + this.emptyMerge = this.data[$getChildren]().length === 0; + this.root.form = this.form = root.template[$clone](); + } + _isConsumeData() { + return !this.emptyMerge && this._mergeMode; + } + _isMatchTemplate() { + return !this._isConsumeData(); + } + bind() { + this._bindElement(this.form, this.data); + return this.form; + } + getData() { + return this.data; + } + _bindValue(formNode, data, picture) { + formNode[$data] = data; + if (formNode[$hasSettableValue]()) { + if (data[$isDataValue]()) { + const value = data[$getDataValue](); + formNode[$setValue](createText(value)); + } else if (formNode instanceof Field && formNode.ui?.choiceList?.open === "multiSelect") { + const value = data[$getChildren]().map(child => child[$content].trim()).join("\n"); + formNode[$setValue](createText(value)); + } else if (this._isConsumeData()) { + warn(`XFA - Nodes haven't the same type.`); + } + } else if (!data[$isDataValue]() || this._isMatchTemplate()) { + this._bindElement(formNode, data); + } else { + warn(`XFA - Nodes haven't the same type.`); + } + } + _findDataByNameToConsume(name, isValue, dataNode, global) { + if (!name) { + return null; + } + let generator, match; + for (let i = 0; i < 3; i++) { + generator = dataNode[$getRealChildrenByNameIt](name, false, true); + while (true) { + match = generator.next().value; + if (!match) { + break; + } + if (isValue === match[$isDataValue]()) { + return match; + } + } + if (dataNode[$namespaceId] === NamespaceIds.datasets.id && dataNode[$nodeName] === "data") { + break; + } + dataNode = dataNode[$getParent](); + } + if (!global) { + return null; + } + generator = this.data[$getRealChildrenByNameIt](name, true, false); + match = generator.next().value; + if (match) { + return match; + } + generator = this.data[$getAttributeIt](name, true); + match = generator.next().value; + if (match?.[$isDataValue]()) { + return match; + } + return null; + } + _setProperties(formNode, dataNode) { + if (!formNode.hasOwnProperty("setProperty")) { + return; + } + for (const { + ref, + target, + connection + } of formNode.setProperty.children) { + if (connection) { + continue; + } + if (!ref) { + continue; + } + const nodes = searchNode(this.root, dataNode, ref, false, false); + if (!nodes) { + warn(`XFA - Invalid reference: ${ref}.`); + continue; + } + const [node] = nodes; + if (!node[$isDescendent](this.data)) { + warn(`XFA - Invalid node: must be a data node.`); + continue; + } + const targetNodes = searchNode(this.root, formNode, target, false, false); + if (!targetNodes) { + warn(`XFA - Invalid target: ${target}.`); + continue; + } + const [targetNode] = targetNodes; + if (!targetNode[$isDescendent](formNode)) { + warn(`XFA - Invalid target: must be a property or subproperty.`); + continue; + } + const targetParent = targetNode[$getParent](); + if (targetNode instanceof SetProperty || targetParent instanceof SetProperty) { + warn(`XFA - Invalid target: cannot be a setProperty or one of its properties.`); + continue; + } + if (targetNode instanceof BindItems || targetParent instanceof BindItems) { + warn(`XFA - Invalid target: cannot be a bindItems or one of its properties.`); + continue; + } + const content = node[$text](); + const name = targetNode[$nodeName]; + if (targetNode instanceof XFAAttribute) { + const attrs = Object.create(null); + attrs[name] = content; + const obj = Reflect.construct(Object.getPrototypeOf(targetParent).constructor, [attrs]); + targetParent[name] = obj[name]; + continue; + } + if (!targetNode.hasOwnProperty($content)) { + warn(`XFA - Invalid node to use in setProperty`); + continue; + } + targetNode[$data] = node; + targetNode[$content] = content; + targetNode[$finalize](); + } + } + _bindItems(formNode, dataNode) { + if (!formNode.hasOwnProperty("items") || !formNode.hasOwnProperty("bindItems") || formNode.bindItems.isEmpty()) { + return; + } + for (const item of formNode.items.children) { + formNode[$removeChild](item); + } + formNode.items.clear(); + const labels = new Items({}); + const values = new Items({}); + formNode[$appendChild](labels); + formNode.items.push(labels); + formNode[$appendChild](values); + formNode.items.push(values); + for (const { + ref, + labelRef, + valueRef, + connection + } of formNode.bindItems.children) { + if (connection) { + continue; + } + if (!ref) { + continue; + } + const nodes = searchNode(this.root, dataNode, ref, false, false); + if (!nodes) { + warn(`XFA - Invalid reference: ${ref}.`); + continue; + } + for (const node of nodes) { + if (!node[$isDescendent](this.datasets)) { + warn(`XFA - Invalid ref (${ref}): must be a datasets child.`); + continue; + } + const labelNodes = searchNode(this.root, node, labelRef, true, false); + if (!labelNodes) { + warn(`XFA - Invalid label: ${labelRef}.`); + continue; + } + const [labelNode] = labelNodes; + if (!labelNode[$isDescendent](this.datasets)) { + warn(`XFA - Invalid label: must be a datasets child.`); + continue; + } + const valueNodes = searchNode(this.root, node, valueRef, true, false); + if (!valueNodes) { + warn(`XFA - Invalid value: ${valueRef}.`); + continue; + } + const [valueNode] = valueNodes; + if (!valueNode[$isDescendent](this.datasets)) { + warn(`XFA - Invalid value: must be a datasets child.`); + continue; + } + const label = createText(labelNode[$text]()); + const value = createText(valueNode[$text]()); + labels[$appendChild](label); + labels.text.push(label); + values[$appendChild](value); + values.text.push(value); + } + } + } + _bindOccurrences(formNode, matches, picture) { + let baseClone; + if (matches.length > 1) { + baseClone = formNode[$clone](); + baseClone[$removeChild](baseClone.occur); + baseClone.occur = null; + } + this._bindValue(formNode, matches[0], picture); + this._setProperties(formNode, matches[0]); + this._bindItems(formNode, matches[0]); + if (matches.length === 1) { + return; + } + const parent = formNode[$getParent](); + const name = formNode[$nodeName]; + const pos = parent[$indexOf](formNode); + for (let i = 1, ii = matches.length; i < ii; i++) { + const match = matches[i]; + const clone = baseClone[$clone](); + parent[name].push(clone); + parent[$insertAt](pos + i, clone); + this._bindValue(clone, match, picture); + this._setProperties(clone, match); + this._bindItems(clone, match); + } + } + _createOccurrences(formNode) { + if (!this.emptyMerge) { + return; + } + const { + occur + } = formNode; + if (!occur || occur.initial <= 1) { + return; + } + const parent = formNode[$getParent](); + const name = formNode[$nodeName]; + if (!(parent[name] instanceof XFAObjectArray)) { + return; + } + let currentNumber; + if (formNode.name) { + currentNumber = parent[name].children.filter(e => e.name === formNode.name).length; + } else { + currentNumber = parent[name].children.length; + } + const pos = parent[$indexOf](formNode) + 1; + const ii = occur.initial - currentNumber; + if (ii) { + const nodeClone = formNode[$clone](); + nodeClone[$removeChild](nodeClone.occur); + nodeClone.occur = null; + parent[name].push(nodeClone); + parent[$insertAt](pos, nodeClone); + for (let i = 1; i < ii; i++) { + const clone = nodeClone[$clone](); + parent[name].push(clone); + parent[$insertAt](pos + i, clone); + } + } + } + _getOccurInfo(formNode) { + const { + name, + occur + } = formNode; + if (!occur || !name) { + return [1, 1]; + } + const max = occur.max === -1 ? Infinity : occur.max; + return [occur.min, max]; + } + _setAndBind(formNode, dataNode) { + this._setProperties(formNode, dataNode); + this._bindItems(formNode, dataNode); + this._bindElement(formNode, dataNode); + } + _bindElement(formNode, dataNode) { + const uselessNodes = []; + this._createOccurrences(formNode); + for (const child of formNode[$getChildren]()) { + if (child[$data]) { + continue; + } + if (this._mergeMode === undefined && child[$nodeName] === "subform") { + this._mergeMode = child.mergeMode === "consumeData"; + const dataChildren = dataNode[$getChildren](); + if (dataChildren.length > 0) { + this._bindOccurrences(child, [dataChildren[0]], null); + } else if (this.emptyMerge) { + const nsId = dataNode[$namespaceId] === bind_NS_DATASETS ? -1 : dataNode[$namespaceId]; + const dataChild = child[$data] = new XmlObject(nsId, child.name || "root"); + dataNode[$appendChild](dataChild); + this._bindElement(child, dataChild); + } + continue; + } + if (!child[$isBindable]()) { + continue; + } + let global = false; + let picture = null; + let ref = null; + let match = null; + if (child.bind) { + switch (child.bind.match) { + case "none": + this._setAndBind(child, dataNode); + continue; + case "global": + global = true; + break; + case "dataRef": + if (!child.bind.ref) { + warn(`XFA - ref is empty in node ${child[$nodeName]}.`); + this._setAndBind(child, dataNode); + continue; + } + ref = child.bind.ref; + break; + default: + break; + } + if (child.bind.picture) { + picture = child.bind.picture[$content]; + } + } + const [min, max] = this._getOccurInfo(child); + if (ref) { + match = searchNode(this.root, dataNode, ref, true, false); + if (match === null) { + match = createDataNode(this.data, dataNode, ref); + if (!match) { + continue; + } + if (this._isConsumeData()) { + match[$consumed] = true; + } + this._setAndBind(child, match); + continue; + } else { + if (this._isConsumeData()) { + match = match.filter(node => !node[$consumed]); + } + if (match.length > max) { + match = match.slice(0, max); + } else if (match.length === 0) { + match = null; + } + if (match && this._isConsumeData()) { + match.forEach(node => { + node[$consumed] = true; + }); + } + } + } else { + if (!child.name) { + this._setAndBind(child, dataNode); + continue; + } + if (this._isConsumeData()) { + const matches = []; + while (matches.length < max) { + const found = this._findDataByNameToConsume(child.name, child[$hasSettableValue](), dataNode, global); + if (!found) { + break; + } + found[$consumed] = true; + matches.push(found); + } + match = matches.length > 0 ? matches : null; + } else { + match = dataNode[$getRealChildrenByNameIt](child.name, false, this.emptyMerge).next().value; + if (!match) { + if (min === 0) { + uselessNodes.push(child); + continue; + } + const nsId = dataNode[$namespaceId] === bind_NS_DATASETS ? -1 : dataNode[$namespaceId]; + match = child[$data] = new XmlObject(nsId, child.name); + if (this.emptyMerge) { + match[$consumed] = true; + } + dataNode[$appendChild](match); + this._setAndBind(child, match); + continue; + } + if (this.emptyMerge) { + match[$consumed] = true; + } + match = [match]; + } + } + if (match) { + this._bindOccurrences(child, match, picture); + } else if (min > 0) { + this._setAndBind(child, dataNode); + } else { + uselessNodes.push(child); + } + } + uselessNodes.forEach(node => node[$getParent]()[$removeChild](node)); + } +} + +;// ./src/core/xfa/data.js + +class DataHandler { + constructor(root, data) { + this.data = data; + this.dataset = root.datasets || null; + } + serialize(storage) { + const stack = [[-1, this.data[$getChildren]()]]; + while (stack.length > 0) { + const last = stack.at(-1); + const [i, children] = last; + if (i + 1 === children.length) { + stack.pop(); + continue; + } + const child = children[++last[0]]; + const storageEntry = storage.get(child[$uid]); + if (storageEntry) { + child[$setValue](storageEntry); + } else { + const attributes = child[$getAttributes](); + for (const value of attributes.values()) { + const entry = storage.get(value[$uid]); + if (entry) { + value[$setValue](entry); + break; + } + } + } + const nodes = child[$getChildren](); + if (nodes.length > 0) { + stack.push([-1, nodes]); + } + } + const buf = [``]; + if (this.dataset) { + for (const child of this.dataset[$getChildren]()) { + if (child[$nodeName] !== "data") { + child[$toString](buf); + } + } + } + this.data[$toString](buf); + buf.push(""); + return buf.join(""); + } +} + +;// ./src/core/xfa/config.js + + + + + +const CONFIG_NS_ID = NamespaceIds.config.id; +class Acrobat extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "acrobat", true); + this.acrobat7 = null; + this.autoSave = null; + this.common = null; + this.validate = null; + this.validateApprovalSignatures = null; + this.submitUrl = new XFAObjectArray(); + } +} +class Acrobat7 extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "acrobat7", true); + this.dynamicRender = null; + } +} +class ADBE_JSConsole extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "ADBE_JSConsole", ["delegate", "Enable", "Disable"]); + } +} +class ADBE_JSDebugger extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "ADBE_JSDebugger", ["delegate", "Enable", "Disable"]); + } +} +class AddSilentPrint extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "addSilentPrint"); + } +} +class AddViewerPreferences extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "addViewerPreferences"); + } +} +class AdjustData extends Option10 { + constructor(attributes) { + super(CONFIG_NS_ID, "adjustData"); + } +} +class AdobeExtensionLevel extends IntegerObject { + constructor(attributes) { + super(CONFIG_NS_ID, "adobeExtensionLevel", 0, n => n >= 1 && n <= 8); + } +} +class Agent extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "agent", true); + this.name = attributes.name ? attributes.name.trim() : ""; + this.common = new XFAObjectArray(); + } +} +class AlwaysEmbed extends ContentObject { + constructor(attributes) { + super(CONFIG_NS_ID, "alwaysEmbed"); + } +} +class Amd extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "amd"); + } +} +class config_Area extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "area"); + this.level = getInteger({ + data: attributes.level, + defaultValue: 0, + validate: n => n >= 1 && n <= 3 + }); + this.name = getStringOption(attributes.name, ["", "barcode", "coreinit", "deviceDriver", "font", "general", "layout", "merge", "script", "signature", "sourceSet", "templateCache"]); + } +} +class Attributes extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "attributes", ["preserve", "delegate", "ignore"]); + } +} +class AutoSave extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "autoSave", ["disabled", "enabled"]); + } +} +class Base extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "base"); + } +} +class BatchOutput extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "batchOutput"); + this.format = getStringOption(attributes.format, ["none", "concat", "zip", "zipCompress"]); + } +} +class BehaviorOverride extends ContentObject { + constructor(attributes) { + super(CONFIG_NS_ID, "behaviorOverride"); + } + [$finalize]() { + this[$content] = new Map(this[$content].trim().split(/\s+/).filter(x => x.includes(":")).map(x => x.split(":", 2))); + } +} +class Cache extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "cache", true); + this.templateCache = null; + } +} +class Change extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "change"); + } +} +class Common extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "common", true); + this.data = null; + this.locale = null; + this.localeSet = null; + this.messaging = null; + this.suppressBanner = null; + this.template = null; + this.validationMessaging = null; + this.versionControl = null; + this.log = new XFAObjectArray(); + } +} +class Compress extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "compress"); + this.scope = getStringOption(attributes.scope, ["imageOnly", "document"]); + } +} +class CompressLogicalStructure extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "compressLogicalStructure"); + } +} +class CompressObjectStream extends Option10 { + constructor(attributes) { + super(CONFIG_NS_ID, "compressObjectStream"); + } +} +class Compression extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "compression", true); + this.compressLogicalStructure = null; + this.compressObjectStream = null; + this.level = null; + this.type = null; + } +} +class Config extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "config", true); + this.acrobat = null; + this.present = null; + this.trace = null; + this.agent = new XFAObjectArray(); + } +} +class Conformance extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "conformance", ["A", "B"]); + } +} +class ContentCopy extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "contentCopy"); + } +} +class Copies extends IntegerObject { + constructor(attributes) { + super(CONFIG_NS_ID, "copies", 1, n => n >= 1); + } +} +class Creator extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "creator"); + } +} +class CurrentPage extends IntegerObject { + constructor(attributes) { + super(CONFIG_NS_ID, "currentPage", 0, n => n >= 0); + } +} +class Data extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "data", true); + this.adjustData = null; + this.attributes = null; + this.incrementalLoad = null; + this.outputXSL = null; + this.range = null; + this.record = null; + this.startNode = null; + this.uri = null; + this.window = null; + this.xsl = null; + this.excludeNS = new XFAObjectArray(); + this.transform = new XFAObjectArray(); + } +} +class Debug extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "debug", true); + this.uri = null; + } +} +class DefaultTypeface extends ContentObject { + constructor(attributes) { + super(CONFIG_NS_ID, "defaultTypeface"); + this.writingScript = getStringOption(attributes.writingScript, ["*", "Arabic", "Cyrillic", "EastEuropeanRoman", "Greek", "Hebrew", "Japanese", "Korean", "Roman", "SimplifiedChinese", "Thai", "TraditionalChinese", "Vietnamese"]); + } +} +class Destination extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "destination", ["pdf", "pcl", "ps", "webClient", "zpl"]); + } +} +class DocumentAssembly extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "documentAssembly"); + } +} +class Driver extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "driver", true); + this.name = attributes.name ? attributes.name.trim() : ""; + this.fontInfo = null; + this.xdc = null; + } +} +class DuplexOption extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "duplexOption", ["simplex", "duplexFlipLongEdge", "duplexFlipShortEdge"]); + } +} +class DynamicRender extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "dynamicRender", ["forbidden", "required"]); + } +} +class Embed extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "embed"); + } +} +class config_Encrypt extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "encrypt"); + } +} +class config_Encryption extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "encryption", true); + this.encrypt = null; + this.encryptionLevel = null; + this.permissions = null; + } +} +class EncryptionLevel extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "encryptionLevel", ["40bit", "128bit"]); + } +} +class Enforce extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "enforce"); + } +} +class Equate extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "equate"); + this.force = getInteger({ + data: attributes.force, + defaultValue: 1, + validate: n => n === 0 + }); + this.from = attributes.from || ""; + this.to = attributes.to || ""; + } +} +class EquateRange extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "equateRange"); + this.from = attributes.from || ""; + this.to = attributes.to || ""; + this._unicodeRange = attributes.unicodeRange || ""; + } + get unicodeRange() { + const ranges = []; + const unicodeRegex = /U\+([0-9a-fA-F]+)/; + const unicodeRange = this._unicodeRange; + for (let range of unicodeRange.split(",").map(x => x.trim()).filter(x => !!x)) { + range = range.split("-", 2).map(x => { + const found = x.match(unicodeRegex); + if (!found) { + return 0; + } + return parseInt(found[1], 16); + }); + if (range.length === 1) { + range.push(range[0]); + } + ranges.push(range); + } + return shadow(this, "unicodeRange", ranges); + } +} +class Exclude extends ContentObject { + constructor(attributes) { + super(CONFIG_NS_ID, "exclude"); + } + [$finalize]() { + this[$content] = this[$content].trim().split(/\s+/).filter(x => x && ["calculate", "close", "enter", "exit", "initialize", "ready", "validate"].includes(x)); + } +} +class ExcludeNS extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "excludeNS"); + } +} +class FlipLabel extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "flipLabel", ["usePrinterSetting", "on", "off"]); + } +} +class config_FontInfo extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "fontInfo", true); + this.embed = null; + this.map = null; + this.subsetBelow = null; + this.alwaysEmbed = new XFAObjectArray(); + this.defaultTypeface = new XFAObjectArray(); + this.neverEmbed = new XFAObjectArray(); + } +} +class FormFieldFilling extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "formFieldFilling"); + } +} +class GroupParent extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "groupParent"); + } +} +class IfEmpty extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "ifEmpty", ["dataValue", "dataGroup", "ignore", "remove"]); + } +} +class IncludeXDPContent extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "includeXDPContent"); + } +} +class IncrementalLoad extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "incrementalLoad", ["none", "forwardOnly"]); + } +} +class IncrementalMerge extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "incrementalMerge"); + } +} +class Interactive extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "interactive"); + } +} +class Jog extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "jog", ["usePrinterSetting", "none", "pageSet"]); + } +} +class LabelPrinter extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "labelPrinter", true); + this.name = getStringOption(attributes.name, ["zpl", "dpl", "ipl", "tcpl"]); + this.batchOutput = null; + this.flipLabel = null; + this.fontInfo = null; + this.xdc = null; + } +} +class Layout extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "layout", ["paginate", "panel"]); + } +} +class Level extends IntegerObject { + constructor(attributes) { + super(CONFIG_NS_ID, "level", 0, n => n > 0); + } +} +class Linearized extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "linearized"); + } +} +class Locale extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "locale"); + } +} +class LocaleSet extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "localeSet"); + } +} +class Log extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "log", true); + this.mode = null; + this.threshold = null; + this.to = null; + this.uri = null; + } +} +class MapElement extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "map", true); + this.equate = new XFAObjectArray(); + this.equateRange = new XFAObjectArray(); + } +} +class MediumInfo extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "mediumInfo", true); + this.map = null; + } +} +class config_Message extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "message", true); + this.msgId = null; + this.severity = null; + } +} +class Messaging extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "messaging", true); + this.message = new XFAObjectArray(); + } +} +class Mode extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "mode", ["append", "overwrite"]); + } +} +class ModifyAnnots extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "modifyAnnots"); + } +} +class MsgId extends IntegerObject { + constructor(attributes) { + super(CONFIG_NS_ID, "msgId", 1, n => n >= 1); + } +} +class NameAttr extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "nameAttr"); + } +} +class NeverEmbed extends ContentObject { + constructor(attributes) { + super(CONFIG_NS_ID, "neverEmbed"); + } +} +class NumberOfCopies extends IntegerObject { + constructor(attributes) { + super(CONFIG_NS_ID, "numberOfCopies", null, n => n >= 2 && n <= 5); + } +} +class OpenAction extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "openAction", true); + this.destination = null; + } +} +class Output extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "output", true); + this.to = null; + this.type = null; + this.uri = null; + } +} +class OutputBin extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "outputBin"); + } +} +class OutputXSL extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "outputXSL", true); + this.uri = null; + } +} +class Overprint extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "overprint", ["none", "both", "draw", "field"]); + } +} +class Packets extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "packets"); + } + [$finalize]() { + if (this[$content] === "*") { + return; + } + this[$content] = this[$content].trim().split(/\s+/).filter(x => ["config", "datasets", "template", "xfdf", "xslt"].includes(x)); + } +} +class PageOffset extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "pageOffset"); + this.x = getInteger({ + data: attributes.x, + defaultValue: "useXDCSetting", + validate: n => true + }); + this.y = getInteger({ + data: attributes.y, + defaultValue: "useXDCSetting", + validate: n => true + }); + } +} +class PageRange extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "pageRange"); + } + [$finalize]() { + const numbers = this[$content].trim().split(/\s+/).map(x => parseInt(x, 10)); + const ranges = []; + for (let i = 0, ii = numbers.length; i < ii; i += 2) { + ranges.push(numbers.slice(i, i + 2)); + } + this[$content] = ranges; + } +} +class Pagination extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "pagination", ["simplex", "duplexShortEdge", "duplexLongEdge"]); + } +} +class PaginationOverride extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "paginationOverride", ["none", "forceDuplex", "forceDuplexLongEdge", "forceDuplexShortEdge", "forceSimplex"]); + } +} +class Part extends IntegerObject { + constructor(attributes) { + super(CONFIG_NS_ID, "part", 1, n => false); + } +} +class Pcl extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "pcl", true); + this.name = attributes.name || ""; + this.batchOutput = null; + this.fontInfo = null; + this.jog = null; + this.mediumInfo = null; + this.outputBin = null; + this.pageOffset = null; + this.staple = null; + this.xdc = null; + } +} +class Pdf extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "pdf", true); + this.name = attributes.name || ""; + this.adobeExtensionLevel = null; + this.batchOutput = null; + this.compression = null; + this.creator = null; + this.encryption = null; + this.fontInfo = null; + this.interactive = null; + this.linearized = null; + this.openAction = null; + this.pdfa = null; + this.producer = null; + this.renderPolicy = null; + this.scriptModel = null; + this.silentPrint = null; + this.submitFormat = null; + this.tagged = null; + this.version = null; + this.viewerPreferences = null; + this.xdc = null; + } +} +class Pdfa extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "pdfa", true); + this.amd = null; + this.conformance = null; + this.includeXDPContent = null; + this.part = null; + } +} +class Permissions extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "permissions", true); + this.accessibleContent = null; + this.change = null; + this.contentCopy = null; + this.documentAssembly = null; + this.formFieldFilling = null; + this.modifyAnnots = null; + this.plaintextMetadata = null; + this.print = null; + this.printHighQuality = null; + } +} +class PickTrayByPDFSize extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "pickTrayByPDFSize"); + } +} +class config_Picture extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "picture"); + } +} +class PlaintextMetadata extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "plaintextMetadata"); + } +} +class Presence extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "presence", ["preserve", "dissolve", "dissolveStructure", "ignore", "remove"]); + } +} +class Present extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "present", true); + this.behaviorOverride = null; + this.cache = null; + this.common = null; + this.copies = null; + this.destination = null; + this.incrementalMerge = null; + this.layout = null; + this.output = null; + this.overprint = null; + this.pagination = null; + this.paginationOverride = null; + this.script = null; + this.validate = null; + this.xdp = null; + this.driver = new XFAObjectArray(); + this.labelPrinter = new XFAObjectArray(); + this.pcl = new XFAObjectArray(); + this.pdf = new XFAObjectArray(); + this.ps = new XFAObjectArray(); + this.submitUrl = new XFAObjectArray(); + this.webClient = new XFAObjectArray(); + this.zpl = new XFAObjectArray(); + } +} +class Print extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "print"); + } +} +class PrintHighQuality extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "printHighQuality"); + } +} +class PrintScaling extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "printScaling", ["appdefault", "noScaling"]); + } +} +class PrinterName extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "printerName"); + } +} +class Producer extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "producer"); + } +} +class Ps extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "ps", true); + this.name = attributes.name || ""; + this.batchOutput = null; + this.fontInfo = null; + this.jog = null; + this.mediumInfo = null; + this.outputBin = null; + this.staple = null; + this.xdc = null; + } +} +class Range extends ContentObject { + constructor(attributes) { + super(CONFIG_NS_ID, "range"); + } + [$finalize]() { + this[$content] = this[$content].trim().split(/\s*,\s*/, 2).map(range => range.split("-").map(x => parseInt(x.trim(), 10))).filter(range => range.every(x => !isNaN(x))).map(range => { + if (range.length === 1) { + range.push(range[0]); + } + return range; + }); + } +} +class Record extends ContentObject { + constructor(attributes) { + super(CONFIG_NS_ID, "record"); + } + [$finalize]() { + this[$content] = this[$content].trim(); + const n = parseInt(this[$content], 10); + if (!isNaN(n) && n >= 0) { + this[$content] = n; + } + } +} +class Relevant extends ContentObject { + constructor(attributes) { + super(CONFIG_NS_ID, "relevant"); + } + [$finalize]() { + this[$content] = this[$content].trim().split(/\s+/); + } +} +class Rename extends ContentObject { + constructor(attributes) { + super(CONFIG_NS_ID, "rename"); + } + [$finalize]() { + this[$content] = this[$content].trim(); + if (this[$content].toLowerCase().startsWith("xml") || new RegExp("[\\p{L}_][\\p{L}\\d._\\p{M}-]*", "u").test(this[$content])) { + warn("XFA - Rename: invalid XFA name"); + } + } +} +class RenderPolicy extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "renderPolicy", ["server", "client"]); + } +} +class RunScripts extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "runScripts", ["both", "client", "none", "server"]); + } +} +class config_Script extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "script", true); + this.currentPage = null; + this.exclude = null; + this.runScripts = null; + } +} +class ScriptModel extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "scriptModel", ["XFA", "none"]); + } +} +class Severity extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "severity", ["ignore", "error", "information", "trace", "warning"]); + } +} +class SilentPrint extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "silentPrint", true); + this.addSilentPrint = null; + this.printerName = null; + } +} +class Staple extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "staple"); + this.mode = getStringOption(attributes.mode, ["usePrinterSetting", "on", "off"]); + } +} +class StartNode extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "startNode"); + } +} +class StartPage extends IntegerObject { + constructor(attributes) { + super(CONFIG_NS_ID, "startPage", 0, n => true); + } +} +class SubmitFormat extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "submitFormat", ["html", "delegate", "fdf", "xml", "pdf"]); + } +} +class SubmitUrl extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "submitUrl"); + } +} +class SubsetBelow extends IntegerObject { + constructor(attributes) { + super(CONFIG_NS_ID, "subsetBelow", 100, n => n >= 0 && n <= 100); + } +} +class SuppressBanner extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "suppressBanner"); + } +} +class Tagged extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "tagged"); + } +} +class config_Template extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "template", true); + this.base = null; + this.relevant = null; + this.startPage = null; + this.uri = null; + this.xsl = null; + } +} +class Threshold extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "threshold", ["trace", "error", "information", "warning"]); + } +} +class To extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "to", ["null", "memory", "stderr", "stdout", "system", "uri"]); + } +} +class TemplateCache extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "templateCache"); + this.maxEntries = getInteger({ + data: attributes.maxEntries, + defaultValue: 5, + validate: n => n >= 0 + }); + } +} +class Trace extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "trace", true); + this.area = new XFAObjectArray(); + } +} +class Transform extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "transform", true); + this.groupParent = null; + this.ifEmpty = null; + this.nameAttr = null; + this.picture = null; + this.presence = null; + this.rename = null; + this.whitespace = null; + } +} +class Type extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "type", ["none", "ascii85", "asciiHex", "ccittfax", "flate", "lzw", "runLength", "native", "xdp", "mergedXDP"]); + } +} +class Uri extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "uri"); + } +} +class config_Validate extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "validate", ["preSubmit", "prePrint", "preExecute", "preSave"]); + } +} +class ValidateApprovalSignatures extends ContentObject { + constructor(attributes) { + super(CONFIG_NS_ID, "validateApprovalSignatures"); + } + [$finalize]() { + this[$content] = this[$content].trim().split(/\s+/).filter(x => ["docReady", "postSign"].includes(x)); + } +} +class ValidationMessaging extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "validationMessaging", ["allMessagesIndividually", "allMessagesTogether", "firstMessageOnly", "noMessages"]); + } +} +class Version extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "version", ["1.7", "1.6", "1.5", "1.4", "1.3", "1.2"]); + } +} +class VersionControl extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "VersionControl"); + this.outputBelow = getStringOption(attributes.outputBelow, ["warn", "error", "update"]); + this.sourceAbove = getStringOption(attributes.sourceAbove, ["warn", "error"]); + this.sourceBelow = getStringOption(attributes.sourceBelow, ["update", "maintain"]); + } +} +class ViewerPreferences extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "viewerPreferences", true); + this.ADBE_JSConsole = null; + this.ADBE_JSDebugger = null; + this.addViewerPreferences = null; + this.duplexOption = null; + this.enforce = null; + this.numberOfCopies = null; + this.pageRange = null; + this.pickTrayByPDFSize = null; + this.printScaling = null; + } +} +class WebClient extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "webClient", true); + this.name = attributes.name ? attributes.name.trim() : ""; + this.fontInfo = null; + this.xdc = null; + } +} +class Whitespace extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "whitespace", ["preserve", "ltrim", "normalize", "rtrim", "trim"]); + } +} +class Window extends ContentObject { + constructor(attributes) { + super(CONFIG_NS_ID, "window"); + } + [$finalize]() { + const pair = this[$content].trim().split(/\s*,\s*/, 2).map(x => parseInt(x, 10)); + if (pair.some(x => isNaN(x))) { + this[$content] = [0, 0]; + return; + } + if (pair.length === 1) { + pair.push(pair[0]); + } + this[$content] = pair; + } +} +class Xdc extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "xdc", true); + this.uri = new XFAObjectArray(); + this.xsl = new XFAObjectArray(); + } +} +class Xdp extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "xdp", true); + this.packets = null; + } +} +class Xsl extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "xsl", true); + this.debug = null; + this.uri = null; + } +} +class Zpl extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "zpl", true); + this.name = attributes.name ? attributes.name.trim() : ""; + this.batchOutput = null; + this.flipLabel = null; + this.fontInfo = null; + this.xdc = null; + } +} +class ConfigNamespace { + static [$buildXFAObject](name, attributes) { + if (ConfigNamespace.hasOwnProperty(name)) { + return ConfigNamespace[name](attributes); + } + return undefined; + } + static acrobat(attrs) { + return new Acrobat(attrs); + } + static acrobat7(attrs) { + return new Acrobat7(attrs); + } + static ADBE_JSConsole(attrs) { + return new ADBE_JSConsole(attrs); + } + static ADBE_JSDebugger(attrs) { + return new ADBE_JSDebugger(attrs); + } + static addSilentPrint(attrs) { + return new AddSilentPrint(attrs); + } + static addViewerPreferences(attrs) { + return new AddViewerPreferences(attrs); + } + static adjustData(attrs) { + return new AdjustData(attrs); + } + static adobeExtensionLevel(attrs) { + return new AdobeExtensionLevel(attrs); + } + static agent(attrs) { + return new Agent(attrs); + } + static alwaysEmbed(attrs) { + return new AlwaysEmbed(attrs); + } + static amd(attrs) { + return new Amd(attrs); + } + static area(attrs) { + return new config_Area(attrs); + } + static attributes(attrs) { + return new Attributes(attrs); + } + static autoSave(attrs) { + return new AutoSave(attrs); + } + static base(attrs) { + return new Base(attrs); + } + static batchOutput(attrs) { + return new BatchOutput(attrs); + } + static behaviorOverride(attrs) { + return new BehaviorOverride(attrs); + } + static cache(attrs) { + return new Cache(attrs); + } + static change(attrs) { + return new Change(attrs); + } + static common(attrs) { + return new Common(attrs); + } + static compress(attrs) { + return new Compress(attrs); + } + static compressLogicalStructure(attrs) { + return new CompressLogicalStructure(attrs); + } + static compressObjectStream(attrs) { + return new CompressObjectStream(attrs); + } + static compression(attrs) { + return new Compression(attrs); + } + static config(attrs) { + return new Config(attrs); + } + static conformance(attrs) { + return new Conformance(attrs); + } + static contentCopy(attrs) { + return new ContentCopy(attrs); + } + static copies(attrs) { + return new Copies(attrs); + } + static creator(attrs) { + return new Creator(attrs); + } + static currentPage(attrs) { + return new CurrentPage(attrs); + } + static data(attrs) { + return new Data(attrs); + } + static debug(attrs) { + return new Debug(attrs); + } + static defaultTypeface(attrs) { + return new DefaultTypeface(attrs); + } + static destination(attrs) { + return new Destination(attrs); + } + static documentAssembly(attrs) { + return new DocumentAssembly(attrs); + } + static driver(attrs) { + return new Driver(attrs); + } + static duplexOption(attrs) { + return new DuplexOption(attrs); + } + static dynamicRender(attrs) { + return new DynamicRender(attrs); + } + static embed(attrs) { + return new Embed(attrs); + } + static encrypt(attrs) { + return new config_Encrypt(attrs); + } + static encryption(attrs) { + return new config_Encryption(attrs); + } + static encryptionLevel(attrs) { + return new EncryptionLevel(attrs); + } + static enforce(attrs) { + return new Enforce(attrs); + } + static equate(attrs) { + return new Equate(attrs); + } + static equateRange(attrs) { + return new EquateRange(attrs); + } + static exclude(attrs) { + return new Exclude(attrs); + } + static excludeNS(attrs) { + return new ExcludeNS(attrs); + } + static flipLabel(attrs) { + return new FlipLabel(attrs); + } + static fontInfo(attrs) { + return new config_FontInfo(attrs); + } + static formFieldFilling(attrs) { + return new FormFieldFilling(attrs); + } + static groupParent(attrs) { + return new GroupParent(attrs); + } + static ifEmpty(attrs) { + return new IfEmpty(attrs); + } + static includeXDPContent(attrs) { + return new IncludeXDPContent(attrs); + } + static incrementalLoad(attrs) { + return new IncrementalLoad(attrs); + } + static incrementalMerge(attrs) { + return new IncrementalMerge(attrs); + } + static interactive(attrs) { + return new Interactive(attrs); + } + static jog(attrs) { + return new Jog(attrs); + } + static labelPrinter(attrs) { + return new LabelPrinter(attrs); + } + static layout(attrs) { + return new Layout(attrs); + } + static level(attrs) { + return new Level(attrs); + } + static linearized(attrs) { + return new Linearized(attrs); + } + static locale(attrs) { + return new Locale(attrs); + } + static localeSet(attrs) { + return new LocaleSet(attrs); + } + static log(attrs) { + return new Log(attrs); + } + static map(attrs) { + return new MapElement(attrs); + } + static mediumInfo(attrs) { + return new MediumInfo(attrs); + } + static message(attrs) { + return new config_Message(attrs); + } + static messaging(attrs) { + return new Messaging(attrs); + } + static mode(attrs) { + return new Mode(attrs); + } + static modifyAnnots(attrs) { + return new ModifyAnnots(attrs); + } + static msgId(attrs) { + return new MsgId(attrs); + } + static nameAttr(attrs) { + return new NameAttr(attrs); + } + static neverEmbed(attrs) { + return new NeverEmbed(attrs); + } + static numberOfCopies(attrs) { + return new NumberOfCopies(attrs); + } + static openAction(attrs) { + return new OpenAction(attrs); + } + static output(attrs) { + return new Output(attrs); + } + static outputBin(attrs) { + return new OutputBin(attrs); + } + static outputXSL(attrs) { + return new OutputXSL(attrs); + } + static overprint(attrs) { + return new Overprint(attrs); + } + static packets(attrs) { + return new Packets(attrs); + } + static pageOffset(attrs) { + return new PageOffset(attrs); + } + static pageRange(attrs) { + return new PageRange(attrs); + } + static pagination(attrs) { + return new Pagination(attrs); + } + static paginationOverride(attrs) { + return new PaginationOverride(attrs); + } + static part(attrs) { + return new Part(attrs); + } + static pcl(attrs) { + return new Pcl(attrs); + } + static pdf(attrs) { + return new Pdf(attrs); + } + static pdfa(attrs) { + return new Pdfa(attrs); + } + static permissions(attrs) { + return new Permissions(attrs); + } + static pickTrayByPDFSize(attrs) { + return new PickTrayByPDFSize(attrs); + } + static picture(attrs) { + return new config_Picture(attrs); + } + static plaintextMetadata(attrs) { + return new PlaintextMetadata(attrs); + } + static presence(attrs) { + return new Presence(attrs); + } + static present(attrs) { + return new Present(attrs); + } + static print(attrs) { + return new Print(attrs); + } + static printHighQuality(attrs) { + return new PrintHighQuality(attrs); + } + static printScaling(attrs) { + return new PrintScaling(attrs); + } + static printerName(attrs) { + return new PrinterName(attrs); + } + static producer(attrs) { + return new Producer(attrs); + } + static ps(attrs) { + return new Ps(attrs); + } + static range(attrs) { + return new Range(attrs); + } + static record(attrs) { + return new Record(attrs); + } + static relevant(attrs) { + return new Relevant(attrs); + } + static rename(attrs) { + return new Rename(attrs); + } + static renderPolicy(attrs) { + return new RenderPolicy(attrs); + } + static runScripts(attrs) { + return new RunScripts(attrs); + } + static script(attrs) { + return new config_Script(attrs); + } + static scriptModel(attrs) { + return new ScriptModel(attrs); + } + static severity(attrs) { + return new Severity(attrs); + } + static silentPrint(attrs) { + return new SilentPrint(attrs); + } + static staple(attrs) { + return new Staple(attrs); + } + static startNode(attrs) { + return new StartNode(attrs); + } + static startPage(attrs) { + return new StartPage(attrs); + } + static submitFormat(attrs) { + return new SubmitFormat(attrs); + } + static submitUrl(attrs) { + return new SubmitUrl(attrs); + } + static subsetBelow(attrs) { + return new SubsetBelow(attrs); + } + static suppressBanner(attrs) { + return new SuppressBanner(attrs); + } + static tagged(attrs) { + return new Tagged(attrs); + } + static template(attrs) { + return new config_Template(attrs); + } + static templateCache(attrs) { + return new TemplateCache(attrs); + } + static threshold(attrs) { + return new Threshold(attrs); + } + static to(attrs) { + return new To(attrs); + } + static trace(attrs) { + return new Trace(attrs); + } + static transform(attrs) { + return new Transform(attrs); + } + static type(attrs) { + return new Type(attrs); + } + static uri(attrs) { + return new Uri(attrs); + } + static validate(attrs) { + return new config_Validate(attrs); + } + static validateApprovalSignatures(attrs) { + return new ValidateApprovalSignatures(attrs); + } + static validationMessaging(attrs) { + return new ValidationMessaging(attrs); + } + static version(attrs) { + return new Version(attrs); + } + static versionControl(attrs) { + return new VersionControl(attrs); + } + static viewerPreferences(attrs) { + return new ViewerPreferences(attrs); + } + static webClient(attrs) { + return new WebClient(attrs); + } + static whitespace(attrs) { + return new Whitespace(attrs); + } + static window(attrs) { + return new Window(attrs); + } + static xdc(attrs) { + return new Xdc(attrs); + } + static xdp(attrs) { + return new Xdp(attrs); + } + static xsl(attrs) { + return new Xsl(attrs); + } + static zpl(attrs) { + return new Zpl(attrs); + } +} + +;// ./src/core/xfa/connection_set.js + + +const CONNECTION_SET_NS_ID = NamespaceIds.connectionSet.id; +class ConnectionSet extends XFAObject { + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "connectionSet", true); + this.wsdlConnection = new XFAObjectArray(); + this.xmlConnection = new XFAObjectArray(); + this.xsdConnection = new XFAObjectArray(); + } +} +class EffectiveInputPolicy extends XFAObject { + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "effectiveInputPolicy"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class EffectiveOutputPolicy extends XFAObject { + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "effectiveOutputPolicy"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Operation extends StringObject { + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "operation"); + this.id = attributes.id || ""; + this.input = attributes.input || ""; + this.name = attributes.name || ""; + this.output = attributes.output || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class RootElement extends StringObject { + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "rootElement"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class SoapAction extends StringObject { + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "soapAction"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class SoapAddress extends StringObject { + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "soapAddress"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class connection_set_Uri extends StringObject { + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "uri"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class WsdlAddress extends StringObject { + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "wsdlAddress"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class WsdlConnection extends XFAObject { + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "wsdlConnection", true); + this.dataDescription = attributes.dataDescription || ""; + this.name = attributes.name || ""; + this.effectiveInputPolicy = null; + this.effectiveOutputPolicy = null; + this.operation = null; + this.soapAction = null; + this.soapAddress = null; + this.wsdlAddress = null; + } +} +class XmlConnection extends XFAObject { + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "xmlConnection", true); + this.dataDescription = attributes.dataDescription || ""; + this.name = attributes.name || ""; + this.uri = null; + } +} +class XsdConnection extends XFAObject { + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "xsdConnection", true); + this.dataDescription = attributes.dataDescription || ""; + this.name = attributes.name || ""; + this.rootElement = null; + this.uri = null; + } +} +class ConnectionSetNamespace { + static [$buildXFAObject](name, attributes) { + if (ConnectionSetNamespace.hasOwnProperty(name)) { + return ConnectionSetNamespace[name](attributes); + } + return undefined; + } + static connectionSet(attrs) { + return new ConnectionSet(attrs); + } + static effectiveInputPolicy(attrs) { + return new EffectiveInputPolicy(attrs); + } + static effectiveOutputPolicy(attrs) { + return new EffectiveOutputPolicy(attrs); + } + static operation(attrs) { + return new Operation(attrs); + } + static rootElement(attrs) { + return new RootElement(attrs); + } + static soapAction(attrs) { + return new SoapAction(attrs); + } + static soapAddress(attrs) { + return new SoapAddress(attrs); + } + static uri(attrs) { + return new connection_set_Uri(attrs); + } + static wsdlAddress(attrs) { + return new WsdlAddress(attrs); + } + static wsdlConnection(attrs) { + return new WsdlConnection(attrs); + } + static xmlConnection(attrs) { + return new XmlConnection(attrs); + } + static xsdConnection(attrs) { + return new XsdConnection(attrs); + } +} + +;// ./src/core/xfa/datasets.js + + + +const DATASETS_NS_ID = NamespaceIds.datasets.id; +class datasets_Data extends XmlObject { + constructor(attributes) { + super(DATASETS_NS_ID, "data", attributes); + } + [$isNsAgnostic]() { + return true; + } +} +class Datasets extends XFAObject { + constructor(attributes) { + super(DATASETS_NS_ID, "datasets", true); + this.data = null; + this.Signature = null; + } + [$onChild](child) { + const name = child[$nodeName]; + if (name === "data" && child[$namespaceId] === DATASETS_NS_ID || name === "Signature" && child[$namespaceId] === NamespaceIds.signature.id) { + this[name] = child; + } + this[$appendChild](child); + } +} +class DatasetsNamespace { + static [$buildXFAObject](name, attributes) { + if (DatasetsNamespace.hasOwnProperty(name)) { + return DatasetsNamespace[name](attributes); + } + return undefined; + } + static datasets(attributes) { + return new Datasets(attributes); + } + static data(attributes) { + return new datasets_Data(attributes); + } +} + +;// ./src/core/xfa/locale_set.js + + + +const LOCALE_SET_NS_ID = NamespaceIds.localeSet.id; +class CalendarSymbols extends XFAObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "calendarSymbols", true); + this.name = "gregorian"; + this.dayNames = new XFAObjectArray(2); + this.eraNames = null; + this.meridiemNames = null; + this.monthNames = new XFAObjectArray(2); + } +} +class CurrencySymbol extends StringObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "currencySymbol"); + this.name = getStringOption(attributes.name, ["symbol", "isoname", "decimal"]); + } +} +class CurrencySymbols extends XFAObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "currencySymbols", true); + this.currencySymbol = new XFAObjectArray(3); + } +} +class DatePattern extends StringObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "datePattern"); + this.name = getStringOption(attributes.name, ["full", "long", "med", "short"]); + } +} +class DatePatterns extends XFAObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "datePatterns", true); + this.datePattern = new XFAObjectArray(4); + } +} +class DateTimeSymbols extends ContentObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "dateTimeSymbols"); + } +} +class Day extends StringObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "day"); + } +} +class DayNames extends XFAObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "dayNames", true); + this.abbr = getInteger({ + data: attributes.abbr, + defaultValue: 0, + validate: x => x === 1 + }); + this.day = new XFAObjectArray(7); + } +} +class Era extends StringObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "era"); + } +} +class EraNames extends XFAObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "eraNames", true); + this.era = new XFAObjectArray(2); + } +} +class locale_set_Locale extends XFAObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "locale", true); + this.desc = attributes.desc || ""; + this.name = "isoname"; + this.calendarSymbols = null; + this.currencySymbols = null; + this.datePatterns = null; + this.dateTimeSymbols = null; + this.numberPatterns = null; + this.numberSymbols = null; + this.timePatterns = null; + this.typeFaces = null; + } +} +class locale_set_LocaleSet extends XFAObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "localeSet", true); + this.locale = new XFAObjectArray(); + } +} +class Meridiem extends StringObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "meridiem"); + } +} +class MeridiemNames extends XFAObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "meridiemNames", true); + this.meridiem = new XFAObjectArray(2); + } +} +class Month extends StringObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "month"); + } +} +class MonthNames extends XFAObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "monthNames", true); + this.abbr = getInteger({ + data: attributes.abbr, + defaultValue: 0, + validate: x => x === 1 + }); + this.month = new XFAObjectArray(12); + } +} +class NumberPattern extends StringObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "numberPattern"); + this.name = getStringOption(attributes.name, ["full", "long", "med", "short"]); + } +} +class NumberPatterns extends XFAObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "numberPatterns", true); + this.numberPattern = new XFAObjectArray(4); + } +} +class NumberSymbol extends StringObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "numberSymbol"); + this.name = getStringOption(attributes.name, ["decimal", "grouping", "percent", "minus", "zero"]); + } +} +class NumberSymbols extends XFAObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "numberSymbols", true); + this.numberSymbol = new XFAObjectArray(5); + } +} +class TimePattern extends StringObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "timePattern"); + this.name = getStringOption(attributes.name, ["full", "long", "med", "short"]); + } +} +class TimePatterns extends XFAObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "timePatterns", true); + this.timePattern = new XFAObjectArray(4); + } +} +class TypeFace extends XFAObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "typeFace", true); + this.name = attributes.name | ""; + } +} +class TypeFaces extends XFAObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "typeFaces", true); + this.typeFace = new XFAObjectArray(); + } +} +class LocaleSetNamespace { + static [$buildXFAObject](name, attributes) { + if (LocaleSetNamespace.hasOwnProperty(name)) { + return LocaleSetNamespace[name](attributes); + } + return undefined; + } + static calendarSymbols(attrs) { + return new CalendarSymbols(attrs); + } + static currencySymbol(attrs) { + return new CurrencySymbol(attrs); + } + static currencySymbols(attrs) { + return new CurrencySymbols(attrs); + } + static datePattern(attrs) { + return new DatePattern(attrs); + } + static datePatterns(attrs) { + return new DatePatterns(attrs); + } + static dateTimeSymbols(attrs) { + return new DateTimeSymbols(attrs); + } + static day(attrs) { + return new Day(attrs); + } + static dayNames(attrs) { + return new DayNames(attrs); + } + static era(attrs) { + return new Era(attrs); + } + static eraNames(attrs) { + return new EraNames(attrs); + } + static locale(attrs) { + return new locale_set_Locale(attrs); + } + static localeSet(attrs) { + return new locale_set_LocaleSet(attrs); + } + static meridiem(attrs) { + return new Meridiem(attrs); + } + static meridiemNames(attrs) { + return new MeridiemNames(attrs); + } + static month(attrs) { + return new Month(attrs); + } + static monthNames(attrs) { + return new MonthNames(attrs); + } + static numberPattern(attrs) { + return new NumberPattern(attrs); + } + static numberPatterns(attrs) { + return new NumberPatterns(attrs); + } + static numberSymbol(attrs) { + return new NumberSymbol(attrs); + } + static numberSymbols(attrs) { + return new NumberSymbols(attrs); + } + static timePattern(attrs) { + return new TimePattern(attrs); + } + static timePatterns(attrs) { + return new TimePatterns(attrs); + } + static typeFace(attrs) { + return new TypeFace(attrs); + } + static typeFaces(attrs) { + return new TypeFaces(attrs); + } +} + +;// ./src/core/xfa/signature.js + + +const SIGNATURE_NS_ID = NamespaceIds.signature.id; +class signature_Signature extends XFAObject { + constructor(attributes) { + super(SIGNATURE_NS_ID, "signature", true); + } +} +class SignatureNamespace { + static [$buildXFAObject](name, attributes) { + if (SignatureNamespace.hasOwnProperty(name)) { + return SignatureNamespace[name](attributes); + } + return undefined; + } + static signature(attributes) { + return new signature_Signature(attributes); + } +} + +;// ./src/core/xfa/stylesheet.js + + +const STYLESHEET_NS_ID = NamespaceIds.stylesheet.id; +class Stylesheet extends XFAObject { + constructor(attributes) { + super(STYLESHEET_NS_ID, "stylesheet", true); + } +} +class StylesheetNamespace { + static [$buildXFAObject](name, attributes) { + if (StylesheetNamespace.hasOwnProperty(name)) { + return StylesheetNamespace[name](attributes); + } + return undefined; + } + static stylesheet(attributes) { + return new Stylesheet(attributes); + } +} + +;// ./src/core/xfa/xdp.js + + + +const XDP_NS_ID = NamespaceIds.xdp.id; +class xdp_Xdp extends XFAObject { + constructor(attributes) { + super(XDP_NS_ID, "xdp", true); + this.uuid = attributes.uuid || ""; + this.timeStamp = attributes.timeStamp || ""; + this.config = null; + this.connectionSet = null; + this.datasets = null; + this.localeSet = null; + this.stylesheet = new XFAObjectArray(); + this.template = null; + } + [$onChildCheck](child) { + const ns = NamespaceIds[child[$nodeName]]; + return ns && child[$namespaceId] === ns.id; + } +} +class XdpNamespace { + static [$buildXFAObject](name, attributes) { + if (XdpNamespace.hasOwnProperty(name)) { + return XdpNamespace[name](attributes); + } + return undefined; + } + static xdp(attributes) { + return new xdp_Xdp(attributes); + } +} + +;// ./src/core/xfa/xhtml.js + + + + + +const XHTML_NS_ID = NamespaceIds.xhtml.id; +const $richText = Symbol(); +const VALID_STYLES = new Set(["color", "font", "font-family", "font-size", "font-stretch", "font-style", "font-weight", "margin", "margin-bottom", "margin-left", "margin-right", "margin-top", "letter-spacing", "line-height", "orphans", "page-break-after", "page-break-before", "page-break-inside", "tab-interval", "tab-stop", "text-align", "text-decoration", "text-indent", "vertical-align", "widows", "kerning-mode", "xfa-font-horizontal-scale", "xfa-font-vertical-scale", "xfa-spacerun", "xfa-tab-stops"]); +const StyleMapping = new Map([["page-break-after", "breakAfter"], ["page-break-before", "breakBefore"], ["page-break-inside", "breakInside"], ["kerning-mode", value => value === "none" ? "none" : "normal"], ["xfa-font-horizontal-scale", value => `scaleX(${Math.max(0, Math.min(parseInt(value) / 100)).toFixed(2)})`], ["xfa-font-vertical-scale", value => `scaleY(${Math.max(0, Math.min(parseInt(value) / 100)).toFixed(2)})`], ["xfa-spacerun", ""], ["xfa-tab-stops", ""], ["font-size", (value, original) => { + value = original.fontSize = Math.abs(getMeasurement(value)); + return measureToString(0.99 * value); +}], ["letter-spacing", value => measureToString(getMeasurement(value))], ["line-height", value => measureToString(getMeasurement(value))], ["margin", value => measureToString(getMeasurement(value))], ["margin-bottom", value => measureToString(getMeasurement(value))], ["margin-left", value => measureToString(getMeasurement(value))], ["margin-right", value => measureToString(getMeasurement(value))], ["margin-top", value => measureToString(getMeasurement(value))], ["text-indent", value => measureToString(getMeasurement(value))], ["font-family", value => value], ["vertical-align", value => measureToString(getMeasurement(value))]]); +const spacesRegExp = /\s+/g; +const crlfRegExp = /[\r\n]+/g; +const crlfForRichTextRegExp = /\r\n?/g; +function mapStyle(styleStr, node, richText) { + const style = Object.create(null); + if (!styleStr) { + return style; + } + const original = Object.create(null); + for (const [key, value] of styleStr.split(";").map(s => s.split(":", 2))) { + const mapping = StyleMapping.get(key); + if (mapping === "") { + continue; + } + let newValue = value; + if (mapping) { + newValue = typeof mapping === "string" ? mapping : mapping(value, original); + } + if (key.endsWith("scale")) { + style.transform = style.transform ? `${style[key]} ${newValue}` : newValue; + } else { + style[key.replaceAll(/-([a-zA-Z])/g, (_, x) => x.toUpperCase())] = newValue; + } + } + if (style.fontFamily) { + setFontFamily({ + typeface: style.fontFamily, + weight: style.fontWeight || "normal", + posture: style.fontStyle || "normal", + size: original.fontSize || 0 + }, node, node[$globalData].fontFinder, style); + } + if (richText && style.verticalAlign && style.verticalAlign !== "0px" && style.fontSize) { + const SUB_SUPER_SCRIPT_FACTOR = 0.583; + const VERTICAL_FACTOR = 0.333; + const fontSize = getMeasurement(style.fontSize); + style.fontSize = measureToString(fontSize * SUB_SUPER_SCRIPT_FACTOR); + style.verticalAlign = measureToString(Math.sign(getMeasurement(style.verticalAlign)) * fontSize * VERTICAL_FACTOR); + } + if (richText && style.fontSize) { + style.fontSize = `calc(${style.fontSize} * var(--scale-factor))`; + } + fixTextIndent(style); + return style; +} +function checkStyle(node) { + if (!node.style) { + return ""; + } + return node.style.trim().split(/\s*;\s*/).filter(s => !!s).map(s => s.split(/\s*:\s*/, 2)).filter(([key, value]) => { + if (key === "font-family") { + node[$globalData].usedTypefaces.add(value); + } + return VALID_STYLES.has(key); + }).map(kv => kv.join(":")).join(";"); +} +const NoWhites = new Set(["body", "html"]); +class XhtmlObject extends XmlObject { + constructor(attributes, name) { + super(XHTML_NS_ID, name); + this[$richText] = false; + this.style = attributes.style || ""; + } + [$clean](builder) { + super[$clean](builder); + this.style = checkStyle(this); + } + [$acceptWhitespace]() { + return !NoWhites.has(this[$nodeName]); + } + [$onText](str, richText = false) { + if (!richText) { + str = str.replaceAll(crlfRegExp, ""); + if (!this.style.includes("xfa-spacerun:yes")) { + str = str.replaceAll(spacesRegExp, " "); + } + } else { + this[$richText] = true; + } + if (str) { + this[$content] += str; + } + } + [$pushGlyphs](measure, mustPop = true) { + const xfaFont = Object.create(null); + const margin = { + top: NaN, + bottom: NaN, + left: NaN, + right: NaN + }; + let lineHeight = null; + for (const [key, value] of this.style.split(";").map(s => s.split(":", 2))) { + switch (key) { + case "font-family": + xfaFont.typeface = stripQuotes(value); + break; + case "font-size": + xfaFont.size = getMeasurement(value); + break; + case "font-weight": + xfaFont.weight = value; + break; + case "font-style": + xfaFont.posture = value; + break; + case "letter-spacing": + xfaFont.letterSpacing = getMeasurement(value); + break; + case "margin": + const values = value.split(/ \t/).map(x => getMeasurement(x)); + switch (values.length) { + case 1: + margin.top = margin.bottom = margin.left = margin.right = values[0]; + break; + case 2: + margin.top = margin.bottom = values[0]; + margin.left = margin.right = values[1]; + break; + case 3: + margin.top = values[0]; + margin.bottom = values[2]; + margin.left = margin.right = values[1]; + break; + case 4: + margin.top = values[0]; + margin.left = values[1]; + margin.bottom = values[2]; + margin.right = values[3]; + break; + } + break; + case "margin-top": + margin.top = getMeasurement(value); + break; + case "margin-bottom": + margin.bottom = getMeasurement(value); + break; + case "margin-left": + margin.left = getMeasurement(value); + break; + case "margin-right": + margin.right = getMeasurement(value); + break; + case "line-height": + lineHeight = getMeasurement(value); + break; + } + } + measure.pushData(xfaFont, margin, lineHeight); + if (this[$content]) { + measure.addString(this[$content]); + } else { + for (const child of this[$getChildren]()) { + if (child[$nodeName] === "#text") { + measure.addString(child[$content]); + continue; + } + child[$pushGlyphs](measure); + } + } + if (mustPop) { + measure.popFont(); + } + } + [$toHTML](availableSpace) { + const children = []; + this[$extra] = { + children + }; + this[$childrenToHTML]({}); + if (children.length === 0 && !this[$content]) { + return HTMLResult.EMPTY; + } + let value; + if (this[$richText]) { + value = this[$content] ? this[$content].replaceAll(crlfForRichTextRegExp, "\n") : undefined; + } else { + value = this[$content] || undefined; + } + return HTMLResult.success({ + name: this[$nodeName], + attributes: { + href: this.href, + style: mapStyle(this.style, this, this[$richText]) + }, + children, + value + }); + } +} +class A extends XhtmlObject { + constructor(attributes) { + super(attributes, "a"); + this.href = fixURL(attributes.href) || ""; + } +} +class B extends XhtmlObject { + constructor(attributes) { + super(attributes, "b"); + } + [$pushGlyphs](measure) { + measure.pushFont({ + weight: "bold" + }); + super[$pushGlyphs](measure); + measure.popFont(); + } +} +class Body extends XhtmlObject { + constructor(attributes) { + super(attributes, "body"); + } + [$toHTML](availableSpace) { + const res = super[$toHTML](availableSpace); + const { + html + } = res; + if (!html) { + return HTMLResult.EMPTY; + } + html.name = "div"; + html.attributes.class = ["xfaRich"]; + return res; + } +} +class Br extends XhtmlObject { + constructor(attributes) { + super(attributes, "br"); + } + [$text]() { + return "\n"; + } + [$pushGlyphs](measure) { + measure.addString("\n"); + } + [$toHTML](availableSpace) { + return HTMLResult.success({ + name: "br" + }); + } +} +class Html extends XhtmlObject { + constructor(attributes) { + super(attributes, "html"); + } + [$toHTML](availableSpace) { + const children = []; + this[$extra] = { + children + }; + this[$childrenToHTML]({}); + if (children.length === 0) { + return HTMLResult.success({ + name: "div", + attributes: { + class: ["xfaRich"], + style: {} + }, + value: this[$content] || "" + }); + } + if (children.length === 1) { + const child = children[0]; + if (child.attributes?.class.includes("xfaRich")) { + return HTMLResult.success(child); + } + } + return HTMLResult.success({ + name: "div", + attributes: { + class: ["xfaRich"], + style: {} + }, + children + }); + } +} +class I extends XhtmlObject { + constructor(attributes) { + super(attributes, "i"); + } + [$pushGlyphs](measure) { + measure.pushFont({ + posture: "italic" + }); + super[$pushGlyphs](measure); + measure.popFont(); + } +} +class Li extends XhtmlObject { + constructor(attributes) { + super(attributes, "li"); + } +} +class Ol extends XhtmlObject { + constructor(attributes) { + super(attributes, "ol"); + } +} +class P extends XhtmlObject { + constructor(attributes) { + super(attributes, "p"); + } + [$pushGlyphs](measure) { + super[$pushGlyphs](measure, false); + measure.addString("\n"); + measure.addPara(); + measure.popFont(); + } + [$text]() { + const siblings = this[$getParent]()[$getChildren](); + if (siblings.at(-1) === this) { + return super[$text](); + } + return super[$text]() + "\n"; + } +} +class Span extends XhtmlObject { + constructor(attributes) { + super(attributes, "span"); + } +} +class Sub extends XhtmlObject { + constructor(attributes) { + super(attributes, "sub"); + } +} +class Sup extends XhtmlObject { + constructor(attributes) { + super(attributes, "sup"); + } +} +class Ul extends XhtmlObject { + constructor(attributes) { + super(attributes, "ul"); + } +} +class XhtmlNamespace { + static [$buildXFAObject](name, attributes) { + if (XhtmlNamespace.hasOwnProperty(name)) { + return XhtmlNamespace[name](attributes); + } + return undefined; + } + static a(attributes) { + return new A(attributes); + } + static b(attributes) { + return new B(attributes); + } + static body(attributes) { + return new Body(attributes); + } + static br(attributes) { + return new Br(attributes); + } + static html(attributes) { + return new Html(attributes); + } + static i(attributes) { + return new I(attributes); + } + static li(attributes) { + return new Li(attributes); + } + static ol(attributes) { + return new Ol(attributes); + } + static p(attributes) { + return new P(attributes); + } + static span(attributes) { + return new Span(attributes); + } + static sub(attributes) { + return new Sub(attributes); + } + static sup(attributes) { + return new Sup(attributes); + } + static ul(attributes) { + return new Ul(attributes); + } +} + +;// ./src/core/xfa/setup.js + + + + + + + + + +const NamespaceSetUp = { + config: ConfigNamespace, + connection: ConnectionSetNamespace, + datasets: DatasetsNamespace, + localeSet: LocaleSetNamespace, + signature: SignatureNamespace, + stylesheet: StylesheetNamespace, + template: TemplateNamespace, + xdp: XdpNamespace, + xhtml: XhtmlNamespace +}; + +;// ./src/core/xfa/unknown.js + + +class UnknownNamespace { + constructor(nsId) { + this.namespaceId = nsId; + } + [$buildXFAObject](name, attributes) { + return new XmlObject(this.namespaceId, name, attributes); + } +} + +;// ./src/core/xfa/builder.js + + + + + + + +class Root extends XFAObject { + constructor(ids) { + super(-1, "root", Object.create(null)); + this.element = null; + this[$ids] = ids; + } + [$onChild](child) { + this.element = child; + return true; + } + [$finalize]() { + super[$finalize](); + if (this.element.template instanceof Template) { + this[$ids].set($root, this.element); + this.element.template[$resolvePrototypes](this[$ids]); + this.element.template[$ids] = this[$ids]; + } + } +} +class Empty extends XFAObject { + constructor() { + super(-1, "", Object.create(null)); + } + [$onChild](_) { + return false; + } +} +class Builder { + constructor(rootNameSpace = null) { + this._namespaceStack = []; + this._nsAgnosticLevel = 0; + this._namespacePrefixes = new Map(); + this._namespaces = new Map(); + this._nextNsId = Math.max(...Object.values(NamespaceIds).map(({ + id + }) => id)); + this._currentNamespace = rootNameSpace || new UnknownNamespace(++this._nextNsId); + } + buildRoot(ids) { + return new Root(ids); + } + build({ + nsPrefix, + name, + attributes, + namespace, + prefixes + }) { + const hasNamespaceDef = namespace !== null; + if (hasNamespaceDef) { + this._namespaceStack.push(this._currentNamespace); + this._currentNamespace = this._searchNamespace(namespace); + } + if (prefixes) { + this._addNamespacePrefix(prefixes); + } + if (attributes.hasOwnProperty($nsAttributes)) { + const dataTemplate = NamespaceSetUp.datasets; + const nsAttrs = attributes[$nsAttributes]; + let xfaAttrs = null; + for (const [ns, attrs] of Object.entries(nsAttrs)) { + const nsToUse = this._getNamespaceToUse(ns); + if (nsToUse === dataTemplate) { + xfaAttrs = { + xfa: attrs + }; + break; + } + } + if (xfaAttrs) { + attributes[$nsAttributes] = xfaAttrs; + } else { + delete attributes[$nsAttributes]; + } + } + const namespaceToUse = this._getNamespaceToUse(nsPrefix); + const node = namespaceToUse?.[$buildXFAObject](name, attributes) || new Empty(); + if (node[$isNsAgnostic]()) { + this._nsAgnosticLevel++; + } + if (hasNamespaceDef || prefixes || node[$isNsAgnostic]()) { + node[$cleanup] = { + hasNamespace: hasNamespaceDef, + prefixes, + nsAgnostic: node[$isNsAgnostic]() + }; + } + return node; + } + isNsAgnostic() { + return this._nsAgnosticLevel > 0; + } + _searchNamespace(nsName) { + let ns = this._namespaces.get(nsName); + if (ns) { + return ns; + } + for (const [name, { + check + }] of Object.entries(NamespaceIds)) { + if (check(nsName)) { + ns = NamespaceSetUp[name]; + if (ns) { + this._namespaces.set(nsName, ns); + return ns; + } + break; + } + } + ns = new UnknownNamespace(++this._nextNsId); + this._namespaces.set(nsName, ns); + return ns; + } + _addNamespacePrefix(prefixes) { + for (const { + prefix, + value + } of prefixes) { + const namespace = this._searchNamespace(value); + let prefixStack = this._namespacePrefixes.get(prefix); + if (!prefixStack) { + prefixStack = []; + this._namespacePrefixes.set(prefix, prefixStack); + } + prefixStack.push(namespace); + } + } + _getNamespaceToUse(prefix) { + if (!prefix) { + return this._currentNamespace; + } + const prefixStack = this._namespacePrefixes.get(prefix); + if (prefixStack?.length > 0) { + return prefixStack.at(-1); + } + warn(`Unknown namespace prefix: ${prefix}.`); + return null; + } + clean(data) { + const { + hasNamespace, + prefixes, + nsAgnostic + } = data; + if (hasNamespace) { + this._currentNamespace = this._namespaceStack.pop(); + } + if (prefixes) { + prefixes.forEach(({ + prefix + }) => { + this._namespacePrefixes.get(prefix).pop(); + }); + } + if (nsAgnostic) { + this._nsAgnosticLevel--; + } + } +} + +;// ./src/core/xfa/parser.js + + + + +class XFAParser extends XMLParserBase { + constructor(rootNameSpace = null, richText = false) { + super(); + this._builder = new Builder(rootNameSpace); + this._stack = []; + this._globalData = { + usedTypefaces: new Set() + }; + this._ids = new Map(); + this._current = this._builder.buildRoot(this._ids); + this._errorCode = XMLParserErrorCode.NoError; + this._whiteRegex = /^\s+$/; + this._nbsps = /\xa0+/g; + this._richText = richText; + } + parse(data) { + this.parseXml(data); + if (this._errorCode !== XMLParserErrorCode.NoError) { + return undefined; + } + this._current[$finalize](); + return this._current.element; + } + onText(text) { + text = text.replace(this._nbsps, match => match.slice(1) + " "); + if (this._richText || this._current[$acceptWhitespace]()) { + this._current[$onText](text, this._richText); + return; + } + if (this._whiteRegex.test(text)) { + return; + } + this._current[$onText](text.trim()); + } + onCdata(text) { + this._current[$onText](text); + } + _mkAttributes(attributes, tagName) { + let namespace = null; + let prefixes = null; + const attributeObj = Object.create({}); + for (const { + name, + value + } of attributes) { + if (name === "xmlns") { + if (!namespace) { + namespace = value; + } else { + warn(`XFA - multiple namespace definition in <${tagName}>`); + } + } else if (name.startsWith("xmlns:")) { + const prefix = name.substring("xmlns:".length); + if (!prefixes) { + prefixes = []; + } + prefixes.push({ + prefix, + value + }); + } else { + const i = name.indexOf(":"); + if (i === -1) { + attributeObj[name] = value; + } else { + let nsAttrs = attributeObj[$nsAttributes]; + if (!nsAttrs) { + nsAttrs = attributeObj[$nsAttributes] = Object.create(null); + } + const [ns, attrName] = [name.slice(0, i), name.slice(i + 1)]; + const attrs = nsAttrs[ns] ||= Object.create(null); + attrs[attrName] = value; + } + } + } + return [namespace, prefixes, attributeObj]; + } + _getNameAndPrefix(name, nsAgnostic) { + const i = name.indexOf(":"); + if (i === -1) { + return [name, null]; + } + return [name.substring(i + 1), nsAgnostic ? "" : name.substring(0, i)]; + } + onBeginElement(tagName, attributes, isEmpty) { + const [namespace, prefixes, attributesObj] = this._mkAttributes(attributes, tagName); + const [name, nsPrefix] = this._getNameAndPrefix(tagName, this._builder.isNsAgnostic()); + const node = this._builder.build({ + nsPrefix, + name, + attributes: attributesObj, + namespace, + prefixes + }); + node[$globalData] = this._globalData; + if (isEmpty) { + node[$finalize](); + if (this._current[$onChild](node)) { + node[$setId](this._ids); + } + node[$clean](this._builder); + return; + } + this._stack.push(this._current); + this._current = node; + } + onEndElement(name) { + const node = this._current; + if (node[$isCDATAXml]() && typeof node[$content] === "string") { + const parser = new XFAParser(); + parser._globalData = this._globalData; + const root = parser.parse(node[$content]); + node[$content] = null; + node[$onChild](root); + } + node[$finalize](); + this._current = this._stack.pop(); + if (this._current[$onChild](node)) { + node[$setId](this._ids); + } + node[$clean](this._builder); + } + onError(code) { + this._errorCode = code; + } +} + +;// ./src/core/xfa/factory.js + + + + + + + + +class XFAFactory { + constructor(data) { + try { + this.root = new XFAParser().parse(XFAFactory._createDocument(data)); + const binder = new Binder(this.root); + this.form = binder.bind(); + this.dataHandler = new DataHandler(this.root, binder.getData()); + this.form[$globalData].template = this.form; + } catch (e) { + warn(`XFA - an error occurred during parsing and binding: ${e}`); + } + } + isValid() { + return this.root && this.form; + } + _createPagesHelper() { + const iterator = this.form[$toPages](); + return new Promise((resolve, reject) => { + const nextIteration = () => { + try { + const value = iterator.next(); + if (value.done) { + resolve(value.value); + } else { + setTimeout(nextIteration, 0); + } + } catch (e) { + reject(e); + } + }; + setTimeout(nextIteration, 0); + }); + } + async _createPages() { + try { + this.pages = await this._createPagesHelper(); + this.dims = this.pages.children.map(c => { + const { + width, + height + } = c.attributes.style; + return [0, 0, parseInt(width), parseInt(height)]; + }); + } catch (e) { + warn(`XFA - an error occurred during layout: ${e}`); + } + } + getBoundingBox(pageIndex) { + return this.dims[pageIndex]; + } + async getNumPages() { + if (!this.pages) { + await this._createPages(); + } + return this.dims.length; + } + setImages(images) { + this.form[$globalData].images = images; + } + setFonts(fonts) { + this.form[$globalData].fontFinder = new FontFinder(fonts); + const missingFonts = []; + for (let typeface of this.form[$globalData].usedTypefaces) { + typeface = stripQuotes(typeface); + const font = this.form[$globalData].fontFinder.find(typeface); + if (!font) { + missingFonts.push(typeface); + } + } + if (missingFonts.length > 0) { + return missingFonts; + } + return null; + } + appendFonts(fonts, reallyMissingFonts) { + this.form[$globalData].fontFinder.add(fonts, reallyMissingFonts); + } + async getPages() { + if (!this.pages) { + await this._createPages(); + } + const pages = this.pages; + this.pages = null; + return pages; + } + serializeData(storage) { + return this.dataHandler.serialize(storage); + } + static _createDocument(data) { + if (!data["/xdp:xdp"]) { + return data["xdp:xdp"]; + } + return Object.values(data).join(""); + } + static getRichTextAsHtml(rc) { + if (!rc || typeof rc !== "string") { + return null; + } + try { + let root = new XFAParser(XhtmlNamespace, true).parse(rc); + if (!["body", "xhtml"].includes(root[$nodeName])) { + const newRoot = XhtmlNamespace.body({}); + newRoot[$appendChild](root); + root = newRoot; + } + const result = root[$toHTML](); + if (!result.success) { + return null; + } + const { + html + } = result; + const { + attributes + } = html; + if (attributes) { + if (attributes.class) { + attributes.class = attributes.class.filter(attr => !attr.startsWith("xfa")); + } + attributes.dir = "auto"; + } + return { + html, + str: root[$text]() + }; + } catch (e) { + warn(`XFA - an error occurred during parsing of rich text: ${e}`); + } + return null; + } +} + +;// ./src/core/annotation.js + + + + + + + + + + + + + + +class AnnotationFactory { + static createGlobals(pdfManager) { + return Promise.all([pdfManager.ensureCatalog("acroForm"), pdfManager.ensureDoc("xfaDatasets"), pdfManager.ensureCatalog("structTreeRoot"), pdfManager.ensureCatalog("baseUrl"), pdfManager.ensureCatalog("attachments")]).then(([acroForm, xfaDatasets, structTreeRoot, baseUrl, attachments]) => { + return { + pdfManager, + acroForm: acroForm instanceof Dict ? acroForm : Dict.empty, + xfaDatasets, + structTreeRoot, + baseUrl, + attachments + }; + }, reason => { + warn(`createGlobals: "${reason}".`); + return null; + }); + } + static async create(xref, ref, annotationGlobals, idFactory, collectFields, orphanFields, pageRef) { + const pageIndex = collectFields ? await this._getPageIndex(xref, ref, annotationGlobals.pdfManager) : null; + return annotationGlobals.pdfManager.ensure(this, "_create", [xref, ref, annotationGlobals, idFactory, collectFields, orphanFields, pageIndex, pageRef]); + } + static _create(xref, ref, annotationGlobals, idFactory, collectFields = false, orphanFields = null, pageIndex = null, pageRef = null) { + const dict = xref.fetchIfRef(ref); + if (!(dict instanceof Dict)) { + return undefined; + } + const { + acroForm, + pdfManager + } = annotationGlobals; + const id = ref instanceof Ref ? ref.toString() : `annot_${idFactory.createObjId()}`; + let subtype = dict.get("Subtype"); + subtype = subtype instanceof Name ? subtype.name : null; + const parameters = { + xref, + ref, + dict, + subtype, + id, + annotationGlobals, + collectFields, + orphanFields, + needAppearances: !collectFields && acroForm.get("NeedAppearances") === true, + pageIndex, + evaluatorOptions: pdfManager.evaluatorOptions, + pageRef + }; + switch (subtype) { + case "Link": + return new LinkAnnotation(parameters); + case "Text": + return new TextAnnotation(parameters); + case "Widget": + let fieldType = getInheritableProperty({ + dict, + key: "FT" + }); + fieldType = fieldType instanceof Name ? fieldType.name : null; + switch (fieldType) { + case "Tx": + return new TextWidgetAnnotation(parameters); + case "Btn": + return new ButtonWidgetAnnotation(parameters); + case "Ch": + return new ChoiceWidgetAnnotation(parameters); + case "Sig": + return new SignatureWidgetAnnotation(parameters); + } + warn(`Unimplemented widget field type "${fieldType}", ` + "falling back to base field type."); + return new WidgetAnnotation(parameters); + case "Popup": + return new PopupAnnotation(parameters); + case "FreeText": + return new FreeTextAnnotation(parameters); + case "Line": + return new LineAnnotation(parameters); + case "Square": + return new SquareAnnotation(parameters); + case "Circle": + return new CircleAnnotation(parameters); + case "PolyLine": + return new PolylineAnnotation(parameters); + case "Polygon": + return new PolygonAnnotation(parameters); + case "Caret": + return new CaretAnnotation(parameters); + case "Ink": + return new InkAnnotation(parameters); + case "Highlight": + return new HighlightAnnotation(parameters); + case "Underline": + return new UnderlineAnnotation(parameters); + case "Squiggly": + return new SquigglyAnnotation(parameters); + case "StrikeOut": + return new StrikeOutAnnotation(parameters); + case "Stamp": + return new StampAnnotation(parameters); + case "FileAttachment": + return new FileAttachmentAnnotation(parameters); + default: + if (!collectFields) { + if (!subtype) { + warn("Annotation is missing the required /Subtype."); + } else { + warn(`Unimplemented annotation type "${subtype}", ` + "falling back to base annotation."); + } + } + return new Annotation(parameters); + } + } + static async _getPageIndex(xref, ref, pdfManager) { + try { + const annotDict = await xref.fetchIfRefAsync(ref); + if (!(annotDict instanceof Dict)) { + return -1; + } + const pageRef = annotDict.getRaw("P"); + if (pageRef instanceof Ref) { + try { + const pageIndex = await pdfManager.ensureCatalog("getPageIndex", [pageRef]); + return pageIndex; + } catch (ex) { + info(`_getPageIndex -- not a valid page reference: "${ex}".`); + } + } + if (annotDict.has("Kids")) { + return -1; + } + const numPages = await pdfManager.ensureDoc("numPages"); + for (let pageIndex = 0; pageIndex < numPages; pageIndex++) { + const page = await pdfManager.getPage(pageIndex); + const annotations = await pdfManager.ensure(page, "annotations"); + for (const annotRef of annotations) { + if (annotRef instanceof Ref && isRefsEqual(annotRef, ref)) { + return pageIndex; + } + } + } + } catch (ex) { + warn(`_getPageIndex: "${ex}".`); + } + return -1; + } + static generateImages(annotations, xref, isOffscreenCanvasSupported) { + if (!isOffscreenCanvasSupported) { + warn("generateImages: OffscreenCanvas is not supported, cannot save or print some annotations with images."); + return null; + } + let imagePromises; + for (const { + bitmapId, + bitmap + } of annotations) { + if (!bitmap) { + continue; + } + imagePromises ||= new Map(); + imagePromises.set(bitmapId, StampAnnotation.createImage(bitmap, xref)); + } + return imagePromises; + } + static async saveNewAnnotations(evaluator, task, annotations, imagePromises, changes) { + const xref = evaluator.xref; + let baseFontRef; + const promises = []; + const { + isOffscreenCanvasSupported + } = evaluator.options; + for (const annotation of annotations) { + if (annotation.deleted) { + continue; + } + switch (annotation.annotationType) { + case AnnotationEditorType.FREETEXT: + if (!baseFontRef) { + const baseFont = new Dict(xref); + baseFont.set("BaseFont", Name.get("Helvetica")); + baseFont.set("Type", Name.get("Font")); + baseFont.set("Subtype", Name.get("Type1")); + baseFont.set("Encoding", Name.get("WinAnsiEncoding")); + baseFontRef = xref.getNewTemporaryRef(); + changes.put(baseFontRef, { + data: baseFont + }); + } + promises.push(FreeTextAnnotation.createNewAnnotation(xref, annotation, changes, { + evaluator, + task, + baseFontRef + })); + break; + case AnnotationEditorType.HIGHLIGHT: + if (annotation.quadPoints) { + promises.push(HighlightAnnotation.createNewAnnotation(xref, annotation, changes)); + } else { + promises.push(InkAnnotation.createNewAnnotation(xref, annotation, changes)); + } + break; + case AnnotationEditorType.INK: + promises.push(InkAnnotation.createNewAnnotation(xref, annotation, changes)); + break; + case AnnotationEditorType.STAMP: + const image = isOffscreenCanvasSupported ? await imagePromises?.get(annotation.bitmapId) : null; + if (image?.imageStream) { + const { + imageStream, + smaskStream + } = image; + if (smaskStream) { + const smaskRef = xref.getNewTemporaryRef(); + changes.put(smaskRef, { + data: smaskStream + }); + imageStream.dict.set("SMask", smaskRef); + } + const imageRef = image.imageRef = xref.getNewTemporaryRef(); + changes.put(imageRef, { + data: imageStream + }); + image.imageStream = image.smaskStream = null; + } + promises.push(StampAnnotation.createNewAnnotation(xref, annotation, changes, { + image + })); + break; + } + } + return { + annotations: await Promise.all(promises) + }; + } + static async printNewAnnotations(annotationGlobals, evaluator, task, annotations, imagePromises) { + if (!annotations) { + return null; + } + const { + options, + xref + } = evaluator; + const promises = []; + for (const annotation of annotations) { + if (annotation.deleted) { + continue; + } + switch (annotation.annotationType) { + case AnnotationEditorType.FREETEXT: + promises.push(FreeTextAnnotation.createNewPrintAnnotation(annotationGlobals, xref, annotation, { + evaluator, + task, + evaluatorOptions: options + })); + break; + case AnnotationEditorType.HIGHLIGHT: + if (annotation.quadPoints) { + promises.push(HighlightAnnotation.createNewPrintAnnotation(annotationGlobals, xref, annotation, { + evaluatorOptions: options + })); + } else { + promises.push(InkAnnotation.createNewPrintAnnotation(annotationGlobals, xref, annotation, { + evaluatorOptions: options + })); + } + break; + case AnnotationEditorType.INK: + promises.push(InkAnnotation.createNewPrintAnnotation(annotationGlobals, xref, annotation, { + evaluatorOptions: options + })); + break; + case AnnotationEditorType.STAMP: + const image = options.isOffscreenCanvasSupported ? await imagePromises?.get(annotation.bitmapId) : null; + if (image?.imageStream) { + const { + imageStream, + smaskStream + } = image; + if (smaskStream) { + imageStream.dict.set("SMask", smaskStream); + } + image.imageRef = new JpegStream(imageStream, imageStream.length); + image.imageStream = image.smaskStream = null; + } + promises.push(StampAnnotation.createNewPrintAnnotation(annotationGlobals, xref, annotation, { + image, + evaluatorOptions: options + })); + break; + } + } + return Promise.all(promises); + } +} +function getRgbColor(color, defaultColor = new Uint8ClampedArray(3)) { + if (!Array.isArray(color)) { + return defaultColor; + } + const rgbColor = defaultColor || new Uint8ClampedArray(3); + switch (color.length) { + case 0: + return null; + case 1: + ColorSpace.singletons.gray.getRgbItem(color, 0, rgbColor, 0); + return rgbColor; + case 3: + ColorSpace.singletons.rgb.getRgbItem(color, 0, rgbColor, 0); + return rgbColor; + case 4: + ColorSpace.singletons.cmyk.getRgbItem(color, 0, rgbColor, 0); + return rgbColor; + default: + return defaultColor; + } +} +function getPdfColorArray(color) { + return Array.from(color, c => c / 255); +} +function getQuadPoints(dict, rect) { + const quadPoints = dict.getArray("QuadPoints"); + if (!isNumberArray(quadPoints, null) || quadPoints.length === 0 || quadPoints.length % 8 > 0) { + return null; + } + const newQuadPoints = new Float32Array(quadPoints.length); + for (let i = 0, ii = quadPoints.length; i < ii; i += 8) { + const [x1, y1, x2, y2, x3, y3, x4, y4] = quadPoints.slice(i, i + 8); + const minX = Math.min(x1, x2, x3, x4); + const maxX = Math.max(x1, x2, x3, x4); + const minY = Math.min(y1, y2, y3, y4); + const maxY = Math.max(y1, y2, y3, y4); + if (rect !== null && (minX < rect[0] || maxX > rect[2] || minY < rect[1] || maxY > rect[3])) { + return null; + } + newQuadPoints.set([minX, maxY, maxX, maxY, minX, minY, maxX, minY], i); + } + return newQuadPoints; +} +function getTransformMatrix(rect, bbox, matrix) { + const [minX, minY, maxX, maxY] = Util.getAxialAlignedBoundingBox(bbox, matrix); + if (minX === maxX || minY === maxY) { + return [1, 0, 0, 1, rect[0], rect[1]]; + } + const xRatio = (rect[2] - rect[0]) / (maxX - minX); + const yRatio = (rect[3] - rect[1]) / (maxY - minY); + return [xRatio, 0, 0, yRatio, rect[0] - minX * xRatio, rect[1] - minY * yRatio]; +} +class Annotation { + constructor(params) { + const { + dict, + xref, + annotationGlobals, + ref, + orphanFields + } = params; + const parentRef = orphanFields?.get(ref); + if (parentRef) { + dict.set("Parent", parentRef); + } + this.setTitle(dict.get("T")); + this.setContents(dict.get("Contents")); + this.setModificationDate(dict.get("M")); + this.setFlags(dict.get("F")); + this.setRectangle(dict.getArray("Rect")); + this.setColor(dict.getArray("C")); + this.setBorderStyle(dict); + this.setAppearance(dict); + this.setOptionalContent(dict); + const MK = dict.get("MK"); + this.setBorderAndBackgroundColors(MK); + this.setRotation(MK, dict); + this.ref = params.ref instanceof Ref ? params.ref : null; + this._streams = []; + if (this.appearance) { + this._streams.push(this.appearance); + } + const isLocked = !!(this.flags & AnnotationFlag.LOCKED); + const isContentLocked = !!(this.flags & AnnotationFlag.LOCKEDCONTENTS); + this.data = { + annotationFlags: this.flags, + borderStyle: this.borderStyle, + color: this.color, + backgroundColor: this.backgroundColor, + borderColor: this.borderColor, + rotation: this.rotation, + contentsObj: this._contents, + hasAppearance: !!this.appearance, + id: params.id, + modificationDate: this.modificationDate, + rect: this.rectangle, + subtype: params.subtype, + hasOwnCanvas: false, + noRotate: !!(this.flags & AnnotationFlag.NOROTATE), + noHTML: isLocked && isContentLocked, + isEditable: false, + structParent: -1 + }; + if (annotationGlobals.structTreeRoot) { + let structParent = dict.get("StructParent"); + this.data.structParent = structParent = Number.isInteger(structParent) && structParent >= 0 ? structParent : -1; + annotationGlobals.structTreeRoot.addAnnotationIdToPage(params.pageRef, structParent); + } + if (params.collectFields) { + const kids = dict.get("Kids"); + if (Array.isArray(kids)) { + const kidIds = []; + for (const kid of kids) { + if (kid instanceof Ref) { + kidIds.push(kid.toString()); + } + } + if (kidIds.length !== 0) { + this.data.kidIds = kidIds; + } + } + this.data.actions = collectActions(xref, dict, AnnotationActionEventType); + this.data.fieldName = this._constructFieldName(dict); + this.data.pageIndex = params.pageIndex; + } + const it = dict.get("IT"); + if (it instanceof Name) { + this.data.it = it.name; + } + this._isOffscreenCanvasSupported = params.evaluatorOptions.isOffscreenCanvasSupported; + this._fallbackFontDict = null; + this._needAppearances = false; + } + _hasFlag(flags, flag) { + return !!(flags & flag); + } + _buildFlags(noView, noPrint) { + let { + flags + } = this; + if (noView === undefined) { + if (noPrint === undefined) { + return undefined; + } + if (noPrint) { + return flags & ~AnnotationFlag.PRINT; + } + return flags & ~AnnotationFlag.HIDDEN | AnnotationFlag.PRINT; + } + if (noView) { + flags |= AnnotationFlag.PRINT; + if (noPrint) { + return flags & ~AnnotationFlag.NOVIEW | AnnotationFlag.HIDDEN; + } + return flags & ~AnnotationFlag.HIDDEN | AnnotationFlag.NOVIEW; + } + flags &= ~(AnnotationFlag.HIDDEN | AnnotationFlag.NOVIEW); + if (noPrint) { + return flags & ~AnnotationFlag.PRINT; + } + return flags | AnnotationFlag.PRINT; + } + _isViewable(flags) { + return !this._hasFlag(flags, AnnotationFlag.INVISIBLE) && !this._hasFlag(flags, AnnotationFlag.NOVIEW); + } + _isPrintable(flags) { + return this._hasFlag(flags, AnnotationFlag.PRINT) && !this._hasFlag(flags, AnnotationFlag.HIDDEN) && !this._hasFlag(flags, AnnotationFlag.INVISIBLE); + } + mustBeViewed(annotationStorage, _renderForms) { + const noView = annotationStorage?.get(this.data.id)?.noView; + if (noView !== undefined) { + return !noView; + } + return this.viewable && !this._hasFlag(this.flags, AnnotationFlag.HIDDEN); + } + mustBePrinted(annotationStorage) { + const noPrint = annotationStorage?.get(this.data.id)?.noPrint; + if (noPrint !== undefined) { + return !noPrint; + } + return this.printable; + } + mustBeViewedWhenEditing(isEditing, modifiedIds = null) { + return isEditing ? !this.data.isEditable : !modifiedIds?.has(this.data.id); + } + get viewable() { + if (this.data.quadPoints === null) { + return false; + } + if (this.flags === 0) { + return true; + } + return this._isViewable(this.flags); + } + get printable() { + if (this.data.quadPoints === null) { + return false; + } + if (this.flags === 0) { + return false; + } + return this._isPrintable(this.flags); + } + _parseStringHelper(data) { + const str = typeof data === "string" ? stringToPDFString(data) : ""; + const dir = str && bidi(str).dir === "rtl" ? "rtl" : "ltr"; + return { + str, + dir + }; + } + setDefaultAppearance(params) { + const { + dict, + annotationGlobals + } = params; + const defaultAppearance = getInheritableProperty({ + dict, + key: "DA" + }) || annotationGlobals.acroForm.get("DA"); + this._defaultAppearance = typeof defaultAppearance === "string" ? defaultAppearance : ""; + this.data.defaultAppearanceData = parseDefaultAppearance(this._defaultAppearance); + } + setTitle(title) { + this._title = this._parseStringHelper(title); + } + setContents(contents) { + this._contents = this._parseStringHelper(contents); + } + setModificationDate(modificationDate) { + this.modificationDate = typeof modificationDate === "string" ? modificationDate : null; + } + setFlags(flags) { + this.flags = Number.isInteger(flags) && flags > 0 ? flags : 0; + if (this.flags & AnnotationFlag.INVISIBLE && this.constructor.name !== "Annotation") { + this.flags ^= AnnotationFlag.INVISIBLE; + } + } + hasFlag(flag) { + return this._hasFlag(this.flags, flag); + } + setRectangle(rectangle) { + this.rectangle = lookupNormalRect(rectangle, [0, 0, 0, 0]); + } + setColor(color) { + this.color = getRgbColor(color); + } + setLineEndings(lineEndings) { + this.lineEndings = ["None", "None"]; + if (Array.isArray(lineEndings) && lineEndings.length === 2) { + for (let i = 0; i < 2; i++) { + const obj = lineEndings[i]; + if (obj instanceof Name) { + switch (obj.name) { + case "None": + continue; + case "Square": + case "Circle": + case "Diamond": + case "OpenArrow": + case "ClosedArrow": + case "Butt": + case "ROpenArrow": + case "RClosedArrow": + case "Slash": + this.lineEndings[i] = obj.name; + continue; + } + } + warn(`Ignoring invalid lineEnding: ${obj}`); + } + } + } + setRotation(mk, dict) { + this.rotation = 0; + let angle = mk instanceof Dict ? mk.get("R") || 0 : dict.get("Rotate") || 0; + if (Number.isInteger(angle) && angle !== 0) { + angle %= 360; + if (angle < 0) { + angle += 360; + } + if (angle % 90 === 0) { + this.rotation = angle; + } + } + } + setBorderAndBackgroundColors(mk) { + if (mk instanceof Dict) { + this.borderColor = getRgbColor(mk.getArray("BC"), null); + this.backgroundColor = getRgbColor(mk.getArray("BG"), null); + } else { + this.borderColor = this.backgroundColor = null; + } + } + setBorderStyle(borderStyle) { + this.borderStyle = new AnnotationBorderStyle(); + if (!(borderStyle instanceof Dict)) { + return; + } + if (borderStyle.has("BS")) { + const dict = borderStyle.get("BS"); + if (dict instanceof Dict) { + const dictType = dict.get("Type"); + if (!dictType || isName(dictType, "Border")) { + this.borderStyle.setWidth(dict.get("W"), this.rectangle); + this.borderStyle.setStyle(dict.get("S")); + this.borderStyle.setDashArray(dict.getArray("D")); + } + } + } else if (borderStyle.has("Border")) { + const array = borderStyle.getArray("Border"); + if (Array.isArray(array) && array.length >= 3) { + this.borderStyle.setHorizontalCornerRadius(array[0]); + this.borderStyle.setVerticalCornerRadius(array[1]); + this.borderStyle.setWidth(array[2], this.rectangle); + if (array.length === 4) { + this.borderStyle.setDashArray(array[3], true); + } + } + } else { + this.borderStyle.setWidth(0); + } + } + setAppearance(dict) { + this.appearance = null; + const appearanceStates = dict.get("AP"); + if (!(appearanceStates instanceof Dict)) { + return; + } + const normalAppearanceState = appearanceStates.get("N"); + if (normalAppearanceState instanceof BaseStream) { + this.appearance = normalAppearanceState; + return; + } + if (!(normalAppearanceState instanceof Dict)) { + return; + } + const as = dict.get("AS"); + if (!(as instanceof Name) || !normalAppearanceState.has(as.name)) { + return; + } + const appearance = normalAppearanceState.get(as.name); + if (appearance instanceof BaseStream) { + this.appearance = appearance; + } + } + setOptionalContent(dict) { + this.oc = null; + const oc = dict.get("OC"); + if (oc instanceof Name) { + warn("setOptionalContent: Support for /Name-entry is not implemented."); + } else if (oc instanceof Dict) { + this.oc = oc; + } + } + loadResources(keys, appearance) { + return appearance.dict.getAsync("Resources").then(resources => { + if (!resources) { + return undefined; + } + const objectLoader = new ObjectLoader(resources, keys, resources.xref); + return objectLoader.load().then(function () { + return resources; + }); + }); + } + async getOperatorList(evaluator, task, intent, annotationStorage) { + const { + hasOwnCanvas, + id, + rect + } = this.data; + let appearance = this.appearance; + const isUsingOwnCanvas = !!(hasOwnCanvas && intent & RenderingIntentFlag.DISPLAY); + if (isUsingOwnCanvas && (rect[0] === rect[2] || rect[1] === rect[3])) { + this.data.hasOwnCanvas = false; + return { + opList: new OperatorList(), + separateForm: false, + separateCanvas: false + }; + } + if (!appearance) { + if (!isUsingOwnCanvas) { + return { + opList: new OperatorList(), + separateForm: false, + separateCanvas: false + }; + } + appearance = new StringStream(""); + appearance.dict = new Dict(); + } + const appearanceDict = appearance.dict; + const resources = await this.loadResources(["ExtGState", "ColorSpace", "Pattern", "Shading", "XObject", "Font"], appearance); + const bbox = lookupRect(appearanceDict.getArray("BBox"), [0, 0, 1, 1]); + const matrix = lookupMatrix(appearanceDict.getArray("Matrix"), IDENTITY_MATRIX); + const transform = getTransformMatrix(rect, bbox, matrix); + const opList = new OperatorList(); + let optionalContent; + if (this.oc) { + optionalContent = await evaluator.parseMarkedContentProps(this.oc, null); + } + if (optionalContent !== undefined) { + opList.addOp(OPS.beginMarkedContentProps, ["OC", optionalContent]); + } + opList.addOp(OPS.beginAnnotation, [id, rect, transform, matrix, isUsingOwnCanvas]); + await evaluator.getOperatorList({ + stream: appearance, + task, + resources, + operatorList: opList, + fallbackFontDict: this._fallbackFontDict + }); + opList.addOp(OPS.endAnnotation, []); + if (optionalContent !== undefined) { + opList.addOp(OPS.endMarkedContent, []); + } + this.reset(); + return { + opList, + separateForm: false, + separateCanvas: isUsingOwnCanvas + }; + } + async save(evaluator, task, annotationStorage, changes) { + return null; + } + get hasTextContent() { + return false; + } + async extractTextContent(evaluator, task, viewBox) { + if (!this.appearance) { + return; + } + const resources = await this.loadResources(["ExtGState", "Font", "Properties", "XObject"], this.appearance); + const text = []; + const buffer = []; + let firstPosition = null; + const sink = { + desiredSize: Math.Infinity, + ready: true, + enqueue(chunk, size) { + for (const item of chunk.items) { + if (item.str === undefined) { + continue; + } + firstPosition ||= item.transform.slice(-2); + buffer.push(item.str); + if (item.hasEOL) { + text.push(buffer.join("").trimEnd()); + buffer.length = 0; + } + } + } + }; + await evaluator.getTextContent({ + stream: this.appearance, + task, + resources, + includeMarkedContent: true, + keepWhiteSpace: true, + sink, + viewBox + }); + this.reset(); + if (buffer.length) { + text.push(buffer.join("").trimEnd()); + } + if (text.length > 1 || text[0]) { + const appearanceDict = this.appearance.dict; + const bbox = lookupRect(appearanceDict.getArray("BBox"), null); + const matrix = lookupMatrix(appearanceDict.getArray("Matrix"), null); + this.data.textPosition = this._transformPoint(firstPosition, bbox, matrix); + this.data.textContent = text; + } + } + _transformPoint(coords, bbox, matrix) { + const { + rect + } = this.data; + bbox ||= [0, 0, 1, 1]; + matrix ||= [1, 0, 0, 1, 0, 0]; + const transform = getTransformMatrix(rect, bbox, matrix); + transform[4] -= rect[0]; + transform[5] -= rect[1]; + coords = Util.applyTransform(coords, transform); + return Util.applyTransform(coords, matrix); + } + getFieldObject() { + if (this.data.kidIds) { + return { + id: this.data.id, + actions: this.data.actions, + name: this.data.fieldName, + strokeColor: this.data.borderColor, + fillColor: this.data.backgroundColor, + type: "", + kidIds: this.data.kidIds, + page: this.data.pageIndex, + rotation: this.rotation + }; + } + return null; + } + reset() { + for (const stream of this._streams) { + stream.reset(); + } + } + _constructFieldName(dict) { + if (!dict.has("T") && !dict.has("Parent")) { + warn("Unknown field name, falling back to empty field name."); + return ""; + } + if (!dict.has("Parent")) { + return stringToPDFString(dict.get("T")); + } + const fieldName = []; + if (dict.has("T")) { + fieldName.unshift(stringToPDFString(dict.get("T"))); + } + let loopDict = dict; + const visited = new RefSet(); + if (dict.objId) { + visited.put(dict.objId); + } + while (loopDict.has("Parent")) { + loopDict = loopDict.get("Parent"); + if (!(loopDict instanceof Dict) || loopDict.objId && visited.has(loopDict.objId)) { + break; + } + if (loopDict.objId) { + visited.put(loopDict.objId); + } + if (loopDict.has("T")) { + fieldName.unshift(stringToPDFString(loopDict.get("T"))); + } + } + return fieldName.join("."); + } +} +class AnnotationBorderStyle { + constructor() { + this.width = 1; + this.rawWidth = 1; + this.style = AnnotationBorderStyleType.SOLID; + this.dashArray = [3]; + this.horizontalCornerRadius = 0; + this.verticalCornerRadius = 0; + } + setWidth(width, rect = [0, 0, 0, 0]) { + if (width instanceof Name) { + this.width = 0; + return; + } + if (typeof width === "number") { + if (width > 0) { + this.rawWidth = width; + const maxWidth = (rect[2] - rect[0]) / 2; + const maxHeight = (rect[3] - rect[1]) / 2; + if (maxWidth > 0 && maxHeight > 0 && (width > maxWidth || width > maxHeight)) { + warn(`AnnotationBorderStyle.setWidth - ignoring width: ${width}`); + width = 1; + } + } + this.width = width; + } + } + setStyle(style) { + if (!(style instanceof Name)) { + return; + } + switch (style.name) { + case "S": + this.style = AnnotationBorderStyleType.SOLID; + break; + case "D": + this.style = AnnotationBorderStyleType.DASHED; + break; + case "B": + this.style = AnnotationBorderStyleType.BEVELED; + break; + case "I": + this.style = AnnotationBorderStyleType.INSET; + break; + case "U": + this.style = AnnotationBorderStyleType.UNDERLINE; + break; + default: + break; + } + } + setDashArray(dashArray, forceStyle = false) { + if (Array.isArray(dashArray)) { + let isValid = true; + let allZeros = true; + for (const element of dashArray) { + const validNumber = +element >= 0; + if (!validNumber) { + isValid = false; + break; + } else if (element > 0) { + allZeros = false; + } + } + if (dashArray.length === 0 || isValid && !allZeros) { + this.dashArray = dashArray; + if (forceStyle) { + this.setStyle(Name.get("D")); + } + } else { + this.width = 0; + } + } else if (dashArray) { + this.width = 0; + } + } + setHorizontalCornerRadius(radius) { + if (Number.isInteger(radius)) { + this.horizontalCornerRadius = radius; + } + } + setVerticalCornerRadius(radius) { + if (Number.isInteger(radius)) { + this.verticalCornerRadius = radius; + } + } +} +class MarkupAnnotation extends Annotation { + constructor(params) { + super(params); + const { + dict + } = params; + if (dict.has("IRT")) { + const rawIRT = dict.getRaw("IRT"); + this.data.inReplyTo = rawIRT instanceof Ref ? rawIRT.toString() : null; + const rt = dict.get("RT"); + this.data.replyType = rt instanceof Name ? rt.name : AnnotationReplyType.REPLY; + } + let popupRef = null; + if (this.data.replyType === AnnotationReplyType.GROUP) { + const parent = dict.get("IRT"); + this.setTitle(parent.get("T")); + this.data.titleObj = this._title; + this.setContents(parent.get("Contents")); + this.data.contentsObj = this._contents; + if (!parent.has("CreationDate")) { + this.data.creationDate = null; + } else { + this.setCreationDate(parent.get("CreationDate")); + this.data.creationDate = this.creationDate; + } + if (!parent.has("M")) { + this.data.modificationDate = null; + } else { + this.setModificationDate(parent.get("M")); + this.data.modificationDate = this.modificationDate; + } + popupRef = parent.getRaw("Popup"); + if (!parent.has("C")) { + this.data.color = null; + } else { + this.setColor(parent.getArray("C")); + this.data.color = this.color; + } + } else { + this.data.titleObj = this._title; + this.setCreationDate(dict.get("CreationDate")); + this.data.creationDate = this.creationDate; + popupRef = dict.getRaw("Popup"); + if (!dict.has("C")) { + this.data.color = null; + } + } + this.data.popupRef = popupRef instanceof Ref ? popupRef.toString() : null; + if (dict.has("RC")) { + this.data.richText = XFAFactory.getRichTextAsHtml(dict.get("RC")); + } + } + setCreationDate(creationDate) { + this.creationDate = typeof creationDate === "string" ? creationDate : null; + } + _setDefaultAppearance({ + xref, + extra, + strokeColor, + fillColor, + blendMode, + strokeAlpha, + fillAlpha, + pointsCallback + }) { + let minX = Number.MAX_VALUE; + let minY = Number.MAX_VALUE; + let maxX = Number.MIN_VALUE; + let maxY = Number.MIN_VALUE; + const buffer = ["q"]; + if (extra) { + buffer.push(extra); + } + if (strokeColor) { + buffer.push(`${strokeColor[0]} ${strokeColor[1]} ${strokeColor[2]} RG`); + } + if (fillColor) { + buffer.push(`${fillColor[0]} ${fillColor[1]} ${fillColor[2]} rg`); + } + const pointsArray = this.data.quadPoints || Float32Array.from([this.rectangle[0], this.rectangle[3], this.rectangle[2], this.rectangle[3], this.rectangle[0], this.rectangle[1], this.rectangle[2], this.rectangle[1]]); + for (let i = 0, ii = pointsArray.length; i < ii; i += 8) { + const [mX, MX, mY, MY] = pointsCallback(buffer, pointsArray.subarray(i, i + 8)); + minX = Math.min(minX, mX); + maxX = Math.max(maxX, MX); + minY = Math.min(minY, mY); + maxY = Math.max(maxY, MY); + } + buffer.push("Q"); + const formDict = new Dict(xref); + const appearanceStreamDict = new Dict(xref); + appearanceStreamDict.set("Subtype", Name.get("Form")); + const appearanceStream = new StringStream(buffer.join(" ")); + appearanceStream.dict = appearanceStreamDict; + formDict.set("Fm0", appearanceStream); + const gsDict = new Dict(xref); + if (blendMode) { + gsDict.set("BM", Name.get(blendMode)); + } + if (typeof strokeAlpha === "number") { + gsDict.set("CA", strokeAlpha); + } + if (typeof fillAlpha === "number") { + gsDict.set("ca", fillAlpha); + } + const stateDict = new Dict(xref); + stateDict.set("GS0", gsDict); + const resources = new Dict(xref); + resources.set("ExtGState", stateDict); + resources.set("XObject", formDict); + const appearanceDict = new Dict(xref); + appearanceDict.set("Resources", resources); + const bbox = this.data.rect = [minX, minY, maxX, maxY]; + appearanceDict.set("BBox", bbox); + this.appearance = new StringStream("/GS0 gs /Fm0 Do"); + this.appearance.dict = appearanceDict; + this._streams.push(this.appearance, appearanceStream); + } + static async createNewAnnotation(xref, annotation, changes, params) { + const annotationRef = annotation.ref ||= xref.getNewTemporaryRef(); + const ap = await this.createNewAppearanceStream(annotation, xref, params); + let annotationDict; + if (ap) { + const apRef = xref.getNewTemporaryRef(); + annotationDict = this.createNewDict(annotation, xref, { + apRef + }); + changes.put(apRef, { + data: ap + }); + } else { + annotationDict = this.createNewDict(annotation, xref, {}); + } + if (Number.isInteger(annotation.parentTreeId)) { + annotationDict.set("StructParent", annotation.parentTreeId); + } + changes.put(annotationRef, { + data: annotationDict + }); + return { + ref: annotationRef + }; + } + static async createNewPrintAnnotation(annotationGlobals, xref, annotation, params) { + const ap = await this.createNewAppearanceStream(annotation, xref, params); + const annotationDict = this.createNewDict(annotation, xref, ap ? { + ap + } : {}); + const newAnnotation = new this.prototype.constructor({ + dict: annotationDict, + xref, + annotationGlobals, + evaluatorOptions: params.evaluatorOptions + }); + if (annotation.ref) { + newAnnotation.ref = newAnnotation.refToReplace = annotation.ref; + } + return newAnnotation; + } +} +class WidgetAnnotation extends Annotation { + constructor(params) { + super(params); + const { + dict, + xref, + annotationGlobals + } = params; + const data = this.data; + this._needAppearances = params.needAppearances; + data.annotationType = AnnotationType.WIDGET; + if (data.fieldName === undefined) { + data.fieldName = this._constructFieldName(dict); + } + if (data.actions === undefined) { + data.actions = collectActions(xref, dict, AnnotationActionEventType); + } + let fieldValue = getInheritableProperty({ + dict, + key: "V", + getArray: true + }); + data.fieldValue = this._decodeFormValue(fieldValue); + const defaultFieldValue = getInheritableProperty({ + dict, + key: "DV", + getArray: true + }); + data.defaultFieldValue = this._decodeFormValue(defaultFieldValue); + if (fieldValue === undefined && annotationGlobals.xfaDatasets) { + const path = this._title.str; + if (path) { + this._hasValueFromXFA = true; + data.fieldValue = fieldValue = annotationGlobals.xfaDatasets.getValue(path); + } + } + if (fieldValue === undefined && data.defaultFieldValue !== null) { + data.fieldValue = data.defaultFieldValue; + } + data.alternativeText = stringToPDFString(dict.get("TU") || ""); + this.setDefaultAppearance(params); + data.hasAppearance ||= this._needAppearances && data.fieldValue !== undefined && data.fieldValue !== null; + const fieldType = getInheritableProperty({ + dict, + key: "FT" + }); + data.fieldType = fieldType instanceof Name ? fieldType.name : null; + const localResources = getInheritableProperty({ + dict, + key: "DR" + }); + const acroFormResources = annotationGlobals.acroForm.get("DR"); + const appearanceResources = this.appearance?.dict.get("Resources"); + this._fieldResources = { + localResources, + acroFormResources, + appearanceResources, + mergedResources: Dict.merge({ + xref, + dictArray: [localResources, appearanceResources, acroFormResources], + mergeSubDicts: true + }) + }; + data.fieldFlags = getInheritableProperty({ + dict, + key: "Ff" + }); + if (!Number.isInteger(data.fieldFlags) || data.fieldFlags < 0) { + data.fieldFlags = 0; + } + data.readOnly = this.hasFieldFlag(AnnotationFieldFlag.READONLY); + data.required = this.hasFieldFlag(AnnotationFieldFlag.REQUIRED); + data.hidden = this._hasFlag(data.annotationFlags, AnnotationFlag.HIDDEN) || this._hasFlag(data.annotationFlags, AnnotationFlag.NOVIEW); + } + _decodeFormValue(formValue) { + if (Array.isArray(formValue)) { + return formValue.filter(item => typeof item === "string").map(item => stringToPDFString(item)); + } else if (formValue instanceof Name) { + return stringToPDFString(formValue.name); + } else if (typeof formValue === "string") { + return stringToPDFString(formValue); + } + return null; + } + hasFieldFlag(flag) { + return !!(this.data.fieldFlags & flag); + } + _isViewable(flags) { + return true; + } + mustBeViewed(annotationStorage, renderForms) { + if (renderForms) { + return this.viewable; + } + return super.mustBeViewed(annotationStorage, renderForms) && !this._hasFlag(this.flags, AnnotationFlag.NOVIEW); + } + getRotationMatrix(annotationStorage) { + let rotation = annotationStorage?.get(this.data.id)?.rotation; + if (rotation === undefined) { + rotation = this.rotation; + } + if (rotation === 0) { + return IDENTITY_MATRIX; + } + const width = this.data.rect[2] - this.data.rect[0]; + const height = this.data.rect[3] - this.data.rect[1]; + return getRotationMatrix(rotation, width, height); + } + getBorderAndBackgroundAppearances(annotationStorage) { + let rotation = annotationStorage?.get(this.data.id)?.rotation; + if (rotation === undefined) { + rotation = this.rotation; + } + if (!this.backgroundColor && !this.borderColor) { + return ""; + } + const width = this.data.rect[2] - this.data.rect[0]; + const height = this.data.rect[3] - this.data.rect[1]; + const rect = rotation === 0 || rotation === 180 ? `0 0 ${width} ${height} re` : `0 0 ${height} ${width} re`; + let str = ""; + if (this.backgroundColor) { + str = `${getPdfColor(this.backgroundColor, true)} ${rect} f `; + } + if (this.borderColor) { + const borderWidth = this.borderStyle.width || 1; + str += `${borderWidth} w ${getPdfColor(this.borderColor, false)} ${rect} S `; + } + return str; + } + async getOperatorList(evaluator, task, intent, annotationStorage) { + if (intent & RenderingIntentFlag.ANNOTATIONS_FORMS && !(this instanceof SignatureWidgetAnnotation) && !this.data.noHTML && !this.data.hasOwnCanvas) { + return { + opList: new OperatorList(), + separateForm: true, + separateCanvas: false + }; + } + if (!this._hasText) { + return super.getOperatorList(evaluator, task, intent, annotationStorage); + } + const content = await this._getAppearance(evaluator, task, intent, annotationStorage); + if (this.appearance && content === null) { + return super.getOperatorList(evaluator, task, intent, annotationStorage); + } + const opList = new OperatorList(); + if (!this._defaultAppearance || content === null) { + return { + opList, + separateForm: false, + separateCanvas: false + }; + } + const isUsingOwnCanvas = !!(this.data.hasOwnCanvas && intent & RenderingIntentFlag.DISPLAY); + const matrix = [1, 0, 0, 1, 0, 0]; + const bbox = [0, 0, this.data.rect[2] - this.data.rect[0], this.data.rect[3] - this.data.rect[1]]; + const transform = getTransformMatrix(this.data.rect, bbox, matrix); + let optionalContent; + if (this.oc) { + optionalContent = await evaluator.parseMarkedContentProps(this.oc, null); + } + if (optionalContent !== undefined) { + opList.addOp(OPS.beginMarkedContentProps, ["OC", optionalContent]); + } + opList.addOp(OPS.beginAnnotation, [this.data.id, this.data.rect, transform, this.getRotationMatrix(annotationStorage), isUsingOwnCanvas]); + const stream = new StringStream(content); + await evaluator.getOperatorList({ + stream, + task, + resources: this._fieldResources.mergedResources, + operatorList: opList + }); + opList.addOp(OPS.endAnnotation, []); + if (optionalContent !== undefined) { + opList.addOp(OPS.endMarkedContent, []); + } + return { + opList, + separateForm: false, + separateCanvas: isUsingOwnCanvas + }; + } + _getMKDict(rotation) { + const mk = new Dict(null); + if (rotation) { + mk.set("R", rotation); + } + if (this.borderColor) { + mk.set("BC", getPdfColorArray(this.borderColor)); + } + if (this.backgroundColor) { + mk.set("BG", getPdfColorArray(this.backgroundColor)); + } + return mk.size > 0 ? mk : null; + } + amendSavedDict(annotationStorage, dict) {} + setValue(dict, value, xref, changes) { + const { + dict: parentDict, + ref: parentRef + } = getParentToUpdate(dict, this.ref, xref); + if (!parentDict) { + dict.set("V", value); + } else if (!changes.has(parentRef)) { + const newParentDict = parentDict.clone(); + newParentDict.set("V", value); + changes.put(parentRef, { + data: newParentDict + }); + return newParentDict; + } + return null; + } + async save(evaluator, task, annotationStorage, changes) { + const storageEntry = annotationStorage?.get(this.data.id); + const flags = this._buildFlags(storageEntry?.noView, storageEntry?.noPrint); + let value = storageEntry?.value, + rotation = storageEntry?.rotation; + if (value === this.data.fieldValue || value === undefined) { + if (!this._hasValueFromXFA && rotation === undefined && flags === undefined) { + return; + } + value ||= this.data.fieldValue; + } + if (rotation === undefined && !this._hasValueFromXFA && Array.isArray(value) && Array.isArray(this.data.fieldValue) && isArrayEqual(value, this.data.fieldValue) && flags === undefined) { + return; + } + if (rotation === undefined) { + rotation = this.rotation; + } + let appearance = null; + if (!this._needAppearances) { + appearance = await this._getAppearance(evaluator, task, RenderingIntentFlag.SAVE, annotationStorage); + if (appearance === null && flags === undefined) { + return; + } + } else {} + let needAppearances = false; + if (appearance?.needAppearances) { + needAppearances = true; + appearance = null; + } + const { + xref + } = evaluator; + const originalDict = xref.fetchIfRef(this.ref); + if (!(originalDict instanceof Dict)) { + return; + } + const dict = new Dict(xref); + for (const key of originalDict.getKeys()) { + if (key !== "AP") { + dict.set(key, originalDict.getRaw(key)); + } + } + if (flags !== undefined) { + dict.set("F", flags); + if (appearance === null && !needAppearances) { + const ap = originalDict.getRaw("AP"); + if (ap) { + dict.set("AP", ap); + } + } + } + const xfa = { + path: this.data.fieldName, + value + }; + const newParentDict = this.setValue(dict, Array.isArray(value) ? value.map(stringToAsciiOrUTF16BE) : stringToAsciiOrUTF16BE(value), xref, changes); + this.amendSavedDict(annotationStorage, newParentDict || dict); + const maybeMK = this._getMKDict(rotation); + if (maybeMK) { + dict.set("MK", maybeMK); + } + changes.put(this.ref, { + data: dict, + xfa, + needAppearances + }); + if (appearance !== null) { + const newRef = xref.getNewTemporaryRef(); + const AP = new Dict(xref); + dict.set("AP", AP); + AP.set("N", newRef); + const resources = this._getSaveFieldResources(xref); + const appearanceStream = new StringStream(appearance); + const appearanceDict = appearanceStream.dict = new Dict(xref); + appearanceDict.set("Subtype", Name.get("Form")); + appearanceDict.set("Resources", resources); + appearanceDict.set("BBox", [0, 0, this.data.rect[2] - this.data.rect[0], this.data.rect[3] - this.data.rect[1]]); + const rotationMatrix = this.getRotationMatrix(annotationStorage); + if (rotationMatrix !== IDENTITY_MATRIX) { + appearanceDict.set("Matrix", rotationMatrix); + } + changes.put(newRef, { + data: appearanceStream, + xfa: null, + needAppearances: false + }); + } + dict.set("M", `D:${getModificationDate()}`); + } + async _getAppearance(evaluator, task, intent, annotationStorage) { + const isPassword = this.hasFieldFlag(AnnotationFieldFlag.PASSWORD); + if (isPassword) { + return null; + } + const storageEntry = annotationStorage?.get(this.data.id); + let value, rotation; + if (storageEntry) { + value = storageEntry.formattedValue || storageEntry.value; + rotation = storageEntry.rotation; + } + if (rotation === undefined && value === undefined && !this._needAppearances) { + if (!this._hasValueFromXFA || this.appearance) { + return null; + } + } + const colors = this.getBorderAndBackgroundAppearances(annotationStorage); + if (value === undefined) { + value = this.data.fieldValue; + if (!value) { + return `/Tx BMC q ${colors}Q EMC`; + } + } + if (Array.isArray(value) && value.length === 1) { + value = value[0]; + } + assert(typeof value === "string", "Expected `value` to be a string."); + value = value.trimEnd(); + if (this.data.combo) { + const option = this.data.options.find(({ + exportValue + }) => value === exportValue); + value = option?.displayValue || value; + } + if (value === "") { + return `/Tx BMC q ${colors}Q EMC`; + } + if (rotation === undefined) { + rotation = this.rotation; + } + let lineCount = -1; + let lines; + if (this.data.multiLine) { + lines = value.split(/\r\n?|\n/).map(line => line.normalize("NFC")); + lineCount = lines.length; + } else { + lines = [value.replace(/\r\n?|\n/, "").normalize("NFC")]; + } + const defaultPadding = 1; + const defaultHPadding = 2; + let totalHeight = this.data.rect[3] - this.data.rect[1]; + let totalWidth = this.data.rect[2] - this.data.rect[0]; + if (rotation === 90 || rotation === 270) { + [totalWidth, totalHeight] = [totalHeight, totalWidth]; + } + if (!this._defaultAppearance) { + this.data.defaultAppearanceData = parseDefaultAppearance(this._defaultAppearance = "/Helvetica 0 Tf 0 g"); + } + let font = await WidgetAnnotation._getFontData(evaluator, task, this.data.defaultAppearanceData, this._fieldResources.mergedResources); + let defaultAppearance, fontSize, lineHeight; + const encodedLines = []; + let encodingError = false; + for (const line of lines) { + const encodedString = font.encodeString(line); + if (encodedString.length > 1) { + encodingError = true; + } + encodedLines.push(encodedString.join("")); + } + if (encodingError && intent & RenderingIntentFlag.SAVE) { + return { + needAppearances: true + }; + } + if (encodingError && this._isOffscreenCanvasSupported) { + const fontFamily = this.data.comb ? "monospace" : "sans-serif"; + const fakeUnicodeFont = new FakeUnicodeFont(evaluator.xref, fontFamily); + const resources = fakeUnicodeFont.createFontResources(lines.join("")); + const newFont = resources.getRaw("Font"); + if (this._fieldResources.mergedResources.has("Font")) { + const oldFont = this._fieldResources.mergedResources.get("Font"); + for (const key of newFont.getKeys()) { + oldFont.set(key, newFont.getRaw(key)); + } + } else { + this._fieldResources.mergedResources.set("Font", newFont); + } + const fontName = fakeUnicodeFont.fontName.name; + font = await WidgetAnnotation._getFontData(evaluator, task, { + fontName, + fontSize: 0 + }, resources); + for (let i = 0, ii = encodedLines.length; i < ii; i++) { + encodedLines[i] = stringToUTF16String(lines[i]); + } + const savedDefaultAppearance = Object.assign(Object.create(null), this.data.defaultAppearanceData); + this.data.defaultAppearanceData.fontSize = 0; + this.data.defaultAppearanceData.fontName = fontName; + [defaultAppearance, fontSize, lineHeight] = this._computeFontSize(totalHeight - 2 * defaultPadding, totalWidth - 2 * defaultHPadding, value, font, lineCount); + this.data.defaultAppearanceData = savedDefaultAppearance; + } else { + if (!this._isOffscreenCanvasSupported) { + warn("_getAppearance: OffscreenCanvas is not supported, annotation may not render correctly."); + } + [defaultAppearance, fontSize, lineHeight] = this._computeFontSize(totalHeight - 2 * defaultPadding, totalWidth - 2 * defaultHPadding, value, font, lineCount); + } + let descent = font.descent; + if (isNaN(descent)) { + descent = BASELINE_FACTOR * lineHeight; + } else { + descent = Math.max(BASELINE_FACTOR * lineHeight, Math.abs(descent) * fontSize); + } + const defaultVPadding = Math.min(Math.floor((totalHeight - fontSize) / 2), defaultPadding); + const alignment = this.data.textAlignment; + if (this.data.multiLine) { + return this._getMultilineAppearance(defaultAppearance, encodedLines, font, fontSize, totalWidth, totalHeight, alignment, defaultHPadding, defaultVPadding, descent, lineHeight, annotationStorage); + } + if (this.data.comb) { + return this._getCombAppearance(defaultAppearance, font, encodedLines[0], fontSize, totalWidth, totalHeight, defaultHPadding, defaultVPadding, descent, lineHeight, annotationStorage); + } + const bottomPadding = defaultVPadding + descent; + if (alignment === 0 || alignment > 2) { + return `/Tx BMC q ${colors}BT ` + defaultAppearance + ` 1 0 0 1 ${numberToString(defaultHPadding)} ${numberToString(bottomPadding)} Tm (${escapeString(encodedLines[0])}) Tj` + " ET Q EMC"; + } + const prevInfo = { + shift: 0 + }; + const renderedText = this._renderText(encodedLines[0], font, fontSize, totalWidth, alignment, prevInfo, defaultHPadding, bottomPadding); + return `/Tx BMC q ${colors}BT ` + defaultAppearance + ` 1 0 0 1 0 0 Tm ${renderedText}` + " ET Q EMC"; + } + static async _getFontData(evaluator, task, appearanceData, resources) { + const operatorList = new OperatorList(); + const initialState = { + font: null, + clone() { + return this; + } + }; + const { + fontName, + fontSize + } = appearanceData; + await evaluator.handleSetFont(resources, [fontName && Name.get(fontName), fontSize], null, operatorList, task, initialState, null); + return initialState.font; + } + _getTextWidth(text, font) { + return font.charsToGlyphs(text).reduce((width, glyph) => width + glyph.width, 0) / 1000; + } + _computeFontSize(height, width, text, font, lineCount) { + let { + fontSize + } = this.data.defaultAppearanceData; + let lineHeight = (fontSize || 12) * LINE_FACTOR, + numberOfLines = Math.round(height / lineHeight); + if (!fontSize) { + const roundWithTwoDigits = x => Math.floor(x * 100) / 100; + if (lineCount === -1) { + const textWidth = this._getTextWidth(text, font); + fontSize = roundWithTwoDigits(Math.min(height / LINE_FACTOR, width / textWidth)); + numberOfLines = 1; + } else { + const lines = text.split(/\r\n?|\n/); + const cachedLines = []; + for (const line of lines) { + const encoded = font.encodeString(line).join(""); + const glyphs = font.charsToGlyphs(encoded); + const positions = font.getCharPositions(encoded); + cachedLines.push({ + line: encoded, + glyphs, + positions + }); + } + const isTooBig = fsize => { + let totalHeight = 0; + for (const cache of cachedLines) { + const chunks = this._splitLine(null, font, fsize, width, cache); + totalHeight += chunks.length * fsize; + if (totalHeight > height) { + return true; + } + } + return false; + }; + numberOfLines = Math.max(numberOfLines, lineCount); + while (true) { + lineHeight = height / numberOfLines; + fontSize = roundWithTwoDigits(lineHeight / LINE_FACTOR); + if (isTooBig(fontSize)) { + numberOfLines++; + continue; + } + break; + } + } + const { + fontName, + fontColor + } = this.data.defaultAppearanceData; + this._defaultAppearance = createDefaultAppearance({ + fontSize, + fontName, + fontColor + }); + } + return [this._defaultAppearance, fontSize, height / numberOfLines]; + } + _renderText(text, font, fontSize, totalWidth, alignment, prevInfo, hPadding, vPadding) { + let shift; + if (alignment === 1) { + const width = this._getTextWidth(text, font) * fontSize; + shift = (totalWidth - width) / 2; + } else if (alignment === 2) { + const width = this._getTextWidth(text, font) * fontSize; + shift = totalWidth - width - hPadding; + } else { + shift = hPadding; + } + const shiftStr = numberToString(shift - prevInfo.shift); + prevInfo.shift = shift; + vPadding = numberToString(vPadding); + return `${shiftStr} ${vPadding} Td (${escapeString(text)}) Tj`; + } + _getSaveFieldResources(xref) { + const { + localResources, + appearanceResources, + acroFormResources + } = this._fieldResources; + const fontName = this.data.defaultAppearanceData?.fontName; + if (!fontName) { + return localResources || Dict.empty; + } + for (const resources of [localResources, appearanceResources]) { + if (resources instanceof Dict) { + const localFont = resources.get("Font"); + if (localFont instanceof Dict && localFont.has(fontName)) { + return resources; + } + } + } + if (acroFormResources instanceof Dict) { + const acroFormFont = acroFormResources.get("Font"); + if (acroFormFont instanceof Dict && acroFormFont.has(fontName)) { + const subFontDict = new Dict(xref); + subFontDict.set(fontName, acroFormFont.getRaw(fontName)); + const subResourcesDict = new Dict(xref); + subResourcesDict.set("Font", subFontDict); + return Dict.merge({ + xref, + dictArray: [subResourcesDict, localResources], + mergeSubDicts: true + }); + } + } + return localResources || Dict.empty; + } + getFieldObject() { + return null; + } +} +class TextWidgetAnnotation extends WidgetAnnotation { + constructor(params) { + super(params); + const { + dict + } = params; + if (dict.has("PMD")) { + this.flags |= AnnotationFlag.HIDDEN; + this.data.hidden = true; + warn("Barcodes are not supported"); + } + this.data.hasOwnCanvas = this.data.readOnly && !this.data.noHTML; + this._hasText = true; + if (typeof this.data.fieldValue !== "string") { + this.data.fieldValue = ""; + } + let alignment = getInheritableProperty({ + dict, + key: "Q" + }); + if (!Number.isInteger(alignment) || alignment < 0 || alignment > 2) { + alignment = null; + } + this.data.textAlignment = alignment; + let maximumLength = getInheritableProperty({ + dict, + key: "MaxLen" + }); + if (!Number.isInteger(maximumLength) || maximumLength < 0) { + maximumLength = 0; + } + this.data.maxLen = maximumLength; + this.data.multiLine = this.hasFieldFlag(AnnotationFieldFlag.MULTILINE); + this.data.comb = this.hasFieldFlag(AnnotationFieldFlag.COMB) && !this.hasFieldFlag(AnnotationFieldFlag.MULTILINE) && !this.hasFieldFlag(AnnotationFieldFlag.PASSWORD) && !this.hasFieldFlag(AnnotationFieldFlag.FILESELECT) && this.data.maxLen !== 0; + this.data.doNotScroll = this.hasFieldFlag(AnnotationFieldFlag.DONOTSCROLL); + } + get hasTextContent() { + return !!this.appearance && !this._needAppearances; + } + _getCombAppearance(defaultAppearance, font, text, fontSize, width, height, hPadding, vPadding, descent, lineHeight, annotationStorage) { + const combWidth = width / this.data.maxLen; + const colors = this.getBorderAndBackgroundAppearances(annotationStorage); + const buf = []; + const positions = font.getCharPositions(text); + for (const [start, end] of positions) { + buf.push(`(${escapeString(text.substring(start, end))}) Tj`); + } + const renderedComb = buf.join(` ${numberToString(combWidth)} 0 Td `); + return `/Tx BMC q ${colors}BT ` + defaultAppearance + ` 1 0 0 1 ${numberToString(hPadding)} ${numberToString(vPadding + descent)} Tm ${renderedComb}` + " ET Q EMC"; + } + _getMultilineAppearance(defaultAppearance, lines, font, fontSize, width, height, alignment, hPadding, vPadding, descent, lineHeight, annotationStorage) { + const buf = []; + const totalWidth = width - 2 * hPadding; + const prevInfo = { + shift: 0 + }; + for (let i = 0, ii = lines.length; i < ii; i++) { + const line = lines[i]; + const chunks = this._splitLine(line, font, fontSize, totalWidth); + for (let j = 0, jj = chunks.length; j < jj; j++) { + const chunk = chunks[j]; + const vShift = i === 0 && j === 0 ? -vPadding - (lineHeight - descent) : -lineHeight; + buf.push(this._renderText(chunk, font, fontSize, width, alignment, prevInfo, hPadding, vShift)); + } + } + const colors = this.getBorderAndBackgroundAppearances(annotationStorage); + const renderedText = buf.join("\n"); + return `/Tx BMC q ${colors}BT ` + defaultAppearance + ` 1 0 0 1 0 ${numberToString(height)} Tm ${renderedText}` + " ET Q EMC"; + } + _splitLine(line, font, fontSize, width, cache = {}) { + line = cache.line || line; + const glyphs = cache.glyphs || font.charsToGlyphs(line); + if (glyphs.length <= 1) { + return [line]; + } + const positions = cache.positions || font.getCharPositions(line); + const scale = fontSize / 1000; + const chunks = []; + let lastSpacePosInStringStart = -1, + lastSpacePosInStringEnd = -1, + lastSpacePos = -1, + startChunk = 0, + currentWidth = 0; + for (let i = 0, ii = glyphs.length; i < ii; i++) { + const [start, end] = positions[i]; + const glyph = glyphs[i]; + const glyphWidth = glyph.width * scale; + if (glyph.unicode === " ") { + if (currentWidth + glyphWidth > width) { + chunks.push(line.substring(startChunk, start)); + startChunk = start; + currentWidth = glyphWidth; + lastSpacePosInStringStart = -1; + lastSpacePos = -1; + } else { + currentWidth += glyphWidth; + lastSpacePosInStringStart = start; + lastSpacePosInStringEnd = end; + lastSpacePos = i; + } + } else if (currentWidth + glyphWidth > width) { + if (lastSpacePosInStringStart !== -1) { + chunks.push(line.substring(startChunk, lastSpacePosInStringEnd)); + startChunk = lastSpacePosInStringEnd; + i = lastSpacePos + 1; + lastSpacePosInStringStart = -1; + currentWidth = 0; + } else { + chunks.push(line.substring(startChunk, start)); + startChunk = start; + currentWidth = glyphWidth; + } + } else { + currentWidth += glyphWidth; + } + } + if (startChunk < line.length) { + chunks.push(line.substring(startChunk, line.length)); + } + return chunks; + } + async extractTextContent(evaluator, task, viewBox) { + await super.extractTextContent(evaluator, task, viewBox); + const text = this.data.textContent; + if (!text) { + return; + } + const allText = text.join("\n"); + if (allText === this.data.fieldValue) { + return; + } + const regex = allText.replaceAll(/([.*+?^${}()|[\]\\])|(\s+)/g, (_m, p1) => p1 ? `\\${p1}` : "\\s+"); + if (new RegExp(`^\\s*${regex}\\s*$`).test(this.data.fieldValue)) { + this.data.textContent = this.data.fieldValue.split("\n"); + } + } + getFieldObject() { + return { + id: this.data.id, + value: this.data.fieldValue, + defaultValue: this.data.defaultFieldValue || "", + multiline: this.data.multiLine, + password: this.hasFieldFlag(AnnotationFieldFlag.PASSWORD), + charLimit: this.data.maxLen, + comb: this.data.comb, + editable: !this.data.readOnly, + hidden: this.data.hidden, + name: this.data.fieldName, + rect: this.data.rect, + actions: this.data.actions, + page: this.data.pageIndex, + strokeColor: this.data.borderColor, + fillColor: this.data.backgroundColor, + rotation: this.rotation, + type: "text" + }; + } +} +class ButtonWidgetAnnotation extends WidgetAnnotation { + constructor(params) { + super(params); + this.checkedAppearance = null; + this.uncheckedAppearance = null; + this.data.checkBox = !this.hasFieldFlag(AnnotationFieldFlag.RADIO) && !this.hasFieldFlag(AnnotationFieldFlag.PUSHBUTTON); + this.data.radioButton = this.hasFieldFlag(AnnotationFieldFlag.RADIO) && !this.hasFieldFlag(AnnotationFieldFlag.PUSHBUTTON); + this.data.pushButton = this.hasFieldFlag(AnnotationFieldFlag.PUSHBUTTON); + this.data.isTooltipOnly = false; + if (this.data.checkBox) { + this._processCheckBox(params); + } else if (this.data.radioButton) { + this._processRadioButton(params); + } else if (this.data.pushButton) { + this.data.hasOwnCanvas = true; + this.data.noHTML = false; + this._processPushButton(params); + } else { + warn("Invalid field flags for button widget annotation"); + } + } + async getOperatorList(evaluator, task, intent, annotationStorage) { + if (this.data.pushButton) { + return super.getOperatorList(evaluator, task, intent, false, annotationStorage); + } + let value = null; + let rotation = null; + if (annotationStorage) { + const storageEntry = annotationStorage.get(this.data.id); + value = storageEntry ? storageEntry.value : null; + rotation = storageEntry ? storageEntry.rotation : null; + } + if (value === null && this.appearance) { + return super.getOperatorList(evaluator, task, intent, annotationStorage); + } + if (value === null || value === undefined) { + value = this.data.checkBox ? this.data.fieldValue === this.data.exportValue : this.data.fieldValue === this.data.buttonValue; + } + const appearance = value ? this.checkedAppearance : this.uncheckedAppearance; + if (appearance) { + const savedAppearance = this.appearance; + const savedMatrix = lookupMatrix(appearance.dict.getArray("Matrix"), IDENTITY_MATRIX); + if (rotation) { + appearance.dict.set("Matrix", this.getRotationMatrix(annotationStorage)); + } + this.appearance = appearance; + const operatorList = super.getOperatorList(evaluator, task, intent, annotationStorage); + this.appearance = savedAppearance; + appearance.dict.set("Matrix", savedMatrix); + return operatorList; + } + return { + opList: new OperatorList(), + separateForm: false, + separateCanvas: false + }; + } + async save(evaluator, task, annotationStorage, changes) { + if (this.data.checkBox) { + this._saveCheckbox(evaluator, task, annotationStorage, changes); + return; + } + if (this.data.radioButton) { + this._saveRadioButton(evaluator, task, annotationStorage, changes); + } + } + async _saveCheckbox(evaluator, task, annotationStorage, changes) { + if (!annotationStorage) { + return; + } + const storageEntry = annotationStorage.get(this.data.id); + const flags = this._buildFlags(storageEntry?.noView, storageEntry?.noPrint); + let rotation = storageEntry?.rotation, + value = storageEntry?.value; + if (rotation === undefined && flags === undefined) { + if (value === undefined) { + return; + } + const defaultValue = this.data.fieldValue === this.data.exportValue; + if (defaultValue === value) { + return; + } + } + let dict = evaluator.xref.fetchIfRef(this.ref); + if (!(dict instanceof Dict)) { + return; + } + dict = dict.clone(); + if (rotation === undefined) { + rotation = this.rotation; + } + if (value === undefined) { + value = this.data.fieldValue === this.data.exportValue; + } + const xfa = { + path: this.data.fieldName, + value: value ? this.data.exportValue : "" + }; + const name = Name.get(value ? this.data.exportValue : "Off"); + this.setValue(dict, name, evaluator.xref, changes); + dict.set("AS", name); + dict.set("M", `D:${getModificationDate()}`); + if (flags !== undefined) { + dict.set("F", flags); + } + const maybeMK = this._getMKDict(rotation); + if (maybeMK) { + dict.set("MK", maybeMK); + } + changes.put(this.ref, { + data: dict, + xfa, + needAppearances: false + }); + } + async _saveRadioButton(evaluator, task, annotationStorage, changes) { + if (!annotationStorage) { + return; + } + const storageEntry = annotationStorage.get(this.data.id); + const flags = this._buildFlags(storageEntry?.noView, storageEntry?.noPrint); + let rotation = storageEntry?.rotation, + value = storageEntry?.value; + if (rotation === undefined && flags === undefined) { + if (value === undefined) { + return; + } + const defaultValue = this.data.fieldValue === this.data.buttonValue; + if (defaultValue === value) { + return; + } + } + let dict = evaluator.xref.fetchIfRef(this.ref); + if (!(dict instanceof Dict)) { + return; + } + dict = dict.clone(); + if (value === undefined) { + value = this.data.fieldValue === this.data.buttonValue; + } + if (rotation === undefined) { + rotation = this.rotation; + } + const xfa = { + path: this.data.fieldName, + value: value ? this.data.buttonValue : "" + }; + const name = Name.get(value ? this.data.buttonValue : "Off"); + if (value) { + this.setValue(dict, name, evaluator.xref, changes); + } + dict.set("AS", name); + dict.set("M", `D:${getModificationDate()}`); + if (flags !== undefined) { + dict.set("F", flags); + } + const maybeMK = this._getMKDict(rotation); + if (maybeMK) { + dict.set("MK", maybeMK); + } + changes.put(this.ref, { + data: dict, + xfa, + needAppearances: false + }); + } + _getDefaultCheckedAppearance(params, type) { + const width = this.data.rect[2] - this.data.rect[0]; + const height = this.data.rect[3] - this.data.rect[1]; + const bbox = [0, 0, width, height]; + const FONT_RATIO = 0.8; + const fontSize = Math.min(width, height) * FONT_RATIO; + let metrics, char; + if (type === "check") { + metrics = { + width: 0.755 * fontSize, + height: 0.705 * fontSize + }; + char = "\x33"; + } else if (type === "disc") { + metrics = { + width: 0.791 * fontSize, + height: 0.705 * fontSize + }; + char = "\x6C"; + } else { + unreachable(`_getDefaultCheckedAppearance - unsupported type: ${type}`); + } + const xShift = numberToString((width - metrics.width) / 2); + const yShift = numberToString((height - metrics.height) / 2); + const appearance = `q BT /PdfJsZaDb ${fontSize} Tf 0 g ${xShift} ${yShift} Td (${char}) Tj ET Q`; + const appearanceStreamDict = new Dict(params.xref); + appearanceStreamDict.set("FormType", 1); + appearanceStreamDict.set("Subtype", Name.get("Form")); + appearanceStreamDict.set("Type", Name.get("XObject")); + appearanceStreamDict.set("BBox", bbox); + appearanceStreamDict.set("Matrix", [1, 0, 0, 1, 0, 0]); + appearanceStreamDict.set("Length", appearance.length); + const resources = new Dict(params.xref); + const font = new Dict(params.xref); + font.set("PdfJsZaDb", this.fallbackFontDict); + resources.set("Font", font); + appearanceStreamDict.set("Resources", resources); + this.checkedAppearance = new StringStream(appearance); + this.checkedAppearance.dict = appearanceStreamDict; + this._streams.push(this.checkedAppearance); + } + _processCheckBox(params) { + const customAppearance = params.dict.get("AP"); + if (!(customAppearance instanceof Dict)) { + return; + } + const normalAppearance = customAppearance.get("N"); + if (!(normalAppearance instanceof Dict)) { + return; + } + const asValue = this._decodeFormValue(params.dict.get("AS")); + if (typeof asValue === "string") { + this.data.fieldValue = asValue; + } + const yes = this.data.fieldValue !== null && this.data.fieldValue !== "Off" ? this.data.fieldValue : "Yes"; + const exportValues = normalAppearance.getKeys(); + if (exportValues.length === 0) { + exportValues.push("Off", yes); + } else if (exportValues.length === 1) { + if (exportValues[0] === "Off") { + exportValues.push(yes); + } else { + exportValues.unshift("Off"); + } + } else if (exportValues.includes(yes)) { + exportValues.length = 0; + exportValues.push("Off", yes); + } else { + const otherYes = exportValues.find(v => v !== "Off"); + exportValues.length = 0; + exportValues.push("Off", otherYes); + } + if (!exportValues.includes(this.data.fieldValue)) { + this.data.fieldValue = "Off"; + } + this.data.exportValue = exportValues[1]; + const checkedAppearance = normalAppearance.get(this.data.exportValue); + this.checkedAppearance = checkedAppearance instanceof BaseStream ? checkedAppearance : null; + const uncheckedAppearance = normalAppearance.get("Off"); + this.uncheckedAppearance = uncheckedAppearance instanceof BaseStream ? uncheckedAppearance : null; + if (this.checkedAppearance) { + this._streams.push(this.checkedAppearance); + } else { + this._getDefaultCheckedAppearance(params, "check"); + } + if (this.uncheckedAppearance) { + this._streams.push(this.uncheckedAppearance); + } + this._fallbackFontDict = this.fallbackFontDict; + if (this.data.defaultFieldValue === null) { + this.data.defaultFieldValue = "Off"; + } + } + _processRadioButton(params) { + this.data.buttonValue = null; + const fieldParent = params.dict.get("Parent"); + if (fieldParent instanceof Dict) { + this.parent = params.dict.getRaw("Parent"); + const fieldParentValue = fieldParent.get("V"); + if (fieldParentValue instanceof Name) { + this.data.fieldValue = this._decodeFormValue(fieldParentValue); + } + } + const appearanceStates = params.dict.get("AP"); + if (!(appearanceStates instanceof Dict)) { + return; + } + const normalAppearance = appearanceStates.get("N"); + if (!(normalAppearance instanceof Dict)) { + return; + } + for (const key of normalAppearance.getKeys()) { + if (key !== "Off") { + this.data.buttonValue = this._decodeFormValue(key); + break; + } + } + const checkedAppearance = normalAppearance.get(this.data.buttonValue); + this.checkedAppearance = checkedAppearance instanceof BaseStream ? checkedAppearance : null; + const uncheckedAppearance = normalAppearance.get("Off"); + this.uncheckedAppearance = uncheckedAppearance instanceof BaseStream ? uncheckedAppearance : null; + if (this.checkedAppearance) { + this._streams.push(this.checkedAppearance); + } else { + this._getDefaultCheckedAppearance(params, "disc"); + } + if (this.uncheckedAppearance) { + this._streams.push(this.uncheckedAppearance); + } + this._fallbackFontDict = this.fallbackFontDict; + if (this.data.defaultFieldValue === null) { + this.data.defaultFieldValue = "Off"; + } + } + _processPushButton(params) { + const { + dict, + annotationGlobals + } = params; + if (!dict.has("A") && !dict.has("AA") && !this.data.alternativeText) { + warn("Push buttons without action dictionaries are not supported"); + return; + } + this.data.isTooltipOnly = !dict.has("A") && !dict.has("AA"); + Catalog.parseDestDictionary({ + destDict: dict, + resultObj: this.data, + docBaseUrl: annotationGlobals.baseUrl, + docAttachments: annotationGlobals.attachments + }); + } + getFieldObject() { + let type = "button"; + let exportValues; + if (this.data.checkBox) { + type = "checkbox"; + exportValues = this.data.exportValue; + } else if (this.data.radioButton) { + type = "radiobutton"; + exportValues = this.data.buttonValue; + } + return { + id: this.data.id, + value: this.data.fieldValue || "Off", + defaultValue: this.data.defaultFieldValue, + exportValues, + editable: !this.data.readOnly, + name: this.data.fieldName, + rect: this.data.rect, + hidden: this.data.hidden, + actions: this.data.actions, + page: this.data.pageIndex, + strokeColor: this.data.borderColor, + fillColor: this.data.backgroundColor, + rotation: this.rotation, + type + }; + } + get fallbackFontDict() { + const dict = new Dict(); + dict.set("BaseFont", Name.get("ZapfDingbats")); + dict.set("Type", Name.get("FallbackType")); + dict.set("Subtype", Name.get("FallbackType")); + dict.set("Encoding", Name.get("ZapfDingbatsEncoding")); + return shadow(this, "fallbackFontDict", dict); + } +} +class ChoiceWidgetAnnotation extends WidgetAnnotation { + constructor(params) { + super(params); + const { + dict, + xref + } = params; + this.indices = dict.getArray("I"); + this.hasIndices = Array.isArray(this.indices) && this.indices.length > 0; + this.data.options = []; + const options = getInheritableProperty({ + dict, + key: "Opt" + }); + if (Array.isArray(options)) { + for (let i = 0, ii = options.length; i < ii; i++) { + const option = xref.fetchIfRef(options[i]); + const isOptionArray = Array.isArray(option); + this.data.options[i] = { + exportValue: this._decodeFormValue(isOptionArray ? xref.fetchIfRef(option[0]) : option), + displayValue: this._decodeFormValue(isOptionArray ? xref.fetchIfRef(option[1]) : option) + }; + } + } + if (!this.hasIndices) { + if (typeof this.data.fieldValue === "string") { + this.data.fieldValue = [this.data.fieldValue]; + } else if (!this.data.fieldValue) { + this.data.fieldValue = []; + } + } else { + this.data.fieldValue = []; + const ii = this.data.options.length; + for (const i of this.indices) { + if (Number.isInteger(i) && i >= 0 && i < ii) { + this.data.fieldValue.push(this.data.options[i].exportValue); + } + } + } + if (this.data.options.length === 0 && this.data.fieldValue.length > 0) { + this.data.options = this.data.fieldValue.map(value => ({ + exportValue: value, + displayValue: value + })); + } + this.data.combo = this.hasFieldFlag(AnnotationFieldFlag.COMBO); + this.data.multiSelect = this.hasFieldFlag(AnnotationFieldFlag.MULTISELECT); + this._hasText = true; + } + getFieldObject() { + const type = this.data.combo ? "combobox" : "listbox"; + const value = this.data.fieldValue.length > 0 ? this.data.fieldValue[0] : null; + return { + id: this.data.id, + value, + defaultValue: this.data.defaultFieldValue, + editable: !this.data.readOnly, + name: this.data.fieldName, + rect: this.data.rect, + numItems: this.data.fieldValue.length, + multipleSelection: this.data.multiSelect, + hidden: this.data.hidden, + actions: this.data.actions, + items: this.data.options, + page: this.data.pageIndex, + strokeColor: this.data.borderColor, + fillColor: this.data.backgroundColor, + rotation: this.rotation, + type + }; + } + amendSavedDict(annotationStorage, dict) { + if (!this.hasIndices) { + return; + } + let values = annotationStorage?.get(this.data.id)?.value; + if (!Array.isArray(values)) { + values = [values]; + } + const indices = []; + const { + options + } = this.data; + for (let i = 0, j = 0, ii = options.length; i < ii; i++) { + if (options[i].exportValue === values[j]) { + indices.push(i); + j += 1; + } + } + dict.set("I", indices); + } + async _getAppearance(evaluator, task, intent, annotationStorage) { + if (this.data.combo) { + return super._getAppearance(evaluator, task, intent, annotationStorage); + } + let exportedValue, rotation; + const storageEntry = annotationStorage?.get(this.data.id); + if (storageEntry) { + rotation = storageEntry.rotation; + exportedValue = storageEntry.value; + } + if (rotation === undefined && exportedValue === undefined && !this._needAppearances) { + return null; + } + if (exportedValue === undefined) { + exportedValue = this.data.fieldValue; + } else if (!Array.isArray(exportedValue)) { + exportedValue = [exportedValue]; + } + const defaultPadding = 1; + const defaultHPadding = 2; + let totalHeight = this.data.rect[3] - this.data.rect[1]; + let totalWidth = this.data.rect[2] - this.data.rect[0]; + if (rotation === 90 || rotation === 270) { + [totalWidth, totalHeight] = [totalHeight, totalWidth]; + } + const lineCount = this.data.options.length; + const valueIndices = []; + for (let i = 0; i < lineCount; i++) { + const { + exportValue + } = this.data.options[i]; + if (exportedValue.includes(exportValue)) { + valueIndices.push(i); + } + } + if (!this._defaultAppearance) { + this.data.defaultAppearanceData = parseDefaultAppearance(this._defaultAppearance = "/Helvetica 0 Tf 0 g"); + } + const font = await WidgetAnnotation._getFontData(evaluator, task, this.data.defaultAppearanceData, this._fieldResources.mergedResources); + let defaultAppearance; + let { + fontSize + } = this.data.defaultAppearanceData; + if (!fontSize) { + const lineHeight = (totalHeight - defaultPadding) / lineCount; + let lineWidth = -1; + let value; + for (const { + displayValue + } of this.data.options) { + const width = this._getTextWidth(displayValue, font); + if (width > lineWidth) { + lineWidth = width; + value = displayValue; + } + } + [defaultAppearance, fontSize] = this._computeFontSize(lineHeight, totalWidth - 2 * defaultHPadding, value, font, -1); + } else { + defaultAppearance = this._defaultAppearance; + } + const lineHeight = fontSize * LINE_FACTOR; + const vPadding = (lineHeight - fontSize) / 2; + const numberOfVisibleLines = Math.floor(totalHeight / lineHeight); + let firstIndex = 0; + if (valueIndices.length > 0) { + const minIndex = Math.min(...valueIndices); + const maxIndex = Math.max(...valueIndices); + firstIndex = Math.max(0, maxIndex - numberOfVisibleLines + 1); + if (firstIndex > minIndex) { + firstIndex = minIndex; + } + } + const end = Math.min(firstIndex + numberOfVisibleLines + 1, lineCount); + const buf = ["/Tx BMC q", `1 1 ${totalWidth} ${totalHeight} re W n`]; + if (valueIndices.length) { + buf.push("0.600006 0.756866 0.854904 rg"); + for (const index of valueIndices) { + if (firstIndex <= index && index < end) { + buf.push(`1 ${totalHeight - (index - firstIndex + 1) * lineHeight} ${totalWidth} ${lineHeight} re f`); + } + } + } + buf.push("BT", defaultAppearance, `1 0 0 1 0 ${totalHeight} Tm`); + const prevInfo = { + shift: 0 + }; + for (let i = firstIndex; i < end; i++) { + const { + displayValue + } = this.data.options[i]; + const vpadding = i === firstIndex ? vPadding : 0; + buf.push(this._renderText(displayValue, font, fontSize, totalWidth, 0, prevInfo, defaultHPadding, -lineHeight + vpadding)); + } + buf.push("ET Q EMC"); + return buf.join("\n"); + } +} +class SignatureWidgetAnnotation extends WidgetAnnotation { + constructor(params) { + super(params); + this.data.fieldValue = null; + this.data.hasOwnCanvas = this.data.noRotate; + this.data.noHTML = !this.data.hasOwnCanvas; + } + getFieldObject() { + return { + id: this.data.id, + value: null, + page: this.data.pageIndex, + type: "signature" + }; + } +} +class TextAnnotation extends MarkupAnnotation { + constructor(params) { + const DEFAULT_ICON_SIZE = 22; + super(params); + this.data.noRotate = true; + this.data.hasOwnCanvas = this.data.noRotate; + this.data.noHTML = false; + const { + dict + } = params; + this.data.annotationType = AnnotationType.TEXT; + if (this.data.hasAppearance) { + this.data.name = "NoIcon"; + } else { + this.data.rect[1] = this.data.rect[3] - DEFAULT_ICON_SIZE; + this.data.rect[2] = this.data.rect[0] + DEFAULT_ICON_SIZE; + this.data.name = dict.has("Name") ? dict.get("Name").name : "Note"; + } + if (dict.has("State")) { + this.data.state = dict.get("State") || null; + this.data.stateModel = dict.get("StateModel") || null; + } else { + this.data.state = null; + this.data.stateModel = null; + } + } +} +class LinkAnnotation extends Annotation { + constructor(params) { + super(params); + const { + dict, + annotationGlobals + } = params; + this.data.annotationType = AnnotationType.LINK; + this.data.noHTML = false; + const quadPoints = getQuadPoints(dict, this.rectangle); + if (quadPoints) { + this.data.quadPoints = quadPoints; + } + this.data.borderColor ||= this.data.color; + Catalog.parseDestDictionary({ + destDict: dict, + resultObj: this.data, + docBaseUrl: annotationGlobals.baseUrl, + docAttachments: annotationGlobals.attachments + }); + } +} +class PopupAnnotation extends Annotation { + constructor(params) { + super(params); + const { + dict + } = params; + this.data.annotationType = AnnotationType.POPUP; + this.data.noHTML = false; + if (this.data.rect[0] === this.data.rect[2] || this.data.rect[1] === this.data.rect[3]) { + this.data.rect = null; + } + let parentItem = dict.get("Parent"); + if (!parentItem) { + warn("Popup annotation has a missing or invalid parent annotation."); + return; + } + this.data.parentRect = lookupNormalRect(parentItem.getArray("Rect"), null); + const rt = parentItem.get("RT"); + if (isName(rt, AnnotationReplyType.GROUP)) { + parentItem = parentItem.get("IRT"); + } + if (!parentItem.has("M")) { + this.data.modificationDate = null; + } else { + this.setModificationDate(parentItem.get("M")); + this.data.modificationDate = this.modificationDate; + } + if (!parentItem.has("C")) { + this.data.color = null; + } else { + this.setColor(parentItem.getArray("C")); + this.data.color = this.color; + } + if (!this.viewable) { + const parentFlags = parentItem.get("F"); + if (this._isViewable(parentFlags)) { + this.setFlags(parentFlags); + } + } + this.setTitle(parentItem.get("T")); + this.data.titleObj = this._title; + this.setContents(parentItem.get("Contents")); + this.data.contentsObj = this._contents; + if (parentItem.has("RC")) { + this.data.richText = XFAFactory.getRichTextAsHtml(parentItem.get("RC")); + } + this.data.open = !!dict.get("Open"); + } +} +class FreeTextAnnotation extends MarkupAnnotation { + constructor(params) { + super(params); + this.data.hasOwnCanvas = this.data.noRotate; + this.data.isEditable = !this.data.noHTML; + this.data.noHTML = false; + const { + evaluatorOptions, + xref + } = params; + this.data.annotationType = AnnotationType.FREETEXT; + this.setDefaultAppearance(params); + this._hasAppearance = !!this.appearance; + if (this._hasAppearance) { + const { + fontColor, + fontSize + } = parseAppearanceStream(this.appearance, evaluatorOptions, xref); + this.data.defaultAppearanceData.fontColor = fontColor; + this.data.defaultAppearanceData.fontSize = fontSize || 10; + } else { + this.data.defaultAppearanceData.fontSize ||= 10; + const { + fontColor, + fontSize + } = this.data.defaultAppearanceData; + if (this._contents.str) { + this.data.textContent = this._contents.str.split(/\r\n?|\n/).map(line => line.trimEnd()); + const { + coords, + bbox, + matrix + } = FakeUnicodeFont.getFirstPositionInfo(this.rectangle, this.rotation, fontSize); + this.data.textPosition = this._transformPoint(coords, bbox, matrix); + } + if (this._isOffscreenCanvasSupported) { + const strokeAlpha = params.dict.get("CA"); + const fakeUnicodeFont = new FakeUnicodeFont(xref, "sans-serif"); + this.appearance = fakeUnicodeFont.createAppearance(this._contents.str, this.rectangle, this.rotation, fontSize, fontColor, strokeAlpha); + this._streams.push(this.appearance); + } else { + warn("FreeTextAnnotation: OffscreenCanvas is not supported, annotation may not render correctly."); + } + } + } + get hasTextContent() { + return this._hasAppearance; + } + static createNewDict(annotation, xref, { + apRef, + ap + }) { + const { + color, + fontSize, + oldAnnotation, + rect, + rotation, + user, + value + } = annotation; + const freetext = oldAnnotation || new Dict(xref); + freetext.set("Type", Name.get("Annot")); + freetext.set("Subtype", Name.get("FreeText")); + if (oldAnnotation) { + freetext.set("M", `D:${getModificationDate()}`); + freetext.delete("RC"); + } else { + freetext.set("CreationDate", `D:${getModificationDate()}`); + } + freetext.set("Rect", rect); + const da = `/Helv ${fontSize} Tf ${getPdfColor(color, true)}`; + freetext.set("DA", da); + freetext.set("Contents", stringToAsciiOrUTF16BE(value)); + freetext.set("F", 4); + freetext.set("Border", [0, 0, 0]); + freetext.set("Rotate", rotation); + if (user) { + freetext.set("T", stringToAsciiOrUTF16BE(user)); + } + if (apRef || ap) { + const n = new Dict(xref); + freetext.set("AP", n); + if (apRef) { + n.set("N", apRef); + } else { + n.set("N", ap); + } + } + return freetext; + } + static async createNewAppearanceStream(annotation, xref, params) { + const { + baseFontRef, + evaluator, + task + } = params; + const { + color, + fontSize, + rect, + rotation, + value + } = annotation; + const resources = new Dict(xref); + const font = new Dict(xref); + if (baseFontRef) { + font.set("Helv", baseFontRef); + } else { + const baseFont = new Dict(xref); + baseFont.set("BaseFont", Name.get("Helvetica")); + baseFont.set("Type", Name.get("Font")); + baseFont.set("Subtype", Name.get("Type1")); + baseFont.set("Encoding", Name.get("WinAnsiEncoding")); + font.set("Helv", baseFont); + } + resources.set("Font", font); + const helv = await WidgetAnnotation._getFontData(evaluator, task, { + fontName: "Helv", + fontSize + }, resources); + const [x1, y1, x2, y2] = rect; + let w = x2 - x1; + let h = y2 - y1; + if (rotation % 180 !== 0) { + [w, h] = [h, w]; + } + const lines = value.split("\n"); + const scale = fontSize / 1000; + let totalWidth = -Infinity; + const encodedLines = []; + for (let line of lines) { + const encoded = helv.encodeString(line); + if (encoded.length > 1) { + return null; + } + line = encoded.join(""); + encodedLines.push(line); + let lineWidth = 0; + const glyphs = helv.charsToGlyphs(line); + for (const glyph of glyphs) { + lineWidth += glyph.width * scale; + } + totalWidth = Math.max(totalWidth, lineWidth); + } + let hscale = 1; + if (totalWidth > w) { + hscale = w / totalWidth; + } + let vscale = 1; + const lineHeight = LINE_FACTOR * fontSize; + const lineAscent = (LINE_FACTOR - LINE_DESCENT_FACTOR) * fontSize; + const totalHeight = lineHeight * lines.length; + if (totalHeight > h) { + vscale = h / totalHeight; + } + const fscale = Math.min(hscale, vscale); + const newFontSize = fontSize * fscale; + let firstPoint, clipBox, matrix; + switch (rotation) { + case 0: + matrix = [1, 0, 0, 1]; + clipBox = [rect[0], rect[1], w, h]; + firstPoint = [rect[0], rect[3] - lineAscent]; + break; + case 90: + matrix = [0, 1, -1, 0]; + clipBox = [rect[1], -rect[2], w, h]; + firstPoint = [rect[1], -rect[0] - lineAscent]; + break; + case 180: + matrix = [-1, 0, 0, -1]; + clipBox = [-rect[2], -rect[3], w, h]; + firstPoint = [-rect[2], -rect[1] - lineAscent]; + break; + case 270: + matrix = [0, -1, 1, 0]; + clipBox = [-rect[3], rect[0], w, h]; + firstPoint = [-rect[3], rect[2] - lineAscent]; + break; + } + const buffer = ["q", `${matrix.join(" ")} 0 0 cm`, `${clipBox.join(" ")} re W n`, `BT`, `${getPdfColor(color, true)}`, `0 Tc /Helv ${numberToString(newFontSize)} Tf`]; + buffer.push(`${firstPoint.join(" ")} Td (${escapeString(encodedLines[0])}) Tj`); + const vShift = numberToString(lineHeight); + for (let i = 1, ii = encodedLines.length; i < ii; i++) { + const line = encodedLines[i]; + buffer.push(`0 -${vShift} Td (${escapeString(line)}) Tj`); + } + buffer.push("ET", "Q"); + const appearance = buffer.join("\n"); + const appearanceStreamDict = new Dict(xref); + appearanceStreamDict.set("FormType", 1); + appearanceStreamDict.set("Subtype", Name.get("Form")); + appearanceStreamDict.set("Type", Name.get("XObject")); + appearanceStreamDict.set("BBox", rect); + appearanceStreamDict.set("Resources", resources); + appearanceStreamDict.set("Matrix", [1, 0, 0, 1, -rect[0], -rect[1]]); + const ap = new StringStream(appearance); + ap.dict = appearanceStreamDict; + return ap; + } +} +class LineAnnotation extends MarkupAnnotation { + constructor(params) { + super(params); + const { + dict, + xref + } = params; + this.data.annotationType = AnnotationType.LINE; + this.data.hasOwnCanvas = this.data.noRotate; + this.data.noHTML = false; + const lineCoordinates = lookupRect(dict.getArray("L"), [0, 0, 0, 0]); + this.data.lineCoordinates = Util.normalizeRect(lineCoordinates); + this.setLineEndings(dict.getArray("LE")); + this.data.lineEndings = this.lineEndings; + if (!this.appearance) { + const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0]; + const strokeAlpha = dict.get("CA"); + const interiorColor = getRgbColor(dict.getArray("IC"), null); + const fillColor = interiorColor ? getPdfColorArray(interiorColor) : null; + const fillAlpha = fillColor ? strokeAlpha : null; + const borderWidth = this.borderStyle.width || 1, + borderAdjust = 2 * borderWidth; + const bbox = [this.data.lineCoordinates[0] - borderAdjust, this.data.lineCoordinates[1] - borderAdjust, this.data.lineCoordinates[2] + borderAdjust, this.data.lineCoordinates[3] + borderAdjust]; + if (!Util.intersect(this.rectangle, bbox)) { + this.rectangle = bbox; + } + this._setDefaultAppearance({ + xref, + extra: `${borderWidth} w`, + strokeColor, + fillColor, + strokeAlpha, + fillAlpha, + pointsCallback: (buffer, points) => { + buffer.push(`${lineCoordinates[0]} ${lineCoordinates[1]} m`, `${lineCoordinates[2]} ${lineCoordinates[3]} l`, "S"); + return [points[0] - borderWidth, points[2] + borderWidth, points[7] - borderWidth, points[3] + borderWidth]; + } + }); + } + } +} +class SquareAnnotation extends MarkupAnnotation { + constructor(params) { + super(params); + const { + dict, + xref + } = params; + this.data.annotationType = AnnotationType.SQUARE; + this.data.hasOwnCanvas = this.data.noRotate; + this.data.noHTML = false; + if (!this.appearance) { + const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0]; + const strokeAlpha = dict.get("CA"); + const interiorColor = getRgbColor(dict.getArray("IC"), null); + const fillColor = interiorColor ? getPdfColorArray(interiorColor) : null; + const fillAlpha = fillColor ? strokeAlpha : null; + if (this.borderStyle.width === 0 && !fillColor) { + return; + } + this._setDefaultAppearance({ + xref, + extra: `${this.borderStyle.width} w`, + strokeColor, + fillColor, + strokeAlpha, + fillAlpha, + pointsCallback: (buffer, points) => { + const x = points[4] + this.borderStyle.width / 2; + const y = points[5] + this.borderStyle.width / 2; + const width = points[6] - points[4] - this.borderStyle.width; + const height = points[3] - points[7] - this.borderStyle.width; + buffer.push(`${x} ${y} ${width} ${height} re`); + if (fillColor) { + buffer.push("B"); + } else { + buffer.push("S"); + } + return [points[0], points[2], points[7], points[3]]; + } + }); + } + } +} +class CircleAnnotation extends MarkupAnnotation { + constructor(params) { + super(params); + const { + dict, + xref + } = params; + this.data.annotationType = AnnotationType.CIRCLE; + if (!this.appearance) { + const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0]; + const strokeAlpha = dict.get("CA"); + const interiorColor = getRgbColor(dict.getArray("IC"), null); + const fillColor = interiorColor ? getPdfColorArray(interiorColor) : null; + const fillAlpha = fillColor ? strokeAlpha : null; + if (this.borderStyle.width === 0 && !fillColor) { + return; + } + const controlPointsDistance = 4 / 3 * Math.tan(Math.PI / (2 * 4)); + this._setDefaultAppearance({ + xref, + extra: `${this.borderStyle.width} w`, + strokeColor, + fillColor, + strokeAlpha, + fillAlpha, + pointsCallback: (buffer, points) => { + const x0 = points[0] + this.borderStyle.width / 2; + const y0 = points[1] - this.borderStyle.width / 2; + const x1 = points[6] - this.borderStyle.width / 2; + const y1 = points[7] + this.borderStyle.width / 2; + const xMid = x0 + (x1 - x0) / 2; + const yMid = y0 + (y1 - y0) / 2; + const xOffset = (x1 - x0) / 2 * controlPointsDistance; + const yOffset = (y1 - y0) / 2 * controlPointsDistance; + buffer.push(`${xMid} ${y1} m`, `${xMid + xOffset} ${y1} ${x1} ${yMid + yOffset} ${x1} ${yMid} c`, `${x1} ${yMid - yOffset} ${xMid + xOffset} ${y0} ${xMid} ${y0} c`, `${xMid - xOffset} ${y0} ${x0} ${yMid - yOffset} ${x0} ${yMid} c`, `${x0} ${yMid + yOffset} ${xMid - xOffset} ${y1} ${xMid} ${y1} c`, "h"); + if (fillColor) { + buffer.push("B"); + } else { + buffer.push("S"); + } + return [points[0], points[2], points[7], points[3]]; + } + }); + } + } +} +class PolylineAnnotation extends MarkupAnnotation { + constructor(params) { + super(params); + const { + dict, + xref + } = params; + this.data.annotationType = AnnotationType.POLYLINE; + this.data.hasOwnCanvas = this.data.noRotate; + this.data.noHTML = false; + this.data.vertices = null; + if (!(this instanceof PolygonAnnotation)) { + this.setLineEndings(dict.getArray("LE")); + this.data.lineEndings = this.lineEndings; + } + const rawVertices = dict.getArray("Vertices"); + if (!isNumberArray(rawVertices, null)) { + return; + } + const vertices = this.data.vertices = Float32Array.from(rawVertices); + if (!this.appearance) { + const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0]; + const strokeAlpha = dict.get("CA"); + const borderWidth = this.borderStyle.width || 1, + borderAdjust = 2 * borderWidth; + const bbox = [Infinity, Infinity, -Infinity, -Infinity]; + for (let i = 0, ii = vertices.length; i < ii; i += 2) { + bbox[0] = Math.min(bbox[0], vertices[i] - borderAdjust); + bbox[1] = Math.min(bbox[1], vertices[i + 1] - borderAdjust); + bbox[2] = Math.max(bbox[2], vertices[i] + borderAdjust); + bbox[3] = Math.max(bbox[3], vertices[i + 1] + borderAdjust); + } + if (!Util.intersect(this.rectangle, bbox)) { + this.rectangle = bbox; + } + this._setDefaultAppearance({ + xref, + extra: `${borderWidth} w`, + strokeColor, + strokeAlpha, + pointsCallback: (buffer, points) => { + for (let i = 0, ii = vertices.length; i < ii; i += 2) { + buffer.push(`${vertices[i]} ${vertices[i + 1]} ${i === 0 ? "m" : "l"}`); + } + buffer.push("S"); + return [points[0], points[2], points[7], points[3]]; + } + }); + } + } +} +class PolygonAnnotation extends PolylineAnnotation { + constructor(params) { + super(params); + this.data.annotationType = AnnotationType.POLYGON; + } +} +class CaretAnnotation extends MarkupAnnotation { + constructor(params) { + super(params); + this.data.annotationType = AnnotationType.CARET; + } +} +class InkAnnotation extends MarkupAnnotation { + constructor(params) { + super(params); + this.data.hasOwnCanvas = this.data.noRotate; + this.data.noHTML = false; + const { + dict, + xref + } = params; + this.data.annotationType = AnnotationType.INK; + this.data.inkLists = []; + this.data.isEditable = !this.data.noHTML; + this.data.noHTML = false; + this.data.opacity = dict.get("CA") || 1; + const rawInkLists = dict.getArray("InkList"); + if (!Array.isArray(rawInkLists)) { + return; + } + for (let i = 0, ii = rawInkLists.length; i < ii; ++i) { + if (!Array.isArray(rawInkLists[i])) { + continue; + } + const inkList = new Float32Array(rawInkLists[i].length); + this.data.inkLists.push(inkList); + for (let j = 0, jj = rawInkLists[i].length; j < jj; j += 2) { + const x = xref.fetchIfRef(rawInkLists[i][j]), + y = xref.fetchIfRef(rawInkLists[i][j + 1]); + if (typeof x === "number" && typeof y === "number") { + inkList[j] = x; + inkList[j + 1] = y; + } + } + } + if (!this.appearance) { + const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0]; + const strokeAlpha = dict.get("CA"); + const borderWidth = this.borderStyle.width || 1, + borderAdjust = 2 * borderWidth; + const bbox = [Infinity, Infinity, -Infinity, -Infinity]; + for (const inkList of this.data.inkLists) { + for (let i = 0, ii = inkList.length; i < ii; i += 2) { + bbox[0] = Math.min(bbox[0], inkList[i] - borderAdjust); + bbox[1] = Math.min(bbox[1], inkList[i + 1] - borderAdjust); + bbox[2] = Math.max(bbox[2], inkList[i] + borderAdjust); + bbox[3] = Math.max(bbox[3], inkList[i + 1] + borderAdjust); + } + } + if (!Util.intersect(this.rectangle, bbox)) { + this.rectangle = bbox; + } + this._setDefaultAppearance({ + xref, + extra: `${borderWidth} w`, + strokeColor, + strokeAlpha, + pointsCallback: (buffer, points) => { + for (const inkList of this.data.inkLists) { + for (let i = 0, ii = inkList.length; i < ii; i += 2) { + buffer.push(`${inkList[i]} ${inkList[i + 1]} ${i === 0 ? "m" : "l"}`); + } + buffer.push("S"); + } + return [points[0], points[2], points[7], points[3]]; + } + }); + } + } + static createNewDict(annotation, xref, { + apRef, + ap + }) { + const { + oldAnnotation, + color, + opacity, + paths, + outlines, + rect, + rotation, + thickness, + user + } = annotation; + const ink = oldAnnotation || new Dict(xref); + ink.set("Type", Name.get("Annot")); + ink.set("Subtype", Name.get("Ink")); + ink.set(oldAnnotation ? "M" : "CreationDate", `D:${getModificationDate()}`); + ink.set("Rect", rect); + ink.set("InkList", outlines?.points || paths.points); + ink.set("F", 4); + ink.set("Rotate", rotation); + if (user) { + ink.set("T", stringToAsciiOrUTF16BE(user)); + } + if (outlines) { + ink.set("IT", Name.get("InkHighlight")); + } + const bs = new Dict(xref); + ink.set("BS", bs); + bs.set("W", thickness); + ink.set("C", Array.from(color, c => c / 255)); + ink.set("CA", opacity); + const n = new Dict(xref); + ink.set("AP", n); + if (apRef) { + n.set("N", apRef); + } else { + n.set("N", ap); + } + return ink; + } + static async createNewAppearanceStream(annotation, xref, params) { + if (annotation.outlines) { + return this.createNewAppearanceStreamForHighlight(annotation, xref, params); + } + const { + color, + rect, + paths, + thickness, + opacity + } = annotation; + const appearanceBuffer = [`${thickness} w 1 J 1 j`, `${getPdfColor(color, false)}`]; + if (opacity !== 1) { + appearanceBuffer.push("/R0 gs"); + } + for (const outline of paths.lines) { + appearanceBuffer.push(`${numberToString(outline[4])} ${numberToString(outline[5])} m`); + for (let i = 6, ii = outline.length; i < ii; i += 6) { + if (isNaN(outline[i])) { + appearanceBuffer.push(`${numberToString(outline[i + 4])} ${numberToString(outline[i + 5])} l`); + } else { + const [c1x, c1y, c2x, c2y, x, y] = outline.slice(i, i + 6); + appearanceBuffer.push([c1x, c1y, c2x, c2y, x, y].map(numberToString).join(" ") + " c"); + } + } + if (outline.length === 6) { + appearanceBuffer.push(`${numberToString(outline[4])} ${numberToString(outline[5])} l`); + } + } + appearanceBuffer.push("S"); + const appearance = appearanceBuffer.join("\n"); + const appearanceStreamDict = new Dict(xref); + appearanceStreamDict.set("FormType", 1); + appearanceStreamDict.set("Subtype", Name.get("Form")); + appearanceStreamDict.set("Type", Name.get("XObject")); + appearanceStreamDict.set("BBox", rect); + appearanceStreamDict.set("Length", appearance.length); + if (opacity !== 1) { + const resources = new Dict(xref); + const extGState = new Dict(xref); + const r0 = new Dict(xref); + r0.set("CA", opacity); + r0.set("Type", Name.get("ExtGState")); + extGState.set("R0", r0); + resources.set("ExtGState", extGState); + appearanceStreamDict.set("Resources", resources); + } + const ap = new StringStream(appearance); + ap.dict = appearanceStreamDict; + return ap; + } + static async createNewAppearanceStreamForHighlight(annotation, xref, params) { + const { + color, + rect, + outlines: { + outline + }, + opacity + } = annotation; + const appearanceBuffer = [`${getPdfColor(color, true)}`, "/R0 gs"]; + appearanceBuffer.push(`${numberToString(outline[4])} ${numberToString(outline[5])} m`); + for (let i = 6, ii = outline.length; i < ii; i += 6) { + if (isNaN(outline[i])) { + appearanceBuffer.push(`${numberToString(outline[i + 4])} ${numberToString(outline[i + 5])} l`); + } else { + const [c1x, c1y, c2x, c2y, x, y] = outline.slice(i, i + 6); + appearanceBuffer.push([c1x, c1y, c2x, c2y, x, y].map(numberToString).join(" ") + " c"); + } + } + appearanceBuffer.push("h f"); + const appearance = appearanceBuffer.join("\n"); + const appearanceStreamDict = new Dict(xref); + appearanceStreamDict.set("FormType", 1); + appearanceStreamDict.set("Subtype", Name.get("Form")); + appearanceStreamDict.set("Type", Name.get("XObject")); + appearanceStreamDict.set("BBox", rect); + appearanceStreamDict.set("Length", appearance.length); + const resources = new Dict(xref); + const extGState = new Dict(xref); + resources.set("ExtGState", extGState); + appearanceStreamDict.set("Resources", resources); + const r0 = new Dict(xref); + extGState.set("R0", r0); + r0.set("BM", Name.get("Multiply")); + if (opacity !== 1) { + r0.set("ca", opacity); + r0.set("Type", Name.get("ExtGState")); + } + const ap = new StringStream(appearance); + ap.dict = appearanceStreamDict; + return ap; + } +} +class HighlightAnnotation extends MarkupAnnotation { + constructor(params) { + super(params); + const { + dict, + xref + } = params; + this.data.annotationType = AnnotationType.HIGHLIGHT; + this.data.isEditable = !this.data.noHTML; + this.data.noHTML = false; + this.data.opacity = dict.get("CA") || 1; + const quadPoints = this.data.quadPoints = getQuadPoints(dict, null); + if (quadPoints) { + const resources = this.appearance?.dict.get("Resources"); + if (!this.appearance || !resources?.has("ExtGState")) { + if (this.appearance) { + warn("HighlightAnnotation - ignoring built-in appearance stream."); + } + const fillColor = this.color ? getPdfColorArray(this.color) : [1, 1, 0]; + const fillAlpha = dict.get("CA"); + this._setDefaultAppearance({ + xref, + fillColor, + blendMode: "Multiply", + fillAlpha, + pointsCallback: (buffer, points) => { + buffer.push(`${points[0]} ${points[1]} m`, `${points[2]} ${points[3]} l`, `${points[6]} ${points[7]} l`, `${points[4]} ${points[5]} l`, "f"); + return [points[0], points[2], points[7], points[3]]; + } + }); + } + } else { + this.data.popupRef = null; + } + } + static createNewDict(annotation, xref, { + apRef, + ap + }) { + const { + color, + oldAnnotation, + opacity, + rect, + rotation, + user, + quadPoints + } = annotation; + const highlight = oldAnnotation || new Dict(xref); + highlight.set("Type", Name.get("Annot")); + highlight.set("Subtype", Name.get("Highlight")); + highlight.set(oldAnnotation ? "M" : "CreationDate", `D:${getModificationDate()}`); + highlight.set("CreationDate", `D:${getModificationDate()}`); + highlight.set("Rect", rect); + highlight.set("F", 4); + highlight.set("Border", [0, 0, 0]); + highlight.set("Rotate", rotation); + highlight.set("QuadPoints", quadPoints); + highlight.set("C", Array.from(color, c => c / 255)); + highlight.set("CA", opacity); + if (user) { + highlight.set("T", stringToAsciiOrUTF16BE(user)); + } + if (apRef || ap) { + const n = new Dict(xref); + highlight.set("AP", n); + n.set("N", apRef || ap); + } + return highlight; + } + static async createNewAppearanceStream(annotation, xref, params) { + const { + color, + rect, + outlines, + opacity + } = annotation; + const appearanceBuffer = [`${getPdfColor(color, true)}`, "/R0 gs"]; + const buffer = []; + for (const outline of outlines) { + buffer.length = 0; + buffer.push(`${numberToString(outline[0])} ${numberToString(outline[1])} m`); + for (let i = 2, ii = outline.length; i < ii; i += 2) { + buffer.push(`${numberToString(outline[i])} ${numberToString(outline[i + 1])} l`); + } + buffer.push("h"); + appearanceBuffer.push(buffer.join("\n")); + } + appearanceBuffer.push("f*"); + const appearance = appearanceBuffer.join("\n"); + const appearanceStreamDict = new Dict(xref); + appearanceStreamDict.set("FormType", 1); + appearanceStreamDict.set("Subtype", Name.get("Form")); + appearanceStreamDict.set("Type", Name.get("XObject")); + appearanceStreamDict.set("BBox", rect); + appearanceStreamDict.set("Length", appearance.length); + const resources = new Dict(xref); + const extGState = new Dict(xref); + resources.set("ExtGState", extGState); + appearanceStreamDict.set("Resources", resources); + const r0 = new Dict(xref); + extGState.set("R0", r0); + r0.set("BM", Name.get("Multiply")); + if (opacity !== 1) { + r0.set("ca", opacity); + r0.set("Type", Name.get("ExtGState")); + } + const ap = new StringStream(appearance); + ap.dict = appearanceStreamDict; + return ap; + } +} +class UnderlineAnnotation extends MarkupAnnotation { + constructor(params) { + super(params); + const { + dict, + xref + } = params; + this.data.annotationType = AnnotationType.UNDERLINE; + const quadPoints = this.data.quadPoints = getQuadPoints(dict, null); + if (quadPoints) { + if (!this.appearance) { + const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0]; + const strokeAlpha = dict.get("CA"); + this._setDefaultAppearance({ + xref, + extra: "[] 0 d 0.571 w", + strokeColor, + strokeAlpha, + pointsCallback: (buffer, points) => { + buffer.push(`${points[4]} ${points[5] + 1.3} m`, `${points[6]} ${points[7] + 1.3} l`, "S"); + return [points[0], points[2], points[7], points[3]]; + } + }); + } + } else { + this.data.popupRef = null; + } + } +} +class SquigglyAnnotation extends MarkupAnnotation { + constructor(params) { + super(params); + const { + dict, + xref + } = params; + this.data.annotationType = AnnotationType.SQUIGGLY; + const quadPoints = this.data.quadPoints = getQuadPoints(dict, null); + if (quadPoints) { + if (!this.appearance) { + const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0]; + const strokeAlpha = dict.get("CA"); + this._setDefaultAppearance({ + xref, + extra: "[] 0 d 1 w", + strokeColor, + strokeAlpha, + pointsCallback: (buffer, points) => { + const dy = (points[1] - points[5]) / 6; + let shift = dy; + let x = points[4]; + const y = points[5]; + const xEnd = points[6]; + buffer.push(`${x} ${y + shift} m`); + do { + x += 2; + shift = shift === 0 ? dy : 0; + buffer.push(`${x} ${y + shift} l`); + } while (x < xEnd); + buffer.push("S"); + return [points[4], xEnd, y - 2 * dy, y + 2 * dy]; + } + }); + } + } else { + this.data.popupRef = null; + } + } +} +class StrikeOutAnnotation extends MarkupAnnotation { + constructor(params) { + super(params); + const { + dict, + xref + } = params; + this.data.annotationType = AnnotationType.STRIKEOUT; + const quadPoints = this.data.quadPoints = getQuadPoints(dict, null); + if (quadPoints) { + if (!this.appearance) { + const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0]; + const strokeAlpha = dict.get("CA"); + this._setDefaultAppearance({ + xref, + extra: "[] 0 d 1 w", + strokeColor, + strokeAlpha, + pointsCallback: (buffer, points) => { + buffer.push(`${(points[0] + points[4]) / 2} ` + `${(points[1] + points[5]) / 2} m`, `${(points[2] + points[6]) / 2} ` + `${(points[3] + points[7]) / 2} l`, "S"); + return [points[0], points[2], points[7], points[3]]; + } + }); + } + } else { + this.data.popupRef = null; + } + } +} +class StampAnnotation extends MarkupAnnotation { + #savedHasOwnCanvas; + constructor(params) { + super(params); + this.data.annotationType = AnnotationType.STAMP; + this.#savedHasOwnCanvas = this.data.hasOwnCanvas = this.data.noRotate; + this.data.isEditable = !this.data.noHTML; + this.data.noHTML = false; + } + mustBeViewedWhenEditing(isEditing, modifiedIds = null) { + if (isEditing) { + if (!this.data.isEditable) { + return false; + } + this.#savedHasOwnCanvas = this.data.hasOwnCanvas; + this.data.hasOwnCanvas = true; + return true; + } + this.data.hasOwnCanvas = this.#savedHasOwnCanvas; + return !modifiedIds?.has(this.data.id); + } + static async createImage(bitmap, xref) { + const { + width, + height + } = bitmap; + const canvas = new OffscreenCanvas(width, height); + const ctx = canvas.getContext("2d", { + alpha: true + }); + ctx.drawImage(bitmap, 0, 0); + const data = ctx.getImageData(0, 0, width, height).data; + const buf32 = new Uint32Array(data.buffer); + const hasAlpha = buf32.some(FeatureTest.isLittleEndian ? x => x >>> 24 !== 0xff : x => (x & 0xff) !== 0xff); + if (hasAlpha) { + ctx.fillStyle = "white"; + ctx.fillRect(0, 0, width, height); + ctx.drawImage(bitmap, 0, 0); + } + const jpegBufferPromise = canvas.convertToBlob({ + type: "image/jpeg", + quality: 1 + }).then(blob => blob.arrayBuffer()); + const xobjectName = Name.get("XObject"); + const imageName = Name.get("Image"); + const image = new Dict(xref); + image.set("Type", xobjectName); + image.set("Subtype", imageName); + image.set("BitsPerComponent", 8); + image.set("ColorSpace", Name.get("DeviceRGB")); + image.set("Filter", Name.get("DCTDecode")); + image.set("BBox", [0, 0, width, height]); + image.set("Width", width); + image.set("Height", height); + let smaskStream = null; + if (hasAlpha) { + const alphaBuffer = new Uint8Array(buf32.length); + if (FeatureTest.isLittleEndian) { + for (let i = 0, ii = buf32.length; i < ii; i++) { + alphaBuffer[i] = buf32[i] >>> 24; + } + } else { + for (let i = 0, ii = buf32.length; i < ii; i++) { + alphaBuffer[i] = buf32[i] & 0xff; + } + } + const smask = new Dict(xref); + smask.set("Type", xobjectName); + smask.set("Subtype", imageName); + smask.set("BitsPerComponent", 8); + smask.set("ColorSpace", Name.get("DeviceGray")); + smask.set("Width", width); + smask.set("Height", height); + smaskStream = new Stream(alphaBuffer, 0, 0, smask); + } + const imageStream = new Stream(await jpegBufferPromise, 0, 0, image); + return { + imageStream, + smaskStream, + width, + height + }; + } + static createNewDict(annotation, xref, { + apRef, + ap + }) { + const { + oldAnnotation, + rect, + rotation, + user + } = annotation; + const stamp = oldAnnotation || new Dict(xref); + stamp.set("Type", Name.get("Annot")); + stamp.set("Subtype", Name.get("Stamp")); + stamp.set(oldAnnotation ? "M" : "CreationDate", `D:${getModificationDate()}`); + stamp.set("Rect", rect); + stamp.set("F", 4); + stamp.set("Border", [0, 0, 0]); + stamp.set("Rotate", rotation); + if (user) { + stamp.set("T", stringToAsciiOrUTF16BE(user)); + } + if (apRef || ap) { + const n = new Dict(xref); + stamp.set("AP", n); + if (apRef) { + n.set("N", apRef); + } else { + n.set("N", ap); + } + } + return stamp; + } + static async createNewAppearanceStream(annotation, xref, params) { + if (annotation.oldAnnotation) { + return null; + } + const { + rotation + } = annotation; + const { + imageRef, + width, + height + } = params.image; + const resources = new Dict(xref); + const xobject = new Dict(xref); + resources.set("XObject", xobject); + xobject.set("Im0", imageRef); + const appearance = `q ${width} 0 0 ${height} 0 0 cm /Im0 Do Q`; + const appearanceStreamDict = new Dict(xref); + appearanceStreamDict.set("FormType", 1); + appearanceStreamDict.set("Subtype", Name.get("Form")); + appearanceStreamDict.set("Type", Name.get("XObject")); + appearanceStreamDict.set("BBox", [0, 0, width, height]); + appearanceStreamDict.set("Resources", resources); + if (rotation) { + const matrix = getRotationMatrix(rotation, width, height); + appearanceStreamDict.set("Matrix", matrix); + } + const ap = new StringStream(appearance); + ap.dict = appearanceStreamDict; + return ap; + } +} +class FileAttachmentAnnotation extends MarkupAnnotation { + constructor(params) { + super(params); + const { + dict, + xref + } = params; + const file = new FileSpec(dict.get("FS"), xref); + this.data.annotationType = AnnotationType.FILEATTACHMENT; + this.data.hasOwnCanvas = this.data.noRotate; + this.data.noHTML = false; + this.data.file = file.serializable; + const name = dict.get("Name"); + this.data.name = name instanceof Name ? stringToPDFString(name.name) : "PushPin"; + const fillAlpha = dict.get("ca"); + this.data.fillAlpha = typeof fillAlpha === "number" && fillAlpha >= 0 && fillAlpha <= 1 ? fillAlpha : null; + } +} + +;// ./src/core/decrypt_stream.js + +const chunkSize = 512; +class DecryptStream extends DecodeStream { + constructor(str, maybeLength, decrypt) { + super(maybeLength); + this.str = str; + this.dict = str.dict; + this.decrypt = decrypt; + this.nextChunk = null; + this.initialized = false; + } + readBlock() { + let chunk; + if (this.initialized) { + chunk = this.nextChunk; + } else { + chunk = this.str.getBytes(chunkSize); + this.initialized = true; + } + if (!chunk?.length) { + this.eof = true; + return; + } + this.nextChunk = this.str.getBytes(chunkSize); + const hasMoreData = this.nextChunk?.length > 0; + const decrypt = this.decrypt; + chunk = decrypt(chunk, !hasMoreData); + const bufferLength = this.bufferLength, + newLength = bufferLength + chunk.length, + buffer = this.ensureBuffer(newLength); + buffer.set(chunk, bufferLength); + this.bufferLength = newLength; + } +} + +;// ./src/core/crypto.js + + + +class ARCFourCipher { + constructor(key) { + this.a = 0; + this.b = 0; + const s = new Uint8Array(256); + const keyLength = key.length; + for (let i = 0; i < 256; ++i) { + s[i] = i; + } + for (let i = 0, j = 0; i < 256; ++i) { + const tmp = s[i]; + j = j + tmp + key[i % keyLength] & 0xff; + s[i] = s[j]; + s[j] = tmp; + } + this.s = s; + } + encryptBlock(data) { + let a = this.a, + b = this.b; + const s = this.s; + const n = data.length; + const output = new Uint8Array(n); + for (let i = 0; i < n; ++i) { + a = a + 1 & 0xff; + const tmp = s[a]; + b = b + tmp & 0xff; + const tmp2 = s[b]; + s[a] = tmp2; + s[b] = tmp; + output[i] = data[i] ^ s[tmp + tmp2 & 0xff]; + } + this.a = a; + this.b = b; + return output; + } + decryptBlock(data) { + return this.encryptBlock(data); + } + encrypt(data) { + return this.encryptBlock(data); + } +} +const calculateMD5 = function calculateMD5Closure() { + const r = new Uint8Array([7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21]); + const k = new Int32Array([-680876936, -389564586, 606105819, -1044525330, -176418897, 1200080426, -1473231341, -45705983, 1770035416, -1958414417, -42063, -1990404162, 1804603682, -40341101, -1502002290, 1236535329, -165796510, -1069501632, 643717713, -373897302, -701558691, 38016083, -660478335, -405537848, 568446438, -1019803690, -187363961, 1163531501, -1444681467, -51403784, 1735328473, -1926607734, -378558, -2022574463, 1839030562, -35309556, -1530992060, 1272893353, -155497632, -1094730640, 681279174, -358537222, -722521979, 76029189, -640364487, -421815835, 530742520, -995338651, -198630844, 1126891415, -1416354905, -57434055, 1700485571, -1894986606, -1051523, -2054922799, 1873313359, -30611744, -1560198380, 1309151649, -145523070, -1120210379, 718787259, -343485551]); + function hash(data, offset, length) { + let h0 = 1732584193, + h1 = -271733879, + h2 = -1732584194, + h3 = 271733878; + const paddedLength = length + 72 & ~63; + const padded = new Uint8Array(paddedLength); + let i, j; + for (i = 0; i < length; ++i) { + padded[i] = data[offset++]; + } + padded[i++] = 0x80; + const n = paddedLength - 8; + while (i < n) { + padded[i++] = 0; + } + padded[i++] = length << 3 & 0xff; + padded[i++] = length >> 5 & 0xff; + padded[i++] = length >> 13 & 0xff; + padded[i++] = length >> 21 & 0xff; + padded[i++] = length >>> 29 & 0xff; + padded[i++] = 0; + padded[i++] = 0; + padded[i++] = 0; + const w = new Int32Array(16); + for (i = 0; i < paddedLength;) { + for (j = 0; j < 16; ++j, i += 4) { + w[j] = padded[i] | padded[i + 1] << 8 | padded[i + 2] << 16 | padded[i + 3] << 24; + } + let a = h0, + b = h1, + c = h2, + d = h3, + f, + g; + for (j = 0; j < 64; ++j) { + if (j < 16) { + f = b & c | ~b & d; + g = j; + } else if (j < 32) { + f = d & b | ~d & c; + g = 5 * j + 1 & 15; + } else if (j < 48) { + f = b ^ c ^ d; + g = 3 * j + 5 & 15; + } else { + f = c ^ (b | ~d); + g = 7 * j & 15; + } + const tmp = d, + rotateArg = a + f + k[j] + w[g] | 0, + rotate = r[j]; + d = c; + c = b; + b = b + (rotateArg << rotate | rotateArg >>> 32 - rotate) | 0; + a = tmp; + } + h0 = h0 + a | 0; + h1 = h1 + b | 0; + h2 = h2 + c | 0; + h3 = h3 + d | 0; + } + return new Uint8Array([h0 & 0xFF, h0 >> 8 & 0xFF, h0 >> 16 & 0xFF, h0 >>> 24 & 0xFF, h1 & 0xFF, h1 >> 8 & 0xFF, h1 >> 16 & 0xFF, h1 >>> 24 & 0xFF, h2 & 0xFF, h2 >> 8 & 0xFF, h2 >> 16 & 0xFF, h2 >>> 24 & 0xFF, h3 & 0xFF, h3 >> 8 & 0xFF, h3 >> 16 & 0xFF, h3 >>> 24 & 0xFF]); + } + return hash; +}(); +class Word64 { + constructor(highInteger, lowInteger) { + this.high = highInteger | 0; + this.low = lowInteger | 0; + } + and(word) { + this.high &= word.high; + this.low &= word.low; + } + xor(word) { + this.high ^= word.high; + this.low ^= word.low; + } + or(word) { + this.high |= word.high; + this.low |= word.low; + } + shiftRight(places) { + if (places >= 32) { + this.low = this.high >>> places - 32 | 0; + this.high = 0; + } else { + this.low = this.low >>> places | this.high << 32 - places; + this.high = this.high >>> places | 0; + } + } + shiftLeft(places) { + if (places >= 32) { + this.high = this.low << places - 32; + this.low = 0; + } else { + this.high = this.high << places | this.low >>> 32 - places; + this.low <<= places; + } + } + rotateRight(places) { + let low, high; + if (places & 32) { + high = this.low; + low = this.high; + } else { + low = this.low; + high = this.high; + } + places &= 31; + this.low = low >>> places | high << 32 - places; + this.high = high >>> places | low << 32 - places; + } + not() { + this.high = ~this.high; + this.low = ~this.low; + } + add(word) { + const lowAdd = (this.low >>> 0) + (word.low >>> 0); + let highAdd = (this.high >>> 0) + (word.high >>> 0); + if (lowAdd > 0xffffffff) { + highAdd += 1; + } + this.low = lowAdd | 0; + this.high = highAdd | 0; + } + copyTo(bytes, offset) { + bytes[offset] = this.high >>> 24 & 0xff; + bytes[offset + 1] = this.high >> 16 & 0xff; + bytes[offset + 2] = this.high >> 8 & 0xff; + bytes[offset + 3] = this.high & 0xff; + bytes[offset + 4] = this.low >>> 24 & 0xff; + bytes[offset + 5] = this.low >> 16 & 0xff; + bytes[offset + 6] = this.low >> 8 & 0xff; + bytes[offset + 7] = this.low & 0xff; + } + assign(word) { + this.high = word.high; + this.low = word.low; + } +} +const calculateSHA256 = function calculateSHA256Closure() { + function rotr(x, n) { + return x >>> n | x << 32 - n; + } + function ch(x, y, z) { + return x & y ^ ~x & z; + } + function maj(x, y, z) { + return x & y ^ x & z ^ y & z; + } + function sigma(x) { + return rotr(x, 2) ^ rotr(x, 13) ^ rotr(x, 22); + } + function sigmaPrime(x) { + return rotr(x, 6) ^ rotr(x, 11) ^ rotr(x, 25); + } + function littleSigma(x) { + return rotr(x, 7) ^ rotr(x, 18) ^ x >>> 3; + } + function littleSigmaPrime(x) { + return rotr(x, 17) ^ rotr(x, 19) ^ x >>> 10; + } + const k = [0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2]; + function hash(data, offset, length) { + let h0 = 0x6a09e667, + h1 = 0xbb67ae85, + h2 = 0x3c6ef372, + h3 = 0xa54ff53a, + h4 = 0x510e527f, + h5 = 0x9b05688c, + h6 = 0x1f83d9ab, + h7 = 0x5be0cd19; + const paddedLength = Math.ceil((length + 9) / 64) * 64; + const padded = new Uint8Array(paddedLength); + let i, j; + for (i = 0; i < length; ++i) { + padded[i] = data[offset++]; + } + padded[i++] = 0x80; + const n = paddedLength - 8; + while (i < n) { + padded[i++] = 0; + } + padded[i++] = 0; + padded[i++] = 0; + padded[i++] = 0; + padded[i++] = length >>> 29 & 0xff; + padded[i++] = length >> 21 & 0xff; + padded[i++] = length >> 13 & 0xff; + padded[i++] = length >> 5 & 0xff; + padded[i++] = length << 3 & 0xff; + const w = new Uint32Array(64); + for (i = 0; i < paddedLength;) { + for (j = 0; j < 16; ++j) { + w[j] = padded[i] << 24 | padded[i + 1] << 16 | padded[i + 2] << 8 | padded[i + 3]; + i += 4; + } + for (j = 16; j < 64; ++j) { + w[j] = littleSigmaPrime(w[j - 2]) + w[j - 7] + littleSigma(w[j - 15]) + w[j - 16] | 0; + } + let a = h0, + b = h1, + c = h2, + d = h3, + e = h4, + f = h5, + g = h6, + h = h7, + t1, + t2; + for (j = 0; j < 64; ++j) { + t1 = h + sigmaPrime(e) + ch(e, f, g) + k[j] + w[j]; + t2 = sigma(a) + maj(a, b, c); + h = g; + g = f; + f = e; + e = d + t1 | 0; + d = c; + c = b; + b = a; + a = t1 + t2 | 0; + } + h0 = h0 + a | 0; + h1 = h1 + b | 0; + h2 = h2 + c | 0; + h3 = h3 + d | 0; + h4 = h4 + e | 0; + h5 = h5 + f | 0; + h6 = h6 + g | 0; + h7 = h7 + h | 0; + } + return new Uint8Array([h0 >> 24 & 0xFF, h0 >> 16 & 0xFF, h0 >> 8 & 0xFF, h0 & 0xFF, h1 >> 24 & 0xFF, h1 >> 16 & 0xFF, h1 >> 8 & 0xFF, h1 & 0xFF, h2 >> 24 & 0xFF, h2 >> 16 & 0xFF, h2 >> 8 & 0xFF, h2 & 0xFF, h3 >> 24 & 0xFF, h3 >> 16 & 0xFF, h3 >> 8 & 0xFF, h3 & 0xFF, h4 >> 24 & 0xFF, h4 >> 16 & 0xFF, h4 >> 8 & 0xFF, h4 & 0xFF, h5 >> 24 & 0xFF, h5 >> 16 & 0xFF, h5 >> 8 & 0xFF, h5 & 0xFF, h6 >> 24 & 0xFF, h6 >> 16 & 0xFF, h6 >> 8 & 0xFF, h6 & 0xFF, h7 >> 24 & 0xFF, h7 >> 16 & 0xFF, h7 >> 8 & 0xFF, h7 & 0xFF]); + } + return hash; +}(); +const calculateSHA512 = function calculateSHA512Closure() { + function ch(result, x, y, z, tmp) { + result.assign(x); + result.and(y); + tmp.assign(x); + tmp.not(); + tmp.and(z); + result.xor(tmp); + } + function maj(result, x, y, z, tmp) { + result.assign(x); + result.and(y); + tmp.assign(x); + tmp.and(z); + result.xor(tmp); + tmp.assign(y); + tmp.and(z); + result.xor(tmp); + } + function sigma(result, x, tmp) { + result.assign(x); + result.rotateRight(28); + tmp.assign(x); + tmp.rotateRight(34); + result.xor(tmp); + tmp.assign(x); + tmp.rotateRight(39); + result.xor(tmp); + } + function sigmaPrime(result, x, tmp) { + result.assign(x); + result.rotateRight(14); + tmp.assign(x); + tmp.rotateRight(18); + result.xor(tmp); + tmp.assign(x); + tmp.rotateRight(41); + result.xor(tmp); + } + function littleSigma(result, x, tmp) { + result.assign(x); + result.rotateRight(1); + tmp.assign(x); + tmp.rotateRight(8); + result.xor(tmp); + tmp.assign(x); + tmp.shiftRight(7); + result.xor(tmp); + } + function littleSigmaPrime(result, x, tmp) { + result.assign(x); + result.rotateRight(19); + tmp.assign(x); + tmp.rotateRight(61); + result.xor(tmp); + tmp.assign(x); + tmp.shiftRight(6); + result.xor(tmp); + } + const k = [new Word64(0x428a2f98, 0xd728ae22), new Word64(0x71374491, 0x23ef65cd), new Word64(0xb5c0fbcf, 0xec4d3b2f), new Word64(0xe9b5dba5, 0x8189dbbc), new Word64(0x3956c25b, 0xf348b538), new Word64(0x59f111f1, 0xb605d019), new Word64(0x923f82a4, 0xaf194f9b), new Word64(0xab1c5ed5, 0xda6d8118), new Word64(0xd807aa98, 0xa3030242), new Word64(0x12835b01, 0x45706fbe), new Word64(0x243185be, 0x4ee4b28c), new Word64(0x550c7dc3, 0xd5ffb4e2), new Word64(0x72be5d74, 0xf27b896f), new Word64(0x80deb1fe, 0x3b1696b1), new Word64(0x9bdc06a7, 0x25c71235), new Word64(0xc19bf174, 0xcf692694), new Word64(0xe49b69c1, 0x9ef14ad2), new Word64(0xefbe4786, 0x384f25e3), new Word64(0x0fc19dc6, 0x8b8cd5b5), new Word64(0x240ca1cc, 0x77ac9c65), new Word64(0x2de92c6f, 0x592b0275), new Word64(0x4a7484aa, 0x6ea6e483), new Word64(0x5cb0a9dc, 0xbd41fbd4), new Word64(0x76f988da, 0x831153b5), new Word64(0x983e5152, 0xee66dfab), new Word64(0xa831c66d, 0x2db43210), new Word64(0xb00327c8, 0x98fb213f), new Word64(0xbf597fc7, 0xbeef0ee4), new Word64(0xc6e00bf3, 0x3da88fc2), new Word64(0xd5a79147, 0x930aa725), new Word64(0x06ca6351, 0xe003826f), new Word64(0x14292967, 0x0a0e6e70), new Word64(0x27b70a85, 0x46d22ffc), new Word64(0x2e1b2138, 0x5c26c926), new Word64(0x4d2c6dfc, 0x5ac42aed), new Word64(0x53380d13, 0x9d95b3df), new Word64(0x650a7354, 0x8baf63de), new Word64(0x766a0abb, 0x3c77b2a8), new Word64(0x81c2c92e, 0x47edaee6), new Word64(0x92722c85, 0x1482353b), new Word64(0xa2bfe8a1, 0x4cf10364), new Word64(0xa81a664b, 0xbc423001), new Word64(0xc24b8b70, 0xd0f89791), new Word64(0xc76c51a3, 0x0654be30), new Word64(0xd192e819, 0xd6ef5218), new Word64(0xd6990624, 0x5565a910), new Word64(0xf40e3585, 0x5771202a), new Word64(0x106aa070, 0x32bbd1b8), new Word64(0x19a4c116, 0xb8d2d0c8), new Word64(0x1e376c08, 0x5141ab53), new Word64(0x2748774c, 0xdf8eeb99), new Word64(0x34b0bcb5, 0xe19b48a8), new Word64(0x391c0cb3, 0xc5c95a63), new Word64(0x4ed8aa4a, 0xe3418acb), new Word64(0x5b9cca4f, 0x7763e373), new Word64(0x682e6ff3, 0xd6b2b8a3), new Word64(0x748f82ee, 0x5defb2fc), new Word64(0x78a5636f, 0x43172f60), new Word64(0x84c87814, 0xa1f0ab72), new Word64(0x8cc70208, 0x1a6439ec), new Word64(0x90befffa, 0x23631e28), new Word64(0xa4506ceb, 0xde82bde9), new Word64(0xbef9a3f7, 0xb2c67915), new Word64(0xc67178f2, 0xe372532b), new Word64(0xca273ece, 0xea26619c), new Word64(0xd186b8c7, 0x21c0c207), new Word64(0xeada7dd6, 0xcde0eb1e), new Word64(0xf57d4f7f, 0xee6ed178), new Word64(0x06f067aa, 0x72176fba), new Word64(0x0a637dc5, 0xa2c898a6), new Word64(0x113f9804, 0xbef90dae), new Word64(0x1b710b35, 0x131c471b), new Word64(0x28db77f5, 0x23047d84), new Word64(0x32caab7b, 0x40c72493), new Word64(0x3c9ebe0a, 0x15c9bebc), new Word64(0x431d67c4, 0x9c100d4c), new Word64(0x4cc5d4be, 0xcb3e42b6), new Word64(0x597f299c, 0xfc657e2a), new Word64(0x5fcb6fab, 0x3ad6faec), new Word64(0x6c44198c, 0x4a475817)]; + function hash(data, offset, length, mode384 = false) { + let h0, h1, h2, h3, h4, h5, h6, h7; + if (!mode384) { + h0 = new Word64(0x6a09e667, 0xf3bcc908); + h1 = new Word64(0xbb67ae85, 0x84caa73b); + h2 = new Word64(0x3c6ef372, 0xfe94f82b); + h3 = new Word64(0xa54ff53a, 0x5f1d36f1); + h4 = new Word64(0x510e527f, 0xade682d1); + h5 = new Word64(0x9b05688c, 0x2b3e6c1f); + h6 = new Word64(0x1f83d9ab, 0xfb41bd6b); + h7 = new Word64(0x5be0cd19, 0x137e2179); + } else { + h0 = new Word64(0xcbbb9d5d, 0xc1059ed8); + h1 = new Word64(0x629a292a, 0x367cd507); + h2 = new Word64(0x9159015a, 0x3070dd17); + h3 = new Word64(0x152fecd8, 0xf70e5939); + h4 = new Word64(0x67332667, 0xffc00b31); + h5 = new Word64(0x8eb44a87, 0x68581511); + h6 = new Word64(0xdb0c2e0d, 0x64f98fa7); + h7 = new Word64(0x47b5481d, 0xbefa4fa4); + } + const paddedLength = Math.ceil((length + 17) / 128) * 128; + const padded = new Uint8Array(paddedLength); + let i, j; + for (i = 0; i < length; ++i) { + padded[i] = data[offset++]; + } + padded[i++] = 0x80; + const n = paddedLength - 16; + while (i < n) { + padded[i++] = 0; + } + padded[i++] = 0; + padded[i++] = 0; + padded[i++] = 0; + padded[i++] = 0; + padded[i++] = 0; + padded[i++] = 0; + padded[i++] = 0; + padded[i++] = 0; + padded[i++] = 0; + padded[i++] = 0; + padded[i++] = 0; + padded[i++] = length >>> 29 & 0xff; + padded[i++] = length >> 21 & 0xff; + padded[i++] = length >> 13 & 0xff; + padded[i++] = length >> 5 & 0xff; + padded[i++] = length << 3 & 0xff; + const w = new Array(80); + for (i = 0; i < 80; i++) { + w[i] = new Word64(0, 0); + } + let a = new Word64(0, 0), + b = new Word64(0, 0), + c = new Word64(0, 0); + let d = new Word64(0, 0), + e = new Word64(0, 0), + f = new Word64(0, 0); + let g = new Word64(0, 0), + h = new Word64(0, 0); + const t1 = new Word64(0, 0), + t2 = new Word64(0, 0); + const tmp1 = new Word64(0, 0), + tmp2 = new Word64(0, 0); + let tmp3; + for (i = 0; i < paddedLength;) { + for (j = 0; j < 16; ++j) { + w[j].high = padded[i] << 24 | padded[i + 1] << 16 | padded[i + 2] << 8 | padded[i + 3]; + w[j].low = padded[i + 4] << 24 | padded[i + 5] << 16 | padded[i + 6] << 8 | padded[i + 7]; + i += 8; + } + for (j = 16; j < 80; ++j) { + tmp3 = w[j]; + littleSigmaPrime(tmp3, w[j - 2], tmp2); + tmp3.add(w[j - 7]); + littleSigma(tmp1, w[j - 15], tmp2); + tmp3.add(tmp1); + tmp3.add(w[j - 16]); + } + a.assign(h0); + b.assign(h1); + c.assign(h2); + d.assign(h3); + e.assign(h4); + f.assign(h5); + g.assign(h6); + h.assign(h7); + for (j = 0; j < 80; ++j) { + t1.assign(h); + sigmaPrime(tmp1, e, tmp2); + t1.add(tmp1); + ch(tmp1, e, f, g, tmp2); + t1.add(tmp1); + t1.add(k[j]); + t1.add(w[j]); + sigma(t2, a, tmp2); + maj(tmp1, a, b, c, tmp2); + t2.add(tmp1); + tmp3 = h; + h = g; + g = f; + f = e; + d.add(t1); + e = d; + d = c; + c = b; + b = a; + tmp3.assign(t1); + tmp3.add(t2); + a = tmp3; + } + h0.add(a); + h1.add(b); + h2.add(c); + h3.add(d); + h4.add(e); + h5.add(f); + h6.add(g); + h7.add(h); + } + let result; + if (!mode384) { + result = new Uint8Array(64); + h0.copyTo(result, 0); + h1.copyTo(result, 8); + h2.copyTo(result, 16); + h3.copyTo(result, 24); + h4.copyTo(result, 32); + h5.copyTo(result, 40); + h6.copyTo(result, 48); + h7.copyTo(result, 56); + } else { + result = new Uint8Array(48); + h0.copyTo(result, 0); + h1.copyTo(result, 8); + h2.copyTo(result, 16); + h3.copyTo(result, 24); + h4.copyTo(result, 32); + h5.copyTo(result, 40); + } + return result; + } + return hash; +}(); +function calculateSHA384(data, offset, length) { + return calculateSHA512(data, offset, length, true); +} +class NullCipher { + decryptBlock(data) { + return data; + } + encrypt(data) { + return data; + } +} +class AESBaseCipher { + constructor() { + this._s = new Uint8Array([0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x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 0x3f, 0x0f, 0x02, 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b, 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73, 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e, 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b, 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4, 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f, 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d]); + this._mix = new Uint32Array([0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927, 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45, 0x486c5c74, 0x4665517f, 0x547e4662, 0x5a774b69, 0xe090d0b0, 0xee99ddbb, 0xfc82caa6, 0xf28bc7ad, 0xd8b4e49c, 0xd6bde997, 0xc4a6fe8a, 0xcaaff381, 0x90d8b8e8, 0x9ed1b5e3, 0x8ccaa2fe, 0x82c3aff5, 0xa8fc8cc4, 0xa6f581cf, 0xb4ee96d2, 0xbae79bd9, 0xdb3bbb7b, 0xd532b670, 0xc729a16d, 0xc920ac66, 0xe31f8f57, 0xed16825c, 0xff0d9541, 0xf104984a, 0xab73d323, 0xa57ade28, 0xb761c935, 0xb968c43e, 0x9357e70f, 0x9d5eea04, 0x8f45fd19, 0x814cf012, 0x3bab6bcb, 0x35a266c0, 0x27b971dd, 0x29b07cd6, 0x038f5fe7, 0x0d8652ec, 0x1f9d45f1, 0x119448fa, 0x4be30393, 0x45ea0e98, 0x57f11985, 0x59f8148e, 0x73c737bf, 0x7dce3ab4, 0x6fd52da9, 0x61dc20a2, 0xad766df6, 0xa37f60fd, 0xb16477e0, 0xbf6d7aeb, 0x955259da, 0x9b5b54d1, 0x894043cc, 0x87494ec7, 0xdd3e05ae, 0xd33708a5, 0xc12c1fb8, 0xcf2512b3, 0xe51a3182, 0xeb133c89, 0xf9082b94, 0xf701269f, 0x4de6bd46, 0x43efb04d, 0x51f4a750, 0x5ffdaa5b, 0x75c2896a, 0x7bcb8461, 0x69d0937c, 0x67d99e77, 0x3daed51e, 0x33a7d815, 0x21bccf08, 0x2fb5c203, 0x058ae132, 0x0b83ec39, 0x1998fb24, 0x1791f62f, 0x764dd68d, 0x7844db86, 0x6a5fcc9b, 0x6456c190, 0x4e69e2a1, 0x4060efaa, 0x527bf8b7, 0x5c72f5bc, 0x0605bed5, 0x080cb3de, 0x1a17a4c3, 0x141ea9c8, 0x3e218af9, 0x302887f2, 0x223390ef, 0x2c3a9de4, 0x96dd063d, 0x98d40b36, 0x8acf1c2b, 0x84c61120, 0xaef93211, 0xa0f03f1a, 0xb2eb2807, 0xbce2250c, 0xe6956e65, 0xe89c636e, 0xfa877473, 0xf48e7978, 0xdeb15a49, 0xd0b85742, 0xc2a3405f, 0xccaa4d54, 0x41ecdaf7, 0x4fe5d7fc, 0x5dfec0e1, 0x53f7cdea, 0x79c8eedb, 0x77c1e3d0, 0x65daf4cd, 0x6bd3f9c6, 0x31a4b2af, 0x3fadbfa4, 0x2db6a8b9, 0x23bfa5b2, 0x09808683, 0x07898b88, 0x15929c95, 0x1b9b919e, 0xa17c0a47, 0xaf75074c, 0xbd6e1051, 0xb3671d5a, 0x99583e6b, 0x97513360, 0x854a247d, 0x8b432976, 0xd134621f, 0xdf3d6f14, 0xcd267809, 0xc32f7502, 0xe9105633, 0xe7195b38, 0xf5024c25, 0xfb0b412e, 0x9ad7618c, 0x94de6c87, 0x86c57b9a, 0x88cc7691, 0xa2f355a0, 0xacfa58ab, 0xbee14fb6, 0xb0e842bd, 0xea9f09d4, 0xe49604df, 0xf68d13c2, 0xf8841ec9, 0xd2bb3df8, 0xdcb230f3, 0xcea927ee, 0xc0a02ae5, 0x7a47b13c, 0x744ebc37, 0x6655ab2a, 0x685ca621, 0x42638510, 0x4c6a881b, 0x5e719f06, 0x5078920d, 0x0a0fd964, 0x0406d46f, 0x161dc372, 0x1814ce79, 0x322bed48, 0x3c22e043, 0x2e39f75e, 0x2030fa55, 0xec9ab701, 0xe293ba0a, 0xf088ad17, 0xfe81a01c, 0xd4be832d, 0xdab78e26, 0xc8ac993b, 0xc6a59430, 0x9cd2df59, 0x92dbd252, 0x80c0c54f, 0x8ec9c844, 0xa4f6eb75, 0xaaffe67e, 0xb8e4f163, 0xb6edfc68, 0x0c0a67b1, 0x02036aba, 0x10187da7, 0x1e1170ac, 0x342e539d, 0x3a275e96, 0x283c498b, 0x26354480, 0x7c420fe9, 0x724b02e2, 0x605015ff, 0x6e5918f4, 0x44663bc5, 0x4a6f36ce, 0x587421d3, 0x567d2cd8, 0x37a10c7a, 0x39a80171, 0x2bb3166c, 0x25ba1b67, 0x0f853856, 0x018c355d, 0x13972240, 0x1d9e2f4b, 0x47e96422, 0x49e06929, 0x5bfb7e34, 0x55f2733f, 0x7fcd500e, 0x71c45d05, 0x63df4a18, 0x6dd64713, 0xd731dcca, 0xd938d1c1, 0xcb23c6dc, 0xc52acbd7, 0xef15e8e6, 0xe11ce5ed, 0xf307f2f0, 0xfd0efffb, 0xa779b492, 0xa970b999, 0xbb6bae84, 0xb562a38f, 0x9f5d80be, 0x91548db5, 0x834f9aa8, 0x8d4697a3]); + this._mixCol = new Uint8Array(256); + for (let i = 0; i < 256; i++) { + this._mixCol[i] = i < 128 ? i << 1 : i << 1 ^ 0x1b; + } + this.buffer = new Uint8Array(16); + this.bufferPosition = 0; + } + _expandKey(cipherKey) { + unreachable("Cannot call `_expandKey` on the base class"); + } + _decrypt(input, key) { + let t, u, v; + const state = new Uint8Array(16); + state.set(input); + for (let j = 0, k = this._keySize; j < 16; ++j, ++k) { + state[j] ^= key[k]; + } + for (let i = this._cyclesOfRepetition - 1; i >= 1; --i) { + t = state[13]; + state[13] = state[9]; + state[9] = state[5]; + state[5] = state[1]; + state[1] = t; + t = state[14]; + u = state[10]; + state[14] = state[6]; + state[10] = state[2]; + state[6] = t; + state[2] = u; + t = state[15]; + u = state[11]; + v = state[7]; + state[15] = state[3]; + state[11] = t; + state[7] = u; + state[3] = v; + for (let j = 0; j < 16; ++j) { + state[j] = this._inv_s[state[j]]; + } + for (let j = 0, k = i * 16; j < 16; ++j, ++k) { + state[j] ^= key[k]; + } + for (let j = 0; j < 16; j += 4) { + const s0 = this._mix[state[j]]; + const s1 = this._mix[state[j + 1]]; + const s2 = this._mix[state[j + 2]]; + const s3 = this._mix[state[j + 3]]; + t = s0 ^ s1 >>> 8 ^ s1 << 24 ^ s2 >>> 16 ^ s2 << 16 ^ s3 >>> 24 ^ s3 << 8; + state[j] = t >>> 24 & 0xff; + state[j + 1] = t >> 16 & 0xff; + state[j + 2] = t >> 8 & 0xff; + state[j + 3] = t & 0xff; + } + } + t = state[13]; + state[13] = state[9]; + state[9] = state[5]; + state[5] = state[1]; + state[1] = t; + t = state[14]; + u = state[10]; + state[14] = state[6]; + state[10] = state[2]; + state[6] = t; + state[2] = u; + t = state[15]; + u = state[11]; + v = state[7]; + state[15] = state[3]; + state[11] = t; + state[7] = u; + state[3] = v; + for (let j = 0; j < 16; ++j) { + state[j] = this._inv_s[state[j]]; + state[j] ^= key[j]; + } + return state; + } + _encrypt(input, key) { + const s = this._s; + let t, u, v; + const state = new Uint8Array(16); + state.set(input); + for (let j = 0; j < 16; ++j) { + state[j] ^= key[j]; + } + for (let i = 1; i < this._cyclesOfRepetition; i++) { + for (let j = 0; j < 16; ++j) { + state[j] = s[state[j]]; + } + v = state[1]; + state[1] = state[5]; + state[5] = state[9]; + state[9] = state[13]; + state[13] = v; + v = state[2]; + u = state[6]; + state[2] = state[10]; + state[6] = state[14]; + state[10] = v; + state[14] = u; + v = state[3]; + u = state[7]; + t = state[11]; + state[3] = state[15]; + state[7] = v; + state[11] = u; + state[15] = t; + for (let j = 0; j < 16; j += 4) { + const s0 = state[j + 0]; + const s1 = state[j + 1]; + const s2 = state[j + 2]; + const s3 = state[j + 3]; + t = s0 ^ s1 ^ s2 ^ s3; + state[j + 0] ^= t ^ this._mixCol[s0 ^ s1]; + state[j + 1] ^= t ^ this._mixCol[s1 ^ s2]; + state[j + 2] ^= t ^ this._mixCol[s2 ^ s3]; + state[j + 3] ^= t ^ this._mixCol[s3 ^ s0]; + } + for (let j = 0, k = i * 16; j < 16; ++j, ++k) { + state[j] ^= key[k]; + } + } + for (let j = 0; j < 16; ++j) { + state[j] = s[state[j]]; + } + v = state[1]; + state[1] = state[5]; + state[5] = state[9]; + state[9] = state[13]; + state[13] = v; + v = state[2]; + u = state[6]; + state[2] = state[10]; + state[6] = state[14]; + state[10] = v; + state[14] = u; + v = state[3]; + u = state[7]; + t = state[11]; + state[3] = state[15]; + state[7] = v; + state[11] = u; + state[15] = t; + for (let j = 0, k = this._keySize; j < 16; ++j, ++k) { + state[j] ^= key[k]; + } + return state; + } + _decryptBlock2(data, finalize) { + const sourceLength = data.length; + let buffer = this.buffer, + bufferLength = this.bufferPosition; + const result = []; + let iv = this.iv; + for (let i = 0; i < sourceLength; ++i) { + buffer[bufferLength] = data[i]; + ++bufferLength; + if (bufferLength < 16) { + continue; + } + const plain = this._decrypt(buffer, this._key); + for (let j = 0; j < 16; ++j) { + plain[j] ^= iv[j]; + } + iv = buffer; + result.push(plain); + buffer = new Uint8Array(16); + bufferLength = 0; + } + this.buffer = buffer; + this.bufferLength = bufferLength; + this.iv = iv; + if (result.length === 0) { + return new Uint8Array(0); + } + let outputLength = 16 * result.length; + if (finalize) { + const lastBlock = result.at(-1); + let psLen = lastBlock[15]; + if (psLen <= 16) { + for (let i = 15, ii = 16 - psLen; i >= ii; --i) { + if (lastBlock[i] !== psLen) { + psLen = 0; + break; + } + } + outputLength -= psLen; + result[result.length - 1] = lastBlock.subarray(0, 16 - psLen); + } + } + const output = new Uint8Array(outputLength); + for (let i = 0, j = 0, ii = result.length; i < ii; ++i, j += 16) { + output.set(result[i], j); + } + return output; + } + decryptBlock(data, finalize, iv = null) { + const sourceLength = data.length; + const buffer = this.buffer; + let bufferLength = this.bufferPosition; + if (iv) { + this.iv = iv; + } else { + for (let i = 0; bufferLength < 16 && i < sourceLength; ++i, ++bufferLength) { + buffer[bufferLength] = data[i]; + } + if (bufferLength < 16) { + this.bufferLength = bufferLength; + return new Uint8Array(0); + } + this.iv = buffer; + data = data.subarray(16); + } + this.buffer = new Uint8Array(16); + this.bufferLength = 0; + this.decryptBlock = this._decryptBlock2; + return this.decryptBlock(data, finalize); + } + encrypt(data, iv) { + const sourceLength = data.length; + let buffer = this.buffer, + bufferLength = this.bufferPosition; + const result = []; + if (!iv) { + iv = new Uint8Array(16); + } + for (let i = 0; i < sourceLength; ++i) { + buffer[bufferLength] = data[i]; + ++bufferLength; + if (bufferLength < 16) { + continue; + } + for (let j = 0; j < 16; ++j) { + buffer[j] ^= iv[j]; + } + const cipher = this._encrypt(buffer, this._key); + iv = cipher; + result.push(cipher); + buffer = new Uint8Array(16); + bufferLength = 0; + } + this.buffer = buffer; + this.bufferLength = bufferLength; + this.iv = iv; + if (result.length === 0) { + return new Uint8Array(0); + } + const outputLength = 16 * result.length; + const output = new Uint8Array(outputLength); + for (let i = 0, j = 0, ii = result.length; i < ii; ++i, j += 16) { + output.set(result[i], j); + } + return output; + } +} +class AES128Cipher extends AESBaseCipher { + constructor(key) { + super(); + this._cyclesOfRepetition = 10; + this._keySize = 160; + this._rcon = new Uint8Array([0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d]); + this._key = this._expandKey(key); + } + _expandKey(cipherKey) { + const b = 176; + const s = this._s; + const rcon = this._rcon; + const result = new Uint8Array(b); + result.set(cipherKey); + for (let j = 16, i = 1; j < b; ++i) { + let t1 = result[j - 3]; + let t2 = result[j - 2]; + let t3 = result[j - 1]; + let t4 = result[j - 4]; + t1 = s[t1]; + t2 = s[t2]; + t3 = s[t3]; + t4 = s[t4]; + t1 ^= rcon[i]; + for (let n = 0; n < 4; ++n) { + result[j] = t1 ^= result[j - 16]; + j++; + result[j] = t2 ^= result[j - 16]; + j++; + result[j] = t3 ^= result[j - 16]; + j++; + result[j] = t4 ^= result[j - 16]; + j++; + } + } + return result; + } +} +class AES256Cipher extends AESBaseCipher { + constructor(key) { + super(); + this._cyclesOfRepetition = 14; + this._keySize = 224; + this._key = this._expandKey(key); + } + _expandKey(cipherKey) { + const b = 240; + const s = this._s; + const result = new Uint8Array(b); + result.set(cipherKey); + let r = 1; + let t1, t2, t3, t4; + for (let j = 32, i = 1; j < b; ++i) { + if (j % 32 === 16) { + t1 = s[t1]; + t2 = s[t2]; + t3 = s[t3]; + t4 = s[t4]; + } else if (j % 32 === 0) { + t1 = result[j - 3]; + t2 = result[j - 2]; + t3 = result[j - 1]; + t4 = result[j - 4]; + t1 = s[t1]; + t2 = s[t2]; + t3 = s[t3]; + t4 = s[t4]; + t1 ^= r; + if ((r <<= 1) >= 256) { + r = (r ^ 0x1b) & 0xff; + } + } + for (let n = 0; n < 4; ++n) { + result[j] = t1 ^= result[j - 32]; + j++; + result[j] = t2 ^= result[j - 32]; + j++; + result[j] = t3 ^= result[j - 32]; + j++; + result[j] = t4 ^= result[j - 32]; + j++; + } + } + return result; + } +} +class PDF17 { + checkOwnerPassword(password, ownerValidationSalt, userBytes, ownerPassword) { + const hashData = new Uint8Array(password.length + 56); + hashData.set(password, 0); + hashData.set(ownerValidationSalt, password.length); + hashData.set(userBytes, password.length + ownerValidationSalt.length); + const result = calculateSHA256(hashData, 0, hashData.length); + return isArrayEqual(result, ownerPassword); + } + checkUserPassword(password, userValidationSalt, userPassword) { + const hashData = new Uint8Array(password.length + 8); + hashData.set(password, 0); + hashData.set(userValidationSalt, password.length); + const result = calculateSHA256(hashData, 0, hashData.length); + return isArrayEqual(result, userPassword); + } + getOwnerKey(password, ownerKeySalt, userBytes, ownerEncryption) { + const hashData = new Uint8Array(password.length + 56); + hashData.set(password, 0); + hashData.set(ownerKeySalt, password.length); + hashData.set(userBytes, password.length + ownerKeySalt.length); + const key = calculateSHA256(hashData, 0, hashData.length); + const cipher = new AES256Cipher(key); + return cipher.decryptBlock(ownerEncryption, false, new Uint8Array(16)); + } + getUserKey(password, userKeySalt, userEncryption) { + const hashData = new Uint8Array(password.length + 8); + hashData.set(password, 0); + hashData.set(userKeySalt, password.length); + const key = calculateSHA256(hashData, 0, hashData.length); + const cipher = new AES256Cipher(key); + return cipher.decryptBlock(userEncryption, false, new Uint8Array(16)); + } +} +class PDF20 { + _hash(password, input, userBytes) { + let k = calculateSHA256(input, 0, input.length).subarray(0, 32); + let e = [0]; + let i = 0; + while (i < 64 || e.at(-1) > i - 32) { + const combinedLength = password.length + k.length + userBytes.length, + combinedArray = new Uint8Array(combinedLength); + let writeOffset = 0; + combinedArray.set(password, writeOffset); + writeOffset += password.length; + combinedArray.set(k, writeOffset); + writeOffset += k.length; + combinedArray.set(userBytes, writeOffset); + const k1 = new Uint8Array(combinedLength * 64); + for (let j = 0, pos = 0; j < 64; j++, pos += combinedLength) { + k1.set(combinedArray, pos); + } + const cipher = new AES128Cipher(k.subarray(0, 16)); + e = cipher.encrypt(k1, k.subarray(16, 32)); + const remainder = e.slice(0, 16).reduce((a, b) => a + b, 0) % 3; + if (remainder === 0) { + k = calculateSHA256(e, 0, e.length); + } else if (remainder === 1) { + k = calculateSHA384(e, 0, e.length); + } else if (remainder === 2) { + k = calculateSHA512(e, 0, e.length); + } + i++; + } + return k.subarray(0, 32); + } + checkOwnerPassword(password, ownerValidationSalt, userBytes, ownerPassword) { + const hashData = new Uint8Array(password.length + 56); + hashData.set(password, 0); + hashData.set(ownerValidationSalt, password.length); + hashData.set(userBytes, password.length + ownerValidationSalt.length); + const result = this._hash(password, hashData, userBytes); + return isArrayEqual(result, ownerPassword); + } + checkUserPassword(password, userValidationSalt, userPassword) { + const hashData = new Uint8Array(password.length + 8); + hashData.set(password, 0); + hashData.set(userValidationSalt, password.length); + const result = this._hash(password, hashData, []); + return isArrayEqual(result, userPassword); + } + getOwnerKey(password, ownerKeySalt, userBytes, ownerEncryption) { + const hashData = new Uint8Array(password.length + 56); + hashData.set(password, 0); + hashData.set(ownerKeySalt, password.length); + hashData.set(userBytes, password.length + ownerKeySalt.length); + const key = this._hash(password, hashData, userBytes); + const cipher = new AES256Cipher(key); + return cipher.decryptBlock(ownerEncryption, false, new Uint8Array(16)); + } + getUserKey(password, userKeySalt, userEncryption) { + const hashData = new Uint8Array(password.length + 8); + hashData.set(password, 0); + hashData.set(userKeySalt, password.length); + const key = this._hash(password, hashData, []); + const cipher = new AES256Cipher(key); + return cipher.decryptBlock(userEncryption, false, new Uint8Array(16)); + } +} +class CipherTransform { + constructor(stringCipherConstructor, streamCipherConstructor) { + this.StringCipherConstructor = stringCipherConstructor; + this.StreamCipherConstructor = streamCipherConstructor; + } + createStream(stream, length) { + const cipher = new this.StreamCipherConstructor(); + return new DecryptStream(stream, length, function cipherTransformDecryptStream(data, finalize) { + return cipher.decryptBlock(data, finalize); + }); + } + decryptString(s) { + const cipher = new this.StringCipherConstructor(); + let data = stringToBytes(s); + data = cipher.decryptBlock(data, true); + return bytesToString(data); + } + encryptString(s) { + const cipher = new this.StringCipherConstructor(); + if (cipher instanceof AESBaseCipher) { + const strLen = s.length; + const pad = 16 - strLen % 16; + s += String.fromCharCode(pad).repeat(pad); + const iv = new Uint8Array(16); + if (typeof crypto !== "undefined") { + crypto.getRandomValues(iv); + } else { + for (let i = 0; i < 16; i++) { + iv[i] = Math.floor(256 * Math.random()); + } + } + let data = stringToBytes(s); + data = cipher.encrypt(data, iv); + const buf = new Uint8Array(16 + data.length); + buf.set(iv); + buf.set(data, 16); + return bytesToString(buf); + } + let data = stringToBytes(s); + data = cipher.encrypt(data); + return bytesToString(data); + } +} +class CipherTransformFactory { + static #defaultPasswordBytes = new Uint8Array([0x28, 0xbf, 0x4e, 0x5e, 0x4e, 0x75, 0x8a, 0x41, 0x64, 0x00, 0x4e, 0x56, 0xff, 0xfa, 0x01, 0x08, 0x2e, 0x2e, 0x00, 0xb6, 0xd0, 0x68, 0x3e, 0x80, 0x2f, 0x0c, 0xa9, 0xfe, 0x64, 0x53, 0x69, 0x7a]); + #createEncryptionKey20(revision, password, ownerPassword, ownerValidationSalt, ownerKeySalt, uBytes, userPassword, userValidationSalt, userKeySalt, ownerEncryption, userEncryption, perms) { + if (password) { + const passwordLength = Math.min(127, password.length); + password = password.subarray(0, passwordLength); + } else { + password = []; + } + const pdfAlgorithm = revision === 6 ? new PDF20() : new PDF17(); + if (pdfAlgorithm.checkUserPassword(password, userValidationSalt, userPassword)) { + return pdfAlgorithm.getUserKey(password, userKeySalt, userEncryption); + } else if (password.length && pdfAlgorithm.checkOwnerPassword(password, ownerValidationSalt, uBytes, ownerPassword)) { + return pdfAlgorithm.getOwnerKey(password, ownerKeySalt, uBytes, ownerEncryption); + } + return null; + } + #prepareKeyData(fileId, password, ownerPassword, userPassword, flags, revision, keyLength, encryptMetadata) { + const hashDataSize = 40 + ownerPassword.length + fileId.length; + const hashData = new Uint8Array(hashDataSize); + let i = 0, + j, + n; + if (password) { + n = Math.min(32, password.length); + for (; i < n; ++i) { + hashData[i] = password[i]; + } + } + j = 0; + while (i < 32) { + hashData[i++] = CipherTransformFactory.#defaultPasswordBytes[j++]; + } + for (j = 0, n = ownerPassword.length; j < n; ++j) { + hashData[i++] = ownerPassword[j]; + } + hashData[i++] = flags & 0xff; + hashData[i++] = flags >> 8 & 0xff; + hashData[i++] = flags >> 16 & 0xff; + hashData[i++] = flags >>> 24 & 0xff; + for (j = 0, n = fileId.length; j < n; ++j) { + hashData[i++] = fileId[j]; + } + if (revision >= 4 && !encryptMetadata) { + hashData[i++] = 0xff; + hashData[i++] = 0xff; + hashData[i++] = 0xff; + hashData[i++] = 0xff; + } + let hash = calculateMD5(hashData, 0, i); + const keyLengthInBytes = keyLength >> 3; + if (revision >= 3) { + for (j = 0; j < 50; ++j) { + hash = calculateMD5(hash, 0, keyLengthInBytes); + } + } + const encryptionKey = hash.subarray(0, keyLengthInBytes); + let cipher, checkData; + if (revision >= 3) { + for (i = 0; i < 32; ++i) { + hashData[i] = CipherTransformFactory.#defaultPasswordBytes[i]; + } + for (j = 0, n = fileId.length; j < n; ++j) { + hashData[i++] = fileId[j]; + } + cipher = new ARCFourCipher(encryptionKey); + checkData = cipher.encryptBlock(calculateMD5(hashData, 0, i)); + n = encryptionKey.length; + const derivedKey = new Uint8Array(n); + for (j = 1; j <= 19; ++j) { + for (let k = 0; k < n; ++k) { + derivedKey[k] = encryptionKey[k] ^ j; + } + cipher = new ARCFourCipher(derivedKey); + checkData = cipher.encryptBlock(checkData); + } + for (j = 0, n = checkData.length; j < n; ++j) { + if (userPassword[j] !== checkData[j]) { + return null; + } + } + } else { + cipher = new ARCFourCipher(encryptionKey); + checkData = cipher.encryptBlock(CipherTransformFactory.#defaultPasswordBytes); + for (j = 0, n = checkData.length; j < n; ++j) { + if (userPassword[j] !== checkData[j]) { + return null; + } + } + } + return encryptionKey; + } + #decodeUserPassword(password, ownerPassword, revision, keyLength) { + const hashData = new Uint8Array(32); + let i = 0; + const n = Math.min(32, password.length); + for (; i < n; ++i) { + hashData[i] = password[i]; + } + let j = 0; + while (i < 32) { + hashData[i++] = CipherTransformFactory.#defaultPasswordBytes[j++]; + } + let hash = calculateMD5(hashData, 0, i); + const keyLengthInBytes = keyLength >> 3; + if (revision >= 3) { + for (j = 0; j < 50; ++j) { + hash = calculateMD5(hash, 0, hash.length); + } + } + let cipher, userPassword; + if (revision >= 3) { + userPassword = ownerPassword; + const derivedKey = new Uint8Array(keyLengthInBytes); + for (j = 19; j >= 0; j--) { + for (let k = 0; k < keyLengthInBytes; ++k) { + derivedKey[k] = hash[k] ^ j; + } + cipher = new ARCFourCipher(derivedKey); + userPassword = cipher.encryptBlock(userPassword); + } + } else { + cipher = new ARCFourCipher(hash.subarray(0, keyLengthInBytes)); + userPassword = cipher.encryptBlock(ownerPassword); + } + return userPassword; + } + #buildObjectKey(num, gen, encryptionKey, isAes = false) { + const key = new Uint8Array(encryptionKey.length + 9); + const n = encryptionKey.length; + let i; + for (i = 0; i < n; ++i) { + key[i] = encryptionKey[i]; + } + key[i++] = num & 0xff; + key[i++] = num >> 8 & 0xff; + key[i++] = num >> 16 & 0xff; + key[i++] = gen & 0xff; + key[i++] = gen >> 8 & 0xff; + if (isAes) { + key[i++] = 0x73; + key[i++] = 0x41; + key[i++] = 0x6c; + key[i++] = 0x54; + } + const hash = calculateMD5(key, 0, i); + return hash.subarray(0, Math.min(encryptionKey.length + 5, 16)); + } + #buildCipherConstructor(cf, name, num, gen, key) { + if (!(name instanceof Name)) { + throw new FormatError("Invalid crypt filter name."); + } + const self = this; + const cryptFilter = cf.get(name.name); + const cfm = cryptFilter?.get("CFM"); + if (!cfm || cfm.name === "None") { + return function () { + return new NullCipher(); + }; + } + if (cfm.name === "V2") { + return function () { + return new ARCFourCipher(self.#buildObjectKey(num, gen, key, false)); + }; + } + if (cfm.name === "AESV2") { + return function () { + return new AES128Cipher(self.#buildObjectKey(num, gen, key, true)); + }; + } + if (cfm.name === "AESV3") { + return function () { + return new AES256Cipher(key); + }; + } + throw new FormatError("Unknown crypto method"); + } + constructor(dict, fileId, password) { + const filter = dict.get("Filter"); + if (!isName(filter, "Standard")) { + throw new FormatError("unknown encryption method"); + } + this.filterName = filter.name; + this.dict = dict; + const algorithm = dict.get("V"); + if (!Number.isInteger(algorithm) || algorithm !== 1 && algorithm !== 2 && algorithm !== 4 && algorithm !== 5) { + throw new FormatError("unsupported encryption algorithm"); + } + this.algorithm = algorithm; + let keyLength = dict.get("Length"); + if (!keyLength) { + if (algorithm <= 3) { + keyLength = 40; + } else { + const cfDict = dict.get("CF"); + const streamCryptoName = dict.get("StmF"); + if (cfDict instanceof Dict && streamCryptoName instanceof Name) { + cfDict.suppressEncryption = true; + const handlerDict = cfDict.get(streamCryptoName.name); + keyLength = handlerDict?.get("Length") || 128; + if (keyLength < 40) { + keyLength <<= 3; + } + } + } + } + if (!Number.isInteger(keyLength) || keyLength < 40 || keyLength % 8 !== 0) { + throw new FormatError("invalid key length"); + } + const ownerBytes = stringToBytes(dict.get("O")), + userBytes = stringToBytes(dict.get("U")); + const ownerPassword = ownerBytes.subarray(0, 32); + const userPassword = userBytes.subarray(0, 32); + const flags = dict.get("P"); + const revision = dict.get("R"); + const encryptMetadata = (algorithm === 4 || algorithm === 5) && dict.get("EncryptMetadata") !== false; + this.encryptMetadata = encryptMetadata; + const fileIdBytes = stringToBytes(fileId); + let passwordBytes; + if (password) { + if (revision === 6) { + try { + password = utf8StringToString(password); + } catch { + warn("CipherTransformFactory: Unable to convert UTF8 encoded password."); + } + } + passwordBytes = stringToBytes(password); + } + let encryptionKey; + if (algorithm !== 5) { + encryptionKey = this.#prepareKeyData(fileIdBytes, passwordBytes, ownerPassword, userPassword, flags, revision, keyLength, encryptMetadata); + } else { + const ownerValidationSalt = ownerBytes.subarray(32, 40); + const ownerKeySalt = ownerBytes.subarray(40, 48); + const uBytes = userBytes.subarray(0, 48); + const userValidationSalt = userBytes.subarray(32, 40); + const userKeySalt = userBytes.subarray(40, 48); + const ownerEncryption = stringToBytes(dict.get("OE")); + const userEncryption = stringToBytes(dict.get("UE")); + const perms = stringToBytes(dict.get("Perms")); + encryptionKey = this.#createEncryptionKey20(revision, passwordBytes, ownerPassword, ownerValidationSalt, ownerKeySalt, uBytes, userPassword, userValidationSalt, userKeySalt, ownerEncryption, userEncryption, perms); + } + if (!encryptionKey && !password) { + throw new PasswordException("No password given", PasswordResponses.NEED_PASSWORD); + } else if (!encryptionKey && password) { + const decodedPassword = this.#decodeUserPassword(passwordBytes, ownerPassword, revision, keyLength); + encryptionKey = this.#prepareKeyData(fileIdBytes, decodedPassword, ownerPassword, userPassword, flags, revision, keyLength, encryptMetadata); + } + if (!encryptionKey) { + throw new PasswordException("Incorrect Password", PasswordResponses.INCORRECT_PASSWORD); + } + this.encryptionKey = encryptionKey; + if (algorithm >= 4) { + const cf = dict.get("CF"); + if (cf instanceof Dict) { + cf.suppressEncryption = true; + } + this.cf = cf; + this.stmf = dict.get("StmF") || Name.get("Identity"); + this.strf = dict.get("StrF") || Name.get("Identity"); + this.eff = dict.get("EFF") || this.stmf; + } + } + createCipherTransform(num, gen) { + if (this.algorithm === 4 || this.algorithm === 5) { + return new CipherTransform(this.#buildCipherConstructor(this.cf, this.strf, num, gen, this.encryptionKey), this.#buildCipherConstructor(this.cf, this.stmf, num, gen, this.encryptionKey)); + } + const key = this.#buildObjectKey(num, gen, this.encryptionKey, false); + const cipherConstructor = function () { + return new ARCFourCipher(key); + }; + return new CipherTransform(cipherConstructor, cipherConstructor); + } +} + +;// ./src/core/dataset_reader.js + + + +function decodeString(str) { + try { + return stringToUTF8String(str); + } catch (ex) { + warn(`UTF-8 decoding failed: "${ex}".`); + return str; + } +} +class DatasetXMLParser extends SimpleXMLParser { + constructor(options) { + super(options); + this.node = null; + } + onEndElement(name) { + const node = super.onEndElement(name); + if (node && name === "xfa:datasets") { + this.node = node; + throw new Error("Aborting DatasetXMLParser."); + } + } +} +class DatasetReader { + constructor(data) { + if (data.datasets) { + this.node = new SimpleXMLParser({ + hasAttributes: true + }).parseFromString(data.datasets).documentElement; + } else { + const parser = new DatasetXMLParser({ + hasAttributes: true + }); + try { + parser.parseFromString(data["xdp:xdp"]); + } catch {} + this.node = parser.node; + } + } + getValue(path) { + if (!this.node || !path) { + return ""; + } + const node = this.node.searchNode(parseXFAPath(path), 0); + if (!node) { + return ""; + } + const first = node.firstChild; + if (first?.nodeName === "value") { + return node.children.map(child => decodeString(child.textContent)); + } + return decodeString(node.textContent); + } +} + +;// ./src/core/xref.js + + + + + + +class XRef { + #firstXRefStmPos = null; + constructor(stream, pdfManager) { + this.stream = stream; + this.pdfManager = pdfManager; + this.entries = []; + this._xrefStms = new Set(); + this._cacheMap = new Map(); + this._pendingRefs = new RefSet(); + this._newPersistentRefNum = null; + this._newTemporaryRefNum = null; + this._persistentRefsCache = null; + } + getNewPersistentRef(obj) { + if (this._newPersistentRefNum === null) { + this._newPersistentRefNum = this.entries.length || 1; + } + const num = this._newPersistentRefNum++; + this._cacheMap.set(num, obj); + return Ref.get(num, 0); + } + getNewTemporaryRef() { + if (this._newTemporaryRefNum === null) { + this._newTemporaryRefNum = this.entries.length || 1; + if (this._newPersistentRefNum) { + this._persistentRefsCache = new Map(); + for (let i = this._newTemporaryRefNum; i < this._newPersistentRefNum; i++) { + this._persistentRefsCache.set(i, this._cacheMap.get(i)); + this._cacheMap.delete(i); + } + } + } + return Ref.get(this._newTemporaryRefNum++, 0); + } + resetNewTemporaryRef() { + this._newTemporaryRefNum = null; + if (this._persistentRefsCache) { + for (const [num, obj] of this._persistentRefsCache) { + this._cacheMap.set(num, obj); + } + } + this._persistentRefsCache = null; + } + setStartXRef(startXRef) { + this.startXRefQueue = [startXRef]; + } + parse(recoveryMode = false) { + let trailerDict; + if (!recoveryMode) { + trailerDict = this.readXRef(); + } else { + warn("Indexing all PDF objects"); + trailerDict = this.indexObjects(); + } + trailerDict.assignXref(this); + this.trailer = trailerDict; + let encrypt; + try { + encrypt = trailerDict.get("Encrypt"); + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + warn(`XRef.parse - Invalid "Encrypt" reference: "${ex}".`); + } + if (encrypt instanceof Dict) { + const ids = trailerDict.get("ID"); + const fileId = ids?.length ? ids[0] : ""; + encrypt.suppressEncryption = true; + this.encrypt = new CipherTransformFactory(encrypt, fileId, this.pdfManager.password); + } + let root; + try { + root = trailerDict.get("Root"); + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + warn(`XRef.parse - Invalid "Root" reference: "${ex}".`); + } + if (root instanceof Dict) { + try { + const pages = root.get("Pages"); + if (pages instanceof Dict) { + this.root = root; + return; + } + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + warn(`XRef.parse - Invalid "Pages" reference: "${ex}".`); + } + } + if (!recoveryMode) { + throw new XRefParseException(); + } + throw new InvalidPDFException("Invalid Root reference."); + } + processXRefTable(parser) { + if (!("tableState" in this)) { + this.tableState = { + entryNum: 0, + streamPos: parser.lexer.stream.pos, + parserBuf1: parser.buf1, + parserBuf2: parser.buf2 + }; + } + const obj = this.readXRefTable(parser); + if (!isCmd(obj, "trailer")) { + throw new FormatError("Invalid XRef table: could not find trailer dictionary"); + } + let dict = parser.getObj(); + if (!(dict instanceof Dict) && dict.dict) { + dict = dict.dict; + } + if (!(dict instanceof Dict)) { + throw new FormatError("Invalid XRef table: could not parse trailer dictionary"); + } + delete this.tableState; + return dict; + } + readXRefTable(parser) { + const stream = parser.lexer.stream; + const tableState = this.tableState; + stream.pos = tableState.streamPos; + parser.buf1 = tableState.parserBuf1; + parser.buf2 = tableState.parserBuf2; + let obj; + while (true) { + if (!("firstEntryNum" in tableState) || !("entryCount" in tableState)) { + if (isCmd(obj = parser.getObj(), "trailer")) { + break; + } + tableState.firstEntryNum = obj; + tableState.entryCount = parser.getObj(); + } + let first = tableState.firstEntryNum; + const count = tableState.entryCount; + if (!Number.isInteger(first) || !Number.isInteger(count)) { + throw new FormatError("Invalid XRef table: wrong types in subsection header"); + } + for (let i = tableState.entryNum; i < count; i++) { + tableState.streamPos = stream.pos; + tableState.entryNum = i; + tableState.parserBuf1 = parser.buf1; + tableState.parserBuf2 = parser.buf2; + const entry = {}; + entry.offset = parser.getObj(); + entry.gen = parser.getObj(); + const type = parser.getObj(); + if (type instanceof Cmd) { + switch (type.cmd) { + case "f": + entry.free = true; + break; + case "n": + entry.uncompressed = true; + break; + } + } + if (!Number.isInteger(entry.offset) || !Number.isInteger(entry.gen) || !(entry.free || entry.uncompressed)) { + throw new FormatError(`Invalid entry in XRef subsection: ${first}, ${count}`); + } + if (i === 0 && entry.free && first === 1) { + first = 0; + } + if (!this.entries[i + first]) { + this.entries[i + first] = entry; + } + } + tableState.entryNum = 0; + tableState.streamPos = stream.pos; + tableState.parserBuf1 = parser.buf1; + tableState.parserBuf2 = parser.buf2; + delete tableState.firstEntryNum; + delete tableState.entryCount; + } + if (this.entries[0] && !this.entries[0].free) { + throw new FormatError("Invalid XRef table: unexpected first object"); + } + return obj; + } + processXRefStream(stream) { + if (!("streamState" in this)) { + const { + dict, + pos + } = stream; + const byteWidths = dict.get("W"); + const range = dict.get("Index") || [0, dict.get("Size")]; + this.streamState = { + entryRanges: range, + byteWidths, + entryNum: 0, + streamPos: pos + }; + } + this.readXRefStream(stream); + delete this.streamState; + return stream.dict; + } + readXRefStream(stream) { + const streamState = this.streamState; + stream.pos = streamState.streamPos; + const [typeFieldWidth, offsetFieldWidth, generationFieldWidth] = streamState.byteWidths; + const entryRanges = streamState.entryRanges; + while (entryRanges.length > 0) { + const [first, n] = entryRanges; + if (!Number.isInteger(first) || !Number.isInteger(n)) { + throw new FormatError(`Invalid XRef range fields: ${first}, ${n}`); + } + if (!Number.isInteger(typeFieldWidth) || !Number.isInteger(offsetFieldWidth) || !Number.isInteger(generationFieldWidth)) { + throw new FormatError(`Invalid XRef entry fields length: ${first}, ${n}`); + } + for (let i = streamState.entryNum; i < n; ++i) { + streamState.entryNum = i; + streamState.streamPos = stream.pos; + let type = 0, + offset = 0, + generation = 0; + for (let j = 0; j < typeFieldWidth; ++j) { + const typeByte = stream.getByte(); + if (typeByte === -1) { + throw new FormatError("Invalid XRef byteWidths 'type'."); + } + type = type << 8 | typeByte; + } + if (typeFieldWidth === 0) { + type = 1; + } + for (let j = 0; j < offsetFieldWidth; ++j) { + const offsetByte = stream.getByte(); + if (offsetByte === -1) { + throw new FormatError("Invalid XRef byteWidths 'offset'."); + } + offset = offset << 8 | offsetByte; + } + for (let j = 0; j < generationFieldWidth; ++j) { + const generationByte = stream.getByte(); + if (generationByte === -1) { + throw new FormatError("Invalid XRef byteWidths 'generation'."); + } + generation = generation << 8 | generationByte; + } + const entry = {}; + entry.offset = offset; + entry.gen = generation; + switch (type) { + case 0: + entry.free = true; + break; + case 1: + entry.uncompressed = true; + break; + case 2: + break; + default: + throw new FormatError(`Invalid XRef entry type: ${type}`); + } + if (!this.entries[first + i]) { + this.entries[first + i] = entry; + } + } + streamState.entryNum = 0; + streamState.streamPos = stream.pos; + entryRanges.splice(0, 2); + } + } + indexObjects() { + const TAB = 0x9, + LF = 0xa, + CR = 0xd, + SPACE = 0x20; + const PERCENT = 0x25, + LT = 0x3c; + function readToken(data, offset) { + let token = "", + ch = data[offset]; + while (ch !== LF && ch !== CR && ch !== LT) { + if (++offset >= data.length) { + break; + } + token += String.fromCharCode(ch); + ch = data[offset]; + } + return token; + } + function skipUntil(data, offset, what) { + const length = what.length, + dataLength = data.length; + let skipped = 0; + while (offset < dataLength) { + let i = 0; + while (i < length && data[offset + i] === what[i]) { + ++i; + } + if (i >= length) { + break; + } + offset++; + skipped++; + } + return skipped; + } + const gEndobjRegExp = /\b(endobj|\d+\s+\d+\s+obj|xref|trailer\s*<<)\b/g; + const gStartxrefRegExp = /\b(startxref|\d+\s+\d+\s+obj)\b/g; + const objRegExp = /^(\d+)\s+(\d+)\s+obj\b/; + const trailerBytes = new Uint8Array([116, 114, 97, 105, 108, 101, 114]); + const startxrefBytes = new Uint8Array([115, 116, 97, 114, 116, 120, 114, 101, 102]); + const xrefBytes = new Uint8Array([47, 88, 82, 101, 102]); + this.entries.length = 0; + this._cacheMap.clear(); + const stream = this.stream; + stream.pos = 0; + const buffer = stream.getBytes(), + bufferStr = bytesToString(buffer), + length = buffer.length; + let position = stream.start; + const trailers = [], + xrefStms = []; + while (position < length) { + let ch = buffer[position]; + if (ch === TAB || ch === LF || ch === CR || ch === SPACE) { + ++position; + continue; + } + if (ch === PERCENT) { + do { + ++position; + if (position >= length) { + break; + } + ch = buffer[position]; + } while (ch !== LF && ch !== CR); + continue; + } + const token = readToken(buffer, position); + let m; + if (token.startsWith("xref") && (token.length === 4 || /\s/.test(token[4]))) { + position += skipUntil(buffer, position, trailerBytes); + trailers.push(position); + position += skipUntil(buffer, position, startxrefBytes); + } else if (m = objRegExp.exec(token)) { + const num = m[1] | 0, + gen = m[2] | 0; + const startPos = position + token.length; + let contentLength, + updateEntries = false; + if (!this.entries[num]) { + updateEntries = true; + } else if (this.entries[num].gen === gen) { + try { + const parser = new Parser({ + lexer: new Lexer(stream.makeSubStream(startPos)) + }); + parser.getObj(); + updateEntries = true; + } catch (ex) { + if (ex instanceof ParserEOFException) { + warn(`indexObjects -- checking object (${token}): "${ex}".`); + } else { + updateEntries = true; + } + } + } + if (updateEntries) { + this.entries[num] = { + offset: position - stream.start, + gen, + uncompressed: true + }; + } + gEndobjRegExp.lastIndex = startPos; + const match = gEndobjRegExp.exec(bufferStr); + if (match) { + const endPos = gEndobjRegExp.lastIndex + 1; + contentLength = endPos - position; + if (match[1] !== "endobj") { + warn(`indexObjects: Found "${match[1]}" inside of another "obj", ` + 'caused by missing "endobj" -- trying to recover.'); + contentLength -= match[1].length + 1; + } + } else { + contentLength = length - position; + } + const content = buffer.subarray(position, position + contentLength); + const xrefTagOffset = skipUntil(content, 0, xrefBytes); + if (xrefTagOffset < contentLength && content[xrefTagOffset + 5] < 64) { + xrefStms.push(position - stream.start); + this._xrefStms.add(position - stream.start); + } + position += contentLength; + } else if (token.startsWith("trailer") && (token.length === 7 || /\s/.test(token[7]))) { + trailers.push(position); + const startPos = position + token.length; + let contentLength; + gStartxrefRegExp.lastIndex = startPos; + const match = gStartxrefRegExp.exec(bufferStr); + if (match) { + const endPos = gStartxrefRegExp.lastIndex + 1; + contentLength = endPos - position; + if (match[1] !== "startxref") { + warn(`indexObjects: Found "${match[1]}" after "trailer", ` + 'caused by missing "startxref" -- trying to recover.'); + contentLength -= match[1].length + 1; + } + } else { + contentLength = length - position; + } + position += contentLength; + } else { + position += token.length + 1; + } + } + for (const xrefStm of xrefStms) { + this.startXRefQueue.push(xrefStm); + this.readXRef(true); + } + const trailerDicts = []; + let isEncrypted = false; + for (const trailer of trailers) { + stream.pos = trailer; + const parser = new Parser({ + lexer: new Lexer(stream), + xref: this, + allowStreams: true, + recoveryMode: true + }); + const obj = parser.getObj(); + if (!isCmd(obj, "trailer")) { + continue; + } + const dict = parser.getObj(); + if (!(dict instanceof Dict)) { + continue; + } + trailerDicts.push(dict); + if (dict.has("Encrypt")) { + isEncrypted = true; + } + } + let trailerDict, trailerError; + for (const dict of [...trailerDicts, "genFallback", ...trailerDicts]) { + if (dict === "genFallback") { + if (!trailerError) { + break; + } + this._generationFallback = true; + continue; + } + let validPagesDict = false; + try { + const rootDict = dict.get("Root"); + if (!(rootDict instanceof Dict)) { + continue; + } + const pagesDict = rootDict.get("Pages"); + if (!(pagesDict instanceof Dict)) { + continue; + } + const pagesCount = pagesDict.get("Count"); + if (Number.isInteger(pagesCount)) { + validPagesDict = true; + } + } catch (ex) { + trailerError = ex; + continue; + } + if (validPagesDict && (!isEncrypted || dict.has("Encrypt")) && dict.has("ID")) { + return dict; + } + trailerDict = dict; + } + if (trailerDict) { + return trailerDict; + } + if (this.topDict) { + return this.topDict; + } + if (!trailerDicts.length) { + for (const [num, entry] of this.entries.entries()) { + if (!entry) { + continue; + } + const ref = Ref.get(num, entry.gen); + let obj; + try { + obj = this.fetch(ref); + } catch { + continue; + } + if (obj instanceof BaseStream) { + obj = obj.dict; + } + if (obj instanceof Dict && obj.has("Root")) { + return obj; + } + } + } + throw new InvalidPDFException("Invalid PDF structure."); + } + readXRef(recoveryMode = false) { + const stream = this.stream; + const startXRefParsedCache = new Set(); + while (this.startXRefQueue.length) { + try { + const startXRef = this.startXRefQueue[0]; + if (startXRefParsedCache.has(startXRef)) { + warn("readXRef - skipping XRef table since it was already parsed."); + this.startXRefQueue.shift(); + continue; + } + startXRefParsedCache.add(startXRef); + stream.pos = startXRef + stream.start; + const parser = new Parser({ + lexer: new Lexer(stream), + xref: this, + allowStreams: true + }); + let obj = parser.getObj(); + let dict; + if (isCmd(obj, "xref")) { + dict = this.processXRefTable(parser); + if (!this.topDict) { + this.topDict = dict; + } + obj = dict.get("XRefStm"); + if (Number.isInteger(obj) && !this._xrefStms.has(obj)) { + this._xrefStms.add(obj); + this.startXRefQueue.push(obj); + this.#firstXRefStmPos ??= obj; + } + } else if (Number.isInteger(obj)) { + if (!Number.isInteger(parser.getObj()) || !isCmd(parser.getObj(), "obj") || !((obj = parser.getObj()) instanceof BaseStream)) { + throw new FormatError("Invalid XRef stream"); + } + dict = this.processXRefStream(obj); + if (!this.topDict) { + this.topDict = dict; + } + if (!dict) { + throw new FormatError("Failed to read XRef stream"); + } + } else { + throw new FormatError("Invalid XRef stream header"); + } + obj = dict.get("Prev"); + if (Number.isInteger(obj)) { + this.startXRefQueue.push(obj); + } else if (obj instanceof Ref) { + this.startXRefQueue.push(obj.num); + } + } catch (e) { + if (e instanceof MissingDataException) { + throw e; + } + info("(while reading XRef): " + e); + } + this.startXRefQueue.shift(); + } + if (this.topDict) { + return this.topDict; + } + if (recoveryMode) { + return undefined; + } + throw new XRefParseException(); + } + get lastXRefStreamPos() { + return this.#firstXRefStmPos ?? (this._xrefStms.size > 0 ? Math.max(...this._xrefStms) : null); + } + getEntry(i) { + const xrefEntry = this.entries[i]; + if (xrefEntry && !xrefEntry.free && xrefEntry.offset) { + return xrefEntry; + } + return null; + } + fetchIfRef(obj, suppressEncryption = false) { + if (obj instanceof Ref) { + return this.fetch(obj, suppressEncryption); + } + return obj; + } + fetch(ref, suppressEncryption = false) { + if (!(ref instanceof Ref)) { + throw new Error("ref object is not a reference"); + } + const num = ref.num; + const cacheEntry = this._cacheMap.get(num); + if (cacheEntry !== undefined) { + if (cacheEntry instanceof Dict && !cacheEntry.objId) { + cacheEntry.objId = ref.toString(); + } + return cacheEntry; + } + let xrefEntry = this.getEntry(num); + if (xrefEntry === null) { + this._cacheMap.set(num, xrefEntry); + return xrefEntry; + } + if (this._pendingRefs.has(ref)) { + this._pendingRefs.remove(ref); + warn(`Ignoring circular reference: ${ref}.`); + return CIRCULAR_REF; + } + this._pendingRefs.put(ref); + try { + xrefEntry = xrefEntry.uncompressed ? this.fetchUncompressed(ref, xrefEntry, suppressEncryption) : this.fetchCompressed(ref, xrefEntry, suppressEncryption); + this._pendingRefs.remove(ref); + } catch (ex) { + this._pendingRefs.remove(ref); + throw ex; + } + if (xrefEntry instanceof Dict) { + xrefEntry.objId = ref.toString(); + } else if (xrefEntry instanceof BaseStream) { + xrefEntry.dict.objId = ref.toString(); + } + return xrefEntry; + } + fetchUncompressed(ref, xrefEntry, suppressEncryption = false) { + const gen = ref.gen; + let num = ref.num; + if (xrefEntry.gen !== gen) { + const msg = `Inconsistent generation in XRef: ${ref}`; + if (this._generationFallback && xrefEntry.gen < gen) { + warn(msg); + return this.fetchUncompressed(Ref.get(num, xrefEntry.gen), xrefEntry, suppressEncryption); + } + throw new XRefEntryException(msg); + } + const stream = this.stream.makeSubStream(xrefEntry.offset + this.stream.start); + const parser = new Parser({ + lexer: new Lexer(stream), + xref: this, + allowStreams: true + }); + const obj1 = parser.getObj(); + const obj2 = parser.getObj(); + const obj3 = parser.getObj(); + if (obj1 !== num || obj2 !== gen || !(obj3 instanceof Cmd)) { + throw new XRefEntryException(`Bad (uncompressed) XRef entry: ${ref}`); + } + if (obj3.cmd !== "obj") { + if (obj3.cmd.startsWith("obj")) { + num = parseInt(obj3.cmd.substring(3), 10); + if (!Number.isNaN(num)) { + return num; + } + } + throw new XRefEntryException(`Bad (uncompressed) XRef entry: ${ref}`); + } + xrefEntry = this.encrypt && !suppressEncryption ? parser.getObj(this.encrypt.createCipherTransform(num, gen)) : parser.getObj(); + if (!(xrefEntry instanceof BaseStream)) { + this._cacheMap.set(num, xrefEntry); + } + return xrefEntry; + } + fetchCompressed(ref, xrefEntry, suppressEncryption = false) { + const tableOffset = xrefEntry.offset; + const stream = this.fetch(Ref.get(tableOffset, 0)); + if (!(stream instanceof BaseStream)) { + throw new FormatError("bad ObjStm stream"); + } + const first = stream.dict.get("First"); + const n = stream.dict.get("N"); + if (!Number.isInteger(first) || !Number.isInteger(n)) { + throw new FormatError("invalid first and n parameters for ObjStm stream"); + } + let parser = new Parser({ + lexer: new Lexer(stream), + xref: this, + allowStreams: true + }); + const nums = new Array(n); + const offsets = new Array(n); + for (let i = 0; i < n; ++i) { + const num = parser.getObj(); + if (!Number.isInteger(num)) { + throw new FormatError(`invalid object number in the ObjStm stream: ${num}`); + } + const offset = parser.getObj(); + if (!Number.isInteger(offset)) { + throw new FormatError(`invalid object offset in the ObjStm stream: ${offset}`); + } + nums[i] = num; + offsets[i] = offset; + } + const start = (stream.start || 0) + first; + const entries = new Array(n); + for (let i = 0; i < n; ++i) { + const length = i < n - 1 ? offsets[i + 1] - offsets[i] : undefined; + if (length < 0) { + throw new FormatError("Invalid offset in the ObjStm stream."); + } + parser = new Parser({ + lexer: new Lexer(stream.makeSubStream(start + offsets[i], length, stream.dict)), + xref: this, + allowStreams: true + }); + const obj = parser.getObj(); + entries[i] = obj; + if (obj instanceof BaseStream) { + continue; + } + const num = nums[i], + entry = this.entries[num]; + if (entry && entry.offset === tableOffset && entry.gen === i) { + this._cacheMap.set(num, obj); + } + } + xrefEntry = entries[xrefEntry.gen]; + if (xrefEntry === undefined) { + throw new XRefEntryException(`Bad (compressed) XRef entry: ${ref}`); + } + return xrefEntry; + } + async fetchIfRefAsync(obj, suppressEncryption) { + if (obj instanceof Ref) { + return this.fetchAsync(obj, suppressEncryption); + } + return obj; + } + async fetchAsync(ref, suppressEncryption) { + try { + return this.fetch(ref, suppressEncryption); + } catch (ex) { + if (!(ex instanceof MissingDataException)) { + throw ex; + } + await this.pdfManager.requestRange(ex.begin, ex.end); + return this.fetchAsync(ref, suppressEncryption); + } + } + getCatalogObj() { + return this.root; + } +} + +;// ./src/core/document.js + + + + + + + + + + + + + + + + + + + +const LETTER_SIZE_MEDIABOX = [0, 0, 612, 792]; +class Page { + constructor({ + pdfManager, + xref, + pageIndex, + pageDict, + ref, + globalIdFactory, + fontCache, + builtInCMapCache, + standardFontDataCache, + globalImageCache, + systemFontCache, + nonBlendModesSet, + xfaFactory + }) { + this.pdfManager = pdfManager; + this.pageIndex = pageIndex; + this.pageDict = pageDict; + this.xref = xref; + this.ref = ref; + this.fontCache = fontCache; + this.builtInCMapCache = builtInCMapCache; + this.standardFontDataCache = standardFontDataCache; + this.globalImageCache = globalImageCache; + this.systemFontCache = systemFontCache; + this.nonBlendModesSet = nonBlendModesSet; + this.evaluatorOptions = pdfManager.evaluatorOptions; + this.resourcesPromise = null; + this.xfaFactory = xfaFactory; + const idCounters = { + obj: 0 + }; + this._localIdFactory = class extends globalIdFactory { + static createObjId() { + return `p${pageIndex}_${++idCounters.obj}`; + } + static getPageObjId() { + return `p${ref.toString()}`; + } + }; + } + _getInheritableProperty(key, getArray = false) { + const value = getInheritableProperty({ + dict: this.pageDict, + key, + getArray, + stopWhenFound: false + }); + if (!Array.isArray(value)) { + return value; + } + if (value.length === 1 || !(value[0] instanceof Dict)) { + return value[0]; + } + return Dict.merge({ + xref: this.xref, + dictArray: value + }); + } + get content() { + return this.pageDict.getArray("Contents"); + } + get resources() { + const resources = this._getInheritableProperty("Resources"); + return shadow(this, "resources", resources instanceof Dict ? resources : Dict.empty); + } + _getBoundingBox(name) { + if (this.xfaData) { + return this.xfaData.bbox; + } + const box = lookupNormalRect(this._getInheritableProperty(name, true), null); + if (box) { + if (box[2] - box[0] > 0 && box[3] - box[1] > 0) { + return box; + } + warn(`Empty, or invalid, /${name} entry.`); + } + return null; + } + get mediaBox() { + return shadow(this, "mediaBox", this._getBoundingBox("MediaBox") || LETTER_SIZE_MEDIABOX); + } + get cropBox() { + return shadow(this, "cropBox", this._getBoundingBox("CropBox") || this.mediaBox); + } + get userUnit() { + const obj = this.pageDict.get("UserUnit"); + return shadow(this, "userUnit", typeof obj === "number" && obj > 0 ? obj : 1.0); + } + get view() { + const { + cropBox, + mediaBox + } = this; + if (cropBox !== mediaBox && !isArrayEqual(cropBox, mediaBox)) { + const box = Util.intersect(cropBox, mediaBox); + if (box && box[2] - box[0] > 0 && box[3] - box[1] > 0) { + return shadow(this, "view", box); + } + warn("Empty /CropBox and /MediaBox intersection."); + } + return shadow(this, "view", mediaBox); + } + get rotate() { + let rotate = this._getInheritableProperty("Rotate") || 0; + if (rotate % 90 !== 0) { + rotate = 0; + } else if (rotate >= 360) { + rotate %= 360; + } else if (rotate < 0) { + rotate = (rotate % 360 + 360) % 360; + } + return shadow(this, "rotate", rotate); + } + _onSubStreamError(reason, objId) { + if (this.evaluatorOptions.ignoreErrors) { + warn(`getContentStream - ignoring sub-stream (${objId}): "${reason}".`); + return; + } + throw reason; + } + getContentStream() { + return this.pdfManager.ensure(this, "content").then(content => { + if (content instanceof BaseStream) { + return content; + } + if (Array.isArray(content)) { + return new StreamsSequenceStream(content, this._onSubStreamError.bind(this)); + } + return new NullStream(); + }); + } + get xfaData() { + return shadow(this, "xfaData", this.xfaFactory ? { + bbox: this.xfaFactory.getBoundingBox(this.pageIndex) + } : null); + } + async #replaceIdByRef(annotations, deletedAnnotations, existingAnnotations) { + const promises = []; + for (const annotation of annotations) { + if (annotation.id) { + const ref = Ref.fromString(annotation.id); + if (!ref) { + warn(`A non-linked annotation cannot be modified: ${annotation.id}`); + continue; + } + if (annotation.deleted) { + deletedAnnotations.put(ref, ref); + if (annotation.popupRef) { + const popupRef = Ref.fromString(annotation.popupRef); + if (popupRef) { + deletedAnnotations.put(popupRef, popupRef); + } + } + continue; + } + existingAnnotations?.put(ref); + annotation.ref = ref; + promises.push(this.xref.fetchAsync(ref).then(obj => { + if (obj instanceof Dict) { + annotation.oldAnnotation = obj.clone(); + } + }, () => { + warn(`Cannot fetch \`oldAnnotation\` for: ${ref}.`); + })); + delete annotation.id; + } + } + await Promise.all(promises); + } + async saveNewAnnotations(handler, task, annotations, imagePromises, changes) { + if (this.xfaFactory) { + throw new Error("XFA: Cannot save new annotations."); + } + const partialEvaluator = new PartialEvaluator({ + xref: this.xref, + handler, + pageIndex: this.pageIndex, + idFactory: this._localIdFactory, + fontCache: this.fontCache, + builtInCMapCache: this.builtInCMapCache, + standardFontDataCache: this.standardFontDataCache, + globalImageCache: this.globalImageCache, + systemFontCache: this.systemFontCache, + options: this.evaluatorOptions + }); + const deletedAnnotations = new RefSetCache(); + const existingAnnotations = new RefSet(); + await this.#replaceIdByRef(annotations, deletedAnnotations, existingAnnotations); + const pageDict = this.pageDict; + const annotationsArray = this.annotations.filter(a => !(a instanceof Ref && deletedAnnotations.has(a))); + const newData = await AnnotationFactory.saveNewAnnotations(partialEvaluator, task, annotations, imagePromises, changes); + for (const { + ref + } of newData.annotations) { + if (ref instanceof Ref && !existingAnnotations.has(ref)) { + annotationsArray.push(ref); + } + } + const dict = pageDict.clone(); + dict.set("Annots", annotationsArray); + changes.put(this.ref, { + data: dict + }); + for (const deletedRef of deletedAnnotations) { + changes.put(deletedRef, { + data: null + }); + } + } + save(handler, task, annotationStorage, changes) { + const partialEvaluator = new PartialEvaluator({ + xref: this.xref, + handler, + pageIndex: this.pageIndex, + idFactory: this._localIdFactory, + fontCache: this.fontCache, + builtInCMapCache: this.builtInCMapCache, + standardFontDataCache: this.standardFontDataCache, + globalImageCache: this.globalImageCache, + systemFontCache: this.systemFontCache, + options: this.evaluatorOptions + }); + return this._parsedAnnotations.then(function (annotations) { + const promises = []; + for (const annotation of annotations) { + promises.push(annotation.save(partialEvaluator, task, annotationStorage, changes).catch(function (reason) { + warn("save - ignoring annotation data during " + `"${task.name}" task: "${reason}".`); + return null; + })); + } + return Promise.all(promises); + }); + } + loadResources(keys) { + this.resourcesPromise ||= this.pdfManager.ensure(this, "resources"); + return this.resourcesPromise.then(() => { + const objectLoader = new ObjectLoader(this.resources, keys, this.xref); + return objectLoader.load(); + }); + } + getOperatorList({ + handler, + sink, + task, + intent, + cacheKey, + annotationStorage = null, + modifiedIds = null + }) { + const contentStreamPromise = this.getContentStream(); + const resourcesPromise = this.loadResources(["ColorSpace", "ExtGState", "Font", "Pattern", "Properties", "Shading", "XObject"]); + const partialEvaluator = new PartialEvaluator({ + xref: this.xref, + handler, + pageIndex: this.pageIndex, + idFactory: this._localIdFactory, + fontCache: this.fontCache, + builtInCMapCache: this.builtInCMapCache, + standardFontDataCache: this.standardFontDataCache, + globalImageCache: this.globalImageCache, + systemFontCache: this.systemFontCache, + options: this.evaluatorOptions + }); + const newAnnotsByPage = !this.xfaFactory ? getNewAnnotationsMap(annotationStorage) : null; + const newAnnots = newAnnotsByPage?.get(this.pageIndex); + let newAnnotationsPromise = Promise.resolve(null); + let deletedAnnotations = null; + if (newAnnots) { + const annotationGlobalsPromise = this.pdfManager.ensureDoc("annotationGlobals"); + let imagePromises; + const missingBitmaps = new Set(); + for (const { + bitmapId, + bitmap + } of newAnnots) { + if (bitmapId && !bitmap && !missingBitmaps.has(bitmapId)) { + missingBitmaps.add(bitmapId); + } + } + const { + isOffscreenCanvasSupported + } = this.evaluatorOptions; + if (missingBitmaps.size > 0) { + const annotationWithBitmaps = newAnnots.slice(); + for (const [key, annotation] of annotationStorage) { + if (!key.startsWith(AnnotationEditorPrefix)) { + continue; + } + if (annotation.bitmap && missingBitmaps.has(annotation.bitmapId)) { + annotationWithBitmaps.push(annotation); + } + } + imagePromises = AnnotationFactory.generateImages(annotationWithBitmaps, this.xref, isOffscreenCanvasSupported); + } else { + imagePromises = AnnotationFactory.generateImages(newAnnots, this.xref, isOffscreenCanvasSupported); + } + deletedAnnotations = new RefSet(); + newAnnotationsPromise = Promise.all([annotationGlobalsPromise, this.#replaceIdByRef(newAnnots, deletedAnnotations, null)]).then(([annotationGlobals]) => { + if (!annotationGlobals) { + return null; + } + return AnnotationFactory.printNewAnnotations(annotationGlobals, partialEvaluator, task, newAnnots, imagePromises); + }); + } + const pageListPromise = Promise.all([contentStreamPromise, resourcesPromise]).then(([contentStream]) => { + const opList = new OperatorList(intent, sink); + handler.send("StartRenderPage", { + transparency: partialEvaluator.hasBlendModes(this.resources, this.nonBlendModesSet), + pageIndex: this.pageIndex, + cacheKey + }); + return partialEvaluator.getOperatorList({ + stream: contentStream, + task, + resources: this.resources, + operatorList: opList + }).then(function () { + return opList; + }); + }); + return Promise.all([pageListPromise, this._parsedAnnotations, newAnnotationsPromise]).then(function ([pageOpList, annotations, newAnnotations]) { + if (newAnnotations) { + annotations = annotations.filter(a => !(a.ref && deletedAnnotations.has(a.ref))); + for (let i = 0, ii = newAnnotations.length; i < ii; i++) { + const newAnnotation = newAnnotations[i]; + if (newAnnotation.refToReplace) { + const j = annotations.findIndex(a => a.ref && isRefsEqual(a.ref, newAnnotation.refToReplace)); + if (j >= 0) { + annotations.splice(j, 1, newAnnotation); + newAnnotations.splice(i--, 1); + ii--; + } + } + } + annotations = annotations.concat(newAnnotations); + } + if (annotations.length === 0 || intent & RenderingIntentFlag.ANNOTATIONS_DISABLE) { + pageOpList.flush(true); + return { + length: pageOpList.totalLength + }; + } + const renderForms = !!(intent & RenderingIntentFlag.ANNOTATIONS_FORMS), + isEditing = !!(intent & RenderingIntentFlag.IS_EDITING), + intentAny = !!(intent & RenderingIntentFlag.ANY), + intentDisplay = !!(intent & RenderingIntentFlag.DISPLAY), + intentPrint = !!(intent & RenderingIntentFlag.PRINT); + const opListPromises = []; + for (const annotation of annotations) { + if (intentAny || intentDisplay && annotation.mustBeViewed(annotationStorage, renderForms) && annotation.mustBeViewedWhenEditing(isEditing, modifiedIds) || intentPrint && annotation.mustBePrinted(annotationStorage)) { + opListPromises.push(annotation.getOperatorList(partialEvaluator, task, intent, annotationStorage).catch(function (reason) { + warn("getOperatorList - ignoring annotation data during " + `"${task.name}" task: "${reason}".`); + return { + opList: null, + separateForm: false, + separateCanvas: false + }; + })); + } + } + return Promise.all(opListPromises).then(function (opLists) { + let form = false, + canvas = false; + for (const { + opList, + separateForm, + separateCanvas + } of opLists) { + pageOpList.addOpList(opList); + form ||= separateForm; + canvas ||= separateCanvas; + } + pageOpList.flush(true, { + form, + canvas + }); + return { + length: pageOpList.totalLength + }; + }); + }); + } + async extractTextContent({ + handler, + task, + includeMarkedContent, + disableNormalization, + sink + }) { + const contentStreamPromise = this.getContentStream(); + const resourcesPromise = this.loadResources(["ExtGState", "Font", "Properties", "XObject"]); + const langPromise = this.pdfManager.ensureCatalog("lang"); + const [contentStream,, lang] = await Promise.all([contentStreamPromise, resourcesPromise, langPromise]); + const partialEvaluator = new PartialEvaluator({ + xref: this.xref, + handler, + pageIndex: this.pageIndex, + idFactory: this._localIdFactory, + fontCache: this.fontCache, + builtInCMapCache: this.builtInCMapCache, + standardFontDataCache: this.standardFontDataCache, + globalImageCache: this.globalImageCache, + systemFontCache: this.systemFontCache, + options: this.evaluatorOptions + }); + return partialEvaluator.getTextContent({ + stream: contentStream, + task, + resources: this.resources, + includeMarkedContent, + disableNormalization, + sink, + viewBox: this.view, + lang + }); + } + async getStructTree() { + const structTreeRoot = await this.pdfManager.ensureCatalog("structTreeRoot"); + if (!structTreeRoot) { + return null; + } + await this._parsedAnnotations; + const structTree = await this.pdfManager.ensure(this, "_parseStructTree", [structTreeRoot]); + return this.pdfManager.ensure(structTree, "serializable"); + } + _parseStructTree(structTreeRoot) { + const tree = new StructTreePage(structTreeRoot, this.pageDict); + tree.parse(this.ref); + return tree; + } + async getAnnotationsData(handler, task, intent) { + const annotations = await this._parsedAnnotations; + if (annotations.length === 0) { + return annotations; + } + const annotationsData = [], + textContentPromises = []; + let partialEvaluator; + const intentAny = !!(intent & RenderingIntentFlag.ANY), + intentDisplay = !!(intent & RenderingIntentFlag.DISPLAY), + intentPrint = !!(intent & RenderingIntentFlag.PRINT); + for (const annotation of annotations) { + const isVisible = intentAny || intentDisplay && annotation.viewable; + if (isVisible || intentPrint && annotation.printable) { + annotationsData.push(annotation.data); + } + if (annotation.hasTextContent && isVisible) { + partialEvaluator ||= new PartialEvaluator({ + xref: this.xref, + handler, + pageIndex: this.pageIndex, + idFactory: this._localIdFactory, + fontCache: this.fontCache, + builtInCMapCache: this.builtInCMapCache, + standardFontDataCache: this.standardFontDataCache, + globalImageCache: this.globalImageCache, + systemFontCache: this.systemFontCache, + options: this.evaluatorOptions + }); + textContentPromises.push(annotation.extractTextContent(partialEvaluator, task, [-Infinity, -Infinity, Infinity, Infinity]).catch(function (reason) { + warn(`getAnnotationsData - ignoring textContent during "${task.name}" task: "${reason}".`); + })); + } + } + await Promise.all(textContentPromises); + return annotationsData; + } + get annotations() { + const annots = this._getInheritableProperty("Annots"); + return shadow(this, "annotations", Array.isArray(annots) ? annots : []); + } + get _parsedAnnotations() { + const promise = this.pdfManager.ensure(this, "annotations").then(async annots => { + if (annots.length === 0) { + return annots; + } + const [annotationGlobals, fieldObjects] = await Promise.all([this.pdfManager.ensureDoc("annotationGlobals"), this.pdfManager.ensureDoc("fieldObjects")]); + if (!annotationGlobals) { + return []; + } + const orphanFields = fieldObjects?.orphanFields; + const annotationPromises = []; + for (const annotationRef of annots) { + annotationPromises.push(AnnotationFactory.create(this.xref, annotationRef, annotationGlobals, this._localIdFactory, false, orphanFields, this.ref).catch(function (reason) { + warn(`_parsedAnnotations: "${reason}".`); + return null; + })); + } + const sortedAnnotations = []; + let popupAnnotations, widgetAnnotations; + for (const annotation of await Promise.all(annotationPromises)) { + if (!annotation) { + continue; + } + if (annotation instanceof WidgetAnnotation) { + (widgetAnnotations ||= []).push(annotation); + continue; + } + if (annotation instanceof PopupAnnotation) { + (popupAnnotations ||= []).push(annotation); + continue; + } + sortedAnnotations.push(annotation); + } + if (widgetAnnotations) { + sortedAnnotations.push(...widgetAnnotations); + } + if (popupAnnotations) { + sortedAnnotations.push(...popupAnnotations); + } + return sortedAnnotations; + }); + return shadow(this, "_parsedAnnotations", promise); + } + get jsActions() { + const actions = collectActions(this.xref, this.pageDict, PageActionEventType); + return shadow(this, "jsActions", actions); + } +} +const PDF_HEADER_SIGNATURE = new Uint8Array([0x25, 0x50, 0x44, 0x46, 0x2d]); +const STARTXREF_SIGNATURE = new Uint8Array([0x73, 0x74, 0x61, 0x72, 0x74, 0x78, 0x72, 0x65, 0x66]); +const ENDOBJ_SIGNATURE = new Uint8Array([0x65, 0x6e, 0x64, 0x6f, 0x62, 0x6a]); +function find(stream, signature, limit = 1024, backwards = false) { + const signatureLength = signature.length; + const scanBytes = stream.peekBytes(limit); + const scanLength = scanBytes.length - signatureLength; + if (scanLength <= 0) { + return false; + } + if (backwards) { + const signatureEnd = signatureLength - 1; + let pos = scanBytes.length - 1; + while (pos >= signatureEnd) { + let j = 0; + while (j < signatureLength && scanBytes[pos - j] === signature[signatureEnd - j]) { + j++; + } + if (j >= signatureLength) { + stream.pos += pos - signatureEnd; + return true; + } + pos--; + } + } else { + let pos = 0; + while (pos <= scanLength) { + let j = 0; + while (j < signatureLength && scanBytes[pos + j] === signature[j]) { + j++; + } + if (j >= signatureLength) { + stream.pos += pos; + return true; + } + pos++; + } + } + return false; +} +class PDFDocument { + constructor(pdfManager, stream) { + if (stream.length <= 0) { + throw new InvalidPDFException("The PDF file is empty, i.e. its size is zero bytes."); + } + this.pdfManager = pdfManager; + this.stream = stream; + this.xref = new XRef(stream, pdfManager); + this._pagePromises = new Map(); + this._version = null; + const idCounters = { + font: 0 + }; + this._globalIdFactory = class { + static getDocId() { + return `g_${pdfManager.docId}`; + } + static createFontId() { + return `f${++idCounters.font}`; + } + static createObjId() { + unreachable("Abstract method `createObjId` called."); + } + static getPageObjId() { + unreachable("Abstract method `getPageObjId` called."); + } + }; + } + parse(recoveryMode) { + this.xref.parse(recoveryMode); + this.catalog = new Catalog(this.pdfManager, this.xref); + } + get linearization() { + let linearization = null; + try { + linearization = Linearization.create(this.stream); + } catch (err) { + if (err instanceof MissingDataException) { + throw err; + } + info(err); + } + return shadow(this, "linearization", linearization); + } + get startXRef() { + const stream = this.stream; + let startXRef = 0; + if (this.linearization) { + stream.reset(); + if (find(stream, ENDOBJ_SIGNATURE)) { + stream.skip(6); + let ch = stream.peekByte(); + while (isWhiteSpace(ch)) { + stream.pos++; + ch = stream.peekByte(); + } + startXRef = stream.pos - stream.start; + } + } else { + const step = 1024; + const startXRefLength = STARTXREF_SIGNATURE.length; + let found = false, + pos = stream.end; + while (!found && pos > 0) { + pos -= step - startXRefLength; + if (pos < 0) { + pos = 0; + } + stream.pos = pos; + found = find(stream, STARTXREF_SIGNATURE, step, true); + } + if (found) { + stream.skip(9); + let ch; + do { + ch = stream.getByte(); + } while (isWhiteSpace(ch)); + let str = ""; + while (ch >= 0x20 && ch <= 0x39) { + str += String.fromCharCode(ch); + ch = stream.getByte(); + } + startXRef = parseInt(str, 10); + if (isNaN(startXRef)) { + startXRef = 0; + } + } + } + return shadow(this, "startXRef", startXRef); + } + checkHeader() { + const stream = this.stream; + stream.reset(); + if (!find(stream, PDF_HEADER_SIGNATURE)) { + return; + } + stream.moveStart(); + stream.skip(PDF_HEADER_SIGNATURE.length); + let version = "", + ch; + while ((ch = stream.getByte()) > 0x20 && version.length < 7) { + version += String.fromCharCode(ch); + } + if (PDF_VERSION_REGEXP.test(version)) { + this._version = version; + } else { + warn(`Invalid PDF header version: ${version}`); + } + } + parseStartXRef() { + this.xref.setStartXRef(this.startXRef); + } + get numPages() { + let num = 0; + if (this.catalog.hasActualNumPages) { + num = this.catalog.numPages; + } else if (this.xfaFactory) { + num = this.xfaFactory.getNumPages(); + } else if (this.linearization) { + num = this.linearization.numPages; + } else { + num = this.catalog.numPages; + } + return shadow(this, "numPages", num); + } + _hasOnlyDocumentSignatures(fields, recursionDepth = 0) { + const RECURSION_LIMIT = 10; + if (!Array.isArray(fields)) { + return false; + } + return fields.every(field => { + field = this.xref.fetchIfRef(field); + if (!(field instanceof Dict)) { + return false; + } + if (field.has("Kids")) { + if (++recursionDepth > RECURSION_LIMIT) { + warn("_hasOnlyDocumentSignatures: maximum recursion depth reached"); + return false; + } + return this._hasOnlyDocumentSignatures(field.get("Kids"), recursionDepth); + } + const isSignature = isName(field.get("FT"), "Sig"); + const rectangle = field.get("Rect"); + const isInvisible = Array.isArray(rectangle) && rectangle.every(value => value === 0); + return isSignature && isInvisible; + }); + } + get _xfaStreams() { + const acroForm = this.catalog.acroForm; + if (!acroForm) { + return null; + } + const xfa = acroForm.get("XFA"); + const entries = { + "xdp:xdp": "", + template: "", + datasets: "", + config: "", + connectionSet: "", + localeSet: "", + stylesheet: "", + "/xdp:xdp": "" + }; + if (xfa instanceof BaseStream && !xfa.isEmpty) { + entries["xdp:xdp"] = xfa; + return entries; + } + if (!Array.isArray(xfa) || xfa.length === 0) { + return null; + } + for (let i = 0, ii = xfa.length; i < ii; i += 2) { + let name; + if (i === 0) { + name = "xdp:xdp"; + } else if (i === ii - 2) { + name = "/xdp:xdp"; + } else { + name = xfa[i]; + } + if (!entries.hasOwnProperty(name)) { + continue; + } + const data = this.xref.fetchIfRef(xfa[i + 1]); + if (!(data instanceof BaseStream) || data.isEmpty) { + continue; + } + entries[name] = data; + } + return entries; + } + get xfaDatasets() { + const streams = this._xfaStreams; + if (!streams) { + return shadow(this, "xfaDatasets", null); + } + for (const key of ["datasets", "xdp:xdp"]) { + const stream = streams[key]; + if (!stream) { + continue; + } + try { + const str = stringToUTF8String(stream.getString()); + const data = { + [key]: str + }; + return shadow(this, "xfaDatasets", new DatasetReader(data)); + } catch { + warn("XFA - Invalid utf-8 string."); + break; + } + } + return shadow(this, "xfaDatasets", null); + } + get xfaData() { + const streams = this._xfaStreams; + if (!streams) { + return null; + } + const data = Object.create(null); + for (const [key, stream] of Object.entries(streams)) { + if (!stream) { + continue; + } + try { + data[key] = stringToUTF8String(stream.getString()); + } catch { + warn("XFA - Invalid utf-8 string."); + return null; + } + } + return data; + } + get xfaFactory() { + let data; + if (this.pdfManager.enableXfa && this.catalog.needsRendering && this.formInfo.hasXfa && !this.formInfo.hasAcroForm) { + data = this.xfaData; + } + return shadow(this, "xfaFactory", data ? new XFAFactory(data) : null); + } + get isPureXfa() { + return this.xfaFactory ? this.xfaFactory.isValid() : false; + } + get htmlForXfa() { + return this.xfaFactory ? this.xfaFactory.getPages() : null; + } + async loadXfaImages() { + const xfaImagesDict = await this.pdfManager.ensureCatalog("xfaImages"); + if (!xfaImagesDict) { + return; + } + const keys = xfaImagesDict.getKeys(); + const objectLoader = new ObjectLoader(xfaImagesDict, keys, this.xref); + await objectLoader.load(); + const xfaImages = new Map(); + for (const key of keys) { + const stream = xfaImagesDict.get(key); + if (stream instanceof BaseStream) { + xfaImages.set(key, stream.getBytes()); + } + } + this.xfaFactory.setImages(xfaImages); + } + async loadXfaFonts(handler, task) { + const acroForm = await this.pdfManager.ensureCatalog("acroForm"); + if (!acroForm) { + return; + } + const resources = await acroForm.getAsync("DR"); + if (!(resources instanceof Dict)) { + return; + } + const objectLoader = new ObjectLoader(resources, ["Font"], this.xref); + await objectLoader.load(); + const fontRes = resources.get("Font"); + if (!(fontRes instanceof Dict)) { + return; + } + const options = Object.assign(Object.create(null), this.pdfManager.evaluatorOptions); + options.useSystemFonts = false; + const partialEvaluator = new PartialEvaluator({ + xref: this.xref, + handler, + pageIndex: -1, + idFactory: this._globalIdFactory, + fontCache: this.catalog.fontCache, + builtInCMapCache: this.catalog.builtInCMapCache, + standardFontDataCache: this.catalog.standardFontDataCache, + options + }); + const operatorList = new OperatorList(); + const pdfFonts = []; + const initialState = { + get font() { + return pdfFonts.at(-1); + }, + set font(font) { + pdfFonts.push(font); + }, + clone() { + return this; + } + }; + const promises = []; + for (const [fontName, font] of fontRes) { + const descriptor = font.get("FontDescriptor"); + if (!(descriptor instanceof Dict)) { + continue; + } + let fontFamily = descriptor.get("FontFamily"); + fontFamily = fontFamily.replaceAll(/[ ]+(\d)/g, "$1"); + const fontWeight = descriptor.get("FontWeight"); + const italicAngle = -descriptor.get("ItalicAngle"); + const cssFontInfo = { + fontFamily, + fontWeight, + italicAngle + }; + if (!validateCSSFont(cssFontInfo)) { + continue; + } + promises.push(partialEvaluator.handleSetFont(resources, [Name.get(fontName), 1], null, operatorList, task, initialState, null, cssFontInfo).catch(function (reason) { + warn(`loadXfaFonts: "${reason}".`); + return null; + })); + } + await Promise.all(promises); + const missingFonts = this.xfaFactory.setFonts(pdfFonts); + if (!missingFonts) { + return; + } + options.ignoreErrors = true; + promises.length = 0; + pdfFonts.length = 0; + const reallyMissingFonts = new Set(); + for (const missing of missingFonts) { + if (!getXfaFontName(`${missing}-Regular`)) { + reallyMissingFonts.add(missing); + } + } + if (reallyMissingFonts.size) { + missingFonts.push("PdfJS-Fallback"); + } + for (const missing of missingFonts) { + if (reallyMissingFonts.has(missing)) { + continue; + } + for (const fontInfo of [{ + name: "Regular", + fontWeight: 400, + italicAngle: 0 + }, { + name: "Bold", + fontWeight: 700, + italicAngle: 0 + }, { + name: "Italic", + fontWeight: 400, + italicAngle: 12 + }, { + name: "BoldItalic", + fontWeight: 700, + italicAngle: 12 + }]) { + const name = `${missing}-${fontInfo.name}`; + const dict = getXfaFontDict(name); + promises.push(partialEvaluator.handleSetFont(resources, [Name.get(name), 1], null, operatorList, task, initialState, dict, { + fontFamily: missing, + fontWeight: fontInfo.fontWeight, + italicAngle: fontInfo.italicAngle + }).catch(function (reason) { + warn(`loadXfaFonts: "${reason}".`); + return null; + })); + } + } + await Promise.all(promises); + this.xfaFactory.appendFonts(pdfFonts, reallyMissingFonts); + } + async serializeXfaData(annotationStorage) { + return this.xfaFactory ? this.xfaFactory.serializeData(annotationStorage) : null; + } + get version() { + return this.catalog.version || this._version; + } + get formInfo() { + const formInfo = { + hasFields: false, + hasAcroForm: false, + hasXfa: false, + hasSignatures: false + }; + const acroForm = this.catalog.acroForm; + if (!acroForm) { + return shadow(this, "formInfo", formInfo); + } + try { + const fields = acroForm.get("Fields"); + const hasFields = Array.isArray(fields) && fields.length > 0; + formInfo.hasFields = hasFields; + const xfa = acroForm.get("XFA"); + formInfo.hasXfa = Array.isArray(xfa) && xfa.length > 0 || xfa instanceof BaseStream && !xfa.isEmpty; + const sigFlags = acroForm.get("SigFlags"); + const hasSignatures = !!(sigFlags & 0x1); + const hasOnlyDocumentSignatures = hasSignatures && this._hasOnlyDocumentSignatures(fields); + formInfo.hasAcroForm = hasFields && !hasOnlyDocumentSignatures; + formInfo.hasSignatures = hasSignatures; + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + warn(`Cannot fetch form information: "${ex}".`); + } + return shadow(this, "formInfo", formInfo); + } + get documentInfo() { + const docInfo = { + PDFFormatVersion: this.version, + Language: this.catalog.lang, + EncryptFilterName: this.xref.encrypt ? this.xref.encrypt.filterName : null, + IsLinearized: !!this.linearization, + IsAcroFormPresent: this.formInfo.hasAcroForm, + IsXFAPresent: this.formInfo.hasXfa, + IsCollectionPresent: !!this.catalog.collection, + IsSignaturesPresent: this.formInfo.hasSignatures + }; + let infoDict; + try { + infoDict = this.xref.trailer.get("Info"); + } catch (err) { + if (err instanceof MissingDataException) { + throw err; + } + info("The document information dictionary is invalid."); + } + if (!(infoDict instanceof Dict)) { + return shadow(this, "documentInfo", docInfo); + } + for (const key of infoDict.getKeys()) { + const value = infoDict.get(key); + switch (key) { + case "Title": + case "Author": + case "Subject": + case "Keywords": + case "Creator": + case "Producer": + case "CreationDate": + case "ModDate": + if (typeof value === "string") { + docInfo[key] = stringToPDFString(value); + continue; + } + break; + case "Trapped": + if (value instanceof Name) { + docInfo[key] = value; + continue; + } + break; + default: + let customValue; + switch (typeof value) { + case "string": + customValue = stringToPDFString(value); + break; + case "number": + case "boolean": + customValue = value; + break; + default: + if (value instanceof Name) { + customValue = value; + } + break; + } + if (customValue === undefined) { + warn(`Bad value, for custom key "${key}", in Info: ${value}.`); + continue; + } + if (!docInfo.Custom) { + docInfo.Custom = Object.create(null); + } + docInfo.Custom[key] = customValue; + continue; + } + warn(`Bad value, for key "${key}", in Info: ${value}.`); + } + return shadow(this, "documentInfo", docInfo); + } + get fingerprints() { + const FINGERPRINT_FIRST_BYTES = 1024; + const EMPTY_FINGERPRINT = "\x00".repeat(16); + function validate(data) { + return typeof data === "string" && data.length === 16 && data !== EMPTY_FINGERPRINT; + } + const id = this.xref.trailer.get("ID"); + let hashOriginal, hashModified; + if (Array.isArray(id) && validate(id[0])) { + hashOriginal = stringToBytes(id[0]); + if (id[1] !== id[0] && validate(id[1])) { + hashModified = stringToBytes(id[1]); + } + } else { + hashOriginal = calculateMD5(this.stream.getByteRange(0, FINGERPRINT_FIRST_BYTES), 0, FINGERPRINT_FIRST_BYTES); + } + return shadow(this, "fingerprints", [toHexUtil(hashOriginal), hashModified ? toHexUtil(hashModified) : null]); + } + async _getLinearizationPage(pageIndex) { + const { + catalog, + linearization, + xref + } = this; + const ref = Ref.get(linearization.objectNumberFirst, 0); + try { + const obj = await xref.fetchAsync(ref); + if (obj instanceof Dict) { + let type = obj.getRaw("Type"); + if (type instanceof Ref) { + type = await xref.fetchAsync(type); + } + if (isName(type, "Page") || !obj.has("Type") && !obj.has("Kids") && obj.has("Contents")) { + if (!catalog.pageKidsCountCache.has(ref)) { + catalog.pageKidsCountCache.put(ref, 1); + } + if (!catalog.pageIndexCache.has(ref)) { + catalog.pageIndexCache.put(ref, 0); + } + return [obj, ref]; + } + } + throw new FormatError("The Linearization dictionary doesn't point to a valid Page dictionary."); + } catch (reason) { + warn(`_getLinearizationPage: "${reason.message}".`); + return catalog.getPageDict(pageIndex); + } + } + getPage(pageIndex) { + const cachedPromise = this._pagePromises.get(pageIndex); + if (cachedPromise) { + return cachedPromise; + } + const { + catalog, + linearization, + xfaFactory + } = this; + let promise; + if (xfaFactory) { + promise = Promise.resolve([Dict.empty, null]); + } else if (linearization?.pageFirst === pageIndex) { + promise = this._getLinearizationPage(pageIndex); + } else { + promise = catalog.getPageDict(pageIndex); + } + promise = promise.then(([pageDict, ref]) => { + return new Page({ + pdfManager: this.pdfManager, + xref: this.xref, + pageIndex, + pageDict, + ref, + globalIdFactory: this._globalIdFactory, + fontCache: catalog.fontCache, + builtInCMapCache: catalog.builtInCMapCache, + standardFontDataCache: catalog.standardFontDataCache, + globalImageCache: catalog.globalImageCache, + systemFontCache: catalog.systemFontCache, + nonBlendModesSet: catalog.nonBlendModesSet, + xfaFactory + }); + }); + this._pagePromises.set(pageIndex, promise); + return promise; + } + async checkFirstPage(recoveryMode = false) { + if (recoveryMode) { + return; + } + try { + await this.getPage(0); + } catch (reason) { + if (reason instanceof XRefEntryException) { + this._pagePromises.delete(0); + await this.cleanup(); + throw new XRefParseException(); + } + } + } + async checkLastPage(recoveryMode = false) { + const { + catalog, + pdfManager + } = this; + catalog.setActualNumPages(); + let numPages; + try { + await Promise.all([pdfManager.ensureDoc("xfaFactory"), pdfManager.ensureDoc("linearization"), pdfManager.ensureCatalog("numPages")]); + if (this.xfaFactory) { + return; + } else if (this.linearization) { + numPages = this.linearization.numPages; + } else { + numPages = catalog.numPages; + } + if (!Number.isInteger(numPages)) { + throw new FormatError("Page count is not an integer."); + } else if (numPages <= 1) { + return; + } + await this.getPage(numPages - 1); + } catch (reason) { + this._pagePromises.delete(numPages - 1); + await this.cleanup(); + if (reason instanceof XRefEntryException && !recoveryMode) { + throw new XRefParseException(); + } + warn(`checkLastPage - invalid /Pages tree /Count: ${numPages}.`); + let pagesTree; + try { + pagesTree = await catalog.getAllPageDicts(recoveryMode); + } catch (reasonAll) { + if (reasonAll instanceof XRefEntryException && !recoveryMode) { + throw new XRefParseException(); + } + catalog.setActualNumPages(1); + return; + } + for (const [pageIndex, [pageDict, ref]] of pagesTree) { + let promise; + if (pageDict instanceof Error) { + promise = Promise.reject(pageDict); + promise.catch(() => {}); + } else { + promise = Promise.resolve(new Page({ + pdfManager, + xref: this.xref, + pageIndex, + pageDict, + ref, + globalIdFactory: this._globalIdFactory, + fontCache: catalog.fontCache, + builtInCMapCache: catalog.builtInCMapCache, + standardFontDataCache: catalog.standardFontDataCache, + globalImageCache: catalog.globalImageCache, + systemFontCache: catalog.systemFontCache, + nonBlendModesSet: catalog.nonBlendModesSet, + xfaFactory: null + })); + } + this._pagePromises.set(pageIndex, promise); + } + catalog.setActualNumPages(pagesTree.size); + } + } + fontFallback(id, handler) { + return this.catalog.fontFallback(id, handler); + } + async cleanup(manuallyTriggered = false) { + return this.catalog ? this.catalog.cleanup(manuallyTriggered) : clearGlobalCaches(); + } + async #collectFieldObjects(name, parentRef, fieldRef, promises, annotationGlobals, visitedRefs, orphanFields) { + const { + xref + } = this; + if (!(fieldRef instanceof Ref) || visitedRefs.has(fieldRef)) { + return; + } + visitedRefs.put(fieldRef); + const field = await xref.fetchAsync(fieldRef); + if (!(field instanceof Dict)) { + return; + } + if (field.has("T")) { + const partName = stringToPDFString(await field.getAsync("T")); + name = name === "" ? partName : `${name}.${partName}`; + } else { + let obj = field; + while (true) { + obj = obj.getRaw("Parent") || parentRef; + if (obj instanceof Ref) { + if (visitedRefs.has(obj)) { + break; + } + obj = await xref.fetchAsync(obj); + } + if (!(obj instanceof Dict)) { + break; + } + if (obj.has("T")) { + const partName = stringToPDFString(await obj.getAsync("T")); + name = name === "" ? partName : `${name}.${partName}`; + break; + } + } + } + if (parentRef && !field.has("Parent") && isName(field.get("Subtype"), "Widget")) { + orphanFields.put(fieldRef, parentRef); + } + if (!promises.has(name)) { + promises.set(name, []); + } + promises.get(name).push(AnnotationFactory.create(xref, fieldRef, annotationGlobals, null, true, orphanFields, null).then(annotation => annotation?.getFieldObject()).catch(function (reason) { + warn(`#collectFieldObjects: "${reason}".`); + return null; + })); + if (!field.has("Kids")) { + return; + } + const kids = await field.getAsync("Kids"); + if (Array.isArray(kids)) { + for (const kid of kids) { + await this.#collectFieldObjects(name, fieldRef, kid, promises, annotationGlobals, visitedRefs, orphanFields); + } + } + } + get fieldObjects() { + const promise = this.pdfManager.ensureDoc("formInfo").then(async formInfo => { + if (!formInfo.hasFields) { + return null; + } + const [annotationGlobals, acroForm] = await Promise.all([this.pdfManager.ensureDoc("annotationGlobals"), this.pdfManager.ensureCatalog("acroForm")]); + if (!annotationGlobals) { + return null; + } + const visitedRefs = new RefSet(); + const allFields = Object.create(null); + const fieldPromises = new Map(); + const orphanFields = new RefSetCache(); + for (const fieldRef of await acroForm.getAsync("Fields")) { + await this.#collectFieldObjects("", null, fieldRef, fieldPromises, annotationGlobals, visitedRefs, orphanFields); + } + const allPromises = []; + for (const [name, promises] of fieldPromises) { + allPromises.push(Promise.all(promises).then(fields => { + fields = fields.filter(field => !!field); + if (fields.length > 0) { + allFields[name] = fields; + } + })); + } + await Promise.all(allPromises); + return { + allFields, + orphanFields + }; + }); + return shadow(this, "fieldObjects", promise); + } + get hasJSActions() { + const promise = this.pdfManager.ensureDoc("_parseHasJSActions"); + return shadow(this, "hasJSActions", promise); + } + async _parseHasJSActions() { + const [catalogJsActions, fieldObjects] = await Promise.all([this.pdfManager.ensureCatalog("jsActions"), this.pdfManager.ensureDoc("fieldObjects")]); + if (catalogJsActions) { + return true; + } + if (fieldObjects) { + return Object.values(fieldObjects.allFields).some(fieldObject => fieldObject.some(object => object.actions !== null)); + } + return false; + } + get calculationOrderIds() { + const calculationOrder = this.catalog.acroForm?.get("CO"); + if (!Array.isArray(calculationOrder) || calculationOrder.length === 0) { + return shadow(this, "calculationOrderIds", null); + } + const ids = []; + for (const id of calculationOrder) { + if (id instanceof Ref) { + ids.push(id.toString()); + } + } + return shadow(this, "calculationOrderIds", ids.length ? ids : null); + } + get annotationGlobals() { + return shadow(this, "annotationGlobals", AnnotationFactory.createGlobals(this.pdfManager)); + } +} + +;// ./src/core/pdf_manager.js + + + + + +function parseDocBaseUrl(url) { + if (url) { + const absoluteUrl = createValidAbsoluteUrl(url); + if (absoluteUrl) { + return absoluteUrl.href; + } + warn(`Invalid absolute docBaseUrl: "${url}".`); + } + return null; +} +class BasePdfManager { + constructor(args) { + this._docBaseUrl = parseDocBaseUrl(args.docBaseUrl); + this._docId = args.docId; + this._password = args.password; + this.enableXfa = args.enableXfa; + args.evaluatorOptions.isOffscreenCanvasSupported &&= FeatureTest.isOffscreenCanvasSupported; + args.evaluatorOptions.isImageDecoderSupported &&= FeatureTest.isImageDecoderSupported; + this.evaluatorOptions = Object.freeze(args.evaluatorOptions); + } + get docId() { + return this._docId; + } + get password() { + return this._password; + } + get docBaseUrl() { + return this._docBaseUrl; + } + get catalog() { + return this.pdfDocument.catalog; + } + ensureDoc(prop, args) { + return this.ensure(this.pdfDocument, prop, args); + } + ensureXRef(prop, args) { + return this.ensure(this.pdfDocument.xref, prop, args); + } + ensureCatalog(prop, args) { + return this.ensure(this.pdfDocument.catalog, prop, args); + } + getPage(pageIndex) { + return this.pdfDocument.getPage(pageIndex); + } + fontFallback(id, handler) { + return this.pdfDocument.fontFallback(id, handler); + } + loadXfaFonts(handler, task) { + return this.pdfDocument.loadXfaFonts(handler, task); + } + loadXfaImages() { + return this.pdfDocument.loadXfaImages(); + } + serializeXfaData(annotationStorage) { + return this.pdfDocument.serializeXfaData(annotationStorage); + } + cleanup(manuallyTriggered = false) { + return this.pdfDocument.cleanup(manuallyTriggered); + } + async ensure(obj, prop, args) { + unreachable("Abstract method `ensure` called"); + } + requestRange(begin, end) { + unreachable("Abstract method `requestRange` called"); + } + requestLoadedStream(noFetch = false) { + unreachable("Abstract method `requestLoadedStream` called"); + } + sendProgressiveData(chunk) { + unreachable("Abstract method `sendProgressiveData` called"); + } + updatePassword(password) { + this._password = password; + } + terminate(reason) { + unreachable("Abstract method `terminate` called"); + } +} +class LocalPdfManager extends BasePdfManager { + constructor(args) { + super(args); + const stream = new Stream(args.source); + this.pdfDocument = new PDFDocument(this, stream); + this._loadedStreamPromise = Promise.resolve(stream); + } + async ensure(obj, prop, args) { + const value = obj[prop]; + if (typeof value === "function") { + return value.apply(obj, args); + } + return value; + } + requestRange(begin, end) { + return Promise.resolve(); + } + requestLoadedStream(noFetch = false) { + return this._loadedStreamPromise; + } + terminate(reason) {} +} +class NetworkPdfManager extends BasePdfManager { + constructor(args) { + super(args); + this.streamManager = new ChunkedStreamManager(args.source, { + msgHandler: args.handler, + length: args.length, + disableAutoFetch: args.disableAutoFetch, + rangeChunkSize: args.rangeChunkSize + }); + this.pdfDocument = new PDFDocument(this, this.streamManager.getStream()); + } + async ensure(obj, prop, args) { + try { + const value = obj[prop]; + if (typeof value === "function") { + return value.apply(obj, args); + } + return value; + } catch (ex) { + if (!(ex instanceof MissingDataException)) { + throw ex; + } + await this.requestRange(ex.begin, ex.end); + return this.ensure(obj, prop, args); + } + } + requestRange(begin, end) { + return this.streamManager.requestRange(begin, end); + } + requestLoadedStream(noFetch = false) { + return this.streamManager.requestAllChunks(noFetch); + } + sendProgressiveData(chunk) { + this.streamManager.onReceiveData({ + chunk + }); + } + terminate(reason) { + this.streamManager.abort(reason); + } +} + +;// ./src/shared/message_handler.js + +const CallbackKind = { + DATA: 1, + ERROR: 2 +}; +const StreamKind = { + CANCEL: 1, + CANCEL_COMPLETE: 2, + CLOSE: 3, + ENQUEUE: 4, + ERROR: 5, + PULL: 6, + PULL_COMPLETE: 7, + START_COMPLETE: 8 +}; +function onFn() {} +function wrapReason(ex) { + if (ex instanceof AbortException || ex instanceof InvalidPDFException || ex instanceof MissingPDFException || ex instanceof PasswordException || ex instanceof UnexpectedResponseException || ex instanceof UnknownErrorException) { + return ex; + } + if (!(ex instanceof Error || typeof ex === "object" && ex !== null)) { + unreachable('wrapReason: Expected "reason" to be a (possibly cloned) Error.'); + } + switch (ex.name) { + case "AbortException": + return new AbortException(ex.message); + case "InvalidPDFException": + return new InvalidPDFException(ex.message); + case "MissingPDFException": + return new MissingPDFException(ex.message); + case "PasswordException": + return new PasswordException(ex.message, ex.code); + case "UnexpectedResponseException": + return new UnexpectedResponseException(ex.message, ex.status); + case "UnknownErrorException": + return new UnknownErrorException(ex.message, ex.details); + } + return new UnknownErrorException(ex.message, ex.toString()); +} +class MessageHandler { + #messageAC = new AbortController(); + constructor(sourceName, targetName, comObj) { + this.sourceName = sourceName; + this.targetName = targetName; + this.comObj = comObj; + this.callbackId = 1; + this.streamId = 1; + this.streamSinks = Object.create(null); + this.streamControllers = Object.create(null); + this.callbackCapabilities = Object.create(null); + this.actionHandler = Object.create(null); + comObj.addEventListener("message", this.#onMessage.bind(this), { + signal: this.#messageAC.signal + }); + } + #onMessage({ + data + }) { + if (data.targetName !== this.sourceName) { + return; + } + if (data.stream) { + this.#processStreamMessage(data); + return; + } + if (data.callback) { + const callbackId = data.callbackId; + const capability = this.callbackCapabilities[callbackId]; + if (!capability) { + throw new Error(`Cannot resolve callback ${callbackId}`); + } + delete this.callbackCapabilities[callbackId]; + if (data.callback === CallbackKind.DATA) { + capability.resolve(data.data); + } else if (data.callback === CallbackKind.ERROR) { + capability.reject(wrapReason(data.reason)); + } else { + throw new Error("Unexpected callback case"); + } + return; + } + const action = this.actionHandler[data.action]; + if (!action) { + throw new Error(`Unknown action from worker: ${data.action}`); + } + if (data.callbackId) { + const sourceName = this.sourceName, + targetName = data.sourceName, + comObj = this.comObj; + Promise.try(action, data.data).then(function (result) { + comObj.postMessage({ + sourceName, + targetName, + callback: CallbackKind.DATA, + callbackId: data.callbackId, + data: result + }); + }, function (reason) { + comObj.postMessage({ + sourceName, + targetName, + callback: CallbackKind.ERROR, + callbackId: data.callbackId, + reason: wrapReason(reason) + }); + }); + return; + } + if (data.streamId) { + this.#createStreamSink(data); + return; + } + action(data.data); + } + on(actionName, handler) { + const ah = this.actionHandler; + if (ah[actionName]) { + throw new Error(`There is already an actionName called "${actionName}"`); + } + ah[actionName] = handler; + } + send(actionName, data, transfers) { + this.comObj.postMessage({ + sourceName: this.sourceName, + targetName: this.targetName, + action: actionName, + data + }, transfers); + } + sendWithPromise(actionName, data, transfers) { + const callbackId = this.callbackId++; + const capability = Promise.withResolvers(); + this.callbackCapabilities[callbackId] = capability; + try { + this.comObj.postMessage({ + sourceName: this.sourceName, + targetName: this.targetName, + action: actionName, + callbackId, + data + }, transfers); + } catch (ex) { + capability.reject(ex); + } + return capability.promise; + } + sendWithStream(actionName, data, queueingStrategy, transfers) { + const streamId = this.streamId++, + sourceName = this.sourceName, + targetName = this.targetName, + comObj = this.comObj; + return new ReadableStream({ + start: controller => { + const startCapability = Promise.withResolvers(); + this.streamControllers[streamId] = { + controller, + startCall: startCapability, + pullCall: null, + cancelCall: null, + isClosed: false + }; + comObj.postMessage({ + sourceName, + targetName, + action: actionName, + streamId, + data, + desiredSize: controller.desiredSize + }, transfers); + return startCapability.promise; + }, + pull: controller => { + const pullCapability = Promise.withResolvers(); + this.streamControllers[streamId].pullCall = pullCapability; + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.PULL, + streamId, + desiredSize: controller.desiredSize + }); + return pullCapability.promise; + }, + cancel: reason => { + assert(reason instanceof Error, "cancel must have a valid reason"); + const cancelCapability = Promise.withResolvers(); + this.streamControllers[streamId].cancelCall = cancelCapability; + this.streamControllers[streamId].isClosed = true; + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.CANCEL, + streamId, + reason: wrapReason(reason) + }); + return cancelCapability.promise; + } + }, queueingStrategy); + } + #createStreamSink(data) { + const streamId = data.streamId, + sourceName = this.sourceName, + targetName = data.sourceName, + comObj = this.comObj; + const self = this, + action = this.actionHandler[data.action]; + const streamSink = { + enqueue(chunk, size = 1, transfers) { + if (this.isCancelled) { + return; + } + const lastDesiredSize = this.desiredSize; + this.desiredSize -= size; + if (lastDesiredSize > 0 && this.desiredSize <= 0) { + this.sinkCapability = Promise.withResolvers(); + this.ready = this.sinkCapability.promise; + } + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.ENQUEUE, + streamId, + chunk + }, transfers); + }, + close() { + if (this.isCancelled) { + return; + } + this.isCancelled = true; + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.CLOSE, + streamId + }); + delete self.streamSinks[streamId]; + }, + error(reason) { + assert(reason instanceof Error, "error must have a valid reason"); + if (this.isCancelled) { + return; + } + this.isCancelled = true; + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.ERROR, + streamId, + reason: wrapReason(reason) + }); + }, + sinkCapability: Promise.withResolvers(), + onPull: null, + onCancel: null, + isCancelled: false, + desiredSize: data.desiredSize, + ready: null + }; + streamSink.sinkCapability.resolve(); + streamSink.ready = streamSink.sinkCapability.promise; + this.streamSinks[streamId] = streamSink; + Promise.try(action, data.data, streamSink).then(function () { + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.START_COMPLETE, + streamId, + success: true + }); + }, function (reason) { + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.START_COMPLETE, + streamId, + reason: wrapReason(reason) + }); + }); + } + #processStreamMessage(data) { + const streamId = data.streamId, + sourceName = this.sourceName, + targetName = data.sourceName, + comObj = this.comObj; + const streamController = this.streamControllers[streamId], + streamSink = this.streamSinks[streamId]; + switch (data.stream) { + case StreamKind.START_COMPLETE: + if (data.success) { + streamController.startCall.resolve(); + } else { + streamController.startCall.reject(wrapReason(data.reason)); + } + break; + case StreamKind.PULL_COMPLETE: + if (data.success) { + streamController.pullCall.resolve(); + } else { + streamController.pullCall.reject(wrapReason(data.reason)); + } + break; + case StreamKind.PULL: + if (!streamSink) { + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.PULL_COMPLETE, + streamId, + success: true + }); + break; + } + if (streamSink.desiredSize <= 0 && data.desiredSize > 0) { + streamSink.sinkCapability.resolve(); + } + streamSink.desiredSize = data.desiredSize; + Promise.try(streamSink.onPull || onFn).then(function () { + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.PULL_COMPLETE, + streamId, + success: true + }); + }, function (reason) { + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.PULL_COMPLETE, + streamId, + reason: wrapReason(reason) + }); + }); + break; + case StreamKind.ENQUEUE: + assert(streamController, "enqueue should have stream controller"); + if (streamController.isClosed) { + break; + } + streamController.controller.enqueue(data.chunk); + break; + case StreamKind.CLOSE: + assert(streamController, "close should have stream controller"); + if (streamController.isClosed) { + break; + } + streamController.isClosed = true; + streamController.controller.close(); + this.#deleteStreamController(streamController, streamId); + break; + case StreamKind.ERROR: + assert(streamController, "error should have stream controller"); + streamController.controller.error(wrapReason(data.reason)); + this.#deleteStreamController(streamController, streamId); + break; + case StreamKind.CANCEL_COMPLETE: + if (data.success) { + streamController.cancelCall.resolve(); + } else { + streamController.cancelCall.reject(wrapReason(data.reason)); + } + this.#deleteStreamController(streamController, streamId); + break; + case StreamKind.CANCEL: + if (!streamSink) { + break; + } + const dataReason = wrapReason(data.reason); + Promise.try(streamSink.onCancel || onFn, dataReason).then(function () { + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.CANCEL_COMPLETE, + streamId, + success: true + }); + }, function (reason) { + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.CANCEL_COMPLETE, + streamId, + reason: wrapReason(reason) + }); + }); + streamSink.sinkCapability.reject(dataReason); + streamSink.isCancelled = true; + delete this.streamSinks[streamId]; + break; + default: + throw new Error("Unexpected stream case"); + } + } + async #deleteStreamController(streamController, streamId) { + await Promise.allSettled([streamController.startCall?.promise, streamController.pullCall?.promise, streamController.cancelCall?.promise]); + delete this.streamControllers[streamId]; + } + destroy() { + this.#messageAC?.abort(); + this.#messageAC = null; + } +} + +;// ./src/core/writer.js + + + + + + + +async function writeObject(ref, obj, buffer, { + encrypt = null +}) { + const transform = encrypt?.createCipherTransform(ref.num, ref.gen); + buffer.push(`${ref.num} ${ref.gen} obj\n`); + if (obj instanceof Dict) { + await writeDict(obj, buffer, transform); + } else if (obj instanceof BaseStream) { + await writeStream(obj, buffer, transform); + } else if (Array.isArray(obj) || ArrayBuffer.isView(obj)) { + await writeArray(obj, buffer, transform); + } + buffer.push("\nendobj\n"); +} +async function writeDict(dict, buffer, transform) { + buffer.push("<<"); + for (const key of dict.getKeys()) { + buffer.push(` /${escapePDFName(key)} `); + await writeValue(dict.getRaw(key), buffer, transform); + } + buffer.push(">>"); +} +async function writeStream(stream, buffer, transform) { + let bytes = stream.getBytes(); + const { + dict + } = stream; + const [filter, params] = await Promise.all([dict.getAsync("Filter"), dict.getAsync("DecodeParms")]); + const filterZero = Array.isArray(filter) ? await dict.xref.fetchIfRefAsync(filter[0]) : filter; + const isFilterZeroFlateDecode = isName(filterZero, "FlateDecode"); + const MIN_LENGTH_FOR_COMPRESSING = 256; + if (bytes.length >= MIN_LENGTH_FOR_COMPRESSING || isFilterZeroFlateDecode) { + try { + const cs = new CompressionStream("deflate"); + const writer = cs.writable.getWriter(); + await writer.ready; + writer.write(bytes).then(async () => { + await writer.ready; + await writer.close(); + }).catch(() => {}); + const buf = await new Response(cs.readable).arrayBuffer(); + bytes = new Uint8Array(buf); + let newFilter, newParams; + if (!filter) { + newFilter = Name.get("FlateDecode"); + } else if (!isFilterZeroFlateDecode) { + newFilter = Array.isArray(filter) ? [Name.get("FlateDecode"), ...filter] : [Name.get("FlateDecode"), filter]; + if (params) { + newParams = Array.isArray(params) ? [null, ...params] : [null, params]; + } + } + if (newFilter) { + dict.set("Filter", newFilter); + } + if (newParams) { + dict.set("DecodeParms", newParams); + } + } catch (ex) { + info(`writeStream - cannot compress data: "${ex}".`); + } + } + let string = bytesToString(bytes); + if (transform) { + string = transform.encryptString(string); + } + dict.set("Length", string.length); + await writeDict(dict, buffer, transform); + buffer.push(" stream\n", string, "\nendstream"); +} +async function writeArray(array, buffer, transform) { + buffer.push("["); + let first = true; + for (const val of array) { + if (!first) { + buffer.push(" "); + } else { + first = false; + } + await writeValue(val, buffer, transform); + } + buffer.push("]"); +} +async function writeValue(value, buffer, transform) { + if (value instanceof Name) { + buffer.push(`/${escapePDFName(value.name)}`); + } else if (value instanceof Ref) { + buffer.push(`${value.num} ${value.gen} R`); + } else if (Array.isArray(value) || ArrayBuffer.isView(value)) { + await writeArray(value, buffer, transform); + } else if (typeof value === "string") { + if (transform) { + value = transform.encryptString(value); + } + buffer.push(`(${escapeString(value)})`); + } else if (typeof value === "number") { + buffer.push(numberToString(value)); + } else if (typeof value === "boolean") { + buffer.push(value.toString()); + } else if (value instanceof Dict) { + await writeDict(value, buffer, transform); + } else if (value instanceof BaseStream) { + await writeStream(value, buffer, transform); + } else if (value === null) { + buffer.push("null"); + } else { + warn(`Unhandled value in writer: ${typeof value}, please file a bug.`); + } +} +function writeInt(number, size, offset, buffer) { + for (let i = size + offset - 1; i > offset - 1; i--) { + buffer[i] = number & 0xff; + number >>= 8; + } + return offset + size; +} +function writeString(string, offset, buffer) { + for (let i = 0, len = string.length; i < len; i++) { + buffer[offset + i] = string.charCodeAt(i) & 0xff; + } +} +function computeMD5(filesize, xrefInfo) { + const time = Math.floor(Date.now() / 1000); + const filename = xrefInfo.filename || ""; + const md5Buffer = [time.toString(), filename, filesize.toString()]; + let md5BufferLen = md5Buffer.reduce((a, str) => a + str.length, 0); + for (const value of Object.values(xrefInfo.info)) { + md5Buffer.push(value); + md5BufferLen += value.length; + } + const array = new Uint8Array(md5BufferLen); + let offset = 0; + for (const str of md5Buffer) { + writeString(str, offset, array); + offset += str.length; + } + return bytesToString(calculateMD5(array)); +} +function writeXFADataForAcroform(str, changes) { + const xml = new SimpleXMLParser({ + hasAttributes: true + }).parseFromString(str); + for (const { + xfa + } of changes) { + if (!xfa) { + continue; + } + const { + path, + value + } = xfa; + if (!path) { + continue; + } + const nodePath = parseXFAPath(path); + let node = xml.documentElement.searchNode(nodePath, 0); + if (!node && nodePath.length > 1) { + node = xml.documentElement.searchNode([nodePath.at(-1)], 0); + } + if (node) { + node.childNodes = Array.isArray(value) ? value.map(val => new SimpleDOMNode("value", val)) : [new SimpleDOMNode("#text", value)]; + } else { + warn(`Node not found for path: ${path}`); + } + } + const buffer = []; + xml.documentElement.dump(buffer); + return buffer.join(""); +} +async function updateAcroform({ + xref, + acroForm, + acroFormRef, + hasXfa, + hasXfaDatasetsEntry, + xfaDatasetsRef, + needAppearances, + changes +}) { + if (hasXfa && !hasXfaDatasetsEntry && !xfaDatasetsRef) { + warn("XFA - Cannot save it"); + } + if (!needAppearances && (!hasXfa || !xfaDatasetsRef || hasXfaDatasetsEntry)) { + return; + } + const dict = acroForm.clone(); + if (hasXfa && !hasXfaDatasetsEntry) { + const newXfa = acroForm.get("XFA").slice(); + newXfa.splice(2, 0, "datasets"); + newXfa.splice(3, 0, xfaDatasetsRef); + dict.set("XFA", newXfa); + } + if (needAppearances) { + dict.set("NeedAppearances", true); + } + changes.put(acroFormRef, { + data: dict + }); +} +function updateXFA({ + xfaData, + xfaDatasetsRef, + changes, + xref +}) { + if (xfaData === null) { + const datasets = xref.fetchIfRef(xfaDatasetsRef); + xfaData = writeXFADataForAcroform(datasets.getString(), changes); + } + const xfaDataStream = new StringStream(xfaData); + xfaDataStream.dict = new Dict(xref); + xfaDataStream.dict.set("Type", Name.get("EmbeddedFile")); + changes.put(xfaDatasetsRef, { + data: xfaDataStream + }); +} +async function getXRefTable(xrefInfo, baseOffset, newRefs, newXref, buffer) { + buffer.push("xref\n"); + const indexes = getIndexes(newRefs); + let indexesPosition = 0; + for (const { + ref, + data + } of newRefs) { + if (ref.num === indexes[indexesPosition]) { + buffer.push(`${indexes[indexesPosition]} ${indexes[indexesPosition + 1]}\n`); + indexesPosition += 2; + } + if (data !== null) { + buffer.push(`${baseOffset.toString().padStart(10, "0")} ${Math.min(ref.gen, 0xffff).toString().padStart(5, "0")} n\r\n`); + baseOffset += data.length; + } else { + buffer.push(`0000000000 ${Math.min(ref.gen + 1, 0xffff).toString().padStart(5, "0")} f\r\n`); + } + } + computeIDs(baseOffset, xrefInfo, newXref); + buffer.push("trailer\n"); + await writeDict(newXref, buffer); + buffer.push("\nstartxref\n", baseOffset.toString(), "\n%%EOF\n"); +} +function getIndexes(newRefs) { + const indexes = []; + for (const { + ref + } of newRefs) { + if (ref.num === indexes.at(-2) + indexes.at(-1)) { + indexes[indexes.length - 1] += 1; + } else { + indexes.push(ref.num, 1); + } + } + return indexes; +} +async function getXRefStreamTable(xrefInfo, baseOffset, newRefs, newXref, buffer) { + const xrefTableData = []; + let maxOffset = 0; + let maxGen = 0; + for (const { + ref, + data + } of newRefs) { + let gen; + maxOffset = Math.max(maxOffset, baseOffset); + if (data !== null) { + gen = Math.min(ref.gen, 0xffff); + xrefTableData.push([1, baseOffset, gen]); + baseOffset += data.length; + } else { + gen = Math.min(ref.gen + 1, 0xffff); + xrefTableData.push([0, 0, gen]); + } + maxGen = Math.max(maxGen, gen); + } + newXref.set("Index", getIndexes(newRefs)); + const offsetSize = getSizeInBytes(maxOffset); + const maxGenSize = getSizeInBytes(maxGen); + const sizes = [1, offsetSize, maxGenSize]; + newXref.set("W", sizes); + computeIDs(baseOffset, xrefInfo, newXref); + const structSize = sizes.reduce((a, x) => a + x, 0); + const data = new Uint8Array(structSize * xrefTableData.length); + const stream = new Stream(data); + stream.dict = newXref; + let offset = 0; + for (const [type, objOffset, gen] of xrefTableData) { + offset = writeInt(type, sizes[0], offset, data); + offset = writeInt(objOffset, sizes[1], offset, data); + offset = writeInt(gen, sizes[2], offset, data); + } + await writeObject(xrefInfo.newRef, stream, buffer, {}); + buffer.push("startxref\n", baseOffset.toString(), "\n%%EOF\n"); +} +function computeIDs(baseOffset, xrefInfo, newXref) { + if (Array.isArray(xrefInfo.fileIds) && xrefInfo.fileIds.length > 0) { + const md5 = computeMD5(baseOffset, xrefInfo); + newXref.set("ID", [xrefInfo.fileIds[0], md5]); + } +} +function getTrailerDict(xrefInfo, changes, useXrefStream) { + const newXref = new Dict(null); + newXref.set("Prev", xrefInfo.startXRef); + const refForXrefTable = xrefInfo.newRef; + if (useXrefStream) { + changes.put(refForXrefTable, { + data: "" + }); + newXref.set("Size", refForXrefTable.num + 1); + newXref.set("Type", Name.get("XRef")); + } else { + newXref.set("Size", refForXrefTable.num); + } + if (xrefInfo.rootRef !== null) { + newXref.set("Root", xrefInfo.rootRef); + } + if (xrefInfo.infoRef !== null) { + newXref.set("Info", xrefInfo.infoRef); + } + if (xrefInfo.encryptRef !== null) { + newXref.set("Encrypt", xrefInfo.encryptRef); + } + return newXref; +} +async function writeChanges(changes, xref, buffer = []) { + const newRefs = []; + for (const [ref, { + data + }] of changes.items()) { + if (data === null || typeof data === "string") { + newRefs.push({ + ref, + data + }); + continue; + } + await writeObject(ref, data, buffer, xref); + newRefs.push({ + ref, + data: buffer.join("") + }); + buffer.length = 0; + } + return newRefs.sort((a, b) => a.ref.num - b.ref.num); +} +async function incrementalUpdate({ + originalData, + xrefInfo, + changes, + xref = null, + hasXfa = false, + xfaDatasetsRef = null, + hasXfaDatasetsEntry = false, + needAppearances, + acroFormRef = null, + acroForm = null, + xfaData = null, + useXrefStream = false +}) { + await updateAcroform({ + xref, + acroForm, + acroFormRef, + hasXfa, + hasXfaDatasetsEntry, + xfaDatasetsRef, + needAppearances, + changes + }); + if (hasXfa) { + updateXFA({ + xfaData, + xfaDatasetsRef, + changes, + xref + }); + } + const newXref = getTrailerDict(xrefInfo, changes, useXrefStream); + const buffer = []; + const newRefs = await writeChanges(changes, xref, buffer); + let baseOffset = originalData.length; + const lastByte = originalData.at(-1); + if (lastByte !== 0x0a && lastByte !== 0x0d) { + buffer.push("\n"); + baseOffset += 1; + } + for (const { + data + } of newRefs) { + if (data !== null) { + buffer.push(data); + } + } + await (useXrefStream ? getXRefStreamTable(xrefInfo, baseOffset, newRefs, newXref, buffer) : getXRefTable(xrefInfo, baseOffset, newRefs, newXref, buffer)); + const totalLength = buffer.reduce((a, str) => a + str.length, originalData.length); + const array = new Uint8Array(totalLength); + array.set(originalData); + let offset = originalData.length; + for (const str of buffer) { + writeString(str, offset, array); + offset += str.length; + } + return array; +} + +;// ./src/core/worker_stream.js + +class PDFWorkerStream { + constructor(msgHandler) { + this._msgHandler = msgHandler; + this._contentLength = null; + this._fullRequestReader = null; + this._rangeRequestReaders = []; + } + getFullReader() { + assert(!this._fullRequestReader, "PDFWorkerStream.getFullReader can only be called once."); + this._fullRequestReader = new PDFWorkerStreamReader(this._msgHandler); + return this._fullRequestReader; + } + getRangeReader(begin, end) { + const reader = new PDFWorkerStreamRangeReader(begin, end, this._msgHandler); + this._rangeRequestReaders.push(reader); + return reader; + } + cancelAllRequests(reason) { + this._fullRequestReader?.cancel(reason); + for (const reader of this._rangeRequestReaders.slice(0)) { + reader.cancel(reason); + } + } +} +class PDFWorkerStreamReader { + constructor(msgHandler) { + this._msgHandler = msgHandler; + this.onProgress = null; + this._contentLength = null; + this._isRangeSupported = false; + this._isStreamingSupported = false; + const readableStream = this._msgHandler.sendWithStream("GetReader"); + this._reader = readableStream.getReader(); + this._headersReady = this._msgHandler.sendWithPromise("ReaderHeadersReady").then(data => { + this._isStreamingSupported = data.isStreamingSupported; + this._isRangeSupported = data.isRangeSupported; + this._contentLength = data.contentLength; + }); + } + get headersReady() { + return this._headersReady; + } + get contentLength() { + return this._contentLength; + } + get isStreamingSupported() { + return this._isStreamingSupported; + } + get isRangeSupported() { + return this._isRangeSupported; + } + async read() { + const { + value, + done + } = await this._reader.read(); + if (done) { + return { + value: undefined, + done: true + }; + } + return { + value: value.buffer, + done: false + }; + } + cancel(reason) { + this._reader.cancel(reason); + } +} +class PDFWorkerStreamRangeReader { + constructor(begin, end, msgHandler) { + this._msgHandler = msgHandler; + this.onProgress = null; + const readableStream = this._msgHandler.sendWithStream("GetRangeReader", { + begin, + end + }); + this._reader = readableStream.getReader(); + } + get isStreamingSupported() { + return false; + } + async read() { + const { + value, + done + } = await this._reader.read(); + if (done) { + return { + value: undefined, + done: true + }; + } + return { + value: value.buffer, + done: false + }; + } + cancel(reason) { + this._reader.cancel(reason); + } +} + +;// ./src/core/worker.js + + + + + + + + + + +class WorkerTask { + constructor(name) { + this.name = name; + this.terminated = false; + this._capability = Promise.withResolvers(); + } + get finished() { + return this._capability.promise; + } + finish() { + this._capability.resolve(); + } + terminate() { + this.terminated = true; + } + ensureNotTerminated() { + if (this.terminated) { + throw new Error("Worker task was terminated"); + } + } +} +class WorkerMessageHandler { + static { + if (typeof window === "undefined" && !isNodeJS && typeof self !== "undefined" && typeof self.postMessage === "function" && "onmessage" in self) { + this.initializeFromPort(self); + } + } + static setup(handler, port) { + let testMessageProcessed = false; + handler.on("test", data => { + if (testMessageProcessed) { + return; + } + testMessageProcessed = true; + handler.send("test", data instanceof Uint8Array); + }); + handler.on("configure", data => { + setVerbosityLevel(data.verbosity); + }); + handler.on("GetDocRequest", data => this.createDocumentHandler(data, port)); + } + static createDocumentHandler(docParams, port) { + let pdfManager; + let terminated = false; + let cancelXHRs = null; + const WorkerTasks = new Set(); + const verbosity = getVerbosityLevel(); + const { + docId, + apiVersion + } = docParams; + const workerVersion = "4.10.38"; + if (apiVersion !== workerVersion) { + throw new Error(`The API version "${apiVersion}" does not match ` + `the Worker version "${workerVersion}".`); + } + const enumerableProperties = []; + for (const property in []) { + enumerableProperties.push(property); + } + if (enumerableProperties.length) { + throw new Error("The `Array.prototype` contains unexpected enumerable properties: " + enumerableProperties.join(", ") + "; thus breaking e.g. `for...in` iteration of `Array`s."); + } + const workerHandlerName = docId + "_worker"; + let handler = new MessageHandler(workerHandlerName, docId, port); + function ensureNotTerminated() { + if (terminated) { + throw new Error("Worker was terminated"); + } + } + function startWorkerTask(task) { + WorkerTasks.add(task); + } + function finishWorkerTask(task) { + task.finish(); + WorkerTasks.delete(task); + } + async function loadDocument(recoveryMode) { + await pdfManager.ensureDoc("checkHeader"); + await pdfManager.ensureDoc("parseStartXRef"); + await pdfManager.ensureDoc("parse", [recoveryMode]); + await pdfManager.ensureDoc("checkFirstPage", [recoveryMode]); + await pdfManager.ensureDoc("checkLastPage", [recoveryMode]); + const isPureXfa = await pdfManager.ensureDoc("isPureXfa"); + if (isPureXfa) { + const task = new WorkerTask("loadXfaFonts"); + startWorkerTask(task); + await Promise.all([pdfManager.loadXfaFonts(handler, task).catch(reason => {}).then(() => finishWorkerTask(task)), pdfManager.loadXfaImages()]); + } + const [numPages, fingerprints] = await Promise.all([pdfManager.ensureDoc("numPages"), pdfManager.ensureDoc("fingerprints")]); + const htmlForXfa = isPureXfa ? await pdfManager.ensureDoc("htmlForXfa") : null; + return { + numPages, + fingerprints, + htmlForXfa + }; + } + async function getPdfManager({ + data, + password, + disableAutoFetch, + rangeChunkSize, + length, + docBaseUrl, + enableXfa, + evaluatorOptions + }) { + const pdfManagerArgs = { + source: null, + disableAutoFetch, + docBaseUrl, + docId, + enableXfa, + evaluatorOptions, + handler, + length, + password, + rangeChunkSize + }; + if (data) { + pdfManagerArgs.source = data; + return new LocalPdfManager(pdfManagerArgs); + } + const pdfStream = new PDFWorkerStream(handler), + fullRequest = pdfStream.getFullReader(); + const pdfManagerCapability = Promise.withResolvers(); + let newPdfManager, + cachedChunks = [], + loaded = 0; + fullRequest.headersReady.then(function () { + if (!fullRequest.isRangeSupported) { + return; + } + pdfManagerArgs.source = pdfStream; + pdfManagerArgs.length = fullRequest.contentLength; + pdfManagerArgs.disableAutoFetch ||= fullRequest.isStreamingSupported; + newPdfManager = new NetworkPdfManager(pdfManagerArgs); + for (const chunk of cachedChunks) { + newPdfManager.sendProgressiveData(chunk); + } + cachedChunks = []; + pdfManagerCapability.resolve(newPdfManager); + cancelXHRs = null; + }).catch(function (reason) { + pdfManagerCapability.reject(reason); + cancelXHRs = null; + }); + new Promise(function (resolve, reject) { + const readChunk = function ({ + value, + done + }) { + try { + ensureNotTerminated(); + if (done) { + if (!newPdfManager) { + const pdfFile = arrayBuffersToBytes(cachedChunks); + cachedChunks = []; + if (length && pdfFile.length !== length) { + warn("reported HTTP length is different from actual"); + } + pdfManagerArgs.source = pdfFile; + newPdfManager = new LocalPdfManager(pdfManagerArgs); + pdfManagerCapability.resolve(newPdfManager); + } + cancelXHRs = null; + return; + } + loaded += value.byteLength; + if (!fullRequest.isStreamingSupported) { + handler.send("DocProgress", { + loaded, + total: Math.max(loaded, fullRequest.contentLength || 0) + }); + } + if (newPdfManager) { + newPdfManager.sendProgressiveData(value); + } else { + cachedChunks.push(value); + } + fullRequest.read().then(readChunk, reject); + } catch (e) { + reject(e); + } + }; + fullRequest.read().then(readChunk, reject); + }).catch(function (e) { + pdfManagerCapability.reject(e); + cancelXHRs = null; + }); + cancelXHRs = reason => { + pdfStream.cancelAllRequests(reason); + }; + return pdfManagerCapability.promise; + } + function setupDoc(data) { + function onSuccess(doc) { + ensureNotTerminated(); + handler.send("GetDoc", { + pdfInfo: doc + }); + } + function onFailure(ex) { + ensureNotTerminated(); + if (ex instanceof PasswordException) { + const task = new WorkerTask(`PasswordException: response ${ex.code}`); + startWorkerTask(task); + handler.sendWithPromise("PasswordRequest", ex).then(function ({ + password + }) { + finishWorkerTask(task); + pdfManager.updatePassword(password); + pdfManagerReady(); + }).catch(function () { + finishWorkerTask(task); + handler.send("DocException", ex); + }); + } else { + handler.send("DocException", wrapReason(ex)); + } + } + function pdfManagerReady() { + ensureNotTerminated(); + loadDocument(false).then(onSuccess, function (reason) { + ensureNotTerminated(); + if (!(reason instanceof XRefParseException)) { + onFailure(reason); + return; + } + pdfManager.requestLoadedStream().then(function () { + ensureNotTerminated(); + loadDocument(true).then(onSuccess, onFailure); + }); + }); + } + ensureNotTerminated(); + getPdfManager(data).then(function (newPdfManager) { + if (terminated) { + newPdfManager.terminate(new AbortException("Worker was terminated.")); + throw new Error("Worker was terminated"); + } + pdfManager = newPdfManager; + pdfManager.requestLoadedStream(true).then(stream => { + handler.send("DataLoaded", { + length: stream.bytes.byteLength + }); + }); + }).then(pdfManagerReady, onFailure); + } + handler.on("GetPage", function (data) { + return pdfManager.getPage(data.pageIndex).then(function (page) { + return Promise.all([pdfManager.ensure(page, "rotate"), pdfManager.ensure(page, "ref"), pdfManager.ensure(page, "userUnit"), pdfManager.ensure(page, "view")]).then(function ([rotate, ref, userUnit, view]) { + return { + rotate, + ref, + refStr: ref?.toString() ?? null, + userUnit, + view + }; + }); + }); + }); + handler.on("GetPageIndex", function (data) { + const pageRef = Ref.get(data.num, data.gen); + return pdfManager.ensureCatalog("getPageIndex", [pageRef]); + }); + handler.on("GetDestinations", function (data) { + return pdfManager.ensureCatalog("destinations"); + }); + handler.on("GetDestination", function (data) { + return pdfManager.ensureCatalog("getDestination", [data.id]); + }); + handler.on("GetPageLabels", function (data) { + return pdfManager.ensureCatalog("pageLabels"); + }); + handler.on("GetPageLayout", function (data) { + return pdfManager.ensureCatalog("pageLayout"); + }); + handler.on("GetPageMode", function (data) { + return pdfManager.ensureCatalog("pageMode"); + }); + handler.on("GetViewerPreferences", function (data) { + return pdfManager.ensureCatalog("viewerPreferences"); + }); + handler.on("GetOpenAction", function (data) { + return pdfManager.ensureCatalog("openAction"); + }); + handler.on("GetAttachments", function (data) { + return pdfManager.ensureCatalog("attachments"); + }); + handler.on("GetDocJSActions", function (data) { + return pdfManager.ensureCatalog("jsActions"); + }); + handler.on("GetPageJSActions", function ({ + pageIndex + }) { + return pdfManager.getPage(pageIndex).then(function (page) { + return pdfManager.ensure(page, "jsActions"); + }); + }); + handler.on("GetOutline", function (data) { + return pdfManager.ensureCatalog("documentOutline"); + }); + handler.on("GetOptionalContentConfig", function (data) { + return pdfManager.ensureCatalog("optionalContentConfig"); + }); + handler.on("GetPermissions", function (data) { + return pdfManager.ensureCatalog("permissions"); + }); + handler.on("GetMetadata", function (data) { + return Promise.all([pdfManager.ensureDoc("documentInfo"), pdfManager.ensureCatalog("metadata")]); + }); + handler.on("GetMarkInfo", function (data) { + return pdfManager.ensureCatalog("markInfo"); + }); + handler.on("GetData", function (data) { + return pdfManager.requestLoadedStream().then(function (stream) { + return stream.bytes; + }); + }); + handler.on("GetAnnotations", function ({ + pageIndex, + intent + }) { + return pdfManager.getPage(pageIndex).then(function (page) { + const task = new WorkerTask(`GetAnnotations: page ${pageIndex}`); + startWorkerTask(task); + return page.getAnnotationsData(handler, task, intent).then(data => { + finishWorkerTask(task); + return data; + }, reason => { + finishWorkerTask(task); + throw reason; + }); + }); + }); + handler.on("GetFieldObjects", function (data) { + return pdfManager.ensureDoc("fieldObjects").then(fieldObjects => fieldObjects?.allFields || null); + }); + handler.on("HasJSActions", function (data) { + return pdfManager.ensureDoc("hasJSActions"); + }); + handler.on("GetCalculationOrderIds", function (data) { + return pdfManager.ensureDoc("calculationOrderIds"); + }); + handler.on("SaveDocument", async function ({ + isPureXfa, + numPages, + annotationStorage, + filename + }) { + const globalPromises = [pdfManager.requestLoadedStream(), pdfManager.ensureCatalog("acroForm"), pdfManager.ensureCatalog("acroFormRef"), pdfManager.ensureDoc("startXRef"), pdfManager.ensureDoc("xref"), pdfManager.ensureDoc("linearization"), pdfManager.ensureCatalog("structTreeRoot")]; + const changes = new RefSetCache(); + const promises = []; + const newAnnotationsByPage = !isPureXfa ? getNewAnnotationsMap(annotationStorage) : null; + const [stream, acroForm, acroFormRef, startXRef, xref, linearization, _structTreeRoot] = await Promise.all(globalPromises); + const catalogRef = xref.trailer.getRaw("Root") || null; + let structTreeRoot; + if (newAnnotationsByPage) { + if (!_structTreeRoot) { + if (await StructTreeRoot.canCreateStructureTree({ + catalogRef, + pdfManager, + newAnnotationsByPage + })) { + structTreeRoot = null; + } + } else if (await _structTreeRoot.canUpdateStructTree({ + pdfManager, + xref, + newAnnotationsByPage + })) { + structTreeRoot = _structTreeRoot; + } + const imagePromises = AnnotationFactory.generateImages(annotationStorage.values(), xref, pdfManager.evaluatorOptions.isOffscreenCanvasSupported); + const newAnnotationPromises = structTreeRoot === undefined ? promises : []; + for (const [pageIndex, annotations] of newAnnotationsByPage) { + newAnnotationPromises.push(pdfManager.getPage(pageIndex).then(page => { + const task = new WorkerTask(`Save (editor): page ${pageIndex}`); + startWorkerTask(task); + return page.saveNewAnnotations(handler, task, annotations, imagePromises, changes).finally(function () { + finishWorkerTask(task); + }); + })); + } + if (structTreeRoot === null) { + promises.push(Promise.all(newAnnotationPromises).then(async () => { + await StructTreeRoot.createStructureTree({ + newAnnotationsByPage, + xref, + catalogRef, + pdfManager, + changes + }); + })); + } else if (structTreeRoot) { + promises.push(Promise.all(newAnnotationPromises).then(async () => { + await structTreeRoot.updateStructureTree({ + newAnnotationsByPage, + pdfManager, + changes + }); + })); + } + } + if (isPureXfa) { + promises.push(pdfManager.serializeXfaData(annotationStorage)); + } else { + for (let pageIndex = 0; pageIndex < numPages; pageIndex++) { + promises.push(pdfManager.getPage(pageIndex).then(function (page) { + const task = new WorkerTask(`Save: page ${pageIndex}`); + startWorkerTask(task); + return page.save(handler, task, annotationStorage, changes).finally(function () { + finishWorkerTask(task); + }); + })); + } + } + const refs = await Promise.all(promises); + let xfaData = null; + if (isPureXfa) { + xfaData = refs[0]; + if (!xfaData) { + return stream.bytes; + } + } else if (changes.size === 0) { + return stream.bytes; + } + const needAppearances = acroFormRef && acroForm instanceof Dict && changes.values().some(ref => ref.needAppearances); + const xfa = acroForm instanceof Dict && acroForm.get("XFA") || null; + let xfaDatasetsRef = null; + let hasXfaDatasetsEntry = false; + if (Array.isArray(xfa)) { + for (let i = 0, ii = xfa.length; i < ii; i += 2) { + if (xfa[i] === "datasets") { + xfaDatasetsRef = xfa[i + 1]; + hasXfaDatasetsEntry = true; + } + } + if (xfaDatasetsRef === null) { + xfaDatasetsRef = xref.getNewTemporaryRef(); + } + } else if (xfa) { + warn("Unsupported XFA type."); + } + let newXrefInfo = Object.create(null); + if (xref.trailer) { + const infoObj = Object.create(null); + const xrefInfo = xref.trailer.get("Info") || null; + if (xrefInfo instanceof Dict) { + for (const [key, value] of xrefInfo) { + if (typeof value === "string") { + infoObj[key] = stringToPDFString(value); + } + } + } + newXrefInfo = { + rootRef: catalogRef, + encryptRef: xref.trailer.getRaw("Encrypt") || null, + newRef: xref.getNewTemporaryRef(), + infoRef: xref.trailer.getRaw("Info") || null, + info: infoObj, + fileIds: xref.trailer.get("ID") || null, + startXRef: linearization ? startXRef : xref.lastXRefStreamPos ?? startXRef, + filename + }; + } + return incrementalUpdate({ + originalData: stream.bytes, + xrefInfo: newXrefInfo, + changes, + xref, + hasXfa: !!xfa, + xfaDatasetsRef, + hasXfaDatasetsEntry, + needAppearances, + acroFormRef, + acroForm, + xfaData, + useXrefStream: isDict(xref.topDict, "XRef") + }).finally(() => { + xref.resetNewTemporaryRef(); + }); + }); + handler.on("GetOperatorList", function (data, sink) { + const pageIndex = data.pageIndex; + pdfManager.getPage(pageIndex).then(function (page) { + const task = new WorkerTask(`GetOperatorList: page ${pageIndex}`); + startWorkerTask(task); + const start = verbosity >= VerbosityLevel.INFOS ? Date.now() : 0; + page.getOperatorList({ + handler, + sink, + task, + intent: data.intent, + cacheKey: data.cacheKey, + annotationStorage: data.annotationStorage, + modifiedIds: data.modifiedIds + }).then(function (operatorListInfo) { + finishWorkerTask(task); + if (start) { + info(`page=${pageIndex + 1} - getOperatorList: time=` + `${Date.now() - start}ms, len=${operatorListInfo.length}`); + } + sink.close(); + }, function (reason) { + finishWorkerTask(task); + if (task.terminated) { + return; + } + sink.error(reason); + }); + }); + }); + handler.on("GetTextContent", function (data, sink) { + const { + pageIndex, + includeMarkedContent, + disableNormalization + } = data; + pdfManager.getPage(pageIndex).then(function (page) { + const task = new WorkerTask("GetTextContent: page " + pageIndex); + startWorkerTask(task); + const start = verbosity >= VerbosityLevel.INFOS ? Date.now() : 0; + page.extractTextContent({ + handler, + task, + sink, + includeMarkedContent, + disableNormalization + }).then(function () { + finishWorkerTask(task); + if (start) { + info(`page=${pageIndex + 1} - getTextContent: time=` + `${Date.now() - start}ms`); + } + sink.close(); + }, function (reason) { + finishWorkerTask(task); + if (task.terminated) { + return; + } + sink.error(reason); + }); + }); + }); + handler.on("GetStructTree", function (data) { + return pdfManager.getPage(data.pageIndex).then(function (page) { + return pdfManager.ensure(page, "getStructTree"); + }); + }); + handler.on("FontFallback", function (data) { + return pdfManager.fontFallback(data.id, handler); + }); + handler.on("Cleanup", function (data) { + return pdfManager.cleanup(true); + }); + handler.on("Terminate", function (data) { + terminated = true; + const waitOn = []; + if (pdfManager) { + pdfManager.terminate(new AbortException("Worker was terminated.")); + const cleanupPromise = pdfManager.cleanup(); + waitOn.push(cleanupPromise); + pdfManager = null; + } else { + clearGlobalCaches(); + } + cancelXHRs?.(new AbortException("Worker was terminated.")); + for (const task of WorkerTasks) { + waitOn.push(task.finished); + task.terminate(); + } + return Promise.all(waitOn).then(function () { + handler.destroy(); + handler = null; + }); + }); + handler.on("Ready", function (data) { + setupDoc(docParams); + docParams = null; + }); + return workerHandlerName; + } + static initializeFromPort(port) { + const handler = new MessageHandler("worker", "main", port); + this.setup(handler, port); + handler.send("ready", null); + } +} + +;// ./src/pdf.worker.js + +const pdfjsVersion = "4.10.38"; +const pdfjsBuild = "f9bea397f"; + +var __webpack_exports__WorkerMessageHandler = __webpack_exports__.WorkerMessageHandler; +export { __webpack_exports__WorkerMessageHandler as WorkerMessageHandler }; + +//# sourceMappingURL=pdf.worker.mjs.map \ No newline at end of file diff --git a/public/pdfjs/web/debugger.css b/public/pdfjs/web/debugger.css new file mode 100644 index 0000000..b9d9f81 --- /dev/null +++ b/public/pdfjs/web/debugger.css @@ -0,0 +1,111 @@ +/* Copyright 2014 Mozilla Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +:root { + --panel-width: 300px; +} + +#PDFBug, +#PDFBug :is(input, button, select) { + font: message-box; +} +#PDFBug { + background-color: rgb(255 255 255); + border: 1px solid rgb(102 102 102); + position: fixed; + top: 32px; + right: 0; + bottom: 0; + font-size: 10px; + padding: 0; + width: var(--panel-width); +} +#PDFBug .controls { + background: rgb(238 238 238); + border-bottom: 1px solid rgb(102 102 102); + padding: 3px; +} +#PDFBug .panels { + inset: 27px 0 0; + overflow: auto; + position: absolute; +} +#PDFBug .panels > div { + padding: 5px; +} +#PDFBug button.active { + font-weight: bold; +} +.debuggerShowText, +.debuggerHideText:hover { + background-color: rgb(255 255 0 / 0.25); +} +#PDFBug .stats { + font-family: courier; + font-size: 10px; + white-space: pre; +} +#PDFBug .stats .title { + font-weight: bold; +} +#PDFBug table { + font-size: 10px; + white-space: pre; +} +#PDFBug table.showText { + border-collapse: collapse; + text-align: center; +} +#PDFBug table.showText, +#PDFBug table.showText :is(tr, td) { + border: 1px solid black; + padding: 1px; +} +#PDFBug table.showText td.advance { + color: grey; +} + +#viewer.textLayer-visible .textLayer { + opacity: 1; +} + +#viewer.textLayer-visible .canvasWrapper { + background-color: rgb(128 255 128); +} + +#viewer.textLayer-visible .canvasWrapper canvas { + mix-blend-mode: screen; +} + +#viewer.textLayer-visible .textLayer span { + background-color: rgb(255 255 0 / 0.1); + color: rgb(0 0 0); + border: solid 1px rgb(255 0 0 / 0.5); + box-sizing: border-box; +} + +#viewer.textLayer-visible .textLayer span[aria-owns] { + background-color: rgb(255 0 0 / 0.3); +} + +#viewer.textLayer-hover .textLayer span:hover { + background-color: rgb(255 255 255); + color: rgb(0 0 0); +} + +#viewer.textLayer-shadow .textLayer span { + background-color: rgb(255 255 255 / 0.6); + color: rgb(0 0 0); +} diff --git a/public/pdfjs/web/debugger.mjs b/public/pdfjs/web/debugger.mjs new file mode 100644 index 0000000..59c1871 --- /dev/null +++ b/public/pdfjs/web/debugger.mjs @@ -0,0 +1,623 @@ +/* Copyright 2012 Mozilla Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +const { OPS } = globalThis.pdfjsLib || (await import("pdfjs-lib")); + +const opMap = Object.create(null); +for (const key in OPS) { + opMap[OPS[key]] = key; +} + +const FontInspector = (function FontInspectorClosure() { + let fonts; + let active = false; + const fontAttribute = "data-font-name"; + function removeSelection() { + const divs = document.querySelectorAll(`span[${fontAttribute}]`); + for (const div of divs) { + div.className = ""; + } + } + function resetSelection() { + const divs = document.querySelectorAll(`span[${fontAttribute}]`); + for (const div of divs) { + div.className = "debuggerHideText"; + } + } + function selectFont(fontName, show) { + const divs = document.querySelectorAll( + `span[${fontAttribute}=${fontName}]` + ); + for (const div of divs) { + div.className = show ? "debuggerShowText" : "debuggerHideText"; + } + } + function textLayerClick(e) { + if ( + !e.target.dataset.fontName || + e.target.tagName.toUpperCase() !== "SPAN" + ) { + return; + } + const fontName = e.target.dataset.fontName; + const selects = document.getElementsByTagName("input"); + for (const select of selects) { + if (select.dataset.fontName !== fontName) { + continue; + } + select.checked = !select.checked; + selectFont(fontName, select.checked); + select.scrollIntoView(); + } + } + return { + // Properties/functions needed by PDFBug. + id: "FontInspector", + name: "Font Inspector", + panel: null, + manager: null, + init() { + const panel = this.panel; + const tmp = document.createElement("button"); + tmp.addEventListener("click", resetSelection); + tmp.textContent = "Refresh"; + panel.append(tmp); + + fonts = document.createElement("div"); + panel.append(fonts); + }, + cleanup() { + fonts.textContent = ""; + }, + enabled: false, + get active() { + return active; + }, + set active(value) { + active = value; + if (active) { + document.body.addEventListener("click", textLayerClick, true); + resetSelection(); + } else { + document.body.removeEventListener("click", textLayerClick, true); + removeSelection(); + } + }, + // FontInspector specific functions. + fontAdded(fontObj, url) { + function properties(obj, list) { + const moreInfo = document.createElement("table"); + for (const entry of list) { + const tr = document.createElement("tr"); + const td1 = document.createElement("td"); + td1.textContent = entry; + tr.append(td1); + const td2 = document.createElement("td"); + td2.textContent = obj[entry].toString(); + tr.append(td2); + moreInfo.append(tr); + } + return moreInfo; + } + + const moreInfo = fontObj.css + ? properties(fontObj, ["baseFontName"]) + : properties(fontObj, ["name", "type"]); + + const fontName = fontObj.loadedName; + const font = document.createElement("div"); + const name = document.createElement("span"); + name.textContent = fontName; + let download; + if (!fontObj.css) { + download = document.createElement("a"); + if (url) { + url = /url\(['"]?([^)"']+)/.exec(url); + download.href = url[1]; + } else if (fontObj.data) { + download.href = URL.createObjectURL( + new Blob([fontObj.data], { type: fontObj.mimetype }) + ); + } + download.textContent = "Download"; + } + + const logIt = document.createElement("a"); + logIt.href = ""; + logIt.textContent = "Log"; + logIt.addEventListener("click", function (event) { + event.preventDefault(); + console.log(fontObj); + }); + const select = document.createElement("input"); + select.setAttribute("type", "checkbox"); + select.dataset.fontName = fontName; + select.addEventListener("click", function () { + selectFont(fontName, select.checked); + }); + if (download) { + font.append(select, name, " ", download, " ", logIt, moreInfo); + } else { + font.append(select, name, " ", logIt, moreInfo); + } + fonts.append(font); + // Somewhat of a hack, should probably add a hook for when the text layer + // is done rendering. + setTimeout(() => { + if (this.active) { + resetSelection(); + } + }, 2000); + }, + }; +})(); + +// Manages all the page steppers. +const StepperManager = (function StepperManagerClosure() { + let steppers = []; + let stepperDiv = null; + let stepperControls = null; + let stepperChooser = null; + let breakPoints = Object.create(null); + return { + // Properties/functions needed by PDFBug. + id: "Stepper", + name: "Stepper", + panel: null, + manager: null, + init() { + const self = this; + stepperControls = document.createElement("div"); + stepperChooser = document.createElement("select"); + stepperChooser.addEventListener("change", function (event) { + self.selectStepper(this.value); + }); + stepperControls.append(stepperChooser); + stepperDiv = document.createElement("div"); + this.panel.append(stepperControls, stepperDiv); + if (sessionStorage.getItem("pdfjsBreakPoints")) { + breakPoints = JSON.parse(sessionStorage.getItem("pdfjsBreakPoints")); + } + }, + cleanup() { + stepperChooser.textContent = ""; + stepperDiv.textContent = ""; + steppers = []; + }, + enabled: false, + active: false, + // Stepper specific functions. + create(pageIndex) { + const debug = document.createElement("div"); + debug.id = "stepper" + pageIndex; + debug.hidden = true; + debug.className = "stepper"; + stepperDiv.append(debug); + const b = document.createElement("option"); + b.textContent = "Page " + (pageIndex + 1); + b.value = pageIndex; + stepperChooser.append(b); + const initBreakPoints = breakPoints[pageIndex] || []; + const stepper = new Stepper(debug, pageIndex, initBreakPoints); + steppers.push(stepper); + if (steppers.length === 1) { + this.selectStepper(pageIndex, false); + } + return stepper; + }, + selectStepper(pageIndex, selectPanel) { + pageIndex |= 0; + if (selectPanel) { + this.manager.selectPanel(this); + } + for (const stepper of steppers) { + stepper.panel.hidden = stepper.pageIndex !== pageIndex; + } + for (const option of stepperChooser.options) { + option.selected = (option.value | 0) === pageIndex; + } + }, + saveBreakPoints(pageIndex, bps) { + breakPoints[pageIndex] = bps; + sessionStorage.setItem("pdfjsBreakPoints", JSON.stringify(breakPoints)); + }, + }; +})(); + +// The stepper for each page's operatorList. +class Stepper { + // Shorter way to create element and optionally set textContent. + #c(tag, textContent) { + const d = document.createElement(tag); + if (textContent) { + d.textContent = textContent; + } + return d; + } + + #simplifyArgs(args) { + if (typeof args === "string") { + const MAX_STRING_LENGTH = 75; + return args.length <= MAX_STRING_LENGTH + ? args + : args.substring(0, MAX_STRING_LENGTH) + "..."; + } + if (typeof args !== "object" || args === null) { + return args; + } + if ("length" in args) { + // array + const MAX_ITEMS = 10, + simpleArgs = []; + let i, ii; + for (i = 0, ii = Math.min(MAX_ITEMS, args.length); i < ii; i++) { + simpleArgs.push(this.#simplifyArgs(args[i])); + } + if (i < args.length) { + simpleArgs.push("..."); + } + return simpleArgs; + } + const simpleObj = {}; + for (const key in args) { + simpleObj[key] = this.#simplifyArgs(args[key]); + } + return simpleObj; + } + + constructor(panel, pageIndex, initialBreakPoints) { + this.panel = panel; + this.breakPoint = 0; + this.nextBreakPoint = null; + this.pageIndex = pageIndex; + this.breakPoints = initialBreakPoints; + this.currentIdx = -1; + this.operatorListIdx = 0; + this.indentLevel = 0; + } + + init(operatorList) { + const panel = this.panel; + const content = this.#c("div", "c=continue, s=step"); + const table = this.#c("table"); + content.append(table); + table.cellSpacing = 0; + const headerRow = this.#c("tr"); + table.append(headerRow); + headerRow.append( + this.#c("th", "Break"), + this.#c("th", "Idx"), + this.#c("th", "fn"), + this.#c("th", "args") + ); + panel.append(content); + this.table = table; + this.updateOperatorList(operatorList); + } + + updateOperatorList(operatorList) { + const self = this; + + function cboxOnClick() { + const x = +this.dataset.idx; + if (this.checked) { + self.breakPoints.push(x); + } else { + self.breakPoints.splice(self.breakPoints.indexOf(x), 1); + } + StepperManager.saveBreakPoints(self.pageIndex, self.breakPoints); + } + + const MAX_OPERATORS_COUNT = 15000; + if (this.operatorListIdx > MAX_OPERATORS_COUNT) { + return; + } + + const chunk = document.createDocumentFragment(); + const operatorsToDisplay = Math.min( + MAX_OPERATORS_COUNT, + operatorList.fnArray.length + ); + for (let i = this.operatorListIdx; i < operatorsToDisplay; i++) { + const line = this.#c("tr"); + line.className = "line"; + line.dataset.idx = i; + chunk.append(line); + const checked = this.breakPoints.includes(i); + const args = operatorList.argsArray[i] || []; + + const breakCell = this.#c("td"); + const cbox = this.#c("input"); + cbox.type = "checkbox"; + cbox.className = "points"; + cbox.checked = checked; + cbox.dataset.idx = i; + cbox.onclick = cboxOnClick; + + breakCell.append(cbox); + line.append(breakCell, this.#c("td", i.toString())); + const fn = opMap[operatorList.fnArray[i]]; + let decArgs = args; + if (fn === "showText") { + const glyphs = args[0]; + const charCodeRow = this.#c("tr"); + const fontCharRow = this.#c("tr"); + const unicodeRow = this.#c("tr"); + for (const glyph of glyphs) { + if (typeof glyph === "object" && glyph !== null) { + charCodeRow.append(this.#c("td", glyph.originalCharCode)); + fontCharRow.append(this.#c("td", glyph.fontChar)); + unicodeRow.append(this.#c("td", glyph.unicode)); + } else { + // null or number + const advanceEl = this.#c("td", glyph); + advanceEl.classList.add("advance"); + charCodeRow.append(advanceEl); + fontCharRow.append(this.#c("td")); + unicodeRow.append(this.#c("td")); + } + } + decArgs = this.#c("td"); + const table = this.#c("table"); + table.classList.add("showText"); + decArgs.append(table); + table.append(charCodeRow, fontCharRow, unicodeRow); + } else if (fn === "restore" && this.indentLevel > 0) { + this.indentLevel--; + } + line.append(this.#c("td", " ".repeat(this.indentLevel * 2) + fn)); + if (fn === "save") { + this.indentLevel++; + } + + if (decArgs instanceof HTMLElement) { + line.append(decArgs); + } else { + line.append(this.#c("td", JSON.stringify(this.#simplifyArgs(decArgs)))); + } + } + if (operatorsToDisplay < operatorList.fnArray.length) { + const lastCell = this.#c("td", "..."); + lastCell.colspan = 4; + chunk.append(lastCell); + } + this.operatorListIdx = operatorList.fnArray.length; + this.table.append(chunk); + } + + getNextBreakPoint() { + this.breakPoints.sort(function (a, b) { + return a - b; + }); + for (const breakPoint of this.breakPoints) { + if (breakPoint > this.currentIdx) { + return breakPoint; + } + } + return null; + } + + breakIt(idx, callback) { + StepperManager.selectStepper(this.pageIndex, true); + this.currentIdx = idx; + + const listener = evt => { + switch (evt.keyCode) { + case 83: // step + document.removeEventListener("keydown", listener); + this.nextBreakPoint = this.currentIdx + 1; + this.goTo(-1); + callback(); + break; + case 67: // continue + document.removeEventListener("keydown", listener); + this.nextBreakPoint = this.getNextBreakPoint(); + this.goTo(-1); + callback(); + break; + } + }; + document.addEventListener("keydown", listener); + this.goTo(idx); + } + + goTo(idx) { + const allRows = this.panel.getElementsByClassName("line"); + for (const row of allRows) { + if ((row.dataset.idx | 0) === idx) { + row.style.backgroundColor = "rgb(251,250,207)"; + row.scrollIntoView(); + } else { + row.style.backgroundColor = null; + } + } + } +} + +const Stats = (function Stats() { + let stats = []; + function clear(node) { + node.textContent = ""; // Remove any `node` contents from the DOM. + } + function getStatIndex(pageNumber) { + for (const [i, stat] of stats.entries()) { + if (stat.pageNumber === pageNumber) { + return i; + } + } + return false; + } + return { + // Properties/functions needed by PDFBug. + id: "Stats", + name: "Stats", + panel: null, + manager: null, + init() {}, + enabled: false, + active: false, + // Stats specific functions. + add(pageNumber, stat) { + if (!stat) { + return; + } + const statsIndex = getStatIndex(pageNumber); + if (statsIndex !== false) { + stats[statsIndex].div.remove(); + stats.splice(statsIndex, 1); + } + const wrapper = document.createElement("div"); + wrapper.className = "stats"; + const title = document.createElement("div"); + title.className = "title"; + title.textContent = "Page: " + pageNumber; + const statsDiv = document.createElement("div"); + statsDiv.textContent = stat.toString(); + wrapper.append(title, statsDiv); + stats.push({ pageNumber, div: wrapper }); + stats.sort(function (a, b) { + return a.pageNumber - b.pageNumber; + }); + clear(this.panel); + for (const entry of stats) { + this.panel.append(entry.div); + } + }, + cleanup() { + stats = []; + clear(this.panel); + }, + }; +})(); + +// Manages all the debugging tools. +class PDFBug { + static #buttons = []; + + static #activePanel = null; + + static tools = [FontInspector, StepperManager, Stats]; + + static enable(ids) { + const all = ids.length === 1 && ids[0] === "all"; + const tools = this.tools; + for (const tool of tools) { + if (all || ids.includes(tool.id)) { + tool.enabled = true; + } + } + if (!all) { + // Sort the tools by the order they are enabled. + tools.sort(function (a, b) { + let indexA = ids.indexOf(a.id); + indexA = indexA < 0 ? tools.length : indexA; + let indexB = ids.indexOf(b.id); + indexB = indexB < 0 ? tools.length : indexB; + return indexA - indexB; + }); + } + } + + static init(container, ids) { + this.loadCSS(); + this.enable(ids); + /* + * Basic Layout: + * PDFBug + * Controls + * Panels + * Panel + * Panel + * ... + */ + const ui = document.createElement("div"); + ui.id = "PDFBug"; + + const controls = document.createElement("div"); + controls.setAttribute("class", "controls"); + ui.append(controls); + + const panels = document.createElement("div"); + panels.setAttribute("class", "panels"); + ui.append(panels); + + container.append(ui); + container.style.right = "var(--panel-width)"; + + // Initialize all the debugging tools. + for (const tool of this.tools) { + const panel = document.createElement("div"); + const panelButton = document.createElement("button"); + panelButton.textContent = tool.name; + panelButton.addEventListener("click", event => { + event.preventDefault(); + this.selectPanel(tool); + }); + controls.append(panelButton); + panels.append(panel); + tool.panel = panel; + tool.manager = this; + if (tool.enabled) { + tool.init(); + } else { + panel.textContent = + `${tool.name} is disabled. To enable add "${tool.id}" to ` + + "the pdfBug parameter and refresh (separate multiple by commas)."; + } + this.#buttons.push(panelButton); + } + this.selectPanel(0); + } + + static loadCSS() { + const { url } = import.meta; + + const link = document.createElement("link"); + link.rel = "stylesheet"; + link.href = url.replace(/\.mjs$/, ".css"); + + document.head.append(link); + } + + static cleanup() { + for (const tool of this.tools) { + if (tool.enabled) { + tool.cleanup(); + } + } + } + + static selectPanel(index) { + if (typeof index !== "number") { + index = this.tools.indexOf(index); + } + if (index === this.#activePanel) { + return; + } + this.#activePanel = index; + for (const [j, tool] of this.tools.entries()) { + const isActive = j === index; + this.#buttons[j].classList.toggle("active", isActive); + tool.active = isActive; + tool.panel.hidden = !isActive; + } + } +} + +globalThis.FontInspector = FontInspector; +globalThis.StepperManager = StepperManager; +globalThis.Stats = Stats; + +export { PDFBug }; diff --git a/public/pdfjs/web/images/altText_add.svg b/public/pdfjs/web/images/altText_add.svg new file mode 100644 index 0000000..3451b53 --- /dev/null +++ b/public/pdfjs/web/images/altText_add.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/pdfjs/web/images/altText_disclaimer.svg b/public/pdfjs/web/images/altText_disclaimer.svg new file mode 100644 index 0000000..6fe79e7 --- /dev/null +++ b/public/pdfjs/web/images/altText_disclaimer.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/pdfjs/web/images/altText_done.svg b/public/pdfjs/web/images/altText_done.svg new file mode 100644 index 0000000..f54924e --- /dev/null +++ b/public/pdfjs/web/images/altText_done.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/pdfjs/web/images/altText_spinner.svg b/public/pdfjs/web/images/altText_spinner.svg new file mode 100644 index 0000000..fedb472 --- /dev/null +++ b/public/pdfjs/web/images/altText_spinner.svg @@ -0,0 +1,30 @@ + + + + + + + + + diff --git a/public/pdfjs/web/images/altText_warning.svg b/public/pdfjs/web/images/altText_warning.svg new file mode 100644 index 0000000..03014ce --- /dev/null +++ b/public/pdfjs/web/images/altText_warning.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/pdfjs/web/images/annotation-check.svg b/public/pdfjs/web/images/annotation-check.svg new file mode 100644 index 0000000..71cd16d --- /dev/null +++ b/public/pdfjs/web/images/annotation-check.svg @@ -0,0 +1,11 @@ + + + + diff --git a/public/pdfjs/web/images/annotation-comment.svg b/public/pdfjs/web/images/annotation-comment.svg new file mode 100644 index 0000000..86f1f17 --- /dev/null +++ b/public/pdfjs/web/images/annotation-comment.svg @@ -0,0 +1,16 @@ + + + + + diff --git a/public/pdfjs/web/images/annotation-help.svg b/public/pdfjs/web/images/annotation-help.svg new file mode 100644 index 0000000..00938fe --- /dev/null +++ b/public/pdfjs/web/images/annotation-help.svg @@ -0,0 +1,26 @@ + + + + + + + + + + diff --git a/public/pdfjs/web/images/annotation-insert.svg b/public/pdfjs/web/images/annotation-insert.svg new file mode 100644 index 0000000..519ef68 --- /dev/null +++ b/public/pdfjs/web/images/annotation-insert.svg @@ -0,0 +1,10 @@ + + + + diff --git a/public/pdfjs/web/images/annotation-key.svg b/public/pdfjs/web/images/annotation-key.svg new file mode 100644 index 0000000..8d09d53 --- /dev/null +++ b/public/pdfjs/web/images/annotation-key.svg @@ -0,0 +1,11 @@ + + + + diff --git a/public/pdfjs/web/images/annotation-newparagraph.svg b/public/pdfjs/web/images/annotation-newparagraph.svg new file mode 100644 index 0000000..38d2497 --- /dev/null +++ b/public/pdfjs/web/images/annotation-newparagraph.svg @@ -0,0 +1,11 @@ + + + + diff --git a/public/pdfjs/web/images/annotation-noicon.svg b/public/pdfjs/web/images/annotation-noicon.svg new file mode 100644 index 0000000..c07d108 --- /dev/null +++ b/public/pdfjs/web/images/annotation-noicon.svg @@ -0,0 +1,7 @@ + + + diff --git a/public/pdfjs/web/images/annotation-note.svg b/public/pdfjs/web/images/annotation-note.svg new file mode 100644 index 0000000..7017365 --- /dev/null +++ b/public/pdfjs/web/images/annotation-note.svg @@ -0,0 +1,42 @@ + + + + + + + + diff --git a/public/pdfjs/web/images/annotation-paperclip.svg b/public/pdfjs/web/images/annotation-paperclip.svg new file mode 100644 index 0000000..2bed225 --- /dev/null +++ b/public/pdfjs/web/images/annotation-paperclip.svg @@ -0,0 +1,6 @@ + + + + diff --git a/public/pdfjs/web/images/annotation-paragraph.svg b/public/pdfjs/web/images/annotation-paragraph.svg new file mode 100644 index 0000000..6ae5212 --- /dev/null +++ b/public/pdfjs/web/images/annotation-paragraph.svg @@ -0,0 +1,16 @@ + + + + + diff --git a/public/pdfjs/web/images/annotation-pushpin.svg b/public/pdfjs/web/images/annotation-pushpin.svg new file mode 100644 index 0000000..6e0896c --- /dev/null +++ b/public/pdfjs/web/images/annotation-pushpin.svg @@ -0,0 +1,7 @@ + + + + + diff --git a/public/pdfjs/web/images/cursor-editorFreeHighlight.svg b/public/pdfjs/web/images/cursor-editorFreeHighlight.svg new file mode 100644 index 0000000..513f6bd --- /dev/null +++ b/public/pdfjs/web/images/cursor-editorFreeHighlight.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/public/pdfjs/web/images/cursor-editorFreeText.svg b/public/pdfjs/web/images/cursor-editorFreeText.svg new file mode 100644 index 0000000..de2838e --- /dev/null +++ b/public/pdfjs/web/images/cursor-editorFreeText.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/pdfjs/web/images/cursor-editorInk.svg b/public/pdfjs/web/images/cursor-editorInk.svg new file mode 100644 index 0000000..1dadb5c --- /dev/null +++ b/public/pdfjs/web/images/cursor-editorInk.svg @@ -0,0 +1,4 @@ + + + + diff --git a/public/pdfjs/web/images/cursor-editorTextHighlight.svg b/public/pdfjs/web/images/cursor-editorTextHighlight.svg new file mode 100644 index 0000000..800340c --- /dev/null +++ b/public/pdfjs/web/images/cursor-editorTextHighlight.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/public/pdfjs/web/images/editor-toolbar-delete.svg b/public/pdfjs/web/images/editor-toolbar-delete.svg new file mode 100644 index 0000000..f84520d --- /dev/null +++ b/public/pdfjs/web/images/editor-toolbar-delete.svg @@ -0,0 +1,5 @@ + + + \ No newline at end of file diff --git a/public/pdfjs/web/images/findbarButton-next.svg b/public/pdfjs/web/images/findbarButton-next.svg new file mode 100644 index 0000000..8cb39be --- /dev/null +++ b/public/pdfjs/web/images/findbarButton-next.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/pdfjs/web/images/findbarButton-previous.svg b/public/pdfjs/web/images/findbarButton-previous.svg new file mode 100644 index 0000000..b610879 --- /dev/null +++ b/public/pdfjs/web/images/findbarButton-previous.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/pdfjs/web/images/gv-toolbarButton-download.svg b/public/pdfjs/web/images/gv-toolbarButton-download.svg new file mode 100644 index 0000000..d56cf3c --- /dev/null +++ b/public/pdfjs/web/images/gv-toolbarButton-download.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/pdfjs/web/images/loading-icon.gif b/public/pdfjs/web/images/loading-icon.gif new file mode 100644 index 0000000..1c72ebb Binary files /dev/null and b/public/pdfjs/web/images/loading-icon.gif differ diff --git a/public/pdfjs/web/images/loading.svg b/public/pdfjs/web/images/loading.svg new file mode 100644 index 0000000..0a15ff6 --- /dev/null +++ b/public/pdfjs/web/images/loading.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/pdfjs/web/images/messageBar_closingButton.svg b/public/pdfjs/web/images/messageBar_closingButton.svg new file mode 100644 index 0000000..8a40715 --- /dev/null +++ b/public/pdfjs/web/images/messageBar_closingButton.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/pdfjs/web/images/messageBar_warning.svg b/public/pdfjs/web/images/messageBar_warning.svg new file mode 100644 index 0000000..011cfcf --- /dev/null +++ b/public/pdfjs/web/images/messageBar_warning.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/pdfjs/web/images/secondaryToolbarButton-documentProperties.svg b/public/pdfjs/web/images/secondaryToolbarButton-documentProperties.svg new file mode 100644 index 0000000..dd3917b --- /dev/null +++ b/public/pdfjs/web/images/secondaryToolbarButton-documentProperties.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/pdfjs/web/images/secondaryToolbarButton-firstPage.svg b/public/pdfjs/web/images/secondaryToolbarButton-firstPage.svg new file mode 100644 index 0000000..f5c917f --- /dev/null +++ b/public/pdfjs/web/images/secondaryToolbarButton-firstPage.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/pdfjs/web/images/secondaryToolbarButton-handTool.svg b/public/pdfjs/web/images/secondaryToolbarButton-handTool.svg new file mode 100644 index 0000000..b7073b5 --- /dev/null +++ b/public/pdfjs/web/images/secondaryToolbarButton-handTool.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/pdfjs/web/images/secondaryToolbarButton-lastPage.svg b/public/pdfjs/web/images/secondaryToolbarButton-lastPage.svg new file mode 100644 index 0000000..c04f650 --- /dev/null +++ b/public/pdfjs/web/images/secondaryToolbarButton-lastPage.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/pdfjs/web/images/secondaryToolbarButton-rotateCcw.svg b/public/pdfjs/web/images/secondaryToolbarButton-rotateCcw.svg new file mode 100644 index 0000000..da73a1b --- /dev/null +++ b/public/pdfjs/web/images/secondaryToolbarButton-rotateCcw.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/pdfjs/web/images/secondaryToolbarButton-rotateCw.svg b/public/pdfjs/web/images/secondaryToolbarButton-rotateCw.svg new file mode 100644 index 0000000..c41ce73 --- /dev/null +++ b/public/pdfjs/web/images/secondaryToolbarButton-rotateCw.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/pdfjs/web/images/secondaryToolbarButton-scrollHorizontal.svg b/public/pdfjs/web/images/secondaryToolbarButton-scrollHorizontal.svg new file mode 100644 index 0000000..fb440b9 --- /dev/null +++ b/public/pdfjs/web/images/secondaryToolbarButton-scrollHorizontal.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/pdfjs/web/images/secondaryToolbarButton-scrollPage.svg b/public/pdfjs/web/images/secondaryToolbarButton-scrollPage.svg new file mode 100644 index 0000000..64a9f50 --- /dev/null +++ b/public/pdfjs/web/images/secondaryToolbarButton-scrollPage.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/pdfjs/web/images/secondaryToolbarButton-scrollVertical.svg b/public/pdfjs/web/images/secondaryToolbarButton-scrollVertical.svg new file mode 100644 index 0000000..dc7e805 --- /dev/null +++ b/public/pdfjs/web/images/secondaryToolbarButton-scrollVertical.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/pdfjs/web/images/secondaryToolbarButton-scrollWrapped.svg b/public/pdfjs/web/images/secondaryToolbarButton-scrollWrapped.svg new file mode 100644 index 0000000..75fe26b --- /dev/null +++ b/public/pdfjs/web/images/secondaryToolbarButton-scrollWrapped.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/pdfjs/web/images/secondaryToolbarButton-selectTool.svg b/public/pdfjs/web/images/secondaryToolbarButton-selectTool.svg new file mode 100644 index 0000000..94d5141 --- /dev/null +++ b/public/pdfjs/web/images/secondaryToolbarButton-selectTool.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/pdfjs/web/images/secondaryToolbarButton-spreadEven.svg b/public/pdfjs/web/images/secondaryToolbarButton-spreadEven.svg new file mode 100644 index 0000000..ce201e3 --- /dev/null +++ b/public/pdfjs/web/images/secondaryToolbarButton-spreadEven.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/pdfjs/web/images/secondaryToolbarButton-spreadNone.svg b/public/pdfjs/web/images/secondaryToolbarButton-spreadNone.svg new file mode 100644 index 0000000..e8d487f --- /dev/null +++ b/public/pdfjs/web/images/secondaryToolbarButton-spreadNone.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/pdfjs/web/images/secondaryToolbarButton-spreadOdd.svg b/public/pdfjs/web/images/secondaryToolbarButton-spreadOdd.svg new file mode 100644 index 0000000..9211a42 --- /dev/null +++ b/public/pdfjs/web/images/secondaryToolbarButton-spreadOdd.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/pdfjs/web/images/toolbarButton-bookmark.svg b/public/pdfjs/web/images/toolbarButton-bookmark.svg new file mode 100644 index 0000000..c4c37c9 --- /dev/null +++ b/public/pdfjs/web/images/toolbarButton-bookmark.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/pdfjs/web/images/toolbarButton-currentOutlineItem.svg b/public/pdfjs/web/images/toolbarButton-currentOutlineItem.svg new file mode 100644 index 0000000..01e6762 --- /dev/null +++ b/public/pdfjs/web/images/toolbarButton-currentOutlineItem.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/pdfjs/web/images/toolbarButton-download.svg b/public/pdfjs/web/images/toolbarButton-download.svg new file mode 100644 index 0000000..e2e850a --- /dev/null +++ b/public/pdfjs/web/images/toolbarButton-download.svg @@ -0,0 +1,4 @@ + + + + diff --git a/public/pdfjs/web/images/toolbarButton-editorFreeText.svg b/public/pdfjs/web/images/toolbarButton-editorFreeText.svg new file mode 100644 index 0000000..13a67bd --- /dev/null +++ b/public/pdfjs/web/images/toolbarButton-editorFreeText.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/public/pdfjs/web/images/toolbarButton-editorHighlight.svg b/public/pdfjs/web/images/toolbarButton-editorHighlight.svg new file mode 100644 index 0000000..b3cd7fd --- /dev/null +++ b/public/pdfjs/web/images/toolbarButton-editorHighlight.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/public/pdfjs/web/images/toolbarButton-editorInk.svg b/public/pdfjs/web/images/toolbarButton-editorInk.svg new file mode 100644 index 0000000..b579eec --- /dev/null +++ b/public/pdfjs/web/images/toolbarButton-editorInk.svg @@ -0,0 +1,4 @@ + + + + diff --git a/public/pdfjs/web/images/toolbarButton-editorStamp.svg b/public/pdfjs/web/images/toolbarButton-editorStamp.svg new file mode 100644 index 0000000..a1fef49 --- /dev/null +++ b/public/pdfjs/web/images/toolbarButton-editorStamp.svg @@ -0,0 +1,8 @@ + + + + + + diff --git a/public/pdfjs/web/images/toolbarButton-menuArrow.svg b/public/pdfjs/web/images/toolbarButton-menuArrow.svg new file mode 100644 index 0000000..82ffeaa --- /dev/null +++ b/public/pdfjs/web/images/toolbarButton-menuArrow.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/pdfjs/web/images/toolbarButton-openFile.svg b/public/pdfjs/web/images/toolbarButton-openFile.svg new file mode 100644 index 0000000..e773781 --- /dev/null +++ b/public/pdfjs/web/images/toolbarButton-openFile.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/pdfjs/web/images/toolbarButton-pageDown.svg b/public/pdfjs/web/images/toolbarButton-pageDown.svg new file mode 100644 index 0000000..1fc12e7 --- /dev/null +++ b/public/pdfjs/web/images/toolbarButton-pageDown.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/pdfjs/web/images/toolbarButton-pageUp.svg b/public/pdfjs/web/images/toolbarButton-pageUp.svg new file mode 100644 index 0000000..0936b9a --- /dev/null +++ b/public/pdfjs/web/images/toolbarButton-pageUp.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/pdfjs/web/images/toolbarButton-presentationMode.svg b/public/pdfjs/web/images/toolbarButton-presentationMode.svg new file mode 100644 index 0000000..901d567 --- /dev/null +++ b/public/pdfjs/web/images/toolbarButton-presentationMode.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/pdfjs/web/images/toolbarButton-print.svg b/public/pdfjs/web/images/toolbarButton-print.svg new file mode 100644 index 0000000..97a3904 --- /dev/null +++ b/public/pdfjs/web/images/toolbarButton-print.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/pdfjs/web/images/toolbarButton-search.svg b/public/pdfjs/web/images/toolbarButton-search.svg new file mode 100644 index 0000000..0cc7ae2 --- /dev/null +++ b/public/pdfjs/web/images/toolbarButton-search.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/pdfjs/web/images/toolbarButton-secondaryToolbarToggle.svg b/public/pdfjs/web/images/toolbarButton-secondaryToolbarToggle.svg new file mode 100644 index 0000000..cace863 --- /dev/null +++ b/public/pdfjs/web/images/toolbarButton-secondaryToolbarToggle.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/pdfjs/web/images/toolbarButton-sidebarToggle.svg b/public/pdfjs/web/images/toolbarButton-sidebarToggle.svg new file mode 100644 index 0000000..1d8d0e4 --- /dev/null +++ b/public/pdfjs/web/images/toolbarButton-sidebarToggle.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/pdfjs/web/images/toolbarButton-viewAttachments.svg b/public/pdfjs/web/images/toolbarButton-viewAttachments.svg new file mode 100644 index 0000000..ab73f6e --- /dev/null +++ b/public/pdfjs/web/images/toolbarButton-viewAttachments.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/pdfjs/web/images/toolbarButton-viewLayers.svg b/public/pdfjs/web/images/toolbarButton-viewLayers.svg new file mode 100644 index 0000000..1d72668 --- /dev/null +++ b/public/pdfjs/web/images/toolbarButton-viewLayers.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/pdfjs/web/images/toolbarButton-viewOutline.svg b/public/pdfjs/web/images/toolbarButton-viewOutline.svg new file mode 100644 index 0000000..7ed1bd9 --- /dev/null +++ b/public/pdfjs/web/images/toolbarButton-viewOutline.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/pdfjs/web/images/toolbarButton-viewThumbnail.svg b/public/pdfjs/web/images/toolbarButton-viewThumbnail.svg new file mode 100644 index 0000000..040d123 --- /dev/null +++ b/public/pdfjs/web/images/toolbarButton-viewThumbnail.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/pdfjs/web/images/toolbarButton-zoomIn.svg b/public/pdfjs/web/images/toolbarButton-zoomIn.svg new file mode 100644 index 0000000..30ec51a --- /dev/null +++ b/public/pdfjs/web/images/toolbarButton-zoomIn.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/pdfjs/web/images/toolbarButton-zoomOut.svg b/public/pdfjs/web/images/toolbarButton-zoomOut.svg new file mode 100644 index 0000000..f273b59 --- /dev/null +++ b/public/pdfjs/web/images/toolbarButton-zoomOut.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/pdfjs/web/images/treeitem-collapsed.svg b/public/pdfjs/web/images/treeitem-collapsed.svg new file mode 100644 index 0000000..831cddf --- /dev/null +++ b/public/pdfjs/web/images/treeitem-collapsed.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/pdfjs/web/images/treeitem-expanded.svg b/public/pdfjs/web/images/treeitem-expanded.svg new file mode 100644 index 0000000..2d45f0c --- /dev/null +++ b/public/pdfjs/web/images/treeitem-expanded.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/pdfjs/web/locale/ach/viewer.ftl b/public/pdfjs/web/locale/ach/viewer.ftl new file mode 100644 index 0000000..36769b7 --- /dev/null +++ b/public/pdfjs/web/locale/ach/viewer.ftl @@ -0,0 +1,225 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Pot buk mukato +pdfjs-previous-button-label = Mukato +pdfjs-next-button = + .title = Pot buk malubo +pdfjs-next-button-label = Malubo +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Pot buk +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = pi { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } me { $pagesCount }) +pdfjs-zoom-out-button = + .title = Jwik Matidi +pdfjs-zoom-out-button-label = Jwik Matidi +pdfjs-zoom-in-button = + .title = Kwot Madit +pdfjs-zoom-in-button-label = Kwot Madit +pdfjs-zoom-select = + .title = Kwoti +pdfjs-presentation-mode-button = + .title = Lokke i kit me tyer +pdfjs-presentation-mode-button-label = Kit me tyer +pdfjs-open-file-button = + .title = Yab Pwail +pdfjs-open-file-button-label = Yab +pdfjs-print-button = + .title = Go +pdfjs-print-button-label = Go + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Gintic +pdfjs-tools-button-label = Gintic +pdfjs-first-page-button = + .title = Cit i pot buk mukwongo +pdfjs-first-page-button-label = Cit i pot buk mukwongo +pdfjs-last-page-button = + .title = Cit i pot buk magiko +pdfjs-last-page-button-label = Cit i pot buk magiko +pdfjs-page-rotate-cw-button = + .title = Wire i tung lacuc +pdfjs-page-rotate-cw-button-label = Wire i tung lacuc +pdfjs-page-rotate-ccw-button = + .title = Wire i tung lacam +pdfjs-page-rotate-ccw-button-label = Wire i tung lacam +pdfjs-cursor-text-select-tool-button = + .title = Cak gitic me yero coc +pdfjs-cursor-text-select-tool-button-label = Gitic me yero coc +pdfjs-cursor-hand-tool-button = + .title = Cak gitic me cing +pdfjs-cursor-hand-tool-button-label = Gitic cing + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Jami me gin acoya… +pdfjs-document-properties-button-label = Jami me gin acoya… +pdfjs-document-properties-file-name = Nying pwail: +pdfjs-document-properties-file-size = Dit pa pwail: +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bytes) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bytes) +pdfjs-document-properties-title = Wiye: +pdfjs-document-properties-author = Ngat mucoyo: +pdfjs-document-properties-subject = Subjek: +pdfjs-document-properties-keywords = Lok mapire tek: +pdfjs-document-properties-creation-date = Nino dwe me cwec: +pdfjs-document-properties-modification-date = Nino dwe me yub: +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Lacwec: +pdfjs-document-properties-producer = Layub PDF: +pdfjs-document-properties-version = Kit PDF: +pdfjs-document-properties-page-count = Kwan me pot buk: +pdfjs-document-properties-page-size = Dit pa potbuk: +pdfjs-document-properties-page-size-unit-inches = i +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = atir +pdfjs-document-properties-page-size-orientation-landscape = arii +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Waraga +pdfjs-document-properties-page-size-name-legal = Cik + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +pdfjs-document-properties-linearized-yes = Eyo +pdfjs-document-properties-linearized-no = Pe +pdfjs-document-properties-close-button = Lor + +## Print + +pdfjs-print-progress-message = Yubo coc me agoya… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Juki +pdfjs-printing-not-supported = Ciko: Layeny ma pe teno goyo liweng. +pdfjs-printing-not-ready = Ciko: PDF pe ocane weng me agoya. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Lok gintic ma inget +pdfjs-toggle-sidebar-button-label = Lok gintic ma inget +pdfjs-document-outline-button = + .title = Nyut Wiyewiye me Gin acoya (dii-kiryo me yaro/kano jami weng) +pdfjs-document-outline-button-label = Pek pa gin acoya +pdfjs-attachments-button = + .title = Nyut twec +pdfjs-attachments-button-label = Twec +pdfjs-thumbs-button = + .title = Nyut cal +pdfjs-thumbs-button-label = Cal +pdfjs-findbar-button = + .title = Nong iye gin acoya +pdfjs-findbar-button-label = Nong + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Pot buk { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Cal me pot buk { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Nong + .placeholder = Nong i dokumen… +pdfjs-find-previous-button = + .title = Nong timme pa lok mukato +pdfjs-find-previous-button-label = Mukato +pdfjs-find-next-button = + .title = Nong timme pa lok malubo +pdfjs-find-next-button-label = Malubo +pdfjs-find-highlight-checkbox = Ket Lanyut I Weng +pdfjs-find-match-case-checkbox-label = Lok marwate +pdfjs-find-reached-top = Oo iwi gin acoya, omede ki i tere +pdfjs-find-reached-bottom = Oo i agiki me gin acoya, omede ki iwiye +pdfjs-find-not-found = Lok pe ononge + +## Predefined zoom values + +pdfjs-page-scale-width = Lac me iye pot buk +pdfjs-page-scale-fit = Porre me pot buk +pdfjs-page-scale-auto = Kwot pire kene +pdfjs-page-scale-actual = Dite kikome +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + + +## Loading indicator messages + +pdfjs-loading-error = Bal otime kun cano PDF. +pdfjs-invalid-file-error = Pwail me PDF ma pe atir onyo obale woko. +pdfjs-missing-file-error = Pwail me PDF tye ka rem. +pdfjs-unexpected-response-error = Lagam mape kigeno pa lapok tic. +pdfjs-rendering-error = Bal otime i kare me nyuto pot buk. + +## Annotations + +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } Lok angea manok] + +## Password + +pdfjs-password-label = Ket mung me donyo me yabo pwail me PDF man. +pdfjs-password-invalid = Mung me donyo pe atir. Tim ber i tem doki. +pdfjs-password-ok-button = OK +pdfjs-password-cancel-button = Juki +pdfjs-web-fonts-disabled = Kijuko dit pa coc me kakube woko: pe romo tic ki dit pa coc me PDF ma kiketo i kine. + +## Editing + + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + diff --git a/public/pdfjs/web/locale/af/viewer.ftl b/public/pdfjs/web/locale/af/viewer.ftl new file mode 100644 index 0000000..7c4346f --- /dev/null +++ b/public/pdfjs/web/locale/af/viewer.ftl @@ -0,0 +1,212 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Vorige bladsy +pdfjs-previous-button-label = Vorige +pdfjs-next-button = + .title = Volgende bladsy +pdfjs-next-button-label = Volgende +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Bladsy +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = van { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } van { $pagesCount }) +pdfjs-zoom-out-button = + .title = Zoem uit +pdfjs-zoom-out-button-label = Zoem uit +pdfjs-zoom-in-button = + .title = Zoem in +pdfjs-zoom-in-button-label = Zoem in +pdfjs-zoom-select = + .title = Zoem +pdfjs-presentation-mode-button = + .title = Wissel na voorleggingsmodus +pdfjs-presentation-mode-button-label = Voorleggingsmodus +pdfjs-open-file-button = + .title = Open lêer +pdfjs-open-file-button-label = Open +pdfjs-print-button = + .title = Druk +pdfjs-print-button-label = Druk + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Nutsgoed +pdfjs-tools-button-label = Nutsgoed +pdfjs-first-page-button = + .title = Gaan na eerste bladsy +pdfjs-first-page-button-label = Gaan na eerste bladsy +pdfjs-last-page-button = + .title = Gaan na laaste bladsy +pdfjs-last-page-button-label = Gaan na laaste bladsy +pdfjs-page-rotate-cw-button = + .title = Roteer kloksgewys +pdfjs-page-rotate-cw-button-label = Roteer kloksgewys +pdfjs-page-rotate-ccw-button = + .title = Roteer anti-kloksgewys +pdfjs-page-rotate-ccw-button-label = Roteer anti-kloksgewys +pdfjs-cursor-text-select-tool-button = + .title = Aktiveer gereedskap om teks te merk +pdfjs-cursor-text-select-tool-button-label = Teksmerkgereedskap +pdfjs-cursor-hand-tool-button = + .title = Aktiveer handjie +pdfjs-cursor-hand-tool-button-label = Handjie + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Dokumenteienskappe… +pdfjs-document-properties-button-label = Dokumenteienskappe… +pdfjs-document-properties-file-name = Lêernaam: +pdfjs-document-properties-file-size = Lêergrootte: +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } kG ({ $size_b } grepe) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MG ({ $size_b } grepe) +pdfjs-document-properties-title = Titel: +pdfjs-document-properties-author = Outeur: +pdfjs-document-properties-subject = Onderwerp: +pdfjs-document-properties-keywords = Sleutelwoorde: +pdfjs-document-properties-creation-date = Skeppingsdatum: +pdfjs-document-properties-modification-date = Wysigingsdatum: +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Skepper: +pdfjs-document-properties-producer = PDF-vervaardiger: +pdfjs-document-properties-version = PDF-weergawe: +pdfjs-document-properties-page-count = Aantal bladsye: + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + + +## + +pdfjs-document-properties-close-button = Sluit + +## Print + +pdfjs-print-progress-message = Berei tans dokument voor om te druk… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Kanselleer +pdfjs-printing-not-supported = Waarskuwing: Dié blaaier ondersteun nie drukwerk ten volle nie. +pdfjs-printing-not-ready = Waarskuwing: Die PDF is nog nie volledig gelaai vir drukwerk nie. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Sypaneel aan/af +pdfjs-toggle-sidebar-button-label = Sypaneel aan/af +pdfjs-document-outline-button = + .title = Wys dokumentskema (dubbelklik om alle items oop/toe te vou) +pdfjs-document-outline-button-label = Dokumentoorsig +pdfjs-attachments-button = + .title = Wys aanhegsels +pdfjs-attachments-button-label = Aanhegsels +pdfjs-thumbs-button = + .title = Wys duimnaels +pdfjs-thumbs-button-label = Duimnaels +pdfjs-findbar-button = + .title = Soek in dokument +pdfjs-findbar-button-label = Vind + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Bladsy { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Duimnael van bladsy { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Vind + .placeholder = Soek in dokument… +pdfjs-find-previous-button = + .title = Vind die vorige voorkoms van die frase +pdfjs-find-previous-button-label = Vorige +pdfjs-find-next-button = + .title = Vind die volgende voorkoms van die frase +pdfjs-find-next-button-label = Volgende +pdfjs-find-highlight-checkbox = Verlig almal +pdfjs-find-match-case-checkbox-label = Kassensitief +pdfjs-find-reached-top = Bokant van dokument is bereik; gaan voort van onder af +pdfjs-find-reached-bottom = Einde van dokument is bereik; gaan voort van bo af +pdfjs-find-not-found = Frase nie gevind nie + +## Predefined zoom values + +pdfjs-page-scale-width = Bladsywydte +pdfjs-page-scale-fit = Pas bladsy +pdfjs-page-scale-auto = Outomatiese zoem +pdfjs-page-scale-actual = Werklike grootte +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + + +## Loading indicator messages + +pdfjs-loading-error = 'n Fout het voorgekom met die laai van die PDF. +pdfjs-invalid-file-error = Ongeldige of korrupte PDF-lêer. +pdfjs-missing-file-error = PDF-lêer is weg. +pdfjs-unexpected-response-error = Onverwagse antwoord van bediener. +pdfjs-rendering-error = 'n Fout het voorgekom toe die bladsy weergegee is. + +## Annotations + +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type }-annotasie] + +## Password + +pdfjs-password-label = Gee die wagwoord om dié PDF-lêer mee te open. +pdfjs-password-invalid = Ongeldige wagwoord. Probeer gerus weer. +pdfjs-password-ok-button = OK +pdfjs-password-cancel-button = Kanselleer +pdfjs-web-fonts-disabled = Webfonte is gedeaktiveer: kan nie PDF-fonte wat ingebed is, gebruik nie. + +## Editing + + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + diff --git a/public/pdfjs/web/locale/an/viewer.ftl b/public/pdfjs/web/locale/an/viewer.ftl new file mode 100644 index 0000000..6733147 --- /dev/null +++ b/public/pdfjs/web/locale/an/viewer.ftl @@ -0,0 +1,257 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Pachina anterior +pdfjs-previous-button-label = Anterior +pdfjs-next-button = + .title = Pachina siguient +pdfjs-next-button-label = Siguient +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Pachina +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = de { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } de { $pagesCount }) +pdfjs-zoom-out-button = + .title = Achiquir +pdfjs-zoom-out-button-label = Achiquir +pdfjs-zoom-in-button = + .title = Agrandir +pdfjs-zoom-in-button-label = Agrandir +pdfjs-zoom-select = + .title = Grandaria +pdfjs-presentation-mode-button = + .title = Cambear t'o modo de presentación +pdfjs-presentation-mode-button-label = Modo de presentación +pdfjs-open-file-button = + .title = Ubrir o fichero +pdfjs-open-file-button-label = Ubrir +pdfjs-print-button = + .title = Imprentar +pdfjs-print-button-label = Imprentar + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Ferramientas +pdfjs-tools-button-label = Ferramientas +pdfjs-first-page-button = + .title = Ir ta la primer pachina +pdfjs-first-page-button-label = Ir ta la primer pachina +pdfjs-last-page-button = + .title = Ir ta la zaguer pachina +pdfjs-last-page-button-label = Ir ta la zaguer pachina +pdfjs-page-rotate-cw-button = + .title = Chirar enta la dreita +pdfjs-page-rotate-cw-button-label = Chira enta la dreita +pdfjs-page-rotate-ccw-button = + .title = Chirar enta la zurda +pdfjs-page-rotate-ccw-button-label = Chirar enta la zurda +pdfjs-cursor-text-select-tool-button = + .title = Activar la ferramienta de selección de texto +pdfjs-cursor-text-select-tool-button-label = Ferramienta de selección de texto +pdfjs-cursor-hand-tool-button = + .title = Activar la ferramienta man +pdfjs-cursor-hand-tool-button-label = Ferramienta man +pdfjs-scroll-vertical-button = + .title = Usar lo desplazamiento vertical +pdfjs-scroll-vertical-button-label = Desplazamiento vertical +pdfjs-scroll-horizontal-button = + .title = Usar lo desplazamiento horizontal +pdfjs-scroll-horizontal-button-label = Desplazamiento horizontal +pdfjs-scroll-wrapped-button = + .title = Activaar lo desplazamiento contino +pdfjs-scroll-wrapped-button-label = Desplazamiento contino +pdfjs-spread-none-button = + .title = No unir vistas de pachinas +pdfjs-spread-none-button-label = Una pachina nomás +pdfjs-spread-odd-button = + .title = Mostrar vista de pachinas, con as impars a la zurda +pdfjs-spread-odd-button-label = Doble pachina, impar a la zurda +pdfjs-spread-even-button = + .title = Amostrar vista de pachinas, con as pars a la zurda +pdfjs-spread-even-button-label = Doble pachina, para a la zurda + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Propiedatz d'o documento... +pdfjs-document-properties-button-label = Propiedatz d'o documento... +pdfjs-document-properties-file-name = Nombre de fichero: +pdfjs-document-properties-file-size = Grandaria d'o fichero: +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bytes) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bytes) +pdfjs-document-properties-title = Titol: +pdfjs-document-properties-author = Autor: +pdfjs-document-properties-subject = Afer: +pdfjs-document-properties-keywords = Parolas clau: +pdfjs-document-properties-creation-date = Calendata de creyación: +pdfjs-document-properties-modification-date = Calendata de modificación: +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Creyador: +pdfjs-document-properties-producer = Creyador de PDF: +pdfjs-document-properties-version = Versión de PDF: +pdfjs-document-properties-page-count = Numero de pachinas: +pdfjs-document-properties-page-size = Mida de pachina: +pdfjs-document-properties-page-size-unit-inches = pulgadas +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = vertical +pdfjs-document-properties-page-size-orientation-landscape = horizontal +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Carta +pdfjs-document-properties-page-size-name-legal = Legal + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } x { $height } { $unit } { $orientation } +pdfjs-document-properties-page-size-dimension-name-string = { $width } x { $height } { $unit } { $name }, { $orientation } + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Vista web rapida: +pdfjs-document-properties-linearized-yes = Sí +pdfjs-document-properties-linearized-no = No +pdfjs-document-properties-close-button = Zarrar + +## Print + +pdfjs-print-progress-message = Se ye preparando la documentación pa imprentar… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Cancelar +pdfjs-printing-not-supported = Pare cuenta: Iste navegador no maneya totalment as impresions. +pdfjs-printing-not-ready = Aviso: Encara no se ha cargau completament o PDF ta imprentar-lo. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Amostrar u amagar a barra lateral +pdfjs-toggle-sidebar-notification-button = + .title = Cambiar barra lateral (lo documento contiene esquema/adchuntos/capas) +pdfjs-toggle-sidebar-button-label = Amostrar a barra lateral +pdfjs-document-outline-button = + .title = Amostrar esquema d'o documento (fer doble clic pa expandir/compactar totz los items) +pdfjs-document-outline-button-label = Esquema d'o documento +pdfjs-attachments-button = + .title = Amostrar os adchuntos +pdfjs-attachments-button-label = Adchuntos +pdfjs-layers-button = + .title = Amostrar capas (doble clic para reiniciar totas las capas a lo estau per defecto) +pdfjs-layers-button-label = Capas +pdfjs-thumbs-button = + .title = Amostrar as miniaturas +pdfjs-thumbs-button-label = Miniaturas +pdfjs-findbar-button = + .title = Trobar en o documento +pdfjs-findbar-button-label = Trobar +pdfjs-additional-layers = Capas adicionals + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Pachina { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Miniatura d'a pachina { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Trobar + .placeholder = Trobar en o documento… +pdfjs-find-previous-button = + .title = Trobar l'anterior coincidencia d'a frase +pdfjs-find-previous-button-label = Anterior +pdfjs-find-next-button = + .title = Trobar a siguient coincidencia d'a frase +pdfjs-find-next-button-label = Siguient +pdfjs-find-highlight-checkbox = Resaltar-lo tot +pdfjs-find-match-case-checkbox-label = Coincidencia de mayusclas/minusclas +pdfjs-find-entire-word-checkbox-label = Parolas completas +pdfjs-find-reached-top = S'ha plegau a l'inicio d'o documento, se contina dende baixo +pdfjs-find-reached-bottom = S'ha plegau a la fin d'o documento, se contina dende alto +pdfjs-find-not-found = No s'ha trobau a frase + +## Predefined zoom values + +pdfjs-page-scale-width = Amplaria d'a pachina +pdfjs-page-scale-fit = Achuste d'a pachina +pdfjs-page-scale-auto = Grandaria automatica +pdfjs-page-scale-actual = Grandaria actual +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + + +## Loading indicator messages + +pdfjs-loading-error = S'ha produciu una error en cargar o PDF. +pdfjs-invalid-file-error = O PDF no ye valido u ye estorbau. +pdfjs-missing-file-error = No i ha fichero PDF. +pdfjs-unexpected-response-error = Respuesta a lo servicio inasperada. +pdfjs-rendering-error = Ha ocurriu una error en renderizar a pachina. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [Anotación { $type }] + +## Password + +pdfjs-password-label = Introduzca a clau ta ubrir iste fichero PDF. +pdfjs-password-invalid = Clau invalida. Torna a intentar-lo. +pdfjs-password-ok-button = Acceptar +pdfjs-password-cancel-button = Cancelar +pdfjs-web-fonts-disabled = As fuents web son desactivadas: no se puet incrustar fichers PDF. + +## Editing + + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + diff --git a/public/pdfjs/web/locale/ar/viewer.ftl b/public/pdfjs/web/locale/ar/viewer.ftl new file mode 100644 index 0000000..8d14767 --- /dev/null +++ b/public/pdfjs/web/locale/ar/viewer.ftl @@ -0,0 +1,425 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = الصفحة السابقة +pdfjs-previous-button-label = السابقة +pdfjs-next-button = + .title = الصفحة التالية +pdfjs-next-button-label = التالية +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = صفحة +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = من { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } من { $pagesCount }) +pdfjs-zoom-out-button = + .title = بعّد +pdfjs-zoom-out-button-label = بعّد +pdfjs-zoom-in-button = + .title = قرّب +pdfjs-zoom-in-button-label = قرّب +pdfjs-zoom-select = + .title = التقريب +pdfjs-presentation-mode-button = + .title = انتقل لوضع العرض التقديمي +pdfjs-presentation-mode-button-label = وضع العرض التقديمي +pdfjs-open-file-button = + .title = افتح ملفًا +pdfjs-open-file-button-label = افتح +pdfjs-print-button = + .title = اطبع +pdfjs-print-button-label = اطبع +pdfjs-save-button = + .title = احفظ +pdfjs-save-button-label = احفظ +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = نزّل +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = نزّل +pdfjs-bookmark-button = + .title = الصفحة الحالية (عرض URL من الصفحة الحالية) +pdfjs-bookmark-button-label = الصفحة الحالية + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = الأدوات +pdfjs-tools-button-label = الأدوات +pdfjs-first-page-button = + .title = انتقل إلى الصفحة الأولى +pdfjs-first-page-button-label = انتقل إلى الصفحة الأولى +pdfjs-last-page-button = + .title = انتقل إلى الصفحة الأخيرة +pdfjs-last-page-button-label = انتقل إلى الصفحة الأخيرة +pdfjs-page-rotate-cw-button = + .title = أدر باتجاه عقارب الساعة +pdfjs-page-rotate-cw-button-label = أدر باتجاه عقارب الساعة +pdfjs-page-rotate-ccw-button = + .title = أدر بعكس اتجاه عقارب الساعة +pdfjs-page-rotate-ccw-button-label = أدر بعكس اتجاه عقارب الساعة +pdfjs-cursor-text-select-tool-button = + .title = فعّل أداة اختيار النص +pdfjs-cursor-text-select-tool-button-label = أداة اختيار النص +pdfjs-cursor-hand-tool-button = + .title = فعّل أداة اليد +pdfjs-cursor-hand-tool-button-label = أداة اليد +pdfjs-scroll-page-button = + .title = استخدم تمرير الصفحة +pdfjs-scroll-page-button-label = تمرير الصفحة +pdfjs-scroll-vertical-button = + .title = استخدم التمرير الرأسي +pdfjs-scroll-vertical-button-label = التمرير الرأسي +pdfjs-scroll-horizontal-button = + .title = استخدم التمرير الأفقي +pdfjs-scroll-horizontal-button-label = التمرير الأفقي +pdfjs-scroll-wrapped-button = + .title = استخدم التمرير الملتف +pdfjs-scroll-wrapped-button-label = التمرير الملتف +pdfjs-spread-none-button = + .title = لا تدمج هوامش الصفحات مع بعضها البعض +pdfjs-spread-none-button-label = بلا هوامش +pdfjs-spread-odd-button = + .title = ادمج هوامش الصفحات الفردية +pdfjs-spread-odd-button-label = هوامش الصفحات الفردية +pdfjs-spread-even-button = + .title = ادمج هوامش الصفحات الزوجية +pdfjs-spread-even-button-label = هوامش الصفحات الزوجية + +## Document properties dialog + +pdfjs-document-properties-button = + .title = خصائص المستند… +pdfjs-document-properties-button-label = خصائص المستند… +pdfjs-document-properties-file-name = اسم الملف: +pdfjs-document-properties-file-size = حجم الملف: +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } ك.بايت ({ $size_b } بايت) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } م.بايت ({ $size_b } بايت) +pdfjs-document-properties-title = العنوان: +pdfjs-document-properties-author = المؤلف: +pdfjs-document-properties-subject = الموضوع: +pdfjs-document-properties-keywords = الكلمات الأساسية: +pdfjs-document-properties-creation-date = تاريخ الإنشاء: +pdfjs-document-properties-modification-date = تاريخ التعديل: +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }، { $time } +pdfjs-document-properties-creator = المنشئ: +pdfjs-document-properties-producer = منتج PDF: +pdfjs-document-properties-version = إصدارة PDF: +pdfjs-document-properties-page-count = عدد الصفحات: +pdfjs-document-properties-page-size = مقاس الورقة: +pdfjs-document-properties-page-size-unit-inches = بوصة +pdfjs-document-properties-page-size-unit-millimeters = ملم +pdfjs-document-properties-page-size-orientation-portrait = طوليّ +pdfjs-document-properties-page-size-orientation-landscape = عرضيّ +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = خطاب +pdfjs-document-properties-page-size-name-legal = قانونيّ + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = ‏{ $width } × ‏{ $height } ‏{ $unit } (‏{ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = ‏{ $width } × ‏{ $height } ‏{ $unit } (‏{ $name }، { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = العرض السريع عبر الوِب: +pdfjs-document-properties-linearized-yes = نعم +pdfjs-document-properties-linearized-no = لا +pdfjs-document-properties-close-button = أغلق + +## Print + +pdfjs-print-progress-message = يُحضّر المستند للطباعة… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }٪ +pdfjs-print-progress-close-button = ألغِ +pdfjs-printing-not-supported = تحذير: لا يدعم هذا المتصفح الطباعة بشكل كامل. +pdfjs-printing-not-ready = تحذير: ملف PDF لم يُحمّل كاملًا للطباعة. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = بدّل ظهور الشريط الجانبي +pdfjs-toggle-sidebar-notification-button = + .title = بدّل ظهور الشريط الجانبي (يحتوي المستند على مخطط أو مرفقات أو طبقات) +pdfjs-toggle-sidebar-button-label = بدّل ظهور الشريط الجانبي +pdfjs-document-outline-button = + .title = اعرض فهرس المستند (نقر مزدوج لتمديد أو تقليص كل العناصر) +pdfjs-document-outline-button-label = مخطط المستند +pdfjs-attachments-button = + .title = اعرض المرفقات +pdfjs-attachments-button-label = المُرفقات +pdfjs-layers-button = + .title = اعرض الطبقات (انقر مرتين لتصفير كل الطبقات إلى الحالة المبدئية) +pdfjs-layers-button-label = ‏‏الطبقات +pdfjs-thumbs-button = + .title = اعرض مُصغرات +pdfjs-thumbs-button-label = مُصغّرات +pdfjs-current-outline-item-button = + .title = ابحث عن عنصر المخطّط التفصيلي الحالي +pdfjs-current-outline-item-button-label = عنصر المخطّط التفصيلي الحالي +pdfjs-findbar-button = + .title = ابحث في المستند +pdfjs-findbar-button-label = ابحث +pdfjs-additional-layers = الطبقات الإضافية + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = صفحة { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = مصغّرة صفحة { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = ابحث + .placeholder = ابحث في المستند… +pdfjs-find-previous-button = + .title = ابحث عن التّواجد السّابق للعبارة +pdfjs-find-previous-button-label = السابق +pdfjs-find-next-button = + .title = ابحث عن التّواجد التّالي للعبارة +pdfjs-find-next-button-label = التالي +pdfjs-find-highlight-checkbox = أبرِز الكل +pdfjs-find-match-case-checkbox-label = طابق حالة الأحرف +pdfjs-find-match-diacritics-checkbox-label = طابِق الحركات +pdfjs-find-entire-word-checkbox-label = كلمات كاملة +pdfjs-find-reached-top = تابعت من الأسفل بعدما وصلت إلى بداية المستند +pdfjs-find-reached-bottom = تابعت من الأعلى بعدما وصلت إلى نهاية المستند +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [zero] لا مطابقة + [one] { $current } من أصل { $total } مطابقة + [two] { $current } من أصل { $total } مطابقة + [few] { $current } من أصل { $total } مطابقة + [many] { $current } من أصل { $total } مطابقة + *[other] { $current } من أصل { $total } مطابقة + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [zero] { $limit } مطابقة + [one] أكثر من { $limit } مطابقة + [two] أكثر من { $limit } مطابقة + [few] أكثر من { $limit } مطابقة + [many] أكثر من { $limit } مطابقة + *[other] أكثر من { $limit } مطابقات + } +pdfjs-find-not-found = لا وجود للعبارة + +## Predefined zoom values + +pdfjs-page-scale-width = عرض الصفحة +pdfjs-page-scale-fit = ملائمة الصفحة +pdfjs-page-scale-auto = تقريب تلقائي +pdfjs-page-scale-actual = الحجم الفعلي +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }٪ + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = صفحة { $page } + +## Loading indicator messages + +pdfjs-loading-error = حدث عطل أثناء تحميل ملف PDF. +pdfjs-invalid-file-error = ملف PDF تالف أو غير صحيح. +pdfjs-missing-file-error = ملف PDF غير موجود. +pdfjs-unexpected-response-error = استجابة خادوم غير متوقعة. +pdfjs-rendering-error = حدث خطأ أثناء عرض الصفحة. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }، { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [تعليق { $type }] + +## Password + +pdfjs-password-label = أدخل لكلمة السر لفتح هذا الملف. +pdfjs-password-invalid = كلمة سر خطأ. من فضلك أعد المحاولة. +pdfjs-password-ok-button = حسنا +pdfjs-password-cancel-button = ألغِ +pdfjs-web-fonts-disabled = خطوط الوب مُعطّلة: تعذّر استخدام خطوط PDF المُضمّنة. + +## Editing + +pdfjs-editor-free-text-button = + .title = نص +pdfjs-editor-free-text-button-label = نص +pdfjs-editor-ink-button = + .title = ارسم +pdfjs-editor-ink-button-label = ارسم +pdfjs-editor-stamp-button = + .title = أضِف أو حرّر الصور +pdfjs-editor-stamp-button-label = أضِف أو حرّر الصور +pdfjs-editor-highlight-button = + .title = أبرِز +pdfjs-editor-highlight-button-label = أبرِز +pdfjs-highlight-floating-button1 = + .title = أبرِز + .aria-label = أبرِز +pdfjs-highlight-floating-button-label = أبرِز + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = أزِل الرسم +pdfjs-editor-remove-freetext-button = + .title = أزِل النص +pdfjs-editor-remove-stamp-button = + .title = أزِل الصورة +pdfjs-editor-remove-highlight-button = + .title = أزِل الإبراز + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = اللون +pdfjs-editor-free-text-size-input = الحجم +pdfjs-editor-ink-color-input = اللون +pdfjs-editor-ink-thickness-input = السماكة +pdfjs-editor-ink-opacity-input = العتامة +pdfjs-editor-stamp-add-image-button = + .title = أضِف صورة +pdfjs-editor-stamp-add-image-button-label = أضِف صورة +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = السماكة +pdfjs-editor-free-highlight-thickness-title = + .title = غيّر السُمك عند إبراز عناصر أُخرى غير النص +pdfjs-free-text = + .aria-label = محرِّر النص +pdfjs-free-text-default-content = ابدأ الكتابة… +pdfjs-ink = + .aria-label = محرِّر الرسم +pdfjs-ink-canvas = + .aria-label = صورة أنشأها المستخدم + +## Alt-text dialog + +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button-label = نص بديل +pdfjs-editor-alt-text-edit-button-label = تحرير النص البديل +pdfjs-editor-alt-text-dialog-label = اختر خيار +pdfjs-editor-alt-text-dialog-description = يساعد النص البديل عندما لا يتمكن الأشخاص من رؤية الصورة أو عندما لا يتم تحميلها. +pdfjs-editor-alt-text-add-description-label = أضِف وصف +pdfjs-editor-alt-text-add-description-description = استهدف جملتين تصفان الموضوع أو الإعداد أو الإجراءات. +pdfjs-editor-alt-text-mark-decorative-label = علّمها على أنها زخرفية +pdfjs-editor-alt-text-mark-decorative-description = يُستخدم هذا في الصور المزخرفة، مثل الحدود أو العلامات المائية. +pdfjs-editor-alt-text-cancel-button = ألغِ +pdfjs-editor-alt-text-save-button = احفظ +pdfjs-editor-alt-text-decorative-tooltip = عُلّمت على أنها زخرفية +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = على سبيل المثال، "يجلس شاب على الطاولة لتناول وجبة" + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = الزاوية اليُسرى العُليا — غيّر الحجم +pdfjs-editor-resizer-label-top-middle = أعلى الوسط - غيّر الحجم +pdfjs-editor-resizer-label-top-right = الزاوية اليُمنى العُليا - غيّر الحجم +pdfjs-editor-resizer-label-middle-right = اليمين الأوسط - غيّر الحجم +pdfjs-editor-resizer-label-bottom-right = الزاوية اليُمنى السُفلى - غيّر الحجم +pdfjs-editor-resizer-label-bottom-middle = أسفل الوسط - غيّر الحجم +pdfjs-editor-resizer-label-bottom-left = الزاوية اليُسرى السُفلية - غيّر الحجم +pdfjs-editor-resizer-label-middle-left = مُنتصف اليسار - غيّر الحجم +pdfjs-editor-resizer-top-left = + .aria-label = الزاوية اليُسرى العُليا — غيّر الحجم +pdfjs-editor-resizer-top-middle = + .aria-label = أعلى الوسط - غيّر الحجم +pdfjs-editor-resizer-top-right = + .aria-label = الزاوية اليُمنى العُليا - غيّر الحجم +pdfjs-editor-resizer-middle-right = + .aria-label = اليمين الأوسط - غيّر الحجم +pdfjs-editor-resizer-bottom-right = + .aria-label = الزاوية اليُمنى السُفلى - غيّر الحجم +pdfjs-editor-resizer-bottom-middle = + .aria-label = أسفل الوسط - غيّر الحجم +pdfjs-editor-resizer-bottom-left = + .aria-label = الزاوية اليُسرى السُفلية - غيّر الحجم +pdfjs-editor-resizer-middle-left = + .aria-label = مُنتصف اليسار - غيّر الحجم + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = أبرِز اللون +pdfjs-editor-colorpicker-button = + .title = غيّر اللون +pdfjs-editor-colorpicker-dropdown = + .aria-label = اختيارات الألوان +pdfjs-editor-colorpicker-yellow = + .title = أصفر +pdfjs-editor-colorpicker-green = + .title = أخضر +pdfjs-editor-colorpicker-blue = + .title = أزرق +pdfjs-editor-colorpicker-pink = + .title = وردي +pdfjs-editor-colorpicker-red = + .title = أحمر + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = أظهِر الكل +pdfjs-editor-highlight-show-all-button = + .title = أظهِر الكل + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + + +## Image alt-text settings + diff --git a/public/pdfjs/web/locale/ast/viewer.ftl b/public/pdfjs/web/locale/ast/viewer.ftl new file mode 100644 index 0000000..2503caf --- /dev/null +++ b/public/pdfjs/web/locale/ast/viewer.ftl @@ -0,0 +1,201 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Páxina anterior +pdfjs-previous-button-label = Anterior +pdfjs-next-button = + .title = Páxina siguiente +pdfjs-next-button-label = Siguiente +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Páxina +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = de { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } de { $pagesCount }) +pdfjs-zoom-out-button = + .title = Alloñar +pdfjs-zoom-out-button-label = Alloña +pdfjs-zoom-in-button = + .title = Averar +pdfjs-zoom-in-button-label = Avera +pdfjs-zoom-select = + .title = Zoom +pdfjs-presentation-mode-button = + .title = Cambiar al mou de presentación +pdfjs-presentation-mode-button-label = Mou de presentación +pdfjs-open-file-button-label = Abrir +pdfjs-print-button = + .title = Imprentar +pdfjs-print-button-label = Imprentar + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Ferramientes +pdfjs-tools-button-label = Ferramientes +pdfjs-first-page-button-label = Dir a la primer páxina +pdfjs-last-page-button-label = Dir a la última páxina +pdfjs-page-rotate-cw-button = + .title = Voltia a la derecha +pdfjs-page-rotate-cw-button-label = Voltiar a la derecha +pdfjs-page-rotate-ccw-button = + .title = Voltia a la esquierda +pdfjs-page-rotate-ccw-button-label = Voltiar a la esquierda +pdfjs-cursor-text-select-tool-button = + .title = Activa la ferramienta d'esbilla de testu +pdfjs-cursor-text-select-tool-button-label = Ferramienta d'esbilla de testu +pdfjs-cursor-hand-tool-button = + .title = Activa la ferramienta de mano +pdfjs-cursor-hand-tool-button-label = Ferramienta de mano +pdfjs-scroll-vertical-button = + .title = Usa'l desplazamientu vertical +pdfjs-scroll-vertical-button-label = Desplazamientu vertical +pdfjs-scroll-horizontal-button = + .title = Usa'l desplazamientu horizontal +pdfjs-scroll-horizontal-button-label = Desplazamientu horizontal +pdfjs-scroll-wrapped-button = + .title = Usa'l desplazamientu continuu +pdfjs-scroll-wrapped-button-label = Desplazamientu continuu +pdfjs-spread-none-button-label = Fueyes individuales +pdfjs-spread-odd-button-label = Fueyes pares +pdfjs-spread-even-button-label = Fueyes impares + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Propiedaes del documentu… +pdfjs-document-properties-button-label = Propiedaes del documentu… +pdfjs-document-properties-file-name = Nome del ficheru: +pdfjs-document-properties-file-size = Tamañu del ficheru: +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bytes) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bytes) +pdfjs-document-properties-title = Títulu: +pdfjs-document-properties-keywords = Pallabres clave: +pdfjs-document-properties-creation-date = Data de creación: +pdfjs-document-properties-modification-date = Data de modificación: +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-producer = Productor del PDF: +pdfjs-document-properties-version = Versión del PDF: +pdfjs-document-properties-page-count = Númberu de páxines: +pdfjs-document-properties-page-size = Tamañu de páxina: +pdfjs-document-properties-page-size-unit-inches = in +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = vertical +pdfjs-document-properties-page-size-orientation-landscape = horizontal +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Vista web rápida: +pdfjs-document-properties-linearized-yes = Sí +pdfjs-document-properties-linearized-no = Non +pdfjs-document-properties-close-button = Zarrar + +## Print + +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Encaboxar + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Alternar la barra llateral +pdfjs-attachments-button = + .title = Amosar los axuntos +pdfjs-attachments-button-label = Axuntos +pdfjs-layers-button-label = Capes +pdfjs-thumbs-button = + .title = Amosar les miniatures +pdfjs-thumbs-button-label = Miniatures +pdfjs-findbar-button-label = Atopar +pdfjs-additional-layers = Capes adicionales + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Páxina { $page } + +## Find panel button title and messages + +pdfjs-find-previous-button-label = Anterior +pdfjs-find-next-button-label = Siguiente +pdfjs-find-entire-word-checkbox-label = Pallabres completes +pdfjs-find-reached-top = Algamóse'l comienzu de la páxina, síguese dende abaxo +pdfjs-find-reached-bottom = Algamóse la fin del documentu, síguese dende arriba + +## Predefined zoom values + +pdfjs-page-scale-auto = Zoom automáticu +pdfjs-page-scale-actual = Tamañu real +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Páxina { $page } + +## Loading indicator messages + +pdfjs-loading-error = Asocedió un fallu mentanto se cargaba'l PDF. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } + +## Password + +pdfjs-password-ok-button = Aceptar +pdfjs-password-cancel-button = Encaboxar + +## Editing + + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + diff --git a/public/pdfjs/web/locale/az/viewer.ftl b/public/pdfjs/web/locale/az/viewer.ftl new file mode 100644 index 0000000..773aae4 --- /dev/null +++ b/public/pdfjs/web/locale/az/viewer.ftl @@ -0,0 +1,257 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Əvvəlki səhifə +pdfjs-previous-button-label = Əvvəlkini tap +pdfjs-next-button = + .title = Növbəti səhifə +pdfjs-next-button-label = İrəli +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Səhifə +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = / { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } / { $pagesCount }) +pdfjs-zoom-out-button = + .title = Uzaqlaş +pdfjs-zoom-out-button-label = Uzaqlaş +pdfjs-zoom-in-button = + .title = Yaxınlaş +pdfjs-zoom-in-button-label = Yaxınlaş +pdfjs-zoom-select = + .title = Yaxınlaşdırma +pdfjs-presentation-mode-button = + .title = Təqdimat Rejiminə Keç +pdfjs-presentation-mode-button-label = Təqdimat Rejimi +pdfjs-open-file-button = + .title = Fayl Aç +pdfjs-open-file-button-label = Aç +pdfjs-print-button = + .title = Yazdır +pdfjs-print-button-label = Yazdır + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Alətlər +pdfjs-tools-button-label = Alətlər +pdfjs-first-page-button = + .title = İlk Səhifəyə get +pdfjs-first-page-button-label = İlk Səhifəyə get +pdfjs-last-page-button = + .title = Son Səhifəyə get +pdfjs-last-page-button-label = Son Səhifəyə get +pdfjs-page-rotate-cw-button = + .title = Saat İstiqamətində Fırlat +pdfjs-page-rotate-cw-button-label = Saat İstiqamətində Fırlat +pdfjs-page-rotate-ccw-button = + .title = Saat İstiqamətinin Əksinə Fırlat +pdfjs-page-rotate-ccw-button-label = Saat İstiqamətinin Əksinə Fırlat +pdfjs-cursor-text-select-tool-button = + .title = Yazı seçmə alətini aktivləşdir +pdfjs-cursor-text-select-tool-button-label = Yazı seçmə aləti +pdfjs-cursor-hand-tool-button = + .title = Əl alətini aktivləşdir +pdfjs-cursor-hand-tool-button-label = Əl aləti +pdfjs-scroll-vertical-button = + .title = Şaquli sürüşdürmə işlət +pdfjs-scroll-vertical-button-label = Şaquli sürüşdürmə +pdfjs-scroll-horizontal-button = + .title = Üfüqi sürüşdürmə işlət +pdfjs-scroll-horizontal-button-label = Üfüqi sürüşdürmə +pdfjs-scroll-wrapped-button = + .title = Bükülü sürüşdürmə işlət +pdfjs-scroll-wrapped-button-label = Bükülü sürüşdürmə +pdfjs-spread-none-button = + .title = Yan-yana birləşdirilmiş səhifələri işlətmə +pdfjs-spread-none-button-label = Birləşdirmə +pdfjs-spread-odd-button = + .title = Yan-yana birləşdirilmiş səhifələri tək nömrəli səhifələrdən başlat +pdfjs-spread-odd-button-label = Tək nömrəli +pdfjs-spread-even-button = + .title = Yan-yana birləşdirilmiş səhifələri cüt nömrəli səhifələrdən başlat +pdfjs-spread-even-button-label = Cüt nömrəli + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Sənəd xüsusiyyətləri… +pdfjs-document-properties-button-label = Sənəd xüsusiyyətləri… +pdfjs-document-properties-file-name = Fayl adı: +pdfjs-document-properties-file-size = Fayl ölçüsü: +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bayt) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bayt) +pdfjs-document-properties-title = Başlık: +pdfjs-document-properties-author = Müəllif: +pdfjs-document-properties-subject = Mövzu: +pdfjs-document-properties-keywords = Açar sözlər: +pdfjs-document-properties-creation-date = Yaradılış Tarixi : +pdfjs-document-properties-modification-date = Dəyişdirilmə Tarixi : +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Yaradan: +pdfjs-document-properties-producer = PDF yaradıcısı: +pdfjs-document-properties-version = PDF versiyası: +pdfjs-document-properties-page-count = Səhifə sayı: +pdfjs-document-properties-page-size = Səhifə Ölçüsü: +pdfjs-document-properties-page-size-unit-inches = inç +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = portret +pdfjs-document-properties-page-size-orientation-landscape = albom +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Məktub +pdfjs-document-properties-page-size-name-legal = Hüquqi + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Fast Web View: +pdfjs-document-properties-linearized-yes = Bəli +pdfjs-document-properties-linearized-no = Xeyr +pdfjs-document-properties-close-button = Qapat + +## Print + +pdfjs-print-progress-message = Sənəd çap üçün hazırlanır… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Ləğv et +pdfjs-printing-not-supported = Xəbərdarlıq: Çap bu səyyah tərəfindən tam olaraq dəstəklənmir. +pdfjs-printing-not-ready = Xəbərdarlıq: PDF çap üçün tam yüklənməyib. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Yan Paneli Aç/Bağla +pdfjs-toggle-sidebar-notification-button = + .title = Yan paneli çevir (sənəddə icmal/bağlamalar/laylar mövcuddur) +pdfjs-toggle-sidebar-button-label = Yan Paneli Aç/Bağla +pdfjs-document-outline-button = + .title = Sənədin eskizini göstər (bütün bəndləri açmaq/yığmaq üçün iki dəfə klikləyin) +pdfjs-document-outline-button-label = Sənəd strukturu +pdfjs-attachments-button = + .title = Bağlamaları göstər +pdfjs-attachments-button-label = Bağlamalar +pdfjs-layers-button = + .title = Layları göstər (bütün layları ilkin halına sıfırlamaq üçün iki dəfə klikləyin) +pdfjs-layers-button-label = Laylar +pdfjs-thumbs-button = + .title = Kiçik şəkilləri göstər +pdfjs-thumbs-button-label = Kiçik şəkillər +pdfjs-findbar-button = + .title = Sənəddə Tap +pdfjs-findbar-button-label = Tap +pdfjs-additional-layers = Əlavə laylar + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Səhifə{ $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = { $page } səhifəsinin kiçik vəziyyəti + +## Find panel button title and messages + +pdfjs-find-input = + .title = Tap + .placeholder = Sənəddə tap… +pdfjs-find-previous-button = + .title = Bir öncəki uyğun gələn sözü tapır +pdfjs-find-previous-button-label = Geri +pdfjs-find-next-button = + .title = Bir sonrakı uyğun gələn sözü tapır +pdfjs-find-next-button-label = İrəli +pdfjs-find-highlight-checkbox = İşarələ +pdfjs-find-match-case-checkbox-label = Böyük/kiçik hərfə həssaslıq +pdfjs-find-entire-word-checkbox-label = Tam sözlər +pdfjs-find-reached-top = Sənədin yuxarısına çatdı, aşağıdan davam edir +pdfjs-find-reached-bottom = Sənədin sonuna çatdı, yuxarıdan davam edir +pdfjs-find-not-found = Uyğunlaşma tapılmadı + +## Predefined zoom values + +pdfjs-page-scale-width = Səhifə genişliyi +pdfjs-page-scale-fit = Səhifəni sığdır +pdfjs-page-scale-auto = Avtomatik yaxınlaşdır +pdfjs-page-scale-actual = Hazırkı Həcm +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + + +## Loading indicator messages + +pdfjs-loading-error = PDF yüklenərkən bir səhv yarandı. +pdfjs-invalid-file-error = Səhv və ya zədələnmiş olmuş PDF fayl. +pdfjs-missing-file-error = PDF fayl yoxdur. +pdfjs-unexpected-response-error = Gözlənilməz server cavabı. +pdfjs-rendering-error = Səhifə göstərilərkən səhv yarandı. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } Annotasiyası] + +## Password + +pdfjs-password-label = Bu PDF faylı açmaq üçün parolu daxil edin. +pdfjs-password-invalid = Parol səhvdir. Bir daha yoxlayın. +pdfjs-password-ok-button = Tamam +pdfjs-password-cancel-button = Ləğv et +pdfjs-web-fonts-disabled = Web Şriftlər söndürülüb: yerləşdirilmiş PDF şriftlərini istifadə etmək mümkün deyil. + +## Editing + + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + diff --git a/public/pdfjs/web/locale/be/viewer.ftl b/public/pdfjs/web/locale/be/viewer.ftl new file mode 100644 index 0000000..3f029d9 --- /dev/null +++ b/public/pdfjs/web/locale/be/viewer.ftl @@ -0,0 +1,518 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Папярэдняя старонка +pdfjs-previous-button-label = Папярэдняя +pdfjs-next-button = + .title = Наступная старонка +pdfjs-next-button-label = Наступная +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Старонка +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = з { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } з { $pagesCount }) +pdfjs-zoom-out-button = + .title = Паменшыць +pdfjs-zoom-out-button-label = Паменшыць +pdfjs-zoom-in-button = + .title = Павялічыць +pdfjs-zoom-in-button-label = Павялічыць +pdfjs-zoom-select = + .title = Павялічэнне тэксту +pdfjs-presentation-mode-button = + .title = Пераключыцца ў рэжым паказу +pdfjs-presentation-mode-button-label = Рэжым паказу +pdfjs-open-file-button = + .title = Адкрыць файл +pdfjs-open-file-button-label = Адкрыць +pdfjs-print-button = + .title = Друкаваць +pdfjs-print-button-label = Друкаваць +pdfjs-save-button = + .title = Захаваць +pdfjs-save-button-label = Захаваць +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Сцягнуць +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Сцягнуць +pdfjs-bookmark-button = + .title = Дзейная старонка (паглядзець URL-адрас з дзейнай старонкі) +pdfjs-bookmark-button-label = Цяперашняя старонка + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Прылады +pdfjs-tools-button-label = Прылады +pdfjs-first-page-button = + .title = Перайсці на першую старонку +pdfjs-first-page-button-label = Перайсці на першую старонку +pdfjs-last-page-button = + .title = Перайсці на апошнюю старонку +pdfjs-last-page-button-label = Перайсці на апошнюю старонку +pdfjs-page-rotate-cw-button = + .title = Павярнуць па сонцу +pdfjs-page-rotate-cw-button-label = Павярнуць па сонцу +pdfjs-page-rotate-ccw-button = + .title = Павярнуць супраць сонца +pdfjs-page-rotate-ccw-button-label = Павярнуць супраць сонца +pdfjs-cursor-text-select-tool-button = + .title = Уключыць прыладу выбару тэксту +pdfjs-cursor-text-select-tool-button-label = Прылада выбару тэксту +pdfjs-cursor-hand-tool-button = + .title = Уключыць ручную прыладу +pdfjs-cursor-hand-tool-button-label = Ручная прылада +pdfjs-scroll-page-button = + .title = Выкарыстоўваць пракрутку старонкi +pdfjs-scroll-page-button-label = Пракрутка старонкi +pdfjs-scroll-vertical-button = + .title = Ужываць вертыкальную пракрутку +pdfjs-scroll-vertical-button-label = Вертыкальная пракрутка +pdfjs-scroll-horizontal-button = + .title = Ужываць гарызантальную пракрутку +pdfjs-scroll-horizontal-button-label = Гарызантальная пракрутка +pdfjs-scroll-wrapped-button = + .title = Ужываць маштабавальную пракрутку +pdfjs-scroll-wrapped-button-label = Маштабавальная пракрутка +pdfjs-spread-none-button = + .title = Не выкарыстоўваць разгорнутыя старонкі +pdfjs-spread-none-button-label = Без разгорнутых старонак +pdfjs-spread-odd-button = + .title = Разгорнутыя старонкі пачынаючы з няцотных нумароў +pdfjs-spread-odd-button-label = Няцотныя старонкі злева +pdfjs-spread-even-button = + .title = Разгорнутыя старонкі пачынаючы з цотных нумароў +pdfjs-spread-even-button-label = Цотныя старонкі злева + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Уласцівасці дакумента… +pdfjs-document-properties-button-label = Уласцівасці дакумента… +pdfjs-document-properties-file-name = Назва файла: +pdfjs-document-properties-file-size = Памер файла: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } КБ ({ $b } байтаў) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } МБ ({ $b } байтаў) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } КБ ({ $size_b } байт) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } МБ ({ $size_b } байт) +pdfjs-document-properties-title = Загаловак: +pdfjs-document-properties-author = Аўтар: +pdfjs-document-properties-subject = Тэма: +pdfjs-document-properties-keywords = Ключавыя словы: +pdfjs-document-properties-creation-date = Дата стварэння: +pdfjs-document-properties-modification-date = Дата змянення: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Стваральнік: +pdfjs-document-properties-producer = Вырабнік PDF: +pdfjs-document-properties-version = Версія PDF: +pdfjs-document-properties-page-count = Колькасць старонак: +pdfjs-document-properties-page-size = Памер старонкі: +pdfjs-document-properties-page-size-unit-inches = цаляў +pdfjs-document-properties-page-size-unit-millimeters = мм +pdfjs-document-properties-page-size-orientation-portrait = кніжная +pdfjs-document-properties-page-size-orientation-landscape = альбомная +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Letter +pdfjs-document-properties-page-size-name-legal = Legal + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Хуткі прагляд у Інтэрнэце: +pdfjs-document-properties-linearized-yes = Так +pdfjs-document-properties-linearized-no = Не +pdfjs-document-properties-close-button = Закрыць + +## Print + +pdfjs-print-progress-message = Падрыхтоўка дакумента да друку… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Скасаваць +pdfjs-printing-not-supported = Папярэджанне: друк не падтрымліваецца цалкам гэтым браўзерам. +pdfjs-printing-not-ready = Увага: PDF не сцягнуты цалкам для друкавання. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Паказаць/схаваць бакавую панэль +pdfjs-toggle-sidebar-notification-button = + .title = Паказаць/схаваць бакавую панэль (дакумент мае змест/укладанні/пласты) +pdfjs-toggle-sidebar-button-label = Паказаць/схаваць бакавую панэль +pdfjs-document-outline-button = + .title = Паказаць структуру дакумента (двайная пстрычка, каб разгарнуць /згарнуць усе элементы) +pdfjs-document-outline-button-label = Структура дакумента +pdfjs-attachments-button = + .title = Паказаць далучэнні +pdfjs-attachments-button-label = Далучэнні +pdfjs-layers-button = + .title = Паказаць пласты (націсніце двойчы, каб скінуць усе пласты да прадвызначанага стану) +pdfjs-layers-button-label = Пласты +pdfjs-thumbs-button = + .title = Паказ мініяцюр +pdfjs-thumbs-button-label = Мініяцюры +pdfjs-current-outline-item-button = + .title = Знайсці бягучы элемент структуры +pdfjs-current-outline-item-button-label = Бягучы элемент структуры +pdfjs-findbar-button = + .title = Пошук у дакуменце +pdfjs-findbar-button-label = Знайсці +pdfjs-additional-layers = Дадатковыя пласты + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Старонка { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Мініяцюра старонкі { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Шукаць + .placeholder = Шукаць у дакуменце… +pdfjs-find-previous-button = + .title = Знайсці папярэдні выпадак выразу +pdfjs-find-previous-button-label = Папярэдні +pdfjs-find-next-button = + .title = Знайсці наступны выпадак выразу +pdfjs-find-next-button-label = Наступны +pdfjs-find-highlight-checkbox = Падфарбаваць усе +pdfjs-find-match-case-checkbox-label = Адрозніваць вялікія/малыя літары +pdfjs-find-match-diacritics-checkbox-label = З улікам дыякрытык +pdfjs-find-entire-word-checkbox-label = Словы цалкам +pdfjs-find-reached-top = Дасягнуты пачатак дакумента, працяг з канца +pdfjs-find-reached-bottom = Дасягнуты канец дакумента, працяг з пачатку +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] { $current } з { $total } супадзенняў + [few] { $current } з { $total } супадзенняў + *[many] { $current } з { $total } супадзенняў + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] Больш за { $limit } супадзенне + [few] Больш за { $limit } супадзенні + *[many] Больш за { $limit } супадзенняў + } +pdfjs-find-not-found = Выраз не знойдзены + +## Predefined zoom values + +pdfjs-page-scale-width = Шырыня старонкі +pdfjs-page-scale-fit = Уцісненне старонкі +pdfjs-page-scale-auto = Аўтаматычнае павелічэнне +pdfjs-page-scale-actual = Сапраўдны памер +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Старонка { $page } + +## Loading indicator messages + +pdfjs-loading-error = Здарылася памылка ў часе загрузкі PDF. +pdfjs-invalid-file-error = Няспраўны або пашкоджаны файл PDF. +pdfjs-missing-file-error = Адсутны файл PDF. +pdfjs-unexpected-response-error = Нечаканы адказ сервера. +pdfjs-rendering-error = Здарылася памылка падчас адлюстравання старонкі. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } Annotation] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Увядзіце пароль, каб адкрыць гэты файл PDF. +pdfjs-password-invalid = Нядзейсны пароль. Паспрабуйце зноў. +pdfjs-password-ok-button = Добра +pdfjs-password-cancel-button = Скасаваць +pdfjs-web-fonts-disabled = Шрыфты Сеціва забаронены: немагчыма ўжываць укладзеныя шрыфты PDF. + +## Editing + +pdfjs-editor-free-text-button = + .title = Тэкст +pdfjs-editor-free-text-button-label = Тэкст +pdfjs-editor-ink-button = + .title = Маляваць +pdfjs-editor-ink-button-label = Маляваць +pdfjs-editor-stamp-button = + .title = Дадаць або змяніць выявы +pdfjs-editor-stamp-button-label = Дадаць або змяніць выявы +pdfjs-editor-highlight-button = + .title = Вылучэнне +pdfjs-editor-highlight-button-label = Вылучэнне +pdfjs-highlight-floating-button1 = + .title = Падфарбаваць + .aria-label = Падфарбаваць +pdfjs-highlight-floating-button-label = Падфарбаваць + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Выдаліць малюнак +pdfjs-editor-remove-freetext-button = + .title = Выдаліць тэкст +pdfjs-editor-remove-stamp-button = + .title = Выдаліць выяву +pdfjs-editor-remove-highlight-button = + .title = Выдаліць падфарбоўку + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Колер +pdfjs-editor-free-text-size-input = Памер +pdfjs-editor-ink-color-input = Колер +pdfjs-editor-ink-thickness-input = Таўшчыня +pdfjs-editor-ink-opacity-input = Непразрыстасць +pdfjs-editor-stamp-add-image-button = + .title = Дадаць выяву +pdfjs-editor-stamp-add-image-button-label = Дадаць выяву +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Таўшчыня +pdfjs-editor-free-highlight-thickness-title = + .title = Змяняць таўшчыню пры вылучэнні іншых элементаў, акрамя тэксту +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = Тэкставы рэдактар + .default-content = Пачніце ўводзіць… +pdfjs-free-text = + .aria-label = Тэкставы рэдактар +pdfjs-free-text-default-content = Пачніце набор тэксту… +pdfjs-ink = + .aria-label = Графічны рэдактар +pdfjs-ink-canvas = + .aria-label = Выява, створаная карыстальнікам + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = Альтэрнатыўны тэкст +pdfjs-editor-alt-text-edit-button = + .aria-label = Змяніць альтэрнатыўны тэкст +pdfjs-editor-alt-text-edit-button-label = Змяніць альтэрнатыўны тэкст +pdfjs-editor-alt-text-dialog-label = Выберыце варыянт +pdfjs-editor-alt-text-dialog-description = Альтэрнатыўны тэкст дапамагае, калі людзі не бачаць выяву або калі яна не загружаецца. +pdfjs-editor-alt-text-add-description-label = Дадаць апісанне +pdfjs-editor-alt-text-add-description-description = Старайцеся скласці 1-2 сказы, якія апісваюць прадмет, абстаноўку або дзеянні. +pdfjs-editor-alt-text-mark-decorative-label = Пазначыць як дэкаратыўны +pdfjs-editor-alt-text-mark-decorative-description = Выкарыстоўваецца для дэкаратыўных выяваў, такіх як рамкі або вадзяныя знакі. +pdfjs-editor-alt-text-cancel-button = Скасаваць +pdfjs-editor-alt-text-save-button = Захаваць +pdfjs-editor-alt-text-decorative-tooltip = Пазначаны як дэкаратыўны +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = Напрыклад, «Малады чалавек садзіцца за стол есці» +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = Альтэрнатыўны тэкст + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Верхні левы кут — змяніць памер +pdfjs-editor-resizer-label-top-middle = Уверсе пасярэдзіне — змяніць памер +pdfjs-editor-resizer-label-top-right = Верхні правы кут — змяніць памер +pdfjs-editor-resizer-label-middle-right = Пасярэдзіне справа — змяніць памер +pdfjs-editor-resizer-label-bottom-right = Правы ніжні кут — змяніць памер +pdfjs-editor-resizer-label-bottom-middle = Пасярэдзіне ўнізе — змяніць памер +pdfjs-editor-resizer-label-bottom-left = Левы ніжні кут — змяніць памер +pdfjs-editor-resizer-label-middle-left = Пасярэдзіне злева — змяніць памер +pdfjs-editor-resizer-top-left = + .aria-label = Верхні левы кут — змяніць памер +pdfjs-editor-resizer-top-middle = + .aria-label = Уверсе пасярэдзіне — змяніць памер +pdfjs-editor-resizer-top-right = + .aria-label = Верхні правы кут — змяніць памер +pdfjs-editor-resizer-middle-right = + .aria-label = Пасярэдзіне справа — змяніць памер +pdfjs-editor-resizer-bottom-right = + .aria-label = Правы ніжні кут — змяніць памер +pdfjs-editor-resizer-bottom-middle = + .aria-label = Пасярэдзіне ўнізе — змяніць памер +pdfjs-editor-resizer-bottom-left = + .aria-label = Левы ніжні кут — змяніць памер +pdfjs-editor-resizer-middle-left = + .aria-label = Пасярэдзіне злева — змяніць памер + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Колер падфарбоўкі +pdfjs-editor-colorpicker-button = + .title = Змяніць колер +pdfjs-editor-colorpicker-dropdown = + .aria-label = Выбар колеру +pdfjs-editor-colorpicker-yellow = + .title = Жоўты +pdfjs-editor-colorpicker-green = + .title = Зялёны +pdfjs-editor-colorpicker-blue = + .title = Блакітны +pdfjs-editor-colorpicker-pink = + .title = Ружовы +pdfjs-editor-colorpicker-red = + .title = Чырвоны + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Паказаць усе +pdfjs-editor-highlight-show-all-button = + .title = Паказаць усе + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = Рэдагаваць тэкст для атрыбута alt (апісанне выявы) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = Дадаць тэкст для атрыбута alt (апісанне выявы) +pdfjs-editor-new-alt-text-textarea = + .placeholder = Напішыце сваё апісанне тут… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = Кароткае апісанне для людзей, якія не бачаць выяву, ці калі выява не загружаецца. +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = Гэты тэкст для атрыбута alt быў створаны аўтаматычна і можа быць недакладным +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Даведацца больш +pdfjs-editor-new-alt-text-create-automatically-button-label = Ствараць тэкст для атрыбута alt аўтаматычна +pdfjs-editor-new-alt-text-not-now-button = Не зараз +pdfjs-editor-new-alt-text-error-title = Не ўдалося аўтаматычна стварыць тэкст для атрыбута alt +pdfjs-editor-new-alt-text-error-description = Калі ласка, напішыце ўласны тэкст для атрыбута alt або паўтарыце спробу пазней. +pdfjs-editor-new-alt-text-error-close-button = Закрыць +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = Сцягванне мадэлі ШІ для тэксту для атрыбута alt ({ $downloadedSize } з { $totalSize } МБ) + .aria-valuetext = Сцягванне мадэлі ШІ для тэксту для атрыбута alt ({ $downloadedSize } з { $totalSize } МБ) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = Тэкст для атрыбута alt дададзены +pdfjs-editor-new-alt-text-added-button-label = Тэкст для атрыбута alt дададзены +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = Адсутнічае тэкст для атрыбута alt +pdfjs-editor-new-alt-text-missing-button-label = Адсутнічае тэкст для атрыбута alt +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = Водгук на тэкст для атрыбута alt +pdfjs-editor-new-alt-text-to-review-button-label = Водгук на тэкст для атрыбута alt +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Створаны аўтаматычна: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = Налады альтэрнатыўнага тэксту для выявы +pdfjs-image-alt-text-settings-button-label = Налады альтэрнатыўнага тэксту для выявы +pdfjs-editor-alt-text-settings-dialog-label = Налады альтэрнатыўнага тэксту для выявы +pdfjs-editor-alt-text-settings-automatic-title = Аўтаматычны тэкст для атрыбута alt +pdfjs-editor-alt-text-settings-create-model-button-label = Ствараць тэкст для атрыбута alt аўтаматычна +pdfjs-editor-alt-text-settings-create-model-description = Прапануе апісанні, каб дапамагчы людзям, якія не бачаць выяву, ці калі выява не загружаецца. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = Мадэль ШІ для тэксту для атрыбута alt ({ $totalSize } МБ) +pdfjs-editor-alt-text-settings-ai-model-description = Працуе лакальна на вашай прыладзе, таму вашы звесткі застаюцца прыватнымі. Патрабуецца для аўтаматычнага альтэрнатыўнага тэксту. +pdfjs-editor-alt-text-settings-delete-model-button = Выдаліць +pdfjs-editor-alt-text-settings-download-model-button = Сцягнуць +pdfjs-editor-alt-text-settings-downloading-model-button = Сцягванне… +pdfjs-editor-alt-text-settings-editor-title = Рэдактар тэксту для атрыбута alt +pdfjs-editor-alt-text-settings-show-dialog-button-label = Адразу паказваць рэдактар тэксту для атрыбута alt пры даданні выявы +pdfjs-editor-alt-text-settings-show-dialog-description = Дапамагае пераканацца, што ўсе вашы выявы маюць альтэрнатыўны тэкст. +pdfjs-editor-alt-text-settings-close-button = Закрыць + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = Падсвятленне выдалена +pdfjs-editor-undo-bar-message-freetext = Тэкст выдалены +pdfjs-editor-undo-bar-message-ink = Малюнак выдалены +pdfjs-editor-undo-bar-message-stamp = Відарыс выдалены +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = + { $count -> + [one] { $count } анатацыя выдалена + [few] { $count } анатацыі выдалена + *[many] { $count } анатацый выдалена + } +pdfjs-editor-undo-bar-undo-button = + .title = Адмяніць +pdfjs-editor-undo-bar-undo-button-label = Адмяніць +pdfjs-editor-undo-bar-close-button = + .title = Закрыць +pdfjs-editor-undo-bar-close-button-label = Закрыць diff --git a/public/pdfjs/web/locale/bg/viewer.ftl b/public/pdfjs/web/locale/bg/viewer.ftl new file mode 100644 index 0000000..8b1124e --- /dev/null +++ b/public/pdfjs/web/locale/bg/viewer.ftl @@ -0,0 +1,418 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Предишна страница +pdfjs-previous-button-label = Предишна +pdfjs-next-button = + .title = Следваща страница +pdfjs-next-button-label = Следваща +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Страница +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = от { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } от { $pagesCount }) +pdfjs-zoom-out-button = + .title = Намаляване +pdfjs-zoom-out-button-label = Намаляване +pdfjs-zoom-in-button = + .title = Увеличаване +pdfjs-zoom-in-button-label = Увеличаване +pdfjs-zoom-select = + .title = Мащабиране +pdfjs-presentation-mode-button = + .title = Превключване към режим на представяне +pdfjs-presentation-mode-button-label = Режим на представяне +pdfjs-open-file-button = + .title = Отваряне на файл +pdfjs-open-file-button-label = Отваряне +pdfjs-print-button = + .title = Отпечатване +pdfjs-print-button-label = Отпечатване +pdfjs-save-button = + .title = Запазване +pdfjs-save-button-label = Запазване +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Изтегляне +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Изтегляне +pdfjs-bookmark-button = + .title = Текуща страница (преглед на адреса на страницата) +pdfjs-bookmark-button-label = Текуща страница + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Инструменти +pdfjs-tools-button-label = Инструменти +pdfjs-first-page-button = + .title = Към първата страница +pdfjs-first-page-button-label = Към първата страница +pdfjs-last-page-button = + .title = Към последната страница +pdfjs-last-page-button-label = Към последната страница +pdfjs-page-rotate-cw-button = + .title = Завъртане по час. стрелка +pdfjs-page-rotate-cw-button-label = Завъртане по часовниковата стрелка +pdfjs-page-rotate-ccw-button = + .title = Завъртане обратно на час. стрелка +pdfjs-page-rotate-ccw-button-label = Завъртане обратно на часовниковата стрелка +pdfjs-cursor-text-select-tool-button = + .title = Включване на инструмента за избор на текст +pdfjs-cursor-text-select-tool-button-label = Инструмент за избор на текст +pdfjs-cursor-hand-tool-button = + .title = Включване на инструмента ръка +pdfjs-cursor-hand-tool-button-label = Инструмент ръка +pdfjs-scroll-page-button = + .title = Използване на плъзгане на страници +pdfjs-scroll-page-button-label = Плъзгане на страници +pdfjs-scroll-vertical-button = + .title = Използване на вертикално плъзгане +pdfjs-scroll-vertical-button-label = Вертикално плъзгане +pdfjs-scroll-horizontal-button = + .title = Използване на хоризонтално +pdfjs-scroll-horizontal-button-label = Хоризонтално плъзгане +pdfjs-scroll-wrapped-button = + .title = Използване на мащабируемо плъзгане +pdfjs-scroll-wrapped-button-label = Мащабируемо плъзгане +pdfjs-spread-none-button = + .title = Режимът на сдвояване е изключен +pdfjs-spread-none-button-label = Без сдвояване +pdfjs-spread-odd-button = + .title = Сдвояване, започвайки от нечетните страници +pdfjs-spread-odd-button-label = Нечетните отляво +pdfjs-spread-even-button = + .title = Сдвояване, започвайки от четните страници +pdfjs-spread-even-button-label = Четните отляво + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Свойства на документа… +pdfjs-document-properties-button-label = Свойства на документа… +pdfjs-document-properties-file-name = Име на файл: +pdfjs-document-properties-file-size = Големина на файл: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } КБ ({ $b } байта) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } МБ ({ $b } байта) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } КБ ({ $size_b } байта) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } МБ ({ $size_b } байта) +pdfjs-document-properties-title = Заглавие: +pdfjs-document-properties-author = Автор: +pdfjs-document-properties-subject = Тема: +pdfjs-document-properties-keywords = Ключови думи: +pdfjs-document-properties-creation-date = Дата на създаване: +pdfjs-document-properties-modification-date = Дата на промяна: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Създател: +pdfjs-document-properties-producer = PDF произведен от: +pdfjs-document-properties-version = Издание на PDF: +pdfjs-document-properties-page-count = Брой страници: +pdfjs-document-properties-page-size = Размер на страницата: +pdfjs-document-properties-page-size-unit-inches = инч +pdfjs-document-properties-page-size-unit-millimeters = мм +pdfjs-document-properties-page-size-orientation-portrait = портрет +pdfjs-document-properties-page-size-orientation-landscape = пейзаж +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Letter +pdfjs-document-properties-page-size-name-legal = Правни въпроси + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Бърз преглед: +pdfjs-document-properties-linearized-yes = Да +pdfjs-document-properties-linearized-no = Не +pdfjs-document-properties-close-button = Затваряне + +## Print + +pdfjs-print-progress-message = Подготвяне на документа за отпечатване… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Отказ +pdfjs-printing-not-supported = Внимание: Този четец няма пълна поддръжка на отпечатване. +pdfjs-printing-not-ready = Внимание: Този PDF файл не е напълно зареден за печат. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Превключване на страничната лента +pdfjs-toggle-sidebar-notification-button = + .title = Превключване на страничната лента (документът има структура/прикачени файлове/слоеве) +pdfjs-toggle-sidebar-button-label = Превключване на страничната лента +pdfjs-document-outline-button = + .title = Показване на структурата на документа (двукратно щракване за свиване/разгъване на всичко) +pdfjs-document-outline-button-label = Структура на документа +pdfjs-attachments-button = + .title = Показване на притурките +pdfjs-attachments-button-label = Притурки +pdfjs-layers-button = + .title = Показване на слоевете (двукратно щракване за възстановяване на всички слоеве към състоянието по подразбиране) +pdfjs-layers-button-label = Слоеве +pdfjs-thumbs-button = + .title = Показване на миниатюрите +pdfjs-thumbs-button-label = Миниатюри +pdfjs-current-outline-item-button = + .title = Намиране на текущия елемент от структурата +pdfjs-current-outline-item-button-label = Текущ елемент от структурата +pdfjs-findbar-button = + .title = Намиране в документа +pdfjs-findbar-button-label = Търсене +pdfjs-additional-layers = Допълнителни слоеве + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Страница { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Миниатюра на страница { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Търсене + .placeholder = Търсене в документа… +pdfjs-find-previous-button = + .title = Намиране на предишно съвпадение на фразата +pdfjs-find-previous-button-label = Предишна +pdfjs-find-next-button = + .title = Намиране на следващо съвпадение на фразата +pdfjs-find-next-button-label = Следваща +pdfjs-find-highlight-checkbox = Открояване на всички +pdfjs-find-match-case-checkbox-label = Съвпадение на регистъра +pdfjs-find-match-diacritics-checkbox-label = Без производни букви +pdfjs-find-entire-word-checkbox-label = Цели думи +pdfjs-find-reached-top = Достигнато е началото на документа, продължаване от края +pdfjs-find-reached-bottom = Достигнат е краят на документа, продължаване от началото +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] { $current } от { $total } съвпадение + *[other] { $current } от { $total } съвпадения + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] Повече от { $limit } съвпадение + *[other] Повече от { $limit } съвпадения + } +pdfjs-find-not-found = Фразата не е намерена + +## Predefined zoom values + +pdfjs-page-scale-width = Ширина на страницата +pdfjs-page-scale-fit = Вместване в страницата +pdfjs-page-scale-auto = Автоматично мащабиране +pdfjs-page-scale-actual = Действителен размер +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Страница { $page } + +## Loading indicator messages + +pdfjs-loading-error = Получи се грешка при зареждане на PDF-а. +pdfjs-invalid-file-error = Невалиден или повреден PDF файл. +pdfjs-missing-file-error = Липсващ PDF файл. +pdfjs-unexpected-response-error = Неочакван отговор от сървъра. +pdfjs-rendering-error = Грешка при изчертаване на страницата. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [Анотация { $type }] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Въведете парола за отваряне на този PDF файл. +pdfjs-password-invalid = Невалидна парола. Моля, опитайте отново. +pdfjs-password-ok-button = Добре +pdfjs-password-cancel-button = Отказ +pdfjs-web-fonts-disabled = Уеб-шрифтовете са забранени: разрешаване на използването на вградените PDF шрифтове. + +## Editing + +pdfjs-editor-free-text-button = + .title = Текст +pdfjs-editor-free-text-button-label = Текст +pdfjs-editor-ink-button = + .title = Рисуване +pdfjs-editor-ink-button-label = Рисуване +pdfjs-editor-stamp-button = + .title = Добавяне или променяне на изображения +pdfjs-editor-stamp-button-label = Добавяне или променяне на изображения + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Премахване на рисунката +pdfjs-editor-remove-freetext-button = + .title = Премахване на текста +pdfjs-editor-remove-stamp-button = + .title = Пермахване на изображението +pdfjs-editor-remove-highlight-button = + .title = Премахване на открояването + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Цвят +pdfjs-editor-free-text-size-input = Размер +pdfjs-editor-ink-color-input = Цвят +pdfjs-editor-ink-thickness-input = Дебелина +pdfjs-editor-ink-opacity-input = Прозрачност +pdfjs-editor-stamp-add-image-button = + .title = Добавяне на изображение +pdfjs-editor-stamp-add-image-button-label = Добавяне на изображение +pdfjs-free-text = + .aria-label = Текстов редактор +pdfjs-free-text-default-content = Започнете да пишете… +pdfjs-ink = + .aria-label = Промяна на рисунка +pdfjs-ink-canvas = + .aria-label = Изображение, създадено от потребител + +## Alt-text dialog + +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button-label = Алтернативен текст +pdfjs-editor-alt-text-edit-button-label = Промяна на алтернативния текст +pdfjs-editor-alt-text-dialog-label = Изберете от възможностите +pdfjs-editor-alt-text-dialog-description = Алтернативният текст помага на потребителите, когато не могат да видят изображението или то не се зарежда. +pdfjs-editor-alt-text-add-description-label = Добавяне на описание +pdfjs-editor-alt-text-add-description-description = Стремете се към 1-2 изречения, описващи предмета, настройката или действията. +pdfjs-editor-alt-text-mark-decorative-label = Отбелязване като декоративно +pdfjs-editor-alt-text-mark-decorative-description = Използва се за орнаменти или декоративни изображения, като контури и водни знаци. +pdfjs-editor-alt-text-cancel-button = Отказ +pdfjs-editor-alt-text-save-button = Запазване +pdfjs-editor-alt-text-decorative-tooltip = Отбелязване като декоративно +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = Например, „Млад мъж седи на маса и се храни“ + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Горен ляв ъгъл — преоразмеряване +pdfjs-editor-resizer-label-top-middle = Горе в средата — преоразмеряване +pdfjs-editor-resizer-label-top-right = Горен десен ъгъл — преоразмеряване +pdfjs-editor-resizer-label-middle-right = Дясно в средата — преоразмеряване +pdfjs-editor-resizer-label-bottom-right = Долен десен ъгъл — преоразмеряване +pdfjs-editor-resizer-label-bottom-middle = Долу в средата — преоразмеряване +pdfjs-editor-resizer-label-bottom-left = Долен ляв ъгъл — преоразмеряване +pdfjs-editor-resizer-label-middle-left = Ляво в средата — преоразмеряване +pdfjs-editor-resizer-top-left = + .aria-label = Горен ляв ъгъл — преоразмеряване +pdfjs-editor-resizer-top-middle = + .aria-label = Горе в средата — преоразмеряване +pdfjs-editor-resizer-top-right = + .aria-label = Горен десен ъгъл — преоразмеряване +pdfjs-editor-resizer-middle-right = + .aria-label = Дясно в средата — преоразмеряване +pdfjs-editor-resizer-bottom-right = + .aria-label = Долен десен ъгъл — преоразмеряване +pdfjs-editor-resizer-bottom-middle = + .aria-label = Долу в средата — преоразмеряване +pdfjs-editor-resizer-bottom-left = + .aria-label = Долен ляв ъгъл — преоразмеряване +pdfjs-editor-resizer-middle-left = + .aria-label = Ляво в средата — преоразмеряване + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Цвят на открояване +pdfjs-editor-colorpicker-button = + .title = Промяна на цвят +pdfjs-editor-colorpicker-dropdown = + .aria-label = Избор на цвят +pdfjs-editor-colorpicker-yellow = + .title = Жълто +pdfjs-editor-colorpicker-green = + .title = Зелено +pdfjs-editor-colorpicker-blue = + .title = Синьо +pdfjs-editor-colorpicker-pink = + .title = Розово +pdfjs-editor-colorpicker-red = + .title = Червено + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +pdfjs-editor-new-alt-text-not-now-button = Не сега + +## Image alt-text settings + diff --git a/public/pdfjs/web/locale/bn/viewer.ftl b/public/pdfjs/web/locale/bn/viewer.ftl new file mode 100644 index 0000000..1e20ecb --- /dev/null +++ b/public/pdfjs/web/locale/bn/viewer.ftl @@ -0,0 +1,247 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = পূর্ববর্তী পাতা +pdfjs-previous-button-label = পূর্ববর্তী +pdfjs-next-button = + .title = পরবর্তী পাতা +pdfjs-next-button-label = পরবর্তী +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = পাতা +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = { $pagesCount } এর +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pagesCount } এর { $pageNumber }) +pdfjs-zoom-out-button = + .title = ছোট আকারে প্রদর্শন +pdfjs-zoom-out-button-label = ছোট আকারে প্রদর্শন +pdfjs-zoom-in-button = + .title = বড় আকারে প্রদর্শন +pdfjs-zoom-in-button-label = বড় আকারে প্রদর্শন +pdfjs-zoom-select = + .title = বড় আকারে প্রদর্শন +pdfjs-presentation-mode-button = + .title = উপস্থাপনা মোডে স্যুইচ করুন +pdfjs-presentation-mode-button-label = উপস্থাপনা মোড +pdfjs-open-file-button = + .title = ফাইল খুলুন +pdfjs-open-file-button-label = খুলুন +pdfjs-print-button = + .title = মুদ্রণ +pdfjs-print-button-label = মুদ্রণ + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = টুল +pdfjs-tools-button-label = টুল +pdfjs-first-page-button = + .title = প্রথম পাতায় যাও +pdfjs-first-page-button-label = প্রথম পাতায় যাও +pdfjs-last-page-button = + .title = শেষ পাতায় যাও +pdfjs-last-page-button-label = শেষ পাতায় যাও +pdfjs-page-rotate-cw-button = + .title = ঘড়ির কাঁটার দিকে ঘোরাও +pdfjs-page-rotate-cw-button-label = ঘড়ির কাঁটার দিকে ঘোরাও +pdfjs-page-rotate-ccw-button = + .title = ঘড়ির কাঁটার বিপরীতে ঘোরাও +pdfjs-page-rotate-ccw-button-label = ঘড়ির কাঁটার বিপরীতে ঘোরাও +pdfjs-cursor-text-select-tool-button = + .title = লেখা নির্বাচক টুল সক্রিয় করুন +pdfjs-cursor-text-select-tool-button-label = লেখা নির্বাচক টুল +pdfjs-cursor-hand-tool-button = + .title = হ্যান্ড টুল সক্রিয় করুন +pdfjs-cursor-hand-tool-button-label = হ্যান্ড টুল +pdfjs-scroll-vertical-button = + .title = উলম্ব স্ক্রলিং ব্যবহার করুন +pdfjs-scroll-vertical-button-label = উলম্ব স্ক্রলিং +pdfjs-scroll-horizontal-button = + .title = অনুভূমিক স্ক্রলিং ব্যবহার করুন +pdfjs-scroll-horizontal-button-label = অনুভূমিক স্ক্রলিং +pdfjs-scroll-wrapped-button = + .title = Wrapped স্ক্রোলিং ব্যবহার করুন +pdfjs-scroll-wrapped-button-label = Wrapped স্ক্রোলিং +pdfjs-spread-none-button = + .title = পেজ স্প্রেডগুলোতে যোগদান করবেন না +pdfjs-spread-none-button-label = Spreads নেই +pdfjs-spread-odd-button-label = বিজোড় Spreads +pdfjs-spread-even-button-label = জোড় Spreads + +## Document properties dialog + +pdfjs-document-properties-button = + .title = নথি বৈশিষ্ট্য… +pdfjs-document-properties-button-label = নথি বৈশিষ্ট্য… +pdfjs-document-properties-file-name = ফাইলের নাম: +pdfjs-document-properties-file-size = ফাইলের আকার: +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } কেবি ({ $size_b } বাইট) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } এমবি ({ $size_b } বাইট) +pdfjs-document-properties-title = শিরোনাম: +pdfjs-document-properties-author = লেখক: +pdfjs-document-properties-subject = বিষয়: +pdfjs-document-properties-keywords = কীওয়ার্ড: +pdfjs-document-properties-creation-date = তৈরির তারিখ: +pdfjs-document-properties-modification-date = পরিবর্তনের তারিখ: +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = প্রস্তুতকারক: +pdfjs-document-properties-producer = পিডিএফ প্রস্তুতকারক: +pdfjs-document-properties-version = পিডিএফ সংষ্করণ: +pdfjs-document-properties-page-count = মোট পাতা: +pdfjs-document-properties-page-size = পাতার সাইজ: +pdfjs-document-properties-page-size-unit-inches = এর মধ্যে +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = উলম্ব +pdfjs-document-properties-page-size-orientation-landscape = অনুভূমিক +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = লেটার +pdfjs-document-properties-page-size-name-legal = লীগাল + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Fast Web View: +pdfjs-document-properties-linearized-yes = হ্যাঁ +pdfjs-document-properties-linearized-no = না +pdfjs-document-properties-close-button = বন্ধ + +## Print + +pdfjs-print-progress-message = মুদ্রণের জন্য নথি প্রস্তুত করা হচ্ছে… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = বাতিল +pdfjs-printing-not-supported = সতর্কতা: এই ব্রাউজারে মুদ্রণ সম্পূর্ণভাবে সমর্থিত নয়। +pdfjs-printing-not-ready = সতর্কীকরণ: পিডিএফটি মুদ্রণের জন্য সম্পূর্ণ লোড হয়নি। + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = সাইডবার টগল করুন +pdfjs-toggle-sidebar-button-label = সাইডবার টগল করুন +pdfjs-document-outline-button = + .title = নথির আউটলাইন দেখাও (সব আইটেম প্রসারিত/সঙ্কুচিত করতে ডবল ক্লিক করুন) +pdfjs-document-outline-button-label = নথির রূপরেখা +pdfjs-attachments-button = + .title = সংযুক্তি দেখাও +pdfjs-attachments-button-label = সংযুক্তি +pdfjs-thumbs-button = + .title = থাম্বনেইল সমূহ প্রদর্শন করুন +pdfjs-thumbs-button-label = থাম্বনেইল সমূহ +pdfjs-findbar-button = + .title = নথির মধ্যে খুঁজুন +pdfjs-findbar-button-label = খুঁজুন + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = পাতা { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = { $page } পাতার থাম্বনেইল + +## Find panel button title and messages + +pdfjs-find-input = + .title = খুঁজুন + .placeholder = নথির মধ্যে খুঁজুন… +pdfjs-find-previous-button = + .title = বাক্যাংশের পূর্ববর্তী উপস্থিতি অনুসন্ধান +pdfjs-find-previous-button-label = পূর্ববর্তী +pdfjs-find-next-button = + .title = বাক্যাংশের পরবর্তী উপস্থিতি অনুসন্ধান +pdfjs-find-next-button-label = পরবর্তী +pdfjs-find-highlight-checkbox = সব হাইলাইট করুন +pdfjs-find-match-case-checkbox-label = অক্ষরের ছাঁদ মেলানো +pdfjs-find-entire-word-checkbox-label = সম্পূর্ণ শব্দ +pdfjs-find-reached-top = পাতার শুরুতে পৌছে গেছে, নীচ থেকে আরম্ভ করা হয়েছে +pdfjs-find-reached-bottom = পাতার শেষে পৌছে গেছে, উপর থেকে আরম্ভ করা হয়েছে +pdfjs-find-not-found = বাক্যাংশ পাওয়া যায়নি + +## Predefined zoom values + +pdfjs-page-scale-width = পাতার প্রস্থ +pdfjs-page-scale-fit = পাতা ফিট করুন +pdfjs-page-scale-auto = স্বয়ংক্রিয় জুম +pdfjs-page-scale-actual = প্রকৃত আকার +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + + +## Loading indicator messages + +pdfjs-loading-error = পিডিএফ লোড করার সময় ত্রুটি দেখা দিয়েছে। +pdfjs-invalid-file-error = অকার্যকর অথবা ক্ষতিগ্রস্ত পিডিএফ ফাইল। +pdfjs-missing-file-error = নিখোঁজ PDF ফাইল। +pdfjs-unexpected-response-error = অপ্রত্যাশীত সার্ভার প্রতিক্রিয়া। +pdfjs-rendering-error = পাতা উপস্থাপনার সময় ত্রুটি দেখা দিয়েছে। + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } টীকা] + +## Password + +pdfjs-password-label = পিডিএফ ফাইলটি ওপেন করতে পাসওয়ার্ড দিন। +pdfjs-password-invalid = ভুল পাসওয়ার্ড। অনুগ্রহ করে আবার চেষ্টা করুন। +pdfjs-password-ok-button = ঠিক আছে +pdfjs-password-cancel-button = বাতিল +pdfjs-web-fonts-disabled = ওয়েব ফন্ট নিষ্ক্রিয়: সংযুক্ত পিডিএফ ফন্ট ব্যবহার করা যাচ্ছে না। + +## Editing + + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + diff --git a/public/pdfjs/web/locale/bo/viewer.ftl b/public/pdfjs/web/locale/bo/viewer.ftl new file mode 100644 index 0000000..824eab4 --- /dev/null +++ b/public/pdfjs/web/locale/bo/viewer.ftl @@ -0,0 +1,247 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = དྲ་ངོས་སྔོན་མ +pdfjs-previous-button-label = སྔོན་མ +pdfjs-next-button = + .title = དྲ་ངོས་རྗེས་མ +pdfjs-next-button-label = རྗེས་མ +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = ཤོག་ངོས +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = of { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } of { $pagesCount }) +pdfjs-zoom-out-button = + .title = Zoom Out +pdfjs-zoom-out-button-label = Zoom Out +pdfjs-zoom-in-button = + .title = Zoom In +pdfjs-zoom-in-button-label = Zoom In +pdfjs-zoom-select = + .title = Zoom +pdfjs-presentation-mode-button = + .title = Switch to Presentation Mode +pdfjs-presentation-mode-button-label = Presentation Mode +pdfjs-open-file-button = + .title = Open File +pdfjs-open-file-button-label = Open +pdfjs-print-button = + .title = Print +pdfjs-print-button-label = Print + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Tools +pdfjs-tools-button-label = Tools +pdfjs-first-page-button = + .title = Go to First Page +pdfjs-first-page-button-label = Go to First Page +pdfjs-last-page-button = + .title = Go to Last Page +pdfjs-last-page-button-label = Go to Last Page +pdfjs-page-rotate-cw-button = + .title = Rotate Clockwise +pdfjs-page-rotate-cw-button-label = Rotate Clockwise +pdfjs-page-rotate-ccw-button = + .title = Rotate Counterclockwise +pdfjs-page-rotate-ccw-button-label = Rotate Counterclockwise +pdfjs-cursor-text-select-tool-button = + .title = Enable Text Selection Tool +pdfjs-cursor-text-select-tool-button-label = Text Selection Tool +pdfjs-cursor-hand-tool-button = + .title = Enable Hand Tool +pdfjs-cursor-hand-tool-button-label = Hand Tool +pdfjs-scroll-vertical-button = + .title = Use Vertical Scrolling +pdfjs-scroll-vertical-button-label = Vertical Scrolling +pdfjs-scroll-horizontal-button = + .title = Use Horizontal Scrolling +pdfjs-scroll-horizontal-button-label = Horizontal Scrolling +pdfjs-scroll-wrapped-button = + .title = Use Wrapped Scrolling +pdfjs-scroll-wrapped-button-label = Wrapped Scrolling +pdfjs-spread-none-button = + .title = Do not join page spreads +pdfjs-spread-none-button-label = No Spreads +pdfjs-spread-odd-button = + .title = Join page spreads starting with odd-numbered pages +pdfjs-spread-odd-button-label = Odd Spreads +pdfjs-spread-even-button = + .title = Join page spreads starting with even-numbered pages +pdfjs-spread-even-button-label = Even Spreads + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Document Properties… +pdfjs-document-properties-button-label = Document Properties… +pdfjs-document-properties-file-name = File name: +pdfjs-document-properties-file-size = File size: +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bytes) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bytes) +pdfjs-document-properties-title = Title: +pdfjs-document-properties-author = Author: +pdfjs-document-properties-subject = Subject: +pdfjs-document-properties-keywords = Keywords: +pdfjs-document-properties-creation-date = Creation Date: +pdfjs-document-properties-modification-date = Modification Date: +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Creator: +pdfjs-document-properties-producer = PDF Producer: +pdfjs-document-properties-version = PDF Version: +pdfjs-document-properties-page-count = Page Count: +pdfjs-document-properties-page-size = Page Size: +pdfjs-document-properties-page-size-unit-inches = in +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = portrait +pdfjs-document-properties-page-size-orientation-landscape = landscape +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Letter +pdfjs-document-properties-page-size-name-legal = Legal + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Fast Web View: +pdfjs-document-properties-linearized-yes = Yes +pdfjs-document-properties-linearized-no = No +pdfjs-document-properties-close-button = Close + +## Print + +pdfjs-print-progress-message = Preparing document for printing… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Cancel +pdfjs-printing-not-supported = Warning: Printing is not fully supported by this browser. +pdfjs-printing-not-ready = Warning: The PDF is not fully loaded for printing. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Toggle Sidebar +pdfjs-toggle-sidebar-button-label = Toggle Sidebar +pdfjs-document-outline-button = + .title = Show Document Outline (double-click to expand/collapse all items) +pdfjs-document-outline-button-label = Document Outline +pdfjs-attachments-button = + .title = Show Attachments +pdfjs-attachments-button-label = Attachments +pdfjs-thumbs-button = + .title = Show Thumbnails +pdfjs-thumbs-button-label = Thumbnails +pdfjs-findbar-button = + .title = Find in Document +pdfjs-findbar-button-label = Find + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Page { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Thumbnail of Page { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Find + .placeholder = Find in document… +pdfjs-find-previous-button = + .title = Find the previous occurrence of the phrase +pdfjs-find-previous-button-label = Previous +pdfjs-find-next-button = + .title = Find the next occurrence of the phrase +pdfjs-find-next-button-label = Next +pdfjs-find-highlight-checkbox = Highlight all +pdfjs-find-match-case-checkbox-label = Match case +pdfjs-find-entire-word-checkbox-label = Whole words +pdfjs-find-reached-top = Reached top of document, continued from bottom +pdfjs-find-reached-bottom = Reached end of document, continued from top +pdfjs-find-not-found = Phrase not found + +## Predefined zoom values + +pdfjs-page-scale-width = Page Width +pdfjs-page-scale-fit = Page Fit +pdfjs-page-scale-auto = Automatic Zoom +pdfjs-page-scale-actual = Actual Size +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + + +## Loading indicator messages + +pdfjs-loading-error = An error occurred while loading the PDF. +pdfjs-invalid-file-error = Invalid or corrupted PDF file. +pdfjs-missing-file-error = Missing PDF file. +pdfjs-unexpected-response-error = Unexpected server response. +pdfjs-rendering-error = An error occurred while rendering the page. + +## Annotations + +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } Annotation] + +## Password + +pdfjs-password-label = Enter the password to open this PDF file. +pdfjs-password-invalid = Invalid password. Please try again. +pdfjs-password-ok-button = OK +pdfjs-password-cancel-button = Cancel +pdfjs-web-fonts-disabled = Web fonts are disabled: unable to use embedded PDF fonts. + +## Editing + + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + diff --git a/public/pdfjs/web/locale/br/viewer.ftl b/public/pdfjs/web/locale/br/viewer.ftl new file mode 100644 index 0000000..60a3df0 --- /dev/null +++ b/public/pdfjs/web/locale/br/viewer.ftl @@ -0,0 +1,340 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Pajenn a-raok +pdfjs-previous-button-label = A-raok +pdfjs-next-button = + .title = Pajenn war-lerc'h +pdfjs-next-button-label = War-lerc'h +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Pajenn +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = eus { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } war { $pagesCount }) +pdfjs-zoom-out-button = + .title = Zoum bihanaat +pdfjs-zoom-out-button-label = Zoum bihanaat +pdfjs-zoom-in-button = + .title = Zoum brasaat +pdfjs-zoom-in-button-label = Zoum brasaat +pdfjs-zoom-select = + .title = Zoum +pdfjs-presentation-mode-button = + .title = Trec'haoliñ etrezek ar mod kinnigadenn +pdfjs-presentation-mode-button-label = Mod kinnigadenn +pdfjs-open-file-button = + .title = Digeriñ ur restr +pdfjs-open-file-button-label = Digeriñ ur restr +pdfjs-print-button = + .title = Moullañ +pdfjs-print-button-label = Moullañ +pdfjs-save-button = + .title = Enrollañ +pdfjs-save-button-label = Enrollañ +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Pellgargañ +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Pellgargañ +pdfjs-bookmark-button-label = Pajenn a-vremañ + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Ostilhoù +pdfjs-tools-button-label = Ostilhoù +pdfjs-first-page-button = + .title = Mont d'ar bajenn gentañ +pdfjs-first-page-button-label = Mont d'ar bajenn gentañ +pdfjs-last-page-button = + .title = Mont d'ar bajenn diwezhañ +pdfjs-last-page-button-label = Mont d'ar bajenn diwezhañ +pdfjs-page-rotate-cw-button = + .title = C'hwelañ gant roud ar bizied +pdfjs-page-rotate-cw-button-label = C'hwelañ gant roud ar bizied +pdfjs-page-rotate-ccw-button = + .title = C'hwelañ gant roud gin ar bizied +pdfjs-page-rotate-ccw-button-label = C'hwelañ gant roud gin ar bizied +pdfjs-cursor-text-select-tool-button = + .title = Gweredekaat an ostilh diuzañ testenn +pdfjs-cursor-text-select-tool-button-label = Ostilh diuzañ testenn +pdfjs-cursor-hand-tool-button = + .title = Gweredekaat an ostilh dorn +pdfjs-cursor-hand-tool-button-label = Ostilh dorn +pdfjs-scroll-vertical-button = + .title = Arverañ an dibunañ a-blom +pdfjs-scroll-vertical-button-label = Dibunañ a-serzh +pdfjs-scroll-horizontal-button = + .title = Arverañ an dibunañ a-blaen +pdfjs-scroll-horizontal-button-label = Dibunañ a-blaen +pdfjs-scroll-wrapped-button = + .title = Arverañ an dibunañ paket +pdfjs-scroll-wrapped-button-label = Dibunañ paket +pdfjs-spread-none-button = + .title = Chom hep stagañ ar skignadurioù +pdfjs-spread-none-button-label = Skignadenn ebet +pdfjs-spread-odd-button = + .title = Lakaat ar pajennadoù en ur gregiñ gant ar pajennoù ampar +pdfjs-spread-odd-button-label = Pajennoù ampar +pdfjs-spread-even-button = + .title = Lakaat ar pajennadoù en ur gregiñ gant ar pajennoù par +pdfjs-spread-even-button-label = Pajennoù par + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Perzhioù an teul… +pdfjs-document-properties-button-label = Perzhioù an teul… +pdfjs-document-properties-file-name = Anv restr: +pdfjs-document-properties-file-size = Ment ar restr: +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } Ke ({ $size_b } eizhbit) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } Me ({ $size_b } eizhbit) +pdfjs-document-properties-title = Titl: +pdfjs-document-properties-author = Aozer: +pdfjs-document-properties-subject = Danvez: +pdfjs-document-properties-keywords = Gerioù-alc'hwez: +pdfjs-document-properties-creation-date = Deiziad krouiñ: +pdfjs-document-properties-modification-date = Deiziad kemmañ: +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Krouer: +pdfjs-document-properties-producer = Kenderc'her PDF: +pdfjs-document-properties-version = Handelv PDF: +pdfjs-document-properties-page-count = Niver a bajennoù: +pdfjs-document-properties-page-size = Ment ar bajenn: +pdfjs-document-properties-page-size-unit-inches = in +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = poltred +pdfjs-document-properties-page-size-orientation-landscape = gweledva +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Lizher +pdfjs-document-properties-page-size-name-legal = Lezennel + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Gwel Web Herrek: +pdfjs-document-properties-linearized-yes = Ya +pdfjs-document-properties-linearized-no = Ket +pdfjs-document-properties-close-button = Serriñ + +## Print + +pdfjs-print-progress-message = O prientiñ an teul evit moullañ... +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Nullañ +pdfjs-printing-not-supported = Kemenn: N'eo ket skoret penn-da-benn ar moullañ gant ar merdeer-mañ. +pdfjs-printing-not-ready = Kemenn: N'hall ket bezañ moullet ar restr PDF rak n'eo ket karget penn-da-benn. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Diskouez/kuzhat ar varrenn gostez +pdfjs-toggle-sidebar-notification-button = + .title = Trec'haoliñ ar varrenn-gostez (ur steuñv pe stagadennoù a zo en teul) +pdfjs-toggle-sidebar-button-label = Diskouez/kuzhat ar varrenn gostez +pdfjs-document-outline-button = + .title = Diskouez steuñv an teul (daouglikit evit brasaat/bihanaat an holl elfennoù) +pdfjs-document-outline-button-label = Sinedoù an teuliad +pdfjs-attachments-button = + .title = Diskouez ar c'henstagadurioù +pdfjs-attachments-button-label = Kenstagadurioù +pdfjs-layers-button = + .title = Diskouez ar gwiskadoù (daou-glikañ evit adderaouekaat an holl gwiskadoù d'o stad dre ziouer) +pdfjs-layers-button-label = Gwiskadoù +pdfjs-thumbs-button = + .title = Diskouez ar melvennoù +pdfjs-thumbs-button-label = Melvennoù +pdfjs-findbar-button = + .title = Klask e-barzh an teuliad +pdfjs-findbar-button-label = Klask +pdfjs-additional-layers = Gwiskadoù ouzhpenn + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Pajenn { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Melvenn ar bajenn { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Klask + .placeholder = Klask e-barzh an teuliad +pdfjs-find-previous-button = + .title = Kavout an tamm frazenn kent o klotañ ganti +pdfjs-find-previous-button-label = Kent +pdfjs-find-next-button = + .title = Kavout an tamm frazenn war-lerc'h o klotañ ganti +pdfjs-find-next-button-label = War-lerc'h +pdfjs-find-highlight-checkbox = Usskediñ pep tra +pdfjs-find-match-case-checkbox-label = Teurel evezh ouzh ar pennlizherennoù +pdfjs-find-match-diacritics-checkbox-label = Doujañ d’an tiredoù +pdfjs-find-entire-word-checkbox-label = Gerioù a-bezh +pdfjs-find-reached-top = Tizhet eo bet derou ar bajenn, kenderc'hel diouzh an diaz +pdfjs-find-reached-bottom = Tizhet eo bet dibenn ar bajenn, kenderc'hel diouzh ar c'hrec'h +pdfjs-find-not-found = N'haller ket kavout ar frazenn + +## Predefined zoom values + +pdfjs-page-scale-width = Led ar bajenn +pdfjs-page-scale-fit = Pajenn a-bezh +pdfjs-page-scale-auto = Zoum emgefreek +pdfjs-page-scale-actual = Ment wir +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Pajenn { $page } + +## Loading indicator messages + +pdfjs-loading-error = Degouezhet ez eus bet ur fazi e-pad kargañ ar PDF. +pdfjs-invalid-file-error = Restr PDF didalvoudek pe kontronet. +pdfjs-missing-file-error = Restr PDF o vankout. +pdfjs-unexpected-response-error = Respont dic'hortoz a-berzh an dafariad +pdfjs-rendering-error = Degouezhet ez eus bet ur fazi e-pad skrammañ ar bajennad. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } Notennañ] + +## Password + +pdfjs-password-label = Enankit ar ger-tremen evit digeriñ ar restr PDF-mañ. +pdfjs-password-invalid = Ger-tremen didalvoudek. Klaskit en-dro mar plij. +pdfjs-password-ok-button = Mat eo +pdfjs-password-cancel-button = Nullañ +pdfjs-web-fonts-disabled = Diweredekaet eo an nodrezhoù web: n'haller ket arverañ an nodrezhoù PDF enframmet. + +## Editing + +pdfjs-editor-free-text-button = + .title = Testenn +pdfjs-editor-free-text-button-label = Testenn +pdfjs-editor-ink-button = + .title = Tresañ +pdfjs-editor-ink-button-label = Tresañ +pdfjs-editor-stamp-button = + .title = Ouzhpennañ pe aozañ skeudennoù +pdfjs-editor-stamp-button-label = Ouzhpennañ pe aozañ skeudennoù + +## Remove button for the various kind of editor. + + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Liv +pdfjs-editor-free-text-size-input = Ment +pdfjs-editor-ink-color-input = Liv +pdfjs-editor-ink-thickness-input = Tevder +pdfjs-editor-ink-opacity-input = Boullder +pdfjs-editor-stamp-add-image-button = + .title = Ouzhpennañ ur skeudenn +pdfjs-editor-stamp-add-image-button-label = Ouzhpennañ ur skeudenn +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Tevded +pdfjs-free-text = + .aria-label = Aozer testennoù +pdfjs-ink = + .aria-label = Aozer tresoù +pdfjs-ink-canvas = + .aria-label = Skeudenn bet krouet gant an implijer·ez + +## Alt-text dialog + +pdfjs-editor-alt-text-add-description-label = Ouzhpennañ un deskrivadur +pdfjs-editor-alt-text-cancel-button = Nullañ +pdfjs-editor-alt-text-save-button = Enrollañ + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + + +## Color picker + +pdfjs-editor-colorpicker-button = + .title = Cheñch liv +pdfjs-editor-colorpicker-yellow = + .title = Melen +pdfjs-editor-colorpicker-blue = + .title = Glas +pdfjs-editor-colorpicker-pink = + .title = Roz +pdfjs-editor-colorpicker-red = + .title = Ruz + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Diskouez pep tra +pdfjs-editor-highlight-show-all-button = + .title = Diskouez pep tra + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Gouzout hiroc’h +pdfjs-editor-new-alt-text-error-close-button = Serriñ + +## Image alt-text settings + +pdfjs-editor-alt-text-settings-delete-model-button = Dilemel +pdfjs-editor-alt-text-settings-download-model-button = Pellgargañ +pdfjs-editor-alt-text-settings-downloading-model-button = O pellgargañ… +pdfjs-editor-alt-text-settings-close-button = Serriñ diff --git a/public/pdfjs/web/locale/brx/viewer.ftl b/public/pdfjs/web/locale/brx/viewer.ftl new file mode 100644 index 0000000..53ff72c --- /dev/null +++ b/public/pdfjs/web/locale/brx/viewer.ftl @@ -0,0 +1,218 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = आगोलनि बिलाइ +pdfjs-previous-button-label = आगोलनि +pdfjs-next-button = + .title = उननि बिलाइ +pdfjs-next-button-label = उननि +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = बिलाइ +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = { $pagesCount } नि +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pagesCount } नि { $pageNumber }) +pdfjs-zoom-out-button = + .title = फिसायै जुम खालाम +pdfjs-zoom-out-button-label = फिसायै जुम खालाम +pdfjs-zoom-in-button = + .title = गेदेरै जुम खालाम +pdfjs-zoom-in-button-label = गेदेरै जुम खालाम +pdfjs-zoom-select = + .title = जुम खालाम +pdfjs-presentation-mode-button = + .title = दिन्थिफुंनाय म'डआव थां +pdfjs-presentation-mode-button-label = दिन्थिफुंनाय म'ड +pdfjs-open-file-button = + .title = फाइलखौ खेव +pdfjs-open-file-button-label = खेव +pdfjs-print-button = + .title = साफाय +pdfjs-print-button-label = साफाय + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = टुल +pdfjs-tools-button-label = टुल +pdfjs-first-page-button = + .title = गिबि बिलाइआव थां +pdfjs-first-page-button-label = गिबि बिलाइआव थां +pdfjs-last-page-button = + .title = जोबथा बिलाइआव थां +pdfjs-last-page-button-label = जोबथा बिलाइआव थां +pdfjs-page-rotate-cw-button = + .title = घरि गिदिंनाय फार्से फिदिं +pdfjs-page-rotate-cw-button-label = घरि गिदिंनाय फार्से फिदिं +pdfjs-page-rotate-ccw-button = + .title = घरि गिदिंनाय उल्था फार्से फिदिं +pdfjs-page-rotate-ccw-button-label = घरि गिदिंनाय उल्था फार्से फिदिं + +## Document properties dialog + +pdfjs-document-properties-button = + .title = फोरमान बिलाइनि आखुथाय... +pdfjs-document-properties-button-label = फोरमान बिलाइनि आखुथाय... +pdfjs-document-properties-file-name = फाइलनि मुं: +pdfjs-document-properties-file-size = फाइलनि महर: +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } बाइट) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } बाइट) +pdfjs-document-properties-title = बिमुं: +pdfjs-document-properties-author = लिरगिरि: +pdfjs-document-properties-subject = आयदा: +pdfjs-document-properties-keywords = गाहाय सोदोब: +pdfjs-document-properties-creation-date = सोरजिनाय अक्ट': +pdfjs-document-properties-modification-date = सुद्रायनाय अक्ट': +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = सोरजिग्रा: +pdfjs-document-properties-producer = PDF दिहुनग्रा: +pdfjs-document-properties-version = PDF बिसान: +pdfjs-document-properties-page-count = बिलाइनि हिसाब: +pdfjs-document-properties-page-size-unit-inches = in +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = प'र्ट्रेट +pdfjs-document-properties-page-size-orientation-landscape = लेण्डस्केप +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = लायजाम + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +pdfjs-document-properties-linearized-yes = नंगौ +pdfjs-document-properties-linearized-no = नङा +pdfjs-document-properties-close-button = बन्द खालाम + +## Print + +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = नेवसि +pdfjs-printing-not-supported = सांग्रांथि: साफायनाया बे ब्राउजारजों आबुङै हेफाजाब होजाया। +pdfjs-printing-not-ready = सांग्रांथि: PDF खौ साफायनायनि थाखाय फुरायै ल'ड खालामाखै। + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = टग्गल साइडबार +pdfjs-toggle-sidebar-button-label = टग्गल साइडबार +pdfjs-document-outline-button-label = फोरमान बिलाइ सिमा हांखो +pdfjs-attachments-button = + .title = नांजाब होनायखौ दिन्थि +pdfjs-attachments-button-label = नांजाब होनाय +pdfjs-thumbs-button = + .title = थामनेइलखौ दिन्थि +pdfjs-thumbs-button-label = थामनेइल +pdfjs-findbar-button = + .title = फोरमान बिलाइआव नागिरना दिहुन +pdfjs-findbar-button-label = नायगिरना दिहुन + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = बिलाइ { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = बिलाइ { $page } नि थामनेइल + +## Find panel button title and messages + +pdfjs-find-input = + .title = नायगिरना दिहुन + .placeholder = फोरमान बिलाइआव नागिरना दिहुन... +pdfjs-find-previous-button = + .title = बाथ्रा खोन्दोबनि सिगांनि नुजाथिनायखौ नागिर +pdfjs-find-previous-button-label = आगोलनि +pdfjs-find-next-button = + .title = बाथ्रा खोन्दोबनि उननि नुजाथिनायखौ नागिर +pdfjs-find-next-button-label = उननि +pdfjs-find-highlight-checkbox = गासैखौबो हाइलाइट खालाम +pdfjs-find-match-case-checkbox-label = गोरोबनाय केस +pdfjs-find-reached-top = थालो निफ्राय जागायनानै फोरमान बिलाइनि बिजौआव सौहैबाय +pdfjs-find-reached-bottom = बिजौ निफ्राय जागायनानै फोरमान बिलाइनि बिजौआव सौहैबाय +pdfjs-find-not-found = बाथ्रा खोन्दोब मोनाखै + +## Predefined zoom values + +pdfjs-page-scale-width = बिलाइनि गुवार +pdfjs-page-scale-fit = बिलाइ गोरोबनाय +pdfjs-page-scale-auto = गावनोगाव जुम +pdfjs-page-scale-actual = थार महर +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + + +## Loading indicator messages + +pdfjs-loading-error = PDF ल'ड खालामनाय समाव मोनसे गोरोन्थि जाबाय। +pdfjs-invalid-file-error = बाहायजायै एबा गाज्रि जानाय PDF फाइल +pdfjs-missing-file-error = गोमानाय PDF फाइल +pdfjs-unexpected-response-error = मिजिंथियै सार्भार फिननाय। +pdfjs-rendering-error = बिलाइखौ राव सोलायनाय समाव मोनसे गोरोन्थि जादों। + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } सोदोब बेखेवनाय] + +## Password + +pdfjs-password-label = बे PDF फाइलखौ खेवनो पासवार्ड हाबहो। +pdfjs-password-invalid = बाहायजायै पासवार्ड। अननानै फिन नाजा। +pdfjs-password-ok-button = OK +pdfjs-password-cancel-button = नेवसि +pdfjs-web-fonts-disabled = वेब फन्टखौ लोरबां खालामबाय: अरजाबहोनाय PDF फन्टखौ बाहायनो हायाखै। + +## Editing + + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + diff --git a/public/pdfjs/web/locale/bs/viewer.ftl b/public/pdfjs/web/locale/bs/viewer.ftl new file mode 100644 index 0000000..3944042 --- /dev/null +++ b/public/pdfjs/web/locale/bs/viewer.ftl @@ -0,0 +1,223 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Prethodna strana +pdfjs-previous-button-label = Prethodna +pdfjs-next-button = + .title = Sljedeća strna +pdfjs-next-button-label = Sljedeća +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Strana +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = od { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } od { $pagesCount }) +pdfjs-zoom-out-button = + .title = Umanji +pdfjs-zoom-out-button-label = Umanji +pdfjs-zoom-in-button = + .title = Uvećaj +pdfjs-zoom-in-button-label = Uvećaj +pdfjs-zoom-select = + .title = Uvećanje +pdfjs-presentation-mode-button = + .title = Prebaci se u prezentacijski režim +pdfjs-presentation-mode-button-label = Prezentacijski režim +pdfjs-open-file-button = + .title = Otvori fajl +pdfjs-open-file-button-label = Otvori +pdfjs-print-button = + .title = Štampaj +pdfjs-print-button-label = Štampaj + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Alati +pdfjs-tools-button-label = Alati +pdfjs-first-page-button = + .title = Idi na prvu stranu +pdfjs-first-page-button-label = Idi na prvu stranu +pdfjs-last-page-button = + .title = Idi na zadnju stranu +pdfjs-last-page-button-label = Idi na zadnju stranu +pdfjs-page-rotate-cw-button = + .title = Rotiraj u smjeru kazaljke na satu +pdfjs-page-rotate-cw-button-label = Rotiraj u smjeru kazaljke na satu +pdfjs-page-rotate-ccw-button = + .title = Rotiraj suprotno smjeru kazaljke na satu +pdfjs-page-rotate-ccw-button-label = Rotiraj suprotno smjeru kazaljke na satu +pdfjs-cursor-text-select-tool-button = + .title = Omogući alat za označavanje teksta +pdfjs-cursor-text-select-tool-button-label = Alat za označavanje teksta +pdfjs-cursor-hand-tool-button = + .title = Omogući ručni alat +pdfjs-cursor-hand-tool-button-label = Ručni alat + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Svojstva dokumenta... +pdfjs-document-properties-button-label = Svojstva dokumenta... +pdfjs-document-properties-file-name = Naziv fajla: +pdfjs-document-properties-file-size = Veličina fajla: +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bajta) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bajta) +pdfjs-document-properties-title = Naslov: +pdfjs-document-properties-author = Autor: +pdfjs-document-properties-subject = Predmet: +pdfjs-document-properties-keywords = Ključne riječi: +pdfjs-document-properties-creation-date = Datum kreiranja: +pdfjs-document-properties-modification-date = Datum promjene: +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Kreator: +pdfjs-document-properties-producer = PDF stvaratelj: +pdfjs-document-properties-version = PDF verzija: +pdfjs-document-properties-page-count = Broj stranica: +pdfjs-document-properties-page-size = Veličina stranice: +pdfjs-document-properties-page-size-unit-inches = u +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = uspravno +pdfjs-document-properties-page-size-orientation-landscape = vodoravno +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Pismo +pdfjs-document-properties-page-size-name-legal = Pravni + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +pdfjs-document-properties-close-button = Zatvori + +## Print + +pdfjs-print-progress-message = Pripremam dokument za štampu… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Otkaži +pdfjs-printing-not-supported = Upozorenje: Štampanje nije u potpunosti podržano u ovom browseru. +pdfjs-printing-not-ready = Upozorenje: PDF nije u potpunosti učitan za štampanje. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Uključi/isključi bočnu traku +pdfjs-toggle-sidebar-button-label = Uključi/isključi bočnu traku +pdfjs-document-outline-button = + .title = Prikaži outline dokumenta (dvoklik za skupljanje/širenje svih stavki) +pdfjs-document-outline-button-label = Konture dokumenta +pdfjs-attachments-button = + .title = Prikaži priloge +pdfjs-attachments-button-label = Prilozi +pdfjs-thumbs-button = + .title = Prikaži thumbnailove +pdfjs-thumbs-button-label = Thumbnailovi +pdfjs-findbar-button = + .title = Pronađi u dokumentu +pdfjs-findbar-button-label = Pronađi + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Strana { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Thumbnail strane { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Pronađi + .placeholder = Pronađi u dokumentu… +pdfjs-find-previous-button = + .title = Pronađi prethodno pojavljivanje fraze +pdfjs-find-previous-button-label = Prethodno +pdfjs-find-next-button = + .title = Pronađi sljedeće pojavljivanje fraze +pdfjs-find-next-button-label = Sljedeće +pdfjs-find-highlight-checkbox = Označi sve +pdfjs-find-match-case-checkbox-label = Osjetljivost na karaktere +pdfjs-find-reached-top = Dostigao sam vrh dokumenta, nastavljam sa dna +pdfjs-find-reached-bottom = Dostigao sam kraj dokumenta, nastavljam sa vrha +pdfjs-find-not-found = Fraza nije pronađena + +## Predefined zoom values + +pdfjs-page-scale-width = Širina strane +pdfjs-page-scale-fit = Uklopi stranu +pdfjs-page-scale-auto = Automatsko uvećanje +pdfjs-page-scale-actual = Stvarna veličina +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + + +## Loading indicator messages + +pdfjs-loading-error = Došlo je do greške prilikom učitavanja PDF-a. +pdfjs-invalid-file-error = Neispravan ili oštećen PDF fajl. +pdfjs-missing-file-error = Nedostaje PDF fajl. +pdfjs-unexpected-response-error = Neočekivani odgovor servera. +pdfjs-rendering-error = Došlo je do greške prilikom renderiranja strane. + +## Annotations + +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } pribilješka] + +## Password + +pdfjs-password-label = Upišite lozinku da biste otvorili ovaj PDF fajl. +pdfjs-password-invalid = Pogrešna lozinka. Pokušajte ponovo. +pdfjs-password-ok-button = OK +pdfjs-password-cancel-button = Otkaži +pdfjs-web-fonts-disabled = Web fontovi su onemogućeni: nemoguće koristiti ubačene PDF fontove. + +## Editing + + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + diff --git a/public/pdfjs/web/locale/ca/viewer.ftl b/public/pdfjs/web/locale/ca/viewer.ftl new file mode 100644 index 0000000..7417741 --- /dev/null +++ b/public/pdfjs/web/locale/ca/viewer.ftl @@ -0,0 +1,313 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Pàgina anterior +pdfjs-previous-button-label = Anterior +pdfjs-next-button = + .title = Pàgina següent +pdfjs-next-button-label = Següent +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Pàgina +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = de { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } de { $pagesCount }) +pdfjs-zoom-out-button = + .title = Redueix +pdfjs-zoom-out-button-label = Redueix +pdfjs-zoom-in-button = + .title = Amplia +pdfjs-zoom-in-button-label = Amplia +pdfjs-zoom-select = + .title = Escala +pdfjs-presentation-mode-button = + .title = Canvia al mode de presentació +pdfjs-presentation-mode-button-label = Mode de presentació +pdfjs-open-file-button = + .title = Obre el fitxer +pdfjs-open-file-button-label = Obre +pdfjs-print-button = + .title = Imprimeix +pdfjs-print-button-label = Imprimeix +pdfjs-save-button = + .title = Desa +pdfjs-save-button-label = Desa +pdfjs-bookmark-button = + .title = Pàgina actual (mostra l'URL de la pàgina actual) +pdfjs-bookmark-button-label = Pàgina actual + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Eines +pdfjs-tools-button-label = Eines +pdfjs-first-page-button = + .title = Vés a la primera pàgina +pdfjs-first-page-button-label = Vés a la primera pàgina +pdfjs-last-page-button = + .title = Vés a l'última pàgina +pdfjs-last-page-button-label = Vés a l'última pàgina +pdfjs-page-rotate-cw-button = + .title = Gira cap a la dreta +pdfjs-page-rotate-cw-button-label = Gira cap a la dreta +pdfjs-page-rotate-ccw-button = + .title = Gira cap a l'esquerra +pdfjs-page-rotate-ccw-button-label = Gira cap a l'esquerra +pdfjs-cursor-text-select-tool-button = + .title = Habilita l'eina de selecció de text +pdfjs-cursor-text-select-tool-button-label = Eina de selecció de text +pdfjs-cursor-hand-tool-button = + .title = Habilita l'eina de mà +pdfjs-cursor-hand-tool-button-label = Eina de mà +pdfjs-scroll-page-button = + .title = Usa el desplaçament de pàgina +pdfjs-scroll-page-button-label = Desplaçament de pàgina +pdfjs-scroll-vertical-button = + .title = Utilitza el desplaçament vertical +pdfjs-scroll-vertical-button-label = Desplaçament vertical +pdfjs-scroll-horizontal-button = + .title = Utilitza el desplaçament horitzontal +pdfjs-scroll-horizontal-button-label = Desplaçament horitzontal +pdfjs-scroll-wrapped-button = + .title = Activa el desplaçament continu +pdfjs-scroll-wrapped-button-label = Desplaçament continu +pdfjs-spread-none-button = + .title = No agrupis les pàgines de dues en dues +pdfjs-spread-none-button-label = Una sola pàgina +pdfjs-spread-odd-button = + .title = Mostra dues pàgines començant per les pàgines de numeració senar +pdfjs-spread-odd-button-label = Doble pàgina (senar) +pdfjs-spread-even-button = + .title = Mostra dues pàgines començant per les pàgines de numeració parell +pdfjs-spread-even-button-label = Doble pàgina (parell) + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Propietats del document… +pdfjs-document-properties-button-label = Propietats del document… +pdfjs-document-properties-file-name = Nom del fitxer: +pdfjs-document-properties-file-size = Mida del fitxer: +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bytes) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bytes) +pdfjs-document-properties-title = Títol: +pdfjs-document-properties-author = Autor: +pdfjs-document-properties-subject = Assumpte: +pdfjs-document-properties-keywords = Paraules clau: +pdfjs-document-properties-creation-date = Data de creació: +pdfjs-document-properties-modification-date = Data de modificació: +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Creador: +pdfjs-document-properties-producer = Generador de PDF: +pdfjs-document-properties-version = Versió de PDF: +pdfjs-document-properties-page-count = Nombre de pàgines: +pdfjs-document-properties-page-size = Mida de la pàgina: +pdfjs-document-properties-page-size-unit-inches = polzades +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = vertical +pdfjs-document-properties-page-size-orientation-landscape = apaïsat +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Carta +pdfjs-document-properties-page-size-name-legal = Legal + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Vista web ràpida: +pdfjs-document-properties-linearized-yes = Sí +pdfjs-document-properties-linearized-no = No +pdfjs-document-properties-close-button = Tanca + +## Print + +pdfjs-print-progress-message = S'està preparant la impressió del document… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Cancel·la +pdfjs-printing-not-supported = Avís: la impressió no és plenament funcional en aquest navegador. +pdfjs-printing-not-ready = Atenció: el PDF no s'ha acabat de carregar per imprimir-lo. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Mostra/amaga la barra lateral +pdfjs-toggle-sidebar-notification-button = + .title = Mostra/amaga la barra lateral (el document conté un esquema, adjuncions o capes) +pdfjs-toggle-sidebar-button-label = Mostra/amaga la barra lateral +pdfjs-document-outline-button = + .title = Mostra l'esquema del document (doble clic per ampliar/reduir tots els elements) +pdfjs-document-outline-button-label = Esquema del document +pdfjs-attachments-button = + .title = Mostra les adjuncions +pdfjs-attachments-button-label = Adjuncions +pdfjs-layers-button = + .title = Mostra les capes (doble clic per restablir totes les capes al seu estat per defecte) +pdfjs-layers-button-label = Capes +pdfjs-thumbs-button = + .title = Mostra les miniatures +pdfjs-thumbs-button-label = Miniatures +pdfjs-current-outline-item-button = + .title = Cerca l'element d'esquema actual +pdfjs-current-outline-item-button-label = Element d'esquema actual +pdfjs-findbar-button = + .title = Cerca al document +pdfjs-findbar-button-label = Cerca +pdfjs-additional-layers = Capes addicionals + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Pàgina { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Miniatura de la pàgina { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Cerca + .placeholder = Cerca al document… +pdfjs-find-previous-button = + .title = Cerca l'anterior coincidència de l'expressió +pdfjs-find-previous-button-label = Anterior +pdfjs-find-next-button = + .title = Cerca la següent coincidència de l'expressió +pdfjs-find-next-button-label = Següent +pdfjs-find-highlight-checkbox = Ressalta-ho tot +pdfjs-find-match-case-checkbox-label = Distingeix entre majúscules i minúscules +pdfjs-find-match-diacritics-checkbox-label = Respecta els diacrítics +pdfjs-find-entire-word-checkbox-label = Paraules senceres +pdfjs-find-reached-top = S'ha arribat al principi del document, es continua pel final +pdfjs-find-reached-bottom = S'ha arribat al final del document, es continua pel principi +pdfjs-find-not-found = No s'ha trobat l'expressió + +## Predefined zoom values + +pdfjs-page-scale-width = Amplada de la pàgina +pdfjs-page-scale-fit = Ajusta la pàgina +pdfjs-page-scale-auto = Zoom automàtic +pdfjs-page-scale-actual = Mida real +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Pàgina { $page } + +## Loading indicator messages + +pdfjs-loading-error = S'ha produït un error en carregar el PDF. +pdfjs-invalid-file-error = El fitxer PDF no és vàlid o està malmès. +pdfjs-missing-file-error = Falta el fitxer PDF. +pdfjs-unexpected-response-error = Resposta inesperada del servidor. +pdfjs-rendering-error = S'ha produït un error mentre es renderitzava la pàgina. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [Anotació { $type }] + +## Password + +pdfjs-password-label = Introduïu la contrasenya per obrir aquest fitxer PDF. +pdfjs-password-invalid = La contrasenya no és vàlida. Torneu-ho a provar. +pdfjs-password-ok-button = D'acord +pdfjs-password-cancel-button = Cancel·la +pdfjs-web-fonts-disabled = Els tipus de lletra web estan desactivats: no es poden utilitzar els tipus de lletra incrustats al PDF. + +## Editing + +pdfjs-editor-free-text-button = + .title = Text +pdfjs-editor-free-text-button-label = Text +pdfjs-editor-ink-button = + .title = Dibuixa +pdfjs-editor-ink-button-label = Dibuixa + +## Remove button for the various kind of editor. + + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Color +pdfjs-editor-free-text-size-input = Mida +pdfjs-editor-ink-color-input = Color +pdfjs-editor-ink-thickness-input = Gruix +pdfjs-editor-ink-opacity-input = Opacitat +pdfjs-free-text = + .aria-label = Editor de text +pdfjs-free-text-default-content = Escriviu… +pdfjs-ink = + .aria-label = Editor de dibuix +pdfjs-ink-canvas = + .aria-label = Imatge creada per l'usuari + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + + +## Color picker + + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + + +## Image alt-text settings + diff --git a/public/pdfjs/web/locale/cak/viewer.ftl b/public/pdfjs/web/locale/cak/viewer.ftl new file mode 100644 index 0000000..f40c1e9 --- /dev/null +++ b/public/pdfjs/web/locale/cak/viewer.ftl @@ -0,0 +1,291 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Jun kan ruxaq +pdfjs-previous-button-label = Jun kan +pdfjs-next-button = + .title = Jun chik ruxaq +pdfjs-next-button-label = Jun chik +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Ruxaq +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = richin { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } richin { $pagesCount }) +pdfjs-zoom-out-button = + .title = Tich'utinirisäx +pdfjs-zoom-out-button-label = Tich'utinirisäx +pdfjs-zoom-in-button = + .title = Tinimirisäx +pdfjs-zoom-in-button-label = Tinimirisäx +pdfjs-zoom-select = + .title = Sum +pdfjs-presentation-mode-button = + .title = Tijal ri rub'anikil niwachin +pdfjs-presentation-mode-button-label = Pa rub'eyal niwachin +pdfjs-open-file-button = + .title = Tijaq Yakb'äl +pdfjs-open-file-button-label = Tijaq +pdfjs-print-button = + .title = Titz'ajb'äx +pdfjs-print-button-label = Titz'ajb'äx +pdfjs-save-button = + .title = Tiyak +pdfjs-save-button-label = Tiyak +pdfjs-bookmark-button-label = Ruxaq k'o wakami + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Samajib'äl +pdfjs-tools-button-label = Samajib'äl +pdfjs-first-page-button = + .title = Tib'e pa nab'ey ruxaq +pdfjs-first-page-button-label = Tib'e pa nab'ey ruxaq +pdfjs-last-page-button = + .title = Tib'e pa ruk'isib'äl ruxaq +pdfjs-last-page-button-label = Tib'e pa ruk'isib'äl ruxaq +pdfjs-page-rotate-cw-button = + .title = Tisutïx pan ajkiq'a' +pdfjs-page-rotate-cw-button-label = Tisutïx pan ajkiq'a' +pdfjs-page-rotate-ccw-button = + .title = Tisutïx pan ajxokon +pdfjs-page-rotate-ccw-button-label = Tisutïx pan ajxokon +pdfjs-cursor-text-select-tool-button = + .title = Titzij ri rusamajib'al Rucha'ik Rucholajem Tzij +pdfjs-cursor-text-select-tool-button-label = Rusamajib'al Rucha'ik Rucholajem Tzij +pdfjs-cursor-hand-tool-button = + .title = Titzij ri q'ab'aj samajib'äl +pdfjs-cursor-hand-tool-button-label = Q'ab'aj Samajib'äl +pdfjs-scroll-page-button = + .title = Tokisäx Ruxaq Q'axanem +pdfjs-scroll-page-button-label = Ruxaq Q'axanem +pdfjs-scroll-vertical-button = + .title = Tokisäx Pa'äl Q'axanem +pdfjs-scroll-vertical-button-label = Pa'äl Q'axanem +pdfjs-scroll-horizontal-button = + .title = Tokisäx Kotz'öl Q'axanem +pdfjs-scroll-horizontal-button-label = Kotz'öl Q'axanem +pdfjs-scroll-wrapped-button = + .title = Tokisäx Tzub'aj Q'axanem +pdfjs-scroll-wrapped-button-label = Tzub'aj Q'axanem +pdfjs-spread-none-button = + .title = Man ketun taq ruxaq pa rub'eyal wuj +pdfjs-spread-none-button-label = Majun Rub'eyal +pdfjs-spread-odd-button = + .title = Ke'atunu' ri taq ruxaq rik'in natikirisaj rik'in jun man k'ulaj ta rajilab'al +pdfjs-spread-odd-button-label = Man K'ulaj Ta Rub'eyal +pdfjs-spread-even-button = + .title = Ke'atunu' ri taq ruxaq rik'in natikirisaj rik'in jun k'ulaj rajilab'al +pdfjs-spread-even-button-label = K'ulaj Rub'eyal + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Taq richinil wuj… +pdfjs-document-properties-button-label = Taq richinil wuj… +pdfjs-document-properties-file-name = Rub'i' yakb'äl: +pdfjs-document-properties-file-size = Runimilem yakb'äl: +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bytes) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bytes) +pdfjs-document-properties-title = B'i'aj: +pdfjs-document-properties-author = B'anel: +pdfjs-document-properties-subject = Taqikil: +pdfjs-document-properties-keywords = Kixe'el taq tzij: +pdfjs-document-properties-creation-date = Ruq'ijul xtz'uk: +pdfjs-document-properties-modification-date = Ruq'ijul xjalwachïx: +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Q'inonel: +pdfjs-document-properties-producer = PDF b'anöy: +pdfjs-document-properties-version = PDF ruwäch: +pdfjs-document-properties-page-count = Jarupe' ruxaq: +pdfjs-document-properties-page-size = Runimilem ri Ruxaq: +pdfjs-document-properties-page-size-unit-inches = pa +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = rupalem +pdfjs-document-properties-page-size-orientation-landscape = rukotz'olem +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Loman wuj +pdfjs-document-properties-page-size-name-legal = Taqanel tzijol + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Anin Rutz'etik Ajk'amaya'l: +pdfjs-document-properties-linearized-yes = Ja' +pdfjs-document-properties-linearized-no = Mani +pdfjs-document-properties-close-button = Titz'apïx + +## Print + +pdfjs-print-progress-message = Ruchojmirisaxik wuj richin nitz'ajb'äx… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Tiq'at +pdfjs-printing-not-supported = Rutzijol k'ayewal: Ri rutz'ajb'axik man koch'el ta ronojel pa re okik'amaya'l re'. +pdfjs-printing-not-ready = Rutzijol k'ayewal: Ri PDF man xusamajij ta ronojel richin nitz'ajb'äx. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Tijal ri ajxikin kajtz'ik +pdfjs-toggle-sidebar-notification-button = + .title = Tik'ex ri ajxikin yuqkajtz'ik (ri wuj eruk'wan taq ruchi'/taqo/kuchuj) +pdfjs-toggle-sidebar-button-label = Tijal ri ajxikin kajtz'ik +pdfjs-document-outline-button = + .title = Tik'ut pe ruch'akulal wuj (kamul-pitz'oj richin nirik'/nich'utinirisäx ronojel ruch'akulal) +pdfjs-document-outline-button-label = Ruch'akulal wuj +pdfjs-attachments-button = + .title = Kek'ut pe ri taq taqoj +pdfjs-attachments-button-label = Taq taqoj +pdfjs-layers-button = + .title = Kek'ut taq Kuchuj (ka'i'-pitz' richin yetzolïx ronojel ri taq kuchuj e k'o wi) +pdfjs-layers-button-label = Taq kuchuj +pdfjs-thumbs-button = + .title = Kek'ut pe taq ch'utiq +pdfjs-thumbs-button-label = Koköj +pdfjs-current-outline-item-button = + .title = Kekanöx Taq Ch'akulal Kik'wan Chib'äl +pdfjs-current-outline-item-button-label = Taq Ch'akulal Kik'wan Chib'äl +pdfjs-findbar-button = + .title = Tikanöx chupam ri wuj +pdfjs-findbar-button-label = Tikanöx +pdfjs-additional-layers = Tz'aqat ta Kuchuj + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Ruxaq { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Ruch'utinirisaxik ruxaq { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Tikanöx + .placeholder = Tikanöx pa wuj… +pdfjs-find-previous-button = + .title = Tib'an b'enam pa ri jun kan q'aptzij xilitäj +pdfjs-find-previous-button-label = Jun kan +pdfjs-find-next-button = + .title = Tib'e pa ri jun chik pajtzij xilitäj +pdfjs-find-next-button-label = Jun chik +pdfjs-find-highlight-checkbox = Tiya' retal ronojel +pdfjs-find-match-case-checkbox-label = Tuk'äm ri' kik'in taq nimatz'ib' chuqa' taq ch'utitz'ib' +pdfjs-find-match-diacritics-checkbox-label = Tiya' Kikojol Tz'aqat taq Tz'ib' +pdfjs-find-entire-word-checkbox-label = Tz'aqät taq tzij +pdfjs-find-reached-top = Xb'eq'i' ri rutikirib'al wuj, xtikanöx k'a pa ruk'isib'äl +pdfjs-find-reached-bottom = Xb'eq'i' ri ruk'isib'äl wuj, xtikanöx pa rutikirib'al +pdfjs-find-not-found = Man xilitäj ta ri pajtzij + +## Predefined zoom values + +pdfjs-page-scale-width = Ruwa ruxaq +pdfjs-page-scale-fit = Tinuk' ruxaq +pdfjs-page-scale-auto = Yonil chi nimilem +pdfjs-page-scale-actual = Runimilem Wakami +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Ruxaq { $page } + +## Loading indicator messages + +pdfjs-loading-error = Xk'ulwachitäj jun sach'oj toq xnuk'ux ri PDF . +pdfjs-invalid-file-error = Man oke ta o yujtajinäq ri PDF yakb'äl. +pdfjs-missing-file-error = Man xilitäj ta ri PDF yakb'äl. +pdfjs-unexpected-response-error = Man oyob'en ta tz'olin rutzij ruk'u'x samaj. +pdfjs-rendering-error = Xk'ulwachitäj jun sachoj toq ninuk'wachij ri ruxaq. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } Tz'ib'anïk] + +## Password + +pdfjs-password-label = Tatz'ib'aj ri ewan tzij richin najäq re yakb'äl re' pa PDF. +pdfjs-password-invalid = Man okel ta ri ewan tzij: Tatojtob'ej chik. +pdfjs-password-ok-button = Ütz +pdfjs-password-cancel-button = Tiq'at +pdfjs-web-fonts-disabled = E chupül ri taq ajk'amaya'l tz'ib': man tikirel ta nokisäx ri taq tz'ib' PDF pa ch'ikenïk + +## Editing + +pdfjs-editor-free-text-button = + .title = Rucholajem tz'ib' +pdfjs-editor-free-text-button-label = Rucholajem tz'ib' +pdfjs-editor-ink-button = + .title = Tiwachib'ëx +pdfjs-editor-ink-button-label = Tiwachib'ëx +# Editor Parameters +pdfjs-editor-free-text-color-input = B'onil +pdfjs-editor-free-text-size-input = Nimilem +pdfjs-editor-ink-color-input = B'onil +pdfjs-editor-ink-thickness-input = Rupimil +pdfjs-editor-ink-opacity-input = Q'equmal +pdfjs-free-text = + .aria-label = Nuk'unel tz'ib'atzij +pdfjs-free-text-default-content = Titikitisäx rutz'ib'axik… +pdfjs-ink = + .aria-label = Nuk'unel wachib'äl +pdfjs-ink-canvas = + .aria-label = Wachib'äl nuk'un ruma okisaxel + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + diff --git a/public/pdfjs/web/locale/ckb/viewer.ftl b/public/pdfjs/web/locale/ckb/viewer.ftl new file mode 100644 index 0000000..ae87335 --- /dev/null +++ b/public/pdfjs/web/locale/ckb/viewer.ftl @@ -0,0 +1,242 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = پەڕەی پێشوو +pdfjs-previous-button-label = پێشوو +pdfjs-next-button = + .title = پەڕەی دوواتر +pdfjs-next-button-label = دوواتر +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = پەرە +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = لە { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } لە { $pagesCount }) +pdfjs-zoom-out-button = + .title = ڕۆچوونی +pdfjs-zoom-out-button-label = ڕۆچوونی +pdfjs-zoom-in-button = + .title = هێنانەپێش +pdfjs-zoom-in-button-label = هێنانەپێش +pdfjs-zoom-select = + .title = زووم +pdfjs-presentation-mode-button = + .title = گۆڕین بۆ دۆخی پێشکەشکردن +pdfjs-presentation-mode-button-label = دۆخی پێشکەشکردن +pdfjs-open-file-button = + .title = پەڕگە بکەرەوە +pdfjs-open-file-button-label = کردنەوە +pdfjs-print-button = + .title = چاپکردن +pdfjs-print-button-label = چاپکردن + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = ئامرازەکان +pdfjs-tools-button-label = ئامرازەکان +pdfjs-first-page-button = + .title = برۆ بۆ یەکەم پەڕە +pdfjs-first-page-button-label = بڕۆ بۆ یەکەم پەڕە +pdfjs-last-page-button = + .title = بڕۆ بۆ کۆتا پەڕە +pdfjs-last-page-button-label = بڕۆ بۆ کۆتا پەڕە +pdfjs-page-rotate-cw-button = + .title = ئاڕاستەی میلی کاتژمێر +pdfjs-page-rotate-cw-button-label = ئاڕاستەی میلی کاتژمێر +pdfjs-page-rotate-ccw-button = + .title = پێچەوانەی میلی کاتژمێر +pdfjs-page-rotate-ccw-button-label = پێچەوانەی میلی کاتژمێر +pdfjs-cursor-text-select-tool-button = + .title = توڵامرازی نیشانکەری دەق چالاک بکە +pdfjs-cursor-text-select-tool-button-label = توڵامرازی نیشانکەری دەق +pdfjs-cursor-hand-tool-button = + .title = توڵامرازی دەستی چالاک بکە +pdfjs-cursor-hand-tool-button-label = توڵامرازی دەستی +pdfjs-scroll-vertical-button = + .title = ناردنی ئەستوونی بەکاربێنە +pdfjs-scroll-vertical-button-label = ناردنی ئەستوونی +pdfjs-scroll-horizontal-button = + .title = ناردنی ئاسۆیی بەکاربێنە +pdfjs-scroll-horizontal-button-label = ناردنی ئاسۆیی +pdfjs-scroll-wrapped-button = + .title = ناردنی لوولکراو بەکاربێنە +pdfjs-scroll-wrapped-button-label = ناردنی لوولکراو + +## Document properties dialog + +pdfjs-document-properties-button = + .title = تایبەتمەندییەکانی بەڵگەنامە... +pdfjs-document-properties-button-label = تایبەتمەندییەکانی بەڵگەنامە... +pdfjs-document-properties-file-name = ناوی پەڕگە: +pdfjs-document-properties-file-size = قەبارەی پەڕگە: +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } کب ({ $size_b } بایت) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } مب ({ $size_b } بایت) +pdfjs-document-properties-title = سەردێڕ: +pdfjs-document-properties-author = نووسەر +pdfjs-document-properties-subject = بابەت: +pdfjs-document-properties-keywords = کلیلەوشە: +pdfjs-document-properties-creation-date = بەرواری درووستکردن: +pdfjs-document-properties-modification-date = بەرواری دەستکاریکردن: +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = درووستکەر: +pdfjs-document-properties-producer = بەرهەمهێنەری PDF: +pdfjs-document-properties-version = وەشانی PDF: +pdfjs-document-properties-page-count = ژمارەی پەرەکان: +pdfjs-document-properties-page-size = قەبارەی پەڕە: +pdfjs-document-properties-page-size-unit-inches = ئینچ +pdfjs-document-properties-page-size-unit-millimeters = ملم +pdfjs-document-properties-page-size-orientation-portrait = پۆرترەیت(درێژ) +pdfjs-document-properties-page-size-orientation-landscape = پانیی +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = نامە +pdfjs-document-properties-page-size-name-legal = یاسایی + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = پیشاندانی وێبی خێرا: +pdfjs-document-properties-linearized-yes = بەڵێ +pdfjs-document-properties-linearized-no = نەخێر +pdfjs-document-properties-close-button = داخستن + +## Print + +pdfjs-print-progress-message = بەڵگەنامە ئامادەدەکرێت بۆ چاپکردن... +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = پاشگەزبوونەوە +pdfjs-printing-not-supported = ئاگاداربە: چاپکردن بە تەواوی پشتگیر ناکرێت لەم وێبگەڕە. +pdfjs-printing-not-ready = ئاگاداربە: PDF بە تەواوی بارنەبووە بۆ چاپکردن. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = لاتەنیشت پیشاندان/شاردنەوە +pdfjs-toggle-sidebar-button-label = لاتەنیشت پیشاندان/شاردنەوە +pdfjs-document-outline-button-label = سنووری چوارچێوە +pdfjs-attachments-button = + .title = پاشکۆکان پیشان بدە +pdfjs-attachments-button-label = پاشکۆکان +pdfjs-layers-button-label = چینەکان +pdfjs-thumbs-button = + .title = وێنۆچکە پیشان بدە +pdfjs-thumbs-button-label = وێنۆچکە +pdfjs-findbar-button = + .title = لە بەڵگەنامە بگەرێ +pdfjs-findbar-button-label = دۆزینەوە +pdfjs-additional-layers = چینی زیاتر + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = پەڕەی { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = وێنۆچکەی پەڕەی { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = دۆزینەوە + .placeholder = لە بەڵگەنامە بگەرێ... +pdfjs-find-previous-button = + .title = هەبوونی پێشوو بدۆزرەوە لە ڕستەکەدا +pdfjs-find-previous-button-label = پێشوو +pdfjs-find-next-button = + .title = هەبوونی داهاتوو بدۆزەرەوە لە ڕستەکەدا +pdfjs-find-next-button-label = دوواتر +pdfjs-find-highlight-checkbox = هەمووی نیشانە بکە +pdfjs-find-match-case-checkbox-label = دۆخی لەیەکچوون +pdfjs-find-entire-word-checkbox-label = هەموو وشەکان +pdfjs-find-reached-top = گەشتیتە سەرەوەی بەڵگەنامە، لە خوارەوە دەستت پێکرد +pdfjs-find-reached-bottom = گەشتیتە کۆتایی بەڵگەنامە. لەسەرەوە دەستت پێکرد +pdfjs-find-not-found = نووسین نەدۆزرایەوە + +## Predefined zoom values + +pdfjs-page-scale-width = پانی پەڕە +pdfjs-page-scale-fit = پڕبوونی پەڕە +pdfjs-page-scale-auto = زوومی خۆکار +pdfjs-page-scale-actual = قەبارەی ڕاستی +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + + +## Loading indicator messages + +pdfjs-loading-error = هەڵەیەک ڕوویدا لە کاتی بارکردنی PDF. +pdfjs-invalid-file-error = پەڕگەی pdf تێکچووە یان نەگونجاوە. +pdfjs-missing-file-error = پەڕگەی pdf بوونی نیە. +pdfjs-unexpected-response-error = وەڵامی ڕاژەخوازی نەخوازراو. +pdfjs-rendering-error = هەڵەیەک ڕوویدا لە کاتی پوختەکردنی (ڕێندەر) پەڕە. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } سەرنج] + +## Password + +pdfjs-password-label = وشەی تێپەڕ بنووسە بۆ کردنەوەی پەڕگەی pdf. +pdfjs-password-invalid = وشەی تێپەڕ هەڵەیە. تکایە دووبارە هەوڵ بدەرەوە. +pdfjs-password-ok-button = باشە +pdfjs-password-cancel-button = پاشگەزبوونەوە +pdfjs-web-fonts-disabled = جۆرەپیتی وێب ناچالاکە: نەتوانی جۆرەپیتی تێخراوی ناو pdfـەکە بەکاربێت. + +## Editing + + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + diff --git a/public/pdfjs/web/locale/cs/viewer.ftl b/public/pdfjs/web/locale/cs/viewer.ftl new file mode 100644 index 0000000..696fe30 --- /dev/null +++ b/public/pdfjs/web/locale/cs/viewer.ftl @@ -0,0 +1,521 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Přejde na předchozí stránku +pdfjs-previous-button-label = Předchozí +pdfjs-next-button = + .title = Přejde na následující stránku +pdfjs-next-button-label = Další +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Stránka +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = z { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } z { $pagesCount }) +pdfjs-zoom-out-button = + .title = Zmenší velikost +pdfjs-zoom-out-button-label = Zmenšit +pdfjs-zoom-in-button = + .title = Zvětší velikost +pdfjs-zoom-in-button-label = Zvětšit +pdfjs-zoom-select = + .title = Nastaví velikost +pdfjs-presentation-mode-button = + .title = Přepne do režimu prezentace +pdfjs-presentation-mode-button-label = Režim prezentace +pdfjs-open-file-button = + .title = Otevře soubor +pdfjs-open-file-button-label = Otevřít +pdfjs-print-button = + .title = Vytiskne dokument +pdfjs-print-button-label = Vytisknout +pdfjs-save-button = + .title = Uložit +pdfjs-save-button-label = Uložit +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Stáhnout +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Stáhnout +pdfjs-bookmark-button = + .title = Aktuální stránka (zobrazit URL od aktuální stránky) +pdfjs-bookmark-button-label = Aktuální stránka + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Nástroje +pdfjs-tools-button-label = Nástroje +pdfjs-first-page-button = + .title = Přejde na první stránku +pdfjs-first-page-button-label = Přejít na první stránku +pdfjs-last-page-button = + .title = Přejde na poslední stránku +pdfjs-last-page-button-label = Přejít na poslední stránku +pdfjs-page-rotate-cw-button = + .title = Otočí po směru hodin +pdfjs-page-rotate-cw-button-label = Otočit po směru hodin +pdfjs-page-rotate-ccw-button = + .title = Otočí proti směru hodin +pdfjs-page-rotate-ccw-button-label = Otočit proti směru hodin +pdfjs-cursor-text-select-tool-button = + .title = Povolí výběr textu +pdfjs-cursor-text-select-tool-button-label = Výběr textu +pdfjs-cursor-hand-tool-button = + .title = Povolí nástroj ručička +pdfjs-cursor-hand-tool-button-label = Nástroj ručička +pdfjs-scroll-page-button = + .title = Posouvat po stránkách +pdfjs-scroll-page-button-label = Posouvání po stránkách +pdfjs-scroll-vertical-button = + .title = Použít svislé posouvání +pdfjs-scroll-vertical-button-label = Svislé posouvání +pdfjs-scroll-horizontal-button = + .title = Použít vodorovné posouvání +pdfjs-scroll-horizontal-button-label = Vodorovné posouvání +pdfjs-scroll-wrapped-button = + .title = Použít postupné posouvání +pdfjs-scroll-wrapped-button-label = Postupné posouvání +pdfjs-spread-none-button = + .title = Nesdružovat stránky +pdfjs-spread-none-button-label = Žádné sdružení +pdfjs-spread-odd-button = + .title = Sdruží stránky s umístěním lichých vlevo +pdfjs-spread-odd-button-label = Sdružení stránek (liché vlevo) +pdfjs-spread-even-button = + .title = Sdruží stránky s umístěním sudých vlevo +pdfjs-spread-even-button-label = Sdružení stránek (sudé vlevo) + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Vlastnosti dokumentu… +pdfjs-document-properties-button-label = Vlastnosti dokumentu… +pdfjs-document-properties-file-name = Název souboru: +pdfjs-document-properties-file-size = Velikost souboru: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } kB ({ $b } bajtů) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } bajtů) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bajtů) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bajtů) +pdfjs-document-properties-title = Název stránky: +pdfjs-document-properties-author = Autor: +pdfjs-document-properties-subject = Předmět: +pdfjs-document-properties-keywords = Klíčová slova: +pdfjs-document-properties-creation-date = Datum vytvoření: +pdfjs-document-properties-modification-date = Datum úpravy: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Vytvořil: +pdfjs-document-properties-producer = Tvůrce PDF: +pdfjs-document-properties-version = Verze PDF: +pdfjs-document-properties-page-count = Počet stránek: +pdfjs-document-properties-page-size = Velikost stránky: +pdfjs-document-properties-page-size-unit-inches = in +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = na výšku +pdfjs-document-properties-page-size-orientation-landscape = na šířku +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Dopis +pdfjs-document-properties-page-size-name-legal = Právní dokument + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Rychlé zobrazování z webu: +pdfjs-document-properties-linearized-yes = Ano +pdfjs-document-properties-linearized-no = Ne +pdfjs-document-properties-close-button = Zavřít + +## Print + +pdfjs-print-progress-message = Příprava dokumentu pro tisk… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress } % +pdfjs-print-progress-close-button = Zrušit +pdfjs-printing-not-supported = Upozornění: Tisk není v tomto prohlížeči plně podporován. +pdfjs-printing-not-ready = Upozornění: Dokument PDF není kompletně načten. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Postranní lišta +pdfjs-toggle-sidebar-notification-button = + .title = Přepnout postranní lištu (dokument obsahuje osnovu/přílohy/vrstvy) +pdfjs-toggle-sidebar-button-label = Postranní lišta +pdfjs-document-outline-button = + .title = Zobrazí osnovu dokumentu (poklepání přepne zobrazení všech položek) +pdfjs-document-outline-button-label = Osnova dokumentu +pdfjs-attachments-button = + .title = Zobrazí přílohy +pdfjs-attachments-button-label = Přílohy +pdfjs-layers-button = + .title = Zobrazit vrstvy (poklepáním obnovíte všechny vrstvy do výchozího stavu) +pdfjs-layers-button-label = Vrstvy +pdfjs-thumbs-button = + .title = Zobrazí náhledy +pdfjs-thumbs-button-label = Náhledy +pdfjs-current-outline-item-button = + .title = Najít aktuální položku v osnově +pdfjs-current-outline-item-button-label = Aktuální položka v osnově +pdfjs-findbar-button = + .title = Najde v dokumentu +pdfjs-findbar-button-label = Najít +pdfjs-additional-layers = Další vrstvy + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Strana { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Náhled strany { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Najít + .placeholder = Najít v dokumentu… +pdfjs-find-previous-button = + .title = Najde předchozí výskyt hledaného textu +pdfjs-find-previous-button-label = Předchozí +pdfjs-find-next-button = + .title = Najde další výskyt hledaného textu +pdfjs-find-next-button-label = Další +pdfjs-find-highlight-checkbox = Zvýraznit +pdfjs-find-match-case-checkbox-label = Rozlišovat velikost +pdfjs-find-match-diacritics-checkbox-label = Rozlišovat diakritiku +pdfjs-find-entire-word-checkbox-label = Celá slova +pdfjs-find-reached-top = Dosažen začátek dokumentu, pokračuje se od konce +pdfjs-find-reached-bottom = Dosažen konec dokumentu, pokračuje se od začátku +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] { $current }. z { $total } výskytu + [few] { $current }. z { $total } výskytů + [many] { $current }. z { $total } výskytů + *[other] { $current }. z { $total } výskytů + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] Více než { $limit } výskyt + [few] Více než { $limit } výskyty + [many] Více než { $limit } výskytů + *[other] Více než { $limit } výskytů + } +pdfjs-find-not-found = Hledaný text nenalezen + +## Predefined zoom values + +pdfjs-page-scale-width = Podle šířky +pdfjs-page-scale-fit = Podle výšky +pdfjs-page-scale-auto = Automatická velikost +pdfjs-page-scale-actual = Skutečná velikost +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale } % + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Strana { $page } + +## Loading indicator messages + +pdfjs-loading-error = Při nahrávání PDF nastala chyba. +pdfjs-invalid-file-error = Neplatný nebo chybný soubor PDF. +pdfjs-missing-file-error = Chybí soubor PDF. +pdfjs-unexpected-response-error = Neočekávaná odpověď serveru. +pdfjs-rendering-error = Při vykreslování stránky nastala chyba. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [Anotace typu { $type }] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Pro otevření PDF souboru vložte heslo. +pdfjs-password-invalid = Neplatné heslo. Zkuste to znovu. +pdfjs-password-ok-button = OK +pdfjs-password-cancel-button = Zrušit +pdfjs-web-fonts-disabled = Webová písma jsou zakázána, proto není možné použít vložená písma PDF. + +## Editing + +pdfjs-editor-free-text-button = + .title = Text +pdfjs-editor-free-text-button-label = Text +pdfjs-editor-ink-button = + .title = Kreslení +pdfjs-editor-ink-button-label = Kreslení +pdfjs-editor-stamp-button = + .title = Přidání či úprava obrázků +pdfjs-editor-stamp-button-label = Přidání či úprava obrázků +pdfjs-editor-highlight-button = + .title = Zvýraznění +pdfjs-editor-highlight-button-label = Zvýraznění +pdfjs-highlight-floating-button1 = + .title = Zvýraznit + .aria-label = Zvýraznit +pdfjs-highlight-floating-button-label = Zvýraznit + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Odebrat kresbu +pdfjs-editor-remove-freetext-button = + .title = Odebrat text +pdfjs-editor-remove-stamp-button = + .title = Odebrat obrázek +pdfjs-editor-remove-highlight-button = + .title = Odebrat zvýraznění + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Barva +pdfjs-editor-free-text-size-input = Velikost +pdfjs-editor-ink-color-input = Barva +pdfjs-editor-ink-thickness-input = Tloušťka +pdfjs-editor-ink-opacity-input = Průhlednost +pdfjs-editor-stamp-add-image-button = + .title = Přidat obrázek +pdfjs-editor-stamp-add-image-button-label = Přidat obrázek +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Tloušťka +pdfjs-editor-free-highlight-thickness-title = + .title = Změna tloušťky při zvýrazňování jiných položek než textu +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = Textový editor + .default-content = Začněte psát... +pdfjs-free-text = + .aria-label = Textový editor +pdfjs-free-text-default-content = Začněte psát… +pdfjs-ink = + .aria-label = Editor kreslení +pdfjs-ink-canvas = + .aria-label = Uživatelem vytvořený obrázek + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = Náhradní popis +pdfjs-editor-alt-text-edit-button = + .aria-label = Upravit alternativní text +pdfjs-editor-alt-text-edit-button-label = Upravit náhradní popis +pdfjs-editor-alt-text-dialog-label = Vyberte možnost +pdfjs-editor-alt-text-dialog-description = Náhradní popis pomáhá, když lidé obrázek nevidí nebo když se nenačítá. +pdfjs-editor-alt-text-add-description-label = Přidat popis +pdfjs-editor-alt-text-add-description-description = Snažte se o 1-2 věty, které popisují předmět, prostředí nebo činnosti. +pdfjs-editor-alt-text-mark-decorative-label = Označit jako dekorativní +pdfjs-editor-alt-text-mark-decorative-description = Používá se pro okrasné obrázky, jako jsou rámečky nebo vodoznaky. +pdfjs-editor-alt-text-cancel-button = Zrušit +pdfjs-editor-alt-text-save-button = Uložit +pdfjs-editor-alt-text-decorative-tooltip = Označen jako dekorativní +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = Například: “Mladý muž si sedá ke stolu, aby se najedl.” +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = Alternativní text + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Levý horní roh — změna velikosti +pdfjs-editor-resizer-label-top-middle = Horní střed — změna velikosti +pdfjs-editor-resizer-label-top-right = Pravý horní roh — změna velikosti +pdfjs-editor-resizer-label-middle-right = Vpravo uprostřed — změna velikosti +pdfjs-editor-resizer-label-bottom-right = Pravý dolní roh — změna velikosti +pdfjs-editor-resizer-label-bottom-middle = Střed dole — změna velikosti +pdfjs-editor-resizer-label-bottom-left = Levý dolní roh — změna velikosti +pdfjs-editor-resizer-label-middle-left = Vlevo uprostřed — změna velikosti +pdfjs-editor-resizer-top-left = + .aria-label = Levý horní roh — změna velikosti +pdfjs-editor-resizer-top-middle = + .aria-label = Horní střed — změna velikosti +pdfjs-editor-resizer-top-right = + .aria-label = Pravý horní roh — změna velikosti +pdfjs-editor-resizer-middle-right = + .aria-label = Vpravo uprostřed — změna velikosti +pdfjs-editor-resizer-bottom-right = + .aria-label = Pravý dolní roh — změna velikosti +pdfjs-editor-resizer-bottom-middle = + .aria-label = Střed dole — změna velikosti +pdfjs-editor-resizer-bottom-left = + .aria-label = Levý dolní roh — změna velikosti +pdfjs-editor-resizer-middle-left = + .aria-label = Vlevo uprostřed — změna velikosti + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Barva zvýraznění +pdfjs-editor-colorpicker-button = + .title = Změna barvy +pdfjs-editor-colorpicker-dropdown = + .aria-label = Výběr barev +pdfjs-editor-colorpicker-yellow = + .title = Žlutá +pdfjs-editor-colorpicker-green = + .title = Zelená +pdfjs-editor-colorpicker-blue = + .title = Modrá +pdfjs-editor-colorpicker-pink = + .title = Růžová +pdfjs-editor-colorpicker-red = + .title = Červená + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Zobrazit vše +pdfjs-editor-highlight-show-all-button = + .title = Zobrazit vše + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = Upravit alternativní text (popis obrázku) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = Přidat alternativní text (popis obrázku) +pdfjs-editor-new-alt-text-textarea = + .placeholder = Sem napište svůj popis… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = Krátký popis pro lidi, kteří neuvidí obrázek nebo když se obrázek nenačítá. +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = Tento alternativní text byl vytvořen automaticky a může být nepřesný. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Více informací +pdfjs-editor-new-alt-text-create-automatically-button-label = Vytvořit alternativní text automaticky +pdfjs-editor-new-alt-text-not-now-button = Teď ne +pdfjs-editor-new-alt-text-error-title = Nepodařilo se automaticky vytvořit alternativní text +pdfjs-editor-new-alt-text-error-description = Napište prosím vlastní alternativní text nebo to zkuste znovu později. +pdfjs-editor-new-alt-text-error-close-button = Zavřít +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = Stahuje se model AI pro alternativní texty ({ $downloadedSize } z { $totalSize } MB) + .aria-valuetext = Stahuje se model AI pro alternativní texty ({ $downloadedSize } z { $totalSize } MB) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = Alternativní text byl přidán +pdfjs-editor-new-alt-text-added-button-label = Alternativní text byl přidán +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = Chybí alternativní text +pdfjs-editor-new-alt-text-missing-button-label = Chybí alternativní text +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = Zkontrolovat alternativní text +pdfjs-editor-new-alt-text-to-review-button-label = Zkontrolovat alternativní text +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Vytvořeno automaticky: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = Nastavení alternativního textu obrázku +pdfjs-image-alt-text-settings-button-label = Nastavení alternativního textu obrázku +pdfjs-editor-alt-text-settings-dialog-label = Nastavení alternativního textu obrázku +pdfjs-editor-alt-text-settings-automatic-title = Automatický alternativní text +pdfjs-editor-alt-text-settings-create-model-button-label = Vytvořit alternativní text automaticky +pdfjs-editor-alt-text-settings-create-model-description = Navrhuje popisy, které pomohou lidem, kteří nevidí obrázek nebo když se obrázek nenačte. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = Model AI pro alternativní text ({ $totalSize } MB) +pdfjs-editor-alt-text-settings-ai-model-description = Běží lokálně na vašem zařízení, takže vaše data zůstávají v bezpečí. Vyžadováno pro automatický alternativní text. +pdfjs-editor-alt-text-settings-delete-model-button = Smazat +pdfjs-editor-alt-text-settings-download-model-button = Stáhnout +pdfjs-editor-alt-text-settings-downloading-model-button = Probíhá stahování... +pdfjs-editor-alt-text-settings-editor-title = Editor alternativního textu +pdfjs-editor-alt-text-settings-show-dialog-button-label = Při přidávání obrázku hned zobrazit editor alternativního textu +pdfjs-editor-alt-text-settings-show-dialog-description = Pomůže vám zajistit, aby všechny vaše obrázky obsahovaly alternativní text. +pdfjs-editor-alt-text-settings-close-button = Zavřít + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = Zvýraznění odebráno +pdfjs-editor-undo-bar-message-freetext = Text odstraněn +pdfjs-editor-undo-bar-message-ink = Kresba odstraněna +pdfjs-editor-undo-bar-message-stamp = Obrázek odebrán +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = + { $count -> + [one] { $count } anotace odebrána + [few] { $count } anotace odebrány + [many] { $count } anotací odebráno + *[other] { $count } anotací odebráno + } +pdfjs-editor-undo-bar-undo-button = + .title = Zpět +pdfjs-editor-undo-bar-undo-button-label = Zpět +pdfjs-editor-undo-bar-close-button = + .title = Zavřít +pdfjs-editor-undo-bar-close-button-label = Zavřít diff --git a/public/pdfjs/web/locale/cy/viewer.ftl b/public/pdfjs/web/locale/cy/viewer.ftl new file mode 100644 index 0000000..8363835 --- /dev/null +++ b/public/pdfjs/web/locale/cy/viewer.ftl @@ -0,0 +1,527 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Tudalen Flaenorol +pdfjs-previous-button-label = Blaenorol +pdfjs-next-button = + .title = Tudalen Nesaf +pdfjs-next-button-label = Nesaf +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Tudalen +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = o { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } o { $pagesCount }) +pdfjs-zoom-out-button = + .title = Lleihau +pdfjs-zoom-out-button-label = Lleihau +pdfjs-zoom-in-button = + .title = Cynyddu +pdfjs-zoom-in-button-label = Cynyddu +pdfjs-zoom-select = + .title = Chwyddo +pdfjs-presentation-mode-button = + .title = Newid i'r Modd Cyflwyno +pdfjs-presentation-mode-button-label = Modd Cyflwyno +pdfjs-open-file-button = + .title = Agor Ffeil +pdfjs-open-file-button-label = Agor +pdfjs-print-button = + .title = Argraffu +pdfjs-print-button-label = Argraffu +pdfjs-save-button = + .title = Cadw +pdfjs-save-button-label = Cadw +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Llwytho i lawr +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Llwytho i lawr +pdfjs-bookmark-button = + .title = Tudalen Gyfredol (Gweld URL o'r Dudalen Gyfredol) +pdfjs-bookmark-button-label = Tudalen Gyfredol + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Offer +pdfjs-tools-button-label = Offer +pdfjs-first-page-button = + .title = Mynd i'r Dudalen Gyntaf +pdfjs-first-page-button-label = Mynd i'r Dudalen Gyntaf +pdfjs-last-page-button = + .title = Mynd i'r Dudalen Olaf +pdfjs-last-page-button-label = Mynd i'r Dudalen Olaf +pdfjs-page-rotate-cw-button = + .title = Cylchdroi Clocwedd +pdfjs-page-rotate-cw-button-label = Cylchdroi Clocwedd +pdfjs-page-rotate-ccw-button = + .title = Cylchdroi Gwrthglocwedd +pdfjs-page-rotate-ccw-button-label = Cylchdroi Gwrthglocwedd +pdfjs-cursor-text-select-tool-button = + .title = Galluogi Dewis Offeryn Testun +pdfjs-cursor-text-select-tool-button-label = Offeryn Dewis Testun +pdfjs-cursor-hand-tool-button = + .title = Galluogi Offeryn Llaw +pdfjs-cursor-hand-tool-button-label = Offeryn Llaw +pdfjs-scroll-page-button = + .title = Defnyddio Sgrolio Tudalen +pdfjs-scroll-page-button-label = Sgrolio Tudalen +pdfjs-scroll-vertical-button = + .title = Defnyddio Sgrolio Fertigol +pdfjs-scroll-vertical-button-label = Sgrolio Fertigol +pdfjs-scroll-horizontal-button = + .title = Defnyddio Sgrolio Llorweddol +pdfjs-scroll-horizontal-button-label = Sgrolio Llorweddol +pdfjs-scroll-wrapped-button = + .title = Defnyddio Sgrolio Amlapio +pdfjs-scroll-wrapped-button-label = Sgrolio Amlapio +pdfjs-spread-none-button = + .title = Peidio uno trawsdaleniadau +pdfjs-spread-none-button-label = Dim Trawsdaleniadau +pdfjs-spread-odd-button = + .title = Uno trawsdaleniadau gan gychwyn gyda thudalennau odrif +pdfjs-spread-odd-button-label = Trawsdaleniadau Odrif +pdfjs-spread-even-button = + .title = Uno trawsdaleniadau gan gychwyn gyda thudalennau eilrif +pdfjs-spread-even-button-label = Trawsdaleniadau Eilrif + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Priodweddau Dogfen… +pdfjs-document-properties-button-label = Priodweddau Dogfen… +pdfjs-document-properties-file-name = Enw ffeil: +pdfjs-document-properties-file-size = Maint ffeil: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } beit) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } beit) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } beit) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } beit) +pdfjs-document-properties-title = Teitl: +pdfjs-document-properties-author = Awdur: +pdfjs-document-properties-subject = Pwnc: +pdfjs-document-properties-keywords = Allweddair: +pdfjs-document-properties-creation-date = Dyddiad Creu: +pdfjs-document-properties-modification-date = Dyddiad Addasu: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Crewr: +pdfjs-document-properties-producer = Cynhyrchydd PDF: +pdfjs-document-properties-version = Fersiwn PDF: +pdfjs-document-properties-page-count = Cyfrif Tudalen: +pdfjs-document-properties-page-size = Maint Tudalen: +pdfjs-document-properties-page-size-unit-inches = o fewn +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = portread +pdfjs-document-properties-page-size-orientation-landscape = tirlun +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Llythyr +pdfjs-document-properties-page-size-name-legal = Cyfreithiol + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Golwg Gwe Cyflym: +pdfjs-document-properties-linearized-yes = Iawn +pdfjs-document-properties-linearized-no = Na +pdfjs-document-properties-close-button = Cau + +## Print + +pdfjs-print-progress-message = Paratoi dogfen ar gyfer ei hargraffu… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Diddymu +pdfjs-printing-not-supported = Rhybudd: Nid yw argraffu yn cael ei gynnal yn llawn gan y porwr. +pdfjs-printing-not-ready = Rhybudd: Nid yw'r PDF wedi ei lwytho'n llawn ar gyfer argraffu. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Toglo'r Bar Ochr +pdfjs-toggle-sidebar-notification-button = + .title = Toglo'r Bar Ochr (mae'r ddogfen yn cynnwys amlinelliadau/atodiadau/haenau) +pdfjs-toggle-sidebar-button-label = Toglo'r Bar Ochr +pdfjs-document-outline-button = + .title = Dangos Amlinell Dogfen (clic dwbl i ymestyn/cau pob eitem) +pdfjs-document-outline-button-label = Amlinelliad Dogfen +pdfjs-attachments-button = + .title = Dangos Atodiadau +pdfjs-attachments-button-label = Atodiadau +pdfjs-layers-button = + .title = Dangos Haenau (cliciwch ddwywaith i ailosod yr holl haenau i'r cyflwr rhagosodedig) +pdfjs-layers-button-label = Haenau +pdfjs-thumbs-button = + .title = Dangos Lluniau Bach +pdfjs-thumbs-button-label = Lluniau Bach +pdfjs-current-outline-item-button = + .title = Canfod yr Eitem Amlinellol Gyfredol +pdfjs-current-outline-item-button-label = Yr Eitem Amlinellol Gyfredol +pdfjs-findbar-button = + .title = Canfod yn y Ddogfen +pdfjs-findbar-button-label = Canfod +pdfjs-additional-layers = Haenau Ychwanegol + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Tudalen { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Llun Bach Tudalen { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Canfod + .placeholder = Canfod yn y ddogfen… +pdfjs-find-previous-button = + .title = Canfod enghraifft flaenorol o'r ymadrodd +pdfjs-find-previous-button-label = Blaenorol +pdfjs-find-next-button = + .title = Canfod enghraifft nesaf yr ymadrodd +pdfjs-find-next-button-label = Nesaf +pdfjs-find-highlight-checkbox = Amlygu Popeth +pdfjs-find-match-case-checkbox-label = Cydweddu Maint +pdfjs-find-match-diacritics-checkbox-label = Diacritigau Cyfatebol +pdfjs-find-entire-word-checkbox-label = Geiriau Cyfan +pdfjs-find-reached-top = Wedi cyrraedd brig y dudalen, parhau o'r gwaelod +pdfjs-find-reached-bottom = Wedi cyrraedd diwedd y dudalen, parhau o'r brig +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [zero] { $current } o { $total } cydweddiadau + [one] { $current } o { $total } cydweddiad + [two] { $current } o { $total } gydweddiad + [few] { $current } o { $total } cydweddiad + [many] { $current } o { $total } chydweddiad + *[other] { $current } o { $total } cydweddiad + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [zero] Mwy nag { $limit } cydweddiadau + [one] Mwy nag { $limit } cydweddiad + [two] Mwy nag { $limit } gydweddiad + [few] Mwy nag { $limit } cydweddiad + [many] Mwy nag { $limit } chydweddiad + *[other] Mwy nag { $limit } cydweddiad + } +pdfjs-find-not-found = Heb ganfod ymadrodd + +## Predefined zoom values + +pdfjs-page-scale-width = Lled Tudalen +pdfjs-page-scale-fit = Ffit Tudalen +pdfjs-page-scale-auto = Chwyddo Awtomatig +pdfjs-page-scale-actual = Maint Gwirioneddol +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Tudalen { $page } + +## Loading indicator messages + +pdfjs-loading-error = Digwyddodd gwall wrth lwytho'r PDF. +pdfjs-invalid-file-error = Ffeil PDF annilys neu llwgr. +pdfjs-missing-file-error = Ffeil PDF coll. +pdfjs-unexpected-response-error = Ymateb annisgwyl gan y gweinydd. +pdfjs-rendering-error = Digwyddodd gwall wrth adeiladu'r dudalen. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [Anodiad { $type } ] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Rhowch gyfrinair i agor y PDF. +pdfjs-password-invalid = Cyfrinair annilys. Ceisiwch eto. +pdfjs-password-ok-button = Iawn +pdfjs-password-cancel-button = Diddymu +pdfjs-web-fonts-disabled = Ffontiau gwe wedi eu hanalluogi: methu defnyddio ffontiau PDF mewnblanedig. + +## Editing + +pdfjs-editor-free-text-button = + .title = Testun +pdfjs-editor-free-text-button-label = Testun +pdfjs-editor-ink-button = + .title = Lluniadu +pdfjs-editor-ink-button-label = Lluniadu +pdfjs-editor-stamp-button = + .title = Ychwanegu neu olygu delweddau +pdfjs-editor-stamp-button-label = Ychwanegu neu olygu delweddau +pdfjs-editor-highlight-button = + .title = Amlygu +pdfjs-editor-highlight-button-label = Amlygu +pdfjs-highlight-floating-button1 = + .title = Amlygu + .aria-label = Amlygu +pdfjs-highlight-floating-button-label = Amlygu + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Dileu lluniad +pdfjs-editor-remove-freetext-button = + .title = Dileu testun +pdfjs-editor-remove-stamp-button = + .title = Dileu delwedd +pdfjs-editor-remove-highlight-button = + .title = Tynnu amlygiad + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Lliw +pdfjs-editor-free-text-size-input = Maint +pdfjs-editor-ink-color-input = Lliw +pdfjs-editor-ink-thickness-input = Trwch +pdfjs-editor-ink-opacity-input = Didreiddedd +pdfjs-editor-stamp-add-image-button = + .title = Ychwanegu delwedd +pdfjs-editor-stamp-add-image-button-label = Ychwanegu delwedd +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Trwch +pdfjs-editor-free-highlight-thickness-title = + .title = Newid trwch wrth amlygu eitemau heblaw testun +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = Golygydd Testun + .default-content = Cychwyn teipio… +pdfjs-free-text = + .aria-label = Golygydd Testun +pdfjs-free-text-default-content = Cychwyn teipio… +pdfjs-ink = + .aria-label = Golygydd Lluniadu +pdfjs-ink-canvas = + .aria-label = Delwedd wedi'i chreu gan ddefnyddwyr + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = Testun amgen (alt) +pdfjs-editor-alt-text-edit-button = + .aria-label = Golygu testun amgen +pdfjs-editor-alt-text-edit-button-label = Golygu testun amgen +pdfjs-editor-alt-text-dialog-label = Dewisiadau +pdfjs-editor-alt-text-dialog-description = Mae testun amgen (testun alt) yn helpu pan na all pobl weld y ddelwedd neu pan nad yw'n llwytho. +pdfjs-editor-alt-text-add-description-label = Ychwanegu disgrifiad +pdfjs-editor-alt-text-add-description-description = Anelwch at 1-2 frawddeg sy'n disgrifio'r pwnc, y cefndir neu'r gweithredoedd. +pdfjs-editor-alt-text-mark-decorative-label = Marcio fel addurniadol +pdfjs-editor-alt-text-mark-decorative-description = Mae'n cael ei ddefnyddio ar gyfer delweddau addurniadol, fel borderi neu farciau dŵr. +pdfjs-editor-alt-text-cancel-button = Diddymu +pdfjs-editor-alt-text-save-button = Cadw +pdfjs-editor-alt-text-decorative-tooltip = Marcio fel addurniadol +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = Er enghraifft, “Mae dyn ifanc yn eistedd wrth fwrdd i fwyta pryd bwyd” +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = Testun amgen (alt) + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Y gornel chwith uchaf — newid maint +pdfjs-editor-resizer-label-top-middle = Canol uchaf - newid maint +pdfjs-editor-resizer-label-top-right = Y gornel dde uchaf - newid maint +pdfjs-editor-resizer-label-middle-right = De canol - newid maint +pdfjs-editor-resizer-label-bottom-right = Y gornel dde isaf — newid maint +pdfjs-editor-resizer-label-bottom-middle = Canol gwaelod — newid maint +pdfjs-editor-resizer-label-bottom-left = Y gornel chwith isaf — newid maint +pdfjs-editor-resizer-label-middle-left = Chwith canol — newid maint +pdfjs-editor-resizer-top-left = + .aria-label = Y gornel chwith uchaf — newid maint +pdfjs-editor-resizer-top-middle = + .aria-label = Canol uchaf - newid maint +pdfjs-editor-resizer-top-right = + .aria-label = Y gornel dde uchaf - newid maint +pdfjs-editor-resizer-middle-right = + .aria-label = De canol - newid maint +pdfjs-editor-resizer-bottom-right = + .aria-label = Y gornel dde isaf — newid maint +pdfjs-editor-resizer-bottom-middle = + .aria-label = Canol gwaelod — newid maint +pdfjs-editor-resizer-bottom-left = + .aria-label = Y gornel chwith isaf — newid maint +pdfjs-editor-resizer-middle-left = + .aria-label = Chwith canol — newid maint + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Lliw amlygu +pdfjs-editor-colorpicker-button = + .title = Newid lliw +pdfjs-editor-colorpicker-dropdown = + .aria-label = Dewisiadau lliw +pdfjs-editor-colorpicker-yellow = + .title = Melyn +pdfjs-editor-colorpicker-green = + .title = Gwyrdd +pdfjs-editor-colorpicker-blue = + .title = Glas +pdfjs-editor-colorpicker-pink = + .title = Pinc +pdfjs-editor-colorpicker-red = + .title = Coch + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Dangos y cyfan +pdfjs-editor-highlight-show-all-button = + .title = Dangos y cyfan + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = Golygu testun amgen (disgrifiad o ddelwedd) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = Ychwanegwch destun amgen (disgrifiad delwedd) +pdfjs-editor-new-alt-text-textarea = + .placeholder = Ysgrifennwch eich disgrifiad yma… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = Disgrifiad byr ar gyfer pobl sydd ddim yn gallu gweld y ddelwedd neu pan nad yw'r ddelwedd yn llwytho. +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = Cafodd y testun amgen hwn ei greu'n awtomatig a gall fod yn anghywir. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Rhagor +pdfjs-editor-new-alt-text-create-automatically-button-label = Creu testun amgen yn awtomatig +pdfjs-editor-new-alt-text-not-now-button = Nid nawr +pdfjs-editor-new-alt-text-error-title = Methu â chreu testun amgen yn awtomatig +pdfjs-editor-new-alt-text-error-description = Ysgrifennwch eich testun amgen eich hun neu ceisiwch eto yn nes ymlaen. +pdfjs-editor-new-alt-text-error-close-button = Cau +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = Wrthi'n llwytho i lawr model AI testun amgen ( { $downloadedSize } o { $totalSize } MB) + .aria-valuetext = Wrthi'n llwytho i lawr model AI testun amgen ( { $downloadedSize } o { $totalSize } MB) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = Ychwanegwyd testun amgen +pdfjs-editor-new-alt-text-added-button-label = Ychwanegwyd testun amgen +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = Testun amgen coll +pdfjs-editor-new-alt-text-missing-button-label = Testun amgen coll +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = Adolygu'r testun amgen +pdfjs-editor-new-alt-text-to-review-button-label = Adolygu'r testun amgen +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Crëwyd yn awtomatig: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = Gosodiadau testun amgen delwedd +pdfjs-image-alt-text-settings-button-label = Gosodiadau testun amgen delwedd +pdfjs-editor-alt-text-settings-dialog-label = Gosodiadau testun amgen delwedd +pdfjs-editor-alt-text-settings-automatic-title = Testun amgen awtomatig +pdfjs-editor-alt-text-settings-create-model-button-label = Creu testun amgen yn awtomatig +pdfjs-editor-alt-text-settings-create-model-description = Yn awgrymu disgrifiadau i helpu pobl sydd ddim yn gallu gweld y ddelwedd neu pan nad yw'r ddelwedd yn llwytho. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = Model AI testun amgen ({ $totalSize } MB) +pdfjs-editor-alt-text-settings-ai-model-description = Yn rhedeg yn lleol ar eich dyfais fel bod eich data'n aros yn breifat. Yn ofynnol ar gyfer testun amgen awtomatig. +pdfjs-editor-alt-text-settings-delete-model-button = Dileu +pdfjs-editor-alt-text-settings-download-model-button = Llwytho i Lawr +pdfjs-editor-alt-text-settings-downloading-model-button = Wrthi'n llwytho i lawr… +pdfjs-editor-alt-text-settings-editor-title = Golygydd testun amgen +pdfjs-editor-alt-text-settings-show-dialog-button-label = Dangoswch y golygydd testun amgen yn syth wrth ychwanegu delwedd +pdfjs-editor-alt-text-settings-show-dialog-description = Yn eich helpu i wneud yn siŵr bod gan eich holl ddelweddau destun amgen. +pdfjs-editor-alt-text-settings-close-button = Cau + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = Tynnwyd yr amlygu +pdfjs-editor-undo-bar-message-freetext = Tynnwyd y testun +pdfjs-editor-undo-bar-message-ink = Tynnwyd y lluniad +pdfjs-editor-undo-bar-message-stamp = Tynnwyd y ddelwedd +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = + { $count -> + [zero] { $count } anodiad wedi'u tynnu + [one] { $count } anodiad wedi'i dynnu + [two] { $count } anodiad wedi'u tynnu + [few] { $count } anodiad wedi'u tynnu + [many] { $count } anodiad wedi'u tynnu + *[other] { $count } anodiad wedi'u tynnu + } +pdfjs-editor-undo-bar-undo-button = + .title = Dadwneud +pdfjs-editor-undo-bar-undo-button-label = Dadwneud +pdfjs-editor-undo-bar-close-button = + .title = Cau +pdfjs-editor-undo-bar-close-button-label = Cau diff --git a/public/pdfjs/web/locale/da/viewer.ftl b/public/pdfjs/web/locale/da/viewer.ftl new file mode 100644 index 0000000..224eac1 --- /dev/null +++ b/public/pdfjs/web/locale/da/viewer.ftl @@ -0,0 +1,515 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Forrige side +pdfjs-previous-button-label = Forrige +pdfjs-next-button = + .title = Næste side +pdfjs-next-button-label = Næste +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Side +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = af { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } af { $pagesCount }) +pdfjs-zoom-out-button = + .title = Zoom ud +pdfjs-zoom-out-button-label = Zoom ud +pdfjs-zoom-in-button = + .title = Zoom ind +pdfjs-zoom-in-button-label = Zoom ind +pdfjs-zoom-select = + .title = Zoom +pdfjs-presentation-mode-button = + .title = Skift til fuldskærmsvisning +pdfjs-presentation-mode-button-label = Fuldskærmsvisning +pdfjs-open-file-button = + .title = Åbn fil +pdfjs-open-file-button-label = Åbn +pdfjs-print-button = + .title = Udskriv +pdfjs-print-button-label = Udskriv +pdfjs-save-button = + .title = Gem +pdfjs-save-button-label = Gem +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Hent +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Hent +pdfjs-bookmark-button = + .title = Aktuel side (vis URL fra den aktuelle side) +pdfjs-bookmark-button-label = Aktuel side + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Funktioner +pdfjs-tools-button-label = Funktioner +pdfjs-first-page-button = + .title = Gå til første side +pdfjs-first-page-button-label = Gå til første side +pdfjs-last-page-button = + .title = Gå til sidste side +pdfjs-last-page-button-label = Gå til sidste side +pdfjs-page-rotate-cw-button = + .title = Roter med uret +pdfjs-page-rotate-cw-button-label = Roter med uret +pdfjs-page-rotate-ccw-button = + .title = Roter mod uret +pdfjs-page-rotate-ccw-button-label = Roter mod uret +pdfjs-cursor-text-select-tool-button = + .title = Aktiver markeringsværktøj +pdfjs-cursor-text-select-tool-button-label = Markeringsværktøj +pdfjs-cursor-hand-tool-button = + .title = Aktiver håndværktøj +pdfjs-cursor-hand-tool-button-label = Håndværktøj +pdfjs-scroll-page-button = + .title = Brug sidescrolling +pdfjs-scroll-page-button-label = Sidescrolling +pdfjs-scroll-vertical-button = + .title = Brug vertikal scrolling +pdfjs-scroll-vertical-button-label = Vertikal scrolling +pdfjs-scroll-horizontal-button = + .title = Brug horisontal scrolling +pdfjs-scroll-horizontal-button-label = Horisontal scrolling +pdfjs-scroll-wrapped-button = + .title = Brug ombrudt scrolling +pdfjs-scroll-wrapped-button-label = Ombrudt scrolling +pdfjs-spread-none-button = + .title = Vis enkeltsider +pdfjs-spread-none-button-label = Enkeltsider +pdfjs-spread-odd-button = + .title = Vis opslag med ulige sidenumre til venstre +pdfjs-spread-odd-button-label = Opslag med forside +pdfjs-spread-even-button = + .title = Vis opslag med lige sidenumre til venstre +pdfjs-spread-even-button-label = Opslag uden forside + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Dokumentegenskaber… +pdfjs-document-properties-button-label = Dokumentegenskaber… +pdfjs-document-properties-file-name = Filnavn: +pdfjs-document-properties-file-size = Filstørrelse: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } bytes) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } bytes) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bytes) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bytes) +pdfjs-document-properties-title = Titel: +pdfjs-document-properties-author = Forfatter: +pdfjs-document-properties-subject = Emne: +pdfjs-document-properties-keywords = Nøgleord: +pdfjs-document-properties-creation-date = Oprettet: +pdfjs-document-properties-modification-date = Redigeret: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Program: +pdfjs-document-properties-producer = PDF-producent: +pdfjs-document-properties-version = PDF-version: +pdfjs-document-properties-page-count = Antal sider: +pdfjs-document-properties-page-size = Sidestørrelse: +pdfjs-document-properties-page-size-unit-inches = in +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = stående +pdfjs-document-properties-page-size-orientation-landscape = liggende +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Letter +pdfjs-document-properties-page-size-name-legal = Legal + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Hurtig web-visning: +pdfjs-document-properties-linearized-yes = Ja +pdfjs-document-properties-linearized-no = Nej +pdfjs-document-properties-close-button = Luk + +## Print + +pdfjs-print-progress-message = Forbereder dokument til udskrivning… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Annuller +pdfjs-printing-not-supported = Advarsel: Udskrivning er ikke fuldt understøttet af browseren. +pdfjs-printing-not-ready = Advarsel: PDF-filen er ikke fuldt indlæst til udskrivning. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Slå sidepanel til eller fra +pdfjs-toggle-sidebar-notification-button = + .title = Slå sidepanel til eller fra (dokumentet indeholder disposition/vedhæftede filer/lag) +pdfjs-toggle-sidebar-button-label = Slå sidepanel til eller fra +pdfjs-document-outline-button = + .title = Vis dokumentets disposition (dobbeltklik for at udvide/sammenfolde alle elementer) +pdfjs-document-outline-button-label = Dokument-disposition +pdfjs-attachments-button = + .title = Vis vedhæftede filer +pdfjs-attachments-button-label = Vedhæftede filer +pdfjs-layers-button = + .title = Vis lag (dobbeltklik for at nulstille alle lag til standard-tilstanden) +pdfjs-layers-button-label = Lag +pdfjs-thumbs-button = + .title = Vis miniaturer +pdfjs-thumbs-button-label = Miniaturer +pdfjs-current-outline-item-button = + .title = Find det aktuelle dispositions-element +pdfjs-current-outline-item-button-label = Aktuelt dispositions-element +pdfjs-findbar-button = + .title = Find i dokument +pdfjs-findbar-button-label = Find +pdfjs-additional-layers = Yderligere lag + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Side { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Miniature af side { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Find + .placeholder = Find i dokument… +pdfjs-find-previous-button = + .title = Find den forrige forekomst +pdfjs-find-previous-button-label = Forrige +pdfjs-find-next-button = + .title = Find den næste forekomst +pdfjs-find-next-button-label = Næste +pdfjs-find-highlight-checkbox = Fremhæv alle +pdfjs-find-match-case-checkbox-label = Forskel på store og små bogstaver +pdfjs-find-match-diacritics-checkbox-label = Diakritiske tegn +pdfjs-find-entire-word-checkbox-label = Hele ord +pdfjs-find-reached-top = Toppen af siden blev nået, fortsatte fra bunden +pdfjs-find-reached-bottom = Bunden af siden blev nået, fortsatte fra toppen +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] { $current } af { $total } forekomst + *[other] { $current } af { $total } forekomster + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] Mere end { $limit } forekomst + *[other] Mere end { $limit } forekomster + } +pdfjs-find-not-found = Der blev ikke fundet noget + +## Predefined zoom values + +pdfjs-page-scale-width = Sidebredde +pdfjs-page-scale-fit = Tilpas til side +pdfjs-page-scale-auto = Automatisk zoom +pdfjs-page-scale-actual = Faktisk størrelse +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Side { $page } + +## Loading indicator messages + +pdfjs-loading-error = Der opstod en fejl ved indlæsning af PDF-filen. +pdfjs-invalid-file-error = PDF-filen er ugyldig eller ødelagt. +pdfjs-missing-file-error = Manglende PDF-fil. +pdfjs-unexpected-response-error = Uventet svar fra serveren. +pdfjs-rendering-error = Der opstod en fejl ved generering af siden. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type }kommentar] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Angiv adgangskode til at åbne denne PDF-fil. +pdfjs-password-invalid = Ugyldig adgangskode. Prøv igen. +pdfjs-password-ok-button = OK +pdfjs-password-cancel-button = Fortryd +pdfjs-web-fonts-disabled = Webskrifttyper er deaktiverede. De indlejrede skrifttyper i PDF-filen kan ikke anvendes. + +## Editing + +pdfjs-editor-free-text-button = + .title = Tekst +pdfjs-editor-free-text-button-label = Tekst +pdfjs-editor-ink-button = + .title = Tegn +pdfjs-editor-ink-button-label = Tegn +pdfjs-editor-stamp-button = + .title = Tilføj eller rediger billeder +pdfjs-editor-stamp-button-label = Tilføj eller rediger billeder +pdfjs-editor-highlight-button = + .title = Fremhæv +pdfjs-editor-highlight-button-label = Fremhæv +pdfjs-highlight-floating-button1 = + .title = Fremhæv + .aria-label = Fremhæv +pdfjs-highlight-floating-button-label = Fremhæv + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Fjern tegning +pdfjs-editor-remove-freetext-button = + .title = Fjern tekst +pdfjs-editor-remove-stamp-button = + .title = Fjern billede +pdfjs-editor-remove-highlight-button = + .title = Fjern fremhævning + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Farve +pdfjs-editor-free-text-size-input = Størrelse +pdfjs-editor-ink-color-input = Farve +pdfjs-editor-ink-thickness-input = Tykkelse +pdfjs-editor-ink-opacity-input = Uigennemsigtighed +pdfjs-editor-stamp-add-image-button = + .title = Tilføj billede +pdfjs-editor-stamp-add-image-button-label = Tilføj billede +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Tykkelse +pdfjs-editor-free-highlight-thickness-title = + .title = Ændr tykkelse, når andre elementer end tekst fremhæves +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = Teksteditor + .default-content = Begynd at skrive… +pdfjs-free-text = + .aria-label = Teksteditor +pdfjs-free-text-default-content = Begynd at skrive… +pdfjs-ink = + .aria-label = Tegnings-editor +pdfjs-ink-canvas = + .aria-label = Brugeroprettet billede + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = Alternativ tekst +pdfjs-editor-alt-text-edit-button = + .aria-label = Rediger alternativ tekst +pdfjs-editor-alt-text-edit-button-label = Rediger alternativ tekst +pdfjs-editor-alt-text-dialog-label = Vælg en indstilling +pdfjs-editor-alt-text-dialog-description = Alternativ tekst hjælper folk, som ikke kan se billedet eller når det ikke indlæses. +pdfjs-editor-alt-text-add-description-label = Tilføj en beskrivelse +pdfjs-editor-alt-text-add-description-description = Sigt efter en eller to sætninger, der beskriver emnet, omgivelserne eller handlinger. +pdfjs-editor-alt-text-mark-decorative-label = Marker som dekorativ +pdfjs-editor-alt-text-mark-decorative-description = Dette bruges for dekorative billeder som rammer eller vandmærker. +pdfjs-editor-alt-text-cancel-button = Annuller +pdfjs-editor-alt-text-save-button = Gem +pdfjs-editor-alt-text-decorative-tooltip = Markeret som dekorativ +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = For eksempel: "En ung mand sætter sig ved et bord for at spise et måltid mad" +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = Alternativ tekst + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Øverste venstre hjørne — tilpas størrelse +pdfjs-editor-resizer-label-top-middle = Øverste i midten — tilpas størrelse +pdfjs-editor-resizer-label-top-right = Øverste højre hjørne — tilpas størrelse +pdfjs-editor-resizer-label-middle-right = Midten til højre — tilpas størrelse +pdfjs-editor-resizer-label-bottom-right = Nederste højre hjørne - tilpas størrelse +pdfjs-editor-resizer-label-bottom-middle = Nederst i midten - tilpas størrelse +pdfjs-editor-resizer-label-bottom-left = Nederste venstre hjørne - tilpas størrelse +pdfjs-editor-resizer-label-middle-left = Midten til venstre — tilpas størrelse +pdfjs-editor-resizer-top-left = + .aria-label = Øverste venstre hjørne — tilpas størrelse +pdfjs-editor-resizer-top-middle = + .aria-label = Øverste i midten — tilpas størrelse +pdfjs-editor-resizer-top-right = + .aria-label = Øverste højre hjørne — tilpas størrelse +pdfjs-editor-resizer-middle-right = + .aria-label = Midten til højre — tilpas størrelse +pdfjs-editor-resizer-bottom-right = + .aria-label = Nederste højre hjørne - tilpas størrelse +pdfjs-editor-resizer-bottom-middle = + .aria-label = Nederst i midten - tilpas størrelse +pdfjs-editor-resizer-bottom-left = + .aria-label = Nederste venstre hjørne - tilpas størrelse +pdfjs-editor-resizer-middle-left = + .aria-label = Midten til venstre — tilpas størrelse + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Fremhævningsfarve +pdfjs-editor-colorpicker-button = + .title = Skift farve +pdfjs-editor-colorpicker-dropdown = + .aria-label = Farvevalg +pdfjs-editor-colorpicker-yellow = + .title = Gul +pdfjs-editor-colorpicker-green = + .title = Grøn +pdfjs-editor-colorpicker-blue = + .title = Blå +pdfjs-editor-colorpicker-pink = + .title = Lyserød +pdfjs-editor-colorpicker-red = + .title = Rød + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Vis alle +pdfjs-editor-highlight-show-all-button = + .title = Vis alle + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = Rediger alternativ tekst (billedbeskrivelse) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = Tilføj alternativ tekst (billedbeskrivelse) +pdfjs-editor-new-alt-text-textarea = + .placeholder = Skriv din beskrivelse her... +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = Kort beskrivelse til personer, der ikke kan se billedet, eller når billedet ikke indlæses. +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = Denne alternative tekst blev oprettet automatisk og kan være upræcis. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Læs mere +pdfjs-editor-new-alt-text-create-automatically-button-label = Opret alternativ tekst automatisk +pdfjs-editor-new-alt-text-not-now-button = Ikke nu +pdfjs-editor-new-alt-text-error-title = Kunne ikke oprette alternativ tekst automatisk +pdfjs-editor-new-alt-text-error-description = Skriv din egen alternative tekst, eller prøv igen senere. +pdfjs-editor-new-alt-text-error-close-button = Luk +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = Henter alternativ tekst AI-model ({ $downloadedSize } af { $totalSize } MB) + .aria-valuetext = Henter alternativ tekst AI-model ({ $downloadedSize } af { $totalSize } MB) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = Alternativ tekst tilføjet +pdfjs-editor-new-alt-text-added-button-label = Alternativ tekst tilføjet +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = Mangler alternativ tekst +pdfjs-editor-new-alt-text-missing-button-label = Mangler alternativ tekst +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = Gennemgå alternativ tekst +pdfjs-editor-new-alt-text-to-review-button-label = Gennemgå alternativ tekst +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Oprettet automatisk: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = Indstillinger for alternativ tekst til billeder +pdfjs-image-alt-text-settings-button-label = Indstillinger for alternativ tekst til billeder +pdfjs-editor-alt-text-settings-dialog-label = Indstillinger for alternativ tekst til billeder +pdfjs-editor-alt-text-settings-automatic-title = Automatisk alternativ tekst +pdfjs-editor-alt-text-settings-create-model-button-label = Opret alternativ tekst automatisk +pdfjs-editor-alt-text-settings-create-model-description = Foreslår beskrivelser for at hjælpe folk, der ikke kan se billedet, eller når billedet ikke indlæses. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = AI-model til at oprette alternative tekster ({ $totalSize } MB) +pdfjs-editor-alt-text-settings-ai-model-description = Kører lokalt på din enhed, så dine data forbliver private. Påkrævet for at anvende automatisk alternativ tekst. +pdfjs-editor-alt-text-settings-delete-model-button = Slet +pdfjs-editor-alt-text-settings-download-model-button = Hent +pdfjs-editor-alt-text-settings-downloading-model-button = Henter… +pdfjs-editor-alt-text-settings-editor-title = Redigering af alternativ tekst +pdfjs-editor-alt-text-settings-show-dialog-button-label = Vis redigering af alternativ tekst med det samme, når et billede tilføjes +pdfjs-editor-alt-text-settings-show-dialog-description = Hjælper dig med at sikre, at alle dine billeder har alternativ tekst. +pdfjs-editor-alt-text-settings-close-button = Luk + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = Fremhævning fjernet +pdfjs-editor-undo-bar-message-freetext = Tekst fjernet +pdfjs-editor-undo-bar-message-ink = Tegning fjernet +pdfjs-editor-undo-bar-message-stamp = Billede fjernet +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = + { $count -> + [one] { $count } kommentar fjernet + *[other] { $count } kommentarer fjernet + } +pdfjs-editor-undo-bar-undo-button = + .title = Fortryd +pdfjs-editor-undo-bar-undo-button-label = Fortryd +pdfjs-editor-undo-bar-close-button = + .title = Luk +pdfjs-editor-undo-bar-close-button-label = Luk diff --git a/public/pdfjs/web/locale/de/viewer.ftl b/public/pdfjs/web/locale/de/viewer.ftl new file mode 100644 index 0000000..ee26455 --- /dev/null +++ b/public/pdfjs/web/locale/de/viewer.ftl @@ -0,0 +1,515 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Eine Seite zurück +pdfjs-previous-button-label = Zurück +pdfjs-next-button = + .title = Eine Seite vor +pdfjs-next-button-label = Vor +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Seite +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = von { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } von { $pagesCount }) +pdfjs-zoom-out-button = + .title = Verkleinern +pdfjs-zoom-out-button-label = Verkleinern +pdfjs-zoom-in-button = + .title = Vergrößern +pdfjs-zoom-in-button-label = Vergrößern +pdfjs-zoom-select = + .title = Zoom +pdfjs-presentation-mode-button = + .title = In Präsentationsmodus wechseln +pdfjs-presentation-mode-button-label = Präsentationsmodus +pdfjs-open-file-button = + .title = Datei öffnen +pdfjs-open-file-button-label = Öffnen +pdfjs-print-button = + .title = Drucken +pdfjs-print-button-label = Drucken +pdfjs-save-button = + .title = Speichern +pdfjs-save-button-label = Speichern +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Herunterladen +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Herunterladen +pdfjs-bookmark-button = + .title = Aktuelle Seite (URL von aktueller Seite anzeigen) +pdfjs-bookmark-button-label = Aktuelle Seite + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Werkzeuge +pdfjs-tools-button-label = Werkzeuge +pdfjs-first-page-button = + .title = Erste Seite anzeigen +pdfjs-first-page-button-label = Erste Seite anzeigen +pdfjs-last-page-button = + .title = Letzte Seite anzeigen +pdfjs-last-page-button-label = Letzte Seite anzeigen +pdfjs-page-rotate-cw-button = + .title = Im Uhrzeigersinn drehen +pdfjs-page-rotate-cw-button-label = Im Uhrzeigersinn drehen +pdfjs-page-rotate-ccw-button = + .title = Gegen Uhrzeigersinn drehen +pdfjs-page-rotate-ccw-button-label = Gegen Uhrzeigersinn drehen +pdfjs-cursor-text-select-tool-button = + .title = Textauswahl-Werkzeug aktivieren +pdfjs-cursor-text-select-tool-button-label = Textauswahl-Werkzeug +pdfjs-cursor-hand-tool-button = + .title = Hand-Werkzeug aktivieren +pdfjs-cursor-hand-tool-button-label = Hand-Werkzeug +pdfjs-scroll-page-button = + .title = Seiten einzeln anordnen +pdfjs-scroll-page-button-label = Einzelseitenanordnung +pdfjs-scroll-vertical-button = + .title = Seiten übereinander anordnen +pdfjs-scroll-vertical-button-label = Vertikale Seitenanordnung +pdfjs-scroll-horizontal-button = + .title = Seiten nebeneinander anordnen +pdfjs-scroll-horizontal-button-label = Horizontale Seitenanordnung +pdfjs-scroll-wrapped-button = + .title = Seiten neben- und übereinander anordnen, abhängig vom Platz +pdfjs-scroll-wrapped-button-label = Kombinierte Seitenanordnung +pdfjs-spread-none-button = + .title = Seiten nicht nebeneinander anzeigen +pdfjs-spread-none-button-label = Einzelne Seiten +pdfjs-spread-odd-button = + .title = Jeweils eine ungerade und eine gerade Seite nebeneinander anzeigen +pdfjs-spread-odd-button-label = Ungerade + gerade Seite +pdfjs-spread-even-button = + .title = Jeweils eine gerade und eine ungerade Seite nebeneinander anzeigen +pdfjs-spread-even-button-label = Gerade + ungerade Seite + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Dokumenteigenschaften +pdfjs-document-properties-button-label = Dokumenteigenschaften… +pdfjs-document-properties-file-name = Dateiname: +pdfjs-document-properties-file-size = Dateigröße: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } Bytes) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } Bytes) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } Bytes) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } Bytes) +pdfjs-document-properties-title = Titel: +pdfjs-document-properties-author = Autor: +pdfjs-document-properties-subject = Thema: +pdfjs-document-properties-keywords = Stichwörter: +pdfjs-document-properties-creation-date = Erstelldatum: +pdfjs-document-properties-modification-date = Bearbeitungsdatum: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date } { $time } +pdfjs-document-properties-creator = Anwendung: +pdfjs-document-properties-producer = PDF erstellt mit: +pdfjs-document-properties-version = PDF-Version: +pdfjs-document-properties-page-count = Seitenzahl: +pdfjs-document-properties-page-size = Seitengröße: +pdfjs-document-properties-page-size-unit-inches = Zoll +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = Hochformat +pdfjs-document-properties-page-size-orientation-landscape = Querformat +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Letter +pdfjs-document-properties-page-size-name-legal = Legal + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Schnelle Webanzeige: +pdfjs-document-properties-linearized-yes = Ja +pdfjs-document-properties-linearized-no = Nein +pdfjs-document-properties-close-button = Schließen + +## Print + +pdfjs-print-progress-message = Dokument wird für Drucken vorbereitet… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress } % +pdfjs-print-progress-close-button = Abbrechen +pdfjs-printing-not-supported = Warnung: Die Drucken-Funktion wird durch diesen Browser nicht vollständig unterstützt. +pdfjs-printing-not-ready = Warnung: Die PDF-Datei ist nicht vollständig geladen, dies ist für das Drucken aber empfohlen. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Sidebar umschalten +pdfjs-toggle-sidebar-notification-button = + .title = Sidebar umschalten (Dokument enthält Dokumentstruktur/Anhänge/Ebenen) +pdfjs-toggle-sidebar-button-label = Sidebar umschalten +pdfjs-document-outline-button = + .title = Dokumentstruktur anzeigen (Doppelklicken, um alle Einträge aus- bzw. einzuklappen) +pdfjs-document-outline-button-label = Dokumentstruktur +pdfjs-attachments-button = + .title = Anhänge anzeigen +pdfjs-attachments-button-label = Anhänge +pdfjs-layers-button = + .title = Ebenen anzeigen (Doppelklicken, um alle Ebenen auf den Standardzustand zurückzusetzen) +pdfjs-layers-button-label = Ebenen +pdfjs-thumbs-button = + .title = Miniaturansichten anzeigen +pdfjs-thumbs-button-label = Miniaturansichten +pdfjs-current-outline-item-button = + .title = Aktuelles Struktur-Element finden +pdfjs-current-outline-item-button-label = Aktuelles Struktur-Element +pdfjs-findbar-button = + .title = Dokument durchsuchen +pdfjs-findbar-button-label = Suchen +pdfjs-additional-layers = Zusätzliche Ebenen + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Seite { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Miniaturansicht von Seite { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Suchen + .placeholder = Dokument durchsuchen… +pdfjs-find-previous-button = + .title = Vorheriges Vorkommen des Suchbegriffs finden +pdfjs-find-previous-button-label = Zurück +pdfjs-find-next-button = + .title = Nächstes Vorkommen des Suchbegriffs finden +pdfjs-find-next-button-label = Weiter +pdfjs-find-highlight-checkbox = Alle hervorheben +pdfjs-find-match-case-checkbox-label = Groß-/Kleinschreibung beachten +pdfjs-find-match-diacritics-checkbox-label = Akzente +pdfjs-find-entire-word-checkbox-label = Ganze Wörter +pdfjs-find-reached-top = Anfang des Dokuments erreicht, fahre am Ende fort +pdfjs-find-reached-bottom = Ende des Dokuments erreicht, fahre am Anfang fort +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] { $current } von { $total } Übereinstimmung + *[other] { $current } von { $total } Übereinstimmungen + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] Mehr als { $limit } Übereinstimmung + *[other] Mehr als { $limit } Übereinstimmungen + } +pdfjs-find-not-found = Suchbegriff nicht gefunden + +## Predefined zoom values + +pdfjs-page-scale-width = Seitenbreite +pdfjs-page-scale-fit = Seitengröße +pdfjs-page-scale-auto = Automatischer Zoom +pdfjs-page-scale-actual = Originalgröße +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale } % + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Seite { $page } + +## Loading indicator messages + +pdfjs-loading-error = Beim Laden der PDF-Datei trat ein Fehler auf. +pdfjs-invalid-file-error = Ungültige oder beschädigte PDF-Datei +pdfjs-missing-file-error = Fehlende PDF-Datei +pdfjs-unexpected-response-error = Unerwartete Antwort des Servers +pdfjs-rendering-error = Beim Darstellen der Seite trat ein Fehler auf. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [Anlage: { $type }] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Geben Sie zum Öffnen der PDF-Datei deren Passwort ein. +pdfjs-password-invalid = Falsches Passwort. Bitte versuchen Sie es erneut. +pdfjs-password-ok-button = OK +pdfjs-password-cancel-button = Abbrechen +pdfjs-web-fonts-disabled = Web-Schriftarten sind deaktiviert: Eingebettete PDF-Schriftarten konnten nicht geladen werden. + +## Editing + +pdfjs-editor-free-text-button = + .title = Text +pdfjs-editor-free-text-button-label = Text +pdfjs-editor-ink-button = + .title = Zeichnen +pdfjs-editor-ink-button-label = Zeichnen +pdfjs-editor-stamp-button = + .title = Grafiken hinzufügen oder bearbeiten +pdfjs-editor-stamp-button-label = Grafiken hinzufügen oder bearbeiten +pdfjs-editor-highlight-button = + .title = Hervorheben +pdfjs-editor-highlight-button-label = Hervorheben +pdfjs-highlight-floating-button1 = + .title = Hervorheben + .aria-label = Hervorheben +pdfjs-highlight-floating-button-label = Hervorheben + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Zeichnung entfernen +pdfjs-editor-remove-freetext-button = + .title = Text entfernen +pdfjs-editor-remove-stamp-button = + .title = Grafik entfernen +pdfjs-editor-remove-highlight-button = + .title = Hervorhebung entfernen + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Farbe +pdfjs-editor-free-text-size-input = Größe +pdfjs-editor-ink-color-input = Farbe +pdfjs-editor-ink-thickness-input = Linienstärke +pdfjs-editor-ink-opacity-input = Deckkraft +pdfjs-editor-stamp-add-image-button = + .title = Grafik hinzufügen +pdfjs-editor-stamp-add-image-button-label = Grafik hinzufügen +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Linienstärke +pdfjs-editor-free-highlight-thickness-title = + .title = Linienstärke beim Hervorheben anderer Elemente als Text ändern +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = Texteditor + .default-content = Schreiben beginnen… +pdfjs-free-text = + .aria-label = Texteditor +pdfjs-free-text-default-content = Schreiben beginnen… +pdfjs-ink = + .aria-label = Zeichnungseditor +pdfjs-ink-canvas = + .aria-label = Vom Benutzer erstelltes Bild + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = Alternativ-Text +pdfjs-editor-alt-text-edit-button = + .aria-label = Alternativ-Text bearbeiten +pdfjs-editor-alt-text-edit-button-label = Alternativ-Text bearbeiten +pdfjs-editor-alt-text-dialog-label = Option wählen +pdfjs-editor-alt-text-dialog-description = Alt-Text (Alternativtext) hilft, wenn Personen die Grafik nicht sehen können oder wenn sie nicht geladen wird. +pdfjs-editor-alt-text-add-description-label = Beschreibung hinzufügen +pdfjs-editor-alt-text-add-description-description = Ziel sind 1-2 Sätze, die das Thema, das Szenario oder Aktionen beschreiben. +pdfjs-editor-alt-text-mark-decorative-label = Als dekorativ markieren +pdfjs-editor-alt-text-mark-decorative-description = Dies wird für Ziergrafiken wie Ränder oder Wasserzeichen verwendet. +pdfjs-editor-alt-text-cancel-button = Abbrechen +pdfjs-editor-alt-text-save-button = Speichern +pdfjs-editor-alt-text-decorative-tooltip = Als dekorativ markiert +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = Zum Beispiel: "Ein junger Mann setzt sich an einen Tisch, um zu essen." +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = Alternativ-Text + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Linke obere Ecke - Größe ändern +pdfjs-editor-resizer-label-top-middle = Oben mittig - Größe ändern +pdfjs-editor-resizer-label-top-right = Rechts oben - Größe ändern +pdfjs-editor-resizer-label-middle-right = Mitte rechts - Größe ändern +pdfjs-editor-resizer-label-bottom-right = Rechte untere Ecke - Größe ändern +pdfjs-editor-resizer-label-bottom-middle = Unten mittig - Größe ändern +pdfjs-editor-resizer-label-bottom-left = Linke untere Ecke - Größe ändern +pdfjs-editor-resizer-label-middle-left = Mitte links - Größe ändern +pdfjs-editor-resizer-top-left = + .aria-label = Linke obere Ecke - Größe ändern +pdfjs-editor-resizer-top-middle = + .aria-label = Oben mittig - Größe ändern +pdfjs-editor-resizer-top-right = + .aria-label = Rechts oben - Größe ändern +pdfjs-editor-resizer-middle-right = + .aria-label = Mitte rechts - Größe ändern +pdfjs-editor-resizer-bottom-right = + .aria-label = Rechte untere Ecke - Größe ändern +pdfjs-editor-resizer-bottom-middle = + .aria-label = Unten mittig - Größe ändern +pdfjs-editor-resizer-bottom-left = + .aria-label = Linke untere Ecke - Größe ändern +pdfjs-editor-resizer-middle-left = + .aria-label = Mitte links - Größe ändern + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Hervorhebungsfarbe +pdfjs-editor-colorpicker-button = + .title = Farbe ändern +pdfjs-editor-colorpicker-dropdown = + .aria-label = Farbauswahl +pdfjs-editor-colorpicker-yellow = + .title = Gelb +pdfjs-editor-colorpicker-green = + .title = Grün +pdfjs-editor-colorpicker-blue = + .title = Blau +pdfjs-editor-colorpicker-pink = + .title = Pink +pdfjs-editor-colorpicker-red = + .title = Rot + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Alle anzeigen +pdfjs-editor-highlight-show-all-button = + .title = Alle anzeigen + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = Alternativ-Text (Grafikbeschreibung) bearbeiten +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = Alternativ-Text (Grafikbeschreibung) hinzufügen +pdfjs-editor-new-alt-text-textarea = + .placeholder = Schreiben Sie Ihre Beschreibung hier… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = Kurze Beschreibung für Personen, die die Grafik nicht sehen können, oder wenn die Grafik nicht geladen wird. +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = Dieser Alternativ-Text wurde automatisch erstellt und könnte ungenau sein. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Weitere Informationen +pdfjs-editor-new-alt-text-create-automatically-button-label = Alternativ-Text automatisch erstellen +pdfjs-editor-new-alt-text-not-now-button = Nicht jetzt +pdfjs-editor-new-alt-text-error-title = Alternativ-Text konnte nicht automatisch erstellt werden +pdfjs-editor-new-alt-text-error-description = Bitte schreiben Sie Ihren eigenen Alternativ-Text oder versuchen Sie es später erneut. +pdfjs-editor-new-alt-text-error-close-button = Schließen +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = Alternativ-Text-KI-Modell wird heruntergeladen ({ $downloadedSize } von { $totalSize } MB) + .aria-valuetext = Alternativ-Text-KI-Modell wird heruntergeladen ({ $downloadedSize } von { $totalSize } MB) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = Alternativ-Text hinzugefügt +pdfjs-editor-new-alt-text-added-button-label = Alternativ-Text hinzugefügt +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = Fehlender Alternativ-Text +pdfjs-editor-new-alt-text-missing-button-label = Fehlender Alternativ-Text +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = Alternativ-Text überprüfen +pdfjs-editor-new-alt-text-to-review-button-label = Alternativ-Text überprüfen +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Automatisch erstellt: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = Alternativ-Text-Einstellungen für Grafiken +pdfjs-image-alt-text-settings-button-label = Alternativ-Text-Einstellungen für Grafiken +pdfjs-editor-alt-text-settings-dialog-label = Alternativ-Text-Einstellungen für Grafiken +pdfjs-editor-alt-text-settings-automatic-title = Automatischer Alternativ-Text +pdfjs-editor-alt-text-settings-create-model-button-label = Alternativ-Text automatisch erstellen +pdfjs-editor-alt-text-settings-create-model-description = Schlägt Beschreibungen vor, um Personen zu helfen, die die Grafik nicht sehen können, oder wenn die Grafik nicht geladen wird. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = Alternativ-Text-KI-Modell ({ $totalSize } MB) +pdfjs-editor-alt-text-settings-ai-model-description = Wird lokal auf Ihrem Gerät ausgeführt, sodass Ihre Daten privat bleiben. Erforderlich für automatischen Alternativ-Text. +pdfjs-editor-alt-text-settings-delete-model-button = Löschen +pdfjs-editor-alt-text-settings-download-model-button = Herunterladen +pdfjs-editor-alt-text-settings-downloading-model-button = Wird heruntergeladen… +pdfjs-editor-alt-text-settings-editor-title = Alternativ-Texteditor +pdfjs-editor-alt-text-settings-show-dialog-button-label = Alternativ-Texteditor beim Hinzufügen einer Grafik anzeigen +pdfjs-editor-alt-text-settings-show-dialog-description = Hilft Ihnen, sicherzustellen, dass alle Ihre Grafiken Alternativ-Text haben. +pdfjs-editor-alt-text-settings-close-button = Schließen + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = Hervorhebung entfernt +pdfjs-editor-undo-bar-message-freetext = Text entfernt +pdfjs-editor-undo-bar-message-ink = Zeichnung entfernt +pdfjs-editor-undo-bar-message-stamp = Grafik entfernt +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = + { $count -> + [one] { $count } Anmerkung entfernt + *[other] { $count } Anmerkungen entfernt + } +pdfjs-editor-undo-bar-undo-button = + .title = Rückgängig +pdfjs-editor-undo-bar-undo-button-label = Rückgängig +pdfjs-editor-undo-bar-close-button = + .title = Schließen +pdfjs-editor-undo-bar-close-button-label = Schließen diff --git a/public/pdfjs/web/locale/dsb/viewer.ftl b/public/pdfjs/web/locale/dsb/viewer.ftl new file mode 100644 index 0000000..24ac94f --- /dev/null +++ b/public/pdfjs/web/locale/dsb/viewer.ftl @@ -0,0 +1,521 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Pjerwjejšny bok +pdfjs-previous-button-label = Slědk +pdfjs-next-button = + .title = Pśiducy bok +pdfjs-next-button-label = Dalej +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Bok +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = z { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } z { $pagesCount }) +pdfjs-zoom-out-button = + .title = Pómjeńšyś +pdfjs-zoom-out-button-label = Pómjeńšyś +pdfjs-zoom-in-button = + .title = Pówětšyś +pdfjs-zoom-in-button-label = Pówětšyś +pdfjs-zoom-select = + .title = Skalěrowanje +pdfjs-presentation-mode-button = + .title = Do prezentaciskego modusa pśejś +pdfjs-presentation-mode-button-label = Prezentaciski modus +pdfjs-open-file-button = + .title = Dataju wócyniś +pdfjs-open-file-button-label = Wócyniś +pdfjs-print-button = + .title = Śišćaś +pdfjs-print-button-label = Śišćaś +pdfjs-save-button = + .title = Składowaś +pdfjs-save-button-label = Składowaś +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Ześěgnuś +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Ześěgnuś +pdfjs-bookmark-button = + .title = Aktualny bok (URL z aktualnego boka pokazaś) +pdfjs-bookmark-button-label = Aktualny bok + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Rědy +pdfjs-tools-button-label = Rědy +pdfjs-first-page-button = + .title = K prědnemu bokoju +pdfjs-first-page-button-label = K prědnemu bokoju +pdfjs-last-page-button = + .title = K slědnemu bokoju +pdfjs-last-page-button-label = K slědnemu bokoju +pdfjs-page-rotate-cw-button = + .title = Wobwjertnuś ako špěra źo +pdfjs-page-rotate-cw-button-label = Wobwjertnuś ako špěra źo +pdfjs-page-rotate-ccw-button = + .title = Wobwjertnuś nawopaki ako špěra źo +pdfjs-page-rotate-ccw-button-label = Wobwjertnuś nawopaki ako špěra źo +pdfjs-cursor-text-select-tool-button = + .title = Rěd za wuběranje teksta zmóžniś +pdfjs-cursor-text-select-tool-button-label = Rěd za wuběranje teksta +pdfjs-cursor-hand-tool-button = + .title = Rucny rěd zmóžniś +pdfjs-cursor-hand-tool-button-label = Rucny rěd +pdfjs-scroll-page-button = + .title = Kulanje boka wužywaś +pdfjs-scroll-page-button-label = Kulanje boka +pdfjs-scroll-vertical-button = + .title = Wertikalne suwanje wužywaś +pdfjs-scroll-vertical-button-label = Wertikalne suwanje +pdfjs-scroll-horizontal-button = + .title = Horicontalne suwanje wužywaś +pdfjs-scroll-horizontal-button-label = Horicontalne suwanje +pdfjs-scroll-wrapped-button = + .title = Pózlažke suwanje wužywaś +pdfjs-scroll-wrapped-button-label = Pózlažke suwanje +pdfjs-spread-none-button = + .title = Boki njezwězaś +pdfjs-spread-none-button-label = Žeden dwójny bok +pdfjs-spread-odd-button = + .title = Boki zachopinajucy z njerownymi bokami zwězaś +pdfjs-spread-odd-button-label = Njerowne boki +pdfjs-spread-even-button = + .title = Boki zachopinajucy z rownymi bokami zwězaś +pdfjs-spread-even-button-label = Rowne boki + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Dokumentowe kakosći… +pdfjs-document-properties-button-label = Dokumentowe kakosći… +pdfjs-document-properties-file-name = Mě dataje: +pdfjs-document-properties-file-size = Wjelikosć dataje: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } bajtow) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } bajtow) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bajtow) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bajtow) +pdfjs-document-properties-title = Titel: +pdfjs-document-properties-author = Awtor: +pdfjs-document-properties-subject = Tema: +pdfjs-document-properties-keywords = Klucowe słowa: +pdfjs-document-properties-creation-date = Datum napóranja: +pdfjs-document-properties-modification-date = Datum změny: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Awtor: +pdfjs-document-properties-producer = PDF-gótowaŕ: +pdfjs-document-properties-version = PDF-wersija: +pdfjs-document-properties-page-count = Licba bokow: +pdfjs-document-properties-page-size = Wjelikosć boka: +pdfjs-document-properties-page-size-unit-inches = col +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = wusoki format +pdfjs-document-properties-page-size-orientation-landscape = prěcny format +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Letter +pdfjs-document-properties-page-size-name-legal = Legal + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Fast Web View: +pdfjs-document-properties-linearized-yes = Jo +pdfjs-document-properties-linearized-no = Ně +pdfjs-document-properties-close-button = Zacyniś + +## Print + +pdfjs-print-progress-message = Dokument pśigótujo se za śišćanje… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Pśetergnuś +pdfjs-printing-not-supported = Warnowanje: Śišćanje njepódpěra se połnje pśez toś ten wobglědowak. +pdfjs-printing-not-ready = Warnowanje: PDF njejo se za śišćanje dopołnje zacytał. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Bócnicu pokazaś/schowaś +pdfjs-toggle-sidebar-notification-button = + .title = Bocnicu pśešaltowaś (dokument rozrědowanje/pśipiski/warstwy wopśimujo) +pdfjs-toggle-sidebar-button-label = Bócnicu pokazaś/schowaś +pdfjs-document-outline-button = + .title = Dokumentowe naraźenje pokazaś (dwójne kliknjenje, aby se wšykne zapiski pokazali/schowali) +pdfjs-document-outline-button-label = Dokumentowa struktura +pdfjs-attachments-button = + .title = Pśidanki pokazaś +pdfjs-attachments-button-label = Pśidanki +pdfjs-layers-button = + .title = Warstwy pokazaś (klikniśo dwójcy, aby wšykne warstwy na standardny staw slědk stajił) +pdfjs-layers-button-label = Warstwy +pdfjs-thumbs-button = + .title = Miniatury pokazaś +pdfjs-thumbs-button-label = Miniatury +pdfjs-current-outline-item-button = + .title = Aktualny rozrědowański zapisk pytaś +pdfjs-current-outline-item-button-label = Aktualny rozrědowański zapisk +pdfjs-findbar-button = + .title = W dokumenśe pytaś +pdfjs-findbar-button-label = Pytaś +pdfjs-additional-layers = Dalšne warstwy + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Bok { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Miniatura boka { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Pytaś + .placeholder = W dokumenśe pytaś… +pdfjs-find-previous-button = + .title = Pjerwjejšne wustupowanje pytańskego wuraza pytaś +pdfjs-find-previous-button-label = Slědk +pdfjs-find-next-button = + .title = Pśidujuce wustupowanje pytańskego wuraza pytaś +pdfjs-find-next-button-label = Dalej +pdfjs-find-highlight-checkbox = Wšykne wuzwignuś +pdfjs-find-match-case-checkbox-label = Na wjelikopisanje źiwaś +pdfjs-find-match-diacritics-checkbox-label = Diakritiske znamuška wužywaś +pdfjs-find-entire-word-checkbox-label = Cełe słowa +pdfjs-find-reached-top = Zachopjeńk dokumenta dostany, pókšacujo se z kóńcom +pdfjs-find-reached-bottom = Kóńc dokumenta dostany, pókšacujo se ze zachopjeńkom +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] { $current } z { $total } wótpowědnika + [two] { $current } z { $total } wótpowědnikowu + [few] { $current } z { $total } wótpowědnikow + *[other] { $current } z { $total } wótpowědnikow + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] Wušej { $limit } wótpowědnik + [two] Wušej { $limit } wótpowědnika + [few] Wušej { $limit } wótpowědniki + *[other] Wušej { $limit } wótpowědniki + } +pdfjs-find-not-found = Pytański wuraz njejo se namakał + +## Predefined zoom values + +pdfjs-page-scale-width = Šyrokosć boka +pdfjs-page-scale-fit = Wjelikosć boka +pdfjs-page-scale-auto = Awtomatiske skalěrowanje +pdfjs-page-scale-actual = Aktualna wjelikosć +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Bok { $page } + +## Loading indicator messages + +pdfjs-loading-error = Pśi zacytowanju PDF jo zmólka nastała. +pdfjs-invalid-file-error = Njepłaśiwa abo wobškóźona PDF-dataja. +pdfjs-missing-file-error = Felujuca PDF-dataja. +pdfjs-unexpected-response-error = Njewócakane serwerowe wótegrono. +pdfjs-rendering-error = Pśi zwobraznjanju boka jo zmólka nastała. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [Typ pśipiskow: { $type }] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Zapódajśo gronidło, aby PDF-dataju wócynił. +pdfjs-password-invalid = Njepłaśiwe gronidło. Pšosym wopytajśo hyšći raz. +pdfjs-password-ok-button = W pórěźe +pdfjs-password-cancel-button = Pśetergnuś +pdfjs-web-fonts-disabled = Webpisma su znjemóžnjone: njejo móžno, zasajźone PDF-pisma wužywaś. + +## Editing + +pdfjs-editor-free-text-button = + .title = Tekst +pdfjs-editor-free-text-button-label = Tekst +pdfjs-editor-ink-button = + .title = Kresliś +pdfjs-editor-ink-button-label = Kresliś +pdfjs-editor-stamp-button = + .title = Wobraze pśidaś abo wobźěłaś +pdfjs-editor-stamp-button-label = Wobraze pśidaś abo wobźěłaś +pdfjs-editor-highlight-button = + .title = Wuzwignuś +pdfjs-editor-highlight-button-label = Wuzwignuś +pdfjs-highlight-floating-button1 = + .title = Wuzwignuś + .aria-label = Wuzwignuś +pdfjs-highlight-floating-button-label = Wuzwignuś + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Kreslanku wótwónoźeś +pdfjs-editor-remove-freetext-button = + .title = Tekst wótwónoźeś +pdfjs-editor-remove-stamp-button = + .title = Wobraz wótwónoźeś +pdfjs-editor-remove-highlight-button = + .title = Wuzwignjenje wótpóraś + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Barwa +pdfjs-editor-free-text-size-input = Wjelikosć +pdfjs-editor-ink-color-input = Barwa +pdfjs-editor-ink-thickness-input = Tłustosć +pdfjs-editor-ink-opacity-input = Opacita +pdfjs-editor-stamp-add-image-button = + .title = Wobraz pśidaś +pdfjs-editor-stamp-add-image-button-label = Wobraz pśidaś +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Tłustosć +pdfjs-editor-free-highlight-thickness-title = + .title = Tłustosć změniś, gaž se zapiski wuzwiguju, kótarež tekst njejsu +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = Tekstowy editor + .default-content = Zachopśo pisaś … +pdfjs-free-text = + .aria-label = Tekstowy editor +pdfjs-free-text-default-content = Zachopśo pisaś… +pdfjs-ink = + .aria-label = Kresleński editor +pdfjs-ink-canvas = + .aria-label = Wobraz napórany wót wužywarja + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = Alternatiwny tekst +pdfjs-editor-alt-text-edit-button = + .aria-label = Alternatiwny tekst wobźěłaś +pdfjs-editor-alt-text-edit-button-label = Alternatiwny tekst wobźěłaś +pdfjs-editor-alt-text-dialog-label = Nastajenje wubraś +pdfjs-editor-alt-text-dialog-description = Alternatiwny tekst pomaga, gaž luźe njamógu wobraz wiźeś abo gaž se wobraz njezacytajo. +pdfjs-editor-alt-text-add-description-label = Wopisanje pśidaś +pdfjs-editor-alt-text-add-description-description = Pišćo 1 sadu abo 2 saźe, kótarejž temu, nastajenje abo akcije wopisujotej. +pdfjs-editor-alt-text-mark-decorative-label = Ako dekoratiwny markěrowaś +pdfjs-editor-alt-text-mark-decorative-description = To se za pyšnjece wobraze wužywa, na pśikład ramiki abo wódowe znamjenja. +pdfjs-editor-alt-text-cancel-button = Pśetergnuś +pdfjs-editor-alt-text-save-button = Składowaś +pdfjs-editor-alt-text-decorative-tooltip = Ako dekoratiwny markěrowany +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = Na pśikład, „Młody muski za blidom sejźi, aby jěź jědł“ +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = Alternatiwny tekst + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Górjejce nalěwo – wjelikosć změniś +pdfjs-editor-resizer-label-top-middle = Górjejce wesrjejź – wjelikosć změniś +pdfjs-editor-resizer-label-top-right = Górjejce napšawo – wjelikosć změniś +pdfjs-editor-resizer-label-middle-right = Wesrjejź napšawo – wjelikosć změniś +pdfjs-editor-resizer-label-bottom-right = Dołojce napšawo – wjelikosć změniś +pdfjs-editor-resizer-label-bottom-middle = Dołojce wesrjejź – wjelikosć změniś +pdfjs-editor-resizer-label-bottom-left = Dołojce nalěwo – wjelikosć změniś +pdfjs-editor-resizer-label-middle-left = Wesrjejź nalěwo – wjelikosć změniś +pdfjs-editor-resizer-top-left = + .aria-label = Górjejce nalěwo – wjelikosć změniś +pdfjs-editor-resizer-top-middle = + .aria-label = Górjejce wesrjejź – wjelikosć změniś +pdfjs-editor-resizer-top-right = + .aria-label = Górjejce napšawo – wjelikosć změniś +pdfjs-editor-resizer-middle-right = + .aria-label = Wesrjejź napšawo – wjelikosć změniś +pdfjs-editor-resizer-bottom-right = + .aria-label = Dołojce napšawo – wjelikosć změniś +pdfjs-editor-resizer-bottom-middle = + .aria-label = Dołojce wesrjejź – wjelikosć změniś +pdfjs-editor-resizer-bottom-left = + .aria-label = Dołojce nalěwo – wjelikosć změniś +pdfjs-editor-resizer-middle-left = + .aria-label = Wesrjejź nalěwo – wjelikosć změniś + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Barwa wuzwignjenja +pdfjs-editor-colorpicker-button = + .title = Barwu změniś +pdfjs-editor-colorpicker-dropdown = + .aria-label = Wuběrk barwow +pdfjs-editor-colorpicker-yellow = + .title = Žołty +pdfjs-editor-colorpicker-green = + .title = Zeleny +pdfjs-editor-colorpicker-blue = + .title = Módry +pdfjs-editor-colorpicker-pink = + .title = Pink +pdfjs-editor-colorpicker-red = + .title = Cerwjeny + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Wšykne pokazaś +pdfjs-editor-highlight-show-all-button = + .title = Wšykne pokazaś + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = Alternatiwny tekst wobźěłaś (wobrazowe wopisanje) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = Alternatiwny tekst pśidaś (wobrazowe wopisanje) +pdfjs-editor-new-alt-text-textarea = + .placeholder = Pišćo how swójo wopisanje… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = Krotke wopisanje za luźe, kótarež njamóžośo wobraz wiźeś abo gaž se wobraz njezacytajo. +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = Toś ten alternatiwny tekst jo se awtomatiski napórał a jo snaź njedokradny. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Dalšne informacije +pdfjs-editor-new-alt-text-create-automatically-button-label = Alternatiwny tekst awtomatiski napóraś +pdfjs-editor-new-alt-text-not-now-button = Nic něnto +pdfjs-editor-new-alt-text-error-title = Alternatiwny tekst njedajo se awtomatiski napóraś +pdfjs-editor-new-alt-text-error-description = Pšosym pišćo swój alternatiwny tekst abo wopytajśo pózdźej hyšći raz. +pdfjs-editor-new-alt-text-error-close-button = Zacyniś +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = Model KI za alternatiwny tekst se ześěgujo ({ $downloadedSize } z { $totalSize } MB) + .aria-valuetext = Model KI za alternatiwny tekst se ześěgujo ({ $downloadedSize } z { $totalSize } MB) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = Alternatiwny tekst jo se pśidał +pdfjs-editor-new-alt-text-added-button-label = Alternatiwny tekst jo se pśidał +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = Alternatiwny tekst felujo +pdfjs-editor-new-alt-text-missing-button-label = Alternatiwny tekst felujo +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = Alternatiwny tekst pśeglědowaś +pdfjs-editor-new-alt-text-to-review-button-label = Alternatiwny tekst pśeglědowaś +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Awtomatiski napórany: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = Nastajenja alternatiwnego wobrazowego teksta +pdfjs-image-alt-text-settings-button-label = Nastajenja alternatiwnego wobrazowego teksta +pdfjs-editor-alt-text-settings-dialog-label = Nastajenja alternatiwnego wobrazowego teksta +pdfjs-editor-alt-text-settings-automatic-title = Awtomatiski alternatiwny tekst +pdfjs-editor-alt-text-settings-create-model-button-label = Alternatiwny tekst awtomatiski napóraś +pdfjs-editor-alt-text-settings-create-model-description = Naraźujo wopisanja, aby pomagał ludam, kótarež njamóžośo wobraz wiźeś abo gaž se wobraz njezacytajo. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = Model KI alternatiwnego teksta ({ $totalSize } MB) +pdfjs-editor-alt-text-settings-ai-model-description = Běžy lokalnje na wašom rěźe, aby waše daty priwatne wóstali. Za awtomatiski alternatiwny tekst trjebny. +pdfjs-editor-alt-text-settings-delete-model-button = Lašowaś +pdfjs-editor-alt-text-settings-download-model-button = Ześěgnuś +pdfjs-editor-alt-text-settings-downloading-model-button = Ześěgujo se… +pdfjs-editor-alt-text-settings-editor-title = Editor za alternatiwny tekst +pdfjs-editor-alt-text-settings-show-dialog-button-label = Editor alternatiwnego teksta ned pokazaś, gaž se wobraz pśidawa +pdfjs-editor-alt-text-settings-show-dialog-description = Pomaga, wam wšym swójim wobrazam alternatiwny tekst pśidaś. +pdfjs-editor-alt-text-settings-close-button = Zacyniś + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = Wótwónoźone wuzwignuś +pdfjs-editor-undo-bar-message-freetext = Tekst jo se wótwónoźeł +pdfjs-editor-undo-bar-message-ink = Kreslanka jo se wótwónoźeła +pdfjs-editor-undo-bar-message-stamp = Wobraz jo se wótwónoźeł +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = + { $count -> + [one] { $count } pśipisk jo se wótwónoźeł + [two] { $count } pśipiska stej se wótwónoźełej + [few] { $count } pśipiski su se wótwónoźeli + *[other] { $count } pśipiskow jo se wótwónoźeło + } +pdfjs-editor-undo-bar-undo-button = + .title = Anulěrowaś +pdfjs-editor-undo-bar-undo-button-label = Anulěrowaś +pdfjs-editor-undo-bar-close-button = + .title = Zacyniś +pdfjs-editor-undo-bar-close-button-label = Zacyniś diff --git a/public/pdfjs/web/locale/el/viewer.ftl b/public/pdfjs/web/locale/el/viewer.ftl new file mode 100644 index 0000000..5a04bd8 --- /dev/null +++ b/public/pdfjs/web/locale/el/viewer.ftl @@ -0,0 +1,515 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Προηγούμενη σελίδα +pdfjs-previous-button-label = Προηγούμενη +pdfjs-next-button = + .title = Επόμενη σελίδα +pdfjs-next-button-label = Επόμενη +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Σελίδα +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = από { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } από { $pagesCount }) +pdfjs-zoom-out-button = + .title = Σμίκρυνση +pdfjs-zoom-out-button-label = Σμίκρυνση +pdfjs-zoom-in-button = + .title = Μεγέθυνση +pdfjs-zoom-in-button-label = Μεγέθυνση +pdfjs-zoom-select = + .title = Ζουμ +pdfjs-presentation-mode-button = + .title = Εναλλαγή σε λειτουργία παρουσίασης +pdfjs-presentation-mode-button-label = Λειτουργία παρουσίασης +pdfjs-open-file-button = + .title = Άνοιγμα αρχείου +pdfjs-open-file-button-label = Άνοιγμα +pdfjs-print-button = + .title = Εκτύπωση +pdfjs-print-button-label = Εκτύπωση +pdfjs-save-button = + .title = Αποθήκευση +pdfjs-save-button-label = Αποθήκευση +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Λήψη +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Λήψη +pdfjs-bookmark-button = + .title = Τρέχουσα σελίδα (Προβολή URL από τρέχουσα σελίδα) +pdfjs-bookmark-button-label = Τρέχουσα σελίδα + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Εργαλεία +pdfjs-tools-button-label = Εργαλεία +pdfjs-first-page-button = + .title = Μετάβαση στην πρώτη σελίδα +pdfjs-first-page-button-label = Μετάβαση στην πρώτη σελίδα +pdfjs-last-page-button = + .title = Μετάβαση στην τελευταία σελίδα +pdfjs-last-page-button-label = Μετάβαση στην τελευταία σελίδα +pdfjs-page-rotate-cw-button = + .title = Δεξιόστροφη περιστροφή +pdfjs-page-rotate-cw-button-label = Δεξιόστροφη περιστροφή +pdfjs-page-rotate-ccw-button = + .title = Αριστερόστροφη περιστροφή +pdfjs-page-rotate-ccw-button-label = Αριστερόστροφη περιστροφή +pdfjs-cursor-text-select-tool-button = + .title = Ενεργοποίηση εργαλείου επιλογής κειμένου +pdfjs-cursor-text-select-tool-button-label = Εργαλείο επιλογής κειμένου +pdfjs-cursor-hand-tool-button = + .title = Ενεργοποίηση εργαλείου χεριού +pdfjs-cursor-hand-tool-button-label = Εργαλείο χεριού +pdfjs-scroll-page-button = + .title = Χρήση κύλισης σελίδας +pdfjs-scroll-page-button-label = Κύλιση σελίδας +pdfjs-scroll-vertical-button = + .title = Χρήση κάθετης κύλισης +pdfjs-scroll-vertical-button-label = Κάθετη κύλιση +pdfjs-scroll-horizontal-button = + .title = Χρήση οριζόντιας κύλισης +pdfjs-scroll-horizontal-button-label = Οριζόντια κύλιση +pdfjs-scroll-wrapped-button = + .title = Χρήση κυκλικής κύλισης +pdfjs-scroll-wrapped-button-label = Κυκλική κύλιση +pdfjs-spread-none-button = + .title = Να μη γίνει σύνδεση επεκτάσεων σελίδων +pdfjs-spread-none-button-label = Χωρίς επεκτάσεις +pdfjs-spread-odd-button = + .title = Σύνδεση επεκτάσεων σελίδων ξεκινώντας από τις μονές σελίδες +pdfjs-spread-odd-button-label = Μονές επεκτάσεις +pdfjs-spread-even-button = + .title = Σύνδεση επεκτάσεων σελίδων ξεκινώντας από τις ζυγές σελίδες +pdfjs-spread-even-button-label = Ζυγές επεκτάσεις + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Ιδιότητες εγγράφου… +pdfjs-document-properties-button-label = Ιδιότητες εγγράφου… +pdfjs-document-properties-file-name = Όνομα αρχείου: +pdfjs-document-properties-file-size = Μέγεθος αρχείου: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } bytes) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } bytes) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bytes) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bytes) +pdfjs-document-properties-title = Τίτλος: +pdfjs-document-properties-author = Συγγραφέας: +pdfjs-document-properties-subject = Θέμα: +pdfjs-document-properties-keywords = Λέξεις-κλειδιά: +pdfjs-document-properties-creation-date = Ημερομηνία δημιουργίας: +pdfjs-document-properties-modification-date = Ημερομηνία τροποποίησης: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Δημιουργός: +pdfjs-document-properties-producer = Παραγωγός PDF: +pdfjs-document-properties-version = Έκδοση PDF: +pdfjs-document-properties-page-count = Αριθμός σελίδων: +pdfjs-document-properties-page-size = Μέγεθος σελίδας: +pdfjs-document-properties-page-size-unit-inches = ίντσες +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = κατακόρυφα +pdfjs-document-properties-page-size-orientation-landscape = οριζόντια +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Επιστολή +pdfjs-document-properties-page-size-name-legal = Τύπου Legal + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Ταχεία προβολή ιστού: +pdfjs-document-properties-linearized-yes = Ναι +pdfjs-document-properties-linearized-no = Όχι +pdfjs-document-properties-close-button = Κλείσιμο + +## Print + +pdfjs-print-progress-message = Προετοιμασία του εγγράφου για εκτύπωση… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Ακύρωση +pdfjs-printing-not-supported = Προειδοποίηση: Η εκτύπωση δεν υποστηρίζεται πλήρως από το πρόγραμμα περιήγησης. +pdfjs-printing-not-ready = Προειδοποίηση: Το PDF δεν φορτώθηκε πλήρως για εκτύπωση. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = (Απ)ενεργοποίηση πλαϊνής γραμμής +pdfjs-toggle-sidebar-notification-button = + .title = (Απ)ενεργοποίηση πλαϊνής γραμμής (το έγγραφο περιέχει περίγραμμα/συνημμένα/επίπεδα) +pdfjs-toggle-sidebar-button-label = (Απ)ενεργοποίηση πλαϊνής γραμμής +pdfjs-document-outline-button = + .title = Εμφάνιση διάρθρωσης εγγράφου (διπλό κλικ για ανάπτυξη/σύμπτυξη όλων των στοιχείων) +pdfjs-document-outline-button-label = Διάρθρωση εγγράφου +pdfjs-attachments-button = + .title = Εμφάνιση συνημμένων +pdfjs-attachments-button-label = Συνημμένα +pdfjs-layers-button = + .title = Εμφάνιση επιπέδων (διπλό κλικ για επαναφορά όλων των επιπέδων στην προεπιλεγμένη κατάσταση) +pdfjs-layers-button-label = Επίπεδα +pdfjs-thumbs-button = + .title = Εμφάνιση μικρογραφιών +pdfjs-thumbs-button-label = Μικρογραφίες +pdfjs-current-outline-item-button = + .title = Εύρεση τρέχοντος στοιχείου διάρθρωσης +pdfjs-current-outline-item-button-label = Τρέχον στοιχείο διάρθρωσης +pdfjs-findbar-button = + .title = Εύρεση στο έγγραφο +pdfjs-findbar-button-label = Εύρεση +pdfjs-additional-layers = Επιπρόσθετα επίπεδα + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Σελίδα { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Μικρογραφία σελίδας { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Εύρεση + .placeholder = Εύρεση στο έγγραφο… +pdfjs-find-previous-button = + .title = Εύρεση της προηγούμενης εμφάνισης της φράσης +pdfjs-find-previous-button-label = Προηγούμενο +pdfjs-find-next-button = + .title = Εύρεση της επόμενης εμφάνισης της φράσης +pdfjs-find-next-button-label = Επόμενο +pdfjs-find-highlight-checkbox = Επισήμανση όλων +pdfjs-find-match-case-checkbox-label = Συμφωνία πεζών/κεφαλαίων +pdfjs-find-match-diacritics-checkbox-label = Αντιστοίχιση διακριτικών +pdfjs-find-entire-word-checkbox-label = Ολόκληρες λέξεις +pdfjs-find-reached-top = Φτάσατε στην αρχή του εγγράφου, συνέχεια από το τέλος +pdfjs-find-reached-bottom = Φτάσατε στο τέλος του εγγράφου, συνέχεια από την αρχή +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] { $current } από { $total } αντιστοιχία + *[other] { $current } από { $total } αντιστοιχίες + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] Περισσότερες από { $limit } αντιστοιχία + *[other] Περισσότερες από { $limit } αντιστοιχίες + } +pdfjs-find-not-found = Η φράση δεν βρέθηκε + +## Predefined zoom values + +pdfjs-page-scale-width = Πλάτος σελίδας +pdfjs-page-scale-fit = Μέγεθος σελίδας +pdfjs-page-scale-auto = Αυτόματο ζουμ +pdfjs-page-scale-actual = Πραγματικό μέγεθος +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Σελίδα { $page } + +## Loading indicator messages + +pdfjs-loading-error = Προέκυψε σφάλμα κατά τη φόρτωση του PDF. +pdfjs-invalid-file-error = Μη έγκυρο ή κατεστραμμένο αρχείο PDF. +pdfjs-missing-file-error = Λείπει αρχείο PDF. +pdfjs-unexpected-response-error = Μη αναμενόμενη απόκριση από το διακομιστή. +pdfjs-rendering-error = Προέκυψε σφάλμα κατά την εμφάνιση της σελίδας. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [Σχόλιο «{ $type }»] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Εισαγάγετε τον κωδικό πρόσβασης για να ανοίξετε αυτό το αρχείο PDF. +pdfjs-password-invalid = Μη έγκυρος κωδικός πρόσβασης. Παρακαλώ δοκιμάστε ξανά. +pdfjs-password-ok-button = OK +pdfjs-password-cancel-button = Ακύρωση +pdfjs-web-fonts-disabled = Οι γραμματοσειρές ιστού είναι ανενεργές: δεν είναι δυνατή η χρήση των ενσωματωμένων γραμματοσειρών PDF. + +## Editing + +pdfjs-editor-free-text-button = + .title = Κείμενο +pdfjs-editor-free-text-button-label = Κείμενο +pdfjs-editor-ink-button = + .title = Σχέδιο +pdfjs-editor-ink-button-label = Σχέδιο +pdfjs-editor-stamp-button = + .title = Προσθήκη ή επεξεργασία εικόνων +pdfjs-editor-stamp-button-label = Προσθήκη ή επεξεργασία εικόνων +pdfjs-editor-highlight-button = + .title = Επισήμανση +pdfjs-editor-highlight-button-label = Επισήμανση +pdfjs-highlight-floating-button1 = + .title = Επισήμανση + .aria-label = Επισήμανση +pdfjs-highlight-floating-button-label = Επισήμανση + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Αφαίρεση σχεδίου +pdfjs-editor-remove-freetext-button = + .title = Αφαίρεση κειμένου +pdfjs-editor-remove-stamp-button = + .title = Αφαίρεση εικόνας +pdfjs-editor-remove-highlight-button = + .title = Αφαίρεση επισήμανσης + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Χρώμα +pdfjs-editor-free-text-size-input = Μέγεθος +pdfjs-editor-ink-color-input = Χρώμα +pdfjs-editor-ink-thickness-input = Πάχος +pdfjs-editor-ink-opacity-input = Αδιαφάνεια +pdfjs-editor-stamp-add-image-button = + .title = Προσθήκη εικόνας +pdfjs-editor-stamp-add-image-button-label = Προσθήκη εικόνας +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Πάχος +pdfjs-editor-free-highlight-thickness-title = + .title = Αλλαγή πάχους κατά την επισήμανση στοιχείων εκτός κειμένου +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = Επεξεργασία κειμένου + .default-content = Ξεκινήστε να πληκτρολογείτε… +pdfjs-free-text = + .aria-label = Επεξεργασία κειμένου +pdfjs-free-text-default-content = Ξεκινήστε να πληκτρολογείτε… +pdfjs-ink = + .aria-label = Επεξεργασία σχεδίων +pdfjs-ink-canvas = + .aria-label = Εικόνα από τον χρήστη + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = Εναλλακτικό κείμενο +pdfjs-editor-alt-text-edit-button = + .aria-label = Επεξεργασία εναλλακτικού κειμένου +pdfjs-editor-alt-text-edit-button-label = Επεξεργασία εναλλακτικού κειμένου +pdfjs-editor-alt-text-dialog-label = Διαλέξτε μια επιλογή +pdfjs-editor-alt-text-dialog-description = Το εναλλακτικό κείμενο είναι χρήσιμο όταν οι άνθρωποι δεν μπορούν να δουν την εικόνα ή όταν αυτή δεν φορτώνεται. +pdfjs-editor-alt-text-add-description-label = Προσθήκη περιγραφής +pdfjs-editor-alt-text-add-description-description = Στοχεύστε σε μία ή δύο προτάσεις που περιγράφουν το θέμα, τη ρύθμιση ή τις ενέργειες. +pdfjs-editor-alt-text-mark-decorative-label = Επισήμανση ως διακοσμητικό +pdfjs-editor-alt-text-mark-decorative-description = Χρησιμοποιείται για διακοσμητικές εικόνες, όπως περιγράμματα ή υδατογραφήματα. +pdfjs-editor-alt-text-cancel-button = Ακύρωση +pdfjs-editor-alt-text-save-button = Αποθήκευση +pdfjs-editor-alt-text-decorative-tooltip = Επισημασμένο ως διακοσμητικό +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = Για παράδειγμα, «Ένας νεαρός άνδρας κάθεται σε ένα τραπέζι για να φάει ένα γεύμα» +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = Εναλλακτικό κείμενο + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Επάνω αριστερή γωνία — αλλαγή μεγέθους +pdfjs-editor-resizer-label-top-middle = Μέσο επάνω πλευράς — αλλαγή μεγέθους +pdfjs-editor-resizer-label-top-right = Επάνω δεξιά γωνία — αλλαγή μεγέθους +pdfjs-editor-resizer-label-middle-right = Μέσο δεξιάς πλευράς — αλλαγή μεγέθους +pdfjs-editor-resizer-label-bottom-right = Κάτω δεξιά γωνία — αλλαγή μεγέθους +pdfjs-editor-resizer-label-bottom-middle = Μέσο κάτω πλευράς — αλλαγή μεγέθους +pdfjs-editor-resizer-label-bottom-left = Κάτω αριστερή γωνία — αλλαγή μεγέθους +pdfjs-editor-resizer-label-middle-left = Μέσο αριστερής πλευράς — αλλαγή μεγέθους +pdfjs-editor-resizer-top-left = + .aria-label = Επάνω αριστερή γωνία — αλλαγή μεγέθους +pdfjs-editor-resizer-top-middle = + .aria-label = Μέσο επάνω πλευράς — αλλαγή μεγέθους +pdfjs-editor-resizer-top-right = + .aria-label = Επάνω δεξιά γωνία — αλλαγή μεγέθους +pdfjs-editor-resizer-middle-right = + .aria-label = Μέσο δεξιάς πλευράς — αλλαγή μεγέθους +pdfjs-editor-resizer-bottom-right = + .aria-label = Κάτω δεξιά γωνία — αλλαγή μεγέθους +pdfjs-editor-resizer-bottom-middle = + .aria-label = Μέσο κάτω πλευράς — αλλαγή μεγέθους +pdfjs-editor-resizer-bottom-left = + .aria-label = Κάτω αριστερή γωνία — αλλαγή μεγέθους +pdfjs-editor-resizer-middle-left = + .aria-label = Μέσο αριστερής πλευράς — αλλαγή μεγέθους + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Χρώμα επισήμανσης +pdfjs-editor-colorpicker-button = + .title = Αλλαγή χρώματος +pdfjs-editor-colorpicker-dropdown = + .aria-label = Επιλογές χρωμάτων +pdfjs-editor-colorpicker-yellow = + .title = Κίτρινο +pdfjs-editor-colorpicker-green = + .title = Πράσινο +pdfjs-editor-colorpicker-blue = + .title = Μπλε +pdfjs-editor-colorpicker-pink = + .title = Ροζ +pdfjs-editor-colorpicker-red = + .title = Κόκκινο + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Εμφάνιση όλων +pdfjs-editor-highlight-show-all-button = + .title = Εμφάνιση όλων + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = Επεξεργασία εναλλακτικού κειμένου (περιγραφή εικόνας) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = Προσθήκη εναλλακτικού κειμένου (περιγραφή εικόνας) +pdfjs-editor-new-alt-text-textarea = + .placeholder = Γράψτε την περιγραφή σας εδώ… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = Σύντομη περιγραφή για άτομα που δεν μπορούν να δουν την εικόνα ή όταν η εικόνα δεν φορτώνεται. +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = Αυτό το εναλλακτικό κείμενο δημιουργήθηκε αυτόματα και ενδέχεται να είναι ανακριβές. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Μάθετε περισσότερα +pdfjs-editor-new-alt-text-create-automatically-button-label = Αυτόματη δημιουργία εναλλακτικού κειμένου +pdfjs-editor-new-alt-text-not-now-button = Όχι τώρα +pdfjs-editor-new-alt-text-error-title = Δεν ήταν δυνατή η αυτόματη δημιουργία εναλλακτικού κειμένου +pdfjs-editor-new-alt-text-error-description = Γράψτε το δικό σας εναλλακτικό κείμενο ή δοκιμάστε ξανά αργότερα. +pdfjs-editor-new-alt-text-error-close-button = Κλείσιμο +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = Λήψη μοντέλου AI εναλλακτικού κειμένου ({ $downloadedSize } από { $totalSize } MB) + .aria-valuetext = Λήψη μοντέλου AI εναλλακτικού κειμένου ({ $downloadedSize } από { $totalSize } MB) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = Προστέθηκε εναλλακτικό κείμενο +pdfjs-editor-new-alt-text-added-button-label = Προστέθηκε εναλλακτικό κείμενο +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = Απουσία εναλλακτικού κειμένου +pdfjs-editor-new-alt-text-missing-button-label = Απουσία εναλλακτικού κειμένου +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = Έλεγχος εναλλακτικού κειμένου +pdfjs-editor-new-alt-text-to-review-button-label = Έλεγχος εναλλακτικού κειμένου +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Αυτόματη δημιουργία: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = Ρυθμίσεις εναλλακτικού κειμένου εικόνας +pdfjs-image-alt-text-settings-button-label = Ρυθμίσεις εναλλακτικού κειμένου εικόνας +pdfjs-editor-alt-text-settings-dialog-label = Ρυθμίσεις εναλλακτικού κειμένου εικόνας +pdfjs-editor-alt-text-settings-automatic-title = Αυτόματο εναλλακτικό κείμενο +pdfjs-editor-alt-text-settings-create-model-button-label = Αυτόματη δημιουργία εναλλακτικού κειμένου +pdfjs-editor-alt-text-settings-create-model-description = Προτείνει περιγραφές για άτομα που δεν μπορούν να δουν την εικόνα ή όταν η εικόνα δεν φορτώνεται. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = Μοντέλο AI εναλλακτικού κειμένου ({ $totalSize } MB) +pdfjs-editor-alt-text-settings-ai-model-description = Εκτελείται τοπικά στη συσκευή σας, ώστε τα δεδομένα σας να παραμένουν ιδιωτικά. Απαιτείται για τη δημιουργία του αυτόματου εναλλακτικού κειμένου. +pdfjs-editor-alt-text-settings-delete-model-button = Διαγραφή +pdfjs-editor-alt-text-settings-download-model-button = Λήψη +pdfjs-editor-alt-text-settings-downloading-model-button = Λήψη… +pdfjs-editor-alt-text-settings-editor-title = Επεξεργασία εναλλακτικού κειμένου +pdfjs-editor-alt-text-settings-show-dialog-button-label = Άμεση εμφάνιση της επεξεργασίας εναλλακτικού κειμένου κατά την προσθήκη εικόνας +pdfjs-editor-alt-text-settings-show-dialog-description = Σας βοηθά να βεβαιωθείτε ότι όλες οι εικόνες σας έχουν εναλλακτικό κείμενο. +pdfjs-editor-alt-text-settings-close-button = Κλείσιμο + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = Η επισήμανση αφαιρέθηκε +pdfjs-editor-undo-bar-message-freetext = Το κείμενο αφαιρέθηκε +pdfjs-editor-undo-bar-message-ink = Το σχέδιο αφαιρέθηκε +pdfjs-editor-undo-bar-message-stamp = Η εικόνα αφαιρέθηκε +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = + { $count -> + [one] Αφαιρέθηκε { $count } σχολιασμός + *[other] Αφαιρέθηκαν { $count } σχολιασμοί + } +pdfjs-editor-undo-bar-undo-button = + .title = Αναίρεση +pdfjs-editor-undo-bar-undo-button-label = Αναίρεση +pdfjs-editor-undo-bar-close-button = + .title = Κλείσιμο +pdfjs-editor-undo-bar-close-button-label = Κλείσιμο diff --git a/public/pdfjs/web/locale/en-CA/viewer.ftl b/public/pdfjs/web/locale/en-CA/viewer.ftl new file mode 100644 index 0000000..346e6e8 --- /dev/null +++ b/public/pdfjs/web/locale/en-CA/viewer.ftl @@ -0,0 +1,515 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Previous Page +pdfjs-previous-button-label = Previous +pdfjs-next-button = + .title = Next Page +pdfjs-next-button-label = Next +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Page +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = of { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } of { $pagesCount }) +pdfjs-zoom-out-button = + .title = Zoom Out +pdfjs-zoom-out-button-label = Zoom Out +pdfjs-zoom-in-button = + .title = Zoom In +pdfjs-zoom-in-button-label = Zoom In +pdfjs-zoom-select = + .title = Zoom +pdfjs-presentation-mode-button = + .title = Switch to Presentation Mode +pdfjs-presentation-mode-button-label = Presentation Mode +pdfjs-open-file-button = + .title = Open File +pdfjs-open-file-button-label = Open +pdfjs-print-button = + .title = Print +pdfjs-print-button-label = Print +pdfjs-save-button = + .title = Save +pdfjs-save-button-label = Save +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Download +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Download +pdfjs-bookmark-button = + .title = Current Page (View URL from Current Page) +pdfjs-bookmark-button-label = Current Page + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Tools +pdfjs-tools-button-label = Tools +pdfjs-first-page-button = + .title = Go to First Page +pdfjs-first-page-button-label = Go to First Page +pdfjs-last-page-button = + .title = Go to Last Page +pdfjs-last-page-button-label = Go to Last Page +pdfjs-page-rotate-cw-button = + .title = Rotate Clockwise +pdfjs-page-rotate-cw-button-label = Rotate Clockwise +pdfjs-page-rotate-ccw-button = + .title = Rotate Counterclockwise +pdfjs-page-rotate-ccw-button-label = Rotate Counterclockwise +pdfjs-cursor-text-select-tool-button = + .title = Enable Text Selection Tool +pdfjs-cursor-text-select-tool-button-label = Text Selection Tool +pdfjs-cursor-hand-tool-button = + .title = Enable Hand Tool +pdfjs-cursor-hand-tool-button-label = Hand Tool +pdfjs-scroll-page-button = + .title = Use Page Scrolling +pdfjs-scroll-page-button-label = Page Scrolling +pdfjs-scroll-vertical-button = + .title = Use Vertical Scrolling +pdfjs-scroll-vertical-button-label = Vertical Scrolling +pdfjs-scroll-horizontal-button = + .title = Use Horizontal Scrolling +pdfjs-scroll-horizontal-button-label = Horizontal Scrolling +pdfjs-scroll-wrapped-button = + .title = Use Wrapped Scrolling +pdfjs-scroll-wrapped-button-label = Wrapped Scrolling +pdfjs-spread-none-button = + .title = Do not join page spreads +pdfjs-spread-none-button-label = No Spreads +pdfjs-spread-odd-button = + .title = Join page spreads starting with odd-numbered pages +pdfjs-spread-odd-button-label = Odd Spreads +pdfjs-spread-even-button = + .title = Join page spreads starting with even-numbered pages +pdfjs-spread-even-button-label = Even Spreads + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Document Properties… +pdfjs-document-properties-button-label = Document Properties… +pdfjs-document-properties-file-name = File name: +pdfjs-document-properties-file-size = File size: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } bytes) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } bytes) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } kB ({ $size_b } bytes) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bytes) +pdfjs-document-properties-title = Title: +pdfjs-document-properties-author = Author: +pdfjs-document-properties-subject = Subject: +pdfjs-document-properties-keywords = Keywords: +pdfjs-document-properties-creation-date = Creation Date: +pdfjs-document-properties-modification-date = Modification Date: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Creator: +pdfjs-document-properties-producer = PDF Producer: +pdfjs-document-properties-version = PDF Version: +pdfjs-document-properties-page-count = Page Count: +pdfjs-document-properties-page-size = Page Size: +pdfjs-document-properties-page-size-unit-inches = in +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = portrait +pdfjs-document-properties-page-size-orientation-landscape = landscape +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Letter +pdfjs-document-properties-page-size-name-legal = Legal + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Fast Web View: +pdfjs-document-properties-linearized-yes = Yes +pdfjs-document-properties-linearized-no = No +pdfjs-document-properties-close-button = Close + +## Print + +pdfjs-print-progress-message = Preparing document for printing… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Cancel +pdfjs-printing-not-supported = Warning: Printing is not fully supported by this browser. +pdfjs-printing-not-ready = Warning: The PDF is not fully loaded for printing. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Toggle Sidebar +pdfjs-toggle-sidebar-notification-button = + .title = Toggle Sidebar (document contains outline/attachments/layers) +pdfjs-toggle-sidebar-button-label = Toggle Sidebar +pdfjs-document-outline-button = + .title = Show Document Outline (double-click to expand/collapse all items) +pdfjs-document-outline-button-label = Document Outline +pdfjs-attachments-button = + .title = Show Attachments +pdfjs-attachments-button-label = Attachments +pdfjs-layers-button = + .title = Show Layers (double-click to reset all layers to the default state) +pdfjs-layers-button-label = Layers +pdfjs-thumbs-button = + .title = Show Thumbnails +pdfjs-thumbs-button-label = Thumbnails +pdfjs-current-outline-item-button = + .title = Find Current Outline Item +pdfjs-current-outline-item-button-label = Current Outline Item +pdfjs-findbar-button = + .title = Find in Document +pdfjs-findbar-button-label = Find +pdfjs-additional-layers = Additional Layers + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Page { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Thumbnail of Page { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Find + .placeholder = Find in document… +pdfjs-find-previous-button = + .title = Find the previous occurrence of the phrase +pdfjs-find-previous-button-label = Previous +pdfjs-find-next-button = + .title = Find the next occurrence of the phrase +pdfjs-find-next-button-label = Next +pdfjs-find-highlight-checkbox = Highlight All +pdfjs-find-match-case-checkbox-label = Match Case +pdfjs-find-match-diacritics-checkbox-label = Match Diacritics +pdfjs-find-entire-word-checkbox-label = Whole Words +pdfjs-find-reached-top = Reached top of document, continued from bottom +pdfjs-find-reached-bottom = Reached end of document, continued from top +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] { $current } of { $total } match + *[other] { $current } of { $total } matches + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] More than { $limit } match + *[other] More than { $limit } matches + } +pdfjs-find-not-found = Phrase not found + +## Predefined zoom values + +pdfjs-page-scale-width = Page Width +pdfjs-page-scale-fit = Page Fit +pdfjs-page-scale-auto = Automatic Zoom +pdfjs-page-scale-actual = Actual Size +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Page { $page } + +## Loading indicator messages + +pdfjs-loading-error = An error occurred while loading the PDF. +pdfjs-invalid-file-error = Invalid or corrupted PDF file. +pdfjs-missing-file-error = Missing PDF file. +pdfjs-unexpected-response-error = Unexpected server response. +pdfjs-rendering-error = An error occurred while rendering the page. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } Annotation] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Enter the password to open this PDF file. +pdfjs-password-invalid = Invalid password. Please try again. +pdfjs-password-ok-button = OK +pdfjs-password-cancel-button = Cancel +pdfjs-web-fonts-disabled = Web fonts are disabled: unable to use embedded PDF fonts. + +## Editing + +pdfjs-editor-free-text-button = + .title = Text +pdfjs-editor-free-text-button-label = Text +pdfjs-editor-ink-button = + .title = Draw +pdfjs-editor-ink-button-label = Draw +pdfjs-editor-stamp-button = + .title = Add or edit images +pdfjs-editor-stamp-button-label = Add or edit images +pdfjs-editor-highlight-button = + .title = Highlight +pdfjs-editor-highlight-button-label = Highlight +pdfjs-highlight-floating-button1 = + .title = Highlight + .aria-label = Highlight +pdfjs-highlight-floating-button-label = Highlight + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Remove drawing +pdfjs-editor-remove-freetext-button = + .title = Remove text +pdfjs-editor-remove-stamp-button = + .title = Remove image +pdfjs-editor-remove-highlight-button = + .title = Remove highlight + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Colour +pdfjs-editor-free-text-size-input = Size +pdfjs-editor-ink-color-input = Colour +pdfjs-editor-ink-thickness-input = Thickness +pdfjs-editor-ink-opacity-input = Opacity +pdfjs-editor-stamp-add-image-button = + .title = Add image +pdfjs-editor-stamp-add-image-button-label = Add image +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Thickness +pdfjs-editor-free-highlight-thickness-title = + .title = Change thickness when highlighting items other than text +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = Text Editor + .default-content = Start typing… +pdfjs-free-text = + .aria-label = Text Editor +pdfjs-free-text-default-content = Start typing… +pdfjs-ink = + .aria-label = Draw Editor +pdfjs-ink-canvas = + .aria-label = User-created image + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = Alt text +pdfjs-editor-alt-text-edit-button = + .aria-label = Edit alt text +pdfjs-editor-alt-text-edit-button-label = Edit alt text +pdfjs-editor-alt-text-dialog-label = Choose an option +pdfjs-editor-alt-text-dialog-description = Alt text (alternative text) helps when people can’t see the image or when it doesn’t load. +pdfjs-editor-alt-text-add-description-label = Add a description +pdfjs-editor-alt-text-add-description-description = Aim for 1-2 sentences that describe the subject, setting, or actions. +pdfjs-editor-alt-text-mark-decorative-label = Mark as decorative +pdfjs-editor-alt-text-mark-decorative-description = This is used for ornamental images, like borders or watermarks. +pdfjs-editor-alt-text-cancel-button = Cancel +pdfjs-editor-alt-text-save-button = Save +pdfjs-editor-alt-text-decorative-tooltip = Marked as decorative +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = For example, “A young man sits down at a table to eat a meal” +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = Alt text + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Top left corner — resize +pdfjs-editor-resizer-label-top-middle = Top middle — resize +pdfjs-editor-resizer-label-top-right = Top right corner — resize +pdfjs-editor-resizer-label-middle-right = Middle right — resize +pdfjs-editor-resizer-label-bottom-right = Bottom right corner — resize +pdfjs-editor-resizer-label-bottom-middle = Bottom middle — resize +pdfjs-editor-resizer-label-bottom-left = Bottom left corner — resize +pdfjs-editor-resizer-label-middle-left = Middle left — resize +pdfjs-editor-resizer-top-left = + .aria-label = Top left corner — resize +pdfjs-editor-resizer-top-middle = + .aria-label = Top middle — resize +pdfjs-editor-resizer-top-right = + .aria-label = Top right corner — resize +pdfjs-editor-resizer-middle-right = + .aria-label = Middle right — resize +pdfjs-editor-resizer-bottom-right = + .aria-label = Bottom right corner — resize +pdfjs-editor-resizer-bottom-middle = + .aria-label = Bottom middle — resize +pdfjs-editor-resizer-bottom-left = + .aria-label = Bottom left corner — resize +pdfjs-editor-resizer-middle-left = + .aria-label = Middle left — resize + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Highlight colour +pdfjs-editor-colorpicker-button = + .title = Change colour +pdfjs-editor-colorpicker-dropdown = + .aria-label = Colour choices +pdfjs-editor-colorpicker-yellow = + .title = Yellow +pdfjs-editor-colorpicker-green = + .title = Green +pdfjs-editor-colorpicker-blue = + .title = Blue +pdfjs-editor-colorpicker-pink = + .title = Pink +pdfjs-editor-colorpicker-red = + .title = Red + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Show all +pdfjs-editor-highlight-show-all-button = + .title = Show all + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = Edit alt text (image description) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = Add alt text (image description) +pdfjs-editor-new-alt-text-textarea = + .placeholder = Write your description here… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = Short description for people who can’t see the image or when the image doesn’t load. +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = This alt text was created automatically and may be inaccurate. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Learn more +pdfjs-editor-new-alt-text-create-automatically-button-label = Create alt text automatically +pdfjs-editor-new-alt-text-not-now-button = Not now +pdfjs-editor-new-alt-text-error-title = Couldn’t create alt text automatically +pdfjs-editor-new-alt-text-error-description = Please write your own alt text or try again later. +pdfjs-editor-new-alt-text-error-close-button = Close +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = Downloading alt text AI model ({ $downloadedSize } of { $totalSize } MB) + .aria-valuetext = Downloading alt text AI model ({ $downloadedSize } of { $totalSize } MB) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = Alt text added +pdfjs-editor-new-alt-text-added-button-label = Alt text added +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = Missing alt text +pdfjs-editor-new-alt-text-missing-button-label = Missing alt text +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = Review alt text +pdfjs-editor-new-alt-text-to-review-button-label = Review alt text +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Created automatically: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = Image alt text settings +pdfjs-image-alt-text-settings-button-label = Image alt text settings +pdfjs-editor-alt-text-settings-dialog-label = Image alt text settings +pdfjs-editor-alt-text-settings-automatic-title = Automatic alt text +pdfjs-editor-alt-text-settings-create-model-button-label = Create alt text automatically +pdfjs-editor-alt-text-settings-create-model-description = Suggests descriptions to help people who can’t see the image or when the image doesn’t load. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = Alt text AI model ({ $totalSize } MB) +pdfjs-editor-alt-text-settings-ai-model-description = Runs locally on your device so your data stays private. Required for automatic alt text. +pdfjs-editor-alt-text-settings-delete-model-button = Delete +pdfjs-editor-alt-text-settings-download-model-button = Download +pdfjs-editor-alt-text-settings-downloading-model-button = Downloading… +pdfjs-editor-alt-text-settings-editor-title = Alt text editor +pdfjs-editor-alt-text-settings-show-dialog-button-label = Show alt text editor right away when adding an image +pdfjs-editor-alt-text-settings-show-dialog-description = Helps you make sure all your images have alt text. +pdfjs-editor-alt-text-settings-close-button = Close + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = Highlight removed +pdfjs-editor-undo-bar-message-freetext = Text removed +pdfjs-editor-undo-bar-message-ink = Drawing removed +pdfjs-editor-undo-bar-message-stamp = Image removed +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = + { $count -> + [one] { $count } annotation removed + *[other] { $count } annotations removed + } +pdfjs-editor-undo-bar-undo-button = + .title = Undo +pdfjs-editor-undo-bar-undo-button-label = Undo +pdfjs-editor-undo-bar-close-button = + .title = Close +pdfjs-editor-undo-bar-close-button-label = Close diff --git a/public/pdfjs/web/locale/en-GB/viewer.ftl b/public/pdfjs/web/locale/en-GB/viewer.ftl new file mode 100644 index 0000000..4222f6f --- /dev/null +++ b/public/pdfjs/web/locale/en-GB/viewer.ftl @@ -0,0 +1,515 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Previous Page +pdfjs-previous-button-label = Previous +pdfjs-next-button = + .title = Next Page +pdfjs-next-button-label = Next +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Page +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = of { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } of { $pagesCount }) +pdfjs-zoom-out-button = + .title = Zoom Out +pdfjs-zoom-out-button-label = Zoom Out +pdfjs-zoom-in-button = + .title = Zoom In +pdfjs-zoom-in-button-label = Zoom In +pdfjs-zoom-select = + .title = Zoom +pdfjs-presentation-mode-button = + .title = Switch to Presentation Mode +pdfjs-presentation-mode-button-label = Presentation Mode +pdfjs-open-file-button = + .title = Open File +pdfjs-open-file-button-label = Open +pdfjs-print-button = + .title = Print +pdfjs-print-button-label = Print +pdfjs-save-button = + .title = Save +pdfjs-save-button-label = Save +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Download +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Download +pdfjs-bookmark-button = + .title = Current Page (View URL from Current Page) +pdfjs-bookmark-button-label = Current Page + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Tools +pdfjs-tools-button-label = Tools +pdfjs-first-page-button = + .title = Go to First Page +pdfjs-first-page-button-label = Go to First Page +pdfjs-last-page-button = + .title = Go to Last Page +pdfjs-last-page-button-label = Go to Last Page +pdfjs-page-rotate-cw-button = + .title = Rotate Clockwise +pdfjs-page-rotate-cw-button-label = Rotate Clockwise +pdfjs-page-rotate-ccw-button = + .title = Rotate Anti-Clockwise +pdfjs-page-rotate-ccw-button-label = Rotate Anti-Clockwise +pdfjs-cursor-text-select-tool-button = + .title = Enable Text Selection Tool +pdfjs-cursor-text-select-tool-button-label = Text Selection Tool +pdfjs-cursor-hand-tool-button = + .title = Enable Hand Tool +pdfjs-cursor-hand-tool-button-label = Hand Tool +pdfjs-scroll-page-button = + .title = Use Page Scrolling +pdfjs-scroll-page-button-label = Page Scrolling +pdfjs-scroll-vertical-button = + .title = Use Vertical Scrolling +pdfjs-scroll-vertical-button-label = Vertical Scrolling +pdfjs-scroll-horizontal-button = + .title = Use Horizontal Scrolling +pdfjs-scroll-horizontal-button-label = Horizontal Scrolling +pdfjs-scroll-wrapped-button = + .title = Use Wrapped Scrolling +pdfjs-scroll-wrapped-button-label = Wrapped Scrolling +pdfjs-spread-none-button = + .title = Do not join page spreads +pdfjs-spread-none-button-label = No Spreads +pdfjs-spread-odd-button = + .title = Join page spreads starting with odd-numbered pages +pdfjs-spread-odd-button-label = Odd Spreads +pdfjs-spread-even-button = + .title = Join page spreads starting with even-numbered pages +pdfjs-spread-even-button-label = Even Spreads + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Document Properties… +pdfjs-document-properties-button-label = Document Properties… +pdfjs-document-properties-file-name = File name: +pdfjs-document-properties-file-size = File size: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } kB ({ $b } bytes) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } bytes) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } kB ({ $size_b } bytes) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bytes) +pdfjs-document-properties-title = Title: +pdfjs-document-properties-author = Author: +pdfjs-document-properties-subject = Subject: +pdfjs-document-properties-keywords = Keywords: +pdfjs-document-properties-creation-date = Creation Date: +pdfjs-document-properties-modification-date = Modification Date: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Creator: +pdfjs-document-properties-producer = PDF Producer: +pdfjs-document-properties-version = PDF Version: +pdfjs-document-properties-page-count = Page Count: +pdfjs-document-properties-page-size = Page Size: +pdfjs-document-properties-page-size-unit-inches = in +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = portrait +pdfjs-document-properties-page-size-orientation-landscape = landscape +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Letter +pdfjs-document-properties-page-size-name-legal = Legal + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Fast Web View: +pdfjs-document-properties-linearized-yes = Yes +pdfjs-document-properties-linearized-no = No +pdfjs-document-properties-close-button = Close + +## Print + +pdfjs-print-progress-message = Preparing document for printing… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Cancel +pdfjs-printing-not-supported = Warning: Printing is not fully supported by this browser. +pdfjs-printing-not-ready = Warning: The PDF is not fully loaded for printing. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Toggle Sidebar +pdfjs-toggle-sidebar-notification-button = + .title = Toggle Sidebar (document contains outline/attachments/layers) +pdfjs-toggle-sidebar-button-label = Toggle Sidebar +pdfjs-document-outline-button = + .title = Show Document Outline (double-click to expand/collapse all items) +pdfjs-document-outline-button-label = Document Outline +pdfjs-attachments-button = + .title = Show Attachments +pdfjs-attachments-button-label = Attachments +pdfjs-layers-button = + .title = Show Layers (double-click to reset all layers to the default state) +pdfjs-layers-button-label = Layers +pdfjs-thumbs-button = + .title = Show Thumbnails +pdfjs-thumbs-button-label = Thumbnails +pdfjs-current-outline-item-button = + .title = Find Current Outline Item +pdfjs-current-outline-item-button-label = Current Outline Item +pdfjs-findbar-button = + .title = Find in Document +pdfjs-findbar-button-label = Find +pdfjs-additional-layers = Additional Layers + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Page { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Thumbnail of Page { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Find + .placeholder = Find in document… +pdfjs-find-previous-button = + .title = Find the previous occurrence of the phrase +pdfjs-find-previous-button-label = Previous +pdfjs-find-next-button = + .title = Find the next occurrence of the phrase +pdfjs-find-next-button-label = Next +pdfjs-find-highlight-checkbox = Highlight All +pdfjs-find-match-case-checkbox-label = Match Case +pdfjs-find-match-diacritics-checkbox-label = Match Diacritics +pdfjs-find-entire-word-checkbox-label = Whole Words +pdfjs-find-reached-top = Reached top of document, continued from bottom +pdfjs-find-reached-bottom = Reached end of document, continued from top +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] { $current } of { $total } match + *[other] { $current } of { $total } matches + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] More than { $limit } match + *[other] More than { $limit } matches + } +pdfjs-find-not-found = Phrase not found + +## Predefined zoom values + +pdfjs-page-scale-width = Page Width +pdfjs-page-scale-fit = Page Fit +pdfjs-page-scale-auto = Automatic Zoom +pdfjs-page-scale-actual = Actual Size +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Page { $page } + +## Loading indicator messages + +pdfjs-loading-error = An error occurred while loading the PDF. +pdfjs-invalid-file-error = Invalid or corrupted PDF file. +pdfjs-missing-file-error = Missing PDF file. +pdfjs-unexpected-response-error = Unexpected server response. +pdfjs-rendering-error = An error occurred while rendering the page. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } Annotation] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Enter the password to open this PDF file. +pdfjs-password-invalid = Invalid password. Please try again. +pdfjs-password-ok-button = OK +pdfjs-password-cancel-button = Cancel +pdfjs-web-fonts-disabled = Web fonts are disabled: unable to use embedded PDF fonts. + +## Editing + +pdfjs-editor-free-text-button = + .title = Text +pdfjs-editor-free-text-button-label = Text +pdfjs-editor-ink-button = + .title = Draw +pdfjs-editor-ink-button-label = Draw +pdfjs-editor-stamp-button = + .title = Add or edit images +pdfjs-editor-stamp-button-label = Add or edit images +pdfjs-editor-highlight-button = + .title = Highlight +pdfjs-editor-highlight-button-label = Highlight +pdfjs-highlight-floating-button1 = + .title = Highlight + .aria-label = Highlight +pdfjs-highlight-floating-button-label = Highlight + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Remove drawing +pdfjs-editor-remove-freetext-button = + .title = Remove text +pdfjs-editor-remove-stamp-button = + .title = Remove image +pdfjs-editor-remove-highlight-button = + .title = Remove highlight + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Colour +pdfjs-editor-free-text-size-input = Size +pdfjs-editor-ink-color-input = Colour +pdfjs-editor-ink-thickness-input = Thickness +pdfjs-editor-ink-opacity-input = Opacity +pdfjs-editor-stamp-add-image-button = + .title = Add image +pdfjs-editor-stamp-add-image-button-label = Add image +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Thickness +pdfjs-editor-free-highlight-thickness-title = + .title = Change thickness when highlighting items other than text +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = Text Editor + .default-content = Start typing… +pdfjs-free-text = + .aria-label = Text Editor +pdfjs-free-text-default-content = Start typing… +pdfjs-ink = + .aria-label = Draw Editor +pdfjs-ink-canvas = + .aria-label = User-created image + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = Alt text +pdfjs-editor-alt-text-edit-button = + .aria-label = Edit alt text +pdfjs-editor-alt-text-edit-button-label = Edit alt text +pdfjs-editor-alt-text-dialog-label = Choose an option +pdfjs-editor-alt-text-dialog-description = Alt text (alternative text) helps when people can’t see the image or when it doesn’t load. +pdfjs-editor-alt-text-add-description-label = Add a description +pdfjs-editor-alt-text-add-description-description = Aim for 1-2 sentences that describe the subject, setting, or actions. +pdfjs-editor-alt-text-mark-decorative-label = Mark as decorative +pdfjs-editor-alt-text-mark-decorative-description = This is used for ornamental images, like borders or watermarks. +pdfjs-editor-alt-text-cancel-button = Cancel +pdfjs-editor-alt-text-save-button = Save +pdfjs-editor-alt-text-decorative-tooltip = Marked as decorative +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = For example, “A young man sits down at a table to eat a meal” +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = Alt text + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Top left corner — resize +pdfjs-editor-resizer-label-top-middle = Top middle — resize +pdfjs-editor-resizer-label-top-right = Top right corner — resize +pdfjs-editor-resizer-label-middle-right = Middle right — resize +pdfjs-editor-resizer-label-bottom-right = Bottom right corner — resize +pdfjs-editor-resizer-label-bottom-middle = Bottom middle — resize +pdfjs-editor-resizer-label-bottom-left = Bottom left corner — resize +pdfjs-editor-resizer-label-middle-left = Middle left — resize +pdfjs-editor-resizer-top-left = + .aria-label = Top left corner — resize +pdfjs-editor-resizer-top-middle = + .aria-label = Top middle — resize +pdfjs-editor-resizer-top-right = + .aria-label = Top right corner — resize +pdfjs-editor-resizer-middle-right = + .aria-label = Middle right — resize +pdfjs-editor-resizer-bottom-right = + .aria-label = Bottom right corner — resize +pdfjs-editor-resizer-bottom-middle = + .aria-label = Bottom middle — resize +pdfjs-editor-resizer-bottom-left = + .aria-label = Bottom left corner — resize +pdfjs-editor-resizer-middle-left = + .aria-label = Middle left — resize + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Highlight colour +pdfjs-editor-colorpicker-button = + .title = Change colour +pdfjs-editor-colorpicker-dropdown = + .aria-label = Colour choices +pdfjs-editor-colorpicker-yellow = + .title = Yellow +pdfjs-editor-colorpicker-green = + .title = Green +pdfjs-editor-colorpicker-blue = + .title = Blue +pdfjs-editor-colorpicker-pink = + .title = Pink +pdfjs-editor-colorpicker-red = + .title = Red + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Show all +pdfjs-editor-highlight-show-all-button = + .title = Show all + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = Edit alt text (image description) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = Add alt text (image description) +pdfjs-editor-new-alt-text-textarea = + .placeholder = Write your description here… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = Short description for people who can’t see the image or when the image doesn’t load. +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = This alt text was created automatically and may be inaccurate. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Learn more +pdfjs-editor-new-alt-text-create-automatically-button-label = Create alt text automatically +pdfjs-editor-new-alt-text-not-now-button = Not now +pdfjs-editor-new-alt-text-error-title = Couldn’t create alt text automatically +pdfjs-editor-new-alt-text-error-description = Please write your own alt text or try again later. +pdfjs-editor-new-alt-text-error-close-button = Close +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = Downloading alt text AI model ({ $downloadedSize } of { $totalSize } MB) + .aria-valuetext = Downloading alt text AI model ({ $downloadedSize } of { $totalSize } MB) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = Alt text added +pdfjs-editor-new-alt-text-added-button-label = Alt text added +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = Missing alt text +pdfjs-editor-new-alt-text-missing-button-label = Missing alt text +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = Review alt text +pdfjs-editor-new-alt-text-to-review-button-label = Review alt text +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Created automatically: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = Image alt text settings +pdfjs-image-alt-text-settings-button-label = Image alt text settings +pdfjs-editor-alt-text-settings-dialog-label = Image alt text settings +pdfjs-editor-alt-text-settings-automatic-title = Automatic alt text +pdfjs-editor-alt-text-settings-create-model-button-label = Create alt text automatically +pdfjs-editor-alt-text-settings-create-model-description = Suggests descriptions to help people who can’t see the image or when the image doesn’t load. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = Alt text AI model ({ $totalSize } MB) +pdfjs-editor-alt-text-settings-ai-model-description = Runs locally on your device so your data stays private. Required for automatic alt text. +pdfjs-editor-alt-text-settings-delete-model-button = Delete +pdfjs-editor-alt-text-settings-download-model-button = Download +pdfjs-editor-alt-text-settings-downloading-model-button = Downloading… +pdfjs-editor-alt-text-settings-editor-title = Alt text editor +pdfjs-editor-alt-text-settings-show-dialog-button-label = Show alt text editor right away when adding an image +pdfjs-editor-alt-text-settings-show-dialog-description = Helps you make sure all your images have alt text. +pdfjs-editor-alt-text-settings-close-button = Close + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = Highlight removed +pdfjs-editor-undo-bar-message-freetext = Text removed +pdfjs-editor-undo-bar-message-ink = Drawing removed +pdfjs-editor-undo-bar-message-stamp = Image removed +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = + { $count -> + [one] { $count } annotation removed + *[other] { $count } annotations removed + } +pdfjs-editor-undo-bar-undo-button = + .title = Undo +pdfjs-editor-undo-bar-undo-button-label = Undo +pdfjs-editor-undo-bar-close-button = + .title = Close +pdfjs-editor-undo-bar-close-button-label = Close diff --git a/public/pdfjs/web/locale/en-US/viewer.ftl b/public/pdfjs/web/locale/en-US/viewer.ftl new file mode 100644 index 0000000..3e4a351 --- /dev/null +++ b/public/pdfjs/web/locale/en-US/viewer.ftl @@ -0,0 +1,526 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Previous Page +pdfjs-previous-button-label = Previous +pdfjs-next-button = + .title = Next Page +pdfjs-next-button-label = Next + +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Page + +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = of { $pagesCount } + +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } of { $pagesCount }) + +pdfjs-zoom-out-button = + .title = Zoom Out +pdfjs-zoom-out-button-label = Zoom Out +pdfjs-zoom-in-button = + .title = Zoom In +pdfjs-zoom-in-button-label = Zoom In +pdfjs-zoom-select = + .title = Zoom +pdfjs-presentation-mode-button = + .title = Switch to Presentation Mode +pdfjs-presentation-mode-button-label = Presentation Mode +pdfjs-open-file-button = + .title = Open File +pdfjs-open-file-button-label = Open +pdfjs-print-button = + .title = Print +pdfjs-print-button-label = Print +pdfjs-save-button = + .title = Save +pdfjs-save-button-label = Save + +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Download + +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Download + +pdfjs-bookmark-button = + .title = Current Page (View URL from Current Page) +pdfjs-bookmark-button-label = Current Page + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Tools + +pdfjs-tools-button-label = Tools +pdfjs-first-page-button = + .title = Go to First Page +pdfjs-first-page-button-label = Go to First Page +pdfjs-last-page-button = + .title = Go to Last Page +pdfjs-last-page-button-label = Go to Last Page +pdfjs-page-rotate-cw-button = + .title = Rotate Clockwise +pdfjs-page-rotate-cw-button-label = Rotate Clockwise +pdfjs-page-rotate-ccw-button = + .title = Rotate Counterclockwise +pdfjs-page-rotate-ccw-button-label = Rotate Counterclockwise +pdfjs-cursor-text-select-tool-button = + .title = Enable Text Selection Tool +pdfjs-cursor-text-select-tool-button-label = Text Selection Tool +pdfjs-cursor-hand-tool-button = + .title = Enable Hand Tool +pdfjs-cursor-hand-tool-button-label = Hand Tool +pdfjs-scroll-page-button = + .title = Use Page Scrolling +pdfjs-scroll-page-button-label = Page Scrolling +pdfjs-scroll-vertical-button = + .title = Use Vertical Scrolling +pdfjs-scroll-vertical-button-label = Vertical Scrolling +pdfjs-scroll-horizontal-button = + .title = Use Horizontal Scrolling +pdfjs-scroll-horizontal-button-label = Horizontal Scrolling +pdfjs-scroll-wrapped-button = + .title = Use Wrapped Scrolling +pdfjs-scroll-wrapped-button-label = Wrapped Scrolling +pdfjs-spread-none-button = + .title = Do not join page spreads +pdfjs-spread-none-button-label = No Spreads +pdfjs-spread-odd-button = + .title = Join page spreads starting with odd-numbered pages +pdfjs-spread-odd-button-label = Odd Spreads +pdfjs-spread-even-button = + .title = Join page spreads starting with even-numbered pages +pdfjs-spread-even-button-label = Even Spreads + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Document Properties… +pdfjs-document-properties-button-label = Document Properties… +pdfjs-document-properties-file-name = File name: +pdfjs-document-properties-file-size = File size: + +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } bytes) + +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } bytes) + +pdfjs-document-properties-title = Title: +pdfjs-document-properties-author = Author: +pdfjs-document-properties-subject = Subject: +pdfjs-document-properties-keywords = Keywords: +pdfjs-document-properties-creation-date = Creation Date: +pdfjs-document-properties-modification-date = Modification Date: + +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +pdfjs-document-properties-creator = Creator: +pdfjs-document-properties-producer = PDF Producer: +pdfjs-document-properties-version = PDF Version: +pdfjs-document-properties-page-count = Page Count: +pdfjs-document-properties-page-size = Page Size: +pdfjs-document-properties-page-size-unit-inches = in +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = portrait +pdfjs-document-properties-page-size-orientation-landscape = landscape +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Letter +pdfjs-document-properties-page-size-name-legal = Legal + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Fast Web View: +pdfjs-document-properties-linearized-yes = Yes +pdfjs-document-properties-linearized-no = No +pdfjs-document-properties-close-button = Close + +## Print + +pdfjs-print-progress-message = Preparing document for printing… + +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% + +pdfjs-print-progress-close-button = Cancel +pdfjs-printing-not-supported = Warning: Printing is not fully supported by this browser. +pdfjs-printing-not-ready = Warning: The PDF is not fully loaded for printing. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Toggle Sidebar +pdfjs-toggle-sidebar-notification-button = + .title = Toggle Sidebar (document contains outline/attachments/layers) +pdfjs-toggle-sidebar-button-label = Toggle Sidebar +pdfjs-document-outline-button = + .title = Show Document Outline (double-click to expand/collapse all items) +pdfjs-document-outline-button-label = Document Outline +pdfjs-attachments-button = + .title = Show Attachments +pdfjs-attachments-button-label = Attachments +pdfjs-layers-button = + .title = Show Layers (double-click to reset all layers to the default state) +pdfjs-layers-button-label = Layers +pdfjs-thumbs-button = + .title = Show Thumbnails +pdfjs-thumbs-button-label = Thumbnails +pdfjs-current-outline-item-button = + .title = Find Current Outline Item +pdfjs-current-outline-item-button-label = Current Outline Item +pdfjs-findbar-button = + .title = Find in Document +pdfjs-findbar-button-label = Find +pdfjs-additional-layers = Additional Layers + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Page { $page } + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Thumbnail of Page { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Find + .placeholder = Find in document… +pdfjs-find-previous-button = + .title = Find the previous occurrence of the phrase +pdfjs-find-previous-button-label = Previous +pdfjs-find-next-button = + .title = Find the next occurrence of the phrase +pdfjs-find-next-button-label = Next +pdfjs-find-highlight-checkbox = Highlight All +pdfjs-find-match-case-checkbox-label = Match Case +pdfjs-find-match-diacritics-checkbox-label = Match Diacritics +pdfjs-find-entire-word-checkbox-label = Whole Words +pdfjs-find-reached-top = Reached top of document, continued from bottom +pdfjs-find-reached-bottom = Reached end of document, continued from top + +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] { $current } of { $total } match + *[other] { $current } of { $total } matches + } + +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] More than { $limit } match + *[other] More than { $limit } matches + } + +pdfjs-find-not-found = Phrase not found + +## Predefined zoom values + +pdfjs-page-scale-width = Page Width +pdfjs-page-scale-fit = Page Fit +pdfjs-page-scale-auto = Automatic Zoom +pdfjs-page-scale-actual = Actual Size + +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Page { $page } + +## Loading indicator messages + +pdfjs-loading-error = An error occurred while loading the PDF. +pdfjs-invalid-file-error = Invalid or corrupted PDF file. +pdfjs-missing-file-error = Missing PDF file. +pdfjs-unexpected-response-error = Unexpected server response. +pdfjs-rendering-error = An error occurred while rendering the page. + +## Annotations + +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } Annotation] + +## Password + +pdfjs-password-label = Enter the password to open this PDF file. +pdfjs-password-invalid = Invalid password. Please try again. +pdfjs-password-ok-button = OK +pdfjs-password-cancel-button = Cancel +pdfjs-web-fonts-disabled = Web fonts are disabled: unable to use embedded PDF fonts. + +## Editing + +pdfjs-editor-free-text-button = + .title = Text +pdfjs-editor-free-text-button-label = Text +pdfjs-editor-ink-button = + .title = Draw +pdfjs-editor-ink-button-label = Draw +pdfjs-editor-stamp-button = + .title = Add or edit images +pdfjs-editor-stamp-button-label = Add or edit images +pdfjs-editor-highlight-button = + .title = Highlight +pdfjs-editor-highlight-button-label = Highlight +pdfjs-highlight-floating-button1 = + .title = Highlight + .aria-label = Highlight +pdfjs-highlight-floating-button-label = Highlight + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Remove drawing +pdfjs-editor-remove-freetext-button = + .title = Remove text +pdfjs-editor-remove-stamp-button = + .title = Remove image +pdfjs-editor-remove-highlight-button = + .title = Remove highlight + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Color +pdfjs-editor-free-text-size-input = Size +pdfjs-editor-ink-color-input = Color +pdfjs-editor-ink-thickness-input = Thickness +pdfjs-editor-ink-opacity-input = Opacity +pdfjs-editor-stamp-add-image-button = + .title = Add image +pdfjs-editor-stamp-add-image-button-label = Add image +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Thickness +pdfjs-editor-free-highlight-thickness-title = + .title = Change thickness when highlighting items other than text + +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = Text Editor + .default-content = Start typing… +pdfjs-ink = + .aria-label = Draw Editor +pdfjs-ink-canvas = + .aria-label = User-created image + +## Alt-text dialog + +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = Alt text +pdfjs-editor-alt-text-button-label = Alt text + +pdfjs-editor-alt-text-edit-button = + .aria-label = Edit alt text +pdfjs-editor-alt-text-dialog-label = Choose an option +pdfjs-editor-alt-text-dialog-description = Alt text (alternative text) helps when people can’t see the image or when it doesn’t load. +pdfjs-editor-alt-text-add-description-label = Add a description +pdfjs-editor-alt-text-add-description-description = Aim for 1-2 sentences that describe the subject, setting, or actions. +pdfjs-editor-alt-text-mark-decorative-label = Mark as decorative +pdfjs-editor-alt-text-mark-decorative-description = This is used for ornamental images, like borders or watermarks. +pdfjs-editor-alt-text-cancel-button = Cancel +pdfjs-editor-alt-text-save-button = Save +pdfjs-editor-alt-text-decorative-tooltip = Marked as decorative + +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = For example, “A young man sits down at a table to eat a meal” + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-top-left = + .aria-label = Top left corner — resize +pdfjs-editor-resizer-top-middle = + .aria-label = Top middle — resize +pdfjs-editor-resizer-top-right = + .aria-label = Top right corner — resize +pdfjs-editor-resizer-middle-right = + .aria-label = Middle right — resize +pdfjs-editor-resizer-bottom-right = + .aria-label = Bottom right corner — resize +pdfjs-editor-resizer-bottom-middle = + .aria-label = Bottom middle — resize +pdfjs-editor-resizer-bottom-left = + .aria-label = Bottom left corner — resize +pdfjs-editor-resizer-middle-left = + .aria-label = Middle left — resize + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Highlight color + +pdfjs-editor-colorpicker-button = + .title = Change color +pdfjs-editor-colorpicker-dropdown = + .aria-label = Color choices +pdfjs-editor-colorpicker-yellow = + .title = Yellow +pdfjs-editor-colorpicker-green = + .title = Green +pdfjs-editor-colorpicker-blue = + .title = Blue +pdfjs-editor-colorpicker-pink = + .title = Pink +pdfjs-editor-colorpicker-red = + .title = Red + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Show all +pdfjs-editor-highlight-show-all-button = + .title = Show all + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = Edit alt text (image description) + +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = Add alt text (image description) + +pdfjs-editor-new-alt-text-textarea = + .placeholder = Write your description here… + +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = Short description for people who can’t see the image or when the image doesn’t load. + +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = This alt text was created automatically and may be inaccurate. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Learn more + +pdfjs-editor-new-alt-text-create-automatically-button-label = Create alt text automatically +pdfjs-editor-new-alt-text-not-now-button = Not now +pdfjs-editor-new-alt-text-error-title = Couldn’t create alt text automatically +pdfjs-editor-new-alt-text-error-description = Please write your own alt text or try again later. +pdfjs-editor-new-alt-text-error-close-button = Close + +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = Downloading alt text AI model ({ $downloadedSize } of { $totalSize } MB) + .aria-valuetext = Downloading alt text AI model ({ $downloadedSize } of { $totalSize } MB) + +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = Alt text added +pdfjs-editor-new-alt-text-added-button-label = Alt text added + +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = Missing alt text +pdfjs-editor-new-alt-text-missing-button-label = Missing alt text + +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = Review alt text +pdfjs-editor-new-alt-text-to-review-button-label = Review alt text + +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Created automatically: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = Image alt text settings +pdfjs-image-alt-text-settings-button-label = Image alt text settings + +pdfjs-editor-alt-text-settings-dialog-label = Image alt text settings +pdfjs-editor-alt-text-settings-automatic-title = Automatic alt text +pdfjs-editor-alt-text-settings-create-model-button-label = Create alt text automatically +pdfjs-editor-alt-text-settings-create-model-description = Suggests descriptions to help people who can’t see the image or when the image doesn’t load. + +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = Alt text AI model ({ $totalSize } MB) + +pdfjs-editor-alt-text-settings-ai-model-description = Runs locally on your device so your data stays private. Required for automatic alt text. +pdfjs-editor-alt-text-settings-delete-model-button = Delete +pdfjs-editor-alt-text-settings-download-model-button = Download +pdfjs-editor-alt-text-settings-downloading-model-button = Downloading… + +pdfjs-editor-alt-text-settings-editor-title = Alt text editor +pdfjs-editor-alt-text-settings-show-dialog-button-label = Show alt text editor right away when adding an image +pdfjs-editor-alt-text-settings-show-dialog-description = Helps you make sure all your images have alt text. +pdfjs-editor-alt-text-settings-close-button = Close + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = Highlight removed +pdfjs-editor-undo-bar-message-freetext = Text removed +pdfjs-editor-undo-bar-message-ink = Drawing removed +pdfjs-editor-undo-bar-message-stamp = Image removed +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = + { $count -> + [one] { $count } annotation removed + *[other] { $count } annotations removed + } + +pdfjs-editor-undo-bar-undo-button = + .title = Undo +pdfjs-editor-undo-bar-undo-button-label = Undo +pdfjs-editor-undo-bar-close-button = + .title = Close +pdfjs-editor-undo-bar-close-button-label = Close diff --git a/public/pdfjs/web/locale/eo/viewer.ftl b/public/pdfjs/web/locale/eo/viewer.ftl new file mode 100644 index 0000000..ce45ebf --- /dev/null +++ b/public/pdfjs/web/locale/eo/viewer.ftl @@ -0,0 +1,515 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Antaŭa paĝo +pdfjs-previous-button-label = Malantaŭen +pdfjs-next-button = + .title = Venonta paĝo +pdfjs-next-button-label = Antaŭen +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Paĝo +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = el { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } el { $pagesCount }) +pdfjs-zoom-out-button = + .title = Malpligrandigi +pdfjs-zoom-out-button-label = Malpligrandigi +pdfjs-zoom-in-button = + .title = Pligrandigi +pdfjs-zoom-in-button-label = Pligrandigi +pdfjs-zoom-select = + .title = Pligrandigilo +pdfjs-presentation-mode-button = + .title = Iri al prezenta reĝimo +pdfjs-presentation-mode-button-label = Prezenta reĝimo +pdfjs-open-file-button = + .title = Malfermi dosieron +pdfjs-open-file-button-label = Malfermi +pdfjs-print-button = + .title = Presi +pdfjs-print-button-label = Presi +pdfjs-save-button = + .title = Konservi +pdfjs-save-button-label = Konservi +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Elŝuti +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Elŝuti +pdfjs-bookmark-button = + .title = Nuna paĝo (Montri adreson de la nuna paĝo) +pdfjs-bookmark-button-label = Nuna paĝo + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Iloj +pdfjs-tools-button-label = Iloj +pdfjs-first-page-button = + .title = Iri al la unua paĝo +pdfjs-first-page-button-label = Iri al la unua paĝo +pdfjs-last-page-button = + .title = Iri al la lasta paĝo +pdfjs-last-page-button-label = Iri al la lasta paĝo +pdfjs-page-rotate-cw-button = + .title = Rotaciigi dekstrume +pdfjs-page-rotate-cw-button-label = Rotaciigi dekstrume +pdfjs-page-rotate-ccw-button = + .title = Rotaciigi maldekstrume +pdfjs-page-rotate-ccw-button-label = Rotaciigi maldekstrume +pdfjs-cursor-text-select-tool-button = + .title = Aktivigi tekstan elektilon +pdfjs-cursor-text-select-tool-button-label = Teksta elektilo +pdfjs-cursor-hand-tool-button = + .title = Aktivigi ilon de mano +pdfjs-cursor-hand-tool-button-label = Ilo de mano +pdfjs-scroll-page-button = + .title = Uzi rulumon de paĝo +pdfjs-scroll-page-button-label = Rulumo de paĝo +pdfjs-scroll-vertical-button = + .title = Uzi vertikalan rulumon +pdfjs-scroll-vertical-button-label = Vertikala rulumo +pdfjs-scroll-horizontal-button = + .title = Uzi horizontalan rulumon +pdfjs-scroll-horizontal-button-label = Horizontala rulumo +pdfjs-scroll-wrapped-button = + .title = Uzi ambaŭdirektan rulumon +pdfjs-scroll-wrapped-button-label = Ambaŭdirekta rulumo +pdfjs-spread-none-button = + .title = Ne montri paĝojn po du +pdfjs-spread-none-button-label = Unupaĝa vido +pdfjs-spread-odd-button = + .title = Kunigi paĝojn komencante per nepara paĝo +pdfjs-spread-odd-button-label = Po du paĝoj, neparaj maldekstre +pdfjs-spread-even-button = + .title = Kunigi paĝojn komencante per para paĝo +pdfjs-spread-even-button-label = Po du paĝoj, paraj maldekstre + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Atributoj de dokumento… +pdfjs-document-properties-button-label = Atributoj de dokumento… +pdfjs-document-properties-file-name = Nomo de dosiero: +pdfjs-document-properties-file-size = Grando de dosiero: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KO ({ $b } oktetoj) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } Mo ({ $b } oktetoj) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KO ({ $size_b } oktetoj) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MO ({ $size_b } oktetoj) +pdfjs-document-properties-title = Titolo: +pdfjs-document-properties-author = Aŭtoro: +pdfjs-document-properties-subject = Temo: +pdfjs-document-properties-keywords = Ŝlosilvorto: +pdfjs-document-properties-creation-date = Dato de kreado: +pdfjs-document-properties-modification-date = Dato de modifo: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Kreinto: +pdfjs-document-properties-producer = Produktinto de PDF: +pdfjs-document-properties-version = Versio de PDF: +pdfjs-document-properties-page-count = Nombro de paĝoj: +pdfjs-document-properties-page-size = Grando de paĝo: +pdfjs-document-properties-page-size-unit-inches = in +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = vertikala +pdfjs-document-properties-page-size-orientation-landscape = horizontala +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Letera +pdfjs-document-properties-page-size-name-legal = Jura + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Rapida tekstaĵa vido: +pdfjs-document-properties-linearized-yes = Jes +pdfjs-document-properties-linearized-no = Ne +pdfjs-document-properties-close-button = Fermi + +## Print + +pdfjs-print-progress-message = Preparo de dokumento por presi ĝin … +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Nuligi +pdfjs-printing-not-supported = Averto: tiu ĉi retumilo ne plene subtenas presadon. +pdfjs-printing-not-ready = Averto: la PDF dosiero ne estas plene ŝargita por presado. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Montri/kaŝi flankan strion +pdfjs-toggle-sidebar-notification-button = + .title = Montri/kaŝi flankan strion (la dokumento enhavas konturon/kunsendaĵojn/tavolojn) +pdfjs-toggle-sidebar-button-label = Montri/kaŝi flankan strion +pdfjs-document-outline-button = + .title = Montri la konturon de dokumento (alklaku duoble por faldi/malfaldi ĉiujn elementojn) +pdfjs-document-outline-button-label = Konturo de dokumento +pdfjs-attachments-button = + .title = Montri kunsendaĵojn +pdfjs-attachments-button-label = Kunsendaĵojn +pdfjs-layers-button = + .title = Montri tavolojn (duoble alklaku por remeti ĉiujn tavolojn en la norman staton) +pdfjs-layers-button-label = Tavoloj +pdfjs-thumbs-button = + .title = Montri miniaturojn +pdfjs-thumbs-button-label = Miniaturoj +pdfjs-current-outline-item-button = + .title = Trovi nunan konturan elementon +pdfjs-current-outline-item-button-label = Nuna kontura elemento +pdfjs-findbar-button = + .title = Serĉi en dokumento +pdfjs-findbar-button-label = Serĉi +pdfjs-additional-layers = Aldonaj tavoloj + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Paĝo { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Miniaturo de paĝo { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Serĉi + .placeholder = Serĉi en dokumento… +pdfjs-find-previous-button = + .title = Serĉi la antaŭan aperon de la frazo +pdfjs-find-previous-button-label = Malantaŭen +pdfjs-find-next-button = + .title = Serĉi la venontan aperon de la frazo +pdfjs-find-next-button-label = Antaŭen +pdfjs-find-highlight-checkbox = Elstarigi ĉiujn +pdfjs-find-match-case-checkbox-label = Distingi inter majuskloj kaj minuskloj +pdfjs-find-match-diacritics-checkbox-label = Respekti supersignojn +pdfjs-find-entire-word-checkbox-label = Tutaj vortoj +pdfjs-find-reached-top = Komenco de la dokumento atingita, daŭrigado ekde la fino +pdfjs-find-reached-bottom = Fino de la dokumento atingita, daŭrigado ekde la komenco +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] { $current } el { $total } kongruo + *[other] { $current } el { $total } kongruoj + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] Pli ol { $limit } kongruo + *[other] Pli ol { $limit } kongruoj + } +pdfjs-find-not-found = Frazo ne trovita + +## Predefined zoom values + +pdfjs-page-scale-width = Larĝo de paĝo +pdfjs-page-scale-fit = Adapti paĝon +pdfjs-page-scale-auto = Aŭtomata skalo +pdfjs-page-scale-actual = Reala grando +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Paĝo { $page } + +## Loading indicator messages + +pdfjs-loading-error = Okazis eraro dum la ŝargado de la PDF dosiero. +pdfjs-invalid-file-error = Nevalida aŭ difektita PDF dosiero. +pdfjs-missing-file-error = Mankas dosiero PDF. +pdfjs-unexpected-response-error = Neatendita respondo de servilo. +pdfjs-rendering-error = Okazis eraro dum la montro de la paĝo. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [Prinoto: { $type }] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Tajpu pasvorton por malfermi tiun ĉi dosieron PDF. +pdfjs-password-invalid = Nevalida pasvorto. Bonvolu provi denove. +pdfjs-password-ok-button = Akcepti +pdfjs-password-cancel-button = Nuligi +pdfjs-web-fonts-disabled = Neaktivaj teksaĵaj tiparoj: ne elbas uzi enmetitajn tiparojn de PDF. + +## Editing + +pdfjs-editor-free-text-button = + .title = Teksto +pdfjs-editor-free-text-button-label = Teksto +pdfjs-editor-ink-button = + .title = Desegni +pdfjs-editor-ink-button-label = Desegni +pdfjs-editor-stamp-button = + .title = Aldoni aŭ modifi bildojn +pdfjs-editor-stamp-button-label = Aldoni aŭ modifi bildojn +pdfjs-editor-highlight-button = + .title = Elstarigi +pdfjs-editor-highlight-button-label = Elstarigi +pdfjs-highlight-floating-button1 = + .title = Elstarigi + .aria-label = Elstarigi +pdfjs-highlight-floating-button-label = Elstarigi + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Forigi desegnon +pdfjs-editor-remove-freetext-button = + .title = Forigi tekston +pdfjs-editor-remove-stamp-button = + .title = Forigi bildon +pdfjs-editor-remove-highlight-button = + .title = Forigi elstaraĵon + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Koloro +pdfjs-editor-free-text-size-input = Grando +pdfjs-editor-ink-color-input = Koloro +pdfjs-editor-ink-thickness-input = Dikeco +pdfjs-editor-ink-opacity-input = Maldiafaneco +pdfjs-editor-stamp-add-image-button = + .title = Aldoni bildon +pdfjs-editor-stamp-add-image-button-label = Aldoni bildon +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Dikeco +pdfjs-editor-free-highlight-thickness-title = + .title = Ŝanĝi dikecon dum elstarigo de netekstaj elementoj +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = Teksta redaktilo + .default-content = Komencu tajpi… +pdfjs-free-text = + .aria-label = Teksta redaktilo +pdfjs-free-text-default-content = Ektajpi… +pdfjs-ink = + .aria-label = Desegnan redaktilon +pdfjs-ink-canvas = + .aria-label = Bildo kreita de uzanto + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = Alternativa teksto +pdfjs-editor-alt-text-edit-button = + .aria-label = Redakti alternativan tekston +pdfjs-editor-alt-text-edit-button-label = Redakti alternativan tekston +pdfjs-editor-alt-text-dialog-label = Elektu eblon +pdfjs-editor-alt-text-dialog-description = Alternativa teksto helpas personojn, en la okazoj kiam ili ne povas vidi aŭ ŝargi la bildon. +pdfjs-editor-alt-text-add-description-label = Aldoni priskribon +pdfjs-editor-alt-text-add-description-description = La celo estas unu aŭ du frazoj, kiuj priskribas la temon, etoson aŭ agojn. +pdfjs-editor-alt-text-mark-decorative-label = Marki kiel ornaman +pdfjs-editor-alt-text-mark-decorative-description = Tio ĉi estas uzita por ornamaj bildoj, kiel randoj aŭ fonaj bildoj. +pdfjs-editor-alt-text-cancel-button = Nuligi +pdfjs-editor-alt-text-save-button = Konservi +pdfjs-editor-alt-text-decorative-tooltip = Markita kiel ornama +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = Ekzemple: “Juna persono sidiĝas ĉetable por ekmanĝi” +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = Alternativa teksto + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Supra maldekstra angulo — ŝangi grandon +pdfjs-editor-resizer-label-top-middle = Supra mezo — ŝanĝi grandon +pdfjs-editor-resizer-label-top-right = Supran dekstran angulon — ŝanĝi grandon +pdfjs-editor-resizer-label-middle-right = Dekstra mezo — ŝanĝi grandon +pdfjs-editor-resizer-label-bottom-right = Malsupra deksta angulo — ŝanĝi grandon +pdfjs-editor-resizer-label-bottom-middle = Malsupra mezo — ŝanĝi grandon +pdfjs-editor-resizer-label-bottom-left = Malsupra maldekstra angulo — ŝanĝi grandon +pdfjs-editor-resizer-label-middle-left = Maldekstra mezo — ŝanĝi grandon +pdfjs-editor-resizer-top-left = + .aria-label = Supra maldekstra angulo — ŝangi grandon +pdfjs-editor-resizer-top-middle = + .aria-label = Supra mezo — ŝanĝi grandon +pdfjs-editor-resizer-top-right = + .aria-label = Supran dekstran angulon — ŝanĝi grandon +pdfjs-editor-resizer-middle-right = + .aria-label = Dekstra mezo — ŝanĝi grandon +pdfjs-editor-resizer-bottom-right = + .aria-label = Malsupra deksta angulo — ŝanĝi grandon +pdfjs-editor-resizer-bottom-middle = + .aria-label = Malsupra mezo — ŝanĝi grandon +pdfjs-editor-resizer-bottom-left = + .aria-label = Malsupra maldekstra angulo — ŝanĝi grandon +pdfjs-editor-resizer-middle-left = + .aria-label = Maldekstra mezo — ŝanĝi grandon + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Elstarigi koloron +pdfjs-editor-colorpicker-button = + .title = Ŝanĝi koloron +pdfjs-editor-colorpicker-dropdown = + .aria-label = Elekto de koloroj +pdfjs-editor-colorpicker-yellow = + .title = Flava +pdfjs-editor-colorpicker-green = + .title = Verda +pdfjs-editor-colorpicker-blue = + .title = Blua +pdfjs-editor-colorpicker-pink = + .title = Roza +pdfjs-editor-colorpicker-red = + .title = Ruĝa + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Montri ĉiujn +pdfjs-editor-highlight-show-all-button = + .title = Montri ĉiujn + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = Modifi alternativan tekston (priskribo de bildo) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = Aldoni alternativan tekston (priskribo de bildo) +pdfjs-editor-new-alt-text-textarea = + .placeholder = Skribu vian priskribon ĉi tie… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = Mallonga priskribo por personoj kiuj ne povas vidi la bildon kaj por montri kiam la bildo ne ŝargeblas. +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = Tiu ĉi alternativa teksto estis aŭtomate kreita kaj povus esti malĝusta. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Pli da informo +pdfjs-editor-new-alt-text-create-automatically-button-label = Aŭtomate krei alternativan tekston +pdfjs-editor-new-alt-text-not-now-button = Ne nun +pdfjs-editor-new-alt-text-error-title = Ne eblis aŭtomate krei alternativan tekston +pdfjs-editor-new-alt-text-error-description = Bonvolu skribi vian propran alternativan tekston aŭ provi denove poste. +pdfjs-editor-new-alt-text-error-close-button = Fermi +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = Elŝuto de modelo de artefarita intelekto por alternativa teksto ({ $downloadedSize } el { $totalSize } MO) + .aria-valuetext = Elŝuto de modelo de artefarita intelekto por alternativa teksto ({ $downloadedSize } el { $totalSize } MO) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = Alternativa teksto aldonita +pdfjs-editor-new-alt-text-added-button-label = Alternativa teksto aldonita +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = Mankas alternativa teksto +pdfjs-editor-new-alt-text-missing-button-label = Mankas alternativa teksto +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = Kontroli alternativan tekston +pdfjs-editor-new-alt-text-to-review-button-label = Kontroli alternativan tekston +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Aŭtomate kreita: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = Agordoj por alternativa teksto de bildoj +pdfjs-image-alt-text-settings-button-label = Agordoj por alternativa teksto de bildoj +pdfjs-editor-alt-text-settings-dialog-label = Agordoj por alternativa teksto de bildoj +pdfjs-editor-alt-text-settings-automatic-title = Aŭtomata alternativa teksto +pdfjs-editor-alt-text-settings-create-model-button-label = Aŭtomate krei alternativan tekston +pdfjs-editor-alt-text-settings-create-model-description = Tio ĉi sugestas priskribojn por helpi personojn kiuj ne povas vidi aŭ ŝargi la bildon. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = Modelo de artefarita intelekto por alternativa teksto ({ $totalSize } MO) +pdfjs-editor-alt-text-settings-ai-model-description = Ĝi funkcias en via aparato, do viaj datumoj restas privataj. Ĝi estas postulata por aŭtomata kreado de alternativa teksto. +pdfjs-editor-alt-text-settings-delete-model-button = Forigi +pdfjs-editor-alt-text-settings-download-model-button = Elŝuti +pdfjs-editor-alt-text-settings-downloading-model-button = Elŝuto… +pdfjs-editor-alt-text-settings-editor-title = Redaktilo de alternativa teksto +pdfjs-editor-alt-text-settings-show-dialog-button-label = Montri redaktilon de alternativa teksto tuj post aldono de bildo +pdfjs-editor-alt-text-settings-show-dialog-description = Tio ĉi helpas vin kontroli ĉu ĉiuj bildoj havas alternativan tekston. +pdfjs-editor-alt-text-settings-close-button = Fermi + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = Elstaraĵo forigita +pdfjs-editor-undo-bar-message-freetext = Teksto forigita +pdfjs-editor-undo-bar-message-ink = Desegno forigita +pdfjs-editor-undo-bar-message-stamp = Bildo forigita +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = + { $count -> + [one] unu prinoto forigita + *[other] { $count } prinotoj forigitaj + } +pdfjs-editor-undo-bar-undo-button = + .title = Malfari +pdfjs-editor-undo-bar-undo-button-label = Malfari +pdfjs-editor-undo-bar-close-button = + .title = Fermi +pdfjs-editor-undo-bar-close-button-label = Fermi diff --git a/public/pdfjs/web/locale/es-AR/viewer.ftl b/public/pdfjs/web/locale/es-AR/viewer.ftl new file mode 100644 index 0000000..ca73dc7 --- /dev/null +++ b/public/pdfjs/web/locale/es-AR/viewer.ftl @@ -0,0 +1,515 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Página anterior +pdfjs-previous-button-label = Anterior +pdfjs-next-button = + .title = Página siguiente +pdfjs-next-button-label = Siguiente +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Página +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = de { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ( { $pageNumber } de { $pagesCount } ) +pdfjs-zoom-out-button = + .title = Alejar +pdfjs-zoom-out-button-label = Alejar +pdfjs-zoom-in-button = + .title = Acercar +pdfjs-zoom-in-button-label = Acercar +pdfjs-zoom-select = + .title = Zoom +pdfjs-presentation-mode-button = + .title = Cambiar a modo presentación +pdfjs-presentation-mode-button-label = Modo presentación +pdfjs-open-file-button = + .title = Abrir archivo +pdfjs-open-file-button-label = Abrir +pdfjs-print-button = + .title = Imprimir +pdfjs-print-button-label = Imprimir +pdfjs-save-button = + .title = Guardar +pdfjs-save-button-label = Guardar +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Descargar +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Descargar +pdfjs-bookmark-button = + .title = Página actual (Ver URL de la página actual) +pdfjs-bookmark-button-label = Página actual + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Herramientas +pdfjs-tools-button-label = Herramientas +pdfjs-first-page-button = + .title = Ir a primera página +pdfjs-first-page-button-label = Ir a primera página +pdfjs-last-page-button = + .title = Ir a última página +pdfjs-last-page-button-label = Ir a última página +pdfjs-page-rotate-cw-button = + .title = Rotar horario +pdfjs-page-rotate-cw-button-label = Rotar horario +pdfjs-page-rotate-ccw-button = + .title = Rotar antihorario +pdfjs-page-rotate-ccw-button-label = Rotar antihorario +pdfjs-cursor-text-select-tool-button = + .title = Habilitar herramienta de selección de texto +pdfjs-cursor-text-select-tool-button-label = Herramienta de selección de texto +pdfjs-cursor-hand-tool-button = + .title = Habilitar herramienta mano +pdfjs-cursor-hand-tool-button-label = Herramienta mano +pdfjs-scroll-page-button = + .title = Usar desplazamiento de página +pdfjs-scroll-page-button-label = Desplazamiento de página +pdfjs-scroll-vertical-button = + .title = Usar desplazamiento vertical +pdfjs-scroll-vertical-button-label = Desplazamiento vertical +pdfjs-scroll-horizontal-button = + .title = Usar desplazamiento vertical +pdfjs-scroll-horizontal-button-label = Desplazamiento horizontal +pdfjs-scroll-wrapped-button = + .title = Usar desplazamiento encapsulado +pdfjs-scroll-wrapped-button-label = Desplazamiento encapsulado +pdfjs-spread-none-button = + .title = No unir páginas dobles +pdfjs-spread-none-button-label = Sin dobles +pdfjs-spread-odd-button = + .title = Unir páginas dobles comenzando con las impares +pdfjs-spread-odd-button-label = Dobles impares +pdfjs-spread-even-button = + .title = Unir páginas dobles comenzando con las pares +pdfjs-spread-even-button-label = Dobles pares + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Propiedades del documento… +pdfjs-document-properties-button-label = Propiedades del documento… +pdfjs-document-properties-file-name = Nombre de archivo: +pdfjs-document-properties-file-size = Tamaño de archovo: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } bytes) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } bytes) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bytes) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bytes) +pdfjs-document-properties-title = Título: +pdfjs-document-properties-author = Autor: +pdfjs-document-properties-subject = Asunto: +pdfjs-document-properties-keywords = Palabras clave: +pdfjs-document-properties-creation-date = Fecha de creación: +pdfjs-document-properties-modification-date = Fecha de modificación: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Creador: +pdfjs-document-properties-producer = PDF Productor: +pdfjs-document-properties-version = Versión de PDF: +pdfjs-document-properties-page-count = Cantidad de páginas: +pdfjs-document-properties-page-size = Tamaño de página: +pdfjs-document-properties-page-size-unit-inches = en +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = normal +pdfjs-document-properties-page-size-orientation-landscape = apaisado +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Carta +pdfjs-document-properties-page-size-name-legal = Legal + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Vista rápida de la Web: +pdfjs-document-properties-linearized-yes = Sí +pdfjs-document-properties-linearized-no = No +pdfjs-document-properties-close-button = Cerrar + +## Print + +pdfjs-print-progress-message = Preparando documento para imprimir… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Cancelar +pdfjs-printing-not-supported = Advertencia: La impresión no está totalmente soportada por este navegador. +pdfjs-printing-not-ready = Advertencia: El PDF no está completamente cargado para impresión. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Alternar barra lateral +pdfjs-toggle-sidebar-notification-button = + .title = Alternar barra lateral (el documento contiene esquemas/adjuntos/capas) +pdfjs-toggle-sidebar-button-label = Alternar barra lateral +pdfjs-document-outline-button = + .title = Mostrar esquema del documento (doble clic para expandir/colapsar todos los ítems) +pdfjs-document-outline-button-label = Esquema del documento +pdfjs-attachments-button = + .title = Mostrar adjuntos +pdfjs-attachments-button-label = Adjuntos +pdfjs-layers-button = + .title = Mostrar capas (doble clic para restablecer todas las capas al estado predeterminado) +pdfjs-layers-button-label = Capas +pdfjs-thumbs-button = + .title = Mostrar miniaturas +pdfjs-thumbs-button-label = Miniaturas +pdfjs-current-outline-item-button = + .title = Buscar elemento de esquema actual +pdfjs-current-outline-item-button-label = Elemento de esquema actual +pdfjs-findbar-button = + .title = Buscar en documento +pdfjs-findbar-button-label = Buscar +pdfjs-additional-layers = Capas adicionales + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Página { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Miniatura de página { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Buscar + .placeholder = Buscar en documento… +pdfjs-find-previous-button = + .title = Buscar la aparición anterior de la frase +pdfjs-find-previous-button-label = Anterior +pdfjs-find-next-button = + .title = Buscar la siguiente aparición de la frase +pdfjs-find-next-button-label = Siguiente +pdfjs-find-highlight-checkbox = Resaltar todo +pdfjs-find-match-case-checkbox-label = Coincidir mayúsculas +pdfjs-find-match-diacritics-checkbox-label = Coincidir diacríticos +pdfjs-find-entire-word-checkbox-label = Palabras completas +pdfjs-find-reached-top = Inicio de documento alcanzado, continuando desde abajo +pdfjs-find-reached-bottom = Fin de documento alcanzando, continuando desde arriba +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] { $current } de { $total } coincidencia + *[other] { $current } de { $total } coincidencias + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] Más de { $limit } coincidencia + *[other] Más de { $limit } coincidencias + } +pdfjs-find-not-found = Frase no encontrada + +## Predefined zoom values + +pdfjs-page-scale-width = Ancho de página +pdfjs-page-scale-fit = Ajustar página +pdfjs-page-scale-auto = Zoom automático +pdfjs-page-scale-actual = Tamaño real +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Página { $page } + +## Loading indicator messages + +pdfjs-loading-error = Ocurrió un error al cargar el PDF. +pdfjs-invalid-file-error = Archivo PDF no válido o cocrrupto. +pdfjs-missing-file-error = Archivo PDF faltante. +pdfjs-unexpected-response-error = Respuesta del servidor inesperada. +pdfjs-rendering-error = Ocurrió un error al dibujar la página. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } Anotación] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Ingrese la contraseña para abrir este archivo PDF +pdfjs-password-invalid = Contraseña inválida. Intente nuevamente. +pdfjs-password-ok-button = Aceptar +pdfjs-password-cancel-button = Cancelar +pdfjs-web-fonts-disabled = Tipografía web deshabilitada: no se pueden usar tipos incrustados en PDF. + +## Editing + +pdfjs-editor-free-text-button = + .title = Texto +pdfjs-editor-free-text-button-label = Texto +pdfjs-editor-ink-button = + .title = Dibujar +pdfjs-editor-ink-button-label = Dibujar +pdfjs-editor-stamp-button = + .title = Agregar o editar imágenes +pdfjs-editor-stamp-button-label = Agregar o editar imágenes +pdfjs-editor-highlight-button = + .title = Resaltar +pdfjs-editor-highlight-button-label = Resaltar +pdfjs-highlight-floating-button1 = + .title = Resaltar + .aria-label = Resaltar +pdfjs-highlight-floating-button-label = Resaltar + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Eliminar dibujo +pdfjs-editor-remove-freetext-button = + .title = Eliminar texto +pdfjs-editor-remove-stamp-button = + .title = Eliminar imagen +pdfjs-editor-remove-highlight-button = + .title = Eliminar resaltado + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Color +pdfjs-editor-free-text-size-input = Tamaño +pdfjs-editor-ink-color-input = Color +pdfjs-editor-ink-thickness-input = Espesor +pdfjs-editor-ink-opacity-input = Opacidad +pdfjs-editor-stamp-add-image-button = + .title = Agregar una imagen +pdfjs-editor-stamp-add-image-button-label = Agregar una imagen +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Grosor +pdfjs-editor-free-highlight-thickness-title = + .title = Cambiar el grosor al resaltar elementos que no sean texto +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = Editor de texto + .default-content = Comenzar a tipear… +pdfjs-free-text = + .aria-label = Editor de texto +pdfjs-free-text-default-content = Empezar a tipear… +pdfjs-ink = + .aria-label = Editor de dibujos +pdfjs-ink-canvas = + .aria-label = Imagen creada por el usuario + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = Texto alternativo +pdfjs-editor-alt-text-edit-button = + .aria-label = Editar texto alternativo +pdfjs-editor-alt-text-edit-button-label = Editar el texto alternativo +pdfjs-editor-alt-text-dialog-label = Eligir una opción +pdfjs-editor-alt-text-dialog-description = El texto alternativo (texto alternativo) ayuda cuando las personas no pueden ver la imagen o cuando no se carga. +pdfjs-editor-alt-text-add-description-label = Agregar una descripción +pdfjs-editor-alt-text-add-description-description = Intente escribir 1 o 2 oraciones que describan el tema, el entorno o las acciones. +pdfjs-editor-alt-text-mark-decorative-label = Marcar como decorativo +pdfjs-editor-alt-text-mark-decorative-description = Esto se usa para imágenes ornamentales, como bordes o marcas de agua. +pdfjs-editor-alt-text-cancel-button = Cancelar +pdfjs-editor-alt-text-save-button = Guardar +pdfjs-editor-alt-text-decorative-tooltip = Marcado como decorativo +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = Por ejemplo: “Un joven se sienta a la mesa a comer” +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = Texto alternativo + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Esquina superior izquierda — cambiar el tamaño +pdfjs-editor-resizer-label-top-middle = Arriba en el medio — cambiar el tamaño +pdfjs-editor-resizer-label-top-right = Esquina superior derecha — cambiar el tamaño +pdfjs-editor-resizer-label-middle-right = Al centro a la derecha — cambiar el tamaño +pdfjs-editor-resizer-label-bottom-right = Esquina inferior derecha — cambiar el tamaño +pdfjs-editor-resizer-label-bottom-middle = Abajo en el medio — cambiar el tamaño +pdfjs-editor-resizer-label-bottom-left = Esquina inferior izquierda — cambiar el tamaño +pdfjs-editor-resizer-label-middle-left = Al centro a la izquierda — cambiar el tamaño +pdfjs-editor-resizer-top-left = + .aria-label = Esquina superior izquierda — cambiar el tamaño +pdfjs-editor-resizer-top-middle = + .aria-label = Arriba en el medio — cambiar el tamaño +pdfjs-editor-resizer-top-right = + .aria-label = Esquina superior derecha — cambiar el tamaño +pdfjs-editor-resizer-middle-right = + .aria-label = Al centro a la derecha — cambiar el tamaño +pdfjs-editor-resizer-bottom-right = + .aria-label = Esquina inferior derecha — cambiar el tamaño +pdfjs-editor-resizer-bottom-middle = + .aria-label = Abajo en el medio — cambiar el tamaño +pdfjs-editor-resizer-bottom-left = + .aria-label = Esquina inferior izquierda — cambiar el tamaño +pdfjs-editor-resizer-middle-left = + .aria-label = Al centro a la izquierda — cambiar el tamaño + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Color de resaltado +pdfjs-editor-colorpicker-button = + .title = Cambiar el color +pdfjs-editor-colorpicker-dropdown = + .aria-label = Opciones de color +pdfjs-editor-colorpicker-yellow = + .title = Amarillo +pdfjs-editor-colorpicker-green = + .title = Verde +pdfjs-editor-colorpicker-blue = + .title = Azul +pdfjs-editor-colorpicker-pink = + .title = Rosado +pdfjs-editor-colorpicker-red = + .title = Rojo + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Mostrar todo +pdfjs-editor-highlight-show-all-button = + .title = Mostrar todo + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = Editar texto alternativo (descripción de la imagen) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = Agregar texto alternativo (descripción de la imagen) +pdfjs-editor-new-alt-text-textarea = + .placeholder = Escribir la descripción aquí… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = Descripción corta para las personas que no pueden ver la imagen o cuando la imagen no se carga. +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = Este texto alternativo fue creado automáticamente y puede ser incorrecto. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Conocer más +pdfjs-editor-new-alt-text-create-automatically-button-label = Crear texto alternativo automáticamente +pdfjs-editor-new-alt-text-not-now-button = No ahora +pdfjs-editor-new-alt-text-error-title = No se pudo crear el texto alternativo automáticamente +pdfjs-editor-new-alt-text-error-description = Escriba su propio texto alternativo o pruebe nuevamente más tarde. +pdfjs-editor-new-alt-text-error-close-button = Cerrar +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = Descargando modelo de IA de texto alternativo ({ $downloadedSize } de { $totalSize } MB) + .aria-valuetext = Descargando modelo de IA de texto alternativo ({ $downloadedSize } de { $totalSize } MB) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = Texto alternativo agregado +pdfjs-editor-new-alt-text-added-button-label = Texto alternativo agregado +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = Falta el texto alternativo +pdfjs-editor-new-alt-text-missing-button-label = Falta el texto alternativo +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = Calificar el texto alternativo +pdfjs-editor-new-alt-text-to-review-button-label = Revisar el texto alternativo +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Creado automáticamente: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = Configuración de texto alternativo de la imagen +pdfjs-image-alt-text-settings-button-label = Configuración de texto alternativo de la imagen +pdfjs-editor-alt-text-settings-dialog-label = Configuración de texto alternativo de la imagen +pdfjs-editor-alt-text-settings-automatic-title = Texto alternativo automático +pdfjs-editor-alt-text-settings-create-model-button-label = Crear texto alternativo automáticamente +pdfjs-editor-alt-text-settings-create-model-description = Sugiere descripciones para ayudar a las personas que no pueden ver la imagen o cuando la imagen no se carga. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = Modelo de IA de texto alternativo ({ $totalSize } MB) +pdfjs-editor-alt-text-settings-ai-model-description = Se ejecuta localmente en el dispositivo para que los datos se mantengan privados. Requerido para texto alternativo automático. +pdfjs-editor-alt-text-settings-delete-model-button = Borrar +pdfjs-editor-alt-text-settings-download-model-button = Descargar +pdfjs-editor-alt-text-settings-downloading-model-button = Descargando… +pdfjs-editor-alt-text-settings-editor-title = Editor de texto alternativo +pdfjs-editor-alt-text-settings-show-dialog-button-label = Mostrar el editor de texto alternativo inmediatamente al agregar una imagen +pdfjs-editor-alt-text-settings-show-dialog-description = Te ayuda a asegurarse de que todas las imágenes tengan texto alternativo. +pdfjs-editor-alt-text-settings-close-button = Cerrar + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = Resaltado eliminado +pdfjs-editor-undo-bar-message-freetext = Texto eliminado +pdfjs-editor-undo-bar-message-ink = Dibujo eliminado +pdfjs-editor-undo-bar-message-stamp = Imagen eliminado +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = + { $count -> + [one] { $count } anotación eliminada + *[other] { $count } anotaciones eliminadas + } +pdfjs-editor-undo-bar-undo-button = + .title = Deshacer +pdfjs-editor-undo-bar-undo-button-label = Deshacer +pdfjs-editor-undo-bar-close-button = + .title = Cerrar +pdfjs-editor-undo-bar-close-button-label = Cerrar diff --git a/public/pdfjs/web/locale/es-CL/viewer.ftl b/public/pdfjs/web/locale/es-CL/viewer.ftl new file mode 100644 index 0000000..74389e4 --- /dev/null +++ b/public/pdfjs/web/locale/es-CL/viewer.ftl @@ -0,0 +1,515 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Página anterior +pdfjs-previous-button-label = Anterior +pdfjs-next-button = + .title = Página siguiente +pdfjs-next-button-label = Siguiente +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Página +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = de { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } de { $pagesCount }) +pdfjs-zoom-out-button = + .title = Alejar +pdfjs-zoom-out-button-label = Alejar +pdfjs-zoom-in-button = + .title = Acercar +pdfjs-zoom-in-button-label = Acercar +pdfjs-zoom-select = + .title = Ampliación +pdfjs-presentation-mode-button = + .title = Cambiar al modo de presentación +pdfjs-presentation-mode-button-label = Modo de presentación +pdfjs-open-file-button = + .title = Abrir archivo +pdfjs-open-file-button-label = Abrir +pdfjs-print-button = + .title = Imprimir +pdfjs-print-button-label = Imprimir +pdfjs-save-button = + .title = Guardar +pdfjs-save-button-label = Guardar +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Descargar +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Descargar +pdfjs-bookmark-button = + .title = Página actual (Ver URL de la página actual) +pdfjs-bookmark-button-label = Página actual + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Herramientas +pdfjs-tools-button-label = Herramientas +pdfjs-first-page-button = + .title = Ir a la primera página +pdfjs-first-page-button-label = Ir a la primera página +pdfjs-last-page-button = + .title = Ir a la última página +pdfjs-last-page-button-label = Ir a la última página +pdfjs-page-rotate-cw-button = + .title = Girar a la derecha +pdfjs-page-rotate-cw-button-label = Girar a la derecha +pdfjs-page-rotate-ccw-button = + .title = Girar a la izquierda +pdfjs-page-rotate-ccw-button-label = Girar a la izquierda +pdfjs-cursor-text-select-tool-button = + .title = Activar la herramienta de selección de texto +pdfjs-cursor-text-select-tool-button-label = Herramienta de selección de texto +pdfjs-cursor-hand-tool-button = + .title = Activar la herramienta de mano +pdfjs-cursor-hand-tool-button-label = Herramienta de mano +pdfjs-scroll-page-button = + .title = Usar desplazamiento de página +pdfjs-scroll-page-button-label = Desplazamiento de página +pdfjs-scroll-vertical-button = + .title = Usar desplazamiento vertical +pdfjs-scroll-vertical-button-label = Desplazamiento vertical +pdfjs-scroll-horizontal-button = + .title = Usar desplazamiento horizontal +pdfjs-scroll-horizontal-button-label = Desplazamiento horizontal +pdfjs-scroll-wrapped-button = + .title = Usar desplazamiento en bloque +pdfjs-scroll-wrapped-button-label = Desplazamiento en bloque +pdfjs-spread-none-button = + .title = No juntar páginas a modo de libro +pdfjs-spread-none-button-label = Vista de una página +pdfjs-spread-odd-button = + .title = Junta las páginas partiendo con una de número impar +pdfjs-spread-odd-button-label = Vista de libro impar +pdfjs-spread-even-button = + .title = Junta las páginas partiendo con una de número par +pdfjs-spread-even-button-label = Vista de libro par + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Propiedades del documento… +pdfjs-document-properties-button-label = Propiedades del documento… +pdfjs-document-properties-file-name = Nombre de archivo: +pdfjs-document-properties-file-size = Tamaño del archivo: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } bytes) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } bytes) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bytes) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bytes) +pdfjs-document-properties-title = Título: +pdfjs-document-properties-author = Autor: +pdfjs-document-properties-subject = Asunto: +pdfjs-document-properties-keywords = Palabras clave: +pdfjs-document-properties-creation-date = Fecha de creación: +pdfjs-document-properties-modification-date = Fecha de modificación: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Creador: +pdfjs-document-properties-producer = Productor del PDF: +pdfjs-document-properties-version = Versión de PDF: +pdfjs-document-properties-page-count = Cantidad de páginas: +pdfjs-document-properties-page-size = Tamaño de la página: +pdfjs-document-properties-page-size-unit-inches = in +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = vertical +pdfjs-document-properties-page-size-orientation-landscape = horizontal +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Carta +pdfjs-document-properties-page-size-name-legal = Oficio + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Vista rápida en Web: +pdfjs-document-properties-linearized-yes = Sí +pdfjs-document-properties-linearized-no = No +pdfjs-document-properties-close-button = Cerrar + +## Print + +pdfjs-print-progress-message = Preparando documento para impresión… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Cancelar +pdfjs-printing-not-supported = Advertencia: Imprimir no está soportado completamente por este navegador. +pdfjs-printing-not-ready = Advertencia: El PDF no está completamente cargado para ser impreso. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Barra lateral +pdfjs-toggle-sidebar-notification-button = + .title = Cambiar barra lateral (índice de contenidos del documento/adjuntos/capas) +pdfjs-toggle-sidebar-button-label = Mostrar u ocultar la barra lateral +pdfjs-document-outline-button = + .title = Mostrar esquema del documento (doble clic para expandir/contraer todos los elementos) +pdfjs-document-outline-button-label = Esquema del documento +pdfjs-attachments-button = + .title = Mostrar adjuntos +pdfjs-attachments-button-label = Adjuntos +pdfjs-layers-button = + .title = Mostrar capas (doble clic para restablecer todas las capas al estado predeterminado) +pdfjs-layers-button-label = Capas +pdfjs-thumbs-button = + .title = Mostrar miniaturas +pdfjs-thumbs-button-label = Miniaturas +pdfjs-current-outline-item-button = + .title = Buscar elemento de esquema actual +pdfjs-current-outline-item-button-label = Elemento de esquema actual +pdfjs-findbar-button = + .title = Buscar en el documento +pdfjs-findbar-button-label = Buscar +pdfjs-additional-layers = Capas adicionales + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Página { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Miniatura de la página { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Encontrar + .placeholder = Encontrar en el documento… +pdfjs-find-previous-button = + .title = Buscar la aparición anterior de la frase +pdfjs-find-previous-button-label = Previo +pdfjs-find-next-button = + .title = Buscar la siguiente aparición de la frase +pdfjs-find-next-button-label = Siguiente +pdfjs-find-highlight-checkbox = Destacar todos +pdfjs-find-match-case-checkbox-label = Coincidir mayús./minús. +pdfjs-find-match-diacritics-checkbox-label = Coincidir diacríticos +pdfjs-find-entire-word-checkbox-label = Palabras completas +pdfjs-find-reached-top = Se alcanzó el inicio del documento, continuando desde el final +pdfjs-find-reached-bottom = Se alcanzó el final del documento, continuando desde el inicio +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] Coincidencia { $current } de { $total } + *[other] Coincidencia { $current } de { $total } + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] Más de { $limit } coincidencia + *[other] Más de { $limit } coincidencias + } +pdfjs-find-not-found = Frase no encontrada + +## Predefined zoom values + +pdfjs-page-scale-width = Ancho de página +pdfjs-page-scale-fit = Ajuste de página +pdfjs-page-scale-auto = Aumento automático +pdfjs-page-scale-actual = Tamaño actual +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Página { $page } + +## Loading indicator messages + +pdfjs-loading-error = Ocurrió un error al cargar el PDF. +pdfjs-invalid-file-error = Archivo PDF inválido o corrupto. +pdfjs-missing-file-error = Falta el archivo PDF. +pdfjs-unexpected-response-error = Respuesta del servidor inesperada. +pdfjs-rendering-error = Ocurrió un error al renderizar la página. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } Anotación] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Ingresa la contraseña para abrir este archivo PDF. +pdfjs-password-invalid = Contraseña inválida. Por favor, vuelve a intentarlo. +pdfjs-password-ok-button = Aceptar +pdfjs-password-cancel-button = Cancelar +pdfjs-web-fonts-disabled = Las tipografías web están desactivadas: imposible usar las fuentes PDF embebidas. + +## Editing + +pdfjs-editor-free-text-button = + .title = Texto +pdfjs-editor-free-text-button-label = Texto +pdfjs-editor-ink-button = + .title = Dibujar +pdfjs-editor-ink-button-label = Dibujar +pdfjs-editor-stamp-button = + .title = Añadir o editar imágenes +pdfjs-editor-stamp-button-label = Añadir o editar imágenes +pdfjs-editor-highlight-button = + .title = Destacar +pdfjs-editor-highlight-button-label = Destacar +pdfjs-highlight-floating-button1 = + .title = Destacar + .aria-label = Destacar +pdfjs-highlight-floating-button-label = Destacar + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Eliminar dibujo +pdfjs-editor-remove-freetext-button = + .title = Eliminar texto +pdfjs-editor-remove-stamp-button = + .title = Eliminar imagen +pdfjs-editor-remove-highlight-button = + .title = Quitar resaltado + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Color +pdfjs-editor-free-text-size-input = Tamaño +pdfjs-editor-ink-color-input = Color +pdfjs-editor-ink-thickness-input = Grosor +pdfjs-editor-ink-opacity-input = Opacidad +pdfjs-editor-stamp-add-image-button = + .title = Añadir imagen +pdfjs-editor-stamp-add-image-button-label = Añadir imagen +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Grosor +pdfjs-editor-free-highlight-thickness-title = + .title = Cambia el grosor al resaltar elementos que no sean texto +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = Editor de texto + .default-content = Empieza a escribir… +pdfjs-free-text = + .aria-label = Editor de texto +pdfjs-free-text-default-content = Empieza a escribir… +pdfjs-ink = + .aria-label = Editor de dibujos +pdfjs-ink-canvas = + .aria-label = Imagen creada por el usuario + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = Texto alternativo +pdfjs-editor-alt-text-edit-button = + .aria-label = Editar texto alternativo +pdfjs-editor-alt-text-edit-button-label = Editar texto alternativo +pdfjs-editor-alt-text-dialog-label = Elige una opción +pdfjs-editor-alt-text-dialog-description = El texto alternativo (alt text) ayuda cuando las personas no pueden ver la imagen o cuando no se carga. +pdfjs-editor-alt-text-add-description-label = Añade una descripción +pdfjs-editor-alt-text-add-description-description = Intenta escribir 1 o 2 oraciones que describan el tema, el ambiente o las acciones. +pdfjs-editor-alt-text-mark-decorative-label = Marcar como decorativa +pdfjs-editor-alt-text-mark-decorative-description = Se utiliza para imágenes ornamentales, como bordes o marcas de agua. +pdfjs-editor-alt-text-cancel-button = Cancelar +pdfjs-editor-alt-text-save-button = Guardar +pdfjs-editor-alt-text-decorative-tooltip = Marcada como decorativa +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = Por ejemplo: “Un joven se sienta a la mesa a comer” +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = Texto alternativo + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Esquina superior izquierda — cambiar el tamaño +pdfjs-editor-resizer-label-top-middle = Borde superior en el medio — cambiar el tamaño +pdfjs-editor-resizer-label-top-right = Esquina superior derecha — cambiar el tamaño +pdfjs-editor-resizer-label-middle-right = Borde derecho en el medio — cambiar el tamaño +pdfjs-editor-resizer-label-bottom-right = Esquina inferior derecha — cambiar el tamaño +pdfjs-editor-resizer-label-bottom-middle = Borde inferior en el medio — cambiar el tamaño +pdfjs-editor-resizer-label-bottom-left = Esquina inferior izquierda — cambiar el tamaño +pdfjs-editor-resizer-label-middle-left = Borde izquierdo en el medio — cambiar el tamaño +pdfjs-editor-resizer-top-left = + .aria-label = Esquina superior izquierda — cambiar el tamaño +pdfjs-editor-resizer-top-middle = + .aria-label = Borde superior en el medio — cambiar el tamaño +pdfjs-editor-resizer-top-right = + .aria-label = Esquina superior derecha — cambiar el tamaño +pdfjs-editor-resizer-middle-right = + .aria-label = Borde derecho en el medio — cambiar el tamaño +pdfjs-editor-resizer-bottom-right = + .aria-label = Esquina inferior derecha — cambiar el tamaño +pdfjs-editor-resizer-bottom-middle = + .aria-label = Borde inferior en el medio — cambiar el tamaño +pdfjs-editor-resizer-bottom-left = + .aria-label = Esquina inferior izquierda — cambiar el tamaño +pdfjs-editor-resizer-middle-left = + .aria-label = Borde izquierdo en el medio — cambiar el tamaño + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Color de resaltado +pdfjs-editor-colorpicker-button = + .title = Cambiar color +pdfjs-editor-colorpicker-dropdown = + .aria-label = Opciones de color +pdfjs-editor-colorpicker-yellow = + .title = Amarillo +pdfjs-editor-colorpicker-green = + .title = Verde +pdfjs-editor-colorpicker-blue = + .title = Azul +pdfjs-editor-colorpicker-pink = + .title = Rosa +pdfjs-editor-colorpicker-red = + .title = Rojo + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Mostrar todo +pdfjs-editor-highlight-show-all-button = + .title = Mostrar todo + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = Editar texto alternativo (descripción de la imagen) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = Añadir texto alternativo (descripción de la imagen) +pdfjs-editor-new-alt-text-textarea = + .placeholder = Escribe tu descripción aquí… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = Breve descripción para las personas que no pueden ver la imagen o cuando la imagen no se carga. +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = Este texto alternativo fue creado automáticamente y puede ser incorrecto. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Aprender más +pdfjs-editor-new-alt-text-create-automatically-button-label = Crear texto alternativo automáticamente +pdfjs-editor-new-alt-text-not-now-button = Ahora no +pdfjs-editor-new-alt-text-error-title = No se pudo crear el texto alternativo automáticamente +pdfjs-editor-new-alt-text-error-description = Escribe tu propio texto alternativo o vuelve a intentarlo más tarde. +pdfjs-editor-new-alt-text-error-close-button = Cerrar +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = Descargando el modelo de IA de texto alternativo ({ $downloadedSize } de { $totalSize } MB) + .aria-valuetext = Descargando el modelo de IA de texto alternativo ({ $downloadedSize } de { $totalSize } MB) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = Se añadió el texto alternativo +pdfjs-editor-new-alt-text-added-button-label = Se añadió el texto alternativo +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = Falta el texto alternativo +pdfjs-editor-new-alt-text-missing-button-label = Falta el texto alternativo +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = Revisar el texto alternativo +pdfjs-editor-new-alt-text-to-review-button-label = Revisar el texto alternativo +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Creado automáticamente: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = Ajustes del texto alternativo de la imagen +pdfjs-image-alt-text-settings-button-label = Ajustes del texto alternativo de la imagen +pdfjs-editor-alt-text-settings-dialog-label = Ajustes del texto alternativo de la imagen +pdfjs-editor-alt-text-settings-automatic-title = Texto alternativo automático +pdfjs-editor-alt-text-settings-create-model-button-label = Crear texto alternativo automáticamente +pdfjs-editor-alt-text-settings-create-model-description = Sugiere descripciones para ayudar a las personas que no pueden ver la imagen o cuando la imagen no se carga. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = Modelo de IA de texto alternativo ({ $totalSize } MB) +pdfjs-editor-alt-text-settings-ai-model-description = Se ejecuta localmente en tu dispositivo para que tus datos permanezcan privados. Necesario para el texto alternativo automático. +pdfjs-editor-alt-text-settings-delete-model-button = Eliminar +pdfjs-editor-alt-text-settings-download-model-button = Descargar +pdfjs-editor-alt-text-settings-downloading-model-button = Bajando… +pdfjs-editor-alt-text-settings-editor-title = Editor de texto alternativo +pdfjs-editor-alt-text-settings-show-dialog-button-label = Mostrar el editor de texto alternativo inmediatamente al añadir una imagen +pdfjs-editor-alt-text-settings-show-dialog-description = Te ayuda a asegurarte de que todas tus imágenes tengan texto alternativo. +pdfjs-editor-alt-text-settings-close-button = Cerrar + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = Resaltado eliminado +pdfjs-editor-undo-bar-message-freetext = Texto eliminado +pdfjs-editor-undo-bar-message-ink = Dibujo eliminado +pdfjs-editor-undo-bar-message-stamp = Imagen eliminada +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = + { $count -> + [one] { $count } anotación eliminada + *[other] { $count } anotaciones eliminadas + } +pdfjs-editor-undo-bar-undo-button = + .title = Deshacer +pdfjs-editor-undo-bar-undo-button-label = Deshacer +pdfjs-editor-undo-bar-close-button = + .title = Cerrar +pdfjs-editor-undo-bar-close-button-label = Cerrar diff --git a/public/pdfjs/web/locale/es-ES/viewer.ftl b/public/pdfjs/web/locale/es-ES/viewer.ftl new file mode 100644 index 0000000..f610a17 --- /dev/null +++ b/public/pdfjs/web/locale/es-ES/viewer.ftl @@ -0,0 +1,515 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Página anterior +pdfjs-previous-button-label = Anterior +pdfjs-next-button = + .title = Página siguiente +pdfjs-next-button-label = Siguiente +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Página +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = de { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } de { $pagesCount }) +pdfjs-zoom-out-button = + .title = Reducir +pdfjs-zoom-out-button-label = Reducir +pdfjs-zoom-in-button = + .title = Aumentar +pdfjs-zoom-in-button-label = Aumentar +pdfjs-zoom-select = + .title = Tamaño +pdfjs-presentation-mode-button = + .title = Cambiar al modo presentación +pdfjs-presentation-mode-button-label = Modo presentación +pdfjs-open-file-button = + .title = Abrir archivo +pdfjs-open-file-button-label = Abrir +pdfjs-print-button = + .title = Imprimir +pdfjs-print-button-label = Imprimir +pdfjs-save-button = + .title = Guardar +pdfjs-save-button-label = Guardar +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Descargar +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Descargar +pdfjs-bookmark-button = + .title = Página actual (Ver URL de la página actual) +pdfjs-bookmark-button-label = Página actual + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Herramientas +pdfjs-tools-button-label = Herramientas +pdfjs-first-page-button = + .title = Ir a la primera página +pdfjs-first-page-button-label = Ir a la primera página +pdfjs-last-page-button = + .title = Ir a la última página +pdfjs-last-page-button-label = Ir a la última página +pdfjs-page-rotate-cw-button = + .title = Rotar en sentido horario +pdfjs-page-rotate-cw-button-label = Rotar en sentido horario +pdfjs-page-rotate-ccw-button = + .title = Rotar en sentido antihorario +pdfjs-page-rotate-ccw-button-label = Rotar en sentido antihorario +pdfjs-cursor-text-select-tool-button = + .title = Activar herramienta de selección de texto +pdfjs-cursor-text-select-tool-button-label = Herramienta de selección de texto +pdfjs-cursor-hand-tool-button = + .title = Activar herramienta de mano +pdfjs-cursor-hand-tool-button-label = Herramienta de mano +pdfjs-scroll-page-button = + .title = Usar desplazamiento de página +pdfjs-scroll-page-button-label = Desplazamiento de página +pdfjs-scroll-vertical-button = + .title = Usar desplazamiento vertical +pdfjs-scroll-vertical-button-label = Desplazamiento vertical +pdfjs-scroll-horizontal-button = + .title = Usar desplazamiento horizontal +pdfjs-scroll-horizontal-button-label = Desplazamiento horizontal +pdfjs-scroll-wrapped-button = + .title = Usar desplazamiento en bloque +pdfjs-scroll-wrapped-button-label = Desplazamiento en bloque +pdfjs-spread-none-button = + .title = No juntar páginas en vista de libro +pdfjs-spread-none-button-label = Vista de libro +pdfjs-spread-odd-button = + .title = Juntar las páginas partiendo de una con número impar +pdfjs-spread-odd-button-label = Vista de libro impar +pdfjs-spread-even-button = + .title = Juntar las páginas partiendo de una con número par +pdfjs-spread-even-button-label = Vista de libro par + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Propiedades del documento… +pdfjs-document-properties-button-label = Propiedades del documento… +pdfjs-document-properties-file-name = Nombre de archivo: +pdfjs-document-properties-file-size = Tamaño de archivo: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } bytes) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } bytes) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bytes) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bytes) +pdfjs-document-properties-title = Título: +pdfjs-document-properties-author = Autor: +pdfjs-document-properties-subject = Asunto: +pdfjs-document-properties-keywords = Palabras clave: +pdfjs-document-properties-creation-date = Fecha de creación: +pdfjs-document-properties-modification-date = Fecha de modificación: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Creador: +pdfjs-document-properties-producer = Productor PDF: +pdfjs-document-properties-version = Versión PDF: +pdfjs-document-properties-page-count = Número de páginas: +pdfjs-document-properties-page-size = Tamaño de la página: +pdfjs-document-properties-page-size-unit-inches = in +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = vertical +pdfjs-document-properties-page-size-orientation-landscape = horizontal +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Carta +pdfjs-document-properties-page-size-name-legal = Legal + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Vista rápida de la web: +pdfjs-document-properties-linearized-yes = Sí +pdfjs-document-properties-linearized-no = No +pdfjs-document-properties-close-button = Cerrar + +## Print + +pdfjs-print-progress-message = Preparando documento para impresión… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Cancelar +pdfjs-printing-not-supported = Advertencia: Imprimir no está totalmente soportado por este navegador. +pdfjs-printing-not-ready = Advertencia: Este PDF no se ha cargado completamente para poder imprimirse. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Cambiar barra lateral +pdfjs-toggle-sidebar-notification-button = + .title = Alternar barra lateral (el documento contiene esquemas/adjuntos/capas) +pdfjs-toggle-sidebar-button-label = Cambiar barra lateral +pdfjs-document-outline-button = + .title = Mostrar resumen del documento (doble clic para expandir/contraer todos los elementos) +pdfjs-document-outline-button-label = Resumen de documento +pdfjs-attachments-button = + .title = Mostrar adjuntos +pdfjs-attachments-button-label = Adjuntos +pdfjs-layers-button = + .title = Mostrar capas (doble clic para restablecer todas las capas al estado predeterminado) +pdfjs-layers-button-label = Capas +pdfjs-thumbs-button = + .title = Mostrar miniaturas +pdfjs-thumbs-button-label = Miniaturas +pdfjs-current-outline-item-button = + .title = Encontrar elemento de esquema actual +pdfjs-current-outline-item-button-label = Elemento de esquema actual +pdfjs-findbar-button = + .title = Buscar en el documento +pdfjs-findbar-button-label = Buscar +pdfjs-additional-layers = Capas adicionales + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Página { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Miniatura de la página { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Buscar + .placeholder = Buscar en el documento… +pdfjs-find-previous-button = + .title = Encontrar la anterior aparición de la frase +pdfjs-find-previous-button-label = Anterior +pdfjs-find-next-button = + .title = Encontrar la siguiente aparición de esta frase +pdfjs-find-next-button-label = Siguiente +pdfjs-find-highlight-checkbox = Resaltar todos +pdfjs-find-match-case-checkbox-label = Coincidencia de mayús./minús. +pdfjs-find-match-diacritics-checkbox-label = Coincidir diacríticos +pdfjs-find-entire-word-checkbox-label = Palabras completas +pdfjs-find-reached-top = Se alcanzó el inicio del documento, se continúa desde el final +pdfjs-find-reached-bottom = Se alcanzó el final del documento, se continúa desde el inicio +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] { $current } de { $total } coincidencia + *[other] { $current } de { $total } coincidencias + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] Más de { $limit } coincidencia + *[other] Más de { $limit } coincidencias + } +pdfjs-find-not-found = Frase no encontrada + +## Predefined zoom values + +pdfjs-page-scale-width = Anchura de la página +pdfjs-page-scale-fit = Ajuste de la página +pdfjs-page-scale-auto = Tamaño automático +pdfjs-page-scale-actual = Tamaño real +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Página { $page } + +## Loading indicator messages + +pdfjs-loading-error = Ocurrió un error al cargar el PDF. +pdfjs-invalid-file-error = Fichero PDF no válido o corrupto. +pdfjs-missing-file-error = No hay fichero PDF. +pdfjs-unexpected-response-error = Respuesta inesperada del servidor. +pdfjs-rendering-error = Ocurrió un error al renderizar la página. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [Anotación { $type }] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Introduzca la contraseña para abrir este archivo PDF. +pdfjs-password-invalid = Contraseña no válida. Vuelva a intentarlo. +pdfjs-password-ok-button = Aceptar +pdfjs-password-cancel-button = Cancelar +pdfjs-web-fonts-disabled = Las tipografías web están desactivadas: es imposible usar las tipografías PDF embebidas. + +## Editing + +pdfjs-editor-free-text-button = + .title = Texto +pdfjs-editor-free-text-button-label = Texto +pdfjs-editor-ink-button = + .title = Dibujar +pdfjs-editor-ink-button-label = Dibujar +pdfjs-editor-stamp-button = + .title = Añadir o editar imágenes +pdfjs-editor-stamp-button-label = Añadir o editar imágenes +pdfjs-editor-highlight-button = + .title = Resaltar +pdfjs-editor-highlight-button-label = Resaltar +pdfjs-highlight-floating-button1 = + .title = Resaltar + .aria-label = Resaltar +pdfjs-highlight-floating-button-label = Resaltar + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Eliminar dibujo +pdfjs-editor-remove-freetext-button = + .title = Eliminar texto +pdfjs-editor-remove-stamp-button = + .title = Eliminar imagen +pdfjs-editor-remove-highlight-button = + .title = Quitar resaltado + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Color +pdfjs-editor-free-text-size-input = Tamaño +pdfjs-editor-ink-color-input = Color +pdfjs-editor-ink-thickness-input = Grosor +pdfjs-editor-ink-opacity-input = Opacidad +pdfjs-editor-stamp-add-image-button = + .title = Añadir imagen +pdfjs-editor-stamp-add-image-button-label = Añadir imagen +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Grosor +pdfjs-editor-free-highlight-thickness-title = + .title = Cambiar el grosor al resaltar elementos que no sean texto +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = Editor de texto + .default-content = Empiece a escribir… +pdfjs-free-text = + .aria-label = Editor de texto +pdfjs-free-text-default-content = Empezar a escribir… +pdfjs-ink = + .aria-label = Editor de dibujos +pdfjs-ink-canvas = + .aria-label = Imagen creada por el usuario + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = Texto alternativo +pdfjs-editor-alt-text-edit-button = + .aria-label = Editar el texto alternativo +pdfjs-editor-alt-text-edit-button-label = Editar el texto alternativo +pdfjs-editor-alt-text-dialog-label = Eligir una opción +pdfjs-editor-alt-text-dialog-description = El texto alternativo (texto alternativo) ayuda cuando las personas no pueden ver la imagen o cuando no se carga. +pdfjs-editor-alt-text-add-description-label = Añadir una descripción +pdfjs-editor-alt-text-add-description-description = Intente escribir 1 o 2 frases que describan el tema, el entorno o las acciones. +pdfjs-editor-alt-text-mark-decorative-label = Marcar como decorativa +pdfjs-editor-alt-text-mark-decorative-description = Se utiliza para imágenes ornamentales, como bordes o marcas de agua. +pdfjs-editor-alt-text-cancel-button = Cancelar +pdfjs-editor-alt-text-save-button = Guardar +pdfjs-editor-alt-text-decorative-tooltip = Marcada como decorativa +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = Por ejemplo: “Un joven se sienta a la mesa a comer” +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = Texto alternativo + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Esquina superior izquierda — redimensionar +pdfjs-editor-resizer-label-top-middle = Borde superior en el medio — redimensionar +pdfjs-editor-resizer-label-top-right = Esquina superior derecha — redimensionar +pdfjs-editor-resizer-label-middle-right = Borde derecho en el medio — redimensionar +pdfjs-editor-resizer-label-bottom-right = Esquina inferior derecha — redimensionar +pdfjs-editor-resizer-label-bottom-middle = Borde inferior en el medio — redimensionar +pdfjs-editor-resizer-label-bottom-left = Esquina inferior izquierda — redimensionar +pdfjs-editor-resizer-label-middle-left = Borde izquierdo en el medio — redimensionar +pdfjs-editor-resizer-top-left = + .aria-label = Esquina superior izquierda — redimensionar +pdfjs-editor-resizer-top-middle = + .aria-label = Borde superior en el medio — redimensionar +pdfjs-editor-resizer-top-right = + .aria-label = Esquina superior derecha — redimensionar +pdfjs-editor-resizer-middle-right = + .aria-label = Borde derecho en el medio — redimensionar +pdfjs-editor-resizer-bottom-right = + .aria-label = Esquina inferior derecha — redimensionar +pdfjs-editor-resizer-bottom-middle = + .aria-label = Borde inferior en el medio — redimensionar +pdfjs-editor-resizer-bottom-left = + .aria-label = Esquina inferior izquierda — redimensionar +pdfjs-editor-resizer-middle-left = + .aria-label = Borde izquierdo en el medio — redimensionar + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Color de resaltado +pdfjs-editor-colorpicker-button = + .title = Cambiar color +pdfjs-editor-colorpicker-dropdown = + .aria-label = Opciones de color +pdfjs-editor-colorpicker-yellow = + .title = Amarillo +pdfjs-editor-colorpicker-green = + .title = Verde +pdfjs-editor-colorpicker-blue = + .title = Azul +pdfjs-editor-colorpicker-pink = + .title = Rosa +pdfjs-editor-colorpicker-red = + .title = Rojo + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Mostrar todo +pdfjs-editor-highlight-show-all-button = + .title = Mostrar todo + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = Editar texto alternativo (descripción de la imagen) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = Añadir texto alternativo (descripción de la imagen) +pdfjs-editor-new-alt-text-textarea = + .placeholder = Escribir la descripción aquí… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = Breve descripción para las personas que no pueden ver la imagen o cuando la imagen no se carga. +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = Este texto alternativo fue creado automáticamente y puede ser inexacto. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Saber más +pdfjs-editor-new-alt-text-create-automatically-button-label = Crear texto alternativo automáticamente +pdfjs-editor-new-alt-text-not-now-button = Ahora no +pdfjs-editor-new-alt-text-error-title = No se ha podido crear el texto alternativo automáticamente +pdfjs-editor-new-alt-text-error-description = Escriba su propio texto alternativo o inténtelo de nuevo más tarde. +pdfjs-editor-new-alt-text-error-close-button = Cerrar +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = Descargando el modelo de IA de texto alternativo ({ $downloadedSize } de { $totalSize } MB) + .aria-valuetext = Descargando el modelo de IA de texto alternativo ({ $downloadedSize } de { $totalSize } MB) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = Se añadió el texto alternativo +pdfjs-editor-new-alt-text-added-button-label = Se añadió el texto alternativo +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = Falta el texto alternativo +pdfjs-editor-new-alt-text-missing-button-label = Falta el texto alternativo +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = Revisar el texto alternativo +pdfjs-editor-new-alt-text-to-review-button-label = Revisar el texto alternativo +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Creado automáticamente: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = Ajustes del texto alternativo de la imagen +pdfjs-image-alt-text-settings-button-label = Ajustes del texto alternativo de la imagen +pdfjs-editor-alt-text-settings-dialog-label = Ajustes del texto alternativo de la imagen +pdfjs-editor-alt-text-settings-automatic-title = Texto alternativo automático +pdfjs-editor-alt-text-settings-create-model-button-label = Crear texto alternativo automáticamente +pdfjs-editor-alt-text-settings-create-model-description = Sugiere descripciones para ayudar a las personas que no pueden ver la imagen o cuando la imagen no se carga. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = Modelo de IA de texto alternativo ({ $totalSize } MB) +pdfjs-editor-alt-text-settings-ai-model-description = Se ejecuta localmente en el dispositivo para que los datos se mantengan privados. Requerido para texto alternativo automático. +pdfjs-editor-alt-text-settings-delete-model-button = Eliminar +pdfjs-editor-alt-text-settings-download-model-button = Descargar +pdfjs-editor-alt-text-settings-downloading-model-button = Descargando… +pdfjs-editor-alt-text-settings-editor-title = Editor de texto alternativo +pdfjs-editor-alt-text-settings-show-dialog-button-label = Mostrar el editor de texto alternativo inmediatamente al añadir una imagen +pdfjs-editor-alt-text-settings-show-dialog-description = Le ayuda a asegurarse de que todas sus imágenes tengan texto alternativo. +pdfjs-editor-alt-text-settings-close-button = Cerrar + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = Resaltado eliminado +pdfjs-editor-undo-bar-message-freetext = Texto eliminado +pdfjs-editor-undo-bar-message-ink = Dibujo eliminado +pdfjs-editor-undo-bar-message-stamp = Imagen eliminada +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = + { $count -> + [one] { $count } anotación eliminada + *[other] { $count } anotaciones eliminadas + } +pdfjs-editor-undo-bar-undo-button = + .title = Deshacer +pdfjs-editor-undo-bar-undo-button-label = Deshacer +pdfjs-editor-undo-bar-close-button = + .title = Cerrar +pdfjs-editor-undo-bar-close-button-label = Cerrar diff --git a/public/pdfjs/web/locale/es-MX/viewer.ftl b/public/pdfjs/web/locale/es-MX/viewer.ftl new file mode 100644 index 0000000..03afe7c --- /dev/null +++ b/public/pdfjs/web/locale/es-MX/viewer.ftl @@ -0,0 +1,515 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Página anterior +pdfjs-previous-button-label = Anterior +pdfjs-next-button = + .title = Página siguiente +pdfjs-next-button-label = Siguiente +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Página +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = de { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } de { $pagesCount }) +pdfjs-zoom-out-button = + .title = Reducir +pdfjs-zoom-out-button-label = Reducir +pdfjs-zoom-in-button = + .title = Aumentar +pdfjs-zoom-in-button-label = Aumentar +pdfjs-zoom-select = + .title = Zoom +pdfjs-presentation-mode-button = + .title = Cambiar al modo presentación +pdfjs-presentation-mode-button-label = Modo presentación +pdfjs-open-file-button = + .title = Abrir archivo +pdfjs-open-file-button-label = Abrir +pdfjs-print-button = + .title = Imprimir +pdfjs-print-button-label = Imprimir +pdfjs-save-button = + .title = Guardar +pdfjs-save-button-label = Guardar +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Descargar +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Descargar +pdfjs-bookmark-button = + .title = Página actual (Ver URL de la página actual) +pdfjs-bookmark-button-label = Página actual + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Herramientas +pdfjs-tools-button-label = Herramientas +pdfjs-first-page-button = + .title = Ir a la primera página +pdfjs-first-page-button-label = Ir a la primera página +pdfjs-last-page-button = + .title = Ir a la última página +pdfjs-last-page-button-label = Ir a la última página +pdfjs-page-rotate-cw-button = + .title = Girar a la derecha +pdfjs-page-rotate-cw-button-label = Girar a la derecha +pdfjs-page-rotate-ccw-button = + .title = Girar a la izquierda +pdfjs-page-rotate-ccw-button-label = Girar a la izquierda +pdfjs-cursor-text-select-tool-button = + .title = Activar la herramienta de selección de texto +pdfjs-cursor-text-select-tool-button-label = Herramienta de selección de texto +pdfjs-cursor-hand-tool-button = + .title = Activar la herramienta de mano +pdfjs-cursor-hand-tool-button-label = Herramienta de mano +pdfjs-scroll-page-button = + .title = Usar desplazamiento de página +pdfjs-scroll-page-button-label = Desplazamiento de página +pdfjs-scroll-vertical-button = + .title = Usar desplazamiento vertical +pdfjs-scroll-vertical-button-label = Desplazamiento vertical +pdfjs-scroll-horizontal-button = + .title = Usar desplazamiento horizontal +pdfjs-scroll-horizontal-button-label = Desplazamiento horizontal +pdfjs-scroll-wrapped-button = + .title = Usar desplazamiento encapsulado +pdfjs-scroll-wrapped-button-label = Desplazamiento encapsulado +pdfjs-spread-none-button = + .title = No unir páginas separadas +pdfjs-spread-none-button-label = Vista de una página +pdfjs-spread-odd-button = + .title = Unir las páginas partiendo con una de número impar +pdfjs-spread-odd-button-label = Vista de libro impar +pdfjs-spread-even-button = + .title = Juntar las páginas partiendo con una de número par +pdfjs-spread-even-button-label = Vista de libro par + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Propiedades del documento… +pdfjs-document-properties-button-label = Propiedades del documento… +pdfjs-document-properties-file-name = Nombre del archivo: +pdfjs-document-properties-file-size = Tamaño del archivo: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } bytes) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } bytes) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bytes) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bytes) +pdfjs-document-properties-title = Título: +pdfjs-document-properties-author = Autor: +pdfjs-document-properties-subject = Asunto: +pdfjs-document-properties-keywords = Palabras claves: +pdfjs-document-properties-creation-date = Fecha de creación: +pdfjs-document-properties-modification-date = Fecha de modificación: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Creador: +pdfjs-document-properties-producer = Productor PDF: +pdfjs-document-properties-version = Versión PDF: +pdfjs-document-properties-page-count = Número de páginas: +pdfjs-document-properties-page-size = Tamaño de la página: +pdfjs-document-properties-page-size-unit-inches = in +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = vertical +pdfjs-document-properties-page-size-orientation-landscape = horizontal +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Carta +pdfjs-document-properties-page-size-name-legal = Oficio + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Vista rápida de la web: +pdfjs-document-properties-linearized-yes = Sí +pdfjs-document-properties-linearized-no = No +pdfjs-document-properties-close-button = Cerrar + +## Print + +pdfjs-print-progress-message = Preparando documento para impresión… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Cancelar +pdfjs-printing-not-supported = Advertencia: La impresión no esta completamente soportada por este navegador. +pdfjs-printing-not-ready = Advertencia: El PDF no cargo completamente para impresión. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Cambiar barra lateral +pdfjs-toggle-sidebar-notification-button = + .title = Alternar barra lateral (el documento contiene esquemas/adjuntos/capas) +pdfjs-toggle-sidebar-button-label = Cambiar barra lateral +pdfjs-document-outline-button = + .title = Mostrar esquema del documento (doble clic para expandir/contraer todos los elementos) +pdfjs-document-outline-button-label = Esquema del documento +pdfjs-attachments-button = + .title = Mostrar adjuntos +pdfjs-attachments-button-label = Adjuntos +pdfjs-layers-button = + .title = Mostrar capas (doble clic para restablecer todas las capas al estado predeterminado) +pdfjs-layers-button-label = Capas +pdfjs-thumbs-button = + .title = Mostrar miniaturas +pdfjs-thumbs-button-label = Miniaturas +pdfjs-current-outline-item-button = + .title = Buscar elemento de esquema actual +pdfjs-current-outline-item-button-label = Elemento de esquema actual +pdfjs-findbar-button = + .title = Buscar en el documento +pdfjs-findbar-button-label = Buscar +pdfjs-additional-layers = Capas adicionales + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Página { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Miniatura de la página { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Buscar + .placeholder = Buscar en el documento… +pdfjs-find-previous-button = + .title = Ir a la anterior frase encontrada +pdfjs-find-previous-button-label = Anterior +pdfjs-find-next-button = + .title = Ir a la siguiente frase encontrada +pdfjs-find-next-button-label = Siguiente +pdfjs-find-highlight-checkbox = Resaltar todo +pdfjs-find-match-case-checkbox-label = Coincidir con mayúsculas y minúsculas +pdfjs-find-match-diacritics-checkbox-label = Coincidir diacríticos +pdfjs-find-entire-word-checkbox-label = Palabras completas +pdfjs-find-reached-top = Se alcanzó el inicio del documento, se buscará al final +pdfjs-find-reached-bottom = Se alcanzó el final del documento, se buscará al inicio +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] { $current } de { $total } coincidencia + *[other] { $current } de { $total } coincidencias + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] Más de { $limit } coincidencia + *[other] Más de { $limit } coincidencias + } +pdfjs-find-not-found = No se encontró la frase + +## Predefined zoom values + +pdfjs-page-scale-width = Ancho de página +pdfjs-page-scale-fit = Ajustar página +pdfjs-page-scale-auto = Zoom automático +pdfjs-page-scale-actual = Tamaño real +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Página { $page } + +## Loading indicator messages + +pdfjs-loading-error = Un error ocurrió al cargar el PDF. +pdfjs-invalid-file-error = Archivo PDF invalido o dañado. +pdfjs-missing-file-error = Archivo PDF no encontrado. +pdfjs-unexpected-response-error = Respuesta inesperada del servidor. +pdfjs-rendering-error = Un error ocurrió al renderizar la página. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } anotación] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Ingresa la contraseña para abrir este archivo PDF. +pdfjs-password-invalid = Contraseña inválida. Por favor intenta de nuevo. +pdfjs-password-ok-button = Aceptar +pdfjs-password-cancel-button = Cancelar +pdfjs-web-fonts-disabled = Las fuentes web están desactivadas: es imposible usar las fuentes PDF embebidas. + +## Editing + +pdfjs-editor-free-text-button = + .title = Texto +pdfjs-editor-free-text-button-label = Texto +pdfjs-editor-ink-button = + .title = Dibujar +pdfjs-editor-ink-button-label = Dibujar +pdfjs-editor-stamp-button = + .title = Agregar o editar imágenes +pdfjs-editor-stamp-button-label = Agregar o editar imágenes +pdfjs-editor-highlight-button = + .title = Destacar +pdfjs-editor-highlight-button-label = Destacar +pdfjs-highlight-floating-button1 = + .title = Destacados + .aria-label = Destacados +pdfjs-highlight-floating-button-label = Destacados + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Eliminar dibujo +pdfjs-editor-remove-freetext-button = + .title = Eliminar texto +pdfjs-editor-remove-stamp-button = + .title = Eliminar imagen +pdfjs-editor-remove-highlight-button = + .title = Eliminar destacado + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Color +pdfjs-editor-free-text-size-input = Tamaño +pdfjs-editor-ink-color-input = Color +pdfjs-editor-ink-thickness-input = Grossor +pdfjs-editor-ink-opacity-input = Opacidad +pdfjs-editor-stamp-add-image-button = + .title = Agregar imagen +pdfjs-editor-stamp-add-image-button-label = Agregar imagen +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Espesor +pdfjs-editor-free-highlight-thickness-title = + .title = Cambiar el grosor al resaltar elementos que no sean texto +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = Editor de texto + .default-content = Comenzar a escribir… +pdfjs-free-text = + .aria-label = Editor de texto +pdfjs-free-text-default-content = Empieza a escribir… +pdfjs-ink = + .aria-label = Editor de dibujo +pdfjs-ink-canvas = + .aria-label = Imagen creada por el usuario + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = Texto alternativo +pdfjs-editor-alt-text-edit-button = + .aria-label = Editar texto alternativo +pdfjs-editor-alt-text-edit-button-label = Editar texto alternativo +pdfjs-editor-alt-text-dialog-label = Elige una opción +pdfjs-editor-alt-text-dialog-description = El texto alternativo (texto alternativo) ayuda cuando las personas no pueden ver la imagen o cuando no se carga. +pdfjs-editor-alt-text-add-description-label = Añadir una descripción +pdfjs-editor-alt-text-add-description-description = Intente escribir 1 o 2 oraciones que describan el tema, el entorno o las acciones. +pdfjs-editor-alt-text-mark-decorative-label = Marcar como decorativo +pdfjs-editor-alt-text-mark-decorative-description = Se utiliza para imágenes ornamentales, como bordes o marcas de agua. +pdfjs-editor-alt-text-cancel-button = Cancelar +pdfjs-editor-alt-text-save-button = Guardar +pdfjs-editor-alt-text-decorative-tooltip = Marcado como decorativo +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = Por ejemplo: “Un joven se sienta a la mesa a comer” +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = Texto alternativo + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Esquina superior izquierda: cambiar el tamaño +pdfjs-editor-resizer-label-top-middle = Arriba en el medio: cambiar el tamaño +pdfjs-editor-resizer-label-top-right = Esquina superior derecha: cambiar el tamaño +pdfjs-editor-resizer-label-middle-right = Centro derecha: cambiar el tamaño +pdfjs-editor-resizer-label-bottom-right = Esquina inferior derecha: cambiar el tamaño +pdfjs-editor-resizer-label-bottom-middle = Abajo en el medio: cambiar el tamaño +pdfjs-editor-resizer-label-bottom-left = Esquina inferior izquierda: cambiar el tamaño +pdfjs-editor-resizer-label-middle-left = Centro izquierda: cambiar el tamaño +pdfjs-editor-resizer-top-left = + .aria-label = Esquina superior izquierda — redimensionar +pdfjs-editor-resizer-top-middle = + .aria-label = Borde superior en el medio — redimensionar +pdfjs-editor-resizer-top-right = + .aria-label = Esquina superior derecha — redimensionar +pdfjs-editor-resizer-middle-right = + .aria-label = Borde derecho en el medio — redimensionar +pdfjs-editor-resizer-bottom-right = + .aria-label = Esquina inferior derecha — redimensionar +pdfjs-editor-resizer-bottom-middle = + .aria-label = Borde inferior en el medio — redimensionar +pdfjs-editor-resizer-bottom-left = + .aria-label = Esquina inferior izquierda — redimensionar +pdfjs-editor-resizer-middle-left = + .aria-label = Borde izquierdo en el medio — redimensionar + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Color de resaltado +pdfjs-editor-colorpicker-button = + .title = Cambiar color +pdfjs-editor-colorpicker-dropdown = + .aria-label = Opciones de color +pdfjs-editor-colorpicker-yellow = + .title = Amarillo +pdfjs-editor-colorpicker-green = + .title = Verde +pdfjs-editor-colorpicker-blue = + .title = Azul +pdfjs-editor-colorpicker-pink = + .title = Rosa +pdfjs-editor-colorpicker-red = + .title = Rojo + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Mostrar todo +pdfjs-editor-highlight-show-all-button = + .title = Mostrar todo + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = Editar texto alternativo (descripción de la imagen) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = Agregar texto alternativo (descripción de la imagen) +pdfjs-editor-new-alt-text-textarea = + .placeholder = Escribe tu descripción aquí… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = Breve descripción para las personas que no pueden ver la imagen o cuando la imagen no se carga. +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = Este texto alternativo fue creado automáticamente y puede ser inexacto. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Saber más +pdfjs-editor-new-alt-text-create-automatically-button-label = Crear texto alternativo automáticamente +pdfjs-editor-new-alt-text-not-now-button = Ahora no +pdfjs-editor-new-alt-text-error-title = No se pudo crear el texto alternativo automáticamente +pdfjs-editor-new-alt-text-error-description = Escribe tu propio texto alternativo o inténtalo de nuevo más tarde. +pdfjs-editor-new-alt-text-error-close-button = Cerrar +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = Descargando el modelo de IA de texto alternativo ({ $downloadedSize } de { $totalSize } MB) + .aria-valuetext = Descargando el modelo de IA de texto alternativo ({ $downloadedSize } de { $totalSize } MB) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = Se agregó el texto alternativo +pdfjs-editor-new-alt-text-added-button-label = Se agregó el texto alternativo +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = Falta el texto alternativo +pdfjs-editor-new-alt-text-missing-button-label = Falta texto alternativo +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = Revisar el texto alternativo +pdfjs-editor-new-alt-text-to-review-button-label = Revisar el texto alternativo +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Creado automáticamente: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = Ajustes del texto alternativo de la imagen +pdfjs-image-alt-text-settings-button-label = Ajustes del texto alternativo de la imagen +pdfjs-editor-alt-text-settings-dialog-label = Ajustes del texto alternativo de la imagen +pdfjs-editor-alt-text-settings-automatic-title = Texto alternativo automático +pdfjs-editor-alt-text-settings-create-model-button-label = Crear texto alternativo automáticamente +pdfjs-editor-alt-text-settings-create-model-description = Sugiere descripciones para ayudar a las personas que no pueden ver la imagen o cuando la imagen no se carga. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = Modelo de IA de texto alternativo ({ $totalSize } MB) +pdfjs-editor-alt-text-settings-ai-model-description = Se ejecuta localmente en el dispositivo para que los datos se mantengan privados. Requerido para texto alternativo automático. +pdfjs-editor-alt-text-settings-delete-model-button = Eliminar +pdfjs-editor-alt-text-settings-download-model-button = Descargar +pdfjs-editor-alt-text-settings-downloading-model-button = Descargando… +pdfjs-editor-alt-text-settings-editor-title = Editor de texto alternativo +pdfjs-editor-alt-text-settings-show-dialog-button-label = Mostrar el editor de texto alternativo inmediatamente al añadir una imagen +pdfjs-editor-alt-text-settings-show-dialog-description = Te ayuda a asegurarte de que todas tus imágenes tengan texto alternativo. +pdfjs-editor-alt-text-settings-close-button = Cerrar + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = Resaltado eliminado +pdfjs-editor-undo-bar-message-freetext = Texto eliminado +pdfjs-editor-undo-bar-message-ink = Dibujo eliminado +pdfjs-editor-undo-bar-message-stamp = Imagen eliminada +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = + { $count -> + [one] { $count } anotación eliminada + *[other] { $count } anotaciones eliminadas + } +pdfjs-editor-undo-bar-undo-button = + .title = Deshacer +pdfjs-editor-undo-bar-undo-button-label = Deshacer +pdfjs-editor-undo-bar-close-button = + .title = Cerrar +pdfjs-editor-undo-bar-close-button-label = Cerrar diff --git a/public/pdfjs/web/locale/et/viewer.ftl b/public/pdfjs/web/locale/et/viewer.ftl new file mode 100644 index 0000000..b28c6d5 --- /dev/null +++ b/public/pdfjs/web/locale/et/viewer.ftl @@ -0,0 +1,268 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Eelmine lehekülg +pdfjs-previous-button-label = Eelmine +pdfjs-next-button = + .title = Järgmine lehekülg +pdfjs-next-button-label = Järgmine +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Leht +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = / { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber }/{ $pagesCount }) +pdfjs-zoom-out-button = + .title = Vähenda +pdfjs-zoom-out-button-label = Vähenda +pdfjs-zoom-in-button = + .title = Suurenda +pdfjs-zoom-in-button-label = Suurenda +pdfjs-zoom-select = + .title = Suurendamine +pdfjs-presentation-mode-button = + .title = Lülitu esitlusrežiimi +pdfjs-presentation-mode-button-label = Esitlusrežiim +pdfjs-open-file-button = + .title = Ava fail +pdfjs-open-file-button-label = Ava +pdfjs-print-button = + .title = Prindi +pdfjs-print-button-label = Prindi + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Tööriistad +pdfjs-tools-button-label = Tööriistad +pdfjs-first-page-button = + .title = Mine esimesele leheküljele +pdfjs-first-page-button-label = Mine esimesele leheküljele +pdfjs-last-page-button = + .title = Mine viimasele leheküljele +pdfjs-last-page-button-label = Mine viimasele leheküljele +pdfjs-page-rotate-cw-button = + .title = Pööra päripäeva +pdfjs-page-rotate-cw-button-label = Pööra päripäeva +pdfjs-page-rotate-ccw-button = + .title = Pööra vastupäeva +pdfjs-page-rotate-ccw-button-label = Pööra vastupäeva +pdfjs-cursor-text-select-tool-button = + .title = Luba teksti valimise tööriist +pdfjs-cursor-text-select-tool-button-label = Teksti valimise tööriist +pdfjs-cursor-hand-tool-button = + .title = Luba sirvimistööriist +pdfjs-cursor-hand-tool-button-label = Sirvimistööriist +pdfjs-scroll-page-button = + .title = Kasutatakse lehe kaupa kerimist +pdfjs-scroll-page-button-label = Lehe kaupa kerimine +pdfjs-scroll-vertical-button = + .title = Kasuta vertikaalset kerimist +pdfjs-scroll-vertical-button-label = Vertikaalne kerimine +pdfjs-scroll-horizontal-button = + .title = Kasuta horisontaalset kerimist +pdfjs-scroll-horizontal-button-label = Horisontaalne kerimine +pdfjs-scroll-wrapped-button = + .title = Kasuta rohkem mahutavat kerimist +pdfjs-scroll-wrapped-button-label = Rohkem mahutav kerimine +pdfjs-spread-none-button = + .title = Ära kõrvuta lehekülgi +pdfjs-spread-none-button-label = Lehtede kõrvutamine puudub +pdfjs-spread-odd-button = + .title = Kõrvuta leheküljed, alustades paaritute numbritega lehekülgedega +pdfjs-spread-odd-button-label = Kõrvutamine paaritute numbritega alustades +pdfjs-spread-even-button = + .title = Kõrvuta leheküljed, alustades paarisnumbritega lehekülgedega +pdfjs-spread-even-button-label = Kõrvutamine paarisnumbritega alustades + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Dokumendi omadused… +pdfjs-document-properties-button-label = Dokumendi omadused… +pdfjs-document-properties-file-name = Faili nimi: +pdfjs-document-properties-file-size = Faili suurus: +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KiB ({ $size_b } baiti) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MiB ({ $size_b } baiti) +pdfjs-document-properties-title = Pealkiri: +pdfjs-document-properties-author = Autor: +pdfjs-document-properties-subject = Teema: +pdfjs-document-properties-keywords = Märksõnad: +pdfjs-document-properties-creation-date = Loodud: +pdfjs-document-properties-modification-date = Muudetud: +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date } { $time } +pdfjs-document-properties-creator = Looja: +pdfjs-document-properties-producer = Generaator: +pdfjs-document-properties-version = Generaatori versioon: +pdfjs-document-properties-page-count = Lehekülgi: +pdfjs-document-properties-page-size = Lehe suurus: +pdfjs-document-properties-page-size-unit-inches = tolli +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = vertikaalpaigutus +pdfjs-document-properties-page-size-orientation-landscape = rõhtpaigutus +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Letter +pdfjs-document-properties-page-size-name-legal = Legal + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = "Fast Web View" tugi: +pdfjs-document-properties-linearized-yes = Jah +pdfjs-document-properties-linearized-no = Ei +pdfjs-document-properties-close-button = Sulge + +## Print + +pdfjs-print-progress-message = Dokumendi ettevalmistamine printimiseks… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Loobu +pdfjs-printing-not-supported = Hoiatus: printimine pole selle brauseri poolt täielikult toetatud. +pdfjs-printing-not-ready = Hoiatus: PDF pole printimiseks täielikult laaditud. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Näita külgriba +pdfjs-toggle-sidebar-notification-button = + .title = Näita külgriba (dokument sisaldab sisukorda/manuseid/kihte) +pdfjs-toggle-sidebar-button-label = Näita külgriba +pdfjs-document-outline-button = + .title = Näita sisukorda (kõigi punktide laiendamiseks/ahendamiseks topeltklõpsa) +pdfjs-document-outline-button-label = Näita sisukorda +pdfjs-attachments-button = + .title = Näita manuseid +pdfjs-attachments-button-label = Manused +pdfjs-layers-button = + .title = Näita kihte (kõikide kihtide vaikeolekusse lähtestamiseks topeltklõpsa) +pdfjs-layers-button-label = Kihid +pdfjs-thumbs-button = + .title = Näita pisipilte +pdfjs-thumbs-button-label = Pisipildid +pdfjs-current-outline-item-button = + .title = Otsi üles praegune kontuuriüksus +pdfjs-current-outline-item-button-label = Praegune kontuuriüksus +pdfjs-findbar-button = + .title = Otsi dokumendist +pdfjs-findbar-button-label = Otsi +pdfjs-additional-layers = Täiendavad kihid + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = { $page }. lehekülg +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = { $page }. lehekülje pisipilt + +## Find panel button title and messages + +pdfjs-find-input = + .title = Otsi + .placeholder = Otsi dokumendist… +pdfjs-find-previous-button = + .title = Otsi fraasi eelmine esinemiskoht +pdfjs-find-previous-button-label = Eelmine +pdfjs-find-next-button = + .title = Otsi fraasi järgmine esinemiskoht +pdfjs-find-next-button-label = Järgmine +pdfjs-find-highlight-checkbox = Too kõik esile +pdfjs-find-match-case-checkbox-label = Tõstutundlik +pdfjs-find-match-diacritics-checkbox-label = Otsitakse diakriitiliselt +pdfjs-find-entire-word-checkbox-label = Täissõnad +pdfjs-find-reached-top = Jõuti dokumendi algusesse, jätkati lõpust +pdfjs-find-reached-bottom = Jõuti dokumendi lõppu, jätkati algusest +pdfjs-find-not-found = Fraasi ei leitud + +## Predefined zoom values + +pdfjs-page-scale-width = Mahuta laiusele +pdfjs-page-scale-fit = Mahuta leheküljele +pdfjs-page-scale-auto = Automaatne suurendamine +pdfjs-page-scale-actual = Tegelik suurus +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Lehekülg { $page } + +## Loading indicator messages + +pdfjs-loading-error = PDFi laadimisel esines viga. +pdfjs-invalid-file-error = Vigane või rikutud PDF-fail. +pdfjs-missing-file-error = PDF-fail puudub. +pdfjs-unexpected-response-error = Ootamatu vastus serverilt. +pdfjs-rendering-error = Lehe renderdamisel esines viga. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date } { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } Annotation] + +## Password + +pdfjs-password-label = PDF-faili avamiseks sisesta parool. +pdfjs-password-invalid = Vigane parool. Palun proovi uuesti. +pdfjs-password-ok-button = Sobib +pdfjs-password-cancel-button = Loobu +pdfjs-web-fonts-disabled = Veebifondid on keelatud: PDFiga kaasatud fonte pole võimalik kasutada. + +## Editing + + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + diff --git a/public/pdfjs/web/locale/eu/viewer.ftl b/public/pdfjs/web/locale/eu/viewer.ftl new file mode 100644 index 0000000..2b2660b --- /dev/null +++ b/public/pdfjs/web/locale/eu/viewer.ftl @@ -0,0 +1,515 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Aurreko orria +pdfjs-previous-button-label = Aurrekoa +pdfjs-next-button = + .title = Hurrengo orria +pdfjs-next-button-label = Hurrengoa +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Orria +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = / { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = { $pagesCount }/{ $pageNumber } +pdfjs-zoom-out-button = + .title = Urrundu zooma +pdfjs-zoom-out-button-label = Urrundu zooma +pdfjs-zoom-in-button = + .title = Gerturatu zooma +pdfjs-zoom-in-button-label = Gerturatu zooma +pdfjs-zoom-select = + .title = Zooma +pdfjs-presentation-mode-button = + .title = Aldatu aurkezpen modura +pdfjs-presentation-mode-button-label = Arkezpen modua +pdfjs-open-file-button = + .title = Ireki fitxategia +pdfjs-open-file-button-label = Ireki +pdfjs-print-button = + .title = Inprimatu +pdfjs-print-button-label = Inprimatu +pdfjs-save-button = + .title = Gorde +pdfjs-save-button-label = Gorde +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Deskargatu +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Deskargatu +pdfjs-bookmark-button = + .title = Uneko orria (ikusi uneko orriaren URLa) +pdfjs-bookmark-button-label = Uneko orria + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Tresnak +pdfjs-tools-button-label = Tresnak +pdfjs-first-page-button = + .title = Joan lehen orrira +pdfjs-first-page-button-label = Joan lehen orrira +pdfjs-last-page-button = + .title = Joan azken orrira +pdfjs-last-page-button-label = Joan azken orrira +pdfjs-page-rotate-cw-button = + .title = Biratu erlojuaren norantzan +pdfjs-page-rotate-cw-button-label = Biratu erlojuaren norantzan +pdfjs-page-rotate-ccw-button = + .title = Biratu erlojuaren aurkako norantzan +pdfjs-page-rotate-ccw-button-label = Biratu erlojuaren aurkako norantzan +pdfjs-cursor-text-select-tool-button = + .title = Gaitu testuaren hautapen tresna +pdfjs-cursor-text-select-tool-button-label = Testuaren hautapen tresna +pdfjs-cursor-hand-tool-button = + .title = Gaitu eskuaren tresna +pdfjs-cursor-hand-tool-button-label = Eskuaren tresna +pdfjs-scroll-page-button = + .title = Erabili orriaren korritzea +pdfjs-scroll-page-button-label = Orriaren korritzea +pdfjs-scroll-vertical-button = + .title = Erabili korritze bertikala +pdfjs-scroll-vertical-button-label = Korritze bertikala +pdfjs-scroll-horizontal-button = + .title = Erabili korritze horizontala +pdfjs-scroll-horizontal-button-label = Korritze horizontala +pdfjs-scroll-wrapped-button = + .title = Erabili korritze egokitua +pdfjs-scroll-wrapped-button-label = Korritze egokitua +pdfjs-spread-none-button = + .title = Ez elkartu barreiatutako orriak +pdfjs-spread-none-button-label = Barreiatzerik ez +pdfjs-spread-odd-button = + .title = Elkartu barreiatutako orriak bakoiti zenbakidunekin hasita +pdfjs-spread-odd-button-label = Barreiatze bakoitia +pdfjs-spread-even-button = + .title = Elkartu barreiatutako orriak bikoiti zenbakidunekin hasita +pdfjs-spread-even-button-label = Barreiatze bikoitia + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Dokumentuaren propietateak… +pdfjs-document-properties-button-label = Dokumentuaren propietateak… +pdfjs-document-properties-file-name = Fitxategi-izena: +pdfjs-document-properties-file-size = Fitxategiaren tamaina: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } byte) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } byte) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } byte) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } byte) +pdfjs-document-properties-title = Izenburua: +pdfjs-document-properties-author = Egilea: +pdfjs-document-properties-subject = Gaia: +pdfjs-document-properties-keywords = Gako-hitzak: +pdfjs-document-properties-creation-date = Sortze-data: +pdfjs-document-properties-modification-date = Aldatze-data: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Sortzailea: +pdfjs-document-properties-producer = PDFaren ekoizlea: +pdfjs-document-properties-version = PDF bertsioa: +pdfjs-document-properties-page-count = Orrialde kopurua: +pdfjs-document-properties-page-size = Orriaren tamaina: +pdfjs-document-properties-page-size-unit-inches = in +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = bertikala +pdfjs-document-properties-page-size-orientation-landscape = horizontala +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Gutuna +pdfjs-document-properties-page-size-name-legal = Legala + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Webeko ikuspegi bizkorra: +pdfjs-document-properties-linearized-yes = Bai +pdfjs-document-properties-linearized-no = Ez +pdfjs-document-properties-close-button = Itxi + +## Print + +pdfjs-print-progress-message = Dokumentua inprimatzeko prestatzen… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = %{ $progress } +pdfjs-print-progress-close-button = Utzi +pdfjs-printing-not-supported = Abisua: inprimatzeko euskarria ez da erabatekoa nabigatzaile honetan. +pdfjs-printing-not-ready = Abisua: PDFa ez dago erabat kargatuta inprimatzeko. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Txandakatu alboko barra +pdfjs-toggle-sidebar-notification-button = + .title = Txandakatu alboko barra (dokumentuak eskema/eranskinak/geruzak ditu) +pdfjs-toggle-sidebar-button-label = Txandakatu alboko barra +pdfjs-document-outline-button = + .title = Erakutsi dokumentuaren eskema (klik bikoitza elementu guztiak zabaltzeko/tolesteko) +pdfjs-document-outline-button-label = Dokumentuaren eskema +pdfjs-attachments-button = + .title = Erakutsi eranskinak +pdfjs-attachments-button-label = Eranskinak +pdfjs-layers-button = + .title = Erakutsi geruzak (klik bikoitza geruza guztiak egoera lehenetsira berrezartzeko) +pdfjs-layers-button-label = Geruzak +pdfjs-thumbs-button = + .title = Erakutsi koadro txikiak +pdfjs-thumbs-button-label = Koadro txikiak +pdfjs-current-outline-item-button = + .title = Bilatu uneko eskemaren elementua +pdfjs-current-outline-item-button-label = Uneko eskemaren elementua +pdfjs-findbar-button = + .title = Bilatu dokumentuan +pdfjs-findbar-button-label = Bilatu +pdfjs-additional-layers = Geruza gehigarriak + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = { $page }. orria +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = { $page }. orriaren koadro txikia + +## Find panel button title and messages + +pdfjs-find-input = + .title = Bilatu + .placeholder = Bilatu dokumentuan… +pdfjs-find-previous-button = + .title = Bilatu esaldiaren aurreko parekatzea +pdfjs-find-previous-button-label = Aurrekoa +pdfjs-find-next-button = + .title = Bilatu esaldiaren hurrengo parekatzea +pdfjs-find-next-button-label = Hurrengoa +pdfjs-find-highlight-checkbox = Nabarmendu guztia +pdfjs-find-match-case-checkbox-label = Bat etorri maiuskulekin/minuskulekin +pdfjs-find-match-diacritics-checkbox-label = Bereizi diakritikoak +pdfjs-find-entire-word-checkbox-label = Hitz osoak +pdfjs-find-reached-top = Dokumentuaren hasierara heldu da, bukaeratik jarraitzen +pdfjs-find-reached-bottom = Dokumentuaren bukaerara heldu da, hasieratik jarraitzen +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] { $total }/{ $current }. bat-etortzea + *[other] { $total }/{ $current }. bat-etortzea + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] Bat datorren { $limit } baino gehiago + *[other] Bat datozen { $limit } baino gehiago + } +pdfjs-find-not-found = Esaldia ez da aurkitu + +## Predefined zoom values + +pdfjs-page-scale-width = Orriaren zabalera +pdfjs-page-scale-fit = Doitu orrira +pdfjs-page-scale-auto = Zoom automatikoa +pdfjs-page-scale-actual = Benetako tamaina +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = %{ $scale } + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = { $page }. orria + +## Loading indicator messages + +pdfjs-loading-error = Errorea gertatu da PDFa kargatzean. +pdfjs-invalid-file-error = PDF fitxategi baliogabe edo hondatua. +pdfjs-missing-file-error = PDF fitxategia falta da. +pdfjs-unexpected-response-error = Espero gabeko zerbitzariaren erantzuna. +pdfjs-rendering-error = Errorea gertatu da orria errendatzean. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } ohartarazpena] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Idatzi PDF fitxategi hau irekitzeko pasahitza. +pdfjs-password-invalid = Pasahitz baliogabea. Saiatu berriro mesedez. +pdfjs-password-ok-button = Ados +pdfjs-password-cancel-button = Utzi +pdfjs-web-fonts-disabled = Webeko letra-tipoak desgaituta daude: ezin dira kapsulatutako PDF letra-tipoak erabili. + +## Editing + +pdfjs-editor-free-text-button = + .title = Testua +pdfjs-editor-free-text-button-label = Testua +pdfjs-editor-ink-button = + .title = Marrazkia +pdfjs-editor-ink-button-label = Marrazkia +pdfjs-editor-stamp-button = + .title = Gehitu edo editatu irudiak +pdfjs-editor-stamp-button-label = Gehitu edo editatu irudiak +pdfjs-editor-highlight-button = + .title = Nabarmendu +pdfjs-editor-highlight-button-label = Nabarmendu +pdfjs-highlight-floating-button1 = + .title = Nabarmendu + .aria-label = Nabarmendu +pdfjs-highlight-floating-button-label = Nabarmendu + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Kendu marrazkia +pdfjs-editor-remove-freetext-button = + .title = Kendu testua +pdfjs-editor-remove-stamp-button = + .title = Kendu irudia +pdfjs-editor-remove-highlight-button = + .title = Kendu nabarmentzea + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Kolorea +pdfjs-editor-free-text-size-input = Tamaina +pdfjs-editor-ink-color-input = Kolorea +pdfjs-editor-ink-thickness-input = Loditasuna +pdfjs-editor-ink-opacity-input = Opakutasuna +pdfjs-editor-stamp-add-image-button = + .title = Gehitu irudia +pdfjs-editor-stamp-add-image-button-label = Gehitu irudia +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Loditasuna +pdfjs-editor-free-highlight-thickness-title = + .title = Aldatu loditasuna testua ez beste elementuak nabarmentzean +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = Testu-editorea + .default-content = Hasi idazten… +pdfjs-free-text = + .aria-label = Testu-editorea +pdfjs-free-text-default-content = Hasi idazten… +pdfjs-ink = + .aria-label = Marrazki-editorea +pdfjs-ink-canvas = + .aria-label = Erabiltzaileak sortutako irudia + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = Testu alternatiboa +pdfjs-editor-alt-text-edit-button = + .aria-label = Editatu testu alternatiboa +pdfjs-editor-alt-text-edit-button-label = Editatu testu alternatiboa +pdfjs-editor-alt-text-dialog-label = Aukeratu aukera +pdfjs-editor-alt-text-dialog-description = Testu alternatiboak laguntzen du jendeak ezin duenean irudia ikusi edo ez denean kargatzen. +pdfjs-editor-alt-text-add-description-label = Gehitu azalpena +pdfjs-editor-alt-text-add-description-description = Saiatu idazten gaia, ezarpena edo ekintzak deskribatzen dituen esaldi 1 edo 2. +pdfjs-editor-alt-text-mark-decorative-label = Markatu apaingarri gisa +pdfjs-editor-alt-text-mark-decorative-description = Irudiak apaingarrientzat erabiltzen da, adibidez ertz edo ur-marketarako. +pdfjs-editor-alt-text-cancel-button = Utzi +pdfjs-editor-alt-text-save-button = Gorde +pdfjs-editor-alt-text-decorative-tooltip = Apaingarri gisa markatuta +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = Adibidez, "gizon gaztea mahaian eserita dago bazkaltzeko" +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = Testu alternatiboa + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Goiko ezkerreko izkina — aldatu tamaina +pdfjs-editor-resizer-label-top-middle = Goian erdian — aldatu tamaina +pdfjs-editor-resizer-label-top-right = Goiko eskuineko izkina — aldatu tamaina +pdfjs-editor-resizer-label-middle-right = Erdian eskuinean — aldatu tamaina +pdfjs-editor-resizer-label-bottom-right = Beheko eskuineko izkina — aldatu tamaina +pdfjs-editor-resizer-label-bottom-middle = Behean erdian — aldatu tamaina +pdfjs-editor-resizer-label-bottom-left = Beheko ezkerreko izkina — aldatu tamaina +pdfjs-editor-resizer-label-middle-left = Erdian ezkerrean — aldatu tamaina +pdfjs-editor-resizer-top-left = + .aria-label = Goiko ezkerreko izkina — aldatu tamaina +pdfjs-editor-resizer-top-middle = + .aria-label = Goian erdian — aldatu tamaina +pdfjs-editor-resizer-top-right = + .aria-label = Goiko eskuineko izkina — aldatu tamaina +pdfjs-editor-resizer-middle-right = + .aria-label = Erdian eskuinean — aldatu tamaina +pdfjs-editor-resizer-bottom-right = + .aria-label = Beheko eskuineko izkina — aldatu tamaina +pdfjs-editor-resizer-bottom-middle = + .aria-label = Behean erdian — aldatu tamaina +pdfjs-editor-resizer-bottom-left = + .aria-label = Beheko ezkerreko izkina — aldatu tamaina +pdfjs-editor-resizer-middle-left = + .aria-label = Erdian ezkerrean — aldatu tamaina + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Nabarmentze kolorea +pdfjs-editor-colorpicker-button = + .title = Aldatu kolorea +pdfjs-editor-colorpicker-dropdown = + .aria-label = Kolore-aukerak +pdfjs-editor-colorpicker-yellow = + .title = Horia +pdfjs-editor-colorpicker-green = + .title = Berdea +pdfjs-editor-colorpicker-blue = + .title = Urdina +pdfjs-editor-colorpicker-pink = + .title = Arrosa +pdfjs-editor-colorpicker-red = + .title = Gorria + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Erakutsi denak +pdfjs-editor-highlight-show-all-button = + .title = Erakutsi denak + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = Editatu testu alternatiboa (irudiaren azalpena) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = Gehitu testu alternatiboa (irudiaren azalpena) +pdfjs-editor-new-alt-text-textarea = + .placeholder = Idatzi zure azalpena hemen… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = Azalpen laburra irudia ikusi ezin duen jendearentzat edo irudia kargatu ezin denerako. +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = Testu alternatibo hau automatikoki sortu da eta okerra izan liteke. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Argibide gehiago +pdfjs-editor-new-alt-text-create-automatically-button-label = Sortu testu alternatiboa automatikoki +pdfjs-editor-new-alt-text-not-now-button = Une honetan ez +pdfjs-editor-new-alt-text-error-title = Ezin da testu alternatiboa automatikoki sortu +pdfjs-editor-new-alt-text-error-description = Idatzi zure testu alternatibo propioa edo saiatu berriro geroago. +pdfjs-editor-new-alt-text-error-close-button = Itxi +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = Testu alternatiboaren AA modeloa deskargatzen ({ $totalSize }/{ $downloadedSize } MB) + .aria-valuetext = Testu alternatiboaren AA modeloa deskargatzen ({ $totalSize }/{ $downloadedSize } MB) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = Testu alternatiboa gehituta +pdfjs-editor-new-alt-text-added-button-label = Testu alternatiboa gehituta +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = Testu alternatiboa falta da +pdfjs-editor-new-alt-text-missing-button-label = Testu alternatiboa falta da +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = Berrikusi testu alternatiboa +pdfjs-editor-new-alt-text-to-review-button-label = Berrikusi testu alternatiboa +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Automatikoki sortua: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = Irudiaren testu alternatiboaren ezarpenak +pdfjs-image-alt-text-settings-button-label = Irudiaren testu alternatiboaren ezarpenak +pdfjs-editor-alt-text-settings-dialog-label = Irudiaren testu alternatiboaren ezarpenak +pdfjs-editor-alt-text-settings-automatic-title = Testu alternatibo automatikoa +pdfjs-editor-alt-text-settings-create-model-button-label = Sortu testu alternatiboa automatikoki +pdfjs-editor-alt-text-settings-create-model-description = Azalpenak iradokitzen ditu irudia ikusi ezin duen jendearentzat edo irudia kargatu ezin denerako. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = Testu alternatiboaren AA modeloa ({ $totalSize } MB) +pdfjs-editor-alt-text-settings-ai-model-description = Zure gailuan modu lokalean exekutatzen da eta zure datuak pribatu mantentzen dira. Testu alternatibo automatikorako beharrezkoa. +pdfjs-editor-alt-text-settings-delete-model-button = Ezabatu +pdfjs-editor-alt-text-settings-download-model-button = Deskargatu +pdfjs-editor-alt-text-settings-downloading-model-button = Deskargatzen… +pdfjs-editor-alt-text-settings-editor-title = Testu alternatiboaren editorea +pdfjs-editor-alt-text-settings-show-dialog-button-label = Erakutsi testu alternatiboa irudi bat gehitzean berehala +pdfjs-editor-alt-text-settings-show-dialog-description = Zure irudiek testu alternatiboa duela ziurtatzen laguntzen dizu. +pdfjs-editor-alt-text-settings-close-button = Itxi + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = Nabarmentzea kenduta +pdfjs-editor-undo-bar-message-freetext = Testua kenduta +pdfjs-editor-undo-bar-message-ink = Marrazkia kenduta +pdfjs-editor-undo-bar-message-stamp = Irudia kenduta +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = + { $count -> + [one] Esku-ohar bat kenduta + *[other] { $count } esku-ohar kenduta + } +pdfjs-editor-undo-bar-undo-button = + .title = Desegin +pdfjs-editor-undo-bar-undo-button-label = Desegin +pdfjs-editor-undo-bar-close-button = + .title = Itxi +pdfjs-editor-undo-bar-close-button-label = Itxi diff --git a/public/pdfjs/web/locale/fa/viewer.ftl b/public/pdfjs/web/locale/fa/viewer.ftl new file mode 100644 index 0000000..4969209 --- /dev/null +++ b/public/pdfjs/web/locale/fa/viewer.ftl @@ -0,0 +1,348 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = صفحهٔ قبلی +pdfjs-previous-button-label = قبلی +pdfjs-next-button = + .title = صفحهٔ بعدی +pdfjs-next-button-label = بعدی +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = صفحه +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = از { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber }از { $pagesCount }) +pdfjs-zoom-out-button = + .title = کوچک‌نمایی +pdfjs-zoom-out-button-label = کوچک‌نمایی +pdfjs-zoom-in-button = + .title = بزرگ‌نمایی +pdfjs-zoom-in-button-label = بزرگ‌نمایی +pdfjs-zoom-select = + .title = زوم +pdfjs-presentation-mode-button = + .title = تغییر به حالت ارائه +pdfjs-presentation-mode-button-label = حالت ارائه +pdfjs-open-file-button = + .title = باز کردن پرونده +pdfjs-open-file-button-label = باز کردن +pdfjs-print-button = + .title = چاپ +pdfjs-print-button-label = چاپ +pdfjs-save-button = + .title = ذخیره +pdfjs-save-button-label = ذخیره +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = دریافت +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = دریافت +pdfjs-bookmark-button = + .title = صفحه فعلی (مشاهده نشانی اینترنتی از صفحه فعلی) +pdfjs-bookmark-button-label = صفحه فعلی + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = ابزارها +pdfjs-tools-button-label = ابزارها +pdfjs-first-page-button = + .title = برو به اولین صفحه +pdfjs-first-page-button-label = برو به اولین صفحه +pdfjs-last-page-button = + .title = برو به آخرین صفحه +pdfjs-last-page-button-label = برو به آخرین صفحه +pdfjs-page-rotate-cw-button = + .title = چرخش ساعتگرد +pdfjs-page-rotate-cw-button-label = چرخش ساعتگرد +pdfjs-page-rotate-ccw-button = + .title = چرخش پاد ساعتگرد +pdfjs-page-rotate-ccw-button-label = چرخش پاد ساعتگرد +pdfjs-cursor-text-select-tool-button = + .title = فعال کردن ابزارِ انتخابِ متن +pdfjs-cursor-text-select-tool-button-label = ابزارِ انتخابِ متن +pdfjs-cursor-hand-tool-button = + .title = فعال کردن ابزارِ دست +pdfjs-cursor-hand-tool-button-label = ابزار دست +pdfjs-scroll-page-button = + .title = استفاده از پیمایش صفحه +pdfjs-scroll-page-button-label = پیمایش صفحه +pdfjs-scroll-vertical-button = + .title = استفاده از پیمایش عمودی +pdfjs-scroll-vertical-button-label = پیمایش عمودی +pdfjs-scroll-horizontal-button = + .title = استفاده از پیمایش افقی +pdfjs-scroll-horizontal-button-label = پیمایش افقی +pdfjs-spread-none-button = + .title = صفحات پیوسته را یکی نکنید +pdfjs-spread-none-button-label = بدون صفحات پیوسته + +## Document properties dialog + +pdfjs-document-properties-button = + .title = خصوصیات سند... +pdfjs-document-properties-button-label = خصوصیات سند... +pdfjs-document-properties-file-name = نام پرونده: +pdfjs-document-properties-file-size = حجم پرونده: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } کیلوبایت ({ $b } بایت) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } مگابایت ({ $b } بایت) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } کیلوبایت ({ $size_b } بایت) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } مگابایت ({ $size_b } بایت) +pdfjs-document-properties-title = عنوان: +pdfjs-document-properties-author = نویسنده: +pdfjs-document-properties-subject = موضوع: +pdfjs-document-properties-keywords = کلیدواژه‌ها: +pdfjs-document-properties-creation-date = تاریخ ایجاد: +pdfjs-document-properties-modification-date = تاریخ ویرایش: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }، { $time } +pdfjs-document-properties-creator = ایجاد کننده: +pdfjs-document-properties-producer = ایجاد کننده PDF: +pdfjs-document-properties-version = نسخه PDF: +pdfjs-document-properties-page-count = تعداد صفحات: +pdfjs-document-properties-page-size = اندازه صفحه: +pdfjs-document-properties-page-size-unit-inches = اینچ +pdfjs-document-properties-page-size-unit-millimeters = میلی‌متر +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = نامه +pdfjs-document-properties-page-size-name-legal = حقوقی + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +pdfjs-document-properties-linearized-yes = بله +pdfjs-document-properties-linearized-no = خیر +pdfjs-document-properties-close-button = بستن + +## Print + +pdfjs-print-progress-message = آماده سازی مدارک برای چاپ کردن… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = لغو +pdfjs-printing-not-supported = هشدار: قابلیت چاپ به‌طور کامل در این مرورگر پشتیبانی نمی‌شود. +pdfjs-printing-not-ready = اخطار: پرونده PDF بطور کامل بارگیری نشده و امکان چاپ وجود ندارد. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = باز و بسته کردن نوار کناری +pdfjs-toggle-sidebar-button-label = تغییرحالت نوارکناری +pdfjs-document-outline-button = + .title = نمایش رئوس مطالب مدارک(برای بازشدن/جمع شدن همه موارد دوبار کلیک کنید) +pdfjs-document-outline-button-label = طرح نوشتار +pdfjs-attachments-button = + .title = نمایش پیوست‌ها +pdfjs-attachments-button-label = پیوست‌ها +pdfjs-layers-button-label = لایه‌ها +pdfjs-thumbs-button = + .title = نمایش تصاویر بندانگشتی +pdfjs-thumbs-button-label = تصاویر بندانگشتی +pdfjs-findbar-button = + .title = جستجو در سند +pdfjs-findbar-button-label = پیدا کردن + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = صفحه { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = تصویر بند‌ انگشتی صفحه { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = پیدا کردن + .placeholder = پیدا کردن در سند… +pdfjs-find-previous-button = + .title = پیدا کردن رخداد قبلی عبارت +pdfjs-find-previous-button-label = قبلی +pdfjs-find-next-button = + .title = پیدا کردن رخداد بعدی عبارت +pdfjs-find-next-button-label = بعدی +pdfjs-find-highlight-checkbox = برجسته و هایلایت کردن همه موارد +pdfjs-find-match-case-checkbox-label = تطبیق کوچکی و بزرگی حروف +pdfjs-find-entire-word-checkbox-label = تمام کلمه‌ها +pdfjs-find-reached-top = به بالای صفحه رسیدیم، از پایین ادامه می‌دهیم +pdfjs-find-reached-bottom = به آخر صفحه رسیدیم، از بالا ادامه می‌دهیم +pdfjs-find-not-found = عبارت پیدا نشد + +## Predefined zoom values + +pdfjs-page-scale-width = عرض صفحه +pdfjs-page-scale-fit = اندازه کردن صفحه +pdfjs-page-scale-auto = بزرگنمایی خودکار +pdfjs-page-scale-actual = اندازه واقعی‌ +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = صفحهٔ { $page } + +## Loading indicator messages + +pdfjs-loading-error = هنگام بارگیری پرونده PDF خطایی رخ داد. +pdfjs-invalid-file-error = پرونده PDF نامعتبر یامعیوب می‌باشد. +pdfjs-missing-file-error = پرونده PDF یافت نشد. +pdfjs-unexpected-response-error = پاسخ پیش بینی نشده سرور +pdfjs-rendering-error = هنگام بارگیری صفحه خطایی رخ داد. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }، { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } Annotation] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = جهت باز کردن پرونده PDF گذرواژه را وارد نمائید. +pdfjs-password-invalid = گذرواژه نامعتبر. لطفا مجددا تلاش کنید. +pdfjs-password-ok-button = تأیید +pdfjs-password-cancel-button = لغو +pdfjs-web-fonts-disabled = فونت های تحت وب غیر فعال شده اند: امکان استفاده از نمایش دهنده داخلی PDF وجود ندارد. + +## Editing + +pdfjs-editor-free-text-button = + .title = متن +pdfjs-editor-free-text-button-label = متن +pdfjs-editor-ink-button = + .title = کشیدن +pdfjs-editor-ink-button-label = کشیدن +pdfjs-editor-stamp-button = + .title = افزودن یا ویرایش تصاویر +pdfjs-editor-stamp-button-label = افزودن یا ویرایش تصاویر +pdfjs-editor-highlight-button = + .title = برجسته کردن +pdfjs-editor-highlight-button-label = برجسته کردن +pdfjs-highlight-floating-button1 = + .title = برجسته کردن + .aria-label = برجسته کردن +pdfjs-highlight-floating-button-label = برجسته کردن + +## Remove button for the various kind of editor. + + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = رنگ +pdfjs-editor-free-text-size-input = اندازه +pdfjs-editor-ink-color-input = رنگ +pdfjs-editor-stamp-add-image-button = + .title = افزودن تصویر +pdfjs-editor-stamp-add-image-button-label = افزودن تصویر +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = ویرایشگر متن + .default-content = شروع به نوشتن کنید… +pdfjs-free-text = + .aria-label = ویرایشگر متن +pdfjs-free-text-default-content = شروع به نوشتن کنید… + +## Alt-text dialog + +pdfjs-editor-alt-text-add-description-label = افزودن توضیحات +pdfjs-editor-alt-text-cancel-button = انصراف +pdfjs-editor-alt-text-save-button = ذخیره + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + + +## Color picker + +pdfjs-editor-colorpicker-button = + .title = تغییر رنگ +pdfjs-editor-colorpicker-dropdown = + .aria-label = انتخاب رنگ +pdfjs-editor-colorpicker-yellow = + .title = زرد +pdfjs-editor-colorpicker-green = + .title = سبز +pdfjs-editor-colorpicker-blue = + .title = آبی +pdfjs-editor-colorpicker-pink = + .title = صورتی +pdfjs-editor-colorpicker-red = + .title = قرمز + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = نمایش همه +pdfjs-editor-highlight-show-all-button = + .title = نمایش همه + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = بیشتر بدانید +pdfjs-editor-new-alt-text-not-now-button = اکنون نه +pdfjs-editor-new-alt-text-error-close-button = بستن + +## Image alt-text settings + +pdfjs-editor-alt-text-settings-delete-model-button = حذف +pdfjs-editor-alt-text-settings-download-model-button = دریافت +pdfjs-editor-alt-text-settings-downloading-model-button = در حال دریافت… +pdfjs-editor-alt-text-settings-close-button = بستن diff --git a/public/pdfjs/web/locale/ff/viewer.ftl b/public/pdfjs/web/locale/ff/viewer.ftl new file mode 100644 index 0000000..d1419f5 --- /dev/null +++ b/public/pdfjs/web/locale/ff/viewer.ftl @@ -0,0 +1,247 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Hello Ɓennungo +pdfjs-previous-button-label = Ɓennuɗo +pdfjs-next-button = + .title = Hello faango +pdfjs-next-button-label = Yeeso +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Hello +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = e nder { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } of { $pagesCount }) +pdfjs-zoom-out-button = + .title = Lonngo Woɗɗa +pdfjs-zoom-out-button-label = Lonngo Woɗɗa +pdfjs-zoom-in-button = + .title = Lonngo Ara +pdfjs-zoom-in-button-label = Lonngo Ara +pdfjs-zoom-select = + .title = Lonngo +pdfjs-presentation-mode-button = + .title = Faytu to Presentation Mode +pdfjs-presentation-mode-button-label = Presentation Mode +pdfjs-open-file-button = + .title = Uddit Fiilde +pdfjs-open-file-button-label = Uddit +pdfjs-print-button = + .title = Winndito +pdfjs-print-button-label = Winndito + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Kuutorɗe +pdfjs-tools-button-label = Kuutorɗe +pdfjs-first-page-button = + .title = Yah to hello adanngo +pdfjs-first-page-button-label = Yah to hello adanngo +pdfjs-last-page-button = + .title = Yah to hello wattindiingo +pdfjs-last-page-button-label = Yah to hello wattindiingo +pdfjs-page-rotate-cw-button = + .title = Yiiltu Faya Ñaamo +pdfjs-page-rotate-cw-button-label = Yiiltu Faya Ñaamo +pdfjs-page-rotate-ccw-button = + .title = Yiiltu Faya Nano +pdfjs-page-rotate-ccw-button-label = Yiiltu Faya Nano +pdfjs-cursor-text-select-tool-button = + .title = Gollin kaɓirgel cuɓirgel binndi +pdfjs-cursor-text-select-tool-button-label = Kaɓirgel cuɓirgel binndi +pdfjs-cursor-hand-tool-button = + .title = Hurmin kuutorgal junngo +pdfjs-cursor-hand-tool-button-label = Kaɓirgel junngo +pdfjs-scroll-vertical-button = + .title = Huutoro gorwitol daringol +pdfjs-scroll-vertical-button-label = Gorwitol daringol +pdfjs-scroll-horizontal-button = + .title = Huutoro gorwitol lelingol +pdfjs-scroll-horizontal-button-label = Gorwitol daringol +pdfjs-scroll-wrapped-button = + .title = Huutoro gorwitol coomingol +pdfjs-scroll-wrapped-button-label = Gorwitol coomingol +pdfjs-spread-none-button = + .title = Hoto tawtu kelle kelle +pdfjs-spread-none-button-label = Alaa Spreads +pdfjs-spread-odd-button = + .title = Tawtu kelle puɗɗortooɗe kelle teelɗe +pdfjs-spread-odd-button-label = Kelle teelɗe +pdfjs-spread-even-button = + .title = Tawtu ɗereeji kelle puɗɗoriiɗi kelle teeltuɗe +pdfjs-spread-even-button-label = Kelle teeltuɗe + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Keeroraaɗi Winndannde… +pdfjs-document-properties-button-label = Keeroraaɗi Winndannde… +pdfjs-document-properties-file-name = Innde fiilde: +pdfjs-document-properties-file-size = Ɓetol fiilde: +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bite) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bite) +pdfjs-document-properties-title = Tiitoonde: +pdfjs-document-properties-author = Binnduɗo: +pdfjs-document-properties-subject = Toɓɓere: +pdfjs-document-properties-keywords = Kelmekele jiytirɗe: +pdfjs-document-properties-creation-date = Ñalnde Sosaa: +pdfjs-document-properties-modification-date = Ñalnde Waylaa: +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Cosɗo: +pdfjs-document-properties-producer = Paggiiɗo PDF: +pdfjs-document-properties-version = Yamre PDF: +pdfjs-document-properties-page-count = Limoore Kelle: +pdfjs-document-properties-page-size = Ɓeto Hello: +pdfjs-document-properties-page-size-unit-inches = nder +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = dariingo +pdfjs-document-properties-page-size-orientation-landscape = wertiingo +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Ɓataake +pdfjs-document-properties-page-size-name-legal = Laawol + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Ɗisngo geese yaawngo: +pdfjs-document-properties-linearized-yes = Eey +pdfjs-document-properties-linearized-no = Alaa +pdfjs-document-properties-close-button = Uddu + +## Print + +pdfjs-print-progress-message = Nana heboo winnditaade fiilannde… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Haaytu +pdfjs-printing-not-supported = Reentino: Winnditagol tammbitaaka no feewi e ndee wanngorde. +pdfjs-printing-not-ready = Reentino: PDF oo loowaaki haa timmi ngam winnditagol. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Toggilo Palal Sawndo +pdfjs-toggle-sidebar-button-label = Toggilo Palal Sawndo +pdfjs-document-outline-button = + .title = Hollu Ƴiyal Fiilannde (dobdobo ngam wertude/taggude teme fof) +pdfjs-document-outline-button-label = Toɓɓe Fiilannde +pdfjs-attachments-button = + .title = Hollu Ɗisanɗe +pdfjs-attachments-button-label = Ɗisanɗe +pdfjs-thumbs-button = + .title = Hollu Dooɓe +pdfjs-thumbs-button-label = Dooɓe +pdfjs-findbar-button = + .title = Yiylo e fiilannde +pdfjs-findbar-button-label = Yiytu + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Hello { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Dooɓre Hello { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Yiytu + .placeholder = Yiylo nder dokimaa +pdfjs-find-previous-button = + .title = Yiylo cilol ɓennugol konngol ngol +pdfjs-find-previous-button-label = Ɓennuɗo +pdfjs-find-next-button = + .title = Yiylo cilol garowol konngol ngol +pdfjs-find-next-button-label = Yeeso +pdfjs-find-highlight-checkbox = Jalbin fof +pdfjs-find-match-case-checkbox-label = Jaaɓnu darnde +pdfjs-find-entire-word-checkbox-label = Kelme timmuɗe tan +pdfjs-find-reached-top = Heɓii fuɗɗorde fiilannde, jokku faya les +pdfjs-find-reached-bottom = Heɓii hoore fiilannde, jokku faya les +pdfjs-find-not-found = Konngi njiyataa + +## Predefined zoom values + +pdfjs-page-scale-width = Njaajeendi Hello +pdfjs-page-scale-fit = Keƴeendi Hello +pdfjs-page-scale-auto = Loongorde Jaajol +pdfjs-page-scale-actual = Ɓetol Jaati +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + + +## Loading indicator messages + +pdfjs-loading-error = Juumre waɗii tuma nde loowata PDF oo. +pdfjs-invalid-file-error = Fiilde PDF moƴƴaani walla jiibii. +pdfjs-missing-file-error = Fiilde PDF ena ŋakki. +pdfjs-unexpected-response-error = Jaabtol sarworde tijjinooka. +pdfjs-rendering-error = Juumre waɗii tuma nde yoŋkittoo hello. + +## Annotations + +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } Siiftannde] + +## Password + +pdfjs-password-label = Naatu finnde ngam uddite ndee fiilde PDF. +pdfjs-password-invalid = Finnde moƴƴaani. Tiiɗno eto kadi. +pdfjs-password-ok-button = OK +pdfjs-password-cancel-button = Haaytu +pdfjs-web-fonts-disabled = Ponte geese ko daaƴaaɗe: horiima huutoraade ponte PDF coomtoraaɗe. + +## Editing + + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + diff --git a/public/pdfjs/web/locale/fi/viewer.ftl b/public/pdfjs/web/locale/fi/viewer.ftl new file mode 100644 index 0000000..0819d0e --- /dev/null +++ b/public/pdfjs/web/locale/fi/viewer.ftl @@ -0,0 +1,515 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Edellinen sivu +pdfjs-previous-button-label = Edellinen +pdfjs-next-button = + .title = Seuraava sivu +pdfjs-next-button-label = Seuraava +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Sivu +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = / { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } / { $pagesCount }) +pdfjs-zoom-out-button = + .title = Loitonna +pdfjs-zoom-out-button-label = Loitonna +pdfjs-zoom-in-button = + .title = Lähennä +pdfjs-zoom-in-button-label = Lähennä +pdfjs-zoom-select = + .title = Suurennus +pdfjs-presentation-mode-button = + .title = Siirry esitystilaan +pdfjs-presentation-mode-button-label = Esitystila +pdfjs-open-file-button = + .title = Avaa tiedosto +pdfjs-open-file-button-label = Avaa +pdfjs-print-button = + .title = Tulosta +pdfjs-print-button-label = Tulosta +pdfjs-save-button = + .title = Tallenna +pdfjs-save-button-label = Tallenna +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Lataa +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Lataa +pdfjs-bookmark-button = + .title = Nykyinen sivu (Näytä URL-osoite nykyiseltä sivulta) +pdfjs-bookmark-button-label = Nykyinen sivu + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Tools +pdfjs-tools-button-label = Tools +pdfjs-first-page-button = + .title = Siirry ensimmäiselle sivulle +pdfjs-first-page-button-label = Siirry ensimmäiselle sivulle +pdfjs-last-page-button = + .title = Siirry viimeiselle sivulle +pdfjs-last-page-button-label = Siirry viimeiselle sivulle +pdfjs-page-rotate-cw-button = + .title = Kierrä oikealle +pdfjs-page-rotate-cw-button-label = Kierrä oikealle +pdfjs-page-rotate-ccw-button = + .title = Kierrä vasemmalle +pdfjs-page-rotate-ccw-button-label = Kierrä vasemmalle +pdfjs-cursor-text-select-tool-button = + .title = Käytä tekstinvalintatyökalua +pdfjs-cursor-text-select-tool-button-label = Tekstinvalintatyökalu +pdfjs-cursor-hand-tool-button = + .title = Käytä käsityökalua +pdfjs-cursor-hand-tool-button-label = Käsityökalu +pdfjs-scroll-page-button = + .title = Käytä sivun vieritystä +pdfjs-scroll-page-button-label = Sivun vieritys +pdfjs-scroll-vertical-button = + .title = Käytä pystysuuntaista vieritystä +pdfjs-scroll-vertical-button-label = Pystysuuntainen vieritys +pdfjs-scroll-horizontal-button = + .title = Käytä vaakasuuntaista vieritystä +pdfjs-scroll-horizontal-button-label = Vaakasuuntainen vieritys +pdfjs-scroll-wrapped-button = + .title = Käytä rivittyvää vieritystä +pdfjs-scroll-wrapped-button-label = Rivittyvä vieritys +pdfjs-spread-none-button = + .title = Älä yhdistä sivuja aukeamiksi +pdfjs-spread-none-button-label = Ei aukeamia +pdfjs-spread-odd-button = + .title = Yhdistä sivut aukeamiksi alkaen parittomalta sivulta +pdfjs-spread-odd-button-label = Parittomalta alkavat aukeamat +pdfjs-spread-even-button = + .title = Yhdistä sivut aukeamiksi alkaen parilliselta sivulta +pdfjs-spread-even-button-label = Parilliselta alkavat aukeamat + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Dokumentin ominaisuudet… +pdfjs-document-properties-button-label = Dokumentin ominaisuudet… +pdfjs-document-properties-file-name = Tiedoston nimi: +pdfjs-document-properties-file-size = Tiedoston koko: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } kt ({ $b } tavua) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } Mt ({ $b } tavua) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } kt ({ $size_b } tavua) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } Mt ({ $size_b } tavua) +pdfjs-document-properties-title = Otsikko: +pdfjs-document-properties-author = Tekijä: +pdfjs-document-properties-subject = Aihe: +pdfjs-document-properties-keywords = Avainsanat: +pdfjs-document-properties-creation-date = Luomispäivämäärä: +pdfjs-document-properties-modification-date = Muokkauspäivämäärä: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Luoja: +pdfjs-document-properties-producer = PDF-tuottaja: +pdfjs-document-properties-version = PDF-versio: +pdfjs-document-properties-page-count = Sivujen määrä: +pdfjs-document-properties-page-size = Sivun koko: +pdfjs-document-properties-page-size-unit-inches = in +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = pysty +pdfjs-document-properties-page-size-orientation-landscape = vaaka +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Letter +pdfjs-document-properties-page-size-name-legal = Legal + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Nopea web-katselu: +pdfjs-document-properties-linearized-yes = Kyllä +pdfjs-document-properties-linearized-no = Ei +pdfjs-document-properties-close-button = Sulje + +## Print + +pdfjs-print-progress-message = Valmistellaan dokumenttia tulostamista varten… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress } % +pdfjs-print-progress-close-button = Peruuta +pdfjs-printing-not-supported = Varoitus: Selain ei tue kaikkia tulostustapoja. +pdfjs-printing-not-ready = Varoitus: PDF-tiedosto ei ole vielä latautunut kokonaan, eikä sitä voi vielä tulostaa. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Näytä/piilota sivupaneeli +pdfjs-toggle-sidebar-notification-button = + .title = Näytä/piilota sivupaneeli (dokumentissa on sisällys/liitteitä/tasoja) +pdfjs-toggle-sidebar-button-label = Näytä/piilota sivupaneeli +pdfjs-document-outline-button = + .title = Näytä dokumentin sisällys (laajenna tai kutista kohdat kaksoisnapsauttamalla) +pdfjs-document-outline-button-label = Dokumentin sisällys +pdfjs-attachments-button = + .title = Näytä liitteet +pdfjs-attachments-button-label = Liitteet +pdfjs-layers-button = + .title = Näytä tasot (kaksoisnapsauta palauttaaksesi kaikki tasot oletustilaan) +pdfjs-layers-button-label = Tasot +pdfjs-thumbs-button = + .title = Näytä pienoiskuvat +pdfjs-thumbs-button-label = Pienoiskuvat +pdfjs-current-outline-item-button = + .title = Etsi nykyinen sisällyksen kohta +pdfjs-current-outline-item-button-label = Nykyinen sisällyksen kohta +pdfjs-findbar-button = + .title = Etsi dokumentista +pdfjs-findbar-button-label = Etsi +pdfjs-additional-layers = Lisätasot + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Sivu { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Pienoiskuva sivusta { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Etsi + .placeholder = Etsi dokumentista… +pdfjs-find-previous-button = + .title = Etsi hakusanan edellinen osuma +pdfjs-find-previous-button-label = Edellinen +pdfjs-find-next-button = + .title = Etsi hakusanan seuraava osuma +pdfjs-find-next-button-label = Seuraava +pdfjs-find-highlight-checkbox = Korosta kaikki +pdfjs-find-match-case-checkbox-label = Huomioi kirjainkoko +pdfjs-find-match-diacritics-checkbox-label = Erota tarkkeet +pdfjs-find-entire-word-checkbox-label = Kokonaiset sanat +pdfjs-find-reached-top = Päästiin dokumentin alkuun, jatketaan lopusta +pdfjs-find-reached-bottom = Päästiin dokumentin loppuun, jatketaan alusta +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] { $current } / { $total } osuma + *[other] { $current } / { $total } osumaa + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] Yli { $limit } osuma + *[other] Yli { $limit } osumaa + } +pdfjs-find-not-found = Hakusanaa ei löytynyt + +## Predefined zoom values + +pdfjs-page-scale-width = Sivun leveys +pdfjs-page-scale-fit = Koko sivu +pdfjs-page-scale-auto = Automaattinen suurennus +pdfjs-page-scale-actual = Todellinen koko +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale } % + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Sivu { $page } + +## Loading indicator messages + +pdfjs-loading-error = Tapahtui virhe ladattaessa PDF-tiedostoa. +pdfjs-invalid-file-error = Virheellinen tai vioittunut PDF-tiedosto. +pdfjs-missing-file-error = Puuttuva PDF-tiedosto. +pdfjs-unexpected-response-error = Odottamaton vastaus palvelimelta. +pdfjs-rendering-error = Tapahtui virhe piirrettäessä sivua. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type }-merkintä] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Kirjoita PDF-tiedoston salasana. +pdfjs-password-invalid = Virheellinen salasana. Yritä uudestaan. +pdfjs-password-ok-button = OK +pdfjs-password-cancel-button = Peruuta +pdfjs-web-fonts-disabled = Verkkosivujen omat kirjasinlajit on estetty: ei voida käyttää upotettuja PDF-kirjasinlajeja. + +## Editing + +pdfjs-editor-free-text-button = + .title = Teksti +pdfjs-editor-free-text-button-label = Teksti +pdfjs-editor-ink-button = + .title = Piirros +pdfjs-editor-ink-button-label = Piirros +pdfjs-editor-stamp-button = + .title = Lisää tai muokkaa kuvia +pdfjs-editor-stamp-button-label = Lisää tai muokkaa kuvia +pdfjs-editor-highlight-button = + .title = Korostus +pdfjs-editor-highlight-button-label = Korostus +pdfjs-highlight-floating-button1 = + .title = Korostus + .aria-label = Korostus +pdfjs-highlight-floating-button-label = Korostus + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Poista piirros +pdfjs-editor-remove-freetext-button = + .title = Poista teksti +pdfjs-editor-remove-stamp-button = + .title = Poista kuva +pdfjs-editor-remove-highlight-button = + .title = Poista korostus + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Väri +pdfjs-editor-free-text-size-input = Koko +pdfjs-editor-ink-color-input = Väri +pdfjs-editor-ink-thickness-input = Paksuus +pdfjs-editor-ink-opacity-input = Peittävyys +pdfjs-editor-stamp-add-image-button = + .title = Lisää kuva +pdfjs-editor-stamp-add-image-button-label = Lisää kuva +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Paksuus +pdfjs-editor-free-highlight-thickness-title = + .title = Muuta paksuutta korostaessasi muita kohteita kuin tekstiä +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = Tekstimuokkain + .default-content = Aloita kirjoittaminen… +pdfjs-free-text = + .aria-label = Tekstimuokkain +pdfjs-free-text-default-content = Aloita kirjoittaminen… +pdfjs-ink = + .aria-label = Piirrustusmuokkain +pdfjs-ink-canvas = + .aria-label = Käyttäjän luoma kuva + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = Vaihtoehtoinen teksti +pdfjs-editor-alt-text-edit-button = + .aria-label = Muokkaa vaihtoehtoista tekstiä +pdfjs-editor-alt-text-edit-button-label = Muokkaa vaihtoehtoista tekstiä +pdfjs-editor-alt-text-dialog-label = Valitse vaihtoehto +pdfjs-editor-alt-text-dialog-description = Vaihtoehtoinen teksti ("alt-teksti") auttaa ihmisiä, jotka eivät näe kuvaa tai kun kuva ei lataudu. +pdfjs-editor-alt-text-add-description-label = Lisää kuvaus +pdfjs-editor-alt-text-add-description-description = Pyri 1-2 lauseeseen, jotka kuvaavat aihetta, ympäristöä tai toimintaa. +pdfjs-editor-alt-text-mark-decorative-label = Merkitse koristeelliseksi +pdfjs-editor-alt-text-mark-decorative-description = Tätä käytetään koristekuville, kuten reunuksille tai vesileimoille. +pdfjs-editor-alt-text-cancel-button = Peruuta +pdfjs-editor-alt-text-save-button = Tallenna +pdfjs-editor-alt-text-decorative-tooltip = Merkitty koristeelliseksi +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = Esimerkiksi "Nuori mies istuu pöytään syömään aterian" +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = Vaihtoehtoinen teksti + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Vasen yläkulma - muuta kokoa +pdfjs-editor-resizer-label-top-middle = Ylhäällä keskellä - muuta kokoa +pdfjs-editor-resizer-label-top-right = Oikea yläkulma - muuta kokoa +pdfjs-editor-resizer-label-middle-right = Keskellä oikealla - muuta kokoa +pdfjs-editor-resizer-label-bottom-right = Oikea alakulma - muuta kokoa +pdfjs-editor-resizer-label-bottom-middle = Alhaalla keskellä - muuta kokoa +pdfjs-editor-resizer-label-bottom-left = Vasen alakulma - muuta kokoa +pdfjs-editor-resizer-label-middle-left = Keskellä vasemmalla - muuta kokoa +pdfjs-editor-resizer-top-left = + .aria-label = Vasen yläkulma - muuta kokoa +pdfjs-editor-resizer-top-middle = + .aria-label = Ylhäällä keskellä - muuta kokoa +pdfjs-editor-resizer-top-right = + .aria-label = Oikea yläkulma - muuta kokoa +pdfjs-editor-resizer-middle-right = + .aria-label = Keskellä oikealla - muuta kokoa +pdfjs-editor-resizer-bottom-right = + .aria-label = Oikea alakulma - muuta kokoa +pdfjs-editor-resizer-bottom-middle = + .aria-label = Alhaalla keskellä - muuta kokoa +pdfjs-editor-resizer-bottom-left = + .aria-label = Vasen alakulma - muuta kokoa +pdfjs-editor-resizer-middle-left = + .aria-label = Keskellä vasemmalla - muuta kokoa + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Korostusväri +pdfjs-editor-colorpicker-button = + .title = Vaihda väri +pdfjs-editor-colorpicker-dropdown = + .aria-label = Värivalinnat +pdfjs-editor-colorpicker-yellow = + .title = Keltainen +pdfjs-editor-colorpicker-green = + .title = Vihreä +pdfjs-editor-colorpicker-blue = + .title = Sininen +pdfjs-editor-colorpicker-pink = + .title = Pinkki +pdfjs-editor-colorpicker-red = + .title = Punainen + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Näytä kaikki +pdfjs-editor-highlight-show-all-button = + .title = Näytä kaikki + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = Muokkaa vaihtoehtoista tekstiä (kuvan kuvaus) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = Lisää vaihtoehtoinen teksti (kuvan kuvaus) +pdfjs-editor-new-alt-text-textarea = + .placeholder = Kirjoita kuvaus tähän… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = Lyhyt kuvaus ihmisille, jotka eivät näe kuvaa tai kun kuva ei lataudu. +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = Tämä vaihtoehtoinen teksti luotiin automaattisesti, ja se voi olla epätarkka. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Lue lisää +pdfjs-editor-new-alt-text-create-automatically-button-label = Luo vaihtoehtoinen teksti automaattisesti +pdfjs-editor-new-alt-text-not-now-button = Ei nyt +pdfjs-editor-new-alt-text-error-title = Vaihtoehtotekstiä ei voitu luoda automaattisesti +pdfjs-editor-new-alt-text-error-description = Kirjoita oma vaihtoehtoinen teksti tai yritä myöhemmin uudelleen. +pdfjs-editor-new-alt-text-error-close-button = Sulje +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = Ladataan vaihtoehtoisen tekstin tekoälymallia ({ $downloadedSize } / { $totalSize } Mt) + .aria-valuetext = Ladataan vaihtoehtoisen tekstin tekoälymallia ({ $downloadedSize } / { $totalSize } Mt) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = Vaihtoehtoinen teksti lisätty +pdfjs-editor-new-alt-text-added-button-label = Vaihtoehtoinen teksti lisätty +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = Vaihtoehtoinen teksti puuttuu +pdfjs-editor-new-alt-text-missing-button-label = Vaihtoehtoinen teksti puuttuu +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = Tarkista vaihtoehtoinen teksti +pdfjs-editor-new-alt-text-to-review-button-label = Tarkista vaihtoehtoinen teksti +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Luotu automaattisesti: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = Kuvan vaihtoehtoisen tekstin asetukset +pdfjs-image-alt-text-settings-button-label = Kuvan vaihtoehtoisen tekstin asetukset +pdfjs-editor-alt-text-settings-dialog-label = Kuvan vaihtoehtoisen tekstin asetukset +pdfjs-editor-alt-text-settings-automatic-title = Automaattinen vaihtoehtoinen teksti +pdfjs-editor-alt-text-settings-create-model-button-label = Luo vaihtoehtoinen teksti automaattisesti +pdfjs-editor-alt-text-settings-create-model-description = Ehdottaa kuvauksia, jotka auttavat ihmisiä, jotka eivät näe kuvaa tai kun kuva ei lataudu. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = Vaihtoehtoisen tekstin tekoälymalli ({ $totalSize } Mt) +pdfjs-editor-alt-text-settings-ai-model-description = Toimii paikallisesti laitteellasi, joten tietosi pysyvät yksityisinä. Vaadittu automaattiselle vaihtoehtoiselle tekstille. +pdfjs-editor-alt-text-settings-delete-model-button = Poista +pdfjs-editor-alt-text-settings-download-model-button = Lataa +pdfjs-editor-alt-text-settings-downloading-model-button = Ladataan… +pdfjs-editor-alt-text-settings-editor-title = Vaihtoehtoisen tekstin muokkain +pdfjs-editor-alt-text-settings-show-dialog-button-label = Näytä vaihtoehtoisen tekstin muokkain heti, kun lisäät kuvan +pdfjs-editor-alt-text-settings-show-dialog-description = Auttaa varmistamaan, että kaikissa kuvissasi on vaihtoehtoinen teksti. +pdfjs-editor-alt-text-settings-close-button = Sulje + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = Korostus poistettu +pdfjs-editor-undo-bar-message-freetext = Teksti poistettu +pdfjs-editor-undo-bar-message-ink = Piirustus poistettu +pdfjs-editor-undo-bar-message-stamp = Kuva poistettu +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = + { $count -> + [one] { $count } merkintä poistettu + *[other] { $count } merkintää poistettu + } +pdfjs-editor-undo-bar-undo-button = + .title = Kumoa +pdfjs-editor-undo-bar-undo-button-label = Kumoa +pdfjs-editor-undo-bar-close-button = + .title = Sulje +pdfjs-editor-undo-bar-close-button-label = Sulje diff --git a/public/pdfjs/web/locale/fr/viewer.ftl b/public/pdfjs/web/locale/fr/viewer.ftl new file mode 100644 index 0000000..d0a778f --- /dev/null +++ b/public/pdfjs/web/locale/fr/viewer.ftl @@ -0,0 +1,511 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Page précédente +pdfjs-previous-button-label = Précédent +pdfjs-next-button = + .title = Page suivante +pdfjs-next-button-label = Suivant +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Page +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = sur { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } sur { $pagesCount }) +pdfjs-zoom-out-button = + .title = Zoom arrière +pdfjs-zoom-out-button-label = Zoom arrière +pdfjs-zoom-in-button = + .title = Zoom avant +pdfjs-zoom-in-button-label = Zoom avant +pdfjs-zoom-select = + .title = Zoom +pdfjs-presentation-mode-button = + .title = Basculer en mode présentation +pdfjs-presentation-mode-button-label = Mode présentation +pdfjs-open-file-button = + .title = Ouvrir le fichier +pdfjs-open-file-button-label = Ouvrir le fichier +pdfjs-print-button = + .title = Imprimer +pdfjs-print-button-label = Imprimer +pdfjs-save-button = + .title = Enregistrer +pdfjs-save-button-label = Enregistrer +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Télécharger +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Télécharger +pdfjs-bookmark-button = + .title = Page courante (montrer l’adresse de la page courante) +pdfjs-bookmark-button-label = Page courante + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Outils +pdfjs-tools-button-label = Outils +pdfjs-first-page-button = + .title = Aller à la première page +pdfjs-first-page-button-label = Aller à la première page +pdfjs-last-page-button = + .title = Aller à la dernière page +pdfjs-last-page-button-label = Aller à la dernière page +pdfjs-page-rotate-cw-button = + .title = Rotation horaire +pdfjs-page-rotate-cw-button-label = Rotation horaire +pdfjs-page-rotate-ccw-button = + .title = Rotation antihoraire +pdfjs-page-rotate-ccw-button-label = Rotation antihoraire +pdfjs-cursor-text-select-tool-button = + .title = Activer l’outil de sélection de texte +pdfjs-cursor-text-select-tool-button-label = Outil de sélection de texte +pdfjs-cursor-hand-tool-button = + .title = Activer l’outil main +pdfjs-cursor-hand-tool-button-label = Outil main +pdfjs-scroll-page-button = + .title = Utiliser le défilement par page +pdfjs-scroll-page-button-label = Défilement par page +pdfjs-scroll-vertical-button = + .title = Utiliser le défilement vertical +pdfjs-scroll-vertical-button-label = Défilement vertical +pdfjs-scroll-horizontal-button = + .title = Utiliser le défilement horizontal +pdfjs-scroll-horizontal-button-label = Défilement horizontal +pdfjs-scroll-wrapped-button = + .title = Utiliser le défilement par bloc +pdfjs-scroll-wrapped-button-label = Défilement par bloc +pdfjs-spread-none-button = + .title = Ne pas afficher les pages deux à deux +pdfjs-spread-none-button-label = Pas de double affichage +pdfjs-spread-odd-button = + .title = Afficher les pages par deux, impaires à gauche +pdfjs-spread-odd-button-label = Doubles pages, impaires à gauche +pdfjs-spread-even-button = + .title = Afficher les pages par deux, paires à gauche +pdfjs-spread-even-button-label = Doubles pages, paires à gauche + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Propriétés du document… +pdfjs-document-properties-button-label = Propriétés du document… +pdfjs-document-properties-file-name = Nom du fichier : +pdfjs-document-properties-file-size = Taille du fichier : +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } Ko ({ $b } octets) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } Mo ({ $b } octets) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } Ko ({ $size_b } octets) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } Mo ({ $size_b } octets) +pdfjs-document-properties-title = Titre : +pdfjs-document-properties-author = Auteur : +pdfjs-document-properties-subject = Sujet : +pdfjs-document-properties-keywords = Mots-clés : +pdfjs-document-properties-creation-date = Date de création : +pdfjs-document-properties-modification-date = Modifié le : +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date } à { $time } +pdfjs-document-properties-creator = Créé par : +pdfjs-document-properties-producer = Outil de conversion PDF : +pdfjs-document-properties-version = Version PDF : +pdfjs-document-properties-page-count = Nombre de pages : +pdfjs-document-properties-page-size = Taille de la page : +pdfjs-document-properties-page-size-unit-inches = in +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = portrait +pdfjs-document-properties-page-size-orientation-landscape = paysage +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = lettre +pdfjs-document-properties-page-size-name-legal = document juridique + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Affichage rapide des pages web : +pdfjs-document-properties-linearized-yes = Oui +pdfjs-document-properties-linearized-no = Non +pdfjs-document-properties-close-button = Fermer + +## Print + +pdfjs-print-progress-message = Préparation du document pour l’impression… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress } % +pdfjs-print-progress-close-button = Annuler +pdfjs-printing-not-supported = Attention : l’impression n’est pas totalement prise en charge par ce navigateur. +pdfjs-printing-not-ready = Attention : le PDF n’est pas entièrement chargé pour pouvoir l’imprimer. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Afficher/Masquer le panneau latéral +pdfjs-toggle-sidebar-notification-button = + .title = Afficher/Masquer le panneau latéral (le document contient des signets/pièces jointes/calques) +pdfjs-toggle-sidebar-button-label = Afficher/Masquer le panneau latéral +pdfjs-document-outline-button = + .title = Afficher les signets du document (double-cliquer pour développer/réduire tous les éléments) +pdfjs-document-outline-button-label = Signets du document +pdfjs-attachments-button = + .title = Afficher les pièces jointes +pdfjs-attachments-button-label = Pièces jointes +pdfjs-layers-button = + .title = Afficher les calques (double-cliquer pour réinitialiser tous les calques à l’état par défaut) +pdfjs-layers-button-label = Calques +pdfjs-thumbs-button = + .title = Afficher les vignettes +pdfjs-thumbs-button-label = Vignettes +pdfjs-current-outline-item-button = + .title = Trouver l’élément de plan actuel +pdfjs-current-outline-item-button-label = Élément de plan actuel +pdfjs-findbar-button = + .title = Rechercher dans le document +pdfjs-findbar-button-label = Rechercher +pdfjs-additional-layers = Calques additionnels + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Page { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Vignette de la page { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Rechercher + .placeholder = Rechercher dans le document… +pdfjs-find-previous-button = + .title = Trouver l’occurrence précédente de l’expression +pdfjs-find-previous-button-label = Précédent +pdfjs-find-next-button = + .title = Trouver la prochaine occurrence de l’expression +pdfjs-find-next-button-label = Suivant +pdfjs-find-highlight-checkbox = Tout surligner +pdfjs-find-match-case-checkbox-label = Respecter la casse +pdfjs-find-match-diacritics-checkbox-label = Respecter les accents et diacritiques +pdfjs-find-entire-word-checkbox-label = Mots entiers +pdfjs-find-reached-top = Haut de la page atteint, poursuite depuis la fin +pdfjs-find-reached-bottom = Bas de la page atteint, poursuite au début +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = Occurrence { $current } sur { $total } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] Plus d’{ $limit } occurrence + *[other] Plus de { $limit } occurrences + } +pdfjs-find-not-found = Expression non trouvée + +## Predefined zoom values + +pdfjs-page-scale-width = Pleine largeur +pdfjs-page-scale-fit = Page entière +pdfjs-page-scale-auto = Zoom automatique +pdfjs-page-scale-actual = Taille réelle +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale } % + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Page { $page } + +## Loading indicator messages + +pdfjs-loading-error = Une erreur s’est produite lors du chargement du fichier PDF. +pdfjs-invalid-file-error = Fichier PDF invalide ou corrompu. +pdfjs-missing-file-error = Fichier PDF manquant. +pdfjs-unexpected-response-error = Réponse inattendue du serveur. +pdfjs-rendering-error = Une erreur s’est produite lors de l’affichage de la page. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date } à { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [Annotation { $type }] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Veuillez saisir le mot de passe pour ouvrir ce fichier PDF. +pdfjs-password-invalid = Mot de passe incorrect. Veuillez réessayer. +pdfjs-password-ok-button = OK +pdfjs-password-cancel-button = Annuler +pdfjs-web-fonts-disabled = Les polices web sont désactivées : impossible d’utiliser les polices intégrées au PDF. + +## Editing + +pdfjs-editor-free-text-button = + .title = Texte +pdfjs-editor-free-text-button-label = Texte +pdfjs-editor-ink-button = + .title = Dessiner +pdfjs-editor-ink-button-label = Dessiner +pdfjs-editor-stamp-button = + .title = Ajouter ou modifier des images +pdfjs-editor-stamp-button-label = Ajouter ou modifier des images +pdfjs-editor-highlight-button = + .title = Surligner +pdfjs-editor-highlight-button-label = Surligner +pdfjs-highlight-floating-button1 = + .title = Surligner + .aria-label = Surligner +pdfjs-highlight-floating-button-label = Surligner + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Supprimer le dessin +pdfjs-editor-remove-freetext-button = + .title = Supprimer le texte +pdfjs-editor-remove-stamp-button = + .title = Supprimer l’image +pdfjs-editor-remove-highlight-button = + .title = Supprimer le surlignage + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Couleur +pdfjs-editor-free-text-size-input = Taille +pdfjs-editor-ink-color-input = Couleur +pdfjs-editor-ink-thickness-input = Épaisseur +pdfjs-editor-ink-opacity-input = Opacité +pdfjs-editor-stamp-add-image-button = + .title = Ajouter une image +pdfjs-editor-stamp-add-image-button-label = Ajouter une image +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Épaisseur +pdfjs-editor-free-highlight-thickness-title = + .title = Modifier l’épaisseur pour le surlignage d’éléments non textuels +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = Éditeur de texte + .default-content = Commencez à écrire… +pdfjs-free-text = + .aria-label = Éditeur de texte +pdfjs-free-text-default-content = Commencer à écrire… +pdfjs-ink = + .aria-label = Éditeur de dessin +pdfjs-ink-canvas = + .aria-label = Image créée par l’utilisateur·trice + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = Texte alternatif +pdfjs-editor-alt-text-edit-button = + .aria-label = Modifier le texte alternatif +pdfjs-editor-alt-text-edit-button-label = Modifier le texte alternatif +pdfjs-editor-alt-text-dialog-label = Sélectionnez une option +pdfjs-editor-alt-text-dialog-description = Le texte alternatif est utile lorsque des personnes ne peuvent pas voir l’image ou que l’image ne se charge pas. +pdfjs-editor-alt-text-add-description-label = Ajouter une description +pdfjs-editor-alt-text-add-description-description = Il est conseillé de rédiger une ou deux phrases décrivant le sujet, le cadre ou les actions. +pdfjs-editor-alt-text-mark-decorative-label = Marquer comme décorative +pdfjs-editor-alt-text-mark-decorative-description = Cette option est utilisée pour les images décoratives, comme les bordures ou les filigranes. +pdfjs-editor-alt-text-cancel-button = Annuler +pdfjs-editor-alt-text-save-button = Enregistrer +pdfjs-editor-alt-text-decorative-tooltip = Marquée comme décorative +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = Par exemple, « Un jeune homme est assis à une table pour prendre un repas » +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = Texte alternatif + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Coin supérieur gauche — redimensionner +pdfjs-editor-resizer-label-top-middle = Milieu haut — redimensionner +pdfjs-editor-resizer-label-top-right = Coin supérieur droit — redimensionner +pdfjs-editor-resizer-label-middle-right = Milieu droit — redimensionner +pdfjs-editor-resizer-label-bottom-right = Coin inférieur droit — redimensionner +pdfjs-editor-resizer-label-bottom-middle = Centre bas — redimensionner +pdfjs-editor-resizer-label-bottom-left = Coin inférieur gauche — redimensionner +pdfjs-editor-resizer-label-middle-left = Milieu gauche — redimensionner +pdfjs-editor-resizer-top-left = + .aria-label = Coin supérieur gauche — redimensionner +pdfjs-editor-resizer-top-middle = + .aria-label = Milieu haut — redimensionner +pdfjs-editor-resizer-top-right = + .aria-label = Coin supérieur droit — redimensionner +pdfjs-editor-resizer-middle-right = + .aria-label = Milieu droit — redimensionner +pdfjs-editor-resizer-bottom-right = + .aria-label = Coin inférieur droit — redimensionner +pdfjs-editor-resizer-bottom-middle = + .aria-label = Centre bas — redimensionner +pdfjs-editor-resizer-bottom-left = + .aria-label = Coin inférieur gauche — redimensionner +pdfjs-editor-resizer-middle-left = + .aria-label = Milieu gauche — redimensionner + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Couleur de surlignage +pdfjs-editor-colorpicker-button = + .title = Changer de couleur +pdfjs-editor-colorpicker-dropdown = + .aria-label = Choix de couleurs +pdfjs-editor-colorpicker-yellow = + .title = Jaune +pdfjs-editor-colorpicker-green = + .title = Vert +pdfjs-editor-colorpicker-blue = + .title = Bleu +pdfjs-editor-colorpicker-pink = + .title = Rose +pdfjs-editor-colorpicker-red = + .title = Rouge + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Tout afficher +pdfjs-editor-highlight-show-all-button = + .title = Tout afficher + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = Modifier le texte alternatif (description de l’image) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = Ajouter du texte alternatif (description de l’image) +pdfjs-editor-new-alt-text-textarea = + .placeholder = Rédigez votre description ici… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = Courte description pour les personnes qui ne peuvent pas voir l’image ou lorsque l’image ne se charge pas. +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = Ce texte alternatif a été créé automatiquement et peut être inexact. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = En savoir plus +pdfjs-editor-new-alt-text-create-automatically-button-label = Créer automatiquement le texte alternatif +pdfjs-editor-new-alt-text-not-now-button = Pas maintenant +pdfjs-editor-new-alt-text-error-title = Impossible de créer automatiquement le texte alternatif +pdfjs-editor-new-alt-text-error-description = Veuillez rédiger votre propre texte alternatif ou réessayer plus tard. +pdfjs-editor-new-alt-text-error-close-button = Fermer +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = Téléchargement du modèle d’IA de texte alternatif ({ $downloadedSize } sur { $totalSize } Mo) + .aria-valuetext = Téléchargement du modèle d’IA de texte alternatif ({ $downloadedSize } sur { $totalSize } Mo) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = Texte alternatif ajouté +pdfjs-editor-new-alt-text-added-button-label = Texte alternatif ajouté +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = Texte alternatif manquant +pdfjs-editor-new-alt-text-missing-button-label = Texte alternatif manquant +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = Réviser le texte alternatif +pdfjs-editor-new-alt-text-to-review-button-label = Réviser le texte alternatif +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Créé automatiquement : { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = Paramètres du texte alternatif des images +pdfjs-image-alt-text-settings-button-label = Paramètres du texte alternatif des images +pdfjs-editor-alt-text-settings-dialog-label = Paramètres du texte alternatif des images +pdfjs-editor-alt-text-settings-automatic-title = Texte alternatif automatique +pdfjs-editor-alt-text-settings-create-model-button-label = Créer automatiquement le texte alternatif +pdfjs-editor-alt-text-settings-create-model-description = Suggère des descriptions pour aider les personnes qui ne peuvent pas voir l’image ou lorsque l’image ne se charge pas. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = Modèle d’IA de texte alternatif ({ $totalSize } Mo) +pdfjs-editor-alt-text-settings-ai-model-description = Fonctionne localement sur votre appareil, vos données restent privées. Obligatoire pour la génération automatique de texte alternatif. +pdfjs-editor-alt-text-settings-delete-model-button = Supprimer +pdfjs-editor-alt-text-settings-download-model-button = Télécharger +pdfjs-editor-alt-text-settings-downloading-model-button = Téléchargement… +pdfjs-editor-alt-text-settings-editor-title = Éditeur de texte alternatif +pdfjs-editor-alt-text-settings-show-dialog-button-label = Afficher l’éditeur de texte alternatif immédiatement lors de l’ajout d’une image +pdfjs-editor-alt-text-settings-show-dialog-description = Vous aide à vous assurer que toutes vos images ont du texte alternatif. +pdfjs-editor-alt-text-settings-close-button = Fermer + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = Surlignage supprimé +pdfjs-editor-undo-bar-message-freetext = Texte supprimé +pdfjs-editor-undo-bar-message-ink = Dessin supprimé +pdfjs-editor-undo-bar-message-stamp = Image supprimée +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = + { $count -> + [one] { $count } annotation supprimée + *[other] { $count } annotations supprimées + } +pdfjs-editor-undo-bar-undo-button = + .title = Annuler +pdfjs-editor-undo-bar-undo-button-label = Annuler +pdfjs-editor-undo-bar-close-button = + .title = Fermer +pdfjs-editor-undo-bar-close-button-label = Fermer diff --git a/public/pdfjs/web/locale/fur/viewer.ftl b/public/pdfjs/web/locale/fur/viewer.ftl new file mode 100644 index 0000000..370af3f --- /dev/null +++ b/public/pdfjs/web/locale/fur/viewer.ftl @@ -0,0 +1,485 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Pagjine precedente +pdfjs-previous-button-label = Indaûr +pdfjs-next-button = + .title = Prossime pagjine +pdfjs-next-button-label = Indevant +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Pagjine +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = di { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } di { $pagesCount }) +pdfjs-zoom-out-button = + .title = Impiçulìs +pdfjs-zoom-out-button-label = Impiçulìs +pdfjs-zoom-in-button = + .title = Ingrandìs +pdfjs-zoom-in-button-label = Ingrandìs +pdfjs-zoom-select = + .title = Ingrandiment +pdfjs-presentation-mode-button = + .title = Passe ae modalitât presentazion +pdfjs-presentation-mode-button-label = Modalitât presentazion +pdfjs-open-file-button = + .title = Vierç un file +pdfjs-open-file-button-label = Vierç +pdfjs-print-button = + .title = Stampe +pdfjs-print-button-label = Stampe +pdfjs-save-button = + .title = Salve +pdfjs-save-button-label = Salve +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Discjame +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Discjame +pdfjs-bookmark-button = + .title = Pagjine corinte (mostre URL de pagjine atuâl) +pdfjs-bookmark-button-label = Pagjine corinte + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Struments +pdfjs-tools-button-label = Struments +pdfjs-first-page-button = + .title = Va ae prime pagjine +pdfjs-first-page-button-label = Va ae prime pagjine +pdfjs-last-page-button = + .title = Va ae ultime pagjine +pdfjs-last-page-button-label = Va ae ultime pagjine +pdfjs-page-rotate-cw-button = + .title = Zire in sens orari +pdfjs-page-rotate-cw-button-label = Zire in sens orari +pdfjs-page-rotate-ccw-button = + .title = Zire in sens antiorari +pdfjs-page-rotate-ccw-button-label = Zire in sens antiorari +pdfjs-cursor-text-select-tool-button = + .title = Ative il strument di selezion dal test +pdfjs-cursor-text-select-tool-button-label = Strument di selezion dal test +pdfjs-cursor-hand-tool-button = + .title = Ative il strument manute +pdfjs-cursor-hand-tool-button-label = Strument manute +pdfjs-scroll-page-button = + .title = Dopre il scoriment des pagjinis +pdfjs-scroll-page-button-label = Scoriment pagjinis +pdfjs-scroll-vertical-button = + .title = Dopre scoriment verticâl +pdfjs-scroll-vertical-button-label = Scoriment verticâl +pdfjs-scroll-horizontal-button = + .title = Dopre scoriment orizontâl +pdfjs-scroll-horizontal-button-label = Scoriment orizontâl +pdfjs-scroll-wrapped-button = + .title = Dopre scoriment par blocs +pdfjs-scroll-wrapped-button-label = Scoriment par blocs +pdfjs-spread-none-button = + .title = No sta meti dongje pagjinis in cubie +pdfjs-spread-none-button-label = No cubiis di pagjinis +pdfjs-spread-odd-button = + .title = Met dongje cubiis di pagjinis scomençant des pagjinis dispar +pdfjs-spread-odd-button-label = Cubiis di pagjinis, dispar a çampe +pdfjs-spread-even-button = + .title = Met dongje cubiis di pagjinis scomençant des pagjinis pâr +pdfjs-spread-even-button-label = Cubiis di pagjinis, pâr a çampe + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Proprietâts dal document… +pdfjs-document-properties-button-label = Proprietâts dal document… +pdfjs-document-properties-file-name = Non dal file: +pdfjs-document-properties-file-size = Dimension dal file: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } bytes) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } bytes) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bytes) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bytes) +pdfjs-document-properties-title = Titul: +pdfjs-document-properties-author = Autôr: +pdfjs-document-properties-subject = Ogjet: +pdfjs-document-properties-keywords = Peraulis clâf: +pdfjs-document-properties-creation-date = Date di creazion: +pdfjs-document-properties-modification-date = Date di modifiche: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Creatôr +pdfjs-document-properties-producer = Gjeneradôr PDF: +pdfjs-document-properties-version = Version PDF: +pdfjs-document-properties-page-count = Numar di pagjinis: +pdfjs-document-properties-page-size = Dimension de pagjine: +pdfjs-document-properties-page-size-unit-inches = oncis +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = verticâl +pdfjs-document-properties-page-size-orientation-landscape = orizontâl +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Letare +pdfjs-document-properties-page-size-name-legal = Legâl + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Visualizazion web svelte: +pdfjs-document-properties-linearized-yes = Sì +pdfjs-document-properties-linearized-no = No +pdfjs-document-properties-close-button = Siere + +## Print + +pdfjs-print-progress-message = Daûr a prontâ il document pe stampe… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Anule +pdfjs-printing-not-supported = Atenzion: la stampe no je supuartade ad implen di chest navigadôr. +pdfjs-printing-not-ready = Atenzion: il PDF nol è stât cjamât dal dut pe stampe. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Ative/Disative sbare laterâl +pdfjs-toggle-sidebar-notification-button = + .title = Ative/Disative sbare laterâl (il document al conten struture/zontis/strâts) +pdfjs-toggle-sidebar-button-label = Ative/Disative sbare laterâl +pdfjs-document-outline-button = + .title = Mostre la struture dal document (dopli clic par slargjâ/strenzi ducj i elements) +pdfjs-document-outline-button-label = Struture dal document +pdfjs-attachments-button = + .title = Mostre lis zontis +pdfjs-attachments-button-label = Zontis +pdfjs-layers-button = + .title = Mostre i strâts (dopli clic par ristabilî ducj i strâts al stât predefinît) +pdfjs-layers-button-label = Strâts +pdfjs-thumbs-button = + .title = Mostre miniaturis +pdfjs-thumbs-button-label = Miniaturis +pdfjs-current-outline-item-button = + .title = Cjate l'element de struture atuâl +pdfjs-current-outline-item-button-label = Element de struture atuâl +pdfjs-findbar-button = + .title = Cjate tal document +pdfjs-findbar-button-label = Cjate +pdfjs-additional-layers = Strâts adizionâi + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Pagjine { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Miniature de pagjine { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Cjate + .placeholder = Cjate tal document… +pdfjs-find-previous-button = + .title = Cjate il câs precedent dal test +pdfjs-find-previous-button-label = Precedent +pdfjs-find-next-button = + .title = Cjate il câs sucessîf dal test +pdfjs-find-next-button-label = Sucessîf +pdfjs-find-highlight-checkbox = Evidenzie dut +pdfjs-find-match-case-checkbox-label = Fâs distinzion tra maiusculis e minusculis +pdfjs-find-match-diacritics-checkbox-label = Corispondence diacritiche +pdfjs-find-entire-word-checkbox-label = Peraulis interiis +pdfjs-find-reached-top = Si è rivâts al inizi dal document e si à continuât de fin +pdfjs-find-reached-bottom = Si è rivât ae fin dal document e si à continuât dal inizi +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] { $current } di { $total } corispondence + *[other] { $current } di { $total } corispondencis + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] Plui di { $limit } corispondence + *[other] Plui di { $limit } corispondencis + } +pdfjs-find-not-found = Test no cjatât + +## Predefined zoom values + +pdfjs-page-scale-width = Largjece de pagjine +pdfjs-page-scale-fit = Pagjine interie +pdfjs-page-scale-auto = Ingrandiment automatic +pdfjs-page-scale-actual = Dimension reâl +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Pagjine { $page } + +## Loading indicator messages + +pdfjs-loading-error = Al è vignût fûr un erôr intant che si cjariave il PDF. +pdfjs-invalid-file-error = File PDF no valit o ruvinât. +pdfjs-missing-file-error = Al mancje il file PDF. +pdfjs-unexpected-response-error = Rispueste dal servidôr inspietade. +pdfjs-rendering-error = Al è vignût fûr un erôr tal realizâ la visualizazion de pagjine. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [Anotazion { $type }] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Inserìs la password par vierzi chest file PDF. +pdfjs-password-invalid = Password no valide. Par plasê torne prove. +pdfjs-password-ok-button = Va ben +pdfjs-password-cancel-button = Anule +pdfjs-web-fonts-disabled = I caratars dal Web a son disativâts: Impussibil doprâ i caratars PDF incorporâts. + +## Editing + +pdfjs-editor-free-text-button = + .title = Test +pdfjs-editor-free-text-button-label = Test +pdfjs-editor-ink-button = + .title = Dissen +pdfjs-editor-ink-button-label = Dissen +pdfjs-editor-stamp-button = + .title = Zonte o modifiche imagjins +pdfjs-editor-stamp-button-label = Zonte o modifiche imagjins +pdfjs-editor-highlight-button = + .title = Evidenzie +pdfjs-editor-highlight-button-label = Evidenzie +pdfjs-highlight-floating-button1 = + .title = Evidenzie + .aria-label = Evidenzie +pdfjs-highlight-floating-button-label = Evidenzie + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Gjave dissen +pdfjs-editor-remove-freetext-button = + .title = Gjave test +pdfjs-editor-remove-stamp-button = + .title = Gjave imagjin +pdfjs-editor-remove-highlight-button = + .title = Gjave evidenziazion + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Colôr +pdfjs-editor-free-text-size-input = Dimension +pdfjs-editor-ink-color-input = Colôr +pdfjs-editor-ink-thickness-input = Spessôr +pdfjs-editor-ink-opacity-input = Opacitât +pdfjs-editor-stamp-add-image-button = + .title = Zonte imagjin +pdfjs-editor-stamp-add-image-button-label = Zonte imagjin +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Spessôr +pdfjs-editor-free-highlight-thickness-title = + .title = Modifiche il spessôr de selezion pai elements che no son testuâi +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = Editôr di test + .default-content = Scomence a scrivi… +pdfjs-free-text = + .aria-label = Editôr di test +pdfjs-free-text-default-content = Scomence a scrivi… +pdfjs-ink = + .aria-label = Editôr dissens +pdfjs-ink-canvas = + .aria-label = Imagjin creade dal utent + +## Alt-text dialog + +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button-label = Test alternatîf +pdfjs-editor-alt-text-edit-button-label = Modifiche test alternatîf +pdfjs-editor-alt-text-dialog-label = Sielç une opzion +pdfjs-editor-alt-text-dialog-description = Il test alternatîf (“alt text”) al jude cuant che lis personis no puedin viodi la imagjin o cuant che la imagjine no ven cjariade. +pdfjs-editor-alt-text-add-description-label = Zonte une descrizion +pdfjs-editor-alt-text-add-description-description = Ponte a une o dôs frasis che a descrivin l’argoment, la ambientazion o lis azions. +pdfjs-editor-alt-text-mark-decorative-label = Segne come decorative +pdfjs-editor-alt-text-mark-decorative-description = Chest al ven doprât pes imagjins ornamentâls, come i ôrs o lis filigranis. +pdfjs-editor-alt-text-cancel-button = Anule +pdfjs-editor-alt-text-save-button = Salve +pdfjs-editor-alt-text-decorative-tooltip = Segnade come decorative +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = Par esempli, “Un zovin si sente a taule par mangjâ” + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Cjanton in alt a çampe — ridimensione +pdfjs-editor-resizer-label-top-middle = Bande superiôr tal mieç — ridimensione +pdfjs-editor-resizer-label-top-right = Cjanton in alt a diestre — ridimensione +pdfjs-editor-resizer-label-middle-right = Bande diestre tal mieç — ridimensione +pdfjs-editor-resizer-label-bottom-right = Cjanton in bas a diestre — ridimensione +pdfjs-editor-resizer-label-bottom-middle = Bande inferiôr tal mieç — ridimensione +pdfjs-editor-resizer-label-bottom-left = Cjanton in bas a çampe — ridimensione +pdfjs-editor-resizer-label-middle-left = Bande di çampe tal mieç — ridimensione +pdfjs-editor-resizer-top-left = + .aria-label = Cjanton in alt a çampe — ridimensione +pdfjs-editor-resizer-top-middle = + .aria-label = Bande superiôr tal mieç — ridimensione +pdfjs-editor-resizer-top-right = + .aria-label = Cjanton in alt a diestre — ridimensione +pdfjs-editor-resizer-middle-right = + .aria-label = Bande diestre tal mieç — ridimensione +pdfjs-editor-resizer-bottom-right = + .aria-label = Cjanton in bas a diestre — ridimensione +pdfjs-editor-resizer-bottom-middle = + .aria-label = Bande inferiôr tal mieç — ridimensione +pdfjs-editor-resizer-bottom-left = + .aria-label = Cjanton in bas a çampe — ridimensione +pdfjs-editor-resizer-middle-left = + .aria-label = Bande di çampe tal mieç — ridimensione + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Colôr par evidenziâ +pdfjs-editor-colorpicker-button = + .title = Cambie colôr +pdfjs-editor-colorpicker-dropdown = + .aria-label = Sieltis di colôr +pdfjs-editor-colorpicker-yellow = + .title = Zâl +pdfjs-editor-colorpicker-green = + .title = Vert +pdfjs-editor-colorpicker-blue = + .title = Blu +pdfjs-editor-colorpicker-pink = + .title = Rose +pdfjs-editor-colorpicker-red = + .title = Ros + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Mostre dut +pdfjs-editor-highlight-show-all-button = + .title = Mostre dut + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = Modifiche test alternatîf (descrizion de imagjin) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = Zonte test alternatîf (descrizion de imagjin) +pdfjs-editor-new-alt-text-textarea = + .placeholder = Scrîf achì la tô descrizion… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = Curte descrizion par personis che no rivin a viodi la imagjin, o che e ven mostrade cuant che no si rive a cjariâle. +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = Chest test alternatîf al è stât creât in automatic e al è pussibil che nol sedi cret. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Plui informazions +pdfjs-editor-new-alt-text-create-automatically-button-label = Cree test alternatîf in automatic +pdfjs-editor-new-alt-text-not-now-button = No cumò +pdfjs-editor-new-alt-text-error-title = Impussibil creâ test alternatîf in automatic +pdfjs-editor-new-alt-text-error-description = Scrîf il to test alternatîf o prove plui tart. +pdfjs-editor-new-alt-text-error-close-button = Siere +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = Daûr a discjariâil model IA pal test alternatîf ({ $downloadedSize } di { $totalSize } MB) + .aria-valuetext = Daûr a discjariâ il model IA pal test alternatîf ({ $downloadedSize } di { $totalSize } MB) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button-label = Test alternatîf zontât +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button-label = Al mancje il test alternatîf +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button-label = Verifiche test alternatîf +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Creât in automatic: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = Impostazions test alternatîf pes imagjins +pdfjs-image-alt-text-settings-button-label = Impostazions test alternatîf pes imagjins +pdfjs-editor-alt-text-settings-dialog-label = Impostazions test alternatîf pes imagjins +pdfjs-editor-alt-text-settings-automatic-title = Test alternatîf automatic +pdfjs-editor-alt-text-settings-create-model-button-label = Cree test alternatîf in automatic +pdfjs-editor-alt-text-settings-create-model-description = Al sugjerìs descrizions par judâ lis personis che no rivin a viodi la imagjin o cuant che la imagjin no ven cjariade. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = Model IA pal test alternatîf ({ $totalSize } MB) +pdfjs-editor-alt-text-settings-ai-model-description = Al ven eseguît in locâl sul to dispositîf, cussì che i tiei dâts a restin riservâts. Al è necessari pe gjenerazion automatiche dal test alternatîf. +pdfjs-editor-alt-text-settings-delete-model-button = Elimine +pdfjs-editor-alt-text-settings-download-model-button = Discjame +pdfjs-editor-alt-text-settings-downloading-model-button = Daûr a discjariâ… +pdfjs-editor-alt-text-settings-editor-title = Modifiche test alternatîf +pdfjs-editor-alt-text-settings-show-dialog-button-label = Mostre l'editôr dal test alternatîf a pene che e ven zontade une imagjin +pdfjs-editor-alt-text-settings-show-dialog-description = Ti jude a sigurâti che dutis lis tôs imagjins a vedin il test alternatîf. +pdfjs-editor-alt-text-settings-close-button = Siere diff --git a/public/pdfjs/web/locale/fy-NL/viewer.ftl b/public/pdfjs/web/locale/fy-NL/viewer.ftl new file mode 100644 index 0000000..15850b4 --- /dev/null +++ b/public/pdfjs/web/locale/fy-NL/viewer.ftl @@ -0,0 +1,515 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Foarige side +pdfjs-previous-button-label = Foarige +pdfjs-next-button = + .title = Folgjende side +pdfjs-next-button-label = Folgjende +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Side +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = fan { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } fan { $pagesCount }) +pdfjs-zoom-out-button = + .title = Utzoome +pdfjs-zoom-out-button-label = Utzoome +pdfjs-zoom-in-button = + .title = Ynzoome +pdfjs-zoom-in-button-label = Ynzoome +pdfjs-zoom-select = + .title = Zoome +pdfjs-presentation-mode-button = + .title = Wikselje nei presintaasjemodus +pdfjs-presentation-mode-button-label = Presintaasjemodus +pdfjs-open-file-button = + .title = Bestân iepenje +pdfjs-open-file-button-label = Iepenje +pdfjs-print-button = + .title = Ofdrukke +pdfjs-print-button-label = Ofdrukke +pdfjs-save-button = + .title = Bewarje +pdfjs-save-button-label = Bewarje +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Downloade +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Downloade +pdfjs-bookmark-button = + .title = Aktuele side (URL fan aktuele side besjen) +pdfjs-bookmark-button-label = Aktuele side + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Ark +pdfjs-tools-button-label = Ark +pdfjs-first-page-button = + .title = Gean nei earste side +pdfjs-first-page-button-label = Gean nei earste side +pdfjs-last-page-button = + .title = Gean nei lêste side +pdfjs-last-page-button-label = Gean nei lêste side +pdfjs-page-rotate-cw-button = + .title = Rjochtsom draaie +pdfjs-page-rotate-cw-button-label = Rjochtsom draaie +pdfjs-page-rotate-ccw-button = + .title = Linksom draaie +pdfjs-page-rotate-ccw-button-label = Linksom draaie +pdfjs-cursor-text-select-tool-button = + .title = Tekstseleksjehelpmiddel ynskeakelje +pdfjs-cursor-text-select-tool-button-label = Tekstseleksjehelpmiddel +pdfjs-cursor-hand-tool-button = + .title = Hânhelpmiddel ynskeakelje +pdfjs-cursor-hand-tool-button-label = Hânhelpmiddel +pdfjs-scroll-page-button = + .title = Sideskowen brûke +pdfjs-scroll-page-button-label = Sideskowen +pdfjs-scroll-vertical-button = + .title = Fertikaal skowe brûke +pdfjs-scroll-vertical-button-label = Fertikaal skowe +pdfjs-scroll-horizontal-button = + .title = Horizontaal skowe brûke +pdfjs-scroll-horizontal-button-label = Horizontaal skowe +pdfjs-scroll-wrapped-button = + .title = Skowe mei oersjoch brûke +pdfjs-scroll-wrapped-button-label = Skowe mei oersjoch +pdfjs-spread-none-button = + .title = Sidesprieding net gearfetsje +pdfjs-spread-none-button-label = Gjin sprieding +pdfjs-spread-odd-button = + .title = Sidesprieding gearfetsje te starten mei ûneven nûmers +pdfjs-spread-odd-button-label = Uneven sprieding +pdfjs-spread-even-button = + .title = Sidesprieding gearfetsje te starten mei even nûmers +pdfjs-spread-even-button-label = Even sprieding + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Dokuminteigenskippen… +pdfjs-document-properties-button-label = Dokuminteigenskippen… +pdfjs-document-properties-file-name = Bestânsnamme: +pdfjs-document-properties-file-size = Bestânsgrutte: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } bytes) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } bytes) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bytes) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bytes) +pdfjs-document-properties-title = Titel: +pdfjs-document-properties-author = Auteur: +pdfjs-document-properties-subject = Underwerp: +pdfjs-document-properties-keywords = Kaaiwurden: +pdfjs-document-properties-creation-date = Oanmaakdatum: +pdfjs-document-properties-modification-date = Bewurkingsdatum: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Makker: +pdfjs-document-properties-producer = PDF-makker: +pdfjs-document-properties-version = PDF-ferzje: +pdfjs-document-properties-page-count = Siden: +pdfjs-document-properties-page-size = Sideformaat: +pdfjs-document-properties-page-size-unit-inches = yn +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = steand +pdfjs-document-properties-page-size-orientation-landscape = lizzend +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Letter +pdfjs-document-properties-page-size-name-legal = Juridysk + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Flugge webwerjefte: +pdfjs-document-properties-linearized-yes = Ja +pdfjs-document-properties-linearized-no = Nee +pdfjs-document-properties-close-button = Slute + +## Print + +pdfjs-print-progress-message = Dokumint tariede oar ôfdrukken… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Annulearje +pdfjs-printing-not-supported = Warning: Printen is net folslein stipe troch dizze browser. +pdfjs-printing-not-ready = Warning: PDF is net folslein laden om ôf te drukken. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Sidebalke yn-/útskeakelje +pdfjs-toggle-sidebar-notification-button = + .title = Sidebalke yn-/útskeakelje (dokumint befettet oersjoch/bylagen/lagen) +pdfjs-toggle-sidebar-button-label = Sidebalke yn-/útskeakelje +pdfjs-document-outline-button = + .title = Dokumintoersjoch toane (dûbelklik om alle items út/yn te klappen) +pdfjs-document-outline-button-label = Dokumintoersjoch +pdfjs-attachments-button = + .title = Bylagen toane +pdfjs-attachments-button-label = Bylagen +pdfjs-layers-button = + .title = Lagen toane (dûbelklik om alle lagen nei de standertsteat werom te setten) +pdfjs-layers-button-label = Lagen +pdfjs-thumbs-button = + .title = Foarbylden toane +pdfjs-thumbs-button-label = Foarbylden +pdfjs-current-outline-item-button = + .title = Aktueel item yn ynhâldsopjefte sykje +pdfjs-current-outline-item-button-label = Aktueel item yn ynhâldsopjefte +pdfjs-findbar-button = + .title = Sykje yn dokumint +pdfjs-findbar-button-label = Sykje +pdfjs-additional-layers = Oanfoljende lagen + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Side { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Foarbyld fan side { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Sykje + .placeholder = Sykje yn dokumint… +pdfjs-find-previous-button = + .title = It foarige foarkommen fan de tekst sykje +pdfjs-find-previous-button-label = Foarige +pdfjs-find-next-button = + .title = It folgjende foarkommen fan de tekst sykje +pdfjs-find-next-button-label = Folgjende +pdfjs-find-highlight-checkbox = Alles markearje +pdfjs-find-match-case-checkbox-label = Haadlettergefoelich +pdfjs-find-match-diacritics-checkbox-label = Diakrityske tekens brûke +pdfjs-find-entire-word-checkbox-label = Hiele wurden +pdfjs-find-reached-top = Boppekant fan dokumint berikt, trochgien fan ûnder ôf +pdfjs-find-reached-bottom = Ein fan dokumint berikt, trochgien fan boppe ôf +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] { $current } fan { $total } oerienkomst + *[other] { $current } fan { $total } oerienkomsten + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] Mear as { $limit } oerienkomst + *[other] Mear as { $limit } oerienkomsten + } +pdfjs-find-not-found = Tekst net fûn + +## Predefined zoom values + +pdfjs-page-scale-width = Sidebreedte +pdfjs-page-scale-fit = Hiele side +pdfjs-page-scale-auto = Automatysk zoome +pdfjs-page-scale-actual = Werklike grutte +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Side { $page } + +## Loading indicator messages + +pdfjs-loading-error = Der is in flater bard by it laden fan de PDF. +pdfjs-invalid-file-error = Ynfalide of korruptearre PDF-bestân. +pdfjs-missing-file-error = PDF-bestân ûntbrekt. +pdfjs-unexpected-response-error = Unferwacht serverantwurd. +pdfjs-rendering-error = Der is in flater bard by it renderjen fan de side. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type }-annotaasje] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Jou it wachtwurd om dit PDF-bestân te iepenjen. +pdfjs-password-invalid = Ferkeard wachtwurd. Probearje opnij. +pdfjs-password-ok-button = OK +pdfjs-password-cancel-button = Annulearje +pdfjs-web-fonts-disabled = Weblettertypen binne útskeakele: gebrûk fan ynsluten PDF-lettertypen is net mooglik. + +## Editing + +pdfjs-editor-free-text-button = + .title = Tekst +pdfjs-editor-free-text-button-label = Tekst +pdfjs-editor-ink-button = + .title = Tekenje +pdfjs-editor-ink-button-label = Tekenje +pdfjs-editor-stamp-button = + .title = Ofbyldingen tafoegje of bewurkje +pdfjs-editor-stamp-button-label = Ofbyldingen tafoegje of bewurkje +pdfjs-editor-highlight-button = + .title = Markearje +pdfjs-editor-highlight-button-label = Markearje +pdfjs-highlight-floating-button1 = + .title = Markearje + .aria-label = Markearje +pdfjs-highlight-floating-button-label = Markearje + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Tekening fuortsmite +pdfjs-editor-remove-freetext-button = + .title = Tekst fuortsmite +pdfjs-editor-remove-stamp-button = + .title = Ofbylding fuortsmite +pdfjs-editor-remove-highlight-button = + .title = Markearring fuortsmite + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Kleur +pdfjs-editor-free-text-size-input = Grutte +pdfjs-editor-ink-color-input = Kleur +pdfjs-editor-ink-thickness-input = Tsjokte +pdfjs-editor-ink-opacity-input = Transparânsje +pdfjs-editor-stamp-add-image-button = + .title = Ofbylding tafoegje +pdfjs-editor-stamp-add-image-button-label = Ofbylding tafoegje +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Tsjokte +pdfjs-editor-free-highlight-thickness-title = + .title = Tsjokte wizigje by aksintuearring fan oare items as tekst +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = Tekstbewurker + .default-content = Start mei typen… +pdfjs-free-text = + .aria-label = Tekstbewurker +pdfjs-free-text-default-content = Begjin mei typen… +pdfjs-ink = + .aria-label = Tekeningbewurker +pdfjs-ink-canvas = + .aria-label = Troch brûker makke ôfbylding + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = Alternative tekst +pdfjs-editor-alt-text-edit-button = + .aria-label = Alternative tekst bewurkje +pdfjs-editor-alt-text-edit-button-label = Alternative tekst bewurkje +pdfjs-editor-alt-text-dialog-label = Kies in opsje +pdfjs-editor-alt-text-dialog-description = Alternative tekst helpt wannear’t minsken de ôfbylding net sjen kinne of wannear’t dizze net laden wurdt. +pdfjs-editor-alt-text-add-description-label = Foegje in beskriuwing ta +pdfjs-editor-alt-text-add-description-description = Stribje nei 1-2 sinnen dy’t it ûnderwerp, de omjouwing of de aksjes beskriuwe. +pdfjs-editor-alt-text-mark-decorative-label = As dekoratyf markearje +pdfjs-editor-alt-text-mark-decorative-description = Dit wurdt brûkt foar sierlike ôfbyldingen, lykas rânen of wettermerken. +pdfjs-editor-alt-text-cancel-button = Annulearje +pdfjs-editor-alt-text-save-button = Bewarje +pdfjs-editor-alt-text-decorative-tooltip = As dekoratyf markearre +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = Bygelyks, ‘In jonge man sit oan in tafel om te iten’ +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = Alternative tekst + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Linkerboppehoek – formaat wizigje +pdfjs-editor-resizer-label-top-middle = Midden boppe – formaat wizigje +pdfjs-editor-resizer-label-top-right = Rjochterboppehoek – formaat wizigje +pdfjs-editor-resizer-label-middle-right = Midden rjochts – formaat wizigje +pdfjs-editor-resizer-label-bottom-right = Rjochterûnderhoek – formaat wizigje +pdfjs-editor-resizer-label-bottom-middle = Midden ûnder – formaat wizigje +pdfjs-editor-resizer-label-bottom-left = Linkerûnderhoek – formaat wizigje +pdfjs-editor-resizer-label-middle-left = Links midden – formaat wizigje +pdfjs-editor-resizer-top-left = + .aria-label = Linkerboppehoek – formaat wizigje +pdfjs-editor-resizer-top-middle = + .aria-label = Midden boppe – formaat wizigje +pdfjs-editor-resizer-top-right = + .aria-label = Rjochterboppehoek – formaat wizigje +pdfjs-editor-resizer-middle-right = + .aria-label = Midden rjochts – formaat wizigje +pdfjs-editor-resizer-bottom-right = + .aria-label = Rjochterûnderhoek – formaat wizigje +pdfjs-editor-resizer-bottom-middle = + .aria-label = Midden ûnder – formaat wizigje +pdfjs-editor-resizer-bottom-left = + .aria-label = Linkerûnderhoek – formaat wizigje +pdfjs-editor-resizer-middle-left = + .aria-label = Links midden – formaat wizigje + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Markearringskleur +pdfjs-editor-colorpicker-button = + .title = Kleur wizigje +pdfjs-editor-colorpicker-dropdown = + .aria-label = Kleurkarren +pdfjs-editor-colorpicker-yellow = + .title = Giel +pdfjs-editor-colorpicker-green = + .title = Grien +pdfjs-editor-colorpicker-blue = + .title = Blau +pdfjs-editor-colorpicker-pink = + .title = Roze +pdfjs-editor-colorpicker-red = + .title = Read + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Alles toane +pdfjs-editor-highlight-show-all-button = + .title = Alles toane + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = Alternative tekst (ôfbyldingsbeskriuwing) bewurkje +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = Alternative tekst (ôfbyldingsbeskriuwing) tafoegje +pdfjs-editor-new-alt-text-textarea = + .placeholder = Skriuw hjir jo beskriuwing… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = Koarte beskriuwing foar minsken dy’t de ôfbylding net sjen kinne of wannear’t de ôfbylding net laden wurdt. +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = Dizze alternative tekst is automatysk makke en is mooglik net korrekt. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Mear ynfo +pdfjs-editor-new-alt-text-create-automatically-button-label = Alternative tekst automatysk oanmeitsje +pdfjs-editor-new-alt-text-not-now-button = No net +pdfjs-editor-new-alt-text-error-title = Kin alternative tekst net automatysk oanmeitsje +pdfjs-editor-new-alt-text-error-description = Skriuw jo eigen alternative tekst of probearje it letter nochris. +pdfjs-editor-new-alt-text-error-close-button = Slute +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = AI-model foar alternative tekst downloade ({ $downloadedSize } fan { $totalSize } MB) + .aria-valuetext = AI-model foar alternative tekst downloade ({ $downloadedSize } fan { $totalSize } MB) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = Alternative tekst tafoege +pdfjs-editor-new-alt-text-added-button-label = Alternative tekst tafoege +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = Alternative tekst ûntbrekt +pdfjs-editor-new-alt-text-missing-button-label = Alternative tekst ûntbrekt +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = Alternative tekst beoardiele +pdfjs-editor-new-alt-text-to-review-button-label = Alternative tekst beoardiele +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Automatysk oanmakke: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = Ynstellingen foar alternative tekst fan ôfbyldingen +pdfjs-image-alt-text-settings-button-label = Ynstellingen foar alternative tekst fan ôfbyldingen +pdfjs-editor-alt-text-settings-dialog-label = Ynstellingen foar alternative tekst fan ôfbyldingen +pdfjs-editor-alt-text-settings-automatic-title = Automatyske alternative tekst +pdfjs-editor-alt-text-settings-create-model-button-label = Alternative tekst automatysk oanmeitsje +pdfjs-editor-alt-text-settings-create-model-description = Stelt beskriuwingen foar om minsken te helpen dy’t de ôfbylding net sjen kinne of foar wa’t de ôfbylding net laden wurdt. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = AI-model foar alternative tekst ({ $totalSize } MB) +pdfjs-editor-alt-text-settings-ai-model-description = Wurdt lokaal op jo apparaat útfierd, sadat jo gegevens privee bliuwe. Fereaske foar automatyske alternative tekst. +pdfjs-editor-alt-text-settings-delete-model-button = Fuortsmite +pdfjs-editor-alt-text-settings-download-model-button = Downloade +pdfjs-editor-alt-text-settings-downloading-model-button = Downloade… +pdfjs-editor-alt-text-settings-editor-title = Alternative-tekstbewurker +pdfjs-editor-alt-text-settings-show-dialog-button-label = Alternative-tekstbewurker daliks toane by tafoegjen fan in ôfbylding +pdfjs-editor-alt-text-settings-show-dialog-description = Helpt jo derfoar te soargjen dat al jo ôfbyldingen alternative tekst hawwe. +pdfjs-editor-alt-text-settings-close-button = Slute + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = Markearring fuortsmiten +pdfjs-editor-undo-bar-message-freetext = Tekst fuortsmiten +pdfjs-editor-undo-bar-message-ink = Tekening fuortsmiten +pdfjs-editor-undo-bar-message-stamp = Ofbylding fuortsmiten +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = + { $count -> + [one] { $count } annotaasje fuortsmiten + *[other] { $count } annotaasjes fuortsmiten + } +pdfjs-editor-undo-bar-undo-button = + .title = Ungedien meitsje +pdfjs-editor-undo-bar-undo-button-label = Ungedien meitsje +pdfjs-editor-undo-bar-close-button = + .title = Slute +pdfjs-editor-undo-bar-close-button-label = Slute diff --git a/public/pdfjs/web/locale/ga-IE/viewer.ftl b/public/pdfjs/web/locale/ga-IE/viewer.ftl new file mode 100644 index 0000000..cb59308 --- /dev/null +++ b/public/pdfjs/web/locale/ga-IE/viewer.ftl @@ -0,0 +1,213 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = An Leathanach Roimhe Seo +pdfjs-previous-button-label = Roimhe Seo +pdfjs-next-button = + .title = An Chéad Leathanach Eile +pdfjs-next-button-label = Ar Aghaidh +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Leathanach +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = as { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } as { $pagesCount }) +pdfjs-zoom-out-button = + .title = Súmáil Amach +pdfjs-zoom-out-button-label = Súmáil Amach +pdfjs-zoom-in-button = + .title = Súmáil Isteach +pdfjs-zoom-in-button-label = Súmáil Isteach +pdfjs-zoom-select = + .title = Súmáil +pdfjs-presentation-mode-button = + .title = Úsáid an Mód Láithreoireachta +pdfjs-presentation-mode-button-label = Mód Láithreoireachta +pdfjs-open-file-button = + .title = Oscail Comhad +pdfjs-open-file-button-label = Oscail +pdfjs-print-button = + .title = Priontáil +pdfjs-print-button-label = Priontáil + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Uirlisí +pdfjs-tools-button-label = Uirlisí +pdfjs-first-page-button = + .title = Go dtí an chéad leathanach +pdfjs-first-page-button-label = Go dtí an chéad leathanach +pdfjs-last-page-button = + .title = Go dtí an leathanach deiridh +pdfjs-last-page-button-label = Go dtí an leathanach deiridh +pdfjs-page-rotate-cw-button = + .title = Rothlaigh ar deiseal +pdfjs-page-rotate-cw-button-label = Rothlaigh ar deiseal +pdfjs-page-rotate-ccw-button = + .title = Rothlaigh ar tuathal +pdfjs-page-rotate-ccw-button-label = Rothlaigh ar tuathal +pdfjs-cursor-text-select-tool-button = + .title = Cumasaigh an Uirlis Roghnaithe Téacs +pdfjs-cursor-text-select-tool-button-label = Uirlis Roghnaithe Téacs +pdfjs-cursor-hand-tool-button = + .title = Cumasaigh an Uirlis Láimhe +pdfjs-cursor-hand-tool-button-label = Uirlis Láimhe + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Airíonna na Cáipéise… +pdfjs-document-properties-button-label = Airíonna na Cáipéise… +pdfjs-document-properties-file-name = Ainm an chomhaid: +pdfjs-document-properties-file-size = Méid an chomhaid: +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } kB ({ $size_b } beart) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } beart) +pdfjs-document-properties-title = Teideal: +pdfjs-document-properties-author = Údar: +pdfjs-document-properties-subject = Ábhar: +pdfjs-document-properties-keywords = Eochairfhocail: +pdfjs-document-properties-creation-date = Dáta Cruthaithe: +pdfjs-document-properties-modification-date = Dáta Athraithe: +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Cruthaitheoir: +pdfjs-document-properties-producer = Cruthaitheoir an PDF: +pdfjs-document-properties-version = Leagan PDF: +pdfjs-document-properties-page-count = Líon Leathanach: + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + + +## + +pdfjs-document-properties-close-button = Dún + +## Print + +pdfjs-print-progress-message = Cáipéis á hullmhú le priontáil… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Cealaigh +pdfjs-printing-not-supported = Rabhadh: Ní thacaíonn an brabhsálaí le priontáil go hiomlán. +pdfjs-printing-not-ready = Rabhadh: Ní féidir an PDF a phriontáil go dtí go mbeidh an cháipéis iomlán lódáilte. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Scoránaigh an Barra Taoibh +pdfjs-toggle-sidebar-button-label = Scoránaigh an Barra Taoibh +pdfjs-document-outline-button = + .title = Taispeáin Imlíne na Cáipéise (déchliceáil chun chuile rud a leathnú nó a laghdú) +pdfjs-document-outline-button-label = Creatlach na Cáipéise +pdfjs-attachments-button = + .title = Taispeáin Iatáin +pdfjs-attachments-button-label = Iatáin +pdfjs-thumbs-button = + .title = Taispeáin Mionsamhlacha +pdfjs-thumbs-button-label = Mionsamhlacha +pdfjs-findbar-button = + .title = Aimsigh sa Cháipéis +pdfjs-findbar-button-label = Aimsigh + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Leathanach { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Mionsamhail Leathanaigh { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Aimsigh + .placeholder = Aimsigh sa cháipéis… +pdfjs-find-previous-button = + .title = Aimsigh an sampla roimhe seo den nath seo +pdfjs-find-previous-button-label = Roimhe seo +pdfjs-find-next-button = + .title = Aimsigh an chéad sampla eile den nath sin +pdfjs-find-next-button-label = Ar aghaidh +pdfjs-find-highlight-checkbox = Aibhsigh uile +pdfjs-find-match-case-checkbox-label = Cásíogair +pdfjs-find-entire-word-checkbox-label = Focail iomlána +pdfjs-find-reached-top = Ag barr na cáipéise, ag leanúint ón mbun +pdfjs-find-reached-bottom = Ag bun na cáipéise, ag leanúint ón mbarr +pdfjs-find-not-found = Frása gan aimsiú + +## Predefined zoom values + +pdfjs-page-scale-width = Leithead Leathanaigh +pdfjs-page-scale-fit = Laghdaigh go dtí an Leathanach +pdfjs-page-scale-auto = Súmáil Uathoibríoch +pdfjs-page-scale-actual = Fíormhéid +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + + +## Loading indicator messages + +pdfjs-loading-error = Tharla earráid agus an cháipéis PDF á lódáil. +pdfjs-invalid-file-error = Comhad neamhbhailí nó truaillithe PDF. +pdfjs-missing-file-error = Comhad PDF ar iarraidh. +pdfjs-unexpected-response-error = Freagra ón bhfreastalaí nach rabhthas ag súil leis. +pdfjs-rendering-error = Tharla earráid agus an leathanach á leagan amach. + +## Annotations + +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [Anótáil { $type }] + +## Password + +pdfjs-password-label = Cuir an focal faire isteach chun an comhad PDF seo a oscailt. +pdfjs-password-invalid = Focal faire mícheart. Déan iarracht eile. +pdfjs-password-ok-button = OK +pdfjs-password-cancel-button = Cealaigh +pdfjs-web-fonts-disabled = Tá clófhoirne Gréasáin díchumasaithe: ní féidir clófhoirne leabaithe PDF a úsáid. + +## Editing + + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + diff --git a/public/pdfjs/web/locale/gd/viewer.ftl b/public/pdfjs/web/locale/gd/viewer.ftl new file mode 100644 index 0000000..a3d62a0 --- /dev/null +++ b/public/pdfjs/web/locale/gd/viewer.ftl @@ -0,0 +1,313 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = An duilleag roimhe +pdfjs-previous-button-label = Air ais +pdfjs-next-button = + .title = An ath-dhuilleag +pdfjs-next-button-label = Air adhart +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Duilleag +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = à { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } à { $pagesCount }) +pdfjs-zoom-out-button = + .title = Sùm a-mach +pdfjs-zoom-out-button-label = Sùm a-mach +pdfjs-zoom-in-button = + .title = Sùm a-steach +pdfjs-zoom-in-button-label = Sùm a-steach +pdfjs-zoom-select = + .title = Sùm +pdfjs-presentation-mode-button = + .title = Gearr leum dhan mhodh taisbeanaidh +pdfjs-presentation-mode-button-label = Am modh taisbeanaidh +pdfjs-open-file-button = + .title = Fosgail faidhle +pdfjs-open-file-button-label = Fosgail +pdfjs-print-button = + .title = Clò-bhuail +pdfjs-print-button-label = Clò-bhuail +pdfjs-save-button = + .title = Sàbhail +pdfjs-save-button-label = Sàbhail +pdfjs-bookmark-button = + .title = An duilleag làithreach (Seall an URL on duilleag làithreach) +pdfjs-bookmark-button-label = An duilleag làithreach + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Innealan +pdfjs-tools-button-label = Innealan +pdfjs-first-page-button = + .title = Rach gun chiad duilleag +pdfjs-first-page-button-label = Rach gun chiad duilleag +pdfjs-last-page-button = + .title = Rach gun duilleag mu dheireadh +pdfjs-last-page-button-label = Rach gun duilleag mu dheireadh +pdfjs-page-rotate-cw-button = + .title = Cuairtich gu deiseil +pdfjs-page-rotate-cw-button-label = Cuairtich gu deiseil +pdfjs-page-rotate-ccw-button = + .title = Cuairtich gu tuathail +pdfjs-page-rotate-ccw-button-label = Cuairtich gu tuathail +pdfjs-cursor-text-select-tool-button = + .title = Cuir an comas inneal taghadh an teacsa +pdfjs-cursor-text-select-tool-button-label = Inneal taghadh an teacsa +pdfjs-cursor-hand-tool-button = + .title = Cuir inneal na làimhe an comas +pdfjs-cursor-hand-tool-button-label = Inneal na làimhe +pdfjs-scroll-page-button = + .title = Cleachd sgroladh duilleige +pdfjs-scroll-page-button-label = Sgroladh duilleige +pdfjs-scroll-vertical-button = + .title = Cleachd sgroladh inghearach +pdfjs-scroll-vertical-button-label = Sgroladh inghearach +pdfjs-scroll-horizontal-button = + .title = Cleachd sgroladh còmhnard +pdfjs-scroll-horizontal-button-label = Sgroladh còmhnard +pdfjs-scroll-wrapped-button = + .title = Cleachd sgroladh paisgte +pdfjs-scroll-wrapped-button-label = Sgroladh paisgte +pdfjs-spread-none-button = + .title = Na cuir còmhla sgoileadh dhuilleagan +pdfjs-spread-none-button-label = Gun sgaoileadh dhuilleagan +pdfjs-spread-odd-button = + .title = Cuir còmhla duilleagan sgaoilte a thòisicheas le duilleagan aig a bheil àireamh chorr +pdfjs-spread-odd-button-label = Sgaoileadh dhuilleagan corra +pdfjs-spread-even-button = + .title = Cuir còmhla duilleagan sgaoilte a thòisicheas le duilleagan aig a bheil àireamh chothrom +pdfjs-spread-even-button-label = Sgaoileadh dhuilleagan cothrom + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Roghainnean na sgrìobhainne… +pdfjs-document-properties-button-label = Roghainnean na sgrìobhainne… +pdfjs-document-properties-file-name = Ainm an fhaidhle: +pdfjs-document-properties-file-size = Meud an fhaidhle: +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bytes) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bytes) +pdfjs-document-properties-title = Tiotal: +pdfjs-document-properties-author = Ùghdar: +pdfjs-document-properties-subject = Cuspair: +pdfjs-document-properties-keywords = Faclan-luirg: +pdfjs-document-properties-creation-date = Latha a chruthachaidh: +pdfjs-document-properties-modification-date = Latha atharrachaidh: +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Cruthadair: +pdfjs-document-properties-producer = Saothraiche a' PDF: +pdfjs-document-properties-version = Tionndadh a' PDF: +pdfjs-document-properties-page-count = Àireamh de dhuilleagan: +pdfjs-document-properties-page-size = Meud na duilleige: +pdfjs-document-properties-page-size-unit-inches = ann an +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = portraid +pdfjs-document-properties-page-size-orientation-landscape = dreach-tìre +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Litir +pdfjs-document-properties-page-size-name-legal = Laghail + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Grad shealladh-lìn: +pdfjs-document-properties-linearized-yes = Tha +pdfjs-document-properties-linearized-no = Chan eil +pdfjs-document-properties-close-button = Dùin + +## Print + +pdfjs-print-progress-message = Ag ullachadh na sgrìobhainn airson clò-bhualadh… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Sguir dheth +pdfjs-printing-not-supported = Rabhadh: Chan eil am brabhsair seo a' cur làn-taic ri clò-bhualadh. +pdfjs-printing-not-ready = Rabhadh: Cha deach am PDF a luchdadh gu tur airson clò-bhualadh. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Toglaich am bàr-taoibh +pdfjs-toggle-sidebar-notification-button = + .title = Toglaich am bàr-taoibh (tha oir-loidhne/ceanglachain/breathan aig an sgrìobhainn) +pdfjs-toggle-sidebar-button-label = Toglaich am bàr-taoibh +pdfjs-document-outline-button = + .title = Seall oir-loidhne na sgrìobhainn (dèan briogadh dùbailte airson a h-uile nì a leudachadh/a cho-theannadh) +pdfjs-document-outline-button-label = Oir-loidhne na sgrìobhainne +pdfjs-attachments-button = + .title = Seall na ceanglachain +pdfjs-attachments-button-label = Ceanglachain +pdfjs-layers-button = + .title = Seall na breathan (dèan briogadh dùbailte airson a h-uile breath ath-shuidheachadh dhan staid bhunaiteach) +pdfjs-layers-button-label = Breathan +pdfjs-thumbs-button = + .title = Seall na dealbhagan +pdfjs-thumbs-button-label = Dealbhagan +pdfjs-current-outline-item-button = + .title = Lorg nì làithreach na h-oir-loidhne +pdfjs-current-outline-item-button-label = Nì làithreach na h-oir-loidhne +pdfjs-findbar-button = + .title = Lorg san sgrìobhainn +pdfjs-findbar-button-label = Lorg +pdfjs-additional-layers = Barrachd breathan + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Duilleag a { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Dealbhag duilleag a { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Lorg + .placeholder = Lorg san sgrìobhainn... +pdfjs-find-previous-button = + .title = Lorg làthair roimhe na h-abairt seo +pdfjs-find-previous-button-label = Air ais +pdfjs-find-next-button = + .title = Lorg ath-làthair na h-abairt seo +pdfjs-find-next-button-label = Air adhart +pdfjs-find-highlight-checkbox = Soillsich a h-uile +pdfjs-find-match-case-checkbox-label = Aire do litrichean mòra is beaga +pdfjs-find-match-diacritics-checkbox-label = Aire do stràcan +pdfjs-find-entire-word-checkbox-label = Faclan-slàna +pdfjs-find-reached-top = Ràinig sinn barr na duilleige, a' leantainn air adhart o bhonn na duilleige +pdfjs-find-reached-bottom = Ràinig sinn bonn na duilleige, a' leantainn air adhart o bharr na duilleige +pdfjs-find-not-found = Cha deach an abairt a lorg + +## Predefined zoom values + +pdfjs-page-scale-width = Leud na duilleige +pdfjs-page-scale-fit = Freagair ri meud na duilleige +pdfjs-page-scale-auto = Sùm fèin-obrachail +pdfjs-page-scale-actual = Am fìor-mheud +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Duilleag { $page } + +## Loading indicator messages + +pdfjs-loading-error = Thachair mearachd rè luchdadh a' PDF. +pdfjs-invalid-file-error = Faidhle PDF a tha mì-dhligheach no coirbte. +pdfjs-missing-file-error = Faidhle PDF a tha a dhìth. +pdfjs-unexpected-response-error = Freagairt on fhrithealaiche ris nach robh dùil. +pdfjs-rendering-error = Thachair mearachd rè reandaradh na duilleige. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [Nòtachadh { $type }] + +## Password + +pdfjs-password-label = Cuir a-steach am facal-faire gus am faidhle PDF seo fhosgladh. +pdfjs-password-invalid = Tha am facal-faire cearr. Nach fheuch thu ris a-rithist? +pdfjs-password-ok-button = Ceart ma-thà +pdfjs-password-cancel-button = Sguir dheth +pdfjs-web-fonts-disabled = Tha cruthan-clò lìn à comas: Chan urrainn dhuinn cruthan-clò PDF leabaichte a chleachdadh. + +## Editing + +pdfjs-editor-free-text-button = + .title = Teacsa +pdfjs-editor-free-text-button-label = Teacsa +pdfjs-editor-ink-button = + .title = Tarraing +pdfjs-editor-ink-button-label = Tarraing + +## Remove button for the various kind of editor. + + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Dath +pdfjs-editor-free-text-size-input = Meud +pdfjs-editor-ink-color-input = Dath +pdfjs-editor-ink-thickness-input = Tighead +pdfjs-editor-ink-opacity-input = Trìd-dhoilleireachd +pdfjs-free-text = + .aria-label = An deasaiche teacsa +pdfjs-free-text-default-content = Tòisich air sgrìobhadh… +pdfjs-ink = + .aria-label = An deasaiche tharraingean +pdfjs-ink-canvas = + .aria-label = Dealbh a chruthaich cleachdaiche + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + + +## Color picker + + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + + +## Image alt-text settings + diff --git a/public/pdfjs/web/locale/gl/viewer.ftl b/public/pdfjs/web/locale/gl/viewer.ftl new file mode 100644 index 0000000..641a607 --- /dev/null +++ b/public/pdfjs/web/locale/gl/viewer.ftl @@ -0,0 +1,385 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Páxina anterior +pdfjs-previous-button-label = Anterior +pdfjs-next-button = + .title = Seguinte páxina +pdfjs-next-button-label = Seguinte +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Páxina +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = de { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } de { $pagesCount }) +pdfjs-zoom-out-button = + .title = Reducir +pdfjs-zoom-out-button-label = Reducir +pdfjs-zoom-in-button = + .title = Ampliar +pdfjs-zoom-in-button-label = Ampliar +pdfjs-zoom-select = + .title = Zoom +pdfjs-presentation-mode-button = + .title = Cambiar ao modo presentación +pdfjs-presentation-mode-button-label = Modo presentación +pdfjs-open-file-button = + .title = Abrir ficheiro +pdfjs-open-file-button-label = Abrir +pdfjs-print-button = + .title = Imprimir +pdfjs-print-button-label = Imprimir +pdfjs-save-button = + .title = Gardar +pdfjs-save-button-label = Gardar +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Descargar +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Descargar +pdfjs-bookmark-button = + .title = Páxina actual (ver o URL da páxina actual) +pdfjs-bookmark-button-label = Páxina actual + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Ferramentas +pdfjs-tools-button-label = Ferramentas +pdfjs-first-page-button = + .title = Ir á primeira páxina +pdfjs-first-page-button-label = Ir á primeira páxina +pdfjs-last-page-button = + .title = Ir á última páxina +pdfjs-last-page-button-label = Ir á última páxina +pdfjs-page-rotate-cw-button = + .title = Rotar no sentido das agullas do reloxo +pdfjs-page-rotate-cw-button-label = Rotar no sentido das agullas do reloxo +pdfjs-page-rotate-ccw-button = + .title = Rotar no sentido contrario ás agullas do reloxo +pdfjs-page-rotate-ccw-button-label = Rotar no sentido contrario ás agullas do reloxo +pdfjs-cursor-text-select-tool-button = + .title = Activar a ferramenta de selección de texto +pdfjs-cursor-text-select-tool-button-label = Ferramenta de selección de texto +pdfjs-cursor-hand-tool-button = + .title = Activar a ferramenta de man +pdfjs-cursor-hand-tool-button-label = Ferramenta de man +pdfjs-scroll-page-button = + .title = Usar o desprazamento da páxina +pdfjs-scroll-page-button-label = Desprazamento da páxina +pdfjs-scroll-vertical-button = + .title = Usar o desprazamento vertical +pdfjs-scroll-vertical-button-label = Desprazamento vertical +pdfjs-scroll-horizontal-button = + .title = Usar o desprazamento horizontal +pdfjs-scroll-horizontal-button-label = Desprazamento horizontal +pdfjs-scroll-wrapped-button = + .title = Usar o desprazamento en bloque +pdfjs-scroll-wrapped-button-label = Desprazamento por bloque +pdfjs-spread-none-button = + .title = Non agrupar páxinas +pdfjs-spread-none-button-label = Ningún agrupamento +pdfjs-spread-odd-button = + .title = Crea grupo de páxinas que comezan con números de páxina impares +pdfjs-spread-odd-button-label = Agrupamento impar +pdfjs-spread-even-button = + .title = Crea grupo de páxinas que comezan con números de páxina pares +pdfjs-spread-even-button-label = Agrupamento par + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Propiedades do documento… +pdfjs-document-properties-button-label = Propiedades do documento… +pdfjs-document-properties-file-name = Nome do ficheiro: +pdfjs-document-properties-file-size = Tamaño do ficheiro: +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bytes) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bytes) +pdfjs-document-properties-title = Título: +pdfjs-document-properties-author = Autor: +pdfjs-document-properties-subject = Asunto: +pdfjs-document-properties-keywords = Palabras clave: +pdfjs-document-properties-creation-date = Data de creación: +pdfjs-document-properties-modification-date = Data de modificación: +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Creado por: +pdfjs-document-properties-producer = Xenerador do PDF: +pdfjs-document-properties-version = Versión de PDF: +pdfjs-document-properties-page-count = Número de páxinas: +pdfjs-document-properties-page-size = Tamaño da páxina: +pdfjs-document-properties-page-size-unit-inches = pol +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = vertical +pdfjs-document-properties-page-size-orientation-landscape = horizontal +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Carta +pdfjs-document-properties-page-size-name-legal = Legal + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Visualización rápida das páxinas web: +pdfjs-document-properties-linearized-yes = Si +pdfjs-document-properties-linearized-no = Non +pdfjs-document-properties-close-button = Pechar + +## Print + +pdfjs-print-progress-message = Preparando o documento para imprimir… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Cancelar +pdfjs-printing-not-supported = Aviso: A impresión non é compatíbel de todo con este navegador. +pdfjs-printing-not-ready = Aviso: O PDF non se cargou completamente para imprimirse. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Amosar/agochar a barra lateral +pdfjs-toggle-sidebar-notification-button = + .title = Alternar barra lateral (o documento contén esquema/anexos/capas) +pdfjs-toggle-sidebar-button-label = Amosar/agochar a barra lateral +pdfjs-document-outline-button = + .title = Amosar a estrutura do documento (dobre clic para expandir/contraer todos os elementos) +pdfjs-document-outline-button-label = Estrutura do documento +pdfjs-attachments-button = + .title = Amosar anexos +pdfjs-attachments-button-label = Anexos +pdfjs-layers-button = + .title = Mostrar capas (prema dúas veces para restaurar todas as capas o estado predeterminado) +pdfjs-layers-button-label = Capas +pdfjs-thumbs-button = + .title = Amosar miniaturas +pdfjs-thumbs-button-label = Miniaturas +pdfjs-current-outline-item-button = + .title = Atopar o elemento delimitado actualmente +pdfjs-current-outline-item-button-label = Elemento delimitado actualmente +pdfjs-findbar-button = + .title = Atopar no documento +pdfjs-findbar-button-label = Atopar +pdfjs-additional-layers = Capas adicionais + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Páxina { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Miniatura da páxina { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Atopar + .placeholder = Atopar no documento… +pdfjs-find-previous-button = + .title = Atopar a anterior aparición da frase +pdfjs-find-previous-button-label = Anterior +pdfjs-find-next-button = + .title = Atopar a seguinte aparición da frase +pdfjs-find-next-button-label = Seguinte +pdfjs-find-highlight-checkbox = Realzar todo +pdfjs-find-match-case-checkbox-label = Diferenciar maiúsculas de minúsculas +pdfjs-find-match-diacritics-checkbox-label = Distinguir os diacríticos +pdfjs-find-entire-word-checkbox-label = Palabras completas +pdfjs-find-reached-top = Chegouse ao inicio do documento, continuar desde o final +pdfjs-find-reached-bottom = Chegouse ao final do documento, continuar desde o inicio +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] Coincidencia { $current } de { $total } + *[other] Coincidencia { $current } de { $total } + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] Máis de { $limit } coincidencia + *[other] Máis de { $limit } coincidencias + } +pdfjs-find-not-found = Non se atopou a frase + +## Predefined zoom values + +pdfjs-page-scale-width = Largura da páxina +pdfjs-page-scale-fit = Axuste de páxina +pdfjs-page-scale-auto = Zoom automático +pdfjs-page-scale-actual = Tamaño actual +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Páxina { $page } + +## Loading indicator messages + +pdfjs-loading-error = Produciuse un erro ao cargar o PDF. +pdfjs-invalid-file-error = Ficheiro PDF danado ou non válido. +pdfjs-missing-file-error = Falta o ficheiro PDF. +pdfjs-unexpected-response-error = Resposta inesperada do servidor. +pdfjs-rendering-error = Produciuse un erro ao representar a páxina. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [Anotación { $type }] + +## Password + +pdfjs-password-label = Escriba o contrasinal para abrir este ficheiro PDF. +pdfjs-password-invalid = Contrasinal incorrecto. Tente de novo. +pdfjs-password-ok-button = Aceptar +pdfjs-password-cancel-button = Cancelar +pdfjs-web-fonts-disabled = Desactiváronse as fontes web: foi imposíbel usar as fontes incrustadas no PDF. + +## Editing + +pdfjs-editor-free-text-button = + .title = Texto +pdfjs-editor-free-text-button-label = Texto +pdfjs-editor-ink-button = + .title = Debuxo +pdfjs-editor-ink-button-label = Debuxo +pdfjs-editor-stamp-button = + .title = Engadir ou editar imaxes +pdfjs-editor-stamp-button-label = Engadir ou editar imaxes + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-freetext-button = + .title = Eliminar o texto +pdfjs-editor-remove-stamp-button = + .title = Eliminar a imaxe +pdfjs-editor-remove-highlight-button = + .title = Eliminar o resaltado + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Cor +pdfjs-editor-free-text-size-input = Tamaño +pdfjs-editor-ink-color-input = Cor +pdfjs-editor-ink-thickness-input = Grosor +pdfjs-editor-ink-opacity-input = Opacidade +pdfjs-editor-stamp-add-image-button = + .title = Engadir imaxe +pdfjs-editor-stamp-add-image-button-label = Engadir imaxe +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Grosor +pdfjs-free-text = + .aria-label = Editor de texto +pdfjs-free-text-default-content = Comezar a teclear… +pdfjs-ink = + .aria-label = Editor de debuxos +pdfjs-ink-canvas = + .aria-label = Imaxe creada por unha usuaria + +## Alt-text dialog + +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button-label = Texto alternativo +pdfjs-editor-alt-text-edit-button-label = Editar o texto alternativo +pdfjs-editor-alt-text-dialog-label = Escoller unha opción +pdfjs-editor-alt-text-add-description-label = Engadir unha descrición +pdfjs-editor-alt-text-mark-decorative-label = Marcar como decorativo +pdfjs-editor-alt-text-mark-decorative-description = Utilízase para imaxes ornamentais, como bordos ou marcas de auga. +pdfjs-editor-alt-text-cancel-button = Cancelar +pdfjs-editor-alt-text-save-button = Gardar +pdfjs-editor-alt-text-decorative-tooltip = Marcado como decorativo +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = Por exemplo, «Un mozo séntase á mesa para comer» + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Esquina superior esquerda: cambia o tamaño +pdfjs-editor-resizer-label-top-middle = Medio superior: cambia o tamaño +pdfjs-editor-resizer-label-top-right = Esquina superior dereita: cambia o tamaño +pdfjs-editor-resizer-label-middle-right = Medio dereito: cambia o tamaño +pdfjs-editor-resizer-label-bottom-right = Esquina inferior dereita: cambia o tamaño +pdfjs-editor-resizer-label-bottom-middle = Abaixo medio: cambia o tamaño +pdfjs-editor-resizer-label-bottom-left = Esquina inferior esquerda: cambia o tamaño +pdfjs-editor-resizer-label-middle-left = Medio esquerdo: cambia o tamaño +pdfjs-editor-resizer-top-left = + .aria-label = Esquina superior esquerda: cambia o tamaño +pdfjs-editor-resizer-top-middle = + .aria-label = Medio superior: cambia o tamaño +pdfjs-editor-resizer-top-right = + .aria-label = Esquina superior dereita: cambia o tamaño +pdfjs-editor-resizer-middle-right = + .aria-label = Medio dereito: cambia o tamaño +pdfjs-editor-resizer-bottom-right = + .aria-label = Esquina inferior dereita: cambia o tamaño +pdfjs-editor-resizer-bottom-middle = + .aria-label = Abaixo medio: cambia o tamaño +pdfjs-editor-resizer-bottom-left = + .aria-label = Esquina inferior esquerda: cambia o tamaño +pdfjs-editor-resizer-middle-left = + .aria-label = Medio esquerdo: cambia o tamaño + +## Color picker + + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + + +## Image alt-text settings + diff --git a/public/pdfjs/web/locale/gn/viewer.ftl b/public/pdfjs/web/locale/gn/viewer.ftl new file mode 100644 index 0000000..6402c6f --- /dev/null +++ b/public/pdfjs/web/locale/gn/viewer.ftl @@ -0,0 +1,515 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Kuatiarogue mboyvegua +pdfjs-previous-button-label = Mboyvegua +pdfjs-next-button = + .title = Kuatiarogue upeigua +pdfjs-next-button-label = Upeigua +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Kuatiarogue +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = { $pagesCount } gui +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } of { $pagesCount }) +pdfjs-zoom-out-button = + .title = Momichĩ +pdfjs-zoom-out-button-label = Momichĩ +pdfjs-zoom-in-button = + .title = Mbotuicha +pdfjs-zoom-in-button-label = Mbotuicha +pdfjs-zoom-select = + .title = Tuichakue +pdfjs-presentation-mode-button = + .title = Jehechauka reko moambue +pdfjs-presentation-mode-button-label = Jehechauka reko +pdfjs-open-file-button = + .title = Marandurendápe jeike +pdfjs-open-file-button-label = Jeike +pdfjs-print-button = + .title = Monguatia +pdfjs-print-button-label = Monguatia +pdfjs-save-button = + .title = Ñongatu +pdfjs-save-button-label = Ñongatu +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Mboguejy +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Mboguejy +pdfjs-bookmark-button = + .title = Kuatiarogue ag̃agua (Ehecha URL kuatiarogue ag̃agua) +pdfjs-bookmark-button-label = Kuatiarogue Ag̃agua + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Tembiporu +pdfjs-tools-button-label = Tembiporu +pdfjs-first-page-button = + .title = Kuatiarogue ñepyrũme jeho +pdfjs-first-page-button-label = Kuatiarogue ñepyrũme jeho +pdfjs-last-page-button = + .title = Kuatiarogue pahápe jeho +pdfjs-last-page-button-label = Kuatiarogue pahápe jeho +pdfjs-page-rotate-cw-button = + .title = Aravóicha mbojere +pdfjs-page-rotate-cw-button-label = Aravóicha mbojere +pdfjs-page-rotate-ccw-button = + .title = Aravo rapykue gotyo mbojere +pdfjs-page-rotate-ccw-button-label = Aravo rapykue gotyo mbojere +pdfjs-cursor-text-select-tool-button = + .title = Emyandy moñe’ẽrã jeporavo rembiporu +pdfjs-cursor-text-select-tool-button-label = Moñe’ẽrã jeporavo rembiporu +pdfjs-cursor-hand-tool-button = + .title = Tembiporu po pegua myandy +pdfjs-cursor-hand-tool-button-label = Tembiporu po pegua +pdfjs-scroll-page-button = + .title = Eiporu kuatiarogue jeku’e +pdfjs-scroll-page-button-label = Kuatiarogue jeku’e +pdfjs-scroll-vertical-button = + .title = Eiporu jeku’e ykeguáva +pdfjs-scroll-vertical-button-label = Jeku’e ykeguáva +pdfjs-scroll-horizontal-button = + .title = Eiporu jeku’e yvate gotyo +pdfjs-scroll-horizontal-button-label = Jeku’e yvate gotyo +pdfjs-scroll-wrapped-button = + .title = Eiporu jeku’e mbohyrupyre +pdfjs-scroll-wrapped-button-label = Jeku’e mbohyrupyre +pdfjs-spread-none-button = + .title = Ani ejuaju spreads kuatiarogue ndive +pdfjs-spread-none-button-label = Spreads ỹre +pdfjs-spread-odd-button = + .title = Embojuaju kuatiarogue jepysokue eñepyrũvo kuatiarogue impar-vagui +pdfjs-spread-odd-button-label = Spreads impar +pdfjs-spread-even-button = + .title = Embojuaju kuatiarogue jepysokue eñepyrũvo kuatiarogue par-vagui +pdfjs-spread-even-button-label = Ipukuve uvei + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Kuatia mba’etee… +pdfjs-document-properties-button-label = Kuatia mba’etee… +pdfjs-document-properties-file-name = Marandurenda réra: +pdfjs-document-properties-file-size = Marandurenda tuichakue: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } bytes) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } bytes) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bytes) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bytes) +pdfjs-document-properties-title = Teratee: +pdfjs-document-properties-author = Apohára: +pdfjs-document-properties-subject = Mba’egua: +pdfjs-document-properties-keywords = Jehero: +pdfjs-document-properties-creation-date = Teñoihague arange: +pdfjs-document-properties-modification-date = Iñambue hague arange: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Apo’ypyha: +pdfjs-document-properties-producer = PDF mbosako’iha: +pdfjs-document-properties-version = PDF mbojuehegua: +pdfjs-document-properties-page-count = Kuatiarogue papapy: +pdfjs-document-properties-page-size = Kuatiarogue tuichakue: +pdfjs-document-properties-page-size-unit-inches = Amo +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = Oĩháicha +pdfjs-document-properties-page-size-orientation-landscape = apaisado +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Kuatiañe’ẽ +pdfjs-document-properties-page-size-name-legal = Tee + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Ñanduti jahecha pya’e: +pdfjs-document-properties-linearized-yes = Añete +pdfjs-document-properties-linearized-no = Ahániri +pdfjs-document-properties-close-button = Mboty + +## Print + +pdfjs-print-progress-message = Embosako’i kuatia emonguatia hag̃ua… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Heja +pdfjs-printing-not-supported = Kyhyjerã: Ñembokuatia ndojokupytypái ko kundahára ndive. +pdfjs-printing-not-ready = Kyhyjerã: Ko PDF nahenyhẽmbái oñembokuatia hag̃uáicha. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Tenda yke moambue +pdfjs-toggle-sidebar-notification-button = + .title = Embojopyru tenda ykegua (kuatia oguereko kuaakaha/moirũha/ñuãha) +pdfjs-toggle-sidebar-button-label = Tenda yke moambue +pdfjs-document-outline-button = + .title = Ehechauka kuatia rape (eikutu mokõi jey embotuicha/emomichĩ hag̃ua opavavete mba’eporu) +pdfjs-document-outline-button-label = Kuatia apopyre +pdfjs-attachments-button = + .title = Moirũha jehechauka +pdfjs-attachments-button-label = Moirũha +pdfjs-layers-button = + .title = Ehechauka ñuãha (eikutu jo’a emomba’apo hag̃ua opaite ñuãha tekoypýpe) +pdfjs-layers-button-label = Ñuãha +pdfjs-thumbs-button = + .title = Mba’emirĩ jehechauka +pdfjs-thumbs-button-label = Mba’emirĩ +pdfjs-current-outline-item-button = + .title = Eheka mba’eporu ag̃aguaitéva +pdfjs-current-outline-item-button-label = Mba’eporu ag̃aguaitéva +pdfjs-findbar-button = + .title = Kuatiápe jeheka +pdfjs-findbar-button-label = Juhu +pdfjs-additional-layers = Ñuãha moirũguáva + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Kuatiarogue { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Kuatiarogue mba’emirĩ { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Juhu + .placeholder = Kuatiápe jejuhu… +pdfjs-find-previous-button = + .title = Ejuhu ñe’ẽrysýi osẽ’ypy hague +pdfjs-find-previous-button-label = Mboyvegua +pdfjs-find-next-button = + .title = Eho ñe’ẽ juhupyre upeiguávape +pdfjs-find-next-button-label = Upeigua +pdfjs-find-highlight-checkbox = Embojekuaavepa +pdfjs-find-match-case-checkbox-label = Ejesareko taiguasu/taimichĩre +pdfjs-find-match-diacritics-checkbox-label = Diacrítico moñondive +pdfjs-find-entire-word-checkbox-label = Ñe’ẽ oĩmbáva +pdfjs-find-reached-top = Ojehupyty kuatia ñepyrũ, oku’ejeýta kuatia paha guive +pdfjs-find-reached-bottom = Ojehupyty kuatia paha, oku’ejeýta kuatia ñepyrũ guive +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] { $current } ha { $total } ojueheguáva + *[other] { $current } ha { $total } ojueheguáva + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] Hetave { $limit } ojueheguáva + *[other] Hetave { $limit } ojueheguáva + } +pdfjs-find-not-found = Ñe’ẽrysýi ojejuhu’ỹva + +## Predefined zoom values + +pdfjs-page-scale-width = Kuatiarogue pekue +pdfjs-page-scale-fit = Kuatiarogue ñemoĩporã +pdfjs-page-scale-auto = Tuichakue ijeheguíva +pdfjs-page-scale-actual = Tuichakue ag̃agua +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Kuatiarogue { $page } + +## Loading indicator messages + +pdfjs-loading-error = Oiko jejavy PDF oñemyeñyhẽnguévo. +pdfjs-invalid-file-error = PDF marandurenda ndoikóiva térã ivaipyréva. +pdfjs-missing-file-error = Ndaipóri PDF marandurenda +pdfjs-unexpected-response-error = Mohendahavusu mbohovái eha’ãrõ’ỹva. +pdfjs-rendering-error = Oiko jejavy ehechaukasévo kuatiarogue. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [Jehaipy { $type }] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Emoinge ñe’ẽñemi eipe’a hag̃ua ko marandurenda PDF. +pdfjs-password-invalid = Ñe’ẽñemi ndoikóiva. Eha’ã jey. +pdfjs-password-ok-button = MONEĨ +pdfjs-password-cancel-button = Heja +pdfjs-web-fonts-disabled = Ñanduti taity oñemongéma: ndaikatumo’ãi eiporu PDF jehai’íva taity. + +## Editing + +pdfjs-editor-free-text-button = + .title = Moñe’ẽrã +pdfjs-editor-free-text-button-label = Moñe’ẽrã +pdfjs-editor-ink-button = + .title = Moha’ãnga +pdfjs-editor-ink-button-label = Moha’ãnga +pdfjs-editor-stamp-button = + .title = Embojuaju térã embosako’i ta’ãnga +pdfjs-editor-stamp-button-label = Embojuaju térã embosako’i ta’ãnga +pdfjs-editor-highlight-button = + .title = Mbosa’y +pdfjs-editor-highlight-button-label = Mbosa’y +pdfjs-highlight-floating-button1 = + .title = Mbosa’y + .aria-label = Mbosa’y +pdfjs-highlight-floating-button-label = Mbosa’y + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Emboguete ta’ãnga +pdfjs-editor-remove-freetext-button = + .title = Emboguete moñe’ẽrã +pdfjs-editor-remove-stamp-button = + .title = Emboguete ta’ãnga +pdfjs-editor-remove-highlight-button = + .title = Eipe’a jehechaveha + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Sa’y +pdfjs-editor-free-text-size-input = Tuichakue +pdfjs-editor-ink-color-input = Sa’y +pdfjs-editor-ink-thickness-input = Anambusu +pdfjs-editor-ink-opacity-input = Pytũngy +pdfjs-editor-stamp-add-image-button = + .title = Embojuaju ta’ãnga +pdfjs-editor-stamp-add-image-button-label = Embojuaju ta’ãnga +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Anambusu +pdfjs-editor-free-highlight-thickness-title = + .title = Emoambue anambusukue embosa’ývo mba’eporu ha’e’ỹva moñe’ẽrã +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = Moñe’ẽrã moheñoiha + .default-content = Eñepyrũ ehai… +pdfjs-free-text = + .aria-label = Moñe’ẽrã moheñoiha +pdfjs-free-text-default-content = Ehai ñepyrũ… +pdfjs-ink = + .aria-label = Ta’ãnga moheñoiha +pdfjs-ink-canvas = + .aria-label = Ta’ãnga omoheñóiva poruhára + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = Moñe’ẽrã mokõiháva +pdfjs-editor-alt-text-edit-button = + .aria-label = Embojuruja moñe’ẽrã mokõiháva +pdfjs-editor-alt-text-edit-button-label = Embojuruja moñe’ẽrã mokõiháva +pdfjs-editor-alt-text-dialog-label = Eiporavo poravorã +pdfjs-editor-alt-text-dialog-description = Moñe’ẽrã ykepegua (moñe’ẽrã ykepegua) nepytyvõ nderehecháiramo ta’ãnga térã nahenyhẽiramo. +pdfjs-editor-alt-text-add-description-label = Embojuaju ñemoha’ãnga +pdfjs-editor-alt-text-add-description-description = Ehaimi 1 térã 2 ñe’ẽjuaju oñe’ẽva pe téma rehe, ijere térã mba’eapóre. +pdfjs-editor-alt-text-mark-decorative-label = Emongurusu jeguakárõ +pdfjs-editor-alt-text-mark-decorative-description = Ojeporu ta’ãnga jeguakarã, tembe’y térã ta’ãnga ruguarãramo. +pdfjs-editor-alt-text-cancel-button = Heja +pdfjs-editor-alt-text-save-button = Ñongatu +pdfjs-editor-alt-text-decorative-tooltip = Jeguakárõ mongurusupyre +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = Techapyrã: “Peteĩ mitãrusu oguapy mesápe okaru hag̃ua” +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = Moñe’ẽrã mokõiháva + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Yvate asu gotyo — emoambue tuichakue +pdfjs-editor-resizer-label-top-middle = Yvate mbytépe — emoambue tuichakue +pdfjs-editor-resizer-label-top-right = Yvate akatúape — emoambue tuichakue +pdfjs-editor-resizer-label-middle-right = Mbyte akatúape — emoambue tuichakue +pdfjs-editor-resizer-label-bottom-right = Yvy gotyo akatúape — emoambue tuichakue +pdfjs-editor-resizer-label-bottom-middle = Yvy gotyo mbytépe — emoambue tuichakue +pdfjs-editor-resizer-label-bottom-left = Iguýpe asu gotyo — emoambue tuichakue +pdfjs-editor-resizer-label-middle-left = Mbyte asu gotyo — emoambue tuichakue +pdfjs-editor-resizer-top-left = + .aria-label = Yvate asu gotyo — emoambue tuichakue +pdfjs-editor-resizer-top-middle = + .aria-label = Yvate mbytépe — emoambue tuichakue +pdfjs-editor-resizer-top-right = + .aria-label = Yvate akatúape — emoambue tuichakue +pdfjs-editor-resizer-middle-right = + .aria-label = Mbyte akatúape — emoambue tuichakue +pdfjs-editor-resizer-bottom-right = + .aria-label = Yvy gotyo akatúape — emoambue tuichakue +pdfjs-editor-resizer-bottom-middle = + .aria-label = Yvy gotyo mbytépe — emoambue tuichakue +pdfjs-editor-resizer-bottom-left = + .aria-label = Iguýpe asu gotyo — emoambue tuichakue +pdfjs-editor-resizer-middle-left = + .aria-label = Mbyte asu gotyo — emoambue tuichakue + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Jehechaveha sa’y +pdfjs-editor-colorpicker-button = + .title = Emoambue sa’y +pdfjs-editor-colorpicker-dropdown = + .aria-label = Sa’y poravopyrã +pdfjs-editor-colorpicker-yellow = + .title = Sa’yju +pdfjs-editor-colorpicker-green = + .title = Hovyũ +pdfjs-editor-colorpicker-blue = + .title = Hovy +pdfjs-editor-colorpicker-pink = + .title = Pytãngy +pdfjs-editor-colorpicker-red = + .title = Pyha + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Techaukapa +pdfjs-editor-highlight-show-all-button = + .title = Techaukapa + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = Embosako’i moñe’ẽrã mokõiha (ta’ãngáre ñeñe’ẽ) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = Embojuaju moñe’ẽrã mokõiha (ta’ãngáre ñeñe’ẽ) +pdfjs-editor-new-alt-text-textarea = + .placeholder = Edescribi ko’ápe… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = Ñemyesakã mbykymi opavave ohecha’ỹva upe ta’ãnga térã pe ta’ãnga nahenyhẽiramo. +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = Ko moñe’ẽrã mokõiha oñemoheñói ijehegui ha ikatu ndoikoporãi. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Eikuaave +pdfjs-editor-new-alt-text-create-automatically-button-label = Emoheñói moñe’ẽrã mokõiha ijeheguíva +pdfjs-editor-new-alt-text-not-now-button = Ani ko’ág̃a +pdfjs-editor-new-alt-text-error-title = Noñemoheñói moñe’ẽrã mokõiha ijeheguíva +pdfjs-editor-new-alt-text-error-description = Ehai ne moñe’ẽrã mokõiha térã eha’ã jey ag̃amieve. +pdfjs-editor-new-alt-text-error-close-button = Mboty +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = Emboguejyhína IA moñe’ẽrã mokõiháva ({ $downloadedSize } { $totalSize } MB) mba’e + .aria-valuetext = Emboguejyhína IA moñe’ẽrã mokõiháva ({ $downloadedSize } { $totalSize } MB) mba’e +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = Moñe’ẽrã mokõiha mbojuajupyre +pdfjs-editor-new-alt-text-added-button-label = Oñembojuaju moñe’ẽrã mokõiha +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = Ndaipóri moñe’ẽrã mokõiha +pdfjs-editor-new-alt-text-missing-button-label = Ndaipóri moñe’ẽrã mokõiha +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = Ehechajey moñe’ẽrã mokõiha +pdfjs-editor-new-alt-text-to-review-button-label = Ehechajey moñe’ẽrã mokõiha +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Heñóiva ijeheguiete: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = Ta’ãnga moñe’ẽrã mokõiha ñemboheko +pdfjs-image-alt-text-settings-button-label = Ta’ãnga moñe’ẽrã mokõiha ñemboheko +pdfjs-editor-alt-text-settings-dialog-label = Ta’ãnga moñe’ẽrã mokõiha ñemboheko +pdfjs-editor-alt-text-settings-automatic-title = Moñe’ẽrã mokõiha ijeheguíva +pdfjs-editor-alt-text-settings-create-model-button-label = Emoheñói moñe’ẽrã mokõiha ijeheguíva +pdfjs-editor-alt-text-settings-create-model-description = Ñemyesakã mbykymi opavave tapicha ohecha’ỹva upe ta’ãnga térã pe ta’ãnga nahenyhẽiramo. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = Peteĩva IA moñe’ẽrã mokõiha ({ $totalSize } MB) +pdfjs-editor-alt-text-settings-ai-model-description = Oku’e mba’e’okaitépe umi mba’ekuaarã hekoñemi hag̃ua. Tekotevẽva moñe’ẽrã ykegua ijeheguívape. +pdfjs-editor-alt-text-settings-delete-model-button = Mboguete +pdfjs-editor-alt-text-settings-download-model-button = Mboguejy +pdfjs-editor-alt-text-settings-downloading-model-button = Emboguejyhína… +pdfjs-editor-alt-text-settings-editor-title = Moñe’ẽrã mokõiha mbosako’iha +pdfjs-editor-alt-text-settings-show-dialog-button-label = Ehechauka moñe’ẽrã mokõiha mbosako’iha embojuajúvo ta’ãnga +pdfjs-editor-alt-text-settings-show-dialog-description = Nepytyvõta ta’ãngakuéra orekotaha moñe’ẽrã mokõiha. +pdfjs-editor-alt-text-settings-close-button = Mboty + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = Mbosa’ýva mboguete +pdfjs-editor-undo-bar-message-freetext = Moñe’ẽrã mboguepyre +pdfjs-editor-undo-bar-message-ink = Ta’ãnga mboguepyre +pdfjs-editor-undo-bar-message-stamp = Ta’ãnga mboguepyre +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = + { $count -> + [one] { $count } jehaikue mboguepyre + *[other] { $count } jehaikue mboguepyre + } +pdfjs-editor-undo-bar-undo-button = + .title = Mboguevi +pdfjs-editor-undo-bar-undo-button-label = Mboguevi +pdfjs-editor-undo-bar-close-button = + .title = Mboty +pdfjs-editor-undo-bar-close-button-label = Mboty diff --git a/public/pdfjs/web/locale/gu-IN/viewer.ftl b/public/pdfjs/web/locale/gu-IN/viewer.ftl new file mode 100644 index 0000000..5d8bb54 --- /dev/null +++ b/public/pdfjs/web/locale/gu-IN/viewer.ftl @@ -0,0 +1,247 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = પહેલાનુ પાનું +pdfjs-previous-button-label = પહેલાનુ +pdfjs-next-button = + .title = આગળનુ પાનું +pdfjs-next-button-label = આગળનું +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = પાનું +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = નો { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } નો { $pagesCount }) +pdfjs-zoom-out-button = + .title = મોટુ કરો +pdfjs-zoom-out-button-label = મોટુ કરો +pdfjs-zoom-in-button = + .title = નાનું કરો +pdfjs-zoom-in-button-label = નાનું કરો +pdfjs-zoom-select = + .title = નાનું મોટુ કરો +pdfjs-presentation-mode-button = + .title = રજૂઆત સ્થિતિમાં જાવ +pdfjs-presentation-mode-button-label = રજૂઆત સ્થિતિ +pdfjs-open-file-button = + .title = ફાઇલ ખોલો +pdfjs-open-file-button-label = ખોલો +pdfjs-print-button = + .title = છાપો +pdfjs-print-button-label = છારો + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = સાધનો +pdfjs-tools-button-label = સાધનો +pdfjs-first-page-button = + .title = પહેલાં પાનામાં જાવ +pdfjs-first-page-button-label = પ્રથમ પાનાં પર જાવ +pdfjs-last-page-button = + .title = છેલ્લા પાનાં પર જાવ +pdfjs-last-page-button-label = છેલ્લા પાનાં પર જાવ +pdfjs-page-rotate-cw-button = + .title = ઘડિયાળનાં કાંટા તરફ ફેરવો +pdfjs-page-rotate-cw-button-label = ઘડિયાળનાં કાંટા તરફ ફેરવો +pdfjs-page-rotate-ccw-button = + .title = ઘડિયાળનાં કાંટાની ઉલટી દિશામાં ફેરવો +pdfjs-page-rotate-ccw-button-label = ઘડિયાળનાં કાંટાની વિરુદ્દ ફેરવો +pdfjs-cursor-text-select-tool-button = + .title = ટેક્સ્ટ પસંદગી ટૂલ સક્ષમ કરો +pdfjs-cursor-text-select-tool-button-label = ટેક્સ્ટ પસંદગી ટૂલ +pdfjs-cursor-hand-tool-button = + .title = હાથનાં સાધનને સક્રિય કરો +pdfjs-cursor-hand-tool-button-label = હેન્ડ ટૂલ +pdfjs-scroll-vertical-button = + .title = ઊભી સ્ક્રોલિંગનો ઉપયોગ કરો +pdfjs-scroll-vertical-button-label = ઊભી સ્ક્રોલિંગ +pdfjs-scroll-horizontal-button = + .title = આડી સ્ક્રોલિંગનો ઉપયોગ કરો +pdfjs-scroll-horizontal-button-label = આડી સ્ક્રોલિંગ +pdfjs-scroll-wrapped-button = + .title = આવરિત સ્ક્રોલિંગનો ઉપયોગ કરો +pdfjs-scroll-wrapped-button-label = આવરિત સ્ક્રોલિંગ +pdfjs-spread-none-button = + .title = પૃષ્ઠ સ્પ્રેડમાં જોડાવશો નહીં +pdfjs-spread-none-button-label = કોઈ સ્પ્રેડ નથી +pdfjs-spread-odd-button = + .title = એકી-ક્રમાંકિત પૃષ્ઠો સાથે પ્રારંભ થતાં પૃષ્ઠ સ્પ્રેડમાં જોડાઓ +pdfjs-spread-odd-button-label = એકી સ્પ્રેડ્સ +pdfjs-spread-even-button = + .title = નંબર-ક્રમાંકિત પૃષ્ઠોથી શરૂ થતાં પૃષ્ઠ સ્પ્રેડમાં જોડાઓ +pdfjs-spread-even-button-label = સરખું ફેલાવવું + +## Document properties dialog + +pdfjs-document-properties-button = + .title = દસ્તાવેજ ગુણધર્મો… +pdfjs-document-properties-button-label = દસ્તાવેજ ગુણધર્મો… +pdfjs-document-properties-file-name = ફાઇલ નામ: +pdfjs-document-properties-file-size = ફાઇલ માપ: +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } બાઇટ) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } બાઇટ) +pdfjs-document-properties-title = શીર્ષક: +pdfjs-document-properties-author = લેખક: +pdfjs-document-properties-subject = વિષય: +pdfjs-document-properties-keywords = કિવર્ડ: +pdfjs-document-properties-creation-date = નિર્માણ તારીખ: +pdfjs-document-properties-modification-date = ફેરફાર તારીખ: +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = નિર્માતા: +pdfjs-document-properties-producer = PDF નિર્માતા: +pdfjs-document-properties-version = PDF આવૃત્તિ: +pdfjs-document-properties-page-count = પાનાં ગણતરી: +pdfjs-document-properties-page-size = પૃષ્ઠનું કદ: +pdfjs-document-properties-page-size-unit-inches = ઇંચ +pdfjs-document-properties-page-size-unit-millimeters = મીમી +pdfjs-document-properties-page-size-orientation-portrait = ઉભું +pdfjs-document-properties-page-size-orientation-landscape = આડુ +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = પત્ર +pdfjs-document-properties-page-size-name-legal = કાયદાકીય + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = ઝડપી વૅબ દૃશ્ય: +pdfjs-document-properties-linearized-yes = હા +pdfjs-document-properties-linearized-no = ના +pdfjs-document-properties-close-button = બંધ કરો + +## Print + +pdfjs-print-progress-message = છાપકામ માટે દસ્તાવેજ તૈયાર કરી રહ્યા છે… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = રદ કરો +pdfjs-printing-not-supported = ચેતવણી: છાપવાનું આ બ્રાઉઝર દ્દારા સંપૂર્ણપણે આધારભૂત નથી. +pdfjs-printing-not-ready = Warning: PDF એ છાપવા માટે સંપૂર્ણપણે લાવેલ છે. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = ટૉગલ બાજુપટ્ટી +pdfjs-toggle-sidebar-button-label = ટૉગલ બાજુપટ્ટી +pdfjs-document-outline-button = + .title = દસ્તાવેજની રૂપરેખા બતાવો(બધી આઇટમ્સને વિસ્તૃત/સંકુચિત કરવા માટે ડબલ-ક્લિક કરો) +pdfjs-document-outline-button-label = દસ્તાવેજ રૂપરેખા +pdfjs-attachments-button = + .title = જોડાણોને બતાવો +pdfjs-attachments-button-label = જોડાણો +pdfjs-thumbs-button = + .title = થંબનેલ્સ બતાવો +pdfjs-thumbs-button-label = થંબનેલ્સ +pdfjs-findbar-button = + .title = દસ્તાવેજમાં શોધો +pdfjs-findbar-button-label = શોધો + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = પાનું { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = પાનાં { $page } નું થંબનેલ્સ + +## Find panel button title and messages + +pdfjs-find-input = + .title = શોધો + .placeholder = દસ્તાવેજમાં શોધો… +pdfjs-find-previous-button = + .title = શબ્દસમૂહની પાછલી ઘટનાને શોધો +pdfjs-find-previous-button-label = પહેલાંનુ +pdfjs-find-next-button = + .title = શબ્દસમૂહની આગળની ઘટનાને શોધો +pdfjs-find-next-button-label = આગળનું +pdfjs-find-highlight-checkbox = બધુ પ્રકાશિત કરો +pdfjs-find-match-case-checkbox-label = કેસ બંધબેસાડો +pdfjs-find-entire-word-checkbox-label = સંપૂર્ણ શબ્દો +pdfjs-find-reached-top = દસ્તાવેજનાં ટોચે પહોંચી ગયા, તળિયેથી ચાલુ કરેલ હતુ +pdfjs-find-reached-bottom = દસ્તાવેજનાં અંતે પહોંચી ગયા, ઉપરથી ચાલુ કરેલ હતુ +pdfjs-find-not-found = શબ્દસમૂહ મળ્યુ નથી + +## Predefined zoom values + +pdfjs-page-scale-width = પાનાની પહોળાઇ +pdfjs-page-scale-fit = પાનું બંધબેસતુ +pdfjs-page-scale-auto = આપમેળે નાનુંમોટુ કરો +pdfjs-page-scale-actual = ચોક્કસ માપ +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + + +## Loading indicator messages + +pdfjs-loading-error = ભૂલ ઉદ્ભવી જ્યારે PDF ને લાવી રહ્યા હોય. +pdfjs-invalid-file-error = અયોગ્ય અથવા ભાંગેલ PDF ફાઇલ. +pdfjs-missing-file-error = ગુમ થયેલ PDF ફાઇલ. +pdfjs-unexpected-response-error = અનપેક્ષિત સર્વર પ્રતિસાદ. +pdfjs-rendering-error = ભૂલ ઉદ્ભવી જ્યારે પાનાંનુ રેન્ડ કરી રહ્યા હોય. + +## Annotations + +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } Annotation] + +## Password + +pdfjs-password-label = આ PDF ફાઇલને ખોલવા પાસવર્ડને દાખલ કરો. +pdfjs-password-invalid = અયોગ્ય પાસવર્ડ. મહેરબાની કરીને ફરી પ્રયત્ન કરો. +pdfjs-password-ok-button = બરાબર +pdfjs-password-cancel-button = રદ કરો +pdfjs-web-fonts-disabled = વેબ ફોન્ટ નિષ્ક્રિય થયેલ છે: ઍમ્બેડ થયેલ PDF ફોન્ટને વાપરવાનું અસમર્થ. + +## Editing + + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + diff --git a/public/pdfjs/web/locale/he/viewer.ftl b/public/pdfjs/web/locale/he/viewer.ftl new file mode 100644 index 0000000..08308c0 --- /dev/null +++ b/public/pdfjs/web/locale/he/viewer.ftl @@ -0,0 +1,515 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = דף קודם +pdfjs-previous-button-label = קודם +pdfjs-next-button = + .title = דף הבא +pdfjs-next-button-label = הבא +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = דף +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = מתוך { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } מתוך { $pagesCount }) +pdfjs-zoom-out-button = + .title = התרחקות +pdfjs-zoom-out-button-label = התרחקות +pdfjs-zoom-in-button = + .title = התקרבות +pdfjs-zoom-in-button-label = התקרבות +pdfjs-zoom-select = + .title = מרחק מתצוגה +pdfjs-presentation-mode-button = + .title = מעבר למצב מצגת +pdfjs-presentation-mode-button-label = מצב מצגת +pdfjs-open-file-button = + .title = פתיחת קובץ +pdfjs-open-file-button-label = פתיחה +pdfjs-print-button = + .title = הדפסה +pdfjs-print-button-label = הדפסה +pdfjs-save-button = + .title = שמירה +pdfjs-save-button-label = שמירה +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = הורדה +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = הורדה +pdfjs-bookmark-button = + .title = עמוד נוכחי (הצגת כתובת האתר מהעמוד הנוכחי) +pdfjs-bookmark-button-label = עמוד נוכחי + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = כלים +pdfjs-tools-button-label = כלים +pdfjs-first-page-button = + .title = מעבר לעמוד הראשון +pdfjs-first-page-button-label = מעבר לעמוד הראשון +pdfjs-last-page-button = + .title = מעבר לעמוד האחרון +pdfjs-last-page-button-label = מעבר לעמוד האחרון +pdfjs-page-rotate-cw-button = + .title = הטיה עם כיוון השעון +pdfjs-page-rotate-cw-button-label = הטיה עם כיוון השעון +pdfjs-page-rotate-ccw-button = + .title = הטיה כנגד כיוון השעון +pdfjs-page-rotate-ccw-button-label = הטיה כנגד כיוון השעון +pdfjs-cursor-text-select-tool-button = + .title = הפעלת כלי בחירת טקסט +pdfjs-cursor-text-select-tool-button-label = כלי בחירת טקסט +pdfjs-cursor-hand-tool-button = + .title = הפעלת כלי היד +pdfjs-cursor-hand-tool-button-label = כלי יד +pdfjs-scroll-page-button = + .title = שימוש בגלילת עמוד +pdfjs-scroll-page-button-label = גלילת עמוד +pdfjs-scroll-vertical-button = + .title = שימוש בגלילה אנכית +pdfjs-scroll-vertical-button-label = גלילה אנכית +pdfjs-scroll-horizontal-button = + .title = שימוש בגלילה אופקית +pdfjs-scroll-horizontal-button-label = גלילה אופקית +pdfjs-scroll-wrapped-button = + .title = שימוש בגלילה רציפה +pdfjs-scroll-wrapped-button-label = גלילה רציפה +pdfjs-spread-none-button = + .title = לא לצרף מפתחי עמודים +pdfjs-spread-none-button-label = ללא מפתחים +pdfjs-spread-odd-button = + .title = צירוף מפתחי עמודים שמתחילים בדפים עם מספרים אי־זוגיים +pdfjs-spread-odd-button-label = מפתחים אי־זוגיים +pdfjs-spread-even-button = + .title = צירוף מפתחי עמודים שמתחילים בדפים עם מספרים זוגיים +pdfjs-spread-even-button-label = מפתחים זוגיים + +## Document properties dialog + +pdfjs-document-properties-button = + .title = מאפייני מסמך… +pdfjs-document-properties-button-label = מאפייני מסמך… +pdfjs-document-properties-file-name = שם קובץ: +pdfjs-document-properties-file-size = גודל הקובץ: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } ק״ב ({ $b } בתים) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } מ״ב ({ $b } בתים) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } ק״ב ({ $size_b } בתים) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } מ״ב ({ $size_b } בתים) +pdfjs-document-properties-title = כותרת: +pdfjs-document-properties-author = מחבר: +pdfjs-document-properties-subject = נושא: +pdfjs-document-properties-keywords = מילות מפתח: +pdfjs-document-properties-creation-date = תאריך יצירה: +pdfjs-document-properties-modification-date = תאריך שינוי: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = יוצר: +pdfjs-document-properties-producer = יצרן PDF: +pdfjs-document-properties-version = גרסת PDF: +pdfjs-document-properties-page-count = מספר דפים: +pdfjs-document-properties-page-size = גודל העמוד: +pdfjs-document-properties-page-size-unit-inches = אינ׳ +pdfjs-document-properties-page-size-unit-millimeters = מ״מ +pdfjs-document-properties-page-size-orientation-portrait = לאורך +pdfjs-document-properties-page-size-orientation-landscape = לרוחב +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = מכתב +pdfjs-document-properties-page-size-name-legal = דף משפטי + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = תצוגת דף מהירה: +pdfjs-document-properties-linearized-yes = כן +pdfjs-document-properties-linearized-no = לא +pdfjs-document-properties-close-button = סגירה + +## Print + +pdfjs-print-progress-message = מסמך בהכנה להדפסה… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = ביטול +pdfjs-printing-not-supported = אזהרה: הדפסה אינה נתמכת במלואה בדפדפן זה. +pdfjs-printing-not-ready = אזהרה: מסמך ה־PDF לא נטען לחלוטין עד מצב שמאפשר הדפסה. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = הצגה/הסתרה של סרגל הצד +pdfjs-toggle-sidebar-notification-button = + .title = החלפת תצוגת סרגל צד (מסמך שמכיל תוכן עניינים/קבצים מצורפים/שכבות) +pdfjs-toggle-sidebar-button-label = הצגה/הסתרה של סרגל הצד +pdfjs-document-outline-button = + .title = הצגת תוכן העניינים של המסמך (לחיצה כפולה כדי להרחיב או לצמצם את כל הפריטים) +pdfjs-document-outline-button-label = תוכן העניינים של המסמך +pdfjs-attachments-button = + .title = הצגת צרופות +pdfjs-attachments-button-label = צרופות +pdfjs-layers-button = + .title = הצגת שכבות (יש ללחוץ לחיצה כפולה כדי לאפס את כל השכבות למצב ברירת המחדל) +pdfjs-layers-button-label = שכבות +pdfjs-thumbs-button = + .title = הצגת תצוגה מקדימה +pdfjs-thumbs-button-label = תצוגה מקדימה +pdfjs-current-outline-item-button = + .title = מציאת פריט תוכן העניינים הנוכחי +pdfjs-current-outline-item-button-label = פריט תוכן העניינים הנוכחי +pdfjs-findbar-button = + .title = חיפוש במסמך +pdfjs-findbar-button-label = חיפוש +pdfjs-additional-layers = שכבות נוספות + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = עמוד { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = תצוגה מקדימה של עמוד { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = חיפוש + .placeholder = חיפוש במסמך… +pdfjs-find-previous-button = + .title = מציאת המופע הקודם של הביטוי +pdfjs-find-previous-button-label = קודם +pdfjs-find-next-button = + .title = מציאת המופע הבא של הביטוי +pdfjs-find-next-button-label = הבא +pdfjs-find-highlight-checkbox = הדגשת הכול +pdfjs-find-match-case-checkbox-label = התאמת אותיות +pdfjs-find-match-diacritics-checkbox-label = התאמה דיאקריטית +pdfjs-find-entire-word-checkbox-label = מילים שלמות +pdfjs-find-reached-top = הגיע לראש הדף, ממשיך מלמטה +pdfjs-find-reached-bottom = הגיע לסוף הדף, ממשיך מלמעלה +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] { $current } מתוך { $total } תוצאות + *[other] { $current } מתוך { $total } תוצאות + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] יותר מתוצאה אחת + *[other] יותר מ־{ $limit } תוצאות + } +pdfjs-find-not-found = הביטוי לא נמצא + +## Predefined zoom values + +pdfjs-page-scale-width = רוחב העמוד +pdfjs-page-scale-fit = התאמה לעמוד +pdfjs-page-scale-auto = מרחק מתצוגה אוטומטי +pdfjs-page-scale-actual = גודל אמיתי +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = עמוד { $page } + +## Loading indicator messages + +pdfjs-loading-error = אירעה שגיאה בעת טעינת ה־PDF. +pdfjs-invalid-file-error = קובץ PDF פגום או לא תקין. +pdfjs-missing-file-error = קובץ PDF חסר. +pdfjs-unexpected-response-error = תגובת שרת לא צפויה. +pdfjs-rendering-error = אירעה שגיאה בעת עיבוד הדף. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [הערת { $type }] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = נא להכניס את הססמה לפתיחת קובץ PDF זה. +pdfjs-password-invalid = ססמה שגויה. נא לנסות שנית. +pdfjs-password-ok-button = אישור +pdfjs-password-cancel-button = ביטול +pdfjs-web-fonts-disabled = גופני רשת מנוטרלים: לא ניתן להשתמש בגופני PDF מוטבעים. + +## Editing + +pdfjs-editor-free-text-button = + .title = טקסט +pdfjs-editor-free-text-button-label = טקסט +pdfjs-editor-ink-button = + .title = ציור +pdfjs-editor-ink-button-label = ציור +pdfjs-editor-stamp-button = + .title = הוספה או עריכת תמונות +pdfjs-editor-stamp-button-label = הוספה או עריכת תמונות +pdfjs-editor-highlight-button = + .title = סימון +pdfjs-editor-highlight-button-label = סימון +pdfjs-highlight-floating-button1 = + .title = סימון + .aria-label = סימון +pdfjs-highlight-floating-button-label = סימון + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = הסרת ציור +pdfjs-editor-remove-freetext-button = + .title = הסרת טקסט +pdfjs-editor-remove-stamp-button = + .title = הסרת תמונה +pdfjs-editor-remove-highlight-button = + .title = הסרת סימון + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = צבע +pdfjs-editor-free-text-size-input = גודל +pdfjs-editor-ink-color-input = צבע +pdfjs-editor-ink-thickness-input = עובי +pdfjs-editor-ink-opacity-input = אטימות +pdfjs-editor-stamp-add-image-button = + .title = הוספת תמונה +pdfjs-editor-stamp-add-image-button-label = הוספת תמונה +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = עובי +pdfjs-editor-free-highlight-thickness-title = + .title = שינוי עובי בעת סימון פריטים שאינם טקסט +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = עורך טקסט + .default-content = נא להתחיל להקליד… +pdfjs-free-text = + .aria-label = עורך טקסט +pdfjs-free-text-default-content = להתחיל להקליד… +pdfjs-ink = + .aria-label = עורך ציור +pdfjs-ink-canvas = + .aria-label = תמונה שנוצרה על־ידי משתמש + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = טקסט חלופי +pdfjs-editor-alt-text-edit-button = + .aria-label = עריכת טקסט חלופי +pdfjs-editor-alt-text-edit-button-label = עריכת טקסט חלופי +pdfjs-editor-alt-text-dialog-label = בחירת אפשרות +pdfjs-editor-alt-text-dialog-description = טקסט חלופי עוזר כשאנשים לא יכולים לראות את התמונה או כשהיא לא נטענת. +pdfjs-editor-alt-text-add-description-label = הוספת תיאור +pdfjs-editor-alt-text-add-description-description = כדאי לתאר במשפט אחד או שניים את הנושא, התפאורה או הפעולות. +pdfjs-editor-alt-text-mark-decorative-label = סימון כדקורטיבי +pdfjs-editor-alt-text-mark-decorative-description = זה משמש לתמונות נוי, כמו גבולות או סימני מים. +pdfjs-editor-alt-text-cancel-button = ביטול +pdfjs-editor-alt-text-save-button = שמירה +pdfjs-editor-alt-text-decorative-tooltip = מסומן כדקורטיבי +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = לדוגמה, ״גבר צעיר מתיישב ליד שולחן לאכול ארוחה״ +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = טקסט חלופי + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = פינה שמאלית עליונה - שינוי גודל +pdfjs-editor-resizer-label-top-middle = למעלה באמצע - שינוי גודל +pdfjs-editor-resizer-label-top-right = פינה ימנית עליונה - שינוי גודל +pdfjs-editor-resizer-label-middle-right = ימינה באמצע - שינוי גודל +pdfjs-editor-resizer-label-bottom-right = פינה ימנית תחתונה - שינוי גודל +pdfjs-editor-resizer-label-bottom-middle = למטה באמצע - שינוי גודל +pdfjs-editor-resizer-label-bottom-left = פינה שמאלית תחתונה - שינוי גודל +pdfjs-editor-resizer-label-middle-left = שמאלה באמצע - שינוי גודל +pdfjs-editor-resizer-top-left = + .aria-label = פינה שמאלית עליונה - שינוי גודל +pdfjs-editor-resizer-top-middle = + .aria-label = למעלה באמצע - שינוי גודל +pdfjs-editor-resizer-top-right = + .aria-label = פינה ימנית עליונה - שינוי גודל +pdfjs-editor-resizer-middle-right = + .aria-label = ימינה באמצע - שינוי גודל +pdfjs-editor-resizer-bottom-right = + .aria-label = פינה ימנית תחתונה - שינוי גודל +pdfjs-editor-resizer-bottom-middle = + .aria-label = למטה באמצע - שינוי גודל +pdfjs-editor-resizer-bottom-left = + .aria-label = פינה שמאלית תחתונה - שינוי גודל +pdfjs-editor-resizer-middle-left = + .aria-label = שמאלה באמצע - שינוי גודל + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = צבע סימון +pdfjs-editor-colorpicker-button = + .title = שינוי צבע +pdfjs-editor-colorpicker-dropdown = + .aria-label = בחירת צבע +pdfjs-editor-colorpicker-yellow = + .title = צהוב +pdfjs-editor-colorpicker-green = + .title = ירוק +pdfjs-editor-colorpicker-blue = + .title = כחול +pdfjs-editor-colorpicker-pink = + .title = ורוד +pdfjs-editor-colorpicker-red = + .title = אדום + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = הצגת הכול +pdfjs-editor-highlight-show-all-button = + .title = הצגת הכול + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = עריכת טקסט חלופי (תיאור תמונה) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = הוספת טקסט חלופי (תיאור תמונה) +pdfjs-editor-new-alt-text-textarea = + .placeholder = נא לכתוב את התיאור שלך כאן… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = תיאור קצר לאנשים שאינם יכולים לראות את התמונה או כאשר התמונה אינה נטענת. +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = טקסט חלופי זה נוצר באופן אוטומטי ועשוי להיות לא מדויק. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = מידע נוסף +pdfjs-editor-new-alt-text-create-automatically-button-label = יצירת טקסט חלופי באופן אוטומטי +pdfjs-editor-new-alt-text-not-now-button = לא כעת +pdfjs-editor-new-alt-text-error-title = לא ניתן היה ליצור טקסט חלופי באופן אוטומטי +pdfjs-editor-new-alt-text-error-description = נא לכתוב טקסט חלופי משלך או לנסות שוב מאוחר יותר. +pdfjs-editor-new-alt-text-error-close-button = סגירה +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = בתהליך הורדת מודל AI של טקסט חלופי ({ $downloadedSize } מתוך { $totalSize } מ״ב) + .aria-valuetext = בתהליך הורדת מודל AI של טקסט חלופי ({ $downloadedSize } מתוך { $totalSize } מ״ב) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = נוסף טקסט חלופי +pdfjs-editor-new-alt-text-added-button-label = נוסף טקסט חלופי +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = חסר טקסט חלופי +pdfjs-editor-new-alt-text-missing-button-label = חסר טקסט חלופי +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = סקירת טקסט חלופי +pdfjs-editor-new-alt-text-to-review-button-label = סקירת טקסט חלופי +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = נוצר באופן אוטומטי: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = הגדרות טקסט חלופי של תמונה +pdfjs-image-alt-text-settings-button-label = הגדרות טקסט חלופי של תמונה +pdfjs-editor-alt-text-settings-dialog-label = הגדרות טקסט חלופי של תמונה +pdfjs-editor-alt-text-settings-automatic-title = טקסט חלופי אוטומטי +pdfjs-editor-alt-text-settings-create-model-button-label = יצירת טקסט חלופי באופן אוטומטי +pdfjs-editor-alt-text-settings-create-model-description = הצעת תיאורים כדי לסייע לאנשים שאינם יכולים לראות את התמונה או כאשר התמונה אינה נטענת. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = מודל AI לטקסט חלופי ({ $totalSize } מ״ב) +pdfjs-editor-alt-text-settings-ai-model-description = פועל באופן מקומי במכשיר שלך כך שהנתונים שלך נשארים פרטיים. נדרש עבור טקסט חלופי אוטומטי. +pdfjs-editor-alt-text-settings-delete-model-button = מחיקה +pdfjs-editor-alt-text-settings-download-model-button = הורדה +pdfjs-editor-alt-text-settings-downloading-model-button = בהורדה… +pdfjs-editor-alt-text-settings-editor-title = עורך טקסט חלופי +pdfjs-editor-alt-text-settings-show-dialog-button-label = הצגת עורך טקסט חלופי מיד בעת הוספת תמונה +pdfjs-editor-alt-text-settings-show-dialog-description = מסייע לך לוודא שלכל התמונות שלך יש טקסט חלופי. +pdfjs-editor-alt-text-settings-close-button = סגירה + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = הסימון הוסר +pdfjs-editor-undo-bar-message-freetext = הטקסט הוסר +pdfjs-editor-undo-bar-message-ink = הציור הוסר +pdfjs-editor-undo-bar-message-stamp = התמונה הוסרה +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = + { $count -> + [one] הערה אחת הוסרה + *[other] { $count } הערות הוסרו + } +pdfjs-editor-undo-bar-undo-button = + .title = ביטול פעולה +pdfjs-editor-undo-bar-undo-button-label = ביטול פעלה +pdfjs-editor-undo-bar-close-button = + .title = סגירה +pdfjs-editor-undo-bar-close-button-label = סגירה diff --git a/public/pdfjs/web/locale/hi-IN/viewer.ftl b/public/pdfjs/web/locale/hi-IN/viewer.ftl new file mode 100644 index 0000000..b6f378f --- /dev/null +++ b/public/pdfjs/web/locale/hi-IN/viewer.ftl @@ -0,0 +1,267 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = पिछला पृष्ठ +pdfjs-previous-button-label = पिछला +pdfjs-next-button = + .title = अगला पृष्ठ +pdfjs-next-button-label = आगे +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = पृष्ठ: +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = { $pagesCount } का +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } of { $pagesCount }) +pdfjs-zoom-out-button = + .title = छोटा करें +pdfjs-zoom-out-button-label = छोटा करें +pdfjs-zoom-in-button = + .title = बड़ा करें +pdfjs-zoom-in-button-label = बड़ा करें +pdfjs-zoom-select = + .title = बड़ा-छोटा करें +pdfjs-presentation-mode-button = + .title = प्रस्तुति अवस्था में जाएँ +pdfjs-presentation-mode-button-label = प्रस्तुति अवस्था +pdfjs-open-file-button = + .title = फ़ाइल खोलें +pdfjs-open-file-button-label = खोलें +pdfjs-print-button = + .title = छापें +pdfjs-print-button-label = छापें + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = औज़ार +pdfjs-tools-button-label = औज़ार +pdfjs-first-page-button = + .title = प्रथम पृष्ठ पर जाएँ +pdfjs-first-page-button-label = प्रथम पृष्ठ पर जाएँ +pdfjs-last-page-button = + .title = अंतिम पृष्ठ पर जाएँ +pdfjs-last-page-button-label = अंतिम पृष्ठ पर जाएँ +pdfjs-page-rotate-cw-button = + .title = घड़ी की दिशा में घुमाएँ +pdfjs-page-rotate-cw-button-label = घड़ी की दिशा में घुमाएँ +pdfjs-page-rotate-ccw-button = + .title = घड़ी की दिशा से उल्टा घुमाएँ +pdfjs-page-rotate-ccw-button-label = घड़ी की दिशा से उल्टा घुमाएँ +pdfjs-cursor-text-select-tool-button = + .title = पाठ चयन उपकरण सक्षम करें +pdfjs-cursor-text-select-tool-button-label = पाठ चयन उपकरण +pdfjs-cursor-hand-tool-button = + .title = हस्त उपकरण सक्षम करें +pdfjs-cursor-hand-tool-button-label = हस्त उपकरण +pdfjs-scroll-vertical-button = + .title = लंबवत स्क्रॉलिंग का उपयोग करें +pdfjs-scroll-vertical-button-label = लंबवत स्क्रॉलिंग +pdfjs-scroll-horizontal-button = + .title = क्षितिजिय स्क्रॉलिंग का उपयोग करें +pdfjs-scroll-horizontal-button-label = क्षितिजिय स्क्रॉलिंग +pdfjs-scroll-wrapped-button = + .title = व्राप्पेड स्क्रॉलिंग का उपयोग करें +pdfjs-spread-none-button-label = कोई स्प्रेड उपलब्ध नहीं +pdfjs-spread-odd-button = + .title = विषम-क्रमांकित पृष्ठों से प्रारंभ होने वाले पृष्ठ स्प्रेड में शामिल हों +pdfjs-spread-odd-button-label = विषम फैलाव + +## Document properties dialog + +pdfjs-document-properties-button = + .title = दस्तावेज़ विशेषता... +pdfjs-document-properties-button-label = दस्तावेज़ विशेषता... +pdfjs-document-properties-file-name = फ़ाइल नाम: +pdfjs-document-properties-file-size = फाइल आकारः +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bytes) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bytes) +pdfjs-document-properties-title = शीर्षक: +pdfjs-document-properties-author = लेखकः +pdfjs-document-properties-subject = विषय: +pdfjs-document-properties-keywords = कुंजी-शब्द: +pdfjs-document-properties-creation-date = निर्माण दिनांक: +pdfjs-document-properties-modification-date = संशोधन दिनांक: +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = निर्माता: +pdfjs-document-properties-producer = PDF उत्पादक: +pdfjs-document-properties-version = PDF संस्करण: +pdfjs-document-properties-page-count = पृष्ठ गिनती: +pdfjs-document-properties-page-size = पृष्ठ आकार: +pdfjs-document-properties-page-size-unit-inches = इंच +pdfjs-document-properties-page-size-unit-millimeters = मिमी +pdfjs-document-properties-page-size-orientation-portrait = पोर्ट्रेट +pdfjs-document-properties-page-size-orientation-landscape = लैंडस्केप +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = पत्र +pdfjs-document-properties-page-size-name-legal = क़ानूनी + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = तीव्र वेब व्यू: +pdfjs-document-properties-linearized-yes = हाँ +pdfjs-document-properties-linearized-no = नहीं +pdfjs-document-properties-close-button = बंद करें + +## Print + +pdfjs-print-progress-message = छपाई के लिए दस्तावेज़ को तैयार किया जा रहा है... +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = रद्द करें +pdfjs-printing-not-supported = चेतावनी: इस ब्राउज़र पर छपाई पूरी तरह से समर्थित नहीं है. +pdfjs-printing-not-ready = चेतावनी: PDF छपाई के लिए पूरी तरह से लोड नहीं है. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = स्लाइडर टॉगल करें +pdfjs-toggle-sidebar-button-label = स्लाइडर टॉगल करें +pdfjs-document-outline-button = + .title = दस्तावेज़ की रूपरेखा दिखाइए (सारी वस्तुओं को फलने अथवा समेटने के लिए दो बार क्लिक करें) +pdfjs-document-outline-button-label = दस्तावेज़ आउटलाइन +pdfjs-attachments-button = + .title = संलग्नक दिखायें +pdfjs-attachments-button-label = संलग्नक +pdfjs-thumbs-button = + .title = लघुछवियाँ दिखाएँ +pdfjs-thumbs-button-label = लघु छवि +pdfjs-findbar-button = + .title = दस्तावेज़ में ढूँढ़ें +pdfjs-findbar-button-label = ढूँढें + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = पृष्ठ { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = पृष्ठ { $page } की लघु-छवि + +## Find panel button title and messages + +pdfjs-find-input = + .title = ढूँढें + .placeholder = दस्तावेज़ में खोजें... +pdfjs-find-previous-button = + .title = वाक्यांश की पिछली उपस्थिति ढूँढ़ें +pdfjs-find-previous-button-label = पिछला +pdfjs-find-next-button = + .title = वाक्यांश की अगली उपस्थिति ढूँढ़ें +pdfjs-find-next-button-label = अगला +pdfjs-find-highlight-checkbox = सभी आलोकित करें +pdfjs-find-match-case-checkbox-label = मिलान स्थिति +pdfjs-find-entire-word-checkbox-label = संपूर्ण शब्द +pdfjs-find-reached-top = पृष्ठ के ऊपर पहुंच गया, नीचे से जारी रखें +pdfjs-find-reached-bottom = पृष्ठ के नीचे में जा पहुँचा, ऊपर से जारी +pdfjs-find-not-found = वाक्यांश नहीं मिला + +## Predefined zoom values + +pdfjs-page-scale-width = पृष्ठ चौड़ाई +pdfjs-page-scale-fit = पृष्ठ फिट +pdfjs-page-scale-auto = स्वचालित जूम +pdfjs-page-scale-actual = वास्तविक आकार +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + + +## Loading indicator messages + +pdfjs-loading-error = PDF लोड करते समय एक त्रुटि हुई. +pdfjs-invalid-file-error = अमान्य या भ्रष्ट PDF फ़ाइल. +pdfjs-missing-file-error = अनुपस्थित PDF फ़ाइल. +pdfjs-unexpected-response-error = अप्रत्याशित सर्वर प्रतिक्रिया. +pdfjs-rendering-error = पृष्ठ रेंडरिंग के दौरान त्रुटि आई. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } Annotation] + +## Password + +pdfjs-password-label = इस PDF फ़ाइल को खोलने के लिए कृपया कूटशब्द भरें. +pdfjs-password-invalid = अवैध कूटशब्द, कृपया फिर कोशिश करें. +pdfjs-password-ok-button = OK +pdfjs-password-cancel-button = रद्द करें +pdfjs-web-fonts-disabled = वेब फॉन्ट्स निष्क्रिय हैं: अंतःस्थापित PDF फॉन्टस के उपयोग में असमर्थ. + +## Editing + + +## Remove button for the various kind of editor. + + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = रंग + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + + +## Color picker + + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + + +## Image alt-text settings + diff --git a/public/pdfjs/web/locale/hr/viewer.ftl b/public/pdfjs/web/locale/hr/viewer.ftl new file mode 100644 index 0000000..c081c6f --- /dev/null +++ b/public/pdfjs/web/locale/hr/viewer.ftl @@ -0,0 +1,473 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Prethodna stranica +pdfjs-previous-button-label = Prethodna +pdfjs-next-button = + .title = Sljedeća stranica +pdfjs-next-button-label = Sljedeća +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Stranica +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = od { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } od { $pagesCount }) +pdfjs-zoom-out-button = + .title = Umanji +pdfjs-zoom-out-button-label = Umanji +pdfjs-zoom-in-button = + .title = Uvećaj +pdfjs-zoom-in-button-label = Uvećaj +pdfjs-zoom-select = + .title = Zumiranje +pdfjs-presentation-mode-button = + .title = Prebaci u modus prezentacija +pdfjs-presentation-mode-button-label = Modus prezentacija +pdfjs-open-file-button = + .title = Otvori datoteku +pdfjs-open-file-button-label = Otvori +pdfjs-print-button = + .title = Ispiši +pdfjs-print-button-label = Ispiši +pdfjs-save-button = + .title = Spremi +pdfjs-save-button-label = Spremi +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Preuzimanja +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Preuzimanja +pdfjs-bookmark-button = + .title = Trenutna stranica (pogledajte URL s trenutne stranice) +pdfjs-bookmark-button-label = Trenutna stranica + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Alati +pdfjs-tools-button-label = Alati +pdfjs-first-page-button = + .title = Idi na prvu stranicu +pdfjs-first-page-button-label = Idi na prvu stranicu +pdfjs-last-page-button = + .title = Idi na posljednju stranicu +pdfjs-last-page-button-label = Idi na posljednju stranicu +pdfjs-page-rotate-cw-button = + .title = Rotiraj u smjeru kazaljke na satu +pdfjs-page-rotate-cw-button-label = Rotiraj u smjeru kazaljke na satu +pdfjs-page-rotate-ccw-button = + .title = Rotiraj obrnutno od smjera kazaljke na satu +pdfjs-page-rotate-ccw-button-label = Rotiraj obrnutno od smjera kazaljke na satu +pdfjs-cursor-text-select-tool-button = + .title = Aktiviraj alat za biranje teksta +pdfjs-cursor-text-select-tool-button-label = Alat za označavanje teksta +pdfjs-cursor-hand-tool-button = + .title = Aktiviraj ručni alat +pdfjs-cursor-hand-tool-button-label = Ručni alat +pdfjs-scroll-page-button = + .title = Koristi klizanje stranice +pdfjs-scroll-page-button-label = Klizanje stranice +pdfjs-scroll-vertical-button = + .title = Koristi okomito pomicanje +pdfjs-scroll-vertical-button-label = Okomito pomicanje +pdfjs-scroll-horizontal-button = + .title = Koristi vodoravno pomicanje +pdfjs-scroll-horizontal-button-label = Vodoravno pomicanje +pdfjs-scroll-wrapped-button = + .title = Koristi kontinuirani raspored stranica +pdfjs-scroll-wrapped-button-label = Kontinuirani raspored stranica +pdfjs-spread-none-button = + .title = Ne izrađuj duplerice +pdfjs-spread-none-button-label = Pojedinačne stranice +pdfjs-spread-odd-button = + .title = Izradi duplerice koje počinju s neparnim stranicama +pdfjs-spread-odd-button-label = Neparne duplerice +pdfjs-spread-even-button = + .title = Izradi duplerice koje počinju s parnim stranicama +pdfjs-spread-even-button-label = Parne duplerice + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Svojstva dokumenta … +pdfjs-document-properties-button-label = Svojstva dokumenta … +pdfjs-document-properties-file-name = Ime datoteke: +pdfjs-document-properties-file-size = Veličina datoteke: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } bajtova) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } bajtova) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bajtova) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bajtova) +pdfjs-document-properties-title = Naslov: +pdfjs-document-properties-author = Autor: +pdfjs-document-properties-subject = Predmet: +pdfjs-document-properties-keywords = Ključne riječi: +pdfjs-document-properties-creation-date = Datum stvaranja: +pdfjs-document-properties-modification-date = Datum promjene: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Stvaratelj: +pdfjs-document-properties-producer = PDF stvaratelj: +pdfjs-document-properties-version = PDF verzija: +pdfjs-document-properties-page-count = Broj stranica: +pdfjs-document-properties-page-size = Dimenzije stranice: +pdfjs-document-properties-page-size-unit-inches = in +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = uspravno +pdfjs-document-properties-page-size-orientation-landscape = položeno +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Letter +pdfjs-document-properties-page-size-name-legal = Legal + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Brzi web pregled: +pdfjs-document-properties-linearized-yes = Da +pdfjs-document-properties-linearized-no = Ne +pdfjs-document-properties-close-button = Zatvori + +## Print + +pdfjs-print-progress-message = Pripremanje dokumenta za ispis… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Odustani +pdfjs-printing-not-supported = Upozorenje: Ovaj preglednik ne podržava u potpunosti ispisivanje. +pdfjs-printing-not-ready = Upozorenje: PDF nije u potpunosti učitan za ispis. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Prikaži/sakrij bočnu traku +pdfjs-toggle-sidebar-notification-button = + .title = Prikazivanje i sklanjanje bočne trake (dokument sadrži strukturu/privitke/slojeve) +pdfjs-toggle-sidebar-button-label = Prikaži/sakrij bočnu traku +pdfjs-document-outline-button = + .title = Prikaži strukturu dokumenta (dvostruki klik za rasklapanje/sklapanje svih stavki) +pdfjs-document-outline-button-label = Struktura dokumenta +pdfjs-attachments-button = + .title = Prikaži privitke +pdfjs-attachments-button-label = Privitci +pdfjs-layers-button = + .title = Prikaži slojeve (dvoklik za vraćanje svih slojeva u standardno stanje) +pdfjs-layers-button-label = Slojevi +pdfjs-thumbs-button = + .title = Prikaži minijature +pdfjs-thumbs-button-label = Minijature +pdfjs-current-outline-item-button = + .title = Pronađi trenutačni element strukture +pdfjs-current-outline-item-button-label = Trenutačni element strukture +pdfjs-findbar-button = + .title = Pronađi u dokumentu +pdfjs-findbar-button-label = Pronađi +pdfjs-additional-layers = Dodatni slojevi + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Stranica { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Minijatura stranice { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Pronađi + .placeholder = Pronađi u dokumentu … +pdfjs-find-previous-button = + .title = Pronađi prethodno pojavljivanje ovog izraza +pdfjs-find-previous-button-label = Prethodno +pdfjs-find-next-button = + .title = Pronađi sljedeće pojavljivanje ovog izraza +pdfjs-find-next-button-label = Dalje +pdfjs-find-highlight-checkbox = Istankni sve +pdfjs-find-match-case-checkbox-label = Razlikovanje velikih i malih slova +pdfjs-find-match-diacritics-checkbox-label = Razlikuj dijakritičke znakove +pdfjs-find-entire-word-checkbox-label = Cijele riječi +pdfjs-find-reached-top = Dosegnut početak dokumenta, nastavak s kraja +pdfjs-find-reached-bottom = Dosegnut kraj dokumenta, nastavak s početka +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] { $current } od { $total } rezultata + [few] { $current } od { $total } rezultata + *[other] { $current } od { $total } rezultata + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] Više od { $limit } rezultat + [few] Više od { $limit } rezultata + *[other] Više od { $limit } rezultata + } +pdfjs-find-not-found = Izraz nije pronađen + +## Predefined zoom values + +pdfjs-page-scale-width = Prilagodi širini prozora +pdfjs-page-scale-fit = Prilagodi veličini prozora +pdfjs-page-scale-auto = Automatsko zumiranje +pdfjs-page-scale-actual = Stvarna veličina +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale } % + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Stranica { $page } + +## Loading indicator messages + +pdfjs-loading-error = Došlo je do greške pri učitavanju PDF-a. +pdfjs-invalid-file-error = Neispravna ili oštećena PDF datoteka. +pdfjs-missing-file-error = Nedostaje PDF datoteka. +pdfjs-unexpected-response-error = Neočekivani odgovor servera. +pdfjs-rendering-error = Došlo je do greške prilikom iscrtavanja stranice. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } Bilješka] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Za otvoranje ove PDF datoteku upiši lozinku. +pdfjs-password-invalid = Neispravna lozinka. Pokušaj ponovo. +pdfjs-password-ok-button = U redu +pdfjs-password-cancel-button = Odustani +pdfjs-web-fonts-disabled = Web fontovi su deaktivirani: nije moguće koristiti ugrađene PDF fontove. + +## Editing + +pdfjs-editor-free-text-button = + .title = Tekst +pdfjs-editor-free-text-button-label = Tekst +pdfjs-editor-ink-button = + .title = Crtanje +pdfjs-editor-ink-button-label = Crtanje +pdfjs-editor-stamp-button = + .title = Dodajte ili uredite slike +pdfjs-editor-stamp-button-label = Dodajte ili uredite slike +pdfjs-editor-highlight-button = + .title = Istakni +pdfjs-editor-highlight-button-label = Istakni +pdfjs-highlight-floating-button1 = + .title = Istakni + .aria-label = Istakni +pdfjs-highlight-floating-button-label = Istakni + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Ukloni crtež +pdfjs-editor-remove-freetext-button = + .title = Ukloni tekst +pdfjs-editor-remove-stamp-button = + .title = Ukloni sliku +pdfjs-editor-remove-highlight-button = + .title = Ukloni isticanje + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Boja +pdfjs-editor-free-text-size-input = Veličina +pdfjs-editor-ink-color-input = Boja +pdfjs-editor-ink-thickness-input = Debljina +pdfjs-editor-ink-opacity-input = Neprozirnost +pdfjs-editor-stamp-add-image-button = + .title = Dodaj sliku +pdfjs-editor-stamp-add-image-button-label = Dodaj sliku +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Debljina +pdfjs-editor-free-highlight-thickness-title = + .title = Promjeni debljinu pri isticanju drugih stavki osim teksta +pdfjs-free-text = + .aria-label = Uređivač teksta +pdfjs-free-text-default-content = Počni tipkati … +pdfjs-ink = + .aria-label = Uređivač crteža +pdfjs-ink-canvas = + .aria-label = Slika koju je izradio korisnik + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = Alternativni tekst +pdfjs-editor-alt-text-edit-button-label = Uredi alternativni tekst +pdfjs-editor-alt-text-dialog-label = Odaberi jednu opciju +pdfjs-editor-alt-text-dialog-description = Alternativni tekst pomaže slijepim osobama ili kada se slika ne učita. +pdfjs-editor-alt-text-add-description-label = Dodaj opis +pdfjs-editor-alt-text-add-description-description = Sažmi sadržaj predmeta, okruženje ili radnje u jednoj ili dvije rečenice. +pdfjs-editor-alt-text-mark-decorative-label = Označi kao ukrasno +pdfjs-editor-alt-text-mark-decorative-description = Ovo se koristi za ukrasne slike, poput rubova ili vodenih žigova. +pdfjs-editor-alt-text-cancel-button = Odustani +pdfjs-editor-alt-text-save-button = Spremi +pdfjs-editor-alt-text-decorative-tooltip = Označeno kao ukrasno +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = Na primjer, „Mladić sjeda za stol kako bi jeo” + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Gornji lijevi kut – promijeni veličinu +pdfjs-editor-resizer-label-top-middle = Sredina gore – promijeni veličinu +pdfjs-editor-resizer-label-top-right = Gornji desni kut – promijeni veličinu +pdfjs-editor-resizer-label-middle-right = Sredina desno – promijeni veličinu +pdfjs-editor-resizer-label-bottom-right = Donji desni kut – promijeni veličinu +pdfjs-editor-resizer-label-bottom-middle = Sredina dolje – promjeni veličinu +pdfjs-editor-resizer-label-bottom-left = Donji lijevi kut – promijeni veličinu +pdfjs-editor-resizer-label-middle-left = Sredina lijevo – promijeni veličinu +pdfjs-editor-resizer-top-left = + .aria-label = Gornji lijevi kut – promijeni veličinu +pdfjs-editor-resizer-top-middle = + .aria-label = Sredina gore – promijeni veličinu +pdfjs-editor-resizer-top-right = + .aria-label = Gornji desni kut – promijeni veličinu +pdfjs-editor-resizer-middle-right = + .aria-label = Sredina desno – promijeni veličinu +pdfjs-editor-resizer-bottom-right = + .aria-label = Donji desni kut – promijeni veličinu +pdfjs-editor-resizer-bottom-middle = + .aria-label = Sredina dolje – promjeni veličinu +pdfjs-editor-resizer-bottom-left = + .aria-label = Donji lijevi kut – promijeni veličinu +pdfjs-editor-resizer-middle-left = + .aria-label = Sredina lijevo – promijeni veličinu + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Boja isticanja +pdfjs-editor-colorpicker-button = + .title = Promjeni boju +pdfjs-editor-colorpicker-dropdown = + .aria-label = Izbor boja +pdfjs-editor-colorpicker-yellow = + .title = Žuta +pdfjs-editor-colorpicker-green = + .title = Zelena +pdfjs-editor-colorpicker-blue = + .title = Plava +pdfjs-editor-colorpicker-pink = + .title = Ružičasta +pdfjs-editor-colorpicker-red = + .title = Crvena + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Prikaži sve +pdfjs-editor-highlight-show-all-button = + .title = Prikaži sve + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +pdfjs-editor-new-alt-text-textarea = + .placeholder = Ovdje upiši tvoj opis … +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = Ovaj je alternativni tekst stvoren automatski i može biti netočan. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Saznaj više +pdfjs-editor-new-alt-text-create-automatically-button-label = Automatski stvori alternativni tekst +pdfjs-editor-new-alt-text-error-title = Nije bilo moguće automatski izraditi alternativni tekst +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = Preuzimanje alternativnog teksta UI modela ({ $downloadedSize } od { $totalSize } MB) + .aria-valuetext = Preuzimanje alternativnog teksta UI modela ({ $downloadedSize } od { $totalSize } MB) +pdfjs-editor-new-alt-text-added-button-label = Alternativni tekst je dodan +pdfjs-editor-new-alt-text-missing-button-label = Nedostaje alternativni tekst +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = Pregledaj alternativni tekst +pdfjs-editor-new-alt-text-to-review-button-label = Pregledaj alternativni tekst +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Stvoreno automatski: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = Postavke alternativnog teksta slike +pdfjs-image-alt-text-settings-button-label = Postavke alternativnog teksta slike +pdfjs-editor-alt-text-settings-dialog-label = Postavke alternativnog teksta slike +pdfjs-editor-alt-text-settings-automatic-title = Automatski alternativni tekst +pdfjs-editor-alt-text-settings-create-model-button-label = Stvori alternativni tekst automatski +pdfjs-editor-alt-text-settings-create-model-description = Predlaže opise koji pomažu osobama koji ne mogu vidjeti sliku ili kada se slika ne učita. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = Alternativni tekst UI modela ({ $totalSize } MB) +pdfjs-editor-alt-text-settings-ai-model-description = Radi lokalno na tvom uređaju kako bi tvoji podaci ostali privatni. Potrebno za automatski alternativni tekst. +pdfjs-editor-alt-text-settings-delete-model-button = Izbriši +pdfjs-editor-alt-text-settings-download-model-button = Preuzmi +pdfjs-editor-alt-text-settings-downloading-model-button = Preuzimanje … +pdfjs-editor-alt-text-settings-editor-title = Uređivač alternativnog teksta +pdfjs-editor-alt-text-settings-show-dialog-button-label = Prikaži uređivač alternativnog teksta odmah pri dodavanju slike +pdfjs-editor-alt-text-settings-show-dialog-description = Pomaže osigurati da sve tvoje slike imaju alternativni tekst. +pdfjs-editor-alt-text-settings-close-button = Zatvori diff --git a/public/pdfjs/web/locale/hsb/viewer.ftl b/public/pdfjs/web/locale/hsb/viewer.ftl new file mode 100644 index 0000000..065ab8d --- /dev/null +++ b/public/pdfjs/web/locale/hsb/viewer.ftl @@ -0,0 +1,521 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Předchadna strona +pdfjs-previous-button-label = Wróćo +pdfjs-next-button = + .title = Přichodna strona +pdfjs-next-button-label = Dale +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Strona +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = z { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } z { $pagesCount }) +pdfjs-zoom-out-button = + .title = Pomjeńšić +pdfjs-zoom-out-button-label = Pomjeńšić +pdfjs-zoom-in-button = + .title = Powjetšić +pdfjs-zoom-in-button-label = Powjetšić +pdfjs-zoom-select = + .title = Skalowanje +pdfjs-presentation-mode-button = + .title = Do prezentaciskeho modusa přeńć +pdfjs-presentation-mode-button-label = Prezentaciski modus +pdfjs-open-file-button = + .title = Dataju wočinić +pdfjs-open-file-button-label = Wočinić +pdfjs-print-button = + .title = Ćišćeć +pdfjs-print-button-label = Ćišćeć +pdfjs-save-button = + .title = Składować +pdfjs-save-button-label = Składować +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Sćahnyć +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Sćahnyć +pdfjs-bookmark-button = + .title = Aktualna strona (URL z aktualneje strony pokazać) +pdfjs-bookmark-button-label = Aktualna strona + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Nastroje +pdfjs-tools-button-label = Nastroje +pdfjs-first-page-button = + .title = K prěnjej stronje +pdfjs-first-page-button-label = K prěnjej stronje +pdfjs-last-page-button = + .title = K poslednjej stronje +pdfjs-last-page-button-label = K poslednjej stronje +pdfjs-page-rotate-cw-button = + .title = K směrej časnika wjerćeć +pdfjs-page-rotate-cw-button-label = K směrej časnika wjerćeć +pdfjs-page-rotate-ccw-button = + .title = Přećiwo směrej časnika wjerćeć +pdfjs-page-rotate-ccw-button-label = Přećiwo směrej časnika wjerćeć +pdfjs-cursor-text-select-tool-button = + .title = Nastroj za wuběranje teksta zmóžnić +pdfjs-cursor-text-select-tool-button-label = Nastroj za wuběranje teksta +pdfjs-cursor-hand-tool-button = + .title = Ručny nastroj zmóžnić +pdfjs-cursor-hand-tool-button-label = Ručny nastroj +pdfjs-scroll-page-button = + .title = Kulenje strony wužiwać +pdfjs-scroll-page-button-label = Kulenje strony +pdfjs-scroll-vertical-button = + .title = Wertikalne suwanje wužiwać +pdfjs-scroll-vertical-button-label = Wertikalne suwanje +pdfjs-scroll-horizontal-button = + .title = Horicontalne suwanje wužiwać +pdfjs-scroll-horizontal-button-label = Horicontalne suwanje +pdfjs-scroll-wrapped-button = + .title = Postupne suwanje wužiwać +pdfjs-scroll-wrapped-button-label = Postupne suwanje +pdfjs-spread-none-button = + .title = Strony njezwjazać +pdfjs-spread-none-button-label = Žana dwójna strona +pdfjs-spread-odd-button = + .title = Strony započinajo z njerunymi stronami zwjazać +pdfjs-spread-odd-button-label = Njerune strony +pdfjs-spread-even-button = + .title = Strony započinajo z runymi stronami zwjazać +pdfjs-spread-even-button-label = Rune strony + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Dokumentowe kajkosće… +pdfjs-document-properties-button-label = Dokumentowe kajkosće… +pdfjs-document-properties-file-name = Mjeno dataje: +pdfjs-document-properties-file-size = Wulkosć dataje: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } bajtow) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } bajtow) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bajtow) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bajtow) +pdfjs-document-properties-title = Titul: +pdfjs-document-properties-author = Awtor: +pdfjs-document-properties-subject = Předmjet: +pdfjs-document-properties-keywords = Klučowe słowa: +pdfjs-document-properties-creation-date = Datum wutworjenja: +pdfjs-document-properties-modification-date = Datum změny: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Awtor: +pdfjs-document-properties-producer = PDF-zhotowjer: +pdfjs-document-properties-version = PDF-wersija: +pdfjs-document-properties-page-count = Ličba stronow: +pdfjs-document-properties-page-size = Wulkosć strony: +pdfjs-document-properties-page-size-unit-inches = cól +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = wysoki format +pdfjs-document-properties-page-size-orientation-landscape = prěčny format +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Letter +pdfjs-document-properties-page-size-name-legal = Legal + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Fast Web View: +pdfjs-document-properties-linearized-yes = Haj +pdfjs-document-properties-linearized-no = Ně +pdfjs-document-properties-close-button = Začinić + +## Print + +pdfjs-print-progress-message = Dokument so za ćišćenje přihotuje… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Přetorhnyć +pdfjs-printing-not-supported = Warnowanje: Ćišćenje so přez tutón wobhladowak połnje njepodpěruje. +pdfjs-printing-not-ready = Warnowanje: PDF njeje so za ćišćenje dospołnje začitał. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Bóčnicu pokazać/schować +pdfjs-toggle-sidebar-notification-button = + .title = Bóčnicu přepinać (dokument rozrjad/přiwěški/woršty wobsahuje) +pdfjs-toggle-sidebar-button-label = Bóčnicu pokazać/schować +pdfjs-document-outline-button = + .title = Dokumentowy naćisk pokazać (dwójne kliknjenje, zo bychu so wšě zapiski pokazali/schowali) +pdfjs-document-outline-button-label = Dokumentowa struktura +pdfjs-attachments-button = + .title = Přiwěški pokazać +pdfjs-attachments-button-label = Přiwěški +pdfjs-layers-button = + .title = Woršty pokazać (klikńće dwójce, zo byšće wšě woršty na standardny staw wróćo stajił) +pdfjs-layers-button-label = Woršty +pdfjs-thumbs-button = + .title = Miniatury pokazać +pdfjs-thumbs-button-label = Miniatury +pdfjs-current-outline-item-button = + .title = Aktualny rozrjadowy zapisk pytać +pdfjs-current-outline-item-button-label = Aktualny rozrjadowy zapisk +pdfjs-findbar-button = + .title = W dokumenće pytać +pdfjs-findbar-button-label = Pytać +pdfjs-additional-layers = Dalše woršty + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Strona { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Miniatura strony { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Pytać + .placeholder = W dokumenće pytać… +pdfjs-find-previous-button = + .title = Předchadne wustupowanje pytanskeho wuraza pytać +pdfjs-find-previous-button-label = Wróćo +pdfjs-find-next-button = + .title = Přichodne wustupowanje pytanskeho wuraza pytać +pdfjs-find-next-button-label = Dale +pdfjs-find-highlight-checkbox = Wšě wuzběhnyć +pdfjs-find-match-case-checkbox-label = Wulkopisanje wobkedźbować +pdfjs-find-match-diacritics-checkbox-label = Diakritiske znamješka wužiwać +pdfjs-find-entire-word-checkbox-label = Cyłe słowa +pdfjs-find-reached-top = Spočatk dokumenta docpěty, pokročuje so z kóncom +pdfjs-find-reached-bottom = Kónc dokument docpěty, pokročuje so ze spočatkom +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] { $current } z { $total } wotpowědnika + [two] { $current } z { $total } wotpowědnikow + [few] { $current } z { $total } wotpowědnikow + *[other] { $current } z { $total } wotpowědnikow + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] Wyše { $limit } wotpowědnik + [two] Wyše { $limit } wotpowědnikaj + [few] Wyše { $limit } wotpowědniki + *[other] Wyše { $limit } wotpowědnikow + } +pdfjs-find-not-found = Pytanski wuraz njeje so namakał + +## Predefined zoom values + +pdfjs-page-scale-width = Šěrokosć strony +pdfjs-page-scale-fit = Wulkosć strony +pdfjs-page-scale-auto = Awtomatiske skalowanje +pdfjs-page-scale-actual = Aktualna wulkosć +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Strona { $page } + +## Loading indicator messages + +pdfjs-loading-error = Při začitowanju PDF je zmylk wustupił. +pdfjs-invalid-file-error = Njepłaćiwa abo wobškodźena PDF-dataja. +pdfjs-missing-file-error = Falowaca PDF-dataja. +pdfjs-unexpected-response-error = Njewočakowana serwerowa wotmołwa. +pdfjs-rendering-error = Při zwobraznjenju strony je zmylk wustupił. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [Typ přispomnjenki: { $type }] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Zapodajće hesło, zo byšće PDF-dataju wočinił. +pdfjs-password-invalid = Njepłaćiwe hesło. Prošu spytajće hišće raz. +pdfjs-password-ok-button = W porjadku +pdfjs-password-cancel-button = Přetorhnyć +pdfjs-web-fonts-disabled = Webpisma su znjemóžnjene: njeje móžno, zasadźene PDF-pisma wužiwać. + +## Editing + +pdfjs-editor-free-text-button = + .title = Tekst +pdfjs-editor-free-text-button-label = Tekst +pdfjs-editor-ink-button = + .title = Rysować +pdfjs-editor-ink-button-label = Rysować +pdfjs-editor-stamp-button = + .title = Wobrazy přidać abo wobdźěłać +pdfjs-editor-stamp-button-label = Wobrazy přidać abo wobdźěłać +pdfjs-editor-highlight-button = + .title = Wuzběhnyć +pdfjs-editor-highlight-button-label = Wuzběhnyć +pdfjs-highlight-floating-button1 = + .title = Wuzběhnjenje + .aria-label = Wuzběhnjenje +pdfjs-highlight-floating-button-label = Wuzběhnjenje + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Rysowanku wotstronić +pdfjs-editor-remove-freetext-button = + .title = Tekst wotstronić +pdfjs-editor-remove-stamp-button = + .title = Wobraz wotstronić +pdfjs-editor-remove-highlight-button = + .title = Wuzběhnjenje wotstronić + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Barba +pdfjs-editor-free-text-size-input = Wulkosć +pdfjs-editor-ink-color-input = Barba +pdfjs-editor-ink-thickness-input = Tołstosć +pdfjs-editor-ink-opacity-input = Opacita +pdfjs-editor-stamp-add-image-button = + .title = Wobraz přidać +pdfjs-editor-stamp-add-image-button-label = Wobraz přidać +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Tołstosć +pdfjs-editor-free-highlight-thickness-title = + .title = Tołstosć změnić, hdyž so zapiski wuzběhuja, kotrež tekst njejsu +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = Tekstowy editor + .default-content = Započńće pisać … +pdfjs-free-text = + .aria-label = Tekstowy editor +pdfjs-free-text-default-content = Započńće pisać… +pdfjs-ink = + .aria-label = Rysowanski editor +pdfjs-ink-canvas = + .aria-label = Wobraz wutworjeny wot wužiwarja + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = Alternatiwny tekst +pdfjs-editor-alt-text-edit-button = + .aria-label = Alternatiwny tekst wobdźěłać +pdfjs-editor-alt-text-edit-button-label = Alternatiwny tekst wobdźěłać +pdfjs-editor-alt-text-dialog-label = Nastajenje wubrać +pdfjs-editor-alt-text-dialog-description = Alternatiwny tekst pomha, hdyž ludźo njemóža wobraz widźeć abo hdyž so wobraz njezačita. +pdfjs-editor-alt-text-add-description-label = Wopisanje přidać +pdfjs-editor-alt-text-add-description-description = Pisajće 1 sadu abo 2 sadźe, kotrejž temu, nastajenje abo akcije wopisujetej. +pdfjs-editor-alt-text-mark-decorative-label = Jako dekoratiwny markěrować +pdfjs-editor-alt-text-mark-decorative-description = To so za pyšace wobrazy wužiwa, na přikład ramiki abo wodowe znamjenja. +pdfjs-editor-alt-text-cancel-button = Přetorhnyć +pdfjs-editor-alt-text-save-button = Składować +pdfjs-editor-alt-text-decorative-tooltip = Jako dekoratiwny markěrowany +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = Na přikład, „Młody muž za blidom sedźi, zo by jědź jědł“ +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = Alternatiwny tekst + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Horjeka nalěwo – wulkosć změnić +pdfjs-editor-resizer-label-top-middle = Horjeka wosrjedź – wulkosć změnić +pdfjs-editor-resizer-label-top-right = Horjeka naprawo – wulkosć změnić +pdfjs-editor-resizer-label-middle-right = Wosrjedź naprawo – wulkosć změnić +pdfjs-editor-resizer-label-bottom-right = Deleka naprawo – wulkosć změnić +pdfjs-editor-resizer-label-bottom-middle = Deleka wosrjedź – wulkosć změnić +pdfjs-editor-resizer-label-bottom-left = Deleka nalěwo – wulkosć změnić +pdfjs-editor-resizer-label-middle-left = Wosrjedź nalěwo – wulkosć změnić +pdfjs-editor-resizer-top-left = + .aria-label = Horjeka nalěwo – wulkosć změnić +pdfjs-editor-resizer-top-middle = + .aria-label = Horjeka wosrjedź – wulkosć změnić +pdfjs-editor-resizer-top-right = + .aria-label = Horjeka naprawo – wulkosć změnić +pdfjs-editor-resizer-middle-right = + .aria-label = Wosrjedź naprawo – wulkosć změnić +pdfjs-editor-resizer-bottom-right = + .aria-label = Deleka naprawo – wulkosć změnić +pdfjs-editor-resizer-bottom-middle = + .aria-label = Deleka wosrjedź – wulkosć změnić +pdfjs-editor-resizer-bottom-left = + .aria-label = Deleka nalěwo – wulkosć změnić +pdfjs-editor-resizer-middle-left = + .aria-label = Wosrjedź nalěwo – wulkosć změnić + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Barba wuzběhnjenja +pdfjs-editor-colorpicker-button = + .title = Barbu změnić +pdfjs-editor-colorpicker-dropdown = + .aria-label = Wuběr barbow +pdfjs-editor-colorpicker-yellow = + .title = Žołty +pdfjs-editor-colorpicker-green = + .title = Zeleny +pdfjs-editor-colorpicker-blue = + .title = Módry +pdfjs-editor-colorpicker-pink = + .title = Pink +pdfjs-editor-colorpicker-red = + .title = Čerwjeny + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Wšě pokazać +pdfjs-editor-highlight-show-all-button = + .title = Wšě pokazać + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = Alternatiwny tekst wobdźěłać (wobrazowe wopisanje) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = Alternatiwny tekst přidać (wobrazowe wopisanje) +pdfjs-editor-new-alt-text-textarea = + .placeholder = Pisajće tu swoje wopisanje… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = Krótke wopisanje za ludźi, kotřiž njemóžeće wobraz widźeć abo hdyž so wobraz njezačita. +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = Tutón alternatiwny tekst je so awtomatisce wutworił a je snano njedokładny. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Dalše informacije +pdfjs-editor-new-alt-text-create-automatically-button-label = Alternatiwny tekst awtomatisce wutworić +pdfjs-editor-new-alt-text-not-now-button = Nic nětko +pdfjs-editor-new-alt-text-error-title = Alternatiwny tekst njeda so awtomatisce wutworić +pdfjs-editor-new-alt-text-error-description = Prošu pisajće swój alternatiwny tekst abo spytajće pozdźišo hišće raz. +pdfjs-editor-new-alt-text-error-close-button = Začinić +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = Model KI za alternatiwny tekst so sćahuje ({ $downloadedSize } z { $totalSize } MB) + .aria-valuetext = Model KI za alternatiwny tekst so sćahuje ({ $downloadedSize } z { $totalSize } MB) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = Alternatiwny tekst je so přidał +pdfjs-editor-new-alt-text-added-button-label = Alternatiwny tekst je so přidał +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = Alternatiwny tekst faluje +pdfjs-editor-new-alt-text-missing-button-label = Alternatiwny tekst faluje +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = Alternatiwny tekst přepruwować +pdfjs-editor-new-alt-text-to-review-button-label = Alternatiwny tekst přepruwować +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Awtomatisce wutworjeny: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = Nastajenja alternatiwneho wobrazoweho teksta +pdfjs-image-alt-text-settings-button-label = Nastajenja alternatiwneho wobrazoweho teksta +pdfjs-editor-alt-text-settings-dialog-label = Nastajenja alternatiwneho wobrazoweho teksta +pdfjs-editor-alt-text-settings-automatic-title = Awtomatiski alternatiwny tekst +pdfjs-editor-alt-text-settings-create-model-button-label = Alternatiwny tekst awtomatisce wutworić +pdfjs-editor-alt-text-settings-create-model-description = Namjetuje wopisanja, zo by ludźom pomhał, kotřiž njemóžeće wobraz widźeć abo hdyž so wobraz njezačita. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = Model KI alternatiwneho teksta ({ $totalSize } MB) +pdfjs-editor-alt-text-settings-ai-model-description = Běži lokalnje na wašim graće, zo bychu waše daty priwatne wostali. Za awtomatiski alternatiwny tekst trěbny. +pdfjs-editor-alt-text-settings-delete-model-button = Zhašeć +pdfjs-editor-alt-text-settings-download-model-button = Sćahnyć +pdfjs-editor-alt-text-settings-downloading-model-button = Sćahuje so… +pdfjs-editor-alt-text-settings-editor-title = Editor za alternatiwny tekst +pdfjs-editor-alt-text-settings-show-dialog-button-label = Editor alternatiwneho teksta hnydom pokazać, hdyž so wobraz přidawa +pdfjs-editor-alt-text-settings-show-dialog-description = Pomha, wam wšěm swojim wobrazam alternatiwny tekst přidać. +pdfjs-editor-alt-text-settings-close-button = Začinić + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = Wotstronjene wuzběhnyć +pdfjs-editor-undo-bar-message-freetext = Tekst je so wotstronił +pdfjs-editor-undo-bar-message-ink = Rysowanka je so wotstroniła +pdfjs-editor-undo-bar-message-stamp = Wobraz je so wotstronił +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = + { $count -> + [one] { $count } přispomnjenka je so wotstroniła + [two] { $count } přispomnjence stej so wotstroniłoj + [few] { $count } přispomnjenki su so wotstronili + *[other] { $count } přispomnjenkow je so wotstroniło + } +pdfjs-editor-undo-bar-undo-button = + .title = Cofnyć +pdfjs-editor-undo-bar-undo-button-label = Cofnyć +pdfjs-editor-undo-bar-close-button = + .title = Začinić +pdfjs-editor-undo-bar-close-button-label = Začinić diff --git a/public/pdfjs/web/locale/hu/viewer.ftl b/public/pdfjs/web/locale/hu/viewer.ftl new file mode 100644 index 0000000..76307a2 --- /dev/null +++ b/public/pdfjs/web/locale/hu/viewer.ftl @@ -0,0 +1,515 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Előző oldal +pdfjs-previous-button-label = Előző +pdfjs-next-button = + .title = Következő oldal +pdfjs-next-button-label = Tovább +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Oldal +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = összesen: { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } / { $pagesCount }) +pdfjs-zoom-out-button = + .title = Kicsinyítés +pdfjs-zoom-out-button-label = Kicsinyítés +pdfjs-zoom-in-button = + .title = Nagyítás +pdfjs-zoom-in-button-label = Nagyítás +pdfjs-zoom-select = + .title = Nagyítás +pdfjs-presentation-mode-button = + .title = Váltás bemutató módba +pdfjs-presentation-mode-button-label = Bemutató mód +pdfjs-open-file-button = + .title = Fájl megnyitása +pdfjs-open-file-button-label = Megnyitás +pdfjs-print-button = + .title = Nyomtatás +pdfjs-print-button-label = Nyomtatás +pdfjs-save-button = + .title = Mentés +pdfjs-save-button-label = Mentés +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Letöltés +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Letöltés +pdfjs-bookmark-button = + .title = Jelenlegi oldal (webcím megtekintése a jelenlegi oldalról) +pdfjs-bookmark-button-label = Jelenlegi oldal + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Eszközök +pdfjs-tools-button-label = Eszközök +pdfjs-first-page-button = + .title = Ugrás az első oldalra +pdfjs-first-page-button-label = Ugrás az első oldalra +pdfjs-last-page-button = + .title = Ugrás az utolsó oldalra +pdfjs-last-page-button-label = Ugrás az utolsó oldalra +pdfjs-page-rotate-cw-button = + .title = Forgatás az óramutató járásával egyezően +pdfjs-page-rotate-cw-button-label = Forgatás az óramutató járásával egyezően +pdfjs-page-rotate-ccw-button = + .title = Forgatás az óramutató járásával ellentétesen +pdfjs-page-rotate-ccw-button-label = Forgatás az óramutató járásával ellentétesen +pdfjs-cursor-text-select-tool-button = + .title = Szövegkijelölő eszköz bekapcsolása +pdfjs-cursor-text-select-tool-button-label = Szövegkijelölő eszköz +pdfjs-cursor-hand-tool-button = + .title = Kéz eszköz bekapcsolása +pdfjs-cursor-hand-tool-button-label = Kéz eszköz +pdfjs-scroll-page-button = + .title = Oldalgörgetés használata +pdfjs-scroll-page-button-label = Oldalgörgetés +pdfjs-scroll-vertical-button = + .title = Függőleges görgetés használata +pdfjs-scroll-vertical-button-label = Függőleges görgetés +pdfjs-scroll-horizontal-button = + .title = Vízszintes görgetés használata +pdfjs-scroll-horizontal-button-label = Vízszintes görgetés +pdfjs-scroll-wrapped-button = + .title = Rácsos elrendezés használata +pdfjs-scroll-wrapped-button-label = Rácsos elrendezés +pdfjs-spread-none-button = + .title = Ne tapassza össze az oldalakat +pdfjs-spread-none-button-label = Nincs összetapasztás +pdfjs-spread-odd-button = + .title = Lapok összetapasztása, a páratlan számú oldalakkal kezdve +pdfjs-spread-odd-button-label = Összetapasztás: páratlan +pdfjs-spread-even-button = + .title = Lapok összetapasztása, a páros számú oldalakkal kezdve +pdfjs-spread-even-button-label = Összetapasztás: páros + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Dokumentum tulajdonságai… +pdfjs-document-properties-button-label = Dokumentum tulajdonságai… +pdfjs-document-properties-file-name = Fájlnév: +pdfjs-document-properties-file-size = Fájlméret: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } kB ({ $b } bájt) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } bájt) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bájt) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bájt) +pdfjs-document-properties-title = Cím: +pdfjs-document-properties-author = Szerző: +pdfjs-document-properties-subject = Tárgy: +pdfjs-document-properties-keywords = Kulcsszavak: +pdfjs-document-properties-creation-date = Létrehozás dátuma: +pdfjs-document-properties-modification-date = Módosítás dátuma: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Létrehozta: +pdfjs-document-properties-producer = PDF előállító: +pdfjs-document-properties-version = PDF verzió: +pdfjs-document-properties-page-count = Oldalszám: +pdfjs-document-properties-page-size = Lapméret: +pdfjs-document-properties-page-size-unit-inches = in +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = álló +pdfjs-document-properties-page-size-orientation-landscape = fekvő +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Letter +pdfjs-document-properties-page-size-name-legal = Jogi információk + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Gyors webes nézet: +pdfjs-document-properties-linearized-yes = Igen +pdfjs-document-properties-linearized-no = Nem +pdfjs-document-properties-close-button = Bezárás + +## Print + +pdfjs-print-progress-message = Dokumentum előkészítése nyomtatáshoz… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Mégse +pdfjs-printing-not-supported = Figyelmeztetés: Ez a böngésző nem teljesen támogatja a nyomtatást. +pdfjs-printing-not-ready = Figyelmeztetés: A PDF nincs teljesen betöltve a nyomtatáshoz. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Oldalsáv be/ki +pdfjs-toggle-sidebar-notification-button = + .title = Oldalsáv be/ki (a dokumentum vázlatot/mellékleteket/rétegeket tartalmaz) +pdfjs-toggle-sidebar-button-label = Oldalsáv be/ki +pdfjs-document-outline-button = + .title = Dokumentum megjelenítése online (dupla kattintás minden elem kinyitásához/összecsukásához) +pdfjs-document-outline-button-label = Dokumentumvázlat +pdfjs-attachments-button = + .title = Mellékletek megjelenítése +pdfjs-attachments-button-label = Van melléklet +pdfjs-layers-button = + .title = Rétegek megjelenítése (dupla kattintás az összes réteg alapértelmezett állapotra visszaállításához) +pdfjs-layers-button-label = Rétegek +pdfjs-thumbs-button = + .title = Bélyegképek megjelenítése +pdfjs-thumbs-button-label = Bélyegképek +pdfjs-current-outline-item-button = + .title = Jelenlegi vázlatelem megkeresése +pdfjs-current-outline-item-button-label = Jelenlegi vázlatelem +pdfjs-findbar-button = + .title = Keresés a dokumentumban +pdfjs-findbar-button-label = Keresés +pdfjs-additional-layers = További rétegek + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = { $page }. oldal +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = { $page }. oldal bélyegképe + +## Find panel button title and messages + +pdfjs-find-input = + .title = Keresés + .placeholder = Keresés a dokumentumban… +pdfjs-find-previous-button = + .title = A kifejezés előző előfordulásának keresése +pdfjs-find-previous-button-label = Előző +pdfjs-find-next-button = + .title = A kifejezés következő előfordulásának keresése +pdfjs-find-next-button-label = Tovább +pdfjs-find-highlight-checkbox = Összes kiemelése +pdfjs-find-match-case-checkbox-label = Kis- és nagybetűk megkülönböztetése +pdfjs-find-match-diacritics-checkbox-label = Diakritikus jelek +pdfjs-find-entire-word-checkbox-label = Teljes szavak +pdfjs-find-reached-top = A dokumentum eleje elérve, folytatás a végétől +pdfjs-find-reached-bottom = A dokumentum vége elérve, folytatás az elejétől +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] { $current } / { $total } találat + *[other] { $current } / { $total } találat + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] Több mint { $limit } találat + *[other] Több mint { $limit } találat + } +pdfjs-find-not-found = A kifejezés nem található + +## Predefined zoom values + +pdfjs-page-scale-width = Oldalszélesség +pdfjs-page-scale-fit = Teljes oldal +pdfjs-page-scale-auto = Automatikus nagyítás +pdfjs-page-scale-actual = Valódi méret +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = { $page }. oldal + +## Loading indicator messages + +pdfjs-loading-error = Hiba történt a PDF betöltésekor. +pdfjs-invalid-file-error = Érvénytelen vagy sérült PDF fájl. +pdfjs-missing-file-error = Hiányzó PDF fájl. +pdfjs-unexpected-response-error = Váratlan kiszolgálóválasz. +pdfjs-rendering-error = Hiba történt az oldal feldolgozása közben. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } megjegyzés] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Adja meg a jelszót a PDF fájl megnyitásához. +pdfjs-password-invalid = Helytelen jelszó. Próbálja újra. +pdfjs-password-ok-button = OK +pdfjs-password-cancel-button = Mégse +pdfjs-web-fonts-disabled = Webes betűkészletek letiltva: nem használhatók a beágyazott PDF betűkészletek. + +## Editing + +pdfjs-editor-free-text-button = + .title = Szöveg +pdfjs-editor-free-text-button-label = Szöveg +pdfjs-editor-ink-button = + .title = Rajzolás +pdfjs-editor-ink-button-label = Rajzolás +pdfjs-editor-stamp-button = + .title = Képek hozzáadása vagy szerkesztése +pdfjs-editor-stamp-button-label = Képek hozzáadása vagy szerkesztése +pdfjs-editor-highlight-button = + .title = Kiemelés +pdfjs-editor-highlight-button-label = Kiemelés +pdfjs-highlight-floating-button1 = + .title = Kiemelés + .aria-label = Kiemelés +pdfjs-highlight-floating-button-label = Kiemelés + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Rajz eltávolítása +pdfjs-editor-remove-freetext-button = + .title = Szöveg eltávolítása +pdfjs-editor-remove-stamp-button = + .title = Kép eltávolítása +pdfjs-editor-remove-highlight-button = + .title = Kiemelés eltávolítása + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Szín +pdfjs-editor-free-text-size-input = Méret +pdfjs-editor-ink-color-input = Szín +pdfjs-editor-ink-thickness-input = Vastagság +pdfjs-editor-ink-opacity-input = Átlátszatlanság +pdfjs-editor-stamp-add-image-button = + .title = Kép hozzáadása +pdfjs-editor-stamp-add-image-button-label = Kép hozzáadása +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Vastagság +pdfjs-editor-free-highlight-thickness-title = + .title = Vastagság módosítása, ha nem szöveges elemeket emel ki +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = Szövegszerkesztő + .default-content = Kezdjen gépelni… +pdfjs-free-text = + .aria-label = Szövegszerkesztő +pdfjs-free-text-default-content = Kezdjen el gépelni… +pdfjs-ink = + .aria-label = Rajzszerkesztő +pdfjs-ink-canvas = + .aria-label = Felhasználó által készített kép + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = Alternatív szöveg +pdfjs-editor-alt-text-edit-button = + .aria-label = Alternatív szöveg szerkesztése +pdfjs-editor-alt-text-edit-button-label = Alternatív szöveg szerkesztése +pdfjs-editor-alt-text-dialog-label = Válasszon egy lehetőséget +pdfjs-editor-alt-text-dialog-description = Az alternatív szöveg segít, ha az emberek nem látják a képet, vagy ha az nem töltődik be. +pdfjs-editor-alt-text-add-description-label = Leírás hozzáadása +pdfjs-editor-alt-text-add-description-description = Törekedjen 1-2 mondatra, amely jellemzi a témát, környezetet vagy cselekvést. +pdfjs-editor-alt-text-mark-decorative-label = Megjelölés dekoratívként +pdfjs-editor-alt-text-mark-decorative-description = Ez a díszítőképeknél használatos, mint a szegélyek vagy a vízjelek. +pdfjs-editor-alt-text-cancel-button = Mégse +pdfjs-editor-alt-text-save-button = Mentés +pdfjs-editor-alt-text-decorative-tooltip = Megjelölve dekoratívként +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = Például: „Egy fiatal férfi leül enni egy asztalhoz” +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = Alternatív szöveg + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Bal felső sarok – átméretezés +pdfjs-editor-resizer-label-top-middle = Felül középen – átméretezés +pdfjs-editor-resizer-label-top-right = Jobb felső sarok – átméretezés +pdfjs-editor-resizer-label-middle-right = Jobbra középen – átméretezés +pdfjs-editor-resizer-label-bottom-right = Jobb alsó sarok – átméretezés +pdfjs-editor-resizer-label-bottom-middle = Alul középen – átméretezés +pdfjs-editor-resizer-label-bottom-left = Bal alsó sarok – átméretezés +pdfjs-editor-resizer-label-middle-left = Balra középen – átméretezés +pdfjs-editor-resizer-top-left = + .aria-label = Bal felső sarok – átméretezés +pdfjs-editor-resizer-top-middle = + .aria-label = Felül középen – átméretezés +pdfjs-editor-resizer-top-right = + .aria-label = Jobb felső sarok – átméretezés +pdfjs-editor-resizer-middle-right = + .aria-label = Jobbra középen – átméretezés +pdfjs-editor-resizer-bottom-right = + .aria-label = Jobb alsó sarok – átméretezés +pdfjs-editor-resizer-bottom-middle = + .aria-label = Alul középen – átméretezés +pdfjs-editor-resizer-bottom-left = + .aria-label = Bal alsó sarok – átméretezés +pdfjs-editor-resizer-middle-left = + .aria-label = Balra középen – átméretezés + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Kiemelés színe +pdfjs-editor-colorpicker-button = + .title = Szín módosítása +pdfjs-editor-colorpicker-dropdown = + .aria-label = Színválasztások +pdfjs-editor-colorpicker-yellow = + .title = Sárga +pdfjs-editor-colorpicker-green = + .title = Zöld +pdfjs-editor-colorpicker-blue = + .title = Kék +pdfjs-editor-colorpicker-pink = + .title = Rózsaszín +pdfjs-editor-colorpicker-red = + .title = Vörös + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Összes megjelenítése +pdfjs-editor-highlight-show-all-button = + .title = Összes megjelenítése + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = Alternatív szöveg szerkesztése (képleírás) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = Alternatív szöveg hozzáadása (képleírás) +pdfjs-editor-new-alt-text-textarea = + .placeholder = Írja ide a leírását… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = Rövid leírás azoknak, akik nem látják a képet, vagy arra az esetre, ha a kép nem tölt be. +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = Ez az alternatív szöveg automatikusan lett létrehozva, és pontatlan lehet. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = További tudnivalók +pdfjs-editor-new-alt-text-create-automatically-button-label = Alternatív szöveg automatikus létrehozása +pdfjs-editor-new-alt-text-not-now-button = Most nem +pdfjs-editor-new-alt-text-error-title = Az alternatív szöveg automatikus létrehozása nem sikerült +pdfjs-editor-new-alt-text-error-description = Írja meg a saját alternatív szövegét, vagy próbálja újra később. +pdfjs-editor-new-alt-text-error-close-button = Bezárás +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = Alternatív szöveg MI modell letöltése ({ $downloadedSize } / { $totalSize } MB) + .aria-valuetext = Alternatív szöveg MI modell letöltése ({ $downloadedSize } / { $totalSize } MB) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = Alternatív szöveg hozzáadva +pdfjs-editor-new-alt-text-added-button-label = Alternatív szöveg hozzáadva +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = Hiányzó alternatív szöveg +pdfjs-editor-new-alt-text-missing-button-label = Hiányzó alternatív szöveg +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = Alternatív szöveg áttekintése +pdfjs-editor-new-alt-text-to-review-button-label = Alternatív szöveg szerkesztése +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Automatikusan létrehozva: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = Kép alternatív szövegének beállításai +pdfjs-image-alt-text-settings-button-label = Kép alternatív szövegének beállításai +pdfjs-editor-alt-text-settings-dialog-label = Kép alternatív szövegének beállításai +pdfjs-editor-alt-text-settings-automatic-title = Automatikus alternatív szöveg +pdfjs-editor-alt-text-settings-create-model-button-label = Alternatív szöveg automatikus létrehozása +pdfjs-editor-alt-text-settings-create-model-description = Leírásokat javasol, hogy segítsen azoknak, akik nem látják a képet, vagy arra az esetre, ha a kép nem tölt be. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = Alternatív szöveg MI modellje ({ $totalSize } MB) +pdfjs-editor-alt-text-settings-ai-model-description = Helyben fut az eszközén, így az adatai privátok maradnak. Az automatikus alternatív szövegekhez szükséges. +pdfjs-editor-alt-text-settings-delete-model-button = Törlés +pdfjs-editor-alt-text-settings-download-model-button = Letöltés +pdfjs-editor-alt-text-settings-downloading-model-button = Letöltés… +pdfjs-editor-alt-text-settings-editor-title = Alternatív szöveg szerkesztője +pdfjs-editor-alt-text-settings-show-dialog-button-label = Az alternatív szöveg szerkesztőjének azonnali megjelenítése egy kép hozzáadásakor +pdfjs-editor-alt-text-settings-show-dialog-description = Segít elérni, hogy az összes képén legyen alternatív szöveg. +pdfjs-editor-alt-text-settings-close-button = Bezárás + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = Kiemelés eltávolítva +pdfjs-editor-undo-bar-message-freetext = Szöveg eltávolítva +pdfjs-editor-undo-bar-message-ink = Rajz eltávolítva +pdfjs-editor-undo-bar-message-stamp = Kép eltávolítva +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = + { $count -> + [one] { $count } kommentár eltávolítva + *[other] { $count } kommentár eltávolítva + } +pdfjs-editor-undo-bar-undo-button = + .title = Visszavonás +pdfjs-editor-undo-bar-undo-button-label = Visszavonás +pdfjs-editor-undo-bar-close-button = + .title = Bezárás +pdfjs-editor-undo-bar-close-button-label = Bezárás diff --git a/public/pdfjs/web/locale/hy-AM/viewer.ftl b/public/pdfjs/web/locale/hy-AM/viewer.ftl new file mode 100644 index 0000000..5c9dd27 --- /dev/null +++ b/public/pdfjs/web/locale/hy-AM/viewer.ftl @@ -0,0 +1,272 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Նախորդ էջը +pdfjs-previous-button-label = Նախորդը +pdfjs-next-button = + .title = Հաջորդ էջը +pdfjs-next-button-label = Հաջորդը +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Էջ. +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = -ը՝ { $pagesCount }-ից +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber }-ը { $pagesCount })-ից +pdfjs-zoom-out-button = + .title = Փոքրացնել +pdfjs-zoom-out-button-label = Փոքրացնել +pdfjs-zoom-in-button = + .title = Խոշորացնել +pdfjs-zoom-in-button-label = Խոշորացնել +pdfjs-zoom-select = + .title = Դիտափոխում +pdfjs-presentation-mode-button = + .title = Անցնել Ներկայացման եղանակին +pdfjs-presentation-mode-button-label = Ներկայացման եղանակ +pdfjs-open-file-button = + .title = Բացել նիշք +pdfjs-open-file-button-label = Բացել +pdfjs-print-button = + .title = Տպել +pdfjs-print-button-label = Տպել +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Ներբեռնել +pdfjs-bookmark-button-label = Ընթացիկ էջ + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Գործիքներ +pdfjs-tools-button-label = Գործիքներ +pdfjs-first-page-button = + .title = Անցնել առաջին էջին +pdfjs-first-page-button-label = Անցնել առաջին էջին +pdfjs-last-page-button = + .title = Անցնել վերջին էջին +pdfjs-last-page-button-label = Անցնել վերջին էջին +pdfjs-page-rotate-cw-button = + .title = Պտտել ըստ ժամացույցի սլաքի +pdfjs-page-rotate-cw-button-label = Պտտել ըստ ժամացույցի սլաքի +pdfjs-page-rotate-ccw-button = + .title = Պտտել հակառակ ժամացույցի սլաքի +pdfjs-page-rotate-ccw-button-label = Պտտել հակառակ ժամացույցի սլաքի +pdfjs-cursor-text-select-tool-button = + .title = Միացնել գրույթ ընտրելու գործիքը +pdfjs-cursor-text-select-tool-button-label = Գրույթը ընտրելու գործիք +pdfjs-cursor-hand-tool-button = + .title = Միացնել Ձեռքի գործիքը +pdfjs-cursor-hand-tool-button-label = Ձեռքի գործիք +pdfjs-scroll-vertical-button = + .title = Օգտագործել ուղղահայաց ոլորում +pdfjs-scroll-vertical-button-label = Ուղղահայաց ոլորում +pdfjs-scroll-horizontal-button = + .title = Օգտագործել հորիզոնական ոլորում +pdfjs-scroll-horizontal-button-label = Հորիզոնական ոլորում +pdfjs-scroll-wrapped-button = + .title = Օգտագործել փաթաթված ոլորում +pdfjs-scroll-wrapped-button-label = Փաթաթված ոլորում +pdfjs-spread-none-button = + .title = Մի միացեք էջի վերածածկերին +pdfjs-spread-none-button-label = Չկա վերածածկեր +pdfjs-spread-odd-button = + .title = Միացեք էջի վերածածկերին սկսելով՝ կենտ համարակալված էջերով +pdfjs-spread-odd-button-label = Կենտ վերածածկեր +pdfjs-spread-even-button = + .title = Միացեք էջի վերածածկերին սկսելով՝ զույգ համարակալված էջերով +pdfjs-spread-even-button-label = Զույգ վերածածկեր + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Փաստաթղթի հատկությունները… +pdfjs-document-properties-button-label = Փաստաթղթի հատկությունները… +pdfjs-document-properties-file-name = Նիշքի անունը. +pdfjs-document-properties-file-size = Նիշք չափը. +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } ԿԲ ({ $size_b } բայթ) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } ՄԲ ({ $size_b } բայթ) +pdfjs-document-properties-title = Վերնագիր. +pdfjs-document-properties-author = Հեղինակ․ +pdfjs-document-properties-subject = Վերնագիր. +pdfjs-document-properties-keywords = Հիմնաբառ. +pdfjs-document-properties-creation-date = Ստեղծելու ամսաթիվը. +pdfjs-document-properties-modification-date = Փոփոխելու ամսաթիվը. +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Ստեղծող. +pdfjs-document-properties-producer = PDF-ի հեղինակը. +pdfjs-document-properties-version = PDF-ի տարբերակը. +pdfjs-document-properties-page-count = Էջերի քանակը. +pdfjs-document-properties-page-size = Էջի չափը. +pdfjs-document-properties-page-size-unit-inches = ում +pdfjs-document-properties-page-size-unit-millimeters = մմ +pdfjs-document-properties-page-size-orientation-portrait = ուղղաձիգ +pdfjs-document-properties-page-size-orientation-landscape = հորիզոնական +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Նամակ +pdfjs-document-properties-page-size-name-legal = Օրինական + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Արագ վեբ դիտում․ +pdfjs-document-properties-linearized-yes = Այո +pdfjs-document-properties-linearized-no = Ոչ +pdfjs-document-properties-close-button = Փակել + +## Print + +pdfjs-print-progress-message = Նախապատրաստում է փաստաթուղթը տպելուն... +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Չեղարկել +pdfjs-printing-not-supported = Զգուշացում. Տպելը ամբողջությամբ չի աջակցվում դիտարկիչի կողմից։ +pdfjs-printing-not-ready = Զգուշացում. PDF-ը ամբողջությամբ չի բեռնավորվել տպելու համար: + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Բացել/Փակել Կողային վահանակը +pdfjs-toggle-sidebar-button-label = Բացել/Փակել Կողային վահանակը +pdfjs-document-outline-button = + .title = Ցուցադրել փաստաթղթի ուրվագիծը (կրկնակի սեղմեք՝ միավորները ընդարձակելու/կոծկելու համար) +pdfjs-document-outline-button-label = Փաստաթղթի բովանդակությունը +pdfjs-attachments-button = + .title = Ցուցադրել կցորդները +pdfjs-attachments-button-label = Կցորդներ +pdfjs-thumbs-button = + .title = Ցուցադրել Մանրապատկերը +pdfjs-thumbs-button-label = Մանրապատկերը +pdfjs-findbar-button = + .title = Գտնել փաստաթղթում +pdfjs-findbar-button-label = Որոնում + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Էջը { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Էջի մանրապատկերը { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Որոնում + .placeholder = Գտնել փաստաթղթում... +pdfjs-find-previous-button = + .title = Գտնել անրահայտության նախորդ հանդիպումը +pdfjs-find-previous-button-label = Նախորդը +pdfjs-find-next-button = + .title = Գտիր արտահայտության հաջորդ հանդիպումը +pdfjs-find-next-button-label = Հաջորդը +pdfjs-find-highlight-checkbox = Գունանշել բոլորը +pdfjs-find-match-case-checkbox-label = Մեծ(փոքր)ատառ հաշվի առնել +pdfjs-find-entire-word-checkbox-label = Ամբողջ բառերը +pdfjs-find-reached-top = Հասել եք փաստաթղթի վերևին, կշարունակվի ներքևից +pdfjs-find-reached-bottom = Հասել եք փաստաթղթի վերջին, կշարունակվի վերևից +pdfjs-find-not-found = Արտահայտությունը չգտնվեց + +## Predefined zoom values + +pdfjs-page-scale-width = Էջի լայնքը +pdfjs-page-scale-fit = Ձգել էջը +pdfjs-page-scale-auto = Ինքնաշխատ +pdfjs-page-scale-actual = Իրական չափը +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + + +## Loading indicator messages + +pdfjs-loading-error = Սխալ՝ PDF ֆայլը բացելիս։ +pdfjs-invalid-file-error = Սխալ կամ վնասված PDF ֆայլ: +pdfjs-missing-file-error = PDF ֆայլը բացակայում է: +pdfjs-unexpected-response-error = Սպասարկիչի անսպասելի պատասխան: +pdfjs-rendering-error = Սխալ՝ էջը ստեղծելիս: + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } Ծանոթություն] + +## Password + +pdfjs-password-label = Մուտքագրեք PDF-ի գաղտնաբառը: +pdfjs-password-invalid = Գաղտնաբառը սխալ է: Կրկին փորձեք: +pdfjs-password-ok-button = Լավ +pdfjs-password-cancel-button = Չեղարկել +pdfjs-web-fonts-disabled = Վեբ-տառատեսակները անջատված են. հնարավոր չէ օգտագործել ներկառուցված PDF տառատեսակները: + +## Editing + + +## Remove button for the various kind of editor. + + +## + +pdfjs-free-text-default-content = Սկսել մուտքագրումը… + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + + +## Color picker + + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Ցուցադրել բոլորը +pdfjs-editor-highlight-show-all-button = + .title = Ցուցադրել բոլորը diff --git a/public/pdfjs/web/locale/hye/viewer.ftl b/public/pdfjs/web/locale/hye/viewer.ftl new file mode 100644 index 0000000..75cdc06 --- /dev/null +++ b/public/pdfjs/web/locale/hye/viewer.ftl @@ -0,0 +1,268 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Նախորդ էջ +pdfjs-previous-button-label = Նախորդը +pdfjs-next-button = + .title = Յաջորդ էջ +pdfjs-next-button-label = Յաջորդը +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = էջ +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = { $pagesCount }-ից +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber }-ը { $pagesCount })-ից +pdfjs-zoom-out-button = + .title = Փոքրացնել +pdfjs-zoom-out-button-label = Փոքրացնել +pdfjs-zoom-in-button = + .title = Խոշորացնել +pdfjs-zoom-in-button-label = Խոշորացնել +pdfjs-zoom-select = + .title = Խոշորացում +pdfjs-presentation-mode-button = + .title = Անցնել ներկայացման եղանակին +pdfjs-presentation-mode-button-label = Ներկայացման եղանակ +pdfjs-open-file-button = + .title = Բացել նիշքը +pdfjs-open-file-button-label = Բացել +pdfjs-print-button = + .title = Տպել +pdfjs-print-button-label = Տպել + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Գործիքներ +pdfjs-tools-button-label = Գործիքներ +pdfjs-first-page-button = + .title = Գնալ դէպի առաջին էջ +pdfjs-first-page-button-label = Գնալ դէպի առաջին էջ +pdfjs-last-page-button = + .title = Գնալ դէպի վերջին էջ +pdfjs-last-page-button-label = Գնալ դէպի վերջին էջ +pdfjs-page-rotate-cw-button = + .title = Պտտել ժամացոյցի սլաքի ուղղութեամբ +pdfjs-page-rotate-cw-button-label = Պտտել ժամացոյցի սլաքի ուղղութեամբ +pdfjs-page-rotate-ccw-button = + .title = Պտտել ժամացոյցի սլաքի հակառակ ուղղութեամբ +pdfjs-page-rotate-ccw-button-label = Պտտել ժամացոյցի սլաքի հակառակ ուղղութեամբ +pdfjs-cursor-text-select-tool-button = + .title = Միացնել գրոյթ ընտրելու գործիքը +pdfjs-cursor-text-select-tool-button-label = Գրուածք ընտրելու գործիք +pdfjs-cursor-hand-tool-button = + .title = Միացնել ձեռքի գործիքը +pdfjs-cursor-hand-tool-button-label = Ձեռքի գործիք +pdfjs-scroll-page-button = + .title = Աւգտագործել էջի ոլորում +pdfjs-scroll-page-button-label = Էջի ոլորում +pdfjs-scroll-vertical-button = + .title = Աւգտագործել ուղղահայեաց ոլորում +pdfjs-scroll-vertical-button-label = Ուղղահայեաց ոլորում +pdfjs-scroll-horizontal-button = + .title = Աւգտագործել հորիզոնական ոլորում +pdfjs-scroll-horizontal-button-label = Հորիզոնական ոլորում +pdfjs-scroll-wrapped-button = + .title = Աւգտագործել փաթաթուած ոլորում +pdfjs-scroll-wrapped-button-label = Փաթաթուած ոլորում +pdfjs-spread-none-button = + .title = Մի միացէք էջի կոնտեքստում +pdfjs-spread-none-button-label = Չկայ կոնտեքստ +pdfjs-spread-odd-button = + .title = Միացէք էջի կոնտեքստին սկսելով՝ կենտ համարակալուած էջերով +pdfjs-spread-odd-button-label = Տարաւրինակ կոնտեքստ +pdfjs-spread-even-button = + .title = Միացէք էջի կոնտեքստին սկսելով՝ զոյգ համարակալուած էջերով +pdfjs-spread-even-button-label = Հաւասար վերածածկեր + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Փաստաթղթի հատկութիւնները… +pdfjs-document-properties-button-label = Փաստաթղթի յատկութիւնները… +pdfjs-document-properties-file-name = Նիշքի անունը․ +pdfjs-document-properties-file-size = Նիշք չափը. +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } ԿԲ ({ $size_b } բայթ) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } ՄԲ ({ $size_b } բայթ) +pdfjs-document-properties-title = Վերնագիր +pdfjs-document-properties-author = Հեղինակ․ +pdfjs-document-properties-subject = առարկայ +pdfjs-document-properties-keywords = Հիմնաբառեր +pdfjs-document-properties-creation-date = Ստեղծման ամսաթիւ +pdfjs-document-properties-modification-date = Փոփոխութեան ամսաթիւ. +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Ստեղծող +pdfjs-document-properties-producer = PDF-ի Արտադրողը. +pdfjs-document-properties-version = PDF-ի տարբերակը. +pdfjs-document-properties-page-count = Էջերի քանակը. +pdfjs-document-properties-page-size = Էջի չափը. +pdfjs-document-properties-page-size-unit-inches = ում +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = ուղղաձիգ +pdfjs-document-properties-page-size-orientation-landscape = հորիզոնական +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Նամակ +pdfjs-document-properties-page-size-name-legal = Աւրինական + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Արագ վեբ դիտում․ +pdfjs-document-properties-linearized-yes = Այո +pdfjs-document-properties-linearized-no = Ոչ +pdfjs-document-properties-close-button = Փակել + +## Print + +pdfjs-print-progress-message = Նախապատրաստում է փաստաթուղթը տպելուն… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Չեղարկել +pdfjs-printing-not-supported = Զգուշացում. Տպելը ամբողջութեամբ չի աջակցուում զննարկիչի կողմից։ +pdfjs-printing-not-ready = Զգուշացում. PDF֊ը ամբողջութեամբ չի բեռնաւորուել տպելու համար։ + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Փոխարկել կողային վահանակը +pdfjs-toggle-sidebar-notification-button = + .title = Փոխանջատել կողմնասիւնը (փաստաթուղթը պարունակում է ուրուագիծ/կցորդներ/շերտեր) +pdfjs-toggle-sidebar-button-label = Փոխարկել կողային վահանակը +pdfjs-document-outline-button = + .title = Ցուցադրել փաստաթղթի ուրուագիծը (կրկնակի սեղմէք՝ միաւորները ընդարձակելու/կոծկելու համար) +pdfjs-document-outline-button-label = Փաստաթղթի ուրուագիծ +pdfjs-attachments-button = + .title = Ցուցադրել կցորդները +pdfjs-attachments-button-label = Կցորդներ +pdfjs-layers-button = + .title = Ցուցադրել շերտերը (կրկնահպել վերակայելու բոլոր շերտերը սկզբնադիր վիճակի) +pdfjs-layers-button-label = Շերտեր +pdfjs-thumbs-button = + .title = Ցուցադրել մանրապատկերը +pdfjs-thumbs-button-label = Մանրապատկեր +pdfjs-current-outline-item-button = + .title = Գտէք ընթացիկ գծագրման տարրը +pdfjs-current-outline-item-button-label = Ընթացիկ գծագրման տարր +pdfjs-findbar-button = + .title = Գտնել փաստաթղթում +pdfjs-findbar-button-label = Որոնում +pdfjs-additional-layers = Լրացուցիչ շերտեր + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Էջը { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Էջի մանրապատկերը { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Որոնում + .placeholder = Գտնել փաստաթղթում… +pdfjs-find-previous-button = + .title = Գտնել արտայայտութեան նախորդ արտայայտութիւնը +pdfjs-find-previous-button-label = Նախորդը +pdfjs-find-next-button = + .title = Գտիր արտայայտութեան յաջորդ արտայայտութիւնը +pdfjs-find-next-button-label = Հաջորդը +pdfjs-find-highlight-checkbox = Գունանշել բոլորը +pdfjs-find-match-case-checkbox-label = Հաշուի առնել հանգամանքը +pdfjs-find-match-diacritics-checkbox-label = Հնչիւնատարբերիչ նշանների համապատասխանեցում +pdfjs-find-entire-word-checkbox-label = Ամբողջ բառերը +pdfjs-find-reached-top = Հասել եք փաստաթղթի վերեւին,շարունակել ներքեւից +pdfjs-find-reached-bottom = Հասել էք փաստաթղթի վերջին, շարունակել վերեւից +pdfjs-find-not-found = Արտայայտութիւնը չգտնուեց + +## Predefined zoom values + +pdfjs-page-scale-width = Էջի լայնութիւն +pdfjs-page-scale-fit = Հարմարեցնել էջը +pdfjs-page-scale-auto = Ինքնաշխատ խոշորացում +pdfjs-page-scale-actual = Իրական չափը +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Էջ { $page } + +## Loading indicator messages + +pdfjs-loading-error = PDF նիշքը բացելիս սխալ է տեղի ունեցել։ +pdfjs-invalid-file-error = Սխալ կամ վնասուած PDF նիշք։ +pdfjs-missing-file-error = PDF նիշքը բացակաիւմ է։ +pdfjs-unexpected-response-error = Սպասարկիչի անսպասելի պատասխան։ +pdfjs-rendering-error = Սխալ է տեղի ունեցել էջի մեկնաբանման ժամանակ + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } Ծանոթութիւն] + +## Password + +pdfjs-password-label = Մուտքագրէք գաղտնաբառը այս PDF նիշքը բացելու համար +pdfjs-password-invalid = Գաղտնաբառը սխալ է: Կրկին փորձէք: +pdfjs-password-ok-button = Լաւ +pdfjs-password-cancel-button = Չեղարկել +pdfjs-web-fonts-disabled = Վեբ-տառատեսակները անջատուած են. հնարաւոր չէ աւգտագործել ներկառուցուած PDF տառատեսակները։ + +## Editing + + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + diff --git a/public/pdfjs/web/locale/ia/viewer.ftl b/public/pdfjs/web/locale/ia/viewer.ftl new file mode 100644 index 0000000..91fbaf9 --- /dev/null +++ b/public/pdfjs/web/locale/ia/viewer.ftl @@ -0,0 +1,515 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Pagina previe +pdfjs-previous-button-label = Previe +pdfjs-next-button = + .title = Pagina sequente +pdfjs-next-button-label = Sequente +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Pagina +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = de { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } de { $pagesCount }) +pdfjs-zoom-out-button = + .title = Distantiar +pdfjs-zoom-out-button-label = Distantiar +pdfjs-zoom-in-button = + .title = Approximar +pdfjs-zoom-in-button-label = Approximar +pdfjs-zoom-select = + .title = Zoom +pdfjs-presentation-mode-button = + .title = Excambiar a modo presentation +pdfjs-presentation-mode-button-label = Modo presentation +pdfjs-open-file-button = + .title = Aperir le file +pdfjs-open-file-button-label = Aperir +pdfjs-print-button = + .title = Imprimer +pdfjs-print-button-label = Imprimer +pdfjs-save-button = + .title = Salvar +pdfjs-save-button-label = Salvar +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Discargar +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Discargar +pdfjs-bookmark-button = + .title = Pagina actual (vide le URL del pagina actual) +pdfjs-bookmark-button-label = Pagina actual + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Instrumentos +pdfjs-tools-button-label = Instrumentos +pdfjs-first-page-button = + .title = Ir al prime pagina +pdfjs-first-page-button-label = Ir al prime pagina +pdfjs-last-page-button = + .title = Ir al ultime pagina +pdfjs-last-page-button-label = Ir al ultime pagina +pdfjs-page-rotate-cw-button = + .title = Rotar in senso horari +pdfjs-page-rotate-cw-button-label = Rotar in senso horari +pdfjs-page-rotate-ccw-button = + .title = Rotar in senso antihorari +pdfjs-page-rotate-ccw-button-label = Rotar in senso antihorari +pdfjs-cursor-text-select-tool-button = + .title = Activar le instrumento de selection de texto +pdfjs-cursor-text-select-tool-button-label = Instrumento de selection de texto +pdfjs-cursor-hand-tool-button = + .title = Activar le instrumento mano +pdfjs-cursor-hand-tool-button-label = Instrumento mano +pdfjs-scroll-page-button = + .title = Usar rolamento de pagina +pdfjs-scroll-page-button-label = Rolamento de pagina +pdfjs-scroll-vertical-button = + .title = Usar rolamento vertical +pdfjs-scroll-vertical-button-label = Rolamento vertical +pdfjs-scroll-horizontal-button = + .title = Usar rolamento horizontal +pdfjs-scroll-horizontal-button-label = Rolamento horizontal +pdfjs-scroll-wrapped-button = + .title = Usar rolamento incapsulate +pdfjs-scroll-wrapped-button-label = Rolamento incapsulate +pdfjs-spread-none-button = + .title = Non junger paginas dual +pdfjs-spread-none-button-label = Sin paginas dual +pdfjs-spread-odd-button = + .title = Junger paginas dual a partir de paginas con numeros impar +pdfjs-spread-odd-button-label = Paginas dual impar +pdfjs-spread-even-button = + .title = Junger paginas dual a partir de paginas con numeros par +pdfjs-spread-even-button-label = Paginas dual par + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Proprietates del documento… +pdfjs-document-properties-button-label = Proprietates del documento… +pdfjs-document-properties-file-name = Nomine del file: +pdfjs-document-properties-file-size = Dimension de file: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } bytes) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } bytes) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bytes) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bytes) +pdfjs-document-properties-title = Titulo: +pdfjs-document-properties-author = Autor: +pdfjs-document-properties-subject = Subjecto: +pdfjs-document-properties-keywords = Parolas clave: +pdfjs-document-properties-creation-date = Data de creation: +pdfjs-document-properties-modification-date = Data de modification: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Creator: +pdfjs-document-properties-producer = Productor PDF: +pdfjs-document-properties-version = Version PDF: +pdfjs-document-properties-page-count = Numero de paginas: +pdfjs-document-properties-page-size = Dimension del pagina: +pdfjs-document-properties-page-size-unit-inches = in +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = vertical +pdfjs-document-properties-page-size-orientation-landscape = horizontal +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Littera +pdfjs-document-properties-page-size-name-legal = Legal + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Vista web rapide: +pdfjs-document-properties-linearized-yes = Si +pdfjs-document-properties-linearized-no = No +pdfjs-document-properties-close-button = Clauder + +## Print + +pdfjs-print-progress-message = Preparation del documento pro le impression… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Cancellar +pdfjs-printing-not-supported = Attention : le impression non es totalmente supportate per ce navigator. +pdfjs-printing-not-ready = Attention: le file PDF non es integremente cargate pro lo poter imprimer. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Monstrar/celar le barra lateral +pdfjs-toggle-sidebar-notification-button = + .title = Monstrar/celar le barra lateral (le documento contine structura/attachamentos/stratos) +pdfjs-toggle-sidebar-button-label = Monstrar/celar le barra lateral +pdfjs-document-outline-button = + .title = Monstrar le schema del documento (clic duple pro expander/contraher tote le elementos) +pdfjs-document-outline-button-label = Schema del documento +pdfjs-attachments-button = + .title = Monstrar le annexos +pdfjs-attachments-button-label = Annexos +pdfjs-layers-button = + .title = Monstrar stratos (clicca duple pro remontar tote le stratos al stato predefinite) +pdfjs-layers-button-label = Stratos +pdfjs-thumbs-button = + .title = Monstrar le vignettes +pdfjs-thumbs-button-label = Vignettes +pdfjs-current-outline-item-button = + .title = Trovar le elemento de structura actual +pdfjs-current-outline-item-button-label = Elemento de structura actual +pdfjs-findbar-button = + .title = Cercar in le documento +pdfjs-findbar-button-label = Cercar +pdfjs-additional-layers = Altere stratos + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Pagina { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Vignette del pagina { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Cercar + .placeholder = Cercar in le documento… +pdfjs-find-previous-button = + .title = Trovar le previe occurrentia del phrase +pdfjs-find-previous-button-label = Previe +pdfjs-find-next-button = + .title = Trovar le successive occurrentia del phrase +pdfjs-find-next-button-label = Sequente +pdfjs-find-highlight-checkbox = Evidentiar toto +pdfjs-find-match-case-checkbox-label = Distinguer majusculas/minusculas +pdfjs-find-match-diacritics-checkbox-label = Differentiar diacriticos +pdfjs-find-entire-word-checkbox-label = Parolas integre +pdfjs-find-reached-top = Initio del documento attingite, continuation ab fin +pdfjs-find-reached-bottom = Fin del documento attingite, continuation ab initio +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] { $current } de { $total } correspondentia + *[other] { $current } de { $total } correspondentias + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] Plus de { $limit } correspondentia + *[other] Plus de { $limit } correspondentias + } +pdfjs-find-not-found = Phrase non trovate + +## Predefined zoom values + +pdfjs-page-scale-width = Plen largor del pagina +pdfjs-page-scale-fit = Pagina integre +pdfjs-page-scale-auto = Zoom automatic +pdfjs-page-scale-actual = Dimension real +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Pagina { $page } + +## Loading indicator messages + +pdfjs-loading-error = Un error occurreva durante que on cargava le file PDF. +pdfjs-invalid-file-error = File PDF corrumpite o non valide. +pdfjs-missing-file-error = File PDF mancante. +pdfjs-unexpected-response-error = Responsa del servitor inexpectate. +pdfjs-rendering-error = Un error occurreva durante que on processava le pagina. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } Annotation] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Insere le contrasigno pro aperir iste file PDF. +pdfjs-password-invalid = Contrasigno invalide. Per favor retenta. +pdfjs-password-ok-button = OK +pdfjs-password-cancel-button = Cancellar +pdfjs-web-fonts-disabled = Le typos de litteras web es disactivate: impossibile usar le typos de litteras PDF incorporate. + +## Editing + +pdfjs-editor-free-text-button = + .title = Texto +pdfjs-editor-free-text-button-label = Texto +pdfjs-editor-ink-button = + .title = Designar +pdfjs-editor-ink-button-label = Designar +pdfjs-editor-stamp-button = + .title = Adder o rediger imagines +pdfjs-editor-stamp-button-label = Adder o rediger imagines +pdfjs-editor-highlight-button = + .title = Evidentia +pdfjs-editor-highlight-button-label = Evidentia +pdfjs-highlight-floating-button1 = + .title = Evidentiar + .aria-label = Evidentiar +pdfjs-highlight-floating-button-label = Evidentiar + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Remover le designo +pdfjs-editor-remove-freetext-button = + .title = Remover texto +pdfjs-editor-remove-stamp-button = + .title = Remover imagine +pdfjs-editor-remove-highlight-button = + .title = Remover evidentia + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Color +pdfjs-editor-free-text-size-input = Dimension +pdfjs-editor-ink-color-input = Color +pdfjs-editor-ink-thickness-input = Spissor +pdfjs-editor-ink-opacity-input = Opacitate +pdfjs-editor-stamp-add-image-button = + .title = Adder imagine +pdfjs-editor-stamp-add-image-button-label = Adder imagine +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Spissor +pdfjs-editor-free-highlight-thickness-title = + .title = Cambiar spissor evidentiante elementos differente de texto +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = Editor de texto + .default-content = Initiar a inserer… +pdfjs-free-text = + .aria-label = Editor de texto +pdfjs-free-text-default-content = Comenciar a scriber… +pdfjs-ink = + .aria-label = Editor de designos +pdfjs-ink-canvas = + .aria-label = Imagine create per le usator + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = Texto alternative +pdfjs-editor-alt-text-edit-button = + .aria-label = Rediger texto alternative +pdfjs-editor-alt-text-edit-button-label = Rediger texto alternative +pdfjs-editor-alt-text-dialog-label = Elige un option +pdfjs-editor-alt-text-dialog-description = Le texto alternative (alt text) adjuta quando le personas non pote vider le imagine o quando illo non carga. +pdfjs-editor-alt-text-add-description-label = Adder un description +pdfjs-editor-alt-text-add-description-description = Mira a 1-2 phrases que describe le subjecto, parametro, o actiones. +pdfjs-editor-alt-text-mark-decorative-label = Marcar como decorative +pdfjs-editor-alt-text-mark-decorative-description = Isto es usate pro imagines ornamental, como bordaturas o filigranas. +pdfjs-editor-alt-text-cancel-button = Cancellar +pdfjs-editor-alt-text-save-button = Salvar +pdfjs-editor-alt-text-decorative-tooltip = Marcate como decorative +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = Per exemplo, “Un juvene sede a un tabula pro mangiar un repasto” +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = Texto alternative + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Angulo superior sinistre — redimensionar +pdfjs-editor-resizer-label-top-middle = Medio superior — redimensionar +pdfjs-editor-resizer-label-top-right = Angulo superior dextre — redimensionar +pdfjs-editor-resizer-label-middle-right = Medio dextre — redimensionar +pdfjs-editor-resizer-label-bottom-right = Angulo inferior dextre — redimensionar +pdfjs-editor-resizer-label-bottom-middle = Medio inferior — redimensionar +pdfjs-editor-resizer-label-bottom-left = Angulo inferior sinistre — redimensionar +pdfjs-editor-resizer-label-middle-left = Medio sinistre — redimensionar +pdfjs-editor-resizer-top-left = + .aria-label = Angulo superior sinistre — redimensionar +pdfjs-editor-resizer-top-middle = + .aria-label = Medio superior — redimensionar +pdfjs-editor-resizer-top-right = + .aria-label = Angulo superior dextre — redimensionar +pdfjs-editor-resizer-middle-right = + .aria-label = Medio dextre — redimensionar +pdfjs-editor-resizer-bottom-right = + .aria-label = Angulo inferior dextre — redimensionar +pdfjs-editor-resizer-bottom-middle = + .aria-label = Medio inferior — redimensionar +pdfjs-editor-resizer-bottom-left = + .aria-label = Angulo inferior sinistre — redimensionar +pdfjs-editor-resizer-middle-left = + .aria-label = Medio sinistre — redimensionar + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Color pro evidentiar +pdfjs-editor-colorpicker-button = + .title = Cambiar color +pdfjs-editor-colorpicker-dropdown = + .aria-label = Electiones del color +pdfjs-editor-colorpicker-yellow = + .title = Jalne +pdfjs-editor-colorpicker-green = + .title = Verde +pdfjs-editor-colorpicker-blue = + .title = Blau +pdfjs-editor-colorpicker-pink = + .title = Rosate +pdfjs-editor-colorpicker-red = + .title = Rubie + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Monstrar toto +pdfjs-editor-highlight-show-all-button = + .title = Monstrar toto + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = Rediger texto alternative (description del imagine) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = Adder texto alternative (description del imagine) +pdfjs-editor-new-alt-text-textarea = + .placeholder = Scribe tu description ci… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = Breve description pro personas qui non pote vider le imagine o quando le imagine non se carga. +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = Iste texto alternative ha essite create automaticamente e pote esser inexacte. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Pro saper plus +pdfjs-editor-new-alt-text-create-automatically-button-label = Crear texto alternative automaticamente +pdfjs-editor-new-alt-text-not-now-button = Non ora +pdfjs-editor-new-alt-text-error-title = Impossibile crear texto alternative automaticamente +pdfjs-editor-new-alt-text-error-description = Scribe tu proprie texto alternative o retenta plus tarde. +pdfjs-editor-new-alt-text-error-close-button = Clauder +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = Discargante modello de intelligentia artificial del texto alternative ({ $downloadedSize } de { $totalSize } MB) + .aria-valuetext = Discargante modello de intelligentia artificial del texto alternative ({ $downloadedSize } de { $totalSize } MB) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = Texto alternative addite +pdfjs-editor-new-alt-text-added-button-label = Texto alternative addite +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = Texto alternative mancante +pdfjs-editor-new-alt-text-missing-button-label = Texto alternative mancante +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = Revider texto alternative +pdfjs-editor-new-alt-text-to-review-button-label = Revider texto alternative +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Automaticamente create: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = Parametros del texto alternative del imagine +pdfjs-image-alt-text-settings-button-label = Parametros del texto alternative del imagine +pdfjs-editor-alt-text-settings-dialog-label = Parametros del texto alternative del imagine +pdfjs-editor-alt-text-settings-automatic-title = Texto alternative automatic +pdfjs-editor-alt-text-settings-create-model-button-label = Crear texto alternative automaticamente +pdfjs-editor-alt-text-settings-create-model-description = Suggere descriptiones pro adjutar le personas qui non pote vider le imagine o quando le imagine non carga. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = Modello de intelligentia artificial del texto alternative ({ $totalSize } MB) +pdfjs-editor-alt-text-settings-ai-model-description = Flue localmente sur tu apparato assi tu datos remane private. Necessari pro texto alternative automatic. +pdfjs-editor-alt-text-settings-delete-model-button = Deler +pdfjs-editor-alt-text-settings-download-model-button = Discargar +pdfjs-editor-alt-text-settings-downloading-model-button = Discargante… +pdfjs-editor-alt-text-settings-editor-title = Rediger texto alternative +pdfjs-editor-alt-text-settings-show-dialog-button-label = Monstrar le redactor de texto alternative a pena on adde un imagine +pdfjs-editor-alt-text-settings-show-dialog-description = Te adjuta a verifica que tote tu imagines ha un texto alternative. +pdfjs-editor-alt-text-settings-close-button = Clauder + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = Evidentiation removite +pdfjs-editor-undo-bar-message-freetext = Texto removite +pdfjs-editor-undo-bar-message-ink = Designo removite +pdfjs-editor-undo-bar-message-stamp = Imagine removite +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = + { $count -> + [one] { $count } annotation removite + *[other] { $count } annotationes removite + } +pdfjs-editor-undo-bar-undo-button = + .title = Disfacer +pdfjs-editor-undo-bar-undo-button-label = Disfacer +pdfjs-editor-undo-bar-close-button = + .title = Clauder +pdfjs-editor-undo-bar-close-button-label = Clauder diff --git a/public/pdfjs/web/locale/id/viewer.ftl b/public/pdfjs/web/locale/id/viewer.ftl new file mode 100644 index 0000000..c985a33 --- /dev/null +++ b/public/pdfjs/web/locale/id/viewer.ftl @@ -0,0 +1,374 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Laman Sebelumnya +pdfjs-previous-button-label = Sebelumnya +pdfjs-next-button = + .title = Laman Selanjutnya +pdfjs-next-button-label = Selanjutnya +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Halaman +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = dari { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } dari { $pagesCount }) +pdfjs-zoom-out-button = + .title = Perkecil +pdfjs-zoom-out-button-label = Perkecil +pdfjs-zoom-in-button = + .title = Perbesar +pdfjs-zoom-in-button-label = Perbesar +pdfjs-zoom-select = + .title = Perbesaran +pdfjs-presentation-mode-button = + .title = Ganti ke Mode Presentasi +pdfjs-presentation-mode-button-label = Mode Presentasi +pdfjs-open-file-button = + .title = Buka Berkas +pdfjs-open-file-button-label = Buka +pdfjs-print-button = + .title = Cetak +pdfjs-print-button-label = Cetak +pdfjs-save-button = + .title = Simpan +pdfjs-save-button-label = Simpan +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Unduh +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Unduh +pdfjs-bookmark-button = + .title = Laman Saat Ini (Lihat URL dari Laman Sekarang) +pdfjs-bookmark-button-label = Laman Saat Ini + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Alat +pdfjs-tools-button-label = Alat +pdfjs-first-page-button = + .title = Buka Halaman Pertama +pdfjs-first-page-button-label = Buka Halaman Pertama +pdfjs-last-page-button = + .title = Buka Halaman Terakhir +pdfjs-last-page-button-label = Buka Halaman Terakhir +pdfjs-page-rotate-cw-button = + .title = Putar Searah Jarum Jam +pdfjs-page-rotate-cw-button-label = Putar Searah Jarum Jam +pdfjs-page-rotate-ccw-button = + .title = Putar Berlawanan Arah Jarum Jam +pdfjs-page-rotate-ccw-button-label = Putar Berlawanan Arah Jarum Jam +pdfjs-cursor-text-select-tool-button = + .title = Aktifkan Alat Seleksi Teks +pdfjs-cursor-text-select-tool-button-label = Alat Seleksi Teks +pdfjs-cursor-hand-tool-button = + .title = Aktifkan Alat Tangan +pdfjs-cursor-hand-tool-button-label = Alat Tangan +pdfjs-scroll-page-button = + .title = Gunakan Pengguliran Laman +pdfjs-scroll-page-button-label = Pengguliran Laman +pdfjs-scroll-vertical-button = + .title = Gunakan Penggeseran Vertikal +pdfjs-scroll-vertical-button-label = Penggeseran Vertikal +pdfjs-scroll-horizontal-button = + .title = Gunakan Penggeseran Horizontal +pdfjs-scroll-horizontal-button-label = Penggeseran Horizontal +pdfjs-scroll-wrapped-button = + .title = Gunakan Penggeseran Terapit +pdfjs-scroll-wrapped-button-label = Penggeseran Terapit +pdfjs-spread-none-button = + .title = Jangan gabungkan lembar halaman +pdfjs-spread-none-button-label = Tidak Ada Lembaran +pdfjs-spread-odd-button = + .title = Gabungkan lembar lamanan mulai dengan halaman ganjil +pdfjs-spread-odd-button-label = Lembaran Ganjil +pdfjs-spread-even-button = + .title = Gabungkan lembar halaman dimulai dengan halaman genap +pdfjs-spread-even-button-label = Lembaran Genap + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Properti Dokumen… +pdfjs-document-properties-button-label = Properti Dokumen… +pdfjs-document-properties-file-name = Nama berkas: +pdfjs-document-properties-file-size = Ukuran berkas: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } byte) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } byte) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } byte) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } byte) +pdfjs-document-properties-title = Judul: +pdfjs-document-properties-author = Penyusun: +pdfjs-document-properties-subject = Subjek: +pdfjs-document-properties-keywords = Kata Kunci: +pdfjs-document-properties-creation-date = Tanggal Dibuat: +pdfjs-document-properties-modification-date = Tanggal Dimodifikasi: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Pembuat: +pdfjs-document-properties-producer = Pemroduksi PDF: +pdfjs-document-properties-version = Versi PDF: +pdfjs-document-properties-page-count = Jumlah Halaman: +pdfjs-document-properties-page-size = Ukuran Laman: +pdfjs-document-properties-page-size-unit-inches = inci +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = tegak +pdfjs-document-properties-page-size-orientation-landscape = mendatar +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Letter +pdfjs-document-properties-page-size-name-legal = Legal + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Tampilan Web Kilat: +pdfjs-document-properties-linearized-yes = Ya +pdfjs-document-properties-linearized-no = Tidak +pdfjs-document-properties-close-button = Tutup + +## Print + +pdfjs-print-progress-message = Menyiapkan dokumen untuk pencetakan… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Batalkan +pdfjs-printing-not-supported = Peringatan: Pencetakan tidak didukung secara lengkap pada peramban ini. +pdfjs-printing-not-ready = Peringatan: Berkas PDF masih belum dimuat secara lengkap untuk dapat dicetak. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Aktif/Nonaktifkan Bilah Samping +pdfjs-toggle-sidebar-notification-button = + .title = Aktif/Nonaktifkan Bilah Samping (dokumen berisi kerangka/lampiran/lapisan) +pdfjs-toggle-sidebar-button-label = Aktif/Nonaktifkan Bilah Samping +pdfjs-document-outline-button = + .title = Tampilkan Kerangka Dokumen (klik ganda untuk membentangkan/menciutkan semua item) +pdfjs-document-outline-button-label = Kerangka Dokumen +pdfjs-attachments-button = + .title = Tampilkan Lampiran +pdfjs-attachments-button-label = Lampiran +pdfjs-layers-button = + .title = Tampilkan Lapisan (klik ganda untuk mengatur ulang semua lapisan ke keadaan baku) +pdfjs-layers-button-label = Lapisan +pdfjs-thumbs-button = + .title = Tampilkan Miniatur +pdfjs-thumbs-button-label = Miniatur +pdfjs-current-outline-item-button = + .title = Cari Butir Ikhtisar Saat Ini +pdfjs-current-outline-item-button-label = Butir Ikhtisar Saat Ini +pdfjs-findbar-button = + .title = Temukan di Dokumen +pdfjs-findbar-button-label = Temukan +pdfjs-additional-layers = Lapisan Tambahan + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Laman { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Miniatur Laman { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Temukan + .placeholder = Temukan di dokumen… +pdfjs-find-previous-button = + .title = Temukan kata sebelumnya +pdfjs-find-previous-button-label = Sebelumnya +pdfjs-find-next-button = + .title = Temukan lebih lanjut +pdfjs-find-next-button-label = Selanjutnya +pdfjs-find-highlight-checkbox = Sorot semuanya +pdfjs-find-match-case-checkbox-label = Cocokkan BESAR/kecil +pdfjs-find-match-diacritics-checkbox-label = Pencocokan Diakritik +pdfjs-find-entire-word-checkbox-label = Seluruh teks +pdfjs-find-reached-top = Sampai di awal dokumen, dilanjutkan dari bawah +pdfjs-find-reached-bottom = Sampai di akhir dokumen, dilanjutkan dari atas +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = { $current } dari { $total } yang cocok +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = Lebih dari { $limit } kecocokan +pdfjs-find-not-found = Frasa tidak ditemukan + +## Predefined zoom values + +pdfjs-page-scale-width = Lebar Laman +pdfjs-page-scale-fit = Muat Laman +pdfjs-page-scale-auto = Perbesaran Otomatis +pdfjs-page-scale-actual = Ukuran Asli +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Halaman { $page } + +## Loading indicator messages + +pdfjs-loading-error = Galat terjadi saat memuat PDF. +pdfjs-invalid-file-error = Berkas PDF tidak valid atau rusak. +pdfjs-missing-file-error = Berkas PDF tidak ada. +pdfjs-unexpected-response-error = Balasan server yang tidak diharapkan. +pdfjs-rendering-error = Galat terjadi saat merender laman. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [Anotasi { $type }] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Masukkan sandi untuk membuka berkas PDF ini. +pdfjs-password-invalid = Sandi tidak valid. Silakan coba lagi. +pdfjs-password-ok-button = Oke +pdfjs-password-cancel-button = Batal +pdfjs-web-fonts-disabled = Font web dinonaktifkan: tidak dapat menggunakan font PDF yang tersemat. + +## Editing + +pdfjs-editor-free-text-button = + .title = Teks +pdfjs-editor-free-text-button-label = Teks +pdfjs-editor-ink-button = + .title = Gambar +pdfjs-editor-ink-button-label = Gambar +pdfjs-editor-stamp-button = + .title = Tambah atau edit gambar +pdfjs-editor-stamp-button-label = Tambah atau edit gambar +pdfjs-editor-highlight-button = + .title = Sorot +pdfjs-editor-highlight-button-label = Sorot +pdfjs-highlight-floating-button1 = + .title = Sorot + .aria-label = Sorot +pdfjs-highlight-floating-button-label = Sorot + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Hapus gambar +pdfjs-editor-remove-freetext-button = + .title = Hapus teks +pdfjs-editor-remove-stamp-button = + .title = Hapus gambar +pdfjs-editor-remove-highlight-button = + .title = Hapus sorotan + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Warna +pdfjs-editor-free-text-size-input = Ukuran +pdfjs-editor-ink-color-input = Warna +pdfjs-editor-ink-thickness-input = Ketebalan +pdfjs-editor-ink-opacity-input = Opasitas +pdfjs-editor-stamp-add-image-button = + .title = Tambahkan gambar +pdfjs-editor-stamp-add-image-button-label = Tambahkan gambar +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Ketebalan +pdfjs-editor-free-highlight-thickness-title = + .title = Ubah ketebalan saat menyorot item selain teks +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = Editor Teks + .default-content = Mulai mengetik… +pdfjs-free-text = + .aria-label = Editor Teks +pdfjs-free-text-default-content = Mulai mengetik… +pdfjs-ink = + .aria-label = Editor Gambar +pdfjs-ink-canvas = + .aria-label = Gambar yang dibuat pengguna + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = Teks alternatif +pdfjs-editor-alt-text-edit-button = + .aria-label = Edit teks alternatif +pdfjs-editor-alt-text-edit-button-label = Edit teks alternatif +pdfjs-editor-alt-text-dialog-label = Pilih opsi + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + + +## Color picker + + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + + +## Image alt-text settings + diff --git a/public/pdfjs/web/locale/is/viewer.ftl b/public/pdfjs/web/locale/is/viewer.ftl new file mode 100644 index 0000000..deda510 --- /dev/null +++ b/public/pdfjs/web/locale/is/viewer.ftl @@ -0,0 +1,515 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Fyrri síða +pdfjs-previous-button-label = Fyrri +pdfjs-next-button = + .title = Næsta síða +pdfjs-next-button-label = Næsti +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Síða +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = af { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } af { $pagesCount }) +pdfjs-zoom-out-button = + .title = Minnka aðdrátt +pdfjs-zoom-out-button-label = Minnka aðdrátt +pdfjs-zoom-in-button = + .title = Auka aðdrátt +pdfjs-zoom-in-button-label = Auka aðdrátt +pdfjs-zoom-select = + .title = Aðdráttur +pdfjs-presentation-mode-button = + .title = Skipta yfir á kynningarham +pdfjs-presentation-mode-button-label = Kynningarhamur +pdfjs-open-file-button = + .title = Opna skrá +pdfjs-open-file-button-label = Opna +pdfjs-print-button = + .title = Prenta +pdfjs-print-button-label = Prenta +pdfjs-save-button = + .title = Vista +pdfjs-save-button-label = Vista +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Sækja +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Sækja +pdfjs-bookmark-button = + .title = Núverandi síða (Skoða vefslóð frá núverandi síðu) +pdfjs-bookmark-button-label = Núverandi síða + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Verkfæri +pdfjs-tools-button-label = Verkfæri +pdfjs-first-page-button = + .title = Fara á fyrstu síðu +pdfjs-first-page-button-label = Fara á fyrstu síðu +pdfjs-last-page-button = + .title = Fara á síðustu síðu +pdfjs-last-page-button-label = Fara á síðustu síðu +pdfjs-page-rotate-cw-button = + .title = Snúa réttsælis +pdfjs-page-rotate-cw-button-label = Snúa réttsælis +pdfjs-page-rotate-ccw-button = + .title = Snúa rangsælis +pdfjs-page-rotate-ccw-button-label = Snúa rangsælis +pdfjs-cursor-text-select-tool-button = + .title = Virkja textavalsáhald +pdfjs-cursor-text-select-tool-button-label = Textavalsáhald +pdfjs-cursor-hand-tool-button = + .title = Virkja handarverkfæri +pdfjs-cursor-hand-tool-button-label = Handarverkfæri +pdfjs-scroll-page-button = + .title = Nota síðuskrun +pdfjs-scroll-page-button-label = Síðuskrun +pdfjs-scroll-vertical-button = + .title = Nota lóðrétt skrun +pdfjs-scroll-vertical-button-label = Lóðrétt skrun +pdfjs-scroll-horizontal-button = + .title = Nota lárétt skrun +pdfjs-scroll-horizontal-button-label = Lárétt skrun +pdfjs-scroll-wrapped-button = + .title = Nota línuskipt síðuskrun +pdfjs-scroll-wrapped-button-label = Línuskipt síðuskrun +pdfjs-spread-none-button = + .title = Ekki taka þátt í dreifingu síðna +pdfjs-spread-none-button-label = Engin dreifing +pdfjs-spread-odd-button = + .title = Taka þátt í dreifingu síðna með oddatölum +pdfjs-spread-odd-button-label = Oddatöludreifing +pdfjs-spread-even-button = + .title = Taktu þátt í dreifingu síðna með jöfnuntölum +pdfjs-spread-even-button-label = Jafnatöludreifing + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Eiginleikar skjals… +pdfjs-document-properties-button-label = Eiginleikar skjals… +pdfjs-document-properties-file-name = Skráarnafn: +pdfjs-document-properties-file-size = Skrárstærð: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } bæti) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } bæti) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bytes) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bytes) +pdfjs-document-properties-title = Titill: +pdfjs-document-properties-author = Hönnuður: +pdfjs-document-properties-subject = Efni: +pdfjs-document-properties-keywords = Stikkorð: +pdfjs-document-properties-creation-date = Búið til: +pdfjs-document-properties-modification-date = Dags breytingar: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Höfundur: +pdfjs-document-properties-producer = PDF framleiðandi: +pdfjs-document-properties-version = PDF útgáfa: +pdfjs-document-properties-page-count = Blaðsíðufjöldi: +pdfjs-document-properties-page-size = Stærð síðu: +pdfjs-document-properties-page-size-unit-inches = in +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = skammsnið +pdfjs-document-properties-page-size-orientation-landscape = langsnið +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Letter +pdfjs-document-properties-page-size-name-legal = Legal + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Fljótleg vefskoðun: +pdfjs-document-properties-linearized-yes = Já +pdfjs-document-properties-linearized-no = Nei +pdfjs-document-properties-close-button = Loka + +## Print + +pdfjs-print-progress-message = Undirbý skjal fyrir prentun… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Hætta við +pdfjs-printing-not-supported = Aðvörun: Prentun er ekki með fyllilegan stuðning á þessum vafra. +pdfjs-printing-not-ready = Aðvörun: Ekki er búið að hlaða inn allri PDF skránni fyrir prentun. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Víxla hliðarspjaldi af/á +pdfjs-toggle-sidebar-notification-button = + .title = Víxla hliðarslá (skjal inniheldur yfirlit/viðhengi/lög) +pdfjs-toggle-sidebar-button-label = Víxla hliðarspjaldi af/á +pdfjs-document-outline-button = + .title = Sýna yfirlit skjals (tvísmelltu til að opna/loka öllum hlutum) +pdfjs-document-outline-button-label = Efnisskipan skjals +pdfjs-attachments-button = + .title = Sýna viðhengi +pdfjs-attachments-button-label = Viðhengi +pdfjs-layers-button = + .title = Birta lög (tvísmelltu til að endurstilla öll lög í sjálfgefna stöðu) +pdfjs-layers-button-label = Lög +pdfjs-thumbs-button = + .title = Sýna smámyndir +pdfjs-thumbs-button-label = Smámyndir +pdfjs-current-outline-item-button = + .title = Finna núverandi atriði efnisskipunar +pdfjs-current-outline-item-button-label = Núverandi atriði efnisskipunar +pdfjs-findbar-button = + .title = Leita í skjali +pdfjs-findbar-button-label = Leita +pdfjs-additional-layers = Viðbótarlög + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Síða { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Smámynd af síðu { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Leita + .placeholder = Leita í skjali… +pdfjs-find-previous-button = + .title = Leita að fyrra tilfelli þessara orða +pdfjs-find-previous-button-label = Fyrri +pdfjs-find-next-button = + .title = Leita að næsta tilfelli þessara orða +pdfjs-find-next-button-label = Næsti +pdfjs-find-highlight-checkbox = Lita allt +pdfjs-find-match-case-checkbox-label = Passa við stafstöðu +pdfjs-find-match-diacritics-checkbox-label = Passa við broddstafi +pdfjs-find-entire-word-checkbox-label = Heil orð +pdfjs-find-reached-top = Náði efst í skjal, held áfram neðst +pdfjs-find-reached-bottom = Náði enda skjals, held áfram efst +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] { $current } af { $total } passar við + *[other] { $current } af { $total } passa við + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] Fleiri en { $limit } passar við + *[other] Fleiri en { $limit } passa við + } +pdfjs-find-not-found = Fann ekki orðið + +## Predefined zoom values + +pdfjs-page-scale-width = Síðubreidd +pdfjs-page-scale-fit = Passa á síðu +pdfjs-page-scale-auto = Sjálfvirkur aðdráttur +pdfjs-page-scale-actual = Raunstærð +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Síða { $page } + +## Loading indicator messages + +pdfjs-loading-error = Villa kom upp við að hlaða inn PDF. +pdfjs-invalid-file-error = Ógild eða skemmd PDF skrá. +pdfjs-missing-file-error = Vantar PDF skrá. +pdfjs-unexpected-response-error = Óvænt svar frá netþjóni. +pdfjs-rendering-error = Upp kom villa við að birta síðuna. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } Skýring] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Settu inn lykilorð til að opna þessa PDF-skrá. +pdfjs-password-invalid = Ógilt lykilorð. Reyndu aftur. +pdfjs-password-ok-button = Í lagi +pdfjs-password-cancel-button = Hætta við +pdfjs-web-fonts-disabled = Vef leturgerðir eru óvirkar: get ekki notað innbyggðar PDF leturgerðir. + +## Editing + +pdfjs-editor-free-text-button = + .title = Texti +pdfjs-editor-free-text-button-label = Texti +pdfjs-editor-ink-button = + .title = Teikna +pdfjs-editor-ink-button-label = Teikna +pdfjs-editor-stamp-button = + .title = Bæta við eða breyta myndum +pdfjs-editor-stamp-button-label = Bæta við eða breyta myndum +pdfjs-editor-highlight-button = + .title = Áherslulita +pdfjs-editor-highlight-button-label = Áherslulita +pdfjs-highlight-floating-button1 = + .title = Áherslulita + .aria-label = Áherslulita +pdfjs-highlight-floating-button-label = Áherslulita + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Fjarlægja teikningu +pdfjs-editor-remove-freetext-button = + .title = Fjarlægja texta +pdfjs-editor-remove-stamp-button = + .title = Fjarlægja mynd +pdfjs-editor-remove-highlight-button = + .title = Fjarlægja áherslulit + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Litur +pdfjs-editor-free-text-size-input = Stærð +pdfjs-editor-ink-color-input = Litur +pdfjs-editor-ink-thickness-input = Þykkt +pdfjs-editor-ink-opacity-input = Ógegnsæi +pdfjs-editor-stamp-add-image-button = + .title = Bæta við mynd +pdfjs-editor-stamp-add-image-button-label = Bæta við mynd +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Þykkt +pdfjs-editor-free-highlight-thickness-title = + .title = Breyta þykkt við áherslulitun annarra atriða en texta +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = Textaritill + .default-content = Byrjaðu að skrifa… +pdfjs-free-text = + .aria-label = Textaritill +pdfjs-free-text-default-content = Byrjaðu að skrifa… +pdfjs-ink = + .aria-label = Teikniritill +pdfjs-ink-canvas = + .aria-label = Mynd gerð af notanda + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = Alt-varatexti +pdfjs-editor-alt-text-edit-button = + .aria-label = Breyta alt-myndatexta +pdfjs-editor-alt-text-edit-button-label = Breyta alt-varatexta +pdfjs-editor-alt-text-dialog-label = Veldu valkost +pdfjs-editor-alt-text-dialog-description = Alt-varatexti (auka-myndatexti) hjálpar þegar fólk getur ekki séð myndina eða þegar hún hleðst ekki inn. +pdfjs-editor-alt-text-add-description-label = Bættu við lýsingu +pdfjs-editor-alt-text-add-description-description = Reyndu að takmarka þetta við 1-2 setningar sem lýsa efninu, umhverfi eða aðgerðum. +pdfjs-editor-alt-text-mark-decorative-label = Merkja sem skraut +pdfjs-editor-alt-text-mark-decorative-description = Þetta er notað fyrir skrautmyndir, eins og borða eða vatnsmerki. +pdfjs-editor-alt-text-cancel-button = Hætta við +pdfjs-editor-alt-text-save-button = Vista +pdfjs-editor-alt-text-decorative-tooltip = Merkt sem skraut +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = Til dæmis: „Ungur maður sest við borð til að snæða máltíð“ +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = Alt-myndatexti + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Efst í vinstra horni - breyta stærð +pdfjs-editor-resizer-label-top-middle = Efst á miðju - breyta stærð +pdfjs-editor-resizer-label-top-right = Efst í hægra horni - breyta stærð +pdfjs-editor-resizer-label-middle-right = Miðja til hægri - breyta stærð +pdfjs-editor-resizer-label-bottom-right = Neðst í hægra horni - breyta stærð +pdfjs-editor-resizer-label-bottom-middle = Neðst á miðju - breyta stærð +pdfjs-editor-resizer-label-bottom-left = Neðst í vinstra horni - breyta stærð +pdfjs-editor-resizer-label-middle-left = Miðja til vinstri - breyta stærð +pdfjs-editor-resizer-top-left = + .aria-label = Efst í vinstra horni - breyta stærð +pdfjs-editor-resizer-top-middle = + .aria-label = Efst á miðju - breyta stærð +pdfjs-editor-resizer-top-right = + .aria-label = Efst í hægra horni - breyta stærð +pdfjs-editor-resizer-middle-right = + .aria-label = Miðja til hægri - breyta stærð +pdfjs-editor-resizer-bottom-right = + .aria-label = Neðst í hægra horni - breyta stærð +pdfjs-editor-resizer-bottom-middle = + .aria-label = Neðst á miðju - breyta stærð +pdfjs-editor-resizer-bottom-left = + .aria-label = Neðst í vinstra horni - breyta stærð +pdfjs-editor-resizer-middle-left = + .aria-label = Miðja til vinstri - breyta stærð + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Áherslulitur +pdfjs-editor-colorpicker-button = + .title = Skipta um lit +pdfjs-editor-colorpicker-dropdown = + .aria-label = Val lita +pdfjs-editor-colorpicker-yellow = + .title = Gult +pdfjs-editor-colorpicker-green = + .title = Grænt +pdfjs-editor-colorpicker-blue = + .title = Blátt +pdfjs-editor-colorpicker-pink = + .title = Bleikt +pdfjs-editor-colorpicker-red = + .title = Rautt + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Birta allt +pdfjs-editor-highlight-show-all-button = + .title = Birta allt + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = Breyta alt-myndatexta (lýsingu á mynd) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = Bæta við alt-myndatexta (lýsingu á mynd) +pdfjs-editor-new-alt-text-textarea = + .placeholder = Skrifaðu lýsinguna þína hér… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = Stutt lýsing fyrir fólk sem getur ekki séð myndina eða þegar myndin hleðst ekki inn. +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = Þessi alt-myndatexti var búinn til sjálfvirkt og gæti verið ónákvæmur. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Kanna nánar +pdfjs-editor-new-alt-text-create-automatically-button-label = Útbúa alt-myndatexta sjálfvirkt +pdfjs-editor-new-alt-text-not-now-button = Ekki núna +pdfjs-editor-new-alt-text-error-title = Gat ekki búið til alt-myndatexta sjálfkrafa +pdfjs-editor-new-alt-text-error-description = Skrifaðu þinn eiginn alt-myndatexta eða reyndu aftur síðar. +pdfjs-editor-new-alt-text-error-close-button = Loka +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = Sækir gervigreindarlíkan með alt-myndatextum ({ $downloadedSize } af { $totalSize } MB) + .aria-valuetext = Sækir gervigreindarlíkan með alt-myndatextum ({ $downloadedSize } af { $totalSize } MB) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = Alt-myndatexta bætt við +pdfjs-editor-new-alt-text-added-button-label = Alt-myndatexta bætt við +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = Vantar alt-myndatexta +pdfjs-editor-new-alt-text-missing-button-label = Vantar alt-myndatexta +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = Yfirfara alt-myndatexta +pdfjs-editor-new-alt-text-to-review-button-label = Yfirfara myndatexta +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Útbúið sjálfvirkt: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = Stillingar fyrir alt-texta myndar +pdfjs-image-alt-text-settings-button-label = Stillingar fyrir alt-texta myndar +pdfjs-editor-alt-text-settings-dialog-label = Stillingar fyrir alt-texta myndar +pdfjs-editor-alt-text-settings-automatic-title = Sjálfvirkur alt-myndatexti +pdfjs-editor-alt-text-settings-create-model-button-label = Útbúa alt-myndatexta sjálfvirkt +pdfjs-editor-alt-text-settings-create-model-description = Stingur upp á lýsingum til að hjálpa fólki sem getur ekki séð myndina eða þegar myndin hleðst ekki inn. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = Gervigreindarlíkan alt-myndatexta ({ $totalSize } MB) +pdfjs-editor-alt-text-settings-ai-model-description = Keyrir staðbundið á tækinu þínu svo gögnin þín haldast undir þinni stjórn. Nauðsynlegt fyrir sjálfvirka alt-myndatexta. +pdfjs-editor-alt-text-settings-delete-model-button = Eyða +pdfjs-editor-alt-text-settings-download-model-button = Sækja +pdfjs-editor-alt-text-settings-downloading-model-button = Sæki… +pdfjs-editor-alt-text-settings-editor-title = Ritill fyrir alt-myndatexta +pdfjs-editor-alt-text-settings-show-dialog-button-label = Sýna alt-myndatextaritil strax þegar mynd er bætt við +pdfjs-editor-alt-text-settings-show-dialog-description = Hjálpar þér að tryggja að allar myndirnar þínar séu með alt-myndatexta. +pdfjs-editor-alt-text-settings-close-button = Loka + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = Áherslulitun fjarlægð +pdfjs-editor-undo-bar-message-freetext = Texti fjarlægður +pdfjs-editor-undo-bar-message-ink = Teikning fjarlægð +pdfjs-editor-undo-bar-message-stamp = Mynd fjarlægð +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = + { $count -> + [one] { $count } glósa fjarlægð + *[other] { $count } glósur fjarlægðar + } +pdfjs-editor-undo-bar-undo-button = + .title = Afturkalla +pdfjs-editor-undo-bar-undo-button-label = Afturkalla +pdfjs-editor-undo-bar-close-button = + .title = Loka +pdfjs-editor-undo-bar-close-button-label = Loka diff --git a/public/pdfjs/web/locale/it/viewer.ftl b/public/pdfjs/web/locale/it/viewer.ftl new file mode 100644 index 0000000..d1de7e1 --- /dev/null +++ b/public/pdfjs/web/locale/it/viewer.ftl @@ -0,0 +1,515 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Pagina precedente +pdfjs-previous-button-label = Precedente +pdfjs-next-button = + .title = Pagina successiva +pdfjs-next-button-label = Successiva +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Pagina +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = di { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } di { $pagesCount }) +pdfjs-zoom-out-button = + .title = Riduci zoom +pdfjs-zoom-out-button-label = Riduci zoom +pdfjs-zoom-in-button = + .title = Aumenta zoom +pdfjs-zoom-in-button-label = Aumenta zoom +pdfjs-zoom-select = + .title = Zoom +pdfjs-presentation-mode-button = + .title = Passa alla modalità presentazione +pdfjs-presentation-mode-button-label = Modalità presentazione +pdfjs-open-file-button = + .title = Apri file +pdfjs-open-file-button-label = Apri +pdfjs-print-button = + .title = Stampa +pdfjs-print-button-label = Stampa +pdfjs-save-button = + .title = Salva +pdfjs-save-button-label = Salva +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Scarica +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Scarica +pdfjs-bookmark-button = + .title = Pagina corrente (mostra URL della pagina corrente) +pdfjs-bookmark-button-label = Pagina corrente + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Strumenti +pdfjs-tools-button-label = Strumenti +pdfjs-first-page-button = + .title = Vai alla prima pagina +pdfjs-first-page-button-label = Vai alla prima pagina +pdfjs-last-page-button = + .title = Vai all’ultima pagina +pdfjs-last-page-button-label = Vai all’ultima pagina +pdfjs-page-rotate-cw-button = + .title = Ruota in senso orario +pdfjs-page-rotate-cw-button-label = Ruota in senso orario +pdfjs-page-rotate-ccw-button = + .title = Ruota in senso antiorario +pdfjs-page-rotate-ccw-button-label = Ruota in senso antiorario +pdfjs-cursor-text-select-tool-button = + .title = Attiva strumento di selezione testo +pdfjs-cursor-text-select-tool-button-label = Strumento di selezione testo +pdfjs-cursor-hand-tool-button = + .title = Attiva strumento mano +pdfjs-cursor-hand-tool-button-label = Strumento mano +pdfjs-scroll-page-button = + .title = Utilizza scorrimento pagine +pdfjs-scroll-page-button-label = Scorrimento pagine +pdfjs-scroll-vertical-button = + .title = Scorri le pagine in verticale +pdfjs-scroll-vertical-button-label = Scorrimento verticale +pdfjs-scroll-horizontal-button = + .title = Scorri le pagine in orizzontale +pdfjs-scroll-horizontal-button-label = Scorrimento orizzontale +pdfjs-scroll-wrapped-button = + .title = Scorri le pagine in verticale, disponendole da sinistra a destra e andando a capo automaticamente +pdfjs-scroll-wrapped-button-label = Scorrimento con a capo automatico +pdfjs-spread-none-button = + .title = Non raggruppare pagine +pdfjs-spread-none-button-label = Nessun raggruppamento +pdfjs-spread-odd-button = + .title = Crea gruppi di pagine che iniziano con numeri di pagina dispari +pdfjs-spread-odd-button-label = Raggruppamento dispari +pdfjs-spread-even-button = + .title = Crea gruppi di pagine che iniziano con numeri di pagina pari +pdfjs-spread-even-button-label = Raggruppamento pari + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Proprietà del documento… +pdfjs-document-properties-button-label = Proprietà del documento… +pdfjs-document-properties-file-name = Nome file: +pdfjs-document-properties-file-size = Dimensione file: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } byte) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } byte) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } kB ({ $size_b } byte) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } byte) +pdfjs-document-properties-title = Titolo: +pdfjs-document-properties-author = Autore: +pdfjs-document-properties-subject = Oggetto: +pdfjs-document-properties-keywords = Parole chiave: +pdfjs-document-properties-creation-date = Data creazione: +pdfjs-document-properties-modification-date = Data modifica: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Autore originale: +pdfjs-document-properties-producer = Produttore PDF: +pdfjs-document-properties-version = Versione PDF: +pdfjs-document-properties-page-count = Conteggio pagine: +pdfjs-document-properties-page-size = Dimensioni pagina: +pdfjs-document-properties-page-size-unit-inches = in +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = verticale +pdfjs-document-properties-page-size-orientation-landscape = orizzontale +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Lettera +pdfjs-document-properties-page-size-name-legal = Legale + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Visualizzazione web veloce: +pdfjs-document-properties-linearized-yes = Sì +pdfjs-document-properties-linearized-no = No +pdfjs-document-properties-close-button = Chiudi + +## Print + +pdfjs-print-progress-message = Preparazione documento per la stampa… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Annulla +pdfjs-printing-not-supported = Attenzione: la stampa non è completamente supportata da questo browser. +pdfjs-printing-not-ready = Attenzione: il PDF non è ancora stato caricato completamente per la stampa. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Attiva/disattiva barra laterale +pdfjs-toggle-sidebar-notification-button = + .title = Attiva/disattiva barra laterale (il documento contiene struttura/allegati/livelli) +pdfjs-toggle-sidebar-button-label = Attiva/disattiva barra laterale +pdfjs-document-outline-button = + .title = Visualizza la struttura del documento (doppio clic per visualizzare/comprimere tutti gli elementi) +pdfjs-document-outline-button-label = Struttura documento +pdfjs-attachments-button = + .title = Visualizza allegati +pdfjs-attachments-button-label = Allegati +pdfjs-layers-button = + .title = Visualizza livelli (doppio clic per ripristinare tutti i livelli allo stato predefinito) +pdfjs-layers-button-label = Livelli +pdfjs-thumbs-button = + .title = Mostra le miniature +pdfjs-thumbs-button-label = Miniature +pdfjs-current-outline-item-button = + .title = Trova elemento struttura corrente +pdfjs-current-outline-item-button-label = Elemento struttura corrente +pdfjs-findbar-button = + .title = Trova nel documento +pdfjs-findbar-button-label = Trova +pdfjs-additional-layers = Livelli aggiuntivi + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Pagina { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Miniatura della pagina { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Trova + .placeholder = Trova nel documento… +pdfjs-find-previous-button = + .title = Trova l’occorrenza precedente del testo da cercare +pdfjs-find-previous-button-label = Precedente +pdfjs-find-next-button = + .title = Trova l’occorrenza successiva del testo da cercare +pdfjs-find-next-button-label = Successivo +pdfjs-find-highlight-checkbox = Evidenzia +pdfjs-find-match-case-checkbox-label = Maiuscole/minuscole +pdfjs-find-match-diacritics-checkbox-label = Segni diacritici +pdfjs-find-entire-word-checkbox-label = Parole intere +pdfjs-find-reached-top = Raggiunto l’inizio della pagina, continua dalla fine +pdfjs-find-reached-bottom = Raggiunta la fine della pagina, continua dall’inizio +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] { $current } di { $total } corrispondenza + *[other] { $current } di { $total } corrispondenze + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] Più di una { $limit } corrispondenza + *[other] Più di { $limit } corrispondenze + } +pdfjs-find-not-found = Testo non trovato + +## Predefined zoom values + +pdfjs-page-scale-width = Larghezza pagina +pdfjs-page-scale-fit = Adatta a una pagina +pdfjs-page-scale-auto = Zoom automatico +pdfjs-page-scale-actual = Dimensioni effettive +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Pagina { $page } + +## Loading indicator messages + +pdfjs-loading-error = Si è verificato un errore durante il caricamento del PDF. +pdfjs-invalid-file-error = File PDF non valido o danneggiato. +pdfjs-missing-file-error = File PDF non disponibile. +pdfjs-unexpected-response-error = Risposta imprevista del server +pdfjs-rendering-error = Si è verificato un errore durante il rendering della pagina. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [Annotazione: { $type }] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Inserire la password per aprire questo file PDF. +pdfjs-password-invalid = Password non corretta. Riprovare. +pdfjs-password-ok-button = OK +pdfjs-password-cancel-button = Annulla +pdfjs-web-fonts-disabled = I web font risultano disattivati: impossibile utilizzare i caratteri incorporati nel PDF. + +## Editing + +pdfjs-editor-free-text-button = + .title = Testo +pdfjs-editor-free-text-button-label = Testo +pdfjs-editor-ink-button = + .title = Disegno +pdfjs-editor-ink-button-label = Disegno +pdfjs-editor-stamp-button = + .title = Aggiungi o rimuovi immagine +pdfjs-editor-stamp-button-label = Aggiungi o rimuovi immagine +pdfjs-editor-highlight-button = + .title = Evidenzia +pdfjs-editor-highlight-button-label = Evidenzia +pdfjs-highlight-floating-button1 = + .title = Evidenzia + .aria-label = Evidenzia +pdfjs-highlight-floating-button-label = Evidenzia + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Rimuovi disegno +pdfjs-editor-remove-freetext-button = + .title = Rimuovi testo +pdfjs-editor-remove-stamp-button = + .title = Rimuovi immagine +pdfjs-editor-remove-highlight-button = + .title = Rimuovi evidenziazione + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Colore +pdfjs-editor-free-text-size-input = Dimensione +pdfjs-editor-ink-color-input = Colore +pdfjs-editor-ink-thickness-input = Spessore +pdfjs-editor-ink-opacity-input = Opacità +pdfjs-editor-stamp-add-image-button = + .title = Aggiungi immagine +pdfjs-editor-stamp-add-image-button-label = Aggiungi immagine +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Spessore +pdfjs-editor-free-highlight-thickness-title = + .title = Modifica lo spessore della selezione per elementi non testuali +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = Editor di testo + .default-content = Inizia a digitare… +pdfjs-free-text = + .aria-label = Editor di testo +pdfjs-free-text-default-content = Inizia a digitare… +pdfjs-ink = + .aria-label = Editor disegni +pdfjs-ink-canvas = + .aria-label = Immagine creata dall’utente + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = Testo alternativo +pdfjs-editor-alt-text-edit-button = + .aria-label = Modifica testo alternativo +pdfjs-editor-alt-text-edit-button-label = Modifica testo alternativo +pdfjs-editor-alt-text-dialog-label = Scegli un’opzione +pdfjs-editor-alt-text-dialog-description = Il testo alternativo (“alt text”) aiuta quando le persone non possono vedere l’immagine o quando l’immagine non viene caricata. +pdfjs-editor-alt-text-add-description-label = Aggiungi una descrizione +pdfjs-editor-alt-text-add-description-description = Punta a una o due frasi che descrivono l’argomento, l’ambientazione o le azioni. +pdfjs-editor-alt-text-mark-decorative-label = Contrassegna come decorativa +pdfjs-editor-alt-text-mark-decorative-description = Viene utilizzato per immagini ornamentali, come bordi o filigrane. +pdfjs-editor-alt-text-cancel-button = Annulla +pdfjs-editor-alt-text-save-button = Salva +pdfjs-editor-alt-text-decorative-tooltip = Contrassegnata come decorativa +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = Ad esempio, “Un giovane si siede a tavola per mangiare” +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = Testo alternativo + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Angolo in alto a sinistra — ridimensiona +pdfjs-editor-resizer-label-top-middle = Lato superiore nel mezzo — ridimensiona +pdfjs-editor-resizer-label-top-right = Angolo in alto a destra — ridimensiona +pdfjs-editor-resizer-label-middle-right = Lato destro nel mezzo — ridimensiona +pdfjs-editor-resizer-label-bottom-right = Angolo in basso a destra — ridimensiona +pdfjs-editor-resizer-label-bottom-middle = Lato inferiore nel mezzo — ridimensiona +pdfjs-editor-resizer-label-bottom-left = Angolo in basso a sinistra — ridimensiona +pdfjs-editor-resizer-label-middle-left = Lato sinistro nel mezzo — ridimensiona +pdfjs-editor-resizer-top-left = + .aria-label = Angolo in alto a sinistra — ridimensiona +pdfjs-editor-resizer-top-middle = + .aria-label = Lato superiore nel mezzo — ridimensiona +pdfjs-editor-resizer-top-right = + .aria-label = Angolo in alto a destra — ridimensiona +pdfjs-editor-resizer-middle-right = + .aria-label = Lato destro nel mezzo — ridimensiona +pdfjs-editor-resizer-bottom-right = + .aria-label = Angolo in basso a destra — ridimensiona +pdfjs-editor-resizer-bottom-middle = + .aria-label = Lato inferiore nel mezzo — ridimensiona +pdfjs-editor-resizer-bottom-left = + .aria-label = Angolo in basso a sinistra — ridimensiona +pdfjs-editor-resizer-middle-left = + .aria-label = Lato sinistro nel mezzo — ridimensiona + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Colore evidenziatore +pdfjs-editor-colorpicker-button = + .title = Cambia colore +pdfjs-editor-colorpicker-dropdown = + .aria-label = Colori disponibili +pdfjs-editor-colorpicker-yellow = + .title = Giallo +pdfjs-editor-colorpicker-green = + .title = Verde +pdfjs-editor-colorpicker-blue = + .title = Blu +pdfjs-editor-colorpicker-pink = + .title = Rosa +pdfjs-editor-colorpicker-red = + .title = Rosso + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Mostra tutto +pdfjs-editor-highlight-show-all-button = + .title = Mostra tutto + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = Modifica testo alternativo (descrizione dell’immagine) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = Aggiungi testo alternativo (descrizione dell’immagine) +pdfjs-editor-new-alt-text-textarea = + .placeholder = Scrivi qui la tua descrizione… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = Breve descrizione per le persone che non possono vedere l’immagine, o mostrata quando l’immagine non si carica. +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = Questo testo alternativo è stato creato automaticamente e potrebbe non essere accurato. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Ulteriori informazioni +pdfjs-editor-new-alt-text-create-automatically-button-label = Crea automaticamente testo alternativo +pdfjs-editor-new-alt-text-not-now-button = Non adesso +pdfjs-editor-new-alt-text-error-title = Impossibile creare automaticamente il testo alternativo +pdfjs-editor-new-alt-text-error-description = Scrivi il testo alternativo o riprova più tardi. +pdfjs-editor-new-alt-text-error-close-button = Chiudi +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = Download in corso del modello IA per il testo alternativo ({ $downloadedSize } di { $totalSize } MB) + .aria-valuetext = Download in corso del modello IA per il testo alternativo ({ $downloadedSize } di { $totalSize } MB) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = Aggiunto testo alternativo +pdfjs-editor-new-alt-text-added-button-label = Aggiunto testo alternativo +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = Testo alternativo mancante +pdfjs-editor-new-alt-text-missing-button-label = Testo alternativo mancante +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = Verifica testo alternativo +pdfjs-editor-new-alt-text-to-review-button-label = Verifica testo alternativo +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Creato automaticamente: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = Impostazioni testo alternativo per le immagini +pdfjs-image-alt-text-settings-button-label = Impostazioni testo alternativo per le immagini +pdfjs-editor-alt-text-settings-dialog-label = Impostazioni testo alternativo per le immagini +pdfjs-editor-alt-text-settings-automatic-title = Testo alternativo automatico +pdfjs-editor-alt-text-settings-create-model-button-label = Crea testo alternativo automaticamente +pdfjs-editor-alt-text-settings-create-model-description = Suggerisce una descrizione per le persone che non possono vedere l’immagine, o mostrata quando l’immagine non si carica. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = Modello IA per il testo alternativo ({ $totalSize } MB) +pdfjs-editor-alt-text-settings-ai-model-description = Viene eseguito localmente sul tuo dispositivo in modo che i tuoi dati rimangano riservati. È richiesto per la generazione automatica del testo alternativo. +pdfjs-editor-alt-text-settings-delete-model-button = Elimina +pdfjs-editor-alt-text-settings-download-model-button = Scarica +pdfjs-editor-alt-text-settings-downloading-model-button = Download… +pdfjs-editor-alt-text-settings-editor-title = Modifica testo alternativo +pdfjs-editor-alt-text-settings-show-dialog-button-label = Mostra l’editor del testo alternativo non appena si aggiunge un’immagine +pdfjs-editor-alt-text-settings-show-dialog-description = Ti aiuta ad assicurarti che tutte le tue immagini abbiano il testo alternativo. +pdfjs-editor-alt-text-settings-close-button = Chiudi + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = Evidenziazione rimossa +pdfjs-editor-undo-bar-message-freetext = Testo rimosso +pdfjs-editor-undo-bar-message-ink = Disegno rimosso +pdfjs-editor-undo-bar-message-stamp = Immagine rimossa +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = + { $count -> + [one] { $count } annotazione rimossa + *[other] { $count } annotazioni rimosse + } +pdfjs-editor-undo-bar-undo-button = + .title = Annulla +pdfjs-editor-undo-bar-undo-button-label = Annulla +pdfjs-editor-undo-bar-close-button = + .title = Chiudi +pdfjs-editor-undo-bar-close-button-label = Chiudi diff --git a/public/pdfjs/web/locale/ja/viewer.ftl b/public/pdfjs/web/locale/ja/viewer.ftl new file mode 100644 index 0000000..0f37f2a --- /dev/null +++ b/public/pdfjs/web/locale/ja/viewer.ftl @@ -0,0 +1,503 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = 前のページへ戻ります +pdfjs-previous-button-label = 前へ +pdfjs-next-button = + .title = 次のページへ進みます +pdfjs-next-button-label = 次へ +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = ページ +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = / { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } / { $pagesCount }) +pdfjs-zoom-out-button = + .title = 表示を縮小します +pdfjs-zoom-out-button-label = 縮小 +pdfjs-zoom-in-button = + .title = 表示を拡大します +pdfjs-zoom-in-button-label = 拡大 +pdfjs-zoom-select = + .title = 拡大/縮小 +pdfjs-presentation-mode-button = + .title = プレゼンテーションモードに切り替えます +pdfjs-presentation-mode-button-label = プレゼンテーションモード +pdfjs-open-file-button = + .title = ファイルを開きます +pdfjs-open-file-button-label = 開く +pdfjs-print-button = + .title = 印刷します +pdfjs-print-button-label = 印刷 +pdfjs-save-button = + .title = 保存します +pdfjs-save-button-label = 保存 +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = ダウンロードします +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = ダウンロード +pdfjs-bookmark-button = + .title = 現在のページの URL です (現在のページを表示する URL) +pdfjs-bookmark-button-label = 現在のページ + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = ツール +pdfjs-tools-button-label = ツール +pdfjs-first-page-button = + .title = 最初のページへ移動します +pdfjs-first-page-button-label = 最初のページへ移動 +pdfjs-last-page-button = + .title = 最後のページへ移動します +pdfjs-last-page-button-label = 最後のページへ移動 +pdfjs-page-rotate-cw-button = + .title = ページを右へ回転します +pdfjs-page-rotate-cw-button-label = 右回転 +pdfjs-page-rotate-ccw-button = + .title = ページを左へ回転します +pdfjs-page-rotate-ccw-button-label = 左回転 +pdfjs-cursor-text-select-tool-button = + .title = テキスト選択ツールを有効にします +pdfjs-cursor-text-select-tool-button-label = テキスト選択ツール +pdfjs-cursor-hand-tool-button = + .title = 手のひらツールを有効にします +pdfjs-cursor-hand-tool-button-label = 手のひらツール +pdfjs-scroll-page-button = + .title = ページ単位でスクロールします +pdfjs-scroll-page-button-label = ページ単位でスクロール +pdfjs-scroll-vertical-button = + .title = 縦スクロールにします +pdfjs-scroll-vertical-button-label = 縦スクロール +pdfjs-scroll-horizontal-button = + .title = 横スクロールにします +pdfjs-scroll-horizontal-button-label = 横スクロール +pdfjs-scroll-wrapped-button = + .title = 折り返しスクロールにします +pdfjs-scroll-wrapped-button-label = 折り返しスクロール +pdfjs-spread-none-button = + .title = 見開きにしません +pdfjs-spread-none-button-label = 見開きにしない +pdfjs-spread-odd-button = + .title = 奇数ページ開始で見開きにします +pdfjs-spread-odd-button-label = 奇数ページ見開き +pdfjs-spread-even-button = + .title = 偶数ページ開始で見開きにします +pdfjs-spread-even-button-label = 偶数ページ見開き + +## Document properties dialog + +pdfjs-document-properties-button = + .title = 文書のプロパティ... +pdfjs-document-properties-button-label = 文書のプロパティ... +pdfjs-document-properties-file-name = ファイル名: +pdfjs-document-properties-file-size = ファイルサイズ: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } バイト) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } バイト) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } バイト) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } バイト) +pdfjs-document-properties-title = タイトル: +pdfjs-document-properties-author = 作成者: +pdfjs-document-properties-subject = 件名: +pdfjs-document-properties-keywords = キーワード: +pdfjs-document-properties-creation-date = 作成日: +pdfjs-document-properties-modification-date = 更新日: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = アプリケーション: +pdfjs-document-properties-producer = PDF 作成: +pdfjs-document-properties-version = PDF のバージョン: +pdfjs-document-properties-page-count = ページ数: +pdfjs-document-properties-page-size = ページサイズ: +pdfjs-document-properties-page-size-unit-inches = in +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = 縦 +pdfjs-document-properties-page-size-orientation-landscape = 横 +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = レター +pdfjs-document-properties-page-size-name-legal = リーガル + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = ウェブ表示用に最適化: +pdfjs-document-properties-linearized-yes = はい +pdfjs-document-properties-linearized-no = いいえ +pdfjs-document-properties-close-button = 閉じる + +## Print + +pdfjs-print-progress-message = 文書の印刷を準備しています... +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = キャンセル +pdfjs-printing-not-supported = 警告: このブラウザーでは印刷が完全にサポートされていません。 +pdfjs-printing-not-ready = 警告: PDF を印刷するための読み込みが終了していません。 + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = サイドバー表示を切り替えます +pdfjs-toggle-sidebar-notification-button = + .title = サイドバー表示を切り替えます (文書に含まれるアウトライン / 添付 / レイヤー) +pdfjs-toggle-sidebar-button-label = サイドバーの切り替え +pdfjs-document-outline-button = + .title = 文書の目次を表示します (ダブルクリックで項目を開閉します) +pdfjs-document-outline-button-label = 文書の目次 +pdfjs-attachments-button = + .title = 添付ファイルを表示します +pdfjs-attachments-button-label = 添付ファイル +pdfjs-layers-button = + .title = レイヤーを表示します (ダブルクリックですべてのレイヤーが初期状態に戻ります) +pdfjs-layers-button-label = レイヤー +pdfjs-thumbs-button = + .title = 縮小版を表示します +pdfjs-thumbs-button-label = 縮小版 +pdfjs-current-outline-item-button = + .title = 現在のアウトライン項目を検索 +pdfjs-current-outline-item-button-label = 現在のアウトライン項目 +pdfjs-findbar-button = + .title = 文書内を検索します +pdfjs-findbar-button-label = 検索 +pdfjs-additional-layers = 追加レイヤー + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = { $page } ページ +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = { $page } ページの縮小版 + +## Find panel button title and messages + +pdfjs-find-input = + .title = 検索 + .placeholder = 文書内を検索... +pdfjs-find-previous-button = + .title = 現在より前の位置で指定文字列が現れる部分を検索します +pdfjs-find-previous-button-label = 前へ +pdfjs-find-next-button = + .title = 現在より後の位置で指定文字列が現れる部分を検索します +pdfjs-find-next-button-label = 次へ +pdfjs-find-highlight-checkbox = すべて強調表示 +pdfjs-find-match-case-checkbox-label = 大文字/小文字を区別 +pdfjs-find-match-diacritics-checkbox-label = 発音区別符号を区別 +pdfjs-find-entire-word-checkbox-label = 単語一致 +pdfjs-find-reached-top = 文書先頭に到達したので末尾から続けて検索します +pdfjs-find-reached-bottom = 文書末尾に到達したので先頭から続けて検索します +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = { $total } 件中 { $current } 件目 +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = { $limit } 件以上一致 +pdfjs-find-not-found = 見つかりませんでした + +## Predefined zoom values + +pdfjs-page-scale-width = 幅に合わせる +pdfjs-page-scale-fit = ページのサイズに合わせる +pdfjs-page-scale-auto = 自動ズーム +pdfjs-page-scale-actual = 実際のサイズ +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = { $page } ページ + +## Loading indicator messages + +pdfjs-loading-error = PDF の読み込み中にエラーが発生しました。 +pdfjs-invalid-file-error = 無効または破損した PDF ファイル。 +pdfjs-missing-file-error = PDF ファイルが見つかりません。 +pdfjs-unexpected-response-error = サーバーから予期せぬ応答がありました。 +pdfjs-rendering-error = ページのレンダリング中にエラーが発生しました。 + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } 注釈] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = この PDF ファイルを開くためのパスワードを入力してください。 +pdfjs-password-invalid = パスワードが正しくありません。もう一度試してください。 +pdfjs-password-ok-button = OK +pdfjs-password-cancel-button = キャンセル +pdfjs-web-fonts-disabled = ウェブフォントが無効になっています: 埋め込まれた PDF のフォントを使用できません。 + +## Editing + +pdfjs-editor-free-text-button = + .title = フリーテキスト注釈を追加します +pdfjs-editor-free-text-button-label = フリーテキスト注釈 +pdfjs-editor-ink-button = + .title = インク注釈を追加します +pdfjs-editor-ink-button-label = インク注釈 +pdfjs-editor-stamp-button = + .title = 画像を追加または編集します +pdfjs-editor-stamp-button-label = 画像を追加または編集 +pdfjs-editor-highlight-button = + .title = 強調します +pdfjs-editor-highlight-button-label = 強調 +pdfjs-highlight-floating-button1 = + .title = 強調 + .aria-label = 強調します +pdfjs-highlight-floating-button-label = 強調 + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = インク注釈を削除します +pdfjs-editor-remove-freetext-button = + .title = テキストを削除します +pdfjs-editor-remove-stamp-button = + .title = 画像を削除します +pdfjs-editor-remove-highlight-button = + .title = 強調を削除します + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = 色 +pdfjs-editor-free-text-size-input = サイズ +pdfjs-editor-ink-color-input = 色 +pdfjs-editor-ink-thickness-input = 太さ +pdfjs-editor-ink-opacity-input = 不透明度 +pdfjs-editor-stamp-add-image-button = + .title = 画像を追加します +pdfjs-editor-stamp-add-image-button-label = 画像を追加 +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = 太さ +pdfjs-editor-free-highlight-thickness-title = + .title = テキスト以外のアイテムを強調する時の太さを変更します +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = フリーテキスト注釈エディター + .default-content = テキストを入力してください... +pdfjs-free-text = + .aria-label = フリーテキスト注釈エディター +pdfjs-free-text-default-content = テキストを入力してください... +pdfjs-ink = + .aria-label = インク注釈エディター +pdfjs-ink-canvas = + .aria-label = ユーザー作成画像 + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = 代替テキスト +pdfjs-editor-alt-text-edit-button = + .aria-label = 代替テキストを編集 +pdfjs-editor-alt-text-edit-button-label = 代替テキストを編集 +pdfjs-editor-alt-text-dialog-label = オプションの選択 +pdfjs-editor-alt-text-dialog-description = 代替テキストは画像が表示されない場合や読み込まれない場合にユーザーの助けになります。 +pdfjs-editor-alt-text-add-description-label = 説明を追加 +pdfjs-editor-alt-text-add-description-description = 対象や設定、動作を説明する短い文章を記入してください。 +pdfjs-editor-alt-text-mark-decorative-label = 装飾マークを付ける +pdfjs-editor-alt-text-mark-decorative-description = これは区切り線やウォーターマークなどの装飾画像に使用されます。 +pdfjs-editor-alt-text-cancel-button = キャンセル +pdfjs-editor-alt-text-save-button = 保存 +pdfjs-editor-alt-text-decorative-tooltip = 装飾マークが付いています +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = 例:「若い人がテーブルの席について食事をしています」 +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = 代替テキスト + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = 左上隅 — サイズ変更 +pdfjs-editor-resizer-label-top-middle = 上中央 — サイズ変更 +pdfjs-editor-resizer-label-top-right = 右上隅 — サイズ変更 +pdfjs-editor-resizer-label-middle-right = 右中央 — サイズ変更 +pdfjs-editor-resizer-label-bottom-right = 右下隅 — サイズ変更 +pdfjs-editor-resizer-label-bottom-middle = 下中央 — サイズ変更 +pdfjs-editor-resizer-label-bottom-left = 左下隅 — サイズ変更 +pdfjs-editor-resizer-label-middle-left = 左中央 — サイズ変更 +pdfjs-editor-resizer-top-left = + .aria-label = 左上隅 — サイズ変更 +pdfjs-editor-resizer-top-middle = + .aria-label = 上中央 — サイズ変更 +pdfjs-editor-resizer-top-right = + .aria-label = 右上隅 — サイズ変更 +pdfjs-editor-resizer-middle-right = + .aria-label = 右中央 — サイズ変更 +pdfjs-editor-resizer-bottom-right = + .aria-label = 右下隅 — サイズ変更 +pdfjs-editor-resizer-bottom-middle = + .aria-label = 下中央 — サイズ変更 +pdfjs-editor-resizer-bottom-left = + .aria-label = 左下隅 — サイズ変更 +pdfjs-editor-resizer-middle-left = + .aria-label = 左中央 — サイズ変更 + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = 強調色 +pdfjs-editor-colorpicker-button = + .title = 色を変更します +pdfjs-editor-colorpicker-dropdown = + .aria-label = 色の選択 +pdfjs-editor-colorpicker-yellow = + .title = 黄色 +pdfjs-editor-colorpicker-green = + .title = 緑色 +pdfjs-editor-colorpicker-blue = + .title = 青色 +pdfjs-editor-colorpicker-pink = + .title = ピンク色 +pdfjs-editor-colorpicker-red = + .title = 赤色 + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = すべて表示 +# (^m^) en-US: .title = Show all +pdfjs-editor-highlight-show-all-button = + .title = 強調の表示を切り替えます + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = 代替テキストを編集 (画像の説明) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = 代替テキストを追加 (画像の説明) +pdfjs-editor-new-alt-text-textarea = + .placeholder = ここに説明を記入してください... +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = 画像が読み込まれない場合や見えない人のための短い説明です。 +pdfjs-editor-new-alt-text-disclaimer1 = この代替テキストは自動的に生成されたため正確でない可能性があります。 +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = 詳細情報 +pdfjs-editor-new-alt-text-create-automatically-button-label = 代替テキストを自動生成 +pdfjs-editor-new-alt-text-not-now-button = 後で +pdfjs-editor-new-alt-text-error-title = 代替テキストを自動生成できませんでした +pdfjs-editor-new-alt-text-error-description = ご自分で代替テキストを書くか後でもう一度試してください。 +pdfjs-editor-new-alt-text-error-close-button = 閉じる +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = 代替テキスト AI モデルをダウンロードしています ({ $downloadedSize } / { $totalSize } MB) + .aria-valuetext = 代替テキスト AI モデルをダウンロードしています ({ $downloadedSize } / { $totalSize } MB) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = 代替テキストを追加しました +pdfjs-editor-new-alt-text-added-button-label = 代替テキストを追加しました +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = 代替テキストがありません +pdfjs-editor-new-alt-text-missing-button-label = 代替テキストがありません +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = 代替テキストをレビュー +pdfjs-editor-new-alt-text-to-review-button-label = 代替テキストをレビュー +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = 自動生成されました: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = 画像の代替テキスト設定 +pdfjs-image-alt-text-settings-button-label = 画像の代替テキスト設定 +pdfjs-editor-alt-text-settings-dialog-label = 画像の代替テキスト設定 +pdfjs-editor-alt-text-settings-automatic-title = 自動代替テキスト +pdfjs-editor-alt-text-settings-create-model-button-label = 代替テキストを自動生成 +pdfjs-editor-alt-text-settings-create-model-description = 画像が読み込まれない場合や見えない人のために説明を提案します。 +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = 代替テキスト AI モデル ({ $totalSize } MB) +pdfjs-editor-alt-text-settings-ai-model-description = ローカルの端末上で実行されるためデータは非公開になります。代替テキストの自動生成に必要です。 +pdfjs-editor-alt-text-settings-delete-model-button = 削除 +pdfjs-editor-alt-text-settings-download-model-button = ダウンロード +pdfjs-editor-alt-text-settings-downloading-model-button = ダウンロード中... +pdfjs-editor-alt-text-settings-editor-title = 代替テキストエディター +pdfjs-editor-alt-text-settings-show-dialog-button-label = 画像の追加時に代替テキストエディターを表示する +pdfjs-editor-alt-text-settings-show-dialog-description = すべての画像に代替テキストを追加する助けになります。 +pdfjs-editor-alt-text-settings-close-button = 閉じる + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = 強調表示が削除されました +pdfjs-editor-undo-bar-message-freetext = フリーテキスト注釈が削除されました +pdfjs-editor-undo-bar-message-ink = インク注釈が削除されました +pdfjs-editor-undo-bar-message-stamp = 画像が削除されました +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = { $count } 個の注釈が削除されました +pdfjs-editor-undo-bar-undo-button = + .title = 元に戻す +pdfjs-editor-undo-bar-undo-button-label = 元に戻す +pdfjs-editor-undo-bar-close-button = + .title = 閉じる +pdfjs-editor-undo-bar-close-button-label = 閉じる diff --git a/public/pdfjs/web/locale/ka/viewer.ftl b/public/pdfjs/web/locale/ka/viewer.ftl new file mode 100644 index 0000000..d500f3e --- /dev/null +++ b/public/pdfjs/web/locale/ka/viewer.ftl @@ -0,0 +1,515 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = წინა გვერდი +pdfjs-previous-button-label = წინა +pdfjs-next-button = + .title = შემდეგი გვერდი +pdfjs-next-button-label = შემდეგი +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = გვერდი +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = { $pagesCount }-დან +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } { $pagesCount }-დან) +pdfjs-zoom-out-button = + .title = ზომის შემცირება +pdfjs-zoom-out-button-label = დაშორება +pdfjs-zoom-in-button = + .title = ზომის გაზრდა +pdfjs-zoom-in-button-label = მოახლოება +pdfjs-zoom-select = + .title = ზომა +pdfjs-presentation-mode-button = + .title = წარდგენის რეჟიმზე გადართვა +pdfjs-presentation-mode-button-label = წარდგენის რეჟიმი +pdfjs-open-file-button = + .title = ფაილის გახსნა +pdfjs-open-file-button-label = გახსნა +pdfjs-print-button = + .title = ამობეჭდვა +pdfjs-print-button-label = ამობეჭდვა +pdfjs-save-button = + .title = შენახვა +pdfjs-save-button-label = შენახვა +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = ჩამოტვირთვა +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = ჩამოტვირთვა +pdfjs-bookmark-button = + .title = მიმდინარე გვერდი (ბმული ამ გვერდისთვის) +pdfjs-bookmark-button-label = მიმდინარე გვერდი + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = ხელსაწყოები +pdfjs-tools-button-label = ხელსაწყოები +pdfjs-first-page-button = + .title = პირველ გვერდზე გადასვლა +pdfjs-first-page-button-label = პირველ გვერდზე გადასვლა +pdfjs-last-page-button = + .title = ბოლო გვერდზე გადასვლა +pdfjs-last-page-button-label = ბოლო გვერდზე გადასვლა +pdfjs-page-rotate-cw-button = + .title = საათის ისრის მიმართულებით შებრუნება +pdfjs-page-rotate-cw-button-label = მარჯვნივ გადაბრუნება +pdfjs-page-rotate-ccw-button = + .title = საათის ისრის საპირისპიროდ შებრუნება +pdfjs-page-rotate-ccw-button-label = მარცხნივ გადაბრუნება +pdfjs-cursor-text-select-tool-button = + .title = მოსანიშნი მაჩვენებლის გამოყენება +pdfjs-cursor-text-select-tool-button-label = მოსანიშნი მაჩვენებელი +pdfjs-cursor-hand-tool-button = + .title = გადასაადგილებელი მაჩვენებლის გამოყენება +pdfjs-cursor-hand-tool-button-label = გადასაადგილებელი +pdfjs-scroll-page-button = + .title = გვერდზე გადაადგილების გამოყენება +pdfjs-scroll-page-button-label = გვერდშივე გადაადგილება +pdfjs-scroll-vertical-button = + .title = გვერდების შვეულად ჩვენება +pdfjs-scroll-vertical-button-label = შვეული გადაადგილება +pdfjs-scroll-horizontal-button = + .title = გვერდების თარაზულად ჩვენება +pdfjs-scroll-horizontal-button-label = განივი გადაადგილება +pdfjs-scroll-wrapped-button = + .title = გვერდების ცხრილურად ჩვენება +pdfjs-scroll-wrapped-button-label = ცხრილური გადაადგილება +pdfjs-spread-none-button = + .title = ორ გვერდზე გაშლის გარეშე +pdfjs-spread-none-button-label = ცალგვერდიანი ჩვენება +pdfjs-spread-odd-button = + .title = ორ გვერდზე გაშლა კენტი გვერდიდან +pdfjs-spread-odd-button-label = ორ გვერდზე კენტიდან +pdfjs-spread-even-button = + .title = ორ გვერდზე გაშლა ლუწი გვერდიდან +pdfjs-spread-even-button-label = ორ გვერდზე ლუწიდან + +## Document properties dialog + +pdfjs-document-properties-button = + .title = დოკუმენტის შესახებ… +pdfjs-document-properties-button-label = დოკუმენტის შესახებ… +pdfjs-document-properties-file-name = ფაილის სახელი: +pdfjs-document-properties-file-size = ფაილის მოცულობა: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } კბაიტი ({ $b } ბაიტი) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } მბაიტი ({ $b } ბაიტი) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } კბ ({ $size_b } ბაიტი) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } მბ ({ $size_b } ბაიტი) +pdfjs-document-properties-title = სათაური: +pdfjs-document-properties-author = შემქმნელი: +pdfjs-document-properties-subject = თემა: +pdfjs-document-properties-keywords = საკვანძო სიტყვები: +pdfjs-document-properties-creation-date = შექმნის დრო: +pdfjs-document-properties-modification-date = ჩასწორების დრო: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = შემდგენელი: +pdfjs-document-properties-producer = PDF-შემდგენელი: +pdfjs-document-properties-version = PDF-ვერსია: +pdfjs-document-properties-page-count = გვერდები: +pdfjs-document-properties-page-size = გვერდის ზომა: +pdfjs-document-properties-page-size-unit-inches = დუიმი +pdfjs-document-properties-page-size-unit-millimeters = მმ +pdfjs-document-properties-page-size-orientation-portrait = შვეულად +pdfjs-document-properties-page-size-orientation-landscape = თარაზულად +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Letter +pdfjs-document-properties-page-size-name-legal = Legal + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = მსუბუქი ვებჩვენება: +pdfjs-document-properties-linearized-yes = დიახ +pdfjs-document-properties-linearized-no = არა +pdfjs-document-properties-close-button = დახურვა + +## Print + +pdfjs-print-progress-message = დოკუმენტი მზადდება ამოსაბეჭდად… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = გაუქმება +pdfjs-printing-not-supported = გაფრთხილება: ამობეჭდვა ამ ბრაუზერში არაა სრულად მხარდაჭერილი. +pdfjs-printing-not-ready = გაფრთხილება: PDF სრულად ჩატვირთული არაა, ამობეჭდვის დასაწყებად. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = გვერდითა ზოლის გამოჩენა/დამალვა +pdfjs-toggle-sidebar-notification-button = + .title = გვერდითი ზოლის გამოჩენა (შეიცავს სარჩევს/დანართს/შრეებს) +pdfjs-toggle-sidebar-button-label = გვერდითა ზოლის გამოჩენა/დამალვა +pdfjs-document-outline-button = + .title = დოკუმენტის სარჩევის ჩვენება (ორმაგი წკაპით თითოეულის ჩამოშლა/აკეცვა) +pdfjs-document-outline-button-label = დოკუმენტის სარჩევი +pdfjs-attachments-button = + .title = დანართების ჩვენება +pdfjs-attachments-button-label = დანართები +pdfjs-layers-button = + .title = შრეების გამოჩენა (ორმაგი წკაპით ყველა შრის ნაგულისხმევზე დაბრუნება) +pdfjs-layers-button-label = შრეები +pdfjs-thumbs-button = + .title = შეთვალიერება +pdfjs-thumbs-button-label = ესკიზები +pdfjs-current-outline-item-button = + .title = მიმდინარე გვერდის მონახვა სარჩევში +pdfjs-current-outline-item-button-label = მიმდინარე გვერდი სარჩევში +pdfjs-findbar-button = + .title = პოვნა დოკუმენტში +pdfjs-findbar-button-label = ძიება +pdfjs-additional-layers = დამატებითი შრეები + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = გვერდი { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = გვერდის შეთვალიერება { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = ძიება + .placeholder = პოვნა დოკუმენტში… +pdfjs-find-previous-button = + .title = წინა დამთხვევის პოვნა +pdfjs-find-previous-button-label = წინა +pdfjs-find-next-button = + .title = მომდევნო დამთხვევის პოვნა +pdfjs-find-next-button-label = შემდეგი +pdfjs-find-highlight-checkbox = ყველაფრის მონიშვნა +pdfjs-find-match-case-checkbox-label = მთავრულით +pdfjs-find-match-diacritics-checkbox-label = ნიშნებით +pdfjs-find-entire-word-checkbox-label = მთლიანი სიტყვები +pdfjs-find-reached-top = მიღწეულია დოკუმენტის დასაწყისი, გრძელდება ბოლოდან +pdfjs-find-reached-bottom = მიღწეულია დოკუმენტის ბოლო, გრძელდება დასაწყისიდან +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] თანხვედრა { $current }, სულ { $total } + *[other] თანხვედრა { $current }, სულ { $total } + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] არანაკლებ { $limit } თანხვედრა + *[other] არანაკლებ { $limit } თანხვედრა + } +pdfjs-find-not-found = ფრაზა ვერ მოიძებნა + +## Predefined zoom values + +pdfjs-page-scale-width = გვერდის სიგანეზე +pdfjs-page-scale-fit = მთლიანი გვერდი +pdfjs-page-scale-auto = ავტომატური +pdfjs-page-scale-actual = საწყისი ზომა +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = გვერდი { $page } + +## Loading indicator messages + +pdfjs-loading-error = შეცდომა, PDF-ფაილის ჩატვირთვისას. +pdfjs-invalid-file-error = არამართებული ან დაზიანებული PDF-ფაილი. +pdfjs-missing-file-error = ნაკლული PDF-ფაილი. +pdfjs-unexpected-response-error = სერვერის მოულოდნელი პასუხი. +pdfjs-rendering-error = შეცდომა, გვერდის ჩვენებისას. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } შენიშვნა] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = შეიყვანეთ პაროლი PDF-ფაილის გასახსნელად. +pdfjs-password-invalid = არასწორი პაროლი. გთხოვთ, სცადოთ ხელახლა. +pdfjs-password-ok-button = კარგი +pdfjs-password-cancel-button = გაუქმება +pdfjs-web-fonts-disabled = ვებშრიფტები გამორთულია: ჩაშენებული PDF-შრიფტების გამოყენება ვერ ხერხდება. + +## Editing + +pdfjs-editor-free-text-button = + .title = წარწერა +pdfjs-editor-free-text-button-label = წარწერა +pdfjs-editor-ink-button = + .title = ხაზვა +pdfjs-editor-ink-button-label = ხაზვა +pdfjs-editor-stamp-button = + .title = სურათების დართვა ან ჩასწორება +pdfjs-editor-stamp-button-label = სურათების დართვა ან ჩასწორება +pdfjs-editor-highlight-button = + .title = მონიშვნა +pdfjs-editor-highlight-button-label = მონიშვნა +pdfjs-highlight-floating-button1 = + .title = მონიშვნა + .aria-label = მონიშვნა +pdfjs-highlight-floating-button-label = მონიშვნა + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = დახაზულის მოცილება +pdfjs-editor-remove-freetext-button = + .title = წარწერის მოცილება +pdfjs-editor-remove-stamp-button = + .title = სურათის მოცილება +pdfjs-editor-remove-highlight-button = + .title = მონიშვნის მოცილება + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = ფერი +pdfjs-editor-free-text-size-input = ზომა +pdfjs-editor-ink-color-input = ფერი +pdfjs-editor-ink-thickness-input = სისქე +pdfjs-editor-ink-opacity-input = გაუმჭვირვალობა +pdfjs-editor-stamp-add-image-button = + .title = სურათის დამატება +pdfjs-editor-stamp-add-image-button-label = სურათის დამატება +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = სისქე +pdfjs-editor-free-highlight-thickness-title = + .title = სისქის შეცვლა წარწერის გარდა სხვა ნაწილების მონიშვნისას +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = ნაწერის ჩასწორება + .default-content = დაიწყეთ აკრეფა… +pdfjs-free-text = + .aria-label = ნაწერის ჩასწორება +pdfjs-free-text-default-content = აკრიფეთ… +pdfjs-ink = + .aria-label = დახაზულის შესწორება +pdfjs-ink-canvas = + .aria-label = მომხმარებლის შექმნილი სურათი + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = თანდართული წარწერა +pdfjs-editor-alt-text-edit-button = + .aria-label = დართული წარწერის ჩასწორება +pdfjs-editor-alt-text-edit-button-label = თანდართული წარწერის ჩასწორება +pdfjs-editor-alt-text-dialog-label = არჩევა +pdfjs-editor-alt-text-dialog-description = თანდართული (შემნაცვლებელი) წარწერა გამოსადეგია მათთვის, ვინც ვერ ხედავს სურათებს ან გამოისახება მაშინ, როცა სურათი ვერ ჩაიტვირთება. +pdfjs-editor-alt-text-add-description-label = აღწერილობის მითითება +pdfjs-editor-alt-text-add-description-description = განკუთვნილია 1-2 წინადადებით საგნის, მახასიათებლის ან მოქმედების აღსაწერად. +pdfjs-editor-alt-text-mark-decorative-label = მოინიშნოს მორთულობად +pdfjs-editor-alt-text-mark-decorative-description = განკუთვნილია შესამკობი სურათებისთვის, გარსშემოსავლები ჩარჩოებისა და ჭვირნიშნებისთვის. +pdfjs-editor-alt-text-cancel-button = გაუქმება +pdfjs-editor-alt-text-save-button = შენახვა +pdfjs-editor-alt-text-decorative-tooltip = მოინიშნოს მორთულობად +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = მაგალითად, „ახალგაზრდა მამაკაცი მაგიდასთან ზის და სადილობს“ +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = დართული წარწერა + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = ზევით მარცხნივ — ზომაცვლა +pdfjs-editor-resizer-label-top-middle = ზევით შუაში — ზომაცვლა +pdfjs-editor-resizer-label-top-right = ზევით მარჯვნივ — ზომაცვლა +pdfjs-editor-resizer-label-middle-right = შუაში მარჯვნივ — ზომაცვლა +pdfjs-editor-resizer-label-bottom-right = ქვევით მარჯვნივ — ზომაცვლა +pdfjs-editor-resizer-label-bottom-middle = ქვევით შუაში — ზომაცვლა +pdfjs-editor-resizer-label-bottom-left = ზვევით მარცხნივ — ზომაცვლა +pdfjs-editor-resizer-label-middle-left = შუაში მარცხნივ — ზომაცვლა +pdfjs-editor-resizer-top-left = + .aria-label = ზევით მარცხნივ — ზომაცვლა +pdfjs-editor-resizer-top-middle = + .aria-label = ზევით შუაში — ზომაცვლა +pdfjs-editor-resizer-top-right = + .aria-label = ზევით მარჯვნივ — ზომაცვლა +pdfjs-editor-resizer-middle-right = + .aria-label = შუაში მარჯვნივ — ზომაცვლა +pdfjs-editor-resizer-bottom-right = + .aria-label = ქვევით მარჯვნივ — ზომაცვლა +pdfjs-editor-resizer-bottom-middle = + .aria-label = ქვევით შუაში — ზომაცვლა +pdfjs-editor-resizer-bottom-left = + .aria-label = ზვევით მარცხნივ — ზომაცვლა +pdfjs-editor-resizer-middle-left = + .aria-label = შუაში მარცხნივ — ზომაცვლა + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = მოსანიშნი ფერი +pdfjs-editor-colorpicker-button = + .title = ფერის შეცვლა +pdfjs-editor-colorpicker-dropdown = + .aria-label = ფერის არჩევა +pdfjs-editor-colorpicker-yellow = + .title = ყვითელი +pdfjs-editor-colorpicker-green = + .title = მწვანე +pdfjs-editor-colorpicker-blue = + .title = ლურჯი +pdfjs-editor-colorpicker-pink = + .title = ვარდისფერი +pdfjs-editor-colorpicker-red = + .title = წითელი + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = ყველას ჩვენება +pdfjs-editor-highlight-show-all-button = + .title = ყველას ჩვენება + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = დართული წარწერის ჩასწორება (სურათის აღწერის) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = დართული წარწერის დამატება (სურათის აღწერის) +pdfjs-editor-new-alt-text-textarea = + .placeholder = დაწერეთ თქვენი აღწერა აქ… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = მოკლე აღწერა მათთვის, ვინც ვერ ხედავს სურათს ან ვისთანაც ვერ ჩაიტვირთება სურათი. +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = ეს დართული წარწერა ავტომატურადაა შედგენილი და შესაძლოა, უმართებულო იყოს. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = ვრცლად +pdfjs-editor-new-alt-text-create-automatically-button-label = დართული წარწერის ავტომატური შედგენა +pdfjs-editor-new-alt-text-not-now-button = ახლა არა +pdfjs-editor-new-alt-text-error-title = დართული წარწერის შედგენა ვერ მოხერხდა +pdfjs-editor-new-alt-text-error-description = გთხოვთ დაწეროთ საკუთარი დანართი და კვლავ სცადოთ მოგვიანებით. +pdfjs-editor-new-alt-text-error-close-button = დახურვა +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = ჩამოიტვირთება დართული წარწერის შესადეგი AI-მოდელი ({ $downloadedSize } ზომით { $totalSize } მბაიტი) + .aria-valuetext = ჩამოიტვირთება დართული წარწერის შესადეგი AI-მოდელი ({ $downloadedSize } ზომით { $totalSize } მბაიტი) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = დართული წარწერა დამატებულია +pdfjs-editor-new-alt-text-added-button-label = დართული წარწერა დამატებულია +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = აკლია დართული წარწერა +pdfjs-editor-new-alt-text-missing-button-label = აკლია დართული წარწერა +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = დართული წარწერის გადახედვა +pdfjs-editor-new-alt-text-to-review-button-label = დართული წარწერის გადახედვა +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = შედგენილია ავტომატურად: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = სურათის დართული წარწერის პარამეტრები +pdfjs-image-alt-text-settings-button-label = სურათის დართული წარწერის პარამეტრები +pdfjs-editor-alt-text-settings-dialog-label = სურათის დართული წარწერის პარამეტრები +pdfjs-editor-alt-text-settings-automatic-title = ავტომატურად დართული წარწერა +pdfjs-editor-alt-text-settings-create-model-button-label = დართული წარწერის ავტომატური შედგენა +pdfjs-editor-alt-text-settings-create-model-description = აღწერს სურათს მათთვის, ვინც ვერ ხედავს ან ვისთანაც ვერ ჩაიტვირთება. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = დართული წარწერის შესადგენი AI-მოდელი ({ $totalSize } მბაიტი) +pdfjs-editor-alt-text-settings-ai-model-description = ეშვება ადგილობრივად თქვენს მოწყობილობასა, ასე რომ მონაცემები დარჩება პირადი. საჭიროა წარწერის ავტომატურად დართვისთვის. +pdfjs-editor-alt-text-settings-delete-model-button = წაშლა +pdfjs-editor-alt-text-settings-download-model-button = ჩამოტვირთვა +pdfjs-editor-alt-text-settings-downloading-model-button = ჩამოიტვრითება... +pdfjs-editor-alt-text-settings-editor-title = დართული წარწერის ჩამსწორებელი +pdfjs-editor-alt-text-settings-show-dialog-button-label = გამოჩნდეს დართული წარწერის ჩამსწორებელი სურათის დამატებისთანავე +pdfjs-editor-alt-text-settings-show-dialog-description = უზრუნველყოფს, რომ თქვენს ყველა სურათს ახლდეს დართული წარწერა. +pdfjs-editor-alt-text-settings-close-button = დახურვა + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = მონიშვნა მოცილებულია +pdfjs-editor-undo-bar-message-freetext = წარწერა მოცილებულია +pdfjs-editor-undo-bar-message-ink = ნახატი მოცილებულია +pdfjs-editor-undo-bar-message-stamp = სურათი მოცილებულია +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = + { $count -> + [one] { $count } შენიშვნა მოცილებულია + *[other] { $count } შენიშვნა მოცილებულია + } +pdfjs-editor-undo-bar-undo-button = + .title = დაბრუნება +pdfjs-editor-undo-bar-undo-button-label = დაბრუნება +pdfjs-editor-undo-bar-close-button = + .title = დახურვა +pdfjs-editor-undo-bar-close-button-label = დახურვა diff --git a/public/pdfjs/web/locale/kab/viewer.ftl b/public/pdfjs/web/locale/kab/viewer.ftl new file mode 100644 index 0000000..dda88c1 --- /dev/null +++ b/public/pdfjs/web/locale/kab/viewer.ftl @@ -0,0 +1,438 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Asebter azewwar +pdfjs-previous-button-label = Azewwar +pdfjs-next-button = + .title = Asebter d-iteddun +pdfjs-next-button-label = Ddu ɣer zdat +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Asebter +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = ɣef { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } n { $pagesCount }) +pdfjs-zoom-out-button = + .title = Semẓi +pdfjs-zoom-out-button-label = Semẓi +pdfjs-zoom-in-button = + .title = Semɣeṛ +pdfjs-zoom-in-button-label = Semɣeṛ +pdfjs-zoom-select = + .title = Semɣeṛ/Semẓi +pdfjs-presentation-mode-button = + .title = Uɣal ɣer Uskar Tihawt +pdfjs-presentation-mode-button-label = Askar Tihawt +pdfjs-open-file-button = + .title = Ldi Afaylu +pdfjs-open-file-button-label = Ldi +pdfjs-print-button = + .title = Siggez +pdfjs-print-button-label = Siggez +pdfjs-save-button = + .title = Sekles +pdfjs-save-button-label = Sekles +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Sader +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Sader +pdfjs-bookmark-button = + .title = Asebter amiran (Sken-d tansa URL seg usebter amiran) +pdfjs-bookmark-button-label = Asebter amiran + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Ifecka +pdfjs-tools-button-label = Ifecka +pdfjs-first-page-button = + .title = Ddu ɣer usebter amezwaru +pdfjs-first-page-button-label = Ddu ɣer usebter amezwaru +pdfjs-last-page-button = + .title = Ddu ɣer usebter aneggaru +pdfjs-last-page-button-label = Ddu ɣer usebter aneggaru +pdfjs-page-rotate-cw-button = + .title = Tuzzya tusrigt +pdfjs-page-rotate-cw-button-label = Tuzzya tusrigt +pdfjs-page-rotate-ccw-button = + .title = Tuzzya amgal-usrig +pdfjs-page-rotate-ccw-button-label = Tuzzya amgal-usrig +pdfjs-cursor-text-select-tool-button = + .title = Rmed afecku n tefrant n uḍris +pdfjs-cursor-text-select-tool-button-label = Afecku n tefrant n uḍris +pdfjs-cursor-hand-tool-button = + .title = Rmed afecku afus +pdfjs-cursor-hand-tool-button-label = Afecku afus +pdfjs-scroll-page-button = + .title = Seqdec adrurem n usebter +pdfjs-scroll-page-button-label = Adrurem n usebter +pdfjs-scroll-vertical-button = + .title = Seqdec adrurem ubdid +pdfjs-scroll-vertical-button-label = Adrurem ubdid +pdfjs-scroll-horizontal-button = + .title = Seqdec adrurem aglawan +pdfjs-scroll-horizontal-button-label = Adrurem aglawan +pdfjs-scroll-wrapped-button = + .title = Seqdec adrurem yuẓen +pdfjs-scroll-wrapped-button-label = Adrurem yuẓen +pdfjs-spread-none-button = + .title = Ur sedday ara isiɣzaf n usebter +pdfjs-spread-none-button-label = Ulac isiɣzaf +pdfjs-spread-odd-button = + .title = Seddu isiɣzaf n usebter ibeddun s yisebtar irayuganen +pdfjs-spread-odd-button-label = Isiɣzaf irayuganen +pdfjs-spread-even-button = + .title = Seddu isiɣzaf n usebter ibeddun s yisebtar iyuganen +pdfjs-spread-even-button-label = Isiɣzaf iyuganen + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Taɣaṛa n isemli… +pdfjs-document-properties-button-label = Taɣaṛa n isemli… +pdfjs-document-properties-file-name = Isem n ufaylu: +pdfjs-document-properties-file-size = Teɣzi n ufaylu: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } yibiten) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } yibiten) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KAṬ ({ $size_b } ibiten) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MAṬ ({ $size_b } iṭamḍanen) +pdfjs-document-properties-title = Azwel: +pdfjs-document-properties-author = Ameskar: +pdfjs-document-properties-subject = Amgay: +pdfjs-document-properties-keywords = Awalen n tsaruţ +pdfjs-document-properties-creation-date = Azemz n tmerna: +pdfjs-document-properties-modification-date = Azemz n usnifel: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Yerna-t: +pdfjs-document-properties-producer = Afecku n uselket PDF: +pdfjs-document-properties-version = Lqem PDF: +pdfjs-document-properties-page-count = Amḍan n yisebtar: +pdfjs-document-properties-page-size = Tuγzi n usebter: +pdfjs-document-properties-page-size-unit-inches = deg +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = s teɣzi +pdfjs-document-properties-page-size-orientation-landscape = s tehri +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Asekkil +pdfjs-document-properties-page-size-name-legal = Usḍif + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Taskant Web taruradt: +pdfjs-document-properties-linearized-yes = Ih +pdfjs-document-properties-linearized-no = Ala +pdfjs-document-properties-close-button = Mdel + +## Print + +pdfjs-print-progress-message = Aheggi i usiggez n isemli… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Sefsex +pdfjs-printing-not-supported = Ɣuṛ-k: Asiggez ur ittusefrak ara yakan imaṛṛa deg iminig-a. +pdfjs-printing-not-ready = Ɣuṛ-k: Afaylu PDF ur d-yuli ara imeṛṛa akken ad ittusiggez. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Sken/Fer agalis adisan +pdfjs-toggle-sidebar-notification-button = + .title = Ffer/Sekn agalis adisan (isemli yegber aɣawas/ticeqqufin yeddan/tissiwin) +pdfjs-toggle-sidebar-button-label = Sken/Fer agalis adisan +pdfjs-document-outline-button = + .title = Sken isemli (Senned snat tikal i wesemɣer/Afneẓ n iferdisen meṛṛa) +pdfjs-document-outline-button-label = Isɣalen n isebtar +pdfjs-attachments-button = + .title = Sken ticeqqufin yeddan +pdfjs-attachments-button-label = Ticeqqufin yeddan +pdfjs-layers-button = + .title = Skeen tissiwin (sit sin yiberdan i uwennez n meṛṛa tissiwin ɣer waddad amezwer) +pdfjs-layers-button-label = Tissiwin +pdfjs-thumbs-button = + .title = Sken tanfult. +pdfjs-thumbs-button-label = Tinfulin +pdfjs-current-outline-item-button = + .title = Af-d aferdis n uɣawas amiran +pdfjs-current-outline-item-button-label = Aferdis n uɣawas amiran +pdfjs-findbar-button = + .title = Nadi deg isemli +pdfjs-findbar-button-label = Nadi +pdfjs-additional-layers = Tissiwin-nniḍen + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Asebter { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Tanfult n usebter { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Nadi + .placeholder = Nadi deg isemli… +pdfjs-find-previous-button = + .title = Aff-d tamseḍriwt n twinest n deffir +pdfjs-find-previous-button-label = Azewwar +pdfjs-find-next-button = + .title = Aff-d timseḍriwt n twinest d-iteddun +pdfjs-find-next-button-label = Ddu ɣer zdat +pdfjs-find-highlight-checkbox = Err izirig imaṛṛa +pdfjs-find-match-case-checkbox-label = Qadeṛ amasal n isekkilen +pdfjs-find-match-diacritics-checkbox-label = Qadeṛ ifeskilen +pdfjs-find-entire-word-checkbox-label = Awalen iččuranen +pdfjs-find-reached-top = Yabbeḍ s afella n usebter, tuɣalin s wadda +pdfjs-find-reached-bottom = Tebḍeḍ s adda n usebter, tuɣalin s afella +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] Timeḍriwt { $current } ɣef { $total } + *[other] Timeḍriwin { $current } ɣef { $total } + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] Ugar n { $limit } umṣada + *[other] Ugar n { $limit } yimṣadayen + } +pdfjs-find-not-found = Ulac tawinest + +## Predefined zoom values + +pdfjs-page-scale-width = Tehri n usebter +pdfjs-page-scale-fit = Asebter imaṛṛa +pdfjs-page-scale-auto = Asemɣeṛ/Asemẓi awurman +pdfjs-page-scale-actual = Teɣzi tilawt +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Asebter { $page } + +## Loading indicator messages + +pdfjs-loading-error = Teḍra-d tuccḍa deg alluy n PDF: +pdfjs-invalid-file-error = Afaylu PDF arameɣtu neɣ yexṣeṛ. +pdfjs-missing-file-error = Ulac afaylu PDF. +pdfjs-unexpected-response-error = Aqeddac yerra-d yir tiririt ur nettwaṛǧi ara. +pdfjs-rendering-error = Teḍra-d tuccḍa deg uskan n usebter. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [Tabzimt { $type }] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Sekcem awal uffir akken ad ldiḍ afaylu-yagi PDF +pdfjs-password-invalid = Awal uffir mačči d ameɣtu, Ɛreḍ tikelt-nniḍen. +pdfjs-password-ok-button = IH +pdfjs-password-cancel-button = Sefsex +pdfjs-web-fonts-disabled = Tisefsiyin web ttwassensent; D awezɣi useqdec n tsefsiyin yettwarnan ɣer PDF. + +## Editing + +pdfjs-editor-free-text-button = + .title = Aḍris +pdfjs-editor-free-text-button-label = Aḍris +pdfjs-editor-ink-button = + .title = Suneɣ +pdfjs-editor-ink-button-label = Suneɣ +pdfjs-editor-stamp-button = + .title = Rnu neɣ ẓreg tugniwin +pdfjs-editor-stamp-button-label = Rnu neɣ ẓreg tugniwin +pdfjs-editor-highlight-button = + .title = Derrer +pdfjs-editor-highlight-button-label = Derrer +pdfjs-highlight-floating-button1 = + .title = Derrer + .aria-label = Derrer +pdfjs-highlight-floating-button-label = Derrer + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Kkes asuneɣ +pdfjs-editor-remove-freetext-button = + .title = Kkes aḍris +pdfjs-editor-remove-stamp-button = + .title = Kkes tugna +pdfjs-editor-remove-highlight-button = + .title = Kkes aderrer + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Initen +pdfjs-editor-free-text-size-input = Teɣzi +pdfjs-editor-ink-color-input = Ini +pdfjs-editor-ink-thickness-input = Tuzert +pdfjs-editor-ink-opacity-input = Tebrek +pdfjs-editor-stamp-add-image-button = + .title = Rnu tawlaft +pdfjs-editor-stamp-add-image-button-label = Rnu tawlaft +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Tuzert +pdfjs-editor-free-highlight-thickness-title = + .title = Beddel tuzert mi ara d-tesbeggneḍ iferdisen niḍen ur nelli d aḍris +pdfjs-free-text = + .aria-label = Amaẓrag n uḍris +pdfjs-free-text-default-content = Bdu tira... +pdfjs-ink = + .aria-label = Amaẓrag n usuneɣ +pdfjs-ink-canvas = + .aria-label = Tugna yettwarnan sɣur useqdac + +## Alt-text dialog + +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button-label = Aḍris amaskal +pdfjs-editor-alt-text-edit-button-label = Ẓreg aḍris amaskal +pdfjs-editor-alt-text-dialog-label = Fren taxtirt +pdfjs-editor-alt-text-add-description-label = Rnu aglam +pdfjs-editor-alt-text-mark-decorative-label = Creḍ d adlag +pdfjs-editor-alt-text-cancel-button = Sefsex +pdfjs-editor-alt-text-save-button = Sekles +pdfjs-editor-alt-text-decorative-tooltip = Yettwacreḍ d adlag + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Tiɣmert n ufella n zelmeḍ — semsawi teɣzi +pdfjs-editor-resizer-label-top-middle = Talemmat n ufella — semsawi teɣzi +pdfjs-editor-resizer-label-top-right = Tiɣmert n ufella n yeffus — semsawi teɣzi +pdfjs-editor-resizer-label-middle-right = Talemmast tayeffust — semsawi teɣzi +pdfjs-editor-resizer-label-bottom-right = Tiɣmert n wadda n yeffus — semsawi teɣzi +pdfjs-editor-resizer-label-bottom-middle = Talemmat n wadda — semsawi teɣzi +pdfjs-editor-resizer-label-bottom-left = Tiɣmert n wadda n zelmeḍ — semsawi teɣzi +pdfjs-editor-resizer-label-middle-left = Talemmast tazelmdaḍt — semsawi teɣzi +pdfjs-editor-resizer-top-left = + .aria-label = Tiɣmert n ufella n zelmeḍ — semsawi teɣzi +pdfjs-editor-resizer-top-middle = + .aria-label = Talemmat n ufella — semsawi teɣzi +pdfjs-editor-resizer-top-right = + .aria-label = Tiɣmert n ufella n yeffus — semsawi teɣzi +pdfjs-editor-resizer-middle-right = + .aria-label = Talemmast tayeffust — semsawi teɣzi +pdfjs-editor-resizer-bottom-right = + .aria-label = Tiɣmert n wadda n yeffus — semsawi teɣzi +pdfjs-editor-resizer-bottom-middle = + .aria-label = Talemmat n wadda — semsawi teɣzi +pdfjs-editor-resizer-bottom-left = + .aria-label = Tiɣmert n wadda n zelmeḍ — semsawi teɣzi +pdfjs-editor-resizer-middle-left = + .aria-label = Talemmast tazelmdaḍt — semsawi teɣzi + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Ini n uderrer +pdfjs-editor-colorpicker-button = + .title = Senfel ini +pdfjs-editor-colorpicker-dropdown = + .aria-label = Afran n yiniten +pdfjs-editor-colorpicker-yellow = + .title = Awraɣ +pdfjs-editor-colorpicker-green = + .title = Azegzaw +pdfjs-editor-colorpicker-blue = + .title = Amidadi +pdfjs-editor-colorpicker-pink = + .title = Axuxi +pdfjs-editor-colorpicker-red = + .title = Azggaɣ + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Sken akk +pdfjs-editor-highlight-show-all-button = + .title = Sken akk + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = Rnu aḍris niḍen (aglam n tugna) +pdfjs-editor-new-alt-text-textarea = + .placeholder = Aru aglam-ik dagi… +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Issin ugar +pdfjs-editor-new-alt-text-create-automatically-button-label = Rnu aḍris niḍen s wudem awurman +pdfjs-editor-new-alt-text-not-now-button = Mačči tura +pdfjs-editor-new-alt-text-error-title = D awezɣi timerna n uḍris niḍen s wudem awurman +pdfjs-editor-new-alt-text-error-close-button = Mdel + +## Image alt-text settings + +pdfjs-editor-alt-text-settings-delete-model-button = Kkes +pdfjs-editor-alt-text-settings-download-model-button = Sader +pdfjs-editor-alt-text-settings-downloading-model-button = Asader… +pdfjs-editor-alt-text-settings-close-button = Mdel diff --git a/public/pdfjs/web/locale/kk/viewer.ftl b/public/pdfjs/web/locale/kk/viewer.ftl new file mode 100644 index 0000000..fb14226 --- /dev/null +++ b/public/pdfjs/web/locale/kk/viewer.ftl @@ -0,0 +1,515 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Алдыңғы парақ +pdfjs-previous-button-label = Алдыңғысы +pdfjs-next-button = + .title = Келесі парақ +pdfjs-next-button-label = Келесі +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Парақ +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = { $pagesCount } ішінен +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = (парақ { $pageNumber }, { $pagesCount } ішінен) +pdfjs-zoom-out-button = + .title = Кішірейту +pdfjs-zoom-out-button-label = Кішірейту +pdfjs-zoom-in-button = + .title = Үлкейту +pdfjs-zoom-in-button-label = Үлкейту +pdfjs-zoom-select = + .title = Масштаб +pdfjs-presentation-mode-button = + .title = Презентация режиміне ауысу +pdfjs-presentation-mode-button-label = Презентация режимі +pdfjs-open-file-button = + .title = Файлды ашу +pdfjs-open-file-button-label = Ашу +pdfjs-print-button = + .title = Баспаға шығару +pdfjs-print-button-label = Баспаға шығару +pdfjs-save-button = + .title = Сақтау +pdfjs-save-button-label = Сақтау +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Жүктеп алу +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Жүктеп алу +pdfjs-bookmark-button = + .title = Ағымдағы бет (Ағымдағы беттен URL адресін көру) +pdfjs-bookmark-button-label = Ағымдағы бет + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Құралдар +pdfjs-tools-button-label = Құралдар +pdfjs-first-page-button = + .title = Алғашқы параққа өту +pdfjs-first-page-button-label = Алғашқы параққа өту +pdfjs-last-page-button = + .title = Соңғы параққа өту +pdfjs-last-page-button-label = Соңғы параққа өту +pdfjs-page-rotate-cw-button = + .title = Сағат тілі бағытымен айналдыру +pdfjs-page-rotate-cw-button-label = Сағат тілі бағытымен бұру +pdfjs-page-rotate-ccw-button = + .title = Сағат тілі бағытына қарсы бұру +pdfjs-page-rotate-ccw-button-label = Сағат тілі бағытына қарсы бұру +pdfjs-cursor-text-select-tool-button = + .title = Мәтінді таңдау құралын іске қосу +pdfjs-cursor-text-select-tool-button-label = Мәтінді таңдау құралы +pdfjs-cursor-hand-tool-button = + .title = Қол құралын іске қосу +pdfjs-cursor-hand-tool-button-label = Қол құралы +pdfjs-scroll-page-button = + .title = Беттерді айналдыруды пайдалану +pdfjs-scroll-page-button-label = Беттерді айналдыру +pdfjs-scroll-vertical-button = + .title = Вертикалды айналдыруды қолдану +pdfjs-scroll-vertical-button-label = Вертикалды айналдыру +pdfjs-scroll-horizontal-button = + .title = Горизонталды айналдыруды қолдану +pdfjs-scroll-horizontal-button-label = Горизонталды айналдыру +pdfjs-scroll-wrapped-button = + .title = Масштабталатын айналдыруды қолдану +pdfjs-scroll-wrapped-button-label = Масштабталатын айналдыру +pdfjs-spread-none-button = + .title = Жазық беттер режимін қолданбау +pdfjs-spread-none-button-label = Жазық беттер режимсіз +pdfjs-spread-odd-button = + .title = Жазық беттер тақ нөмірлі беттерден басталады +pdfjs-spread-odd-button-label = Тақ нөмірлі беттер сол жақтан +pdfjs-spread-even-button = + .title = Жазық беттер жұп нөмірлі беттерден басталады +pdfjs-spread-even-button-label = Жұп нөмірлі беттер сол жақтан + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Құжат қасиеттері… +pdfjs-document-properties-button-label = Құжат қасиеттері… +pdfjs-document-properties-file-name = Файл аты: +pdfjs-document-properties-file-size = Файл өлшемі: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } КБ ({ $b } байт) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } МБ ({ $b } байт) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } КБ ({ $size_b } байт) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } МБ ({ $size_b } байт) +pdfjs-document-properties-title = Тақырыбы: +pdfjs-document-properties-author = Авторы: +pdfjs-document-properties-subject = Тақырыбы: +pdfjs-document-properties-keywords = Кілт сөздер: +pdfjs-document-properties-creation-date = Жасалған күні: +pdfjs-document-properties-modification-date = Түзету күні: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Жасаған: +pdfjs-document-properties-producer = PDF өндірген: +pdfjs-document-properties-version = PDF нұсқасы: +pdfjs-document-properties-page-count = Беттер саны: +pdfjs-document-properties-page-size = Бет өлшемі: +pdfjs-document-properties-page-size-unit-inches = дюйм +pdfjs-document-properties-page-size-unit-millimeters = мм +pdfjs-document-properties-page-size-orientation-portrait = тік +pdfjs-document-properties-page-size-orientation-landscape = жатық +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Letter +pdfjs-document-properties-page-size-name-legal = Legal + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Жылдам Web көрінісі: +pdfjs-document-properties-linearized-yes = Иә +pdfjs-document-properties-linearized-no = Жоқ +pdfjs-document-properties-close-button = Жабу + +## Print + +pdfjs-print-progress-message = Құжатты баспаға шығару үшін дайындау… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Бас тарту +pdfjs-printing-not-supported = Ескерту: Баспаға шығаруды бұл браузер толығымен қолдамайды. +pdfjs-printing-not-ready = Ескерту: Баспаға шығару үшін, бұл PDF толығымен жүктеліп алынбады. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Бүйір панелін көрсету/жасыру +pdfjs-toggle-sidebar-notification-button = + .title = Бүйір панелін көрсету/жасыру (құжатта құрылымы/салынымдар/қабаттар бар) +pdfjs-toggle-sidebar-button-label = Бүйір панелін көрсету/жасыру +pdfjs-document-outline-button = + .title = Құжат құрылымын көрсету (барлық нәрселерді жазық қылу/жинау үшін қос шерту керек) +pdfjs-document-outline-button-label = Құжат құрамасы +pdfjs-attachments-button = + .title = Салынымдарды көрсету +pdfjs-attachments-button-label = Салынымдар +pdfjs-layers-button = + .title = Қабаттарды көрсету (барлық қабаттарды бастапқы күйге келтіру үшін екі рет шертіңіз) +pdfjs-layers-button-label = Қабаттар +pdfjs-thumbs-button = + .title = Кіші көріністерді көрсету +pdfjs-thumbs-button-label = Кіші көріністер +pdfjs-current-outline-item-button = + .title = Құрылымның ағымдағы элементін табу +pdfjs-current-outline-item-button-label = Құрылымның ағымдағы элементі +pdfjs-findbar-button = + .title = Құжаттан табу +pdfjs-findbar-button-label = Табу +pdfjs-additional-layers = Қосымша қабаттар + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = { $page } парағы +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = { $page } парағы үшін кіші көрінісі + +## Find panel button title and messages + +pdfjs-find-input = + .title = Табу + .placeholder = Құжаттан табу… +pdfjs-find-previous-button = + .title = Осы сөздердің мәтіннен алдыңғы кездесуін табу +pdfjs-find-previous-button-label = Алдыңғысы +pdfjs-find-next-button = + .title = Осы сөздердің мәтіннен келесі кездесуін табу +pdfjs-find-next-button-label = Келесі +pdfjs-find-highlight-checkbox = Барлығын түспен ерекшелеу +pdfjs-find-match-case-checkbox-label = Регистрді ескеру +pdfjs-find-match-diacritics-checkbox-label = Диакритиканы ескеру +pdfjs-find-entire-word-checkbox-label = Сөздер толығымен +pdfjs-find-reached-top = Құжаттың басына жеттік, соңынан бастап жалғастырамыз +pdfjs-find-reached-bottom = Құжаттың соңына жеттік, басынан бастап жалғастырамыз +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] { $current } сәйкестік, барлығы { $total } + *[other] { $current } сәйкестік, барлығы { $total } + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] { $limit } сәйкестіктен көп + *[other] { $limit } сәйкестіктен көп + } +pdfjs-find-not-found = Сөз(дер) табылмады + +## Predefined zoom values + +pdfjs-page-scale-width = Парақ ені +pdfjs-page-scale-fit = Парақты сыйдыру +pdfjs-page-scale-auto = Автомасштабтау +pdfjs-page-scale-actual = Нақты өлшемі +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Бет { $page } + +## Loading indicator messages + +pdfjs-loading-error = PDF жүктеу кезінде қате кетті. +pdfjs-invalid-file-error = Зақымдалған немесе қате PDF файл. +pdfjs-missing-file-error = PDF файлы жоқ. +pdfjs-unexpected-response-error = Сервердің күтпеген жауабы. +pdfjs-rendering-error = Парақты өңдеу кезінде қате кетті. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } аңдатпасы] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Бұл PDF файлын ашу үшін парольді енгізіңіз. +pdfjs-password-invalid = Пароль дұрыс емес. Қайталап көріңіз. +pdfjs-password-ok-button = ОК +pdfjs-password-cancel-button = Бас тарту +pdfjs-web-fonts-disabled = Веб қаріптері сөндірілген: құрамына енгізілген PDF қаріптерін қолдану мүмкін емес. + +## Editing + +pdfjs-editor-free-text-button = + .title = Мәтін +pdfjs-editor-free-text-button-label = Мәтін +pdfjs-editor-ink-button = + .title = Сурет салу +pdfjs-editor-ink-button-label = Сурет салу +pdfjs-editor-stamp-button = + .title = Суреттерді қосу немесе түзету +pdfjs-editor-stamp-button-label = Суреттерді қосу немесе түзету +pdfjs-editor-highlight-button = + .title = Ерекшелеу +pdfjs-editor-highlight-button-label = Ерекшелеу +pdfjs-highlight-floating-button1 = + .title = Ерекшелеу + .aria-label = Ерекшелеу +pdfjs-highlight-floating-button-label = Ерекшелеу + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Сызбаны өшіру +pdfjs-editor-remove-freetext-button = + .title = Мәтінді өшіру +pdfjs-editor-remove-stamp-button = + .title = Суретті өшіру +pdfjs-editor-remove-highlight-button = + .title = Түспен ерекшелеуді өшіру + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Түс +pdfjs-editor-free-text-size-input = Өлшемі +pdfjs-editor-ink-color-input = Түс +pdfjs-editor-ink-thickness-input = Қалыңдығы +pdfjs-editor-ink-opacity-input = Мөлдірсіздігі +pdfjs-editor-stamp-add-image-button = + .title = Суретті қосу +pdfjs-editor-stamp-add-image-button-label = Суретті қосу +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Қалыңдығы +pdfjs-editor-free-highlight-thickness-title = + .title = Мәтіннен басқа элементтерді ерекшелеу кезінде қалыңдықты өзгерту +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = Мәтін түзеткіші + .default-content = Теріп бастаңыз… +pdfjs-free-text = + .aria-label = Мәтін түзеткіші +pdfjs-free-text-default-content = Теруді бастау… +pdfjs-ink = + .aria-label = Сурет түзеткіші +pdfjs-ink-canvas = + .aria-label = Пайдаланушы жасаған сурет + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = Балама мәтін +pdfjs-editor-alt-text-edit-button = + .aria-label = Балама мәтінді өңдеу +pdfjs-editor-alt-text-edit-button-label = Балама мәтінді өңдеу +pdfjs-editor-alt-text-dialog-label = Опцияны таңдау +pdfjs-editor-alt-text-dialog-description = Балама мәтін адамдар суретті көре алмағанда немесе ол жүктелмегенде көмектеседі. +pdfjs-editor-alt-text-add-description-label = Сипаттаманы қосу +pdfjs-editor-alt-text-add-description-description = Тақырыпты, баптауды немесе әрекетті сипаттайтын 1-2 сөйлемді қолдануға тырысыңыз. +pdfjs-editor-alt-text-mark-decorative-label = Декоративті деп белгілеу +pdfjs-editor-alt-text-mark-decorative-description = Бұл жиектер немесе су белгілері сияқты оюлық суреттер үшін пайдаланылады. +pdfjs-editor-alt-text-cancel-button = Бас тарту +pdfjs-editor-alt-text-save-button = Сақтау +pdfjs-editor-alt-text-decorative-tooltip = Декоративті деп белгіленген +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = Мысалы, "Жас жігіт тамақ ішу үшін үстел басына отырады" +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = Балама мәтін + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Жоғарғы сол жақ бұрыш — өлшемін өзгерту +pdfjs-editor-resizer-label-top-middle = Жоғарғы ортасы — өлшемін өзгерту +pdfjs-editor-resizer-label-top-right = Жоғарғы оң жақ бұрыш — өлшемін өзгерту +pdfjs-editor-resizer-label-middle-right = Ортаңғы оң жақ — өлшемін өзгерту +pdfjs-editor-resizer-label-bottom-right = Төменгі оң жақ бұрыш — өлшемін өзгерту +pdfjs-editor-resizer-label-bottom-middle = Төменгі ортасы — өлшемін өзгерту +pdfjs-editor-resizer-label-bottom-left = Төменгі сол жақ бұрыш — өлшемін өзгерту +pdfjs-editor-resizer-label-middle-left = Ортаңғы сол жақ — өлшемін өзгерту +pdfjs-editor-resizer-top-left = + .aria-label = Жоғарғы сол жақ бұрыш — өлшемін өзгерту +pdfjs-editor-resizer-top-middle = + .aria-label = Жоғарғы ортасы — өлшемін өзгерту +pdfjs-editor-resizer-top-right = + .aria-label = Жоғарғы оң жақ бұрыш — өлшемін өзгерту +pdfjs-editor-resizer-middle-right = + .aria-label = Ортаңғы оң жақ — өлшемін өзгерту +pdfjs-editor-resizer-bottom-right = + .aria-label = Төменгі оң жақ бұрыш — өлшемін өзгерту +pdfjs-editor-resizer-bottom-middle = + .aria-label = Төменгі ортасы — өлшемін өзгерту +pdfjs-editor-resizer-bottom-left = + .aria-label = Төменгі сол жақ бұрыш — өлшемін өзгерту +pdfjs-editor-resizer-middle-left = + .aria-label = Ортаңғы сол жақ — өлшемін өзгерту + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Ерекшелеу түсі +pdfjs-editor-colorpicker-button = + .title = Түсті өзгерту +pdfjs-editor-colorpicker-dropdown = + .aria-label = Түс таңдаулары +pdfjs-editor-colorpicker-yellow = + .title = Сары +pdfjs-editor-colorpicker-green = + .title = Жасыл +pdfjs-editor-colorpicker-blue = + .title = Көк +pdfjs-editor-colorpicker-pink = + .title = Қызғылт +pdfjs-editor-colorpicker-red = + .title = Қызыл + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Барлығын көрсету +pdfjs-editor-highlight-show-all-button = + .title = Барлығын көрсету + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = Балама мәтінді өңдеу (сурет сипаттамасы) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = Балама мәтінді қосу (сурет сипаттамасы) +pdfjs-editor-new-alt-text-textarea = + .placeholder = Сипаттамаңызды осында жазыңыз… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = Суретті көре алмайтын адамдар үшін немесе сурет жүктелмеген кезіне арналған қысқаша сипаттама. +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = Бұл балама мәтін автоматты түрде жасалды және дәлсіз болуы мүмкін. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Көбірек білу +pdfjs-editor-new-alt-text-create-automatically-button-label = Балама мәтінді автоматты түрде жасау +pdfjs-editor-new-alt-text-not-now-button = Қазір емес +pdfjs-editor-new-alt-text-error-title = Балама мәтінді автоматты түрде жасау мүмкін болмады +pdfjs-editor-new-alt-text-error-description = Өзіңіздің балама мәтініңізді жазыңыз немесе кейінірек қайталап көріңіз. +pdfjs-editor-new-alt-text-error-close-button = Жабу +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = Балама мәтін үшін ЖИ моделі жүктеп алынуда ({ $downloadedSize }/{ $totalSize } МБ) + .aria-valuetext = Балама мәтін үшін ЖИ моделі жүктеп алынуда ({ $downloadedSize }/{ $totalSize } МБ) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = Балама мәтін қосылды +pdfjs-editor-new-alt-text-added-button-label = Балама мәтін қосылды +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = Балама мәтін жоқ +pdfjs-editor-new-alt-text-missing-button-label = Балама мәтін жоқ +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = Балама мәтінге пікір қалдыру +pdfjs-editor-new-alt-text-to-review-button-label = Балама мәтінге пікір қалдыру +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Автоматты түрде жасалды: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = Суреттің балама мәтінінің баптаулары +pdfjs-image-alt-text-settings-button-label = Суреттің балама мәтінінің баптаулары +pdfjs-editor-alt-text-settings-dialog-label = Суреттің балама мәтінінің баптаулары +pdfjs-editor-alt-text-settings-automatic-title = Автоматты балама мәтін +pdfjs-editor-alt-text-settings-create-model-button-label = Балама мәтінді автоматты түрде жасау +pdfjs-editor-alt-text-settings-create-model-description = Суретті көре алмайтын адамдар үшін немесе сурет жүктелмеген кезіне арналған сипаттамаларды ұсынады. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = Баламалы мәтіннің ЖИ моделі ({ $totalSize } МБ) +pdfjs-editor-alt-text-settings-ai-model-description = Деректеріңіз жеке болып қалуы үшін құрылғыңызда жергілікті түрде жұмыс істейді. Автоматты балама мәтін үшін қажет. +pdfjs-editor-alt-text-settings-delete-model-button = Өшіру +pdfjs-editor-alt-text-settings-download-model-button = Жүктеп алу +pdfjs-editor-alt-text-settings-downloading-model-button = Жүктеліп алынуда… +pdfjs-editor-alt-text-settings-editor-title = Баламалы мәтін редакторы +pdfjs-editor-alt-text-settings-show-dialog-button-label = Суретті қосқанда балама мәтін редакторын бірден көрсету +pdfjs-editor-alt-text-settings-show-dialog-description = Барлық суреттерде балама мәтін бар екеніне көз жеткізуге көмектеседі. +pdfjs-editor-alt-text-settings-close-button = Жабу + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = Ерекшелеу өшірілді +pdfjs-editor-undo-bar-message-freetext = Мәтін өшірілді +pdfjs-editor-undo-bar-message-ink = Сызба өшірілді +pdfjs-editor-undo-bar-message-stamp = Сурет өшірілді +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = + { $count -> + [one] { $count } анимация өшірілді + *[other] { $count } анимация өшірілді + } +pdfjs-editor-undo-bar-undo-button = + .title = Болдырмау +pdfjs-editor-undo-bar-undo-button-label = Болдырмау +pdfjs-editor-undo-bar-close-button = + .title = Жабу +pdfjs-editor-undo-bar-close-button-label = Жабу diff --git a/public/pdfjs/web/locale/km/viewer.ftl b/public/pdfjs/web/locale/km/viewer.ftl new file mode 100644 index 0000000..6efd105 --- /dev/null +++ b/public/pdfjs/web/locale/km/viewer.ftl @@ -0,0 +1,223 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = ទំព័រ​មុន +pdfjs-previous-button-label = មុន +pdfjs-next-button = + .title = ទំព័រ​បន្ទាប់ +pdfjs-next-button-label = បន្ទាប់ +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = ទំព័រ +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = នៃ { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } នៃ { $pagesCount }) +pdfjs-zoom-out-button = + .title = ​បង្រួម +pdfjs-zoom-out-button-label = ​បង្រួម +pdfjs-zoom-in-button = + .title = ​ពង្រីក +pdfjs-zoom-in-button-label = ​ពង្រីក +pdfjs-zoom-select = + .title = ពង្រីក +pdfjs-presentation-mode-button = + .title = ប្ដូរ​ទៅ​របៀប​បទ​បង្ហាញ +pdfjs-presentation-mode-button-label = របៀប​បទ​បង្ហាញ +pdfjs-open-file-button = + .title = បើក​ឯកសារ +pdfjs-open-file-button-label = បើក +pdfjs-print-button = + .title = បោះពុម្ព +pdfjs-print-button-label = បោះពុម្ព + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = ឧបករណ៍ +pdfjs-tools-button-label = ឧបករណ៍ +pdfjs-first-page-button = + .title = ទៅកាន់​ទំព័រ​ដំបូង​ +pdfjs-first-page-button-label = ទៅកាន់​ទំព័រ​ដំបូង​ +pdfjs-last-page-button = + .title = ទៅកាន់​ទំព័រ​ចុងក្រោយ​ +pdfjs-last-page-button-label = ទៅកាន់​ទំព័រ​ចុងក្រោយ +pdfjs-page-rotate-cw-button = + .title = បង្វិល​ស្រប​ទ្រនិច​នាឡិកា +pdfjs-page-rotate-cw-button-label = បង្វិល​ស្រប​ទ្រនិច​នាឡិកា +pdfjs-page-rotate-ccw-button = + .title = បង្វិល​ច្រាស​ទ្រនិច​នាឡិកា​​ +pdfjs-page-rotate-ccw-button-label = បង្វិល​ច្រាស​ទ្រនិច​នាឡិកា​​ +pdfjs-cursor-text-select-tool-button = + .title = បើក​ឧបករណ៍​ជ្រើស​អត្ថបទ +pdfjs-cursor-text-select-tool-button-label = ឧបករណ៍​ជ្រើស​អត្ថបទ +pdfjs-cursor-hand-tool-button = + .title = បើក​ឧបករណ៍​ដៃ +pdfjs-cursor-hand-tool-button-label = ឧបករណ៍​ដៃ + +## Document properties dialog + +pdfjs-document-properties-button = + .title = លក្ខណ​សម្បត្តិ​ឯកសារ… +pdfjs-document-properties-button-label = លក្ខណ​សម្បត្តិ​ឯកសារ… +pdfjs-document-properties-file-name = ឈ្មោះ​ឯកសារ៖ +pdfjs-document-properties-file-size = ទំហំ​ឯកសារ៖ +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } បៃ) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } បៃ) +pdfjs-document-properties-title = ចំណងជើង៖ +pdfjs-document-properties-author = អ្នក​និពន្ធ៖ +pdfjs-document-properties-subject = ប្រធានបទ៖ +pdfjs-document-properties-keywords = ពាក្យ​គន្លឹះ៖ +pdfjs-document-properties-creation-date = កាលបរិច្ឆេទ​បង្កើត៖ +pdfjs-document-properties-modification-date = កាលបរិច្ឆេទ​កែប្រែ៖ +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = អ្នក​បង្កើត៖ +pdfjs-document-properties-producer = កម្មវិធី​បង្កើត PDF ៖ +pdfjs-document-properties-version = កំណែ PDF ៖ +pdfjs-document-properties-page-count = ចំនួន​ទំព័រ៖ +pdfjs-document-properties-page-size-unit-inches = អ៊ីញ +pdfjs-document-properties-page-size-unit-millimeters = មម +pdfjs-document-properties-page-size-orientation-portrait = បញ្ឈរ +pdfjs-document-properties-page-size-orientation-landscape = ផ្តេក +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = សំបុត្រ + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +pdfjs-document-properties-linearized-yes = បាទ/ចាស +pdfjs-document-properties-linearized-no = ទេ +pdfjs-document-properties-close-button = បិទ + +## Print + +pdfjs-print-progress-message = កំពុង​រៀបចំ​ឯកសារ​សម្រាប់​បោះពុម្ព… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = បោះបង់ +pdfjs-printing-not-supported = ការ​ព្រមាន ៖ កា​រ​បោះពុម្ព​មិន​ត្រូវ​បាន​គាំទ្រ​ពេញលេញ​ដោយ​កម្មវិធី​រុករក​នេះ​ទេ ។ +pdfjs-printing-not-ready = ព្រមាន៖ PDF មិន​ត្រូវ​បាន​ផ្ទុក​ទាំងស្រុង​ដើម្បី​បោះពុម្ព​ទេ។ + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = បិទ/បើក​គ្រាប់​រំកិល +pdfjs-toggle-sidebar-button-label = បិទ/បើក​គ្រាប់​រំកិល +pdfjs-document-outline-button = + .title = បង្ហាញ​គ្រោង​ឯកសារ (ចុច​ទ្វេ​ដង​ដើម្បី​ពង្រីក/បង្រួម​ធាតុ​ទាំងអស់) +pdfjs-document-outline-button-label = គ្រោង​ឯកសារ +pdfjs-attachments-button = + .title = បង្ហាញ​ឯកសារ​ភ្ជាប់ +pdfjs-attachments-button-label = ឯកសារ​ភ្ជាប់ +pdfjs-thumbs-button = + .title = បង្ហាញ​រូបភាព​តូចៗ +pdfjs-thumbs-button-label = រួបភាព​តូចៗ +pdfjs-findbar-button = + .title = រក​នៅ​ក្នុង​ឯកសារ +pdfjs-findbar-button-label = រក + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = ទំព័រ { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = រូបភាព​តូច​របស់​ទំព័រ { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = រក + .placeholder = រក​នៅ​ក្នុង​ឯកសារ... +pdfjs-find-previous-button = + .title = រក​ពាក្យ ឬ​ឃ្លា​ដែល​បាន​ជួប​មុន +pdfjs-find-previous-button-label = មុន +pdfjs-find-next-button = + .title = រក​ពាក្យ ឬ​ឃ្លា​ដែល​បាន​ជួប​បន្ទាប់ +pdfjs-find-next-button-label = បន្ទាប់ +pdfjs-find-highlight-checkbox = បន្លិច​ទាំងអស់ +pdfjs-find-match-case-checkbox-label = ករណី​ដំណូច +pdfjs-find-reached-top = បាន​បន្ត​ពី​ខាង​ក្រោម ទៅ​ដល់​ខាង​​លើ​នៃ​ឯកសារ +pdfjs-find-reached-bottom = បាន​បន្ត​ពី​ខាងលើ ទៅដល់​ចុង​​នៃ​ឯកសារ +pdfjs-find-not-found = រក​មិន​ឃើញ​ពាក្យ ឬ​ឃ្លា + +## Predefined zoom values + +pdfjs-page-scale-width = ទទឹង​ទំព័រ +pdfjs-page-scale-fit = សម​ទំព័រ +pdfjs-page-scale-auto = ពង្រីក​ស្វ័យប្រវត្តិ +pdfjs-page-scale-actual = ទំហំ​ជាក់ស្ដែង +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + + +## Loading indicator messages + +pdfjs-loading-error = មាន​កំហុស​បាន​កើតឡើង​ពេល​កំពុង​ផ្ទុក PDF ។ +pdfjs-invalid-file-error = ឯកសារ PDF ខូច ឬ​មិន​ត្រឹមត្រូវ ។ +pdfjs-missing-file-error = បាត់​ឯកសារ PDF +pdfjs-unexpected-response-error = ការ​ឆ្លើយ​តម​ម៉ាស៊ីន​មេ​ដែល​មិន​បាន​រំពឹង។ +pdfjs-rendering-error = មាន​កំហុស​បាន​កើតឡើង​ពេល​បង្ហាញ​ទំព័រ ។ + +## Annotations + +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } ចំណារ​ពន្យល់] + +## Password + +pdfjs-password-label = បញ្ចូល​ពាក្យសម្ងាត់​ដើម្បី​បើក​ឯកសារ PDF នេះ។ +pdfjs-password-invalid = ពាក្យសម្ងាត់​មិន​ត្រឹមត្រូវ។ សូម​ព្យាយាម​ម្ដងទៀត។ +pdfjs-password-ok-button = យល់​ព្រម +pdfjs-password-cancel-button = បោះបង់ +pdfjs-web-fonts-disabled = បាន​បិទ​ពុម្ពអក្សរ​បណ្ដាញ ៖ មិន​អាច​ប្រើ​ពុម្ពអក្សរ PDF ដែល​បាន​បង្កប់​បាន​ទេ ។ + +## Editing + + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + diff --git a/public/pdfjs/web/locale/kn/viewer.ftl b/public/pdfjs/web/locale/kn/viewer.ftl new file mode 100644 index 0000000..0332255 --- /dev/null +++ b/public/pdfjs/web/locale/kn/viewer.ftl @@ -0,0 +1,213 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = ಹಿಂದಿನ ಪುಟ +pdfjs-previous-button-label = ಹಿಂದಿನ +pdfjs-next-button = + .title = ಮುಂದಿನ ಪುಟ +pdfjs-next-button-label = ಮುಂದಿನ +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = ಪುಟ +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = { $pagesCount } ರಲ್ಲಿ +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pagesCount } ರಲ್ಲಿ { $pageNumber }) +pdfjs-zoom-out-button = + .title = ಕಿರಿದಾಗಿಸು +pdfjs-zoom-out-button-label = ಕಿರಿದಾಗಿಸಿ +pdfjs-zoom-in-button = + .title = ಹಿರಿದಾಗಿಸು +pdfjs-zoom-in-button-label = ಹಿರಿದಾಗಿಸಿ +pdfjs-zoom-select = + .title = ಗಾತ್ರಬದಲಿಸು +pdfjs-presentation-mode-button = + .title = ಪ್ರಸ್ತುತಿ (ಪ್ರಸೆಂಟೇಶನ್) ಕ್ರಮಕ್ಕೆ ಬದಲಾಯಿಸು +pdfjs-presentation-mode-button-label = ಪ್ರಸ್ತುತಿ (ಪ್ರಸೆಂಟೇಶನ್) ಕ್ರಮ +pdfjs-open-file-button = + .title = ಕಡತವನ್ನು ತೆರೆ +pdfjs-open-file-button-label = ತೆರೆಯಿರಿ +pdfjs-print-button = + .title = ಮುದ್ರಿಸು +pdfjs-print-button-label = ಮುದ್ರಿಸಿ + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = ಉಪಕರಣಗಳು +pdfjs-tools-button-label = ಉಪಕರಣಗಳು +pdfjs-first-page-button = + .title = ಮೊದಲ ಪುಟಕ್ಕೆ ತೆರಳು +pdfjs-first-page-button-label = ಮೊದಲ ಪುಟಕ್ಕೆ ತೆರಳು +pdfjs-last-page-button = + .title = ಕೊನೆಯ ಪುಟಕ್ಕೆ ತೆರಳು +pdfjs-last-page-button-label = ಕೊನೆಯ ಪುಟಕ್ಕೆ ತೆರಳು +pdfjs-page-rotate-cw-button = + .title = ಪ್ರದಕ್ಷಿಣೆಯಲ್ಲಿ ತಿರುಗಿಸು +pdfjs-page-rotate-cw-button-label = ಪ್ರದಕ್ಷಿಣೆಯಲ್ಲಿ ತಿರುಗಿಸು +pdfjs-page-rotate-ccw-button = + .title = ಅಪ್ರದಕ್ಷಿಣೆಯಲ್ಲಿ ತಿರುಗಿಸು +pdfjs-page-rotate-ccw-button-label = ಅಪ್ರದಕ್ಷಿಣೆಯಲ್ಲಿ ತಿರುಗಿಸು +pdfjs-cursor-text-select-tool-button = + .title = ಪಠ್ಯ ಆಯ್ಕೆ ಉಪಕರಣವನ್ನು ಸಕ್ರಿಯಗೊಳಿಸಿ +pdfjs-cursor-text-select-tool-button-label = ಪಠ್ಯ ಆಯ್ಕೆಯ ಉಪಕರಣ +pdfjs-cursor-hand-tool-button = + .title = ಕೈ ಉಪಕರಣವನ್ನು ಸಕ್ರಿಯಗೊಳಿಸಿ +pdfjs-cursor-hand-tool-button-label = ಕೈ ಉಪಕರಣ + +## Document properties dialog + +pdfjs-document-properties-button = + .title = ಡಾಕ್ಯುಮೆಂಟ್‌ ಗುಣಗಳು... +pdfjs-document-properties-button-label = ಡಾಕ್ಯುಮೆಂಟ್‌ ಗುಣಗಳು... +pdfjs-document-properties-file-name = ಕಡತದ ಹೆಸರು: +pdfjs-document-properties-file-size = ಕಡತದ ಗಾತ್ರ: +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } ಬೈಟ್‍ಗಳು) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } ಬೈಟ್‍ಗಳು) +pdfjs-document-properties-title = ಶೀರ್ಷಿಕೆ: +pdfjs-document-properties-author = ಕರ್ತೃ: +pdfjs-document-properties-subject = ವಿಷಯ: +pdfjs-document-properties-keywords = ಮುಖ್ಯಪದಗಳು: +pdfjs-document-properties-creation-date = ರಚಿಸಿದ ದಿನಾಂಕ: +pdfjs-document-properties-modification-date = ಮಾರ್ಪಡಿಸಲಾದ ದಿನಾಂಕ: +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = ರಚಿಸಿದವರು: +pdfjs-document-properties-producer = PDF ಉತ್ಪಾದಕ: +pdfjs-document-properties-version = PDF ಆವೃತ್ತಿ: +pdfjs-document-properties-page-count = ಪುಟದ ಎಣಿಕೆ: +pdfjs-document-properties-page-size-unit-inches = ಇದರಲ್ಲಿ +pdfjs-document-properties-page-size-orientation-portrait = ಭಾವಚಿತ್ರ +pdfjs-document-properties-page-size-orientation-landscape = ಪ್ರಕೃತಿ ಚಿತ್ರ + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + + +## + +pdfjs-document-properties-close-button = ಮುಚ್ಚು + +## Print + +pdfjs-print-progress-message = ಮುದ್ರಿಸುವುದಕ್ಕಾಗಿ ದಸ್ತಾವೇಜನ್ನು ಸಿದ್ಧಗೊಳಿಸಲಾಗುತ್ತಿದೆ… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = ರದ್ದು ಮಾಡು +pdfjs-printing-not-supported = ಎಚ್ಚರಿಕೆ: ಈ ಜಾಲವೀಕ್ಷಕದಲ್ಲಿ ಮುದ್ರಣಕ್ಕೆ ಸಂಪೂರ್ಣ ಬೆಂಬಲವಿಲ್ಲ. +pdfjs-printing-not-ready = ಎಚ್ಚರಿಕೆ: PDF ಕಡತವು ಮುದ್ರಿಸಲು ಸಂಪೂರ್ಣವಾಗಿ ಲೋಡ್ ಆಗಿಲ್ಲ. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = ಬದಿಪಟ್ಟಿಯನ್ನು ಹೊರಳಿಸು +pdfjs-toggle-sidebar-button-label = ಬದಿಪಟ್ಟಿಯನ್ನು ಹೊರಳಿಸು +pdfjs-document-outline-button-label = ದಸ್ತಾವೇಜಿನ ಹೊರರೇಖೆ +pdfjs-attachments-button = + .title = ಲಗತ್ತುಗಳನ್ನು ತೋರಿಸು +pdfjs-attachments-button-label = ಲಗತ್ತುಗಳು +pdfjs-thumbs-button = + .title = ಚಿಕ್ಕಚಿತ್ರದಂತೆ ತೋರಿಸು +pdfjs-thumbs-button-label = ಚಿಕ್ಕಚಿತ್ರಗಳು +pdfjs-findbar-button = + .title = ದಸ್ತಾವೇಜಿನಲ್ಲಿ ಹುಡುಕು +pdfjs-findbar-button-label = ಹುಡುಕು + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = ಪುಟ { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = ಪುಟವನ್ನು ಚಿಕ್ಕಚಿತ್ರದಂತೆ ತೋರಿಸು { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = ಹುಡುಕು + .placeholder = ದಸ್ತಾವೇಜಿನಲ್ಲಿ ಹುಡುಕು… +pdfjs-find-previous-button = + .title = ವಾಕ್ಯದ ಹಿಂದಿನ ಇರುವಿಕೆಯನ್ನು ಹುಡುಕು +pdfjs-find-previous-button-label = ಹಿಂದಿನ +pdfjs-find-next-button = + .title = ವಾಕ್ಯದ ಮುಂದಿನ ಇರುವಿಕೆಯನ್ನು ಹುಡುಕು +pdfjs-find-next-button-label = ಮುಂದಿನ +pdfjs-find-highlight-checkbox = ಎಲ್ಲವನ್ನು ಹೈಲೈಟ್ ಮಾಡು +pdfjs-find-match-case-checkbox-label = ಕೇಸನ್ನು ಹೊಂದಿಸು +pdfjs-find-reached-top = ದಸ್ತಾವೇಜಿನ ಮೇಲ್ಭಾಗವನ್ನು ತಲುಪಿದೆ, ಕೆಳಗಿನಿಂದ ಆರಂಭಿಸು +pdfjs-find-reached-bottom = ದಸ್ತಾವೇಜಿನ ಕೊನೆಯನ್ನು ತಲುಪಿದೆ, ಮೇಲಿನಿಂದ ಆರಂಭಿಸು +pdfjs-find-not-found = ವಾಕ್ಯವು ಕಂಡು ಬಂದಿಲ್ಲ + +## Predefined zoom values + +pdfjs-page-scale-width = ಪುಟದ ಅಗಲ +pdfjs-page-scale-fit = ಪುಟದ ಸರಿಹೊಂದಿಕೆ +pdfjs-page-scale-auto = ಸ್ವಯಂಚಾಲಿತ ಗಾತ್ರಬದಲಾವಣೆ +pdfjs-page-scale-actual = ನಿಜವಾದ ಗಾತ್ರ +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + + +## Loading indicator messages + +pdfjs-loading-error = PDF ಅನ್ನು ಲೋಡ್ ಮಾಡುವಾಗ ಒಂದು ದೋಷ ಎದುರಾಗಿದೆ. +pdfjs-invalid-file-error = ಅಮಾನ್ಯವಾದ ಅಥವ ಹಾಳಾದ PDF ಕಡತ. +pdfjs-missing-file-error = PDF ಕಡತ ಇಲ್ಲ. +pdfjs-unexpected-response-error = ಅನಿರೀಕ್ಷಿತವಾದ ಪೂರೈಕೆಗಣಕದ ಪ್ರತಿಕ್ರಿಯೆ. +pdfjs-rendering-error = ಪುಟವನ್ನು ನಿರೂಪಿಸುವಾಗ ಒಂದು ದೋಷ ಎದುರಾಗಿದೆ. + +## Annotations + +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } ಟಿಪ್ಪಣಿ] + +## Password + +pdfjs-password-label = PDF ಅನ್ನು ತೆರೆಯಲು ಗುಪ್ತಪದವನ್ನು ನಮೂದಿಸಿ. +pdfjs-password-invalid = ಅಮಾನ್ಯವಾದ ಗುಪ್ತಪದ, ದಯವಿಟ್ಟು ಇನ್ನೊಮ್ಮೆ ಪ್ರಯತ್ನಿಸಿ. +pdfjs-password-ok-button = OK +pdfjs-password-cancel-button = ರದ್ದು ಮಾಡು +pdfjs-web-fonts-disabled = ಜಾಲ ಅಕ್ಷರಶೈಲಿಯನ್ನು ನಿಷ್ಕ್ರಿಯಗೊಳಿಸಲಾಗಿದೆ: ಅಡಕಗೊಳಿಸಿದ PDF ಅಕ್ಷರಶೈಲಿಗಳನ್ನು ಬಳಸಲು ಸಾಧ್ಯವಾಗಿಲ್ಲ. + +## Editing + + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + diff --git a/public/pdfjs/web/locale/ko/viewer.ftl b/public/pdfjs/web/locale/ko/viewer.ftl new file mode 100644 index 0000000..a321a11 --- /dev/null +++ b/public/pdfjs/web/locale/ko/viewer.ftl @@ -0,0 +1,503 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = 이전 페이지 +pdfjs-previous-button-label = 이전 +pdfjs-next-button = + .title = 다음 페이지 +pdfjs-next-button-label = 다음 +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = 페이지 +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = / { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } / { $pagesCount }) +pdfjs-zoom-out-button = + .title = 축소 +pdfjs-zoom-out-button-label = 축소 +pdfjs-zoom-in-button = + .title = 확대 +pdfjs-zoom-in-button-label = 확대 +pdfjs-zoom-select = + .title = 확대/축소 +pdfjs-presentation-mode-button = + .title = 프레젠테이션 모드로 전환 +pdfjs-presentation-mode-button-label = 프레젠테이션 모드 +pdfjs-open-file-button = + .title = 파일 열기 +pdfjs-open-file-button-label = 열기 +pdfjs-print-button = + .title = 인쇄 +pdfjs-print-button-label = 인쇄 +pdfjs-save-button = + .title = 저장 +pdfjs-save-button-label = 저장 +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = 다운로드 +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = 다운로드 +pdfjs-bookmark-button = + .title = 현재 페이지 (현재 페이지에서 URL 보기) +pdfjs-bookmark-button-label = 현재 페이지 + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = 도구 +pdfjs-tools-button-label = 도구 +pdfjs-first-page-button = + .title = 첫 페이지로 이동 +pdfjs-first-page-button-label = 첫 페이지로 이동 +pdfjs-last-page-button = + .title = 마지막 페이지로 이동 +pdfjs-last-page-button-label = 마지막 페이지로 이동 +pdfjs-page-rotate-cw-button = + .title = 시계방향으로 회전 +pdfjs-page-rotate-cw-button-label = 시계방향으로 회전 +pdfjs-page-rotate-ccw-button = + .title = 시계 반대방향으로 회전 +pdfjs-page-rotate-ccw-button-label = 시계 반대방향으로 회전 +pdfjs-cursor-text-select-tool-button = + .title = 텍스트 선택 도구 활성화 +pdfjs-cursor-text-select-tool-button-label = 텍스트 선택 도구 +pdfjs-cursor-hand-tool-button = + .title = 손 도구 활성화 +pdfjs-cursor-hand-tool-button-label = 손 도구 +pdfjs-scroll-page-button = + .title = 페이지 스크롤 사용 +pdfjs-scroll-page-button-label = 페이지 스크롤 +pdfjs-scroll-vertical-button = + .title = 세로 스크롤 사용 +pdfjs-scroll-vertical-button-label = 세로 스크롤 +pdfjs-scroll-horizontal-button = + .title = 가로 스크롤 사용 +pdfjs-scroll-horizontal-button-label = 가로 스크롤 +pdfjs-scroll-wrapped-button = + .title = 래핑(자동 줄 바꿈) 스크롤 사용 +pdfjs-scroll-wrapped-button-label = 래핑 스크롤 +pdfjs-spread-none-button = + .title = 한 페이지 보기 +pdfjs-spread-none-button-label = 펼침 없음 +pdfjs-spread-odd-button = + .title = 홀수 페이지로 시작하는 두 페이지 보기 +pdfjs-spread-odd-button-label = 홀수 펼침 +pdfjs-spread-even-button = + .title = 짝수 페이지로 시작하는 두 페이지 보기 +pdfjs-spread-even-button-label = 짝수 펼침 + +## Document properties dialog + +pdfjs-document-properties-button = + .title = 문서 속성… +pdfjs-document-properties-button-label = 문서 속성… +pdfjs-document-properties-file-name = 파일 이름: +pdfjs-document-properties-file-size = 파일 크기: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } 바이트) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } 바이트) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b }바이트) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b }바이트) +pdfjs-document-properties-title = 제목: +pdfjs-document-properties-author = 작성자: +pdfjs-document-properties-subject = 주제: +pdfjs-document-properties-keywords = 키워드: +pdfjs-document-properties-creation-date = 작성 날짜: +pdfjs-document-properties-modification-date = 수정 날짜: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = 작성 프로그램: +pdfjs-document-properties-producer = PDF 변환 소프트웨어: +pdfjs-document-properties-version = PDF 버전: +pdfjs-document-properties-page-count = 페이지 수: +pdfjs-document-properties-page-size = 페이지 크기: +pdfjs-document-properties-page-size-unit-inches = in +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = 세로 방향 +pdfjs-document-properties-page-size-orientation-landscape = 가로 방향 +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = 레터 +pdfjs-document-properties-page-size-name-legal = 리걸 + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = 빠른 웹 보기: +pdfjs-document-properties-linearized-yes = 예 +pdfjs-document-properties-linearized-no = 아니요 +pdfjs-document-properties-close-button = 닫기 + +## Print + +pdfjs-print-progress-message = 인쇄 문서 준비 중… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = 취소 +pdfjs-printing-not-supported = 경고: 이 브라우저는 인쇄를 완전히 지원하지 않습니다. +pdfjs-printing-not-ready = 경고: 이 PDF를 인쇄를 할 수 있을 정도로 읽어들이지 못했습니다. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = 사이드바 표시/숨기기 +pdfjs-toggle-sidebar-notification-button = + .title = 사이드바 표시/숨기기 (문서에 아웃라인/첨부파일/레이어 포함됨) +pdfjs-toggle-sidebar-button-label = 사이드바 표시/숨기기 +pdfjs-document-outline-button = + .title = 문서 아웃라인 보기 (더블 클릭해서 모든 항목 펼치기/접기) +pdfjs-document-outline-button-label = 문서 아웃라인 +pdfjs-attachments-button = + .title = 첨부파일 보기 +pdfjs-attachments-button-label = 첨부파일 +pdfjs-layers-button = + .title = 레이어 보기 (더블 클릭해서 모든 레이어를 기본 상태로 재설정) +pdfjs-layers-button-label = 레이어 +pdfjs-thumbs-button = + .title = 미리보기 +pdfjs-thumbs-button-label = 미리보기 +pdfjs-current-outline-item-button = + .title = 현재 아웃라인 항목 찾기 +pdfjs-current-outline-item-button-label = 현재 아웃라인 항목 +pdfjs-findbar-button = + .title = 검색 +pdfjs-findbar-button-label = 검색 +pdfjs-additional-layers = 추가 레이어 + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = { $page } 페이지 +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = { $page } 페이지 미리보기 + +## Find panel button title and messages + +pdfjs-find-input = + .title = 찾기 + .placeholder = 문서에서 찾기… +pdfjs-find-previous-button = + .title = 지정 문자열에 일치하는 1개 부분을 검색 +pdfjs-find-previous-button-label = 이전 +pdfjs-find-next-button = + .title = 지정 문자열에 일치하는 다음 부분을 검색 +pdfjs-find-next-button-label = 다음 +pdfjs-find-highlight-checkbox = 모두 강조 표시 +pdfjs-find-match-case-checkbox-label = 대/소문자 구분 +pdfjs-find-match-diacritics-checkbox-label = 분음 부호 일치 +pdfjs-find-entire-word-checkbox-label = 단어 단위로 +pdfjs-find-reached-top = 문서 처음까지 검색하고 끝으로 돌아와 검색했습니다. +pdfjs-find-reached-bottom = 문서 끝까지 검색하고 앞으로 돌아와 검색했습니다. +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = { $current } / { $total } 일치 +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = { $limit }개 이상 일치 +pdfjs-find-not-found = 검색 결과 없음 + +## Predefined zoom values + +pdfjs-page-scale-width = 페이지 너비에 맞추기 +pdfjs-page-scale-fit = 페이지에 맞추기 +pdfjs-page-scale-auto = 자동 +pdfjs-page-scale-actual = 실제 크기 +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = { $page } 페이지 + +## Loading indicator messages + +pdfjs-loading-error = PDF를 로드하는 동안 오류가 발생했습니다. +pdfjs-invalid-file-error = 잘못되었거나 손상된 PDF 파일. +pdfjs-missing-file-error = PDF 파일 없음. +pdfjs-unexpected-response-error = 예기치 않은 서버 응답입니다. +pdfjs-rendering-error = 페이지를 렌더링하는 동안 오류가 발생했습니다. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date } { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } 주석] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = 이 PDF 파일을 열 수 있는 비밀번호를 입력하세요. +pdfjs-password-invalid = 잘못된 비밀번호입니다. 다시 시도하세요. +pdfjs-password-ok-button = 확인 +pdfjs-password-cancel-button = 취소 +pdfjs-web-fonts-disabled = 웹 폰트가 비활성화됨: 내장된 PDF 글꼴을 사용할 수 없습니다. + +## Editing + +pdfjs-editor-free-text-button = + .title = 텍스트 +pdfjs-editor-free-text-button-label = 텍스트 +pdfjs-editor-ink-button = + .title = 그리기 +pdfjs-editor-ink-button-label = 그리기 +pdfjs-editor-stamp-button = + .title = 이미지 추가 또는 편집 +pdfjs-editor-stamp-button-label = 이미지 추가 또는 편집 +pdfjs-editor-highlight-button = + .title = 강조 표시 +pdfjs-editor-highlight-button-label = 강조 표시 +pdfjs-highlight-floating-button1 = + .title = 강조 표시 + .aria-label = 강조 표시 +pdfjs-highlight-floating-button-label = 강조 표시 + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = 그리기 제거 +pdfjs-editor-remove-freetext-button = + .title = 텍스트 제거 +pdfjs-editor-remove-stamp-button = + .title = 이미지 제거 +pdfjs-editor-remove-highlight-button = + .title = 강조 표시 제거 + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = 색상 +pdfjs-editor-free-text-size-input = 크기 +pdfjs-editor-ink-color-input = 색상 +pdfjs-editor-ink-thickness-input = 두께 +pdfjs-editor-ink-opacity-input = 불투명도 +pdfjs-editor-stamp-add-image-button = + .title = 이미지 추가 +pdfjs-editor-stamp-add-image-button-label = 이미지 추가 +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = 두께 +pdfjs-editor-free-highlight-thickness-title = + .title = 텍스트 이외의 항목을 강조 표시할 때 두께 변경 +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = 텍스트 편집기 + .default-content = 입력을 시작하세요… +pdfjs-free-text = + .aria-label = 텍스트 편집기 +pdfjs-free-text-default-content = 입력하세요… +pdfjs-ink = + .aria-label = 그리기 편집기 +pdfjs-ink-canvas = + .aria-label = 사용자 생성 이미지 + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = 대체 텍스트 +pdfjs-editor-alt-text-edit-button = + .aria-label = 대체 텍스트 편집 +pdfjs-editor-alt-text-edit-button-label = 대체 텍스트 편집 +pdfjs-editor-alt-text-dialog-label = 옵션을 선택하세요 +pdfjs-editor-alt-text-dialog-description = 대체 텍스트는 사람들이 이미지를 볼 수 없거나 이미지가 로드되지 않을 때 도움이 됩니다. +pdfjs-editor-alt-text-add-description-label = 설명 추가 +pdfjs-editor-alt-text-add-description-description = 주제, 설정, 동작을 설명하는 1~2개의 문장을 목표로 하세요. +pdfjs-editor-alt-text-mark-decorative-label = 장식용으로 표시 +pdfjs-editor-alt-text-mark-decorative-description = 테두리나 워터마크와 같은 장식적인 이미지에 사용됩니다. +pdfjs-editor-alt-text-cancel-button = 취소 +pdfjs-editor-alt-text-save-button = 저장 +pdfjs-editor-alt-text-decorative-tooltip = 장식용으로 표시됨 +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = 예를 들어, “한 청년이 식탁에 앉아 식사를 하고 있습니다.” +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = 대체 텍스트 + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = 왼쪽 위 — 크기 조정 +pdfjs-editor-resizer-label-top-middle = 가운데 위 - 크기 조정 +pdfjs-editor-resizer-label-top-right = 오른쪽 위 — 크기 조정 +pdfjs-editor-resizer-label-middle-right = 오른쪽 가운데 — 크기 조정 +pdfjs-editor-resizer-label-bottom-right = 오른쪽 아래 - 크기 조정 +pdfjs-editor-resizer-label-bottom-middle = 가운데 아래 — 크기 조정 +pdfjs-editor-resizer-label-bottom-left = 왼쪽 아래 - 크기 조정 +pdfjs-editor-resizer-label-middle-left = 왼쪽 가운데 — 크기 조정 +pdfjs-editor-resizer-top-left = + .aria-label = 왼쪽 위 — 크기 조정 +pdfjs-editor-resizer-top-middle = + .aria-label = 가운데 위 - 크기 조정 +pdfjs-editor-resizer-top-right = + .aria-label = 오른쪽 위 — 크기 조정 +pdfjs-editor-resizer-middle-right = + .aria-label = 오른쪽 가운데 — 크기 조정 +pdfjs-editor-resizer-bottom-right = + .aria-label = 오른쪽 아래 - 크기 조정 +pdfjs-editor-resizer-bottom-middle = + .aria-label = 가운데 아래 — 크기 조정 +pdfjs-editor-resizer-bottom-left = + .aria-label = 왼쪽 아래 - 크기 조정 +pdfjs-editor-resizer-middle-left = + .aria-label = 왼쪽 가운데 — 크기 조정 + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = 색상 +pdfjs-editor-colorpicker-button = + .title = 색상 변경 +pdfjs-editor-colorpicker-dropdown = + .aria-label = 색상 선택 +pdfjs-editor-colorpicker-yellow = + .title = 노란색 +pdfjs-editor-colorpicker-green = + .title = 녹색 +pdfjs-editor-colorpicker-blue = + .title = 파란색 +pdfjs-editor-colorpicker-pink = + .title = 분홍색 +pdfjs-editor-colorpicker-red = + .title = 빨간색 + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = 모두 보기 +pdfjs-editor-highlight-show-all-button = + .title = 모두 보기 + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = 대체 텍스트 (이미지 설명) 편집 +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = 대체 텍스트 (이미지 설명) 추가 +pdfjs-editor-new-alt-text-textarea = + .placeholder = 여기에 설명을 작성하세요… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = 이미지가 보이지 않거나 이미지가 로딩되지 않는 경우를 위한 간단한 설명입니다. +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = 이 대체 텍스트는 자동으로 생성되었으므로 정확하지 않을 수 있습니다. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = 더 알아보기 +pdfjs-editor-new-alt-text-create-automatically-button-label = 자동으로 대체 텍스트 생성 +pdfjs-editor-new-alt-text-not-now-button = 나중에 +pdfjs-editor-new-alt-text-error-title = 대체 텍스트를 자동으로 생성할 수 없습니다. +pdfjs-editor-new-alt-text-error-description = 대체 텍스트를 직접 작성하거나 나중에 다시 시도하세요. +pdfjs-editor-new-alt-text-error-close-button = 닫기 +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = 대체 텍스트 AI 모델 다운로드 중 ({ $downloadedSize } / { $totalSize } MB) + .aria-valuetext = 대체 텍스트 AI 모델 다운로드 중 ({ $downloadedSize } / { $totalSize } MB) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = 대체 텍스트 추가됨 +pdfjs-editor-new-alt-text-added-button-label = 대체 텍스트 추가됨 +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = 대체 텍스트 누락 +pdfjs-editor-new-alt-text-missing-button-label = 대체 텍스트 누락 +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = 대체 텍스트 검토 +pdfjs-editor-new-alt-text-to-review-button-label = 대체 텍스트 검토 +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = 자동으로 생성됨: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = 이미지 대체 텍스트 설정 +pdfjs-image-alt-text-settings-button-label = 이미지 대체 텍스트 설정 +pdfjs-editor-alt-text-settings-dialog-label = 이미지 대체 텍스트 설정 +pdfjs-editor-alt-text-settings-automatic-title = 자동 대체 텍스트 +pdfjs-editor-alt-text-settings-create-model-button-label = 자동으로 대체 텍스트 생성 +pdfjs-editor-alt-text-settings-create-model-description = 이미지가 보이지 않거나 이미지가 로딩되지 않을 때 도움이 되는 설명을 제안합니다. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = 대체 텍스트 AI 모델 ({ $totalSize } MB) +pdfjs-editor-alt-text-settings-ai-model-description = 사용자의 장치에서 로컬로 실행되므로 데이터가 비공개로 유지됩니다. 자동 대체 텍스트에 필요합니다. +pdfjs-editor-alt-text-settings-delete-model-button = 삭제 +pdfjs-editor-alt-text-settings-download-model-button = 다운로드 +pdfjs-editor-alt-text-settings-downloading-model-button = 다운로드 중… +pdfjs-editor-alt-text-settings-editor-title = 대체 텍스트 편집기 +pdfjs-editor-alt-text-settings-show-dialog-button-label = 이미지 추가 시 바로 대체 텍스트 편집기 표시 +pdfjs-editor-alt-text-settings-show-dialog-description = 모든 이미지에 대체 텍스트가 있는지 확인하는 데 도움이 됩니다. +pdfjs-editor-alt-text-settings-close-button = 닫기 + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = 강조 표시 제거됨 +pdfjs-editor-undo-bar-message-freetext = 텍스트 제거됨 +pdfjs-editor-undo-bar-message-ink = 그리기 제거됨 +pdfjs-editor-undo-bar-message-stamp = 이미지 제거됨 +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = 주석 { $count }개 제거됨 +pdfjs-editor-undo-bar-undo-button = + .title = 실행 취소 +pdfjs-editor-undo-bar-undo-button-label = 실행 취소 +pdfjs-editor-undo-bar-close-button = + .title = 닫기 +pdfjs-editor-undo-bar-close-button-label = 닫기 diff --git a/public/pdfjs/web/locale/lij/viewer.ftl b/public/pdfjs/web/locale/lij/viewer.ftl new file mode 100644 index 0000000..b2941f9 --- /dev/null +++ b/public/pdfjs/web/locale/lij/viewer.ftl @@ -0,0 +1,247 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Pagina primma +pdfjs-previous-button-label = Precedente +pdfjs-next-button = + .title = Pagina dòppo +pdfjs-next-button-label = Pròscima +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Pagina +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = de { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } de { $pagesCount }) +pdfjs-zoom-out-button = + .title = Diminoisci zoom +pdfjs-zoom-out-button-label = Diminoisci zoom +pdfjs-zoom-in-button = + .title = Aomenta zoom +pdfjs-zoom-in-button-label = Aomenta zoom +pdfjs-zoom-select = + .title = Zoom +pdfjs-presentation-mode-button = + .title = Vanni into mòddo de prezentaçion +pdfjs-presentation-mode-button-label = Mòddo de prezentaçion +pdfjs-open-file-button = + .title = Arvi file +pdfjs-open-file-button-label = Arvi +pdfjs-print-button = + .title = Stanpa +pdfjs-print-button-label = Stanpa + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Atressi +pdfjs-tools-button-label = Atressi +pdfjs-first-page-button = + .title = Vanni a-a primma pagina +pdfjs-first-page-button-label = Vanni a-a primma pagina +pdfjs-last-page-button = + .title = Vanni a l'urtima pagina +pdfjs-last-page-button-label = Vanni a l'urtima pagina +pdfjs-page-rotate-cw-button = + .title = Gia into verso oraio +pdfjs-page-rotate-cw-button-label = Gia into verso oraio +pdfjs-page-rotate-ccw-button = + .title = Gia into verso antioraio +pdfjs-page-rotate-ccw-button-label = Gia into verso antioraio +pdfjs-cursor-text-select-tool-button = + .title = Abilita strumento de seleçion do testo +pdfjs-cursor-text-select-tool-button-label = Strumento de seleçion do testo +pdfjs-cursor-hand-tool-button = + .title = Abilita strumento man +pdfjs-cursor-hand-tool-button-label = Strumento man +pdfjs-scroll-vertical-button = + .title = Deuvia rebelamento verticale +pdfjs-scroll-vertical-button-label = Rebelamento verticale +pdfjs-scroll-horizontal-button = + .title = Deuvia rebelamento orizontâ +pdfjs-scroll-horizontal-button-label = Rebelamento orizontâ +pdfjs-scroll-wrapped-button = + .title = Deuvia rebelamento incapsolou +pdfjs-scroll-wrapped-button-label = Rebelamento incapsolou +pdfjs-spread-none-button = + .title = No unite a-a difuxon de pagina +pdfjs-spread-none-button-label = No difuxon +pdfjs-spread-odd-button = + .title = Uniscite a-a difuxon de pagina co-o numero dèspa +pdfjs-spread-odd-button-label = Difuxon dèspa +pdfjs-spread-even-button = + .title = Uniscite a-a difuxon de pagina co-o numero pari +pdfjs-spread-even-button-label = Difuxon pari + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Propietæ do documento… +pdfjs-document-properties-button-label = Propietæ do documento… +pdfjs-document-properties-file-name = Nomme schedaio: +pdfjs-document-properties-file-size = Dimenscion schedaio: +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } kB ({ $size_b } byte) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } byte) +pdfjs-document-properties-title = Titolo: +pdfjs-document-properties-author = Aoto: +pdfjs-document-properties-subject = Ogetto: +pdfjs-document-properties-keywords = Paròlle ciave: +pdfjs-document-properties-creation-date = Dæta creaçion: +pdfjs-document-properties-modification-date = Dæta cangiamento: +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Aotô originale: +pdfjs-document-properties-producer = Produtô PDF: +pdfjs-document-properties-version = Verscion PDF: +pdfjs-document-properties-page-count = Contezzo pagine: +pdfjs-document-properties-page-size = Dimenscion da pagina: +pdfjs-document-properties-page-size-unit-inches = dii gròsci +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = drito +pdfjs-document-properties-page-size-orientation-landscape = desteizo +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Letia +pdfjs-document-properties-page-size-name-legal = Lezze + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Vista veloce do Web: +pdfjs-document-properties-linearized-yes = Sci +pdfjs-document-properties-linearized-no = No +pdfjs-document-properties-close-button = Særa + +## Print + +pdfjs-print-progress-message = Praparo o documento pe-a stanpa… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Anulla +pdfjs-printing-not-supported = Atençion: a stanpa a no l'é conpletamente soportâ da sto navegatô. +pdfjs-printing-not-ready = Atençion: o PDF o no l'é ancon caregou conpletamente pe-a stanpa. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Ativa/dizativa bara de scianco +pdfjs-toggle-sidebar-button-label = Ativa/dizativa bara de scianco +pdfjs-document-outline-button = + .title = Fanni vedde o contorno do documento (scicca doggio pe espande/ridue tutti i elementi) +pdfjs-document-outline-button-label = Contorno do documento +pdfjs-attachments-button = + .title = Fanni vedde alegæ +pdfjs-attachments-button-label = Alegæ +pdfjs-thumbs-button = + .title = Mostra miniatue +pdfjs-thumbs-button-label = Miniatue +pdfjs-findbar-button = + .title = Treuva into documento +pdfjs-findbar-button-label = Treuva + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Pagina { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Miniatua da pagina { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Treuva + .placeholder = Treuva into documento… +pdfjs-find-previous-button = + .title = Treuva a ripetiçion precedente do testo da çercâ +pdfjs-find-previous-button-label = Precedente +pdfjs-find-next-button = + .title = Treuva a ripetiçion dòppo do testo da çercâ +pdfjs-find-next-button-label = Segoente +pdfjs-find-highlight-checkbox = Evidençia +pdfjs-find-match-case-checkbox-label = Maioscole/minoscole +pdfjs-find-entire-word-checkbox-label = Poula intrega +pdfjs-find-reached-top = Razonto a fin da pagina, continoa da l'iniçio +pdfjs-find-reached-bottom = Razonto l'iniçio da pagina, continoa da-a fin +pdfjs-find-not-found = Testo no trovou + +## Predefined zoom values + +pdfjs-page-scale-width = Larghessa pagina +pdfjs-page-scale-fit = Adatta a una pagina +pdfjs-page-scale-auto = Zoom aotomatico +pdfjs-page-scale-actual = Dimenscioin efetive +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + + +## Loading indicator messages + +pdfjs-loading-error = S'é verificou 'n'erô itno caregamento do PDF. +pdfjs-invalid-file-error = O schedaio PDF o l'é no valido ò aroinou. +pdfjs-missing-file-error = O schedaio PDF o no gh'é. +pdfjs-unexpected-response-error = Risposta inprevista do-u server +pdfjs-rendering-error = Gh'é stæto 'n'erô itno rendering da pagina. + +## Annotations + +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [Anotaçion: { $type }] + +## Password + +pdfjs-password-label = Dimme a paròlla segreta pe arvî sto schedaio PDF. +pdfjs-password-invalid = Paròlla segreta sbalia. Preuva torna. +pdfjs-password-ok-button = Va ben +pdfjs-password-cancel-button = Anulla +pdfjs-web-fonts-disabled = I font do web en dizativæ: inposcibile adeuviâ i carateri do PDF. + +## Editing + + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + diff --git a/public/pdfjs/web/locale/lo/viewer.ftl b/public/pdfjs/web/locale/lo/viewer.ftl new file mode 100644 index 0000000..557e201 --- /dev/null +++ b/public/pdfjs/web/locale/lo/viewer.ftl @@ -0,0 +1,313 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = ຫນ້າກ່ອນຫນ້າ +pdfjs-previous-button-label = ກ່ອນຫນ້າ +pdfjs-next-button = + .title = ຫນ້າຖັດໄປ +pdfjs-next-button-label = ຖັດໄປ +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = ຫນ້າ +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = ຈາກ { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } ຈາກ { $pagesCount }) +pdfjs-zoom-out-button = + .title = ຂະຫຍາຍອອກ +pdfjs-zoom-out-button-label = ຂະຫຍາຍອອກ +pdfjs-zoom-in-button = + .title = ຂະຫຍາຍເຂົ້າ +pdfjs-zoom-in-button-label = ຂະຫຍາຍເຂົ້າ +pdfjs-zoom-select = + .title = ຂະຫຍາຍ +pdfjs-presentation-mode-button = + .title = ສັບປ່ຽນເປັນໂຫມດການນຳສະເຫນີ +pdfjs-presentation-mode-button-label = ໂຫມດການນຳສະເຫນີ +pdfjs-open-file-button = + .title = ເປີດໄຟລ໌ +pdfjs-open-file-button-label = ເປີດ +pdfjs-print-button = + .title = ພິມ +pdfjs-print-button-label = ພິມ +pdfjs-save-button = + .title = ບັນທຶກ +pdfjs-save-button-label = ບັນທຶກ +pdfjs-bookmark-button = + .title = ໜ້າປັດຈຸບັນ (ເບິ່ງ URL ຈາກໜ້າປັດຈຸບັນ) +pdfjs-bookmark-button-label = ຫນ້າ​ປັດ​ຈຸ​ບັນ + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = ເຄື່ອງມື +pdfjs-tools-button-label = ເຄື່ອງມື +pdfjs-first-page-button = + .title = ໄປທີ່ຫນ້າທຳອິດ +pdfjs-first-page-button-label = ໄປທີ່ຫນ້າທຳອິດ +pdfjs-last-page-button = + .title = ໄປທີ່ຫນ້າສຸດທ້າຍ +pdfjs-last-page-button-label = ໄປທີ່ຫນ້າສຸດທ້າຍ +pdfjs-page-rotate-cw-button = + .title = ຫມູນຕາມເຂັມໂມງ +pdfjs-page-rotate-cw-button-label = ຫມູນຕາມເຂັມໂມງ +pdfjs-page-rotate-ccw-button = + .title = ຫມູນທວນເຂັມໂມງ +pdfjs-page-rotate-ccw-button-label = ຫມູນທວນເຂັມໂມງ +pdfjs-cursor-text-select-tool-button = + .title = ເປີດໃຊ້ເຄື່ອງມືການເລືອກຂໍ້ຄວາມ +pdfjs-cursor-text-select-tool-button-label = ເຄື່ອງມືເລືອກຂໍ້ຄວາມ +pdfjs-cursor-hand-tool-button = + .title = ເປີດໃຊ້ເຄື່ອງມືມື +pdfjs-cursor-hand-tool-button-label = ເຄື່ອງມືມື +pdfjs-scroll-page-button = + .title = ໃຊ້ການເລື່ອນໜ້າ +pdfjs-scroll-page-button-label = ເລື່ອນໜ້າ +pdfjs-scroll-vertical-button = + .title = ໃຊ້ການເລື່ອນແນວຕັ້ງ +pdfjs-scroll-vertical-button-label = ເລື່ອນແນວຕັ້ງ +pdfjs-scroll-horizontal-button = + .title = ໃຊ້ການເລື່ອນແນວນອນ +pdfjs-scroll-horizontal-button-label = ເລື່ອນແນວນອນ +pdfjs-scroll-wrapped-button = + .title = ໃຊ້ Wrapped Scrolling +pdfjs-scroll-wrapped-button-label = Wrapped Scrolling +pdfjs-spread-none-button = + .title = ບໍ່ຕ້ອງຮ່ວມການແຜ່ກະຈາຍຫນ້າ +pdfjs-spread-none-button-label = ບໍ່ມີການແຜ່ກະຈາຍ +pdfjs-spread-odd-button = + .title = ເຂົ້າຮ່ວມການແຜ່ກະຈາຍຫນ້າເລີ່ມຕົ້ນດ້ວຍຫນ້າເລກຄີກ +pdfjs-spread-odd-button-label = ການແຜ່ກະຈາຍຄີກ +pdfjs-spread-even-button = + .title = ເຂົ້າຮ່ວມການແຜ່ກະຈາຍຂອງຫນ້າເລີ່ມຕົ້ນດ້ວຍຫນ້າເລກຄູ່ +pdfjs-spread-even-button-label = ການແຜ່ກະຈາຍຄູ່ + +## Document properties dialog + +pdfjs-document-properties-button = + .title = ຄຸນສົມບັດເອກະສານ... +pdfjs-document-properties-button-label = ຄຸນສົມບັດເອກະສານ... +pdfjs-document-properties-file-name = ຊື່ໄຟລ໌: +pdfjs-document-properties-file-size = ຂະຫນາດໄຟລ໌: +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } ໄບຕ໌) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } ໄບຕ໌) +pdfjs-document-properties-title = ຫົວຂໍ້: +pdfjs-document-properties-author = ຜູ້ຂຽນ: +pdfjs-document-properties-subject = ຫົວຂໍ້: +pdfjs-document-properties-keywords = ຄໍາທີ່ຕ້ອງການຄົ້ນຫາ: +pdfjs-document-properties-creation-date = ວັນທີສ້າງ: +pdfjs-document-properties-modification-date = ວັນທີແກ້ໄຂ: +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = ຜູ້ສ້າງ: +pdfjs-document-properties-producer = ຜູ້ຜະລິດ PDF: +pdfjs-document-properties-version = ເວີຊັ່ນ PDF: +pdfjs-document-properties-page-count = ຈຳນວນໜ້າ: +pdfjs-document-properties-page-size = ຂະໜາດໜ້າ: +pdfjs-document-properties-page-size-unit-inches = in +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = ລວງຕັ້ງ +pdfjs-document-properties-page-size-orientation-landscape = ລວງນອນ +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = ຈົດໝາຍ +pdfjs-document-properties-page-size-name-legal = ຂໍ້ກົດຫມາຍ + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = ມຸມມອງເວັບທີ່ໄວ: +pdfjs-document-properties-linearized-yes = ແມ່ນ +pdfjs-document-properties-linearized-no = ບໍ່ +pdfjs-document-properties-close-button = ປິດ + +## Print + +pdfjs-print-progress-message = ກຳລັງກະກຽມເອກະສານສຳລັບການພິມ... +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = ຍົກເລີກ +pdfjs-printing-not-supported = ຄຳເຕືອນ: ບຼາວເຊີນີ້ບໍ່ຮອງຮັບການພິມຢ່າງເຕັມທີ່. +pdfjs-printing-not-ready = ຄໍາ​ເຕືອນ​: PDF ບໍ່​ໄດ້​ຖືກ​ໂຫຼດ​ຢ່າງ​ເຕັມ​ທີ່​ສໍາ​ລັບ​ການ​ພິມ​. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = ເປີດ/ປິດແຖບຂ້າງ +pdfjs-toggle-sidebar-notification-button = + .title = ສະຫຼັບແຖບດ້ານຂ້າງ (ເອກະສານປະກອບມີໂຄງຮ່າງ/ໄຟລ໌ແນບ/ຊັ້ນຂໍ້ມູນ) +pdfjs-toggle-sidebar-button-label = ເປີດ/ປິດແຖບຂ້າງ +pdfjs-document-outline-button = + .title = ສະ​ແດງ​ໂຄງ​ຮ່າງ​ເອ​ກະ​ສານ (ກົດ​ສອງ​ຄັ້ງ​ເພື່ອ​ຂະ​ຫຍາຍ / ຫຍໍ້​ລາຍ​ການ​ທັງ​ຫມົດ​) +pdfjs-document-outline-button-label = ເຄົ້າຮ່າງເອກະສານ +pdfjs-attachments-button = + .title = ສະແດງໄຟລ໌ແນບ +pdfjs-attachments-button-label = ໄຟລ໌ແນບ +pdfjs-layers-button = + .title = ສະແດງຊັ້ນຂໍ້ມູນ (ຄລິກສອງເທື່ອເພື່ອຣີເຊັດຊັ້ນຂໍ້ມູນທັງໝົດໃຫ້ເປັນສະຖານະເລີ່ມຕົ້ນ) +pdfjs-layers-button-label = ຊັ້ນ +pdfjs-thumbs-button = + .title = ສະແດງຮູບຫຍໍ້ +pdfjs-thumbs-button-label = ຮູບຕົວຢ່າງ +pdfjs-current-outline-item-button = + .title = ຊອກຫາລາຍການໂຄງຮ່າງປະຈຸບັນ +pdfjs-current-outline-item-button-label = ລາຍການໂຄງຮ່າງປະຈຸບັນ +pdfjs-findbar-button = + .title = ຊອກຫາໃນເອກະສານ +pdfjs-findbar-button-label = ຄົ້ນຫາ +pdfjs-additional-layers = ຊັ້ນຂໍ້ມູນເພີ່ມເຕີມ + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = ໜ້າ { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = ຮູບຕົວຢ່າງຂອງໜ້າ { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = ຄົ້ນຫາ + .placeholder = ຊອກຫາໃນເອກະສານ... +pdfjs-find-previous-button = + .title = ຊອກຫາການປະກົດຕົວທີ່ຜ່ານມາຂອງປະໂຫຍກ +pdfjs-find-previous-button-label = ກ່ອນຫນ້ານີ້ +pdfjs-find-next-button = + .title = ຊອກຫາຕຳແຫນ່ງຖັດໄປຂອງວະລີ +pdfjs-find-next-button-label = ຕໍ່ໄປ +pdfjs-find-highlight-checkbox = ໄຮໄລທ໌ທັງຫມົດ +pdfjs-find-match-case-checkbox-label = ກໍລະນີທີ່ກົງກັນ +pdfjs-find-match-diacritics-checkbox-label = ເຄື່ອງໝາຍກຳກັບການອອກສຽງກົງກັນ +pdfjs-find-entire-word-checkbox-label = ກົງກັນທຸກຄຳ +pdfjs-find-reached-top = ມາຮອດເທິງຂອງເອກະສານ, ສືບຕໍ່ຈາກລຸ່ມ +pdfjs-find-reached-bottom = ຮອດຕອນທ້າຍຂອງເອກະສານ, ສືບຕໍ່ຈາກເທິງ +pdfjs-find-not-found = ບໍ່ພົບວະລີທີ່ຕ້ອງການ + +## Predefined zoom values + +pdfjs-page-scale-width = ຄວາມກວ້າງໜ້າ +pdfjs-page-scale-fit = ໜ້າພໍດີ +pdfjs-page-scale-auto = ຊູມອັດຕະໂນມັດ +pdfjs-page-scale-actual = ຂະໜາດຕົວຈິງ +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = ໜ້າ { $page } + +## Loading indicator messages + +pdfjs-loading-error = ມີຂໍ້ຜິດພາດເກີດຂື້ນຂະນະທີ່ກຳລັງໂຫລດ PDF. +pdfjs-invalid-file-error = ໄຟລ໌ PDF ບໍ່ຖືກຕ້ອງຫລືເສຍຫາຍ. +pdfjs-missing-file-error = ບໍ່ມີໄຟລ໌ PDF. +pdfjs-unexpected-response-error = ການຕອບສະໜອງຂອງເຊີບເວີທີ່ບໍ່ຄາດຄິດ. +pdfjs-rendering-error = ມີຂໍ້ຜິດພາດເກີດຂື້ນຂະນະທີ່ກຳລັງເຣັນເດີຫນ້າ. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } ຄຳບັນຍາຍ] + +## Password + +pdfjs-password-label = ໃສ່ລະຫັດຜ່ານເພື່ອເປີດໄຟລ໌ PDF ນີ້. +pdfjs-password-invalid = ລະຫັດຜ່ານບໍ່ຖືກຕ້ອງ. ກະລຸນາລອງອີກຄັ້ງ. +pdfjs-password-ok-button = ຕົກລົງ +pdfjs-password-cancel-button = ຍົກເລີກ +pdfjs-web-fonts-disabled = ຟອນເວັບຖືກປິດໃຊ້ງານ: ບໍ່ສາມາດໃຊ້ຟອນ PDF ທີ່ຝັງໄວ້ໄດ້. + +## Editing + +pdfjs-editor-free-text-button = + .title = ຂໍ້ຄວາມ +pdfjs-editor-free-text-button-label = ຂໍ້ຄວາມ +pdfjs-editor-ink-button = + .title = ແຕ້ມ +pdfjs-editor-ink-button-label = ແຕ້ມ + +## Remove button for the various kind of editor. + + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = ສີ +pdfjs-editor-free-text-size-input = ຂະຫນາດ +pdfjs-editor-ink-color-input = ສີ +pdfjs-editor-ink-thickness-input = ຄວາມຫນາ +pdfjs-editor-ink-opacity-input = ຄວາມໂປ່ງໃສ +pdfjs-free-text = + .aria-label = ຕົວແກ້ໄຂຂໍ້ຄວາມ +pdfjs-free-text-default-content = ເລີ່ມພິມ... +pdfjs-ink = + .aria-label = ຕົວແກ້ໄຂຮູບແຕ້ມ +pdfjs-ink-canvas = + .aria-label = ຮູບພາບທີ່ຜູ້ໃຊ້ສ້າງ + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + + +## Color picker + + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + + +## Image alt-text settings + diff --git a/public/pdfjs/web/locale/locale.json b/public/pdfjs/web/locale/locale.json new file mode 100644 index 0000000..2012211 --- /dev/null +++ b/public/pdfjs/web/locale/locale.json @@ -0,0 +1 @@ +{"ach":"ach/viewer.ftl","af":"af/viewer.ftl","an":"an/viewer.ftl","ar":"ar/viewer.ftl","ast":"ast/viewer.ftl","az":"az/viewer.ftl","be":"be/viewer.ftl","bg":"bg/viewer.ftl","bn":"bn/viewer.ftl","bo":"bo/viewer.ftl","br":"br/viewer.ftl","brx":"brx/viewer.ftl","bs":"bs/viewer.ftl","ca":"ca/viewer.ftl","cak":"cak/viewer.ftl","ckb":"ckb/viewer.ftl","cs":"cs/viewer.ftl","cy":"cy/viewer.ftl","da":"da/viewer.ftl","de":"de/viewer.ftl","dsb":"dsb/viewer.ftl","el":"el/viewer.ftl","en-ca":"en-CA/viewer.ftl","en-gb":"en-GB/viewer.ftl","en-us":"en-US/viewer.ftl","eo":"eo/viewer.ftl","es-ar":"es-AR/viewer.ftl","es-cl":"es-CL/viewer.ftl","es-es":"es-ES/viewer.ftl","es-mx":"es-MX/viewer.ftl","et":"et/viewer.ftl","eu":"eu/viewer.ftl","fa":"fa/viewer.ftl","ff":"ff/viewer.ftl","fi":"fi/viewer.ftl","fr":"fr/viewer.ftl","fur":"fur/viewer.ftl","fy-nl":"fy-NL/viewer.ftl","ga-ie":"ga-IE/viewer.ftl","gd":"gd/viewer.ftl","gl":"gl/viewer.ftl","gn":"gn/viewer.ftl","gu-in":"gu-IN/viewer.ftl","he":"he/viewer.ftl","hi-in":"hi-IN/viewer.ftl","hr":"hr/viewer.ftl","hsb":"hsb/viewer.ftl","hu":"hu/viewer.ftl","hy-am":"hy-AM/viewer.ftl","hye":"hye/viewer.ftl","ia":"ia/viewer.ftl","id":"id/viewer.ftl","is":"is/viewer.ftl","it":"it/viewer.ftl","ja":"ja/viewer.ftl","ka":"ka/viewer.ftl","kab":"kab/viewer.ftl","kk":"kk/viewer.ftl","km":"km/viewer.ftl","kn":"kn/viewer.ftl","ko":"ko/viewer.ftl","lij":"lij/viewer.ftl","lo":"lo/viewer.ftl","lt":"lt/viewer.ftl","ltg":"ltg/viewer.ftl","lv":"lv/viewer.ftl","meh":"meh/viewer.ftl","mk":"mk/viewer.ftl","mr":"mr/viewer.ftl","ms":"ms/viewer.ftl","my":"my/viewer.ftl","nb-no":"nb-NO/viewer.ftl","ne-np":"ne-NP/viewer.ftl","nl":"nl/viewer.ftl","nn-no":"nn-NO/viewer.ftl","oc":"oc/viewer.ftl","pa-in":"pa-IN/viewer.ftl","pl":"pl/viewer.ftl","pt-br":"pt-BR/viewer.ftl","pt-pt":"pt-PT/viewer.ftl","rm":"rm/viewer.ftl","ro":"ro/viewer.ftl","ru":"ru/viewer.ftl","sat":"sat/viewer.ftl","sc":"sc/viewer.ftl","scn":"scn/viewer.ftl","sco":"sco/viewer.ftl","si":"si/viewer.ftl","sk":"sk/viewer.ftl","skr":"skr/viewer.ftl","sl":"sl/viewer.ftl","son":"son/viewer.ftl","sq":"sq/viewer.ftl","sr":"sr/viewer.ftl","sv-se":"sv-SE/viewer.ftl","szl":"szl/viewer.ftl","ta":"ta/viewer.ftl","te":"te/viewer.ftl","tg":"tg/viewer.ftl","th":"th/viewer.ftl","tl":"tl/viewer.ftl","tr":"tr/viewer.ftl","trs":"trs/viewer.ftl","uk":"uk/viewer.ftl","ur":"ur/viewer.ftl","uz":"uz/viewer.ftl","vi":"vi/viewer.ftl","wo":"wo/viewer.ftl","xh":"xh/viewer.ftl","zh-cn":"zh-CN/viewer.ftl","zh-tw":"zh-TW/viewer.ftl"} \ No newline at end of file diff --git a/public/pdfjs/web/locale/lt/viewer.ftl b/public/pdfjs/web/locale/lt/viewer.ftl new file mode 100644 index 0000000..a8ee7a0 --- /dev/null +++ b/public/pdfjs/web/locale/lt/viewer.ftl @@ -0,0 +1,268 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Ankstesnis puslapis +pdfjs-previous-button-label = Ankstesnis +pdfjs-next-button = + .title = Kitas puslapis +pdfjs-next-button-label = Kitas +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Puslapis +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = iš { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } iš { $pagesCount }) +pdfjs-zoom-out-button = + .title = Sumažinti +pdfjs-zoom-out-button-label = Sumažinti +pdfjs-zoom-in-button = + .title = Padidinti +pdfjs-zoom-in-button-label = Padidinti +pdfjs-zoom-select = + .title = Mastelis +pdfjs-presentation-mode-button = + .title = Pereiti į pateikties veikseną +pdfjs-presentation-mode-button-label = Pateikties veiksena +pdfjs-open-file-button = + .title = Atverti failą +pdfjs-open-file-button-label = Atverti +pdfjs-print-button = + .title = Spausdinti +pdfjs-print-button-label = Spausdinti + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Priemonės +pdfjs-tools-button-label = Priemonės +pdfjs-first-page-button = + .title = Eiti į pirmą puslapį +pdfjs-first-page-button-label = Eiti į pirmą puslapį +pdfjs-last-page-button = + .title = Eiti į paskutinį puslapį +pdfjs-last-page-button-label = Eiti į paskutinį puslapį +pdfjs-page-rotate-cw-button = + .title = Pasukti pagal laikrodžio rodyklę +pdfjs-page-rotate-cw-button-label = Pasukti pagal laikrodžio rodyklę +pdfjs-page-rotate-ccw-button = + .title = Pasukti prieš laikrodžio rodyklę +pdfjs-page-rotate-ccw-button-label = Pasukti prieš laikrodžio rodyklę +pdfjs-cursor-text-select-tool-button = + .title = Įjungti teksto žymėjimo įrankį +pdfjs-cursor-text-select-tool-button-label = Teksto žymėjimo įrankis +pdfjs-cursor-hand-tool-button = + .title = Įjungti vilkimo įrankį +pdfjs-cursor-hand-tool-button-label = Vilkimo įrankis +pdfjs-scroll-page-button = + .title = Naudoti puslapio slinkimą +pdfjs-scroll-page-button-label = Puslapio slinkimas +pdfjs-scroll-vertical-button = + .title = Naudoti vertikalų slinkimą +pdfjs-scroll-vertical-button-label = Vertikalus slinkimas +pdfjs-scroll-horizontal-button = + .title = Naudoti horizontalų slinkimą +pdfjs-scroll-horizontal-button-label = Horizontalus slinkimas +pdfjs-scroll-wrapped-button = + .title = Naudoti išklotą slinkimą +pdfjs-scroll-wrapped-button-label = Išklotas slinkimas +pdfjs-spread-none-button = + .title = Nejungti puslapių į dvilapius +pdfjs-spread-none-button-label = Be dvilapių +pdfjs-spread-odd-button = + .title = Sujungti į dvilapius pradedant nelyginiais puslapiais +pdfjs-spread-odd-button-label = Nelyginiai dvilapiai +pdfjs-spread-even-button = + .title = Sujungti į dvilapius pradedant lyginiais puslapiais +pdfjs-spread-even-button-label = Lyginiai dvilapiai + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Dokumento savybės… +pdfjs-document-properties-button-label = Dokumento savybės… +pdfjs-document-properties-file-name = Failo vardas: +pdfjs-document-properties-file-size = Failo dydis: +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } B) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } B) +pdfjs-document-properties-title = Antraštė: +pdfjs-document-properties-author = Autorius: +pdfjs-document-properties-subject = Tema: +pdfjs-document-properties-keywords = Reikšminiai žodžiai: +pdfjs-document-properties-creation-date = Sukūrimo data: +pdfjs-document-properties-modification-date = Modifikavimo data: +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Kūrėjas: +pdfjs-document-properties-producer = PDF generatorius: +pdfjs-document-properties-version = PDF versija: +pdfjs-document-properties-page-count = Puslapių skaičius: +pdfjs-document-properties-page-size = Puslapio dydis: +pdfjs-document-properties-page-size-unit-inches = in +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = stačias +pdfjs-document-properties-page-size-orientation-landscape = gulsčias +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Laiškas +pdfjs-document-properties-page-size-name-legal = Dokumentas + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Spartus žiniatinklio rodinys: +pdfjs-document-properties-linearized-yes = Taip +pdfjs-document-properties-linearized-no = Ne +pdfjs-document-properties-close-button = Užverti + +## Print + +pdfjs-print-progress-message = Dokumentas ruošiamas spausdinimui… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Atsisakyti +pdfjs-printing-not-supported = Dėmesio! Spausdinimas šioje naršyklėje nėra pilnai realizuotas. +pdfjs-printing-not-ready = Dėmesio! PDF failas dar nėra pilnai įkeltas spausdinimui. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Rodyti / slėpti šoninį polangį +pdfjs-toggle-sidebar-notification-button = + .title = Parankinė (dokumentas turi struktūrą / priedų / sluoksnių) +pdfjs-toggle-sidebar-button-label = Šoninis polangis +pdfjs-document-outline-button = + .title = Rodyti dokumento struktūrą (spustelėkite dukart norėdami išplėsti/suskleisti visus elementus) +pdfjs-document-outline-button-label = Dokumento struktūra +pdfjs-attachments-button = + .title = Rodyti priedus +pdfjs-attachments-button-label = Priedai +pdfjs-layers-button = + .title = Rodyti sluoksnius (spustelėkite dukart, norėdami atstatyti visus sluoksnius į numatytąją būseną) +pdfjs-layers-button-label = Sluoksniai +pdfjs-thumbs-button = + .title = Rodyti puslapių miniatiūras +pdfjs-thumbs-button-label = Miniatiūros +pdfjs-current-outline-item-button = + .title = Rasti dabartinį struktūros elementą +pdfjs-current-outline-item-button-label = Dabartinis struktūros elementas +pdfjs-findbar-button = + .title = Ieškoti dokumente +pdfjs-findbar-button-label = Rasti +pdfjs-additional-layers = Papildomi sluoksniai + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = { $page } puslapis +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = { $page } puslapio miniatiūra + +## Find panel button title and messages + +pdfjs-find-input = + .title = Rasti + .placeholder = Rasti dokumente… +pdfjs-find-previous-button = + .title = Ieškoti ankstesnio frazės egzemplioriaus +pdfjs-find-previous-button-label = Ankstesnis +pdfjs-find-next-button = + .title = Ieškoti tolesnio frazės egzemplioriaus +pdfjs-find-next-button-label = Tolesnis +pdfjs-find-highlight-checkbox = Viską paryškinti +pdfjs-find-match-case-checkbox-label = Skirti didžiąsias ir mažąsias raides +pdfjs-find-match-diacritics-checkbox-label = Skirti diakritinius ženklus +pdfjs-find-entire-word-checkbox-label = Ištisi žodžiai +pdfjs-find-reached-top = Pasiekus dokumento pradžią, paieška pratęsta nuo pabaigos +pdfjs-find-reached-bottom = Pasiekus dokumento pabaigą, paieška pratęsta nuo pradžios +pdfjs-find-not-found = Ieškoma frazė nerasta + +## Predefined zoom values + +pdfjs-page-scale-width = Priderinti prie lapo pločio +pdfjs-page-scale-fit = Pritaikyti prie lapo dydžio +pdfjs-page-scale-auto = Automatinis mastelis +pdfjs-page-scale-actual = Tikras dydis +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = { $page } puslapis + +## Loading indicator messages + +pdfjs-loading-error = Įkeliant PDF failą įvyko klaida. +pdfjs-invalid-file-error = Tai nėra PDF failas arba jis yra sugadintas. +pdfjs-missing-file-error = PDF failas nerastas. +pdfjs-unexpected-response-error = Netikėtas serverio atsakas. +pdfjs-rendering-error = Atvaizduojant puslapį įvyko klaida. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [„{ $type }“ tipo anotacija] + +## Password + +pdfjs-password-label = Įveskite slaptažodį šiam PDF failui atverti. +pdfjs-password-invalid = Slaptažodis neteisingas. Bandykite dar kartą. +pdfjs-password-ok-button = Gerai +pdfjs-password-cancel-button = Atsisakyti +pdfjs-web-fonts-disabled = Saityno šriftai išjungti – PDF faile esančių šriftų naudoti negalima. + +## Editing + + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + diff --git a/public/pdfjs/web/locale/ltg/viewer.ftl b/public/pdfjs/web/locale/ltg/viewer.ftl new file mode 100644 index 0000000..d262165 --- /dev/null +++ b/public/pdfjs/web/locale/ltg/viewer.ftl @@ -0,0 +1,246 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Īprīkšejā lopa +pdfjs-previous-button-label = Īprīkšejā +pdfjs-next-button = + .title = Nuokomuo lopa +pdfjs-next-button-label = Nuokomuo +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Lopa +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = nu { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } nu { $pagesCount }) +pdfjs-zoom-out-button = + .title = Attuolynuot +pdfjs-zoom-out-button-label = Attuolynuot +pdfjs-zoom-in-button = + .title = Pītuvynuot +pdfjs-zoom-in-button-label = Pītuvynuot +pdfjs-zoom-select = + .title = Palelynuojums +pdfjs-presentation-mode-button = + .title = Puorslēgtīs iz Prezentacejis režymu +pdfjs-presentation-mode-button-label = Prezentacejis režyms +pdfjs-open-file-button = + .title = Attaiseit failu +pdfjs-open-file-button-label = Attaiseit +pdfjs-print-button = + .title = Drukuošona +pdfjs-print-button-label = Drukōt + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Reiki +pdfjs-tools-button-label = Reiki +pdfjs-first-page-button = + .title = Īt iz pyrmū lopu +pdfjs-first-page-button-label = Īt iz pyrmū lopu +pdfjs-last-page-button = + .title = Īt iz piedejū lopu +pdfjs-last-page-button-label = Īt iz piedejū lopu +pdfjs-page-rotate-cw-button = + .title = Pagrīzt pa pulksteni +pdfjs-page-rotate-cw-button-label = Pagrīzt pa pulksteni +pdfjs-page-rotate-ccw-button = + .title = Pagrīzt pret pulksteni +pdfjs-page-rotate-ccw-button-label = Pagrīzt pret pulksteni +pdfjs-cursor-text-select-tool-button = + .title = Aktivizēt teksta izvieles reiku +pdfjs-cursor-text-select-tool-button-label = Teksta izvieles reiks +pdfjs-cursor-hand-tool-button = + .title = Aktivēt rūkys reiku +pdfjs-cursor-hand-tool-button-label = Rūkys reiks +pdfjs-scroll-vertical-button = + .title = Izmontōt vertikalū ritinōšonu +pdfjs-scroll-vertical-button-label = Vertikalō ritinōšona +pdfjs-scroll-horizontal-button = + .title = Izmontōt horizontalū ritinōšonu +pdfjs-scroll-horizontal-button-label = Horizontalō ritinōšona +pdfjs-scroll-wrapped-button = + .title = Izmontōt mārūgojamū ritinōšonu +pdfjs-scroll-wrapped-button-label = Mārūgojamō ritinōšona +pdfjs-spread-none-button = + .title = Naizmontōt lopu atvāruma režimu +pdfjs-spread-none-button-label = Bez atvārumim +pdfjs-spread-odd-button = + .title = Izmontōt lopu atvārumus sōkut nu napōra numeru lopom +pdfjs-spread-odd-button-label = Napōra lopys pa kreisi +pdfjs-spread-even-button = + .title = Izmontōt lopu atvārumus sōkut nu pōra numeru lopom +pdfjs-spread-even-button-label = Pōra lopys pa kreisi + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Dokumenta īstatiejumi… +pdfjs-document-properties-button-label = Dokumenta īstatiejumi… +pdfjs-document-properties-file-name = Faila nūsaukums: +pdfjs-document-properties-file-size = Faila izmārs: +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } biti) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } biti) +pdfjs-document-properties-title = Nūsaukums: +pdfjs-document-properties-author = Autors: +pdfjs-document-properties-subject = Tema: +pdfjs-document-properties-keywords = Atslāgi vuordi: +pdfjs-document-properties-creation-date = Izveides datums: +pdfjs-document-properties-modification-date = lobuošonys datums: +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Radeituojs: +pdfjs-document-properties-producer = PDF producents: +pdfjs-document-properties-version = PDF verseja: +pdfjs-document-properties-page-count = Lopu skaits: +pdfjs-document-properties-page-size = Lopas izmārs: +pdfjs-document-properties-page-size-unit-inches = collas +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = portreta orientaceja +pdfjs-document-properties-page-size-orientation-landscape = ainovys orientaceja +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Letter +pdfjs-document-properties-page-size-name-legal = Legal + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Fast Web View: +pdfjs-document-properties-linearized-yes = Jā +pdfjs-document-properties-linearized-no = Nā +pdfjs-document-properties-close-button = Aiztaiseit + +## Print + +pdfjs-print-progress-message = Preparing document for printing… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Atceļt +pdfjs-printing-not-supported = Uzmaneibu: Drukuošona nu itei puorlūka dorbojās tikai daleji. +pdfjs-printing-not-ready = Uzmaneibu: PDF nav pilneibā īluodeits drukuošonai. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Puorslēgt suonu jūslu +pdfjs-toggle-sidebar-button-label = Puorslēgt suonu jūslu +pdfjs-document-outline-button = + .title = Show Document Outline (double-click to expand/collapse all items) +pdfjs-document-outline-button-label = Dokumenta saturs +pdfjs-attachments-button = + .title = Show Attachments +pdfjs-attachments-button-label = Attachments +pdfjs-thumbs-button = + .title = Paruodeit seiktālus +pdfjs-thumbs-button-label = Seiktāli +pdfjs-findbar-button = + .title = Mekleit dokumentā +pdfjs-findbar-button-label = Mekleit + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Lopa { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Lopys { $page } seiktāls + +## Find panel button title and messages + +pdfjs-find-input = + .title = Mekleit + .placeholder = Mekleit dokumentā… +pdfjs-find-previous-button = + .title = Atrast īprīkšejū +pdfjs-find-previous-button-label = Īprīkšejā +pdfjs-find-next-button = + .title = Atrast nuokamū +pdfjs-find-next-button-label = Nuokomuo +pdfjs-find-highlight-checkbox = Īkruosuot vysys +pdfjs-find-match-case-checkbox-label = Lelū, mozū burtu jiuteigs +pdfjs-find-reached-top = Sasnīgts dokumenta suokums, turpynojom nu beigom +pdfjs-find-reached-bottom = Sasnīgtys dokumenta beigys, turpynojom nu suokuma +pdfjs-find-not-found = Frāze nav atrosta + +## Predefined zoom values + +pdfjs-page-scale-width = Lopys plotumā +pdfjs-page-scale-fit = Ītylpynūt lopu +pdfjs-page-scale-auto = Automatiskais izmārs +pdfjs-page-scale-actual = Patīsais izmārs +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + + +## Loading indicator messages + +pdfjs-loading-error = Īluodejūt PDF nūtyka klaida. +pdfjs-invalid-file-error = Nadereigs voi būjuots PDF fails. +pdfjs-missing-file-error = PDF fails nav atrosts. +pdfjs-unexpected-response-error = Unexpected server response. +pdfjs-rendering-error = Attālojūt lopu rodās klaida + +## Annotations + +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } Annotation] + +## Password + +pdfjs-password-label = Īvodit paroli, kab attaiseitu PDF failu. +pdfjs-password-invalid = Napareiza parole, raugit vēļreiz. +pdfjs-password-ok-button = Labi +pdfjs-password-cancel-button = Atceļt +pdfjs-web-fonts-disabled = Šķārsteikla fonti nav aktivizāti: Navar īgult PDF fontus. + +## Editing + + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + diff --git a/public/pdfjs/web/locale/lv/viewer.ftl b/public/pdfjs/web/locale/lv/viewer.ftl new file mode 100644 index 0000000..067dc10 --- /dev/null +++ b/public/pdfjs/web/locale/lv/viewer.ftl @@ -0,0 +1,247 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Iepriekšējā lapa +pdfjs-previous-button-label = Iepriekšējā +pdfjs-next-button = + .title = Nākamā lapa +pdfjs-next-button-label = Nākamā +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Lapa +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = no { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } no { $pagesCount }) +pdfjs-zoom-out-button = + .title = Attālināt +pdfjs-zoom-out-button-label = Attālināt +pdfjs-zoom-in-button = + .title = Pietuvināt +pdfjs-zoom-in-button-label = Pietuvināt +pdfjs-zoom-select = + .title = Palielinājums +pdfjs-presentation-mode-button = + .title = Pārslēgties uz Prezentācijas režīmu +pdfjs-presentation-mode-button-label = Prezentācijas režīms +pdfjs-open-file-button = + .title = Atvērt failu +pdfjs-open-file-button-label = Atvērt +pdfjs-print-button = + .title = Drukāšana +pdfjs-print-button-label = Drukāt + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Rīki +pdfjs-tools-button-label = Rīki +pdfjs-first-page-button = + .title = Iet uz pirmo lapu +pdfjs-first-page-button-label = Iet uz pirmo lapu +pdfjs-last-page-button = + .title = Iet uz pēdējo lapu +pdfjs-last-page-button-label = Iet uz pēdējo lapu +pdfjs-page-rotate-cw-button = + .title = Pagriezt pa pulksteni +pdfjs-page-rotate-cw-button-label = Pagriezt pa pulksteni +pdfjs-page-rotate-ccw-button = + .title = Pagriezt pret pulksteni +pdfjs-page-rotate-ccw-button-label = Pagriezt pret pulksteni +pdfjs-cursor-text-select-tool-button = + .title = Aktivizēt teksta izvēles rīku +pdfjs-cursor-text-select-tool-button-label = Teksta izvēles rīks +pdfjs-cursor-hand-tool-button = + .title = Aktivēt rokas rīku +pdfjs-cursor-hand-tool-button-label = Rokas rīks +pdfjs-scroll-vertical-button = + .title = Izmantot vertikālo ritināšanu +pdfjs-scroll-vertical-button-label = Vertikālā ritināšana +pdfjs-scroll-horizontal-button = + .title = Izmantot horizontālo ritināšanu +pdfjs-scroll-horizontal-button-label = Horizontālā ritināšana +pdfjs-scroll-wrapped-button = + .title = Izmantot apkļauto ritināšanu +pdfjs-scroll-wrapped-button-label = Apkļautā ritināšana +pdfjs-spread-none-button = + .title = Nepievienoties lapu izpletumiem +pdfjs-spread-none-button-label = Neizmantot izpletumus +pdfjs-spread-odd-button = + .title = Izmantot lapu izpletumus sākot ar nepāra numuru lapām +pdfjs-spread-odd-button-label = Nepāra izpletumi +pdfjs-spread-even-button = + .title = Izmantot lapu izpletumus sākot ar pāra numuru lapām +pdfjs-spread-even-button-label = Pāra izpletumi + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Dokumenta iestatījumi… +pdfjs-document-properties-button-label = Dokumenta iestatījumi… +pdfjs-document-properties-file-name = Faila nosaukums: +pdfjs-document-properties-file-size = Faila izmērs: +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } biti) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } biti) +pdfjs-document-properties-title = Nosaukums: +pdfjs-document-properties-author = Autors: +pdfjs-document-properties-subject = Tēma: +pdfjs-document-properties-keywords = Atslēgas vārdi: +pdfjs-document-properties-creation-date = Izveides datums: +pdfjs-document-properties-modification-date = LAbošanas datums: +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Radītājs: +pdfjs-document-properties-producer = PDF producents: +pdfjs-document-properties-version = PDF versija: +pdfjs-document-properties-page-count = Lapu skaits: +pdfjs-document-properties-page-size = Papīra izmērs: +pdfjs-document-properties-page-size-unit-inches = collas +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = portretorientācija +pdfjs-document-properties-page-size-orientation-landscape = ainavorientācija +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Vēstule +pdfjs-document-properties-page-size-name-legal = Juridiskie teksti + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Ātrā tīmekļa skats: +pdfjs-document-properties-linearized-yes = Jā +pdfjs-document-properties-linearized-no = Nē +pdfjs-document-properties-close-button = Aizvērt + +## Print + +pdfjs-print-progress-message = Gatavo dokumentu drukāšanai... +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Atcelt +pdfjs-printing-not-supported = Uzmanību: Drukāšana no šī pārlūka darbojas tikai daļēji. +pdfjs-printing-not-ready = Uzmanību: PDF nav pilnībā ielādēts drukāšanai. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Pārslēgt sānu joslu +pdfjs-toggle-sidebar-button-label = Pārslēgt sānu joslu +pdfjs-document-outline-button = + .title = Rādīt dokumenta struktūru (veiciet dubultklikšķi lai izvērstu/sakļautu visus vienumus) +pdfjs-document-outline-button-label = Dokumenta saturs +pdfjs-attachments-button = + .title = Rādīt pielikumus +pdfjs-attachments-button-label = Pielikumi +pdfjs-thumbs-button = + .title = Parādīt sīktēlus +pdfjs-thumbs-button-label = Sīktēli +pdfjs-findbar-button = + .title = Meklēt dokumentā +pdfjs-findbar-button-label = Meklēt + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Lapa { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Lapas { $page } sīktēls + +## Find panel button title and messages + +pdfjs-find-input = + .title = Meklēt + .placeholder = Meklēt dokumentā… +pdfjs-find-previous-button = + .title = Atrast iepriekšējo +pdfjs-find-previous-button-label = Iepriekšējā +pdfjs-find-next-button = + .title = Atrast nākamo +pdfjs-find-next-button-label = Nākamā +pdfjs-find-highlight-checkbox = Iekrāsot visas +pdfjs-find-match-case-checkbox-label = Lielo, mazo burtu jutīgs +pdfjs-find-entire-word-checkbox-label = Veselus vārdus +pdfjs-find-reached-top = Sasniegts dokumenta sākums, turpinām no beigām +pdfjs-find-reached-bottom = Sasniegtas dokumenta beigas, turpinām no sākuma +pdfjs-find-not-found = Frāze nav atrasta + +## Predefined zoom values + +pdfjs-page-scale-width = Lapas platumā +pdfjs-page-scale-fit = Ietilpinot lapu +pdfjs-page-scale-auto = Automātiskais izmērs +pdfjs-page-scale-actual = Patiesais izmērs +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + + +## Loading indicator messages + +pdfjs-loading-error = Ielādējot PDF notika kļūda. +pdfjs-invalid-file-error = Nederīgs vai bojāts PDF fails. +pdfjs-missing-file-error = PDF fails nav atrasts. +pdfjs-unexpected-response-error = Negaidīa servera atbilde. +pdfjs-rendering-error = Attēlojot lapu radās kļūda + +## Annotations + +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } anotācija] + +## Password + +pdfjs-password-label = Ievadiet paroli, lai atvērtu PDF failu. +pdfjs-password-invalid = Nepareiza parole, mēģiniet vēlreiz. +pdfjs-password-ok-button = Labi +pdfjs-password-cancel-button = Atcelt +pdfjs-web-fonts-disabled = Tīmekļa fonti nav aktivizēti: Nevar iegult PDF fontus. + +## Editing + + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + diff --git a/public/pdfjs/web/locale/meh/viewer.ftl b/public/pdfjs/web/locale/meh/viewer.ftl new file mode 100644 index 0000000..d8bddc9 --- /dev/null +++ b/public/pdfjs/web/locale/meh/viewer.ftl @@ -0,0 +1,87 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Página yata +pdfjs-zoom-select = + .title = Nasa´a ka´nu/Nasa´a luli +pdfjs-open-file-button-label = Síne + +## Secondary toolbar and context menu + + +## Document properties dialog + +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +pdfjs-document-properties-linearized-yes = Kuvi +pdfjs-document-properties-close-button = Nakasɨ + +## Print + +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Nkuvi-ka + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-findbar-button-label = Nánuku + +## Thumbnails panel item (tooltip and alt text for images) + + +## Find panel button title and messages + + +## Predefined zoom values + +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + + +## Loading indicator messages + + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } + +## Password + +pdfjs-password-cancel-button = Nkuvi-ka + +## Editing + + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + diff --git a/public/pdfjs/web/locale/mk/viewer.ftl b/public/pdfjs/web/locale/mk/viewer.ftl new file mode 100644 index 0000000..47d24b2 --- /dev/null +++ b/public/pdfjs/web/locale/mk/viewer.ftl @@ -0,0 +1,215 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Претходна страница +pdfjs-previous-button-label = Претходна +pdfjs-next-button = + .title = Следна страница +pdfjs-next-button-label = Следна +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Страница +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = од { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } од { $pagesCount }) +pdfjs-zoom-out-button = + .title = Намалување +pdfjs-zoom-out-button-label = Намали +pdfjs-zoom-in-button = + .title = Зголемување +pdfjs-zoom-in-button-label = Зголеми +pdfjs-zoom-select = + .title = Променување на големина +pdfjs-presentation-mode-button = + .title = Премини во презентациски режим +pdfjs-presentation-mode-button-label = Презентациски режим +pdfjs-open-file-button = + .title = Отворање датотека +pdfjs-open-file-button-label = Отвори +pdfjs-print-button = + .title = Печатење +pdfjs-print-button-label = Печати + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Алатки +pdfjs-tools-button-label = Алатки +pdfjs-first-page-button = + .title = Оди до првата страница +pdfjs-first-page-button-label = Оди до првата страница +pdfjs-last-page-button = + .title = Оди до последната страница +pdfjs-last-page-button-label = Оди до последната страница +pdfjs-page-rotate-cw-button = + .title = Ротирај по стрелките на часовникот +pdfjs-page-rotate-cw-button-label = Ротирај по стрелките на часовникот +pdfjs-page-rotate-ccw-button = + .title = Ротирај спротивно од стрелките на часовникот +pdfjs-page-rotate-ccw-button-label = Ротирај спротивно од стрелките на часовникот +pdfjs-cursor-text-select-tool-button = + .title = Овозможи алатка за избор на текст +pdfjs-cursor-text-select-tool-button-label = Алатка за избор на текст + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Својства на документот… +pdfjs-document-properties-button-label = Својства на документот… +pdfjs-document-properties-file-name = Име на датотека: +pdfjs-document-properties-file-size = Големина на датотеката: +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } КБ ({ $size_b } бајти) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } МБ ({ $size_b } бајти) +pdfjs-document-properties-title = Наслов: +pdfjs-document-properties-author = Автор: +pdfjs-document-properties-subject = Тема: +pdfjs-document-properties-keywords = Клучни зборови: +pdfjs-document-properties-creation-date = Датум на создавање: +pdfjs-document-properties-modification-date = Датум на промена: +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Креатор: +pdfjs-document-properties-version = Верзија на PDF: +pdfjs-document-properties-page-count = Број на страници: +pdfjs-document-properties-page-size = Големина на страница: +pdfjs-document-properties-page-size-unit-inches = инч +pdfjs-document-properties-page-size-unit-millimeters = мм +pdfjs-document-properties-page-size-orientation-portrait = портрет +pdfjs-document-properties-page-size-orientation-landscape = пејзаж +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Писмо + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +pdfjs-document-properties-linearized-yes = Да +pdfjs-document-properties-linearized-no = Не +pdfjs-document-properties-close-button = Затвори + +## Print + +pdfjs-print-progress-message = Документ се подготвува за печатење… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Откажи +pdfjs-printing-not-supported = Предупредување: Печатењето не е целосно поддржано во овој прелистувач. +pdfjs-printing-not-ready = Предупредување: PDF документот не е целосно вчитан за печатење. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Вклучи странична лента +pdfjs-toggle-sidebar-button-label = Вклучи странична лента +pdfjs-document-outline-button-label = Содржина на документот +pdfjs-attachments-button = + .title = Прикажи додатоци +pdfjs-thumbs-button = + .title = Прикажување на икони +pdfjs-thumbs-button-label = Икони +pdfjs-findbar-button = + .title = Најди во документот +pdfjs-findbar-button-label = Најди + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Страница { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Икона од страница { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Пронајди + .placeholder = Пронајди во документот… +pdfjs-find-previous-button = + .title = Најди ја предходната појава на фразата +pdfjs-find-previous-button-label = Претходно +pdfjs-find-next-button = + .title = Најди ја следната појава на фразата +pdfjs-find-next-button-label = Следно +pdfjs-find-highlight-checkbox = Означи сѐ +pdfjs-find-match-case-checkbox-label = Токму така +pdfjs-find-entire-word-checkbox-label = Цели зборови +pdfjs-find-reached-top = Барањето стигна до почетокот на документот и почнува од крајот +pdfjs-find-reached-bottom = Барањето стигна до крајот на документот и почнува од почеток +pdfjs-find-not-found = Фразата не е пронајдена + +## Predefined zoom values + +pdfjs-page-scale-width = Ширина на страница +pdfjs-page-scale-fit = Цела страница +pdfjs-page-scale-auto = Автоматска големина +pdfjs-page-scale-actual = Вистинска големина +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + + +## Loading indicator messages + +pdfjs-loading-error = Настана грешка при вчитувањето на PDF-от. +pdfjs-invalid-file-error = Невалидна или корумпирана PDF датотека. +pdfjs-missing-file-error = Недостасува PDF документ. +pdfjs-unexpected-response-error = Неочекуван одговор од серверот. +pdfjs-rendering-error = Настана грешка при прикажувањето на страницата. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } + +## Password + +pdfjs-password-label = Внесете ја лозинката за да ја отворите оваа датотека. +pdfjs-password-invalid = Невалидна лозинка. Обидете се повторно. +pdfjs-password-ok-button = Во ред +pdfjs-password-cancel-button = Откажи +pdfjs-web-fonts-disabled = Интернет фонтовите се оневозможени: не може да се користат вградените PDF фонтови. + +## Editing + + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + diff --git a/public/pdfjs/web/locale/mr/viewer.ftl b/public/pdfjs/web/locale/mr/viewer.ftl new file mode 100644 index 0000000..49948b1 --- /dev/null +++ b/public/pdfjs/web/locale/mr/viewer.ftl @@ -0,0 +1,239 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = मागील पृष्ठ +pdfjs-previous-button-label = मागील +pdfjs-next-button = + .title = पुढील पृष्ठ +pdfjs-next-button-label = पुढील +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = पृष्ठ +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = { $pagesCount }पैकी +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pagesCount } पैकी { $pageNumber }) +pdfjs-zoom-out-button = + .title = छोटे करा +pdfjs-zoom-out-button-label = छोटे करा +pdfjs-zoom-in-button = + .title = मोठे करा +pdfjs-zoom-in-button-label = मोठे करा +pdfjs-zoom-select = + .title = लहान किंवा मोठे करा +pdfjs-presentation-mode-button = + .title = प्रस्तुतिकरण मोडचा वापर करा +pdfjs-presentation-mode-button-label = प्रस्तुतिकरण मोड +pdfjs-open-file-button = + .title = फाइल उघडा +pdfjs-open-file-button-label = उघडा +pdfjs-print-button = + .title = छपाई करा +pdfjs-print-button-label = छपाई करा + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = साधने +pdfjs-tools-button-label = साधने +pdfjs-first-page-button = + .title = पहिल्या पृष्ठावर जा +pdfjs-first-page-button-label = पहिल्या पृष्ठावर जा +pdfjs-last-page-button = + .title = शेवटच्या पृष्ठावर जा +pdfjs-last-page-button-label = शेवटच्या पृष्ठावर जा +pdfjs-page-rotate-cw-button = + .title = घड्याळाच्या काट्याच्या दिशेने फिरवा +pdfjs-page-rotate-cw-button-label = घड्याळाच्या काट्याच्या दिशेने फिरवा +pdfjs-page-rotate-ccw-button = + .title = घड्याळाच्या काट्याच्या उलट दिशेने फिरवा +pdfjs-page-rotate-ccw-button-label = घड्याळाच्या काट्याच्या उलट दिशेने फिरवा +pdfjs-cursor-text-select-tool-button = + .title = मजकूर निवड साधन कार्यान्वयीत करा +pdfjs-cursor-text-select-tool-button-label = मजकूर निवड साधन +pdfjs-cursor-hand-tool-button = + .title = हात साधन कार्यान्वित करा +pdfjs-cursor-hand-tool-button-label = हस्त साधन +pdfjs-scroll-vertical-button = + .title = अनुलंब स्क्रोलिंग वापरा +pdfjs-scroll-vertical-button-label = अनुलंब स्क्रोलिंग +pdfjs-scroll-horizontal-button = + .title = क्षैतिज स्क्रोलिंग वापरा +pdfjs-scroll-horizontal-button-label = क्षैतिज स्क्रोलिंग + +## Document properties dialog + +pdfjs-document-properties-button = + .title = दस्तऐवज गुणधर्म… +pdfjs-document-properties-button-label = दस्तऐवज गुणधर्म… +pdfjs-document-properties-file-name = फाइलचे नाव: +pdfjs-document-properties-file-size = फाइल आकार: +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } बाइट्स) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } बाइट्स) +pdfjs-document-properties-title = शिर्षक: +pdfjs-document-properties-author = लेखक: +pdfjs-document-properties-subject = विषय: +pdfjs-document-properties-keywords = मुख्यशब्द: +pdfjs-document-properties-creation-date = निर्माण दिनांक: +pdfjs-document-properties-modification-date = दुरूस्ती दिनांक: +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = निर्माता: +pdfjs-document-properties-producer = PDF निर्माता: +pdfjs-document-properties-version = PDF आवृत्ती: +pdfjs-document-properties-page-count = पृष्ठ संख्या: +pdfjs-document-properties-page-size = पृष्ठ आकार: +pdfjs-document-properties-page-size-unit-inches = इंच +pdfjs-document-properties-page-size-unit-millimeters = मीमी +pdfjs-document-properties-page-size-orientation-portrait = उभी मांडणी +pdfjs-document-properties-page-size-orientation-landscape = आडवे +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Letter +pdfjs-document-properties-page-size-name-legal = Legal + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = जलद वेब दृष्य: +pdfjs-document-properties-linearized-yes = हो +pdfjs-document-properties-linearized-no = नाही +pdfjs-document-properties-close-button = बंद करा + +## Print + +pdfjs-print-progress-message = छपाई करीता पृष्ठ तयार करीत आहे… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = रद्द करा +pdfjs-printing-not-supported = सावधानता: या ब्राउझरतर्फे छपाइ पूर्णपणे समर्थीत नाही. +pdfjs-printing-not-ready = सावधानता: छपाईकरिता PDF पूर्णतया लोड झाले नाही. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = बाजूचीपट्टी टॉगल करा +pdfjs-toggle-sidebar-button-label = बाजूचीपट्टी टॉगल करा +pdfjs-document-outline-button = + .title = दस्तऐवज बाह्यरेखा दर्शवा (विस्तृत करण्यासाठी दोनवेळा क्लिक करा /सर्व घटक दाखवा) +pdfjs-document-outline-button-label = दस्तऐवज रूपरेषा +pdfjs-attachments-button = + .title = जोडपत्र दाखवा +pdfjs-attachments-button-label = जोडपत्र +pdfjs-thumbs-button = + .title = थंबनेल्स् दाखवा +pdfjs-thumbs-button-label = थंबनेल्स् +pdfjs-findbar-button = + .title = दस्तऐवजात शोधा +pdfjs-findbar-button-label = शोधा + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = पृष्ठ { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = पृष्ठाचे थंबनेल { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = शोधा + .placeholder = दस्तऐवजात शोधा… +pdfjs-find-previous-button = + .title = वाकप्रयोगची मागील घटना शोधा +pdfjs-find-previous-button-label = मागील +pdfjs-find-next-button = + .title = वाकप्रयोगची पुढील घटना शोधा +pdfjs-find-next-button-label = पुढील +pdfjs-find-highlight-checkbox = सर्व ठळक करा +pdfjs-find-match-case-checkbox-label = आकार जुळवा +pdfjs-find-entire-word-checkbox-label = संपूर्ण शब्द +pdfjs-find-reached-top = दस्तऐवजाच्या शीर्षकास पोहचले, तळपासून पुढे +pdfjs-find-reached-bottom = दस्तऐवजाच्या तळाला पोहचले, शीर्षकापासून पुढे +pdfjs-find-not-found = वाकप्रयोग आढळले नाही + +## Predefined zoom values + +pdfjs-page-scale-width = पृष्ठाची रूंदी +pdfjs-page-scale-fit = पृष्ठ बसवा +pdfjs-page-scale-auto = स्वयं लाहन किंवा मोठे करणे +pdfjs-page-scale-actual = प्रत्यक्ष आकार +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + + +## Loading indicator messages + +pdfjs-loading-error = PDF लोड करतेवेळी त्रुटी आढळली. +pdfjs-invalid-file-error = अवैध किंवा दोषीत PDF फाइल. +pdfjs-missing-file-error = न आढळणारी PDF फाइल. +pdfjs-unexpected-response-error = अनपेक्षित सर्व्हर प्रतिसाद. +pdfjs-rendering-error = पृष्ठ दाखवतेवेळी त्रुटी आढळली. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } टिपण्णी] + +## Password + +pdfjs-password-label = ही PDF फाइल उघडण्याकरिता पासवर्ड द्या. +pdfjs-password-invalid = अवैध पासवर्ड. कृपया पुन्हा प्रयत्न करा. +pdfjs-password-ok-button = ठीक आहे +pdfjs-password-cancel-button = रद्द करा +pdfjs-web-fonts-disabled = वेब टंक असमर्थीत आहेत: एम्बेडेड PDF टंक वापर अशक्य. + +## Editing + + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + diff --git a/public/pdfjs/web/locale/ms/viewer.ftl b/public/pdfjs/web/locale/ms/viewer.ftl new file mode 100644 index 0000000..11b8665 --- /dev/null +++ b/public/pdfjs/web/locale/ms/viewer.ftl @@ -0,0 +1,247 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Halaman Dahulu +pdfjs-previous-button-label = Dahulu +pdfjs-next-button = + .title = Halaman Berikut +pdfjs-next-button-label = Berikut +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Halaman +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = daripada { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } daripada { $pagesCount }) +pdfjs-zoom-out-button = + .title = Zum Keluar +pdfjs-zoom-out-button-label = Zum Keluar +pdfjs-zoom-in-button = + .title = Zum Masuk +pdfjs-zoom-in-button-label = Zum Masuk +pdfjs-zoom-select = + .title = Zum +pdfjs-presentation-mode-button = + .title = Tukar ke Mod Persembahan +pdfjs-presentation-mode-button-label = Mod Persembahan +pdfjs-open-file-button = + .title = Buka Fail +pdfjs-open-file-button-label = Buka +pdfjs-print-button = + .title = Cetak +pdfjs-print-button-label = Cetak + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Alatan +pdfjs-tools-button-label = Alatan +pdfjs-first-page-button = + .title = Pergi ke Halaman Pertama +pdfjs-first-page-button-label = Pergi ke Halaman Pertama +pdfjs-last-page-button = + .title = Pergi ke Halaman Terakhir +pdfjs-last-page-button-label = Pergi ke Halaman Terakhir +pdfjs-page-rotate-cw-button = + .title = Berputar ikut arah Jam +pdfjs-page-rotate-cw-button-label = Berputar ikut arah Jam +pdfjs-page-rotate-ccw-button = + .title = Pusing berlawan arah jam +pdfjs-page-rotate-ccw-button-label = Pusing berlawan arah jam +pdfjs-cursor-text-select-tool-button = + .title = Dayakan Alatan Pilihan Teks +pdfjs-cursor-text-select-tool-button-label = Alatan Pilihan Teks +pdfjs-cursor-hand-tool-button = + .title = Dayakan Alatan Tangan +pdfjs-cursor-hand-tool-button-label = Alatan Tangan +pdfjs-scroll-vertical-button = + .title = Guna Skrol Menegak +pdfjs-scroll-vertical-button-label = Skrol Menegak +pdfjs-scroll-horizontal-button = + .title = Guna Skrol Mengufuk +pdfjs-scroll-horizontal-button-label = Skrol Mengufuk +pdfjs-scroll-wrapped-button = + .title = Guna Skrol Berbalut +pdfjs-scroll-wrapped-button-label = Skrol Berbalut +pdfjs-spread-none-button = + .title = Jangan hubungkan hamparan halaman +pdfjs-spread-none-button-label = Tanpa Hamparan +pdfjs-spread-odd-button = + .title = Hubungkan hamparan halaman dengan halaman nombor ganjil +pdfjs-spread-odd-button-label = Hamparan Ganjil +pdfjs-spread-even-button = + .title = Hubungkan hamparan halaman dengan halaman nombor genap +pdfjs-spread-even-button-label = Hamparan Seimbang + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Sifat Dokumen… +pdfjs-document-properties-button-label = Sifat Dokumen… +pdfjs-document-properties-file-name = Nama fail: +pdfjs-document-properties-file-size = Saiz fail: +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bait) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bait) +pdfjs-document-properties-title = Tajuk: +pdfjs-document-properties-author = Pengarang: +pdfjs-document-properties-subject = Subjek: +pdfjs-document-properties-keywords = Kata kunci: +pdfjs-document-properties-creation-date = Masa Dicipta: +pdfjs-document-properties-modification-date = Tarikh Ubahsuai: +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Pencipta: +pdfjs-document-properties-producer = Pengeluar PDF: +pdfjs-document-properties-version = Versi PDF: +pdfjs-document-properties-page-count = Kiraan Laman: +pdfjs-document-properties-page-size = Saiz Halaman: +pdfjs-document-properties-page-size-unit-inches = dalam +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = potret +pdfjs-document-properties-page-size-orientation-landscape = landskap +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Letter +pdfjs-document-properties-page-size-name-legal = Legal + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Paparan Web Pantas: +pdfjs-document-properties-linearized-yes = Ya +pdfjs-document-properties-linearized-no = Tidak +pdfjs-document-properties-close-button = Tutup + +## Print + +pdfjs-print-progress-message = Menyediakan dokumen untuk dicetak… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Batal +pdfjs-printing-not-supported = Amaran: Cetakan ini tidak sepenuhnya disokong oleh pelayar ini. +pdfjs-printing-not-ready = Amaran: PDF tidak sepenuhnya dimuatkan untuk dicetak. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Togol Bar Sisi +pdfjs-toggle-sidebar-button-label = Togol Bar Sisi +pdfjs-document-outline-button = + .title = Papar Rangka Dokumen (klik-dua-kali untuk kembangkan/kolaps semua item) +pdfjs-document-outline-button-label = Rangka Dokumen +pdfjs-attachments-button = + .title = Papar Lampiran +pdfjs-attachments-button-label = Lampiran +pdfjs-thumbs-button = + .title = Papar Thumbnails +pdfjs-thumbs-button-label = Imej kecil +pdfjs-findbar-button = + .title = Cari didalam Dokumen +pdfjs-findbar-button-label = Cari + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Halaman { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Halaman Imej kecil { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Cari + .placeholder = Cari dalam dokumen… +pdfjs-find-previous-button = + .title = Cari teks frasa berkenaan yang terdahulu +pdfjs-find-previous-button-label = Dahulu +pdfjs-find-next-button = + .title = Cari teks frasa berkenaan yang berikut +pdfjs-find-next-button-label = Berikut +pdfjs-find-highlight-checkbox = Serlahkan semua +pdfjs-find-match-case-checkbox-label = Huruf sepadan +pdfjs-find-entire-word-checkbox-label = Seluruh perkataan +pdfjs-find-reached-top = Mencapai teratas daripada dokumen, sambungan daripada bawah +pdfjs-find-reached-bottom = Mencapai terakhir daripada dokumen, sambungan daripada atas +pdfjs-find-not-found = Frasa tidak ditemui + +## Predefined zoom values + +pdfjs-page-scale-width = Lebar Halaman +pdfjs-page-scale-fit = Muat Halaman +pdfjs-page-scale-auto = Zoom Automatik +pdfjs-page-scale-actual = Saiz Sebenar +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + + +## Loading indicator messages + +pdfjs-loading-error = Masalah berlaku semasa menuatkan sebuah PDF. +pdfjs-invalid-file-error = Tidak sah atau fail PDF rosak. +pdfjs-missing-file-error = Fail PDF Hilang. +pdfjs-unexpected-response-error = Respon pelayan yang tidak dijangka. +pdfjs-rendering-error = Ralat berlaku ketika memberikan halaman. + +## Annotations + +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } Anotasi] + +## Password + +pdfjs-password-label = Masukan kata kunci untuk membuka fail PDF ini. +pdfjs-password-invalid = Kata laluan salah. Cuba lagi. +pdfjs-password-ok-button = OK +pdfjs-password-cancel-button = Batal +pdfjs-web-fonts-disabled = Fon web dinyahdayakan: tidak dapat menggunakan fon terbenam PDF. + +## Editing + + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + diff --git a/public/pdfjs/web/locale/my/viewer.ftl b/public/pdfjs/web/locale/my/viewer.ftl new file mode 100644 index 0000000..d3b973d --- /dev/null +++ b/public/pdfjs/web/locale/my/viewer.ftl @@ -0,0 +1,206 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = အရင် စာမျက်နှာ +pdfjs-previous-button-label = အရင်နေရာ +pdfjs-next-button = + .title = ရှေ့ စာမျက်နှာ +pdfjs-next-button-label = နောက်တခု +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = စာမျက်နှာ +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = { $pagesCount } ၏ +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pagesCount } ၏ { $pageNumber }) +pdfjs-zoom-out-button = + .title = ချုံ့ပါ +pdfjs-zoom-out-button-label = ချုံ့ပါ +pdfjs-zoom-in-button = + .title = ချဲ့ပါ +pdfjs-zoom-in-button-label = ချဲ့ပါ +pdfjs-zoom-select = + .title = ချုံ့/ချဲ့ပါ +pdfjs-presentation-mode-button = + .title = ဆွေးနွေးတင်ပြစနစ်သို့ ကူးပြောင်းပါ +pdfjs-presentation-mode-button-label = ဆွေးနွေးတင်ပြစနစ် +pdfjs-open-file-button = + .title = ဖိုင်အားဖွင့်ပါ။ +pdfjs-open-file-button-label = ဖွင့်ပါ +pdfjs-print-button = + .title = ပုံနှိုပ်ပါ +pdfjs-print-button-label = ပုံနှိုပ်ပါ + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = ကိရိယာများ +pdfjs-tools-button-label = ကိရိယာများ +pdfjs-first-page-button = + .title = ပထမ စာမျက်နှာသို့ +pdfjs-first-page-button-label = ပထမ စာမျက်နှာသို့ +pdfjs-last-page-button = + .title = နောက်ဆုံး စာမျက်နှာသို့ +pdfjs-last-page-button-label = နောက်ဆုံး စာမျက်နှာသို့ +pdfjs-page-rotate-cw-button = + .title = နာရီလက်တံ အတိုင်း +pdfjs-page-rotate-cw-button-label = နာရီလက်တံ အတိုင်း +pdfjs-page-rotate-ccw-button = + .title = နာရီလက်တံ ပြောင်းပြန် +pdfjs-page-rotate-ccw-button-label = နာရီလက်တံ ပြောင်းပြန် + +## Document properties dialog + +pdfjs-document-properties-button = + .title = မှတ်တမ်းမှတ်ရာ ဂုဏ်သတ္တိများ +pdfjs-document-properties-button-label = မှတ်တမ်းမှတ်ရာ ဂုဏ်သတ္တိများ +pdfjs-document-properties-file-name = ဖိုင် : +pdfjs-document-properties-file-size = ဖိုင်ဆိုဒ် : +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } ကီလိုဘိုတ် ({ $size_b }ဘိုတ်) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bytes) +pdfjs-document-properties-title = ခေါင်းစဉ်‌ - +pdfjs-document-properties-author = ရေးသားသူ: +pdfjs-document-properties-subject = အကြောင်းအရာ: +pdfjs-document-properties-keywords = သော့ချက် စာလုံး: +pdfjs-document-properties-creation-date = ထုတ်လုပ်ရက်စွဲ: +pdfjs-document-properties-modification-date = ပြင်ဆင်ရက်စွဲ: +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = ဖန်တီးသူ: +pdfjs-document-properties-producer = PDF ထုတ်လုပ်သူ: +pdfjs-document-properties-version = PDF ဗားရှင်း: +pdfjs-document-properties-page-count = စာမျက်နှာအရေအတွက်: + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + + +## + +pdfjs-document-properties-close-button = ပိတ် + +## Print + +pdfjs-print-progress-message = Preparing document for printing… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = ပယ်​ဖျက်ပါ +pdfjs-printing-not-supported = သတိပေးချက်၊ပရင့်ထုတ်ခြင်းကိုဤဘယောက်ဆာသည် ပြည့်ဝစွာထောက်ပံ့မထားပါ ။ +pdfjs-printing-not-ready = သတိပေးချက်: ယခု PDF ဖိုင်သည် ပုံနှိပ်ရန် မပြည့်စုံပါ + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = ဘေးတန်းဖွင့်ပိတ် +pdfjs-toggle-sidebar-button-label = ဖွင့်ပိတ် ဆလိုက်ဒါ +pdfjs-document-outline-button = + .title = စာတမ်းအကျဉ်းချုပ်ကို ပြပါ (စာရင်းအားလုံးကို ချုံ့/ချဲ့ရန် ကလစ်နှစ်ချက်နှိပ်ပါ) +pdfjs-document-outline-button-label = စာတမ်းအကျဉ်းချုပ် +pdfjs-attachments-button = + .title = တွဲချက်များ ပြပါ +pdfjs-attachments-button-label = တွဲထားချက်များ +pdfjs-thumbs-button = + .title = ပုံရိပ်ငယ်များကို ပြပါ +pdfjs-thumbs-button-label = ပုံရိပ်ငယ်များ +pdfjs-findbar-button = + .title = Find in Document +pdfjs-findbar-button-label = ရှာဖွေပါ + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = စာမျက်နှာ { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = စာမျက်နှာရဲ့ ပုံရိပ်ငယ် { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = ရှာဖွေပါ + .placeholder = စာတမ်းထဲတွင် ရှာဖွေရန်… +pdfjs-find-previous-button = + .title = စကားစုရဲ့ အရင် ​ဖြစ်ပွားမှုကို ရှာဖွေပါ +pdfjs-find-previous-button-label = နောက်သို့ +pdfjs-find-next-button = + .title = စကားစုရဲ့ နောက်ထပ် ​ဖြစ်ပွားမှုကို ရှာဖွေပါ +pdfjs-find-next-button-label = ရှေ့သို့ +pdfjs-find-highlight-checkbox = အားလုံးကို မျဉ်းသားပါ +pdfjs-find-match-case-checkbox-label = စာလုံး တိုက်ဆိုင်ပါ +pdfjs-find-reached-top = စာမျက်နှာထိပ် ရောက်နေပြီ၊ အဆုံးကနေ ပြန်စပါ +pdfjs-find-reached-bottom = စာမျက်နှာအဆုံး ရောက်နေပြီ၊ ထိပ်ကနေ ပြန်စပါ +pdfjs-find-not-found = စကားစု မတွေ့ရဘူး + +## Predefined zoom values + +pdfjs-page-scale-width = စာမျက်နှာ အကျယ် +pdfjs-page-scale-fit = စာမျက်နှာ ကွက်တိ +pdfjs-page-scale-auto = အလိုအလျောက် ချုံ့ချဲ့ +pdfjs-page-scale-actual = အမှန်တကယ်ရှိတဲ့ အရွယ် +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + + +## Loading indicator messages + +pdfjs-loading-error = PDF ဖိုင် ကိုဆွဲတင်နေချိန်မှာ အမှားတစ်ခုတွေ့ရပါတယ်။ +pdfjs-invalid-file-error = မရသော သို့ ပျက်နေသော PDF ဖိုင် +pdfjs-missing-file-error = PDF ပျောက်ဆုံး +pdfjs-unexpected-response-error = မမျှော်လင့်ထားသော ဆာဗာမှ ပြန်ကြားချက် +pdfjs-rendering-error = စာမျက်နှာကို ပုံဖော်နေချိန်မှာ အမှားတစ်ခုတွေ့ရပါတယ်။ + +## Annotations + +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } အဓိပ္ပာယ်ဖွင့်ဆိုချက်] + +## Password + +pdfjs-password-label = ယခု PDF ကို ဖွင့်ရန် စကားဝှက်ကို ရိုက်ပါ။ +pdfjs-password-invalid = စာဝှက် မှားသည်။ ထပ်ကြိုးစားကြည့်ပါ။ +pdfjs-password-ok-button = OK +pdfjs-password-cancel-button = ပယ်​ဖျက်ပါ +pdfjs-web-fonts-disabled = Web fonts are disabled: unable to use embedded PDF fonts. + +## Editing + + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + diff --git a/public/pdfjs/web/locale/nb-NO/viewer.ftl b/public/pdfjs/web/locale/nb-NO/viewer.ftl new file mode 100644 index 0000000..a644157 --- /dev/null +++ b/public/pdfjs/web/locale/nb-NO/viewer.ftl @@ -0,0 +1,495 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Forrige side +pdfjs-previous-button-label = Forrige +pdfjs-next-button = + .title = Neste side +pdfjs-next-button-label = Neste +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Side +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = av { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } av { $pagesCount }) +pdfjs-zoom-out-button = + .title = Zoom ut +pdfjs-zoom-out-button-label = Zoom ut +pdfjs-zoom-in-button = + .title = Zoom inn +pdfjs-zoom-in-button-label = Zoom inn +pdfjs-zoom-select = + .title = Zoom +pdfjs-presentation-mode-button = + .title = Bytt til presentasjonsmodus +pdfjs-presentation-mode-button-label = Presentasjonsmodus +pdfjs-open-file-button = + .title = Åpne fil +pdfjs-open-file-button-label = Åpne +pdfjs-print-button = + .title = Skriv ut +pdfjs-print-button-label = Skriv ut +pdfjs-save-button = + .title = Lagre +pdfjs-save-button-label = Lagre +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Last ned +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Last ned +pdfjs-bookmark-button = + .title = Gjeldende side (se URL fra gjeldende side) +pdfjs-bookmark-button-label = Gjeldende side + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Verktøy +pdfjs-tools-button-label = Verktøy +pdfjs-first-page-button = + .title = Gå til første side +pdfjs-first-page-button-label = Gå til første side +pdfjs-last-page-button = + .title = Gå til siste side +pdfjs-last-page-button-label = Gå til siste side +pdfjs-page-rotate-cw-button = + .title = Roter med klokken +pdfjs-page-rotate-cw-button-label = Roter med klokken +pdfjs-page-rotate-ccw-button = + .title = Roter mot klokken +pdfjs-page-rotate-ccw-button-label = Roter mot klokken +pdfjs-cursor-text-select-tool-button = + .title = Aktiver tekstmarkeringsverktøy +pdfjs-cursor-text-select-tool-button-label = Tekstmarkeringsverktøy +pdfjs-cursor-hand-tool-button = + .title = Aktiver handverktøy +pdfjs-cursor-hand-tool-button-label = Handverktøy +pdfjs-scroll-page-button = + .title = Bruk siderulling +pdfjs-scroll-page-button-label = Siderulling +pdfjs-scroll-vertical-button = + .title = Bruk vertikal rulling +pdfjs-scroll-vertical-button-label = Vertikal rulling +pdfjs-scroll-horizontal-button = + .title = Bruk horisontal rulling +pdfjs-scroll-horizontal-button-label = Horisontal rulling +pdfjs-scroll-wrapped-button = + .title = Bruk flersiderulling +pdfjs-scroll-wrapped-button-label = Flersiderulling +pdfjs-spread-none-button = + .title = Vis enkeltsider +pdfjs-spread-none-button-label = Enkeltsider +pdfjs-spread-odd-button = + .title = Vis oppslag med ulike sidenumre til venstre +pdfjs-spread-odd-button-label = Oppslag med forside +pdfjs-spread-even-button = + .title = Vis oppslag med like sidenumre til venstre +pdfjs-spread-even-button-label = Oppslag uten forside + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Dokumentegenskaper … +pdfjs-document-properties-button-label = Dokumentegenskaper … +pdfjs-document-properties-file-name = Filnavn: +pdfjs-document-properties-file-size = Filstørrelse: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } byte) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } byte) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bytes) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bytes) +pdfjs-document-properties-title = Dokumentegenskaper … +pdfjs-document-properties-author = Forfatter: +pdfjs-document-properties-subject = Emne: +pdfjs-document-properties-keywords = Nøkkelord: +pdfjs-document-properties-creation-date = Opprettet dato: +pdfjs-document-properties-modification-date = Endret dato: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Opprettet av: +pdfjs-document-properties-producer = PDF-verktøy: +pdfjs-document-properties-version = PDF-versjon: +pdfjs-document-properties-page-count = Sideantall: +pdfjs-document-properties-page-size = Sidestørrelse: +pdfjs-document-properties-page-size-unit-inches = in +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = stående +pdfjs-document-properties-page-size-orientation-landscape = liggende +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Letter +pdfjs-document-properties-page-size-name-legal = Legal + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Hurtig nettvisning: +pdfjs-document-properties-linearized-yes = Ja +pdfjs-document-properties-linearized-no = Nei +pdfjs-document-properties-close-button = Lukk + +## Print + +pdfjs-print-progress-message = Forbereder dokument for utskrift … +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Avbryt +pdfjs-printing-not-supported = Advarsel: Utskrift er ikke fullstendig støttet av denne nettleseren. +pdfjs-printing-not-ready = Advarsel: PDF er ikke fullstendig innlastet for utskrift. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Slå av/på sidestolpe +pdfjs-toggle-sidebar-notification-button = + .title = Vis/gjem sidestolpe (dokumentet inneholder oversikt/vedlegg/lag) +pdfjs-toggle-sidebar-button-label = Slå av/på sidestolpe +pdfjs-document-outline-button = + .title = Vis dokumentdisposisjonen (dobbeltklikk for å utvide/skjule alle elementer) +pdfjs-document-outline-button-label = Dokumentdisposisjon +pdfjs-attachments-button = + .title = Vis vedlegg +pdfjs-attachments-button-label = Vedlegg +pdfjs-layers-button = + .title = Vis lag (dobbeltklikk for å tilbakestille alle lag til standardtilstand) +pdfjs-layers-button-label = Lag +pdfjs-thumbs-button = + .title = Vis miniatyrbilde +pdfjs-thumbs-button-label = Miniatyrbilde +pdfjs-current-outline-item-button = + .title = Finn gjeldende disposisjonselement +pdfjs-current-outline-item-button-label = Gjeldende disposisjonselement +pdfjs-findbar-button = + .title = Finn i dokumentet +pdfjs-findbar-button-label = Finn +pdfjs-additional-layers = Ytterligere lag + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Side { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Miniatyrbilde av side { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Søk + .placeholder = Søk i dokument… +pdfjs-find-previous-button = + .title = Finn forrige forekomst av frasen +pdfjs-find-previous-button-label = Forrige +pdfjs-find-next-button = + .title = Finn neste forekomst av frasen +pdfjs-find-next-button-label = Neste +pdfjs-find-highlight-checkbox = Uthev alle +pdfjs-find-match-case-checkbox-label = Skill store/små bokstaver +pdfjs-find-match-diacritics-checkbox-label = Samsvar diakritiske tegn +pdfjs-find-entire-word-checkbox-label = Hele ord +pdfjs-find-reached-top = Nådde toppen av dokumentet, fortsetter fra bunnen +pdfjs-find-reached-bottom = Nådde bunnen av dokumentet, fortsetter fra toppen +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] { $current } av { $total } treff + *[other] { $current } av { $total } treff + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] Mer enn { $limit } treff + *[other] Mer enn { $limit } treff + } +pdfjs-find-not-found = Fant ikke teksten + +## Predefined zoom values + +pdfjs-page-scale-width = Sidebredde +pdfjs-page-scale-fit = Tilpass til siden +pdfjs-page-scale-auto = Automatisk zoom +pdfjs-page-scale-actual = Virkelig størrelse +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale } % + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Side { $page } + +## Loading indicator messages + +pdfjs-loading-error = En feil oppstod ved lasting av PDF. +pdfjs-invalid-file-error = Ugyldig eller skadet PDF-fil. +pdfjs-missing-file-error = Manglende PDF-fil. +pdfjs-unexpected-response-error = Uventet serverrespons. +pdfjs-rendering-error = En feil oppstod ved opptegning av siden. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } annotasjon] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Skriv inn passordet for å åpne denne PDF-filen. +pdfjs-password-invalid = Ugyldig passord. Prøv igjen. +pdfjs-password-ok-button = OK +pdfjs-password-cancel-button = Avbryt +pdfjs-web-fonts-disabled = Web-fonter er avslått: Kan ikke bruke innbundne PDF-fonter. + +## Editing + +pdfjs-editor-free-text-button = + .title = Tekst +pdfjs-editor-free-text-button-label = Tekst +pdfjs-editor-ink-button = + .title = Tegn +pdfjs-editor-ink-button-label = Tegn +pdfjs-editor-stamp-button = + .title = Legg til eller rediger bilder +pdfjs-editor-stamp-button-label = Legg til eller rediger bilder +pdfjs-editor-highlight-button = + .title = Markere +pdfjs-editor-highlight-button-label = Markere +pdfjs-highlight-floating-button1 = + .title = Markere + .aria-label = Markere +pdfjs-highlight-floating-button-label = Markere + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Fjern tegningen +pdfjs-editor-remove-freetext-button = + .title = Fjern tekst +pdfjs-editor-remove-stamp-button = + .title = Fjern bildet +pdfjs-editor-remove-highlight-button = + .title = Fjern utheving + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Farge +pdfjs-editor-free-text-size-input = Størrelse +pdfjs-editor-ink-color-input = Farge +pdfjs-editor-ink-thickness-input = Tykkelse +pdfjs-editor-ink-opacity-input = Ugjennomsiktighet +pdfjs-editor-stamp-add-image-button = + .title = Legg til bilde +pdfjs-editor-stamp-add-image-button-label = Legg til bilde +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Tykkelse +pdfjs-editor-free-highlight-thickness-title = + .title = Endre tykkelse når du markerer andre elementer enn tekst +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = Tekstredigering + .default-content = Begynn å skrive… +pdfjs-free-text = + .aria-label = Tekstredigering +pdfjs-free-text-default-content = Begynn å skrive… +pdfjs-ink = + .aria-label = Tegneredigering +pdfjs-ink-canvas = + .aria-label = Brukerskapt bilde + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = Alt-tekst +pdfjs-editor-alt-text-edit-button = + .aria-label = Rediger alt-tekst +pdfjs-editor-alt-text-edit-button-label = Rediger alt-tekst tekst +pdfjs-editor-alt-text-dialog-label = Velg et alternativ +pdfjs-editor-alt-text-dialog-description = Alt-tekst (alternativ tekst) hjelper når folk ikke kan se bildet eller når det ikke lastes inn. +pdfjs-editor-alt-text-add-description-label = Legg til en beskrivelse +pdfjs-editor-alt-text-add-description-description = Gå etter 1-2 setninger som beskriver emnet, settingen eller handlingene. +pdfjs-editor-alt-text-mark-decorative-label = Merk som dekorativt +pdfjs-editor-alt-text-mark-decorative-description = Dette brukes til dekorative bilder, som kantlinjer eller vannmerker. +pdfjs-editor-alt-text-cancel-button = Avbryt +pdfjs-editor-alt-text-save-button = Lagre +pdfjs-editor-alt-text-decorative-tooltip = Merket som dekorativ +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = For eksempel, «En ung mann setter seg ved et bord for å spise et måltid» +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = Alt-tekst + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Øverste venstre hjørne – endre størrelse +pdfjs-editor-resizer-label-top-middle = Øverst i midten — endre størrelse +pdfjs-editor-resizer-label-top-right = Øverste høyre hjørne – endre størrelse +pdfjs-editor-resizer-label-middle-right = Midt til høyre – endre størrelse +pdfjs-editor-resizer-label-bottom-right = Nederste høyre hjørne – endre størrelse +pdfjs-editor-resizer-label-bottom-middle = Nederst i midten — endre størrelse +pdfjs-editor-resizer-label-bottom-left = Nederste venstre hjørne – endre størrelse +pdfjs-editor-resizer-label-middle-left = Midt til venstre — endre størrelse +pdfjs-editor-resizer-top-left = + .aria-label = Øverste venstre hjørne – endre størrelse +pdfjs-editor-resizer-top-middle = + .aria-label = Øverst i midten — endre størrelse +pdfjs-editor-resizer-top-right = + .aria-label = Øverste høyre hjørne – endre størrelse +pdfjs-editor-resizer-middle-right = + .aria-label = Midt til høyre – endre størrelse +pdfjs-editor-resizer-bottom-right = + .aria-label = Nederste høyre hjørne – endre størrelse +pdfjs-editor-resizer-bottom-middle = + .aria-label = Nederst i midten — endre størrelse +pdfjs-editor-resizer-bottom-left = + .aria-label = Nederste venstre hjørne – endre størrelse +pdfjs-editor-resizer-middle-left = + .aria-label = Midt til venstre — endre størrelse + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Uthevingsfarge +pdfjs-editor-colorpicker-button = + .title = Endre farge +pdfjs-editor-colorpicker-dropdown = + .aria-label = Fargevalg +pdfjs-editor-colorpicker-yellow = + .title = Gul +pdfjs-editor-colorpicker-green = + .title = Grønn +pdfjs-editor-colorpicker-blue = + .title = Blå +pdfjs-editor-colorpicker-pink = + .title = Rosa +pdfjs-editor-colorpicker-red = + .title = Rød + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Vis alle +pdfjs-editor-highlight-show-all-button = + .title = Vis alle + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = Rediger alternativ tekst (bildebeskrivelse) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = Legg til alternativ tekst (bildebeskrivelse) +pdfjs-editor-new-alt-text-textarea = + .placeholder = Skriv din beskrivelse her… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = Kort beskrivelse for folk som ikke kan se bildet eller når bildet ikke lastes inn. +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = Denne alternative teksten ble opprettet automatisk og kan være unøyaktig. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Les mer +pdfjs-editor-new-alt-text-create-automatically-button-label = Lag alternativ tekst automatisk +pdfjs-editor-new-alt-text-not-now-button = Ikke nå +pdfjs-editor-new-alt-text-error-title = Kunne ikke opprette alternativ tekst automatisk +pdfjs-editor-new-alt-text-error-description = Skriv din egen alternativ-tekst eller prøv igjen senere. +pdfjs-editor-new-alt-text-error-close-button = Lukk +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = Laster ned alternativ tekst AI-modell ({ $downloadedSize } av { $totalSize } MB) + .aria-valuetext = Laster ned alternativ tekst AI-modell ({ $downloadedSize } av { $totalSize } MB) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = Alt-tekst lagt til +pdfjs-editor-new-alt-text-added-button-label = Alternativ tekst lagt til +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = Mangler alt-tekst +pdfjs-editor-new-alt-text-missing-button-label = Mangler alternativ tekst +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = Gjennomgå alt-tekst +pdfjs-editor-new-alt-text-to-review-button-label = Gjennomgå alternativ tekst +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Opprettet automatisk: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = Innstillinger for alternativ tekst for bilde +pdfjs-image-alt-text-settings-button-label = Innstillinger for alternativ tekst for bilde +pdfjs-editor-alt-text-settings-dialog-label = Innstillinger for alternativ tekst for bilde +pdfjs-editor-alt-text-settings-automatic-title = Automatisk alternativ tekst +pdfjs-editor-alt-text-settings-create-model-button-label = Opprett alternativ tekst automatisk +pdfjs-editor-alt-text-settings-create-model-description = Foreslår beskrivelser for å hjelpe folk som ikke kan se bildet eller når bildet ikke lastes inn. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = Alternativ tekst AI-modell ({ $totalSize } MB) +pdfjs-editor-alt-text-settings-ai-model-description = Kjører lokalt på enheten din slik at dataene dine forblir private. Nødvendig for automatisk alternativ tekst. +pdfjs-editor-alt-text-settings-delete-model-button = Slett +pdfjs-editor-alt-text-settings-download-model-button = Last ned +pdfjs-editor-alt-text-settings-downloading-model-button = Laster ned… +pdfjs-editor-alt-text-settings-editor-title = Alternativ tekst-redigerer +pdfjs-editor-alt-text-settings-show-dialog-button-label = Vis alternativ tekst-redigerer direkte når du legger til et bilde +pdfjs-editor-alt-text-settings-show-dialog-description = Hjelper deg å sørge for at alle bildene dine har alternativ tekst. +pdfjs-editor-alt-text-settings-close-button = Lukk diff --git a/public/pdfjs/web/locale/ne-NP/viewer.ftl b/public/pdfjs/web/locale/ne-NP/viewer.ftl new file mode 100644 index 0000000..65193b6 --- /dev/null +++ b/public/pdfjs/web/locale/ne-NP/viewer.ftl @@ -0,0 +1,234 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = अघिल्लो पृष्ठ +pdfjs-previous-button-label = अघिल्लो +pdfjs-next-button = + .title = पछिल्लो पृष्ठ +pdfjs-next-button-label = पछिल्लो +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = पृष्ठ +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = { $pagesCount } मध्ये +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pagesCount } को { $pageNumber }) +pdfjs-zoom-out-button = + .title = जुम घटाउनुहोस् +pdfjs-zoom-out-button-label = जुम घटाउनुहोस् +pdfjs-zoom-in-button = + .title = जुम बढाउनुहोस् +pdfjs-zoom-in-button-label = जुम बढाउनुहोस् +pdfjs-zoom-select = + .title = जुम गर्नुहोस् +pdfjs-presentation-mode-button = + .title = प्रस्तुति मोडमा जानुहोस् +pdfjs-presentation-mode-button-label = प्रस्तुति मोड +pdfjs-open-file-button = + .title = फाइल खोल्नुहोस् +pdfjs-open-file-button-label = खोल्नुहोस् +pdfjs-print-button = + .title = मुद्रण गर्नुहोस् +pdfjs-print-button-label = मुद्रण गर्नुहोस् + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = औजारहरू +pdfjs-tools-button-label = औजारहरू +pdfjs-first-page-button = + .title = पहिलो पृष्ठमा जानुहोस् +pdfjs-first-page-button-label = पहिलो पृष्ठमा जानुहोस् +pdfjs-last-page-button = + .title = पछिल्लो पृष्ठमा जानुहोस् +pdfjs-last-page-button-label = पछिल्लो पृष्ठमा जानुहोस् +pdfjs-page-rotate-cw-button = + .title = घडीको दिशामा घुमाउनुहोस् +pdfjs-page-rotate-cw-button-label = घडीको दिशामा घुमाउनुहोस् +pdfjs-page-rotate-ccw-button = + .title = घडीको विपरित दिशामा घुमाउनुहोस् +pdfjs-page-rotate-ccw-button-label = घडीको विपरित दिशामा घुमाउनुहोस् +pdfjs-cursor-text-select-tool-button = + .title = पाठ चयन उपकरण सक्षम गर्नुहोस् +pdfjs-cursor-text-select-tool-button-label = पाठ चयन उपकरण +pdfjs-cursor-hand-tool-button = + .title = हाते उपकरण सक्षम गर्नुहोस् +pdfjs-cursor-hand-tool-button-label = हाते उपकरण +pdfjs-scroll-vertical-button = + .title = ठाडो स्क्रोलिङ्ग प्रयोग गर्नुहोस् +pdfjs-scroll-vertical-button-label = ठाडो स्क्र्रोलिङ्ग +pdfjs-scroll-horizontal-button = + .title = तेर्सो स्क्रोलिङ्ग प्रयोग गर्नुहोस् +pdfjs-scroll-horizontal-button-label = तेर्सो स्क्रोलिङ्ग +pdfjs-scroll-wrapped-button = + .title = लिपि स्क्रोलिङ्ग प्रयोग गर्नुहोस् +pdfjs-scroll-wrapped-button-label = लिपि स्क्रोलिङ्ग +pdfjs-spread-none-button = + .title = पृष्ठ स्प्रेडमा सामेल हुनुहुन्न +pdfjs-spread-none-button-label = स्प्रेड छैन + +## Document properties dialog + +pdfjs-document-properties-button = + .title = कागजात विशेषताहरू... +pdfjs-document-properties-button-label = कागजात विशेषताहरू... +pdfjs-document-properties-file-name = फाइल नाम: +pdfjs-document-properties-file-size = फाइल आकार: +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bytes) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bytes) +pdfjs-document-properties-title = शीर्षक: +pdfjs-document-properties-author = लेखक: +pdfjs-document-properties-subject = विषयः +pdfjs-document-properties-keywords = शब्दकुञ्जीः +pdfjs-document-properties-creation-date = सिर्जना गरिएको मिति: +pdfjs-document-properties-modification-date = परिमार्जित मिति: +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = सर्जक: +pdfjs-document-properties-producer = PDF निर्माता: +pdfjs-document-properties-version = PDF संस्करण +pdfjs-document-properties-page-count = पृष्ठ गणना: +pdfjs-document-properties-page-size = पृष्ठ आकार: +pdfjs-document-properties-page-size-unit-inches = इन्च +pdfjs-document-properties-page-size-unit-millimeters = मि.मि. +pdfjs-document-properties-page-size-orientation-portrait = पोट्रेट +pdfjs-document-properties-page-size-orientation-landscape = परिदृश्य +pdfjs-document-properties-page-size-name-letter = अक्षर +pdfjs-document-properties-page-size-name-legal = कानूनी + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + + +## + +pdfjs-document-properties-linearized-yes = हो +pdfjs-document-properties-linearized-no = होइन +pdfjs-document-properties-close-button = बन्द गर्नुहोस् + +## Print + +pdfjs-print-progress-message = मुद्रणका लागि कागजात तयारी गरिदै… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = रद्द गर्नुहोस् +pdfjs-printing-not-supported = चेतावनी: यो ब्राउजरमा मुद्रण पूर्णतया समर्थित छैन। +pdfjs-printing-not-ready = चेतावनी: PDF मुद्रणका लागि पूर्णतया लोड भएको छैन। + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = टगल साइडबार +pdfjs-toggle-sidebar-button-label = टगल साइडबार +pdfjs-document-outline-button = + .title = कागजातको रूपरेखा देखाउनुहोस् (सबै वस्तुहरू विस्तार/पतन गर्न डबल-क्लिक गर्नुहोस्) +pdfjs-document-outline-button-label = दस्तावेजको रूपरेखा +pdfjs-attachments-button = + .title = संलग्नहरू देखाउनुहोस् +pdfjs-attachments-button-label = संलग्नकहरू +pdfjs-thumbs-button = + .title = थम्बनेलहरू देखाउनुहोस् +pdfjs-thumbs-button-label = थम्बनेलहरू +pdfjs-findbar-button = + .title = कागजातमा फेला पार्नुहोस् +pdfjs-findbar-button-label = फेला पार्नुहोस् + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = पृष्ठ { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = { $page } पृष्ठको थम्बनेल + +## Find panel button title and messages + +pdfjs-find-input = + .title = फेला पार्नुहोस् + .placeholder = कागजातमा फेला पार्नुहोस्… +pdfjs-find-previous-button = + .title = यस वाक्यांशको अघिल्लो घटना फेला पार्नुहोस् +pdfjs-find-previous-button-label = अघिल्लो +pdfjs-find-next-button = + .title = यस वाक्यांशको पछिल्लो घटना फेला पार्नुहोस् +pdfjs-find-next-button-label = अर्को +pdfjs-find-highlight-checkbox = सबै हाइलाइट गर्ने +pdfjs-find-match-case-checkbox-label = केस जोडा मिलाउनुहोस् +pdfjs-find-entire-word-checkbox-label = पुरा शब्दहरु +pdfjs-find-reached-top = पृष्ठको शिर्षमा पुगीयो, तलबाट जारी गरिएको थियो +pdfjs-find-reached-bottom = पृष्ठको अन्त्यमा पुगीयो, शिर्षबाट जारी गरिएको थियो +pdfjs-find-not-found = वाक्यांश फेला परेन + +## Predefined zoom values + +pdfjs-page-scale-width = पृष्ठ चौडाइ +pdfjs-page-scale-fit = पृष्ठ ठिक्क मिल्ने +pdfjs-page-scale-auto = स्वचालित जुम +pdfjs-page-scale-actual = वास्तविक आकार +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + + +## Loading indicator messages + +pdfjs-loading-error = यो PDF लोड गर्दा एउटा त्रुटि देखापर्‍यो। +pdfjs-invalid-file-error = अवैध वा दुषित PDF फाइल। +pdfjs-missing-file-error = हराईरहेको PDF फाइल। +pdfjs-unexpected-response-error = अप्रत्याशित सर्भर प्रतिक्रिया। +pdfjs-rendering-error = पृष्ठ प्रतिपादन गर्दा एउटा त्रुटि देखापर्‍यो। + +## Annotations + +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } Annotation] + +## Password + +pdfjs-password-label = यस PDF फाइललाई खोल्न गोप्यशब्द प्रविष्ट गर्नुहोस्। +pdfjs-password-invalid = अवैध गोप्यशब्द। पुनः प्रयास गर्नुहोस्। +pdfjs-password-ok-button = ठिक छ +pdfjs-password-cancel-button = रद्द गर्नुहोस् +pdfjs-web-fonts-disabled = वेब फन्ट असक्षम छन्: एम्बेडेड PDF फन्ट प्रयोग गर्न असमर्थ। + +## Editing + + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + diff --git a/public/pdfjs/web/locale/nl/viewer.ftl b/public/pdfjs/web/locale/nl/viewer.ftl new file mode 100644 index 0000000..fe24ce7 --- /dev/null +++ b/public/pdfjs/web/locale/nl/viewer.ftl @@ -0,0 +1,515 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Vorige pagina +pdfjs-previous-button-label = Vorige +pdfjs-next-button = + .title = Volgende pagina +pdfjs-next-button-label = Volgende +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Pagina +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = van { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } van { $pagesCount }) +pdfjs-zoom-out-button = + .title = Uitzoomen +pdfjs-zoom-out-button-label = Uitzoomen +pdfjs-zoom-in-button = + .title = Inzoomen +pdfjs-zoom-in-button-label = Inzoomen +pdfjs-zoom-select = + .title = Zoomen +pdfjs-presentation-mode-button = + .title = Wisselen naar presentatiemodus +pdfjs-presentation-mode-button-label = Presentatiemodus +pdfjs-open-file-button = + .title = Bestand openen +pdfjs-open-file-button-label = Openen +pdfjs-print-button = + .title = Afdrukken +pdfjs-print-button-label = Afdrukken +pdfjs-save-button = + .title = Opslaan +pdfjs-save-button-label = Opslaan +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Downloaden +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Downloaden +pdfjs-bookmark-button = + .title = Huidige pagina (URL van huidige pagina bekijken) +pdfjs-bookmark-button-label = Huidige pagina + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Hulpmiddelen +pdfjs-tools-button-label = Hulpmiddelen +pdfjs-first-page-button = + .title = Naar eerste pagina gaan +pdfjs-first-page-button-label = Naar eerste pagina gaan +pdfjs-last-page-button = + .title = Naar laatste pagina gaan +pdfjs-last-page-button-label = Naar laatste pagina gaan +pdfjs-page-rotate-cw-button = + .title = Rechtsom draaien +pdfjs-page-rotate-cw-button-label = Rechtsom draaien +pdfjs-page-rotate-ccw-button = + .title = Linksom draaien +pdfjs-page-rotate-ccw-button-label = Linksom draaien +pdfjs-cursor-text-select-tool-button = + .title = Tekstselectiehulpmiddel inschakelen +pdfjs-cursor-text-select-tool-button-label = Tekstselectiehulpmiddel +pdfjs-cursor-hand-tool-button = + .title = Handhulpmiddel inschakelen +pdfjs-cursor-hand-tool-button-label = Handhulpmiddel +pdfjs-scroll-page-button = + .title = Paginascrollen gebruiken +pdfjs-scroll-page-button-label = Paginascrollen +pdfjs-scroll-vertical-button = + .title = Verticaal scrollen gebruiken +pdfjs-scroll-vertical-button-label = Verticaal scrollen +pdfjs-scroll-horizontal-button = + .title = Horizontaal scrollen gebruiken +pdfjs-scroll-horizontal-button-label = Horizontaal scrollen +pdfjs-scroll-wrapped-button = + .title = Scrollen met terugloop gebruiken +pdfjs-scroll-wrapped-button-label = Scrollen met terugloop +pdfjs-spread-none-button = + .title = Dubbele pagina’s niet samenvoegen +pdfjs-spread-none-button-label = Geen dubbele pagina’s +pdfjs-spread-odd-button = + .title = Dubbele pagina’s samenvoegen vanaf oneven pagina’s +pdfjs-spread-odd-button-label = Oneven dubbele pagina’s +pdfjs-spread-even-button = + .title = Dubbele pagina’s samenvoegen vanaf even pagina’s +pdfjs-spread-even-button-label = Even dubbele pagina’s + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Documenteigenschappen… +pdfjs-document-properties-button-label = Documenteigenschappen… +pdfjs-document-properties-file-name = Bestandsnaam: +pdfjs-document-properties-file-size = Bestandsgrootte: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } bytes) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } bytes) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bytes) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bytes) +pdfjs-document-properties-title = Titel: +pdfjs-document-properties-author = Auteur: +pdfjs-document-properties-subject = Onderwerp: +pdfjs-document-properties-keywords = Sleutelwoorden: +pdfjs-document-properties-creation-date = Aanmaakdatum: +pdfjs-document-properties-modification-date = Wijzigingsdatum: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Maker: +pdfjs-document-properties-producer = PDF-producent: +pdfjs-document-properties-version = PDF-versie: +pdfjs-document-properties-page-count = Aantal pagina’s: +pdfjs-document-properties-page-size = Paginagrootte: +pdfjs-document-properties-page-size-unit-inches = in +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = staand +pdfjs-document-properties-page-size-orientation-landscape = liggend +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Letter +pdfjs-document-properties-page-size-name-legal = Legal + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Snelle webweergave: +pdfjs-document-properties-linearized-yes = Ja +pdfjs-document-properties-linearized-no = Nee +pdfjs-document-properties-close-button = Sluiten + +## Print + +pdfjs-print-progress-message = Document voorbereiden voor afdrukken… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Annuleren +pdfjs-printing-not-supported = Waarschuwing: afdrukken wordt niet volledig ondersteund door deze browser. +pdfjs-printing-not-ready = Waarschuwing: de PDF is niet volledig geladen voor afdrukken. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Zijbalk in-/uitschakelen +pdfjs-toggle-sidebar-notification-button = + .title = Zijbalk in-/uitschakelen (document bevat overzicht/bijlagen/lagen) +pdfjs-toggle-sidebar-button-label = Zijbalk in-/uitschakelen +pdfjs-document-outline-button = + .title = Documentoverzicht tonen (dubbelklik om alle items uit/samen te vouwen) +pdfjs-document-outline-button-label = Documentoverzicht +pdfjs-attachments-button = + .title = Bijlagen tonen +pdfjs-attachments-button-label = Bijlagen +pdfjs-layers-button = + .title = Lagen tonen (dubbelklik om alle lagen naar de standaardstatus terug te zetten) +pdfjs-layers-button-label = Lagen +pdfjs-thumbs-button = + .title = Miniaturen tonen +pdfjs-thumbs-button-label = Miniaturen +pdfjs-current-outline-item-button = + .title = Huidig item in inhoudsopgave zoeken +pdfjs-current-outline-item-button-label = Huidig item in inhoudsopgave +pdfjs-findbar-button = + .title = Zoeken in document +pdfjs-findbar-button-label = Zoeken +pdfjs-additional-layers = Aanvullende lagen + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Pagina { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Miniatuur van pagina { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Zoeken + .placeholder = Zoeken in document… +pdfjs-find-previous-button = + .title = De vorige overeenkomst van de tekst zoeken +pdfjs-find-previous-button-label = Vorige +pdfjs-find-next-button = + .title = De volgende overeenkomst van de tekst zoeken +pdfjs-find-next-button-label = Volgende +pdfjs-find-highlight-checkbox = Alles markeren +pdfjs-find-match-case-checkbox-label = Hoofdlettergevoelig +pdfjs-find-match-diacritics-checkbox-label = Diakritische tekens gebruiken +pdfjs-find-entire-word-checkbox-label = Hele woorden +pdfjs-find-reached-top = Bovenkant van document bereikt, doorgegaan vanaf onderkant +pdfjs-find-reached-bottom = Onderkant van document bereikt, doorgegaan vanaf bovenkant +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] { $current } van { $total } overeenkomst + *[other] { $current } van { $total } overeenkomsten + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] Meer dan { $limit } overeenkomst + *[other] Meer dan { $limit } overeenkomsten + } +pdfjs-find-not-found = Tekst niet gevonden + +## Predefined zoom values + +pdfjs-page-scale-width = Paginabreedte +pdfjs-page-scale-fit = Hele pagina +pdfjs-page-scale-auto = Automatisch zoomen +pdfjs-page-scale-actual = Werkelijke grootte +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Pagina { $page } + +## Loading indicator messages + +pdfjs-loading-error = Er is een fout opgetreden bij het laden van de PDF. +pdfjs-invalid-file-error = Ongeldig of beschadigd PDF-bestand. +pdfjs-missing-file-error = PDF-bestand ontbreekt. +pdfjs-unexpected-response-error = Onverwacht serverantwoord. +pdfjs-rendering-error = Er is een fout opgetreden bij het weergeven van de pagina. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type }-aantekening] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Voer het wachtwoord in om dit PDF-bestand te openen. +pdfjs-password-invalid = Ongeldig wachtwoord. Probeer het opnieuw. +pdfjs-password-ok-button = OK +pdfjs-password-cancel-button = Annuleren +pdfjs-web-fonts-disabled = Weblettertypen zijn uitgeschakeld: gebruik van ingebedde PDF-lettertypen is niet mogelijk. + +## Editing + +pdfjs-editor-free-text-button = + .title = Tekst +pdfjs-editor-free-text-button-label = Tekst +pdfjs-editor-ink-button = + .title = Tekenen +pdfjs-editor-ink-button-label = Tekenen +pdfjs-editor-stamp-button = + .title = Afbeeldingen toevoegen of bewerken +pdfjs-editor-stamp-button-label = Afbeeldingen toevoegen of bewerken +pdfjs-editor-highlight-button = + .title = Markeren +pdfjs-editor-highlight-button-label = Markeren +pdfjs-highlight-floating-button1 = + .title = Markeren + .aria-label = Markeren +pdfjs-highlight-floating-button-label = Markeren + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Tekening verwijderen +pdfjs-editor-remove-freetext-button = + .title = Tekst verwijderen +pdfjs-editor-remove-stamp-button = + .title = Afbeelding verwijderen +pdfjs-editor-remove-highlight-button = + .title = Markering verwijderen + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Kleur +pdfjs-editor-free-text-size-input = Grootte +pdfjs-editor-ink-color-input = Kleur +pdfjs-editor-ink-thickness-input = Dikte +pdfjs-editor-ink-opacity-input = Opaciteit +pdfjs-editor-stamp-add-image-button = + .title = Afbeelding toevoegen +pdfjs-editor-stamp-add-image-button-label = Afbeelding toevoegen +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Dikte +pdfjs-editor-free-highlight-thickness-title = + .title = Dikte wijzigen bij accentuering van andere items dan tekst +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = Tekstbewerker + .default-content = Start met typen… +pdfjs-free-text = + .aria-label = Tekstbewerker +pdfjs-free-text-default-content = Begin met typen… +pdfjs-ink = + .aria-label = Tekeningbewerker +pdfjs-ink-canvas = + .aria-label = Door gebruiker gemaakte afbeelding + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = Alternatieve tekst +pdfjs-editor-alt-text-edit-button = + .aria-label = Alternatieve tekst bewerken +pdfjs-editor-alt-text-edit-button-label = Alternatieve tekst bewerken +pdfjs-editor-alt-text-dialog-label = Kies een optie +pdfjs-editor-alt-text-dialog-description = Alternatieve tekst helpt wanneer mensen de afbeelding niet kunnen zien of wanneer deze niet wordt geladen. +pdfjs-editor-alt-text-add-description-label = Voeg een beschrijving toe +pdfjs-editor-alt-text-add-description-description = Streef naar 1-2 zinnen die het onderwerp, de omgeving of de acties beschrijven. +pdfjs-editor-alt-text-mark-decorative-label = Als decoratief markeren +pdfjs-editor-alt-text-mark-decorative-description = Dit wordt gebruikt voor sierafbeeldingen, zoals randen of watermerken. +pdfjs-editor-alt-text-cancel-button = Annuleren +pdfjs-editor-alt-text-save-button = Opslaan +pdfjs-editor-alt-text-decorative-tooltip = Als decoratief gemarkeerd +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = Bijvoorbeeld: ‘Een jonge man gaat aan een tafel zitten om te eten’ +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = Alternatieve tekst + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Linkerbovenhoek – formaat wijzigen +pdfjs-editor-resizer-label-top-middle = Midden boven – formaat wijzigen +pdfjs-editor-resizer-label-top-right = Rechterbovenhoek – formaat wijzigen +pdfjs-editor-resizer-label-middle-right = Midden rechts – formaat wijzigen +pdfjs-editor-resizer-label-bottom-right = Rechterbenedenhoek – formaat wijzigen +pdfjs-editor-resizer-label-bottom-middle = Midden onder – formaat wijzigen +pdfjs-editor-resizer-label-bottom-left = Linkerbenedenhoek – formaat wijzigen +pdfjs-editor-resizer-label-middle-left = Links midden – formaat wijzigen +pdfjs-editor-resizer-top-left = + .aria-label = Linkerbovenhoek – formaat wijzigen +pdfjs-editor-resizer-top-middle = + .aria-label = Midden boven – formaat wijzigen +pdfjs-editor-resizer-top-right = + .aria-label = Rechterbovenhoek – formaat wijzigen +pdfjs-editor-resizer-middle-right = + .aria-label = Midden rechts – formaat wijzigen +pdfjs-editor-resizer-bottom-right = + .aria-label = Rechterbenedenhoek – formaat wijzigen +pdfjs-editor-resizer-bottom-middle = + .aria-label = Midden onder – formaat wijzigen +pdfjs-editor-resizer-bottom-left = + .aria-label = Linkerbenedenhoek – formaat wijzigen +pdfjs-editor-resizer-middle-left = + .aria-label = Links midden – formaat wijzigen + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Markeringskleur +pdfjs-editor-colorpicker-button = + .title = Kleur wijzigen +pdfjs-editor-colorpicker-dropdown = + .aria-label = Kleurkeuzes +pdfjs-editor-colorpicker-yellow = + .title = Geel +pdfjs-editor-colorpicker-green = + .title = Groen +pdfjs-editor-colorpicker-blue = + .title = Blauw +pdfjs-editor-colorpicker-pink = + .title = Roze +pdfjs-editor-colorpicker-red = + .title = Rood + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Alles tonen +pdfjs-editor-highlight-show-all-button = + .title = Alles tonen + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = Alternatieve tekst (afbeeldingsbeschrijving) bewerken +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = Alternatieve tekst (afbeeldingsbeschrijving) toevoegen +pdfjs-editor-new-alt-text-textarea = + .placeholder = Schrijf hier uw beschrijving… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = Korte beschrijving voor mensen die de afbeelding niet kunnen zien of wanneer de afbeelding niet wordt geladen. +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = Deze alternatieve tekst is automatisch gemaakt en is mogelijk onjuist. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Meer info +pdfjs-editor-new-alt-text-create-automatically-button-label = Alternatieve tekst automatisch aanmaken +pdfjs-editor-new-alt-text-not-now-button = Niet nu +pdfjs-editor-new-alt-text-error-title = Kan alternatieve tekst niet automatisch aanmaken +pdfjs-editor-new-alt-text-error-description = Schrijf uw eigen alternatieve tekst of probeer het later nog eens. +pdfjs-editor-new-alt-text-error-close-button = Sluiten +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = AI-model voor alternatieve tekst downloaden ({ $downloadedSize } van { $totalSize } MB) + .aria-valuetext = AI-model voor alternatieve tekst downloaden ({ $downloadedSize } van { $totalSize } MB) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = Alternatieve tekst toegevoegd +pdfjs-editor-new-alt-text-added-button-label = Alternatieve tekst toegevoegd +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = Alternatieve tekst ontbreekt +pdfjs-editor-new-alt-text-missing-button-label = Alternatieve tekst ontbreekt +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = Alternatieve tekst beoordelen +pdfjs-editor-new-alt-text-to-review-button-label = Alternatieve tekst beoordelen +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Automatisch aangemaakt: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = Instellingen voor alternatieve tekst van afbeeldingen +pdfjs-image-alt-text-settings-button-label = Instellingen voor alternatieve tekst van afbeeldingen +pdfjs-editor-alt-text-settings-dialog-label = Instellingen voor alternatieve tekst van afbeeldingen +pdfjs-editor-alt-text-settings-automatic-title = Automatische alternatieve tekst +pdfjs-editor-alt-text-settings-create-model-button-label = Alternatieve tekst automatisch aanmaken +pdfjs-editor-alt-text-settings-create-model-description = Stelt beschrijvingen voor om mensen te helpen die de afbeelding niet kunnen zien of voor wie de afbeelding niet wordt geladen. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = AI-model voor alternatieve tekst ({ $totalSize } MB) +pdfjs-editor-alt-text-settings-ai-model-description = Wordt lokaal op uw apparaat uitgevoerd, zodat uw gegevens privé blijven. Vereist voor automatische alternatieve tekst. +pdfjs-editor-alt-text-settings-delete-model-button = Verwijderen +pdfjs-editor-alt-text-settings-download-model-button = Downloaden +pdfjs-editor-alt-text-settings-downloading-model-button = Downloaden… +pdfjs-editor-alt-text-settings-editor-title = Alternatieve-tekstbewerker +pdfjs-editor-alt-text-settings-show-dialog-button-label = Alternatieve-tekstbewerker meteen tonen bij toevoegen van een afbeelding +pdfjs-editor-alt-text-settings-show-dialog-description = Helpt u ervoor te zorgen dat al uw afbeeldingen alternatieve tekst hebben. +pdfjs-editor-alt-text-settings-close-button = Sluiten + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = Markering verwijderd +pdfjs-editor-undo-bar-message-freetext = Tekst verwijderd +pdfjs-editor-undo-bar-message-ink = Tekening verwijderd +pdfjs-editor-undo-bar-message-stamp = Afbeelding verwijderd +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = + { $count -> + [one] { $count } annotatie verwijderd + *[other] { $count } annotaties verwijderd + } +pdfjs-editor-undo-bar-undo-button = + .title = Ongedaan maken +pdfjs-editor-undo-bar-undo-button-label = Ongedaan maken +pdfjs-editor-undo-bar-close-button = + .title = Sluiten +pdfjs-editor-undo-bar-close-button-label = Sluiten diff --git a/public/pdfjs/web/locale/nn-NO/viewer.ftl b/public/pdfjs/web/locale/nn-NO/viewer.ftl new file mode 100644 index 0000000..d617e16 --- /dev/null +++ b/public/pdfjs/web/locale/nn-NO/viewer.ftl @@ -0,0 +1,498 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Føregåande side +pdfjs-previous-button-label = Føregåande +pdfjs-next-button = + .title = Neste side +pdfjs-next-button-label = Neste +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Side +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = av { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } av { $pagesCount }) +pdfjs-zoom-out-button = + .title = Zoom ut +pdfjs-zoom-out-button-label = Zoom ut +pdfjs-zoom-in-button = + .title = Zoom inn +pdfjs-zoom-in-button-label = Zoom inn +pdfjs-zoom-select = + .title = Zoom +pdfjs-presentation-mode-button = + .title = Byt til presentasjonsmodus +pdfjs-presentation-mode-button-label = Presentasjonsmodus +pdfjs-open-file-button = + .title = Opne fil +pdfjs-open-file-button-label = Opne +pdfjs-print-button = + .title = Skriv ut +pdfjs-print-button-label = Skriv ut +pdfjs-save-button = + .title = Lagre +pdfjs-save-button-label = Lagre +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Last ned +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Last ned +pdfjs-bookmark-button = + .title = Gjeldande side (sjå URL frå gjeldande side) +pdfjs-bookmark-button-label = Gjeldande side + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Verktøy +pdfjs-tools-button-label = Verktøy +pdfjs-first-page-button = + .title = Gå til første side +pdfjs-first-page-button-label = Gå til første side +pdfjs-last-page-button = + .title = Gå til siste side +pdfjs-last-page-button-label = Gå til siste side +pdfjs-page-rotate-cw-button = + .title = Roter med klokka +pdfjs-page-rotate-cw-button-label = Roter med klokka +pdfjs-page-rotate-ccw-button = + .title = Roter mot klokka +pdfjs-page-rotate-ccw-button-label = Roter mot klokka +pdfjs-cursor-text-select-tool-button = + .title = Aktiver tekstmarkeringsverktøy +pdfjs-cursor-text-select-tool-button-label = Tekstmarkeringsverktøy +pdfjs-cursor-hand-tool-button = + .title = Aktiver handverktøy +pdfjs-cursor-hand-tool-button-label = Handverktøy +pdfjs-scroll-page-button = + .title = Bruk siderulling +pdfjs-scroll-page-button-label = Siderulling +pdfjs-scroll-vertical-button = + .title = Bruk vertikal rulling +pdfjs-scroll-vertical-button-label = Vertikal rulling +pdfjs-scroll-horizontal-button = + .title = Bruk horisontal rulling +pdfjs-scroll-horizontal-button-label = Horisontal rulling +pdfjs-scroll-wrapped-button = + .title = Bruk fleirsiderulling +pdfjs-scroll-wrapped-button-label = Fleirsiderulling +pdfjs-spread-none-button = + .title = Vis enkeltsider +pdfjs-spread-none-button-label = Enkeltside +pdfjs-spread-odd-button = + .title = Vis oppslag med ulike sidenummer til venstre +pdfjs-spread-odd-button-label = Oppslag med framside +pdfjs-spread-even-button = + .title = Vis oppslag med like sidenummmer til venstre +pdfjs-spread-even-button-label = Oppslag utan framside + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Dokumenteigenskapar… +pdfjs-document-properties-button-label = Dokumenteigenskapar… +pdfjs-document-properties-file-name = Filnamn: +pdfjs-document-properties-file-size = Filstorleik: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } kB ({ $b } byte) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } byte) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bytes) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bytes) +pdfjs-document-properties-title = Tittel: +pdfjs-document-properties-author = Forfattar: +pdfjs-document-properties-subject = Emne: +pdfjs-document-properties-keywords = Stikkord: +pdfjs-document-properties-creation-date = Dato oppretta: +pdfjs-document-properties-modification-date = Dato endra: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Oppretta av: +pdfjs-document-properties-producer = PDF-verktøy: +pdfjs-document-properties-version = PDF-versjon: +pdfjs-document-properties-page-count = Sidetal: +pdfjs-document-properties-page-size = Sidestørrelse: +pdfjs-document-properties-page-size-unit-inches = in +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = ståande (portrait) +pdfjs-document-properties-page-size-orientation-landscape = liggande (landscape) +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Brev +pdfjs-document-properties-page-size-name-legal = Legal + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Rask nettvising: +pdfjs-document-properties-linearized-yes = Ja +pdfjs-document-properties-linearized-no = Nei +pdfjs-document-properties-close-button = Lat att + +## Print + +pdfjs-print-progress-message = Førebur dokumentet for utskrift… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Avbryt +pdfjs-printing-not-supported = Åtvaring: Utskrift er ikkje fullstendig støtta av denne nettlesaren. +pdfjs-printing-not-ready = Åtvaring: PDF ikkje fullstendig innlasta for utskrift. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Slå av/på sidestolpe +pdfjs-toggle-sidebar-notification-button = + .title = Vis/gøym sidestolpe (dokumentet inneheld oversikt/vedlegg/lag) +pdfjs-toggle-sidebar-button-label = Slå av/på sidestolpe +pdfjs-document-outline-button = + .title = Vis dokumentdisposisjonen (dobbelklikk for å utvide/gøyme alle elementa) +pdfjs-document-outline-button-label = Dokumentdisposisjon +pdfjs-attachments-button = + .title = Vis vedlegg +pdfjs-attachments-button-label = Vedlegg +pdfjs-layers-button = + .title = Vis lag (dobbeltklikk for å tilbakestille alle lag til standardtilstand) +pdfjs-layers-button-label = Lag +pdfjs-thumbs-button = + .title = Vis miniatyrbilde +pdfjs-thumbs-button-label = Miniatyrbilde +pdfjs-current-outline-item-button = + .title = Finn gjeldande disposisjonselement +pdfjs-current-outline-item-button-label = Gjeldande disposisjonselement +pdfjs-findbar-button = + .title = Finn i dokumentet +pdfjs-findbar-button-label = Finn +pdfjs-additional-layers = Ytterlegare lag + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Side { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Miniatyrbilde av side { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Søk + .placeholder = Søk i dokument… +pdfjs-find-previous-button = + .title = Finn førre førekomst av frasen +pdfjs-find-previous-button-label = Førre +pdfjs-find-next-button = + .title = Finn neste førekomst av frasen +pdfjs-find-next-button-label = Neste +pdfjs-find-highlight-checkbox = Uthev alle +pdfjs-find-match-case-checkbox-label = Skil store/små bokstavar +pdfjs-find-match-diacritics-checkbox-label = Samsvar diakritiske teikn +pdfjs-find-entire-word-checkbox-label = Heile ord +pdfjs-find-reached-top = Nådde toppen av dokumentet, fortset frå botnen +pdfjs-find-reached-bottom = Nådde botnen av dokumentet, fortset frå toppen +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] { $current } av { $total } treff + *[other] { $current } av { $total } treff + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] Meir enn { $limit } treff + *[other] Meir enn { $limit } treff + } +pdfjs-find-not-found = Fann ikkje teksten + +## Predefined zoom values + +pdfjs-page-scale-width = Sidebreidde +pdfjs-page-scale-fit = Tilpass til sida +pdfjs-page-scale-auto = Automatisk skalering +pdfjs-page-scale-actual = Verkeleg storleik +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Side { $page } + +## Loading indicator messages + +pdfjs-loading-error = Ein feil oppstod ved lasting av PDF. +pdfjs-invalid-file-error = Ugyldig eller korrupt PDF-fil. +pdfjs-missing-file-error = Manglande PDF-fil. +pdfjs-unexpected-response-error = Uventa tenarrespons. +pdfjs-rendering-error = Ein feil oppstod under vising av sida. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date } { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } annotasjon] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Skriv inn passordet for å opne denne PDF-fila. +pdfjs-password-invalid = Ugyldig passord. Prøv på nytt. +pdfjs-password-ok-button = OK +pdfjs-password-cancel-button = Avbryt +pdfjs-web-fonts-disabled = Web-skrifter er slått av: Kan ikkje bruke innbundne PDF-skrifter. + +## Editing + +pdfjs-editor-free-text-button = + .title = Tekst +pdfjs-editor-free-text-button-label = Tekst +pdfjs-editor-ink-button = + .title = Teikne +pdfjs-editor-ink-button-label = Teikne +pdfjs-editor-stamp-button = + .title = Legg til eller rediger bilde +pdfjs-editor-stamp-button-label = Legg til eller rediger bilde +pdfjs-editor-highlight-button = + .title = Markere +pdfjs-editor-highlight-button-label = Markere +pdfjs-highlight-floating-button1 = + .title = Markere + .aria-label = Markere +pdfjs-highlight-floating-button-label = Markere + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Fjern teikninga +pdfjs-editor-remove-freetext-button = + .title = Fjern tekst +pdfjs-editor-remove-stamp-button = + .title = Fjern bildet +pdfjs-editor-remove-highlight-button = + .title = Fjern utheving + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Farge +pdfjs-editor-free-text-size-input = Storleik +pdfjs-editor-ink-color-input = Farge +pdfjs-editor-ink-thickness-input = Tjukn +pdfjs-editor-ink-opacity-input = Ugjennomskinleg +pdfjs-editor-stamp-add-image-button = + .title = Legg til bilde +pdfjs-editor-stamp-add-image-button-label = Legg til bilde +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Tjukn +pdfjs-editor-free-highlight-thickness-title = + .title = Endre tjukn når du markerer andre element enn tekst +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = Tekstredigering + .default-content = Begynn å skrive… +pdfjs-free-text = + .aria-label = Tekstredigering +pdfjs-free-text-default-content = Byrje å skrive… +pdfjs-ink = + .aria-label = Teikneredigering +pdfjs-ink-canvas = + .aria-label = Brukarskapt bilde + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = Alt-tekst +pdfjs-editor-alt-text-edit-button = + .aria-label = Rediger alt-tekst tekst +pdfjs-editor-alt-text-edit-button-label = Rediger alt-tekst tekst +pdfjs-editor-alt-text-dialog-label = Vel eit alternativ +pdfjs-editor-alt-text-dialog-description = Alt-tekst (alternativ tekst) hjelper når folk ikkje kan sjå bildet eller når det ikkje vert lasta inn. +pdfjs-editor-alt-text-add-description-label = Legg til ei skildring +pdfjs-editor-alt-text-add-description-description = Gå etter 1-2 setninger som skildrar emnet, settinga eller handlingane. +pdfjs-editor-alt-text-mark-decorative-label = Merk som dekorativt +pdfjs-editor-alt-text-mark-decorative-description = Dette vert brukt til dekorative bilde, som kantlinjer eller vassmerke. +pdfjs-editor-alt-text-cancel-button = Avbryt +pdfjs-editor-alt-text-save-button = Lagre +pdfjs-editor-alt-text-decorative-tooltip = Merkt som dekorativ +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = Til dømes, «Ein ung mann set seg ved eit bord for å ete eit måltid» +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = Alt-tekst + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Øvste venstre hjørne – endre størrelse +pdfjs-editor-resizer-label-top-middle = Øvst i midten — endre størrelse +pdfjs-editor-resizer-label-top-right = Øvste høgre hjørne – endre størrelse +pdfjs-editor-resizer-label-middle-right = Midt til høgre – endre størrelse +pdfjs-editor-resizer-label-bottom-right = Nedste høgre hjørne – endre størrelse +pdfjs-editor-resizer-label-bottom-middle = Nedst i midten — endre størrelse +pdfjs-editor-resizer-label-bottom-left = Nedste venstre hjørne – endre størrelse +pdfjs-editor-resizer-label-middle-left = Midt til venstre — endre størrelse +pdfjs-editor-resizer-top-left = + .aria-label = Øvste venstre hjørne – endre størrelse +pdfjs-editor-resizer-top-middle = + .aria-label = Øvst i midten — endre størrelse +pdfjs-editor-resizer-top-right = + .aria-label = Øvste høgre hjørne – endre størrelse +pdfjs-editor-resizer-middle-right = + .aria-label = Midt til høgre – endre størrelse +pdfjs-editor-resizer-bottom-right = + .aria-label = Nedste høgre hjørne – endre størrelse +pdfjs-editor-resizer-bottom-middle = + .aria-label = Nedst i midten — endre størrelse +pdfjs-editor-resizer-bottom-left = + .aria-label = Nedste venstre hjørne – endre størrelse +pdfjs-editor-resizer-middle-left = + .aria-label = Midt til venstre — endre størrelse + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Uthevingsfarge +pdfjs-editor-colorpicker-button = + .title = Endre farge +pdfjs-editor-colorpicker-dropdown = + .aria-label = Fargeval +pdfjs-editor-colorpicker-yellow = + .title = Gul +pdfjs-editor-colorpicker-green = + .title = Grøn +pdfjs-editor-colorpicker-blue = + .title = Blå +pdfjs-editor-colorpicker-pink = + .title = Rosa +pdfjs-editor-colorpicker-red = + .title = Raud + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Vis alle +pdfjs-editor-highlight-show-all-button = + .title = Vis alle + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = Rediger alternativ tekst (bildeskildring) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = Legg til alternativ tekst (bildeskildring) +pdfjs-editor-new-alt-text-textarea = + .placeholder = Skriv skildringa di her… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = Kort skildring for personar som ikkje kan sjå bildet, eller når bildet ikkje lastar inn. +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = Denne alternative teksten vart oppretta automatisk, og kan vere unøyaktig. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Les meir +pdfjs-editor-new-alt-text-create-automatically-button-label = Opprett alternativ tekt automatisk +pdfjs-editor-new-alt-text-not-now-button = Ikkje no +pdfjs-editor-new-alt-text-error-title = Klarte ikkje å opprette alternativ tekst automatisk +pdfjs-editor-new-alt-text-error-description = Skriv din eigen alternative tekst eller prøv igjen seinare. +pdfjs-editor-new-alt-text-error-close-button = Lat att +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = Lastar ned AI-modell med alternativ tekst ({ $downloadedSize } av { $totalSize } MB) + .aria-valuetext = Lastar ned AI-modell med alternativ tekst ({ $downloadedSize } av { $totalSize } MB) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = Alternativ tekst lagt til +pdfjs-editor-new-alt-text-added-button-label = Alternativ tekst lagt til +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = Manglande alternativ tekst +pdfjs-editor-new-alt-text-missing-button-label = Manglande alternativ tekst +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = Vurder alternativ tekst +pdfjs-editor-new-alt-text-to-review-button-label = Vurder alternativ tekst +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Oppretta automatisk: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = Alternative tekst-innstillingar for bilde +pdfjs-image-alt-text-settings-button-label = Alternative tekst-innstillingar for bilde +pdfjs-editor-alt-text-settings-dialog-label = Alternative tekst-innstillingar for bilde +pdfjs-editor-alt-text-settings-automatic-title = Automatisk alternativ tekst +pdfjs-editor-alt-text-settings-create-model-button-label = Opprett alternativ tekt automatisk +pdfjs-editor-alt-text-settings-create-model-description = Foreslår skildringar for å hjelpe folk som ikkje kan sjå bildet eller når bildet ikkje blir lasta inn. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = AI-modell for alternativ tekst ({ $totalSize } MB) +pdfjs-editor-alt-text-settings-ai-model-description = Køyrer lokalt på eininga di slik at dataa dine blir verande private. Påkravd for automatisk alternativ tekst. +pdfjs-editor-alt-text-settings-delete-model-button = Slett +pdfjs-editor-alt-text-settings-download-model-button = Last ned +pdfjs-editor-alt-text-settings-downloading-model-button = Lastar ned… +pdfjs-editor-alt-text-settings-editor-title = Alternativ tekst-redigerar +pdfjs-editor-alt-text-settings-show-dialog-button-label = Vis alternativ tekst-redigerar direkte når du legg til eit bilde +pdfjs-editor-alt-text-settings-show-dialog-description = Hjelper deg med å sørgje for at alle bilda dine har alternativ tekst. +pdfjs-editor-alt-text-settings-close-button = Lat att + +## "Annotations removed" bar + diff --git a/public/pdfjs/web/locale/oc/viewer.ftl b/public/pdfjs/web/locale/oc/viewer.ftl new file mode 100644 index 0000000..b347aef --- /dev/null +++ b/public/pdfjs/web/locale/oc/viewer.ftl @@ -0,0 +1,409 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Pagina precedenta +pdfjs-previous-button-label = Precedent +pdfjs-next-button = + .title = Pagina seguenta +pdfjs-next-button-label = Seguent +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Pagina +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = sus { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } de { $pagesCount }) +pdfjs-zoom-out-button = + .title = Zoom arrièr +pdfjs-zoom-out-button-label = Zoom arrièr +pdfjs-zoom-in-button = + .title = Zoom avant +pdfjs-zoom-in-button-label = Zoom avant +pdfjs-zoom-select = + .title = Zoom +pdfjs-presentation-mode-button = + .title = Bascular en mòde presentacion +pdfjs-presentation-mode-button-label = Mòde Presentacion +pdfjs-open-file-button = + .title = Dobrir lo fichièr +pdfjs-open-file-button-label = Dobrir +pdfjs-print-button = + .title = Imprimir +pdfjs-print-button-label = Imprimir +pdfjs-save-button = + .title = Enregistrar +pdfjs-save-button-label = Enregistrar +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Telecargar +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Telecargar +pdfjs-bookmark-button = + .title = Pagina actuala (mostrar l’adreça de la pagina actuala) +pdfjs-bookmark-button-label = Pagina actuala + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Aisinas +pdfjs-tools-button-label = Aisinas +pdfjs-first-page-button = + .title = Anar a la primièra pagina +pdfjs-first-page-button-label = Anar a la primièra pagina +pdfjs-last-page-button = + .title = Anar a la darrièra pagina +pdfjs-last-page-button-label = Anar a la darrièra pagina +pdfjs-page-rotate-cw-button = + .title = Rotacion orària +pdfjs-page-rotate-cw-button-label = Rotacion orària +pdfjs-page-rotate-ccw-button = + .title = Rotacion antiorària +pdfjs-page-rotate-ccw-button-label = Rotacion antiorària +pdfjs-cursor-text-select-tool-button = + .title = Activar l'aisina de seleccion de tèxte +pdfjs-cursor-text-select-tool-button-label = Aisina de seleccion de tèxte +pdfjs-cursor-hand-tool-button = + .title = Activar l’aisina man +pdfjs-cursor-hand-tool-button-label = Aisina man +pdfjs-scroll-page-button = + .title = Activar lo defilament per pagina +pdfjs-scroll-page-button-label = Defilament per pagina +pdfjs-scroll-vertical-button = + .title = Utilizar lo defilament vertical +pdfjs-scroll-vertical-button-label = Defilament vertical +pdfjs-scroll-horizontal-button = + .title = Utilizar lo defilament orizontal +pdfjs-scroll-horizontal-button-label = Defilament orizontal +pdfjs-scroll-wrapped-button = + .title = Activar lo defilament continú +pdfjs-scroll-wrapped-button-label = Defilament continú +pdfjs-spread-none-button = + .title = Agropar pas las paginas doas a doas +pdfjs-spread-none-button-label = Una sola pagina +pdfjs-spread-odd-button = + .title = Mostrar doas paginas en començant per las paginas imparas a esquèrra +pdfjs-spread-odd-button-label = Dobla pagina, impara a drecha +pdfjs-spread-even-button = + .title = Mostrar doas paginas en començant per las paginas paras a esquèrra +pdfjs-spread-even-button-label = Dobla pagina, para a drecha + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Proprietats del document… +pdfjs-document-properties-button-label = Proprietats del document… +pdfjs-document-properties-file-name = Nom del fichièr : +pdfjs-document-properties-file-size = Talha del fichièr : +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } Ko ({ $size_b } octets) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } Mo ({ $size_b } octets) +pdfjs-document-properties-title = Títol : +pdfjs-document-properties-author = Autor : +pdfjs-document-properties-subject = Subjècte : +pdfjs-document-properties-keywords = Mots claus : +pdfjs-document-properties-creation-date = Data de creacion : +pdfjs-document-properties-modification-date = Data de modificacion : +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, a { $time } +pdfjs-document-properties-creator = Creator : +pdfjs-document-properties-producer = Aisina de conversion PDF : +pdfjs-document-properties-version = Version PDF : +pdfjs-document-properties-page-count = Nombre de paginas : +pdfjs-document-properties-page-size = Talha de la pagina : +pdfjs-document-properties-page-size-unit-inches = in +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = retrach +pdfjs-document-properties-page-size-orientation-landscape = païsatge +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Letra +pdfjs-document-properties-page-size-name-legal = Document juridic + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Vista web rapida : +pdfjs-document-properties-linearized-yes = Òc +pdfjs-document-properties-linearized-no = Non +pdfjs-document-properties-close-button = Tampar + +## Print + +pdfjs-print-progress-message = Preparacion del document per l’impression… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Anullar +pdfjs-printing-not-supported = Atencion : l'impression es pas complètament gerida per aqueste navegador. +pdfjs-printing-not-ready = Atencion : lo PDF es pas entièrament cargat per lo poder imprimir. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Afichar/amagar lo panèl lateral +pdfjs-toggle-sidebar-notification-button = + .title = Afichar/amagar lo panèl lateral (lo document conten esquèmas/pèças juntas/calques) +pdfjs-toggle-sidebar-button-label = Afichar/amagar lo panèl lateral +pdfjs-document-outline-button = + .title = Mostrar los esquèmas del document (dobleclicar per espandre/reduire totes los elements) +pdfjs-document-outline-button-label = Marcapaginas del document +pdfjs-attachments-button = + .title = Visualizar las pèças juntas +pdfjs-attachments-button-label = Pèças juntas +pdfjs-layers-button = + .title = Afichar los calques (doble-clicar per reïnicializar totes los calques a l’estat per defaut) +pdfjs-layers-button-label = Calques +pdfjs-thumbs-button = + .title = Afichar las vinhetas +pdfjs-thumbs-button-label = Vinhetas +pdfjs-current-outline-item-button = + .title = Trobar l’element de plan actual +pdfjs-current-outline-item-button-label = Element de plan actual +pdfjs-findbar-button = + .title = Cercar dins lo document +pdfjs-findbar-button-label = Recercar +pdfjs-additional-layers = Calques suplementaris + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Pagina { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Vinheta de la pagina { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Recercar + .placeholder = Cercar dins lo document… +pdfjs-find-previous-button = + .title = Tròba l'ocurréncia precedenta de la frasa +pdfjs-find-previous-button-label = Precedent +pdfjs-find-next-button = + .title = Tròba l'ocurréncia venenta de la frasa +pdfjs-find-next-button-label = Seguent +pdfjs-find-highlight-checkbox = Suslinhar tot +pdfjs-find-match-case-checkbox-label = Respectar la cassa +pdfjs-find-match-diacritics-checkbox-label = Respectar los diacritics +pdfjs-find-entire-word-checkbox-label = Mots entièrs +pdfjs-find-reached-top = Naut de la pagina atenh, perseguida del bas +pdfjs-find-reached-bottom = Bas de la pagina atench, perseguida al començament +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] Ocurréncia { $current } de { $total } + *[other] Ocurréncia { $current } de { $total } + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] Mai de { $limit } ocurréncia + *[other] Mai de { $limit } ocurréncias + } +pdfjs-find-not-found = Frasa pas trobada + +## Predefined zoom values + +pdfjs-page-scale-width = Largor plena +pdfjs-page-scale-fit = Pagina entièra +pdfjs-page-scale-auto = Zoom automatic +pdfjs-page-scale-actual = Talha vertadièra +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Pagina { $page } + +## Loading indicator messages + +pdfjs-loading-error = Una error s'es producha pendent lo cargament del fichièr PDF. +pdfjs-invalid-file-error = Fichièr PDF invalid o corromput. +pdfjs-missing-file-error = Fichièr PDF mancant. +pdfjs-unexpected-response-error = Responsa de servidor imprevista. +pdfjs-rendering-error = Una error s'es producha pendent l'afichatge de la pagina. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date } a { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [Anotacion { $type }] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Picatz lo senhal per dobrir aqueste fichièr PDF. +pdfjs-password-invalid = Senhal incorrècte. Tornatz ensajar. +pdfjs-password-ok-button = D'acòrdi +pdfjs-password-cancel-button = Anullar +pdfjs-web-fonts-disabled = Las polissas web son desactivadas : impossible d'utilizar las polissas integradas al PDF. + +## Editing + +pdfjs-editor-free-text-button = + .title = Tèxte +pdfjs-editor-free-text-button-label = Tèxte +pdfjs-editor-ink-button = + .title = Dessenhar +pdfjs-editor-ink-button-label = Dessenhar +pdfjs-editor-stamp-button = + .title = Apondre o modificar d’imatges +pdfjs-editor-stamp-button-label = Apondre o modificar d’imatges +pdfjs-editor-highlight-button = + .title = Subrelinhar +pdfjs-editor-highlight-button-label = Subrelinhar +pdfjs-highlight-floating-button1 = + .title = Subrelinhar + .aria-label = Subrelinhar +pdfjs-highlight-floating-button-label = Subrelinhar + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Levar lo dessenh +pdfjs-editor-remove-freetext-button = + .title = Suprimir lo tèxte +pdfjs-editor-remove-stamp-button = + .title = Suprimir l’imatge +pdfjs-editor-remove-highlight-button = + .title = Levar lo suslinhatge + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Color +pdfjs-editor-free-text-size-input = Talha +pdfjs-editor-ink-color-input = Color +pdfjs-editor-ink-thickness-input = Espessor +pdfjs-editor-ink-opacity-input = Opacitat +pdfjs-editor-stamp-add-image-button = + .title = Apondre imatge +pdfjs-editor-stamp-add-image-button-label = Apondre imatge +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Espessor +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = Editor de tèxte + .default-content = Començatz de picar… +pdfjs-free-text = + .aria-label = Editor de tèxte +pdfjs-free-text-default-content = Començatz d’escriure… +pdfjs-ink = + .aria-label = Editor de dessenh +pdfjs-ink-canvas = + .aria-label = Imatge creat per l’utilizaire + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = Tèxt alternatiu +pdfjs-editor-alt-text-edit-button-label = Modificar lo tèxt alternatiu +pdfjs-editor-alt-text-dialog-label = Causir una opcion +pdfjs-editor-alt-text-add-description-label = Apondre una descripcion +pdfjs-editor-alt-text-cancel-button = Anullar +pdfjs-editor-alt-text-save-button = Enregistrar + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Color de suslinhatge +pdfjs-editor-colorpicker-button = + .title = Cambiar de color +pdfjs-editor-colorpicker-dropdown = + .aria-label = Causida de colors +pdfjs-editor-colorpicker-yellow = + .title = Jaune +pdfjs-editor-colorpicker-green = + .title = Verd +pdfjs-editor-colorpicker-blue = + .title = Blau +pdfjs-editor-colorpicker-pink = + .title = Ròse +pdfjs-editor-colorpicker-red = + .title = Roge + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = O afichar tot +pdfjs-editor-highlight-show-all-button = + .title = O afichar tot + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +pdfjs-editor-new-alt-text-error-close-button = Tampar + +## Image alt-text settings + +pdfjs-editor-alt-text-settings-automatic-title = Tèxte alternatiu automatic +pdfjs-editor-alt-text-settings-create-model-button-label = Crear un tèxte alternatiu automaticament +pdfjs-editor-alt-text-settings-delete-model-button = Suprimir +pdfjs-editor-alt-text-settings-download-model-button = Telecargar +pdfjs-editor-alt-text-settings-downloading-model-button = Telecargament… +pdfjs-editor-alt-text-settings-editor-title = Editor de tèxte alternatiu +pdfjs-editor-alt-text-settings-close-button = Tampar + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-freetext = Tèxte suprimit +pdfjs-editor-undo-bar-message-ink = Dessenh suprimit +pdfjs-editor-undo-bar-message-stamp = Imatge suprimit +pdfjs-editor-undo-bar-undo-button = + .title = Anullar +pdfjs-editor-undo-bar-undo-button-label = Anullar +pdfjs-editor-undo-bar-close-button = + .title = Tampar +pdfjs-editor-undo-bar-close-button-label = Tampar diff --git a/public/pdfjs/web/locale/pa-IN/viewer.ftl b/public/pdfjs/web/locale/pa-IN/viewer.ftl new file mode 100644 index 0000000..10a6112 --- /dev/null +++ b/public/pdfjs/web/locale/pa-IN/viewer.ftl @@ -0,0 +1,515 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = ਪਿਛਲਾ ਸਫ਼ਾ +pdfjs-previous-button-label = ਪਿੱਛੇ +pdfjs-next-button = + .title = ਅਗਲਾ ਸਫ਼ਾ +pdfjs-next-button-label = ਅੱਗੇ +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = ਸਫ਼ਾ +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = { $pagesCount } ਵਿੱਚੋਂ +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = { $pagesCount }) ਵਿੱਚੋਂ ({ $pageNumber } +pdfjs-zoom-out-button = + .title = ਜ਼ੂਮ ਆਉਟ +pdfjs-zoom-out-button-label = ਜ਼ੂਮ ਆਉਟ +pdfjs-zoom-in-button = + .title = ਜ਼ੂਮ ਇਨ +pdfjs-zoom-in-button-label = ਜ਼ੂਮ ਇਨ +pdfjs-zoom-select = + .title = ਜ਼ੂਨ +pdfjs-presentation-mode-button = + .title = ਪਰਿਜੈਂਟੇਸ਼ਨ ਮੋਡ ਵਿੱਚ ਜਾਓ +pdfjs-presentation-mode-button-label = ਪਰਿਜੈਂਟੇਸ਼ਨ ਮੋਡ +pdfjs-open-file-button = + .title = ਫਾਈਲ ਨੂੰ ਖੋਲ੍ਹੋ +pdfjs-open-file-button-label = ਖੋਲ੍ਹੋ +pdfjs-print-button = + .title = ਪਰਿੰਟ +pdfjs-print-button-label = ਪਰਿੰਟ +pdfjs-save-button = + .title = ਸੰਭਾਲੋ +pdfjs-save-button-label = ਸੰਭਾਲੋ +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = ਡਾਊਨਲੋਡ +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = ਡਾਊਨਲੋਡ +pdfjs-bookmark-button = + .title = ਮੌਜੂਦਾ ਸਫ਼਼ਾ (ਮੌਜੂਦਾ ਸਫ਼ੇ ਤੋਂ URL ਵੇਖੋ) +pdfjs-bookmark-button-label = ਮੌਜੂਦਾ ਸਫ਼਼ਾ + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = ਟੂਲ +pdfjs-tools-button-label = ਟੂਲ +pdfjs-first-page-button = + .title = ਪਹਿਲੇ ਸਫ਼ੇ ਉੱਤੇ ਜਾਓ +pdfjs-first-page-button-label = ਪਹਿਲੇ ਸਫ਼ੇ ਉੱਤੇ ਜਾਓ +pdfjs-last-page-button = + .title = ਆਖਰੀ ਸਫ਼ੇ ਉੱਤੇ ਜਾਓ +pdfjs-last-page-button-label = ਆਖਰੀ ਸਫ਼ੇ ਉੱਤੇ ਜਾਓ +pdfjs-page-rotate-cw-button = + .title = ਸੱਜੇ ਦਾਅ ਘੁੰਮਾਓ +pdfjs-page-rotate-cw-button-label = ਸੱਜੇ ਦਾਅ ਘੁੰਮਾਓ +pdfjs-page-rotate-ccw-button = + .title = ਖੱਬੇ ਦਾਅ ਘੁੰਮਾਓ +pdfjs-page-rotate-ccw-button-label = ਖੱਬੇ ਦਾਅ ਘੁੰਮਾਓ +pdfjs-cursor-text-select-tool-button = + .title = ਲਿਖਤ ਚੋਣ ਟੂਲ ਸਮਰੱਥ ਕਰੋ +pdfjs-cursor-text-select-tool-button-label = ਲਿਖਤ ਚੋਣ ਟੂਲ +pdfjs-cursor-hand-tool-button = + .title = ਹੱਥ ਟੂਲ ਸਮਰੱਥ ਕਰੋ +pdfjs-cursor-hand-tool-button-label = ਹੱਥ ਟੂਲ +pdfjs-scroll-page-button = + .title = ਸਫ਼ਾ ਖਿਸਕਾਉਣ ਨੂੰ ਵਰਤੋਂ +pdfjs-scroll-page-button-label = ਸਫ਼ਾ ਖਿਸਕਾਉਣਾ +pdfjs-scroll-vertical-button = + .title = ਖੜ੍ਹਵੇਂ ਸਕਰਾਉਣ ਨੂੰ ਵਰਤੋਂ +pdfjs-scroll-vertical-button-label = ਖੜ੍ਹਵਾਂ ਸਰਕਾਉਣਾ +pdfjs-scroll-horizontal-button = + .title = ਲੇਟਵੇਂ ਸਰਕਾਉਣ ਨੂੰ ਵਰਤੋਂ +pdfjs-scroll-horizontal-button-label = ਲੇਟਵਾਂ ਸਰਕਾਉਣਾ +pdfjs-scroll-wrapped-button = + .title = ਸਮੇਟੇ ਸਰਕਾਉਣ ਨੂੰ ਵਰਤੋਂ +pdfjs-scroll-wrapped-button-label = ਸਮੇਟਿਆ ਸਰਕਾਉਣਾ +pdfjs-spread-none-button = + .title = ਸਫ਼ਾ ਫੈਲਾਅ ਵਿੱਚ ਸ਼ਾਮਲ ਨਾ ਹੋਵੋ +pdfjs-spread-none-button-label = ਕੋਈ ਫੈਲਾਅ ਨਹੀਂ +pdfjs-spread-odd-button = + .title = ਟਾਂਕ ਅੰਕ ਵਾਲੇ ਸਫ਼ਿਆਂ ਨਾਲ ਸ਼ੁਰੂ ਹੋਣ ਵਾਲੇ ਸਫਿਆਂ ਵਿੱਚ ਸ਼ਾਮਲ ਹੋਵੋ +pdfjs-spread-odd-button-label = ਟਾਂਕ ਫੈਲਾਅ +pdfjs-spread-even-button = + .title = ਜਿਸਤ ਅੰਕ ਵਾਲੇ ਸਫ਼ਿਆਂ ਨਾਲ ਸ਼ੁਰੂ ਹੋਣ ਵਾਲੇ ਸਫਿਆਂ ਵਿੱਚ ਸ਼ਾਮਲ ਹੋਵੋ +pdfjs-spread-even-button-label = ਜਿਸਤ ਫੈਲਾਅ + +## Document properties dialog + +pdfjs-document-properties-button = + .title = …ਦਸਤਾਵੇਜ਼ ਦੀ ਵਿਸ਼ੇਸ਼ਤਾ +pdfjs-document-properties-button-label = …ਦਸਤਾਵੇਜ਼ ਦੀ ਵਿਸ਼ੇਸ਼ਤਾ +pdfjs-document-properties-file-name = ਫਾਈਲ ਦਾ ਨਾਂ: +pdfjs-document-properties-file-size = ਫਾਈਲ ਦਾ ਆਕਾਰ: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } ਬਾਈਟ) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } ਬਾਈਟ) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } ਬਾਈਟ) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } ਬਾਈਟ) +pdfjs-document-properties-title = ਟਾਈਟਲ: +pdfjs-document-properties-author = ਲੇਖਕ: +pdfjs-document-properties-subject = ਵਿਸ਼ਾ: +pdfjs-document-properties-keywords = ਸ਼ਬਦ: +pdfjs-document-properties-creation-date = ਬਣਾਉਣ ਦੀ ਮਿਤੀ: +pdfjs-document-properties-modification-date = ਸੋਧ ਦੀ ਮਿਤੀ: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = ਨਿਰਮਾਤਾ: +pdfjs-document-properties-producer = PDF ਪ੍ਰੋਡਿਊਸਰ: +pdfjs-document-properties-version = PDF ਵਰਜਨ: +pdfjs-document-properties-page-count = ਸਫ਼ੇ ਦੀ ਗਿਣਤੀ: +pdfjs-document-properties-page-size = ਸਫ਼ਾ ਆਕਾਰ: +pdfjs-document-properties-page-size-unit-inches = ਇੰਚ +pdfjs-document-properties-page-size-unit-millimeters = ਮਿਮੀ +pdfjs-document-properties-page-size-orientation-portrait = ਪੋਰਟਰੇਟ +pdfjs-document-properties-page-size-orientation-landscape = ਲੈਂਡਸਕੇਪ +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = ਲੈਟਰ +pdfjs-document-properties-page-size-name-legal = ਕਨੂੰਨੀ + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = ਤੇਜ਼ ਵੈੱਬ ਝਲਕ: +pdfjs-document-properties-linearized-yes = ਹਾਂ +pdfjs-document-properties-linearized-no = ਨਹੀਂ +pdfjs-document-properties-close-button = ਬੰਦ ਕਰੋ + +## Print + +pdfjs-print-progress-message = …ਪਰਿੰਟ ਕਰਨ ਲਈ ਦਸਤਾਵੇਜ਼ ਨੂੰ ਤਿਆਰ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = ਰੱਦ ਕਰੋ +pdfjs-printing-not-supported = ਸਾਵਧਾਨ: ਇਹ ਬਰਾਊਜ਼ਰ ਪਰਿੰਟ ਕਰਨ ਲਈ ਪੂਰੀ ਤਰ੍ਹਾਂ ਸਹਾਇਕ ਨਹੀਂ ਹੈ। +pdfjs-printing-not-ready = ਸਾਵਧਾਨ: PDF ਨੂੰ ਪਰਿੰਟ ਕਰਨ ਲਈ ਪੂਰੀ ਤਰ੍ਹਾਂ ਲੋਡ ਨਹੀਂ ਹੈ। + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = ਬਾਹੀ ਬਦਲੋ +pdfjs-toggle-sidebar-notification-button = + .title = ਬਾਹੀ ਨੂੰ ਬਦਲੋ (ਦਸਤਾਵੇਜ਼ ਖਾਕਾ/ਅਟੈਚਮੈਂਟ/ਪਰਤਾਂ ਰੱਖਦਾ ਹੈ) +pdfjs-toggle-sidebar-button-label = ਬਾਹੀ ਬਦਲੋ +pdfjs-document-outline-button = + .title = ਦਸਤਾਵੇਜ਼ ਖਾਕਾ ਦਿਖਾਓ (ਸਾਰੀਆਂ ਆਈਟਮਾਂ ਨੂੰ ਫੈਲਾਉਣ/ਸਮੇਟਣ ਲਈ ਦੋ ਵਾਰ ਕਲਿੱਕ ਕਰੋ) +pdfjs-document-outline-button-label = ਦਸਤਾਵੇਜ਼ ਖਾਕਾ +pdfjs-attachments-button = + .title = ਅਟੈਚਮੈਂਟ ਵੇਖਾਓ +pdfjs-attachments-button-label = ਅਟੈਚਮੈਂਟਾਂ +pdfjs-layers-button = + .title = ਪਰਤਾਂ ਵੇਖਾਓ (ਸਾਰੀਆਂ ਪਰਤਾਂ ਨੂੰ ਮੂਲ ਹਾਲਤ ਉੱਤੇ ਮੁੜ-ਸੈੱਟ ਕਰਨ ਲਈ ਦੋ ਵਾਰ ਕਲਿੱਕ ਕਰੋ) +pdfjs-layers-button-label = ਪਰਤਾਂ +pdfjs-thumbs-button = + .title = ਥੰਮਨੇਲ ਨੂੰ ਵੇਖਾਓ +pdfjs-thumbs-button-label = ਥੰਮਨੇਲ +pdfjs-current-outline-item-button = + .title = ਮੌੌਜੂਦਾ ਖਾਕਾ ਚੀਜ਼ ਲੱਭੋ +pdfjs-current-outline-item-button-label = ਮੌਜੂਦਾ ਖਾਕਾ ਚੀਜ਼ +pdfjs-findbar-button = + .title = ਦਸਤਾਵੇਜ਼ ਵਿੱਚ ਲੱਭੋ +pdfjs-findbar-button-label = ਲੱਭੋ +pdfjs-additional-layers = ਵਾਧੂ ਪਰਤਾਂ + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = ਸਫ਼ਾ { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = { $page } ਸਫ਼ੇ ਦਾ ਥੰਮਨੇਲ + +## Find panel button title and messages + +pdfjs-find-input = + .title = ਲੱਭੋ + .placeholder = …ਦਸਤਾਵੇਜ਼ 'ਚ ਲੱਭੋ +pdfjs-find-previous-button = + .title = ਵਾਕ ਦੀ ਪਿਛਲੀ ਮੌਜੂਦਗੀ ਲੱਭੋ +pdfjs-find-previous-button-label = ਪਿੱਛੇ +pdfjs-find-next-button = + .title = ਵਾਕ ਦੀ ਅਗਲੀ ਮੌਜੂਦਗੀ ਲੱਭੋ +pdfjs-find-next-button-label = ਅੱਗੇ +pdfjs-find-highlight-checkbox = ਸਭ ਉਭਾਰੋ +pdfjs-find-match-case-checkbox-label = ਅੱਖਰ ਆਕਾਰ ਨੂੰ ਮਿਲਾਉ +pdfjs-find-match-diacritics-checkbox-label = ਭੇਦਸੂਚਕ ਮੇਲ +pdfjs-find-entire-word-checkbox-label = ਪੂਰੇ ਸ਼ਬਦ +pdfjs-find-reached-top = ਦਸਤਾਵੇਜ਼ ਦੇ ਉੱਤੇ ਆ ਗਏ ਹਾਂ, ਥੱਲੇ ਤੋਂ ਜਾਰੀ ਰੱਖਿਆ ਹੈ +pdfjs-find-reached-bottom = ਦਸਤਾਵੇਜ਼ ਦੇ ਅੰਤ ਉੱਤੇ ਆ ਗਏ ਹਾਂ, ਉੱਤੇ ਤੋਂ ਜਾਰੀ ਰੱਖਿਆ ਹੈ +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] { $total } ਵਿੱਚੋਂ { $current } ਮੇਲ + *[other] { $total } ਵਿੱਚੋਂ { $current } ਮੇਲ + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] { $limit } ਤੋਂ ਵੱਧ ਮੇਲ + *[other] { $limit } ਤੋਂ ਵੱਧ ਮੇਲ + } +pdfjs-find-not-found = ਵਾਕ ਨਹੀਂ ਲੱਭਿਆ + +## Predefined zoom values + +pdfjs-page-scale-width = ਸਫ਼ੇ ਦੀ ਚੌੜਾਈ +pdfjs-page-scale-fit = ਸਫ਼ਾ ਫਿੱਟ +pdfjs-page-scale-auto = ਆਟੋਮੈਟਿਕ ਜ਼ੂਮ ਕਰੋ +pdfjs-page-scale-actual = ਆਟੋਮੈਟਿਕ ਆਕਾਰ +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = ਸਫ਼ਾ { $page } + +## Loading indicator messages + +pdfjs-loading-error = PDF ਲੋਡ ਕਰਨ ਦੇ ਦੌਰਾਨ ਗਲਤੀ ਆਈ ਹੈ। +pdfjs-invalid-file-error = ਗਲਤ ਜਾਂ ਨਿਕਾਰਾ PDF ਫਾਈਲ ਹੈ। +pdfjs-missing-file-error = ਨਾ-ਮੌਜੂਦ PDF ਫਾਈਲ। +pdfjs-unexpected-response-error = ਅਣਜਾਣ ਸਰਵਰ ਜਵਾਬ। +pdfjs-rendering-error = ਸਫ਼ਾ ਰੈਡਰ ਕਰਨ ਦੇ ਦੌਰਾਨ ਗਲਤੀ ਆਈ ਹੈ। + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } ਵਿਆਖਿਆ] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = ਇਹ PDF ਫਾਈਲ ਨੂੰ ਖੋਲ੍ਹਣ ਲਈ ਪਾਸਵਰਡ ਦਿਉ। +pdfjs-password-invalid = ਗਲਤ ਪਾਸਵਰਡ। ਫੇਰ ਕੋਸ਼ਿਸ਼ ਕਰੋ ਜੀ। +pdfjs-password-ok-button = ਠੀਕ ਹੈ +pdfjs-password-cancel-button = ਰੱਦ ਕਰੋ +pdfjs-web-fonts-disabled = ਵੈਬ ਫੋਂਟ ਬੰਦ ਹਨ: ਇੰਬੈਡ PDF ਫੋਂਟ ਨੂੰ ਵਰਤਣ ਲਈ ਅਸਮਰੱਥ ਹੈ। + +## Editing + +pdfjs-editor-free-text-button = + .title = ਲਿਖਤ +pdfjs-editor-free-text-button-label = ਲਿਖਤ +pdfjs-editor-ink-button = + .title = ਵਾਹੋ +pdfjs-editor-ink-button-label = ਵਾਹੋ +pdfjs-editor-stamp-button = + .title = ਚਿੱਤਰ ਜੋੜੋ ਜਾਂ ਸੋਧੋ +pdfjs-editor-stamp-button-label = ਚਿੱਤਰ ਜੋੜੋ ਜਾਂ ਸੋਧੋ +pdfjs-editor-highlight-button = + .title = ਹਾਈਲਾਈਟ +pdfjs-editor-highlight-button-label = ਹਾਈਲਾਈਟ +pdfjs-highlight-floating-button1 = + .title = ਹਾਈਲਾਈਟ + .aria-label = ਹਾਈਲਾਈਟ +pdfjs-highlight-floating-button-label = ਹਾਈਲਾਈਟ + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = ਡਰਾਇੰਗ ਨੂੰ ਹਟਾਓ +pdfjs-editor-remove-freetext-button = + .title = ਲਿਖਤ ਨੂੰ ਹਟਾਓ +pdfjs-editor-remove-stamp-button = + .title = ਚਿੱਤਰ ਨੂੰ ਹਟਾਓ +pdfjs-editor-remove-highlight-button = + .title = ਹਾਈਲਾਈਟ ਨੂੰ ਹਟਾਓ + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = ਰੰਗ +pdfjs-editor-free-text-size-input = ਆਕਾਰ +pdfjs-editor-ink-color-input = ਰੰਗ +pdfjs-editor-ink-thickness-input = ਮੋਟਾਈ +pdfjs-editor-ink-opacity-input = ਧੁੰਦਲਾਪਨ +pdfjs-editor-stamp-add-image-button = + .title = ਚਿੱਤਰ ਜੋੜੋ +pdfjs-editor-stamp-add-image-button-label = ਚਿੱਤਰ ਜੋੜੋ +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = ਮੋਟਾਈ +pdfjs-editor-free-highlight-thickness-title = + .title = ਚੀਜ਼ਾਂ ਨੂੰ ਹੋਰ ਲਿਖਤਾਂ ਤੋਂ ਉਘਾੜਨ ਸਮੇਂ ਮੋਟਾਈ ਨੂੰ ਬਦਲੋ +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = ਲਿਖਤ ਐਡੀਟਰ + .default-content = …ਲਿਖਣਾ ਸ਼ੁਰੂ ਕਰੋ +pdfjs-free-text = + .aria-label = ਲਿਖਤ ਐਡੀਟਰ +pdfjs-free-text-default-content = …ਲਿਖਣਾ ਸ਼ੁਰੂ ਕਰੋ +pdfjs-ink = + .aria-label = ਵਹਾਉਣ ਐਡੀਟਰ +pdfjs-ink-canvas = + .aria-label = ਵਰਤੋਂਕਾਰ ਵਲੋਂ ਬਣਾਇਆ ਚਿੱਤਰ + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = ਬਦਲਵੀਂ ਲਿਖਤ +pdfjs-editor-alt-text-edit-button = + .aria-label = ਬਦਲਵੀ ਲਿਖਤ ਨੂੰ ਸੋਧੋ +pdfjs-editor-alt-text-edit-button-label = ਬਦਲਵੀ ਲਿਖਤ ਨੂੰ ਸੋਧੋ +pdfjs-editor-alt-text-dialog-label = ਚੋਣ ਕਰੋ +pdfjs-editor-alt-text-dialog-description = ਚਿੱਤਰ ਨਾ ਦਿੱਸਣ ਜਾਂ ਲੋਡ ਨਾ ਹੋਣ ਦੀ ਹਾਲਤ ਵਿੱਚ Alt ਲਿਖਤ (ਬਦਲਵੀਂ ਲਿਖਤ) ਲੋਕਾਂ ਲਈ ਮਦਦਗਾਰ ਹੁੰਦੀ ਹੈ। +pdfjs-editor-alt-text-add-description-label = ਵਰਣਨ ਜੋੜੋ +pdfjs-editor-alt-text-add-description-description = 1-2 ਵਾਕ ਰੱਖੋ, ਜੋ ਕਿ ਵਿਸ਼ੇ, ਸੈਟਿੰਗ ਜਾਂ ਕਾਰਵਾਈਆਂ ਬਾਰੇ ਦਰਸਾਉਂਦੇ ਹੋਣ। +pdfjs-editor-alt-text-mark-decorative-label = ਸਜਾਵਟ ਵਜੋਂ ਨਿਸ਼ਾਨ ਲਾਇਆ +pdfjs-editor-alt-text-mark-decorative-description = ਇਸ ਨੂੰ ਸਜਾਵਟੀ ਚਿੱਤਰਾਂ ਲਈ ਵਰਤਿਆ ਜਾਂਦਾ ਹੈ ਜਿਵੇਂ ਕਿ ਹਾਸ਼ੀਆ ਜਾਂ ਵਾਟਰਮਾਰਕ ਆਦਿ। +pdfjs-editor-alt-text-cancel-button = ਰੱਦ ਕਰੋ +pdfjs-editor-alt-text-save-button = ਸੰਭਾਲੋ +pdfjs-editor-alt-text-decorative-tooltip = ਸਜਾਵਟ ਵਜੋਂ ਨਿਸ਼ਾਨ ਲਾਓ +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = ਮਿਸਾਲ ਵਜੋਂ, “ਗੱਭਰੂ ਭੋਜਨ ਲੈ ਕੇ ਮੇਜ਼ ਉੱਤੇ ਬੈਠਾ ਹੈ” +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = ਬਦਲਵੀਂ ਲਿਖਤ + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = ਉੱਤੇ ਖੱਬਾ ਕੋਨਾ — ਮੁੜ-ਆਕਾਰ ਕਰੋ +pdfjs-editor-resizer-label-top-middle = ਉੱਤੇ ਮੱਧ — ਮੁੜ-ਆਕਾਰ ਕਰੋ +pdfjs-editor-resizer-label-top-right = ਉੱਤੇ ਸੱਜਾ ਕੋਨਾ — ਮੁੜ-ਆਕਾਰ ਕਰੋ +pdfjs-editor-resizer-label-middle-right = ਮੱਧ ਸੱਜਾ — ਮੁੜ-ਆਕਾਰ ਕਰੋ +pdfjs-editor-resizer-label-bottom-right = ਹੇਠਾਂ ਸੱਜਾ ਕੋਨਾ — ਮੁੜ-ਆਕਾਰ ਕਰੋ +pdfjs-editor-resizer-label-bottom-middle = ਹੇਠਾਂ ਮੱਧ — ਮੁੜ-ਆਕਾਰ ਕਰੋ +pdfjs-editor-resizer-label-bottom-left = ਹੇਠਾਂ ਖੱਬਾ ਕੋਨਾ — ਮੁੜ-ਆਕਾਰ ਕਰੋ +pdfjs-editor-resizer-label-middle-left = ਮੱਧ ਖੱਬਾ — ਮੁੜ-ਆਕਾਰ ਕਰੋ +pdfjs-editor-resizer-top-left = + .aria-label = ਉੱਤੇ ਖੱਬਾ ਕੋਨਾ — ਮੁੜ-ਆਕਾਰ ਕਰੋ +pdfjs-editor-resizer-top-middle = + .aria-label = ਉੱਤੇ ਮੱਧ — ਮੁੜ-ਆਕਾਰ ਕਰੋ +pdfjs-editor-resizer-top-right = + .aria-label = ਉੱਤੇ ਸੱਜਾ ਕੋਨਾ — ਮੁੜ-ਆਕਾਰ ਕਰੋ +pdfjs-editor-resizer-middle-right = + .aria-label = ਮੱਧ ਸੱਜਾ — ਮੁੜ-ਆਕਾਰ ਕਰੋ +pdfjs-editor-resizer-bottom-right = + .aria-label = ਹੇਠਾਂ ਸੱਜਾ ਕੋਨਾ — ਮੁੜ-ਆਕਾਰ ਕਰੋ +pdfjs-editor-resizer-bottom-middle = + .aria-label = ਹੇਠਾਂ ਮੱਧ — ਮੁੜ-ਆਕਾਰ ਕਰੋ +pdfjs-editor-resizer-bottom-left = + .aria-label = ਹੇਠਾਂ ਖੱਬਾ ਕੋਨਾ — ਮੁੜ-ਆਕਾਰ ਕਰੋ +pdfjs-editor-resizer-middle-left = + .aria-label = ਮੱਧ ਖੱਬਾ — ਮੁੜ-ਆਕਾਰ ਕਰੋ + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = ਹਾਈਟਲਾਈਟ ਦਾ ਰੰਗ +pdfjs-editor-colorpicker-button = + .title = ਰੰਗ ਨੂੰ ਬਦਲੋ +pdfjs-editor-colorpicker-dropdown = + .aria-label = ਰੰਗ ਚੋਣਾਂ +pdfjs-editor-colorpicker-yellow = + .title = ਪੀਲਾ +pdfjs-editor-colorpicker-green = + .title = ਹਰਾ +pdfjs-editor-colorpicker-blue = + .title = ਨੀਲਾ +pdfjs-editor-colorpicker-pink = + .title = ਗੁਲਾਬੀ +pdfjs-editor-colorpicker-red = + .title = ਲਾਲ + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = ਸਭ ਵੇਖੋ +pdfjs-editor-highlight-show-all-button = + .title = ਸਭ ਵੇਖੋ + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = ਬਦਲਵੀਂ ਲਿਖਤ (ਚਿੱਤਰ ਦਾ ਵਰਣਨ) ਨੂੰ ਸੋਧੋ +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = ਬਦਲਵੀਂ ਲਿਖਤ (ਚਿੱਤਰ ਦਾ ਵਰਣਨ) ਨੂੰ ਜੋੜੋ +pdfjs-editor-new-alt-text-textarea = + .placeholder = …ਆਪਣਾ ਵਰਣਨਾ ਇੱਥੇ ਲਿਖੋ +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = ਲੋਕ, ਜੋ ਕਿ ਚਿੱਤਰ ਨਹੀਂ ਵੇਖ ਸਕਦੇ ਜਾਂ ਜਦ ਵੀ ਚਿੱਤਰਾਂ ਨੂੰ ਲੋਡ ਨਹੀਂ ਜਾ ਸਕਦਾ, ਉਸ ਲਈ ਛੋਟਾ ਵੇਰਵਾ ਦਿਓ। +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = ਇਹ ਬਦਲਵੀਂ ਲਿਖਤ ਆਪਣੇ-ਆਪ ਤਿਆਰ ਕੀਤੀ ਗਈ ਸੀ ਅਤੇ ਗਲਤ ਵੀ ਹੋ ਸਕਦੀ ਹੈ। +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = ਹੋਰ ਜਾਣੋ +pdfjs-editor-new-alt-text-create-automatically-button-label = ਬਲਦਵੀਂ ਲਿਖਤ ਆਪਣੇ-ਆਪ ਬਣਾਓ +pdfjs-editor-new-alt-text-not-now-button = ਹੁਣੇ ਨਹੀਂ +pdfjs-editor-new-alt-text-error-title = ਬਦਲਵੀਂ ਲਿਖਤ ਆਪਣੇ-ਆਪ ਬਣਾਈ ਨਹੀਂ ਜਾ ਸਕੀ +pdfjs-editor-new-alt-text-error-description = ਆਪਣਾ ਖੁਦ ਦੀ ਬਦਲਵੀਂ ਲਿਖਤ ਲਿਖੋ ਜਾਂ ਫੇਰ ਕੋਸ਼ਿਸ਼ ਕਰੋ। +pdfjs-editor-new-alt-text-error-close-button = ਬੰਦ ਕਰੋ +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = ਬਦਲਵਾਂ ਲਿਖਤ AI ਮਾਡਲ ਡਾਊਨਲੋਡ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ ({ $totalSize } MB ਵਿੱਚੋਂ { $downloadedSize }) + .aria-valuetext = ਬਦਲਵਾਂ ਲਿਖਤ AI ਮਾਡਲ ਡਾਊਨਲੋਡ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ ({ $totalSize } MB ਵਿੱਚੋਂ { $downloadedSize }) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = ਬਦਲਵੀਂ ਲਿਖਤ ਜੋੜੀ +pdfjs-editor-new-alt-text-added-button-label = ਬਦਲਵੀਂ ਲਿਖਤ ਜੋੜੀ +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = ਬਦਲਵਾਂ ਲਿਖਤ ਗੁੰਮ ਹੈ +pdfjs-editor-new-alt-text-missing-button-label = ਬਦਲਵਾਂ ਲਿਖਤ ਗੁੰਮ ਹੈ +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = ਬਦਲਵੀਂ ਲਿਖਤ ਦਾ ਰੀਵਿਊ ਕਰੋ +pdfjs-editor-new-alt-text-to-review-button-label = ਬਦਲਵੀਂ ਲਿਖਤ ਦਾ ਰੀਵਿਊ ਕਰੋ +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = ਆਪਣੇ-ਆਪ ਬਣਾਇਆ: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = ਚਿੱਤਰ ਬਦਲਵੀਂ ਲਿਖਤ ਦੀਆਂ ਸੈਟਿੰਗਾਂ +pdfjs-image-alt-text-settings-button-label = ਚਿੱਤਰ ਬਦਲਵੀਂ ਲਿਖਤ ਦੀਆਂ ਸੈਟਿੰਗਾਂ +pdfjs-editor-alt-text-settings-dialog-label = ਚਿੱਤਰ ਬਦਲਵੀਂ ਲਿਖਤ ਦੀਆਂ ਸੈਟਿੰਗਾਂ +pdfjs-editor-alt-text-settings-automatic-title = ਆਟੋਮਮੈਟਿਕ ਬਦਲਵੀਂ ਲਿਖਤ +pdfjs-editor-alt-text-settings-create-model-button-label = ਬਲਦਵੀਂ ਲਿਖਤ ਆਪਣੇ-ਆਪ ਬਣਾਓ +pdfjs-editor-alt-text-settings-create-model-description = ਚਿੱਤਰ ਨਾ ਵੇਖ ਸਕਣ ਵਾਲੇ ਲੋਕਾਂ ਦੀ ਮਦਦ ਜਾਂ ਜਦ ਵੀ ਚਿੱਤਰਾਂ ਨੂੰ ਲੋਡ ਨਹੀਂ ਜਾ ਸਕਦਾ, ਉਸ ਲਈ ਛੋਟਾ ਵੇਰਵਾ ਦਿਓ। +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = ਬਦਲਵੀ ਲਿਖਤ ਲਈ AI ਮਾਡਲ ({ $totalSize } MB) +pdfjs-editor-alt-text-settings-ai-model-description = ਤੁਹਾਡੇ ਡਿਵਾਈਸ ਉੱਤੇ ਲੋਕਲ ਹੀ ਚੱਲਦਾ ਹੋਣ ਕਰਕੇ ਤੁਹਾਡਾ ਡਾਟਾ ਪ੍ਰਾਈਵੇਟ ਹੀ ਰਹਿੰਦਾ ਹੈ। ਆਟੋਮੈਟਿਕ ਬਦਲਵੀਂ ਲਿਖਤ ਲਈ ਚਾਹੀਦਾ ਹੈ। +pdfjs-editor-alt-text-settings-delete-model-button = ਹਟਾਓ +pdfjs-editor-alt-text-settings-download-model-button = ਡਾਊਨਲੋਡ +pdfjs-editor-alt-text-settings-downloading-model-button = …ਨੂੰ ਡਾਊਨਲੋਡ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ +pdfjs-editor-alt-text-settings-editor-title = ਬਦਲਵੀਂ ਲਿਖਤ ਐਡੀਟਰ +pdfjs-editor-alt-text-settings-show-dialog-button-label = ਜਦੋਂ ਵਿੱਚ ਚਿੱਤਰ ਜੋੜਿਆ ਜਾਵੇ ਤਾਂ ਫ਼ੌਰਨ ਬਦਲਵੀ ਲਿਖਤ ਸੰਪਾਦਕ ਵੇਖਾਓ +pdfjs-editor-alt-text-settings-show-dialog-description = ਤੁਹਾਡੀ ਮਦਦ ਕਰਦਾ ਹੈ ਕਿ ਤੁਹਾਡੇ ਸਾਰੇ ਚਿੱਤਰਾਂ ਲਈ ਬਦਲਵੀਂ ਲਿਖਤ ਮੌਜੂਦ ਹੋਵੇ। +pdfjs-editor-alt-text-settings-close-button = ਬੰਦ ਕਰੋ + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = ਹਾਈਲਾਈਟ ਨੂੰ ਹਟਾਇਆ ਗਿਆ +pdfjs-editor-undo-bar-message-freetext = ਲਿਖਤ ਨੂੰ ਹਟਾਇਆ ਗਿਆ +pdfjs-editor-undo-bar-message-ink = ਡਰਾਇੰਗ ਨੂੰ ਹਟਾਇਆ ਗਿਆ +pdfjs-editor-undo-bar-message-stamp = ਚਿੱਤਰ ਨੂੰ ਹਟਾਇਆ ਗਿਆ +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = + { $count -> + [one] { $count } ਵਿਆਖਿਆ ਨੂੰ ਹਟਾਇਆ + *[other] { $count } ਵਿਆਖਿਆਵਾਂ ਨੂੰ ਹਟਾਇਆ + } +pdfjs-editor-undo-bar-undo-button = + .title = ਵਾਪਸ +pdfjs-editor-undo-bar-undo-button-label = ਵਾਪਸ +pdfjs-editor-undo-bar-close-button = + .title = ਬੰਦ ਕਰੋ +pdfjs-editor-undo-bar-close-button-label = ਬੰਦ ਕਰੋ diff --git a/public/pdfjs/web/locale/pl/viewer.ftl b/public/pdfjs/web/locale/pl/viewer.ftl new file mode 100644 index 0000000..07f9416 --- /dev/null +++ b/public/pdfjs/web/locale/pl/viewer.ftl @@ -0,0 +1,518 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Poprzednia strona +pdfjs-previous-button-label = Poprzednia +pdfjs-next-button = + .title = Następna strona +pdfjs-next-button-label = Następna +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Strona +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = z { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } z { $pagesCount }) +pdfjs-zoom-out-button = + .title = Pomniejsz +pdfjs-zoom-out-button-label = Pomniejsz +pdfjs-zoom-in-button = + .title = Powiększ +pdfjs-zoom-in-button-label = Powiększ +pdfjs-zoom-select = + .title = Skala +pdfjs-presentation-mode-button = + .title = Przełącz na tryb prezentacji +pdfjs-presentation-mode-button-label = Tryb prezentacji +pdfjs-open-file-button = + .title = Otwórz plik +pdfjs-open-file-button-label = Otwórz +pdfjs-print-button = + .title = Drukuj +pdfjs-print-button-label = Drukuj +pdfjs-save-button = + .title = Zapisz +pdfjs-save-button-label = Zapisz +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Pobierz +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Pobierz +pdfjs-bookmark-button = + .title = Bieżąca strona (adres do otwarcia na bieżącej stronie) +pdfjs-bookmark-button-label = Bieżąca strona + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Narzędzia +pdfjs-tools-button-label = Narzędzia +pdfjs-first-page-button = + .title = Przejdź do pierwszej strony +pdfjs-first-page-button-label = Przejdź do pierwszej strony +pdfjs-last-page-button = + .title = Przejdź do ostatniej strony +pdfjs-last-page-button-label = Przejdź do ostatniej strony +pdfjs-page-rotate-cw-button = + .title = Obróć zgodnie z ruchem wskazówek zegara +pdfjs-page-rotate-cw-button-label = Obróć zgodnie z ruchem wskazówek zegara +pdfjs-page-rotate-ccw-button = + .title = Obróć przeciwnie do ruchu wskazówek zegara +pdfjs-page-rotate-ccw-button-label = Obróć przeciwnie do ruchu wskazówek zegara +pdfjs-cursor-text-select-tool-button = + .title = Włącz narzędzie zaznaczania tekstu +pdfjs-cursor-text-select-tool-button-label = Narzędzie zaznaczania tekstu +pdfjs-cursor-hand-tool-button = + .title = Włącz narzędzie rączka +pdfjs-cursor-hand-tool-button-label = Narzędzie rączka +pdfjs-scroll-page-button = + .title = Przewijaj strony +pdfjs-scroll-page-button-label = Przewijanie stron +pdfjs-scroll-vertical-button = + .title = Przewijaj dokument w pionie +pdfjs-scroll-vertical-button-label = Przewijanie pionowe +pdfjs-scroll-horizontal-button = + .title = Przewijaj dokument w poziomie +pdfjs-scroll-horizontal-button-label = Przewijanie poziome +pdfjs-scroll-wrapped-button = + .title = Strony dokumentu wyświetlaj i przewijaj w kolumnach +pdfjs-scroll-wrapped-button-label = Widok dwóch stron +pdfjs-spread-none-button = + .title = Nie ustawiaj stron obok siebie +pdfjs-spread-none-button-label = Brak kolumn +pdfjs-spread-odd-button = + .title = Strony nieparzyste ustawiaj na lewo od parzystych +pdfjs-spread-odd-button-label = Nieparzyste po lewej +pdfjs-spread-even-button = + .title = Strony parzyste ustawiaj na lewo od nieparzystych +pdfjs-spread-even-button-label = Parzyste po lewej + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Właściwości dokumentu… +pdfjs-document-properties-button-label = Właściwości dokumentu… +pdfjs-document-properties-file-name = Nazwa pliku: +pdfjs-document-properties-file-size = Rozmiar pliku: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } B) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } B) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } B) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } B) +pdfjs-document-properties-title = Tytuł: +pdfjs-document-properties-author = Autor: +pdfjs-document-properties-subject = Temat: +pdfjs-document-properties-keywords = Słowa kluczowe: +pdfjs-document-properties-creation-date = Data utworzenia: +pdfjs-document-properties-modification-date = Data modyfikacji: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Utworzony przez: +pdfjs-document-properties-producer = PDF wyprodukowany przez: +pdfjs-document-properties-version = Wersja PDF: +pdfjs-document-properties-page-count = Liczba stron: +pdfjs-document-properties-page-size = Wymiary strony: +pdfjs-document-properties-page-size-unit-inches = in +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = pionowa +pdfjs-document-properties-page-size-orientation-landscape = pozioma +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = US Letter +pdfjs-document-properties-page-size-name-legal = US Legal + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width }×{ $height } { $unit } (orientacja { $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width }×{ $height } { $unit } ({ $name }, orientacja { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Szybki podgląd w Internecie: +pdfjs-document-properties-linearized-yes = tak +pdfjs-document-properties-linearized-no = nie +pdfjs-document-properties-close-button = Zamknij + +## Print + +pdfjs-print-progress-message = Przygotowywanie dokumentu do druku… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Anuluj +pdfjs-printing-not-supported = Ostrzeżenie: drukowanie nie jest w pełni obsługiwane przez tę przeglądarkę. +pdfjs-printing-not-ready = Ostrzeżenie: dokument PDF nie jest całkowicie wczytany, więc nie można go wydrukować. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Przełącz panel boczny +pdfjs-toggle-sidebar-notification-button = + .title = Przełącz panel boczny (dokument zawiera konspekt/załączniki/warstwy) +pdfjs-toggle-sidebar-button-label = Przełącz panel boczny +pdfjs-document-outline-button = + .title = Konspekt dokumentu (podwójne kliknięcie rozwija lub zwija wszystkie pozycje) +pdfjs-document-outline-button-label = Konspekt dokumentu +pdfjs-attachments-button = + .title = Załączniki +pdfjs-attachments-button-label = Załączniki +pdfjs-layers-button = + .title = Warstwy (podwójne kliknięcie przywraca wszystkie warstwy do stanu domyślnego) +pdfjs-layers-button-label = Warstwy +pdfjs-thumbs-button = + .title = Miniatury +pdfjs-thumbs-button-label = Miniatury +pdfjs-current-outline-item-button = + .title = Znajdź bieżący element konspektu +pdfjs-current-outline-item-button-label = Bieżący element konspektu +pdfjs-findbar-button = + .title = Znajdź w dokumencie +pdfjs-findbar-button-label = Znajdź +pdfjs-additional-layers = Dodatkowe warstwy + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = { $page }. strona +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Miniatura { $page }. strony + +## Find panel button title and messages + +pdfjs-find-input = + .title = Znajdź + .placeholder = Znajdź w dokumencie… +pdfjs-find-previous-button = + .title = Znajdź poprzednie wystąpienie tekstu +pdfjs-find-previous-button-label = Poprzednie +pdfjs-find-next-button = + .title = Znajdź następne wystąpienie tekstu +pdfjs-find-next-button-label = Następne +pdfjs-find-highlight-checkbox = Wyróżnianie wszystkich +pdfjs-find-match-case-checkbox-label = Rozróżnianie wielkości liter +pdfjs-find-match-diacritics-checkbox-label = Rozróżnianie liter diakrytyzowanych +pdfjs-find-entire-word-checkbox-label = Całe słowa +pdfjs-find-reached-top = Początek dokumentu. Wyszukiwanie od końca. +pdfjs-find-reached-bottom = Koniec dokumentu. Wyszukiwanie od początku. +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] { $current }. z { $total } trafienia + [few] { $current }. z { $total } trafień + *[many] { $current }. z { $total } trafień + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] Więcej niż { $limit } trafienie + [few] Więcej niż { $limit } trafienia + *[many] Więcej niż { $limit } trafień + } +pdfjs-find-not-found = Nie znaleziono tekstu + +## Predefined zoom values + +pdfjs-page-scale-width = Szerokość strony +pdfjs-page-scale-fit = Dopasowanie strony +pdfjs-page-scale-auto = Skala automatyczna +pdfjs-page-scale-actual = Rozmiar oryginalny +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = { $page }. strona + +## Loading indicator messages + +pdfjs-loading-error = Podczas wczytywania dokumentu PDF wystąpił błąd. +pdfjs-invalid-file-error = Nieprawidłowy lub uszkodzony plik PDF. +pdfjs-missing-file-error = Brak pliku PDF. +pdfjs-unexpected-response-error = Nieoczekiwana odpowiedź serwera. +pdfjs-rendering-error = Podczas renderowania strony wystąpił błąd. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [Przypis: { $type }] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Wprowadź hasło, aby otworzyć ten dokument PDF. +pdfjs-password-invalid = Nieprawidłowe hasło. Proszę spróbować ponownie. +pdfjs-password-ok-button = OK +pdfjs-password-cancel-button = Anuluj +pdfjs-web-fonts-disabled = Czcionki sieciowe są wyłączone: nie można użyć osadzonych czcionek PDF. + +## Editing + +pdfjs-editor-free-text-button = + .title = Tekst +pdfjs-editor-free-text-button-label = Tekst +pdfjs-editor-ink-button = + .title = Rysunek +pdfjs-editor-ink-button-label = Rysunek +pdfjs-editor-stamp-button = + .title = Dodaj lub edytuj obrazy +pdfjs-editor-stamp-button-label = Dodaj lub edytuj obrazy +pdfjs-editor-highlight-button = + .title = Wyróżnij +pdfjs-editor-highlight-button-label = Wyróżnij +pdfjs-highlight-floating-button1 = + .title = Wyróżnij + .aria-label = Wyróżnij +pdfjs-highlight-floating-button-label = Wyróżnij + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Usuń rysunek +pdfjs-editor-remove-freetext-button = + .title = Usuń tekst +pdfjs-editor-remove-stamp-button = + .title = Usuń obraz +pdfjs-editor-remove-highlight-button = + .title = Usuń wyróżnienie + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Kolor +pdfjs-editor-free-text-size-input = Rozmiar +pdfjs-editor-ink-color-input = Kolor +pdfjs-editor-ink-thickness-input = Grubość +pdfjs-editor-ink-opacity-input = Nieprzezroczystość +pdfjs-editor-stamp-add-image-button = + .title = Dodaj obraz +pdfjs-editor-stamp-add-image-button-label = Dodaj obraz +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Grubość +pdfjs-editor-free-highlight-thickness-title = + .title = Zmień grubość podczas wyróżniania elementów innych niż tekst +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = Edytor tekstu + .default-content = Zacznij pisać… +pdfjs-free-text = + .aria-label = Edytor tekstu +pdfjs-free-text-default-content = Zacznij pisać… +pdfjs-ink = + .aria-label = Edytor rysunku +pdfjs-ink-canvas = + .aria-label = Obraz utworzony przez użytkownika + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = Tekst alternatywny +pdfjs-editor-alt-text-edit-button = + .aria-label = Edytuj tekst alternatywny +pdfjs-editor-alt-text-edit-button-label = Edytuj tekst alternatywny +pdfjs-editor-alt-text-dialog-label = Wybierz opcję +pdfjs-editor-alt-text-dialog-description = Tekst alternatywny pomaga, kiedy ktoś nie może zobaczyć obrazu lub gdy się nie wczytuje. +pdfjs-editor-alt-text-add-description-label = Dodaj opis +pdfjs-editor-alt-text-add-description-description = Staraj się napisać 1-2 zdania opisujące temat, miejsce lub działania. +pdfjs-editor-alt-text-mark-decorative-label = Oznacz jako dekoracyjne +pdfjs-editor-alt-text-mark-decorative-description = Używane w przypadku obrazów ozdobnych, takich jak obramowania lub znaki wodne. +pdfjs-editor-alt-text-cancel-button = Anuluj +pdfjs-editor-alt-text-save-button = Zapisz +pdfjs-editor-alt-text-decorative-tooltip = Oznaczone jako dekoracyjne +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = Na przykład: „Młody człowiek siada przy stole, aby zjeść posiłek” +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = Tekst alternatywny + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Lewy górny róg — zmień rozmiar +pdfjs-editor-resizer-label-top-middle = Górny środkowy — zmień rozmiar +pdfjs-editor-resizer-label-top-right = Prawy górny róg — zmień rozmiar +pdfjs-editor-resizer-label-middle-right = Prawy środkowy — zmień rozmiar +pdfjs-editor-resizer-label-bottom-right = Prawy dolny róg — zmień rozmiar +pdfjs-editor-resizer-label-bottom-middle = Dolny środkowy — zmień rozmiar +pdfjs-editor-resizer-label-bottom-left = Lewy dolny róg — zmień rozmiar +pdfjs-editor-resizer-label-middle-left = Lewy środkowy — zmień rozmiar +pdfjs-editor-resizer-top-left = + .aria-label = Lewy górny róg — zmień rozmiar +pdfjs-editor-resizer-top-middle = + .aria-label = Górny środkowy — zmień rozmiar +pdfjs-editor-resizer-top-right = + .aria-label = Prawy górny róg — zmień rozmiar +pdfjs-editor-resizer-middle-right = + .aria-label = Prawy środkowy — zmień rozmiar +pdfjs-editor-resizer-bottom-right = + .aria-label = Prawy dolny róg — zmień rozmiar +pdfjs-editor-resizer-bottom-middle = + .aria-label = Dolny środkowy — zmień rozmiar +pdfjs-editor-resizer-bottom-left = + .aria-label = Lewy dolny róg — zmień rozmiar +pdfjs-editor-resizer-middle-left = + .aria-label = Lewy środkowy — zmień rozmiar + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Kolor wyróżnienia +pdfjs-editor-colorpicker-button = + .title = Zmień kolor +pdfjs-editor-colorpicker-dropdown = + .aria-label = Wybór kolorów +pdfjs-editor-colorpicker-yellow = + .title = Żółty +pdfjs-editor-colorpicker-green = + .title = Zielony +pdfjs-editor-colorpicker-blue = + .title = Niebieski +pdfjs-editor-colorpicker-pink = + .title = Różowy +pdfjs-editor-colorpicker-red = + .title = Czerwony + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Pokaż wszystkie +pdfjs-editor-highlight-show-all-button = + .title = Pokaż wszystkie + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = Edytuj tekst alternatywny (opis obrazu) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = Dodaj tekst alternatywny (opis obrazu) +pdfjs-editor-new-alt-text-textarea = + .placeholder = Napisz tutaj opis… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = Krótki opis dla osób, które nie widzą obrazu lub kiedy obraz się nie wczytuje. +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = Ten tekst alternatywny został utworzony automatycznie i może być niepoprawny. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Więcej informacji +pdfjs-editor-new-alt-text-create-automatically-button-label = Automatycznie utwórz tekst alternatywny +pdfjs-editor-new-alt-text-not-now-button = Nie teraz +pdfjs-editor-new-alt-text-error-title = Nie można automatycznie utworzyć tekstu alternatywnego +pdfjs-editor-new-alt-text-error-description = Proszę napisać własny tekst alternatywny lub spróbować ponownie później. +pdfjs-editor-new-alt-text-error-close-button = Zamknij +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = Pobieranie modelu SI tekstu alternatywnego ({ $downloadedSize } z { $totalSize } MB) + .aria-valuetext = Pobieranie modelu SI tekstu alternatywnego ({ $downloadedSize } z { $totalSize } MB) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = Dodano tekst alternatywny +pdfjs-editor-new-alt-text-added-button-label = Dodano tekst alternatywny +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = Brak tekstu alternatywnego +pdfjs-editor-new-alt-text-missing-button-label = Brak tekstu alternatywnego +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = Przejrzyj tekst alternatywny +pdfjs-editor-new-alt-text-to-review-button-label = Przejrzyj tekst alternatywny +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Utworzono automatycznie: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = Ustawienia tekstu alternatywnego obrazów +pdfjs-image-alt-text-settings-button-label = Ustawienia tekstu alternatywnego obrazów +pdfjs-editor-alt-text-settings-dialog-label = Ustawienia tekstu alternatywnego obrazów +pdfjs-editor-alt-text-settings-automatic-title = Automatyczny tekst alternatywny +pdfjs-editor-alt-text-settings-create-model-button-label = Automatyczne tworzenie tekstu alternatywnego +pdfjs-editor-alt-text-settings-create-model-description = Podpowiada opisy, które mogą pomóc osobom, które nie widzą obrazu lub kiedy obraz się nie wczytuje. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = Model SI tekstu alternatywnego ({ $totalSize } MB) +pdfjs-editor-alt-text-settings-ai-model-description = Działa lokalnie na urządzeniu użytkownika, więc Twoje dane pozostają prywatne. Wymagane do funkcji automatycznego tekstu alternatywnego. +pdfjs-editor-alt-text-settings-delete-model-button = Usuń +pdfjs-editor-alt-text-settings-download-model-button = Pobierz +pdfjs-editor-alt-text-settings-downloading-model-button = Pobieranie… +pdfjs-editor-alt-text-settings-editor-title = Edytor tekstu alternatywnego +pdfjs-editor-alt-text-settings-show-dialog-button-label = Wyświetlanie edytora tekstu alternatywnego od razu po dodaniu obrazu +pdfjs-editor-alt-text-settings-show-dialog-description = Pomaga upewnić się, że wszystkie obrazy mają tekst alternatywny. +pdfjs-editor-alt-text-settings-close-button = Zamknij + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = Usunięto wyróżnienie +pdfjs-editor-undo-bar-message-freetext = Usunięto tekst +pdfjs-editor-undo-bar-message-ink = Usunięto rysunek +pdfjs-editor-undo-bar-message-stamp = Usunięto obraz +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = + { $count -> + [one] Usunięto przypis + [few] Usunięto { $count } przypisy + *[many] Usunięto { $count } przypisów + } +pdfjs-editor-undo-bar-undo-button = + .title = Cofnij +pdfjs-editor-undo-bar-undo-button-label = Cofnij +pdfjs-editor-undo-bar-close-button = + .title = Zamknij +pdfjs-editor-undo-bar-close-button-label = Zamknij diff --git a/public/pdfjs/web/locale/pt-BR/viewer.ftl b/public/pdfjs/web/locale/pt-BR/viewer.ftl new file mode 100644 index 0000000..7da5201 --- /dev/null +++ b/public/pdfjs/web/locale/pt-BR/viewer.ftl @@ -0,0 +1,515 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Página anterior +pdfjs-previous-button-label = Anterior +pdfjs-next-button = + .title = Próxima página +pdfjs-next-button-label = Próxima +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Página +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = de { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } de { $pagesCount }) +pdfjs-zoom-out-button = + .title = Reduzir +pdfjs-zoom-out-button-label = Reduzir +pdfjs-zoom-in-button = + .title = Ampliar +pdfjs-zoom-in-button-label = Ampliar +pdfjs-zoom-select = + .title = Zoom +pdfjs-presentation-mode-button = + .title = Mudar para o modo de apresentação +pdfjs-presentation-mode-button-label = Modo de apresentação +pdfjs-open-file-button = + .title = Abrir arquivo +pdfjs-open-file-button-label = Abrir +pdfjs-print-button = + .title = Imprimir +pdfjs-print-button-label = Imprimir +pdfjs-save-button = + .title = Salvar +pdfjs-save-button-label = Salvar +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Baixar +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Baixar +pdfjs-bookmark-button = + .title = Página atual (ver URL da página atual) +pdfjs-bookmark-button-label = Pagina atual + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Ferramentas +pdfjs-tools-button-label = Ferramentas +pdfjs-first-page-button = + .title = Ir para a primeira página +pdfjs-first-page-button-label = Ir para a primeira página +pdfjs-last-page-button = + .title = Ir para a última página +pdfjs-last-page-button-label = Ir para a última página +pdfjs-page-rotate-cw-button = + .title = Girar no sentido horário +pdfjs-page-rotate-cw-button-label = Girar no sentido horário +pdfjs-page-rotate-ccw-button = + .title = Girar no sentido anti-horário +pdfjs-page-rotate-ccw-button-label = Girar no sentido anti-horário +pdfjs-cursor-text-select-tool-button = + .title = Ativar a ferramenta de seleção de texto +pdfjs-cursor-text-select-tool-button-label = Ferramenta de seleção de texto +pdfjs-cursor-hand-tool-button = + .title = Ativar ferramenta de deslocamento +pdfjs-cursor-hand-tool-button-label = Ferramenta de deslocamento +pdfjs-scroll-page-button = + .title = Usar rolagem de página +pdfjs-scroll-page-button-label = Rolagem de página +pdfjs-scroll-vertical-button = + .title = Usar deslocamento vertical +pdfjs-scroll-vertical-button-label = Deslocamento vertical +pdfjs-scroll-horizontal-button = + .title = Usar deslocamento horizontal +pdfjs-scroll-horizontal-button-label = Deslocamento horizontal +pdfjs-scroll-wrapped-button = + .title = Usar deslocamento contido +pdfjs-scroll-wrapped-button-label = Deslocamento contido +pdfjs-spread-none-button = + .title = Não reagrupar páginas +pdfjs-spread-none-button-label = Não estender +pdfjs-spread-odd-button = + .title = Agrupar páginas começando em páginas com números ímpares +pdfjs-spread-odd-button-label = Estender ímpares +pdfjs-spread-even-button = + .title = Agrupar páginas começando em páginas com números pares +pdfjs-spread-even-button-label = Estender pares + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Propriedades do documento… +pdfjs-document-properties-button-label = Propriedades do documento… +pdfjs-document-properties-file-name = Nome do arquivo: +pdfjs-document-properties-file-size = Tamanho do arquivo: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } bytes) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } bytes) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bytes) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bytes) +pdfjs-document-properties-title = Título: +pdfjs-document-properties-author = Autor: +pdfjs-document-properties-subject = Assunto: +pdfjs-document-properties-keywords = Palavras-chave: +pdfjs-document-properties-creation-date = Data da criação: +pdfjs-document-properties-modification-date = Data da modificação: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Criação: +pdfjs-document-properties-producer = Criador do PDF: +pdfjs-document-properties-version = Versão do PDF: +pdfjs-document-properties-page-count = Número de páginas: +pdfjs-document-properties-page-size = Tamanho da página: +pdfjs-document-properties-page-size-unit-inches = pol. +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = retrato +pdfjs-document-properties-page-size-orientation-landscape = paisagem +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Carta +pdfjs-document-properties-page-size-name-legal = Jurídico + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Exibição web rápida: +pdfjs-document-properties-linearized-yes = Sim +pdfjs-document-properties-linearized-no = Não +pdfjs-document-properties-close-button = Fechar + +## Print + +pdfjs-print-progress-message = Preparando documento para impressão… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress } % +pdfjs-print-progress-close-button = Cancelar +pdfjs-printing-not-supported = Aviso: a impressão não é totalmente suportada neste navegador. +pdfjs-printing-not-ready = Aviso: o PDF não está totalmente carregado para impressão. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Exibir/ocultar painel lateral +pdfjs-toggle-sidebar-notification-button = + .title = Exibir/ocultar painel lateral (documento contém estrutura/anexos/camadas) +pdfjs-toggle-sidebar-button-label = Exibir/ocultar painel lateral +pdfjs-document-outline-button = + .title = Mostrar estrutura do documento (duplo-clique expande/recolhe todos os itens) +pdfjs-document-outline-button-label = Estrutura do documento +pdfjs-attachments-button = + .title = Mostrar anexos +pdfjs-attachments-button-label = Anexos +pdfjs-layers-button = + .title = Mostrar camadas (duplo-clique redefine todas as camadas ao estado predefinido) +pdfjs-layers-button-label = Camadas +pdfjs-thumbs-button = + .title = Mostrar miniaturas +pdfjs-thumbs-button-label = Miniaturas +pdfjs-current-outline-item-button = + .title = Encontrar item atual da estrutura +pdfjs-current-outline-item-button-label = Item atual da estrutura +pdfjs-findbar-button = + .title = Procurar no documento +pdfjs-findbar-button-label = Procurar +pdfjs-additional-layers = Camadas adicionais + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Página { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Miniatura da página { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Procurar + .placeholder = Procurar no documento… +pdfjs-find-previous-button = + .title = Procurar a ocorrência anterior da frase +pdfjs-find-previous-button-label = Anterior +pdfjs-find-next-button = + .title = Procurar a próxima ocorrência da frase +pdfjs-find-next-button-label = Próxima +pdfjs-find-highlight-checkbox = Destacar tudo +pdfjs-find-match-case-checkbox-label = Diferenciar maiúsculas/minúsculas +pdfjs-find-match-diacritics-checkbox-label = Considerar acentuação +pdfjs-find-entire-word-checkbox-label = Palavras completas +pdfjs-find-reached-top = Início do documento alcançado, continuando do fim +pdfjs-find-reached-bottom = Fim do documento alcançado, continuando do início +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] { $current } de { $total } ocorrência + *[other] { $current } de { $total } ocorrências + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] Mais de { $limit } ocorrência + *[other] Mais de { $limit } ocorrências + } +pdfjs-find-not-found = Não encontrado + +## Predefined zoom values + +pdfjs-page-scale-width = Largura da página +pdfjs-page-scale-fit = Ajustar à janela +pdfjs-page-scale-auto = Zoom automático +pdfjs-page-scale-actual = Tamanho real +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Página { $page } + +## Loading indicator messages + +pdfjs-loading-error = Ocorreu um erro ao carregar o PDF. +pdfjs-invalid-file-error = Arquivo PDF corrompido ou inválido. +pdfjs-missing-file-error = Arquivo PDF ausente. +pdfjs-unexpected-response-error = Resposta inesperada do servidor. +pdfjs-rendering-error = Ocorreu um erro ao renderizar a página. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [Anotação { $type }] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Forneça a senha para abrir este arquivo PDF. +pdfjs-password-invalid = Senha inválida. Tente novamente. +pdfjs-password-ok-button = OK +pdfjs-password-cancel-button = Cancelar +pdfjs-web-fonts-disabled = As fontes web estão desativadas: não foi possível usar fontes incorporadas do PDF. + +## Editing + +pdfjs-editor-free-text-button = + .title = Texto +pdfjs-editor-free-text-button-label = Texto +pdfjs-editor-ink-button = + .title = Desenho +pdfjs-editor-ink-button-label = Desenho +pdfjs-editor-stamp-button = + .title = Adicionar ou editar imagens +pdfjs-editor-stamp-button-label = Adicionar ou editar imagens +pdfjs-editor-highlight-button = + .title = Destaque +pdfjs-editor-highlight-button-label = Destaque +pdfjs-highlight-floating-button1 = + .title = Destaque + .aria-label = Destaque +pdfjs-highlight-floating-button-label = Destaque + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Remover desenho +pdfjs-editor-remove-freetext-button = + .title = Remover texto +pdfjs-editor-remove-stamp-button = + .title = Remover imagem +pdfjs-editor-remove-highlight-button = + .title = Remover destaque + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Cor +pdfjs-editor-free-text-size-input = Tamanho +pdfjs-editor-ink-color-input = Cor +pdfjs-editor-ink-thickness-input = Espessura +pdfjs-editor-ink-opacity-input = Opacidade +pdfjs-editor-stamp-add-image-button = + .title = Adicionar imagem +pdfjs-editor-stamp-add-image-button-label = Adicionar imagem +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Espessura +pdfjs-editor-free-highlight-thickness-title = + .title = Mudar espessura ao destacar itens que não são texto +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = Editor de texto + .default-content = Comece a digitar… +pdfjs-free-text = + .aria-label = Editor de texto +pdfjs-free-text-default-content = Comece digitando… +pdfjs-ink = + .aria-label = Editor de desenho +pdfjs-ink-canvas = + .aria-label = Imagem criada pelo usuário + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = Texto alternativo +pdfjs-editor-alt-text-edit-button = + .aria-label = Editar texto alternativo +pdfjs-editor-alt-text-edit-button-label = Editar texto alternativo +pdfjs-editor-alt-text-dialog-label = Escolha uma opção +pdfjs-editor-alt-text-dialog-description = O texto alternativo ajuda quando uma imagem não aparece ou não é carregada. +pdfjs-editor-alt-text-add-description-label = Adicionar uma descrição +pdfjs-editor-alt-text-add-description-description = Procure usar uma ou duas frases que descrevam o assunto, cenário ou ação. +pdfjs-editor-alt-text-mark-decorative-label = Marcar como decorativa +pdfjs-editor-alt-text-mark-decorative-description = Isto é usado em imagens ornamentais, como bordas ou marcas d'água. +pdfjs-editor-alt-text-cancel-button = Cancelar +pdfjs-editor-alt-text-save-button = Salvar +pdfjs-editor-alt-text-decorative-tooltip = Marcado como decorativa +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = Por exemplo, “Um jovem senta-se à mesa para comer uma refeição” +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = Texto alternativo + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Canto superior esquerdo — redimensionar +pdfjs-editor-resizer-label-top-middle = No centro do topo — redimensionar +pdfjs-editor-resizer-label-top-right = Canto superior direito — redimensionar +pdfjs-editor-resizer-label-middle-right = No meio à direita — redimensionar +pdfjs-editor-resizer-label-bottom-right = Canto inferior direito — redimensionar +pdfjs-editor-resizer-label-bottom-middle = No centro da base — redimensionar +pdfjs-editor-resizer-label-bottom-left = Canto inferior esquerdo — redimensionar +pdfjs-editor-resizer-label-middle-left = No meio à esquerda — redimensionar +pdfjs-editor-resizer-top-left = + .aria-label = Canto superior esquerdo — redimensionar +pdfjs-editor-resizer-top-middle = + .aria-label = No centro do topo — redimensionar +pdfjs-editor-resizer-top-right = + .aria-label = Canto superior direito — redimensionar +pdfjs-editor-resizer-middle-right = + .aria-label = No meio à direita — redimensionar +pdfjs-editor-resizer-bottom-right = + .aria-label = Canto inferior direito — redimensionar +pdfjs-editor-resizer-bottom-middle = + .aria-label = No centro da base — redimensionar +pdfjs-editor-resizer-bottom-left = + .aria-label = Canto inferior esquerdo — redimensionar +pdfjs-editor-resizer-middle-left = + .aria-label = No meio à esquerda — redimensionar + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Cor de destaque +pdfjs-editor-colorpicker-button = + .title = Mudar cor +pdfjs-editor-colorpicker-dropdown = + .aria-label = Opções de cores +pdfjs-editor-colorpicker-yellow = + .title = Amarelo +pdfjs-editor-colorpicker-green = + .title = Verde +pdfjs-editor-colorpicker-blue = + .title = Azul +pdfjs-editor-colorpicker-pink = + .title = Rosa +pdfjs-editor-colorpicker-red = + .title = Vermelho + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Mostrar todos +pdfjs-editor-highlight-show-all-button = + .title = Mostrar todos + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = Editar texto alternativo (descrição da imagem) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = Adicionar texto alternativo (descrição da imagem) +pdfjs-editor-new-alt-text-textarea = + .placeholder = Escreva sua descrição aqui… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = Descrição curta para pessoas que não conseguem ver a imagem ou quando a imagem não é carregada. +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = Este texto alternativo foi criado automaticamente, pode não estar correto. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Saiba mais +pdfjs-editor-new-alt-text-create-automatically-button-label = Criar texto alternativo automaticamente +pdfjs-editor-new-alt-text-not-now-button = Agora não +pdfjs-editor-new-alt-text-error-title = Não foi possível criar texto alternativo automaticamente +pdfjs-editor-new-alt-text-error-description = Escreva seu próprio texto alternativo ou tente novamente mais tarde. +pdfjs-editor-new-alt-text-error-close-button = Fechar +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = Baixando modelo de inteligência artificial de texto alternativo ({ $downloadedSize } de { $totalSize } MB) + .aria-valuetext = Baixando modelo de inteligência artificial de texto alternativo ({ $downloadedSize } de { $totalSize } MB) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = Texto alternativo adicionado +pdfjs-editor-new-alt-text-added-button-label = Texto alternativo adicionado +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = Falta texto alternativo +pdfjs-editor-new-alt-text-missing-button-label = Falta texto alternativo +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = Revisar texto alternativo +pdfjs-editor-new-alt-text-to-review-button-label = Revisar texto alternativo +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Criado automaticamente: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = Configurações de texto alternativo de imagens +pdfjs-image-alt-text-settings-button-label = Configurações de texto alternativo de imagens +pdfjs-editor-alt-text-settings-dialog-label = Configurações de texto alternativo de imagens +pdfjs-editor-alt-text-settings-automatic-title = Texto alternativo automático +pdfjs-editor-alt-text-settings-create-model-button-label = Criar texto alternativo automaticamente +pdfjs-editor-alt-text-settings-create-model-description = Sugere uma descrição para ajudar pessoas que não conseguem ver a imagem ou quando a imagem não é carregada. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = Modelo de inteligência artificial de texto alternativo ({ $totalSize } MB) +pdfjs-editor-alt-text-settings-ai-model-description = Funciona localmente no seu dispositivo para que seus dados permaneçam privativos. Necessário para texto alternativo automático. +pdfjs-editor-alt-text-settings-delete-model-button = Excluir +pdfjs-editor-alt-text-settings-download-model-button = Baixar +pdfjs-editor-alt-text-settings-downloading-model-button = Baixando… +pdfjs-editor-alt-text-settings-editor-title = Editor de texto alternativo +pdfjs-editor-alt-text-settings-show-dialog-button-label = Mostrar o editor de texto alternativo imediatamente ao adicionar uma imagem +pdfjs-editor-alt-text-settings-show-dialog-description = Ajuda a assegurar que todas as suas imagens tenham texto alternativo. +pdfjs-editor-alt-text-settings-close-button = Fechar + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = Destaque removido +pdfjs-editor-undo-bar-message-freetext = Texto removido +pdfjs-editor-undo-bar-message-ink = Desenho removido +pdfjs-editor-undo-bar-message-stamp = Imagem removida +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = + { $count -> + [one] { $count } anotação removida + *[other] { $count } anotações removidas + } +pdfjs-editor-undo-bar-undo-button = + .title = Desfazer +pdfjs-editor-undo-bar-undo-button-label = Desfazer +pdfjs-editor-undo-bar-close-button = + .title = Fechar +pdfjs-editor-undo-bar-close-button-label = Fechar diff --git a/public/pdfjs/web/locale/pt-PT/viewer.ftl b/public/pdfjs/web/locale/pt-PT/viewer.ftl new file mode 100644 index 0000000..1829417 --- /dev/null +++ b/public/pdfjs/web/locale/pt-PT/viewer.ftl @@ -0,0 +1,515 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Página anterior +pdfjs-previous-button-label = Anterior +pdfjs-next-button = + .title = Página seguinte +pdfjs-next-button-label = Seguinte +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Página +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = de { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } de { $pagesCount }) +pdfjs-zoom-out-button = + .title = Reduzir +pdfjs-zoom-out-button-label = Reduzir +pdfjs-zoom-in-button = + .title = Ampliar +pdfjs-zoom-in-button-label = Ampliar +pdfjs-zoom-select = + .title = Zoom +pdfjs-presentation-mode-button = + .title = Trocar para o modo de apresentação +pdfjs-presentation-mode-button-label = Modo de apresentação +pdfjs-open-file-button = + .title = Abrir ficheiro +pdfjs-open-file-button-label = Abrir +pdfjs-print-button = + .title = Imprimir +pdfjs-print-button-label = Imprimir +pdfjs-save-button = + .title = Guardar +pdfjs-save-button-label = Guardar +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Transferir +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Transferir +pdfjs-bookmark-button = + .title = Página atual (ver URL da página atual) +pdfjs-bookmark-button-label = Pagina atual + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Ferramentas +pdfjs-tools-button-label = Ferramentas +pdfjs-first-page-button = + .title = Ir para a primeira página +pdfjs-first-page-button-label = Ir para a primeira página +pdfjs-last-page-button = + .title = Ir para a última página +pdfjs-last-page-button-label = Ir para a última página +pdfjs-page-rotate-cw-button = + .title = Rodar à direita +pdfjs-page-rotate-cw-button-label = Rodar à direita +pdfjs-page-rotate-ccw-button = + .title = Rodar à esquerda +pdfjs-page-rotate-ccw-button-label = Rodar à esquerda +pdfjs-cursor-text-select-tool-button = + .title = Ativar ferramenta de seleção de texto +pdfjs-cursor-text-select-tool-button-label = Ferramenta de seleção de texto +pdfjs-cursor-hand-tool-button = + .title = Ativar ferramenta de mão +pdfjs-cursor-hand-tool-button-label = Ferramenta de mão +pdfjs-scroll-page-button = + .title = Utilizar deslocamento da página +pdfjs-scroll-page-button-label = Deslocamento da página +pdfjs-scroll-vertical-button = + .title = Utilizar deslocação vertical +pdfjs-scroll-vertical-button-label = Deslocação vertical +pdfjs-scroll-horizontal-button = + .title = Utilizar deslocação horizontal +pdfjs-scroll-horizontal-button-label = Deslocação horizontal +pdfjs-scroll-wrapped-button = + .title = Utilizar deslocação encapsulada +pdfjs-scroll-wrapped-button-label = Deslocação encapsulada +pdfjs-spread-none-button = + .title = Não juntar páginas dispersas +pdfjs-spread-none-button-label = Sem spreads +pdfjs-spread-odd-button = + .title = Juntar páginas dispersas a partir de páginas com números ímpares +pdfjs-spread-odd-button-label = Spreads ímpares +pdfjs-spread-even-button = + .title = Juntar páginas dispersas a partir de páginas com números pares +pdfjs-spread-even-button-label = Spreads pares + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Propriedades do documento… +pdfjs-document-properties-button-label = Propriedades do documento… +pdfjs-document-properties-file-name = Nome do ficheiro: +pdfjs-document-properties-file-size = Tamanho do ficheiro: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } bytes) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } bytes) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bytes) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bytes) +pdfjs-document-properties-title = Título: +pdfjs-document-properties-author = Autor: +pdfjs-document-properties-subject = Assunto: +pdfjs-document-properties-keywords = Palavras-chave: +pdfjs-document-properties-creation-date = Data de criação: +pdfjs-document-properties-modification-date = Data de modificação: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Criador: +pdfjs-document-properties-producer = Produtor de PDF: +pdfjs-document-properties-version = Versão do PDF: +pdfjs-document-properties-page-count = N.º de páginas: +pdfjs-document-properties-page-size = Tamanho da página: +pdfjs-document-properties-page-size-unit-inches = in +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = retrato +pdfjs-document-properties-page-size-orientation-landscape = paisagem +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Carta +pdfjs-document-properties-page-size-name-legal = Legal + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Vista rápida web: +pdfjs-document-properties-linearized-yes = Sim +pdfjs-document-properties-linearized-no = Não +pdfjs-document-properties-close-button = Fechar + +## Print + +pdfjs-print-progress-message = A preparar o documento para impressão… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Cancelar +pdfjs-printing-not-supported = Aviso: a impressão não é totalmente suportada por este navegador. +pdfjs-printing-not-ready = Aviso: o PDF ainda não está totalmente carregado. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Alternar barra lateral +pdfjs-toggle-sidebar-notification-button = + .title = Alternar barra lateral (o documento contém contornos/anexos/camadas) +pdfjs-toggle-sidebar-button-label = Alternar barra lateral +pdfjs-document-outline-button = + .title = Mostrar esquema do documento (duplo clique para expandir/colapsar todos os itens) +pdfjs-document-outline-button-label = Esquema do documento +pdfjs-attachments-button = + .title = Mostrar anexos +pdfjs-attachments-button-label = Anexos +pdfjs-layers-button = + .title = Mostrar camadas (clique duas vezes para repor todas as camadas para o estado predefinido) +pdfjs-layers-button-label = Camadas +pdfjs-thumbs-button = + .title = Mostrar miniaturas +pdfjs-thumbs-button-label = Miniaturas +pdfjs-current-outline-item-button = + .title = Encontrar o item atualmente destacado +pdfjs-current-outline-item-button-label = Item atualmente destacado +pdfjs-findbar-button = + .title = Localizar em documento +pdfjs-findbar-button-label = Localizar +pdfjs-additional-layers = Camadas adicionais + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Página { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Miniatura da página { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Localizar + .placeholder = Localizar em documento… +pdfjs-find-previous-button = + .title = Localizar ocorrência anterior da frase +pdfjs-find-previous-button-label = Anterior +pdfjs-find-next-button = + .title = Localizar ocorrência seguinte da frase +pdfjs-find-next-button-label = Seguinte +pdfjs-find-highlight-checkbox = Destacar tudo +pdfjs-find-match-case-checkbox-label = Correspondência +pdfjs-find-match-diacritics-checkbox-label = Corresponder diacríticos +pdfjs-find-entire-word-checkbox-label = Palavras completas +pdfjs-find-reached-top = Topo do documento atingido, a continuar a partir do fundo +pdfjs-find-reached-bottom = Fim do documento atingido, a continuar a partir do topo +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] { $current } de { $total } correspondência + *[other] { $current } de { $total } correspondências + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] Mais de { $limit } correspondência + *[other] Mais de { $limit } correspondências + } +pdfjs-find-not-found = Frase não encontrada + +## Predefined zoom values + +pdfjs-page-scale-width = Ajustar à largura +pdfjs-page-scale-fit = Ajustar à página +pdfjs-page-scale-auto = Zoom automático +pdfjs-page-scale-actual = Tamanho real +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Página { $page } + +## Loading indicator messages + +pdfjs-loading-error = Ocorreu um erro ao carregar o PDF. +pdfjs-invalid-file-error = Ficheiro PDF inválido ou danificado. +pdfjs-missing-file-error = Ficheiro PDF inexistente. +pdfjs-unexpected-response-error = Resposta inesperada do servidor. +pdfjs-rendering-error = Ocorreu um erro ao processar a página. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [Anotação { $type }] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Introduza a palavra-passe para abrir este ficheiro PDF. +pdfjs-password-invalid = Palavra-passe inválida. Por favor, tente novamente. +pdfjs-password-ok-button = OK +pdfjs-password-cancel-button = Cancelar +pdfjs-web-fonts-disabled = Os tipos de letra web estão desativados: não é possível utilizar os tipos de letra PDF embutidos. + +## Editing + +pdfjs-editor-free-text-button = + .title = Texto +pdfjs-editor-free-text-button-label = Texto +pdfjs-editor-ink-button = + .title = Desenhar +pdfjs-editor-ink-button-label = Desenhar +pdfjs-editor-stamp-button = + .title = Adicionar ou editar imagens +pdfjs-editor-stamp-button-label = Adicionar ou editar imagens +pdfjs-editor-highlight-button = + .title = Destaque +pdfjs-editor-highlight-button-label = Destaque +pdfjs-highlight-floating-button1 = + .title = Realçar + .aria-label = Realçar +pdfjs-highlight-floating-button-label = Realçar + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Remover desenho +pdfjs-editor-remove-freetext-button = + .title = Remover texto +pdfjs-editor-remove-stamp-button = + .title = Remover imagem +pdfjs-editor-remove-highlight-button = + .title = Remover destaque + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Cor +pdfjs-editor-free-text-size-input = Tamanho +pdfjs-editor-ink-color-input = Cor +pdfjs-editor-ink-thickness-input = Espessura +pdfjs-editor-ink-opacity-input = Opacidade +pdfjs-editor-stamp-add-image-button = + .title = Adicionar imagem +pdfjs-editor-stamp-add-image-button-label = Adicionar imagem +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Espessura +pdfjs-editor-free-highlight-thickness-title = + .title = Alterar espessura quando destacar itens que não sejam texto +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = Editor de texto + .default-content = Comece a escrever… +pdfjs-free-text = + .aria-label = Editor de texto +pdfjs-free-text-default-content = Começar a digitar… +pdfjs-ink = + .aria-label = Editor de desenho +pdfjs-ink-canvas = + .aria-label = Imagem criada pelo utilizador + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = Texto alternativo +pdfjs-editor-alt-text-edit-button = + .aria-label = Editar texto alternativo +pdfjs-editor-alt-text-edit-button-label = Editar texto alternativo +pdfjs-editor-alt-text-dialog-label = Escolher uma opção +pdfjs-editor-alt-text-dialog-description = O texto alternativo (texto alternativo) ajuda quando as pessoas não conseguem ver a imagem ou quando a mesma não é carregada. +pdfjs-editor-alt-text-add-description-label = Adicionar uma descrição +pdfjs-editor-alt-text-add-description-description = Aponte para 1-2 frases que descrevam o assunto, definição ou ações. +pdfjs-editor-alt-text-mark-decorative-label = Marcar como decorativa +pdfjs-editor-alt-text-mark-decorative-description = Isto é utilizado para imagens decorativas, tais como limites ou marcas d'água. +pdfjs-editor-alt-text-cancel-button = Cancelar +pdfjs-editor-alt-text-save-button = Guardar +pdfjs-editor-alt-text-decorative-tooltip = Marcada como decorativa +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = Por exemplo, “Um jovem senta-se à mesa para comer uma refeição” +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = Texto alternativo + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Canto superior esquerdo — redimensionar +pdfjs-editor-resizer-label-top-middle = Superior ao centro — redimensionar +pdfjs-editor-resizer-label-top-right = Canto superior direito — redimensionar +pdfjs-editor-resizer-label-middle-right = Centro à direita — redimensionar +pdfjs-editor-resizer-label-bottom-right = Canto inferior direito — redimensionar +pdfjs-editor-resizer-label-bottom-middle = Inferior ao centro — redimensionar +pdfjs-editor-resizer-label-bottom-left = Canto inferior esquerdo — redimensionar +pdfjs-editor-resizer-label-middle-left = Centro à esquerda — redimensionar +pdfjs-editor-resizer-top-left = + .aria-label = Canto superior esquerdo — redimensionar +pdfjs-editor-resizer-top-middle = + .aria-label = Superior ao centro — redimensionar +pdfjs-editor-resizer-top-right = + .aria-label = Canto superior direito — redimensionar +pdfjs-editor-resizer-middle-right = + .aria-label = Centro à direita — redimensionar +pdfjs-editor-resizer-bottom-right = + .aria-label = Canto inferior direito — redimensionar +pdfjs-editor-resizer-bottom-middle = + .aria-label = Inferior ao centro — redimensionar +pdfjs-editor-resizer-bottom-left = + .aria-label = Canto inferior esquerdo — redimensionar +pdfjs-editor-resizer-middle-left = + .aria-label = Centro à esquerda — redimensionar + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Cor de destaque +pdfjs-editor-colorpicker-button = + .title = Alterar cor +pdfjs-editor-colorpicker-dropdown = + .aria-label = Escolhas de cor +pdfjs-editor-colorpicker-yellow = + .title = Amarelo +pdfjs-editor-colorpicker-green = + .title = Verde +pdfjs-editor-colorpicker-blue = + .title = Azul +pdfjs-editor-colorpicker-pink = + .title = Rosa +pdfjs-editor-colorpicker-red = + .title = Vermelho + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Mostrar tudo +pdfjs-editor-highlight-show-all-button = + .title = Mostrar tudo + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = Editar texto alternativo (descrição da imagem) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = Adicionar texto alternativo (descrição da imagem) +pdfjs-editor-new-alt-text-textarea = + .placeholder = Escreva a sua descrição aqui… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = Descrição curta para as pessoas que não podem visualizar a imagem ou quando a imagem não carrega. +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = Este texto alternativo foi criado automaticamente e pode ser impreciso. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Saber mais +pdfjs-editor-new-alt-text-create-automatically-button-label = Criar texto alternativo automaticamente +pdfjs-editor-new-alt-text-not-now-button = Agora não +pdfjs-editor-new-alt-text-error-title = Não foi possível criar o texto alternativo automaticamente +pdfjs-editor-new-alt-text-error-description = Escreva o seu próprio texto alternativo ou tente novamente mais tarde. +pdfjs-editor-new-alt-text-error-close-button = Fechar +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = A transferir o modelo de IA de texto alternativo ({ $downloadedSize } de { $totalSize } MB) + .aria-valuetext = A transferir o modelo de IA de texto alternativo ({ $downloadedSize } de { $totalSize } MB) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = Texto alternativo adicionado +pdfjs-editor-new-alt-text-added-button-label = Texto alternativo adicionado +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = Texto alternativo em falta +pdfjs-editor-new-alt-text-missing-button-label = Texto alternativo em falta +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = Rever texto alternativo +pdfjs-editor-new-alt-text-to-review-button-label = Rever texto alternativo +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Criado automaticamente: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = Definições de texto alternativo da imagem +pdfjs-image-alt-text-settings-button-label = Definições de texto alternativo da imagem +pdfjs-editor-alt-text-settings-dialog-label = Definições de texto alternativo das imagens +pdfjs-editor-alt-text-settings-automatic-title = Texto alternativo automático +pdfjs-editor-alt-text-settings-create-model-button-label = Criar texto alternativo automaticamente +pdfjs-editor-alt-text-settings-create-model-description = Sugere descrições para ajudar as pessoas que não podem visualizar a imagem ou quando a imagem não carrega. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = Modelo de IA de texto alternativo ({ $totalSize } MB) +pdfjs-editor-alt-text-settings-ai-model-description = É executado localmente no seu dispositivo para que os seus dados se mantenham privados. É necessário para o texto alternativo automático. +pdfjs-editor-alt-text-settings-delete-model-button = Eliminar +pdfjs-editor-alt-text-settings-download-model-button = Transferir +pdfjs-editor-alt-text-settings-downloading-model-button = A transferir… +pdfjs-editor-alt-text-settings-editor-title = Editor de texto alternativo +pdfjs-editor-alt-text-settings-show-dialog-button-label = Mostrar editor de texto alternativo imediatamente ao adicionar uma imagem +pdfjs-editor-alt-text-settings-show-dialog-description = Ajuda a garantir que todas as suas imagens tenham um texto alternativo. +pdfjs-editor-alt-text-settings-close-button = Fechar + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = Destaque removido +pdfjs-editor-undo-bar-message-freetext = Texto removido +pdfjs-editor-undo-bar-message-ink = Desenho removido +pdfjs-editor-undo-bar-message-stamp = Imagem removida +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = + { $count -> + [one] { $count } anotação removida + *[other] { $count } anotações removidas + } +pdfjs-editor-undo-bar-undo-button = + .title = Anular +pdfjs-editor-undo-bar-undo-button-label = Anular +pdfjs-editor-undo-bar-close-button = + .title = Fechar +pdfjs-editor-undo-bar-close-button-label = Fechar diff --git a/public/pdfjs/web/locale/rm/viewer.ftl b/public/pdfjs/web/locale/rm/viewer.ftl new file mode 100644 index 0000000..76992da --- /dev/null +++ b/public/pdfjs/web/locale/rm/viewer.ftl @@ -0,0 +1,515 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Pagina precedenta +pdfjs-previous-button-label = Enavos +pdfjs-next-button = + .title = Proxima pagina +pdfjs-next-button-label = Enavant +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Pagina +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = da { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } da { $pagesCount }) +pdfjs-zoom-out-button = + .title = Empitschnir +pdfjs-zoom-out-button-label = Empitschnir +pdfjs-zoom-in-button = + .title = Engrondir +pdfjs-zoom-in-button-label = Engrondir +pdfjs-zoom-select = + .title = Zoom +pdfjs-presentation-mode-button = + .title = Midar en il modus da preschentaziun +pdfjs-presentation-mode-button-label = Modus da preschentaziun +pdfjs-open-file-button = + .title = Avrir datoteca +pdfjs-open-file-button-label = Avrir +pdfjs-print-button = + .title = Stampar +pdfjs-print-button-label = Stampar +pdfjs-save-button = + .title = Memorisar +pdfjs-save-button-label = Memorisar +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Telechargiar +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Telechargiar +pdfjs-bookmark-button = + .title = Pagina actuala (mussar l'URL da la pagina actuala) +pdfjs-bookmark-button-label = Pagina actuala + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Utensils +pdfjs-tools-button-label = Utensils +pdfjs-first-page-button = + .title = Siglir a l'emprima pagina +pdfjs-first-page-button-label = Siglir a l'emprima pagina +pdfjs-last-page-button = + .title = Siglir a la davosa pagina +pdfjs-last-page-button-label = Siglir a la davosa pagina +pdfjs-page-rotate-cw-button = + .title = Rotar en direcziun da l'ura +pdfjs-page-rotate-cw-button-label = Rotar en direcziun da l'ura +pdfjs-page-rotate-ccw-button = + .title = Rotar en direcziun cuntraria a l'ura +pdfjs-page-rotate-ccw-button-label = Rotar en direcziun cuntraria a l'ura +pdfjs-cursor-text-select-tool-button = + .title = Activar l'utensil per selecziunar text +pdfjs-cursor-text-select-tool-button-label = Utensil per selecziunar text +pdfjs-cursor-hand-tool-button = + .title = Activar l'utensil da maun +pdfjs-cursor-hand-tool-button-label = Utensil da maun +pdfjs-scroll-page-button = + .title = Utilisar la defilada per pagina +pdfjs-scroll-page-button-label = Defilada per pagina +pdfjs-scroll-vertical-button = + .title = Utilisar il defilar vertical +pdfjs-scroll-vertical-button-label = Defilar vertical +pdfjs-scroll-horizontal-button = + .title = Utilisar il defilar orizontal +pdfjs-scroll-horizontal-button-label = Defilar orizontal +pdfjs-scroll-wrapped-button = + .title = Utilisar il defilar en colonnas +pdfjs-scroll-wrapped-button-label = Defilar en colonnas +pdfjs-spread-none-button = + .title = Betg parallelisar las paginas +pdfjs-spread-none-button-label = Betg parallel +pdfjs-spread-odd-button = + .title = Parallelisar las paginas cun cumenzar cun paginas spèras +pdfjs-spread-odd-button-label = Parallel spèr +pdfjs-spread-even-button = + .title = Parallelisar las paginas cun cumenzar cun paginas pèras +pdfjs-spread-even-button-label = Parallel pèr + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Caracteristicas dal document… +pdfjs-document-properties-button-label = Caracteristicas dal document… +pdfjs-document-properties-file-name = Num da la datoteca: +pdfjs-document-properties-file-size = Grondezza da la datoteca: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } bytes) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } bytes) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bytes) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bytes) +pdfjs-document-properties-title = Titel: +pdfjs-document-properties-author = Autur: +pdfjs-document-properties-subject = Tema: +pdfjs-document-properties-keywords = Chavazzins: +pdfjs-document-properties-creation-date = Data da creaziun: +pdfjs-document-properties-modification-date = Data da modificaziun: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date } { $time } +pdfjs-document-properties-creator = Creà da: +pdfjs-document-properties-producer = Creà il PDF cun: +pdfjs-document-properties-version = Versiun da PDF: +pdfjs-document-properties-page-count = Dumber da paginas: +pdfjs-document-properties-page-size = Grondezza da la pagina: +pdfjs-document-properties-page-size-unit-inches = in +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = vertical +pdfjs-document-properties-page-size-orientation-landscape = orizontal +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Letter +pdfjs-document-properties-page-size-name-legal = Legal + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Fast Web View: +pdfjs-document-properties-linearized-yes = Gea +pdfjs-document-properties-linearized-no = Na +pdfjs-document-properties-close-button = Serrar + +## Print + +pdfjs-print-progress-message = Preparar il document per stampar… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Interrumper +pdfjs-printing-not-supported = Attenziun: Il stampar na funcziunescha anc betg dal tut en quest navigatur. +pdfjs-printing-not-ready = Attenziun: Il PDF n'è betg chargià cumplettamain per stampar. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Activar/deactivar la trav laterala +pdfjs-toggle-sidebar-notification-button = + .title = Activar/deactivar la trav laterala (il document cuntegna structura dal document/agiuntas/nivels) +pdfjs-toggle-sidebar-button-label = Activar/deactivar la trav laterala +pdfjs-document-outline-button = + .title = Mussar la structura dal document (cliccar duas giadas per extender/cumprimer tut ils elements) +pdfjs-document-outline-button-label = Structura dal document +pdfjs-attachments-button = + .title = Mussar agiuntas +pdfjs-attachments-button-label = Agiuntas +pdfjs-layers-button = + .title = Mussar ils nivels (cliccar dubel per restaurar il stadi da standard da tut ils nivels) +pdfjs-layers-button-label = Nivels +pdfjs-thumbs-button = + .title = Mussar las miniaturas +pdfjs-thumbs-button-label = Miniaturas +pdfjs-current-outline-item-button = + .title = Tschertgar l'element da structura actual +pdfjs-current-outline-item-button-label = Element da structura actual +pdfjs-findbar-button = + .title = Tschertgar en il document +pdfjs-findbar-button-label = Tschertgar +pdfjs-additional-layers = Nivels supplementars + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Pagina { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Miniatura da la pagina { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Tschertgar + .placeholder = Tschertgar en il document… +pdfjs-find-previous-button = + .title = Tschertgar la posiziun precedenta da l'expressiun +pdfjs-find-previous-button-label = Enavos +pdfjs-find-next-button = + .title = Tschertgar la proxima posiziun da l'expressiun +pdfjs-find-next-button-label = Enavant +pdfjs-find-highlight-checkbox = Relevar tuts +pdfjs-find-match-case-checkbox-label = Resguardar maiusclas/minusclas +pdfjs-find-match-diacritics-checkbox-label = Resguardar ils segns diacritics +pdfjs-find-entire-word-checkbox-label = Pleds entirs +pdfjs-find-reached-top = Il cumenzament dal document è cuntanschì, la tschertga cuntinuescha a la fin dal document +pdfjs-find-reached-bottom = La fin dal document è cuntanschì, la tschertga cuntinuescha al cumenzament dal document +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] { $current } dad { $total } correspundenza + *[other] { $current } da { $total } correspundenzas + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] Dapli che { $limit } correspundenza + *[other] Dapli che { $limit } correspundenzas + } +pdfjs-find-not-found = Impussibel da chattar l'expressiun + +## Predefined zoom values + +pdfjs-page-scale-width = Ladezza da la pagina +pdfjs-page-scale-fit = Entira pagina +pdfjs-page-scale-auto = Zoom automatic +pdfjs-page-scale-actual = Grondezza actuala +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Pagina { $page } + +## Loading indicator messages + +pdfjs-loading-error = Ina errur è cumparida cun chargiar il PDF. +pdfjs-invalid-file-error = Datoteca PDF nunvalida u donnegiada. +pdfjs-missing-file-error = Datoteca PDF manconta. +pdfjs-unexpected-response-error = Resposta nunspetgada dal server. +pdfjs-rendering-error = Ina errur è cumparida cun visualisar questa pagina. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [Annotaziun da { $type }] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Endatescha il pled-clav per avrir questa datoteca da PDF. +pdfjs-password-invalid = Pled-clav nunvalid. Emprova anc ina giada. +pdfjs-password-ok-button = OK +pdfjs-password-cancel-button = Interrumper +pdfjs-web-fonts-disabled = Scrittiras dal web èn deactivadas: impussibel dad utilisar las scrittiras integradas en il PDF. + +## Editing + +pdfjs-editor-free-text-button = + .title = Text +pdfjs-editor-free-text-button-label = Text +pdfjs-editor-ink-button = + .title = Dissegnar +pdfjs-editor-ink-button-label = Dissegnar +pdfjs-editor-stamp-button = + .title = Agiuntar u modifitgar maletgs +pdfjs-editor-stamp-button-label = Agiuntar u modifitgar maletgs +pdfjs-editor-highlight-button = + .title = Marcar +pdfjs-editor-highlight-button-label = Marcar +pdfjs-highlight-floating-button1 = + .title = Marcar + .aria-label = Marcar +pdfjs-highlight-floating-button-label = Marcar + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Allontanar il dissegn +pdfjs-editor-remove-freetext-button = + .title = Allontanar il text +pdfjs-editor-remove-stamp-button = + .title = Allontanar la grafica +pdfjs-editor-remove-highlight-button = + .title = Allontanar l'emfasa + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Colur +pdfjs-editor-free-text-size-input = Grondezza +pdfjs-editor-ink-color-input = Colur +pdfjs-editor-ink-thickness-input = Grossezza +pdfjs-editor-ink-opacity-input = Opacitad +pdfjs-editor-stamp-add-image-button = + .title = Agiuntar in maletg +pdfjs-editor-stamp-add-image-button-label = Agiuntar in maletg +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Grossezza +pdfjs-editor-free-highlight-thickness-title = + .title = Midar la grossezza cun relevar elements betg textuals +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = Editur da text + .default-content = Cumenza a tippar… +pdfjs-free-text = + .aria-label = Editur da text +pdfjs-free-text-default-content = Cumenzar a tippar… +pdfjs-ink = + .aria-label = Editur dissegn +pdfjs-ink-canvas = + .aria-label = Maletg creà da l'utilisader + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = Text alternativ +pdfjs-editor-alt-text-edit-button = + .aria-label = Modifitgar il text alternativ +pdfjs-editor-alt-text-edit-button-label = Modifitgar il text alternativ +pdfjs-editor-alt-text-dialog-label = Tscherner ina opziun +pdfjs-editor-alt-text-dialog-description = Il text alternativ (alt text) gida en cas che persunas na vesan betg il maletg u sch'i na reussescha betg d'al chargiar. +pdfjs-editor-alt-text-add-description-label = Agiuntar ina descripziun +pdfjs-editor-alt-text-add-description-description = Scriva idealmain 1-2 frasas che descrivan l'object, la situaziun u las acziuns. +pdfjs-editor-alt-text-mark-decorative-label = Marcar sco decorativ +pdfjs-editor-alt-text-mark-decorative-description = Quai vegn duvrà per maletgs ornamentals, sco urs u filigranas. +pdfjs-editor-alt-text-cancel-button = Interrumper +pdfjs-editor-alt-text-save-button = Memorisar +pdfjs-editor-alt-text-decorative-tooltip = Marcà sco decorativ +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = Per exempel: «In um giuven sesa a maisa per mangiar in past» +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = Text alternativ + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Chantun sura a sanestra — redimensiunar +pdfjs-editor-resizer-label-top-middle = Sura amez — redimensiunar +pdfjs-editor-resizer-label-top-right = Chantun sura a dretga — redimensiunar +pdfjs-editor-resizer-label-middle-right = Da vart dretga amez — redimensiunar +pdfjs-editor-resizer-label-bottom-right = Chantun sut a dretga — redimensiunar +pdfjs-editor-resizer-label-bottom-middle = Sutvart amez — redimensiunar +pdfjs-editor-resizer-label-bottom-left = Chantun sut a sanestra — redimensiunar +pdfjs-editor-resizer-label-middle-left = Vart sanestra amez — redimensiunar +pdfjs-editor-resizer-top-left = + .aria-label = Chantun sura a sanestra — redimensiunar +pdfjs-editor-resizer-top-middle = + .aria-label = Sura amez — redimensiunar +pdfjs-editor-resizer-top-right = + .aria-label = Chantun sura a dretga — redimensiunar +pdfjs-editor-resizer-middle-right = + .aria-label = Da vart dretga amez — redimensiunar +pdfjs-editor-resizer-bottom-right = + .aria-label = Chantun sut a dretga — redimensiunar +pdfjs-editor-resizer-bottom-middle = + .aria-label = Sutvart amez — redimensiunar +pdfjs-editor-resizer-bottom-left = + .aria-label = Chantun sut a sanestra — redimensiunar +pdfjs-editor-resizer-middle-left = + .aria-label = Vart sanestra amez — redimensiunar + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Colur per l'emfasa +pdfjs-editor-colorpicker-button = + .title = Midar la colur +pdfjs-editor-colorpicker-dropdown = + .aria-label = Colurs disponiblas +pdfjs-editor-colorpicker-yellow = + .title = Mellen +pdfjs-editor-colorpicker-green = + .title = Verd +pdfjs-editor-colorpicker-blue = + .title = Blau +pdfjs-editor-colorpicker-pink = + .title = Rosa +pdfjs-editor-colorpicker-red = + .title = Cotschen + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Mussar tut +pdfjs-editor-highlight-show-all-button = + .title = Mussar tut + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = Modifitgar il text alternativ (descripziun dal maletg) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = Agiuntar in text alternativ (descripziun dal maletg) +pdfjs-editor-new-alt-text-textarea = + .placeholder = Scriva qua tia descripziun… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = Curta descripziun per persunas che na vesan betg il maletg u per cass en ils quals il maletg na vegn betg chargià. +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = Quest text alternativ è vegnì creà automaticamain ed è eventualmain nunprecis. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Ulteriuras infurmaziuns +pdfjs-editor-new-alt-text-create-automatically-button-label = Crear automaticamain il text alternativ +pdfjs-editor-new-alt-text-not-now-button = Betg ussa +pdfjs-editor-new-alt-text-error-title = I n’è betg reussì da crear automaticamain il text alternativ +pdfjs-editor-new-alt-text-error-description = Scriva per plaschair tes agen text alternativ u emprova pli tard anc ina giada. +pdfjs-editor-new-alt-text-error-close-button = Serrar +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = Telechargiar il model IA da text alternativ ({ $downloadedSize } da { $totalSize } MB) + .aria-valuetext = Telechargiar il model IA da text alternativ ({ $downloadedSize } da { $totalSize } MB) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = Agiuntà text alternativ +pdfjs-editor-new-alt-text-added-button-label = Text alternativ agiuntà +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = Text alternativ manca +pdfjs-editor-new-alt-text-missing-button-label = Text alternativ manca +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = Repassar il text alternativ +pdfjs-editor-new-alt-text-to-review-button-label = Repassar il text alternativ +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Creà automaticamain: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = Parameters dal text alternativ da maletgs +pdfjs-image-alt-text-settings-button-label = Parameters dal text alternativ da maletgs +pdfjs-editor-alt-text-settings-dialog-label = Parameters dal text alternativ da maletgs +pdfjs-editor-alt-text-settings-automatic-title = Text alternativ automatic +pdfjs-editor-alt-text-settings-create-model-button-label = Crear automaticamain text alternativ +pdfjs-editor-alt-text-settings-create-model-description = Propona descripziuns per gidar a persunas che na vesan betg il maletg u per cass en ils quals il maletg na vegn betg chargià. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = Model IA da text alternativ ({ $totalSize } MB) +pdfjs-editor-alt-text-settings-ai-model-description = Vegn exequì localmain sin tes apparat per che tias datas restian privatas. Necessari per text alternativ automatic. +pdfjs-editor-alt-text-settings-delete-model-button = Stizzar +pdfjs-editor-alt-text-settings-download-model-button = Telechargiar +pdfjs-editor-alt-text-settings-downloading-model-button = Telechargiar… +pdfjs-editor-alt-text-settings-editor-title = Editur per text alternativ +pdfjs-editor-alt-text-settings-show-dialog-button-label = Mussar l’editur per text alternativ directamain cun agiuntar in maletg +pdfjs-editor-alt-text-settings-show-dialog-description = Ta gida a garantir che tut tes maletgs hajan in text alternativ. +pdfjs-editor-alt-text-settings-close-button = Serrar + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = Allontanà la marcaziun +pdfjs-editor-undo-bar-message-freetext = Allontanà il text +pdfjs-editor-undo-bar-message-ink = Allontanà il dissegn +pdfjs-editor-undo-bar-message-stamp = Allontanà il maletg +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = + { $count -> + [one] { $count } annotaziun allontanada + *[other] { $count } annotaziuns allontanadas + } +pdfjs-editor-undo-bar-undo-button = + .title = Revocar +pdfjs-editor-undo-bar-undo-button-label = Revocar +pdfjs-editor-undo-bar-close-button = + .title = Serrar +pdfjs-editor-undo-bar-close-button-label = Serrar diff --git a/public/pdfjs/web/locale/ro/viewer.ftl b/public/pdfjs/web/locale/ro/viewer.ftl new file mode 100644 index 0000000..7c6f0b6 --- /dev/null +++ b/public/pdfjs/web/locale/ro/viewer.ftl @@ -0,0 +1,251 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Pagina precedentă +pdfjs-previous-button-label = Înapoi +pdfjs-next-button = + .title = Pagina următoare +pdfjs-next-button-label = Înainte +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Pagina +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = din { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } din { $pagesCount }) +pdfjs-zoom-out-button = + .title = Micșorează +pdfjs-zoom-out-button-label = Micșorează +pdfjs-zoom-in-button = + .title = Mărește +pdfjs-zoom-in-button-label = Mărește +pdfjs-zoom-select = + .title = Zoom +pdfjs-presentation-mode-button = + .title = Comută la modul de prezentare +pdfjs-presentation-mode-button-label = Mod de prezentare +pdfjs-open-file-button = + .title = Deschide un fișier +pdfjs-open-file-button-label = Deschide +pdfjs-print-button = + .title = Tipărește +pdfjs-print-button-label = Tipărește + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Instrumente +pdfjs-tools-button-label = Instrumente +pdfjs-first-page-button = + .title = Mergi la prima pagină +pdfjs-first-page-button-label = Mergi la prima pagină +pdfjs-last-page-button = + .title = Mergi la ultima pagină +pdfjs-last-page-button-label = Mergi la ultima pagină +pdfjs-page-rotate-cw-button = + .title = Rotește în sensul acelor de ceas +pdfjs-page-rotate-cw-button-label = Rotește în sensul acelor de ceas +pdfjs-page-rotate-ccw-button = + .title = Rotește în sens invers al acelor de ceas +pdfjs-page-rotate-ccw-button-label = Rotește în sens invers al acelor de ceas +pdfjs-cursor-text-select-tool-button = + .title = Activează instrumentul de selecție a textului +pdfjs-cursor-text-select-tool-button-label = Instrumentul de selecție a textului +pdfjs-cursor-hand-tool-button = + .title = Activează instrumentul mână +pdfjs-cursor-hand-tool-button-label = Unealta mână +pdfjs-scroll-vertical-button = + .title = Folosește derularea verticală +pdfjs-scroll-vertical-button-label = Derulare verticală +pdfjs-scroll-horizontal-button = + .title = Folosește derularea orizontală +pdfjs-scroll-horizontal-button-label = Derulare orizontală +pdfjs-scroll-wrapped-button = + .title = Folosește derularea încadrată +pdfjs-scroll-wrapped-button-label = Derulare încadrată +pdfjs-spread-none-button = + .title = Nu uni paginile broșate +pdfjs-spread-none-button-label = Fără pagini broșate +pdfjs-spread-odd-button = + .title = Unește paginile broșate începând cu cele impare +pdfjs-spread-odd-button-label = Broșare pagini impare +pdfjs-spread-even-button = + .title = Unește paginile broșate începând cu cele pare +pdfjs-spread-even-button-label = Broșare pagini pare + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Proprietățile documentului… +pdfjs-document-properties-button-label = Proprietățile documentului… +pdfjs-document-properties-file-name = Numele fișierului: +pdfjs-document-properties-file-size = Mărimea fișierului: +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } byți) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } byți) +pdfjs-document-properties-title = Titlu: +pdfjs-document-properties-author = Autor: +pdfjs-document-properties-subject = Subiect: +pdfjs-document-properties-keywords = Cuvinte cheie: +pdfjs-document-properties-creation-date = Data creării: +pdfjs-document-properties-modification-date = Data modificării: +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Autor: +pdfjs-document-properties-producer = Producător PDF: +pdfjs-document-properties-version = Versiune PDF: +pdfjs-document-properties-page-count = Număr de pagini: +pdfjs-document-properties-page-size = Mărimea paginii: +pdfjs-document-properties-page-size-unit-inches = in +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = verticală +pdfjs-document-properties-page-size-orientation-landscape = orizontală +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Literă +pdfjs-document-properties-page-size-name-legal = Legal + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Vizualizare web rapidă: +pdfjs-document-properties-linearized-yes = Da +pdfjs-document-properties-linearized-no = Nu +pdfjs-document-properties-close-button = Închide + +## Print + +pdfjs-print-progress-message = Se pregătește documentul pentru tipărire… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Renunță +pdfjs-printing-not-supported = Avertisment: Tipărirea nu este suportată în totalitate de acest browser. +pdfjs-printing-not-ready = Avertisment: PDF-ul nu este încărcat complet pentru tipărire. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Comută bara laterală +pdfjs-toggle-sidebar-button-label = Comută bara laterală +pdfjs-document-outline-button = + .title = Afișează schița documentului (dublu-clic pentru a extinde/restrânge toate elementele) +pdfjs-document-outline-button-label = Schița documentului +pdfjs-attachments-button = + .title = Afișează atașamentele +pdfjs-attachments-button-label = Atașamente +pdfjs-thumbs-button = + .title = Afișează miniaturi +pdfjs-thumbs-button-label = Miniaturi +pdfjs-findbar-button = + .title = Caută în document +pdfjs-findbar-button-label = Caută + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Pagina { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Miniatura paginii { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Caută + .placeholder = Caută în document… +pdfjs-find-previous-button = + .title = Mergi la apariția anterioară a textului +pdfjs-find-previous-button-label = Înapoi +pdfjs-find-next-button = + .title = Mergi la apariția următoare a textului +pdfjs-find-next-button-label = Înainte +pdfjs-find-highlight-checkbox = Evidențiază toate aparițiile +pdfjs-find-match-case-checkbox-label = Ține cont de majuscule și minuscule +pdfjs-find-entire-word-checkbox-label = Cuvinte întregi +pdfjs-find-reached-top = Am ajuns la începutul documentului, continuă de la sfârșit +pdfjs-find-reached-bottom = Am ajuns la sfârșitul documentului, continuă de la început +pdfjs-find-not-found = Nu s-a găsit textul + +## Predefined zoom values + +pdfjs-page-scale-width = Lățime pagină +pdfjs-page-scale-fit = Potrivire la pagină +pdfjs-page-scale-auto = Zoom automat +pdfjs-page-scale-actual = Mărime reală +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + + +## Loading indicator messages + +pdfjs-loading-error = A intervenit o eroare la încărcarea PDF-ului. +pdfjs-invalid-file-error = Fișier PDF nevalid sau corupt. +pdfjs-missing-file-error = Fișier PDF lipsă. +pdfjs-unexpected-response-error = Răspuns neașteptat de la server. +pdfjs-rendering-error = A intervenit o eroare la randarea paginii. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [Adnotare { $type }] + +## Password + +pdfjs-password-label = Introdu parola pentru a deschide acest fișier PDF. +pdfjs-password-invalid = Parolă nevalidă. Te rugăm să încerci din nou. +pdfjs-password-ok-button = OK +pdfjs-password-cancel-button = Renunță +pdfjs-web-fonts-disabled = Fonturile web sunt dezactivate: nu se pot folosi fonturile PDF încorporate. + +## Editing + + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + diff --git a/public/pdfjs/web/locale/ru/viewer.ftl b/public/pdfjs/web/locale/ru/viewer.ftl new file mode 100644 index 0000000..81c2f41 --- /dev/null +++ b/public/pdfjs/web/locale/ru/viewer.ftl @@ -0,0 +1,518 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Предыдущая страница +pdfjs-previous-button-label = Предыдущая +pdfjs-next-button = + .title = Следующая страница +pdfjs-next-button-label = Следующая +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Страница +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = из { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } из { $pagesCount }) +pdfjs-zoom-out-button = + .title = Уменьшить +pdfjs-zoom-out-button-label = Уменьшить +pdfjs-zoom-in-button = + .title = Увеличить +pdfjs-zoom-in-button-label = Увеличить +pdfjs-zoom-select = + .title = Масштаб +pdfjs-presentation-mode-button = + .title = Перейти в режим презентации +pdfjs-presentation-mode-button-label = Режим презентации +pdfjs-open-file-button = + .title = Открыть файл +pdfjs-open-file-button-label = Открыть +pdfjs-print-button = + .title = Печать +pdfjs-print-button-label = Печать +pdfjs-save-button = + .title = Сохранить +pdfjs-save-button-label = Сохранить +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Загрузить +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Загрузить +pdfjs-bookmark-button = + .title = Текущая страница (просмотр URL-адреса с текущей страницы) +pdfjs-bookmark-button-label = Текущая страница + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Инструменты +pdfjs-tools-button-label = Инструменты +pdfjs-first-page-button = + .title = Перейти на первую страницу +pdfjs-first-page-button-label = Перейти на первую страницу +pdfjs-last-page-button = + .title = Перейти на последнюю страницу +pdfjs-last-page-button-label = Перейти на последнюю страницу +pdfjs-page-rotate-cw-button = + .title = Повернуть по часовой стрелке +pdfjs-page-rotate-cw-button-label = Повернуть по часовой стрелке +pdfjs-page-rotate-ccw-button = + .title = Повернуть против часовой стрелки +pdfjs-page-rotate-ccw-button-label = Повернуть против часовой стрелки +pdfjs-cursor-text-select-tool-button = + .title = Включить Инструмент «Выделение текста» +pdfjs-cursor-text-select-tool-button-label = Инструмент «Выделение текста» +pdfjs-cursor-hand-tool-button = + .title = Включить Инструмент «Рука» +pdfjs-cursor-hand-tool-button-label = Инструмент «Рука» +pdfjs-scroll-page-button = + .title = Использовать прокрутку страниц +pdfjs-scroll-page-button-label = Прокрутка страниц +pdfjs-scroll-vertical-button = + .title = Использовать вертикальную прокрутку +pdfjs-scroll-vertical-button-label = Вертикальная прокрутка +pdfjs-scroll-horizontal-button = + .title = Использовать горизонтальную прокрутку +pdfjs-scroll-horizontal-button-label = Горизонтальная прокрутка +pdfjs-scroll-wrapped-button = + .title = Использовать масштабируемую прокрутку +pdfjs-scroll-wrapped-button-label = Масштабируемая прокрутка +pdfjs-spread-none-button = + .title = Не использовать режим разворотов страниц +pdfjs-spread-none-button-label = Без разворотов страниц +pdfjs-spread-odd-button = + .title = Развороты начинаются с нечётных номеров страниц +pdfjs-spread-odd-button-label = Нечётные страницы слева +pdfjs-spread-even-button = + .title = Развороты начинаются с чётных номеров страниц +pdfjs-spread-even-button-label = Чётные страницы слева + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Свойства документа… +pdfjs-document-properties-button-label = Свойства документа… +pdfjs-document-properties-file-name = Имя файла: +pdfjs-document-properties-file-size = Размер файла: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } КБ ({ $b } байт) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } МБ ({ $b } байт) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } КБ ({ $size_b } байт) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } МБ ({ $size_b } байт) +pdfjs-document-properties-title = Заголовок: +pdfjs-document-properties-author = Автор: +pdfjs-document-properties-subject = Тема: +pdfjs-document-properties-keywords = Ключевые слова: +pdfjs-document-properties-creation-date = Дата создания: +pdfjs-document-properties-modification-date = Дата изменения: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Приложение: +pdfjs-document-properties-producer = Производитель PDF: +pdfjs-document-properties-version = Версия PDF: +pdfjs-document-properties-page-count = Число страниц: +pdfjs-document-properties-page-size = Размер страницы: +pdfjs-document-properties-page-size-unit-inches = дюймов +pdfjs-document-properties-page-size-unit-millimeters = мм +pdfjs-document-properties-page-size-orientation-portrait = книжная +pdfjs-document-properties-page-size-orientation-landscape = альбомная +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Letter +pdfjs-document-properties-page-size-name-legal = Legal + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Быстрый просмотр в Web: +pdfjs-document-properties-linearized-yes = Да +pdfjs-document-properties-linearized-no = Нет +pdfjs-document-properties-close-button = Закрыть + +## Print + +pdfjs-print-progress-message = Подготовка документа к печати… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Отмена +pdfjs-printing-not-supported = Предупреждение: В этом браузере не полностью поддерживается печать. +pdfjs-printing-not-ready = Предупреждение: PDF не полностью загружен для печати. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Показать/скрыть боковую панель +pdfjs-toggle-sidebar-notification-button = + .title = Показать/скрыть боковую панель (документ имеет содержание/вложения/слои) +pdfjs-toggle-sidebar-button-label = Показать/скрыть боковую панель +pdfjs-document-outline-button = + .title = Показать содержание документа (двойной щелчок, чтобы развернуть/свернуть все элементы) +pdfjs-document-outline-button-label = Содержание документа +pdfjs-attachments-button = + .title = Показать вложения +pdfjs-attachments-button-label = Вложения +pdfjs-layers-button = + .title = Показать слои (дважды щёлкните, чтобы сбросить все слои к состоянию по умолчанию) +pdfjs-layers-button-label = Слои +pdfjs-thumbs-button = + .title = Показать миниатюры +pdfjs-thumbs-button-label = Миниатюры +pdfjs-current-outline-item-button = + .title = Найти текущий элемент структуры +pdfjs-current-outline-item-button-label = Текущий элемент структуры +pdfjs-findbar-button = + .title = Найти в документе +pdfjs-findbar-button-label = Найти +pdfjs-additional-layers = Дополнительные слои + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Страница { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Миниатюра страницы { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Найти + .placeholder = Найти в документе… +pdfjs-find-previous-button = + .title = Найти предыдущее вхождение фразы в текст +pdfjs-find-previous-button-label = Назад +pdfjs-find-next-button = + .title = Найти следующее вхождение фразы в текст +pdfjs-find-next-button-label = Далее +pdfjs-find-highlight-checkbox = Подсветить все +pdfjs-find-match-case-checkbox-label = С учётом регистра +pdfjs-find-match-diacritics-checkbox-label = С учётом диакритических знаков +pdfjs-find-entire-word-checkbox-label = Слова целиком +pdfjs-find-reached-top = Достигнут верх документа, продолжено снизу +pdfjs-find-reached-bottom = Достигнут конец документа, продолжено сверху +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] { $current } из { $total } совпадения + [few] { $current } из { $total } совпадений + *[many] { $current } из { $total } совпадений + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] Более { $limit } совпадения + [few] Более { $limit } совпадений + *[many] Более { $limit } совпадений + } +pdfjs-find-not-found = Фраза не найдена + +## Predefined zoom values + +pdfjs-page-scale-width = По ширине страницы +pdfjs-page-scale-fit = По размеру страницы +pdfjs-page-scale-auto = Автоматически +pdfjs-page-scale-actual = Реальный размер +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Страница { $page } + +## Loading indicator messages + +pdfjs-loading-error = При загрузке PDF произошла ошибка. +pdfjs-invalid-file-error = Некорректный или повреждённый PDF-файл. +pdfjs-missing-file-error = PDF-файл отсутствует. +pdfjs-unexpected-response-error = Неожиданный ответ сервера. +pdfjs-rendering-error = При создании страницы произошла ошибка. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [Аннотация { $type }] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Введите пароль, чтобы открыть этот PDF-файл. +pdfjs-password-invalid = Неверный пароль. Пожалуйста, попробуйте снова. +pdfjs-password-ok-button = OK +pdfjs-password-cancel-button = Отмена +pdfjs-web-fonts-disabled = Веб-шрифты отключены: не удалось задействовать встроенные PDF-шрифты. + +## Editing + +pdfjs-editor-free-text-button = + .title = Текст +pdfjs-editor-free-text-button-label = Текст +pdfjs-editor-ink-button = + .title = Рисовать +pdfjs-editor-ink-button-label = Рисовать +pdfjs-editor-stamp-button = + .title = Добавить или изменить изображения +pdfjs-editor-stamp-button-label = Добавить или изменить изображения +pdfjs-editor-highlight-button = + .title = Выделение +pdfjs-editor-highlight-button-label = Выделение +pdfjs-highlight-floating-button1 = + .title = Выделение + .aria-label = Выделение +pdfjs-highlight-floating-button-label = Выделение + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Удалить рисунок +pdfjs-editor-remove-freetext-button = + .title = Удалить текст +pdfjs-editor-remove-stamp-button = + .title = Удалить изображение +pdfjs-editor-remove-highlight-button = + .title = Удалить выделение + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Цвет +pdfjs-editor-free-text-size-input = Размер +pdfjs-editor-ink-color-input = Цвет +pdfjs-editor-ink-thickness-input = Толщина +pdfjs-editor-ink-opacity-input = Прозрачность +pdfjs-editor-stamp-add-image-button = + .title = Добавить изображение +pdfjs-editor-stamp-add-image-button-label = Добавить изображение +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Толщина +pdfjs-editor-free-highlight-thickness-title = + .title = Изменить толщину при выделении элементов, кроме текста +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = Текстовый редактор + .default-content = Начните ввод... +pdfjs-free-text = + .aria-label = Текстовый редактор +pdfjs-free-text-default-content = Начните вводить… +pdfjs-ink = + .aria-label = Редактор рисования +pdfjs-ink-canvas = + .aria-label = Созданное пользователем изображение + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = Альтернативный текст +pdfjs-editor-alt-text-edit-button = + .aria-label = Изменить альтернативный текст +pdfjs-editor-alt-text-edit-button-label = Изменить альтернативный текст +pdfjs-editor-alt-text-dialog-label = Выберите вариант +pdfjs-editor-alt-text-dialog-description = Альтернативный текст помогает, когда люди не видят изображение или оно не загружается. +pdfjs-editor-alt-text-add-description-label = Добавить описание +pdfjs-editor-alt-text-add-description-description = Старайтесь составлять 1–2 предложения, описывающих предмет, обстановку или действия. +pdfjs-editor-alt-text-mark-decorative-label = Отметить как декоративное +pdfjs-editor-alt-text-mark-decorative-description = Используется для декоративных изображений, таких как рамки или водяные знаки. +pdfjs-editor-alt-text-cancel-button = Отменить +pdfjs-editor-alt-text-save-button = Сохранить +pdfjs-editor-alt-text-decorative-tooltip = Помечен как декоративный +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = Например: «Молодой человек садится за стол, чтобы поесть» +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = Альтернативный текст + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Левый верхний угол — изменить размер +pdfjs-editor-resizer-label-top-middle = Вверху посередине — изменить размер +pdfjs-editor-resizer-label-top-right = Верхний правый угол — изменить размер +pdfjs-editor-resizer-label-middle-right = В центре справа — изменить размер +pdfjs-editor-resizer-label-bottom-right = Нижний правый угол — изменить размер +pdfjs-editor-resizer-label-bottom-middle = Внизу посередине — изменить размер +pdfjs-editor-resizer-label-bottom-left = Нижний левый угол — изменить размер +pdfjs-editor-resizer-label-middle-left = В центре слева — изменить размер +pdfjs-editor-resizer-top-left = + .aria-label = Левый верхний угол — изменить размер +pdfjs-editor-resizer-top-middle = + .aria-label = Вверху посередине — изменить размер +pdfjs-editor-resizer-top-right = + .aria-label = Верхний правый угол — изменить размер +pdfjs-editor-resizer-middle-right = + .aria-label = В центре справа — изменить размер +pdfjs-editor-resizer-bottom-right = + .aria-label = Нижний правый угол — изменить размер +pdfjs-editor-resizer-bottom-middle = + .aria-label = Внизу посередине — изменить размер +pdfjs-editor-resizer-bottom-left = + .aria-label = Нижний левый угол — изменить размер +pdfjs-editor-resizer-middle-left = + .aria-label = В центре слева — изменить размер + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Цвет выделения +pdfjs-editor-colorpicker-button = + .title = Изменить цвет +pdfjs-editor-colorpicker-dropdown = + .aria-label = Выбор цвета +pdfjs-editor-colorpicker-yellow = + .title = Жёлтый +pdfjs-editor-colorpicker-green = + .title = Зелёный +pdfjs-editor-colorpicker-blue = + .title = Синий +pdfjs-editor-colorpicker-pink = + .title = Розовый +pdfjs-editor-colorpicker-red = + .title = Красный + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Показать все +pdfjs-editor-highlight-show-all-button = + .title = Показать все + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = Изменить альтернативный текст (описание изображения) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = Добавить альтернативный текст (описание изображения) +pdfjs-editor-new-alt-text-textarea = + .placeholder = Напишите здесь своё описание… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = Короткое описание для людей, которые не видят изображение, или если изображение не загружается. +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = Этот альтернативный текст был создан автоматически и может быть неточным. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Подробнее +pdfjs-editor-new-alt-text-create-automatically-button-label = Автоматически создавать альтернативный текст +pdfjs-editor-new-alt-text-not-now-button = Не сейчас +pdfjs-editor-new-alt-text-error-title = Не удалось автоматически создать альтернативный текст +pdfjs-editor-new-alt-text-error-description = Пожалуйста, напишите свой альтернативный текст или попробуйте ещё раз позже. +pdfjs-editor-new-alt-text-error-close-button = Закрыть +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = Загрузка модели ИИ для альтернативного текста ({ $downloadedSize } из { $totalSize } МБ) + .aria-valuetext = Загрузка модели ИИ для альтернативного текста ({ $downloadedSize } из { $totalSize } МБ) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = Альтернативный текст добавлен +pdfjs-editor-new-alt-text-added-button-label = Альтернативный текст добавлен +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = Отсутствует альтернативный текст +pdfjs-editor-new-alt-text-missing-button-label = Отсутствует альтернативный текст +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = Оценить альтернативный текст +pdfjs-editor-new-alt-text-to-review-button-label = Оценить альтернативный текст +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Создано автоматически: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = Настройки альтернативного текста для изображения +pdfjs-image-alt-text-settings-button-label = Настройки альтернативного текста для изображения +pdfjs-editor-alt-text-settings-dialog-label = Настройки альтернативного текста для изображения +pdfjs-editor-alt-text-settings-automatic-title = Автоматический альтернативный текст +pdfjs-editor-alt-text-settings-create-model-button-label = Автоматически создавать альтернативный текст +pdfjs-editor-alt-text-settings-create-model-description = Предлагает описания, чтобы помочь людям, которые не видят изображение, или если изображение не загружается. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = ИИ-модель альтернативного текста ({ $totalSize } МБ) +pdfjs-editor-alt-text-settings-ai-model-description = Запускается локально на вашем устройстве, поэтому ваши данные остаются конфиденциальными. Требуется для автоматического альтернативного текста. +pdfjs-editor-alt-text-settings-delete-model-button = Удалить +pdfjs-editor-alt-text-settings-download-model-button = Загрузить +pdfjs-editor-alt-text-settings-downloading-model-button = Загрузка… +pdfjs-editor-alt-text-settings-editor-title = Редактор альтернативного текста +pdfjs-editor-alt-text-settings-show-dialog-button-label = Сразу показывать редактор альтернативного текста при добавлении изображения +pdfjs-editor-alt-text-settings-show-dialog-description = Помогает вам убедиться, что все ваши изображения имеют альтернативный текст. +pdfjs-editor-alt-text-settings-close-button = Закрыть + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = Выделение удалено +pdfjs-editor-undo-bar-message-freetext = Текст удалён +pdfjs-editor-undo-bar-message-ink = Рисунок удалён +pdfjs-editor-undo-bar-message-stamp = Изображение удалено +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = + { $count -> + [one] { $count } аннотация удалена + [few] { $count } аннотации удалены + *[many] { $count } аннотаций удалены + } +pdfjs-editor-undo-bar-undo-button = + .title = Отменить +pdfjs-editor-undo-bar-undo-button-label = Отменить +pdfjs-editor-undo-bar-close-button = + .title = Закрыть +pdfjs-editor-undo-bar-close-button-label = Закрыть diff --git a/public/pdfjs/web/locale/sat/viewer.ftl b/public/pdfjs/web/locale/sat/viewer.ftl new file mode 100644 index 0000000..2fbbc12 --- /dev/null +++ b/public/pdfjs/web/locale/sat/viewer.ftl @@ -0,0 +1,325 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = ᱢᱟᱲᱟᱝ ᱥᱟᱦᱴᱟ +pdfjs-previous-button-label = ᱢᱟᱲᱟᱝᱟᱜ +pdfjs-next-button = + .title = ᱤᱱᱟᱹ ᱛᱟᱭᱚᱢ ᱥᱟᱦᱴᱟ +pdfjs-next-button-label = ᱤᱱᱟᱹ ᱛᱟᱭᱚᱢ +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = ᱥᱟᱦᱴᱟ +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = ᱨᱮᱭᱟᱜ { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } ᱠᱷᱚᱱ { $pagesCount }) +pdfjs-zoom-out-button = + .title = ᱦᱤᱲᱤᱧ ᱛᱮᱭᱟᱨ +pdfjs-zoom-out-button-label = ᱦᱤᱲᱤᱧ ᱛᱮᱭᱟᱨ +pdfjs-zoom-in-button = + .title = ᱢᱟᱨᱟᱝ ᱛᱮᱭᱟᱨ +pdfjs-zoom-in-button-label = ᱢᱟᱨᱟᱝ ᱛᱮᱭᱟᱨ +pdfjs-zoom-select = + .title = ᱡᱩᱢ +pdfjs-presentation-mode-button = + .title = ᱩᱫᱩᱜ ᱥᱚᱫᱚᱨ ᱚᱵᱚᱥᱛᱟ ᱨᱮ ᱚᱛᱟᱭ ᱢᱮ +pdfjs-presentation-mode-button-label = ᱩᱫᱩᱜ ᱥᱚᱫᱚᱨ ᱚᱵᱚᱥᱛᱟ ᱨᱮ +pdfjs-open-file-button = + .title = ᱨᱮᱫ ᱡᱷᱤᱡᱽ ᱢᱮ +pdfjs-open-file-button-label = ᱡᱷᱤᱡᱽ ᱢᱮ +pdfjs-print-button = + .title = ᱪᱷᱟᱯᱟ +pdfjs-print-button-label = ᱪᱷᱟᱯᱟ +pdfjs-save-button = + .title = ᱥᱟᱺᱪᱟᱣ ᱢᱮ +pdfjs-save-button-label = ᱥᱟᱺᱪᱟᱣ ᱢᱮ +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = ᱰᱟᱣᱩᱱᱞᱚᱰ +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = ᱰᱟᱣᱩᱱᱞᱚᱰ +pdfjs-bookmark-button = + .title = ᱱᱤᱛᱚᱜᱟᱜ ᱥᱟᱦᱴᱟ (ᱱᱤᱛᱚᱜᱟᱜ ᱥᱟᱦᱴᱟ ᱠᱷᱚᱱ URL ᱫᱮᱠᱷᱟᱣ ᱢᱮ) +pdfjs-bookmark-button-label = ᱱᱤᱛᱚᱜᱟᱜ ᱥᱟᱦᱴᱟ + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = ᱦᱟᱹᱛᱤᱭᱟᱹᱨ ᱠᱚ +pdfjs-tools-button-label = ᱦᱟᱹᱛᱤᱭᱟᱹᱨ ᱠᱚ +pdfjs-first-page-button = + .title = ᱯᱩᱭᱞᱩ ᱥᱟᱦᱴᱟ ᱥᱮᱫ ᱪᱟᱞᱟᱜ ᱢᱮ +pdfjs-first-page-button-label = ᱯᱩᱭᱞᱩ ᱥᱟᱦᱴᱟ ᱥᱮᱫ ᱪᱟᱞᱟᱜ ᱢᱮ +pdfjs-last-page-button = + .title = ᱢᱩᱪᱟᱹᱫ ᱥᱟᱦᱴᱟ ᱥᱮᱫ ᱪᱟᱞᱟᱜ ᱢᱮ +pdfjs-last-page-button-label = ᱢᱩᱪᱟᱹᱫ ᱥᱟᱦᱴᱟ ᱥᱮᱫ ᱪᱟᱞᱟᱜ ᱢᱮ +pdfjs-page-rotate-cw-button = + .title = ᱜᱷᱚᱰᱤ ᱦᱤᱥᱟᱹᱵ ᱛᱮ ᱟᱹᱪᱩᱨ +pdfjs-page-rotate-cw-button-label = ᱜᱷᱚᱰᱤ ᱦᱤᱥᱟᱹᱵ ᱛᱮ ᱟᱹᱪᱩᱨ +pdfjs-page-rotate-ccw-button = + .title = ᱜᱷᱚᱰᱤ ᱦᱤᱥᱟᱹᱵ ᱛᱮ ᱩᱞᱴᱟᱹ ᱟᱹᱪᱩᱨ +pdfjs-page-rotate-ccw-button-label = ᱜᱷᱚᱰᱤ ᱦᱤᱥᱟᱹᱵ ᱛᱮ ᱩᱞᱴᱟᱹ ᱟᱹᱪᱩᱨ +pdfjs-cursor-text-select-tool-button = + .title = ᱚᱞ ᱵᱟᱪᱷᱟᱣ ᱦᱟᱹᱛᱤᱭᱟᱨ ᱮᱢ ᱪᱷᱚᱭ ᱢᱮ +pdfjs-cursor-text-select-tool-button-label = ᱚᱞ ᱵᱟᱪᱷᱟᱣ ᱦᱟᱹᱛᱤᱭᱟᱨ +pdfjs-cursor-hand-tool-button = + .title = ᱛᱤ ᱦᱟᱹᱛᱤᱭᱟᱨ ᱮᱢ ᱪᱷᱚᱭ ᱢᱮ +pdfjs-cursor-hand-tool-button-label = ᱛᱤ ᱦᱟᱹᱛᱤᱭᱟᱨ +pdfjs-scroll-page-button = + .title = ᱥᱟᱦᱴᱟ ᱜᱩᱲᱟᱹᱣ ᱵᱮᱵᱷᱟᱨ ᱢᱮ +pdfjs-scroll-page-button-label = ᱥᱟᱦᱴᱟ ᱜᱩᱲᱟᱹᱣ +pdfjs-scroll-vertical-button = + .title = ᱥᱤᱫᱽ ᱜᱩᱲᱟᱹᱣ ᱵᱮᱵᱷᱟᱨ ᱢᱮ +pdfjs-scroll-vertical-button-label = ᱥᱤᱫᱽ ᱜᱩᱲᱟᱹᱣ +pdfjs-scroll-horizontal-button = + .title = ᱜᱤᱛᱤᱡ ᱛᱮ ᱜᱩᱲᱟᱹᱣ ᱵᱮᱵᱷᱟᱨ ᱢᱮ +pdfjs-scroll-horizontal-button-label = ᱜᱤᱛᱤᱡ ᱛᱮ ᱜᱩᱲᱟᱹᱣ +pdfjs-scroll-wrapped-button = + .title = ᱞᱤᱯᱴᱟᱹᱣ ᱜᱩᱰᱨᱟᱹᱣ ᱵᱮᱵᱷᱟᱨ ᱢᱮ +pdfjs-scroll-wrapped-button-label = ᱞᱤᱯᱴᱟᱣ ᱜᱩᱰᱨᱟᱹᱣ +pdfjs-spread-none-button = + .title = ᱟᱞᱚᱢ ᱡᱚᱲᱟᱣ ᱟ ᱥᱟᱦᱴᱟ ᱫᱚ ᱯᱟᱥᱱᱟᱣᱜᱼᱟ +pdfjs-spread-none-button-label = ᱯᱟᱥᱱᱟᱣ ᱵᱟᱹᱱᱩᱜᱼᱟ +pdfjs-spread-odd-button = + .title = ᱥᱟᱦᱴᱟ ᱯᱟᱥᱱᱟᱣ ᱡᱚᱲᱟᱣ ᱢᱮ ᱡᱟᱦᱟᱸ ᱫᱚ ᱚᱰᱼᱮᱞ ᱥᱟᱦᱴᱟᱠᱚ ᱥᱟᱞᱟᱜ ᱮᱛᱦᱚᱵᱚᱜ ᱠᱟᱱᱟ +pdfjs-spread-odd-button-label = ᱚᱰ ᱯᱟᱥᱱᱟᱣ +pdfjs-spread-even-button = + .title = ᱥᱟᱦᱴᱟ ᱯᱟᱥᱱᱟᱣ ᱡᱚᱲᱟᱣ ᱢᱮ ᱡᱟᱦᱟᱸ ᱫᱚ ᱤᱣᱮᱱᱼᱮᱞ ᱥᱟᱦᱴᱟᱠᱚ ᱥᱟᱞᱟᱜ ᱮᱛᱦᱚᱵᱚᱜ ᱠᱟᱱᱟ +pdfjs-spread-even-button-label = ᱯᱟᱥᱱᱟᱣ ᱤᱣᱮᱱ + +## Document properties dialog + +pdfjs-document-properties-button = + .title = ᱫᱚᱞᱤᱞ ᱜᱩᱱᱠᱚ … +pdfjs-document-properties-button-label = ᱫᱚᱞᱤᱞ ᱜᱩᱱᱠᱚ … +pdfjs-document-properties-file-name = ᱨᱮᱫᱽ ᱧᱩᱛᱩᱢ : +pdfjs-document-properties-file-size = ᱨᱮᱫᱽ ᱢᱟᱯ : +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } ᱵᱟᱭᱤᱴ ᱠᱚ) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } ᱵᱟᱭᱤᱴ ᱠᱚ) +pdfjs-document-properties-title = ᱧᱩᱛᱩᱢ : +pdfjs-document-properties-author = ᱚᱱᱚᱞᱤᱭᱟᱹ : +pdfjs-document-properties-subject = ᱵᱤᱥᱚᱭ : +pdfjs-document-properties-keywords = ᱠᱟᱹᱴᱷᱤ ᱥᱟᱵᱟᱫᱽ : +pdfjs-document-properties-creation-date = ᱛᱮᱭᱟᱨ ᱢᱟᱸᱦᱤᱛ : +pdfjs-document-properties-modification-date = ᱵᱚᱫᱚᱞ ᱦᱚᱪᱚ ᱢᱟᱹᱦᱤᱛ : +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = ᱵᱮᱱᱟᱣᱤᱡ : +pdfjs-document-properties-producer = PDF ᱛᱮᱭᱟᱨ ᱚᱰᱚᱠᱤᱡ : +pdfjs-document-properties-version = PDF ᱵᱷᱟᱹᱨᱥᱚᱱ : +pdfjs-document-properties-page-count = ᱥᱟᱦᱴᱟ ᱞᱮᱠᱷᱟ : +pdfjs-document-properties-page-size = ᱥᱟᱦᱴᱟ ᱢᱟᱯ : +pdfjs-document-properties-page-size-unit-inches = ᱤᱧᱪ +pdfjs-document-properties-page-size-unit-millimeters = ᱢᱤᱢᱤ +pdfjs-document-properties-page-size-orientation-portrait = ᱯᱚᱴᱨᱮᱴ +pdfjs-document-properties-page-size-orientation-landscape = ᱞᱮᱱᱰᱥᱠᱮᱯ +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = ᱪᱤᱴᱷᱤ +pdfjs-document-properties-page-size-name-legal = ᱠᱟᱹᱱᱩᱱᱤ + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = ᱞᱚᱜᱚᱱ ᱣᱮᱵᱽ ᱧᱮᱞ : +pdfjs-document-properties-linearized-yes = ᱦᱚᱭ +pdfjs-document-properties-linearized-no = ᱵᱟᱝ +pdfjs-document-properties-close-button = ᱵᱚᱸᱫᱚᱭ ᱢᱮ + +## Print + +pdfjs-print-progress-message = ᱪᱷᱟᱯᱟ ᱞᱟᱹᱜᱤᱫ ᱫᱚᱞᱤᱞ ᱛᱮᱭᱟᱨᱚᱜ ᱠᱟᱱᱟ … +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = ᱵᱟᱹᱰᱨᱟᱹ +pdfjs-printing-not-supported = ᱦᱚᱥᱤᱭᱟᱨ : ᱪᱷᱟᱯᱟ ᱱᱚᱣᱟ ᱯᱟᱱᱛᱮᱭᱟᱜ ᱫᱟᱨᱟᱭ ᱛᱮ ᱯᱩᱨᱟᱹᱣ ᱵᱟᱭ ᱜᱚᱲᱚᱣᱟᱠᱟᱱᱟ ᱾ +pdfjs-printing-not-ready = ᱦᱩᱥᱤᱭᱟᱹᱨ : ᱪᱷᱟᱯᱟ ᱞᱟᱹᱜᱤᱫ PDF ᱯᱩᱨᱟᱹ ᱵᱟᱭ ᱞᱟᱫᱮ ᱟᱠᱟᱱᱟ ᱾ + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = ᱫᱷᱟᱨᱮᱵᱟᱨ ᱥᱮᱫ ᱩᱪᱟᱹᱲᱚᱜ ᱢᱮ +pdfjs-toggle-sidebar-notification-button = + .title = ᱫᱷᱟᱨᱮᱵᱟᱨ ᱥᱮᱫ ᱩᱪᱟᱹᱲᱚᱜ ᱢᱮ (ᱫᱚᱞᱤᱞ ᱨᱮ ᱟᱣᱴᱞᱟᱭᱤᱢ ᱢᱮᱱᱟᱜᱼᱟ/ᱞᱟᱪᱷᱟᱠᱚ/ᱯᱚᱨᱚᱛᱠᱚ) +pdfjs-toggle-sidebar-button-label = ᱫᱷᱟᱨᱮᱵᱟᱨ ᱥᱮᱫ ᱩᱪᱟᱹᱲᱚᱜ ᱢᱮ +pdfjs-document-outline-button = + .title = ᱫᱚᱞᱚᱞ ᱟᱣᱴᱞᱟᱭᱤᱱ ᱫᱮᱠᱷᱟᱣ ᱢᱮ (ᱡᱷᱚᱛᱚ ᱡᱤᱱᱤᱥᱠᱚ ᱵᱟᱨ ᱡᱮᱠᱷᱟ ᱚᱛᱟ ᱠᱮᱛᱮ ᱡᱷᱟᱹᱞ/ᱦᱩᱰᱤᱧ ᱪᱷᱚᱭ ᱢᱮ) +pdfjs-document-outline-button-label = ᱫᱚᱞᱤᱞ ᱛᱮᱭᱟᱨ ᱛᱮᱫ +pdfjs-attachments-button = + .title = ᱞᱟᱴᱷᱟ ᱥᱮᱞᱮᱫ ᱠᱚ ᱩᱫᱩᱜᱽ ᱢᱮ +pdfjs-attachments-button-label = ᱞᱟᱴᱷᱟ ᱥᱮᱞᱮᱫ ᱠᱚ +pdfjs-layers-button = + .title = ᱯᱚᱨᱚᱛ ᱫᱮᱠᱷᱟᱣ ᱢᱮ (ᱢᱩᱞ ᱡᱟᱭᱜᱟ ᱛᱮ ᱡᱷᱚᱛᱚ ᱯᱚᱨᱚᱛᱠᱚ ᱨᱤᱥᱮᱴ ᱞᱟᱹᱜᱤᱫ ᱵᱟᱨ ᱡᱮᱠᱷᱟ ᱚᱛᱚᱭ ᱢᱮ) +pdfjs-layers-button-label = ᱯᱚᱨᱚᱛᱠᱚ +pdfjs-thumbs-button = + .title = ᱪᱤᱛᱟᱹᱨ ᱟᱦᱞᱟ ᱠᱚ ᱩᱫᱩᱜᱽ ᱢᱮ +pdfjs-thumbs-button-label = ᱪᱤᱛᱟᱹᱨ ᱟᱦᱞᱟ ᱠᱚ +pdfjs-current-outline-item-button = + .title = ᱱᱤᱛᱚᱜᱟᱜ ᱟᱣᱴᱞᱟᱭᱤᱱ ᱡᱟᱱᱤᱥ ᱯᱟᱱᱛᱮ ᱢᱮ +pdfjs-current-outline-item-button-label = ᱱᱤᱛᱚᱜᱟᱜ ᱟᱣᱴᱞᱟᱭᱤᱱ ᱡᱟᱱᱤᱥ +pdfjs-findbar-button = + .title = ᱫᱚᱞᱤᱞ ᱨᱮ ᱯᱟᱱᱛᱮ +pdfjs-findbar-button-label = ᱥᱮᱸᱫᱽᱨᱟᱭ ᱢᱮ +pdfjs-additional-layers = ᱵᱟᱹᱲᱛᱤ ᱯᱚᱨᱚᱛᱠᱚ + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = { $page } ᱥᱟᱦᱴᱟ +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = { $page } ᱥᱟᱦᱴᱟ ᱨᱮᱭᱟᱜ ᱪᱤᱛᱟᱹᱨ ᱟᱦᱞᱟ + +## Find panel button title and messages + +pdfjs-find-input = + .title = ᱥᱮᱸᱫᱽᱨᱟᱭ ᱢᱮ + .placeholder = ᱫᱚᱞᱤᱞ ᱨᱮ ᱯᱟᱱᱛᱮ ᱢᱮ … +pdfjs-find-previous-button = + .title = ᱟᱭᱟᱛ ᱦᱤᱸᱥ ᱨᱮᱭᱟᱜ ᱯᱟᱹᱦᱤᱞ ᱥᱮᱫᱟᱜ ᱚᱰᱚᱠ ᱧᱟᱢ ᱢᱮ +pdfjs-find-previous-button-label = ᱢᱟᱲᱟᱝᱟᱜ +pdfjs-find-next-button = + .title = ᱟᱭᱟᱛ ᱦᱤᱸᱥ ᱨᱮᱭᱟᱜ ᱤᱱᱟᱹ ᱛᱟᱭᱚᱢ ᱚᱰᱚᱠ ᱧᱟᱢ ᱢᱮ +pdfjs-find-next-button-label = ᱤᱱᱟᱹ ᱛᱟᱭᱚᱢ +pdfjs-find-highlight-checkbox = ᱡᱷᱚᱛᱚ ᱩᱫᱩᱜ ᱨᱟᱠᱟᱵ +pdfjs-find-match-case-checkbox-label = ᱡᱚᱲ ᱠᱟᱛᱷᱟ +pdfjs-find-match-diacritics-checkbox-label = ᱵᱤᱥᱮᱥᱚᱠ ᱠᱚ ᱢᱮᱲᱟᱣ ᱢᱮ +pdfjs-find-entire-word-checkbox-label = ᱡᱷᱚᱛᱚ ᱟᱹᱲᱟᱹᱠᱚ +pdfjs-find-reached-top = ᱫᱚᱞᱤᱞ ᱨᱮᱭᱟᱜ ᱪᱤᱴ ᱨᱮ ᱥᱮᱴᱮᱨ, ᱞᱟᱛᱟᱨ ᱠᱷᱚᱱ ᱞᱮᱛᱟᱲ +pdfjs-find-reached-bottom = ᱫᱚᱞᱤᱞ ᱨᱮᱭᱟᱜ ᱢᱩᱪᱟᱹᱫ ᱨᱮ ᱥᱮᱴᱮᱨ, ᱪᱚᱴ ᱠᱷᱚᱱ ᱞᱮᱛᱟᱲ +pdfjs-find-not-found = ᱛᱚᱯᱚᱞ ᱫᱚᱱᱚᱲ ᱵᱟᱝ ᱧᱟᱢ ᱞᱮᱱᱟ + +## Predefined zoom values + +pdfjs-page-scale-width = ᱥᱟᱦᱴᱟ ᱚᱥᱟᱨ +pdfjs-page-scale-fit = ᱥᱟᱦᱴᱟ ᱠᱷᱟᱯ +pdfjs-page-scale-auto = ᱟᱡᱼᱟᱡ ᱛᱮ ᱦᱩᱰᱤᱧ ᱞᱟᱹᱴᱩ ᱛᱮᱭᱟᱨ +pdfjs-page-scale-actual = ᱴᱷᱤᱠ ᱢᱟᱨᱟᱝ ᱛᱮᱫ +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = { $page } ᱥᱟᱦᱴᱟ + +## Loading indicator messages + +pdfjs-loading-error = PDF ᱞᱟᱫᱮ ᱡᱚᱦᱚᱜ ᱢᱤᱫ ᱵᱷᱩᱞ ᱦᱩᱭ ᱮᱱᱟ ᱾ +pdfjs-invalid-file-error = ᱵᱟᱝ ᱵᱟᱛᱟᱣ ᱟᱨᱵᱟᱝᱠᱷᱟᱱ ᱰᱤᱜᱟᱹᱣ PDF ᱨᱮᱫᱽ ᱾ +pdfjs-missing-file-error = ᱟᱫᱟᱜ PDF ᱨᱮᱫᱽ ᱾ +pdfjs-unexpected-response-error = ᱵᱟᱝᱵᱩᱡᱷ ᱥᱚᱨᱵᱷᱚᱨ ᱛᱮᱞᱟ ᱾ +pdfjs-rendering-error = ᱥᱟᱦᱴᱟ ᱮᱢ ᱡᱚᱦᱚᱠ ᱢᱤᱫ ᱵᱷᱩᱞ ᱦᱩᱭ ᱮᱱᱟ ᱾ + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } ᱢᱚᱱᱛᱚ ᱮᱢ] + +## Password + +pdfjs-password-label = ᱱᱚᱶᱟ PDF ᱨᱮᱫᱽ ᱡᱷᱤᱡᱽ ᱞᱟᱹᱜᱤᱫ ᱫᱟᱱᱟᱝ ᱥᱟᱵᱟᱫᱽ ᱟᱫᱮᱨ ᱢᱮ ᱾ +pdfjs-password-invalid = ᱵᱷᱩᱞ ᱫᱟᱱᱟᱝ ᱥᱟᱵᱟᱫᱽ ᱾ ᱫᱟᱭᱟᱠᱟᱛᱮ ᱫᱩᱦᱲᱟᱹ ᱪᱮᱥᱴᱟᱭ ᱢᱮ ᱾ +pdfjs-password-ok-button = ᱴᱷᱤᱠ +pdfjs-password-cancel-button = ᱵᱟᱹᱰᱨᱟᱹ +pdfjs-web-fonts-disabled = ᱣᱮᱵᱽ ᱪᱤᱠᱤ ᱵᱟᱝ ᱦᱩᱭ ᱦᱚᱪᱚ ᱠᱟᱱᱟ : ᱵᱷᱤᱛᱤᱨ ᱛᱷᱟᱯᱚᱱ PDF ᱪᱤᱠᱤ ᱵᱮᱵᱷᱟᱨ ᱵᱟᱝ ᱦᱩᱭ ᱠᱮᱭᱟ ᱾ + +## Editing + +pdfjs-editor-free-text-button = + .title = ᱚᱞ +pdfjs-editor-free-text-button-label = ᱚᱞ +pdfjs-editor-ink-button = + .title = ᱛᱮᱭᱟᱨ +pdfjs-editor-ink-button-label = ᱛᱮᱭᱟᱨ +pdfjs-editor-stamp-button = + .title = ᱪᱤᱛᱟᱹᱨᱠᱚ ᱥᱮᱞᱮᱫ ᱥᱮ ᱥᱟᱯᱲᱟᱣ ᱢᱮ +pdfjs-editor-stamp-button-label = ᱪᱤᱛᱟᱹᱨᱠᱚ ᱥᱮᱞᱮᱫ ᱥᱮ ᱥᱟᱯᱲᱟᱣ ᱢᱮ + +## Remove button for the various kind of editor. + + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = ᱨᱚᱝ +pdfjs-editor-free-text-size-input = ᱢᱟᱯ +pdfjs-editor-ink-color-input = ᱨᱚᱝ +pdfjs-editor-ink-thickness-input = ᱢᱚᱴᱟ +pdfjs-editor-ink-opacity-input = ᱟᱨᱯᱟᱨ +pdfjs-editor-stamp-add-image-button = + .title = ᱪᱤᱛᱟᱹᱨ ᱥᱮᱞᱮᱫ ᱢᱮ +pdfjs-editor-stamp-add-image-button-label = ᱪᱤᱛᱟᱹᱨ ᱥᱮᱞᱮᱫ ᱢᱮ +pdfjs-free-text = + .aria-label = ᱚᱞ ᱥᱟᱯᱲᱟᱣᱤᱭᱟᱹ +pdfjs-free-text-default-content = ᱚᱞ ᱮᱛᱦᱚᱵ ᱢᱮ … +pdfjs-ink = + .aria-label = ᱛᱮᱭᱟᱨ ᱥᱟᱯᱲᱟᱣᱤᱭᱟᱹ +pdfjs-ink-canvas = + .aria-label = ᱵᱮᱵᱷᱟᱨᱤᱭᱟᱹ ᱛᱮᱭᱟᱨ ᱠᱟᱫ ᱪᱤᱛᱟᱹᱨ + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + + +## Color picker + + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + + +## Image alt-text settings + diff --git a/public/pdfjs/web/locale/sc/viewer.ftl b/public/pdfjs/web/locale/sc/viewer.ftl new file mode 100644 index 0000000..1137c2b --- /dev/null +++ b/public/pdfjs/web/locale/sc/viewer.ftl @@ -0,0 +1,367 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Pàgina anteriore +pdfjs-previous-button-label = S'ischeda chi b'est primu +pdfjs-next-button = + .title = Pàgina imbeniente +pdfjs-next-button-label = Imbeniente +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Pàgina +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = de { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } de { $pagesCount }) +pdfjs-zoom-out-button = + .title = Impitica +pdfjs-zoom-out-button-label = Impitica +pdfjs-zoom-in-button = + .title = Ismànnia +pdfjs-zoom-in-button-label = Ismànnia +pdfjs-zoom-select = + .title = Ismànnia +pdfjs-presentation-mode-button = + .title = Cola a sa modalidade de presentatzione +pdfjs-presentation-mode-button-label = Modalidade de presentatzione +pdfjs-open-file-button = + .title = Aberi s'archìviu +pdfjs-open-file-button-label = Abertu +pdfjs-print-button = + .title = Imprenta +pdfjs-print-button-label = Imprenta +pdfjs-save-button = + .title = Sarva +pdfjs-save-button-label = Sarva +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Iscàrriga +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Iscàrriga +pdfjs-bookmark-button = + .title = Pàgina atuale (ammustra s’URL de sa pàgina atuale) +pdfjs-bookmark-button-label = Pàgina atuale + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Istrumentos +pdfjs-tools-button-label = Istrumentos +pdfjs-first-page-button = + .title = Bae a sa prima pàgina +pdfjs-first-page-button-label = Bae a sa prima pàgina +pdfjs-last-page-button = + .title = Bae a s'ùrtima pàgina +pdfjs-last-page-button-label = Bae a s'ùrtima pàgina +pdfjs-page-rotate-cw-button = + .title = Gira in sensu oràriu +pdfjs-page-rotate-cw-button-label = Gira in sensu oràriu +pdfjs-page-rotate-ccw-button = + .title = Gira in sensu anti-oràriu +pdfjs-page-rotate-ccw-button-label = Gira in sensu anti-oràriu +pdfjs-cursor-text-select-tool-button = + .title = Ativa s'aina de seletzione de testu +pdfjs-cursor-text-select-tool-button-label = Aina de seletzione de testu +pdfjs-cursor-hand-tool-button = + .title = Ativa s'aina de manu +pdfjs-cursor-hand-tool-button-label = Aina de manu +pdfjs-scroll-page-button = + .title = Imprea s'iscurrimentu de pàgina +pdfjs-scroll-page-button-label = Iscurrimentu de pàgina +pdfjs-scroll-vertical-button = + .title = Imprea s'iscurrimentu verticale +pdfjs-scroll-vertical-button-label = Iscurrimentu verticale +pdfjs-scroll-horizontal-button = + .title = Imprea s'iscurrimentu orizontale +pdfjs-scroll-horizontal-button-label = Iscurrimentu orizontale +pdfjs-scroll-wrapped-button = + .title = Imprea s'iscurrimentu continu +pdfjs-scroll-wrapped-button-label = Iscurrimentu continu + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Propiedades de su documentu… +pdfjs-document-properties-button-label = Propiedades de su documentu… +pdfjs-document-properties-file-name = Nòmine de s'archìviu: +pdfjs-document-properties-file-size = Mannària de s'archìviu: +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bytes) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bytes) +pdfjs-document-properties-title = Tìtulu: +pdfjs-document-properties-author = Autoria: +pdfjs-document-properties-subject = Ogetu: +pdfjs-document-properties-keywords = Faeddos crae: +pdfjs-document-properties-creation-date = Data de creatzione: +pdfjs-document-properties-modification-date = Data de modìfica: +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Creatzione: +pdfjs-document-properties-producer = Produtore de PDF: +pdfjs-document-properties-version = Versione de PDF: +pdfjs-document-properties-page-count = Contu de pàginas: +pdfjs-document-properties-page-size = Mannària de sa pàgina: +pdfjs-document-properties-page-size-unit-inches = pòddighes +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = verticale +pdfjs-document-properties-page-size-orientation-landscape = orizontale +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Lìtera +pdfjs-document-properties-page-size-name-legal = Legale + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Visualizatzione web lestra: +pdfjs-document-properties-linearized-yes = Eja +pdfjs-document-properties-linearized-no = Nono +pdfjs-document-properties-close-button = Serra + +## Print + +pdfjs-print-progress-message = Aparitzende s'imprenta de su documentu… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Cantzella +pdfjs-printing-not-supported = Atentzione: s'imprenta no est funtzionende de su totu in custu navigadore. +pdfjs-printing-not-ready = Atentzione: su PDF no est istadu carrigadu de su totu pro s'imprenta. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Ativa/disativa sa barra laterale +pdfjs-toggle-sidebar-notification-button = + .title = Ativa/disativa sa barra laterale (su documentu cuntenet un'ischema, alligongiados o livellos) +pdfjs-toggle-sidebar-button-label = Ativa/disativa sa barra laterale +pdfjs-document-outline-button-label = Ischema de su documentu +pdfjs-attachments-button = + .title = Ammustra alligongiados +pdfjs-attachments-button-label = Alliongiados +pdfjs-layers-button = + .title = Ammustra livellos (clic dòpiu pro ripristinare totu is livellos a s'istadu predefinidu) +pdfjs-layers-button-label = Livellos +pdfjs-thumbs-button = + .title = Ammustra miniaturas +pdfjs-thumbs-button-label = Miniaturas +pdfjs-current-outline-item-button = + .title = Agata s'elementu atuale de s'ischema +pdfjs-current-outline-item-button-label = Elementu atuale de s'ischema +pdfjs-findbar-button = + .title = Agata in su documentu +pdfjs-findbar-button-label = Agata +pdfjs-additional-layers = Livellos additzionales + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Pàgina { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Miniatura de sa pàgina { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Agata + .placeholder = Agata in su documentu… +pdfjs-find-previous-button = + .title = Agata s'ocurrèntzia pretzedente de sa fràsia +pdfjs-find-previous-button-label = S'ischeda chi b'est primu +pdfjs-find-next-button = + .title = Agata s'ocurrèntzia imbeniente de sa fràsia +pdfjs-find-next-button-label = Imbeniente +pdfjs-find-highlight-checkbox = Evidèntzia totu +pdfjs-find-match-case-checkbox-label = Distinghe intre majùsculas e minùsculas +pdfjs-find-match-diacritics-checkbox-label = Respeta is diacrìticos +pdfjs-find-entire-word-checkbox-label = Faeddos intreos +pdfjs-find-reached-top = S'est lòmpidu a su cumintzu de su documentu, si sighit dae su bàsciu +pdfjs-find-reached-bottom = Acabbu de su documentu, si sighit dae s'artu +pdfjs-find-not-found = Testu no agatadu + +## Predefined zoom values + +pdfjs-page-scale-auto = Ingrandimentu automàticu +pdfjs-page-scale-actual = Mannària reale +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Pàgina { $page } + +## Loading indicator messages + +pdfjs-loading-error = Faddina in sa càrriga de su PDF. +pdfjs-invalid-file-error = Archìviu PDF non vàlidu o corrùmpidu. +pdfjs-missing-file-error = Ammancat s'archìviu PDF. +pdfjs-unexpected-response-error = Risposta imprevista de su serbidore. +pdfjs-rendering-error = Faddina in sa visualizatzione de sa pàgina. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } + +## Password + +pdfjs-password-label = Inserta sa crae pro abèrrere custu archìviu PDF. +pdfjs-password-invalid = Sa crae no est curreta. Torra a nche proare. +pdfjs-password-ok-button = Andat bene +pdfjs-password-cancel-button = Cantzella +pdfjs-web-fonts-disabled = Is tipografias web sunt disativadas: is tipografias incrustadas a su PDF non podent èssere impreadas. + +## Editing + +pdfjs-editor-free-text-button = + .title = Testu +pdfjs-editor-free-text-button-label = Testu +pdfjs-editor-ink-button = + .title = Disinnu +pdfjs-editor-ink-button-label = Disinnu +pdfjs-editor-stamp-button = + .title = Agiunghe o modìfica immàgines +pdfjs-editor-stamp-button-label = Agiunghe o modìfica immàgines +pdfjs-editor-highlight-button = + .title = Evidèntzia +pdfjs-editor-highlight-button-label = Evidèntzia +pdfjs-highlight-floating-button1 = + .title = Evidèntzia + .aria-label = Evidèntzia +pdfjs-highlight-floating-button-label = Evidèntzia + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Boga su disinnu +pdfjs-editor-remove-freetext-button = + .title = Boga su testu +pdfjs-editor-remove-stamp-button = + .title = Boga s’immàgine +pdfjs-editor-remove-highlight-button = + .title = Boga s’evidèntzia + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Colore +pdfjs-editor-free-text-size-input = Mannària +pdfjs-editor-ink-color-input = Colore +pdfjs-editor-ink-thickness-input = Grussària +pdfjs-editor-stamp-add-image-button = + .title = Agiunghe un’immàgine +pdfjs-editor-stamp-add-image-button-label = Agiunghe un’immàgine +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Grussària +pdfjs-free-text = + .aria-label = Editore de testu +pdfjs-free-text-default-content = Cumintza a iscrìere… +pdfjs-ink = + .aria-label = Editore de disinnos +pdfjs-ink-canvas = + .aria-label = Immàgine creada dae s’utente + +## Alt-text dialog + +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button-label = Testu alternativu +pdfjs-editor-alt-text-edit-button-label = Modifica su testu alternativu +pdfjs-editor-alt-text-dialog-label = Sèbera un’optzione +pdfjs-editor-alt-text-dialog-description = Su testu alternativu (“alt text”) est ùtile pro persones chi non podent bìdere s’immàgine o cando non benit carrigada. +pdfjs-editor-alt-text-add-description-label = Agiunghe una descritzione +pdfjs-editor-alt-text-cancel-button = Annulla +pdfjs-editor-alt-text-save-button = Sarva + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + + +## Color picker + +pdfjs-editor-colorpicker-button = + .title = Modifica su colore +pdfjs-editor-colorpicker-dropdown = + .aria-label = Colores a disponimentu +pdfjs-editor-colorpicker-yellow = + .title = Grogu +pdfjs-editor-colorpicker-green = + .title = Birde +pdfjs-editor-colorpicker-blue = + .title = Biaitu +pdfjs-editor-colorpicker-pink = + .title = Rosa + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button-label = Mancat su testu alternativu +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button-label = Revisiona su testu alternativu +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Creadu in automàticu: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = Cunfiguratzione de su testu alternativu de is immàgines +pdfjs-image-alt-text-settings-button-label = Cunfiguratzione de su testu alternativu de is immàgines +pdfjs-editor-alt-text-settings-dialog-label = Cunfiguratzione de su testu alternativu de is immàgines +pdfjs-editor-alt-text-settings-automatic-title = Testu alternativu automàticu +pdfjs-editor-alt-text-settings-create-model-button-label = Crea testu alternativu in automàticu +pdfjs-editor-alt-text-settings-create-model-description = Cussìgiat descritziones pro agiudare a gente chi non podet bìdere s’immàgine o cando non benit carrigada. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = Modellu de IA pro su testu alternativu ({ $totalSize } MB) +pdfjs-editor-alt-text-settings-ai-model-description = Est esecutadu in locale in manera chi is datos tuos abarrent in privadu. Rechestu pro sa generatzione automàtica de testu alternativu. +pdfjs-editor-alt-text-settings-delete-model-button = Cantzella +pdfjs-editor-alt-text-settings-download-model-button = Iscàrriga +pdfjs-editor-alt-text-settings-downloading-model-button = Iscarrighende… +pdfjs-editor-alt-text-settings-editor-title = Editore de testu alternativu +pdfjs-editor-alt-text-settings-show-dialog-button-label = Mustra deretu s’editore de testu alternativu cando siat agiunta un’immàgine +pdfjs-editor-alt-text-settings-show-dialog-description = T’agiudat a assegurare chi totu is immàgines tuas tèngiant unu testu alternativu. +pdfjs-editor-alt-text-settings-close-button = Serra diff --git a/public/pdfjs/web/locale/scn/viewer.ftl b/public/pdfjs/web/locale/scn/viewer.ftl new file mode 100644 index 0000000..a3c7c03 --- /dev/null +++ b/public/pdfjs/web/locale/scn/viewer.ftl @@ -0,0 +1,74 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-zoom-out-button = + .title = Cchiù nicu +pdfjs-zoom-out-button-label = Cchiù nicu +pdfjs-zoom-in-button = + .title = Cchiù granni +pdfjs-zoom-in-button-label = Cchiù granni + +## Secondary toolbar and context menu + + +## Document properties dialog + + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Vista web lesta: +pdfjs-document-properties-linearized-yes = Se + +## Print + +pdfjs-print-progress-close-button = Sfai + +## Tooltips and alt text for side panel toolbar buttons + + +## Thumbnails panel item (tooltip and alt text for images) + + +## Find panel button title and messages + + +## Predefined zoom values + +pdfjs-page-scale-width = Larghizza dâ pàggina + +## PDF page + + +## Loading indicator messages + + +## Annotations + + +## Password + +pdfjs-password-cancel-button = Sfai + +## Editing + + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + diff --git a/public/pdfjs/web/locale/sco/viewer.ftl b/public/pdfjs/web/locale/sco/viewer.ftl new file mode 100644 index 0000000..6f71c47 --- /dev/null +++ b/public/pdfjs/web/locale/sco/viewer.ftl @@ -0,0 +1,264 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Page Afore +pdfjs-previous-button-label = Previous +pdfjs-next-button = + .title = Page Efter +pdfjs-next-button-label = Neist +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Page +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = o { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } o { $pagesCount }) +pdfjs-zoom-out-button = + .title = Zoom Oot +pdfjs-zoom-out-button-label = Zoom Oot +pdfjs-zoom-in-button = + .title = Zoom In +pdfjs-zoom-in-button-label = Zoom In +pdfjs-zoom-select = + .title = Zoom +pdfjs-presentation-mode-button = + .title = Flit tae Presentation Mode +pdfjs-presentation-mode-button-label = Presentation Mode +pdfjs-open-file-button = + .title = Open File +pdfjs-open-file-button-label = Open +pdfjs-print-button = + .title = Prent +pdfjs-print-button-label = Prent + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Tools +pdfjs-tools-button-label = Tools +pdfjs-first-page-button = + .title = Gang tae First Page +pdfjs-first-page-button-label = Gang tae First Page +pdfjs-last-page-button = + .title = Gang tae Lest Page +pdfjs-last-page-button-label = Gang tae Lest Page +pdfjs-page-rotate-cw-button = + .title = Rotate Clockwise +pdfjs-page-rotate-cw-button-label = Rotate Clockwise +pdfjs-page-rotate-ccw-button = + .title = Rotate Coonterclockwise +pdfjs-page-rotate-ccw-button-label = Rotate Coonterclockwise +pdfjs-cursor-text-select-tool-button = + .title = Enable Text Walin Tool +pdfjs-cursor-text-select-tool-button-label = Text Walin Tool +pdfjs-cursor-hand-tool-button = + .title = Enable Haun Tool +pdfjs-cursor-hand-tool-button-label = Haun Tool +pdfjs-scroll-vertical-button = + .title = Yaise Vertical Scrollin +pdfjs-scroll-vertical-button-label = Vertical Scrollin +pdfjs-scroll-horizontal-button = + .title = Yaise Horizontal Scrollin +pdfjs-scroll-horizontal-button-label = Horizontal Scrollin +pdfjs-scroll-wrapped-button = + .title = Yaise Wrapped Scrollin +pdfjs-scroll-wrapped-button-label = Wrapped Scrollin +pdfjs-spread-none-button = + .title = Dinnae jyn page spreids +pdfjs-spread-none-button-label = Nae Spreids +pdfjs-spread-odd-button = + .title = Jyn page spreids stertin wi odd-numbered pages +pdfjs-spread-odd-button-label = Odd Spreids +pdfjs-spread-even-button = + .title = Jyn page spreids stertin wi even-numbered pages +pdfjs-spread-even-button-label = Even Spreids + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Document Properties… +pdfjs-document-properties-button-label = Document Properties… +pdfjs-document-properties-file-name = File nemme: +pdfjs-document-properties-file-size = File size: +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bytes) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bytes) +pdfjs-document-properties-title = Title: +pdfjs-document-properties-author = Author: +pdfjs-document-properties-subject = Subjeck: +pdfjs-document-properties-keywords = Keywirds: +pdfjs-document-properties-creation-date = Date o Makkin: +pdfjs-document-properties-modification-date = Date o Chynges: +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Makker: +pdfjs-document-properties-producer = PDF Producer: +pdfjs-document-properties-version = PDF Version: +pdfjs-document-properties-page-count = Page Coont: +pdfjs-document-properties-page-size = Page Size: +pdfjs-document-properties-page-size-unit-inches = in +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = portrait +pdfjs-document-properties-page-size-orientation-landscape = landscape +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Letter +pdfjs-document-properties-page-size-name-legal = Legal + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Fast Wab View: +pdfjs-document-properties-linearized-yes = Aye +pdfjs-document-properties-linearized-no = Naw +pdfjs-document-properties-close-button = Sneck + +## Print + +pdfjs-print-progress-message = Reddin document fur prentin… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Stap +pdfjs-printing-not-supported = Tak tent: Prentin isnae richt supportit by this stravaiger. +pdfjs-printing-not-ready = Tak tent: The PDF isnae richt loadit fur prentin. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Toggle Sidebaur +pdfjs-toggle-sidebar-notification-button = + .title = Toggle Sidebaur (document conteens ootline/attachments/layers) +pdfjs-toggle-sidebar-button-label = Toggle Sidebaur +pdfjs-document-outline-button = + .title = Kythe Document Ootline (double-click fur tae oot-fauld/in-fauld aw items) +pdfjs-document-outline-button-label = Document Ootline +pdfjs-attachments-button = + .title = Kythe Attachments +pdfjs-attachments-button-label = Attachments +pdfjs-layers-button = + .title = Kythe Layers (double-click fur tae reset aw layers tae the staunart state) +pdfjs-layers-button-label = Layers +pdfjs-thumbs-button = + .title = Kythe Thumbnails +pdfjs-thumbs-button-label = Thumbnails +pdfjs-current-outline-item-button = + .title = Find Current Ootline Item +pdfjs-current-outline-item-button-label = Current Ootline Item +pdfjs-findbar-button = + .title = Find in Document +pdfjs-findbar-button-label = Find +pdfjs-additional-layers = Mair Layers + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Page { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Thumbnail o Page { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Find + .placeholder = Find in document… +pdfjs-find-previous-button = + .title = Airt oot the last time this phrase occurred +pdfjs-find-previous-button-label = Previous +pdfjs-find-next-button = + .title = Airt oot the neist time this phrase occurs +pdfjs-find-next-button-label = Neist +pdfjs-find-highlight-checkbox = Highlicht aw +pdfjs-find-match-case-checkbox-label = Match case +pdfjs-find-entire-word-checkbox-label = Hale Wirds +pdfjs-find-reached-top = Raxed tap o document, went on fae the dowp end +pdfjs-find-reached-bottom = Raxed end o document, went on fae the tap +pdfjs-find-not-found = Phrase no fund + +## Predefined zoom values + +pdfjs-page-scale-width = Page Width +pdfjs-page-scale-fit = Page Fit +pdfjs-page-scale-auto = Automatic Zoom +pdfjs-page-scale-actual = Actual Size +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Page { $page } + +## Loading indicator messages + +pdfjs-loading-error = An mishanter tuik place while loadin the PDF. +pdfjs-invalid-file-error = No suithfest or camshauchlet PDF file. +pdfjs-missing-file-error = PDF file tint. +pdfjs-unexpected-response-error = Unexpectit server repone. +pdfjs-rendering-error = A mishanter tuik place while renderin the page. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } Annotation] + +## Password + +pdfjs-password-label = Inpit the passwird fur tae open this PDF file. +pdfjs-password-invalid = Passwird no suithfest. Gonnae gie it anither shot. +pdfjs-password-ok-button = OK +pdfjs-password-cancel-button = Stap +pdfjs-web-fonts-disabled = Wab fonts are disabled: cannae yaise embeddit PDF fonts. + +## Editing + + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + diff --git a/public/pdfjs/web/locale/si/viewer.ftl b/public/pdfjs/web/locale/si/viewer.ftl new file mode 100644 index 0000000..0481116 --- /dev/null +++ b/public/pdfjs/web/locale/si/viewer.ftl @@ -0,0 +1,271 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = කලින් පිටුව +pdfjs-previous-button-label = කලින් +pdfjs-next-button = + .title = ඊළඟ පිටුව +pdfjs-next-button-label = ඊළඟ +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = පිටුව +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } / { $pagesCount }) +pdfjs-zoom-out-button = + .title = කුඩාලනය +pdfjs-zoom-out-button-label = කුඩාලනය +pdfjs-zoom-in-button = + .title = විශාලනය +pdfjs-zoom-in-button-label = විශාලනය +pdfjs-zoom-select = + .title = විශාල කරන්න +pdfjs-presentation-mode-button = + .title = සමර්පණ ප්‍රකාරය වෙත මාරුවන්න +pdfjs-presentation-mode-button-label = සමර්පණ ප්‍රකාරය +pdfjs-open-file-button = + .title = ගොනුව අරින්න +pdfjs-open-file-button-label = අරින්න +pdfjs-print-button = + .title = මුද්‍රණය +pdfjs-print-button-label = මුද්‍රණය +pdfjs-save-button = + .title = සුරකින්න +pdfjs-save-button-label = සුරකින්න +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = බාගන්න +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = බාගන්න +pdfjs-bookmark-button-label = පවතින පිටුව + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = මෙවලම් +pdfjs-tools-button-label = මෙවලම් +pdfjs-first-page-button = + .title = මුල් පිටුවට යන්න +pdfjs-first-page-button-label = මුල් පිටුවට යන්න +pdfjs-last-page-button = + .title = අවසන් පිටුවට යන්න +pdfjs-last-page-button-label = අවසන් පිටුවට යන්න +pdfjs-cursor-text-select-tool-button = + .title = පෙළ තේරීමේ මෙවලම සබල කරන්න +pdfjs-cursor-text-select-tool-button-label = පෙළ තේරීමේ මෙවලම +pdfjs-cursor-hand-tool-button = + .title = අත් මෙවලම සබල කරන්න +pdfjs-cursor-hand-tool-button-label = අත් මෙවලම +pdfjs-scroll-page-button = + .title = පිටුව අනුචලනය භාවිතය +pdfjs-scroll-page-button-label = පිටුව අනුචලනය +pdfjs-scroll-vertical-button = + .title = සිරස් අනුචලනය භාවිතය +pdfjs-scroll-vertical-button-label = සිරස් අනුචලනය +pdfjs-scroll-horizontal-button = + .title = තිරස් අනුචලනය භාවිතය +pdfjs-scroll-horizontal-button-label = තිරස් අනුචලනය + +## Document properties dialog + +pdfjs-document-properties-button = + .title = ලේඛනයේ ගුණාංග… +pdfjs-document-properties-button-label = ලේඛනයේ ගුණාංග… +pdfjs-document-properties-file-name = ගොනුවේ නම: +pdfjs-document-properties-file-size = ගොනුවේ ප්‍රමාණය: +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = කි.බ. { $size_kb } (බයිට { $size_b }) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = මෙ.බ. { $size_mb } (බයිට { $size_b }) +pdfjs-document-properties-title = සිරැසිය: +pdfjs-document-properties-author = කතෘ: +pdfjs-document-properties-subject = මාතෘකාව: +pdfjs-document-properties-keywords = මූල පද: +pdfjs-document-properties-creation-date = සෑදූ දිනය: +pdfjs-document-properties-modification-date = සංශෝධිත දිනය: +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = නිර්මාතෘ: +pdfjs-document-properties-producer = පීඩීඑෆ් සම්පාදක: +pdfjs-document-properties-version = පීඩීඑෆ් අනුවාදය: +pdfjs-document-properties-page-count = පිටු ගණන: +pdfjs-document-properties-page-size = පිටුවේ තරම: +pdfjs-document-properties-page-size-unit-inches = අඟල් +pdfjs-document-properties-page-size-unit-millimeters = මි.මී. +pdfjs-document-properties-page-size-orientation-portrait = සිරස් +pdfjs-document-properties-page-size-orientation-landscape = තිරස් +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width }×{ $height }{ $unit }{ $name }{ $orientation } + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = වේගවත් වියමන දැක්ම: +pdfjs-document-properties-linearized-yes = ඔව් +pdfjs-document-properties-linearized-no = නැහැ +pdfjs-document-properties-close-button = වසන්න + +## Print + +pdfjs-print-progress-message = මුද්‍රණය සඳහා ලේඛනය සූදානම් වෙමින්… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = අවලංගු කරන්න +pdfjs-printing-not-supported = අවවාදයයි: මෙම අතිරික්සුව මුද්‍රණය සඳහා හොඳින් සහාය නොදක්වයි. +pdfjs-printing-not-ready = අවවාදයයි: මුද්‍රණයට පීඩීඑෆ් ගොනුව සම්පූර්ණයෙන් පූරණය වී නැත. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-document-outline-button-label = ලේඛනයේ වටසන +pdfjs-attachments-button = + .title = ඇමුණුම් පෙන්වන්න +pdfjs-attachments-button-label = ඇමුණුම් +pdfjs-layers-button = + .title = ස්තර පෙන්වන්න (සියළු ස්තර පෙරනිමි තත්‍වයට යළි සැකසීමට දෙවරක් ඔබන්න) +pdfjs-layers-button-label = ස්තර +pdfjs-thumbs-button = + .title = සිඟිති රූ පෙන්වන්න +pdfjs-thumbs-button-label = සිඟිති රූ +pdfjs-findbar-button = + .title = ලේඛනයෙහි සොයන්න +pdfjs-findbar-button-label = සොයන්න +pdfjs-additional-layers = අතිරේක ස්තර + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = පිටුව { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = පිටුවේ සිඟිත රූව { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = සොයන්න + .placeholder = ලේඛනයේ සොයන්න… +pdfjs-find-previous-button = + .title = මෙම වැකිකඩ කලින් යෙදුණු ස්ථානය සොයන්න +pdfjs-find-previous-button-label = කලින් +pdfjs-find-next-button = + .title = මෙම වැකිකඩ ඊළඟට යෙදෙන ස්ථානය සොයන්න +pdfjs-find-next-button-label = ඊළඟ +pdfjs-find-highlight-checkbox = සියල්ල උද්දීපනය +pdfjs-find-entire-word-checkbox-label = සමස්ත වචන +pdfjs-find-reached-top = ලේඛනයේ මුදුනට ළඟා විය, පහළ සිට ඉහළට +pdfjs-find-reached-bottom = ලේඛනයේ අවසානයට ළඟා විය, ඉහළ සිට පහළට +pdfjs-find-not-found = වැකිකඩ හමු නොවුණි + +## Predefined zoom values + +pdfjs-page-scale-width = පිටුවේ පළල +pdfjs-page-scale-auto = ස්වයංක්‍රීය විශාලනය +pdfjs-page-scale-actual = සැබෑ ප්‍රමාණය +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = පිටුව { $page } + +## Loading indicator messages + +pdfjs-loading-error = පීඩීඑෆ් පූරණය කිරීමේදී දෝෂයක් සිදු විය. +pdfjs-invalid-file-error = වලංගු නොවන හෝ හානිවූ පීඩීඑෆ් ගොනුවකි. +pdfjs-missing-file-error = මඟහැරුණු පීඩීඑෆ් ගොනුවකි. +pdfjs-unexpected-response-error = අනපේක්‍ෂිත සේවාදායක ප්‍රතිචාරයකි. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } + +## Password + +pdfjs-password-label = මෙම පීඩීඑෆ් ගොනුව විවෘත කිරීමට මුරපදය යොදන්න. +pdfjs-password-invalid = වැරදි මුරපදයකි. නැවත උත්සාහ කරන්න. +pdfjs-password-ok-button = හරි +pdfjs-password-cancel-button = අවලංගු +pdfjs-web-fonts-disabled = වියමන අකුරු අබලයි: පීඩීඑෆ් වෙත කාවැද්දූ රුවකුරු භාවිතා කළ නොහැකිය. + +## Editing + +pdfjs-editor-free-text-button = + .title = පෙළ +pdfjs-editor-free-text-button-label = පෙළ +pdfjs-editor-ink-button = + .title = අඳින්න +pdfjs-editor-ink-button-label = අඳින්න +pdfjs-editor-stamp-button = + .title = රූප සංස්කරණය හෝ එක් කරන්න +pdfjs-editor-stamp-button-label = රූප සංස්කරණය හෝ එක් කරන්න + +## Remove button for the various kind of editor. + + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = වර්ණය +pdfjs-editor-free-text-size-input = තරම +pdfjs-editor-ink-color-input = වර්ණය +pdfjs-editor-ink-thickness-input = ඝණකම +pdfjs-free-text = + .aria-label = වදන් සකසනය +pdfjs-free-text-default-content = ලිවීීම අරඹන්න… + +## Alt-text dialog + +pdfjs-editor-alt-text-mark-decorative-description = මෙය දාර හෝ දිය සලකුණු වැනි අලංකාර රූප සඳහා භාවිතා වේ. + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + + +## Color picker + + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + + +## Image alt-text settings + diff --git a/public/pdfjs/web/locale/sk/viewer.ftl b/public/pdfjs/web/locale/sk/viewer.ftl new file mode 100644 index 0000000..5cbbb8d --- /dev/null +++ b/public/pdfjs/web/locale/sk/viewer.ftl @@ -0,0 +1,521 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Predchádzajúca strana +pdfjs-previous-button-label = Predchádzajúca +pdfjs-next-button = + .title = Nasledujúca strana +pdfjs-next-button-label = Nasledujúca +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Strana +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = z { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } z { $pagesCount }) +pdfjs-zoom-out-button = + .title = Zmenšiť veľkosť +pdfjs-zoom-out-button-label = Zmenšiť veľkosť +pdfjs-zoom-in-button = + .title = Zväčšiť veľkosť +pdfjs-zoom-in-button-label = Zväčšiť veľkosť +pdfjs-zoom-select = + .title = Nastavenie veľkosti +pdfjs-presentation-mode-button = + .title = Prepnúť na režim prezentácie +pdfjs-presentation-mode-button-label = Režim prezentácie +pdfjs-open-file-button = + .title = Otvoriť súbor +pdfjs-open-file-button-label = Otvoriť +pdfjs-print-button = + .title = Tlačiť +pdfjs-print-button-label = Tlačiť +pdfjs-save-button = + .title = Uložiť +pdfjs-save-button-label = Uložiť +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Stiahnuť +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Stiahnuť +pdfjs-bookmark-button = + .title = Aktuálna stránka (zobraziť adresu URL z aktuálnej stránky) +pdfjs-bookmark-button-label = Aktuálna stránka + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Nástroje +pdfjs-tools-button-label = Nástroje +pdfjs-first-page-button = + .title = Prejsť na prvú stranu +pdfjs-first-page-button-label = Prejsť na prvú stranu +pdfjs-last-page-button = + .title = Prejsť na poslednú stranu +pdfjs-last-page-button-label = Prejsť na poslednú stranu +pdfjs-page-rotate-cw-button = + .title = Otočiť v smere hodinových ručičiek +pdfjs-page-rotate-cw-button-label = Otočiť v smere hodinových ručičiek +pdfjs-page-rotate-ccw-button = + .title = Otočiť proti smeru hodinových ručičiek +pdfjs-page-rotate-ccw-button-label = Otočiť proti smeru hodinových ručičiek +pdfjs-cursor-text-select-tool-button = + .title = Povoliť výber textu +pdfjs-cursor-text-select-tool-button-label = Výber textu +pdfjs-cursor-hand-tool-button = + .title = Povoliť nástroj ruka +pdfjs-cursor-hand-tool-button-label = Nástroj ruka +pdfjs-scroll-page-button = + .title = Použiť rolovanie po stránkach +pdfjs-scroll-page-button-label = Rolovanie po stránkach +pdfjs-scroll-vertical-button = + .title = Používať zvislé posúvanie +pdfjs-scroll-vertical-button-label = Zvislé posúvanie +pdfjs-scroll-horizontal-button = + .title = Používať vodorovné posúvanie +pdfjs-scroll-horizontal-button-label = Vodorovné posúvanie +pdfjs-scroll-wrapped-button = + .title = Použiť postupné posúvanie +pdfjs-scroll-wrapped-button-label = Postupné posúvanie +pdfjs-spread-none-button = + .title = Nezdružovať stránky +pdfjs-spread-none-button-label = Žiadne združovanie +pdfjs-spread-odd-button = + .title = Združí stránky a umiestni nepárne stránky vľavo +pdfjs-spread-odd-button-label = Združiť stránky (nepárne vľavo) +pdfjs-spread-even-button = + .title = Združí stránky a umiestni párne stránky vľavo +pdfjs-spread-even-button-label = Združiť stránky (párne vľavo) + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Vlastnosti dokumentu… +pdfjs-document-properties-button-label = Vlastnosti dokumentu… +pdfjs-document-properties-file-name = Názov súboru: +pdfjs-document-properties-file-size = Veľkosť súboru: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } kB ({ $b } bajtov) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } bajtov) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } kB ({ $size_b } bajtov) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bajtov) +pdfjs-document-properties-title = Názov: +pdfjs-document-properties-author = Autor: +pdfjs-document-properties-subject = Predmet: +pdfjs-document-properties-keywords = Kľúčové slová: +pdfjs-document-properties-creation-date = Dátum vytvorenia: +pdfjs-document-properties-modification-date = Dátum úpravy: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Aplikácia: +pdfjs-document-properties-producer = Tvorca PDF: +pdfjs-document-properties-version = Verzia PDF: +pdfjs-document-properties-page-count = Počet strán: +pdfjs-document-properties-page-size = Veľkosť stránky: +pdfjs-document-properties-page-size-unit-inches = in +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = na výšku +pdfjs-document-properties-page-size-orientation-landscape = na šírku +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = List +pdfjs-document-properties-page-size-name-legal = Legal + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Rýchle zobrazovanie z webu: +pdfjs-document-properties-linearized-yes = Áno +pdfjs-document-properties-linearized-no = Nie +pdfjs-document-properties-close-button = Zavrieť + +## Print + +pdfjs-print-progress-message = Príprava dokumentu na tlač… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress } % +pdfjs-print-progress-close-button = Zrušiť +pdfjs-printing-not-supported = Upozornenie: tlač nie je v tomto prehliadači plne podporovaná. +pdfjs-printing-not-ready = Upozornenie: súbor PDF nie je plne načítaný pre tlač. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Prepnúť bočný panel +pdfjs-toggle-sidebar-notification-button = + .title = Prepnúť bočný panel (dokument obsahuje osnovu/prílohy/vrstvy) +pdfjs-toggle-sidebar-button-label = Prepnúť bočný panel +pdfjs-document-outline-button = + .title = Zobraziť osnovu dokumentu (dvojitým kliknutím rozbalíte/zbalíte všetky položky) +pdfjs-document-outline-button-label = Osnova dokumentu +pdfjs-attachments-button = + .title = Zobraziť prílohy +pdfjs-attachments-button-label = Prílohy +pdfjs-layers-button = + .title = Zobraziť vrstvy (dvojitým kliknutím uvediete všetky vrstvy do pôvodného stavu) +pdfjs-layers-button-label = Vrstvy +pdfjs-thumbs-button = + .title = Zobraziť miniatúry +pdfjs-thumbs-button-label = Miniatúry +pdfjs-current-outline-item-button = + .title = Nájsť aktuálnu položku v osnove +pdfjs-current-outline-item-button-label = Aktuálna položka v osnove +pdfjs-findbar-button = + .title = Hľadať v dokumente +pdfjs-findbar-button-label = Hľadať +pdfjs-additional-layers = Ďalšie vrstvy + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Strana { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Miniatúra strany { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Hľadať + .placeholder = Hľadať v dokumente… +pdfjs-find-previous-button = + .title = Vyhľadať predchádzajúci výskyt reťazca +pdfjs-find-previous-button-label = Predchádzajúce +pdfjs-find-next-button = + .title = Vyhľadať ďalší výskyt reťazca +pdfjs-find-next-button-label = Ďalšie +pdfjs-find-highlight-checkbox = Zvýrazniť všetky +pdfjs-find-match-case-checkbox-label = Rozlišovať veľkosť písmen +pdfjs-find-match-diacritics-checkbox-label = Rozlišovať diakritiku +pdfjs-find-entire-word-checkbox-label = Celé slová +pdfjs-find-reached-top = Bol dosiahnutý začiatok stránky, pokračuje sa od konca +pdfjs-find-reached-bottom = Bol dosiahnutý koniec stránky, pokračuje sa od začiatku +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] Výskyt { $current } z { $total } + [few] Výskyt { $current } z { $total } + [many] Výskyt { $current } z { $total } + *[other] Výskyt { $current } z { $total } + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] Viac ako { $limit } výskyt + [few] Viac ako { $limit } výskyty + [many] Viac ako { $limit } výskytov + *[other] Viac ako { $limit } výskytov + } +pdfjs-find-not-found = Výraz nebol nájdený + +## Predefined zoom values + +pdfjs-page-scale-width = Na šírku strany +pdfjs-page-scale-fit = Na veľkosť strany +pdfjs-page-scale-auto = Automatická veľkosť +pdfjs-page-scale-actual = Skutočná veľkosť +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale } % + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Strana { $page } + +## Loading indicator messages + +pdfjs-loading-error = Počas načítavania dokumentu PDF sa vyskytla chyba. +pdfjs-invalid-file-error = Neplatný alebo poškodený súbor PDF. +pdfjs-missing-file-error = Chýbajúci súbor PDF. +pdfjs-unexpected-response-error = Neočakávaná odpoveď zo servera. +pdfjs-rendering-error = Pri vykresľovaní stránky sa vyskytla chyba. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [Anotácia typu { $type }] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Ak chcete otvoriť tento súbor PDF, zadajte jeho heslo. +pdfjs-password-invalid = Heslo nie je platné. Skúste to znova. +pdfjs-password-ok-button = OK +pdfjs-password-cancel-button = Zrušiť +pdfjs-web-fonts-disabled = Webové písma sú vypnuté: nie je možné použiť písma vložené do súboru PDF. + +## Editing + +pdfjs-editor-free-text-button = + .title = Text +pdfjs-editor-free-text-button-label = Text +pdfjs-editor-ink-button = + .title = Kresliť +pdfjs-editor-ink-button-label = Kresliť +pdfjs-editor-stamp-button = + .title = Pridať alebo upraviť obrázky +pdfjs-editor-stamp-button-label = Pridať alebo upraviť obrázky +pdfjs-editor-highlight-button = + .title = Zvýrazniť +pdfjs-editor-highlight-button-label = Zvýrazniť +pdfjs-highlight-floating-button1 = + .title = Zvýrazniť + .aria-label = Zvýrazniť +pdfjs-highlight-floating-button-label = Zvýrazniť + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Odstrániť kresbu +pdfjs-editor-remove-freetext-button = + .title = Odstrániť text +pdfjs-editor-remove-stamp-button = + .title = Odstrániť obrázok +pdfjs-editor-remove-highlight-button = + .title = Odstrániť zvýraznenie + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Farba +pdfjs-editor-free-text-size-input = Veľkosť +pdfjs-editor-ink-color-input = Farba +pdfjs-editor-ink-thickness-input = Hrúbka +pdfjs-editor-ink-opacity-input = Priehľadnosť +pdfjs-editor-stamp-add-image-button = + .title = Pridať obrázok +pdfjs-editor-stamp-add-image-button-label = Pridať obrázok +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Hrúbka +pdfjs-editor-free-highlight-thickness-title = + .title = Zmeňte hrúbku pre zvýrazňovanie iných položiek ako textu +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = Textový editor + .default-content = Začnite písať… +pdfjs-free-text = + .aria-label = Textový editor +pdfjs-free-text-default-content = Začnite písať… +pdfjs-ink = + .aria-label = Editor kreslenia +pdfjs-ink-canvas = + .aria-label = Obrázok vytvorený používateľom + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = Alternatívny text +pdfjs-editor-alt-text-edit-button = + .aria-label = Upraviť alternatívny text +pdfjs-editor-alt-text-edit-button-label = Upraviť alternatívny text +pdfjs-editor-alt-text-dialog-label = Vyberte možnosť +pdfjs-editor-alt-text-dialog-description = Alternatívny text (alt text) pomáha, keď ľudia obrázok nevidia alebo sa nenačítava. +pdfjs-editor-alt-text-add-description-label = Pridať popis +pdfjs-editor-alt-text-add-description-description = Zamerajte sa na 1-2 vety, ktoré popisujú predmet, prostredie alebo akcie. +pdfjs-editor-alt-text-mark-decorative-label = Označiť ako dekoratívny +pdfjs-editor-alt-text-mark-decorative-description = Používa sa na ozdobné obrázky, ako sú okraje alebo vodoznaky. +pdfjs-editor-alt-text-cancel-button = Zrušiť +pdfjs-editor-alt-text-save-button = Uložiť +pdfjs-editor-alt-text-decorative-tooltip = Označený ako dekoratívny +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = Napríklad: „Mladý muž si sadá za stôl, aby sa najedol“ +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = Alternatívny text + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Ľavý horný roh – zmena veľkosti +pdfjs-editor-resizer-label-top-middle = Horný stred – zmena veľkosti +pdfjs-editor-resizer-label-top-right = Pravý horný roh – zmena veľkosti +pdfjs-editor-resizer-label-middle-right = Vpravo uprostred – zmena veľkosti +pdfjs-editor-resizer-label-bottom-right = Pravý dolný roh – zmena veľkosti +pdfjs-editor-resizer-label-bottom-middle = Stred dole – zmena veľkosti +pdfjs-editor-resizer-label-bottom-left = Ľavý dolný roh – zmena veľkosti +pdfjs-editor-resizer-label-middle-left = Vľavo uprostred – zmena veľkosti +pdfjs-editor-resizer-top-left = + .aria-label = Ľavý horný roh – zmena veľkosti +pdfjs-editor-resizer-top-middle = + .aria-label = Horný stred – zmena veľkosti +pdfjs-editor-resizer-top-right = + .aria-label = Pravý horný roh – zmena veľkosti +pdfjs-editor-resizer-middle-right = + .aria-label = Vpravo uprostred – zmena veľkosti +pdfjs-editor-resizer-bottom-right = + .aria-label = Pravý dolný roh – zmena veľkosti +pdfjs-editor-resizer-bottom-middle = + .aria-label = Stred dole – zmena veľkosti +pdfjs-editor-resizer-bottom-left = + .aria-label = Ľavý dolný roh – zmena veľkosti +pdfjs-editor-resizer-middle-left = + .aria-label = Vľavo uprostred – zmena veľkosti + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Farba zvýraznenia +pdfjs-editor-colorpicker-button = + .title = Zmeniť farbu +pdfjs-editor-colorpicker-dropdown = + .aria-label = Výber farieb +pdfjs-editor-colorpicker-yellow = + .title = Žltá +pdfjs-editor-colorpicker-green = + .title = Zelená +pdfjs-editor-colorpicker-blue = + .title = Modrá +pdfjs-editor-colorpicker-pink = + .title = Ružová +pdfjs-editor-colorpicker-red = + .title = Červená + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Zobraziť všetko +pdfjs-editor-highlight-show-all-button = + .title = Zobraziť všetko + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = Upraviť alternatívny text (popis obrázka) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = Pridať alternatívny text (popis obrázka) +pdfjs-editor-new-alt-text-textarea = + .placeholder = Sem napíšte svoj popis… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = Krátky popis pre ľudí, ktorí nevidia obrázok alebo ak sa obrázok nenačíta. +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = Tento alternatívny text bol vytvorený automaticky a môže byť nepresný. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Ďalšie informácie +pdfjs-editor-new-alt-text-create-automatically-button-label = Automaticky vytvoriť alternatívny text +pdfjs-editor-new-alt-text-not-now-button = Teraz nie +pdfjs-editor-new-alt-text-error-title = Alternatívny text sa nepodarilo vytvoriť automaticky +pdfjs-editor-new-alt-text-error-description = Napíšte svoj vlastný alternatívny text alebo to skúste znova neskôr. +pdfjs-editor-new-alt-text-error-close-button = Zavrieť +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = Sťahuje sa model AI pre alternatívne texty ({ $downloadedSize } z { $totalSize } MB) + .aria-valuetext = Sťahuje sa model AI pre alternatívne texty ({ $downloadedSize } z { $totalSize } MB) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = Alternatívny text bol pridaný +pdfjs-editor-new-alt-text-added-button-label = Alternatívny text bol pridaný +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = Chýbajúci alternatívny text +pdfjs-editor-new-alt-text-missing-button-label = Chýbajúci alternatívny text +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = Skontrolovať alternatívny text +pdfjs-editor-new-alt-text-to-review-button-label = Skontrolovať alternatívny text +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Vytvorené automaticky: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = Nastavenia alternatívneho textu obrázka +pdfjs-image-alt-text-settings-button-label = Nastavenia alternatívneho textu obrázka +pdfjs-editor-alt-text-settings-dialog-label = Nastavenia alternatívneho textu obrázka +pdfjs-editor-alt-text-settings-automatic-title = Automatický alternatívny text +pdfjs-editor-alt-text-settings-create-model-button-label = Automaticky vytvoriť alternatívny text +pdfjs-editor-alt-text-settings-create-model-description = Navrhuje popisy, ktoré pomôžu ľuďom, ktorým sa obrázok nezobrazuje alebo ak sa obrázok nenačíta. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = Model AI pre alternatívne texty ({ $totalSize } MB) +pdfjs-editor-alt-text-settings-ai-model-description = Beží lokálne na vašom zariadení, takže vaše dáta zostanú súkromné. Vyžaduje sa pre automatický alternatívny text. +pdfjs-editor-alt-text-settings-delete-model-button = Odstrániť +pdfjs-editor-alt-text-settings-download-model-button = Stiahnuť +pdfjs-editor-alt-text-settings-downloading-model-button = Sťahuje sa… +pdfjs-editor-alt-text-settings-editor-title = Editor alternatívneho textu +pdfjs-editor-alt-text-settings-show-dialog-button-label = Pri pridávaní obrázka ihneď zobraziť editor alternatívneho textu +pdfjs-editor-alt-text-settings-show-dialog-description = Pomáha vám zabezpečiť, aby všetky vaše obrázky mali alternatívny text. +pdfjs-editor-alt-text-settings-close-button = Zavrieť + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = Zvýraznenie bolo odstránené +pdfjs-editor-undo-bar-message-freetext = Text bol odstránený +pdfjs-editor-undo-bar-message-ink = Kreslenie bolo odstránené +pdfjs-editor-undo-bar-message-stamp = Obrázok bol odstránený +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = + { $count -> + [one] { $count } anotácia odstránená + [few] { $count } anotácie odstránené + [many] { $count } anotácií odstránených + *[other] { $count } anotácií odstránených + } +pdfjs-editor-undo-bar-undo-button = + .title = Späť +pdfjs-editor-undo-bar-undo-button-label = Späť +pdfjs-editor-undo-bar-close-button = + .title = Zavrieť +pdfjs-editor-undo-bar-close-button-label = Zavrieť diff --git a/public/pdfjs/web/locale/skr/viewer.ftl b/public/pdfjs/web/locale/skr/viewer.ftl new file mode 100644 index 0000000..2d0e87f --- /dev/null +++ b/public/pdfjs/web/locale/skr/viewer.ftl @@ -0,0 +1,498 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = پچھلا ورقہ +pdfjs-previous-button-label = پچھلا +pdfjs-next-button = + .title = اڳلا ورقہ +pdfjs-next-button-label = اڳلا +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = ورقہ +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = { $pagesCount } دا +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } دا { $pagesCount }) +pdfjs-zoom-out-button = + .title = زوم آؤٹ +pdfjs-zoom-out-button-label = زوم آؤٹ +pdfjs-zoom-in-button = + .title = زوم اِن +pdfjs-zoom-in-button-label = زوم اِن +pdfjs-zoom-select = + .title = زوم +pdfjs-presentation-mode-button = + .title = پریزنٹیشن موڈ تے سوئچ کرو +pdfjs-presentation-mode-button-label = پریزنٹیشن موڈ +pdfjs-open-file-button = + .title = فائل کھولو +pdfjs-open-file-button-label = کھولو +pdfjs-print-button = + .title = چھاپو +pdfjs-print-button-label = چھاپو +pdfjs-save-button = + .title = ہتھیکڑا کرو +pdfjs-save-button-label = ہتھیکڑا کرو +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = ڈاؤن لوڈ +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = ڈاؤن لوڈ +pdfjs-bookmark-button = + .title = موجودہ ورقہ (موجودہ ورقے کنوں یوآرایل ݙیکھو) +pdfjs-bookmark-button-label = موجودہ ورقہ + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = اوزار +pdfjs-tools-button-label = اوزار +pdfjs-first-page-button = + .title = پہلے ورقے تے ونڄو +pdfjs-first-page-button-label = پہلے ورقے تے ونڄو +pdfjs-last-page-button = + .title = چھیکڑی ورقے تے ونڄو +pdfjs-last-page-button-label = چھیکڑی ورقے تے ونڄو +pdfjs-page-rotate-cw-button = + .title = گھڑی وانگوں گھماؤ +pdfjs-page-rotate-cw-button-label = گھڑی وانگوں گھماؤ +pdfjs-page-rotate-ccw-button = + .title = گھڑی تے اُپٹھ گھماؤ +pdfjs-page-rotate-ccw-button-label = گھڑی تے اُپٹھ گھماؤ +pdfjs-cursor-text-select-tool-button = + .title = متن منتخب کݨ والا آلہ فعال بݨاؤ +pdfjs-cursor-text-select-tool-button-label = متن منتخب کرݨ والا آلہ +pdfjs-cursor-hand-tool-button = + .title = ہینڈ ٹول فعال بݨاؤ +pdfjs-cursor-hand-tool-button-label = ہینڈ ٹول +pdfjs-scroll-page-button = + .title = پیج سکرولنگ استعمال کرو +pdfjs-scroll-page-button-label = پیج سکرولنگ +pdfjs-scroll-vertical-button = + .title = عمودی سکرولنگ استعمال کرو +pdfjs-scroll-vertical-button-label = عمودی سکرولنگ +pdfjs-scroll-horizontal-button = + .title = افقی سکرولنگ استعمال کرو +pdfjs-scroll-horizontal-button-label = افقی سکرولنگ +pdfjs-scroll-wrapped-button = + .title = ویڑھی ہوئی سکرولنگ استعمال کرو +pdfjs-scroll-wrapped-button-label = وہڑھی ہوئی سکرولنگ +pdfjs-spread-none-button = + .title = پیج سپریڈز وِچ شامل نہ تھیوو۔ +pdfjs-spread-none-button-label = کوئی پولھ کائنی +pdfjs-spread-odd-button = + .title = طاق نمبر والے ورقیاں دے نال شروع تھیوݨ والے پیج سپریڈز وِچ شامل تھیوو۔ +pdfjs-spread-odd-button-label = تاک پھیلاؤ +pdfjs-spread-even-button = + .title = جفت نمر والے ورقیاں نال شروع تھیوݨ والے پیج سپریڈز وِ شامل تھیوو۔ +pdfjs-spread-even-button-label = جفت پھیلاؤ + +## Document properties dialog + +pdfjs-document-properties-button = + .title = دستاویز خواص… +pdfjs-document-properties-button-label = دستاویز خواص … +pdfjs-document-properties-file-name = فائل دا ناں: +pdfjs-document-properties-file-size = فائل دا سائز: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } بائٹاں) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } بائٹاں) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } کے بی ({ $size_b } بائٹس) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } ایم بی ({ $size_b } بائٹس) +pdfjs-document-properties-title = عنوان: +pdfjs-document-properties-author = تخلیق کار: +pdfjs-document-properties-subject = موضوع: +pdfjs-document-properties-keywords = کلیدی الفاظ: +pdfjs-document-properties-creation-date = تخلیق دی تاریخ: +pdfjs-document-properties-modification-date = ترمیم دی تاریخ: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = تخلیق کار: +pdfjs-document-properties-producer = PDF پیدا کار: +pdfjs-document-properties-version = PDF ورژن: +pdfjs-document-properties-page-count = ورقہ شماری: +pdfjs-document-properties-page-size = ورقہ دی سائز: +pdfjs-document-properties-page-size-unit-inches = وِچ +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = عمودی انداز +pdfjs-document-properties-page-size-orientation-landscape = افقى انداز +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = لیٹر +pdfjs-document-properties-page-size-name-legal = قنونی + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = تکھا ویب نظارہ: +pdfjs-document-properties-linearized-yes = جیا +pdfjs-document-properties-linearized-no = کو +pdfjs-document-properties-close-button = بند کرو + +## Print + +pdfjs-print-progress-message = چھاپݨ کیتے دستاویز تیار تھیندے پئے ہن … +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = منسوخ کرو +pdfjs-printing-not-supported = چتاوݨی: چھپائی ایں براؤزر تے پوری طراں معاونت شدہ کائنی۔ +pdfjs-printing-not-ready = چتاوݨی: PDF چھپائی کیتے پوری طراں لوڈ نئیں تھئی۔ + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = سائیڈ بار ٹوگل کرو +pdfjs-toggle-sidebar-notification-button = + .title = سائیڈ بار ٹوگل کرو (دستاویز وِچ آؤٹ لائن/ منسلکات/ پرتاں شامل ہن) +pdfjs-toggle-sidebar-button-label = سائیڈ بار ٹوگل کرو +pdfjs-document-outline-button = + .title = دستاویز دا خاکہ ݙکھاؤ (تمام آئٹمز کوں پھیلاوݨ/سنگوڑݨ کیتے ڈبل کلک کرو) +pdfjs-document-outline-button-label = دستاویز آؤٹ لائن +pdfjs-attachments-button = + .title = نتھیاں ݙکھاؤ +pdfjs-attachments-button-label = منسلکات +pdfjs-layers-button = + .title = پرتاں ݙکھاؤ (تمام پرتاں کوں ڈیفالٹ حالت وِچ دوبارہ ترتیب ݙیوݨ کیتے ڈبل کلک کرو) +pdfjs-layers-button-label = پرتاں +pdfjs-thumbs-button = + .title = تھمبنیل ݙکھاؤ +pdfjs-thumbs-button-label = تھمبنیلز +pdfjs-current-outline-item-button = + .title = موجودہ آؤٹ لائن آئٹم لبھو +pdfjs-current-outline-item-button-label = موجودہ آؤٹ لائن آئٹم +pdfjs-findbar-button = + .title = دستاویز وِچ لبھو +pdfjs-findbar-button-label = لبھو +pdfjs-additional-layers = اضافی پرتاں + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = ورقہ { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = ورقے دا تھمبنیل { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = لبھو + .placeholder = دستاویز وِچ لبھو … +pdfjs-find-previous-button = + .title = فقرے دا پچھلا واقعہ لبھو +pdfjs-find-previous-button-label = پچھلا +pdfjs-find-next-button = + .title = فقرے دا اڳلا واقعہ لبھو +pdfjs-find-next-button-label = اڳلا +pdfjs-find-highlight-checkbox = تمام نشابر کرو +pdfjs-find-match-case-checkbox-label = حروف مشابہ کرو +pdfjs-find-match-diacritics-checkbox-label = ڈائیکرٹکس مشابہ کرو +pdfjs-find-entire-word-checkbox-label = تمام الفاظ +pdfjs-find-reached-top = ورقے دے شروع تے پُج ڳیا، تلوں جاری کیتا ڳیا +pdfjs-find-reached-bottom = ورقے دے پاند تے پُڄ ڳیا، اُتوں شروع کیتا ڳیا +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] { $total } وِچوں { $current } مشابہ + *[other] { $total } وِچوں { $current } مشابے + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] { $limit } توں ودھ مماثلت۔ + *[other] { $limit } توں ودھ مماثلتاں۔ + } +pdfjs-find-not-found = فقرہ نئیں ملیا + +## Predefined zoom values + +pdfjs-page-scale-width = ورقے دی چوڑائی +pdfjs-page-scale-fit = ورقہ فٹنگ +pdfjs-page-scale-auto = آپوں آپ زوم +pdfjs-page-scale-actual = اصل میچا +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = ورقہ { $page } + +## Loading indicator messages + +pdfjs-loading-error = PDF لوڈ کریندے ویلھے نقص آ ڳیا۔ +pdfjs-invalid-file-error = غلط یا خراب شدہ PDF فائل۔ +pdfjs-missing-file-error = PDF فائل غائب ہے۔ +pdfjs-unexpected-response-error = سرور دا غیر متوقع جواب۔ +pdfjs-rendering-error = ورقہ رینڈر کریندے ویلھے ہک خرابی پیش آڳئی۔ + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } تشریح] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = ایہ PDF فائل کھولݨ کیتے پاس ورڈ درج کرو۔ +pdfjs-password-invalid = غلط پاس ورڈ: براہ مہربانی ولدا کوشش کرو۔ +pdfjs-password-ok-button = ٹھیک ہے +pdfjs-password-cancel-button = منسوخ کرو +pdfjs-web-fonts-disabled = ویب فونٹس غیر فعال ہن: ایمبیڈڈ PDF فونٹس استعمال کرݨ کنوں قاصر ہن + +## Editing + +pdfjs-editor-free-text-button = + .title = متن +pdfjs-editor-free-text-button-label = متن +pdfjs-editor-ink-button = + .title = چھکو +pdfjs-editor-ink-button-label = چھکو +pdfjs-editor-stamp-button = + .title = تصویراں کوں شامل کرو یا ترمیم کرو +pdfjs-editor-stamp-button-label = تصویراں کوں شامل کرو یا ترمیم کرو +pdfjs-editor-highlight-button = + .title = نمایاں کرو +pdfjs-editor-highlight-button-label = نمایاں کرو +pdfjs-highlight-floating-button1 = + .title = نمایاں کرو + .aria-label = نمایاں کرو +pdfjs-highlight-floating-button-label = نمایاں کرو + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = ڈرائینگ ہٹاؤ +pdfjs-editor-remove-freetext-button = + .title = متن ہٹاؤ +pdfjs-editor-remove-stamp-button = + .title = تصویر ہٹاؤ +pdfjs-editor-remove-highlight-button = + .title = نمایاں ہٹاؤ + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = رنگ +pdfjs-editor-free-text-size-input = سائز +pdfjs-editor-ink-color-input = رنگ +pdfjs-editor-ink-thickness-input = ٹھولھ +pdfjs-editor-ink-opacity-input = دھندلاپن +pdfjs-editor-stamp-add-image-button = + .title = تصویر شامل کرو +pdfjs-editor-stamp-add-image-button-label = تصویر شامل کرو +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = مُٹاݨ +pdfjs-editor-free-highlight-thickness-title = + .title = متن توں ان٘ج ٻئے شئیں کوں نمایاں کرݨ ویلے مُٹاݨ کوں بدلو +pdfjs-free-text = + .aria-label = ٹیکسٹ ایڈیٹر +pdfjs-free-text-default-content = ٹائپنگ شروع کرو … +pdfjs-ink = + .aria-label = ڈرا ایڈیٹر +pdfjs-ink-canvas = + .aria-label = صارف دی بݨائی ہوئی تصویر + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = Alt متن +pdfjs-editor-alt-text-edit-button-label = alt متن وِچ ترمیم کرو +pdfjs-editor-alt-text-dialog-label = ہِک اختیار چُݨو +pdfjs-editor-alt-text-dialog-description = Alt متن (متبادل متن) اِیں ویلے مَدَت کرین٘دا ہِے جہڑیلے لوک تصویر کوں نِھیں ݙیکھ سڳدے یا جہڑیلے اِیہ لوڈ کائنی تِھین٘دا۔ +pdfjs-editor-alt-text-add-description-label = تفصیل شامل کرو +pdfjs-editor-alt-text-add-description-description = 1-2 جملیاں دا مقصد جہڑے موضوع، ترتیب، یا اعمال کوں بیان کرین٘دے ہِن۔ +pdfjs-editor-alt-text-mark-decorative-label = آرائشی طور تے نشان زد کرو +pdfjs-editor-alt-text-mark-decorative-description = اِیہ آرائشی تصویراں کِیتے استعمال تِھین٘دا ہِے، جیویں بارڈر یا واٹر مارکس۔ +pdfjs-editor-alt-text-cancel-button = منسوخ +pdfjs-editor-alt-text-save-button = محفوظ +pdfjs-editor-alt-text-decorative-tooltip = آرائشی دے طور تے نشان زد تِھی ڳِیا +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = مثال دے طور تے، "ہِک جؤان کھاݨاں کھاوݨ کِیتے میز اُتّے ٻیٹھا ہِے" +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = Alt متن + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = اُتلی کَھٻّی نُکّڑ — سائز بدلو +pdfjs-editor-resizer-label-top-middle = اُتلا وِچلا — سائز بدلو +pdfjs-editor-resizer-label-top-right = اُتلی سَڄّی نُکَّڑ — سائز بدلو +pdfjs-editor-resizer-label-middle-right = وِچلا سڄّا — سائز بدلو +pdfjs-editor-resizer-label-bottom-right = تلوِیں سَڄّی نُکَّڑ — سائز بدلو +pdfjs-editor-resizer-label-bottom-middle = تلواں وِچلا — سائز بدلو +pdfjs-editor-resizer-label-bottom-left = تلوِیں کَھٻّی نُکّڑ — سائز بدلو +pdfjs-editor-resizer-label-middle-left = وِچلا کَھٻّا — سائز بدلو +pdfjs-editor-resizer-top-left = + .aria-label = اُتلی کَھٻّی نُکّڑ — سائز بدلو +pdfjs-editor-resizer-top-middle = + .aria-label = اُتلا وِچلا — سائز بدلو +pdfjs-editor-resizer-top-right = + .aria-label = اُتلی سَڄّی نُکَّڑ — سائز بدلو +pdfjs-editor-resizer-middle-right = + .aria-label = وِچلا سڄّا — سائز بدلو +pdfjs-editor-resizer-bottom-right = + .aria-label = تلوِیں سَڄّی نُکَّڑ — سائز بدلو +pdfjs-editor-resizer-bottom-middle = + .aria-label = تلواں وِچلا — سائز بدلو +pdfjs-editor-resizer-bottom-left = + .aria-label = تلوِیں کَھٻّی نُکّڑ — سائز بدلو +pdfjs-editor-resizer-middle-left = + .aria-label = وِچلا کَھٻّا — سائز بدلو + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = نشابر رنگ +pdfjs-editor-colorpicker-button = + .title = رنگ بدلو +pdfjs-editor-colorpicker-dropdown = + .aria-label = رنگ اختیارات +pdfjs-editor-colorpicker-yellow = + .title = پیلا +pdfjs-editor-colorpicker-green = + .title = ساوا +pdfjs-editor-colorpicker-blue = + .title = نیلا +pdfjs-editor-colorpicker-pink = + .title = گلابی +pdfjs-editor-colorpicker-red = + .title = لال + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = سارے ݙکھاؤ +pdfjs-editor-highlight-show-all-button = + .title = سارے ݙکھاؤ + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = آلٹ عبارت وچ تبدیلی کرو (تصویر تفصیل) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = آلٹ عبارت شامل کرو (تصویر تفصیل) +pdfjs-editor-new-alt-text-textarea = + .placeholder = اتھ آپݨی وضاحت لکھو۔۔۔ +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = اُنہاں لوکاں کیتے مختصر تفصیل جہڑے تصویر کائنی ݙیکھ سڳدے یا ڄݙݨ تصویر لوڈ کائبی تھیندی۔ +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = آلٹ عبارت خودکار تخلیق تھئی ہے تے غلط تھی سڳدی ہے۔ +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = ٻیا سِکھو +pdfjs-editor-new-alt-text-create-automatically-button-label = آلٹ عبارت خودکار بݨاؤ +pdfjs-editor-new-alt-text-not-now-button = ہݨ کائناں +pdfjs-editor-new-alt-text-error-title = آلٹ عبارت خودکار نہ بݨاؤ +pdfjs-editor-new-alt-text-error-description = سوہݨا، آپݨی آلٹ عبارت لکھو یا ولدا بعد وچ کوشش کرو۔ +pdfjs-editor-new-alt-text-error-close-button = بند کرو +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = آلٹ عبارت اے آئی ماڈل({ $totalSize }ایم بی دے { $downloadedSize }) ڈاؤن لوڈ تھیندا پئے + .aria-valuetext = آلٹ عبارت اے آئی ماڈل({ $totalSize }ایم بی دے { $downloadedSize }) ڈاؤن لوڈ تھیندا پئے +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = آلٹ عبارت شامل تھی ڳئی +pdfjs-editor-new-alt-text-added-button-label = آلٹ عبارت شامل تھی ڳئی +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = متبادل عبارت غائب ہے +pdfjs-editor-new-alt-text-missing-button-label = متبادل عبارت غائب ہے +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = alt متن تے نظرثانی کرو +pdfjs-editor-new-alt-text-to-review-button-label = alt متن تے نظرثانی کرو +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = خودکار تخلیق تھئی: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = تصویر آلٹ عبارت ترتیباں +pdfjs-image-alt-text-settings-button-label = تصویر آلٹ عبارت ترتیباں +pdfjs-editor-alt-text-settings-dialog-label = تصویر آلٹ عبارت ترتیباں +pdfjs-editor-alt-text-settings-automatic-title = خودکار آلٹ عبارت +pdfjs-editor-alt-text-settings-create-model-button-label = آلٹ عبارت خودکار بݨاؤ +pdfjs-editor-alt-text-settings-create-model-description = اُنہاں لوکاں دی مدد کیتے تفصیل تجویز کرو جہڑے تصویر کائنی ݙیکھ سڳدے یا ڄݙݨ تصویر لوڈ کائبی تھیندی۔ +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = آلٹ عبارت اے آئی ماڈل ({ $totalSize } ایم بی) +pdfjs-editor-alt-text-settings-ai-model-description = تہاݙی ڈیوائس تے مقامی طور تے چلدا ہے تاں جو تہاݙا ڈیٹا نجی رہوے۔ خودکار آلٹ عبارت کیتے ضروری ہے۔ +pdfjs-editor-alt-text-settings-delete-model-button = مٹاؤ +pdfjs-editor-alt-text-settings-download-model-button = ڈاؤن لوڈ +pdfjs-editor-alt-text-settings-downloading-model-button = ڈاؤن لوڈ تھیندا پئے … +pdfjs-editor-alt-text-settings-editor-title = متبادل ٹیکسٹ ایڈیٹر +pdfjs-editor-alt-text-settings-show-dialog-button-label = تصویر شامل کرݨ ویلے فوری طور تے آلٹ ٹیکسٹ ایڈیٹر ݙکھاؤ +pdfjs-editor-alt-text-settings-show-dialog-description = ایہ تہاکوں یقینی بݨاوݨ وچ مدد کریندے جو تہاݙیاں ساریاں تصویراں وچ آلٹ عبارت ہے۔ +pdfjs-editor-alt-text-settings-close-button = بند کرو + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-undo-button = + .title = کیتا اݨ کیتا +pdfjs-editor-undo-bar-undo-button-label = کیتا اݨ کیتا +pdfjs-editor-undo-bar-close-button = + .title = بند کرو +pdfjs-editor-undo-bar-close-button-label = بند کرو diff --git a/public/pdfjs/web/locale/sl/viewer.ftl b/public/pdfjs/web/locale/sl/viewer.ftl new file mode 100644 index 0000000..4e004bd --- /dev/null +++ b/public/pdfjs/web/locale/sl/viewer.ftl @@ -0,0 +1,521 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Prejšnja stran +pdfjs-previous-button-label = Nazaj +pdfjs-next-button = + .title = Naslednja stran +pdfjs-next-button-label = Naprej +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Stran +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = od { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } od { $pagesCount }) +pdfjs-zoom-out-button = + .title = Pomanjšaj +pdfjs-zoom-out-button-label = Pomanjšaj +pdfjs-zoom-in-button = + .title = Povečaj +pdfjs-zoom-in-button-label = Povečaj +pdfjs-zoom-select = + .title = Povečava +pdfjs-presentation-mode-button = + .title = Preklopi v način predstavitve +pdfjs-presentation-mode-button-label = Način predstavitve +pdfjs-open-file-button = + .title = Odpri datoteko +pdfjs-open-file-button-label = Odpri +pdfjs-print-button = + .title = Natisni +pdfjs-print-button-label = Natisni +pdfjs-save-button = + .title = Shrani +pdfjs-save-button-label = Shrani +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Prenesi +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Prenesi +pdfjs-bookmark-button = + .title = Trenutna stran (prikaži URL, ki vodi do trenutne strani) +pdfjs-bookmark-button-label = Na trenutno stran + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Orodja +pdfjs-tools-button-label = Orodja +pdfjs-first-page-button = + .title = Pojdi na prvo stran +pdfjs-first-page-button-label = Pojdi na prvo stran +pdfjs-last-page-button = + .title = Pojdi na zadnjo stran +pdfjs-last-page-button-label = Pojdi na zadnjo stran +pdfjs-page-rotate-cw-button = + .title = Zavrti v smeri urnega kazalca +pdfjs-page-rotate-cw-button-label = Zavrti v smeri urnega kazalca +pdfjs-page-rotate-ccw-button = + .title = Zavrti v nasprotni smeri urnega kazalca +pdfjs-page-rotate-ccw-button-label = Zavrti v nasprotni smeri urnega kazalca +pdfjs-cursor-text-select-tool-button = + .title = Omogoči orodje za izbor besedila +pdfjs-cursor-text-select-tool-button-label = Orodje za izbor besedila +pdfjs-cursor-hand-tool-button = + .title = Omogoči roko +pdfjs-cursor-hand-tool-button-label = Roka +pdfjs-scroll-page-button = + .title = Uporabi drsenje po strani +pdfjs-scroll-page-button-label = Drsenje po strani +pdfjs-scroll-vertical-button = + .title = Uporabi navpično drsenje +pdfjs-scroll-vertical-button-label = Navpično drsenje +pdfjs-scroll-horizontal-button = + .title = Uporabi vodoravno drsenje +pdfjs-scroll-horizontal-button-label = Vodoravno drsenje +pdfjs-scroll-wrapped-button = + .title = Uporabi ovito drsenje +pdfjs-scroll-wrapped-button-label = Ovito drsenje +pdfjs-spread-none-button = + .title = Ne združuj razponov strani +pdfjs-spread-none-button-label = Brez razponov +pdfjs-spread-odd-button = + .title = Združuj razpone strani z začetkom pri lihih straneh +pdfjs-spread-odd-button-label = Lihi razponi +pdfjs-spread-even-button = + .title = Združuj razpone strani z začetkom pri sodih straneh +pdfjs-spread-even-button-label = Sodi razponi + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Lastnosti dokumenta … +pdfjs-document-properties-button-label = Lastnosti dokumenta … +pdfjs-document-properties-file-name = Ime datoteke: +pdfjs-document-properties-file-size = Velikost datoteke: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } bajtov) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } bajtov) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bajtov) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bajtov) +pdfjs-document-properties-title = Ime: +pdfjs-document-properties-author = Avtor: +pdfjs-document-properties-subject = Tema: +pdfjs-document-properties-keywords = Ključne besede: +pdfjs-document-properties-creation-date = Datum nastanka: +pdfjs-document-properties-modification-date = Datum spremembe: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Ustvaril: +pdfjs-document-properties-producer = Izdelovalec PDF: +pdfjs-document-properties-version = Različica PDF: +pdfjs-document-properties-page-count = Število strani: +pdfjs-document-properties-page-size = Velikost strani: +pdfjs-document-properties-page-size-unit-inches = palcev +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = pokončno +pdfjs-document-properties-page-size-orientation-landscape = ležeče +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Pismo +pdfjs-document-properties-page-size-name-legal = Pravno + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Hitri spletni ogled: +pdfjs-document-properties-linearized-yes = Da +pdfjs-document-properties-linearized-no = Ne +pdfjs-document-properties-close-button = Zapri + +## Print + +pdfjs-print-progress-message = Priprava dokumenta na tiskanje … +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress } % +pdfjs-print-progress-close-button = Prekliči +pdfjs-printing-not-supported = Opozorilo: ta brskalnik ne podpira vseh možnosti tiskanja. +pdfjs-printing-not-ready = Opozorilo: PDF ni v celoti naložen za tiskanje. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Preklopi stransko vrstico +pdfjs-toggle-sidebar-notification-button = + .title = Preklopi stransko vrstico (dokument vsebuje oris/priponke/plasti) +pdfjs-toggle-sidebar-button-label = Preklopi stransko vrstico +pdfjs-document-outline-button = + .title = Prikaži oris dokumenta (dvokliknite za razširitev/strnitev vseh predmetov) +pdfjs-document-outline-button-label = Oris dokumenta +pdfjs-attachments-button = + .title = Prikaži priponke +pdfjs-attachments-button-label = Priponke +pdfjs-layers-button = + .title = Prikaži plasti (dvokliknite za ponastavitev vseh plasti na privzeto stanje) +pdfjs-layers-button-label = Plasti +pdfjs-thumbs-button = + .title = Prikaži sličice +pdfjs-thumbs-button-label = Sličice +pdfjs-current-outline-item-button = + .title = Najdi trenutni predmet orisa +pdfjs-current-outline-item-button-label = Trenutni predmet orisa +pdfjs-findbar-button = + .title = Iskanje po dokumentu +pdfjs-findbar-button-label = Najdi +pdfjs-additional-layers = Dodatne plasti + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Stran { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Sličica strani { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Najdi + .placeholder = Najdi v dokumentu … +pdfjs-find-previous-button = + .title = Najdi prejšnjo ponovitev iskanega +pdfjs-find-previous-button-label = Najdi nazaj +pdfjs-find-next-button = + .title = Najdi naslednjo ponovitev iskanega +pdfjs-find-next-button-label = Najdi naprej +pdfjs-find-highlight-checkbox = Označi vse +pdfjs-find-match-case-checkbox-label = Razlikuj velike/male črke +pdfjs-find-match-diacritics-checkbox-label = Razlikuj diakritične znake +pdfjs-find-entire-word-checkbox-label = Cele besede +pdfjs-find-reached-top = Dosežen začetek dokumenta iz smeri konca +pdfjs-find-reached-bottom = Doseženo konec dokumenta iz smeri začetka +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] Zadetek { $current } od { $total } + [two] Zadetek { $current } od { $total } + [few] Zadetek { $current } od { $total } + *[other] Zadetek { $current } od { $total } + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] Več kot { $limit } zadetek + [two] Več kot { $limit } zadetka + [few] Več kot { $limit } zadetki + *[other] Več kot { $limit } zadetkov + } +pdfjs-find-not-found = Iskanega ni mogoče najti + +## Predefined zoom values + +pdfjs-page-scale-width = Širina strani +pdfjs-page-scale-fit = Prilagodi stran +pdfjs-page-scale-auto = Samodejno +pdfjs-page-scale-actual = Dejanska velikost +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale } % + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Stran { $page } + +## Loading indicator messages + +pdfjs-loading-error = Med nalaganjem datoteke PDF je prišlo do napake. +pdfjs-invalid-file-error = Neveljavna ali pokvarjena datoteka PDF. +pdfjs-missing-file-error = Ni datoteke PDF. +pdfjs-unexpected-response-error = Nepričakovan odgovor strežnika. +pdfjs-rendering-error = Med pripravljanjem strani je prišlo do napake! + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [Opomba vrste { $type }] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Vnesite geslo za odpiranje te datoteke PDF. +pdfjs-password-invalid = Neveljavno geslo. Poskusite znova. +pdfjs-password-ok-button = V redu +pdfjs-password-cancel-button = Prekliči +pdfjs-web-fonts-disabled = Spletne pisave so onemogočene: vgradnih pisav za PDF ni mogoče uporabiti. + +## Editing + +pdfjs-editor-free-text-button = + .title = Besedilo +pdfjs-editor-free-text-button-label = Besedilo +pdfjs-editor-ink-button = + .title = Riši +pdfjs-editor-ink-button-label = Riši +pdfjs-editor-stamp-button = + .title = Dodajanje ali urejanje slik +pdfjs-editor-stamp-button-label = Dodajanje ali urejanje slik +pdfjs-editor-highlight-button = + .title = Označevalnik +pdfjs-editor-highlight-button-label = Označevalnik +pdfjs-highlight-floating-button1 = + .title = Označi + .aria-label = Označi +pdfjs-highlight-floating-button-label = Označi + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Odstrani risbo +pdfjs-editor-remove-freetext-button = + .title = Odstrani besedilo +pdfjs-editor-remove-stamp-button = + .title = Odstrani sliko +pdfjs-editor-remove-highlight-button = + .title = Odstrani označbo + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Barva +pdfjs-editor-free-text-size-input = Velikost +pdfjs-editor-ink-color-input = Barva +pdfjs-editor-ink-thickness-input = Debelina +pdfjs-editor-ink-opacity-input = Neprosojnost +pdfjs-editor-stamp-add-image-button = + .title = Dodaj sliko +pdfjs-editor-stamp-add-image-button-label = Dodaj sliko +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Debelina +pdfjs-editor-free-highlight-thickness-title = + .title = Spremeni debelino pri označevanju nebesedilnih elementov +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = Urejevalnik besedila + .default-content = Začnite tipkati … +pdfjs-free-text = + .aria-label = Urejevalnik besedila +pdfjs-free-text-default-content = Začnite tipkati … +pdfjs-ink = + .aria-label = Urejevalnik risanja +pdfjs-ink-canvas = + .aria-label = Uporabnikova slika + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = Nadomestno besedilo +pdfjs-editor-alt-text-edit-button = + .aria-label = Uredi nadomestno besedilo +pdfjs-editor-alt-text-edit-button-label = Uredi nadomestno besedilo +pdfjs-editor-alt-text-dialog-label = Izberite možnost +pdfjs-editor-alt-text-dialog-description = Nadomestno besedilo se prikaže tistim, ki ne vidijo slike, ali če se ta ne naloži. +pdfjs-editor-alt-text-add-description-label = Dodaj opis +pdfjs-editor-alt-text-add-description-description = Poskušajte v enem ali dveh stavkih opisati motiv, okolje ali dejanja. +pdfjs-editor-alt-text-mark-decorative-label = Označi kot okrasno +pdfjs-editor-alt-text-mark-decorative-description = Uporablja se za slike, ki služijo samo okrasu, na primer obrobe ali vodne žige. +pdfjs-editor-alt-text-cancel-button = Prekliči +pdfjs-editor-alt-text-save-button = Shrani +pdfjs-editor-alt-text-decorative-tooltip = Označeno kot okrasno +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = Na primer: "Mladenič sedi za mizo pri jedi" +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = Nadomestno besedilo + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Zgornji levi kot – spremeni velikost +pdfjs-editor-resizer-label-top-middle = Zgoraj na sredini – spremeni velikost +pdfjs-editor-resizer-label-top-right = Zgornji desni kot – spremeni velikost +pdfjs-editor-resizer-label-middle-right = Desno na sredini – spremeni velikost +pdfjs-editor-resizer-label-bottom-right = Spodnji desni kot – spremeni velikost +pdfjs-editor-resizer-label-bottom-middle = Spodaj na sredini – spremeni velikost +pdfjs-editor-resizer-label-bottom-left = Spodnji levi kot – spremeni velikost +pdfjs-editor-resizer-label-middle-left = Levo na sredini – spremeni velikost +pdfjs-editor-resizer-top-left = + .aria-label = Zgornji levi kot – spremeni velikost +pdfjs-editor-resizer-top-middle = + .aria-label = Zgoraj na sredini – spremeni velikost +pdfjs-editor-resizer-top-right = + .aria-label = Zgornji desni kot – spremeni velikost +pdfjs-editor-resizer-middle-right = + .aria-label = Desno na sredini – spremeni velikost +pdfjs-editor-resizer-bottom-right = + .aria-label = Spodnji desni kot – spremeni velikost +pdfjs-editor-resizer-bottom-middle = + .aria-label = Spodaj na sredini – spremeni velikost +pdfjs-editor-resizer-bottom-left = + .aria-label = Spodnji levi kot – spremeni velikost +pdfjs-editor-resizer-middle-left = + .aria-label = Levo na sredini – spremeni velikost + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Barva označbe +pdfjs-editor-colorpicker-button = + .title = Spremeni barvo +pdfjs-editor-colorpicker-dropdown = + .aria-label = Izbira barve +pdfjs-editor-colorpicker-yellow = + .title = Rumena +pdfjs-editor-colorpicker-green = + .title = Zelena +pdfjs-editor-colorpicker-blue = + .title = Modra +pdfjs-editor-colorpicker-pink = + .title = Roza +pdfjs-editor-colorpicker-red = + .title = Rdeča + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Prikaži vse +pdfjs-editor-highlight-show-all-button = + .title = Prikaži vse + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = Uredi nadomestno besedilo (opis slike) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = Dodaj nadomestno besedilo (opis slike) +pdfjs-editor-new-alt-text-textarea = + .placeholder = Tukaj napišite svoj opis … +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = Kratek opis za ljudi, ki ne morejo videti slike, ali za primer, ko se slika ne naloži. +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = To nadomestno besedilo je bilo ustvarjeno samodejno in je lahko netočno. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Več o tem +pdfjs-editor-new-alt-text-create-automatically-button-label = Samodejno ustvari nadomestno besedilo +pdfjs-editor-new-alt-text-not-now-button = Ne zdaj +pdfjs-editor-new-alt-text-error-title = Nadomestnega besedila ni bilo mogoče samodejno ustvariti +pdfjs-editor-new-alt-text-error-description = Sestavite svoje nadomestno besedilo ali poskusite znova pozneje. +pdfjs-editor-new-alt-text-error-close-button = Zapri +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = Prenašanje modela UI za nadomestno besedilo ({ $downloadedSize } od { $totalSize } MB) + .aria-valuetext = Prenašanje modela UI za nadomestno besedilo ({ $downloadedSize } od { $totalSize } MB) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = Nadomestno besedilo dodano +pdfjs-editor-new-alt-text-added-button-label = Nadomestno besedilo dodano +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = Nadomestno besedilo manjka +pdfjs-editor-new-alt-text-missing-button-label = Nadomestno besedilo manjka +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = Oceni nadomestno besedilo +pdfjs-editor-new-alt-text-to-review-button-label = Oceni nadomestno besedilo +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Samodejno ustvarjeno: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = Nastavitve nadomestnega besedila slike +pdfjs-image-alt-text-settings-button-label = Nastavitve nadomestnega besedila slike +pdfjs-editor-alt-text-settings-dialog-label = Nastavitve nadomestnega besedila slike +pdfjs-editor-alt-text-settings-automatic-title = Samodejno nadomestno besedilo +pdfjs-editor-alt-text-settings-create-model-button-label = Samodejno ustvari nadomestno besedilo +pdfjs-editor-alt-text-settings-create-model-description = Predlaga opise za pomoč ljudem, ki ne morejo videti slike, ali za primer, ko se slika ne naloži. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = Model UI za nadomestno besedilo ({ $totalSize } MB) +pdfjs-editor-alt-text-settings-ai-model-description = Izvaja se lokalno na vaši napravi, tako da vaši podatki ostajajo zasebni. Zahtevano za samodejno nadomestno besedilo. +pdfjs-editor-alt-text-settings-delete-model-button = Izbriši +pdfjs-editor-alt-text-settings-download-model-button = Prenesi +pdfjs-editor-alt-text-settings-downloading-model-button = Prenašanje ... +pdfjs-editor-alt-text-settings-editor-title = Urejevalnik nadomestnega besedila +pdfjs-editor-alt-text-settings-show-dialog-button-label = Ob dodajanju slike takoj prikaži urejevalnik nadomestnega besedila +pdfjs-editor-alt-text-settings-show-dialog-description = Pomaga vam zagotoviti, da imajo vse vaše slike nadomestno besedilo. +pdfjs-editor-alt-text-settings-close-button = Zapri + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = Označba odstranjena +pdfjs-editor-undo-bar-message-freetext = Besedilo odstranjeno +pdfjs-editor-undo-bar-message-ink = Risba odstranjena +pdfjs-editor-undo-bar-message-stamp = Slika odstranjena +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = + { $count -> + [one] { $count } označba odstranjena + [two] { $count } označbi odstranjeni + [few] { $count } označbe odstranjene + *[other] { $count } označb odstranjenih + } +pdfjs-editor-undo-bar-undo-button = + .title = Razveljavi +pdfjs-editor-undo-bar-undo-button-label = Razveljavi +pdfjs-editor-undo-bar-close-button = + .title = Zapri +pdfjs-editor-undo-bar-close-button-label = Zapri diff --git a/public/pdfjs/web/locale/son/viewer.ftl b/public/pdfjs/web/locale/son/viewer.ftl new file mode 100644 index 0000000..fa4f6b1 --- /dev/null +++ b/public/pdfjs/web/locale/son/viewer.ftl @@ -0,0 +1,206 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Moo bisante +pdfjs-previous-button-label = Bisante +pdfjs-next-button = + .title = Jinehere moo +pdfjs-next-button-label = Jine +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Moo +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = { $pagesCount } ra +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } ka hun { $pagesCount }) ra +pdfjs-zoom-out-button = + .title = Nakasandi +pdfjs-zoom-out-button-label = Nakasandi +pdfjs-zoom-in-button = + .title = Bebbeerandi +pdfjs-zoom-in-button-label = Bebbeerandi +pdfjs-zoom-select = + .title = Bebbeerandi +pdfjs-presentation-mode-button = + .title = Bere cebeyan alhaali +pdfjs-presentation-mode-button-label = Cebeyan alhaali +pdfjs-open-file-button = + .title = Tuku feeri +pdfjs-open-file-button-label = Feeri +pdfjs-print-button = + .title = Kar +pdfjs-print-button-label = Kar + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Goyjinawey +pdfjs-tools-button-label = Goyjinawey +pdfjs-first-page-button = + .title = Koy moo jinaa ga +pdfjs-first-page-button-label = Koy moo jinaa ga +pdfjs-last-page-button = + .title = Koy moo koraa ga +pdfjs-last-page-button-label = Koy moo koraa ga +pdfjs-page-rotate-cw-button = + .title = Kuubi kanbe guma here +pdfjs-page-rotate-cw-button-label = Kuubi kanbe guma here +pdfjs-page-rotate-ccw-button = + .title = Kuubi kanbe wowa here +pdfjs-page-rotate-ccw-button-label = Kuubi kanbe wowa here + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Takadda mayrawey… +pdfjs-document-properties-button-label = Takadda mayrawey… +pdfjs-document-properties-file-name = Tuku maa: +pdfjs-document-properties-file-size = Tuku adadu: +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = KB { $size_kb } (cebsu-ize { $size_b }) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = MB { $size_mb } (cebsu-ize { $size_b }) +pdfjs-document-properties-title = Tiiramaa: +pdfjs-document-properties-author = Hantumkaw: +pdfjs-document-properties-subject = Dalil: +pdfjs-document-properties-keywords = Kufalkalimawey: +pdfjs-document-properties-creation-date = Teeyan han: +pdfjs-document-properties-modification-date = Barmayan han: +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Teekaw: +pdfjs-document-properties-producer = PDF berandikaw: +pdfjs-document-properties-version = PDF dumi: +pdfjs-document-properties-page-count = Moo hinna: + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + + +## + +pdfjs-document-properties-close-button = Daabu + +## Print + +pdfjs-print-progress-message = Goo ma takaddaa soolu k'a kar se… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Naŋ +pdfjs-printing-not-supported = Yaamar: Karyan ši tee ka timme nda ceecikaa woo. +pdfjs-printing-not-ready = Yaamar: PDF ši zunbu ka timme karyan še. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Kanjari ceraw zuu +pdfjs-toggle-sidebar-button-label = Kanjari ceraw zuu +pdfjs-document-outline-button = + .title = Takaddaa korfur alhaaloo cebe (naagu cee hinka ka haya-izey kul hayandi/kankamandi) +pdfjs-document-outline-button-label = Takadda filla-boŋ +pdfjs-attachments-button = + .title = Hangarey cebe +pdfjs-attachments-button-label = Hangarey +pdfjs-thumbs-button = + .title = Kabeboy biyey cebe +pdfjs-thumbs-button-label = Kabeboy biyey +pdfjs-findbar-button = + .title = Ceeci takaddaa ra +pdfjs-findbar-button-label = Ceeci + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = { $page } moo +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Kabeboy bii { $page } moo še + +## Find panel button title and messages + +pdfjs-find-input = + .title = Ceeci + .placeholder = Ceeci takaddaa ra… +pdfjs-find-previous-button = + .title = Kalimaɲaŋoo bangayri bisantaa ceeci +pdfjs-find-previous-button-label = Bisante +pdfjs-find-next-button = + .title = Kalimaɲaŋoo hiino bangayroo ceeci +pdfjs-find-next-button-label = Jine +pdfjs-find-highlight-checkbox = Ikul šilbay +pdfjs-find-match-case-checkbox-label = Harfu-beeriyan hawgay +pdfjs-find-reached-top = A too moŋoo boŋoo, koy jine ka šinitin nda cewoo +pdfjs-find-reached-bottom = A too moɲoo cewoo, koy jine šintioo ga +pdfjs-find-not-found = Kalimaɲaa mana duwandi + +## Predefined zoom values + +pdfjs-page-scale-width = Mooo hayyan +pdfjs-page-scale-fit = Moo sawayan +pdfjs-page-scale-auto = Boŋše azzaati barmayyan +pdfjs-page-scale-actual = Adadu cimi +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + + +## Loading indicator messages + +pdfjs-loading-error = Firka bangay kaŋ PDF goo ma zumandi. +pdfjs-invalid-file-error = PDF tuku laala wala laybante. +pdfjs-missing-file-error = PDF tuku kumante. +pdfjs-unexpected-response-error = Manti feršikaw tuuruyan maatante. +pdfjs-rendering-error = Firka bangay kaŋ moɲoo goo ma willandi. + +## Annotations + +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = { $type } maasa-caw] + +## Password + +pdfjs-password-label = Šennikufal dam ka PDF tukoo woo feeri. +pdfjs-password-invalid = Šennikufal laalo. Ceeci koyne taare. +pdfjs-password-ok-button = Ayyo +pdfjs-password-cancel-button = Naŋ +pdfjs-web-fonts-disabled = Interneti šigirawey kay: ši hin ka goy nda PDF šigira hurantey. + +## Editing + + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + diff --git a/public/pdfjs/web/locale/sq/viewer.ftl b/public/pdfjs/web/locale/sq/viewer.ftl new file mode 100644 index 0000000..2b1c91a --- /dev/null +++ b/public/pdfjs/web/locale/sq/viewer.ftl @@ -0,0 +1,506 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Faqja e Mëparshme +pdfjs-previous-button-label = E mëparshmja +pdfjs-next-button = + .title = Faqja Pasuese +pdfjs-next-button-label = Pasuesja +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Faqe +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = nga { $pagesCount } gjithsej +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } nga { $pagesCount }) +pdfjs-zoom-out-button = + .title = Zvogëlojeni +pdfjs-zoom-out-button-label = Zvogëlojeni +pdfjs-zoom-in-button = + .title = Zmadhojeni +pdfjs-zoom-in-button-label = Zmadhojini +pdfjs-zoom-select = + .title = Zmadhim/Zvogëlim +pdfjs-presentation-mode-button = + .title = Kalo te Mënyra Paraqitje +pdfjs-presentation-mode-button-label = Mënyra Paraqitje +pdfjs-open-file-button = + .title = Hapni Kartelë +pdfjs-open-file-button-label = Hape +pdfjs-print-button = + .title = Shtypje +pdfjs-print-button-label = Shtype +pdfjs-save-button = + .title = Ruaje +pdfjs-save-button-label = Ruaje +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Shkarkojeni +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Shkarkoje +pdfjs-bookmark-button = + .title = Faqja e Tanishme (Shihni URL nga Faqja e Tanishme) +pdfjs-bookmark-button-label = Faqja e Tanishme + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Mjete +pdfjs-tools-button-label = Mjete +pdfjs-first-page-button = + .title = Kaloni te Faqja e Parë +pdfjs-first-page-button-label = Kaloni te Faqja e Parë +pdfjs-last-page-button = + .title = Kaloni te Faqja e Fundit +pdfjs-last-page-button-label = Kaloni te Faqja e Fundit +pdfjs-page-rotate-cw-button = + .title = Rrotullojeni Në Kahun Orar +pdfjs-page-rotate-cw-button-label = Rrotulloje Në Kahun Orar +pdfjs-page-rotate-ccw-button = + .title = Rrotullojeni Në Kahun Kundërorar +pdfjs-page-rotate-ccw-button-label = Rrotulloje Në Kahun Kundërorar +pdfjs-cursor-text-select-tool-button = + .title = Aktivizo Mjet Përzgjedhjeje Teksti +pdfjs-cursor-text-select-tool-button-label = Mjet Përzgjedhjeje Teksti +pdfjs-cursor-hand-tool-button = + .title = Aktivizo Mjetin Dorë +pdfjs-cursor-hand-tool-button-label = Mjeti Dorë +pdfjs-scroll-page-button = + .title = Përdor Rrëshqitje Në Faqe +pdfjs-scroll-page-button-label = Rrëshqitje Në Faqe +pdfjs-scroll-vertical-button = + .title = Përdor Rrëshqitje Vertikale +pdfjs-scroll-vertical-button-label = Rrëshqitje Vertikale +pdfjs-scroll-horizontal-button = + .title = Përdor Rrëshqitje Horizontale +pdfjs-scroll-horizontal-button-label = Rrëshqitje Horizontale +pdfjs-scroll-wrapped-button = + .title = Përdor Rrëshqitje Me Mbështjellje +pdfjs-scroll-wrapped-button-label = Rrëshqitje Me Mbështjellje + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Veti Dokumenti… +pdfjs-document-properties-button-label = Veti Dokumenti… +pdfjs-document-properties-file-name = Emër kartele: +pdfjs-document-properties-file-size = Madhësi kartele: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } bajte) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } bajte) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bajte) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bajte) +pdfjs-document-properties-title = Titull: +pdfjs-document-properties-author = Autor: +pdfjs-document-properties-subject = Subjekt: +pdfjs-document-properties-keywords = Fjalëkyçe: +pdfjs-document-properties-creation-date = Datë Krijimi: +pdfjs-document-properties-modification-date = Datë Ndryshimi: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Krijues: +pdfjs-document-properties-producer = Prodhues PDF-je: +pdfjs-document-properties-version = Version PDF-je: +pdfjs-document-properties-page-count = Numër Faqesh: +pdfjs-document-properties-page-size = Madhësi Faqeje: +pdfjs-document-properties-page-size-unit-inches = inç +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = portret +pdfjs-document-properties-page-size-orientation-landscape = së gjeri +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Letter +pdfjs-document-properties-page-size-name-legal = Legal + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Parje e Shpjetë në Web: +pdfjs-document-properties-linearized-yes = Po +pdfjs-document-properties-linearized-no = Jo +pdfjs-document-properties-close-button = Mbylleni + +## Print + +pdfjs-print-progress-message = Po përgatitet dokumenti për shtypje… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Anuloje +pdfjs-printing-not-supported = Kujdes: Shtypja s’mbulohet plotësisht nga ky shfletues. +pdfjs-printing-not-ready = Kujdes: PDF-ja s’është ngarkuar plotësisht që ta shtypni. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Shfaqni/Fshihni Anështyllën +pdfjs-toggle-sidebar-notification-button = + .title = Hap/Mbyll Anështylë (dokumenti përmban përvijim/nashkëngjitje/shtresa) +pdfjs-toggle-sidebar-button-label = Shfaq/Fshih Anështyllën +pdfjs-document-outline-button = + .title = Shfaqni Përvijim Dokumenti (dyklikoni që të shfaqen/fshihen krejt elementët) +pdfjs-document-outline-button-label = Përvijim Dokumenti +pdfjs-attachments-button = + .title = Shfaqni Bashkëngjitje +pdfjs-attachments-button-label = Bashkëngjitje +pdfjs-layers-button = + .title = Shfaq Shtresa (dyklikoni që të rikthehen krejt shtresat në gjendjen e tyre parazgjedhje) +pdfjs-layers-button-label = Shtresa +pdfjs-thumbs-button = + .title = Shfaqni Miniatura +pdfjs-thumbs-button-label = Miniatura +pdfjs-current-outline-item-button = + .title = Gjej Objektin e Tanishëm të Përvijuar +pdfjs-current-outline-item-button-label = Objekt i Tanishëm i Përvijuar +pdfjs-findbar-button = + .title = Gjeni në Dokument +pdfjs-findbar-button-label = Gjej +pdfjs-additional-layers = Shtresa Shtesë + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Faqja { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Miniaturë e Faqes { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Gjej + .placeholder = Gjeni në dokument… +pdfjs-find-previous-button = + .title = Gjeni hasjen e mëparshme të togfjalëshit +pdfjs-find-previous-button-label = E mëparshmja +pdfjs-find-next-button = + .title = Gjeni hasjen pasuese të togfjalëshit +pdfjs-find-next-button-label = Pasuesja +pdfjs-find-highlight-checkbox = Theksoji të tëra +pdfjs-find-match-case-checkbox-label = Siç Është Shkruar +pdfjs-find-match-diacritics-checkbox-label = Me Përputhje Me Shenjat Diakritike +pdfjs-find-entire-word-checkbox-label = Fjalë të Plota +pdfjs-find-reached-top = U mbërrit në krye të dokumentit, vazhduar prej fundit +pdfjs-find-reached-bottom = U mbërrit në fund të dokumentit, vazhduar prej kreut +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] { $current } nga { $total } përputhje + *[other] { $current } nga { $total } përputhje + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] Më tepër se { $limit } përputhje + *[other] Më tepër se { $limit } përputhje + } +pdfjs-find-not-found = Togfjalësh që s’gjendet + +## Predefined zoom values + +pdfjs-page-scale-width = Gjerësi Faqeje +pdfjs-page-scale-fit = Sa Nxë Faqja +pdfjs-page-scale-auto = Zoom i Vetvetishëm +pdfjs-page-scale-actual = Madhësia Faktike +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Faqja { $page } + +## Loading indicator messages + +pdfjs-loading-error = Ndodhi një gabim gjatë ngarkimit të PDF-së. +pdfjs-invalid-file-error = Kartelë PDF e pavlefshme ose e dëmtuar. +pdfjs-missing-file-error = Kartelë PDF që mungon. +pdfjs-unexpected-response-error = Përgjigje shërbyesi e papritur. +pdfjs-rendering-error = Ndodhi një gabim gjatë riprodhimit të faqes. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [Nënvizim { $type }] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Jepni fjalëkalimin që të hapet kjo kartelë PDF. +pdfjs-password-invalid = Fjalëkalim i pavlefshëm. Ju lutemi, riprovoni. +pdfjs-password-ok-button = OK +pdfjs-password-cancel-button = Anuloje +pdfjs-web-fonts-disabled = Shkronjat Web janë të çaktivizuara: s’arrihet të përdoren shkronja të trupëzuara në PDF. + +## Editing + +pdfjs-editor-free-text-button = + .title = Tekst +pdfjs-editor-free-text-button-label = Tekst +pdfjs-editor-ink-button = + .title = Vizatoni +pdfjs-editor-ink-button-label = Vizatoni +pdfjs-editor-stamp-button = + .title = Shtoni ose përpunoni figura +pdfjs-editor-stamp-button-label = Shtoni ose përpunoni figura +pdfjs-editor-highlight-button = + .title = Theksim +pdfjs-editor-highlight-button-label = Theksoje +pdfjs-highlight-floating-button1 = + .title = Theksim + .aria-label = Theksim +pdfjs-highlight-floating-button-label = Theksim + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Hiq vizatim +pdfjs-editor-remove-freetext-button = + .title = Hiq tekst +pdfjs-editor-remove-stamp-button = + .title = Hiq figurë +pdfjs-editor-remove-highlight-button = + .title = Hiqe theksimin + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Ngjyrë +pdfjs-editor-free-text-size-input = Madhësi +pdfjs-editor-ink-color-input = Ngjyrë +pdfjs-editor-ink-thickness-input = Trashësi +pdfjs-editor-ink-opacity-input = Patejdukshmëri +pdfjs-editor-stamp-add-image-button = + .title = Shtoni figurë +pdfjs-editor-stamp-add-image-button-label = Shtoni figurë +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Trashësi +pdfjs-editor-free-highlight-thickness-title = + .title = Ndryshoni trashësinë kur theksoni objekte tjetër nga tekst +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = Përpunues Tekstesh + .default-content = Filloni të shtypni… +pdfjs-free-text = + .aria-label = Përpunues Tekstesh +pdfjs-free-text-default-content = Filloni të shtypni… +pdfjs-ink = + .aria-label = Përpunues Vizatimesh +pdfjs-ink-canvas = + .aria-label = Figurë e krijuar nga përdoruesi + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = Tekst alternativ +pdfjs-editor-alt-text-edit-button = + .aria-label = Përpunoni tekst alternativ +pdfjs-editor-alt-text-edit-button-label = Përpunoni tekst alternativ +pdfjs-editor-alt-text-dialog-label = Zgjidhni një mundësi +pdfjs-editor-alt-text-dialog-description = Teksti alt (tekst alternativ) vjen në ndihmë kur njerëzit s’mund të shohin figurën, ose kur ajo nuk ngarkohet. +pdfjs-editor-alt-text-add-description-label = Shtoni një përshkrim +pdfjs-editor-alt-text-add-description-description = Synoni për 1-2 togfjalësha që përshkruajnë subjektin, rrethanat apo veprimet. +pdfjs-editor-alt-text-mark-decorative-label = Vëri shenjë si dekorative +pdfjs-editor-alt-text-mark-decorative-description = Kjo përdoret për figura zbukuruese, fjala vjen, anë, ose watermark-e. +pdfjs-editor-alt-text-cancel-button = Anuloje +pdfjs-editor-alt-text-save-button = Ruaje +pdfjs-editor-alt-text-decorative-tooltip = Iu vu shenjë si dekorative +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = Për shembull, “Një djalosh ulet në një tryezë të hajë” +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = Tekst alternativ + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Cepi i sipërm majtas — ripërmasojeni +pdfjs-editor-resizer-label-top-middle = Mesi i pjesës sipër — ripërmasojeni +pdfjs-editor-resizer-label-top-right = Cepi i sipërm djathtas — ripërmasojeni +pdfjs-editor-resizer-label-middle-right = Djathtas në mes — ripërmasojeni +pdfjs-editor-resizer-label-bottom-right = Cepi i poshtëm djathtas — ripërmasojeni +pdfjs-editor-resizer-label-bottom-middle = Mesi i pjesës poshtë — ripërmasojeni +pdfjs-editor-resizer-label-bottom-left = Cepi i poshtëm — ripërmasojeni +pdfjs-editor-resizer-label-middle-left = Majtas në mes — ripërmasojeni +pdfjs-editor-resizer-top-left = + .aria-label = Cepi i sipërm majtas — ripërmasojeni +pdfjs-editor-resizer-top-middle = + .aria-label = Mesi i pjesës sipër — ripërmasojeni +pdfjs-editor-resizer-top-right = + .aria-label = Cepi i sipërm djathtas — ripërmasojeni +pdfjs-editor-resizer-middle-right = + .aria-label = Djathtas në mes — ripërmasojeni +pdfjs-editor-resizer-bottom-right = + .aria-label = Cepi i poshtëm djathtas — ripërmasojeni +pdfjs-editor-resizer-bottom-middle = + .aria-label = Mesi i pjesës poshtë — ripërmasojeni +pdfjs-editor-resizer-bottom-left = + .aria-label = Cepi i poshtëm — ripërmasojeni +pdfjs-editor-resizer-middle-left = + .aria-label = Majtas në mes — ripërmasojeni + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Ngjyrë theksimi +pdfjs-editor-colorpicker-button = + .title = Ndryshoni ngjyrë +pdfjs-editor-colorpicker-dropdown = + .aria-label = Zgjedhje ngjyre +pdfjs-editor-colorpicker-yellow = + .title = E verdhë +pdfjs-editor-colorpicker-green = + .title = E gjelbër +pdfjs-editor-colorpicker-blue = + .title = Blu +pdfjs-editor-colorpicker-pink = + .title = Rozë +pdfjs-editor-colorpicker-red = + .title = E kuqe + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Shfaqi krejt +pdfjs-editor-highlight-show-all-button = + .title = Shfaqi krejt + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = Përpunoni tekst alternativ (përshkrim figure) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = Shtoni tekst alternativ (përshkrim figure) +pdfjs-editor-new-alt-text-textarea = + .placeholder = Shkruani këtu përshkrimin tuaj… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = Përshkrim i shkurtër për persona që s’munden të shohin figurën, ose për kur figura nuk ngarkohet dot. +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = Ky tekst alternativ qe krijuar automatikisht dhe mund të jetë i pasaktë. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Mësoni më tepër +pdfjs-editor-new-alt-text-create-automatically-button-label = Krijo automatikisht tekst alternativ +pdfjs-editor-new-alt-text-not-now-button = Jo tani +pdfjs-editor-new-alt-text-error-title = S’u krijua dot automatikisht tekst alternativ +pdfjs-editor-new-alt-text-error-description = Ju lutemi, shkruani tekstin tuaj alternativ, ose riprovoni më vonë. +pdfjs-editor-new-alt-text-error-close-button = Mbylle +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = Po shkarkohet model IA teksti alternativ ({ $downloadedSize } nga { $totalSize } MB) + .aria-valuetext = Po shkarkohet model IA teksti alternativ ({ $downloadedSize } nga { $totalSize } MB) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = U shtua tekst alternativ +pdfjs-editor-new-alt-text-added-button-label = U shtua tekst alternativ +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = Mungon tekst alternativ +pdfjs-editor-new-alt-text-missing-button-label = Mungon tekst alternativ +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = Shqyrtoni tekst alternativ +pdfjs-editor-new-alt-text-to-review-button-label = Shqyrtoni tekst alternativ +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Krijuar automatikisht: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = Rregullime teksti alternativ figure +pdfjs-image-alt-text-settings-button-label = Rregullime teksti alternativ figure +pdfjs-editor-alt-text-settings-dialog-label = Rregullime teksti alternativ figure +pdfjs-editor-alt-text-settings-automatic-title = Tekst alternativ i automatizuar +pdfjs-editor-alt-text-settings-create-model-button-label = Krijo automatikisht tekst alternativ +pdfjs-editor-alt-text-settings-create-model-description = Sugjeron përshkrime, për të ndihmuar persona që s’munden të shohin figurën, ose për kur figura nuk ngarkohet dot. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = Model IA teksti alternativ ({ $totalSize } MB) +pdfjs-editor-alt-text-settings-ai-model-description = Xhiron lokalisht në pajisjen tuaj, pra të dhënat tuaja mbeten private. E domosdoshme për tekst të automatizuar alternativ. +pdfjs-editor-alt-text-settings-delete-model-button = Fshije +pdfjs-editor-alt-text-settings-download-model-button = Shkarkoje +pdfjs-editor-alt-text-settings-downloading-model-button = Po shkarkohet… +pdfjs-editor-alt-text-settings-editor-title = Përpunues teksti alternativ +pdfjs-editor-alt-text-settings-show-dialog-button-label = Shfaq menjëherë përpunues teksti alternativ, kur shtohet një figurë +pdfjs-editor-alt-text-settings-show-dialog-description = Ju ndihmon të siguroheni se krejt figurat tuaja kanë tekst alternativ. +pdfjs-editor-alt-text-settings-close-button = Mbylle + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = U hoq theksimi +pdfjs-editor-undo-bar-message-freetext = U hoq tekst +pdfjs-editor-undo-bar-message-ink = U hoq vizatim +pdfjs-editor-undo-bar-message-stamp = U hoq figurë +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = + { $count -> + [one] U hoq { $count } shënim + *[other] U hoqën { $count } shënime + } +pdfjs-editor-undo-bar-undo-button = + .title = Zhbëje +pdfjs-editor-undo-bar-undo-button-label = Zhbëje +pdfjs-editor-undo-bar-close-button = + .title = Mbylle +pdfjs-editor-undo-bar-close-button-label = Mbylle diff --git a/public/pdfjs/web/locale/sr/viewer.ftl b/public/pdfjs/web/locale/sr/viewer.ftl new file mode 100644 index 0000000..e125dfb --- /dev/null +++ b/public/pdfjs/web/locale/sr/viewer.ftl @@ -0,0 +1,421 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Претходна страница +pdfjs-previous-button-label = Претходна +pdfjs-next-button = + .title = Следећа страница +pdfjs-next-button-label = Следећа +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Страница +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = од { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } од { $pagesCount }) +pdfjs-zoom-out-button = + .title = Умањи +pdfjs-zoom-out-button-label = Умањи +pdfjs-zoom-in-button = + .title = Увеличај +pdfjs-zoom-in-button-label = Увеличај +pdfjs-zoom-select = + .title = Увеличавање +pdfjs-presentation-mode-button = + .title = Промени на приказ у режиму презентације +pdfjs-presentation-mode-button-label = Режим презентације +pdfjs-open-file-button = + .title = Отвори датотеку +pdfjs-open-file-button-label = Отвори +pdfjs-print-button = + .title = Штампај +pdfjs-print-button-label = Штампај +pdfjs-save-button = + .title = Сачувај +pdfjs-save-button-label = Сачувај +pdfjs-bookmark-button = + .title = Тренутна страница (погледајте URL са тренутне странице) +pdfjs-bookmark-button-label = Тренутна страница + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Алатке +pdfjs-tools-button-label = Алатке +pdfjs-first-page-button = + .title = Иди на прву страницу +pdfjs-first-page-button-label = Иди на прву страницу +pdfjs-last-page-button = + .title = Иди на последњу страницу +pdfjs-last-page-button-label = Иди на последњу страницу +pdfjs-page-rotate-cw-button = + .title = Ротирај у смеру казаљке на сату +pdfjs-page-rotate-cw-button-label = Ротирај у смеру казаљке на сату +pdfjs-page-rotate-ccw-button = + .title = Ротирај у смеру супротном од казаљке на сату +pdfjs-page-rotate-ccw-button-label = Ротирај у смеру супротном од казаљке на сату +pdfjs-cursor-text-select-tool-button = + .title = Омогући алат за селектовање текста +pdfjs-cursor-text-select-tool-button-label = Алат за селектовање текста +pdfjs-cursor-hand-tool-button = + .title = Омогући алат за померање +pdfjs-cursor-hand-tool-button-label = Алат за померање +pdfjs-scroll-page-button = + .title = Користи скроловање по омоту +pdfjs-scroll-page-button-label = Скроловање странице +pdfjs-scroll-vertical-button = + .title = Користи вертикално скроловање +pdfjs-scroll-vertical-button-label = Вертикално скроловање +pdfjs-scroll-horizontal-button = + .title = Користи хоризонтално скроловање +pdfjs-scroll-horizontal-button-label = Хоризонтално скроловање +pdfjs-scroll-wrapped-button = + .title = Користи скроловање по омоту +pdfjs-scroll-wrapped-button-label = Скроловање по омоту +pdfjs-spread-none-button = + .title = Немој спајати ширења страница +pdfjs-spread-none-button-label = Без распростирања +pdfjs-spread-odd-button = + .title = Споји ширења страница које почињу непарним бројем +pdfjs-spread-odd-button-label = Непарна распростирања +pdfjs-spread-even-button = + .title = Споји ширења страница које почињу парним бројем +pdfjs-spread-even-button-label = Парна распростирања + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Параметри документа… +pdfjs-document-properties-button-label = Параметри документа… +pdfjs-document-properties-file-name = Име датотеке: +pdfjs-document-properties-file-size = Величина датотеке: +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } B) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } B) +pdfjs-document-properties-title = Наслов: +pdfjs-document-properties-author = Аутор: +pdfjs-document-properties-subject = Тема: +pdfjs-document-properties-keywords = Кључне речи: +pdfjs-document-properties-creation-date = Датум креирања: +pdfjs-document-properties-modification-date = Датум модификације: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Стваралац: +pdfjs-document-properties-producer = PDF произвођач: +pdfjs-document-properties-version = PDF верзија: +pdfjs-document-properties-page-count = Број страница: +pdfjs-document-properties-page-size = Величина странице: +pdfjs-document-properties-page-size-unit-inches = ин +pdfjs-document-properties-page-size-unit-millimeters = мм +pdfjs-document-properties-page-size-orientation-portrait = усправно +pdfjs-document-properties-page-size-orientation-landscape = водоравно +pdfjs-document-properties-page-size-name-a-three = А3 +pdfjs-document-properties-page-size-name-a-four = А4 +pdfjs-document-properties-page-size-name-letter = Слово +pdfjs-document-properties-page-size-name-legal = Права + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Брз веб приказ: +pdfjs-document-properties-linearized-yes = Да +pdfjs-document-properties-linearized-no = Не +pdfjs-document-properties-close-button = Затвори + +## Print + +pdfjs-print-progress-message = Припремам документ за штампање… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Откажи +pdfjs-printing-not-supported = Упозорење: Штампање није у потпуности подржано у овом прегледачу. +pdfjs-printing-not-ready = Упозорење: PDF није у потпуности учитан за штампу. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Прикажи/сакриј бочни панел +pdfjs-toggle-sidebar-notification-button = + .title = Прикажи/сакриј бочни панел (документ садржи контуру/прилоге/слојеве) +pdfjs-toggle-sidebar-button-label = Прикажи/сакриј бочни панел +pdfjs-document-outline-button = + .title = Прикажи структуру документа (двоструким кликом проширујете/скупљате све ставке) +pdfjs-document-outline-button-label = Контура документа +pdfjs-attachments-button = + .title = Прикажи прилоге +pdfjs-attachments-button-label = Прилози +pdfjs-layers-button = + .title = Прикажи слојеве (дупли клик за враћање свих слојева у подразумевано стање) +pdfjs-layers-button-label = Слојеви +pdfjs-thumbs-button = + .title = Прикажи сличице +pdfjs-thumbs-button-label = Сличице +pdfjs-current-outline-item-button = + .title = Пронађите тренутни елемент структуре +pdfjs-current-outline-item-button-label = Тренутна контура +pdfjs-findbar-button = + .title = Пронађи у документу +pdfjs-findbar-button-label = Пронађи +pdfjs-additional-layers = Додатни слојеви + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Страница { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Сличица од странице { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Пронађи + .placeholder = Пронађи у документу… +pdfjs-find-previous-button = + .title = Пронађи претходно појављивање фразе +pdfjs-find-previous-button-label = Претходна +pdfjs-find-next-button = + .title = Пронађи следеће појављивање фразе +pdfjs-find-next-button-label = Следећа +pdfjs-find-highlight-checkbox = Истакнути све +pdfjs-find-match-case-checkbox-label = Подударања +pdfjs-find-match-diacritics-checkbox-label = Дијакритика +pdfjs-find-entire-word-checkbox-label = Целе речи +pdfjs-find-reached-top = Достигнут врх документа, наставио са дна +pdfjs-find-reached-bottom = Достигнуто дно документа, наставио са врха +pdfjs-find-not-found = Фраза није пронађена + +## Predefined zoom values + +pdfjs-page-scale-width = Ширина странице +pdfjs-page-scale-fit = Прилагоди страницу +pdfjs-page-scale-auto = Аутоматско увеличавање +pdfjs-page-scale-actual = Стварна величина +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Страница { $page } + +## Loading indicator messages + +pdfjs-loading-error = Дошло је до грешке приликом учитавања PDF-а. +pdfjs-invalid-file-error = PDF датотека је неважећа или је оштећена. +pdfjs-missing-file-error = Недостаје PDF датотека. +pdfjs-unexpected-response-error = Неочекиван одговор од сервера. +pdfjs-rendering-error = Дошло је до грешке приликом рендеровања ове странице. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } коментар] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Унесите лозинку да бисте отворили овај PDF докуменат. +pdfjs-password-invalid = Неисправна лозинка. Покушајте поново. +pdfjs-password-ok-button = У реду +pdfjs-password-cancel-button = Откажи +pdfjs-web-fonts-disabled = Веб фонтови су онемогућени: не могу користити уграђене PDF фонтове. + +## Editing + +pdfjs-editor-free-text-button = + .title = Текст +pdfjs-editor-free-text-button-label = Текст +pdfjs-editor-ink-button = + .title = Цртај +pdfjs-editor-ink-button-label = Цртај +pdfjs-editor-stamp-button = + .title = Додај или уреди слике +pdfjs-editor-stamp-button-label = Додај или уреди слике +pdfjs-editor-highlight-button = + .title = Означи +pdfjs-editor-highlight-button-label = Означи +pdfjs-highlight-floating-button1 = + .title = Означи + .aria-label = Означи +pdfjs-highlight-floating-button-label = Означи + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Уклони цртеж +pdfjs-editor-remove-freetext-button = + .title = Уклони текст +pdfjs-editor-remove-stamp-button = + .title = Уклони слику +pdfjs-editor-remove-highlight-button = + .title = Уклони ознаку + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Боја +pdfjs-editor-free-text-size-input = Величина +pdfjs-editor-ink-color-input = Боја +pdfjs-editor-ink-thickness-input = Дебљина +pdfjs-editor-ink-opacity-input = Опацитет +pdfjs-editor-stamp-add-image-button = + .title = Додај слику +pdfjs-editor-stamp-add-image-button-label = Додај слику +pdfjs-editor-free-highlight-thickness-title = + .title = Промени дебљину при означавању других ставки сем текста +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = Уређивач текста + .default-content = Почни куцати… +pdfjs-free-text = + .aria-label = Уређивач текста +pdfjs-free-text-default-content = Почни куцање… +pdfjs-ink = + .aria-label = Уређивач цртежа +pdfjs-ink-canvas = + .aria-label = Кориснички направљена слика + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = Алтернативни текст +pdfjs-editor-alt-text-edit-button = + .aria-label = Уреди алтернативни текст +pdfjs-editor-alt-text-edit-button-label = Уреди алтернативни текст +pdfjs-editor-alt-text-dialog-label = Одабери опцију +pdfjs-editor-alt-text-dialog-description = Алтернативни текст помаже слепим и слабовидим особама или када се слика не учита. +pdfjs-editor-alt-text-add-description-label = Додај опис +pdfjs-editor-alt-text-add-description-description = Сажмите у 1-2 реченице које описују предмет, окружење или радње. +pdfjs-editor-alt-text-mark-decorative-label = Означи као украсно +pdfjs-editor-alt-text-mark-decorative-description = Ово је за украсне слике, као што су ивице или водени печати. +pdfjs-editor-alt-text-cancel-button = Откажи +pdfjs-editor-alt-text-save-button = Сачувај +pdfjs-editor-alt-text-decorative-tooltip = Означено као украсно +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = На пример: „Младић седа за сто да једе“ +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = Алтернативни текст + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Горњи леви угао — промени величину +pdfjs-editor-resizer-label-top-middle = Средина горе — промени величину +pdfjs-editor-resizer-label-top-right = Горњи десни угао — промени величину +pdfjs-editor-resizer-label-middle-right = Средина десно — промени величину +pdfjs-editor-resizer-label-bottom-right = Доњи десни угао — промени величину +pdfjs-editor-resizer-label-bottom-middle = Средина доле — промени величину +pdfjs-editor-resizer-label-bottom-left = Доњи леви угао — промени величину +pdfjs-editor-resizer-label-middle-left = Средина лево — промени величину +pdfjs-editor-resizer-top-left = + .aria-label = Горњи леви угао — промени величину +pdfjs-editor-resizer-top-middle = + .aria-label = Средина горе — промени величину +pdfjs-editor-resizer-top-right = + .aria-label = Горњи десни угао — промени величину +pdfjs-editor-resizer-middle-right = + .aria-label = Средина десно — промени величину +pdfjs-editor-resizer-bottom-right = + .aria-label = Доњи десни угао — промени величину +pdfjs-editor-resizer-bottom-middle = + .aria-label = Средина доле — промени величину +pdfjs-editor-resizer-bottom-left = + .aria-label = Доњи леви угао — промени величину +pdfjs-editor-resizer-middle-left = + .aria-label = Средина лево — промени величину + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Боја означавања +pdfjs-editor-colorpicker-button = + .title = Промени боју +pdfjs-editor-colorpicker-dropdown = + .aria-label = Избор боја +pdfjs-editor-colorpicker-yellow = + .title = Жута +pdfjs-editor-colorpicker-green = + .title = Зелена +pdfjs-editor-colorpicker-blue = + .title = Плава +pdfjs-editor-colorpicker-pink = + .title = Розе +pdfjs-editor-colorpicker-red = + .title = Црвена + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Прикажи све +pdfjs-editor-highlight-show-all-button = + .title = Прикажи све + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = Уреди алтернативни текст (опис слике) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = Додај алтернативни текст (опис слике) +pdfjs-editor-new-alt-text-textarea = + .placeholder = Напиши опис овде… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = Кратак опис за слепе и слабовиде људе или када се слика не успе учитати. +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = Овај алтернативни текст је направљен аутоматски и може бити нетачан. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Сазнајте више +pdfjs-editor-new-alt-text-create-automatically-button-label = Прави алтернативни текст аутоматски +pdfjs-editor-new-alt-text-not-now-button = Не сада + +## Image alt-text settings + diff --git a/public/pdfjs/web/locale/sv-SE/viewer.ftl b/public/pdfjs/web/locale/sv-SE/viewer.ftl new file mode 100644 index 0000000..6c4c610 --- /dev/null +++ b/public/pdfjs/web/locale/sv-SE/viewer.ftl @@ -0,0 +1,515 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Föregående sida +pdfjs-previous-button-label = Föregående +pdfjs-next-button = + .title = Nästa sida +pdfjs-next-button-label = Nästa +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Sida +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = av { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } av { $pagesCount }) +pdfjs-zoom-out-button = + .title = Zooma ut +pdfjs-zoom-out-button-label = Zooma ut +pdfjs-zoom-in-button = + .title = Zooma in +pdfjs-zoom-in-button-label = Zooma in +pdfjs-zoom-select = + .title = Zoom +pdfjs-presentation-mode-button = + .title = Byt till presentationsläge +pdfjs-presentation-mode-button-label = Presentationsläge +pdfjs-open-file-button = + .title = Öppna fil +pdfjs-open-file-button-label = Öppna +pdfjs-print-button = + .title = Skriv ut +pdfjs-print-button-label = Skriv ut +pdfjs-save-button = + .title = Spara +pdfjs-save-button-label = Spara +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Hämta +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Hämta +pdfjs-bookmark-button = + .title = Aktuell sida (Visa URL från aktuell sida) +pdfjs-bookmark-button-label = Aktuell sida + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Verktyg +pdfjs-tools-button-label = Verktyg +pdfjs-first-page-button = + .title = Gå till första sidan +pdfjs-first-page-button-label = Gå till första sidan +pdfjs-last-page-button = + .title = Gå till sista sidan +pdfjs-last-page-button-label = Gå till sista sidan +pdfjs-page-rotate-cw-button = + .title = Rotera medurs +pdfjs-page-rotate-cw-button-label = Rotera medurs +pdfjs-page-rotate-ccw-button = + .title = Rotera moturs +pdfjs-page-rotate-ccw-button-label = Rotera moturs +pdfjs-cursor-text-select-tool-button = + .title = Aktivera textmarkeringsverktyg +pdfjs-cursor-text-select-tool-button-label = Textmarkeringsverktyg +pdfjs-cursor-hand-tool-button = + .title = Aktivera handverktyg +pdfjs-cursor-hand-tool-button-label = Handverktyg +pdfjs-scroll-page-button = + .title = Använd sidrullning +pdfjs-scroll-page-button-label = Sidrullning +pdfjs-scroll-vertical-button = + .title = Använd vertikal rullning +pdfjs-scroll-vertical-button-label = Vertikal rullning +pdfjs-scroll-horizontal-button = + .title = Använd horisontell rullning +pdfjs-scroll-horizontal-button-label = Horisontell rullning +pdfjs-scroll-wrapped-button = + .title = Använd överlappande rullning +pdfjs-scroll-wrapped-button-label = Överlappande rullning +pdfjs-spread-none-button = + .title = Visa enkelsidor +pdfjs-spread-none-button-label = Enkelsidor +pdfjs-spread-odd-button = + .title = Visa uppslag med olika sidnummer till vänster +pdfjs-spread-odd-button-label = Uppslag med framsida +pdfjs-spread-even-button = + .title = Visa uppslag med lika sidnummer till vänster +pdfjs-spread-even-button-label = Uppslag utan framsida + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Dokumentegenskaper… +pdfjs-document-properties-button-label = Dokumentegenskaper… +pdfjs-document-properties-file-name = Filnamn: +pdfjs-document-properties-file-size = Filstorlek: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } kB ({ $b } byte) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } byte) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } kB ({ $size_b } byte) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } byte) +pdfjs-document-properties-title = Titel: +pdfjs-document-properties-author = Författare: +pdfjs-document-properties-subject = Ämne: +pdfjs-document-properties-keywords = Nyckelord: +pdfjs-document-properties-creation-date = Skapades: +pdfjs-document-properties-modification-date = Ändrades: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Skapare: +pdfjs-document-properties-producer = PDF-producent: +pdfjs-document-properties-version = PDF-version: +pdfjs-document-properties-page-count = Sidantal: +pdfjs-document-properties-page-size = Pappersstorlek: +pdfjs-document-properties-page-size-unit-inches = in +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = porträtt +pdfjs-document-properties-page-size-orientation-landscape = landskap +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Letter +pdfjs-document-properties-page-size-name-legal = Legal + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Snabb webbvisning: +pdfjs-document-properties-linearized-yes = Ja +pdfjs-document-properties-linearized-no = Nej +pdfjs-document-properties-close-button = Stäng + +## Print + +pdfjs-print-progress-message = Förbereder sidor för utskrift… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Avbryt +pdfjs-printing-not-supported = Varning: Utskrifter stöds inte helt av den här webbläsaren. +pdfjs-printing-not-ready = Varning: PDF:en är inte klar för utskrift. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Visa/dölj sidofält +pdfjs-toggle-sidebar-notification-button = + .title = Växla sidofält (dokumentet innehåller dokumentstruktur/bilagor/lager) +pdfjs-toggle-sidebar-button-label = Visa/dölj sidofält +pdfjs-document-outline-button = + .title = Visa dokumentdisposition (dubbelklicka för att expandera/komprimera alla objekt) +pdfjs-document-outline-button-label = Dokumentöversikt +pdfjs-attachments-button = + .title = Visa Bilagor +pdfjs-attachments-button-label = Bilagor +pdfjs-layers-button = + .title = Visa lager (dubbelklicka för att återställa alla lager till standardläge) +pdfjs-layers-button-label = Lager +pdfjs-thumbs-button = + .title = Visa miniatyrer +pdfjs-thumbs-button-label = Miniatyrer +pdfjs-current-outline-item-button = + .title = Hitta aktuellt dispositionsobjekt +pdfjs-current-outline-item-button-label = Aktuellt dispositionsobjekt +pdfjs-findbar-button = + .title = Sök i dokument +pdfjs-findbar-button-label = Sök +pdfjs-additional-layers = Ytterligare lager + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Sida { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Miniatyr av sida { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Sök + .placeholder = Sök i dokument… +pdfjs-find-previous-button = + .title = Hitta föregående förekomst av frasen +pdfjs-find-previous-button-label = Föregående +pdfjs-find-next-button = + .title = Hitta nästa förekomst av frasen +pdfjs-find-next-button-label = Nästa +pdfjs-find-highlight-checkbox = Markera alla +pdfjs-find-match-case-checkbox-label = Matcha versal/gemen +pdfjs-find-match-diacritics-checkbox-label = Matcha diakritiska tecken +pdfjs-find-entire-word-checkbox-label = Hela ord +pdfjs-find-reached-top = Nådde början av dokumentet, började från slutet +pdfjs-find-reached-bottom = Nådde slutet på dokumentet, började från början +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] { $current } av { $total } match + *[other] { $current } av { $total } matchningar + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] Mer än { $limit } matchning + *[other] Fler än { $limit } matchningar + } +pdfjs-find-not-found = Frasen hittades inte + +## Predefined zoom values + +pdfjs-page-scale-width = Sidbredd +pdfjs-page-scale-fit = Anpassa sida +pdfjs-page-scale-auto = Automatisk zoom +pdfjs-page-scale-actual = Verklig storlek +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Sida { $page } + +## Loading indicator messages + +pdfjs-loading-error = Ett fel uppstod vid laddning av PDF-filen. +pdfjs-invalid-file-error = Ogiltig eller korrupt PDF-fil. +pdfjs-missing-file-error = Saknad PDF-fil. +pdfjs-unexpected-response-error = Oväntat svar från servern. +pdfjs-rendering-error = Ett fel uppstod vid visning av sidan. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date } { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type }-annotering] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Skriv in lösenordet för att öppna PDF-filen. +pdfjs-password-invalid = Ogiltigt lösenord. Försök igen. +pdfjs-password-ok-button = OK +pdfjs-password-cancel-button = Avbryt +pdfjs-web-fonts-disabled = Webbtypsnitt är inaktiverade: kan inte använda inbäddade PDF-typsnitt. + +## Editing + +pdfjs-editor-free-text-button = + .title = Text +pdfjs-editor-free-text-button-label = Text +pdfjs-editor-ink-button = + .title = Rita +pdfjs-editor-ink-button-label = Rita +pdfjs-editor-stamp-button = + .title = Lägg till eller redigera bilder +pdfjs-editor-stamp-button-label = Lägg till eller redigera bilder +pdfjs-editor-highlight-button = + .title = Markera +pdfjs-editor-highlight-button-label = Markera +pdfjs-highlight-floating-button1 = + .title = Markera + .aria-label = Markera +pdfjs-highlight-floating-button-label = Markera + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Ta bort ritning +pdfjs-editor-remove-freetext-button = + .title = Ta bort text +pdfjs-editor-remove-stamp-button = + .title = Ta bort bild +pdfjs-editor-remove-highlight-button = + .title = Ta bort markering + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Färg +pdfjs-editor-free-text-size-input = Storlek +pdfjs-editor-ink-color-input = Färg +pdfjs-editor-ink-thickness-input = Tjocklek +pdfjs-editor-ink-opacity-input = Opacitet +pdfjs-editor-stamp-add-image-button = + .title = Lägg till bild +pdfjs-editor-stamp-add-image-button-label = Lägg till bild +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Tjocklek +pdfjs-editor-free-highlight-thickness-title = + .title = Ändra tjocklek när du markerar andra objekt än text +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = Textredigerare + .default-content = Börja skriva… +pdfjs-free-text = + .aria-label = Textredigerare +pdfjs-free-text-default-content = Börja skriva… +pdfjs-ink = + .aria-label = Ritredigerare +pdfjs-ink-canvas = + .aria-label = Användarskapad bild + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = Alternativ text +pdfjs-editor-alt-text-edit-button = + .aria-label = Redigera alternativ text +pdfjs-editor-alt-text-edit-button-label = Redigera alternativ text +pdfjs-editor-alt-text-dialog-label = Välj ett alternativ +pdfjs-editor-alt-text-dialog-description = Alt text (alternativ text) hjälper till när människor inte kan se bilden eller när den inte laddas. +pdfjs-editor-alt-text-add-description-label = Lägg till en beskrivning +pdfjs-editor-alt-text-add-description-description = Sikta på 1-2 meningar som beskriver ämnet, miljön eller handlingen. +pdfjs-editor-alt-text-mark-decorative-label = Markera som dekorativ +pdfjs-editor-alt-text-mark-decorative-description = Detta används för dekorativa bilder, som kanter eller vattenstämplar. +pdfjs-editor-alt-text-cancel-button = Avbryt +pdfjs-editor-alt-text-save-button = Spara +pdfjs-editor-alt-text-decorative-tooltip = Märkt som dekorativ +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = Till exempel, "En ung man sätter sig vid ett bord för att äta en måltid" +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = Alternativ text + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Det övre vänstra hörnet — ändra storlek +pdfjs-editor-resizer-label-top-middle = Överst i mitten — ändra storlek +pdfjs-editor-resizer-label-top-right = Det övre högra hörnet — ändra storlek +pdfjs-editor-resizer-label-middle-right = Mitten höger — ändra storlek +pdfjs-editor-resizer-label-bottom-right = Nedre högra hörnet — ändra storlek +pdfjs-editor-resizer-label-bottom-middle = Nedre mitten — ändra storlek +pdfjs-editor-resizer-label-bottom-left = Nedre vänstra hörnet — ändra storlek +pdfjs-editor-resizer-label-middle-left = Mitten till vänster — ändra storlek +pdfjs-editor-resizer-top-left = + .aria-label = Det övre vänstra hörnet — ändra storlek +pdfjs-editor-resizer-top-middle = + .aria-label = Överst i mitten — ändra storlek +pdfjs-editor-resizer-top-right = + .aria-label = Det övre högra hörnet — ändra storlek +pdfjs-editor-resizer-middle-right = + .aria-label = Mitten höger — ändra storlek +pdfjs-editor-resizer-bottom-right = + .aria-label = Nedre högra hörnet — ändra storlek +pdfjs-editor-resizer-bottom-middle = + .aria-label = Nedre mitten — ändra storlek +pdfjs-editor-resizer-bottom-left = + .aria-label = Nedre vänstra hörnet — ändra storlek +pdfjs-editor-resizer-middle-left = + .aria-label = Mitten till vänster — ändra storlek + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Markeringsfärg +pdfjs-editor-colorpicker-button = + .title = Ändra färg +pdfjs-editor-colorpicker-dropdown = + .aria-label = Färgval +pdfjs-editor-colorpicker-yellow = + .title = Gul +pdfjs-editor-colorpicker-green = + .title = Grön +pdfjs-editor-colorpicker-blue = + .title = Blå +pdfjs-editor-colorpicker-pink = + .title = Rosa +pdfjs-editor-colorpicker-red = + .title = Röd + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Visa alla +pdfjs-editor-highlight-show-all-button = + .title = Visa alla + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = Redigera alternativ text (bildbeskrivning) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = Lägg till alternativ text (bildbeskrivning) +pdfjs-editor-new-alt-text-textarea = + .placeholder = Skriv din beskrivning här… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = Kort beskrivning för personer som inte kan se bilden eller när bilden inte laddas. +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = Denna alternativa text skapades automatiskt och kan vara felaktig. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Läs mer +pdfjs-editor-new-alt-text-create-automatically-button-label = Skapa alternativ text automatiskt +pdfjs-editor-new-alt-text-not-now-button = Inte nu +pdfjs-editor-new-alt-text-error-title = Det gick inte att skapa alternativ text automatiskt +pdfjs-editor-new-alt-text-error-description = Skriv din egna alternativa text eller försök igen senare. +pdfjs-editor-new-alt-text-error-close-button = Stäng +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = Hämtar AI-modell med alternativ text ({ $downloadedSize } av { $totalSize } MB) + .aria-valuetext = Hämtar AI-modell med alternativ text ({ $downloadedSize } av { $totalSize } MB) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = Alternativ text tillagd +pdfjs-editor-new-alt-text-added-button-label = Alternativ text tillagd +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = Saknar alternativ text +pdfjs-editor-new-alt-text-missing-button-label = Saknar alternativ text +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = Granska alternativ text +pdfjs-editor-new-alt-text-to-review-button-label = Granska alternativ text +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Skapas automatiskt: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = Alternativ textinställningar för bild +pdfjs-image-alt-text-settings-button-label = Alternativ textinställningar för bild +pdfjs-editor-alt-text-settings-dialog-label = Alternativ textinställningar för bild +pdfjs-editor-alt-text-settings-automatic-title = Automatisk alternativ text +pdfjs-editor-alt-text-settings-create-model-button-label = Skapa alternativ text automatiskt +pdfjs-editor-alt-text-settings-create-model-description = Föreslår beskrivningar för att hjälpa personer som inte kan se bilden eller när bilden inte laddas. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = AI-modell för alternativ text ({ $totalSize } MB) +pdfjs-editor-alt-text-settings-ai-model-description = Körs lokalt på din enhet så att din data förblir privat. Krävs för automatisk alternativ text. +pdfjs-editor-alt-text-settings-delete-model-button = Ta bort +pdfjs-editor-alt-text-settings-download-model-button = Hämta +pdfjs-editor-alt-text-settings-downloading-model-button = Hämtar… +pdfjs-editor-alt-text-settings-editor-title = Alternativ textredigerare +pdfjs-editor-alt-text-settings-show-dialog-button-label = Visa alternativ textredigerare direkt när du lägger till en bild +pdfjs-editor-alt-text-settings-show-dialog-description = Hjälper dig att se till att alla dina bilder har alternativ text. +pdfjs-editor-alt-text-settings-close-button = Stäng + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = Markering borttagen +pdfjs-editor-undo-bar-message-freetext = Text borttagen +pdfjs-editor-undo-bar-message-ink = Ritning borttagen +pdfjs-editor-undo-bar-message-stamp = Bild borttagen +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = + { $count -> + [one] { $count } anteckning har tagits bort + *[other] { $count } anteckningar har tagits bort + } +pdfjs-editor-undo-bar-undo-button = + .title = Ångra +pdfjs-editor-undo-bar-undo-button-label = Ångra +pdfjs-editor-undo-bar-close-button = + .title = Stäng +pdfjs-editor-undo-bar-close-button-label = Stäng diff --git a/public/pdfjs/web/locale/szl/viewer.ftl b/public/pdfjs/web/locale/szl/viewer.ftl new file mode 100644 index 0000000..cbf166e --- /dev/null +++ b/public/pdfjs/web/locale/szl/viewer.ftl @@ -0,0 +1,257 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Piyrwyjszo strōna +pdfjs-previous-button-label = Piyrwyjszo +pdfjs-next-button = + .title = Nastympno strōna +pdfjs-next-button-label = Dalij +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Strōna +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = ze { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } ze { $pagesCount }) +pdfjs-zoom-out-button = + .title = Zmyńsz +pdfjs-zoom-out-button-label = Zmyńsz +pdfjs-zoom-in-button = + .title = Zwiynksz +pdfjs-zoom-in-button-label = Zwiynksz +pdfjs-zoom-select = + .title = Srogość +pdfjs-presentation-mode-button = + .title = Przełōncz na tryb prezyntacyje +pdfjs-presentation-mode-button-label = Tryb prezyntacyje +pdfjs-open-file-button = + .title = Ôdewrzij zbiōr +pdfjs-open-file-button-label = Ôdewrzij +pdfjs-print-button = + .title = Durkuj +pdfjs-print-button-label = Durkuj + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Noczynia +pdfjs-tools-button-label = Noczynia +pdfjs-first-page-button = + .title = Idź ku piyrszyj strōnie +pdfjs-first-page-button-label = Idź ku piyrszyj strōnie +pdfjs-last-page-button = + .title = Idź ku ôstatnij strōnie +pdfjs-last-page-button-label = Idź ku ôstatnij strōnie +pdfjs-page-rotate-cw-button = + .title = Zwyrtnij w prawo +pdfjs-page-rotate-cw-button-label = Zwyrtnij w prawo +pdfjs-page-rotate-ccw-button = + .title = Zwyrtnij w lewo +pdfjs-page-rotate-ccw-button-label = Zwyrtnij w lewo +pdfjs-cursor-text-select-tool-button = + .title = Załōncz noczynie ôbiyranio tekstu +pdfjs-cursor-text-select-tool-button-label = Noczynie ôbiyranio tekstu +pdfjs-cursor-hand-tool-button = + .title = Załōncz noczynie rōnczka +pdfjs-cursor-hand-tool-button-label = Noczynie rōnczka +pdfjs-scroll-vertical-button = + .title = Używej piōnowego przewijanio +pdfjs-scroll-vertical-button-label = Piōnowe przewijanie +pdfjs-scroll-horizontal-button = + .title = Używej poziōmego przewijanio +pdfjs-scroll-horizontal-button-label = Poziōme przewijanie +pdfjs-scroll-wrapped-button = + .title = Używej szichtowego przewijanio +pdfjs-scroll-wrapped-button-label = Szichtowe przewijanie +pdfjs-spread-none-button = + .title = Niy dowej strōn w widoku po dwie +pdfjs-spread-none-button-label = Po jednyj strōnie +pdfjs-spread-odd-button = + .title = Pokoż strōny po dwie; niyporziste po lewyj +pdfjs-spread-odd-button-label = Niyporziste po lewyj +pdfjs-spread-even-button = + .title = Pokoż strōny po dwie; porziste po lewyj +pdfjs-spread-even-button-label = Porziste po lewyj + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Włosności dokumyntu… +pdfjs-document-properties-button-label = Włosności dokumyntu… +pdfjs-document-properties-file-name = Miano zbioru: +pdfjs-document-properties-file-size = Srogość zbioru: +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } B) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } B) +pdfjs-document-properties-title = Tytuł: +pdfjs-document-properties-author = Autōr: +pdfjs-document-properties-subject = Tymat: +pdfjs-document-properties-keywords = Kluczowe słowa: +pdfjs-document-properties-creation-date = Data zrychtowanio: +pdfjs-document-properties-modification-date = Data zmiany: +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Zrychtowane ôd: +pdfjs-document-properties-producer = PDF ôd: +pdfjs-document-properties-version = Wersyjo PDF: +pdfjs-document-properties-page-count = Wielość strōn: +pdfjs-document-properties-page-size = Srogość strōny: +pdfjs-document-properties-page-size-unit-inches = in +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = piōnowo +pdfjs-document-properties-page-size-orientation-landscape = poziōmo +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Letter +pdfjs-document-properties-page-size-name-legal = Legal + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Gibki necowy podglōnd: +pdfjs-document-properties-linearized-yes = Ja +pdfjs-document-properties-linearized-no = Niy +pdfjs-document-properties-close-button = Zawrzij + +## Print + +pdfjs-print-progress-message = Rychtowanie dokumyntu do durku… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Pociep +pdfjs-printing-not-supported = Pozōr: Ta przeglōndarka niy cołkiym ôbsuguje durk. +pdfjs-printing-not-ready = Pozōr: Tyn PDF niy ma za tela zaladowany do durku. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Przełōncz posek na rancie +pdfjs-toggle-sidebar-notification-button = + .title = Przełōncz posek na rancie (dokumynt mo struktura/przidowki/warstwy) +pdfjs-toggle-sidebar-button-label = Przełōncz posek na rancie +pdfjs-document-outline-button = + .title = Pokoż struktura dokumyntu (tuplowane klikniyncie rozszyrzo/swijo wszyskie elymynta) +pdfjs-document-outline-button-label = Struktura dokumyntu +pdfjs-attachments-button = + .title = Pokoż przidowki +pdfjs-attachments-button-label = Przidowki +pdfjs-layers-button = + .title = Pokoż warstwy (tuplowane klikniyncie resetuje wszyskie warstwy do bazowego stanu) +pdfjs-layers-button-label = Warstwy +pdfjs-thumbs-button = + .title = Pokoż miniatury +pdfjs-thumbs-button-label = Miniatury +pdfjs-findbar-button = + .title = Znojdź w dokumyncie +pdfjs-findbar-button-label = Znojdź +pdfjs-additional-layers = Nadbytnie warstwy + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Strōna { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Miniatura strōny { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Znojdź + .placeholder = Znojdź w dokumyncie… +pdfjs-find-previous-button = + .title = Znojdź piyrwyjsze pokozanie sie tyj frazy +pdfjs-find-previous-button-label = Piyrwyjszo +pdfjs-find-next-button = + .title = Znojdź nastympne pokozanie sie tyj frazy +pdfjs-find-next-button-label = Dalij +pdfjs-find-highlight-checkbox = Zaznacz wszysko +pdfjs-find-match-case-checkbox-label = Poznowej srogość liter +pdfjs-find-entire-word-checkbox-label = Cołke słowa +pdfjs-find-reached-top = Doszło do samego wiyrchu strōny, dalij ôd spodku +pdfjs-find-reached-bottom = Doszło do samego spodku strōny, dalij ôd wiyrchu +pdfjs-find-not-found = Fraza niy znaleziōno + +## Predefined zoom values + +pdfjs-page-scale-width = Szyrzka strōny +pdfjs-page-scale-fit = Napasowanie strōny +pdfjs-page-scale-auto = Autōmatyczno srogość +pdfjs-page-scale-actual = Aktualno srogość +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + + +## Loading indicator messages + +pdfjs-loading-error = Przi ladowaniu PDFa pokozoł sie feler. +pdfjs-invalid-file-error = Zły abo felerny zbiōr PDF. +pdfjs-missing-file-error = Chybio zbioru PDF. +pdfjs-unexpected-response-error = Niyôczekowano ôdpowiydź serwera. +pdfjs-rendering-error = Przi renderowaniu strōny pokozoł sie feler. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [Anotacyjo typu { $type }] + +## Password + +pdfjs-password-label = Wkludź hasło, coby ôdewrzić tyn zbiōr PDF. +pdfjs-password-invalid = Hasło je złe. Sprōbuj jeszcze roz. +pdfjs-password-ok-button = OK +pdfjs-password-cancel-button = Pociep +pdfjs-web-fonts-disabled = Necowe fōnty sōm zastawiōne: niy idzie użyć wkludzōnych fōntōw PDF. + +## Editing + + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + diff --git a/public/pdfjs/web/locale/ta/viewer.ftl b/public/pdfjs/web/locale/ta/viewer.ftl new file mode 100644 index 0000000..82cf197 --- /dev/null +++ b/public/pdfjs/web/locale/ta/viewer.ftl @@ -0,0 +1,223 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = முந்தைய பக்கம் +pdfjs-previous-button-label = முந்தையது +pdfjs-next-button = + .title = அடுத்த பக்கம் +pdfjs-next-button-label = அடுத்து +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = பக்கம் +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = { $pagesCount } இல் +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = { $pagesCount }) இல் ({ $pageNumber } +pdfjs-zoom-out-button = + .title = சிறிதாக்கு +pdfjs-zoom-out-button-label = சிறிதாக்கு +pdfjs-zoom-in-button = + .title = பெரிதாக்கு +pdfjs-zoom-in-button-label = பெரிதாக்கு +pdfjs-zoom-select = + .title = பெரிதாக்கு +pdfjs-presentation-mode-button = + .title = விளக்ககாட்சி பயன்முறைக்கு மாறு +pdfjs-presentation-mode-button-label = விளக்ககாட்சி பயன்முறை +pdfjs-open-file-button = + .title = கோப்பினை திற +pdfjs-open-file-button-label = திற +pdfjs-print-button = + .title = அச்சிடு +pdfjs-print-button-label = அச்சிடு + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = கருவிகள் +pdfjs-tools-button-label = கருவிகள் +pdfjs-first-page-button = + .title = முதல் பக்கத்திற்கு செல்லவும் +pdfjs-first-page-button-label = முதல் பக்கத்திற்கு செல்லவும் +pdfjs-last-page-button = + .title = கடைசி பக்கத்திற்கு செல்லவும் +pdfjs-last-page-button-label = கடைசி பக்கத்திற்கு செல்லவும் +pdfjs-page-rotate-cw-button = + .title = வலஞ்சுழியாக சுழற்று +pdfjs-page-rotate-cw-button-label = வலஞ்சுழியாக சுழற்று +pdfjs-page-rotate-ccw-button = + .title = இடஞ்சுழியாக சுழற்று +pdfjs-page-rotate-ccw-button-label = இடஞ்சுழியாக சுழற்று +pdfjs-cursor-text-select-tool-button = + .title = உரைத் தெரிவு கருவியைச் செயல்படுத்து +pdfjs-cursor-text-select-tool-button-label = உரைத் தெரிவு கருவி +pdfjs-cursor-hand-tool-button = + .title = கைக் கருவிக்ச் செயற்படுத்து +pdfjs-cursor-hand-tool-button-label = கைக்குருவி + +## Document properties dialog + +pdfjs-document-properties-button = + .title = ஆவண பண்புகள்... +pdfjs-document-properties-button-label = ஆவண பண்புகள்... +pdfjs-document-properties-file-name = கோப்பு பெயர்: +pdfjs-document-properties-file-size = கோப்பின் அளவு: +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } கிபை ({ $size_b } பைட்டுகள்) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } மெபை ({ $size_b } பைட்டுகள்) +pdfjs-document-properties-title = தலைப்பு: +pdfjs-document-properties-author = எழுதியவர் +pdfjs-document-properties-subject = பொருள்: +pdfjs-document-properties-keywords = முக்கிய வார்த்தைகள்: +pdfjs-document-properties-creation-date = படைத்த தேதி : +pdfjs-document-properties-modification-date = திருத்திய தேதி: +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = உருவாக்குபவர்: +pdfjs-document-properties-producer = பிடிஎஃப் தயாரிப்பாளர்: +pdfjs-document-properties-version = PDF பதிப்பு: +pdfjs-document-properties-page-count = பக்க எண்ணிக்கை: +pdfjs-document-properties-page-size = பக்க அளவு: +pdfjs-document-properties-page-size-unit-inches = இதில் +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = நிலைபதிப்பு +pdfjs-document-properties-page-size-orientation-landscape = நிலைபரப்பு +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = கடிதம் +pdfjs-document-properties-page-size-name-legal = சட்டபூர்வ + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +pdfjs-document-properties-close-button = மூடுக + +## Print + +pdfjs-print-progress-message = அச்சிடுவதற்கான ஆவணம் தயாராகிறது... +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = ரத்து +pdfjs-printing-not-supported = எச்சரிக்கை: இந்த உலாவி அச்சிடுதலை முழுமையாக ஆதரிக்கவில்லை. +pdfjs-printing-not-ready = எச்சரிக்கை: PDF அச்சிட முழுவதுமாக ஏற்றப்படவில்லை. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = பக்கப் பட்டியை நிலைமாற்று +pdfjs-toggle-sidebar-button-label = பக்கப் பட்டியை நிலைமாற்று +pdfjs-document-outline-button = + .title = ஆவண அடக்கத்தைக் காட்டு (இருமுறைச் சொடுக்கி அனைத்து உறுப்பிடிகளையும் விரி/சேர்) +pdfjs-document-outline-button-label = ஆவண வெளிவரை +pdfjs-attachments-button = + .title = இணைப்புகளை காண்பி +pdfjs-attachments-button-label = இணைப்புகள் +pdfjs-thumbs-button = + .title = சிறுபடங்களைக் காண்பி +pdfjs-thumbs-button-label = சிறுபடங்கள் +pdfjs-findbar-button = + .title = ஆவணத்தில் கண்டறி +pdfjs-findbar-button-label = தேடு + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = பக்கம் { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = பக்கத்தின் சிறுபடம் { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = கண்டுபிடி + .placeholder = ஆவணத்தில் கண்டறி… +pdfjs-find-previous-button = + .title = இந்த சொற்றொடரின் முந்தைய நிகழ்வை தேடு +pdfjs-find-previous-button-label = முந்தையது +pdfjs-find-next-button = + .title = இந்த சொற்றொடரின் அடுத்த நிகழ்வை தேடு +pdfjs-find-next-button-label = அடுத்து +pdfjs-find-highlight-checkbox = அனைத்தையும் தனிப்படுத்து +pdfjs-find-match-case-checkbox-label = பேரெழுத்தாக்கத்தை உணர் +pdfjs-find-reached-top = ஆவணத்தின் மேல் பகுதியை அடைந்தது, அடிப்பக்கத்திலிருந்து தொடர்ந்தது +pdfjs-find-reached-bottom = ஆவணத்தின் முடிவை அடைந்தது, மேலிருந்து தொடர்ந்தது +pdfjs-find-not-found = சொற்றொடர் காணவில்லை + +## Predefined zoom values + +pdfjs-page-scale-width = பக்க அகலம் +pdfjs-page-scale-fit = பக்கப் பொருத்தம் +pdfjs-page-scale-auto = தானியக்க பெரிதாக்கல் +pdfjs-page-scale-actual = உண்மையான அளவு +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + + +## Loading indicator messages + +pdfjs-loading-error = PDF ஐ ஏற்றும் போது ஒரு பிழை ஏற்பட்டது. +pdfjs-invalid-file-error = செல்லுபடியாகாத அல்லது சிதைந்த PDF கோப்பு. +pdfjs-missing-file-error = PDF கோப்பு காணவில்லை. +pdfjs-unexpected-response-error = சேவகன் பதில் எதிர்பாரதது. +pdfjs-rendering-error = இந்தப் பக்கத்தை காட்சிப்படுத்தும் போது ஒரு பிழை ஏற்பட்டது. + +## Annotations + +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } விளக்கம்] + +## Password + +pdfjs-password-label = இந்த PDF கோப்பை திறக்க கடவுச்சொல்லை உள்ளிடவும். +pdfjs-password-invalid = செல்லுபடியாகாத கடவுச்சொல், தயை செய்து மீண்டும் முயற்சி செய்க. +pdfjs-password-ok-button = சரி +pdfjs-password-cancel-button = ரத்து +pdfjs-web-fonts-disabled = வலை எழுத்துருக்கள் முடக்கப்பட்டுள்ளன: உட்பொதிக்கப்பட்ட PDF எழுத்துருக்களைப் பயன்படுத்த முடியவில்லை. + +## Editing + + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + diff --git a/public/pdfjs/web/locale/te/viewer.ftl b/public/pdfjs/web/locale/te/viewer.ftl new file mode 100644 index 0000000..94dc2b8 --- /dev/null +++ b/public/pdfjs/web/locale/te/viewer.ftl @@ -0,0 +1,239 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = మునుపటి పేజీ +pdfjs-previous-button-label = క్రితం +pdfjs-next-button = + .title = తరువాత పేజీ +pdfjs-next-button-label = తరువాత +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = పేజీ +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = మొత్తం { $pagesCount } లో +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = (మొత్తం { $pagesCount } లో { $pageNumber }వది) +pdfjs-zoom-out-button = + .title = జూమ్ తగ్గించు +pdfjs-zoom-out-button-label = జూమ్ తగ్గించు +pdfjs-zoom-in-button = + .title = జూమ్ చేయి +pdfjs-zoom-in-button-label = జూమ్ చేయి +pdfjs-zoom-select = + .title = జూమ్ +pdfjs-presentation-mode-button = + .title = ప్రదర్శనా రీతికి మారు +pdfjs-presentation-mode-button-label = ప్రదర్శనా రీతి +pdfjs-open-file-button = + .title = ఫైల్ తెరువు +pdfjs-open-file-button-label = తెరువు +pdfjs-print-button = + .title = ముద్రించు +pdfjs-print-button-label = ముద్రించు + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = పనిముట్లు +pdfjs-tools-button-label = పనిముట్లు +pdfjs-first-page-button = + .title = మొదటి పేజీకి వెళ్ళు +pdfjs-first-page-button-label = మొదటి పేజీకి వెళ్ళు +pdfjs-last-page-button = + .title = చివరి పేజీకి వెళ్ళు +pdfjs-last-page-button-label = చివరి పేజీకి వెళ్ళు +pdfjs-page-rotate-cw-button = + .title = సవ్యదిశలో తిప్పు +pdfjs-page-rotate-cw-button-label = సవ్యదిశలో తిప్పు +pdfjs-page-rotate-ccw-button = + .title = అపసవ్యదిశలో తిప్పు +pdfjs-page-rotate-ccw-button-label = అపసవ్యదిశలో తిప్పు +pdfjs-cursor-text-select-tool-button = + .title = టెక్స్ట్ ఎంపిక సాధనాన్ని ప్రారంభించండి +pdfjs-cursor-text-select-tool-button-label = టెక్స్ట్ ఎంపిక సాధనం +pdfjs-cursor-hand-tool-button = + .title = చేతి సాధనం చేతనించు +pdfjs-cursor-hand-tool-button-label = చేతి సాధనం +pdfjs-scroll-vertical-button-label = నిలువు స్క్రోలింగు + +## Document properties dialog + +pdfjs-document-properties-button = + .title = పత్రము లక్షణాలు... +pdfjs-document-properties-button-label = పత్రము లక్షణాలు... +pdfjs-document-properties-file-name = దస్త్రం పేరు: +pdfjs-document-properties-file-size = దస్త్రం పరిమాణం: +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bytes) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bytes) +pdfjs-document-properties-title = శీర్షిక: +pdfjs-document-properties-author = మూలకర్త: +pdfjs-document-properties-subject = విషయం: +pdfjs-document-properties-keywords = కీ పదాలు: +pdfjs-document-properties-creation-date = సృష్టించిన తేదీ: +pdfjs-document-properties-modification-date = సవరించిన తేదీ: +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = సృష్టికర్త: +pdfjs-document-properties-producer = PDF ఉత్పాదకి: +pdfjs-document-properties-version = PDF వర్షన్: +pdfjs-document-properties-page-count = పేజీల సంఖ్య: +pdfjs-document-properties-page-size = కాగితం పరిమాణం: +pdfjs-document-properties-page-size-unit-inches = లో +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = నిలువుచిత్రం +pdfjs-document-properties-page-size-orientation-landscape = అడ్డచిత్రం +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = లేఖ +pdfjs-document-properties-page-size-name-legal = చట్టపరమైన + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +pdfjs-document-properties-linearized-yes = అవును +pdfjs-document-properties-linearized-no = కాదు +pdfjs-document-properties-close-button = మూసివేయి + +## Print + +pdfjs-print-progress-message = ముద్రించడానికి పత్రము సిద్ధమవుతున్నది… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = రద్దుచేయి +pdfjs-printing-not-supported = హెచ్చరిక: ఈ విహారిణి చేత ముద్రణ పూర్తిగా తోడ్పాటు లేదు. +pdfjs-printing-not-ready = హెచ్చరిక: ముద్రణ కొరకు ఈ PDF పూర్తిగా లోడవలేదు. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = పక్కపట్టీ మార్చు +pdfjs-toggle-sidebar-button-label = పక్కపట్టీ మార్చు +pdfjs-document-outline-button = + .title = పత్రము రూపము చూపించు (డబుల్ క్లిక్ చేసి అన్ని అంశాలను విస్తరించు/కూల్చు) +pdfjs-document-outline-button-label = పత్రము అవుట్‌లైన్ +pdfjs-attachments-button = + .title = అనుబంధాలు చూపు +pdfjs-attachments-button-label = అనుబంధాలు +pdfjs-layers-button-label = పొరలు +pdfjs-thumbs-button = + .title = థంబ్‌నైల్స్ చూపు +pdfjs-thumbs-button-label = థంబ్‌నైల్స్ +pdfjs-findbar-button = + .title = పత్రములో కనుగొనుము +pdfjs-findbar-button-label = కనుగొను +pdfjs-additional-layers = అదనపు పొరలు + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = పేజీ { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = { $page } పేజీ నఖచిత్రం + +## Find panel button title and messages + +pdfjs-find-input = + .title = కనుగొను + .placeholder = పత్రములో కనుగొను… +pdfjs-find-previous-button = + .title = పదం యొక్క ముందు సంభవాన్ని కనుగొను +pdfjs-find-previous-button-label = మునుపటి +pdfjs-find-next-button = + .title = పదం యొక్క తర్వాతి సంభవాన్ని కనుగొను +pdfjs-find-next-button-label = తరువాత +pdfjs-find-highlight-checkbox = అన్నిటిని ఉద్దీపనం చేయుము +pdfjs-find-match-case-checkbox-label = అక్షరముల తేడాతో పోల్చు +pdfjs-find-entire-word-checkbox-label = పూర్తి పదాలు +pdfjs-find-reached-top = పేజీ పైకి చేరుకున్నది, క్రింది నుండి కొనసాగించండి +pdfjs-find-reached-bottom = పేజీ చివరకు చేరుకున్నది, పైనుండి కొనసాగించండి +pdfjs-find-not-found = పదబంధం కనబడలేదు + +## Predefined zoom values + +pdfjs-page-scale-width = పేజీ వెడల్పు +pdfjs-page-scale-fit = పేజీ అమర్పు +pdfjs-page-scale-auto = స్వయంచాలక జూమ్ +pdfjs-page-scale-actual = యథార్ధ పరిమాణం +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + + +## Loading indicator messages + +pdfjs-loading-error = PDF లోడవుచున్నప్పుడు ఒక దోషం ఎదురైంది. +pdfjs-invalid-file-error = చెల్లని లేదా పాడైన PDF ఫైలు. +pdfjs-missing-file-error = దొరకని PDF ఫైలు. +pdfjs-unexpected-response-error = అనుకోని సర్వర్ స్పందన. +pdfjs-rendering-error = పేజీను రెండర్ చేయుటలో ఒక దోషం ఎదురైంది. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } టీకా] + +## Password + +pdfjs-password-label = ఈ PDF ఫైల్ తెరుచుటకు సంకేతపదం ప్రవేశపెట్టుము. +pdfjs-password-invalid = సంకేతపదం చెల్లదు. దయచేసి మళ్ళీ ప్రయత్నించండి. +pdfjs-password-ok-button = సరే +pdfjs-password-cancel-button = రద్దుచేయి +pdfjs-web-fonts-disabled = వెబ్ ఫాంట్లు అచేతనించబడెను: ఎంబెడెడ్ PDF ఫాంట్లు ఉపయోగించలేక పోయింది. + +## Editing + +# Editor Parameters +pdfjs-editor-free-text-color-input = రంగు +pdfjs-editor-free-text-size-input = పరిమాణం +pdfjs-editor-ink-color-input = రంగు +pdfjs-editor-ink-thickness-input = మందం +pdfjs-editor-ink-opacity-input = అకిరణ్యత + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + diff --git a/public/pdfjs/web/locale/tg/viewer.ftl b/public/pdfjs/web/locale/tg/viewer.ftl new file mode 100644 index 0000000..b39fee5 --- /dev/null +++ b/public/pdfjs/web/locale/tg/viewer.ftl @@ -0,0 +1,515 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Саҳифаи қаблӣ +pdfjs-previous-button-label = Қаблӣ +pdfjs-next-button = + .title = Саҳифаи навбатӣ +pdfjs-next-button-label = Навбатӣ +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Саҳифа +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = аз { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } аз { $pagesCount }) +pdfjs-zoom-out-button = + .title = Хурд кардан +pdfjs-zoom-out-button-label = Хурд кардан +pdfjs-zoom-in-button = + .title = Калон кардан +pdfjs-zoom-in-button-label = Калон кардан +pdfjs-zoom-select = + .title = Танзими андоза +pdfjs-presentation-mode-button = + .title = Гузариш ба реҷаи тақдим +pdfjs-presentation-mode-button-label = Реҷаи тақдим +pdfjs-open-file-button = + .title = Кушодани файл +pdfjs-open-file-button-label = Кушодан +pdfjs-print-button = + .title = Чоп кардан +pdfjs-print-button-label = Чоп кардан +pdfjs-save-button = + .title = Нигоҳ доштан +pdfjs-save-button-label = Нигоҳ доштан +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Боргирӣ кардан +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Боргирӣ кардан +pdfjs-bookmark-button = + .title = Саҳифаи ҷорӣ (Дидани нишонии URL аз саҳифаи ҷорӣ) +pdfjs-bookmark-button-label = Саҳифаи ҷорӣ + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Абзорҳо +pdfjs-tools-button-label = Абзорҳо +pdfjs-first-page-button = + .title = Ба саҳифаи аввал гузаред +pdfjs-first-page-button-label = Ба саҳифаи аввал гузаред +pdfjs-last-page-button = + .title = Ба саҳифаи охирин гузаред +pdfjs-last-page-button-label = Ба саҳифаи охирин гузаред +pdfjs-page-rotate-cw-button = + .title = Ба самти ҳаракати ақрабаки соат давр задан +pdfjs-page-rotate-cw-button-label = Ба самти ҳаракати ақрабаки соат давр задан +pdfjs-page-rotate-ccw-button = + .title = Ба муқобили самти ҳаракати ақрабаки соат давр задан +pdfjs-page-rotate-ccw-button-label = Ба муқобили самти ҳаракати ақрабаки соат давр задан +pdfjs-cursor-text-select-tool-button = + .title = Фаъол кардани «Абзори интихоби матн» +pdfjs-cursor-text-select-tool-button-label = Абзори интихоби матн +pdfjs-cursor-hand-tool-button = + .title = Фаъол кардани «Абзори даст» +pdfjs-cursor-hand-tool-button-label = Абзори даст +pdfjs-scroll-page-button = + .title = Истифодаи варақзанӣ +pdfjs-scroll-page-button-label = Варақзанӣ +pdfjs-scroll-vertical-button = + .title = Истифодаи варақзании амудӣ +pdfjs-scroll-vertical-button-label = Варақзании амудӣ +pdfjs-scroll-horizontal-button = + .title = Истифодаи варақзании уфуқӣ +pdfjs-scroll-horizontal-button-label = Варақзании уфуқӣ +pdfjs-scroll-wrapped-button = + .title = Истифодаи варақзании миқёсбандӣ +pdfjs-scroll-wrapped-button-label = Варақзании миқёсбандӣ +pdfjs-spread-none-button = + .title = Густариши саҳифаҳо истифода бурда нашавад +pdfjs-spread-none-button-label = Бе густурдани саҳифаҳо +pdfjs-spread-odd-button = + .title = Густариши саҳифаҳо аз саҳифаҳо бо рақамҳои тоқ оғоз карда мешавад +pdfjs-spread-odd-button-label = Саҳифаҳои тоқ аз тарафи чап +pdfjs-spread-even-button = + .title = Густариши саҳифаҳо аз саҳифаҳо бо рақамҳои ҷуфт оғоз карда мешавад +pdfjs-spread-even-button-label = Саҳифаҳои ҷуфт аз тарафи чап + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Хусусиятҳои ҳуҷҷат… +pdfjs-document-properties-button-label = Хусусиятҳои ҳуҷҷат… +pdfjs-document-properties-file-name = Номи файл: +pdfjs-document-properties-file-size = Андозаи файл: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } КБ ({ $b } байт) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } МБ ({ $b } байт) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } КБ ({ $size_b } байт) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } МБ ({ $size_b } байт) +pdfjs-document-properties-title = Сарлавҳа: +pdfjs-document-properties-author = Муаллиф: +pdfjs-document-properties-subject = Мавзуъ: +pdfjs-document-properties-keywords = Калимаҳои калидӣ: +pdfjs-document-properties-creation-date = Санаи эҷод: +pdfjs-document-properties-modification-date = Санаи тағйирот: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Эҷодкунанда: +pdfjs-document-properties-producer = Таҳиякунандаи «PDF»: +pdfjs-document-properties-version = Версияи «PDF»: +pdfjs-document-properties-page-count = Шумораи саҳифаҳо: +pdfjs-document-properties-page-size = Андозаи саҳифа: +pdfjs-document-properties-page-size-unit-inches = дюйм +pdfjs-document-properties-page-size-unit-millimeters = мм +pdfjs-document-properties-page-size-orientation-portrait = амудӣ +pdfjs-document-properties-page-size-orientation-landscape = уфуқӣ +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Мактуб +pdfjs-document-properties-page-size-name-legal = Ҳуқуқӣ + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Намоиши тез дар Интернет: +pdfjs-document-properties-linearized-yes = Ҳа +pdfjs-document-properties-linearized-no = Не +pdfjs-document-properties-close-button = Пӯшидан + +## Print + +pdfjs-print-progress-message = Омодасозии ҳуҷҷат барои чоп… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Бекор кардан +pdfjs-printing-not-supported = Диққат: Чопкунӣ аз тарафи ин браузер ба таври пурра дастгирӣ намешавад. +pdfjs-printing-not-ready = Диққат: Файли «PDF» барои чопкунӣ пурра бор карда нашуд. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Фаъол кардани навори ҷонибӣ +pdfjs-toggle-sidebar-notification-button = + .title = Фаъол кардани навори ҷонибӣ (ҳуҷҷат дорои сохтор/замимаҳо/қабатҳо мебошад) +pdfjs-toggle-sidebar-button-label = Фаъол кардани навори ҷонибӣ +pdfjs-document-outline-button = + .title = Намоиш додани сохтори ҳуҷҷат (барои баркушодан/пеҷондани ҳамаи унсурҳо дубора зер кунед) +pdfjs-document-outline-button-label = Сохтори ҳуҷҷат +pdfjs-attachments-button = + .title = Намоиш додани замимаҳо +pdfjs-attachments-button-label = Замимаҳо +pdfjs-layers-button = + .title = Намоиш додани қабатҳо (барои барқарор кардани ҳамаи қабатҳо ба вазъияти пешфарз дубора зер кунед) +pdfjs-layers-button-label = Қабатҳо +pdfjs-thumbs-button = + .title = Намоиш додани тасвирчаҳо +pdfjs-thumbs-button-label = Тасвирчаҳо +pdfjs-current-outline-item-button = + .title = Ёфтани унсури сохтори ҷорӣ +pdfjs-current-outline-item-button-label = Унсури сохтори ҷорӣ +pdfjs-findbar-button = + .title = Ёфтан дар ҳуҷҷат +pdfjs-findbar-button-label = Ёфтан +pdfjs-additional-layers = Қабатҳои иловагӣ + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Саҳифаи { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Тасвирчаи саҳифаи { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Ёфтан + .placeholder = Ёфтан дар ҳуҷҷат… +pdfjs-find-previous-button = + .title = Ҷустуҷӯи мавриди қаблии ибораи пешниҳодшуда +pdfjs-find-previous-button-label = Қаблӣ +pdfjs-find-next-button = + .title = Ҷустуҷӯи мавриди навбатии ибораи пешниҳодшуда +pdfjs-find-next-button-label = Навбатӣ +pdfjs-find-highlight-checkbox = Ҳамаашро бо ранг ҷудо кардан +pdfjs-find-match-case-checkbox-label = Бо дарназардошти ҳарфҳои хурду калон +pdfjs-find-match-diacritics-checkbox-label = Бо дарназардошти аломатҳои диакритикӣ +pdfjs-find-entire-word-checkbox-label = Калимаҳои пурра +pdfjs-find-reached-top = Ба болои ҳуҷҷат расид, аз поён идома ёфт +pdfjs-find-reached-bottom = Ба поёни ҳуҷҷат расид, аз боло идома ёфт +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] { $current } аз { $total } мувофиқат + *[other] { $current } аз { $total } мувофиқат + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] Зиёда аз { $limit } мувофиқат + *[other] Зиёда аз { $limit } мувофиқат + } +pdfjs-find-not-found = Ибора ёфт нашуд + +## Predefined zoom values + +pdfjs-page-scale-width = Аз рӯи паҳнои саҳифа +pdfjs-page-scale-fit = Аз рӯи андозаи саҳифа +pdfjs-page-scale-auto = Андозаи худкор +pdfjs-page-scale-actual = Андозаи воқеӣ +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Саҳифаи { $page } + +## Loading indicator messages + +pdfjs-loading-error = Ҳангоми боркунии «PDF» хато ба миён омад. +pdfjs-invalid-file-error = Файли «PDF» нодуруст ё вайроншуда мебошад. +pdfjs-missing-file-error = Файли «PDF» ғоиб аст. +pdfjs-unexpected-response-error = Ҷавоби ногаҳон аз сервер. +pdfjs-rendering-error = Ҳангоми шаклсозии саҳифа хато ба миён омад. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [Ҳошиянависӣ - { $type }] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Барои кушодани ин файли «PDF» ниҳонвожаро ворид кунед. +pdfjs-password-invalid = Ниҳонвожаи нодуруст. Лутфан, аз нав кӯшиш кунед. +pdfjs-password-ok-button = ХУБ +pdfjs-password-cancel-button = Бекор кардан +pdfjs-web-fonts-disabled = Шрифтҳои интернетӣ ғайрифаъоланд: истифодаи шрифтҳои дарунсохти «PDF» ғайриимкон аст. + +## Editing + +pdfjs-editor-free-text-button = + .title = Матн +pdfjs-editor-free-text-button-label = Матн +pdfjs-editor-ink-button = + .title = Расмкашӣ +pdfjs-editor-ink-button-label = Расмкашӣ +pdfjs-editor-stamp-button = + .title = Илова ё таҳрир кардани тасвирҳо +pdfjs-editor-stamp-button-label = Илова ё таҳрир кардани тасвирҳо +pdfjs-editor-highlight-button = + .title = Ҷудокунӣ +pdfjs-editor-highlight-button-label = Ҷудокунӣ +pdfjs-highlight-floating-button1 = + .title = Ҷудокунӣ + .aria-label = Ҷудокунӣ +pdfjs-highlight-floating-button-label = Ҷудокунӣ + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Тоза кардани нақша +pdfjs-editor-remove-freetext-button = + .title = Тоза кардани матн +pdfjs-editor-remove-stamp-button = + .title = Тоза кардани тасвир +pdfjs-editor-remove-highlight-button = + .title = Тоза кардани ҷудокунӣ + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Ранг +pdfjs-editor-free-text-size-input = Андоза +pdfjs-editor-ink-color-input = Ранг +pdfjs-editor-ink-thickness-input = Ғафсӣ +pdfjs-editor-ink-opacity-input = Шаффофӣ +pdfjs-editor-stamp-add-image-button = + .title = Илова кардани тасвир +pdfjs-editor-stamp-add-image-button-label = Илова кардани тасвир +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Ғафсӣ +pdfjs-editor-free-highlight-thickness-title = + .title = Иваз кардани ғафсӣ ҳангоми ҷудокунии унсурҳо ба ғайр аз матн +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = Муҳаррири матн + .default-content = Матнро ворид кунед… +pdfjs-free-text = + .aria-label = Муҳаррири матн +pdfjs-free-text-default-content = Нависед… +pdfjs-ink = + .aria-label = Муҳаррири расмкашӣ +pdfjs-ink-canvas = + .aria-label = Тасвири эҷодкардаи корбар + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = Матни иловагӣ +pdfjs-editor-alt-text-edit-button = + .aria-label = Таҳрир кардани матни ивазкунанда +pdfjs-editor-alt-text-edit-button-label = Таҳрир кардани матни иловагӣ +pdfjs-editor-alt-text-dialog-label = Имконеро интихоб намоед +pdfjs-editor-alt-text-dialog-description = Вақте ки одамон тасвирро дида наметавонанд ё вақте ки тасвир бор карда намешавад, матни иловагӣ (Alt text) кумак мерасонад. +pdfjs-editor-alt-text-add-description-label = Илова кардани тавсиф +pdfjs-editor-alt-text-add-description-description = Кӯшиш кунед, ки 1-2 ҷумлаеро нависед, ки ба мавзӯъ, танзим ё амалҳо тавзеҳ медиҳад. +pdfjs-editor-alt-text-mark-decorative-label = Гузоштан ҳамчун матни ороишӣ +pdfjs-editor-alt-text-mark-decorative-description = Ин барои тасвирҳои ороишӣ, ба монанди марзҳо ё аломатҳои обӣ, истифода мешавад. +pdfjs-editor-alt-text-cancel-button = Бекор кардан +pdfjs-editor-alt-text-save-button = Нигоҳ доштан +pdfjs-editor-alt-text-decorative-tooltip = Ҳамчун матни ороишӣ гузошта шуд +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = Барои мисол, «Ман забони тоҷикиро дӯст медорам» +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = Матни ивазкунанда + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Кунҷи чапи боло — тағйир додани андоза +pdfjs-editor-resizer-label-top-middle = Канори миёнаи боло — тағйир додани андоза +pdfjs-editor-resizer-label-top-right = Кунҷи рости боло — тағйир додани андоза +pdfjs-editor-resizer-label-middle-right = Канори миёнаи рост — тағйир додани андоза +pdfjs-editor-resizer-label-bottom-right = Кунҷи рости поён — тағйир додани андоза +pdfjs-editor-resizer-label-bottom-middle = Канори миёнаи поён — тағйир додани андоза +pdfjs-editor-resizer-label-bottom-left = Кунҷи чапи поён — тағйир додани андоза +pdfjs-editor-resizer-label-middle-left = Канори миёнаи чап — тағйир додани андоза +pdfjs-editor-resizer-top-left = + .aria-label = Кунҷи чапи боло — тағйир додани андоза +pdfjs-editor-resizer-top-middle = + .aria-label = Канори миёнаи боло — тағйир додани андоза +pdfjs-editor-resizer-top-right = + .aria-label = Кунҷи рости боло — тағйир додани андоза +pdfjs-editor-resizer-middle-right = + .aria-label = Канори миёнаи рост — тағйир додани андоза +pdfjs-editor-resizer-bottom-right = + .aria-label = Кунҷи рости поён — тағйир додани андоза +pdfjs-editor-resizer-bottom-middle = + .aria-label = Канори миёнаи поён — тағйир додани андоза +pdfjs-editor-resizer-bottom-left = + .aria-label = Кунҷи чапи поён — тағйир додани андоза +pdfjs-editor-resizer-middle-left = + .aria-label = Канори миёнаи чап — тағйир додани андоза + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Ранги ҷудокунӣ +pdfjs-editor-colorpicker-button = + .title = Иваз кардани ранг +pdfjs-editor-colorpicker-dropdown = + .aria-label = Интихоби ранг +pdfjs-editor-colorpicker-yellow = + .title = Зард +pdfjs-editor-colorpicker-green = + .title = Сабз +pdfjs-editor-colorpicker-blue = + .title = Кабуд +pdfjs-editor-colorpicker-pink = + .title = Гулобӣ +pdfjs-editor-colorpicker-red = + .title = Сурх + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Ҳамаро намоиш додан +pdfjs-editor-highlight-show-all-button = + .title = Ҳамаро намоиш додан + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = Таҳрир кардани матни иловагӣ (тафсири тасвир) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = Илова кардани матни иловагӣ (тафсири тасвир) +pdfjs-editor-new-alt-text-textarea = + .placeholder = Тафсири худро дар ин ҷо нависед… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = Тавсифи мухтасар барои одамоне, ки аксҳоро дида наметавонанд ё вақте ки аксҳо кушода намешаванд. +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = Ин матни ивазкунанда ба таври худкор сохта шудааст ва шояд нодуруст бошад. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Маълумоти бештар +pdfjs-editor-new-alt-text-create-automatically-button-label = Ба таври худкор эҷод кардани матни иловагӣ +pdfjs-editor-new-alt-text-not-now-button = Ҳоло не +pdfjs-editor-new-alt-text-error-title = Матни иловагӣ ба таври худкор эҷод карда нашуд +pdfjs-editor-new-alt-text-error-description = Лутфан, матни иловагии худро ворид кунед ё баъдтар аз нав кӯшиш кунед. +pdfjs-editor-new-alt-text-error-close-button = Пӯшидан +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = Боргирии модели зеҳни сунъӣ (AI) барои матни ивазкунанда ({ $downloadedSize } аз { $totalSize } МБ) + .aria-valuetext = Боргирии модели зеҳни сунъӣ (AI) барои матни ивазкунанда ({ $downloadedSize } аз { $totalSize } МБ) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = Матни иловагӣ илова карда шуд +pdfjs-editor-new-alt-text-added-button-label = Матни иловагӣ илова карда шуд +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = Матни иловагӣ вуҷуд надорад +pdfjs-editor-new-alt-text-missing-button-label = Матни иловагӣ вуҷуд надорад +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = Бознигарӣ кардани матни иловагӣ +pdfjs-editor-new-alt-text-to-review-button-label = Бознигарӣ кардани матни иловагӣ +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Ба таври худкор сохта шудааст: «{ $generatedAltText }» + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = Танзимоти матни иловагии тасвир +pdfjs-image-alt-text-settings-button-label = Танзимоти матни иловагии тасвир +pdfjs-editor-alt-text-settings-dialog-label = Танзимоти матни иловагии тасвир +pdfjs-editor-alt-text-settings-automatic-title = Матни иловагии худкор +pdfjs-editor-alt-text-settings-create-model-button-label = Ба таври худкор эҷод кардани матни иловагӣ +pdfjs-editor-alt-text-settings-create-model-description = Ин имкон барои расонидани кумак ба одамоне, ки аксҳоро дида наметавонанд ё вақте ки аксҳо кушода намешаванд, тавсифи аксҳоро пешниҳод мекунад. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = Модели зеҳни сунъӣ «AI» барои матни ивазкунанда ({ $totalSize } МБ) +pdfjs-editor-alt-text-settings-ai-model-description = Дар дастгоҳи шумо ба таври маҳаллӣ кор мекунад, бинобар ин махфияти маълумоти шахсии шумо нигоҳ дошта мешавад. Барои матни ивазкунандаи худкор лозим аст. +pdfjs-editor-alt-text-settings-delete-model-button = Нест кардан +pdfjs-editor-alt-text-settings-download-model-button = Боргирӣ кардан +pdfjs-editor-alt-text-settings-downloading-model-button = Дар ҳоли боргирӣ… +pdfjs-editor-alt-text-settings-editor-title = Муҳаррири матни иловагӣ +pdfjs-editor-alt-text-settings-show-dialog-button-label = Дарҳол нишон додани муҳаррири матни ивазкунанда ҳангоми иловакунии тасвир +pdfjs-editor-alt-text-settings-show-dialog-description = Ба шумо кумак мекунад, ки боварӣ ҳосил кунед, ки ҳамаи тасвирҳои шумо дорои матни ивазкунанда мебошанд. +pdfjs-editor-alt-text-settings-close-button = Пӯшидан + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = Ҷудосозӣ тоза карда шуд +pdfjs-editor-undo-bar-message-freetext = Матн тоза карда шуд +pdfjs-editor-undo-bar-message-ink = Расм тоза карда шуд +pdfjs-editor-undo-bar-message-stamp = Тасвир тоза карда шуд +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = + { $count -> + [one] { $count } ҳошиянависӣ тоза карда шуд + *[other] { $count } ҳошиянависӣ тоза карда шуданд + } +pdfjs-editor-undo-bar-undo-button = + .title = Бекор кардан +pdfjs-editor-undo-bar-undo-button-label = Бекор кардан +pdfjs-editor-undo-bar-close-button = + .title = Пӯшидан +pdfjs-editor-undo-bar-close-button-label = Пӯшидан diff --git a/public/pdfjs/web/locale/th/viewer.ftl b/public/pdfjs/web/locale/th/viewer.ftl new file mode 100644 index 0000000..cba15f9 --- /dev/null +++ b/public/pdfjs/web/locale/th/viewer.ftl @@ -0,0 +1,503 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = หน้าก่อนหน้า +pdfjs-previous-button-label = ก่อนหน้า +pdfjs-next-button = + .title = หน้าถัดไป +pdfjs-next-button-label = ถัดไป +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = หน้า +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = จาก { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } จาก { $pagesCount }) +pdfjs-zoom-out-button = + .title = ซูมออก +pdfjs-zoom-out-button-label = ซูมออก +pdfjs-zoom-in-button = + .title = ซูมเข้า +pdfjs-zoom-in-button-label = ซูมเข้า +pdfjs-zoom-select = + .title = ซูม +pdfjs-presentation-mode-button = + .title = สลับเป็นโหมดการนำเสนอ +pdfjs-presentation-mode-button-label = โหมดการนำเสนอ +pdfjs-open-file-button = + .title = เปิดไฟล์ +pdfjs-open-file-button-label = เปิด +pdfjs-print-button = + .title = พิมพ์ +pdfjs-print-button-label = พิมพ์ +pdfjs-save-button = + .title = บันทึก +pdfjs-save-button-label = บันทึก +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = ดาวน์โหลด +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = ดาวน์โหลด +pdfjs-bookmark-button = + .title = หน้าปัจจุบัน (ดู URL จากหน้าปัจจุบัน) +pdfjs-bookmark-button-label = หน้าปัจจุบัน + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = เครื่องมือ +pdfjs-tools-button-label = เครื่องมือ +pdfjs-first-page-button = + .title = ไปยังหน้าแรก +pdfjs-first-page-button-label = ไปยังหน้าแรก +pdfjs-last-page-button = + .title = ไปยังหน้าสุดท้าย +pdfjs-last-page-button-label = ไปยังหน้าสุดท้าย +pdfjs-page-rotate-cw-button = + .title = หมุนตามเข็มนาฬิกา +pdfjs-page-rotate-cw-button-label = หมุนตามเข็มนาฬิกา +pdfjs-page-rotate-ccw-button = + .title = หมุนทวนเข็มนาฬิกา +pdfjs-page-rotate-ccw-button-label = หมุนทวนเข็มนาฬิกา +pdfjs-cursor-text-select-tool-button = + .title = เปิดใช้งานเครื่องมือการเลือกข้อความ +pdfjs-cursor-text-select-tool-button-label = เครื่องมือการเลือกข้อความ +pdfjs-cursor-hand-tool-button = + .title = เปิดใช้งานเครื่องมือมือ +pdfjs-cursor-hand-tool-button-label = เครื่องมือมือ +pdfjs-scroll-page-button = + .title = ใช้การเลื่อนหน้า +pdfjs-scroll-page-button-label = การเลื่อนหน้า +pdfjs-scroll-vertical-button = + .title = ใช้การเลื่อนแนวตั้ง +pdfjs-scroll-vertical-button-label = การเลื่อนแนวตั้ง +pdfjs-scroll-horizontal-button = + .title = ใช้การเลื่อนแนวนอน +pdfjs-scroll-horizontal-button-label = การเลื่อนแนวนอน +pdfjs-scroll-wrapped-button = + .title = ใช้การเลื่อนแบบคลุม +pdfjs-scroll-wrapped-button-label = เลื่อนแบบคลุม +pdfjs-spread-none-button = + .title = ไม่ต้องรวมการกระจายหน้า +pdfjs-spread-none-button-label = ไม่กระจาย +pdfjs-spread-odd-button = + .title = รวมการกระจายหน้าเริ่มจากหน้าคี่ +pdfjs-spread-odd-button-label = กระจายอย่างเหลือเศษ +pdfjs-spread-even-button = + .title = รวมการกระจายหน้าเริ่มจากหน้าคู่ +pdfjs-spread-even-button-label = กระจายอย่างเท่าเทียม + +## Document properties dialog + +pdfjs-document-properties-button = + .title = คุณสมบัติเอกสาร… +pdfjs-document-properties-button-label = คุณสมบัติเอกสาร… +pdfjs-document-properties-file-name = ชื่อไฟล์: +pdfjs-document-properties-file-size = ขนาดไฟล์: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } ไบต์) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } ไบต์) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } ไบต์) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } ไบต์) +pdfjs-document-properties-title = ชื่อเรื่อง: +pdfjs-document-properties-author = ผู้สร้าง: +pdfjs-document-properties-subject = ชื่อเรื่อง: +pdfjs-document-properties-keywords = คำสำคัญ: +pdfjs-document-properties-creation-date = วันที่สร้าง: +pdfjs-document-properties-modification-date = วันที่แก้ไข: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = ผู้สร้าง: +pdfjs-document-properties-producer = ผู้ผลิต PDF: +pdfjs-document-properties-version = รุ่น PDF: +pdfjs-document-properties-page-count = จำนวนหน้า: +pdfjs-document-properties-page-size = ขนาดหน้า: +pdfjs-document-properties-page-size-unit-inches = in +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = แนวตั้ง +pdfjs-document-properties-page-size-orientation-landscape = แนวนอน +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = จดหมาย +pdfjs-document-properties-page-size-name-legal = ข้อกฎหมาย + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = มุมมองเว็บแบบรวดเร็ว: +pdfjs-document-properties-linearized-yes = ใช่ +pdfjs-document-properties-linearized-no = ไม่ +pdfjs-document-properties-close-button = ปิด + +## Print + +pdfjs-print-progress-message = กำลังเตรียมเอกสารสำหรับการพิมพ์… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = ยกเลิก +pdfjs-printing-not-supported = คำเตือน: เบราว์เซอร์นี้ไม่ได้สนับสนุนการพิมพ์อย่างเต็มที่ +pdfjs-printing-not-ready = คำเตือน: PDF ไม่ได้รับการโหลดอย่างเต็มที่สำหรับการพิมพ์ + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = เปิด/ปิดแถบข้าง +pdfjs-toggle-sidebar-notification-button = + .title = เปิด/ปิดแถบข้าง (เอกสารมีเค้าร่าง/ไฟล์แนบ/เลเยอร์) +pdfjs-toggle-sidebar-button-label = เปิด/ปิดแถบข้าง +pdfjs-document-outline-button = + .title = แสดงเค้าร่างเอกสาร (คลิกสองครั้งเพื่อขยาย/ยุบรายการทั้งหมด) +pdfjs-document-outline-button-label = เค้าร่างเอกสาร +pdfjs-attachments-button = + .title = แสดงไฟล์แนบ +pdfjs-attachments-button-label = ไฟล์แนบ +pdfjs-layers-button = + .title = แสดงเลเยอร์ (คลิกสองครั้งเพื่อรีเซ็ตเลเยอร์ทั้งหมดเป็นสถานะเริ่มต้น) +pdfjs-layers-button-label = เลเยอร์ +pdfjs-thumbs-button = + .title = แสดงภาพขนาดย่อ +pdfjs-thumbs-button-label = ภาพขนาดย่อ +pdfjs-current-outline-item-button = + .title = ค้นหารายการเค้าร่างปัจจุบัน +pdfjs-current-outline-item-button-label = รายการเค้าร่างปัจจุบัน +pdfjs-findbar-button = + .title = ค้นหาในเอกสาร +pdfjs-findbar-button-label = ค้นหา +pdfjs-additional-layers = เลเยอร์เพิ่มเติม + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = หน้า { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = ภาพขนาดย่อของหน้า { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = ค้นหา + .placeholder = ค้นหาในเอกสาร… +pdfjs-find-previous-button = + .title = หาตำแหน่งก่อนหน้าของวลี +pdfjs-find-previous-button-label = ก่อนหน้า +pdfjs-find-next-button = + .title = หาตำแหน่งถัดไปของวลี +pdfjs-find-next-button-label = ถัดไป +pdfjs-find-highlight-checkbox = เน้นสีทั้งหมด +pdfjs-find-match-case-checkbox-label = ตัวพิมพ์ใหญ่เล็กตรงกัน +pdfjs-find-match-diacritics-checkbox-label = เครื่องหมายกำกับการออกเสียงตรงกัน +pdfjs-find-entire-word-checkbox-label = ทั้งคำ +pdfjs-find-reached-top = ค้นหาถึงจุดเริ่มต้นของหน้า เริ่มค้นต่อจากด้านล่าง +pdfjs-find-reached-bottom = ค้นหาถึงจุดสิ้นสุดหน้า เริ่มค้นต่อจากด้านบน +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = { $current } จาก { $total } รายการที่ตรงกัน +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = มากกว่า { $limit } รายการที่ตรงกัน +pdfjs-find-not-found = ไม่พบวลี + +## Predefined zoom values + +pdfjs-page-scale-width = ความกว้างหน้า +pdfjs-page-scale-fit = พอดีหน้า +pdfjs-page-scale-auto = ซูมอัตโนมัติ +pdfjs-page-scale-actual = ขนาดจริง +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = หน้า { $page } + +## Loading indicator messages + +pdfjs-loading-error = เกิดข้อผิดพลาดขณะโหลด PDF +pdfjs-invalid-file-error = ไฟล์ PDF ไม่ถูกต้องหรือเสียหาย +pdfjs-missing-file-error = ไฟล์ PDF หายไป +pdfjs-unexpected-response-error = การตอบสนองของเซิร์ฟเวอร์ที่ไม่คาดคิด +pdfjs-rendering-error = เกิดข้อผิดพลาดขณะเรนเดอร์หน้า + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [คำอธิบายประกอบ { $type }] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = ป้อนรหัสผ่านเพื่อเปิดไฟล์ PDF นี้ +pdfjs-password-invalid = รหัสผ่านไม่ถูกต้อง โปรดลองอีกครั้ง +pdfjs-password-ok-button = ตกลง +pdfjs-password-cancel-button = ยกเลิก +pdfjs-web-fonts-disabled = แบบอักษรเว็บถูกปิดใช้งาน: ไม่สามารถใช้แบบอักษร PDF ฝังตัว + +## Editing + +pdfjs-editor-free-text-button = + .title = ข้อความ +pdfjs-editor-free-text-button-label = ข้อความ +pdfjs-editor-ink-button = + .title = รูปวาด +pdfjs-editor-ink-button-label = รูปวาด +pdfjs-editor-stamp-button = + .title = เพิ่มหรือแก้ไขภาพ +pdfjs-editor-stamp-button-label = เพิ่มหรือแก้ไขภาพ +pdfjs-editor-highlight-button = + .title = เน้น +pdfjs-editor-highlight-button-label = เน้น +pdfjs-highlight-floating-button1 = + .title = เน้นสี + .aria-label = เน้นสี +pdfjs-highlight-floating-button-label = เน้นสี + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = เอาภาพวาดออก +pdfjs-editor-remove-freetext-button = + .title = เอาข้อความออก +pdfjs-editor-remove-stamp-button = + .title = เอาภาพออก +pdfjs-editor-remove-highlight-button = + .title = เอาการเน้นสีออก + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = สี +pdfjs-editor-free-text-size-input = ขนาด +pdfjs-editor-ink-color-input = สี +pdfjs-editor-ink-thickness-input = ความหนา +pdfjs-editor-ink-opacity-input = ความทึบ +pdfjs-editor-stamp-add-image-button = + .title = เพิ่มภาพ +pdfjs-editor-stamp-add-image-button-label = เพิ่มภาพ +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = ความหนา +pdfjs-editor-free-highlight-thickness-title = + .title = เปลี่ยนความหนาเมื่อเน้นรายการอื่นๆ ที่ไม่ใช่ข้อความ +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = ตัวแก้ไขข้อความ + .default-content = เริ่มพิมพ์ได้เลย… +pdfjs-free-text = + .aria-label = ตัวแก้ไขข้อความ +pdfjs-free-text-default-content = เริ่มพิมพ์… +pdfjs-ink = + .aria-label = ตัวแก้ไขรูปวาด +pdfjs-ink-canvas = + .aria-label = ภาพที่ผู้ใช้สร้างขึ้น + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = ข้อความทดแทน +pdfjs-editor-alt-text-edit-button = + .aria-label = แก้ไขข้อความทดแทน +pdfjs-editor-alt-text-edit-button-label = แก้ไขข้อความทดแทน +pdfjs-editor-alt-text-dialog-label = เลือกตัวเลือก +pdfjs-editor-alt-text-dialog-description = ข้อความทดแทนสามารถช่วยเหลือได้เมื่อผู้ใช้มองไม่เห็นภาพ หรือภาพไม่โหลด +pdfjs-editor-alt-text-add-description-label = เพิ่มคำอธิบาย +pdfjs-editor-alt-text-add-description-description = แนะนำให้ใช้ 1-2 ประโยคซึ่งอธิบายหัวเรื่อง ฉาก หรือการกระทำ +pdfjs-editor-alt-text-mark-decorative-label = ทำเครื่องหมายเป็นสิ่งตกแต่ง +pdfjs-editor-alt-text-mark-decorative-description = สิ่งนี้ใช้สำหรับภาพที่เป็นสิ่งประดับ เช่น ขอบ หรือลายน้ำ +pdfjs-editor-alt-text-cancel-button = ยกเลิก +pdfjs-editor-alt-text-save-button = บันทึก +pdfjs-editor-alt-text-decorative-tooltip = ทำเครื่องหมายเป็นสิ่งตกแต่งแล้ว +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = ตัวอย่างเช่น “ชายหนุ่มคนหนึ่งนั่งลงที่โต๊ะเพื่อรับประทานอาหารมื้อหนึ่ง” +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = ข้อความทดแทน + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = มุมซ้ายบน — ปรับขนาด +pdfjs-editor-resizer-label-top-middle = ตรงกลางด้านบน — ปรับขนาด +pdfjs-editor-resizer-label-top-right = มุมขวาบน — ปรับขนาด +pdfjs-editor-resizer-label-middle-right = ตรงกลางด้านขวา — ปรับขนาด +pdfjs-editor-resizer-label-bottom-right = มุมขวาล่าง — ปรับขนาด +pdfjs-editor-resizer-label-bottom-middle = ตรงกลางด้านล่าง — ปรับขนาด +pdfjs-editor-resizer-label-bottom-left = มุมซ้ายล่าง — ปรับขนาด +pdfjs-editor-resizer-label-middle-left = ตรงกลางด้านซ้าย — ปรับขนาด +pdfjs-editor-resizer-top-left = + .aria-label = มุมซ้ายบน — ปรับขนาด +pdfjs-editor-resizer-top-middle = + .aria-label = ตรงกลางด้านบน — ปรับขนาด +pdfjs-editor-resizer-top-right = + .aria-label = มุมขวาบน — ปรับขนาด +pdfjs-editor-resizer-middle-right = + .aria-label = ตรงกลางด้านขวา — ปรับขนาด +pdfjs-editor-resizer-bottom-right = + .aria-label = มุมขวาล่าง — ปรับขนาด +pdfjs-editor-resizer-bottom-middle = + .aria-label = ตรงกลางด้านล่าง — ปรับขนาด +pdfjs-editor-resizer-bottom-left = + .aria-label = มุมซ้ายล่าง — ปรับขนาด +pdfjs-editor-resizer-middle-left = + .aria-label = ตรงกลางด้านซ้าย — ปรับขนาด + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = สีเน้น +pdfjs-editor-colorpicker-button = + .title = เปลี่ยนสี +pdfjs-editor-colorpicker-dropdown = + .aria-label = ทางเลือกสี +pdfjs-editor-colorpicker-yellow = + .title = เหลือง +pdfjs-editor-colorpicker-green = + .title = เขียว +pdfjs-editor-colorpicker-blue = + .title = น้ำเงิน +pdfjs-editor-colorpicker-pink = + .title = ชมพู +pdfjs-editor-colorpicker-red = + .title = แดง + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = แสดงทั้งหมด +pdfjs-editor-highlight-show-all-button = + .title = แสดงทั้งหมด + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = แก้ไขข้อความทดแทน (คำอธิบายภาพ) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = เพิ่มข้อความทดแทน (คำอธิบายภาพ) +pdfjs-editor-new-alt-text-textarea = + .placeholder = เขียนคำอธิบายของคุณที่นี่… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = คำอธิบายสั้นๆ สำหรับผู้ที่ไม่สามารถมองเห็นภาพหรือเมื่อภาพไม่โหลด +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = ข้อความทดแทนนี้ถูกสร้างขึ้นโดยอัตโนมัติและอาจไม่ถูกต้อง +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = เรียนรู้เพิ่มเติม +pdfjs-editor-new-alt-text-create-automatically-button-label = สร้างข้อความทดแทนโดยอัตโนมัติ +pdfjs-editor-new-alt-text-not-now-button = ไม่ใช่ตอนนี้ +pdfjs-editor-new-alt-text-error-title = ไม่สามารถสร้างข้อความทดแทนโดยอัตโนมัติได้ +pdfjs-editor-new-alt-text-error-description = กรุณาเขียนข้อความทดแทนด้วยตัวเองหรือลองใหม่อีกครั้งในภายหลัง +pdfjs-editor-new-alt-text-error-close-button = ปิด +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = กำลังดาวน์โหลดโมเดล AI สำหรับข้อความทดแทน ({ $downloadedSize } จาก { $totalSize } MB) + .aria-valuetext = กำลังดาวน์โหลดโมเดล AI สำหรับข้อความทดแทน ({ $downloadedSize } จาก { $totalSize } MB) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = เพิ่มข้อความทดแทนแล้ว +pdfjs-editor-new-alt-text-added-button-label = เพิ่มข้อความทดแทนแล้ว +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = ขาดข้อความทดแทน +pdfjs-editor-new-alt-text-missing-button-label = ขาดข้อความทดแทน +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = ตรวจสอบข้อความทดแทน +pdfjs-editor-new-alt-text-to-review-button-label = ตรวจสอบข้อความทดแทน +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = สร้างขึ้นโดยอัตโนมัติ: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = ตั้งค่าข้อความทดแทนภาพ +pdfjs-image-alt-text-settings-button-label = ตั้งค่าข้อความทดแทนภาพ +pdfjs-editor-alt-text-settings-dialog-label = ตั้งค่าข้อความทดแทนภาพ +pdfjs-editor-alt-text-settings-automatic-title = การทดแทนด้วยข้อความอัตโนมัติ +pdfjs-editor-alt-text-settings-create-model-button-label = สร้างข้อความทดแทนอัตโนมัติ +pdfjs-editor-alt-text-settings-create-model-description = แนะนำคำอธิบายเพื่อช่วยเหลือผู้ที่ไม่สามารถมองเห็นภาพหรือเมื่อภาพไม่โหลด +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = โมเดล AI สำหรับข้อความทดแทน ({ $totalSize } MB) +pdfjs-editor-alt-text-settings-ai-model-description = ทำงานในเครื่องของคุณเพื่อให้ข้อมูลของคุณเป็นส่วนตัว จำเป็นสำหรับข้อความทดแทนอัตโนมัติ +pdfjs-editor-alt-text-settings-delete-model-button = ลบ +pdfjs-editor-alt-text-settings-download-model-button = ดาวน์โหลด +pdfjs-editor-alt-text-settings-downloading-model-button = กำลังดาวน์โหลด… +pdfjs-editor-alt-text-settings-editor-title = ตัวแก้ไขข้อความทดแทน +pdfjs-editor-alt-text-settings-show-dialog-button-label = แสดงตัวแก้ไขข้อความทดแทนทันทีเมื่อเพิ่มภาพ +pdfjs-editor-alt-text-settings-show-dialog-description = ช่วยให้คุณแน่ใจว่าภาพทั้งหมดของคุณมีข้อความทดแทน +pdfjs-editor-alt-text-settings-close-button = ปิด + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = เอาการเน้นสีออกแล้ว +pdfjs-editor-undo-bar-message-freetext = เอาข้อความออกแล้ว +pdfjs-editor-undo-bar-message-ink = เอาภาพวาดออกแล้ว +pdfjs-editor-undo-bar-message-stamp = เอาภาพออกแล้ว +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = เอาคำอธิบายประกอบ { $count } รายการออกแล้ว +pdfjs-editor-undo-bar-undo-button = + .title = เลิกทำ +pdfjs-editor-undo-bar-undo-button-label = เลิกทำ +pdfjs-editor-undo-bar-close-button = + .title = ปิด +pdfjs-editor-undo-bar-close-button-label = ปิด diff --git a/public/pdfjs/web/locale/tl/viewer.ftl b/public/pdfjs/web/locale/tl/viewer.ftl new file mode 100644 index 0000000..faa0009 --- /dev/null +++ b/public/pdfjs/web/locale/tl/viewer.ftl @@ -0,0 +1,257 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Naunang Pahina +pdfjs-previous-button-label = Nakaraan +pdfjs-next-button = + .title = Sunod na Pahina +pdfjs-next-button-label = Sunod +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Pahina +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = ng { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } ng { $pagesCount }) +pdfjs-zoom-out-button = + .title = Paliitin +pdfjs-zoom-out-button-label = Paliitin +pdfjs-zoom-in-button = + .title = Palakihin +pdfjs-zoom-in-button-label = Palakihin +pdfjs-zoom-select = + .title = Mag-zoom +pdfjs-presentation-mode-button = + .title = Lumipat sa Presentation Mode +pdfjs-presentation-mode-button-label = Presentation Mode +pdfjs-open-file-button = + .title = Magbukas ng file +pdfjs-open-file-button-label = Buksan +pdfjs-print-button = + .title = i-Print +pdfjs-print-button-label = i-Print + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Mga Kagamitan +pdfjs-tools-button-label = Mga Kagamitan +pdfjs-first-page-button = + .title = Pumunta sa Unang Pahina +pdfjs-first-page-button-label = Pumunta sa Unang Pahina +pdfjs-last-page-button = + .title = Pumunta sa Huling Pahina +pdfjs-last-page-button-label = Pumunta sa Huling Pahina +pdfjs-page-rotate-cw-button = + .title = Paikutin Pakanan +pdfjs-page-rotate-cw-button-label = Paikutin Pakanan +pdfjs-page-rotate-ccw-button = + .title = Paikutin Pakaliwa +pdfjs-page-rotate-ccw-button-label = Paikutin Pakaliwa +pdfjs-cursor-text-select-tool-button = + .title = I-enable ang Text Selection Tool +pdfjs-cursor-text-select-tool-button-label = Text Selection Tool +pdfjs-cursor-hand-tool-button = + .title = I-enable ang Hand Tool +pdfjs-cursor-hand-tool-button-label = Hand Tool +pdfjs-scroll-vertical-button = + .title = Gumamit ng Vertical Scrolling +pdfjs-scroll-vertical-button-label = Vertical Scrolling +pdfjs-scroll-horizontal-button = + .title = Gumamit ng Horizontal Scrolling +pdfjs-scroll-horizontal-button-label = Horizontal Scrolling +pdfjs-scroll-wrapped-button = + .title = Gumamit ng Wrapped Scrolling +pdfjs-scroll-wrapped-button-label = Wrapped Scrolling +pdfjs-spread-none-button = + .title = Huwag pagsamahin ang mga page spread +pdfjs-spread-none-button-label = No Spreads +pdfjs-spread-odd-button = + .title = Join page spreads starting with odd-numbered pages +pdfjs-spread-odd-button-label = Mga Odd Spread +pdfjs-spread-even-button = + .title = Pagsamahin ang mga page spread na nagsisimula sa mga even-numbered na pahina +pdfjs-spread-even-button-label = Mga Even Spread + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Mga Katangian ng Dokumento… +pdfjs-document-properties-button-label = Mga Katangian ng Dokumento… +pdfjs-document-properties-file-name = File name: +pdfjs-document-properties-file-size = File size: +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bytes) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bytes) +pdfjs-document-properties-title = Pamagat: +pdfjs-document-properties-author = May-akda: +pdfjs-document-properties-subject = Paksa: +pdfjs-document-properties-keywords = Mga keyword: +pdfjs-document-properties-creation-date = Petsa ng Pagkakagawa: +pdfjs-document-properties-modification-date = Petsa ng Pagkakabago: +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Tagalikha: +pdfjs-document-properties-producer = PDF Producer: +pdfjs-document-properties-version = PDF Version: +pdfjs-document-properties-page-count = Bilang ng Pahina: +pdfjs-document-properties-page-size = Laki ng Pahina: +pdfjs-document-properties-page-size-unit-inches = pulgada +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = patayo +pdfjs-document-properties-page-size-orientation-landscape = pahiga +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Letter +pdfjs-document-properties-page-size-name-legal = Legal + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Fast Web View: +pdfjs-document-properties-linearized-yes = Oo +pdfjs-document-properties-linearized-no = Hindi +pdfjs-document-properties-close-button = Isara + +## Print + +pdfjs-print-progress-message = Inihahanda ang dokumento para sa pag-print… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Kanselahin +pdfjs-printing-not-supported = Babala: Hindi pa ganap na suportado ang pag-print sa browser na ito. +pdfjs-printing-not-ready = Babala: Hindi ganap na nabuksan ang PDF para sa pag-print. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Ipakita/Itago ang Sidebar +pdfjs-toggle-sidebar-notification-button = + .title = Ipakita/Itago ang Sidebar (nagtataglay ang dokumento ng balangkas/mga attachment/mga layer) +pdfjs-toggle-sidebar-button-label = Ipakita/Itago ang Sidebar +pdfjs-document-outline-button = + .title = Ipakita ang Document Outline (mag-double-click para i-expand/collapse ang laman) +pdfjs-document-outline-button-label = Balangkas ng Dokumento +pdfjs-attachments-button = + .title = Ipakita ang mga Attachment +pdfjs-attachments-button-label = Mga attachment +pdfjs-layers-button = + .title = Ipakita ang mga Layer (mag-double click para mareset ang lahat ng layer sa orihinal na estado) +pdfjs-layers-button-label = Mga layer +pdfjs-thumbs-button = + .title = Ipakita ang mga Thumbnail +pdfjs-thumbs-button-label = Mga thumbnail +pdfjs-findbar-button = + .title = Hanapin sa Dokumento +pdfjs-findbar-button-label = Hanapin +pdfjs-additional-layers = Mga Karagdagang Layer + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Pahina { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Thumbnail ng Pahina { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Hanapin + .placeholder = Hanapin sa dokumento… +pdfjs-find-previous-button = + .title = Hanapin ang nakaraang pangyayari ng parirala +pdfjs-find-previous-button-label = Nakaraan +pdfjs-find-next-button = + .title = Hanapin ang susunod na pangyayari ng parirala +pdfjs-find-next-button-label = Susunod +pdfjs-find-highlight-checkbox = I-highlight lahat +pdfjs-find-match-case-checkbox-label = Itugma ang case +pdfjs-find-entire-word-checkbox-label = Buong salita +pdfjs-find-reached-top = Naabot na ang tuktok ng dokumento, ipinagpatuloy mula sa ilalim +pdfjs-find-reached-bottom = Naabot na ang dulo ng dokumento, ipinagpatuloy mula sa tuktok +pdfjs-find-not-found = Hindi natagpuan ang parirala + +## Predefined zoom values + +pdfjs-page-scale-width = Lapad ng Pahina +pdfjs-page-scale-fit = Pagkasyahin ang Pahina +pdfjs-page-scale-auto = Automatic Zoom +pdfjs-page-scale-actual = Totoong sukat +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + + +## Loading indicator messages + +pdfjs-loading-error = Nagkaproblema habang niloload ang PDF. +pdfjs-invalid-file-error = Di-wasto o sira ang PDF file. +pdfjs-missing-file-error = Nawawalang PDF file. +pdfjs-unexpected-response-error = Hindi inaasahang tugon ng server. +pdfjs-rendering-error = Nagkaproblema habang nirerender ang pahina. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } Annotation] + +## Password + +pdfjs-password-label = Ipasok ang password upang buksan ang PDF file na ito. +pdfjs-password-invalid = Maling password. Subukan uli. +pdfjs-password-ok-button = OK +pdfjs-password-cancel-button = Kanselahin +pdfjs-web-fonts-disabled = Naka-disable ang mga Web font: hindi kayang gamitin ang mga naka-embed na PDF font. + +## Editing + + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + diff --git a/public/pdfjs/web/locale/tr/viewer.ftl b/public/pdfjs/web/locale/tr/viewer.ftl new file mode 100644 index 0000000..b1b7cbf --- /dev/null +++ b/public/pdfjs/web/locale/tr/viewer.ftl @@ -0,0 +1,515 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Önceki sayfa +pdfjs-previous-button-label = Önceki +pdfjs-next-button = + .title = Sonraki sayfa +pdfjs-next-button-label = Sonraki +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Sayfa +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = / { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } / { $pagesCount }) +pdfjs-zoom-out-button = + .title = Uzaklaştır +pdfjs-zoom-out-button-label = Uzaklaştır +pdfjs-zoom-in-button = + .title = Yakınlaştır +pdfjs-zoom-in-button-label = Yakınlaştır +pdfjs-zoom-select = + .title = Yakınlaştırma +pdfjs-presentation-mode-button = + .title = Sunum moduna geç +pdfjs-presentation-mode-button-label = Sunum modu +pdfjs-open-file-button = + .title = Dosya aç +pdfjs-open-file-button-label = Aç +pdfjs-print-button = + .title = Yazdır +pdfjs-print-button-label = Yazdır +pdfjs-save-button = + .title = Kaydet +pdfjs-save-button-label = Kaydet +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = İndir +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = İndir +pdfjs-bookmark-button = + .title = Geçerli sayfa (geçerli sayfanın adresini görüntüle) +pdfjs-bookmark-button-label = Geçerli sayfa + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Araçlar +pdfjs-tools-button-label = Araçlar +pdfjs-first-page-button = + .title = İlk sayfaya git +pdfjs-first-page-button-label = İlk sayfaya git +pdfjs-last-page-button = + .title = Son sayfaya git +pdfjs-last-page-button-label = Son sayfaya git +pdfjs-page-rotate-cw-button = + .title = Saat yönünde döndür +pdfjs-page-rotate-cw-button-label = Saat yönünde döndür +pdfjs-page-rotate-ccw-button = + .title = Saat yönünün tersine döndür +pdfjs-page-rotate-ccw-button-label = Saat yönünün tersine döndür +pdfjs-cursor-text-select-tool-button = + .title = Metin seçme aracını etkinleştir +pdfjs-cursor-text-select-tool-button-label = Metin seçme aracı +pdfjs-cursor-hand-tool-button = + .title = El aracını etkinleştir +pdfjs-cursor-hand-tool-button-label = El aracı +pdfjs-scroll-page-button = + .title = Sayfa kaydırmayı kullan +pdfjs-scroll-page-button-label = Sayfa kaydırma +pdfjs-scroll-vertical-button = + .title = Dikey kaydırmayı kullan +pdfjs-scroll-vertical-button-label = Dikey kaydırma +pdfjs-scroll-horizontal-button = + .title = Yatay kaydırmayı kullan +pdfjs-scroll-horizontal-button-label = Yatay kaydırma +pdfjs-scroll-wrapped-button = + .title = Yan yana kaydırmayı kullan +pdfjs-scroll-wrapped-button-label = Yan yana kaydırma +pdfjs-spread-none-button = + .title = Yan yana sayfaları birleştirme +pdfjs-spread-none-button-label = Birleştirme +pdfjs-spread-odd-button = + .title = Yan yana sayfaları tek numaralı sayfalardan başlayarak birleştir +pdfjs-spread-odd-button-label = Tek numaralı +pdfjs-spread-even-button = + .title = Yan yana sayfaları çift numaralı sayfalardan başlayarak birleştir +pdfjs-spread-even-button-label = Çift numaralı + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Belge özellikleri… +pdfjs-document-properties-button-label = Belge özellikleri… +pdfjs-document-properties-file-name = Dosya adı: +pdfjs-document-properties-file-size = Dosya boyutu: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } bayt) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } bayt) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bayt) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bayt) +pdfjs-document-properties-title = Başlık: +pdfjs-document-properties-author = Yazar: +pdfjs-document-properties-subject = Konu: +pdfjs-document-properties-keywords = Anahtar kelimeler: +pdfjs-document-properties-creation-date = Oluşturma tarihi: +pdfjs-document-properties-modification-date = Değiştirme tarihi: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date } { $time } +pdfjs-document-properties-creator = Oluşturan: +pdfjs-document-properties-producer = PDF üreticisi: +pdfjs-document-properties-version = PDF sürümü: +pdfjs-document-properties-page-count = Sayfa sayısı: +pdfjs-document-properties-page-size = Sayfa boyutu: +pdfjs-document-properties-page-size-unit-inches = inç +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = dikey +pdfjs-document-properties-page-size-orientation-landscape = yatay +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Letter +pdfjs-document-properties-page-size-name-legal = Legal + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Hızlı web görünümü: +pdfjs-document-properties-linearized-yes = Evet +pdfjs-document-properties-linearized-no = Hayır +pdfjs-document-properties-close-button = Kapat + +## Print + +pdfjs-print-progress-message = Belge yazdırılmaya hazırlanıyor… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = %{ $progress } +pdfjs-print-progress-close-button = İptal +pdfjs-printing-not-supported = Uyarı: Yazdırma bu tarayıcı tarafından tam olarak desteklenmemektedir. +pdfjs-printing-not-ready = Uyarı: PDF tamamen yüklenmedi ve yazdırmaya hazır değil. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Kenar çubuğunu aç/kapat +pdfjs-toggle-sidebar-notification-button = + .title = Kenar çubuğunu aç/kapat (Belge ana hat/ekler/katmanlar içeriyor) +pdfjs-toggle-sidebar-button-label = Kenar çubuğunu aç/kapat +pdfjs-document-outline-button = + .title = Belge ana hatlarını göster (Tüm öğeleri genişletmek/daraltmak için çift tıklayın) +pdfjs-document-outline-button-label = Belge ana hatları +pdfjs-attachments-button = + .title = Ekleri göster +pdfjs-attachments-button-label = Ekler +pdfjs-layers-button = + .title = Katmanları göster (tüm katmanları varsayılan duruma sıfırlamak için çift tıklayın) +pdfjs-layers-button-label = Katmanlar +pdfjs-thumbs-button = + .title = Küçük resimleri göster +pdfjs-thumbs-button-label = Küçük resimler +pdfjs-current-outline-item-button = + .title = Mevcut ana hat öğesini bul +pdfjs-current-outline-item-button-label = Mevcut ana hat öğesi +pdfjs-findbar-button = + .title = Belgede bul +pdfjs-findbar-button-label = Bul +pdfjs-additional-layers = Ek katmanlar + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Sayfa { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = { $page }. sayfanın küçük hâli + +## Find panel button title and messages + +pdfjs-find-input = + .title = Bul + .placeholder = Belgede bul… +pdfjs-find-previous-button = + .title = Önceki eşleşmeyi bul +pdfjs-find-previous-button-label = Önceki +pdfjs-find-next-button = + .title = Sonraki eşleşmeyi bul +pdfjs-find-next-button-label = Sonraki +pdfjs-find-highlight-checkbox = Tümünü vurgula +pdfjs-find-match-case-checkbox-label = Büyük-küçük harfe duyarlı +pdfjs-find-match-diacritics-checkbox-label = Fonetik işaretleri bul +pdfjs-find-entire-word-checkbox-label = Tam sözcükler +pdfjs-find-reached-top = Belgenin başına ulaşıldı, sonundan devam edildi +pdfjs-find-reached-bottom = Belgenin sonuna ulaşıldı, başından devam edildi +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] { $total } eşleşmeden { $current }. eşleşme + *[other] { $total } eşleşmeden { $current }. eşleşme + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] { $limit } eşleşmeden fazla + *[other] { $limit } eşleşmeden fazla + } +pdfjs-find-not-found = Eşleşme bulunamadı + +## Predefined zoom values + +pdfjs-page-scale-width = Sayfa genişliği +pdfjs-page-scale-fit = Sayfayı sığdır +pdfjs-page-scale-auto = Otomatik yakınlaştır +pdfjs-page-scale-actual = Gerçek boyut +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = %{ $scale } + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Sayfa { $page } + +## Loading indicator messages + +pdfjs-loading-error = PDF yüklenirken bir hata oluştu. +pdfjs-invalid-file-error = Geçersiz veya bozulmuş PDF dosyası. +pdfjs-missing-file-error = PDF dosyası eksik. +pdfjs-unexpected-response-error = Beklenmeyen sunucu yanıtı. +pdfjs-rendering-error = Sayfa yorumlanırken bir hata oluştu. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date } { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } işareti] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Bu PDF dosyasını açmak için parolasını yazın. +pdfjs-password-invalid = Geçersiz parola. Lütfen yeniden deneyin. +pdfjs-password-ok-button = Tamam +pdfjs-password-cancel-button = İptal +pdfjs-web-fonts-disabled = Web fontları devre dışı: Gömülü PDF fontları kullanılamıyor. + +## Editing + +pdfjs-editor-free-text-button = + .title = Metin +pdfjs-editor-free-text-button-label = Metin +pdfjs-editor-ink-button = + .title = Çiz +pdfjs-editor-ink-button-label = Çiz +pdfjs-editor-stamp-button = + .title = Resim ekle veya düzenle +pdfjs-editor-stamp-button-label = Resim ekle veya düzenle +pdfjs-editor-highlight-button = + .title = Vurgula +pdfjs-editor-highlight-button-label = Vurgula +pdfjs-highlight-floating-button1 = + .title = Vurgula + .aria-label = Vurgula +pdfjs-highlight-floating-button-label = Vurgula + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Çizimi kaldır +pdfjs-editor-remove-freetext-button = + .title = Metni kaldır +pdfjs-editor-remove-stamp-button = + .title = Resmi kaldır +pdfjs-editor-remove-highlight-button = + .title = Vurgulamayı kaldır + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Renk +pdfjs-editor-free-text-size-input = Boyut +pdfjs-editor-ink-color-input = Renk +pdfjs-editor-ink-thickness-input = Kalınlık +pdfjs-editor-ink-opacity-input = Saydamlık +pdfjs-editor-stamp-add-image-button = + .title = Resim ekle +pdfjs-editor-stamp-add-image-button-label = Resim ekle +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Kalınlık +pdfjs-editor-free-highlight-thickness-title = + .title = Metin dışındaki öğeleri vurgularken kalınlığı değiştir +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = Metin düzenleyicisi + .default-content = Yazmaya başlayın… +pdfjs-free-text = + .aria-label = Metin düzenleyicisi +pdfjs-free-text-default-content = Yazmaya başlayın… +pdfjs-ink = + .aria-label = Çizim düzenleyicisi +pdfjs-ink-canvas = + .aria-label = Kullanıcı tarafından oluşturulan resim + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = Alternatif metin +pdfjs-editor-alt-text-edit-button = + .aria-label = Alternatif metni düzenle +pdfjs-editor-alt-text-edit-button-label = Alternatif metni düzenle +pdfjs-editor-alt-text-dialog-label = Bir seçenek seçin +pdfjs-editor-alt-text-dialog-description = Alternatif metin, insanlar resmi göremediğinde veya resim yüklenmediğinde işe yarar. +pdfjs-editor-alt-text-add-description-label = Açıklama ekle +pdfjs-editor-alt-text-add-description-description = Konuyu, ortamı veya eylemleri tanımlayan bir iki cümle yazmaya çalışın. +pdfjs-editor-alt-text-mark-decorative-label = Dekoratif olarak işaretle +pdfjs-editor-alt-text-mark-decorative-description = Kenarlıklar veya filigranlar gibi dekoratif resimler için kullanılır. +pdfjs-editor-alt-text-cancel-button = Vazgeç +pdfjs-editor-alt-text-save-button = Kaydet +pdfjs-editor-alt-text-decorative-tooltip = Dekoratif olarak işaretlendi +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = Örneğin, “Genç bir adam yemek yemek için masaya oturuyor” +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = Alternatif metin + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Sol üst köşe — yeniden boyutlandır +pdfjs-editor-resizer-label-top-middle = Üst orta — yeniden boyutlandır +pdfjs-editor-resizer-label-top-right = Sağ üst köşe — yeniden boyutlandır +pdfjs-editor-resizer-label-middle-right = Orta sağ — yeniden boyutlandır +pdfjs-editor-resizer-label-bottom-right = Sağ alt köşe — yeniden boyutlandır +pdfjs-editor-resizer-label-bottom-middle = Alt orta — yeniden boyutlandır +pdfjs-editor-resizer-label-bottom-left = Sol alt köşe — yeniden boyutlandır +pdfjs-editor-resizer-label-middle-left = Orta sol — yeniden boyutlandır +pdfjs-editor-resizer-top-left = + .aria-label = Sol üst köşe — yeniden boyutlandır +pdfjs-editor-resizer-top-middle = + .aria-label = Üst orta — yeniden boyutlandır +pdfjs-editor-resizer-top-right = + .aria-label = Sağ üst köşe — yeniden boyutlandır +pdfjs-editor-resizer-middle-right = + .aria-label = Orta sağ — yeniden boyutlandır +pdfjs-editor-resizer-bottom-right = + .aria-label = Sağ alt köşe — yeniden boyutlandır +pdfjs-editor-resizer-bottom-middle = + .aria-label = Alt orta — yeniden boyutlandır +pdfjs-editor-resizer-bottom-left = + .aria-label = Sol alt köşe — yeniden boyutlandır +pdfjs-editor-resizer-middle-left = + .aria-label = Orta sol — yeniden boyutlandır + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Vurgu rengi +pdfjs-editor-colorpicker-button = + .title = Rengi değiştir +pdfjs-editor-colorpicker-dropdown = + .aria-label = Renk seçenekleri +pdfjs-editor-colorpicker-yellow = + .title = Sarı +pdfjs-editor-colorpicker-green = + .title = Yeşil +pdfjs-editor-colorpicker-blue = + .title = Mavi +pdfjs-editor-colorpicker-pink = + .title = Pembe +pdfjs-editor-colorpicker-red = + .title = Kırmızı + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Tümünü göster +pdfjs-editor-highlight-show-all-button = + .title = Tümünü göster + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = Alt metni düzenle (resim açıklaması) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = Alt metin ekle (resim açıklaması) +pdfjs-editor-new-alt-text-textarea = + .placeholder = Açıklamanızı buraya yazın… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = Görme engelli kişilere gösterilecek veya resmin yüklenemediği durumlarda gösterilecek kısa açıklama. +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = Bu alt metin otomatik olarak oluşturulmuştur ve hatalı olabilir. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Daha fazla bilgi alın +pdfjs-editor-new-alt-text-create-automatically-button-label = Otomatik olarak alt metin oluştur +pdfjs-editor-new-alt-text-not-now-button = Şimdi değil +pdfjs-editor-new-alt-text-error-title = Alt metin otomatik olarak oluşturulamadı +pdfjs-editor-new-alt-text-error-description = Lütfen kendi alt metninizi yazın veya daha sonra yeniden deneyin. +pdfjs-editor-new-alt-text-error-close-button = Kapat +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = Alt metin yapay zekâ modeli indiriliyor ({ $downloadedSize } / { $totalSize } MB) + .aria-valuetext = Alt metin yapay zekâ modeli indiriliyor ({ $downloadedSize } / { $totalSize } MB) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = Alternatif metin eklendi +pdfjs-editor-new-alt-text-added-button-label = Alt metin eklendi +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = Alternatif metin eksik +pdfjs-editor-new-alt-text-missing-button-label = Alt metin eksik +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = Alternatif metni incele +pdfjs-editor-new-alt-text-to-review-button-label = Alt metni incele +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Otomatik olarak oluşturuldu: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = Resim alt metni ayarları +pdfjs-image-alt-text-settings-button-label = Resim alt metni ayarları +pdfjs-editor-alt-text-settings-dialog-label = Resim alt metni ayarları +pdfjs-editor-alt-text-settings-automatic-title = Otomatik alt metin +pdfjs-editor-alt-text-settings-create-model-button-label = Otomatik olarak alt metin oluştur +pdfjs-editor-alt-text-settings-create-model-description = Görme engelli kişilere gösterilecek veya resmin yüklenemediği durumlarda gösterilecek açıklamalar önerir. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = Alt metin yapay zekâ modeli ({ $totalSize } MB) +pdfjs-editor-alt-text-settings-ai-model-description = Verilerinizin gizli kalması için cihazınızda yerel olarak çalışır. Otomatik alt metin için gereklidir. +pdfjs-editor-alt-text-settings-delete-model-button = Sil +pdfjs-editor-alt-text-settings-download-model-button = İndir +pdfjs-editor-alt-text-settings-downloading-model-button = İndiriliyor… +pdfjs-editor-alt-text-settings-editor-title = Alt metin düzenleyicisi +pdfjs-editor-alt-text-settings-show-dialog-button-label = Resim eklerken alt metin düzenleyicisini hemen göster +pdfjs-editor-alt-text-settings-show-dialog-description = Tüm resimlerinizin alt metne sahip olduğundan emin olmanızı sağlar. +pdfjs-editor-alt-text-settings-close-button = Kapat + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = Vurgulama silindi +pdfjs-editor-undo-bar-message-freetext = Metin silindi +pdfjs-editor-undo-bar-message-ink = Çizim silindi +pdfjs-editor-undo-bar-message-stamp = Görsel silindi +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = + { $count -> + [one] { $count } ek açıklama silindi + *[other] { $count } ek açıklama silindi + } +pdfjs-editor-undo-bar-undo-button = + .title = Geri al +pdfjs-editor-undo-bar-undo-button-label = Geri al +pdfjs-editor-undo-bar-close-button = + .title = Kapat +pdfjs-editor-undo-bar-close-button-label = Kapat diff --git a/public/pdfjs/web/locale/trs/viewer.ftl b/public/pdfjs/web/locale/trs/viewer.ftl new file mode 100644 index 0000000..aba3c72 --- /dev/null +++ b/public/pdfjs/web/locale/trs/viewer.ftl @@ -0,0 +1,197 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Pajinâ gunâj rukùu +pdfjs-previous-button-label = Sa gachin +pdfjs-next-button = + .title = Pajinâ 'na' ñaan +pdfjs-next-button-label = Ne' ñaan +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Ñanj +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = si'iaj { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } of { $pagesCount }) +pdfjs-zoom-out-button = + .title = Nagi'iaj li' +pdfjs-zoom-out-button-label = Nagi'iaj li' +pdfjs-zoom-in-button = + .title = Nagi'iaj niko' +pdfjs-zoom-in-button-label = Nagi'iaj niko' +pdfjs-zoom-select = + .title = dàj nìko ma'an +pdfjs-presentation-mode-button = + .title = Naduno' daj ga ma +pdfjs-presentation-mode-button-label = Daj gà ma +pdfjs-open-file-button = + .title = Na'nïn' chrû ñanj +pdfjs-open-file-button-label = Na'nïn +pdfjs-print-button = + .title = Nari' ña du'ua +pdfjs-print-button-label = Nari' ñadu'ua + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Rasun +pdfjs-tools-button-label = Nej rasùun +pdfjs-first-page-button = + .title = gun' riña pajina asiniin +pdfjs-first-page-button-label = Gun' riña pajina asiniin +pdfjs-last-page-button = + .title = Gun' riña pajina rukù ni'in +pdfjs-last-page-button-label = Gun' riña pajina rukù ni'inj +pdfjs-page-rotate-cw-button = + .title = Tanikaj ne' huat +pdfjs-page-rotate-cw-button-label = Tanikaj ne' huat +pdfjs-page-rotate-ccw-button = + .title = Tanikaj ne' chînt' +pdfjs-page-rotate-ccw-button-label = Tanikaj ne' chint +pdfjs-cursor-text-select-tool-button = + .title = Dugi'iaj sun' sa ganahui texto +pdfjs-cursor-text-select-tool-button-label = Nej rasun arajsun' da' nahui' texto +pdfjs-cursor-hand-tool-button = + .title = Nachrun' nej rasun +pdfjs-cursor-hand-tool-button-label = Sa rajsun ro'o' +pdfjs-scroll-vertical-button = + .title = Garasun' dukuán runūu +pdfjs-scroll-vertical-button-label = Dukuán runūu +pdfjs-scroll-horizontal-button = + .title = Garasun' dukuán nikin' nahui +pdfjs-scroll-horizontal-button-label = Dukuán nikin' nahui +pdfjs-scroll-wrapped-button = + .title = Garasun' sa nachree +pdfjs-scroll-wrapped-button-label = Sa nachree +pdfjs-spread-none-button = + .title = Si nagi'iaj nugun'un' nej pagina hua ninin +pdfjs-spread-none-button-label = Ni'io daj hua pagina +pdfjs-spread-odd-button = + .title = Nagi'iaj nugua'ant nej pajina +pdfjs-spread-odd-button-label = Ni'io' daj hua libro gurin +pdfjs-spread-even-button = + .title = Nakāj dugui' ngà nej pajinâ ayi'ì ngà da' hùi hùi +pdfjs-spread-even-button-label = Nahuin nìko nej + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Nej sa nikāj ñanj… +pdfjs-document-properties-button-label = Nej sa nikāj ñanj… +pdfjs-document-properties-file-name = Si yugui archîbo: +pdfjs-document-properties-file-size = Dàj yachìj archîbo: +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bytes) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bytes) +pdfjs-document-properties-title = Si yugui: +pdfjs-document-properties-author = Sí girirà: +pdfjs-document-properties-subject = Dugui': +pdfjs-document-properties-keywords = Nej nuguan' huìi: +pdfjs-document-properties-creation-date = Gui gurugui' man: +pdfjs-document-properties-modification-date = Nuguan' nahuin nakà: +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Guiri ro' +pdfjs-document-properties-producer = Sa ri PDF: +pdfjs-document-properties-version = PDF Version: +pdfjs-document-properties-page-count = Si Guendâ Pâjina: +pdfjs-document-properties-page-size = Dàj yachìj pâjina: +pdfjs-document-properties-page-size-unit-inches = riña +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = nadu'ua +pdfjs-document-properties-page-size-orientation-landscape = dàj huaj +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Da'ngà'a +pdfjs-document-properties-page-size-name-legal = Nuguan' a'nï'ïn + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Nanèt chre ni'iajt riña Web: +pdfjs-document-properties-linearized-yes = Ga'ue +pdfjs-document-properties-linearized-no = Si ga'ue +pdfjs-document-properties-close-button = Narán + +## Print + +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Duyichin' + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Nadunā barrâ nù yi'nïn +pdfjs-toggle-sidebar-button-label = Nadunā barrâ nù yi'nïn +pdfjs-findbar-button-label = Narì' + +## Thumbnails panel item (tooltip and alt text for images) + + +## Find panel button title and messages + +pdfjs-find-previous-button-label = Sa gachîn +pdfjs-find-next-button-label = Ne' ñaan +pdfjs-find-highlight-checkbox = Daran' sa ña'an +pdfjs-find-match-case-checkbox-label = Match case +pdfjs-find-not-found = Nu narì'ij nugua'anj + +## Predefined zoom values + +pdfjs-page-scale-actual = Dàj yàchi akuan' nín +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + + +## Loading indicator messages + + +## Annotations + + +## Password + +pdfjs-password-ok-button = Ga'ue +pdfjs-password-cancel-button = Duyichin' + +## Editing + + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + diff --git a/public/pdfjs/web/locale/uk/viewer.ftl b/public/pdfjs/web/locale/uk/viewer.ftl new file mode 100644 index 0000000..dd54727 --- /dev/null +++ b/public/pdfjs/web/locale/uk/viewer.ftl @@ -0,0 +1,518 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Попередня сторінка +pdfjs-previous-button-label = Попередня +pdfjs-next-button = + .title = Наступна сторінка +pdfjs-next-button-label = Наступна +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Сторінка +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = із { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } із { $pagesCount }) +pdfjs-zoom-out-button = + .title = Зменшити +pdfjs-zoom-out-button-label = Зменшити +pdfjs-zoom-in-button = + .title = Збільшити +pdfjs-zoom-in-button-label = Збільшити +pdfjs-zoom-select = + .title = Масштаб +pdfjs-presentation-mode-button = + .title = Перейти в режим презентації +pdfjs-presentation-mode-button-label = Режим презентації +pdfjs-open-file-button = + .title = Відкрити файл +pdfjs-open-file-button-label = Відкрити +pdfjs-print-button = + .title = Друк +pdfjs-print-button-label = Друк +pdfjs-save-button = + .title = Зберегти +pdfjs-save-button-label = Зберегти +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Завантажити +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Завантажити +pdfjs-bookmark-button = + .title = Поточна сторінка (перегляд URL-адреси з поточної сторінки) +pdfjs-bookmark-button-label = Поточна сторінка + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Інструменти +pdfjs-tools-button-label = Інструменти +pdfjs-first-page-button = + .title = На першу сторінку +pdfjs-first-page-button-label = На першу сторінку +pdfjs-last-page-button = + .title = На останню сторінку +pdfjs-last-page-button-label = На останню сторінку +pdfjs-page-rotate-cw-button = + .title = Повернути за годинниковою стрілкою +pdfjs-page-rotate-cw-button-label = Повернути за годинниковою стрілкою +pdfjs-page-rotate-ccw-button = + .title = Повернути проти годинникової стрілки +pdfjs-page-rotate-ccw-button-label = Повернути проти годинникової стрілки +pdfjs-cursor-text-select-tool-button = + .title = Увімкнути інструмент вибору тексту +pdfjs-cursor-text-select-tool-button-label = Інструмент вибору тексту +pdfjs-cursor-hand-tool-button = + .title = Увімкнути інструмент "Рука" +pdfjs-cursor-hand-tool-button-label = Інструмент "Рука" +pdfjs-scroll-page-button = + .title = Використовувати прокручування сторінки +pdfjs-scroll-page-button-label = Прокручування сторінки +pdfjs-scroll-vertical-button = + .title = Використовувати вертикальне прокручування +pdfjs-scroll-vertical-button-label = Вертикальне прокручування +pdfjs-scroll-horizontal-button = + .title = Використовувати горизонтальне прокручування +pdfjs-scroll-horizontal-button-label = Горизонтальне прокручування +pdfjs-scroll-wrapped-button = + .title = Використовувати масштабоване прокручування +pdfjs-scroll-wrapped-button-label = Масштабоване прокручування +pdfjs-spread-none-button = + .title = Не використовувати розгорнуті сторінки +pdfjs-spread-none-button-label = Без розгорнутих сторінок +pdfjs-spread-odd-button = + .title = Розгорнуті сторінки починаються з непарних номерів +pdfjs-spread-odd-button-label = Непарні сторінки зліва +pdfjs-spread-even-button = + .title = Розгорнуті сторінки починаються з парних номерів +pdfjs-spread-even-button-label = Парні сторінки зліва + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Властивості документа… +pdfjs-document-properties-button-label = Властивості документа… +pdfjs-document-properties-file-name = Назва файлу: +pdfjs-document-properties-file-size = Розмір файлу: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } кБ ({ $b } байтів) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } МБ ({ $b } байтів) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } кБ ({ $size_b } байтів) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } МБ ({ $size_b } байтів) +pdfjs-document-properties-title = Заголовок: +pdfjs-document-properties-author = Автор: +pdfjs-document-properties-subject = Тема: +pdfjs-document-properties-keywords = Ключові слова: +pdfjs-document-properties-creation-date = Дата створення: +pdfjs-document-properties-modification-date = Дата зміни: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Створено: +pdfjs-document-properties-producer = Виробник PDF: +pdfjs-document-properties-version = Версія PDF: +pdfjs-document-properties-page-count = Кількість сторінок: +pdfjs-document-properties-page-size = Розмір сторінки: +pdfjs-document-properties-page-size-unit-inches = дюймів +pdfjs-document-properties-page-size-unit-millimeters = мм +pdfjs-document-properties-page-size-orientation-portrait = книжкова +pdfjs-document-properties-page-size-orientation-landscape = альбомна +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Letter +pdfjs-document-properties-page-size-name-legal = Legal + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Швидкий перегляд в Інтернеті: +pdfjs-document-properties-linearized-yes = Так +pdfjs-document-properties-linearized-no = Ні +pdfjs-document-properties-close-button = Закрити + +## Print + +pdfjs-print-progress-message = Підготовка документу до друку… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Скасувати +pdfjs-printing-not-supported = Попередження: Цей браузер не повністю підтримує друк. +pdfjs-printing-not-ready = Попередження: PDF не повністю завантажений для друку. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Бічна панель +pdfjs-toggle-sidebar-notification-button = + .title = Перемкнути бічну панель (документ містить ескіз/вкладення/шари) +pdfjs-toggle-sidebar-button-label = Перемкнути бічну панель +pdfjs-document-outline-button = + .title = Показати схему документу (подвійний клік для розгортання/згортання елементів) +pdfjs-document-outline-button-label = Схема документа +pdfjs-attachments-button = + .title = Показати вкладення +pdfjs-attachments-button-label = Вкладення +pdfjs-layers-button = + .title = Показати шари (двічі клацніть, щоб скинути всі шари до типового стану) +pdfjs-layers-button-label = Шари +pdfjs-thumbs-button = + .title = Показати мініатюри +pdfjs-thumbs-button-label = Мініатюри +pdfjs-current-outline-item-button = + .title = Знайти поточний елемент змісту +pdfjs-current-outline-item-button-label = Поточний елемент змісту +pdfjs-findbar-button = + .title = Знайти в документі +pdfjs-findbar-button-label = Знайти +pdfjs-additional-layers = Додаткові шари + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Сторінка { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Ескіз сторінки { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Знайти + .placeholder = Знайти в документі… +pdfjs-find-previous-button = + .title = Знайти попереднє входження фрази +pdfjs-find-previous-button-label = Попереднє +pdfjs-find-next-button = + .title = Знайти наступне входження фрази +pdfjs-find-next-button-label = Наступне +pdfjs-find-highlight-checkbox = Підсвітити все +pdfjs-find-match-case-checkbox-label = З урахуванням регістру +pdfjs-find-match-diacritics-checkbox-label = Відповідність діакритичних знаків +pdfjs-find-entire-word-checkbox-label = Цілі слова +pdfjs-find-reached-top = Досягнуто початку документу, продовжено з кінця +pdfjs-find-reached-bottom = Досягнуто кінця документу, продовжено з початку +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = + { $total -> + [one] { $current } збіг з { $total } + [few] { $current } збіги з { $total } + *[many] { $current } збігів з { $total } + } +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = + { $limit -> + [one] Понад { $limit } збіг + [few] Понад { $limit } збіги + *[many] Понад { $limit } збігів + } +pdfjs-find-not-found = Фразу не знайдено + +## Predefined zoom values + +pdfjs-page-scale-width = За шириною +pdfjs-page-scale-fit = Вмістити +pdfjs-page-scale-auto = Автомасштаб +pdfjs-page-scale-actual = Дійсний розмір +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Сторінка { $page } + +## Loading indicator messages + +pdfjs-loading-error = Під час завантаження PDF сталася помилка. +pdfjs-invalid-file-error = Недійсний або пошкоджений PDF-файл. +pdfjs-missing-file-error = Відсутній PDF-файл. +pdfjs-unexpected-response-error = Неочікувана відповідь сервера. +pdfjs-rendering-error = Під час виведення сторінки сталася помилка. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type }-анотація] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Введіть пароль для відкриття цього PDF-файлу. +pdfjs-password-invalid = Неправильний пароль. Спробуйте ще раз. +pdfjs-password-ok-button = OK +pdfjs-password-cancel-button = Скасувати +pdfjs-web-fonts-disabled = Вебшрифти вимкнено: неможливо використати вбудовані у PDF шрифти. + +## Editing + +pdfjs-editor-free-text-button = + .title = Текст +pdfjs-editor-free-text-button-label = Текст +pdfjs-editor-ink-button = + .title = Малювати +pdfjs-editor-ink-button-label = Малювати +pdfjs-editor-stamp-button = + .title = Додати чи редагувати зображення +pdfjs-editor-stamp-button-label = Додати чи редагувати зображення +pdfjs-editor-highlight-button = + .title = Підсвітити +pdfjs-editor-highlight-button-label = Підсвітити +pdfjs-highlight-floating-button1 = + .title = Підсвітити + .aria-label = Підсвітити +pdfjs-highlight-floating-button-label = Підсвітити + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Вилучити малюнок +pdfjs-editor-remove-freetext-button = + .title = Вилучити текст +pdfjs-editor-remove-stamp-button = + .title = Вилучити зображення +pdfjs-editor-remove-highlight-button = + .title = Вилучити підсвічування + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Колір +pdfjs-editor-free-text-size-input = Розмір +pdfjs-editor-ink-color-input = Колір +pdfjs-editor-ink-thickness-input = Товщина +pdfjs-editor-ink-opacity-input = Прозорість +pdfjs-editor-stamp-add-image-button = + .title = Додати зображення +pdfjs-editor-stamp-add-image-button-label = Додати зображення +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Товщина +pdfjs-editor-free-highlight-thickness-title = + .title = Змінюйте товщину під час підсвічування елементів, крім тексту +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = Текстовий редактор + .default-content = Напишіть щось… +pdfjs-free-text = + .aria-label = Текстовий редактор +pdfjs-free-text-default-content = Почніть вводити… +pdfjs-ink = + .aria-label = Графічний редактор +pdfjs-ink-canvas = + .aria-label = Зображення, створене користувачем + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = Альтернативний текст +pdfjs-editor-alt-text-edit-button = + .aria-label = Редагувати альтернативний текст +pdfjs-editor-alt-text-edit-button-label = Змінити альтернативний текст +pdfjs-editor-alt-text-dialog-label = Вибрати варіант +pdfjs-editor-alt-text-dialog-description = Альтернативний текст допомагає, коли зображення не видно або коли воно не завантажується. +pdfjs-editor-alt-text-add-description-label = Додати опис +pdfjs-editor-alt-text-add-description-description = Намагайтеся створити 1-2 речення, які описують тему, обставини або дії. +pdfjs-editor-alt-text-mark-decorative-label = Позначити декоративним +pdfjs-editor-alt-text-mark-decorative-description = Використовується для декоративних зображень, наприклад рамок або водяних знаків. +pdfjs-editor-alt-text-cancel-button = Скасувати +pdfjs-editor-alt-text-save-button = Зберегти +pdfjs-editor-alt-text-decorative-tooltip = Позначено декоративним +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = Наприклад, “Молодий чоловік сідає за стіл їсти” +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = Альтернативний текст + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Верхній лівий кут – зміна розміру +pdfjs-editor-resizer-label-top-middle = Вгорі посередині – зміна розміру +pdfjs-editor-resizer-label-top-right = Верхній правий кут – зміна розміру +pdfjs-editor-resizer-label-middle-right = Праворуч посередині – зміна розміру +pdfjs-editor-resizer-label-bottom-right = Нижній правий кут – зміна розміру +pdfjs-editor-resizer-label-bottom-middle = Внизу посередині – зміна розміру +pdfjs-editor-resizer-label-bottom-left = Нижній лівий кут – зміна розміру +pdfjs-editor-resizer-label-middle-left = Ліворуч посередині – зміна розміру +pdfjs-editor-resizer-top-left = + .aria-label = Верхній лівий кут – зміна розміру +pdfjs-editor-resizer-top-middle = + .aria-label = Вгорі посередині – зміна розміру +pdfjs-editor-resizer-top-right = + .aria-label = Верхній правий кут – зміна розміру +pdfjs-editor-resizer-middle-right = + .aria-label = Праворуч посередині – зміна розміру +pdfjs-editor-resizer-bottom-right = + .aria-label = Нижній правий кут – зміна розміру +pdfjs-editor-resizer-bottom-middle = + .aria-label = Внизу посередині – зміна розміру +pdfjs-editor-resizer-bottom-left = + .aria-label = Нижній лівий кут – зміна розміру +pdfjs-editor-resizer-middle-left = + .aria-label = Ліворуч посередині – зміна розміру + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Колір підсвічування +pdfjs-editor-colorpicker-button = + .title = Змінити колір +pdfjs-editor-colorpicker-dropdown = + .aria-label = Вибір кольору +pdfjs-editor-colorpicker-yellow = + .title = Жовтий +pdfjs-editor-colorpicker-green = + .title = Зелений +pdfjs-editor-colorpicker-blue = + .title = Блакитний +pdfjs-editor-colorpicker-pink = + .title = Рожевий +pdfjs-editor-colorpicker-red = + .title = Червоний + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Показати все +pdfjs-editor-highlight-show-all-button = + .title = Показати все + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = Редагувати альтернативний текст (опис зображення) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = Додати альтернативний текст (опис зображення) +pdfjs-editor-new-alt-text-textarea = + .placeholder = Напишіть свій опис тут… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = Короткий опис для людей, які не бачать зображення, або якщо зображення не завантажується. +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = Цей альтернативний текст створено автоматично, тому він може бути неточним. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Докладніше +pdfjs-editor-new-alt-text-create-automatically-button-label = Автоматично створювати альтернативний текст +pdfjs-editor-new-alt-text-not-now-button = Не зараз +pdfjs-editor-new-alt-text-error-title = Не вдалося автоматично створити альтернативний текст +pdfjs-editor-new-alt-text-error-description = Напишіть власний альтернативний текст або повторіть спробу пізніше. +pdfjs-editor-new-alt-text-error-close-button = Закрити +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = Завантаження моделі ШІ для альтернативного тексту ({ $downloadedSize } з { $totalSize } МБ) + .aria-valuetext = Завантаження моделі ШІ для альтернативного тексту ({ $downloadedSize } з { $totalSize } МБ) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = Альтернативний текст додано +pdfjs-editor-new-alt-text-added-button-label = Альтернативний текст додано +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = Відсутній альтернативний текст +pdfjs-editor-new-alt-text-missing-button-label = Відсутній альтернативний текст +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = Переглянути альтернативний текст +pdfjs-editor-new-alt-text-to-review-button-label = Переглянути альтернативний текст +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Створено автоматично: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = Налаштування альтернативного тексту зображення +pdfjs-image-alt-text-settings-button-label = Налаштування альтернативного тексту зображення +pdfjs-editor-alt-text-settings-dialog-label = Налаштування альтернативного тексту зображення +pdfjs-editor-alt-text-settings-automatic-title = Автоматичний альтернативний текст +pdfjs-editor-alt-text-settings-create-model-button-label = Автоматично створювати альтернативний текст +pdfjs-editor-alt-text-settings-create-model-description = Пропонує описи, щоб допомогти людям, які не бачать зображення, або якщо зображення не завантажується. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = Модель ШІ для альтернативного тексту ({ $totalSize } МБ) +pdfjs-editor-alt-text-settings-ai-model-description = Працює локально на вашому пристрої, тому приватність ваших даних захищена. Призначена для автоматичного створення альтернативного тексту. +pdfjs-editor-alt-text-settings-delete-model-button = Видалити +pdfjs-editor-alt-text-settings-download-model-button = Завантажити +pdfjs-editor-alt-text-settings-downloading-model-button = Завантаження… +pdfjs-editor-alt-text-settings-editor-title = Редактор альтернативного тексту +pdfjs-editor-alt-text-settings-show-dialog-button-label = Показувати редактор альтернативного тексту під час додавання зображення +pdfjs-editor-alt-text-settings-show-dialog-description = Допомагає переконатися, що всі ваші зображення мають альтернативний текст. +pdfjs-editor-alt-text-settings-close-button = Закрити + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = Підсвічення вилучено +pdfjs-editor-undo-bar-message-freetext = Текст вилучено +pdfjs-editor-undo-bar-message-ink = Малюнок вилучено +pdfjs-editor-undo-bar-message-stamp = Зображення вилучено +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = + { $count -> + [one] { $count } анотацію вилучено + [few] { $count } анотації вилучено + *[many] { $count } анотацій вилучено + } +pdfjs-editor-undo-bar-undo-button = + .title = Повернути +pdfjs-editor-undo-bar-undo-button-label = Повернути +pdfjs-editor-undo-bar-close-button = + .title = Закрити +pdfjs-editor-undo-bar-close-button-label = Закрити diff --git a/public/pdfjs/web/locale/ur/viewer.ftl b/public/pdfjs/web/locale/ur/viewer.ftl new file mode 100644 index 0000000..c15f157 --- /dev/null +++ b/public/pdfjs/web/locale/ur/viewer.ftl @@ -0,0 +1,248 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = پچھلا صفحہ +pdfjs-previous-button-label = پچھلا +pdfjs-next-button = + .title = اگلا صفحہ +pdfjs-next-button-label = آگے +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = صفحہ +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = { $pagesCount } کا +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } کا { $pagesCount }) +pdfjs-zoom-out-button = + .title = باہر زوم کریں +pdfjs-zoom-out-button-label = باہر زوم کریں +pdfjs-zoom-in-button = + .title = اندر زوم کریں +pdfjs-zoom-in-button-label = اندر زوم کریں +pdfjs-zoom-select = + .title = زوم +pdfjs-presentation-mode-button = + .title = پیشکش موڈ میں چلے جائیں +pdfjs-presentation-mode-button-label = پیشکش موڈ +pdfjs-open-file-button = + .title = مسل کھولیں +pdfjs-open-file-button-label = کھولیں +pdfjs-print-button = + .title = چھاپیں +pdfjs-print-button-label = چھاپیں + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = آلات +pdfjs-tools-button-label = آلات +pdfjs-first-page-button = + .title = پہلے صفحہ پر جائیں +pdfjs-first-page-button-label = پہلے صفحہ پر جائیں +pdfjs-last-page-button = + .title = آخری صفحہ پر جائیں +pdfjs-last-page-button-label = آخری صفحہ پر جائیں +pdfjs-page-rotate-cw-button = + .title = گھڑی وار گھمائیں +pdfjs-page-rotate-cw-button-label = گھڑی وار گھمائیں +pdfjs-page-rotate-ccw-button = + .title = ضد گھڑی وار گھمائیں +pdfjs-page-rotate-ccw-button-label = ضد گھڑی وار گھمائیں +pdfjs-cursor-text-select-tool-button = + .title = متن کے انتخاب کے ٹول کو فعال بناے +pdfjs-cursor-text-select-tool-button-label = متن کے انتخاب کا آلہ +pdfjs-cursor-hand-tool-button = + .title = ہینڈ ٹول کو فعال بناییں +pdfjs-cursor-hand-tool-button-label = ہاتھ کا آلہ +pdfjs-scroll-vertical-button = + .title = عمودی اسکرولنگ کا استعمال کریں +pdfjs-scroll-vertical-button-label = عمودی اسکرولنگ +pdfjs-scroll-horizontal-button = + .title = افقی سکرولنگ کا استعمال کریں +pdfjs-scroll-horizontal-button-label = افقی سکرولنگ +pdfjs-spread-none-button = + .title = صفحہ پھیلانے میں شامل نہ ہوں +pdfjs-spread-none-button-label = کوئی پھیلاؤ نہیں +pdfjs-spread-odd-button-label = تاک پھیلاؤ +pdfjs-spread-even-button-label = جفت پھیلاؤ + +## Document properties dialog + +pdfjs-document-properties-button = + .title = دستاویز خواص… +pdfjs-document-properties-button-label = دستاویز خواص… +pdfjs-document-properties-file-name = نام مسل: +pdfjs-document-properties-file-size = مسل سائز: +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bytes) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bytes) +pdfjs-document-properties-title = عنوان: +pdfjs-document-properties-author = تخلیق کار: +pdfjs-document-properties-subject = موضوع: +pdfjs-document-properties-keywords = کلیدی الفاظ: +pdfjs-document-properties-creation-date = تخلیق کی تاریخ: +pdfjs-document-properties-modification-date = ترمیم کی تاریخ: +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }، { $time } +pdfjs-document-properties-creator = تخلیق کار: +pdfjs-document-properties-producer = PDF پیدا کار: +pdfjs-document-properties-version = PDF ورژن: +pdfjs-document-properties-page-count = صفحہ شمار: +pdfjs-document-properties-page-size = صفہ کی لمبائ: +pdfjs-document-properties-page-size-unit-inches = میں +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = عمودی انداز +pdfjs-document-properties-page-size-orientation-landscape = افقى انداز +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = خط +pdfjs-document-properties-page-size-name-legal = قانونی + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } { $name } { $orientation } + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = تیز ویب دیکھیں: +pdfjs-document-properties-linearized-yes = ہاں +pdfjs-document-properties-linearized-no = نہیں +pdfjs-document-properties-close-button = بند کریں + +## Print + +pdfjs-print-progress-message = چھاپنے کرنے کے لیے دستاویز تیار کیے جا رھے ھیں +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = *{ $progress }%* +pdfjs-print-progress-close-button = منسوخ کریں +pdfjs-printing-not-supported = تنبیہ:چھاپنا اس براؤزر پر پوری طرح معاونت شدہ نہیں ہے۔ +pdfjs-printing-not-ready = تنبیہ: PDF چھپائی کے لیے پوری طرح لوڈ نہیں ہوئی۔ + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = سلائیڈ ٹوگل کریں +pdfjs-toggle-sidebar-button-label = سلائیڈ ٹوگل کریں +pdfjs-document-outline-button = + .title = دستاویز کی سرخیاں دکھایں (تمام اشیاء وسیع / غائب کرنے کے لیے ڈبل کلک کریں) +pdfjs-document-outline-button-label = دستاویز آؤٹ لائن +pdfjs-attachments-button = + .title = منسلکات دکھائیں +pdfjs-attachments-button-label = منسلکات +pdfjs-thumbs-button = + .title = تھمبنیل دکھائیں +pdfjs-thumbs-button-label = مجمل +pdfjs-findbar-button = + .title = دستاویز میں ڈھونڈیں +pdfjs-findbar-button-label = ڈھونڈیں + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = صفحہ { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = صفحے کا مجمل { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = ڈھونڈیں + .placeholder = دستاویز… میں ڈھونڈیں +pdfjs-find-previous-button = + .title = فقرے کا پچھلا وقوع ڈھونڈیں +pdfjs-find-previous-button-label = پچھلا +pdfjs-find-next-button = + .title = فقرے کا اگلہ وقوع ڈھونڈیں +pdfjs-find-next-button-label = آگے +pdfjs-find-highlight-checkbox = تمام نمایاں کریں +pdfjs-find-match-case-checkbox-label = حروف مشابہ کریں +pdfjs-find-entire-word-checkbox-label = تمام الفاظ +pdfjs-find-reached-top = صفحہ کے شروع پر پہنچ گیا، نیچے سے جاری کیا +pdfjs-find-reached-bottom = صفحہ کے اختتام پر پہنچ گیا، اوپر سے جاری کیا +pdfjs-find-not-found = فقرا نہیں ملا + +## Predefined zoom values + +pdfjs-page-scale-width = صفحہ چوڑائی +pdfjs-page-scale-fit = صفحہ فٹنگ +pdfjs-page-scale-auto = خودکار زوم +pdfjs-page-scale-actual = اصل سائز +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = صفحہ { $page } + +## Loading indicator messages + +pdfjs-loading-error = PDF لوڈ کرتے وقت نقص آ گیا۔ +pdfjs-invalid-file-error = ناجائز یا خراب PDF مسل +pdfjs-missing-file-error = PDF مسل غائب ہے۔ +pdfjs-unexpected-response-error = غیرمتوقع پیش کار جواب +pdfjs-rendering-error = صفحہ بناتے ہوئے نقص آ گیا۔ + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }.{ $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } نوٹ] + +## Password + +pdfjs-password-label = PDF مسل کھولنے کے لیے پاس ورڈ داخل کریں. +pdfjs-password-invalid = ناجائز پاس ورڈ. براےؑ کرم دوبارہ کوشش کریں. +pdfjs-password-ok-button = ٹھیک ہے +pdfjs-password-cancel-button = منسوخ کریں +pdfjs-web-fonts-disabled = ویب فانٹ نا اہل ہیں: شامل PDF فانٹ استعمال کرنے میں ناکام۔ + +## Editing + + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + diff --git a/public/pdfjs/web/locale/uz/viewer.ftl b/public/pdfjs/web/locale/uz/viewer.ftl new file mode 100644 index 0000000..fb82f22 --- /dev/null +++ b/public/pdfjs/web/locale/uz/viewer.ftl @@ -0,0 +1,187 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Oldingi sahifa +pdfjs-previous-button-label = Oldingi +pdfjs-next-button = + .title = Keyingi sahifa +pdfjs-next-button-label = Keyingi +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = /{ $pagesCount } +pdfjs-zoom-out-button = + .title = Kichiklashtirish +pdfjs-zoom-out-button-label = Kichiklashtirish +pdfjs-zoom-in-button = + .title = Kattalashtirish +pdfjs-zoom-in-button-label = Kattalashtirish +pdfjs-zoom-select = + .title = Masshtab +pdfjs-presentation-mode-button = + .title = Namoyish usuliga oʻtish +pdfjs-presentation-mode-button-label = Namoyish usuli +pdfjs-open-file-button = + .title = Faylni ochish +pdfjs-open-file-button-label = Ochish +pdfjs-print-button = + .title = Chop qilish +pdfjs-print-button-label = Chop qilish + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Vositalar +pdfjs-tools-button-label = Vositalar +pdfjs-first-page-button = + .title = Birinchi sahifaga oʻtish +pdfjs-first-page-button-label = Birinchi sahifaga oʻtish +pdfjs-last-page-button = + .title = Soʻnggi sahifaga oʻtish +pdfjs-last-page-button-label = Soʻnggi sahifaga oʻtish +pdfjs-page-rotate-cw-button = + .title = Soat yoʻnalishi boʻyicha burish +pdfjs-page-rotate-cw-button-label = Soat yoʻnalishi boʻyicha burish +pdfjs-page-rotate-ccw-button = + .title = Soat yoʻnalishiga qarshi burish +pdfjs-page-rotate-ccw-button-label = Soat yoʻnalishiga qarshi burish + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Hujjat xossalari +pdfjs-document-properties-button-label = Hujjat xossalari +pdfjs-document-properties-file-name = Fayl nomi: +pdfjs-document-properties-file-size = Fayl hajmi: +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bytes) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bytes) +pdfjs-document-properties-title = Nomi: +pdfjs-document-properties-author = Muallifi: +pdfjs-document-properties-subject = Mavzusi: +pdfjs-document-properties-keywords = Kalit so‘zlar +pdfjs-document-properties-creation-date = Yaratilgan sanasi: +pdfjs-document-properties-modification-date = O‘zgartirilgan sanasi +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Yaratuvchi: +pdfjs-document-properties-producer = PDF ishlab chiqaruvchi: +pdfjs-document-properties-version = PDF versiyasi: +pdfjs-document-properties-page-count = Sahifa soni: + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + + +## + +pdfjs-document-properties-close-button = Yopish + +## Print + +pdfjs-printing-not-supported = Diqqat: chop qilish bruzer tomonidan toʻliq qoʻllab-quvvatlanmaydi. +pdfjs-printing-not-ready = Diqqat: PDF fayl chop qilish uchun toʻliq yuklanmadi. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Yon panelni yoqib/oʻchirib qoʻyish +pdfjs-toggle-sidebar-button-label = Yon panelni yoqib/oʻchirib qoʻyish +pdfjs-document-outline-button-label = Hujjat tuzilishi +pdfjs-attachments-button = + .title = Ilovalarni ko‘rsatish +pdfjs-attachments-button-label = Ilovalar +pdfjs-thumbs-button = + .title = Nishonchalarni koʻrsatish +pdfjs-thumbs-button-label = Nishoncha +pdfjs-findbar-button = + .title = Hujjat ichidan topish + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = { $page } sahifa +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = { $page } sahifa nishonchasi + +## Find panel button title and messages + +pdfjs-find-previous-button = + .title = Soʻzlardagi oldingi hodisani topish +pdfjs-find-previous-button-label = Oldingi +pdfjs-find-next-button = + .title = Iboradagi keyingi hodisani topish +pdfjs-find-next-button-label = Keyingi +pdfjs-find-highlight-checkbox = Barchasini ajratib koʻrsatish +pdfjs-find-match-case-checkbox-label = Katta-kichik harflarni farqlash +pdfjs-find-reached-top = Hujjatning boshigacha yetib keldik, pastdan davom ettiriladi +pdfjs-find-reached-bottom = Hujjatning oxiriga yetib kelindi, yuqoridan davom ettirladi +pdfjs-find-not-found = Soʻzlar topilmadi + +## Predefined zoom values + +pdfjs-page-scale-width = Sahifa eni +pdfjs-page-scale-fit = Sahifani moslashtirish +pdfjs-page-scale-auto = Avtomatik masshtab +pdfjs-page-scale-actual = Haqiqiy hajmi +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + + +## Loading indicator messages + +pdfjs-loading-error = PDF yuklanayotganda xato yuz berdi. +pdfjs-invalid-file-error = Xato yoki buzuq PDF fayli. +pdfjs-missing-file-error = PDF fayl kerak. +pdfjs-unexpected-response-error = Kutilmagan server javobi. +pdfjs-rendering-error = Sahifa renderlanayotganda xato yuz berdi. + +## Annotations + +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } Annotation] + +## Password + +pdfjs-password-label = PDF faylni ochish uchun parolni kiriting. +pdfjs-password-invalid = Parol - notoʻgʻri. Qaytadan urinib koʻring. +pdfjs-password-ok-button = OK +pdfjs-web-fonts-disabled = Veb shriftlar oʻchirilgan: ichki PDF shriftlardan foydalanib boʻlmmaydi. + +## Editing + + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + diff --git a/public/pdfjs/web/locale/vi/viewer.ftl b/public/pdfjs/web/locale/vi/viewer.ftl new file mode 100644 index 0000000..af1291f --- /dev/null +++ b/public/pdfjs/web/locale/vi/viewer.ftl @@ -0,0 +1,503 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Trang trước +pdfjs-previous-button-label = Trước +pdfjs-next-button = + .title = Trang Sau +pdfjs-next-button-label = Tiếp +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Trang +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = trên { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } trên { $pagesCount }) +pdfjs-zoom-out-button = + .title = Thu nhỏ +pdfjs-zoom-out-button-label = Thu nhỏ +pdfjs-zoom-in-button = + .title = Phóng to +pdfjs-zoom-in-button-label = Phóng to +pdfjs-zoom-select = + .title = Thu phóng +pdfjs-presentation-mode-button = + .title = Chuyển sang chế độ trình chiếu +pdfjs-presentation-mode-button-label = Chế độ trình chiếu +pdfjs-open-file-button = + .title = Mở tập tin +pdfjs-open-file-button-label = Mở tập tin +pdfjs-print-button = + .title = In +pdfjs-print-button-label = In +pdfjs-save-button = + .title = Lưu +pdfjs-save-button-label = Lưu +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = Tải xuống +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = Tải xuống +pdfjs-bookmark-button = + .title = Trang hiện tại (xem URL từ trang hiện tại) +pdfjs-bookmark-button-label = Trang hiện tại + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Công cụ +pdfjs-tools-button-label = Công cụ +pdfjs-first-page-button = + .title = Về trang đầu +pdfjs-first-page-button-label = Về trang đầu +pdfjs-last-page-button = + .title = Đến trang cuối +pdfjs-last-page-button-label = Đến trang cuối +pdfjs-page-rotate-cw-button = + .title = Xoay theo chiều kim đồng hồ +pdfjs-page-rotate-cw-button-label = Xoay theo chiều kim đồng hồ +pdfjs-page-rotate-ccw-button = + .title = Xoay ngược chiều kim đồng hồ +pdfjs-page-rotate-ccw-button-label = Xoay ngược chiều kim đồng hồ +pdfjs-cursor-text-select-tool-button = + .title = Kích hoạt công cụ chọn vùng văn bản +pdfjs-cursor-text-select-tool-button-label = Công cụ chọn vùng văn bản +pdfjs-cursor-hand-tool-button = + .title = Kích hoạt công cụ con trỏ +pdfjs-cursor-hand-tool-button-label = Công cụ con trỏ +pdfjs-scroll-page-button = + .title = Sử dụng cuộn trang hiện tại +pdfjs-scroll-page-button-label = Cuộn trang hiện tại +pdfjs-scroll-vertical-button = + .title = Sử dụng cuộn dọc +pdfjs-scroll-vertical-button-label = Cuộn dọc +pdfjs-scroll-horizontal-button = + .title = Sử dụng cuộn ngang +pdfjs-scroll-horizontal-button-label = Cuộn ngang +pdfjs-scroll-wrapped-button = + .title = Sử dụng cuộn ngắt dòng +pdfjs-scroll-wrapped-button-label = Cuộn ngắt dòng +pdfjs-spread-none-button = + .title = Không nối rộng trang +pdfjs-spread-none-button-label = Không có phân cách +pdfjs-spread-odd-button = + .title = Nối trang bài bắt đầu với các trang được đánh số lẻ +pdfjs-spread-odd-button-label = Phân cách theo số lẻ +pdfjs-spread-even-button = + .title = Nối trang bài bắt đầu với các trang được đánh số chẵn +pdfjs-spread-even-button-label = Phân cách theo số chẵn + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Thuộc tính của tài liệu… +pdfjs-document-properties-button-label = Thuộc tính của tài liệu… +pdfjs-document-properties-file-name = Tên tập tin: +pdfjs-document-properties-file-size = Kích thước: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } bytes) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } bytes) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } byte) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } byte) +pdfjs-document-properties-title = Tiêu đề: +pdfjs-document-properties-author = Tác giả: +pdfjs-document-properties-subject = Chủ đề: +pdfjs-document-properties-keywords = Từ khóa: +pdfjs-document-properties-creation-date = Ngày tạo: +pdfjs-document-properties-modification-date = Ngày sửa đổi: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Người tạo: +pdfjs-document-properties-producer = Phần mềm tạo PDF: +pdfjs-document-properties-version = Phiên bản PDF: +pdfjs-document-properties-page-count = Tổng số trang: +pdfjs-document-properties-page-size = Kích thước trang: +pdfjs-document-properties-page-size-unit-inches = in +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = khổ dọc +pdfjs-document-properties-page-size-orientation-landscape = khổ ngang +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Thư +pdfjs-document-properties-page-size-name-legal = Pháp lý + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit } ({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit } ({ $name }, { $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = Xem nhanh trên web: +pdfjs-document-properties-linearized-yes = Có +pdfjs-document-properties-linearized-no = Không +pdfjs-document-properties-close-button = Ðóng + +## Print + +pdfjs-print-progress-message = Chuẩn bị trang để in… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Hủy bỏ +pdfjs-printing-not-supported = Cảnh báo: In ấn không được hỗ trợ đầy đủ ở trình duyệt này. +pdfjs-printing-not-ready = Cảnh báo: PDF chưa được tải hết để in. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Bật/Tắt thanh lề +pdfjs-toggle-sidebar-notification-button = + .title = Bật tắt thanh lề (tài liệu bao gồm bản phác thảo/tập tin đính kèm/lớp) +pdfjs-toggle-sidebar-button-label = Bật/Tắt thanh lề +pdfjs-document-outline-button = + .title = Hiển thị tài liệu phác thảo (nhấp đúp vào để mở rộng/thu gọn tất cả các mục) +pdfjs-document-outline-button-label = Bản phác tài liệu +pdfjs-attachments-button = + .title = Hiện nội dung đính kèm +pdfjs-attachments-button-label = Nội dung đính kèm +pdfjs-layers-button = + .title = Hiển thị các lớp (nhấp đúp để đặt lại tất cả các lớp về trạng thái mặc định) +pdfjs-layers-button-label = Lớp +pdfjs-thumbs-button = + .title = Hiển thị ảnh thu nhỏ +pdfjs-thumbs-button-label = Ảnh thu nhỏ +pdfjs-current-outline-item-button = + .title = Tìm mục phác thảo hiện tại +pdfjs-current-outline-item-button-label = Mục phác thảo hiện tại +pdfjs-findbar-button = + .title = Tìm trong tài liệu +pdfjs-findbar-button-label = Tìm +pdfjs-additional-layers = Các lớp bổ sung + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Trang { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Ảnh thu nhỏ của trang { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Tìm + .placeholder = Tìm trong tài liệu… +pdfjs-find-previous-button = + .title = Tìm cụm từ ở phần trước +pdfjs-find-previous-button-label = Trước +pdfjs-find-next-button = + .title = Tìm cụm từ ở phần sau +pdfjs-find-next-button-label = Tiếp +pdfjs-find-highlight-checkbox = Đánh dấu tất cả +pdfjs-find-match-case-checkbox-label = Phân biệt hoa, thường +pdfjs-find-match-diacritics-checkbox-label = Khớp dấu phụ +pdfjs-find-entire-word-checkbox-label = Toàn bộ từ +pdfjs-find-reached-top = Đã đến phần đầu tài liệu, quay trở lại từ cuối +pdfjs-find-reached-bottom = Đã đến phần cuối của tài liệu, quay trở lại từ đầu +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = { $current } trên { $total } kết quả +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = Tìm thấy hơn { $limit } kết quả +pdfjs-find-not-found = Không tìm thấy cụm từ này + +## Predefined zoom values + +pdfjs-page-scale-width = Vừa chiều rộng +pdfjs-page-scale-fit = Vừa chiều cao +pdfjs-page-scale-auto = Tự động chọn kích thước +pdfjs-page-scale-actual = Kích thước thực +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = Trang { $page } + +## Loading indicator messages + +pdfjs-loading-error = Lỗi khi tải tài liệu PDF. +pdfjs-invalid-file-error = Tập tin PDF hỏng hoặc không hợp lệ. +pdfjs-missing-file-error = Thiếu tập tin PDF. +pdfjs-unexpected-response-error = Máy chủ có phản hồi lạ. +pdfjs-rendering-error = Lỗi khi hiển thị trang. + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date }, { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } Chú thích] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = Nhập mật khẩu để mở tập tin PDF này. +pdfjs-password-invalid = Mật khẩu không đúng. Vui lòng thử lại. +pdfjs-password-ok-button = OK +pdfjs-password-cancel-button = Hủy bỏ +pdfjs-web-fonts-disabled = Phông chữ Web bị vô hiệu hóa: không thể sử dụng các phông chữ PDF được nhúng. + +## Editing + +pdfjs-editor-free-text-button = + .title = Văn bản +pdfjs-editor-free-text-button-label = Văn bản +pdfjs-editor-ink-button = + .title = Vẽ +pdfjs-editor-ink-button-label = Vẽ +pdfjs-editor-stamp-button = + .title = Thêm hoặc chỉnh sửa hình ảnh +pdfjs-editor-stamp-button-label = Thêm hoặc chỉnh sửa hình ảnh +pdfjs-editor-highlight-button = + .title = Đánh dấu +pdfjs-editor-highlight-button-label = Đánh dấu +pdfjs-highlight-floating-button1 = + .title = Đánh dấu + .aria-label = Đánh dấu +pdfjs-highlight-floating-button-label = Đánh dấu + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = Xóa bản vẽ +pdfjs-editor-remove-freetext-button = + .title = Xóa văn bản +pdfjs-editor-remove-stamp-button = + .title = Xóa ảnh +pdfjs-editor-remove-highlight-button = + .title = Xóa phần đánh dấu + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = Màu +pdfjs-editor-free-text-size-input = Kích cỡ +pdfjs-editor-ink-color-input = Màu +pdfjs-editor-ink-thickness-input = Độ dày +pdfjs-editor-ink-opacity-input = Độ mờ +pdfjs-editor-stamp-add-image-button = + .title = Thêm hình ảnh +pdfjs-editor-stamp-add-image-button-label = Thêm hình ảnh +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = Độ dày +pdfjs-editor-free-highlight-thickness-title = + .title = Thay đổi độ dày khi đánh dấu các mục không phải là văn bản +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = Trình chỉnh sửa văn bản + .default-content = Bắt đầu nhập… +pdfjs-free-text = + .aria-label = Trình sửa văn bản +pdfjs-free-text-default-content = Bắt đầu nhập… +pdfjs-ink = + .aria-label = Trình sửa nét vẽ +pdfjs-ink-canvas = + .aria-label = Hình ảnh do người dùng tạo + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = Văn bản thay thế +pdfjs-editor-alt-text-edit-button = + .aria-label = Chỉnh sửa văn bản thay thế +pdfjs-editor-alt-text-edit-button-label = Chỉnh sửa văn bản thay thế +pdfjs-editor-alt-text-dialog-label = Chọn một lựa chọn +pdfjs-editor-alt-text-dialog-description = Văn bản thay thế sẽ hữu ích khi mọi người không thể thấy hình ảnh hoặc khi hình ảnh không tải. +pdfjs-editor-alt-text-add-description-label = Thêm một mô tả +pdfjs-editor-alt-text-add-description-description = Hãy nhắm tới 1-2 câu mô tả chủ đề, bối cảnh hoặc hành động. +pdfjs-editor-alt-text-mark-decorative-label = Đánh dấu là trang trí +pdfjs-editor-alt-text-mark-decorative-description = Điều này được sử dụng cho các hình ảnh trang trí, như đường viền hoặc watermark. +pdfjs-editor-alt-text-cancel-button = Hủy bỏ +pdfjs-editor-alt-text-save-button = Lưu +pdfjs-editor-alt-text-decorative-tooltip = Đã đánh dấu là trang trí +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = Ví dụ: “Một thanh niên ngồi xuống bàn để thưởng thức một bữa ăn” +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = Văn bản thay thế + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = Trên cùng bên trái — thay đổi kích thước +pdfjs-editor-resizer-label-top-middle = Trên cùng ở giữa — thay đổi kích thước +pdfjs-editor-resizer-label-top-right = Trên cùng bên phải — thay đổi kích thước +pdfjs-editor-resizer-label-middle-right = Ở giữa bên phải — thay đổi kích thước +pdfjs-editor-resizer-label-bottom-right = Dưới cùng bên phải — thay đổi kích thước +pdfjs-editor-resizer-label-bottom-middle = Ở giữa dưới cùng — thay đổi kích thước +pdfjs-editor-resizer-label-bottom-left = Góc dưới bên trái — thay đổi kích thước +pdfjs-editor-resizer-label-middle-left = Ở giữa bên trái — thay đổi kích thước +pdfjs-editor-resizer-top-left = + .aria-label = Trên cùng bên trái — thay đổi kích thước +pdfjs-editor-resizer-top-middle = + .aria-label = Trên cùng ở giữa — thay đổi kích thước +pdfjs-editor-resizer-top-right = + .aria-label = Trên cùng bên phải — thay đổi kích thước +pdfjs-editor-resizer-middle-right = + .aria-label = Ở giữa bên phải — thay đổi kích thước +pdfjs-editor-resizer-bottom-right = + .aria-label = Dưới cùng bên phải — thay đổi kích thước +pdfjs-editor-resizer-bottom-middle = + .aria-label = Ở giữa dưới cùng — thay đổi kích thước +pdfjs-editor-resizer-bottom-left = + .aria-label = Góc dưới bên trái — thay đổi kích thước +pdfjs-editor-resizer-middle-left = + .aria-label = Ở giữa bên trái — thay đổi kích thước + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = Màu đánh dấu +pdfjs-editor-colorpicker-button = + .title = Thay đổi màu +pdfjs-editor-colorpicker-dropdown = + .aria-label = Lựa chọn màu sắc +pdfjs-editor-colorpicker-yellow = + .title = Vàng +pdfjs-editor-colorpicker-green = + .title = Xanh lục +pdfjs-editor-colorpicker-blue = + .title = Xanh dương +pdfjs-editor-colorpicker-pink = + .title = Hồng +pdfjs-editor-colorpicker-red = + .title = Đỏ + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = Hiện tất cả +pdfjs-editor-highlight-show-all-button = + .title = Hiện tất cả + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = Chỉnh sửa văn bản thay thế (mô tả hình ảnh) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = Thêm văn bản thay thế (mô tả hình ảnh) +pdfjs-editor-new-alt-text-textarea = + .placeholder = Viết mô tả của bạn ở đây… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = Mô tả ngắn gọn dành cho người không xem được ảnh hoặc khi không thể tải ảnh. +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = Văn bản thay thế này được tạo tự động và có thể không chính xác. +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Tìm hiểu thêm +pdfjs-editor-new-alt-text-create-automatically-button-label = Tạo văn bản thay thế tự động +pdfjs-editor-new-alt-text-not-now-button = Không phải bây giờ +pdfjs-editor-new-alt-text-error-title = Không thể tạo tự động văn bản thay thế +pdfjs-editor-new-alt-text-error-description = Vui lòng viết văn bản thay thế của riêng bạn hoặc thử lại sau. +pdfjs-editor-new-alt-text-error-close-button = Đóng +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = Đang tải xuống mô hình AI văn bản thay thế ({ $downloadedSize } trong số { $totalSize } MB) + .aria-valuetext = Đang tải xuống mô hình AI văn bản thay thế ({ $downloadedSize } trong số { $totalSize } MB) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = Đã thêm văn bản thay thế +pdfjs-editor-new-alt-text-added-button-label = Đã thêm văn bản thay thế +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = Thiếu văn bản thay thế +pdfjs-editor-new-alt-text-missing-button-label = Thiếu văn bản thay thế +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = Xem lại văn bản thay thế +pdfjs-editor-new-alt-text-to-review-button-label = Xem lại văn bản thay thế +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Được tạo tự động: { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = Cài đặt văn bản thay thế của hình ảnh +pdfjs-image-alt-text-settings-button-label = Cài đặt văn bản thay thế của hình ảnh +pdfjs-editor-alt-text-settings-dialog-label = Cài đặt văn bản thay thế của hình ảnh +pdfjs-editor-alt-text-settings-automatic-title = Văn bản thay thế tự động +pdfjs-editor-alt-text-settings-create-model-button-label = Tạo văn bản thay thế tự động +pdfjs-editor-alt-text-settings-create-model-description = Đề xuất mô tả giúp ích cho những người không xem được ảnh hoặc khi không thể tải ảnh. +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = Mô hình AI văn bản khác ({ $totalSize } MB) +pdfjs-editor-alt-text-settings-ai-model-description = Chạy cục bộ trên thiết bị của bạn để dữ liệu của bạn luôn ở chế độ riêng tư. Bắt buộc đối với văn bản thay thế tự động. +pdfjs-editor-alt-text-settings-delete-model-button = Xóa +pdfjs-editor-alt-text-settings-download-model-button = Tải xuống +pdfjs-editor-alt-text-settings-downloading-model-button = Đang tải xuống… +pdfjs-editor-alt-text-settings-editor-title = Trình soạn thảo văn bản thay thế +pdfjs-editor-alt-text-settings-show-dialog-button-label = Hiển thị ngay trình soạn thảo văn bản thay thế khi thêm hình ảnh +pdfjs-editor-alt-text-settings-show-dialog-description = Giúp bạn đảm bảo tất cả hình ảnh của bạn đều có văn bản thay thế. +pdfjs-editor-alt-text-settings-close-button = Đóng + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = Đã xóa đánh dấu +pdfjs-editor-undo-bar-message-freetext = Đã xóa văn bản +pdfjs-editor-undo-bar-message-ink = Đã xóa bản vẽ +pdfjs-editor-undo-bar-message-stamp = Đã xóa hình ảnh +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = { $count } chú thích đã bị xóa +pdfjs-editor-undo-bar-undo-button = + .title = Hoàn tác +pdfjs-editor-undo-bar-undo-button-label = Hoàn tác +pdfjs-editor-undo-bar-close-button = + .title = Đóng +pdfjs-editor-undo-bar-close-button-label = Đóng diff --git a/public/pdfjs/web/locale/wo/viewer.ftl b/public/pdfjs/web/locale/wo/viewer.ftl new file mode 100644 index 0000000..d66c459 --- /dev/null +++ b/public/pdfjs/web/locale/wo/viewer.ftl @@ -0,0 +1,127 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Xët wi jiitu +pdfjs-previous-button-label = Bi jiitu +pdfjs-next-button = + .title = Xët wi ci topp +pdfjs-next-button-label = Bi ci topp +pdfjs-zoom-out-button = + .title = Wàññi +pdfjs-zoom-out-button-label = Wàññi +pdfjs-zoom-in-button = + .title = Yaatal +pdfjs-zoom-in-button-label = Yaatal +pdfjs-zoom-select = + .title = Yambalaŋ +pdfjs-presentation-mode-button = + .title = Wañarñil ci anamu wone +pdfjs-presentation-mode-button-label = Anamu Wone +pdfjs-open-file-button = + .title = Ubbi benn dencukaay +pdfjs-open-file-button-label = Ubbi +pdfjs-print-button = + .title = Móol +pdfjs-print-button-label = Móol + +## Secondary toolbar and context menu + + +## Document properties dialog + +pdfjs-document-properties-title = Bopp: + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + + +## + + +## Print + +pdfjs-printing-not-supported = Artu: Joowkat bii nanguwul lool mool. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-thumbs-button = + .title = Wone nataal yu ndaw yi +pdfjs-thumbs-button-label = Nataal yu ndaw yi +pdfjs-findbar-button = + .title = Gis ci biir jukki bi +pdfjs-findbar-button-label = Wut + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Xët { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Wiñet bu xët { $page } + +## Find panel button title and messages + +pdfjs-find-previous-button = + .title = Seet beneen kaddu bu ni mel te jiitu +pdfjs-find-previous-button-label = Bi jiitu +pdfjs-find-next-button = + .title = Seet beneen kaddu bu ni mel +pdfjs-find-next-button-label = Bi ci topp +pdfjs-find-highlight-checkbox = Melaxal lépp +pdfjs-find-match-case-checkbox-label = Sàmm jëmmalin wi +pdfjs-find-reached-top = Jot nañu ndorteel xët wi, kontine dale ko ci suuf +pdfjs-find-reached-bottom = Jot nañu jeexitalu xët wi, kontine ci ndorte +pdfjs-find-not-found = Gisiñu kaddu gi + +## Predefined zoom values + +pdfjs-page-scale-width = Yaatuwaay bu mët +pdfjs-page-scale-fit = Xët lëmm +pdfjs-page-scale-auto = Yambalaŋ ci saa si +pdfjs-page-scale-actual = Dayo bi am + +## PDF page + + +## Loading indicator messages + +pdfjs-loading-error = Am na njumte ci yebum dencukaay PDF bi. +pdfjs-invalid-file-error = Dencukaay PDF bi baaxul walla mu sankar. +pdfjs-rendering-error = Am njumte bu am bi xët bi di wonewu. + +## Annotations + +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [Karmat { $type }] + +## Password + +pdfjs-password-ok-button = OK +pdfjs-password-cancel-button = Neenal + +## Editing + + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + diff --git a/public/pdfjs/web/locale/xh/viewer.ftl b/public/pdfjs/web/locale/xh/viewer.ftl new file mode 100644 index 0000000..0798887 --- /dev/null +++ b/public/pdfjs/web/locale/xh/viewer.ftl @@ -0,0 +1,212 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = Iphepha langaphambili +pdfjs-previous-button-label = Okwangaphambili +pdfjs-next-button = + .title = Iphepha elilandelayo +pdfjs-next-button-label = Okulandelayo +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = Iphepha +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = kwali- { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } kwali { $pagesCount }) +pdfjs-zoom-out-button = + .title = Bhekelisela Kudana +pdfjs-zoom-out-button-label = Bhekelisela Kudana +pdfjs-zoom-in-button = + .title = Sondeza Kufuphi +pdfjs-zoom-in-button-label = Sondeza Kufuphi +pdfjs-zoom-select = + .title = Yandisa / Nciphisa +pdfjs-presentation-mode-button = + .title = Tshintshela kwimo yonikezelo +pdfjs-presentation-mode-button-label = Imo yonikezelo +pdfjs-open-file-button = + .title = Vula Ifayile +pdfjs-open-file-button-label = Vula +pdfjs-print-button = + .title = Printa +pdfjs-print-button-label = Printa + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = Izixhobo zemiyalelo +pdfjs-tools-button-label = Izixhobo zemiyalelo +pdfjs-first-page-button = + .title = Yiya kwiphepha lokuqala +pdfjs-first-page-button-label = Yiya kwiphepha lokuqala +pdfjs-last-page-button = + .title = Yiya kwiphepha lokugqibela +pdfjs-last-page-button-label = Yiya kwiphepha lokugqibela +pdfjs-page-rotate-cw-button = + .title = Jikelisa ngasekunene +pdfjs-page-rotate-cw-button-label = Jikelisa ngasekunene +pdfjs-page-rotate-ccw-button = + .title = Jikelisa ngasekhohlo +pdfjs-page-rotate-ccw-button-label = Jikelisa ngasekhohlo +pdfjs-cursor-text-select-tool-button = + .title = Vumela iSixhobo sokuKhetha iTeksti +pdfjs-cursor-text-select-tool-button-label = ISixhobo sokuKhetha iTeksti +pdfjs-cursor-hand-tool-button = + .title = Yenza iSixhobo seSandla siSebenze +pdfjs-cursor-hand-tool-button-label = ISixhobo seSandla + +## Document properties dialog + +pdfjs-document-properties-button = + .title = Iipropati zoxwebhu… +pdfjs-document-properties-button-label = Iipropati zoxwebhu… +pdfjs-document-properties-file-name = Igama lefayile: +pdfjs-document-properties-file-size = Isayizi yefayile: +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB (iibhayiti{ $size_b }) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB (iibhayithi{ $size_b }) +pdfjs-document-properties-title = Umxholo: +pdfjs-document-properties-author = Umbhali: +pdfjs-document-properties-subject = Umbandela: +pdfjs-document-properties-keywords = Amagama aphambili: +pdfjs-document-properties-creation-date = Umhla wokwenziwa kwayo: +pdfjs-document-properties-modification-date = Umhla wokulungiswa kwayo: +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = Umntu oyenzileyo: +pdfjs-document-properties-producer = Umvelisi we-PDF: +pdfjs-document-properties-version = Uhlelo lwe-PDF: +pdfjs-document-properties-page-count = Inani lamaphepha: + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + + +## + +pdfjs-document-properties-close-button = Vala + +## Print + +pdfjs-print-progress-message = Ilungisa uxwebhu ukuze iprinte… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = Rhoxisa +pdfjs-printing-not-supported = Isilumkiso: Ukuprinta akuxhaswa ngokupheleleyo yile bhrawuza. +pdfjs-printing-not-ready = Isilumkiso: IPDF ayihlohlwanga ngokupheleleyo ukwenzela ukuprinta. + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = Togola ngebha eseCaleni +pdfjs-toggle-sidebar-button-label = Togola ngebha eseCaleni +pdfjs-document-outline-button = + .title = Bonisa uLwandlalo loXwebhu (cofa kabini ukuze wandise/diliza zonke izinto) +pdfjs-document-outline-button-label = Isishwankathelo soxwebhu +pdfjs-attachments-button = + .title = Bonisa iziqhotyoshelwa +pdfjs-attachments-button-label = Iziqhoboshelo +pdfjs-thumbs-button = + .title = Bonisa ukrobiso kumfanekiso +pdfjs-thumbs-button-label = Ukrobiso kumfanekiso +pdfjs-findbar-button = + .title = Fumana kuXwebhu +pdfjs-findbar-button-label = Fumana + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = Iphepha { $page } +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = Ukrobiso kumfanekiso wephepha { $page } + +## Find panel button title and messages + +pdfjs-find-input = + .title = Fumana + .placeholder = Fumana kuXwebhu… +pdfjs-find-previous-button = + .title = Fumanisa isenzeko sangaphambili sebinzana lamagama +pdfjs-find-previous-button-label = Okwangaphambili +pdfjs-find-next-button = + .title = Fumanisa isenzeko esilandelayo sebinzana lamagama +pdfjs-find-next-button-label = Okulandelayo +pdfjs-find-highlight-checkbox = Qaqambisa konke +pdfjs-find-match-case-checkbox-label = Tshatisa ngobukhulu bukanobumba +pdfjs-find-reached-top = Ufike ngaphezulu ephepheni, kusukwa ngezantsi +pdfjs-find-reached-bottom = Ufike ekupheleni kwephepha, kusukwa ngaphezulu +pdfjs-find-not-found = Ibinzana alifunyenwanga + +## Predefined zoom values + +pdfjs-page-scale-width = Ububanzi bephepha +pdfjs-page-scale-fit = Ukulinganiswa kwephepha +pdfjs-page-scale-auto = Ukwandisa/Ukunciphisa Ngokwayo +pdfjs-page-scale-actual = Ubungakanani bokwenene +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + + +## Loading indicator messages + +pdfjs-loading-error = Imposiso yenzekile xa kulayishwa i-PDF. +pdfjs-invalid-file-error = Ifayile ye-PDF engeyiyo okanye eyonakalisiweyo. +pdfjs-missing-file-error = Ifayile ye-PDF edukileyo. +pdfjs-unexpected-response-error = Impendulo yeseva engalindelekanga. +pdfjs-rendering-error = Imposiso yenzekile xa bekunikezelwa iphepha. + +## Annotations + +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } Ubhalo-nqaku] + +## Password + +pdfjs-password-label = Faka ipasiwedi ukuze uvule le fayile yePDF. +pdfjs-password-invalid = Ipasiwedi ayisebenzi. Nceda uzame kwakhona. +pdfjs-password-ok-button = KULUNGILE +pdfjs-password-cancel-button = Rhoxisa +pdfjs-web-fonts-disabled = Iifonti zewebhu ziqhwalelisiwe: ayikwazi ukusebenzisa iifonti ze-PDF ezincanyathelisiweyo. + +## Editing + + +## Alt-text dialog + + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + diff --git a/public/pdfjs/web/locale/zh-CN/viewer.ftl b/public/pdfjs/web/locale/zh-CN/viewer.ftl new file mode 100644 index 0000000..8fe9a6a --- /dev/null +++ b/public/pdfjs/web/locale/zh-CN/viewer.ftl @@ -0,0 +1,503 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = 上一页 +pdfjs-previous-button-label = 上一页 +pdfjs-next-button = + .title = 下一页 +pdfjs-next-button-label = 下一页 +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = 页面 +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = / { $pagesCount } +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = ({ $pageNumber } / { $pagesCount }) +pdfjs-zoom-out-button = + .title = 缩小 +pdfjs-zoom-out-button-label = 缩小 +pdfjs-zoom-in-button = + .title = 放大 +pdfjs-zoom-in-button-label = 放大 +pdfjs-zoom-select = + .title = 缩放 +pdfjs-presentation-mode-button = + .title = 切换到演示模式 +pdfjs-presentation-mode-button-label = 演示模式 +pdfjs-open-file-button = + .title = 打开文件 +pdfjs-open-file-button-label = 打开 +pdfjs-print-button = + .title = 打印 +pdfjs-print-button-label = 打印 +pdfjs-save-button = + .title = 保存 +pdfjs-save-button-label = 保存 +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = 下载 +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = 下载 +pdfjs-bookmark-button = + .title = 当前页面(在当前页面查看 URL) +pdfjs-bookmark-button-label = 当前页面 + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = 工具 +pdfjs-tools-button-label = 工具 +pdfjs-first-page-button = + .title = 转到第一页 +pdfjs-first-page-button-label = 转到第一页 +pdfjs-last-page-button = + .title = 转到最后一页 +pdfjs-last-page-button-label = 转到最后一页 +pdfjs-page-rotate-cw-button = + .title = 顺时针旋转 +pdfjs-page-rotate-cw-button-label = 顺时针旋转 +pdfjs-page-rotate-ccw-button = + .title = 逆时针旋转 +pdfjs-page-rotate-ccw-button-label = 逆时针旋转 +pdfjs-cursor-text-select-tool-button = + .title = 启用文本选择工具 +pdfjs-cursor-text-select-tool-button-label = 文本选择工具 +pdfjs-cursor-hand-tool-button = + .title = 启用手形工具 +pdfjs-cursor-hand-tool-button-label = 手形工具 +pdfjs-scroll-page-button = + .title = 使用页面滚动 +pdfjs-scroll-page-button-label = 页面滚动 +pdfjs-scroll-vertical-button = + .title = 使用垂直滚动 +pdfjs-scroll-vertical-button-label = 垂直滚动 +pdfjs-scroll-horizontal-button = + .title = 使用水平滚动 +pdfjs-scroll-horizontal-button-label = 水平滚动 +pdfjs-scroll-wrapped-button = + .title = 使用平铺滚动 +pdfjs-scroll-wrapped-button-label = 平铺滚动 +pdfjs-spread-none-button = + .title = 不加入衔接页 +pdfjs-spread-none-button-label = 单页视图 +pdfjs-spread-odd-button = + .title = 加入衔接页使奇数页作为起始页 +pdfjs-spread-odd-button-label = 双页视图 +pdfjs-spread-even-button = + .title = 加入衔接页使偶数页作为起始页 +pdfjs-spread-even-button-label = 书籍视图 + +## Document properties dialog + +pdfjs-document-properties-button = + .title = 文档属性… +pdfjs-document-properties-button-label = 文档属性… +pdfjs-document-properties-file-name = 文件名: +pdfjs-document-properties-file-size = 文件大小: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB({ $b } 字节) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB({ $b } 字节) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } 字节) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } 字节) +pdfjs-document-properties-title = 标题: +pdfjs-document-properties-author = 作者: +pdfjs-document-properties-subject = 主题: +pdfjs-document-properties-keywords = 关键词: +pdfjs-document-properties-creation-date = 创建日期: +pdfjs-document-properties-modification-date = 修改日期: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date }, { $time } +pdfjs-document-properties-creator = 创建者: +pdfjs-document-properties-producer = PDF 生成器: +pdfjs-document-properties-version = PDF 版本: +pdfjs-document-properties-page-count = 页数: +pdfjs-document-properties-page-size = 页面大小: +pdfjs-document-properties-page-size-unit-inches = 英寸 +pdfjs-document-properties-page-size-unit-millimeters = 毫米 +pdfjs-document-properties-page-size-orientation-portrait = 纵向 +pdfjs-document-properties-page-size-orientation-landscape = 横向 +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Letter +pdfjs-document-properties-page-size-name-legal = Legal + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit }({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit }({ $name },{ $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = 快速 Web 视图: +pdfjs-document-properties-linearized-yes = 是 +pdfjs-document-properties-linearized-no = 否 +pdfjs-document-properties-close-button = 关闭 + +## Print + +pdfjs-print-progress-message = 正在准备打印文档… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = 取消 +pdfjs-printing-not-supported = 警告:此浏览器尚未完整支持打印功能。 +pdfjs-printing-not-ready = 警告:此 PDF 未完成加载,无法打印。 + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = 切换侧栏 +pdfjs-toggle-sidebar-notification-button = + .title = 切换侧栏(文档所含的大纲/附件/图层) +pdfjs-toggle-sidebar-button-label = 切换侧栏 +pdfjs-document-outline-button = + .title = 显示文档大纲(双击展开/折叠所有项) +pdfjs-document-outline-button-label = 文档大纲 +pdfjs-attachments-button = + .title = 显示附件 +pdfjs-attachments-button-label = 附件 +pdfjs-layers-button = + .title = 显示图层(双击即可将所有图层重置为默认状态) +pdfjs-layers-button-label = 图层 +pdfjs-thumbs-button = + .title = 显示缩略图 +pdfjs-thumbs-button-label = 缩略图 +pdfjs-current-outline-item-button = + .title = 查找当前大纲项目 +pdfjs-current-outline-item-button-label = 当前大纲项目 +pdfjs-findbar-button = + .title = 在文档中查找 +pdfjs-findbar-button-label = 查找 +pdfjs-additional-layers = 其他图层 + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = 第 { $page } 页 +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = 页面 { $page } 的缩略图 + +## Find panel button title and messages + +pdfjs-find-input = + .title = 查找 + .placeholder = 在文档中查找… +pdfjs-find-previous-button = + .title = 查找词语上一次出现的位置 +pdfjs-find-previous-button-label = 上一页 +pdfjs-find-next-button = + .title = 查找词语后一次出现的位置 +pdfjs-find-next-button-label = 下一页 +pdfjs-find-highlight-checkbox = 全部高亮显示 +pdfjs-find-match-case-checkbox-label = 区分大小写 +pdfjs-find-match-diacritics-checkbox-label = 匹配变音符号 +pdfjs-find-entire-word-checkbox-label = 全词匹配 +pdfjs-find-reached-top = 到达文档开头,从末尾继续 +pdfjs-find-reached-bottom = 到达文档末尾,从开头继续 +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = 第 { $current } 项,共找到 { $total } 个匹配项 +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = 匹配超过 { $limit } 项 +pdfjs-find-not-found = 找不到指定词语 + +## Predefined zoom values + +pdfjs-page-scale-width = 适合页宽 +pdfjs-page-scale-fit = 适合页面 +pdfjs-page-scale-auto = 自动缩放 +pdfjs-page-scale-actual = 实际大小 +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = 第 { $page } 页 + +## Loading indicator messages + +pdfjs-loading-error = 加载 PDF 时发生错误。 +pdfjs-invalid-file-error = 无效或损坏的 PDF 文件。 +pdfjs-missing-file-error = 缺少 PDF 文件。 +pdfjs-unexpected-response-error = 意外的服务器响应。 +pdfjs-rendering-error = 渲染页面时发生错误。 + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date },{ $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } 注释] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = 输入密码以打开此 PDF 文件。 +pdfjs-password-invalid = 密码无效。请重试。 +pdfjs-password-ok-button = 确定 +pdfjs-password-cancel-button = 取消 +pdfjs-web-fonts-disabled = Web 字体已被禁用:无法使用嵌入的 PDF 字体。 + +## Editing + +pdfjs-editor-free-text-button = + .title = 文本 +pdfjs-editor-free-text-button-label = 文本 +pdfjs-editor-ink-button = + .title = 绘图 +pdfjs-editor-ink-button-label = 绘图 +pdfjs-editor-stamp-button = + .title = 添加或编辑图像 +pdfjs-editor-stamp-button-label = 添加或编辑图像 +pdfjs-editor-highlight-button = + .title = 高亮 +pdfjs-editor-highlight-button-label = 高亮 +pdfjs-highlight-floating-button1 = + .title = 高亮 + .aria-label = 高亮 +pdfjs-highlight-floating-button-label = 高亮 + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = 移除绘图 +pdfjs-editor-remove-freetext-button = + .title = 移除文本 +pdfjs-editor-remove-stamp-button = + .title = 移除图像 +pdfjs-editor-remove-highlight-button = + .title = 移除高亮 + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = 颜色 +pdfjs-editor-free-text-size-input = 字号 +pdfjs-editor-ink-color-input = 颜色 +pdfjs-editor-ink-thickness-input = 粗细 +pdfjs-editor-ink-opacity-input = 不透明度 +pdfjs-editor-stamp-add-image-button = + .title = 添加图像 +pdfjs-editor-stamp-add-image-button-label = 添加图像 +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = 粗细 +pdfjs-editor-free-highlight-thickness-title = + .title = 更改高亮粗细(用于文本以外项目) +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = 文本编辑器 + .default-content = 在此键入… +pdfjs-free-text = + .aria-label = 文本编辑器 +pdfjs-free-text-default-content = 开始输入… +pdfjs-ink = + .aria-label = 绘图编辑器 +pdfjs-ink-canvas = + .aria-label = 用户创建图像 + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = 替换文字 +pdfjs-editor-alt-text-edit-button = + .aria-label = 编辑替换文字 +pdfjs-editor-alt-text-edit-button-label = 编辑替换文字 +pdfjs-editor-alt-text-dialog-label = 选择一项 +pdfjs-editor-alt-text-dialog-description = 替换文字可在用户无法看到或加载图像时,描述其内容。 +pdfjs-editor-alt-text-add-description-label = 添加描述 +pdfjs-editor-alt-text-add-description-description = 用一两个句子,描述主题、背景或动作。 +pdfjs-editor-alt-text-mark-decorative-label = 标记为装饰 +pdfjs-editor-alt-text-mark-decorative-description = 用于装饰的图像,例如边框和水印。 +pdfjs-editor-alt-text-cancel-button = 取消 +pdfjs-editor-alt-text-save-button = 保存 +pdfjs-editor-alt-text-decorative-tooltip = 已标记为装饰 +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = 例如:一个少年坐到桌前,准备吃饭 +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = 替换文字 + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = 调整尺寸 - 左上角 +pdfjs-editor-resizer-label-top-middle = 调整尺寸 - 顶部中间 +pdfjs-editor-resizer-label-top-right = 调整尺寸 - 右上角 +pdfjs-editor-resizer-label-middle-right = 调整尺寸 - 右侧中间 +pdfjs-editor-resizer-label-bottom-right = 调整尺寸 - 右下角 +pdfjs-editor-resizer-label-bottom-middle = 调整大小 - 底部中间 +pdfjs-editor-resizer-label-bottom-left = 调整尺寸 - 左下角 +pdfjs-editor-resizer-label-middle-left = 调整尺寸 - 左侧中间 +pdfjs-editor-resizer-top-left = + .aria-label = 调整尺寸 - 左上角 +pdfjs-editor-resizer-top-middle = + .aria-label = 调整尺寸 - 顶部中间 +pdfjs-editor-resizer-top-right = + .aria-label = 调整尺寸 - 右上角 +pdfjs-editor-resizer-middle-right = + .aria-label = 调整尺寸 - 右侧中间 +pdfjs-editor-resizer-bottom-right = + .aria-label = 调整尺寸 - 右下角 +pdfjs-editor-resizer-bottom-middle = + .aria-label = 调整大小 - 底部中间 +pdfjs-editor-resizer-bottom-left = + .aria-label = 调整尺寸 - 左下角 +pdfjs-editor-resizer-middle-left = + .aria-label = 调整尺寸 - 左侧中间 + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = 高亮色 +pdfjs-editor-colorpicker-button = + .title = 更改颜色 +pdfjs-editor-colorpicker-dropdown = + .aria-label = 颜色选择 +pdfjs-editor-colorpicker-yellow = + .title = 黄色 +pdfjs-editor-colorpicker-green = + .title = 绿色 +pdfjs-editor-colorpicker-blue = + .title = 蓝色 +pdfjs-editor-colorpicker-pink = + .title = 粉色 +pdfjs-editor-colorpicker-red = + .title = 红色 + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = 显示全部 +pdfjs-editor-highlight-show-all-button = + .title = 显示全部 + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = 编辑替换文字(图像描述) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = 添加替换文字(图像描述) +pdfjs-editor-new-alt-text-textarea = + .placeholder = 请在此处撰写描述… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = 向无法看到或加载图像的用户提供的简短描述。 +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = 此段替换文字为自动创建,有可能不准确。 +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = 详细了解 +pdfjs-editor-new-alt-text-create-automatically-button-label = 自动创建替换文字 +pdfjs-editor-new-alt-text-not-now-button = 暂时不要 +pdfjs-editor-new-alt-text-error-title = 无法自动创建替换文字 +pdfjs-editor-new-alt-text-error-description = 请自行撰写替换文字,或稍后再试。 +pdfjs-editor-new-alt-text-error-close-button = 关闭 +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = 正在下载提供替换文字的 AI 模型({ $downloadedSize }/{ $totalSize } MB) + .aria-valuetext = 正在下载提供替换文字的 AI 模型({ $downloadedSize }/{ $totalSize } MB) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = 已添加替换文字 +pdfjs-editor-new-alt-text-added-button-label = 已添加替换文字 +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = 缺少替换文字 +pdfjs-editor-new-alt-text-missing-button-label = 缺少替换文字 +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = 检查替换文字 +pdfjs-editor-new-alt-text-to-review-button-label = 检查替换文字 +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = [自动创建] { $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = 图像替换文字设置 +pdfjs-image-alt-text-settings-button-label = 图像替换文字设置 +pdfjs-editor-alt-text-settings-dialog-label = 图像替换文字设置 +pdfjs-editor-alt-text-settings-automatic-title = 自动创建替换文字 +pdfjs-editor-alt-text-settings-create-model-button-label = 自动创建替换文字 +pdfjs-editor-alt-text-settings-create-model-description = 向无法看到或加载图像的用户提供描述。 +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = 提供替换文字的 AI 模型({ $totalSize } MB) +pdfjs-editor-alt-text-settings-ai-model-description = 在您的设备本地运行,可使数据保持私密。自动创建替换文字需要使用此模型。 +pdfjs-editor-alt-text-settings-delete-model-button = 删除 +pdfjs-editor-alt-text-settings-download-model-button = 下载 +pdfjs-editor-alt-text-settings-downloading-model-button = 正在下载… +pdfjs-editor-alt-text-settings-editor-title = 替换文字编辑器 +pdfjs-editor-alt-text-settings-show-dialog-button-label = 添加图像后立即显示替换文字编辑器 +pdfjs-editor-alt-text-settings-show-dialog-description = 帮助确保所有图像均拥有替换文字。 +pdfjs-editor-alt-text-settings-close-button = 关闭 + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = 已移除高亮 +pdfjs-editor-undo-bar-message-freetext = 已移除文本 +pdfjs-editor-undo-bar-message-ink = 已移除绘图 +pdfjs-editor-undo-bar-message-stamp = 已移除图像 +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = 已移除 { $count } 条注释 +pdfjs-editor-undo-bar-undo-button = + .title = 撤销 +pdfjs-editor-undo-bar-undo-button-label = 撤销 +pdfjs-editor-undo-bar-close-button = + .title = 关闭 +pdfjs-editor-undo-bar-close-button-label = 关闭 diff --git a/public/pdfjs/web/locale/zh-TW/viewer.ftl b/public/pdfjs/web/locale/zh-TW/viewer.ftl new file mode 100644 index 0000000..bc4b7ef --- /dev/null +++ b/public/pdfjs/web/locale/zh-TW/viewer.ftl @@ -0,0 +1,503 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +## Main toolbar buttons (tooltips and alt text for images) + +pdfjs-previous-button = + .title = 上一頁 +pdfjs-previous-button-label = 上一頁 +pdfjs-next-button = + .title = 下一頁 +pdfjs-next-button-label = 下一頁 +# .title: Tooltip for the pageNumber input. +pdfjs-page-input = + .title = 第 +# Variables: +# $pagesCount (Number) - the total number of pages in the document +# This string follows an input field with the number of the page currently displayed. +pdfjs-of-pages = 頁,共 { $pagesCount } 頁 +# Variables: +# $pageNumber (Number) - the currently visible page +# $pagesCount (Number) - the total number of pages in the document +pdfjs-page-of-pages = (第 { $pageNumber } 頁,共 { $pagesCount } 頁) +pdfjs-zoom-out-button = + .title = 縮小 +pdfjs-zoom-out-button-label = 縮小 +pdfjs-zoom-in-button = + .title = 放大 +pdfjs-zoom-in-button-label = 放大 +pdfjs-zoom-select = + .title = 縮放 +pdfjs-presentation-mode-button = + .title = 切換至簡報模式 +pdfjs-presentation-mode-button-label = 簡報模式 +pdfjs-open-file-button = + .title = 開啟檔案 +pdfjs-open-file-button-label = 開啟 +pdfjs-print-button = + .title = 列印 +pdfjs-print-button-label = 列印 +pdfjs-save-button = + .title = 儲存 +pdfjs-save-button-label = 儲存 +# Used in Firefox for Android as a tooltip for the download button (“download” is a verb). +pdfjs-download-button = + .title = 下載 +# Used in Firefox for Android as a label for the download button (“download” is a verb). +# Length of the translation matters since we are in a mobile context, with limited screen estate. +pdfjs-download-button-label = 下載 +pdfjs-bookmark-button = + .title = 目前頁面(含目前檢視頁面的網址) +pdfjs-bookmark-button-label = 目前頁面 + +## Secondary toolbar and context menu + +pdfjs-tools-button = + .title = 工具 +pdfjs-tools-button-label = 工具 +pdfjs-first-page-button = + .title = 跳到第一頁 +pdfjs-first-page-button-label = 跳到第一頁 +pdfjs-last-page-button = + .title = 跳到最後一頁 +pdfjs-last-page-button-label = 跳到最後一頁 +pdfjs-page-rotate-cw-button = + .title = 順時針旋轉 +pdfjs-page-rotate-cw-button-label = 順時針旋轉 +pdfjs-page-rotate-ccw-button = + .title = 逆時針旋轉 +pdfjs-page-rotate-ccw-button-label = 逆時針旋轉 +pdfjs-cursor-text-select-tool-button = + .title = 開啟文字選擇工具 +pdfjs-cursor-text-select-tool-button-label = 文字選擇工具 +pdfjs-cursor-hand-tool-button = + .title = 開啟頁面移動工具 +pdfjs-cursor-hand-tool-button-label = 頁面移動工具 +pdfjs-scroll-page-button = + .title = 使用單頁捲動版面 +pdfjs-scroll-page-button-label = 單頁捲動 +pdfjs-scroll-vertical-button = + .title = 使用垂直捲動版面 +pdfjs-scroll-vertical-button-label = 垂直捲動 +pdfjs-scroll-horizontal-button = + .title = 使用水平捲動版面 +pdfjs-scroll-horizontal-button-label = 水平捲動 +pdfjs-scroll-wrapped-button = + .title = 使用多頁捲動版面 +pdfjs-scroll-wrapped-button-label = 多頁捲動 +pdfjs-spread-none-button = + .title = 不要進行跨頁顯示 +pdfjs-spread-none-button-label = 不跨頁 +pdfjs-spread-odd-button = + .title = 從奇數頁開始跨頁 +pdfjs-spread-odd-button-label = 奇數跨頁 +pdfjs-spread-even-button = + .title = 從偶數頁開始跨頁 +pdfjs-spread-even-button-label = 偶數跨頁 + +## Document properties dialog + +pdfjs-document-properties-button = + .title = 文件內容… +pdfjs-document-properties-button-label = 文件內容… +pdfjs-document-properties-file-name = 檔案名稱: +pdfjs-document-properties-file-size = 檔案大小: +# Variables: +# $kb (Number) - the PDF file size in kilobytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB({ $b } 位元組) +# Variables: +# $mb (Number) - the PDF file size in megabytes +# $b (Number) - the PDF file size in bytes +pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB({ $b } 位元組) +# Variables: +# $size_kb (Number) - the PDF file size in kilobytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-kb = { $size_kb } KB({ $size_b } 位元組) +# Variables: +# $size_mb (Number) - the PDF file size in megabytes +# $size_b (Number) - the PDF file size in bytes +pdfjs-document-properties-mb = { $size_mb } MB({ $size_b } 位元組) +pdfjs-document-properties-title = 標題: +pdfjs-document-properties-author = 作者: +pdfjs-document-properties-subject = 主旨: +pdfjs-document-properties-keywords = 關鍵字: +pdfjs-document-properties-creation-date = 建立日期: +pdfjs-document-properties-modification-date = 修改日期: +# Variables: +# $dateObj (Date) - the creation/modification date and time of the PDF file +pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } +# Variables: +# $date (Date) - the creation/modification date of the PDF file +# $time (Time) - the creation/modification time of the PDF file +pdfjs-document-properties-date-string = { $date } { $time } +pdfjs-document-properties-creator = 建立者: +pdfjs-document-properties-producer = PDF 產生器: +pdfjs-document-properties-version = PDF 版本: +pdfjs-document-properties-page-count = 頁數: +pdfjs-document-properties-page-size = 頁面大小: +pdfjs-document-properties-page-size-unit-inches = in +pdfjs-document-properties-page-size-unit-millimeters = mm +pdfjs-document-properties-page-size-orientation-portrait = 垂直 +pdfjs-document-properties-page-size-orientation-landscape = 水平 +pdfjs-document-properties-page-size-name-a-three = A3 +pdfjs-document-properties-page-size-name-a-four = A4 +pdfjs-document-properties-page-size-name-letter = Letter +pdfjs-document-properties-page-size-name-legal = Legal + +## Variables: +## $width (Number) - the width of the (current) page +## $height (Number) - the height of the (current) page +## $unit (String) - the unit of measurement of the (current) page +## $name (String) - the name of the (current) page +## $orientation (String) - the orientation of the (current) page + +pdfjs-document-properties-page-size-dimension-string = { $width } × { $height } { $unit }({ $orientation }) +pdfjs-document-properties-page-size-dimension-name-string = { $width } × { $height } { $unit }({ $name },{ $orientation }) + +## + +# The linearization status of the document; usually called "Fast Web View" in +# English locales of Adobe software. +pdfjs-document-properties-linearized = 快速 Web 檢視: +pdfjs-document-properties-linearized-yes = 是 +pdfjs-document-properties-linearized-no = 否 +pdfjs-document-properties-close-button = 關閉 + +## Print + +pdfjs-print-progress-message = 正在準備列印文件… +# Variables: +# $progress (Number) - percent value +pdfjs-print-progress-percent = { $progress }% +pdfjs-print-progress-close-button = 取消 +pdfjs-printing-not-supported = 警告: 此瀏覽器未完整支援列印功能。 +pdfjs-printing-not-ready = 警告: 此 PDF 未完成下載以供列印。 + +## Tooltips and alt text for side panel toolbar buttons + +pdfjs-toggle-sidebar-button = + .title = 切換側邊欄 +pdfjs-toggle-sidebar-notification-button = + .title = 切換側邊欄(包含大綱、附件、圖層的文件) +pdfjs-toggle-sidebar-button-label = 切換側邊欄 +pdfjs-document-outline-button = + .title = 顯示文件大綱(雙擊展開/摺疊所有項目) +pdfjs-document-outline-button-label = 文件大綱 +pdfjs-attachments-button = + .title = 顯示附件 +pdfjs-attachments-button-label = 附件 +pdfjs-layers-button = + .title = 顯示圖層(滑鼠雙擊即可將所有圖層重設為預設狀態) +pdfjs-layers-button-label = 圖層 +pdfjs-thumbs-button = + .title = 顯示縮圖 +pdfjs-thumbs-button-label = 縮圖 +pdfjs-current-outline-item-button = + .title = 尋找目前的大綱項目 +pdfjs-current-outline-item-button-label = 目前的大綱項目 +pdfjs-findbar-button = + .title = 在文件中尋找 +pdfjs-findbar-button-label = 尋找 +pdfjs-additional-layers = 其他圖層 + +## Thumbnails panel item (tooltip and alt text for images) + +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-title = + .title = 第 { $page } 頁 +# Variables: +# $page (Number) - the page number +pdfjs-thumb-page-canvas = + .aria-label = 第 { $page } 頁的縮圖 + +## Find panel button title and messages + +pdfjs-find-input = + .title = 尋找 + .placeholder = 在文件中搜尋… +pdfjs-find-previous-button = + .title = 尋找文字前次出現的位置 +pdfjs-find-previous-button-label = 上一個 +pdfjs-find-next-button = + .title = 尋找文字下次出現的位置 +pdfjs-find-next-button-label = 下一個 +pdfjs-find-highlight-checkbox = 強調全部 +pdfjs-find-match-case-checkbox-label = 區分大小寫 +pdfjs-find-match-diacritics-checkbox-label = 符合變音符號 +pdfjs-find-entire-word-checkbox-label = 符合整個字 +pdfjs-find-reached-top = 已搜尋至文件頂端,自底端繼續搜尋 +pdfjs-find-reached-bottom = 已搜尋至文件底端,自頂端繼續搜尋 +# Variables: +# $current (Number) - the index of the currently active find result +# $total (Number) - the total number of matches in the document +pdfjs-find-match-count = 第 { $current } 筆符合,共符合 { $total } 筆 +# Variables: +# $limit (Number) - the maximum number of matches +pdfjs-find-match-count-limit = 符合超過 { $limit } 項 +pdfjs-find-not-found = 找不到指定文字 + +## Predefined zoom values + +pdfjs-page-scale-width = 頁面寬度 +pdfjs-page-scale-fit = 縮放至頁面大小 +pdfjs-page-scale-auto = 自動縮放 +pdfjs-page-scale-actual = 實際大小 +# Variables: +# $scale (Number) - percent value for page scale +pdfjs-page-scale-percent = { $scale }% + +## PDF page + +# Variables: +# $page (Number) - the page number +pdfjs-page-landmark = + .aria-label = 第 { $page } 頁 + +## Loading indicator messages + +pdfjs-loading-error = 載入 PDF 時發生錯誤。 +pdfjs-invalid-file-error = 無效或毀損的 PDF 檔案。 +pdfjs-missing-file-error = 找不到 PDF 檔案。 +pdfjs-unexpected-response-error = 伺服器回應未預期的內容。 +pdfjs-rendering-error = 描繪頁面時發生錯誤。 + +## Annotations + +# Variables: +# $date (Date) - the modification date of the annotation +# $time (Time) - the modification time of the annotation +pdfjs-annotation-date-string = { $date } { $time } +# .alt: This is used as a tooltip. +# Variables: +# $type (String) - an annotation type from a list defined in the PDF spec +# (32000-1:2008 Table 169 – Annotation types). +# Some common types are e.g.: "Check", "Text", "Comment", "Note" +pdfjs-text-annotation-type = + .alt = [{ $type } 註解] +# Variables: +# $dateObj (Date) - the modification date and time of the annotation +pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } + +## Password + +pdfjs-password-label = 請輸入用來開啟此 PDF 檔案的密碼。 +pdfjs-password-invalid = 密碼不正確,請再試一次。 +pdfjs-password-ok-button = 確定 +pdfjs-password-cancel-button = 取消 +pdfjs-web-fonts-disabled = 已停用網路字型 (Web fonts): 無法使用 PDF 內嵌字型。 + +## Editing + +pdfjs-editor-free-text-button = + .title = 文字 +pdfjs-editor-free-text-button-label = 文字 +pdfjs-editor-ink-button = + .title = 繪圖 +pdfjs-editor-ink-button-label = 繪圖 +pdfjs-editor-stamp-button = + .title = 新增或編輯圖片 +pdfjs-editor-stamp-button-label = 新增或編輯圖片 +pdfjs-editor-highlight-button = + .title = 強調 +pdfjs-editor-highlight-button-label = 強調 +pdfjs-highlight-floating-button1 = + .title = 強調 + .aria-label = 強調 +pdfjs-highlight-floating-button-label = 強調 + +## Remove button for the various kind of editor. + +pdfjs-editor-remove-ink-button = + .title = 移除繪圖 +pdfjs-editor-remove-freetext-button = + .title = 移除文字 +pdfjs-editor-remove-stamp-button = + .title = 移除圖片 +pdfjs-editor-remove-highlight-button = + .title = 移除強調範圍 + +## + +# Editor Parameters +pdfjs-editor-free-text-color-input = 色彩 +pdfjs-editor-free-text-size-input = 大小 +pdfjs-editor-ink-color-input = 色彩 +pdfjs-editor-ink-thickness-input = 線條粗細 +pdfjs-editor-ink-opacity-input = 透​明度 +pdfjs-editor-stamp-add-image-button = + .title = 新增圖片 +pdfjs-editor-stamp-add-image-button-label = 新增圖片 +# This refers to the thickness of the line used for free highlighting (not bound to text) +pdfjs-editor-free-highlight-thickness-input = 線條粗細 +pdfjs-editor-free-highlight-thickness-title = + .title = 更改強調文字以外的項目時的線條粗細 +# .default-content is used as a placeholder in an empty text editor. +pdfjs-free-text2 = + .aria-label = 文字編輯器 + .default-content = 請打字… +pdfjs-free-text = + .aria-label = 文本編輯器 +pdfjs-free-text-default-content = 在此打字… +pdfjs-ink = + .aria-label = 圖形編輯器 +pdfjs-ink-canvas = + .aria-label = 使用者建立的圖片 + +## Alt-text dialog + +pdfjs-editor-alt-text-button-label = 替代文字 +pdfjs-editor-alt-text-edit-button = + .aria-label = 編輯替代文字 +pdfjs-editor-alt-text-edit-button-label = 編輯替代文字 +pdfjs-editor-alt-text-dialog-label = 挑選一種 +pdfjs-editor-alt-text-dialog-description = 替代文字可協助盲人,或於圖片無法載入時提供說明。 +pdfjs-editor-alt-text-add-description-label = 新增描述 +pdfjs-editor-alt-text-add-description-description = 用 1-2 句文字描述主題、背景或動作。 +pdfjs-editor-alt-text-mark-decorative-label = 標示為裝飾性內容 +pdfjs-editor-alt-text-mark-decorative-description = 這是裝飾性圖片,例如邊框或浮水印。 +pdfjs-editor-alt-text-cancel-button = 取消 +pdfjs-editor-alt-text-save-button = 儲存 +pdfjs-editor-alt-text-decorative-tooltip = 已標示為裝飾性內容 +# .placeholder: This is a placeholder for the alt text input area +pdfjs-editor-alt-text-textarea = + .placeholder = 例如:「有一位年輕男人坐在桌子前面吃飯」 +# Alternative text (alt text) helps when people can't see the image. +pdfjs-editor-alt-text-button = + .aria-label = 替代文字 + +## Editor resizers +## This is used in an aria label to help to understand the role of the resizer. + +pdfjs-editor-resizer-label-top-left = 左上角 — 調整大小 +pdfjs-editor-resizer-label-top-middle = 頂部中間 — 調整大小 +pdfjs-editor-resizer-label-top-right = 右上角 — 調整大小 +pdfjs-editor-resizer-label-middle-right = 中間右方 — 調整大小 +pdfjs-editor-resizer-label-bottom-right = 右下角 — 調整大小 +pdfjs-editor-resizer-label-bottom-middle = 底部中間 — 調整大小 +pdfjs-editor-resizer-label-bottom-left = 左下角 — 調整大小 +pdfjs-editor-resizer-label-middle-left = 中間左方 — 調整大小 +pdfjs-editor-resizer-top-left = + .aria-label = 左上角 — 調整大小 +pdfjs-editor-resizer-top-middle = + .aria-label = 頂部中間 — 調整大小 +pdfjs-editor-resizer-top-right = + .aria-label = 右上角 — 調整大小 +pdfjs-editor-resizer-middle-right = + .aria-label = 中間右方 — 調整大小 +pdfjs-editor-resizer-bottom-right = + .aria-label = 右下角 — 調整大小 +pdfjs-editor-resizer-bottom-middle = + .aria-label = 底部中間 — 調整大小 +pdfjs-editor-resizer-bottom-left = + .aria-label = 左下角 — 調整大小 +pdfjs-editor-resizer-middle-left = + .aria-label = 中間左方 — 調整大小 + +## Color picker + +# This means "Color used to highlight text" +pdfjs-editor-highlight-colorpicker-label = 強調色彩 +pdfjs-editor-colorpicker-button = + .title = 更改色彩 +pdfjs-editor-colorpicker-dropdown = + .aria-label = 色彩選項 +pdfjs-editor-colorpicker-yellow = + .title = 黃色 +pdfjs-editor-colorpicker-green = + .title = 綠色 +pdfjs-editor-colorpicker-blue = + .title = 藍色 +pdfjs-editor-colorpicker-pink = + .title = 粉紅色 +pdfjs-editor-colorpicker-red = + .title = 紅色 + +## Show all highlights +## This is a toggle button to show/hide all the highlights. + +pdfjs-editor-highlight-show-all-button-label = 顯示全部 +pdfjs-editor-highlight-show-all-button = + .title = 顯示全部 + +## New alt-text dialog +## Group note for entire feature: Alternative text (alt text) helps when people can't see the image. This feature includes a tool to create alt text automatically using an AI model that works locally on the user's device to preserve privacy. + +# Modal header positioned above a text box where users can edit the alt text. +pdfjs-editor-new-alt-text-dialog-edit-label = 編輯替代文字(圖片描述) +# Modal header positioned above a text box where users can add the alt text. +pdfjs-editor-new-alt-text-dialog-add-label = 新增替代文字(圖片描述) +pdfjs-editor-new-alt-text-textarea = + .placeholder = 在此寫下您的描述文字… +# This text refers to the alt text box above this description. It offers a definition of alt text. +pdfjs-editor-new-alt-text-description = 為看不到圖片的讀者,或圖片無法載入時顯示的簡短描述。 +# This is a required legal disclaimer that refers to the automatically created text inside the alt text box above this text. It disappears if the text is edited by a human. +pdfjs-editor-new-alt-text-disclaimer1 = 此替代文字是自動產生的,可能不夠精確。 +pdfjs-editor-new-alt-text-disclaimer-learn-more-url = 更多資訊 +pdfjs-editor-new-alt-text-create-automatically-button-label = 自動產生替代文字 +pdfjs-editor-new-alt-text-not-now-button = 暫時不要 +pdfjs-editor-new-alt-text-error-title = 無法自動產生替代文字 +pdfjs-editor-new-alt-text-error-description = 請自行填寫替代文字,或稍後再試一次。 +pdfjs-editor-new-alt-text-error-close-button = 關閉 +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +# $downloadedSize (Number) - the downloaded size (in MB) of the AI model. +# $percent (Number) - the percentage of the downloaded size. +pdfjs-editor-new-alt-text-ai-model-downloading-progress = 正在下載替代文字 AI 模型({ $downloadedSize } / { $totalSize } MB) + .aria-valuetext = 正在下載替代文字 AI 模型({ $downloadedSize } / { $totalSize } MB) +# This is a button that users can click to edit the alt text they have already added. +pdfjs-editor-new-alt-text-added-button = + .aria-label = 已新增替代文字 +pdfjs-editor-new-alt-text-added-button-label = 已新增替代文字 +# This is a button that users can click to open the alt text editor and add alt text when it is not present. +pdfjs-editor-new-alt-text-missing-button = + .aria-label = 缺少替代文字 +pdfjs-editor-new-alt-text-missing-button-label = 缺少替代文字 +# This is a button that opens up the alt text modal where users should review the alt text that was automatically generated. +pdfjs-editor-new-alt-text-to-review-button = + .aria-label = 確認替代文字 +pdfjs-editor-new-alt-text-to-review-button-label = 確認替代文字 +# "Created automatically" is a prefix that will be added to the beginning of any alt text that has been automatically generated. After the colon, the user will see/hear the actual alt text description. If the alt text has been edited by a human, this prefix will not appear. +# Variables: +# $generatedAltText (String) - the generated alt-text. +pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = 自動產生:{ $generatedAltText } + +## Image alt-text settings + +pdfjs-image-alt-text-settings-button = + .title = 圖片替代文字設定 +pdfjs-image-alt-text-settings-button-label = 圖片替代文字設定 +pdfjs-editor-alt-text-settings-dialog-label = 圖片替代文字設定 +pdfjs-editor-alt-text-settings-automatic-title = 自動化替代文字 +pdfjs-editor-alt-text-settings-create-model-button-label = 自動產生替代文字 +pdfjs-editor-alt-text-settings-create-model-description = 為您建議圖片描述,幫助看不到圖片的讀者,或於圖片無法載入時顯示。 +# Variables: +# $totalSize (Number) - the total size (in MB) of the AI model. +pdfjs-editor-alt-text-settings-download-model-label = 替代文字 AI 模型({ $totalSize } MB) +pdfjs-editor-alt-text-settings-ai-model-description = 在您的本機裝置上運作,以確保您的資料隱私。必須下載此模型才可以自動產生替代文字。 +pdfjs-editor-alt-text-settings-delete-model-button = 刪除 +pdfjs-editor-alt-text-settings-download-model-button = 下載 +pdfjs-editor-alt-text-settings-downloading-model-button = 下載中… +pdfjs-editor-alt-text-settings-editor-title = 替代文字編輯器 +pdfjs-editor-alt-text-settings-show-dialog-button-label = 新增圖片後立即顯示替代文字編輯器 +pdfjs-editor-alt-text-settings-show-dialog-description = 幫助您確保所有圖片都有替代文字。 +pdfjs-editor-alt-text-settings-close-button = 關閉 + +## "Annotations removed" bar + +pdfjs-editor-undo-bar-message-highlight = 已移除強調 +pdfjs-editor-undo-bar-message-freetext = 已移除文字 +pdfjs-editor-undo-bar-message-ink = 已移除繪圖 +pdfjs-editor-undo-bar-message-stamp = 已移除圖片 +# Variables: +# $count (Number) - the number of removed annotations. +pdfjs-editor-undo-bar-message-multiple = 已移除 { $count } 筆註解 +pdfjs-editor-undo-bar-undo-button = + .title = 還原 +pdfjs-editor-undo-bar-undo-button-label = 還原 +pdfjs-editor-undo-bar-close-button = + .title = 關閉 +pdfjs-editor-undo-bar-close-button-label = 關閉 diff --git a/public/pdfjs/web/standard_fonts/FoxitDingbats.pfb b/public/pdfjs/web/standard_fonts/FoxitDingbats.pfb new file mode 100644 index 0000000..30d5296 Binary files /dev/null and b/public/pdfjs/web/standard_fonts/FoxitDingbats.pfb differ diff --git a/public/pdfjs/web/standard_fonts/FoxitFixed.pfb b/public/pdfjs/web/standard_fonts/FoxitFixed.pfb new file mode 100644 index 0000000..f12dcbc Binary files /dev/null and b/public/pdfjs/web/standard_fonts/FoxitFixed.pfb differ diff --git a/public/pdfjs/web/standard_fonts/FoxitFixedBold.pfb b/public/pdfjs/web/standard_fonts/FoxitFixedBold.pfb new file mode 100644 index 0000000..cf8e24a Binary files /dev/null and b/public/pdfjs/web/standard_fonts/FoxitFixedBold.pfb differ diff --git a/public/pdfjs/web/standard_fonts/FoxitFixedBoldItalic.pfb b/public/pdfjs/web/standard_fonts/FoxitFixedBoldItalic.pfb new file mode 100644 index 0000000..d288001 Binary files /dev/null and b/public/pdfjs/web/standard_fonts/FoxitFixedBoldItalic.pfb differ diff --git a/public/pdfjs/web/standard_fonts/FoxitFixedItalic.pfb b/public/pdfjs/web/standard_fonts/FoxitFixedItalic.pfb new file mode 100644 index 0000000..d71697d Binary files /dev/null and b/public/pdfjs/web/standard_fonts/FoxitFixedItalic.pfb differ diff --git a/public/pdfjs/web/standard_fonts/FoxitSerif.pfb b/public/pdfjs/web/standard_fonts/FoxitSerif.pfb new file mode 100644 index 0000000..3fa682e Binary files /dev/null and b/public/pdfjs/web/standard_fonts/FoxitSerif.pfb differ diff --git a/public/pdfjs/web/standard_fonts/FoxitSerifBold.pfb b/public/pdfjs/web/standard_fonts/FoxitSerifBold.pfb new file mode 100644 index 0000000..ff7c6dd Binary files /dev/null and b/public/pdfjs/web/standard_fonts/FoxitSerifBold.pfb differ diff --git a/public/pdfjs/web/standard_fonts/FoxitSerifBoldItalic.pfb b/public/pdfjs/web/standard_fonts/FoxitSerifBoldItalic.pfb new file mode 100644 index 0000000..460231f Binary files /dev/null and b/public/pdfjs/web/standard_fonts/FoxitSerifBoldItalic.pfb differ diff --git a/public/pdfjs/web/standard_fonts/FoxitSerifItalic.pfb b/public/pdfjs/web/standard_fonts/FoxitSerifItalic.pfb new file mode 100644 index 0000000..d03a7c7 Binary files /dev/null and b/public/pdfjs/web/standard_fonts/FoxitSerifItalic.pfb differ diff --git a/public/pdfjs/web/standard_fonts/FoxitSymbol.pfb b/public/pdfjs/web/standard_fonts/FoxitSymbol.pfb new file mode 100644 index 0000000..c8f9bca Binary files /dev/null and b/public/pdfjs/web/standard_fonts/FoxitSymbol.pfb differ diff --git a/public/pdfjs/web/standard_fonts/LICENSE_FOXIT b/public/pdfjs/web/standard_fonts/LICENSE_FOXIT new file mode 100644 index 0000000..8b4ed6d --- /dev/null +++ b/public/pdfjs/web/standard_fonts/LICENSE_FOXIT @@ -0,0 +1,27 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/public/pdfjs/web/standard_fonts/LICENSE_LIBERATION b/public/pdfjs/web/standard_fonts/LICENSE_LIBERATION new file mode 100644 index 0000000..aba73e8 --- /dev/null +++ b/public/pdfjs/web/standard_fonts/LICENSE_LIBERATION @@ -0,0 +1,102 @@ +Digitized data copyright (c) 2010 Google Corporation + with Reserved Font Arimo, Tinos and Cousine. +Copyright (c) 2012 Red Hat, Inc. + with Reserved Font Name Liberation. + +This Font Software is licensed under the SIL Open Font License, +Version 1.1. + +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 + +PREAMBLE The goals of the Open Font License (OFL) are to stimulate +worldwide development of collaborative font projects, to support the font +creation efforts of academic and linguistic communities, and to provide +a free and open framework in which fonts may be shared and improved in +partnership with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. +The fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply to +any document created using the fonts or their derivatives. + + + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. +This may include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components +as distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting ? in part or in whole ? +any of the components of the Original Version, by changing formats or +by porting the Font Software to a new environment. + +"Author" refers to any designer, engineer, programmer, technical writer +or other person who contributed to the Font Software. + + +PERMISSION & CONDITIONS + +Permission is hereby granted, free of charge, to any person obtaining a +copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components,in + Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, + redistributed and/or sold with any software, provided that each copy + contains the above copyright notice and this license. These can be + included either as stand-alone text files, human-readable headers or + in the appropriate machine-readable metadata fields within text or + binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font + Name(s) unless explicit written permission is granted by the + corresponding Copyright Holder. This restriction only applies to the + primary font name as presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font + Software shall not be used to promote, endorse or advertise any + Modified Version, except to acknowledge the contribution(s) of the + Copyright Holder(s) and the Author(s) or with their explicit written + permission. + +5) The Font Software, modified or unmodified, in part or in whole, must + be distributed entirely under this license, and must not be distributed + under any other license. The requirement for fonts to remain under + this license does not apply to any document created using the Font + Software. + + + +TERMINATION +This license becomes null and void if any of the above conditions are not met. + + + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER +DEALINGS IN THE FONT SOFTWARE. + diff --git a/public/pdfjs/web/standard_fonts/LiberationSans-Bold.ttf b/public/pdfjs/web/standard_fonts/LiberationSans-Bold.ttf new file mode 100644 index 0000000..ee23715 Binary files /dev/null and b/public/pdfjs/web/standard_fonts/LiberationSans-Bold.ttf differ diff --git a/public/pdfjs/web/standard_fonts/LiberationSans-BoldItalic.ttf b/public/pdfjs/web/standard_fonts/LiberationSans-BoldItalic.ttf new file mode 100644 index 0000000..42b5717 Binary files /dev/null and b/public/pdfjs/web/standard_fonts/LiberationSans-BoldItalic.ttf differ diff --git a/public/pdfjs/web/standard_fonts/LiberationSans-Italic.ttf b/public/pdfjs/web/standard_fonts/LiberationSans-Italic.ttf new file mode 100644 index 0000000..0cf6126 Binary files /dev/null and b/public/pdfjs/web/standard_fonts/LiberationSans-Italic.ttf differ diff --git a/public/pdfjs/web/standard_fonts/LiberationSans-Regular.ttf b/public/pdfjs/web/standard_fonts/LiberationSans-Regular.ttf new file mode 100644 index 0000000..366d148 Binary files /dev/null and b/public/pdfjs/web/standard_fonts/LiberationSans-Regular.ttf differ diff --git a/public/pdfjs/web/viewer.css b/public/pdfjs/web/viewer.css new file mode 100644 index 0000000..a3f33a3 --- /dev/null +++ b/public/pdfjs/web/viewer.css @@ -0,0 +1,6438 @@ +/* Copyright 2014 Mozilla Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +.messageBar { + --closing-button-icon: url(images/messageBar_closingButton.svg); + --message-bar-close-button-color: var(--text-primary-color); + --message-bar-close-button-color-hover: var(--text-primary-color); + --message-bar-close-button-border-radius: 4px; + --message-bar-close-button-border: none; + --message-bar-close-button-hover-bg-color: rgb(21 20 26 / 0.14); + --message-bar-close-button-active-bg-color: rgb(21 20 26 / 0.21); + --message-bar-close-button-focus-bg-color: rgb(21 20 26 / 0.07); +} + +@media (prefers-color-scheme: dark) { + :where(html:not(.is-light)) .messageBar { + --message-bar-close-button-hover-bg-color: rgb(251 251 254 / 0.14); + --message-bar-close-button-active-bg-color: rgb(251 251 254 / 0.21); + --message-bar-close-button-focus-bg-color: rgb(251 251 254 / 0.07); + } +} + +:where(html.is-dark) .messageBar { + --message-bar-close-button-hover-bg-color: rgb(251 251 254 / 0.14); + --message-bar-close-button-active-bg-color: rgb(251 251 254 / 0.21); + --message-bar-close-button-focus-bg-color: rgb(251 251 254 / 0.07); +} + +@media screen and (forced-colors: active) { + .messageBar { + --message-bar-close-button-color: ButtonText; + --message-bar-close-button-border: 1px solid ButtonText; + --message-bar-close-button-hover-bg-color: ButtonText; + --message-bar-close-button-active-bg-color: ButtonText; + --message-bar-close-button-focus-bg-color: ButtonText; + --message-bar-close-button-color-hover: HighlightText; + } +} + +.messageBar { + display: flex; + position: relative; + padding: 8px 8px 8px 16px; + flex-direction: column; + justify-content: center; + align-items: center; + gap: 8px; + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; + + border-radius: 4px; + + border: 1px solid var(--message-bar-border-color); + background: var(--message-bar-bg-color); + color: var(--message-bar-fg-color); +} + +.messageBar > div { + display: flex; + align-items: flex-start; + gap: 8px; + align-self: stretch; +} + +:is(.messageBar > div)::before { + -webkit-mask-image: var(--message-bar-icon); + -webkit-mask-size: cover; + background-color: var(--message-bar-icon-color); + content: ''; + display: inline-block; + flex-shrink: 0; + height: 16px; + mask-image: var(--message-bar-icon); + mask-size: cover; + width: 16px; +} + +.messageBar button { + cursor: pointer; +} + +:is(.messageBar button):focus-visible { + outline: var(--focus-ring-outline); + outline-offset: 2px; +} + +.messageBar .closeButton { + width: 32px; + height: 32px; + background: none; + border-radius: var(--message-bar-close-button-border-radius); + border: var(--message-bar-close-button-border); + + display: flex; + align-items: center; + justify-content: center; +} + +:is(.messageBar .closeButton)::before { + content: ''; + display: inline-block; + width: 16px; + height: 16px; + -webkit-mask-image: var(--closing-button-icon); + mask-image: var(--closing-button-icon); + -webkit-mask-size: cover; + mask-size: cover; + background-color: var(--message-bar-close-button-color); +} + +:is(.messageBar .closeButton):is(:hover, :active, :focus)::before { + background-color: var(--message-bar-close-button-color-hover); +} + +:is(.messageBar .closeButton):hover { + background-color: var(--message-bar-close-button-hover-bg-color); +} + +:is(.messageBar .closeButton):active { + background-color: var(--message-bar-close-button-active-bg-color); +} + +:is(.messageBar .closeButton):focus { + background-color: var(--message-bar-close-button-focus-bg-color); +} + +:is(.messageBar .closeButton) > span { + display: inline-block; + width: 0; + height: 0; + overflow: hidden; +} + +#editorUndoBar { + --text-primary-color: #15141a; + + --message-bar-icon: url(images/secondaryToolbarButton-documentProperties.svg); + --message-bar-icon-color: #0060df; + --message-bar-bg-color: #deeafc; + --message-bar-fg-color: var(--text-primary-color); + --message-bar-border-color: rgb(0 0 0 / 0.08); + + --undo-button-bg-color: rgb(21 20 26 / 0.07); + --undo-button-bg-color-hover: rgb(21 20 26 / 0.14); + --undo-button-bg-color-active: rgb(21 20 26 / 0.21); + + --undo-button-fg-color: var(--message-bar-fg-color); + --undo-button-fg-color-hover: var(--undo-button-fg-color); + --undo-button-fg-color-active: var(--undo-button-fg-color); + + --focus-ring-color: #0060df; + --focus-ring-outline: 2px solid var(--focus-ring-color); +} + +@media (prefers-color-scheme: dark) { + :where(html:not(.is-light)) #editorUndoBar { + --text-primary-color: #fbfbfe; + + --message-bar-icon-color: #73a7f3; + --message-bar-bg-color: #003070; + --message-bar-border-color: rgb(255 255 255 / 0.08); + + --undo-button-bg-color: rgb(255 255 255 / 0.08); + --undo-button-bg-color-hover: rgb(255 255 255 / 0.14); + --undo-button-bg-color-active: rgb(255 255 255 / 0.21); + } +} + +:where(html.is-dark) #editorUndoBar { + --text-primary-color: #fbfbfe; + + --message-bar-icon-color: #73a7f3; + --message-bar-bg-color: #003070; + --message-bar-border-color: rgb(255 255 255 / 0.08); + + --undo-button-bg-color: rgb(255 255 255 / 0.08); + --undo-button-bg-color-hover: rgb(255 255 255 / 0.14); + --undo-button-bg-color-active: rgb(255 255 255 / 0.21); +} + +@media screen and (forced-colors: active) { + #editorUndoBar { + --text-primary-color: CanvasText; + + --message-bar-icon-color: CanvasText; + --message-bar-bg-color: Canvas; + --message-bar-border-color: CanvasText; + + --undo-button-bg-color: ButtonText; + --undo-button-bg-color-hover: SelectedItem; + --undo-button-bg-color-active: SelectedItem; + + --undo-button-fg-color: ButtonFace; + --undo-button-fg-color-hover: SelectedItemText; + --undo-button-fg-color-active: SelectedItemText; + + --focus-ring-color: CanvasText; + } +} + +#editorUndoBar { + position: fixed; + top: 50px; + left: 50%; + transform: translateX(-50%); + z-index: 10; + + padding-block: 8px; + padding-inline: 16px 8px; + + font: menu; + font-size: 15px; + + cursor: default; +} + +#editorUndoBar button { + cursor: pointer; +} + +#editorUndoBar #editorUndoBarUndoButton { + border-radius: 4px; + font-weight: 590; + line-height: 19.5px; + color: var(--undo-button-fg-color); + border: none; + padding: 4px 16px; + margin-inline-start: 8px; + height: 32px; + + background-color: var(--undo-button-bg-color); +} + +:is(#editorUndoBar #editorUndoBarUndoButton):hover { + background-color: var(--undo-button-bg-color-hover); + color: var(--undo-button-fg-color-hover); +} + +:is(#editorUndoBar #editorUndoBarUndoButton):active { + background-color: var(--undo-button-bg-color-active); + color: var(--undo-button-fg-color-active); +} + +#editorUndoBar > div { + align-items: center; +} + +.dialog { + --dialog-bg-color: white; + --dialog-border-color: white; + --dialog-shadow: 0 2px 14px 0 rgb(58 57 68 / 0.2); + --text-primary-color: #15141a; + --text-secondary-color: #5b5b66; + --hover-filter: brightness(0.9); + --focus-ring-color: #0060df; + --focus-ring-outline: 2px solid var(--focus-ring-color); + --link-fg-color: #0060df; + --link-hover-fg-color: #0250bb; + --separator-color: #f0f0f4; + + --textarea-border-color: #8f8f9d; + --textarea-bg-color: white; + --textarea-fg-color: var(--text-secondary-color); + + --radio-bg-color: #f0f0f4; + --radio-checked-bg-color: #fbfbfe; + --radio-border-color: #8f8f9d; + --radio-checked-border-color: #0060df; + + --button-secondary-bg-color: #f0f0f4; + --button-secondary-fg-color: var(--text-primary-color); + --button-secondary-border-color: var(--button-secondary-bg-color); + --button-secondary-hover-bg-color: var(--button-secondary-bg-color); + --button-secondary-hover-fg-color: var(--button-secondary-fg-color); + --button-secondary-hover-border-color: var(--button-secondary-hover-bg-color); + + --button-primary-bg-color: #0060df; + --button-primary-fg-color: #fbfbfe; + --button-primary-border-color: var(--button-primary-bg-color); + --button-primary-hover-bg-color: var(--button-primary-bg-color); + --button-primary-hover-fg-color: var(--button-primary-fg-color); + --button-primary-hover-border-color: var(--button-primary-hover-bg-color); +} + +@media (prefers-color-scheme: dark) { + :where(html:not(.is-light)) .dialog { + --dialog-bg-color: #1c1b22; + --dialog-border-color: #1c1b22; + --dialog-shadow: 0 2px 14px 0 #15141a; + --text-primary-color: #fbfbfe; + --text-secondary-color: #cfcfd8; + --focus-ring-color: #0df; + --hover-filter: brightness(1.4); + --link-fg-color: #0df; + --link-hover-fg-color: #80ebff; + --separator-color: #52525e; + + --textarea-bg-color: #42414d; + + --radio-bg-color: #2b2a33; + --radio-checked-bg-color: #15141a; + --radio-checked-border-color: #0df; + + --button-secondary-bg-color: #2b2a33; + --button-primary-bg-color: #0df; + --button-primary-fg-color: #15141a; + } +} + +:where(html.is-dark) .dialog { + --dialog-bg-color: #1c1b22; + --dialog-border-color: #1c1b22; + --dialog-shadow: 0 2px 14px 0 #15141a; + --text-primary-color: #fbfbfe; + --text-secondary-color: #cfcfd8; + --focus-ring-color: #0df; + --hover-filter: brightness(1.4); + --link-fg-color: #0df; + --link-hover-fg-color: #80ebff; + --separator-color: #52525e; + + --textarea-bg-color: #42414d; + + --radio-bg-color: #2b2a33; + --radio-checked-bg-color: #15141a; + --radio-checked-border-color: #0df; + + --button-secondary-bg-color: #2b2a33; + --button-primary-bg-color: #0df; + --button-primary-fg-color: #15141a; +} + +@media screen and (forced-colors: active) { + .dialog { + --dialog-bg-color: Canvas; + --dialog-border-color: CanvasText; + --dialog-shadow: none; + --text-primary-color: CanvasText; + --text-secondary-color: CanvasText; + --hover-filter: none; + --focus-ring-color: ButtonBorder; + --link-fg-color: LinkText; + --link-hover-fg-color: LinkText; + --separator-color: CanvasText; + + --textarea-border-color: ButtonBorder; + --textarea-bg-color: Field; + --textarea-fg-color: ButtonText; + + --radio-bg-color: ButtonFace; + --radio-checked-bg-color: ButtonFace; + --radio-border-color: ButtonText; + --radio-checked-border-color: ButtonText; + + --button-secondary-bg-color: ButtonFace; + --button-secondary-fg-color: ButtonText; + --button-secondary-border-color: ButtonText; + --button-secondary-hover-bg-color: AccentColor; + --button-secondary-hover-fg-color: AccentColorText; + + --button-primary-bg-color: ButtonText; + --button-primary-fg-color: ButtonFace; + --button-primary-hover-bg-color: AccentColor; + --button-primary-hover-fg-color: AccentColorText; + } +} + +.dialog { + font: message-box; + font-size: 13px; + font-weight: 400; + line-height: 150%; + border-radius: 4px; + padding: 12px 16px; + border: 1px solid var(--dialog-border-color); + background: var(--dialog-bg-color); + color: var(--text-primary-color); + box-shadow: var(--dialog-shadow); +} + +:is(.dialog .mainContainer) *:focus-visible { + outline: var(--focus-ring-outline); + outline-offset: 2px; +} + +:is(.dialog .mainContainer) .title { + display: flex; + width: auto; + flex-direction: column; + justify-content: flex-end; + align-items: flex-start; + gap: 12px; +} + +:is(:is(.dialog .mainContainer) .title) > span { + font-size: 13px; + font-style: normal; + font-weight: 590; + line-height: 150%; +} + +:is(.dialog .mainContainer) .dialogSeparator { + width: 100%; + height: 0; + margin-block: 4px; + border-top: 1px solid var(--separator-color); + border-bottom: none; +} + +:is(.dialog .mainContainer) .dialogButtonsGroup { + display: flex; + gap: 12px; + align-self: flex-end; +} + +:is(.dialog .mainContainer) .radio { + display: flex; + flex-direction: column; + align-items: flex-start; + gap: 4px; +} + +:is(:is(.dialog .mainContainer) .radio) > .radioButton { + display: flex; + gap: 8px; + align-self: stretch; + align-items: center; +} + +:is(:is(:is(.dialog .mainContainer) .radio) > .radioButton) input { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + box-sizing: border-box; + width: 16px; + height: 16px; + border-radius: 50%; + background-color: var(--radio-bg-color); + border: 1px solid var(--radio-border-color); +} + +:is(:is(:is(:is(.dialog .mainContainer) .radio) > .radioButton) input):hover { + filter: var(--hover-filter); +} + +:is(:is(:is(:is(.dialog .mainContainer) .radio) > .radioButton) input):checked { + background-color: var(--radio-checked-bg-color); + border: 4px solid var(--radio-checked-border-color); +} + +:is(:is(.dialog .mainContainer) .radio) > .radioLabel { + display: flex; + padding-inline-start: 24px; + align-items: flex-start; + gap: 10px; + align-self: stretch; +} + +:is(:is(:is(.dialog .mainContainer) .radio) > .radioLabel) > span { + flex: 1 0 0; + font-size: 11px; + color: var(--text-secondary-color); +} + +:is(.dialog .mainContainer) button:not(:is(.toggle-button, .closeButton)) { + border-radius: 4px; + border: 1px solid; + font: menu; + font-weight: 600; + padding: 4px 16px; + width: auto; + height: 32px; +} + +:is( + :is(.dialog .mainContainer) button:not(:is(.toggle-button, .closeButton)) + ):hover { + cursor: pointer; + filter: var(--hover-filter); +} + +.secondaryButton:is( + :is(.dialog .mainContainer) button:not(:is(.toggle-button, .closeButton)) + ) { + color: var(--button-secondary-fg-color); + background-color: var(--button-secondary-bg-color); + border-color: var(--button-secondary-border-color); +} + +.secondaryButton:is( + :is(.dialog .mainContainer) button:not(:is(.toggle-button, .closeButton)) + ):hover { + color: var(--button-secondary-hover-fg-color); + background-color: var(--button-secondary-hover-bg-color); + border-color: var(--button-secondary-hover-border-color); +} + +.primaryButton:is( + :is(.dialog .mainContainer) button:not(:is(.toggle-button, .closeButton)) + ) { + color: var(--button-primary-fg-color); + background-color: var(--button-primary-bg-color); + border-color: var(--button-primary-border-color); + opacity: 1; +} + +.primaryButton:is( + :is(.dialog .mainContainer) button:not(:is(.toggle-button, .closeButton)) + ):hover { + color: var(--button-primary-hover-fg-color); + background-color: var(--button-primary-hover-bg-color); + border-color: var(--button-primary-hover-border-color); +} + +:is(.dialog .mainContainer) a { + color: var(--link-fg-color); +} + +:is(:is(.dialog .mainContainer) a):hover { + color: var(--link-hover-fg-color); +} + +:is(.dialog .mainContainer) textarea { + font: inherit; + padding: 8px; + resize: none; + margin: 0; + box-sizing: border-box; + border-radius: 4px; + border: 1px solid var(--textarea-border-color); + background: var(--textarea-bg-color); + color: var(--textarea-fg-color); +} + +:is(:is(.dialog .mainContainer) textarea):focus { + outline-offset: 0; + border-color: transparent; +} + +:is(:is(.dialog .mainContainer) textarea):disabled { + pointer-events: none; + opacity: 0.4; +} + +:is(.dialog .mainContainer) .messageBar { + --message-bar-bg-color: #ffebcd; + --message-bar-fg-color: #15141a; + --message-bar-border-color: rgb(0 0 0 / 0.08); + --message-bar-icon: url(images/messageBar_warning.svg); + --message-bar-icon-color: #cd411e; +} + +@media (prefers-color-scheme: dark) { + :where(html:not(.is-light)) :is(.dialog .mainContainer) .messageBar { + --message-bar-bg-color: #5a3100; + --message-bar-fg-color: #fbfbfe; + --message-bar-border-color: rgb(255 255 255 / 0.08); + --message-bar-icon-color: #e49c49; + } +} + +:where(html.is-dark) :is(.dialog .mainContainer) .messageBar { + --message-bar-bg-color: #5a3100; + --message-bar-fg-color: #fbfbfe; + --message-bar-border-color: rgb(255 255 255 / 0.08); + --message-bar-icon-color: #e49c49; +} + +@media screen and (forced-colors: active) { + :is(.dialog .mainContainer) .messageBar { + --message-bar-bg-color: HighlightText; + --message-bar-fg-color: CanvasText; + --message-bar-border-color: CanvasText; + --message-bar-icon-color: CanvasText; + } +} + +:is(.dialog .mainContainer) .messageBar { + align-self: stretch; +} + +:is(:is(:is(.dialog .mainContainer) .messageBar) > div)::before, +:is(:is(:is(.dialog .mainContainer) .messageBar) > div) > div { + margin-block: 4px; +} + +:is(:is(:is(.dialog .mainContainer) .messageBar) > div) > div { + display: flex; + flex-direction: column; + align-items: flex-start; + gap: 8px; + flex: 1 0 0; +} + +:is(:is(:is(:is(.dialog .mainContainer) .messageBar) > div) > div) .title { + font-size: 13px; + font-weight: 590; +} + +:is(:is(:is(:is(.dialog .mainContainer) .messageBar) > div) > div) + .description { + font-size: 13px; +} + +:is(.dialog .mainContainer) .toggler { + display: flex; + align-items: center; + gap: 8px; + align-self: stretch; +} + +:is(:is(.dialog .mainContainer) .toggler) > .togglerLabel { + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; +} + +.textLayer { + position: absolute; + text-align: initial; + inset: 0; + overflow: clip; + opacity: 1; + line-height: 1; + -webkit-text-size-adjust: none; + -moz-text-size-adjust: none; + text-size-adjust: none; + forced-color-adjust: none; + transform-origin: 0 0; + caret-color: CanvasText; + z-index: 0; +} + +.textLayer.highlighting { + touch-action: none; +} + +.textLayer :is(span, br) { + color: transparent; + position: absolute; + white-space: pre; + cursor: text; + transform-origin: 0% 0%; +} + +.textLayer > :not(.markedContent), +.textLayer .markedContent span:not(.markedContent) { + z-index: 1; +} + +.textLayer span.markedContent { + top: 0; + height: 0; +} + +.textLayer span[role='img'] { + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; + cursor: default; +} + +.textLayer .highlight { + --highlight-bg-color: rgb(180 0 170 / 0.25); + --highlight-selected-bg-color: rgb(0 100 0 / 0.25); + --highlight-backdrop-filter: none; + --highlight-selected-backdrop-filter: none; +} + +@media screen and (forced-colors: active) { + .textLayer .highlight { + --highlight-bg-color: transparent; + --highlight-selected-bg-color: transparent; + --highlight-backdrop-filter: var(--hcm-highlight-filter); + --highlight-selected-backdrop-filter: var(--hcm-highlight-selected-filter); + } +} + +.textLayer .highlight { + margin: -1px; + padding: 1px; + background-color: var(--highlight-bg-color); + -webkit-backdrop-filter: var(--highlight-backdrop-filter); + backdrop-filter: var(--highlight-backdrop-filter); + border-radius: 4px; +} + +.appended:is(.textLayer .highlight) { + position: initial; +} + +.begin:is(.textLayer .highlight) { + border-radius: 4px 0 0 4px; +} + +.end:is(.textLayer .highlight) { + border-radius: 0 4px 4px 0; +} + +.middle:is(.textLayer .highlight) { + border-radius: 0; +} + +.selected:is(.textLayer .highlight) { + background-color: var(--highlight-selected-bg-color); + -webkit-backdrop-filter: var(--highlight-selected-backdrop-filter); + backdrop-filter: var(--highlight-selected-backdrop-filter); +} + +.textLayer ::-moz-selection { + background: rgba(0 0 255 / 0.25); + background: color-mix(in srgb, AccentColor, transparent 75%); +} + +.textLayer ::selection { + background: rgba(0 0 255 / 0.25); + background: color-mix(in srgb, AccentColor, transparent 75%); +} + +.textLayer br::-moz-selection { + background: transparent; +} + +.textLayer br::selection { + background: transparent; +} + +.textLayer .endOfContent { + display: block; + position: absolute; + inset: 100% 0 0; + z-index: 0; + cursor: default; + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; +} + +.textLayer.selecting .endOfContent { + top: 0; +} + +.annotationLayer { + --annotation-unfocused-field-background: url("data:image/svg+xml;charset=UTF-8,"); + --input-focus-border-color: Highlight; + --input-focus-outline: 1px solid Canvas; + --input-unfocused-border-color: transparent; + --input-disabled-border-color: transparent; + --input-hover-border-color: black; + --link-outline: none; +} + +@media screen and (forced-colors: active) { + .annotationLayer { + --input-focus-border-color: CanvasText; + --input-unfocused-border-color: ActiveText; + --input-disabled-border-color: GrayText; + --input-hover-border-color: Highlight; + --link-outline: 1.5px solid LinkText; + } + + .annotationLayer .textWidgetAnnotation :is(input, textarea):required, + .annotationLayer .choiceWidgetAnnotation select:required, + .annotationLayer + .buttonWidgetAnnotation:is(.checkBox, .radioButton) + input:required { + outline: 1.5px solid selectedItem; + } + + .annotationLayer .linkAnnotation { + outline: var(--link-outline); + } + + :is(.annotationLayer .linkAnnotation):hover { + -webkit-backdrop-filter: var(--hcm-highlight-filter); + backdrop-filter: var(--hcm-highlight-filter); + } + + :is(.annotationLayer .linkAnnotation) > a:hover { + opacity: 0 !important; + background: none !important; + box-shadow: none; + } + + .annotationLayer .popupAnnotation .popup { + outline: calc(1.5px * var(--scale-factor)) solid CanvasText !important; + background-color: ButtonFace !important; + color: ButtonText !important; + } + + .annotationLayer .highlightArea:hover::after { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + -webkit-backdrop-filter: var(--hcm-highlight-filter); + backdrop-filter: var(--hcm-highlight-filter); + content: ''; + pointer-events: none; + } + + .annotationLayer .popupAnnotation.focused .popup { + outline: calc(3px * var(--scale-factor)) solid Highlight !important; + } +} + +.annotationLayer { + position: absolute; + top: 0; + left: 0; + pointer-events: none; + transform-origin: 0 0; +} + +.annotationLayer[data-main-rotation='90'] .norotate { + transform: rotate(270deg) translateX(-100%); +} + +.annotationLayer[data-main-rotation='180'] .norotate { + transform: rotate(180deg) translate(-100%, -100%); +} + +.annotationLayer[data-main-rotation='270'] .norotate { + transform: rotate(90deg) translateY(-100%); +} + +.annotationLayer.disabled section, +.annotationLayer.disabled .popup { + pointer-events: none; +} + +.annotationLayer .annotationContent { + position: absolute; + width: 100%; + height: 100%; + pointer-events: none; +} + +.freetext:is(.annotationLayer .annotationContent) { + background: transparent; + border: none; + inset: 0; + overflow: visible; + white-space: nowrap; + font: 10px sans-serif; + line-height: 1.35; + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; +} + +.annotationLayer section { + position: absolute; + text-align: initial; + pointer-events: auto; + box-sizing: border-box; + transform-origin: 0 0; +} + +:is(.annotationLayer section):has(div.annotationContent) + canvas.annotationContent { + display: none; +} + +.textLayer.selecting ~ .annotationLayer section { + pointer-events: none; +} + +.annotationLayer :is(.linkAnnotation, .buttonWidgetAnnotation.pushButton) > a { + position: absolute; + font-size: 1em; + top: 0; + left: 0; + width: 100%; + height: 100%; +} + +.annotationLayer + :is(.linkAnnotation, .buttonWidgetAnnotation.pushButton):not(.hasBorder) + > a:hover { + opacity: 0.2; + background-color: rgb(255 255 0); + box-shadow: 0 2px 10px rgb(255 255 0); +} + +.annotationLayer .linkAnnotation.hasBorder:hover { + background-color: rgb(255 255 0 / 0.2); +} + +.annotationLayer .hasBorder { + background-size: 100% 100%; +} + +.annotationLayer .textAnnotation img { + position: absolute; + cursor: pointer; + width: 100%; + height: 100%; + top: 0; + left: 0; +} + +.annotationLayer .textWidgetAnnotation :is(input, textarea), +.annotationLayer .choiceWidgetAnnotation select, +.annotationLayer .buttonWidgetAnnotation:is(.checkBox, .radioButton) input { + background-image: var(--annotation-unfocused-field-background); + border: 2px solid var(--input-unfocused-border-color); + box-sizing: border-box; + font: calc(9px * var(--scale-factor)) sans-serif; + height: 100%; + margin: 0; + vertical-align: top; + width: 100%; +} + +.annotationLayer .textWidgetAnnotation :is(input, textarea):required, +.annotationLayer .choiceWidgetAnnotation select:required, +.annotationLayer + .buttonWidgetAnnotation:is(.checkBox, .radioButton) + input:required { + outline: 1.5px solid red; +} + +.annotationLayer .choiceWidgetAnnotation select option { + padding: 0; +} + +.annotationLayer .buttonWidgetAnnotation.radioButton input { + border-radius: 50%; +} + +.annotationLayer .textWidgetAnnotation textarea { + resize: none; +} + +.annotationLayer .textWidgetAnnotation [disabled]:is(input, textarea), +.annotationLayer .choiceWidgetAnnotation select[disabled], +.annotationLayer + .buttonWidgetAnnotation:is(.checkBox, .radioButton) + input[disabled] { + background: none; + border: 2px solid var(--input-disabled-border-color); + cursor: not-allowed; +} + +.annotationLayer .textWidgetAnnotation :is(input, textarea):hover, +.annotationLayer .choiceWidgetAnnotation select:hover, +.annotationLayer + .buttonWidgetAnnotation:is(.checkBox, .radioButton) + input:hover { + border: 2px solid var(--input-hover-border-color); +} + +.annotationLayer .textWidgetAnnotation :is(input, textarea):hover, +.annotationLayer .choiceWidgetAnnotation select:hover, +.annotationLayer .buttonWidgetAnnotation.checkBox input:hover { + border-radius: 2px; +} + +.annotationLayer .textWidgetAnnotation :is(input, textarea):focus, +.annotationLayer .choiceWidgetAnnotation select:focus { + background: none; + border: 2px solid var(--input-focus-border-color); + border-radius: 2px; + outline: var(--input-focus-outline); +} + +.annotationLayer .buttonWidgetAnnotation:is(.checkBox, .radioButton) :focus { + background-image: none; + background-color: transparent; +} + +.annotationLayer .buttonWidgetAnnotation.checkBox :focus { + border: 2px solid var(--input-focus-border-color); + border-radius: 2px; + outline: var(--input-focus-outline); +} + +.annotationLayer .buttonWidgetAnnotation.radioButton :focus { + border: 2px solid var(--input-focus-border-color); + outline: var(--input-focus-outline); +} + +.annotationLayer .buttonWidgetAnnotation.checkBox input:checked::before, +.annotationLayer .buttonWidgetAnnotation.checkBox input:checked::after, +.annotationLayer .buttonWidgetAnnotation.radioButton input:checked::before { + background-color: CanvasText; + content: ''; + display: block; + position: absolute; +} + +.annotationLayer .buttonWidgetAnnotation.checkBox input:checked::before, +.annotationLayer .buttonWidgetAnnotation.checkBox input:checked::after { + height: 80%; + left: 45%; + width: 1px; +} + +.annotationLayer .buttonWidgetAnnotation.checkBox input:checked::before { + transform: rotate(45deg); +} + +.annotationLayer .buttonWidgetAnnotation.checkBox input:checked::after { + transform: rotate(-45deg); +} + +.annotationLayer .buttonWidgetAnnotation.radioButton input:checked::before { + border-radius: 50%; + height: 50%; + left: 25%; + top: 25%; + width: 50%; +} + +.annotationLayer .textWidgetAnnotation input.comb { + font-family: monospace; + padding-left: 2px; + padding-right: 0; +} + +.annotationLayer .textWidgetAnnotation input.comb:focus { + width: 103%; +} + +.annotationLayer .buttonWidgetAnnotation:is(.checkBox, .radioButton) input { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; +} + +.annotationLayer .fileAttachmentAnnotation .popupTriggerArea { + height: 100%; + width: 100%; +} + +.annotationLayer .popupAnnotation { + position: absolute; + font-size: calc(9px * var(--scale-factor)); + pointer-events: none; + width: -moz-max-content; + width: max-content; + max-width: 45%; + height: auto; +} + +.annotationLayer .popup { + background-color: rgb(255 255 153); + box-shadow: 0 calc(2px * var(--scale-factor)) calc(5px * var(--scale-factor)) + rgb(136 136 136); + border-radius: calc(2px * var(--scale-factor)); + outline: 1.5px solid rgb(255 255 74); + padding: calc(6px * var(--scale-factor)); + cursor: pointer; + font: message-box; + white-space: normal; + word-wrap: break-word; + pointer-events: auto; +} + +.annotationLayer .popupAnnotation.focused .popup { + outline-width: 3px; +} + +.annotationLayer .popup * { + font-size: calc(9px * var(--scale-factor)); +} + +.annotationLayer .popup > .header { + display: inline-block; +} + +.annotationLayer .popup > .header h1 { + display: inline; +} + +.annotationLayer .popup > .header .popupDate { + display: inline-block; + margin-left: calc(5px * var(--scale-factor)); + width: -moz-fit-content; + width: fit-content; +} + +.annotationLayer .popupContent { + border-top: 1px solid rgb(51 51 51); + margin-top: calc(2px * var(--scale-factor)); + padding-top: calc(2px * var(--scale-factor)); +} + +.annotationLayer .richText > * { + white-space: pre-wrap; + font-size: calc(9px * var(--scale-factor)); +} + +.annotationLayer .popupTriggerArea { + cursor: pointer; +} + +.annotationLayer section svg { + position: absolute; + width: 100%; + height: 100%; + top: 0; + left: 0; +} + +.annotationLayer .annotationTextContent { + position: absolute; + width: 100%; + height: 100%; + opacity: 0; + color: transparent; + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; + pointer-events: none; +} + +:is(.annotationLayer .annotationTextContent) span { + width: 100%; + display: inline-block; +} + +.annotationLayer svg.quadrilateralsContainer { + contain: strict; + width: 0; + height: 0; + position: absolute; + top: 0; + left: 0; + z-index: -1; +} + +:root { + --xfa-unfocused-field-background: url("data:image/svg+xml;charset=UTF-8,"); + --xfa-focus-outline: auto; +} + +@media screen and (forced-colors: active) { + :root { + --xfa-focus-outline: 2px solid CanvasText; + } + .xfaLayer *:required { + outline: 1.5px solid selectedItem; + } +} + +.xfaLayer { + background-color: transparent; +} + +.xfaLayer .highlight { + margin: -1px; + padding: 1px; + background-color: rgb(239 203 237); + border-radius: 4px; +} + +.xfaLayer .highlight.appended { + position: initial; +} + +.xfaLayer .highlight.begin { + border-radius: 4px 0 0 4px; +} + +.xfaLayer .highlight.end { + border-radius: 0 4px 4px 0; +} + +.xfaLayer .highlight.middle { + border-radius: 0; +} + +.xfaLayer .highlight.selected { + background-color: rgb(203 223 203); +} + +.xfaPage { + overflow: hidden; + position: relative; +} + +.xfaContentarea { + position: absolute; +} + +.xfaPrintOnly { + display: none; +} + +.xfaLayer { + position: absolute; + text-align: initial; + top: 0; + left: 0; + transform-origin: 0 0; + line-height: 1.2; +} + +.xfaLayer * { + color: inherit; + font: inherit; + font-style: inherit; + font-weight: inherit; + font-kerning: inherit; + letter-spacing: -0.01px; + text-align: inherit; + text-decoration: inherit; + box-sizing: border-box; + background-color: transparent; + padding: 0; + margin: 0; + pointer-events: auto; + line-height: inherit; +} + +.xfaLayer *:required { + outline: 1.5px solid red; +} + +.xfaLayer div, +.xfaLayer svg, +.xfaLayer svg * { + pointer-events: none; +} + +.xfaLayer a { + color: blue; +} + +.xfaRich li { + margin-left: 3em; +} + +.xfaFont { + color: black; + font-weight: normal; + font-kerning: none; + font-size: 10px; + font-style: normal; + letter-spacing: 0; + text-decoration: none; + vertical-align: 0; +} + +.xfaCaption { + overflow: hidden; + flex: 0 0 auto; +} + +.xfaCaptionForCheckButton { + overflow: hidden; + flex: 1 1 auto; +} + +.xfaLabel { + height: 100%; + width: 100%; +} + +.xfaLeft { + display: flex; + flex-direction: row; + align-items: center; +} + +.xfaRight { + display: flex; + flex-direction: row-reverse; + align-items: center; +} + +:is(.xfaLeft, .xfaRight) > :is(.xfaCaption, .xfaCaptionForCheckButton) { + max-height: 100%; +} + +.xfaTop { + display: flex; + flex-direction: column; + align-items: flex-start; +} + +.xfaBottom { + display: flex; + flex-direction: column-reverse; + align-items: flex-start; +} + +:is(.xfaTop, .xfaBottom) > :is(.xfaCaption, .xfaCaptionForCheckButton) { + width: 100%; +} + +.xfaBorder { + background-color: transparent; + position: absolute; + pointer-events: none; +} + +.xfaWrapped { + width: 100%; + height: 100%; +} + +:is(.xfaTextfield, .xfaSelect):focus { + background-image: none; + background-color: transparent; + outline: var(--xfa-focus-outline); + outline-offset: -1px; +} + +:is(.xfaCheckbox, .xfaRadio):focus { + outline: var(--xfa-focus-outline); +} + +.xfaTextfield, +.xfaSelect { + height: 100%; + width: 100%; + flex: 1 1 auto; + border: none; + resize: none; + background-image: var(--xfa-unfocused-field-background); +} + +.xfaSelect { + padding-inline: 2px; +} + +:is(.xfaTop, .xfaBottom) > :is(.xfaTextfield, .xfaSelect) { + flex: 0 1 auto; +} + +.xfaButton { + cursor: pointer; + width: 100%; + height: 100%; + border: none; + text-align: center; +} + +.xfaLink { + width: 100%; + height: 100%; + position: absolute; + top: 0; + left: 0; +} + +.xfaCheckbox, +.xfaRadio { + width: 100%; + height: 100%; + flex: 0 0 auto; + border: none; +} + +.xfaRich { + white-space: pre-wrap; + width: 100%; + height: 100%; +} + +.xfaImage { + -o-object-position: left top; + object-position: left top; + -o-object-fit: contain; + object-fit: contain; + width: 100%; + height: 100%; +} + +.xfaLrTb, +.xfaRlTb, +.xfaTb { + display: flex; + flex-direction: column; + align-items: stretch; +} + +.xfaLr { + display: flex; + flex-direction: row; + align-items: stretch; +} + +.xfaRl { + display: flex; + flex-direction: row-reverse; + align-items: stretch; +} + +.xfaTb > div { + justify-content: left; +} + +.xfaPosition { + position: relative; +} + +.xfaArea { + position: relative; +} + +.xfaValignMiddle { + display: flex; + align-items: center; +} + +.xfaTable { + display: flex; + flex-direction: column; + align-items: stretch; +} + +.xfaTable .xfaRow { + display: flex; + flex-direction: row; + align-items: stretch; +} + +.xfaTable .xfaRlRow { + display: flex; + flex-direction: row-reverse; + align-items: stretch; + flex: 1; +} + +.xfaTable .xfaRlRow > div { + flex: 1; +} + +:is(.xfaNonInteractive, .xfaDisabled, .xfaReadOnly) :is(input, textarea) { + background: initial; +} + +@media print { + .xfaTextfield, + .xfaSelect { + background: transparent; + } + + .xfaSelect { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + text-indent: 1px; + text-overflow: ''; + } +} + +.canvasWrapper svg { + transform: none; +} + +.moving:is(.canvasWrapper svg) { + z-index: 100000; +} + +[data-main-rotation='90']:is( + .highlight:is(.canvasWrapper svg), + .highlightOutline:is(.canvasWrapper svg) + ) + mask, +[data-main-rotation='90']:is( + .highlight:is(.canvasWrapper svg), + .highlightOutline:is(.canvasWrapper svg) + ) + use:not(.clip, .mask) { + transform: matrix(0, 1, -1, 0, 1, 0); +} + +[data-main-rotation='180']:is( + .highlight:is(.canvasWrapper svg), + .highlightOutline:is(.canvasWrapper svg) + ) + mask, +[data-main-rotation='180']:is( + .highlight:is(.canvasWrapper svg), + .highlightOutline:is(.canvasWrapper svg) + ) + use:not(.clip, .mask) { + transform: matrix(-1, 0, 0, -1, 1, 1); +} + +[data-main-rotation='270']:is( + .highlight:is(.canvasWrapper svg), + .highlightOutline:is(.canvasWrapper svg) + ) + mask, +[data-main-rotation='270']:is( + .highlight:is(.canvasWrapper svg), + .highlightOutline:is(.canvasWrapper svg) + ) + use:not(.clip, .mask) { + transform: matrix(0, -1, 1, 0, 0, 1); +} + +.draw:is(.canvasWrapper svg) { + position: absolute; + mix-blend-mode: normal; +} + +.draw[data-draw-rotation='90']:is(.canvasWrapper svg) { + transform: rotate(90deg); +} + +.draw[data-draw-rotation='180']:is(.canvasWrapper svg) { + transform: rotate(180deg); +} + +.draw[data-draw-rotation='270']:is(.canvasWrapper svg) { + transform: rotate(270deg); +} + +.highlight:is(.canvasWrapper svg) { + --blend-mode: multiply; +} + +@media screen and (forced-colors: active) { + .highlight:is(.canvasWrapper svg) { + --blend-mode: difference; + } +} + +.highlight:is(.canvasWrapper svg) { + position: absolute; + mix-blend-mode: var(--blend-mode); +} + +.highlight:is(.canvasWrapper svg):not(.free) { + fill-rule: evenodd; +} + +.highlightOutline:is(.canvasWrapper svg) { + position: absolute; + mix-blend-mode: normal; + fill-rule: evenodd; + fill: none; +} + +.highlightOutline.hovered:is(.canvasWrapper svg):not(.free):not(.selected) { + stroke: var(--hover-outline-color); + stroke-width: var(--outline-width); +} + +.highlightOutline.selected:is(.canvasWrapper svg):not(.free) .mainOutline { + stroke: var(--outline-around-color); + stroke-width: calc(var(--outline-width) + 2 * var(--outline-around-width)); +} + +.highlightOutline.selected:is(.canvasWrapper svg):not(.free) .secondaryOutline { + stroke: var(--outline-color); + stroke-width: var(--outline-width); +} + +.highlightOutline.free.hovered:is(.canvasWrapper svg):not(.selected) { + stroke: var(--hover-outline-color); + stroke-width: calc(2 * var(--outline-width)); +} + +.highlightOutline.free.selected:is(.canvasWrapper svg) .mainOutline { + stroke: var(--outline-around-color); + stroke-width: calc(2 * (var(--outline-width) + var(--outline-around-width))); +} + +.highlightOutline.free.selected:is(.canvasWrapper svg) .secondaryOutline { + stroke: var(--outline-color); + stroke-width: calc(2 * var(--outline-width)); +} + +.toggle-button { + --button-background-color: #f0f0f4; + --button-background-color-hover: #e0e0e6; + --button-background-color-active: #cfcfd8; + --color-accent-primary: #0060df; + --color-accent-primary-hover: #0250bb; + --color-accent-primary-active: #054096; + --border-interactive-color: #8f8f9d; + --border-radius-circle: 9999px; + --border-width: 1px; + --size-item-small: 16px; + --size-item-large: 32px; + --color-canvas: white; +} + +@media (prefers-color-scheme: dark) { + :where(html:not(.is-light)) .toggle-button { + --button-background-color: color-mix(in srgb, currentColor 7%, transparent); + --button-background-color-hover: color-mix( + in srgb, + currentColor 14%, + transparent + ); + --button-background-color-active: color-mix( + in srgb, + currentColor 21%, + transparent + ); + --color-accent-primary: #0df; + --color-accent-primary-hover: #80ebff; + --color-accent-primary-active: #aaf2ff; + --border-interactive-color: #bfbfc9; + --color-canvas: #1c1b22; + } +} + +:where(html.is-dark) .toggle-button { + --button-background-color: color-mix(in srgb, currentColor 7%, transparent); + --button-background-color-hover: color-mix( + in srgb, + currentColor 14%, + transparent + ); + --button-background-color-active: color-mix( + in srgb, + currentColor 21%, + transparent + ); + --color-accent-primary: #0df; + --color-accent-primary-hover: #80ebff; + --color-accent-primary-active: #aaf2ff; + --border-interactive-color: #bfbfc9; + --color-canvas: #1c1b22; +} + +@media (forced-colors: active) { + .toggle-button { + --color-accent-primary: ButtonText; + --color-accent-primary-hover: SelectedItem; + --color-accent-primary-active: SelectedItem; + --border-interactive-color: ButtonText; + --button-background-color: ButtonFace; + --border-interactive-color-hover: SelectedItem; + --border-interactive-color-active: SelectedItem; + --border-interactive-color-disabled: GrayText; + --color-canvas: ButtonText; + } +} + +.toggle-button { + --toggle-background-color: var(--button-background-color); + --toggle-background-color-hover: var(--button-background-color-hover); + --toggle-background-color-active: var(--button-background-color-active); + --toggle-background-color-pressed: var(--color-accent-primary); + --toggle-background-color-pressed-hover: var(--color-accent-primary-hover); + --toggle-background-color-pressed-active: var(--color-accent-primary-active); + --toggle-border-color: var(--border-interactive-color); + --toggle-border-color-hover: var(--toggle-border-color); + --toggle-border-color-active: var(--toggle-border-color); + --toggle-border-radius: var(--border-radius-circle); + --toggle-border-width: var(--border-width); + --toggle-height: var(--size-item-small); + --toggle-width: var(--size-item-large); + --toggle-dot-background-color: var(--toggle-border-color); + --toggle-dot-background-color-hover: var(--toggle-dot-background-color); + --toggle-dot-background-color-active: var(--toggle-dot-background-color); + --toggle-dot-background-color-on-pressed: var(--color-canvas); + --toggle-dot-margin: 1px; + --toggle-dot-height: calc( + var(--toggle-height) - 2 * var(--toggle-dot-margin) - 2 * + var(--toggle-border-width) + ); + --toggle-dot-width: var(--toggle-dot-height); + --toggle-dot-transform-x: calc( + var(--toggle-width) - 4 * var(--toggle-dot-margin) - var(--toggle-dot-width) + ); + + -webkit-appearance: none; + + -moz-appearance: none; + + appearance: none; + padding: 0; + margin: 0; + border: var(--toggle-border-width) solid var(--toggle-border-color); + height: var(--toggle-height); + width: var(--toggle-width); + border-radius: var(--toggle-border-radius); + background: var(--toggle-background-color); + box-sizing: border-box; + flex-shrink: 0; +} + +.toggle-button:focus-visible { + outline: var(--focus-outline); + outline-offset: var(--focus-outline-offset); +} + +.toggle-button:enabled:hover { + background: var(--toggle-background-color-hover); + border-color: var(--toggle-border-color); +} + +.toggle-button:enabled:active { + background: var(--toggle-background-color-active); + border-color: var(--toggle-border-color); +} + +.toggle-button[aria-pressed='true'] { + background: var(--toggle-background-color-pressed); + border-color: transparent; +} + +.toggle-button[aria-pressed='true']:enabled:hover { + background: var(--toggle-background-color-pressed-hover); + border-color: transparent; +} + +.toggle-button[aria-pressed='true']:enabled:active { + background: var(--toggle-background-color-pressed-active); + border-color: transparent; +} + +.toggle-button::before { + display: block; + content: ''; + background-color: var(--toggle-dot-background-color); + height: var(--toggle-dot-height); + width: var(--toggle-dot-width); + margin: var(--toggle-dot-margin); + border-radius: var(--toggle-border-radius); + translate: 0; +} + +.toggle-button[aria-pressed='true']::before { + translate: var(--toggle-dot-transform-x); + background-color: var(--toggle-dot-background-color-on-pressed); +} + +.toggle-button[aria-pressed='true']:enabled:hover::before, +.toggle-button[aria-pressed='true']:enabled:active::before { + background-color: var(--toggle-dot-background-color-on-pressed); +} + +[dir='rtl'] .toggle-button[aria-pressed='true']::before { + translate: calc(-1 * var(--toggle-dot-transform-x)); +} + +@media (prefers-reduced-motion: no-preference) { + .toggle-button::before { + transition: translate 100ms; + } +} + +@media (prefers-contrast) { + .toggle-button:enabled:hover { + border-color: var(--toggle-border-color-hover); + } + + .toggle-button:enabled:active { + border-color: var(--toggle-border-color-active); + } + + .toggle-button[aria-pressed='true']:enabled { + border-color: var(--toggle-border-color); + position: relative; + } + + .toggle-button[aria-pressed='true']:enabled:hover, + .toggle-button[aria-pressed='true']:enabled:hover:active { + border-color: var(--toggle-border-color-hover); + } + + .toggle-button[aria-pressed='true']:enabled:active { + background-color: var(--toggle-dot-background-color-active); + border-color: var(--toggle-dot-background-color-hover); + } + + .toggle-button:hover::before, + .toggle-button:active::before { + background-color: var(--toggle-dot-background-color-hover); + } +} + +@media (forced-colors) { + .toggle-button { + --toggle-dot-background-color: var(--color-accent-primary); + --toggle-dot-background-color-hover: var(--color-accent-primary-hover); + --toggle-dot-background-color-active: var(--color-accent-primary-active); + --toggle-dot-background-color-on-pressed: var(--button-background-color); + --toggle-background-color-disabled: var(--button-background-color-disabled); + --toggle-border-color-hover: var(--border-interactive-color-hover); + --toggle-border-color-active: var(--border-interactive-color-active); + --toggle-border-color-disabled: var(--border-interactive-color-disabled); + } + + .toggle-button[aria-pressed='true']:enabled::after { + border: 1px solid var(--button-background-color); + content: ''; + position: absolute; + height: var(--toggle-height); + width: var(--toggle-width); + display: block; + border-radius: var(--toggle-border-radius); + inset: -2px; + } + + .toggle-button[aria-pressed='true']:enabled:active::after { + border-color: var(--toggle-border-color-active); + } +} + +:root { + --outline-width: 2px; + --outline-color: #0060df; + --outline-around-width: 1px; + --outline-around-color: #f0f0f4; + --hover-outline-around-color: var(--outline-around-color); + --focus-outline: solid var(--outline-width) var(--outline-color); + --unfocus-outline: solid var(--outline-width) transparent; + --focus-outline-around: solid var(--outline-around-width) + var(--outline-around-color); + --hover-outline-color: #8f8f9d; + --hover-outline: solid var(--outline-width) var(--hover-outline-color); + --hover-outline-around: solid var(--outline-around-width) + var(--hover-outline-around-color); + --freetext-line-height: 1.35; + --freetext-padding: 2px; + --resizer-bg-color: var(--outline-color); + --resizer-size: 6px; + --resizer-shift: calc( + 0px - (var(--outline-width) + var(--resizer-size)) / 2 - + var(--outline-around-width) + ); + --editorFreeText-editing-cursor: text; + --editorInk-editing-cursor: url(images/cursor-editorInk.svg) 0 16, pointer; + --editorHighlight-editing-cursor: + url(images/cursor-editorTextHighlight.svg) 24 24, text; + --editorFreeHighlight-editing-cursor: + url(images/cursor-editorFreeHighlight.svg) 1 18, pointer; + + --new-alt-text-warning-image: url(images/altText_warning.svg); +} +.visuallyHidden { + position: absolute; + top: 0; + left: 0; + border: 0; + margin: 0; + padding: 0; + width: 0; + height: 0; + overflow: hidden; + white-space: nowrap; + font-size: 0; +} + +.textLayer.highlighting { + cursor: var(--editorFreeHighlight-editing-cursor); +} + +.textLayer.highlighting:not(.free) span { + cursor: var(--editorHighlight-editing-cursor); +} + +[role='img']:is(.textLayer.highlighting:not(.free) span) { + cursor: var(--editorFreeHighlight-editing-cursor); +} + +.textLayer.highlighting.free span { + cursor: var(--editorFreeHighlight-editing-cursor); +} + +:is( + #viewerContainer.pdfPresentationMode:fullscreen, + .annotationEditorLayer.disabled + ) + .noAltTextBadge { + display: none !important; +} + +@media (min-resolution: 1.1dppx) { + :root { + --editorFreeText-editing-cursor: + url(images/cursor-editorFreeText.svg) 0 16, text; + } +} + +@media screen and (forced-colors: active) { + :root { + --outline-color: CanvasText; + --outline-around-color: ButtonFace; + --resizer-bg-color: ButtonText; + --hover-outline-color: Highlight; + --hover-outline-around-color: SelectedItemText; + } +} + +[data-editor-rotation='90'] { + transform: rotate(90deg); +} + +[data-editor-rotation='180'] { + transform: rotate(180deg); +} + +[data-editor-rotation='270'] { + transform: rotate(270deg); +} + +.annotationEditorLayer { + background: transparent; + position: absolute; + inset: 0; + font-size: calc(100px * var(--scale-factor)); + transform-origin: 0 0; + cursor: auto; +} + +.annotationEditorLayer .selectedEditor { + z-index: 100000 !important; +} + +.annotationEditorLayer.drawing * { + pointer-events: none !important; +} + +.annotationEditorLayer.waiting { + content: ''; + cursor: wait; + position: absolute; + inset: 0; + width: 100%; + height: 100%; +} + +.annotationEditorLayer.disabled { + pointer-events: none; +} + +.annotationEditorLayer.freetextEditing { + cursor: var(--editorFreeText-editing-cursor); +} + +.annotationEditorLayer.inkEditing { + cursor: var(--editorInk-editing-cursor); +} + +.annotationEditorLayer .draw { + box-sizing: border-box; +} + +.annotationEditorLayer :is(.freeTextEditor, .inkEditor, .stampEditor) { + position: absolute; + background: transparent; + z-index: 1; + transform-origin: 0 0; + cursor: auto; + max-width: 100%; + max-height: 100%; + border: var(--unfocus-outline); +} + +.draggable.selectedEditor:is( + .annotationEditorLayer :is(.freeTextEditor, .inkEditor, .stampEditor) + ) { + cursor: move; +} + +.selectedEditor:is( + .annotationEditorLayer :is(.freeTextEditor, .inkEditor, .stampEditor) + ) { + border: var(--focus-outline); + outline: var(--focus-outline-around); +} + +.selectedEditor:is( + .annotationEditorLayer :is(.freeTextEditor, .inkEditor, .stampEditor) + )::before { + content: ''; + position: absolute; + inset: 0; + border: var(--focus-outline-around); + pointer-events: none; +} + +:is( + .annotationEditorLayer :is(.freeTextEditor, .inkEditor, .stampEditor) + ):hover:not(.selectedEditor) { + border: var(--hover-outline); + outline: var(--hover-outline-around); +} + +:is( + .annotationEditorLayer :is(.freeTextEditor, .inkEditor, .stampEditor) + ):hover:not(.selectedEditor)::before { + content: ''; + position: absolute; + inset: 0; + border: var(--focus-outline-around); +} + +:is( + .annotationEditorLayer + :is(.freeTextEditor, .inkEditor, .stampEditor, .highlightEditor), + .textLayer + ) + .editToolbar { + --editor-toolbar-delete-image: url(images/editor-toolbar-delete.svg); + --editor-toolbar-bg-color: #f0f0f4; + --editor-toolbar-highlight-image: url(images/toolbarButton-editorHighlight.svg); + --editor-toolbar-fg-color: #2e2e56; + --editor-toolbar-border-color: #8f8f9d; + --editor-toolbar-hover-border-color: var(--editor-toolbar-border-color); + --editor-toolbar-hover-bg-color: #e0e0e6; + --editor-toolbar-hover-fg-color: var(--editor-toolbar-fg-color); + --editor-toolbar-hover-outline: none; + --editor-toolbar-focus-outline-color: #0060df; + --editor-toolbar-shadow: 0 2px 6px 0 rgb(58 57 68 / 0.2); + --editor-toolbar-vert-offset: 6px; + --editor-toolbar-height: 28px; + --editor-toolbar-padding: 2px; + --alt-text-done-color: #2ac3a2; + --alt-text-warning-color: #0090ed; + --alt-text-hover-done-color: var(--alt-text-done-color); + --alt-text-hover-warning-color: var(--alt-text-warning-color); +} + +@media (prefers-color-scheme: dark) { + :where(html:not(.is-light)) + :is( + .annotationEditorLayer + :is(.freeTextEditor, .inkEditor, .stampEditor, .highlightEditor), + .textLayer + ) + .editToolbar { + --editor-toolbar-bg-color: #2b2a33; + --editor-toolbar-fg-color: #fbfbfe; + --editor-toolbar-hover-bg-color: #52525e; + --editor-toolbar-focus-outline-color: #0df; + --alt-text-done-color: #54ffbd; + --alt-text-warning-color: #80ebff; + } +} + +:where(html.is-dark) + :is( + .annotationEditorLayer + :is(.freeTextEditor, .inkEditor, .stampEditor, .highlightEditor), + .textLayer + ) + .editToolbar { + --editor-toolbar-bg-color: #2b2a33; + --editor-toolbar-fg-color: #fbfbfe; + --editor-toolbar-hover-bg-color: #52525e; + --editor-toolbar-focus-outline-color: #0df; + --alt-text-done-color: #54ffbd; + --alt-text-warning-color: #80ebff; +} + +@media screen and (forced-colors: active) { + :is( + .annotationEditorLayer + :is(.freeTextEditor, .inkEditor, .stampEditor, .highlightEditor), + .textLayer + ) + .editToolbar { + --editor-toolbar-bg-color: ButtonFace; + --editor-toolbar-fg-color: ButtonText; + --editor-toolbar-border-color: ButtonText; + --editor-toolbar-hover-border-color: AccentColor; + --editor-toolbar-hover-bg-color: ButtonFace; + --editor-toolbar-hover-fg-color: AccentColor; + --editor-toolbar-hover-outline: 2px solid + var(--editor-toolbar-hover-border-color); + --editor-toolbar-focus-outline-color: ButtonBorder; + --editor-toolbar-shadow: none; + --alt-text-done-color: var(--editor-toolbar-fg-color); + --alt-text-warning-color: var(--editor-toolbar-fg-color); + --alt-text-hover-done-color: var(--editor-toolbar-hover-fg-color); + --alt-text-hover-warning-color: var(--editor-toolbar-hover-fg-color); + } +} + +:is( + .annotationEditorLayer + :is(.freeTextEditor, .inkEditor, .stampEditor, .highlightEditor), + .textLayer + ) + .editToolbar { + display: flex; + width: -moz-fit-content; + width: fit-content; + height: var(--editor-toolbar-height); + flex-direction: column; + justify-content: center; + align-items: center; + cursor: default; + pointer-events: auto; + box-sizing: content-box; + padding: var(--editor-toolbar-padding); + + position: absolute; + inset-inline-end: 0; + inset-block-start: calc(100% + var(--editor-toolbar-vert-offset)); + + border-radius: 6px; + background-color: var(--editor-toolbar-bg-color); + border: 1px solid var(--editor-toolbar-border-color); + box-shadow: var(--editor-toolbar-shadow); +} + +.hidden:is( + :is( + .annotationEditorLayer + :is(.freeTextEditor, .inkEditor, .stampEditor, .highlightEditor), + .textLayer + ) + .editToolbar + ) { + display: none; +} + +:is( + :is( + .annotationEditorLayer + :is(.freeTextEditor, .inkEditor, .stampEditor, .highlightEditor), + .textLayer + ) + .editToolbar + ):has(:focus-visible) { + border-color: transparent; +} + +[dir='ltr'] + :is( + :is( + .annotationEditorLayer + :is(.freeTextEditor, .inkEditor, .stampEditor, .highlightEditor), + .textLayer + ) + .editToolbar + ) { + transform-origin: 100% 0; +} + +[dir='rtl'] + :is( + :is( + .annotationEditorLayer + :is(.freeTextEditor, .inkEditor, .stampEditor, .highlightEditor), + .textLayer + ) + .editToolbar + ) { + transform-origin: 0 0; +} + +:is( + :is( + .annotationEditorLayer + :is(.freeTextEditor, .inkEditor, .stampEditor, .highlightEditor), + .textLayer + ) + .editToolbar + ) + .buttons { + display: flex; + justify-content: center; + align-items: center; + gap: 0; + height: 100%; +} + +:is( + :is( + :is( + .annotationEditorLayer + :is(.freeTextEditor, .inkEditor, .stampEditor, .highlightEditor), + .textLayer + ) + .editToolbar + ) + .buttons + ) + button { + padding: 0; +} + +:is( + :is( + :is( + .annotationEditorLayer + :is(.freeTextEditor, .inkEditor, .stampEditor, .highlightEditor), + .textLayer + ) + .editToolbar + ) + .buttons + ) + .divider { + width: 0; + height: calc( + 2 * var(--editor-toolbar-padding) + var(--editor-toolbar-height) + ); + border-left: 1px solid var(--editor-toolbar-border-color); + border-right: none; + display: inline-block; + margin-inline: 2px; +} + +:is( + :is( + :is( + .annotationEditorLayer + :is(.freeTextEditor, .inkEditor, .stampEditor, .highlightEditor), + .textLayer + ) + .editToolbar + ) + .buttons + ) + .highlightButton { + width: var(--editor-toolbar-height); +} + +:is( + :is( + :is( + :is( + .annotationEditorLayer + :is( + .freeTextEditor, + .inkEditor, + .stampEditor, + .highlightEditor + ), + .textLayer + ) + .editToolbar + ) + .buttons + ) + .highlightButton + )::before { + content: ''; + -webkit-mask-image: var(--editor-toolbar-highlight-image); + mask-image: var(--editor-toolbar-highlight-image); + -webkit-mask-repeat: no-repeat; + mask-repeat: no-repeat; + -webkit-mask-position: center; + mask-position: center; + display: inline-block; + background-color: var(--editor-toolbar-fg-color); + width: 100%; + height: 100%; +} + +:is( + :is( + :is( + :is( + .annotationEditorLayer + :is( + .freeTextEditor, + .inkEditor, + .stampEditor, + .highlightEditor + ), + .textLayer + ) + .editToolbar + ) + .buttons + ) + .highlightButton + ):hover::before { + background-color: var(--editor-toolbar-hover-fg-color); +} + +:is( + :is( + :is( + .annotationEditorLayer + :is(.freeTextEditor, .inkEditor, .stampEditor, .highlightEditor), + .textLayer + ) + .editToolbar + ) + .buttons + ) + .delete { + width: var(--editor-toolbar-height); +} + +:is( + :is( + :is( + :is( + .annotationEditorLayer + :is( + .freeTextEditor, + .inkEditor, + .stampEditor, + .highlightEditor + ), + .textLayer + ) + .editToolbar + ) + .buttons + ) + .delete + )::before { + content: ''; + -webkit-mask-image: var(--editor-toolbar-delete-image); + mask-image: var(--editor-toolbar-delete-image); + -webkit-mask-repeat: no-repeat; + mask-repeat: no-repeat; + -webkit-mask-position: center; + mask-position: center; + display: inline-block; + background-color: var(--editor-toolbar-fg-color); + width: 100%; + height: 100%; +} + +:is( + :is( + :is( + :is( + .annotationEditorLayer + :is( + .freeTextEditor, + .inkEditor, + .stampEditor, + .highlightEditor + ), + .textLayer + ) + .editToolbar + ) + .buttons + ) + .delete + ):hover::before { + background-color: var(--editor-toolbar-hover-fg-color); +} + +:is( + :is( + :is( + .annotationEditorLayer + :is(.freeTextEditor, .inkEditor, .stampEditor, .highlightEditor), + .textLayer + ) + .editToolbar + ) + .buttons + ) + > * { + height: var(--editor-toolbar-height); +} + +:is( + :is( + :is( + .annotationEditorLayer + :is(.freeTextEditor, .inkEditor, .stampEditor, .highlightEditor), + .textLayer + ) + .editToolbar + ) + .buttons + ) + > :not(.divider) { + border: none; + background-color: transparent; + cursor: pointer; +} + +:is( + :is( + :is( + :is( + .annotationEditorLayer + :is( + .freeTextEditor, + .inkEditor, + .stampEditor, + .highlightEditor + ), + .textLayer + ) + .editToolbar + ) + .buttons + ) + > :not(.divider) + ):hover { + border-radius: 2px; + background-color: var(--editor-toolbar-hover-bg-color); + color: var(--editor-toolbar-hover-fg-color); + outline: var(--editor-toolbar-hover-outline); + outline-offset: 1px; +} + +:is( + :is( + :is( + :is( + .annotationEditorLayer + :is( + .freeTextEditor, + .inkEditor, + .stampEditor, + .highlightEditor + ), + .textLayer + ) + .editToolbar + ) + .buttons + ) + > :not(.divider) + ):hover:active { + outline: none; +} + +:is( + :is( + :is( + :is( + .annotationEditorLayer + :is( + .freeTextEditor, + .inkEditor, + .stampEditor, + .highlightEditor + ), + .textLayer + ) + .editToolbar + ) + .buttons + ) + > :not(.divider) + ):focus-visible { + border-radius: 2px; + outline: 2px solid var(--editor-toolbar-focus-outline-color); +} + +:is( + :is( + :is( + .annotationEditorLayer + :is(.freeTextEditor, .inkEditor, .stampEditor, .highlightEditor), + .textLayer + ) + .editToolbar + ) + .buttons + ) + .altText { + --alt-text-add-image: url(images/altText_add.svg); + --alt-text-done-image: url(images/altText_done.svg); + + display: flex; + align-items: center; + justify-content: center; + width: -moz-max-content; + width: max-content; + padding-inline: 8px; + pointer-events: all; + font: menu; + font-weight: 590; + font-size: 12px; + color: var(--editor-toolbar-fg-color); +} + +:is( + :is( + :is( + :is( + .annotationEditorLayer + :is( + .freeTextEditor, + .inkEditor, + .stampEditor, + .highlightEditor + ), + .textLayer + ) + .editToolbar + ) + .buttons + ) + .altText + ):disabled { + pointer-events: none; +} + +:is( + :is( + :is( + :is( + .annotationEditorLayer + :is( + .freeTextEditor, + .inkEditor, + .stampEditor, + .highlightEditor + ), + .textLayer + ) + .editToolbar + ) + .buttons + ) + .altText + )::before { + content: ''; + -webkit-mask-image: var(--alt-text-add-image); + mask-image: var(--alt-text-add-image); + -webkit-mask-repeat: no-repeat; + mask-repeat: no-repeat; + -webkit-mask-position: center; + mask-position: center; + display: inline-block; + width: 12px; + height: 13px; + background-color: var(--editor-toolbar-fg-color); + margin-inline-end: 4px; +} + +:is( + :is( + :is( + :is( + .annotationEditorLayer + :is( + .freeTextEditor, + .inkEditor, + .stampEditor, + .highlightEditor + ), + .textLayer + ) + .editToolbar + ) + .buttons + ) + .altText + ):hover::before { + background-color: var(--editor-toolbar-hover-fg-color); +} + +.done:is( + :is( + :is( + :is( + .annotationEditorLayer + :is( + .freeTextEditor, + .inkEditor, + .stampEditor, + .highlightEditor + ), + .textLayer + ) + .editToolbar + ) + .buttons + ) + .altText + )::before { + -webkit-mask-image: var(--alt-text-done-image); + mask-image: var(--alt-text-done-image); +} + +.new:is( + :is( + :is( + :is( + .annotationEditorLayer + :is( + .freeTextEditor, + .inkEditor, + .stampEditor, + .highlightEditor + ), + .textLayer + ) + .editToolbar + ) + .buttons + ) + .altText + )::before { + width: 16px; + height: 16px; + -webkit-mask-image: var(--new-alt-text-warning-image); + mask-image: var(--new-alt-text-warning-image); + background-color: var(--alt-text-warning-color); + -webkit-mask-size: cover; + mask-size: cover; +} + +.new:is( + :is( + :is( + :is( + .annotationEditorLayer + :is( + .freeTextEditor, + .inkEditor, + .stampEditor, + .highlightEditor + ), + .textLayer + ) + .editToolbar + ) + .buttons + ) + .altText + ):hover::before { + background-color: var(--alt-text-hover-warning-color); +} + +.new.done:is( + :is( + :is( + :is( + .annotationEditorLayer + :is( + .freeTextEditor, + .inkEditor, + .stampEditor, + .highlightEditor + ), + .textLayer + ) + .editToolbar + ) + .buttons + ) + .altText + )::before { + -webkit-mask-image: var(--alt-text-done-image); + mask-image: var(--alt-text-done-image); + background-color: var(--alt-text-done-color); +} + +.new.done:is( + :is( + :is( + :is( + .annotationEditorLayer + :is( + .freeTextEditor, + .inkEditor, + .stampEditor, + .highlightEditor + ), + .textLayer + ) + .editToolbar + ) + .buttons + ) + .altText + ):hover::before { + background-color: var(--alt-text-hover-done-color); +} + +:is( + :is( + :is( + :is( + .annotationEditorLayer + :is( + .freeTextEditor, + .inkEditor, + .stampEditor, + .highlightEditor + ), + .textLayer + ) + .editToolbar + ) + .buttons + ) + .altText + ) + .tooltip { + display: none; + word-wrap: anywhere; +} + +.show:is( + :is( + :is( + :is( + :is( + .annotationEditorLayer + :is( + .freeTextEditor, + .inkEditor, + .stampEditor, + .highlightEditor + ), + .textLayer + ) + .editToolbar + ) + .buttons + ) + .altText + ) + .tooltip + ) { + --alt-text-tooltip-bg: #f0f0f4; + --alt-text-tooltip-fg: #15141a; + --alt-text-tooltip-border: #8f8f9d; + --alt-text-tooltip-shadow: 0px 2px 6px 0px rgb(58 57 68 / 0.2); +} + +@media (prefers-color-scheme: dark) { + :where(html:not(.is-light)) + .show:is( + :is( + :is( + :is( + :is( + .annotationEditorLayer + :is( + .freeTextEditor, + .inkEditor, + .stampEditor, + .highlightEditor + ), + .textLayer + ) + .editToolbar + ) + .buttons + ) + .altText + ) + .tooltip + ) { + --alt-text-tooltip-bg: #1c1b22; + --alt-text-tooltip-fg: #fbfbfe; + --alt-text-tooltip-shadow: 0px 2px 6px 0px #15141a; + } +} + +:where(html.is-dark) + .show:is( + :is( + :is( + :is( + :is( + .annotationEditorLayer + :is( + .freeTextEditor, + .inkEditor, + .stampEditor, + .highlightEditor + ), + .textLayer + ) + .editToolbar + ) + .buttons + ) + .altText + ) + .tooltip + ) { + --alt-text-tooltip-bg: #1c1b22; + --alt-text-tooltip-fg: #fbfbfe; + --alt-text-tooltip-shadow: 0px 2px 6px 0px #15141a; +} + +@media screen and (forced-colors: active) { + .show:is( + :is( + :is( + :is( + :is( + .annotationEditorLayer + :is( + .freeTextEditor, + .inkEditor, + .stampEditor, + .highlightEditor + ), + .textLayer + ) + .editToolbar + ) + .buttons + ) + .altText + ) + .tooltip + ) { + --alt-text-tooltip-bg: Canvas; + --alt-text-tooltip-fg: CanvasText; + --alt-text-tooltip-border: CanvasText; + --alt-text-tooltip-shadow: none; + } +} + +.show:is( + :is( + :is( + :is( + :is( + .annotationEditorLayer + :is( + .freeTextEditor, + .inkEditor, + .stampEditor, + .highlightEditor + ), + .textLayer + ) + .editToolbar + ) + .buttons + ) + .altText + ) + .tooltip + ) { + display: inline-flex; + flex-direction: column; + align-items: center; + justify-content: center; + position: absolute; + top: calc(100% + 2px); + inset-inline-start: 0; + padding-block: 2px 3px; + padding-inline: 3px; + max-width: 300px; + width: -moz-max-content; + width: max-content; + height: auto; + font-size: 12px; + + border: 0.5px solid var(--alt-text-tooltip-border); + background: var(--alt-text-tooltip-bg); + box-shadow: var(--alt-text-tooltip-shadow); + color: var(--alt-text-tooltip-fg); + + pointer-events: none; +} + +.annotationEditorLayer .freeTextEditor { + padding: calc(var(--freetext-padding) * var(--scale-factor)); + width: auto; + height: auto; + touch-action: none; +} + +.annotationEditorLayer .freeTextEditor .internal { + background: transparent; + border: none; + inset: 0; + overflow: visible; + white-space: nowrap; + font: 10px sans-serif; + line-height: var(--freetext-line-height); + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; +} + +.annotationEditorLayer .freeTextEditor .overlay { + position: absolute; + display: none; + background: transparent; + inset: 0; + width: 100%; + height: 100%; +} + +.annotationEditorLayer freeTextEditor .overlay.enabled { + display: block; +} + +.annotationEditorLayer .freeTextEditor .internal:empty::before { + content: attr(default-content); + color: gray; +} + +.annotationEditorLayer .freeTextEditor .internal:focus { + outline: none; + -webkit-user-select: auto; + -moz-user-select: auto; + user-select: auto; +} + +.annotationEditorLayer .inkEditor { + width: 100%; + height: 100%; +} + +.annotationEditorLayer .inkEditor.editing { + cursor: inherit; +} + +.annotationEditorLayer .inkEditor .inkEditorCanvas { + position: absolute; + inset: 0; + width: 100%; + height: 100%; + touch-action: none; +} + +.annotationEditorLayer .stampEditor { + width: auto; + height: auto; +} + +:is(.annotationEditorLayer .stampEditor) canvas { + position: absolute; + width: 100%; + height: 100%; + margin: 0; + top: 0; + left: 0; +} + +:is(.annotationEditorLayer .stampEditor) .noAltTextBadge { + --no-alt-text-badge-border-color: #f0f0f4; + --no-alt-text-badge-bg-color: #cfcfd8; + --no-alt-text-badge-fg-color: #5b5b66; +} + +@media (prefers-color-scheme: dark) { + :where(html:not(.is-light)) + :is(.annotationEditorLayer .stampEditor) + .noAltTextBadge { + --no-alt-text-badge-border-color: #52525e; + --no-alt-text-badge-bg-color: #fbfbfe; + --no-alt-text-badge-fg-color: #15141a; + } +} + +:where(html.is-dark) :is(.annotationEditorLayer .stampEditor) .noAltTextBadge { + --no-alt-text-badge-border-color: #52525e; + --no-alt-text-badge-bg-color: #fbfbfe; + --no-alt-text-badge-fg-color: #15141a; +} + +@media screen and (forced-colors: active) { + :is(.annotationEditorLayer .stampEditor) .noAltTextBadge { + --no-alt-text-badge-border-color: ButtonText; + --no-alt-text-badge-bg-color: ButtonFace; + --no-alt-text-badge-fg-color: ButtonText; + } +} + +:is(.annotationEditorLayer .stampEditor) .noAltTextBadge { + position: absolute; + inset-inline-end: 5px; + inset-block-end: 5px; + display: inline-flex; + width: 32px; + height: 32px; + padding: 3px; + justify-content: center; + align-items: center; + pointer-events: none; + z-index: 1; + + border-radius: 2px; + border: 1px solid var(--no-alt-text-badge-border-color); + background: var(--no-alt-text-badge-bg-color); +} + +:is(:is(.annotationEditorLayer .stampEditor) .noAltTextBadge)::before { + content: ''; + display: inline-block; + width: 16px; + height: 16px; + -webkit-mask-image: var(--new-alt-text-warning-image); + mask-image: var(--new-alt-text-warning-image); + -webkit-mask-size: cover; + mask-size: cover; + background-color: var(--no-alt-text-badge-fg-color); +} + +:is(.annotationEditorLayer :is(.freeTextEditor, .inkEditor, .stampEditor)) + > .resizers { + position: absolute; + inset: 0; +} + +.hidden:is( + :is(.annotationEditorLayer :is(.freeTextEditor, .inkEditor, .stampEditor)) + > .resizers + ) { + display: none; +} + +:is( + :is(.annotationEditorLayer :is(.freeTextEditor, .inkEditor, .stampEditor)) + > .resizers + ) + > .resizer { + width: var(--resizer-size); + height: var(--resizer-size); + background: content-box var(--resizer-bg-color); + border: var(--focus-outline-around); + border-radius: 2px; + position: absolute; +} + +.topLeft:is( + :is( + :is( + .annotationEditorLayer + :is(.freeTextEditor, .inkEditor, .stampEditor) + ) + > .resizers + ) + > .resizer + ) { + top: var(--resizer-shift); + left: var(--resizer-shift); +} + +.topMiddle:is( + :is( + :is( + .annotationEditorLayer + :is(.freeTextEditor, .inkEditor, .stampEditor) + ) + > .resizers + ) + > .resizer + ) { + top: var(--resizer-shift); + left: calc(50% + var(--resizer-shift)); +} + +.topRight:is( + :is( + :is( + .annotationEditorLayer + :is(.freeTextEditor, .inkEditor, .stampEditor) + ) + > .resizers + ) + > .resizer + ) { + top: var(--resizer-shift); + right: var(--resizer-shift); +} + +.middleRight:is( + :is( + :is( + .annotationEditorLayer + :is(.freeTextEditor, .inkEditor, .stampEditor) + ) + > .resizers + ) + > .resizer + ) { + top: calc(50% + var(--resizer-shift)); + right: var(--resizer-shift); +} + +.bottomRight:is( + :is( + :is( + .annotationEditorLayer + :is(.freeTextEditor, .inkEditor, .stampEditor) + ) + > .resizers + ) + > .resizer + ) { + bottom: var(--resizer-shift); + right: var(--resizer-shift); +} + +.bottomMiddle:is( + :is( + :is( + .annotationEditorLayer + :is(.freeTextEditor, .inkEditor, .stampEditor) + ) + > .resizers + ) + > .resizer + ) { + bottom: var(--resizer-shift); + left: calc(50% + var(--resizer-shift)); +} + +.bottomLeft:is( + :is( + :is( + .annotationEditorLayer + :is(.freeTextEditor, .inkEditor, .stampEditor) + ) + > .resizers + ) + > .resizer + ) { + bottom: var(--resizer-shift); + left: var(--resizer-shift); +} + +.middleLeft:is( + :is( + :is( + .annotationEditorLayer + :is(.freeTextEditor, .inkEditor, .stampEditor) + ) + > .resizers + ) + > .resizer + ) { + top: calc(50% + var(--resizer-shift)); + left: var(--resizer-shift); +} + +.topLeft:is( + :is( + .annotationEditorLayer[data-main-rotation='0'] + :is([data-editor-rotation='0'], [data-editor-rotation='180']), + .annotationEditorLayer[data-main-rotation='90'] + :is([data-editor-rotation='270'], [data-editor-rotation='90']), + .annotationEditorLayer[data-main-rotation='180'] + :is([data-editor-rotation='180'], [data-editor-rotation='0']), + .annotationEditorLayer[data-main-rotation='270'] + :is([data-editor-rotation='90'], [data-editor-rotation='270']) + ) + > .resizers + > .resizer + ), +.bottomRight:is( + :is( + .annotationEditorLayer[data-main-rotation='0'] + :is([data-editor-rotation='0'], [data-editor-rotation='180']), + .annotationEditorLayer[data-main-rotation='90'] + :is([data-editor-rotation='270'], [data-editor-rotation='90']), + .annotationEditorLayer[data-main-rotation='180'] + :is([data-editor-rotation='180'], [data-editor-rotation='0']), + .annotationEditorLayer[data-main-rotation='270'] + :is([data-editor-rotation='90'], [data-editor-rotation='270']) + ) + > .resizers + > .resizer + ) { + cursor: nwse-resize; +} + +.topMiddle:is( + :is( + .annotationEditorLayer[data-main-rotation='0'] + :is([data-editor-rotation='0'], [data-editor-rotation='180']), + .annotationEditorLayer[data-main-rotation='90'] + :is([data-editor-rotation='270'], [data-editor-rotation='90']), + .annotationEditorLayer[data-main-rotation='180'] + :is([data-editor-rotation='180'], [data-editor-rotation='0']), + .annotationEditorLayer[data-main-rotation='270'] + :is([data-editor-rotation='90'], [data-editor-rotation='270']) + ) + > .resizers + > .resizer + ), +.bottomMiddle:is( + :is( + .annotationEditorLayer[data-main-rotation='0'] + :is([data-editor-rotation='0'], [data-editor-rotation='180']), + .annotationEditorLayer[data-main-rotation='90'] + :is([data-editor-rotation='270'], [data-editor-rotation='90']), + .annotationEditorLayer[data-main-rotation='180'] + :is([data-editor-rotation='180'], [data-editor-rotation='0']), + .annotationEditorLayer[data-main-rotation='270'] + :is([data-editor-rotation='90'], [data-editor-rotation='270']) + ) + > .resizers + > .resizer + ) { + cursor: ns-resize; +} + +.topRight:is( + :is( + .annotationEditorLayer[data-main-rotation='0'] + :is([data-editor-rotation='0'], [data-editor-rotation='180']), + .annotationEditorLayer[data-main-rotation='90'] + :is([data-editor-rotation='270'], [data-editor-rotation='90']), + .annotationEditorLayer[data-main-rotation='180'] + :is([data-editor-rotation='180'], [data-editor-rotation='0']), + .annotationEditorLayer[data-main-rotation='270'] + :is([data-editor-rotation='90'], [data-editor-rotation='270']) + ) + > .resizers + > .resizer + ), +.bottomLeft:is( + :is( + .annotationEditorLayer[data-main-rotation='0'] + :is([data-editor-rotation='0'], [data-editor-rotation='180']), + .annotationEditorLayer[data-main-rotation='90'] + :is([data-editor-rotation='270'], [data-editor-rotation='90']), + .annotationEditorLayer[data-main-rotation='180'] + :is([data-editor-rotation='180'], [data-editor-rotation='0']), + .annotationEditorLayer[data-main-rotation='270'] + :is([data-editor-rotation='90'], [data-editor-rotation='270']) + ) + > .resizers + > .resizer + ) { + cursor: nesw-resize; +} + +.middleRight:is( + :is( + .annotationEditorLayer[data-main-rotation='0'] + :is([data-editor-rotation='0'], [data-editor-rotation='180']), + .annotationEditorLayer[data-main-rotation='90'] + :is([data-editor-rotation='270'], [data-editor-rotation='90']), + .annotationEditorLayer[data-main-rotation='180'] + :is([data-editor-rotation='180'], [data-editor-rotation='0']), + .annotationEditorLayer[data-main-rotation='270'] + :is([data-editor-rotation='90'], [data-editor-rotation='270']) + ) + > .resizers + > .resizer + ), +.middleLeft:is( + :is( + .annotationEditorLayer[data-main-rotation='0'] + :is([data-editor-rotation='0'], [data-editor-rotation='180']), + .annotationEditorLayer[data-main-rotation='90'] + :is([data-editor-rotation='270'], [data-editor-rotation='90']), + .annotationEditorLayer[data-main-rotation='180'] + :is([data-editor-rotation='180'], [data-editor-rotation='0']), + .annotationEditorLayer[data-main-rotation='270'] + :is([data-editor-rotation='90'], [data-editor-rotation='270']) + ) + > .resizers + > .resizer + ) { + cursor: ew-resize; +} + +.topLeft:is( + :is( + .annotationEditorLayer[data-main-rotation='0'] + :is([data-editor-rotation='90'], [data-editor-rotation='270']), + .annotationEditorLayer[data-main-rotation='90'] + :is([data-editor-rotation='0'], [data-editor-rotation='180']), + .annotationEditorLayer[data-main-rotation='180'] + :is([data-editor-rotation='270'], [data-editor-rotation='90']), + .annotationEditorLayer[data-main-rotation='270'] + :is([data-editor-rotation='180'], [data-editor-rotation='0']) + ) + > .resizers + > .resizer + ), +.bottomRight:is( + :is( + .annotationEditorLayer[data-main-rotation='0'] + :is([data-editor-rotation='90'], [data-editor-rotation='270']), + .annotationEditorLayer[data-main-rotation='90'] + :is([data-editor-rotation='0'], [data-editor-rotation='180']), + .annotationEditorLayer[data-main-rotation='180'] + :is([data-editor-rotation='270'], [data-editor-rotation='90']), + .annotationEditorLayer[data-main-rotation='270'] + :is([data-editor-rotation='180'], [data-editor-rotation='0']) + ) + > .resizers + > .resizer + ) { + cursor: nesw-resize; +} + +.topMiddle:is( + :is( + .annotationEditorLayer[data-main-rotation='0'] + :is([data-editor-rotation='90'], [data-editor-rotation='270']), + .annotationEditorLayer[data-main-rotation='90'] + :is([data-editor-rotation='0'], [data-editor-rotation='180']), + .annotationEditorLayer[data-main-rotation='180'] + :is([data-editor-rotation='270'], [data-editor-rotation='90']), + .annotationEditorLayer[data-main-rotation='270'] + :is([data-editor-rotation='180'], [data-editor-rotation='0']) + ) + > .resizers + > .resizer + ), +.bottomMiddle:is( + :is( + .annotationEditorLayer[data-main-rotation='0'] + :is([data-editor-rotation='90'], [data-editor-rotation='270']), + .annotationEditorLayer[data-main-rotation='90'] + :is([data-editor-rotation='0'], [data-editor-rotation='180']), + .annotationEditorLayer[data-main-rotation='180'] + :is([data-editor-rotation='270'], [data-editor-rotation='90']), + .annotationEditorLayer[data-main-rotation='270'] + :is([data-editor-rotation='180'], [data-editor-rotation='0']) + ) + > .resizers + > .resizer + ) { + cursor: ew-resize; +} + +.topRight:is( + :is( + .annotationEditorLayer[data-main-rotation='0'] + :is([data-editor-rotation='90'], [data-editor-rotation='270']), + .annotationEditorLayer[data-main-rotation='90'] + :is([data-editor-rotation='0'], [data-editor-rotation='180']), + .annotationEditorLayer[data-main-rotation='180'] + :is([data-editor-rotation='270'], [data-editor-rotation='90']), + .annotationEditorLayer[data-main-rotation='270'] + :is([data-editor-rotation='180'], [data-editor-rotation='0']) + ) + > .resizers + > .resizer + ), +.bottomLeft:is( + :is( + .annotationEditorLayer[data-main-rotation='0'] + :is([data-editor-rotation='90'], [data-editor-rotation='270']), + .annotationEditorLayer[data-main-rotation='90'] + :is([data-editor-rotation='0'], [data-editor-rotation='180']), + .annotationEditorLayer[data-main-rotation='180'] + :is([data-editor-rotation='270'], [data-editor-rotation='90']), + .annotationEditorLayer[data-main-rotation='270'] + :is([data-editor-rotation='180'], [data-editor-rotation='0']) + ) + > .resizers + > .resizer + ) { + cursor: nwse-resize; +} + +.middleRight:is( + :is( + .annotationEditorLayer[data-main-rotation='0'] + :is([data-editor-rotation='90'], [data-editor-rotation='270']), + .annotationEditorLayer[data-main-rotation='90'] + :is([data-editor-rotation='0'], [data-editor-rotation='180']), + .annotationEditorLayer[data-main-rotation='180'] + :is([data-editor-rotation='270'], [data-editor-rotation='90']), + .annotationEditorLayer[data-main-rotation='270'] + :is([data-editor-rotation='180'], [data-editor-rotation='0']) + ) + > .resizers + > .resizer + ), +.middleLeft:is( + :is( + .annotationEditorLayer[data-main-rotation='0'] + :is([data-editor-rotation='90'], [data-editor-rotation='270']), + .annotationEditorLayer[data-main-rotation='90'] + :is([data-editor-rotation='0'], [data-editor-rotation='180']), + .annotationEditorLayer[data-main-rotation='180'] + :is([data-editor-rotation='270'], [data-editor-rotation='90']), + .annotationEditorLayer[data-main-rotation='270'] + :is([data-editor-rotation='180'], [data-editor-rotation='0']) + ) + > .resizers + > .resizer + ) { + cursor: ns-resize; +} + +:is( + .annotationEditorLayer + :is( + [data-main-rotation='0'] [data-editor-rotation='90'], + [data-main-rotation='90'] [data-editor-rotation='0'], + [data-main-rotation='180'] [data-editor-rotation='270'], + [data-main-rotation='270'] [data-editor-rotation='180'] + ) + ) + .editToolbar { + rotate: 270deg; +} + +[dir='ltr'] + :is( + :is( + .annotationEditorLayer + :is( + [data-main-rotation='0'] [data-editor-rotation='90'], + [data-main-rotation='90'] [data-editor-rotation='0'], + [data-main-rotation='180'] [data-editor-rotation='270'], + [data-main-rotation='270'] [data-editor-rotation='180'] + ) + ) + .editToolbar + ) { + inset-inline-end: calc(0px - var(--editor-toolbar-vert-offset)); + inset-block-start: 0; +} + +[dir='rtl'] + :is( + :is( + .annotationEditorLayer + :is( + [data-main-rotation='0'] [data-editor-rotation='90'], + [data-main-rotation='90'] [data-editor-rotation='0'], + [data-main-rotation='180'] [data-editor-rotation='270'], + [data-main-rotation='270'] [data-editor-rotation='180'] + ) + ) + .editToolbar + ) { + inset-inline-end: calc(100% + var(--editor-toolbar-vert-offset)); + inset-block-start: 0; +} + +:is( + .annotationEditorLayer + :is( + [data-main-rotation='0'] [data-editor-rotation='180'], + [data-main-rotation='90'] [data-editor-rotation='90'], + [data-main-rotation='180'] [data-editor-rotation='0'], + [data-main-rotation='270'] [data-editor-rotation='270'] + ) + ) + .editToolbar { + rotate: 180deg; + inset-inline-end: 100%; + inset-block-start: calc(0pc - var(--editor-toolbar-vert-offset)); +} + +:is( + .annotationEditorLayer + :is( + [data-main-rotation='0'] [data-editor-rotation='270'], + [data-main-rotation='90'] [data-editor-rotation='180'], + [data-main-rotation='180'] [data-editor-rotation='90'], + [data-main-rotation='270'] [data-editor-rotation='0'] + ) + ) + .editToolbar { + rotate: 90deg; +} + +[dir='ltr'] + :is( + :is( + .annotationEditorLayer + :is( + [data-main-rotation='0'] [data-editor-rotation='270'], + [data-main-rotation='90'] [data-editor-rotation='180'], + [data-main-rotation='180'] [data-editor-rotation='90'], + [data-main-rotation='270'] [data-editor-rotation='0'] + ) + ) + .editToolbar + ) { + inset-inline-end: calc(100% + var(--editor-toolbar-vert-offset)); + inset-block-start: 100%; +} + +[dir='rtl'] + :is( + :is( + .annotationEditorLayer + :is( + [data-main-rotation='0'] [data-editor-rotation='270'], + [data-main-rotation='90'] [data-editor-rotation='180'], + [data-main-rotation='180'] [data-editor-rotation='90'], + [data-main-rotation='270'] [data-editor-rotation='0'] + ) + ) + .editToolbar + ) { + inset-inline-start: calc(0px - var(--editor-toolbar-vert-offset)); + inset-block-start: 0; +} + +.dialog.altText::backdrop { + -webkit-mask: url(#alttext-manager-mask); + mask: url(#alttext-manager-mask); +} + +.dialog.altText.positioned { + margin: 0; +} + +.dialog.altText #altTextContainer { + width: 300px; + height: -moz-fit-content; + height: fit-content; + display: inline-flex; + flex-direction: column; + align-items: flex-start; + gap: 16px; +} + +:is(.dialog.altText #altTextContainer) #overallDescription { + display: flex; + flex-direction: column; + align-items: flex-start; + gap: 4px; + align-self: stretch; +} + +:is(:is(.dialog.altText #altTextContainer) #overallDescription) span { + align-self: stretch; +} + +:is(:is(.dialog.altText #altTextContainer) #overallDescription) .title { + font-size: 13px; + font-style: normal; + font-weight: 590; +} + +:is(.dialog.altText #altTextContainer) #addDescription { + display: flex; + flex-direction: column; + align-items: stretch; + gap: 8px; +} + +:is(:is(.dialog.altText #altTextContainer) #addDescription) .descriptionArea { + flex: 1; + padding-inline: 24px 10px; +} + +:is( + :is(:is(.dialog.altText #altTextContainer) #addDescription) .descriptionArea + ) + textarea { + width: 100%; + min-height: 75px; +} + +:is(.dialog.altText #altTextContainer) #buttons { + display: flex; + justify-content: flex-end; + align-items: flex-start; + gap: 8px; + align-self: stretch; +} + +.dialog.newAltText { + --new-alt-text-ai-disclaimer-icon: url(images/altText_disclaimer.svg); + --new-alt-text-spinner-icon: url(images/altText_spinner.svg); + --preview-image-bg-color: #f0f0f4; + --preview-image-border: none; +} + +@media (prefers-color-scheme: dark) { + :where(html:not(.is-light)) .dialog.newAltText { + --preview-image-bg-color: #2b2a33; + } +} + +:where(html.is-dark) .dialog.newAltText { + --preview-image-bg-color: #2b2a33; +} + +@media screen and (forced-colors: active) { + .dialog.newAltText { + --preview-image-bg-color: ButtonFace; + --preview-image-border: 1px solid ButtonText; + } +} + +.dialog.newAltText { + width: 80%; + max-width: 570px; + min-width: 300px; + padding: 0; +} + +.dialog.newAltText.noAi #newAltTextDisclaimer, +.dialog.newAltText.noAi #newAltTextCreateAutomatically { + display: none !important; +} + +.dialog.newAltText.aiInstalling #newAltTextCreateAutomatically { + display: none !important; +} + +.dialog.newAltText.aiInstalling #newAltTextDownloadModel { + display: flex !important; +} + +.dialog.newAltText.error #newAltTextNotNow { + display: none !important; +} + +.dialog.newAltText.error #newAltTextCancel { + display: inline-block !important; +} + +.dialog.newAltText:not(.error) #newAltTextError { + display: none !important; +} + +.dialog.newAltText #newAltTextContainer { + display: flex; + width: auto; + padding: 16px; + flex-direction: column; + justify-content: flex-end; + align-items: flex-start; + gap: 12px; + flex: 0 1 auto; + line-height: normal; +} + +:is(.dialog.newAltText #newAltTextContainer) #mainContent { + display: flex; + justify-content: flex-end; + align-items: flex-start; + gap: 12px; + align-self: stretch; + flex: 1 1 auto; +} + +:is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) + #descriptionAndSettings { + display: flex; + flex-direction: column; + align-items: flex-start; + gap: 16px; + flex: 1 0 0; + align-self: stretch; +} + +:is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) + #descriptionInstruction { + display: flex; + flex-direction: column; + align-items: flex-start; + gap: 8px; + align-self: stretch; + flex: 1 1 auto; +} + +:is( + :is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) + #descriptionInstruction + ) + #newAltTextDescriptionContainer { + width: 100%; + height: 70px; + position: relative; +} + +:is( + :is( + :is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) + #descriptionInstruction + ) + #newAltTextDescriptionContainer + ) + textarea { + width: 100%; + height: 100%; + padding: 8px; +} + +:is( + :is( + :is( + :is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) + #descriptionInstruction + ) + #newAltTextDescriptionContainer + ) + textarea + )::-moz-placeholder { + color: var(--text-secondary-color); +} + +:is( + :is( + :is( + :is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) + #descriptionInstruction + ) + #newAltTextDescriptionContainer + ) + textarea + )::placeholder { + color: var(--text-secondary-color); +} + +:is( + :is( + :is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) + #descriptionInstruction + ) + #newAltTextDescriptionContainer + ) + .altTextSpinner { + display: none; + position: absolute; + width: 16px; + height: 16px; + inset-inline-start: 8px; + inset-block-start: 8px; + -webkit-mask-size: cover; + mask-size: cover; + background-color: var(--text-secondary-color); + pointer-events: none; +} + +.loading:is( + :is( + :is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) + #descriptionInstruction + ) + #newAltTextDescriptionContainer + ) + textarea::-moz-placeholder { + color: transparent; +} + +.loading:is( + :is( + :is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) + #descriptionInstruction + ) + #newAltTextDescriptionContainer + ) + textarea::placeholder { + color: transparent; +} + +.loading:is( + :is( + :is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) + #descriptionInstruction + ) + #newAltTextDescriptionContainer + ) + .altTextSpinner { + display: inline-block; + -webkit-mask-image: var(--new-alt-text-spinner-icon); + mask-image: var(--new-alt-text-spinner-icon); +} + +:is( + :is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) + #descriptionInstruction + ) + #newAltTextDescription { + font-size: 11px; +} + +:is( + :is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) + #descriptionInstruction + ) + #newAltTextDisclaimer { + display: flex; + flex-direction: row; + align-items: flex-start; + gap: 4px; + font-size: 11px; +} + +:is( + :is( + :is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) + #descriptionInstruction + ) + #newAltTextDisclaimer + )::before { + content: ''; + display: inline-block; + width: 17px; + height: 16px; + -webkit-mask-image: var(--new-alt-text-ai-disclaimer-icon); + mask-image: var(--new-alt-text-ai-disclaimer-icon); + -webkit-mask-size: cover; + mask-size: cover; + background-color: var(--text-secondary-color); + flex: 1 0 auto; +} + +:is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) + #newAltTextDownloadModel { + display: flex; + align-items: center; + gap: 4px; + align-self: stretch; +} + +:is( + :is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) + #newAltTextDownloadModel + )::before { + content: ''; + display: inline-block; + width: 16px; + height: 16px; + -webkit-mask-image: var(--new-alt-text-spinner-icon); + mask-image: var(--new-alt-text-spinner-icon); + -webkit-mask-size: cover; + mask-size: cover; + background-color: var(--text-secondary-color); +} + +:is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) + #newAltTextImagePreview { + width: 180px; + aspect-ratio: 1; + display: flex; + justify-content: center; + align-items: center; + flex: 0 0 auto; + background-color: var(--preview-image-bg-color); + border: var(--preview-image-border); +} + +:is( + :is(:is(.dialog.newAltText #newAltTextContainer) #mainContent) + #newAltTextImagePreview + ) + > canvas { + max-width: 100%; + max-height: 100%; +} + +.colorPicker { + --hover-outline-color: #0250bb; + --selected-outline-color: #0060df; + --swatch-border-color: #cfcfd8; +} + +@media (prefers-color-scheme: dark) { + :where(html:not(.is-light)) .colorPicker { + --hover-outline-color: #80ebff; + --selected-outline-color: #aaf2ff; + --swatch-border-color: #52525e; + } +} + +:where(html.is-dark) .colorPicker { + --hover-outline-color: #80ebff; + --selected-outline-color: #aaf2ff; + --swatch-border-color: #52525e; +} + +@media screen and (forced-colors: active) { + .colorPicker { + --hover-outline-color: Highlight; + --selected-outline-color: var(--hover-outline-color); + --swatch-border-color: ButtonText; + } +} + +.colorPicker .swatch { + width: 16px; + height: 16px; + border: 1px solid var(--swatch-border-color); + border-radius: 100%; + outline-offset: 2px; + box-sizing: border-box; + forced-color-adjust: none; +} + +.colorPicker button:is(:hover, .selected) > .swatch { + border: none; +} + +.annotationEditorLayer[data-main-rotation='0'] + .highlightEditor:not(.free) + > .editToolbar { + rotate: 0deg; +} + +.annotationEditorLayer[data-main-rotation='90'] + .highlightEditor:not(.free) + > .editToolbar { + rotate: 270deg; +} + +.annotationEditorLayer[data-main-rotation='180'] + .highlightEditor:not(.free) + > .editToolbar { + rotate: 180deg; +} + +.annotationEditorLayer[data-main-rotation='270'] + .highlightEditor:not(.free) + > .editToolbar { + rotate: 90deg; +} + +.annotationEditorLayer .highlightEditor { + position: absolute; + background: transparent; + z-index: 1; + cursor: auto; + max-width: 100%; + max-height: 100%; + border: none; + outline: none; + pointer-events: none; + transform-origin: 0 0; +} + +:is(.annotationEditorLayer .highlightEditor):not(.free) { + transform: none; +} + +:is(.annotationEditorLayer .highlightEditor) .internal { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + pointer-events: auto; +} + +.disabled:is(.annotationEditorLayer .highlightEditor) .internal { + pointer-events: none; +} + +.selectedEditor:is(.annotationEditorLayer .highlightEditor) .internal { + cursor: pointer; +} + +:is(.annotationEditorLayer .highlightEditor) .editToolbar { + --editor-toolbar-colorpicker-arrow-image: url(images/toolbarButton-menuArrow.svg); + + transform-origin: center !important; +} + +:is(:is(:is(.annotationEditorLayer .highlightEditor) .editToolbar) .buttons) + .colorPicker { + position: relative; + width: auto; + display: flex; + justify-content: center; + align-items: center; + gap: 4px; + padding: 4px; +} + +:is( + :is(:is(:is(.annotationEditorLayer .highlightEditor) .editToolbar) .buttons) + .colorPicker + )::after { + content: ''; + -webkit-mask-image: var(--editor-toolbar-colorpicker-arrow-image); + mask-image: var(--editor-toolbar-colorpicker-arrow-image); + -webkit-mask-repeat: no-repeat; + mask-repeat: no-repeat; + -webkit-mask-position: center; + mask-position: center; + display: inline-block; + background-color: var(--editor-toolbar-fg-color); + width: 12px; + height: 12px; +} + +:is( + :is(:is(:is(.annotationEditorLayer .highlightEditor) .editToolbar) .buttons) + .colorPicker + ):hover::after { + background-color: var(--editor-toolbar-hover-fg-color); +} + +:is( + :is(:is(:is(.annotationEditorLayer .highlightEditor) .editToolbar) .buttons) + .colorPicker + ):has(.dropdown:not(.hidden)) { + background-color: var(--editor-toolbar-hover-bg-color); +} + +:is( + :is(:is(:is(.annotationEditorLayer .highlightEditor) .editToolbar) .buttons) + .colorPicker + ):has(.dropdown:not(.hidden))::after { + scale: -1; +} + +:is( + :is(:is(:is(.annotationEditorLayer .highlightEditor) .editToolbar) .buttons) + .colorPicker + ) + .dropdown { + position: absolute; + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; + gap: 11px; + padding-block: 8px; + border-radius: 6px; + background-color: var(--editor-toolbar-bg-color); + border: 1px solid var(--editor-toolbar-border-color); + box-shadow: var(--editor-toolbar-shadow); + inset-block-start: calc(100% + 4px); + width: calc(100% + 2 * var(--editor-toolbar-padding)); +} + +:is( + :is( + :is( + :is(:is(.annotationEditorLayer .highlightEditor) .editToolbar) + .buttons + ) + .colorPicker + ) + .dropdown + ) + button { + width: 100%; + height: auto; + border: none; + cursor: pointer; + display: flex; + justify-content: center; + align-items: center; + background: none; +} + +:is( + :is( + :is( + :is( + :is(:is(.annotationEditorLayer .highlightEditor) .editToolbar) + .buttons + ) + .colorPicker + ) + .dropdown + ) + button + ):is(:active, :focus-visible) { + outline: none; +} + +:is( + :is( + :is( + :is( + :is(:is(.annotationEditorLayer .highlightEditor) .editToolbar) + .buttons + ) + .colorPicker + ) + .dropdown + ) + button + ) + > .swatch { + outline-offset: 2px; +} + +[aria-selected='true']:is( + :is( + :is( + :is( + :is(:is(.annotationEditorLayer .highlightEditor) .editToolbar) + .buttons + ) + .colorPicker + ) + .dropdown + ) + button + ) + > .swatch { + outline: 2px solid var(--selected-outline-color); +} + +:is( + :is( + :is( + :is( + :is(:is(.annotationEditorLayer .highlightEditor) .editToolbar) + .buttons + ) + .colorPicker + ) + .dropdown + ) + button + ):is(:hover, :active, :focus-visible) + > .swatch { + outline: 2px solid var(--hover-outline-color); +} + +.editorParamsToolbar:has(#highlightParamsToolbarContainer) { + padding: unset; +} + +#highlightParamsToolbarContainer { + gap: 16px; + padding-inline: 10px; + padding-block-end: 12px; +} + +#highlightParamsToolbarContainer .colorPicker { + display: flex; + flex-direction: column; + gap: 8px; +} + +:is(#highlightParamsToolbarContainer .colorPicker) .dropdown { + display: flex; + justify-content: space-between; + align-items: center; + flex-direction: row; + height: auto; +} + +:is(:is(#highlightParamsToolbarContainer .colorPicker) .dropdown) button { + width: auto; + height: auto; + border: none; + cursor: pointer; + display: flex; + justify-content: center; + align-items: center; + background: none; + flex: 0 0 auto; + padding: 0; +} + +:is(:is(:is(#highlightParamsToolbarContainer .colorPicker) .dropdown) button) + .swatch { + width: 24px; + height: 24px; +} + +:is( + :is(:is(#highlightParamsToolbarContainer .colorPicker) .dropdown) button + ):is(:active, :focus-visible) { + outline: none; +} + +[aria-selected='true']:is( + :is(:is(#highlightParamsToolbarContainer .colorPicker) .dropdown) button + ) + > .swatch { + outline: 2px solid var(--selected-outline-color); +} + +:is( + :is(:is(#highlightParamsToolbarContainer .colorPicker) .dropdown) button + ):is(:hover, :active, :focus-visible) + > .swatch { + outline: 2px solid var(--hover-outline-color); +} + +#highlightParamsToolbarContainer #editorHighlightThickness { + display: flex; + flex-direction: column; + align-items: center; + gap: 4px; + align-self: stretch; +} + +:is(#highlightParamsToolbarContainer #editorHighlightThickness) + .editorParamsLabel { + height: auto; + align-self: stretch; +} + +:is(#highlightParamsToolbarContainer #editorHighlightThickness) + .thicknessPicker { + display: flex; + justify-content: space-between; + align-items: center; + align-self: stretch; + + --example-color: #bfbfc9; +} + +@media (prefers-color-scheme: dark) { + :where(html:not(.is-light)) + :is(#highlightParamsToolbarContainer #editorHighlightThickness) + .thicknessPicker { + --example-color: #80808e; + } +} + +:where(html.is-dark) + :is(#highlightParamsToolbarContainer #editorHighlightThickness) + .thicknessPicker { + --example-color: #80808e; +} + +@media screen and (forced-colors: active) { + :is(#highlightParamsToolbarContainer #editorHighlightThickness) + .thicknessPicker { + --example-color: CanvasText; + } +} + +:is( + :is( + :is(#highlightParamsToolbarContainer #editorHighlightThickness) + .thicknessPicker + ) + > .editorParamsSlider[disabled] +) { + opacity: 0.4; +} + +:is( + :is(#highlightParamsToolbarContainer #editorHighlightThickness) + .thicknessPicker + )::before, +:is( + :is(#highlightParamsToolbarContainer #editorHighlightThickness) + .thicknessPicker + )::after { + content: ''; + width: 8px; + aspect-ratio: 1; + display: block; + border-radius: 100%; + background-color: var(--example-color); +} + +:is( + :is(#highlightParamsToolbarContainer #editorHighlightThickness) + .thicknessPicker + )::after { + width: 24px; +} + +:is( + :is(#highlightParamsToolbarContainer #editorHighlightThickness) + .thicknessPicker + ) + .editorParamsSlider { + width: unset; + height: 14px; +} + +#highlightParamsToolbarContainer #editorHighlightVisibility { + display: flex; + flex-direction: column; + align-items: flex-start; + gap: 8px; + align-self: stretch; +} + +:is(#highlightParamsToolbarContainer #editorHighlightVisibility) .divider { + --divider-color: #d7d7db; +} + +@media (prefers-color-scheme: dark) { + :where(html:not(.is-light)) + :is(#highlightParamsToolbarContainer #editorHighlightVisibility) + .divider { + --divider-color: #8f8f9d; + } +} + +:where(html.is-dark) + :is(#highlightParamsToolbarContainer #editorHighlightVisibility) + .divider { + --divider-color: #8f8f9d; +} + +@media screen and (forced-colors: active) { + :is(#highlightParamsToolbarContainer #editorHighlightVisibility) .divider { + --divider-color: CanvasText; + } +} + +:is(#highlightParamsToolbarContainer #editorHighlightVisibility) .divider { + margin-block: 4px; + width: 100%; + height: 1px; + background-color: var(--divider-color); +} + +:is(#highlightParamsToolbarContainer #editorHighlightVisibility) .toggler { + display: flex; + justify-content: space-between; + align-items: center; + align-self: stretch; +} + +#altTextSettingsDialog { + padding: 16px; +} + +#altTextSettingsDialog #altTextSettingsContainer { + display: flex; + width: 573px; + flex-direction: column; + gap: 16px; +} + +:is(#altTextSettingsDialog #altTextSettingsContainer) .mainContainer { + gap: 16px; +} + +:is(#altTextSettingsDialog #altTextSettingsContainer) .description { + color: var(--text-secondary-color); +} + +:is(#altTextSettingsDialog #altTextSettingsContainer) #aiModelSettings { + display: flex; + flex-direction: column; + gap: 12px; +} + +:is(:is(#altTextSettingsDialog #altTextSettingsContainer) #aiModelSettings) + button { + width: -moz-fit-content; + width: fit-content; +} + +.download:is( + :is(#altTextSettingsDialog #altTextSettingsContainer) #aiModelSettings + ) + #deleteModelButton { + display: none; +} + +:is(:is(#altTextSettingsDialog #altTextSettingsContainer) #aiModelSettings):not( + .download + ) + #downloadModelButton { + display: none; +} + +:is(#altTextSettingsDialog #altTextSettingsContainer) #automaticAltText, +:is(#altTextSettingsDialog #altTextSettingsContainer) #altTextEditor { + display: flex; + flex-direction: column; + gap: 8px; +} + +:is(#altTextSettingsDialog #altTextSettingsContainer) #createModelDescription, +:is(#altTextSettingsDialog #altTextSettingsContainer) #aiModelSettings, +:is(#altTextSettingsDialog #altTextSettingsContainer) + #showAltTextDialogDescription { + padding-inline-start: 40px; +} + +:is(#altTextSettingsDialog #altTextSettingsContainer) #automaticSettings { + display: flex; + flex-direction: column; + gap: 16px; +} + +:root { + --viewer-container-height: 0; + --pdfViewer-padding-bottom: 0; + --page-margin: 1px auto -8px; + --page-border: 9px solid transparent; + --spreadHorizontalWrapped-margin-LR: -3.5px; + --loading-icon-delay: 400ms; +} + +@media screen and (forced-colors: active) { + :root { + --pdfViewer-padding-bottom: 9px; + --page-margin: 8px auto -1px; + --page-border: 1px solid CanvasText; + --spreadHorizontalWrapped-margin-LR: 3.5px; + } +} + +[data-main-rotation='90'] { + transform: rotate(90deg) translateY(-100%); +} +[data-main-rotation='180'] { + transform: rotate(180deg) translate(-100%, -100%); +} +[data-main-rotation='270'] { + transform: rotate(270deg) translateX(-100%); +} + +#hiddenCopyElement, +.hiddenCanvasElement { + position: absolute; + top: 0; + left: 0; + width: 0; + height: 0; + display: none; +} + +.pdfViewer { + --scale-factor: 1; + --page-bg-color: unset; + + padding-bottom: var(--pdfViewer-padding-bottom); + + --hcm-highlight-filter: none; + --hcm-highlight-selected-filter: none; +} + +@media screen and (forced-colors: active) { + .pdfViewer { + --hcm-highlight-filter: invert(100%); + } +} + +.pdfViewer.copyAll { + cursor: wait; +} + +.pdfViewer .canvasWrapper { + overflow: hidden; + width: 100%; + height: 100%; +} + +:is(.pdfViewer .canvasWrapper) canvas { + position: absolute; + top: 0; + left: 0; + margin: 0; + display: block; + width: 100%; + height: 100%; + contain: content; +} + +:is(:is(.pdfViewer .canvasWrapper) canvas) .structTree { + contain: strict; +} + +.pdfViewer .page { + --scale-round-x: 1px; + --scale-round-y: 1px; + + direction: ltr; + width: 816px; + height: 1056px; + margin: var(--page-margin); + position: relative; + overflow: visible; + border: var(--page-border); + background-clip: content-box; + background-color: var(--page-bg-color, rgb(255 255 255)); +} + +.pdfViewer .dummyPage { + position: relative; + width: 0; + height: var(--viewer-container-height); +} + +.pdfViewer.noUserSelect { + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; +} + +.pdfViewer.removePageBorders .page { + margin: 0 auto 10px; + border: none; +} + +.pdfViewer:is(.scrollHorizontal, .scrollWrapped), +.spread { + margin-inline: 3.5px; + text-align: center; +} + +.pdfViewer.scrollHorizontal, +.spread { + white-space: nowrap; +} + +.pdfViewer.removePageBorders, +.pdfViewer:is(.scrollHorizontal, .scrollWrapped) .spread { + margin-inline: 0; +} + +.spread :is(.page, .dummyPage), +.pdfViewer:is(.scrollHorizontal, .scrollWrapped) :is(.page, .spread) { + display: inline-block; + vertical-align: middle; +} + +.spread .page, +.pdfViewer:is(.scrollHorizontal, .scrollWrapped) .page { + margin-inline: var(--spreadHorizontalWrapped-margin-LR); +} + +.pdfViewer.removePageBorders .spread .page, +.pdfViewer.removePageBorders:is(.scrollHorizontal, .scrollWrapped) .page { + margin-inline: 5px; +} + +.pdfViewer .page.loadingIcon::after { + position: absolute; + top: 0; + left: 0; + content: ''; + width: 100%; + height: 100%; + background: url('images/loading-icon.gif') center no-repeat; + display: none; + transition-property: display; + transition-delay: var(--loading-icon-delay); + z-index: 5; + contain: strict; +} + +.pdfViewer .page.loading::after { + display: block; +} + +.pdfViewer .page:not(.loading)::after { + transition-property: none; + display: none; +} + +.pdfPresentationMode .pdfViewer { + padding-bottom: 0; +} + +.pdfPresentationMode .spread { + margin: 0; +} + +.pdfPresentationMode .pdfViewer .page { + margin: 0 auto; + border: 2px solid transparent; +} + +:root { + --dir-factor: 1; + --inline-start: left; + --inline-end: right; + + --sidebar-width: 200px; + --sidebar-transition-duration: 200ms; + --sidebar-transition-timing-function: ease; + + --toolbar-height: 32px; + --toolbar-horizontal-padding: 1px; + --toolbar-vertical-padding: 2px; + --icon-size: 16px; + + --toolbar-icon-opacity: 0.7; + --doorhanger-icon-opacity: 0.9; + --doorhanger-height: 8px; + + --main-color: rgb(12 12 13); + --body-bg-color: rgb(212 212 215); + --progressBar-color: rgb(10 132 255); + --progressBar-bg-color: rgb(221 221 222); + --progressBar-blend-color: rgb(116 177 239); + --scrollbar-color: auto; + --scrollbar-bg-color: auto; + --toolbar-icon-bg-color: rgb(0 0 0); + --toolbar-icon-hover-bg-color: rgb(0 0 0); + + --sidebar-narrow-bg-color: rgb(212 212 215 / 0.9); + --sidebar-toolbar-bg-color: rgb(245 246 247); + --toolbar-bg-color: rgb(249 249 250); + --toolbar-border-color: rgb(184 184 184); + --toolbar-box-shadow: 0 1px 0 var(--toolbar-border-color); + --toolbar-border-bottom: none; + --toolbarSidebar-box-shadow: + inset calc(-1px * var(--dir-factor)) 0 0 rgb(0 0 0 / 0.25), + 0 1px 0 rgb(0 0 0 / 0.15), 0 0 1px rgb(0 0 0 / 0.1); + --toolbarSidebar-border-bottom: none; + --button-hover-color: rgb(221 222 223); + --toggled-btn-color: rgb(0 0 0); + --toggled-btn-bg-color: rgb(0 0 0 / 0.3); + --toggled-hover-active-btn-color: rgb(0 0 0 / 0.4); + --toggled-hover-btn-outline: none; + --dropdown-btn-bg-color: rgb(215 215 219); + --dropdown-btn-border: none; + --separator-color: rgb(0 0 0 / 0.3); + --field-color: rgb(6 6 6); + --field-bg-color: rgb(255 255 255); + --field-border-color: rgb(187 187 188); + --treeitem-color: rgb(0 0 0 / 0.8); + --treeitem-bg-color: rgb(0 0 0 / 0.15); + --treeitem-hover-color: rgb(0 0 0 / 0.9); + --treeitem-selected-color: rgb(0 0 0 / 0.9); + --treeitem-selected-bg-color: rgb(0 0 0 / 0.25); + --thumbnail-hover-color: rgb(0 0 0 / 0.1); + --thumbnail-selected-color: rgb(0 0 0 / 0.2); + --doorhanger-bg-color: rgb(255 255 255); + --doorhanger-border-color: rgb(12 12 13 / 0.2); + --doorhanger-hover-color: rgb(12 12 13); + --doorhanger-hover-bg-color: rgb(237 237 237); + --doorhanger-separator-color: rgb(222 222 222); + --dialog-button-border: none; + --dialog-button-bg-color: rgb(12 12 13 / 0.1); + --dialog-button-hover-bg-color: rgb(12 12 13 / 0.3); + + --loading-icon: url(images/loading.svg); + --treeitem-expanded-icon: url(images/treeitem-expanded.svg); + --treeitem-collapsed-icon: url(images/treeitem-collapsed.svg); + --toolbarButton-editorFreeText-icon: url(images/toolbarButton-editorFreeText.svg); + --toolbarButton-editorHighlight-icon: url(images/toolbarButton-editorHighlight.svg); + --toolbarButton-editorInk-icon: url(images/toolbarButton-editorInk.svg); + --toolbarButton-editorStamp-icon: url(images/toolbarButton-editorStamp.svg); + --toolbarButton-menuArrow-icon: url(images/toolbarButton-menuArrow.svg); + --toolbarButton-sidebarToggle-icon: url(images/toolbarButton-sidebarToggle.svg); + --toolbarButton-secondaryToolbarToggle-icon: url(images/toolbarButton-secondaryToolbarToggle.svg); + --toolbarButton-pageUp-icon: url(images/toolbarButton-pageUp.svg); + --toolbarButton-pageDown-icon: url(images/toolbarButton-pageDown.svg); + --toolbarButton-zoomOut-icon: url(images/toolbarButton-zoomOut.svg); + --toolbarButton-zoomIn-icon: url(images/toolbarButton-zoomIn.svg); + --toolbarButton-presentationMode-icon: url(images/toolbarButton-presentationMode.svg); + --toolbarButton-print-icon: url(images/toolbarButton-print.svg); + --toolbarButton-openFile-icon: url(images/toolbarButton-openFile.svg); + --toolbarButton-download-icon: url(images/toolbarButton-download.svg); + --toolbarButton-bookmark-icon: url(images/toolbarButton-bookmark.svg); + --toolbarButton-viewThumbnail-icon: url(images/toolbarButton-viewThumbnail.svg); + --toolbarButton-viewOutline-icon: url(images/toolbarButton-viewOutline.svg); + --toolbarButton-viewAttachments-icon: url(images/toolbarButton-viewAttachments.svg); + --toolbarButton-viewLayers-icon: url(images/toolbarButton-viewLayers.svg); + --toolbarButton-currentOutlineItem-icon: url(images/toolbarButton-currentOutlineItem.svg); + --toolbarButton-search-icon: url(images/toolbarButton-search.svg); + --findbarButton-previous-icon: url(images/findbarButton-previous.svg); + --findbarButton-next-icon: url(images/findbarButton-next.svg); + --secondaryToolbarButton-firstPage-icon: url(images/secondaryToolbarButton-firstPage.svg); + --secondaryToolbarButton-lastPage-icon: url(images/secondaryToolbarButton-lastPage.svg); + --secondaryToolbarButton-rotateCcw-icon: url(images/secondaryToolbarButton-rotateCcw.svg); + --secondaryToolbarButton-rotateCw-icon: url(images/secondaryToolbarButton-rotateCw.svg); + --secondaryToolbarButton-selectTool-icon: url(images/secondaryToolbarButton-selectTool.svg); + --secondaryToolbarButton-handTool-icon: url(images/secondaryToolbarButton-handTool.svg); + --secondaryToolbarButton-scrollPage-icon: url(images/secondaryToolbarButton-scrollPage.svg); + --secondaryToolbarButton-scrollVertical-icon: url(images/secondaryToolbarButton-scrollVertical.svg); + --secondaryToolbarButton-scrollHorizontal-icon: url(images/secondaryToolbarButton-scrollHorizontal.svg); + --secondaryToolbarButton-scrollWrapped-icon: url(images/secondaryToolbarButton-scrollWrapped.svg); + --secondaryToolbarButton-spreadNone-icon: url(images/secondaryToolbarButton-spreadNone.svg); + --secondaryToolbarButton-spreadOdd-icon: url(images/secondaryToolbarButton-spreadOdd.svg); + --secondaryToolbarButton-spreadEven-icon: url(images/secondaryToolbarButton-spreadEven.svg); + --secondaryToolbarButton-imageAltTextSettings-icon: var( + --toolbarButton-editorStamp-icon + ); + --secondaryToolbarButton-documentProperties-icon: url(images/secondaryToolbarButton-documentProperties.svg); + --editorParams-stampAddImage-icon: url(images/toolbarButton-zoomIn.svg); +} + +[dir='rtl']:root { + --dir-factor: -1; + --inline-start: right; + --inline-end: left; +} + +@media (prefers-color-scheme: dark) { + :root:where(:not(.is-light)) { + --main-color: rgb(249 249 250); + --body-bg-color: rgb(42 42 46); + --progressBar-color: rgb(0 96 223); + --progressBar-bg-color: rgb(40 40 43); + --progressBar-blend-color: rgb(20 68 133); + --scrollbar-color: rgb(121 121 123); + --scrollbar-bg-color: rgb(35 35 39); + --toolbar-icon-bg-color: rgb(255 255 255); + --toolbar-icon-hover-bg-color: rgb(255 255 255); + + --sidebar-narrow-bg-color: rgb(42 42 46 / 0.9); + --sidebar-toolbar-bg-color: rgb(50 50 52); + --toolbar-bg-color: rgb(56 56 61); + --toolbar-border-color: rgb(12 12 13); + --button-hover-color: rgb(102 102 103); + --toggled-btn-color: rgb(255 255 255); + --toggled-btn-bg-color: rgb(0 0 0 / 0.3); + --toggled-hover-active-btn-color: rgb(0 0 0 / 0.4); + --dropdown-btn-bg-color: rgb(74 74 79); + --separator-color: rgb(0 0 0 / 0.3); + --field-color: rgb(250 250 250); + --field-bg-color: rgb(64 64 68); + --field-border-color: rgb(115 115 115); + --treeitem-color: rgb(255 255 255 / 0.8); + --treeitem-bg-color: rgb(255 255 255 / 0.15); + --treeitem-hover-color: rgb(255 255 255 / 0.9); + --treeitem-selected-color: rgb(255 255 255 / 0.9); + --treeitem-selected-bg-color: rgb(255 255 255 / 0.25); + --thumbnail-hover-color: rgb(255 255 255 / 0.1); + --thumbnail-selected-color: rgb(255 255 255 / 0.2); + --doorhanger-bg-color: rgb(74 74 79); + --doorhanger-border-color: rgb(39 39 43); + --doorhanger-hover-color: rgb(249 249 250); + --doorhanger-hover-bg-color: rgb(93 94 98); + --doorhanger-separator-color: rgb(92 92 97); + --dialog-button-bg-color: rgb(92 92 97); + --dialog-button-hover-bg-color: rgb(115 115 115); + } +} + +:root:where(.is-dark) { + --main-color: rgb(249 249 250); + --body-bg-color: rgb(42 42 46); + --progressBar-color: rgb(0 96 223); + --progressBar-bg-color: rgb(40 40 43); + --progressBar-blend-color: rgb(20 68 133); + --scrollbar-color: rgb(121 121 123); + --scrollbar-bg-color: rgb(35 35 39); + --toolbar-icon-bg-color: rgb(255 255 255); + --toolbar-icon-hover-bg-color: rgb(255 255 255); + + --sidebar-narrow-bg-color: rgb(42 42 46 / 0.9); + --sidebar-toolbar-bg-color: rgb(50 50 52); + --toolbar-bg-color: rgb(56 56 61); + --toolbar-border-color: rgb(12 12 13); + --button-hover-color: rgb(102 102 103); + --toggled-btn-color: rgb(255 255 255); + --toggled-btn-bg-color: rgb(0 0 0 / 0.3); + --toggled-hover-active-btn-color: rgb(0 0 0 / 0.4); + --dropdown-btn-bg-color: rgb(74 74 79); + --separator-color: rgb(0 0 0 / 0.3); + --field-color: rgb(250 250 250); + --field-bg-color: rgb(64 64 68); + --field-border-color: rgb(115 115 115); + --treeitem-color: rgb(255 255 255 / 0.8); + --treeitem-bg-color: rgb(255 255 255 / 0.15); + --treeitem-hover-color: rgb(255 255 255 / 0.9); + --treeitem-selected-color: rgb(255 255 255 / 0.9); + --treeitem-selected-bg-color: rgb(255 255 255 / 0.25); + --thumbnail-hover-color: rgb(255 255 255 / 0.1); + --thumbnail-selected-color: rgb(255 255 255 / 0.2); + --doorhanger-bg-color: rgb(74 74 79); + --doorhanger-border-color: rgb(39 39 43); + --doorhanger-hover-color: rgb(249 249 250); + --doorhanger-hover-bg-color: rgb(93 94 98); + --doorhanger-separator-color: rgb(92 92 97); + --dialog-button-bg-color: rgb(92 92 97); + --dialog-button-hover-bg-color: rgb(115 115 115); +} + +@media screen and (forced-colors: active) { + :root { + --button-hover-color: Highlight; + --doorhanger-hover-bg-color: Highlight; + --toolbar-icon-opacity: 1; + --toolbar-icon-bg-color: ButtonText; + --toolbar-icon-hover-bg-color: ButtonFace; + --toggled-hover-active-btn-color: ButtonText; + --toggled-hover-btn-outline: 2px solid ButtonBorder; + --toolbar-border-color: CanvasText; + --toolbar-border-bottom: 1px solid var(--toolbar-border-color); + --toolbar-box-shadow: none; + --toggled-btn-color: HighlightText; + --toggled-btn-bg-color: LinkText; + --doorhanger-hover-color: ButtonFace; + --doorhanger-border-color-whcm: 1px solid ButtonText; + --doorhanger-triangle-opacity-whcm: 0; + --dialog-button-border: 1px solid Highlight; + --dialog-button-hover-bg-color: Highlight; + --dialog-button-hover-color: ButtonFace; + --dropdown-btn-border: 1px solid ButtonText; + --field-border-color: ButtonText; + --main-color: CanvasText; + --separator-color: GrayText; + --doorhanger-separator-color: GrayText; + --toolbarSidebar-box-shadow: none; + --toolbarSidebar-border-bottom: 1px solid var(--toolbar-border-color); + } +} + +@media screen and (prefers-reduced-motion: reduce) { + :root { + --sidebar-transition-duration: 0; + } +} + +@keyframes progressIndeterminate { + 0% { + transform: translateX(calc(-142px * var(--dir-factor))); + } + + 100% { + transform: translateX(0); + } +} + +html[data-toolbar-density='compact'] { + --toolbar-height: 30px; +} + +html[data-toolbar-density='touch'] { + --toolbar-height: 44px; +} + +html, +body { + height: 100%; + width: 100%; +} + +body { + margin: 0; + background-color: var(--body-bg-color); + scrollbar-color: var(--scrollbar-color) var(--scrollbar-bg-color); +} + +body.wait::before { + content: ''; + position: fixed; + width: 100%; + height: 100%; + z-index: 100000; + cursor: wait; +} + +.hidden, +[hidden] { + display: none !important; +} + +#viewerContainer.pdfPresentationMode:fullscreen { + top: 0; + background-color: rgb(0 0 0); + width: 100%; + height: 100%; + overflow: hidden; + cursor: none; + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; +} + +.pdfPresentationMode:fullscreen section:not([data-internal-link]) { + pointer-events: none; +} + +.pdfPresentationMode:fullscreen .textLayer span { + cursor: none; +} + +.pdfPresentationMode.pdfPresentationModeControls > *, +.pdfPresentationMode.pdfPresentationModeControls .textLayer span { + cursor: default; +} + +#outerContainer { + width: 100%; + height: 100%; + position: relative; + margin: 0; +} + +#sidebarContainer { + position: absolute; + inset-block: var(--toolbar-height) 0; + inset-inline-start: calc(-1 * var(--sidebar-width)); + width: var(--sidebar-width); + visibility: hidden; + z-index: 1; + font: message-box; + border-top: 1px solid transparent; + border-inline-end: var(--doorhanger-border-color-whcm); + transition-property: inset-inline-start; + transition-duration: var(--sidebar-transition-duration); + transition-timing-function: var(--sidebar-transition-timing-function); +} + +#outerContainer:is(.sidebarMoving, .sidebarOpen) #sidebarContainer { + visibility: visible; +} + +#outerContainer.sidebarOpen #sidebarContainer { + inset-inline-start: 0; +} + +#mainContainer { + position: absolute; + inset: 0; + min-width: 350px; + margin: 0; + display: flex; + flex-direction: column; +} + +#sidebarContent { + inset-block: var(--toolbar-height) 0; + inset-inline-start: 0; + overflow: auto; + position: absolute; + width: 100%; + box-shadow: inset calc(-1px * var(--dir-factor)) 0 0 rgb(0 0 0 / 0.25); +} + +#viewerContainer { + overflow: auto; + position: absolute; + inset: var(--toolbar-height) 0 0; + outline: none; + z-index: 0; +} + +#viewerContainer:not(.pdfPresentationMode) { + transition-duration: var(--sidebar-transition-duration); + transition-timing-function: var(--sidebar-transition-timing-function); +} + +#outerContainer.sidebarOpen #viewerContainer:not(.pdfPresentationMode) { + inset-inline-start: var(--sidebar-width); + transition-property: inset-inline-start; +} + +#sidebarContainer :is(input, button, select) { + font: message-box; +} + +.toolbar { + z-index: 2; +} + +#toolbarSidebar { + width: 100%; + height: var(--toolbar-height); + background-color: var(--sidebar-toolbar-bg-color); + box-shadow: var(--toolbarSidebar-box-shadow); + border-bottom: var(--toolbarSidebar-border-bottom); + padding: var(--toolbar-vertical-padding) var(--toolbar-horizontal-padding); + justify-content: space-between; +} + +#toolbarSidebar #toolbarSidebarLeft { + width: auto; + height: 100%; +} + +:is(#toolbarSidebar #toolbarSidebarLeft) #viewThumbnail::before { + -webkit-mask-image: var(--toolbarButton-viewThumbnail-icon); + mask-image: var(--toolbarButton-viewThumbnail-icon); +} + +:is(#toolbarSidebar #toolbarSidebarLeft) #viewOutline::before { + -webkit-mask-image: var(--toolbarButton-viewOutline-icon); + mask-image: var(--toolbarButton-viewOutline-icon); + transform: scaleX(var(--dir-factor)); +} + +:is(#toolbarSidebar #toolbarSidebarLeft) #viewAttachments::before { + -webkit-mask-image: var(--toolbarButton-viewAttachments-icon); + mask-image: var(--toolbarButton-viewAttachments-icon); +} + +:is(#toolbarSidebar #toolbarSidebarLeft) #viewLayers::before { + -webkit-mask-image: var(--toolbarButton-viewLayers-icon); + mask-image: var(--toolbarButton-viewLayers-icon); +} + +#toolbarSidebar #toolbarSidebarRight { + width: auto; + height: 100%; + padding-inline-end: 2px; +} + +#sidebarResizer { + position: absolute; + inset-block: 0; + inset-inline-end: -6px; + width: 6px; + z-index: 200; + cursor: ew-resize; +} + +#outerContainer.sidebarOpen #loadingBar { + inset-inline-start: var(--sidebar-width); +} + +#outerContainer.sidebarResizing + :is(#sidebarContainer, #viewerContainer, #loadingBar) { + transition-duration: 0s; +} + +.doorHanger, +.doorHangerRight { + border-radius: 2px; + box-shadow: + 0 1px 5px var(--doorhanger-border-color), + 0 0 0 1px var(--doorhanger-border-color); + border: var(--doorhanger-border-color-whcm); + background-color: var(--doorhanger-bg-color); + inset-block-start: calc(100% + var(--doorhanger-height) - 2px); +} + +:is(.doorHanger, .doorHangerRight)::after, +:is(.doorHanger, .doorHangerRight)::before { + bottom: 100%; + border-style: solid; + border-color: transparent; + content: ''; + height: 0; + width: 0; + position: absolute; + pointer-events: none; + opacity: var(--doorhanger-triangle-opacity-whcm); +} + +:is(.doorHanger, .doorHangerRight)::before { + border-width: calc(var(--doorhanger-height) + 2px); + border-bottom-color: var(--doorhanger-border-color); +} + +:is(.doorHanger, .doorHangerRight)::after { + border-width: var(--doorhanger-height); +} + +.doorHangerRight { + inset-inline-end: calc(50% - var(--doorhanger-height) - 1px); +} + +.doorHangerRight::before { + inset-inline-end: -1px; +} + +.doorHangerRight::after { + border-bottom-color: var(--doorhanger-bg-color); + inset-inline-end: 1px; +} + +.doorHanger { + inset-inline-start: calc(50% - var(--doorhanger-height) - 1px); +} + +.doorHanger::before { + inset-inline-start: -1px; +} + +.doorHanger::after { + border-bottom-color: var(--toolbar-bg-color); + inset-inline-start: 1px; +} + +.dialogButton { + border: none; + background: none; + width: 28px; + height: 28px; + outline: none; +} + +.dialogButton:is(:hover, :focus-visible) { + background-color: var(--dialog-button-hover-bg-color); +} + +.dialogButton:is(:hover, :focus-visible) > span { + color: var(--dialog-button-hover-color); +} + +.splitToolbarButtonSeparator { + float: var(--inline-start); + width: 0; + height: 62%; + border-left: 1px solid var(--separator-color); + border-right: none; +} + +.dialogButton { + min-width: 16px; + margin: 2px 1px; + padding: 2px 6px 0; + border: none; + border-radius: 2px; + color: var(--main-color); + font-size: 12px; + line-height: 14px; + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; + cursor: default; + box-sizing: border-box; +} + +.treeItemToggler::before { + position: absolute; + display: inline-block; + width: 16px; + height: 16px; + + content: ''; + background-color: var(--toolbar-icon-bg-color); + -webkit-mask-size: cover; + mask-size: cover; +} + +#sidebarToggleButton::before { + -webkit-mask-image: var(--toolbarButton-sidebarToggle-icon); + mask-image: var(--toolbarButton-sidebarToggle-icon); + transform: scaleX(var(--dir-factor)); +} + +#secondaryToolbarToggleButton::before { + -webkit-mask-image: var(--toolbarButton-secondaryToolbarToggle-icon); + mask-image: var(--toolbarButton-secondaryToolbarToggle-icon); + transform: scaleX(var(--dir-factor)); +} + +#previous::before { + -webkit-mask-image: var(--toolbarButton-pageUp-icon); + mask-image: var(--toolbarButton-pageUp-icon); +} + +#next::before { + -webkit-mask-image: var(--toolbarButton-pageDown-icon); + mask-image: var(--toolbarButton-pageDown-icon); +} + +#zoomOutButton::before { + -webkit-mask-image: var(--toolbarButton-zoomOut-icon); + mask-image: var(--toolbarButton-zoomOut-icon); +} + +#zoomInButton::before { + -webkit-mask-image: var(--toolbarButton-zoomIn-icon); + mask-image: var(--toolbarButton-zoomIn-icon); +} + +#presentationMode::before { + -webkit-mask-image: var(--toolbarButton-presentationMode-icon); + mask-image: var(--toolbarButton-presentationMode-icon); +} + +#editorFreeTextButton::before { + -webkit-mask-image: var(--toolbarButton-editorFreeText-icon); + mask-image: var(--toolbarButton-editorFreeText-icon); +} + +#editorHighlightButton::before { + -webkit-mask-image: var(--toolbarButton-editorHighlight-icon); + mask-image: var(--toolbarButton-editorHighlight-icon); +} + +#editorInkButton::before { + -webkit-mask-image: var(--toolbarButton-editorInk-icon); + mask-image: var(--toolbarButton-editorInk-icon); +} + +#editorStampButton::before { + -webkit-mask-image: var(--toolbarButton-editorStamp-icon); + mask-image: var(--toolbarButton-editorStamp-icon); +} + +#printButton::before { + -webkit-mask-image: var(--toolbarButton-print-icon); + mask-image: var(--toolbarButton-print-icon); +} + +#secondaryOpenFile::before { + -webkit-mask-image: var(--toolbarButton-openFile-icon); + mask-image: var(--toolbarButton-openFile-icon); +} + +#downloadButton::before { + -webkit-mask-image: var(--toolbarButton-download-icon); + mask-image: var(--toolbarButton-download-icon); +} + +#viewBookmark::before { + -webkit-mask-image: var(--toolbarButton-bookmark-icon); + mask-image: var(--toolbarButton-bookmark-icon); +} + +#currentOutlineItem::before { + -webkit-mask-image: var(--toolbarButton-currentOutlineItem-icon); + mask-image: var(--toolbarButton-currentOutlineItem-icon); + transform: scaleX(var(--dir-factor)); +} + +#viewFindButton::before { + -webkit-mask-image: var(--toolbarButton-search-icon); + mask-image: var(--toolbarButton-search-icon); +} + +.pdfSidebarNotification::after { + position: absolute; + display: inline-block; + top: 2px; + inset-inline-end: 2px; + content: ''; + background-color: rgb(112 219 85); + height: 9px; + width: 9px; + border-radius: 50%; +} + +.verticalToolbarSeparator { + display: block; + margin-inline: 2px; + width: 0; + height: 80%; + border-left: 1px solid var(--separator-color); + border-right: none; + box-sizing: border-box; +} + +.horizontalToolbarSeparator { + display: block; + margin: 6px 0; + border-top: 1px solid var(--doorhanger-separator-color); + border-bottom: none; + height: 0; + width: 100%; +} + +.toggleButton { + display: inline; +} + +.toggleButton:has(> input:checked) { + color: var(--toggled-btn-color); + background-color: var(--toggled-btn-bg-color); +} + +.toggleButton:is(:hover, :has(> input:focus-visible)) { + color: var(--toggled-btn-color); + background-color: var(--button-hover-color); +} + +.toggleButton > input { + position: absolute; + top: 50%; + left: 50%; + opacity: 0; + width: 0; + height: 0; +} + +.toolbarField { + padding: 4px 7px; + margin: 3px 0; + border-radius: 2px; + background-color: var(--field-bg-color); + background-clip: padding-box; + border: 1px solid var(--field-border-color); + box-shadow: none; + color: var(--field-color); + font-size: 12px; + line-height: 16px; + outline: none; +} + +.toolbarField:focus { + border-color: #0a84ff; +} + +#pageNumber { + -moz-appearance: textfield; + text-align: end; + width: 40px; + background-size: 0 0; + transition-property: none; +} + +#pageNumber::-webkit-inner-spin-button { + -webkit-appearance: none; +} + +.loadingInput:has(> .loading:is(#pageNumber))::after { + display: inline; + visibility: visible; + + transition-property: visibility; + transition-delay: var(--loading-icon-delay); +} + +.loadingInput { + position: relative; +} + +.loadingInput::after { + position: absolute; + visibility: hidden; + display: none; + width: var(--icon-size); + height: var(--icon-size); + + content: ''; + background-color: var(--toolbar-icon-bg-color); + -webkit-mask-size: cover; + mask-size: cover; + -webkit-mask-image: var(--loading-icon); + mask-image: var(--loading-icon); +} + +.loadingInput.start::after { + inset-inline-start: 4px; +} + +.loadingInput.end::after { + inset-inline-end: 4px; +} + +#thumbnailView, +#outlineView, +#attachmentsView, +#layersView { + position: absolute; + width: calc(100% - 8px); + inset-block: 0; + padding: 4px 4px 0; + overflow: auto; + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; +} + +#thumbnailView { + width: calc(100% - 60px); + padding: 10px 30px 0; +} + +#thumbnailView > a:is(:active, :focus) { + outline: 0; +} + +.thumbnail { + --thumbnail-width: 0; + --thumbnail-height: 0; + + float: var(--inline-start); + width: var(--thumbnail-width); + height: var(--thumbnail-height); + margin: 0 10px 5px; + padding: 1px; + border: 7px solid transparent; + border-radius: 2px; +} + +#thumbnailView > a:last-of-type > .thumbnail { + margin-bottom: 10px; +} + +a:focus > .thumbnail, +.thumbnail:hover { + border-color: var(--thumbnail-hover-color); +} + +.thumbnail.selected { + border-color: var(--thumbnail-selected-color) !important; +} + +.thumbnailImage { + width: var(--thumbnail-width); + height: var(--thumbnail-height); + opacity: 0.9; +} + +a:focus > .thumbnail > .thumbnailImage, +.thumbnail:hover > .thumbnailImage { + opacity: 0.95; +} + +.thumbnail.selected > .thumbnailImage { + opacity: 1 !important; +} + +.thumbnail:not([data-loaded]) > .thumbnailImage { + width: calc(var(--thumbnail-width) - 2px); + height: calc(var(--thumbnail-height) - 2px); + border: 1px dashed rgb(132 132 132); +} + +.treeWithDeepNesting > .treeItem, +.treeItem > .treeItems { + margin-inline-start: 20px; +} + +.treeItem > a { + text-decoration: none; + display: inline-block; + min-width: calc(100% - 4px); + height: auto; + margin-bottom: 1px; + padding: 2px 0 5px; + padding-inline-start: 4px; + border-radius: 2px; + color: var(--treeitem-color); + font-size: 13px; + line-height: 15px; + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; + white-space: normal; + cursor: pointer; +} + +#layersView .treeItem > a * { + cursor: pointer; +} + +#layersView .treeItem > a > label { + padding-inline-start: 4px; +} + +#layersView .treeItem > a > label > input { + float: var(--inline-start); + margin-top: 1px; +} + +.treeItemToggler { + position: relative; + float: var(--inline-start); + height: 0; + width: 0; + color: rgb(255 255 255 / 0.5); +} + +.treeItemToggler::before { + inset-inline-end: 4px; + -webkit-mask-image: var(--treeitem-expanded-icon); + mask-image: var(--treeitem-expanded-icon); +} + +.treeItemToggler.treeItemsHidden::before { + -webkit-mask-image: var(--treeitem-collapsed-icon); + mask-image: var(--treeitem-collapsed-icon); + transform: scaleX(var(--dir-factor)); +} + +.treeItemToggler.treeItemsHidden ~ .treeItems { + display: none; +} + +.treeItem.selected > a { + background-color: var(--treeitem-selected-bg-color); + color: var(--treeitem-selected-color); +} + +.treeItemToggler:hover, +.treeItemToggler:hover + a, +.treeItemToggler:hover ~ .treeItems, +.treeItem > a:hover { + background-color: var(--treeitem-bg-color); + background-clip: padding-box; + border-radius: 2px; + color: var(--treeitem-hover-color); +} + +#outlineOptionsContainer { + display: none; +} + +#sidebarContainer:has(#outlineView:not(.hidden)) #outlineOptionsContainer { + display: inline flex; +} + +.dialogButton { + width: auto; + margin: 3px 4px 2px !important; + padding: 2px 11px; + color: var(--main-color); + background-color: var(--dialog-button-bg-color); + border: var(--dialog-button-border) !important; +} + +dialog { + margin: auto; + padding: 15px; + border-spacing: 4px; + color: var(--main-color); + font: message-box; + font-size: 12px; + line-height: 14px; + background-color: var(--doorhanger-bg-color); + border: 1px solid rgb(0 0 0 / 0.5); + border-radius: 4px; + box-shadow: 0 1px 4px rgb(0 0 0 / 0.3); +} + +dialog::backdrop { + background-color: rgb(0 0 0 / 0.2); +} + +dialog > .row { + display: table-row; +} + +dialog > .row > * { + display: table-cell; +} + +dialog .toolbarField { + margin: 5px 0; +} + +dialog .separator { + display: block; + margin: 4px 0; + height: 0; + width: 100%; + border-top: 1px solid var(--separator-color); + border-bottom: none; +} + +dialog .buttonRow { + text-align: center; + vertical-align: middle; +} + +dialog :link { + color: rgb(255 255 255); +} + +#passwordDialog { + text-align: center; +} + +#passwordDialog .toolbarField { + width: 200px; +} + +#documentPropertiesDialog { + text-align: left; +} + +#documentPropertiesDialog .row > * { + min-width: 100px; + text-align: start; +} + +#documentPropertiesDialog .row > span { + width: 125px; + word-wrap: break-word; +} + +#documentPropertiesDialog .row > p { + max-width: 225px; + word-wrap: break-word; +} + +#documentPropertiesDialog .buttonRow { + margin-top: 10px; +} + +.grab-to-pan-grab { + cursor: grab !important; +} + +.grab-to-pan-grab + *:not(input):not(textarea):not(button):not(select):not(:link) { + cursor: inherit !important; +} + +.grab-to-pan-grab:active, +.grab-to-pan-grabbing { + cursor: grabbing !important; +} + +.grab-to-pan-grabbing { + position: fixed; + background: rgb(0 0 0 / 0); + display: block; + inset: 0; + overflow: hidden; + z-index: 50000; +} + +.toolbarButton { + height: 100%; + aspect-ratio: 1; + display: flex; + align-items: center; + justify-content: center; + background: none; + border: none; + color: var(--main-color); + outline: none; + border-radius: 2px; + box-sizing: border-box; + font: message-box; + flex: none; + position: relative; + padding: 0; +} + +.toolbarButton > span { + display: inline-block; + width: 0; + height: 0; + overflow: hidden; +} + +.toolbarButton::before { + opacity: var(--toolbar-icon-opacity); + display: inline-block; + width: var(--icon-size); + height: var(--icon-size); + content: ''; + background-color: var(--toolbar-icon-bg-color); + -webkit-mask-size: cover; + mask-size: cover; + -webkit-mask-position: center; + mask-position: center; +} + +.toolbarButton.toggled { + background-color: var(--toggled-btn-bg-color); + color: var(--toggled-btn-color); +} + +.toolbarButton.toggled::before { + background-color: var(--toggled-btn-color); +} + +.toolbarButton.toggled:hover { + outline: var(--toggled-hover-btn-outline) !important; +} + +.toolbarButton.toggled:hover:active { + background-color: var(--toggled-hover-active-btn-color); +} + +.toolbarButton:is(:hover, :focus-visible) { + background-color: var(--button-hover-color); +} + +.toolbarButton:is(:hover, :focus-visible)::before { + background-color: var(--toolbar-icon-hover-bg-color); +} + +.toolbarButton:is([disabled='disabled'], [disabled]) { + opacity: 0.5; + pointer-events: none; +} + +.toolbarButton.labeled { + width: 100%; + min-height: var(--menuitem-height); + justify-content: flex-start; + gap: 8px; + padding-inline-start: 12px; + aspect-ratio: unset; + text-align: start; + white-space: normal; + cursor: default; +} + +.toolbarButton.labeled:is(a) { + text-decoration: none; +} + +.toolbarButton.labeled[href='#']:is(a) { + opacity: 0.5; + pointer-events: none; +} + +.toolbarButton.labeled::before { + opacity: var(--doorhanger-icon-opacity); +} + +.toolbarButton.labeled:is(:hover, :focus-visible) { + background-color: var(--doorhanger-hover-bg-color); + color: var(--doorhanger-hover-color); +} + +.toolbarButton.labeled > span { + display: inline-block; + width: -moz-max-content; + width: max-content; + height: auto; +} + +.toolbarButtonWithContainer { + height: 100%; + aspect-ratio: 1; + display: inline-block; + position: relative; + flex: none; +} + +.toolbarButtonWithContainer > .toolbarButton { + width: 100%; + height: 100%; +} + +.toolbarButtonWithContainer .menu { + padding-block: 5px; +} + +.toolbarButtonWithContainer .menuContainer { + width: 100%; + height: auto; + max-height: calc( + var(--viewer-container-height) - var(--toolbar-height) - + var(--doorhanger-height) + ); + display: flex; + flex-direction: column; + box-sizing: border-box; + overflow-y: auto; +} + +.toolbarButtonWithContainer .editorParamsToolbar { + height: auto; + width: 220px; + position: absolute; + z-index: 30000; + cursor: default; +} + +:is(.toolbarButtonWithContainer .editorParamsToolbar) + #editorStampAddImage::before { + -webkit-mask-image: var(--editorParams-stampAddImage-icon); + mask-image: var(--editorParams-stampAddImage-icon); +} + +:is(.toolbarButtonWithContainer .editorParamsToolbar) .editorParamsLabel { + flex: none; + font: menu; + font-size: 13px; + font-style: normal; + font-weight: 400; + line-height: 150%; + color: var(--main-color); + width: -moz-fit-content; + width: fit-content; + inset-inline-start: 0; +} + +:is(.toolbarButtonWithContainer .editorParamsToolbar) + .editorParamsToolbarContainer { + width: 100%; + height: auto; + display: flex; + flex-direction: column; + box-sizing: border-box; + padding-inline: 10px; + padding-block: 10px; +} + +:is( + :is(.toolbarButtonWithContainer .editorParamsToolbar) + .editorParamsToolbarContainer + ) + > .editorParamsSetter { + min-height: 26px; + display: flex; + align-items: center; + justify-content: space-between; +} + +:is( + :is(.toolbarButtonWithContainer .editorParamsToolbar) + .editorParamsToolbarContainer + ) + .editorParamsColor { + width: 32px; + height: 32px; + flex: none; + padding: 0; +} + +:is( + :is(.toolbarButtonWithContainer .editorParamsToolbar) + .editorParamsToolbarContainer + ) + .editorParamsSlider { + background-color: transparent; + width: 90px; + flex: 0 1 0; + font: message-box; +} + +:is( + :is( + :is(.toolbarButtonWithContainer .editorParamsToolbar) + .editorParamsToolbarContainer + ) + .editorParamsSlider + )::-moz-range-progress { + background-color: black; +} + +:is( + :is( + :is(.toolbarButtonWithContainer .editorParamsToolbar) + .editorParamsToolbarContainer + ) + .editorParamsSlider + )::-webkit-slider-runnable-track, +:is( + :is( + :is(.toolbarButtonWithContainer .editorParamsToolbar) + .editorParamsToolbarContainer + ) + .editorParamsSlider + )::-moz-range-track { + background-color: black; +} + +:is( + :is( + :is(.toolbarButtonWithContainer .editorParamsToolbar) + .editorParamsToolbarContainer + ) + .editorParamsSlider + )::-webkit-slider-thumb, +:is( + :is( + :is(.toolbarButtonWithContainer .editorParamsToolbar) + .editorParamsToolbarContainer + ) + .editorParamsSlider + )::-moz-range-thumb { + background-color: white; +} + +#secondaryToolbar { + height: auto; + width: 220px; + position: absolute; + z-index: 30000; + cursor: default; + min-height: 26px; + max-height: calc(var(--viewer-container-height) - 40px); +} + +:is(#secondaryToolbar #secondaryToolbarButtonContainer) + #secondaryOpenFile::before { + -webkit-mask-image: var(--toolbarButton-openFile-icon); + mask-image: var(--toolbarButton-openFile-icon); +} + +:is(#secondaryToolbar #secondaryToolbarButtonContainer) + #secondaryPrint::before { + -webkit-mask-image: var(--toolbarButton-print-icon); + mask-image: var(--toolbarButton-print-icon); +} + +:is(#secondaryToolbar #secondaryToolbarButtonContainer) + #secondaryDownload::before { + -webkit-mask-image: var(--toolbarButton-download-icon); + mask-image: var(--toolbarButton-download-icon); +} + +:is(#secondaryToolbar #secondaryToolbarButtonContainer) + #presentationMode::before { + -webkit-mask-image: var(--toolbarButton-presentationMode-icon); + mask-image: var(--toolbarButton-presentationMode-icon); +} + +:is(#secondaryToolbar #secondaryToolbarButtonContainer) #viewBookmark::before { + -webkit-mask-image: var(--toolbarButton-bookmark-icon); + mask-image: var(--toolbarButton-bookmark-icon); +} + +:is(#secondaryToolbar #secondaryToolbarButtonContainer) #firstPage::before { + -webkit-mask-image: var(--secondaryToolbarButton-firstPage-icon); + mask-image: var(--secondaryToolbarButton-firstPage-icon); +} + +:is(#secondaryToolbar #secondaryToolbarButtonContainer) #lastPage::before { + -webkit-mask-image: var(--secondaryToolbarButton-lastPage-icon); + mask-image: var(--secondaryToolbarButton-lastPage-icon); +} + +:is(#secondaryToolbar #secondaryToolbarButtonContainer) #pageRotateCcw::before { + -webkit-mask-image: var(--secondaryToolbarButton-rotateCcw-icon); + mask-image: var(--secondaryToolbarButton-rotateCcw-icon); +} + +:is(#secondaryToolbar #secondaryToolbarButtonContainer) #pageRotateCw::before { + -webkit-mask-image: var(--secondaryToolbarButton-rotateCw-icon); + mask-image: var(--secondaryToolbarButton-rotateCw-icon); +} + +:is(#secondaryToolbar #secondaryToolbarButtonContainer) + #cursorSelectTool::before { + -webkit-mask-image: var(--secondaryToolbarButton-selectTool-icon); + mask-image: var(--secondaryToolbarButton-selectTool-icon); +} + +:is(#secondaryToolbar #secondaryToolbarButtonContainer) + #cursorHandTool::before { + -webkit-mask-image: var(--secondaryToolbarButton-handTool-icon); + mask-image: var(--secondaryToolbarButton-handTool-icon); +} + +:is(#secondaryToolbar #secondaryToolbarButtonContainer) #scrollPage::before { + -webkit-mask-image: var(--secondaryToolbarButton-scrollPage-icon); + mask-image: var(--secondaryToolbarButton-scrollPage-icon); +} + +:is(#secondaryToolbar #secondaryToolbarButtonContainer) + #scrollVertical::before { + -webkit-mask-image: var(--secondaryToolbarButton-scrollVertical-icon); + mask-image: var(--secondaryToolbarButton-scrollVertical-icon); +} + +:is(#secondaryToolbar #secondaryToolbarButtonContainer) + #scrollHorizontal::before { + -webkit-mask-image: var(--secondaryToolbarButton-scrollHorizontal-icon); + mask-image: var(--secondaryToolbarButton-scrollHorizontal-icon); +} + +:is(#secondaryToolbar #secondaryToolbarButtonContainer) #scrollWrapped::before { + -webkit-mask-image: var(--secondaryToolbarButton-scrollWrapped-icon); + mask-image: var(--secondaryToolbarButton-scrollWrapped-icon); +} + +:is(#secondaryToolbar #secondaryToolbarButtonContainer) #spreadNone::before { + -webkit-mask-image: var(--secondaryToolbarButton-spreadNone-icon); + mask-image: var(--secondaryToolbarButton-spreadNone-icon); +} + +:is(#secondaryToolbar #secondaryToolbarButtonContainer) #spreadOdd::before { + -webkit-mask-image: var(--secondaryToolbarButton-spreadOdd-icon); + mask-image: var(--secondaryToolbarButton-spreadOdd-icon); +} + +:is(#secondaryToolbar #secondaryToolbarButtonContainer) #spreadEven::before { + -webkit-mask-image: var(--secondaryToolbarButton-spreadEven-icon); + mask-image: var(--secondaryToolbarButton-spreadEven-icon); +} + +:is(#secondaryToolbar #secondaryToolbarButtonContainer) + #imageAltTextSettings::before { + -webkit-mask-image: var(--secondaryToolbarButton-imageAltTextSettings-icon); + mask-image: var(--secondaryToolbarButton-imageAltTextSettings-icon); +} + +:is(#secondaryToolbar #secondaryToolbarButtonContainer) + #documentProperties::before { + -webkit-mask-image: var(--secondaryToolbarButton-documentProperties-icon); + mask-image: var(--secondaryToolbarButton-documentProperties-icon); +} + +#findbar { + --input-horizontal-padding: 4px; + --findbar-padding: 2px; + + width: -moz-max-content; + + width: max-content; + max-width: 90vw; + min-height: var(--toolbar-height); + height: auto; + position: absolute; + z-index: 30000; + cursor: default; + padding: 0; + min-width: 300px; + background-color: var(--toolbar-bg-color); + box-sizing: border-box; + flex-wrap: wrap; + justify-content: flex-start; +} + +#findbar > * { + height: var(--toolbar-height); + padding: var(--findbar-padding); +} + +#findbar #findInputContainer { + margin-inline-start: 2px; +} + +:is(#findbar #findInputContainer) #findPreviousButton::before { + -webkit-mask-image: var(--findbarButton-previous-icon); + mask-image: var(--findbarButton-previous-icon); +} + +:is(#findbar #findInputContainer) #findNextButton::before { + -webkit-mask-image: var(--findbarButton-next-icon); + mask-image: var(--findbarButton-next-icon); +} + +:is(#findbar #findInputContainer) #findInput { + width: 200px; + padding: 5px var(--input-horizontal-padding); +} + +:is(:is(#findbar #findInputContainer) #findInput)::-moz-placeholder { + font-style: normal; +} + +:is(:is(#findbar #findInputContainer) #findInput)::placeholder { + font-style: normal; +} + +.loadingInput:has( + > [data-status='pending']:is(:is(#findbar #findInputContainer) #findInput) + )::after { + display: inline; + visibility: visible; + inset-inline-end: calc(var(--input-horizontal-padding) + 1px); +} + +[data-status='notFound']:is(:is(#findbar #findInputContainer) #findInput) { + background-color: rgb(255 102 102); +} + +#findbar #findbarMessageContainer { + display: none; + gap: 4px; +} + +:is(#findbar #findbarMessageContainer):has( + > :is(#findResultsCount, #findMsg):not(:empty) + ) { + display: inline flex; +} + +:is(#findbar #findbarMessageContainer) #findResultsCount { + background-color: rgb(217 217 217); + color: rgb(82 82 82); + padding-block: 4px; +} + +:is(:is(#findbar #findbarMessageContainer) #findResultsCount):empty { + display: none; +} + +[data-status='notFound']:is(:is(#findbar #findbarMessageContainer) #findMsg) { + font-weight: bold; +} + +:is(:is(#findbar #findbarMessageContainer) #findMsg):empty { + display: none; +} + +#findbar.wrapContainers { + flex-direction: column; + align-items: flex-start; + height: -moz-max-content; + height: max-content; +} + +#findbar.wrapContainers .toolbarLabel { + margin: 0 4px; +} + +#findbar.wrapContainers #findbarMessageContainer { + flex-wrap: wrap; + flex-flow: column nowrap; + align-items: flex-start; + height: -moz-max-content; + height: max-content; +} + +:is(#findbar.wrapContainers #findbarMessageContainer) #findResultsCount { + height: calc(var(--toolbar-height) - 2 * var(--findbar-padding)); +} + +:is(#findbar.wrapContainers #findbarMessageContainer) #findMsg { + min-height: var(--toolbar-height); +} + +@page { + margin: 0; +} + +#printContainer { + display: none; +} + +@media print { + body { + background: rgb(0 0 0 / 0) none; + } + + body[data-pdfjsprinting] #outerContainer { + display: none; + } + + body[data-pdfjsprinting] #printContainer { + display: block; + } + + #printContainer { + height: 100%; + } + #printContainer > .printedPage { + page-break-after: always; + page-break-inside: avoid; + height: 100%; + width: 100%; + + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + } + + #printContainer > .xfaPrintedPage .xfaPage { + position: absolute; + } + + #printContainer > .xfaPrintedPage { + page-break-after: always; + page-break-inside: avoid; + width: 100%; + height: 100%; + position: relative; + } + + #printContainer > .printedPage :is(canvas, img) { + max-width: 100%; + max-height: 100%; + + direction: ltr; + display: block; + } +} + +.visibleMediumView { + display: none !important; +} + +.toolbarLabel { + width: -moz-max-content; + width: max-content; + min-width: 16px; + height: 100%; + padding-inline: 4px; + margin: 2px; + border-radius: 2px; + color: var(--main-color); + font-size: 12px; + line-height: 14px; + text-align: left; + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; + cursor: default; + box-sizing: border-box; + + display: inline flex; + flex-direction: column; + align-items: center; + justify-content: center; +} + +.toolbarLabel > label { + width: 100%; +} + +.toolbarHorizontalGroup { + height: 100%; + display: inline flex; + flex-direction: row; + align-items: center; + justify-content: space-between; + gap: 1px; + box-sizing: border-box; +} + +.dropdownToolbarButton { + display: inline flex; + flex-direction: row; + align-items: center; + justify-content: center; + position: relative; + + width: -moz-fit-content; + + width: fit-content; + min-width: 140px; + padding: 0; + background-color: var(--dropdown-btn-bg-color); + border: var(--dropdown-btn-border); + border-radius: 2px; + color: var(--main-color); + font-size: 12px; + line-height: 14px; + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; + cursor: default; + box-sizing: border-box; + outline: none; +} + +.dropdownToolbarButton:hover { + background-color: var(--button-hover-color); +} + +.dropdownToolbarButton > select { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + width: inherit; + min-width: inherit; + height: 28px; + font: message-box; + font-size: 12px; + color: var(--main-color); + margin: 0; + padding-block: 1px 2px; + padding-inline: 6px 38px; + border: none; + outline: none; + background-color: var(--dropdown-btn-bg-color); +} + +:is(.dropdownToolbarButton > select) > option { + background: var(--doorhanger-bg-color); + color: var(--main-color); +} + +:is(.dropdownToolbarButton > select):is(:hover, :focus-visible) { + background-color: var(--button-hover-color); + color: var(--toggled-btn-color); +} + +.dropdownToolbarButton::after { + position: absolute; + display: inline; + width: var(--icon-size); + height: var(--icon-size); + + content: ''; + background-color: var(--toolbar-icon-bg-color); + -webkit-mask-size: cover; + mask-size: cover; + + inset-inline-end: 4px; + pointer-events: none; + -webkit-mask-image: var(--toolbarButton-menuArrow-icon); + mask-image: var(--toolbarButton-menuArrow-icon); +} + +.dropdownToolbarButton:is(:hover, :focus-visible, :active)::after { + background-color: var(--toolbar-icon-hover-bg-color); +} + +#toolbarContainer { + --menuitem-height: calc(var(--toolbar-height) - 6px); + + width: 100%; + height: var(--toolbar-height); + padding: var(--toolbar-vertical-padding) var(--toolbar-horizontal-padding); + position: relative; + box-sizing: border-box; + font: message-box; + background-color: var(--toolbar-bg-color); + box-shadow: var(--toolbar-box-shadow); + border-bottom: var(--toolbar-border-bottom); +} + +#toolbarContainer #toolbarViewer { + width: 100%; + height: 100%; + justify-content: space-between; +} + +:is(#toolbarContainer #toolbarViewer) > * { + flex: none; +} + +:is(#toolbarContainer #toolbarViewer) input { + font: message-box; +} + +:is(#toolbarContainer #toolbarViewer) .toolbarButtonSpacer { + width: 30px; + display: block; + height: 1px; +} + +:is(#toolbarContainer #toolbarViewer) + #toolbarViewerLeft + #numPages.toolbarLabel { + padding-inline-start: 3px; + flex: none; +} + +#toolbarContainer #loadingBar { + --progressBar-percent: 0%; + --progressBar-end-offset: 0; + + position: absolute; + top: var(--toolbar-height); + inset-inline: 0 var(--progressBar-end-offset); + height: 4px; + background-color: var(--progressBar-bg-color); + border-bottom: 1px solid var(--toolbar-border-color); + transition-property: inset-inline-start; + transition-duration: var(--sidebar-transition-duration); + transition-timing-function: var(--sidebar-transition-timing-function); +} + +:is(#toolbarContainer #loadingBar) .progress { + position: absolute; + top: 0; + inset-inline-start: 0; + width: 100%; + transform: scaleX(var(--progressBar-percent)); + transform-origin: calc(50% - 50% * var(--dir-factor)) 0; + height: 100%; + background-color: var(--progressBar-color); + overflow: hidden; + transition: transform 200ms; +} + +.indeterminate:is(#toolbarContainer #loadingBar) .progress { + transform: none; + background-color: var(--progressBar-bg-color); + transition: none; +} + +:is(.indeterminate:is(#toolbarContainer #loadingBar) .progress) .glimmer { + position: absolute; + top: 0; + inset-inline-start: 0; + height: 100%; + width: calc(100% + 150px); + background: repeating-linear-gradient( + 135deg, + var(--progressBar-blend-color) 0, + var(--progressBar-bg-color) 5px, + var(--progressBar-bg-color) 45px, + var(--progressBar-color) 55px, + var(--progressBar-color) 95px, + var(--progressBar-blend-color) 100px + ); + animation: progressIndeterminate 1s linear infinite; +} + +#secondaryToolbar #firstPage::before { + -webkit-mask-image: var(--secondaryToolbarButton-firstPage-icon); + mask-image: var(--secondaryToolbarButton-firstPage-icon); +} + +#secondaryToolbar #lastPage::before { + -webkit-mask-image: var(--secondaryToolbarButton-lastPage-icon); + mask-image: var(--secondaryToolbarButton-lastPage-icon); +} + +#secondaryToolbar #pageRotateCcw::before { + -webkit-mask-image: var(--secondaryToolbarButton-rotateCcw-icon); + mask-image: var(--secondaryToolbarButton-rotateCcw-icon); +} + +#secondaryToolbar #pageRotateCw::before { + -webkit-mask-image: var(--secondaryToolbarButton-rotateCw-icon); + mask-image: var(--secondaryToolbarButton-rotateCw-icon); +} + +#secondaryToolbar #cursorSelectTool::before { + -webkit-mask-image: var(--secondaryToolbarButton-selectTool-icon); + mask-image: var(--secondaryToolbarButton-selectTool-icon); +} + +#secondaryToolbar #cursorHandTool::before { + -webkit-mask-image: var(--secondaryToolbarButton-handTool-icon); + mask-image: var(--secondaryToolbarButton-handTool-icon); +} + +#secondaryToolbar #scrollPage::before { + -webkit-mask-image: var(--secondaryToolbarButton-scrollPage-icon); + mask-image: var(--secondaryToolbarButton-scrollPage-icon); +} + +#secondaryToolbar #scrollVertical::before { + -webkit-mask-image: var(--secondaryToolbarButton-scrollVertical-icon); + mask-image: var(--secondaryToolbarButton-scrollVertical-icon); +} + +#secondaryToolbar #scrollHorizontal::before { + -webkit-mask-image: var(--secondaryToolbarButton-scrollHorizontal-icon); + mask-image: var(--secondaryToolbarButton-scrollHorizontal-icon); +} + +#secondaryToolbar #scrollWrapped::before { + -webkit-mask-image: var(--secondaryToolbarButton-scrollWrapped-icon); + mask-image: var(--secondaryToolbarButton-scrollWrapped-icon); +} + +#secondaryToolbar #spreadNone::before { + -webkit-mask-image: var(--secondaryToolbarButton-spreadNone-icon); + mask-image: var(--secondaryToolbarButton-spreadNone-icon); +} + +#secondaryToolbar #spreadOdd::before { + -webkit-mask-image: var(--secondaryToolbarButton-spreadOdd-icon); + mask-image: var(--secondaryToolbarButton-spreadOdd-icon); +} + +#secondaryToolbar #spreadEven::before { + -webkit-mask-image: var(--secondaryToolbarButton-spreadEven-icon); + mask-image: var(--secondaryToolbarButton-spreadEven-icon); +} + +#secondaryToolbar #documentProperties::before { + -webkit-mask-image: var(--secondaryToolbarButton-documentProperties-icon); + mask-image: var(--secondaryToolbarButton-documentProperties-icon); +} + +@media all and (max-width: 840px) { + #sidebarContainer { + background-color: var(--sidebar-narrow-bg-color); + } + #outerContainer.sidebarOpen #viewerContainer { + inset-inline-start: 0 !important; + } +} + +@media all and (max-width: 750px) { + #outerContainer .hiddenMediumView { + display: none !important; + } + #outerContainer .visibleMediumView:not(.hidden, [hidden]) { + display: inline-block !important; + } +} + +@media all and (max-width: 690px) { + .hiddenSmallView, + .hiddenSmallView * { + display: none !important; + } + + #toolbarContainer #toolbarViewer .toolbarButtonSpacer { + width: 0; + } +} + +@media all and (max-width: 560px) { + #scaleSelectContainer { + display: none; + } +} diff --git a/public/pdfjs/web/viewer.html b/public/pdfjs/web/viewer.html new file mode 100644 index 0000000..30182ef --- /dev/null +++ b/public/pdfjs/web/viewer.html @@ -0,0 +1,637 @@ + + + + + + + + PDF.js viewer + + + + + + + + + + + +
+ +
+
+
+
+ + + + +
+
+ +
+
+
+ + +
+
+
+
+
+
+ + + +
+
+
+ +
+
+
+
+
+ +
+
+ + +
+
+ +
+ +
+
+ + + + +
+
+
+
+ +
+ +
+ + + +
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+ +
+ + + +
+ +
+ +
+ + +
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+ +
+ +
+ +
+
+ +
+
+ + +
+
+ +
+ File name: +

-

+
+
+ File size: +

-

+
+
+
+ Title: +

-

+
+
+ Author: +

-

+
+
+ Subject: +

-

+
+
+ Keywords: +

-

+
+
+ Creation Date: +

-

+
+
+ Modification Date: +

-

+
+
+ Creator: +

-

+
+
+
+ PDF Producer: +

-

+
+
+ PDF Version: +

-

+
+
+ Page Count: +

-

+
+
+ Page Size: +

-

+
+
+
+ Fast Web View: +

-

+
+
+ +
+
+ +
+
+ Choose an option + + Alt text (alternative text) helps when people can’t see the image or when it doesn’t load. + +
+
+
+
+ + +
+
+ + Aim for 1-2 sentences that describe the subject, setting, or actions. + +
+
+
+ +
+
+
+
+
+ + +
+
+ + This is used for ornamental images, like borders or watermarks. + +
+
+
+
+ + +
+
+
+ +
+
+ Edit alt text (image description) +
+
+
+
+
+
+ +
+ Short description for people who can’t see the image or when the image doesn’t load. +
This alt text was created automatically and may be inaccurate. Learn more
+
+
+ + +
+ +
+
+
+
+
+
+ Couldn’t create alt text automatically + Please write your own alt text or try again later. +
+ +
+
+
+ + + +
+
+
+ + +
+
+ Image alt text settings +
+
+ Automatic alt text +
+
+
+ + +
+
+ Suggests descriptions to help people who can’t see the image or when the image doesn’t load. Learn more +
+
+
+
+ Alt text AI model (180MB) +
+ Runs locally on your device so your data stays private. Required for automatic alt text. +
+
+ + +
+
+
+
+
+ Alt text editor +
+
+ + +
+
+ Helps you make sure all your images have alt text. +
+
+
+
+ +
+
+
+ +
+ Preparing document for printing… +
+
+ + 0% +
+
+ +
+
+
+ + + +
+
+ + diff --git a/public/pdfjs/web/viewer.mjs b/public/pdfjs/web/viewer.mjs new file mode 100644 index 0000000..c3d794a --- /dev/null +++ b/public/pdfjs/web/viewer.mjs @@ -0,0 +1,15365 @@ +/** + * @licstart The following is the entire license notice for the + * JavaScript code in this page + * + * Copyright 2024 Mozilla Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @licend The above is the entire license notice for the + * JavaScript code in this page + */ + +/******/ // The require scope +/******/ var __webpack_require__ = {}; +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; + +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + PDFViewerApplication: () => (/* reexport */ PDFViewerApplication), + PDFViewerApplicationConstants: () => (/* binding */ AppConstants), + PDFViewerApplicationOptions: () => (/* reexport */ AppOptions) +}); + +;// ./web/ui_utils.js +const DEFAULT_SCALE_VALUE = "auto"; +const DEFAULT_SCALE = 1.0; +const DEFAULT_SCALE_DELTA = 1.1; +const MIN_SCALE = 0.1; +const MAX_SCALE = 10.0; +const UNKNOWN_SCALE = 0; +const MAX_AUTO_SCALE = 1.25; +const SCROLLBAR_PADDING = 40; +const VERTICAL_PADDING = 5; +const RenderingStates = { + INITIAL: 0, + RUNNING: 1, + PAUSED: 2, + FINISHED: 3 +}; +const PresentationModeState = { + UNKNOWN: 0, + NORMAL: 1, + CHANGING: 2, + FULLSCREEN: 3 +}; +const SidebarView = { + UNKNOWN: -1, + NONE: 0, + THUMBS: 1, + OUTLINE: 2, + ATTACHMENTS: 3, + LAYERS: 4 +}; +const TextLayerMode = { + DISABLE: 0, + ENABLE: 1, + ENABLE_PERMISSIONS: 2 +}; +const ScrollMode = { + UNKNOWN: -1, + VERTICAL: 0, + HORIZONTAL: 1, + WRAPPED: 2, + PAGE: 3 +}; +const SpreadMode = { + UNKNOWN: -1, + NONE: 0, + ODD: 1, + EVEN: 2 +}; +const CursorTool = { + SELECT: 0, + HAND: 1, + ZOOM: 2 +}; +const AutoPrintRegExp = /\bprint\s*\(/; +function scrollIntoView(element, spot, scrollMatches = false) { + let parent = element.offsetParent; + if (!parent) { + console.error("offsetParent is not set -- cannot scroll"); + return; + } + let offsetY = element.offsetTop + element.clientTop; + let offsetX = element.offsetLeft + element.clientLeft; + while (parent.clientHeight === parent.scrollHeight && parent.clientWidth === parent.scrollWidth || scrollMatches && (parent.classList.contains("markedContent") || getComputedStyle(parent).overflow === "hidden")) { + offsetY += parent.offsetTop; + offsetX += parent.offsetLeft; + parent = parent.offsetParent; + if (!parent) { + return; + } + } + if (spot) { + if (spot.top !== undefined) { + offsetY += spot.top; + } + if (spot.left !== undefined) { + offsetX += spot.left; + parent.scrollLeft = offsetX; + } + } + parent.scrollTop = offsetY; +} +function watchScroll(viewAreaElement, callback, abortSignal = undefined) { + const debounceScroll = function (evt) { + if (rAF) { + return; + } + rAF = window.requestAnimationFrame(function viewAreaElementScrolled() { + rAF = null; + const currentX = viewAreaElement.scrollLeft; + const lastX = state.lastX; + if (currentX !== lastX) { + state.right = currentX > lastX; + } + state.lastX = currentX; + const currentY = viewAreaElement.scrollTop; + const lastY = state.lastY; + if (currentY !== lastY) { + state.down = currentY > lastY; + } + state.lastY = currentY; + callback(state); + }); + }; + const state = { + right: true, + down: true, + lastX: viewAreaElement.scrollLeft, + lastY: viewAreaElement.scrollTop, + _eventHandler: debounceScroll + }; + let rAF = null; + viewAreaElement.addEventListener("scroll", debounceScroll, { + useCapture: true, + signal: abortSignal + }); + abortSignal?.addEventListener("abort", () => window.cancelAnimationFrame(rAF), { + once: true + }); + return state; +} +function parseQueryString(query) { + const params = new Map(); + for (const [key, value] of new URLSearchParams(query)) { + params.set(key.toLowerCase(), value); + } + return params; +} +const InvisibleCharsRegExp = /[\x00-\x1F]/g; +function removeNullCharacters(str, replaceInvisible = false) { + if (!InvisibleCharsRegExp.test(str)) { + return str; + } + if (replaceInvisible) { + return str.replaceAll(InvisibleCharsRegExp, m => m === "\x00" ? "" : " "); + } + return str.replaceAll("\x00", ""); +} +function binarySearchFirstItem(items, condition, start = 0) { + let minIndex = start; + let maxIndex = items.length - 1; + if (maxIndex < 0 || !condition(items[maxIndex])) { + return items.length; + } + if (condition(items[minIndex])) { + return minIndex; + } + while (minIndex < maxIndex) { + const currentIndex = minIndex + maxIndex >> 1; + const currentItem = items[currentIndex]; + if (condition(currentItem)) { + maxIndex = currentIndex; + } else { + minIndex = currentIndex + 1; + } + } + return minIndex; +} +function approximateFraction(x) { + if (Math.floor(x) === x) { + return [x, 1]; + } + const xinv = 1 / x; + const limit = 8; + if (xinv > limit) { + return [1, limit]; + } else if (Math.floor(xinv) === xinv) { + return [1, xinv]; + } + const x_ = x > 1 ? xinv : x; + let a = 0, + b = 1, + c = 1, + d = 1; + while (true) { + const p = a + c, + q = b + d; + if (q > limit) { + break; + } + if (x_ <= p / q) { + c = p; + d = q; + } else { + a = p; + b = q; + } + } + let result; + if (x_ - a / b < c / d - x_) { + result = x_ === x ? [a, b] : [b, a]; + } else { + result = x_ === x ? [c, d] : [d, c]; + } + return result; +} +function floorToDivide(x, div) { + return x - x % div; +} +function getPageSizeInches({ + view, + userUnit, + rotate +}) { + const [x1, y1, x2, y2] = view; + const changeOrientation = rotate % 180 !== 0; + const width = (x2 - x1) / 72 * userUnit; + const height = (y2 - y1) / 72 * userUnit; + return { + width: changeOrientation ? height : width, + height: changeOrientation ? width : height + }; +} +function backtrackBeforeAllVisibleElements(index, views, top) { + if (index < 2) { + return index; + } + let elt = views[index].div; + let pageTop = elt.offsetTop + elt.clientTop; + if (pageTop >= top) { + elt = views[index - 1].div; + pageTop = elt.offsetTop + elt.clientTop; + } + for (let i = index - 2; i >= 0; --i) { + elt = views[i].div; + if (elt.offsetTop + elt.clientTop + elt.clientHeight <= pageTop) { + break; + } + index = i; + } + return index; +} +function getVisibleElements({ + scrollEl, + views, + sortByVisibility = false, + horizontal = false, + rtl = false +}) { + const top = scrollEl.scrollTop, + bottom = top + scrollEl.clientHeight; + const left = scrollEl.scrollLeft, + right = left + scrollEl.clientWidth; + function isElementBottomAfterViewTop(view) { + const element = view.div; + const elementBottom = element.offsetTop + element.clientTop + element.clientHeight; + return elementBottom > top; + } + function isElementNextAfterViewHorizontally(view) { + const element = view.div; + const elementLeft = element.offsetLeft + element.clientLeft; + const elementRight = elementLeft + element.clientWidth; + return rtl ? elementLeft < right : elementRight > left; + } + const visible = [], + ids = new Set(), + numViews = views.length; + let firstVisibleElementInd = binarySearchFirstItem(views, horizontal ? isElementNextAfterViewHorizontally : isElementBottomAfterViewTop); + if (firstVisibleElementInd > 0 && firstVisibleElementInd < numViews && !horizontal) { + firstVisibleElementInd = backtrackBeforeAllVisibleElements(firstVisibleElementInd, views, top); + } + let lastEdge = horizontal ? right : -1; + for (let i = firstVisibleElementInd; i < numViews; i++) { + const view = views[i], + element = view.div; + const currentWidth = element.offsetLeft + element.clientLeft; + const currentHeight = element.offsetTop + element.clientTop; + const viewWidth = element.clientWidth, + viewHeight = element.clientHeight; + const viewRight = currentWidth + viewWidth; + const viewBottom = currentHeight + viewHeight; + if (lastEdge === -1) { + if (viewBottom >= bottom) { + lastEdge = viewBottom; + } + } else if ((horizontal ? currentWidth : currentHeight) > lastEdge) { + break; + } + if (viewBottom <= top || currentHeight >= bottom || viewRight <= left || currentWidth >= right) { + continue; + } + const hiddenHeight = Math.max(0, top - currentHeight) + Math.max(0, viewBottom - bottom); + const hiddenWidth = Math.max(0, left - currentWidth) + Math.max(0, viewRight - right); + const fractionHeight = (viewHeight - hiddenHeight) / viewHeight, + fractionWidth = (viewWidth - hiddenWidth) / viewWidth; + const percent = fractionHeight * fractionWidth * 100 | 0; + visible.push({ + id: view.id, + x: currentWidth, + y: currentHeight, + view, + percent, + widthPercent: fractionWidth * 100 | 0 + }); + ids.add(view.id); + } + const first = visible[0], + last = visible.at(-1); + if (sortByVisibility) { + visible.sort(function (a, b) { + const pc = a.percent - b.percent; + if (Math.abs(pc) > 0.001) { + return -pc; + } + return a.id - b.id; + }); + } + return { + first, + last, + views: visible, + ids + }; +} +function normalizeWheelEventDirection(evt) { + let delta = Math.hypot(evt.deltaX, evt.deltaY); + const angle = Math.atan2(evt.deltaY, evt.deltaX); + if (-0.25 * Math.PI < angle && angle < 0.75 * Math.PI) { + delta = -delta; + } + return delta; +} +function normalizeWheelEventDelta(evt) { + const deltaMode = evt.deltaMode; + let delta = normalizeWheelEventDirection(evt); + const MOUSE_PIXELS_PER_LINE = 30; + const MOUSE_LINES_PER_PAGE = 30; + if (deltaMode === WheelEvent.DOM_DELTA_PIXEL) { + delta /= MOUSE_PIXELS_PER_LINE * MOUSE_LINES_PER_PAGE; + } else if (deltaMode === WheelEvent.DOM_DELTA_LINE) { + delta /= MOUSE_LINES_PER_PAGE; + } + return delta; +} +function isValidRotation(angle) { + return Number.isInteger(angle) && angle % 90 === 0; +} +function isValidScrollMode(mode) { + return Number.isInteger(mode) && Object.values(ScrollMode).includes(mode) && mode !== ScrollMode.UNKNOWN; +} +function isValidSpreadMode(mode) { + return Number.isInteger(mode) && Object.values(SpreadMode).includes(mode) && mode !== SpreadMode.UNKNOWN; +} +function isPortraitOrientation(size) { + return size.width <= size.height; +} +const animationStarted = new Promise(function (resolve) { + window.requestAnimationFrame(resolve); +}); +const docStyle = document.documentElement.style; +function clamp(v, min, max) { + return Math.min(Math.max(v, min), max); +} +class ProgressBar { + #classList = null; + #disableAutoFetchTimeout = null; + #percent = 0; + #style = null; + #visible = true; + constructor(bar) { + this.#classList = bar.classList; + this.#style = bar.style; + } + get percent() { + return this.#percent; + } + set percent(val) { + this.#percent = clamp(val, 0, 100); + if (isNaN(val)) { + this.#classList.add("indeterminate"); + return; + } + this.#classList.remove("indeterminate"); + this.#style.setProperty("--progressBar-percent", `${this.#percent}%`); + } + setWidth(viewer) { + if (!viewer) { + return; + } + const container = viewer.parentNode; + const scrollbarWidth = container.offsetWidth - viewer.offsetWidth; + if (scrollbarWidth > 0) { + this.#style.setProperty("--progressBar-end-offset", `${scrollbarWidth}px`); + } + } + setDisableAutoFetch(delay = 5000) { + if (this.#percent === 100 || isNaN(this.#percent)) { + return; + } + if (this.#disableAutoFetchTimeout) { + clearTimeout(this.#disableAutoFetchTimeout); + } + this.show(); + this.#disableAutoFetchTimeout = setTimeout(() => { + this.#disableAutoFetchTimeout = null; + this.hide(); + }, delay); + } + hide() { + if (!this.#visible) { + return; + } + this.#visible = false; + this.#classList.add("hidden"); + } + show() { + if (this.#visible) { + return; + } + this.#visible = true; + this.#classList.remove("hidden"); + } +} +function getActiveOrFocusedElement() { + let curRoot = document; + let curActiveOrFocused = curRoot.activeElement || curRoot.querySelector(":focus"); + while (curActiveOrFocused?.shadowRoot) { + curRoot = curActiveOrFocused.shadowRoot; + curActiveOrFocused = curRoot.activeElement || curRoot.querySelector(":focus"); + } + return curActiveOrFocused; +} +function apiPageLayoutToViewerModes(layout) { + let scrollMode = ScrollMode.VERTICAL, + spreadMode = SpreadMode.NONE; + switch (layout) { + case "SinglePage": + scrollMode = ScrollMode.PAGE; + break; + case "OneColumn": + break; + case "TwoPageLeft": + scrollMode = ScrollMode.PAGE; + case "TwoColumnLeft": + spreadMode = SpreadMode.ODD; + break; + case "TwoPageRight": + scrollMode = ScrollMode.PAGE; + case "TwoColumnRight": + spreadMode = SpreadMode.EVEN; + break; + } + return { + scrollMode, + spreadMode + }; +} +function apiPageModeToSidebarView(mode) { + switch (mode) { + case "UseNone": + return SidebarView.NONE; + case "UseThumbs": + return SidebarView.THUMBS; + case "UseOutlines": + return SidebarView.OUTLINE; + case "UseAttachments": + return SidebarView.ATTACHMENTS; + case "UseOC": + return SidebarView.LAYERS; + } + return SidebarView.NONE; +} +function toggleCheckedBtn(button, toggle, view = null) { + button.classList.toggle("toggled", toggle); + button.setAttribute("aria-checked", toggle); + view?.classList.toggle("hidden", !toggle); +} +function toggleExpandedBtn(button, toggle, view = null) { + button.classList.toggle("toggled", toggle); + button.setAttribute("aria-expanded", toggle); + view?.classList.toggle("hidden", !toggle); +} +const calcRound = function () { + const e = document.createElement("div"); + e.style.width = "round(down, calc(1.6666666666666665 * 792px), 1px)"; + return e.style.width === "calc(1320px)" ? Math.fround : x => x; +}(); + +;// ./web/app_options.js +{ + var compatParams = new Map(); + const userAgent = navigator.userAgent || ""; + const platform = navigator.platform || ""; + const maxTouchPoints = navigator.maxTouchPoints || 1; + const isAndroid = /Android/.test(userAgent); + const isIOS = /\b(iPad|iPhone|iPod)(?=;)/.test(userAgent) || platform === "MacIntel" && maxTouchPoints > 1; + (function () { + if (isIOS || isAndroid) { + compatParams.set("maxCanvasPixels", 5242880); + } + })(); + (function () { + if (isAndroid) { + compatParams.set("useSystemFonts", false); + } + })(); +} +const OptionKind = { + BROWSER: 0x01, + VIEWER: 0x02, + API: 0x04, + WORKER: 0x08, + EVENT_DISPATCH: 0x10, + PREFERENCE: 0x80 +}; +const Type = { + BOOLEAN: 0x01, + NUMBER: 0x02, + OBJECT: 0x04, + STRING: 0x08, + UNDEFINED: 0x10 +}; +const defaultOptions = { + allowedGlobalEvents: { + value: null, + kind: OptionKind.BROWSER + }, + canvasMaxAreaInBytes: { + value: -1, + kind: OptionKind.BROWSER + OptionKind.API + }, + isInAutomation: { + value: false, + kind: OptionKind.BROWSER + }, + localeProperties: { + value: { + lang: navigator.language || "en-US" + }, + kind: OptionKind.BROWSER + }, + nimbusDataStr: { + value: "", + kind: OptionKind.BROWSER + }, + supportsCaretBrowsingMode: { + value: false, + kind: OptionKind.BROWSER + }, + supportsDocumentFonts: { + value: true, + kind: OptionKind.BROWSER + }, + supportsIntegratedFind: { + value: false, + kind: OptionKind.BROWSER + }, + supportsMouseWheelZoomCtrlKey: { + value: true, + kind: OptionKind.BROWSER + }, + supportsMouseWheelZoomMetaKey: { + value: true, + kind: OptionKind.BROWSER + }, + supportsPinchToZoom: { + value: true, + kind: OptionKind.BROWSER + }, + toolbarDensity: { + value: 0, + kind: OptionKind.BROWSER + OptionKind.EVENT_DISPATCH + }, + altTextLearnMoreUrl: { + value: "", + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + annotationEditorMode: { + value: 0, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + annotationMode: { + value: 2, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + cursorToolOnLoad: { + value: 0, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + debuggerSrc: { + value: "./debugger.mjs", + kind: OptionKind.VIEWER + }, + defaultZoomDelay: { + value: 400, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + defaultZoomValue: { + value: "", + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + disableHistory: { + value: false, + kind: OptionKind.VIEWER + }, + disablePageLabels: { + value: false, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + enableAltText: { + value: false, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + enableAltTextModelDownload: { + value: true, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + OptionKind.EVENT_DISPATCH + }, + enableGuessAltText: { + value: true, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + OptionKind.EVENT_DISPATCH + }, + enableHighlightFloatingButton: { + value: false, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + enableNewAltTextWhenAddingImage: { + value: true, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + enablePermissions: { + value: false, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + enablePrintAutoRotate: { + value: true, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + enableScripting: { + value: true, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + enableUpdatedAddImage: { + value: false, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + externalLinkRel: { + value: "noopener noreferrer nofollow", + kind: OptionKind.VIEWER + }, + externalLinkTarget: { + value: 0, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + highlightEditorColors: { + value: "yellow=#FFFF98,green=#53FFBC,blue=#80EBFF,pink=#FFCBE6,red=#FF4F5F", + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + historyUpdateUrl: { + value: false, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + ignoreDestinationZoom: { + value: false, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + imageResourcesPath: { + value: "./images/", + kind: OptionKind.VIEWER + }, + maxCanvasPixels: { + value: 2 ** 25, + kind: OptionKind.VIEWER + }, + forcePageColors: { + value: false, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + pageColorsBackground: { + value: "Canvas", + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + pageColorsForeground: { + value: "CanvasText", + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + pdfBugEnabled: { + value: false, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + printResolution: { + value: 150, + kind: OptionKind.VIEWER + }, + sidebarViewOnLoad: { + value: -1, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + scrollModeOnLoad: { + value: -1, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + spreadModeOnLoad: { + value: -1, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + textLayerMode: { + value: 1, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + viewOnLoad: { + value: 0, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }, + cMapPacked: { + value: true, + kind: OptionKind.API + }, + cMapUrl: { + value: "../web/cmaps/", + kind: OptionKind.API + }, + disableAutoFetch: { + value: false, + kind: OptionKind.API + OptionKind.PREFERENCE + }, + disableFontFace: { + value: false, + kind: OptionKind.API + OptionKind.PREFERENCE + }, + disableRange: { + value: false, + kind: OptionKind.API + OptionKind.PREFERENCE + }, + disableStream: { + value: false, + kind: OptionKind.API + OptionKind.PREFERENCE + }, + docBaseUrl: { + value: "", + kind: OptionKind.API + }, + enableHWA: { + value: true, + kind: OptionKind.API + OptionKind.VIEWER + OptionKind.PREFERENCE + }, + enableXfa: { + value: true, + kind: OptionKind.API + OptionKind.PREFERENCE + }, + fontExtraProperties: { + value: false, + kind: OptionKind.API + }, + isEvalSupported: { + value: true, + kind: OptionKind.API + }, + isOffscreenCanvasSupported: { + value: true, + kind: OptionKind.API + }, + maxImageSize: { + value: -1, + kind: OptionKind.API + }, + pdfBug: { + value: false, + kind: OptionKind.API + }, + standardFontDataUrl: { + value: "../web/standard_fonts/", + kind: OptionKind.API + }, + useSystemFonts: { + value: undefined, + kind: OptionKind.API, + type: Type.BOOLEAN + Type.UNDEFINED + }, + verbosity: { + value: 1, + kind: OptionKind.API + }, + workerPort: { + value: null, + kind: OptionKind.WORKER + }, + workerSrc: { + value: "../build/pdf.worker.mjs", + kind: OptionKind.WORKER + } +}; +{ + defaultOptions.defaultUrl = { + value: "compressed.tracemonkey-pldi-09.pdf", + kind: OptionKind.VIEWER + }; + defaultOptions.sandboxBundleSrc = { + value: "../build/pdf.sandbox.mjs", + kind: OptionKind.VIEWER + }; + defaultOptions.viewerCssTheme = { + value: 0, + kind: OptionKind.VIEWER + OptionKind.PREFERENCE + }; + defaultOptions.enableFakeMLManager = { + value: true, + kind: OptionKind.VIEWER + }; +} +{ + defaultOptions.disablePreferences = { + value: false, + kind: OptionKind.VIEWER + }; +} +class AppOptions { + static eventBus; + static #opts = new Map(); + static { + for (const name in defaultOptions) { + this.#opts.set(name, defaultOptions[name].value); + } + for (const [name, value] of compatParams) { + this.#opts.set(name, value); + } + this._hasInvokedSet = false; + this._checkDisablePreferences = () => { + if (this.get("disablePreferences")) { + return true; + } + if (this._hasInvokedSet) { + console.warn("The Preferences may override manually set AppOptions; " + 'please use the "disablePreferences"-option to prevent that.'); + } + return false; + }; + } + static get(name) { + return this.#opts.get(name); + } + static getAll(kind = null, defaultOnly = false) { + const options = Object.create(null); + for (const name in defaultOptions) { + const defaultOpt = defaultOptions[name]; + if (kind && !(kind & defaultOpt.kind)) { + continue; + } + options[name] = !defaultOnly ? this.#opts.get(name) : defaultOpt.value; + } + return options; + } + static set(name, value) { + this.setAll({ + [name]: value + }); + } + static setAll(options, prefs = false) { + this._hasInvokedSet ||= true; + let events; + for (const name in options) { + const defaultOpt = defaultOptions[name], + userOpt = options[name]; + if (!defaultOpt || !(typeof userOpt === typeof defaultOpt.value || Type[(typeof userOpt).toUpperCase()] & defaultOpt.type)) { + continue; + } + const { + kind + } = defaultOpt; + if (prefs && !(kind & OptionKind.BROWSER || kind & OptionKind.PREFERENCE)) { + continue; + } + if (this.eventBus && kind & OptionKind.EVENT_DISPATCH) { + (events ||= new Map()).set(name, userOpt); + } + this.#opts.set(name, userOpt); + } + if (events) { + for (const [name, value] of events) { + this.eventBus.dispatch(name.toLowerCase(), { + source: this, + value + }); + } + } + } +} + +;// ./web/pdf_link_service.js + +const DEFAULT_LINK_REL = "noopener noreferrer nofollow"; +const LinkTarget = { + NONE: 0, + SELF: 1, + BLANK: 2, + PARENT: 3, + TOP: 4 +}; +class PDFLinkService { + externalLinkEnabled = true; + constructor({ + eventBus, + externalLinkTarget = null, + externalLinkRel = null, + ignoreDestinationZoom = false + } = {}) { + this.eventBus = eventBus; + this.externalLinkTarget = externalLinkTarget; + this.externalLinkRel = externalLinkRel; + this._ignoreDestinationZoom = ignoreDestinationZoom; + this.baseUrl = null; + this.pdfDocument = null; + this.pdfViewer = null; + this.pdfHistory = null; + } + setDocument(pdfDocument, baseUrl = null) { + this.baseUrl = baseUrl; + this.pdfDocument = pdfDocument; + } + setViewer(pdfViewer) { + this.pdfViewer = pdfViewer; + } + setHistory(pdfHistory) { + this.pdfHistory = pdfHistory; + } + get pagesCount() { + return this.pdfDocument ? this.pdfDocument.numPages : 0; + } + get page() { + return this.pdfDocument ? this.pdfViewer.currentPageNumber : 1; + } + set page(value) { + if (this.pdfDocument) { + this.pdfViewer.currentPageNumber = value; + } + } + get rotation() { + return this.pdfDocument ? this.pdfViewer.pagesRotation : 0; + } + set rotation(value) { + if (this.pdfDocument) { + this.pdfViewer.pagesRotation = value; + } + } + get isInPresentationMode() { + return this.pdfDocument ? this.pdfViewer.isInPresentationMode : false; + } + async goToDestination(dest) { + if (!this.pdfDocument) { + return; + } + let namedDest, explicitDest, pageNumber; + if (typeof dest === "string") { + namedDest = dest; + explicitDest = await this.pdfDocument.getDestination(dest); + } else { + namedDest = null; + explicitDest = await dest; + } + if (!Array.isArray(explicitDest)) { + console.error(`goToDestination: "${explicitDest}" is not a valid destination array, for dest="${dest}".`); + return; + } + const [destRef] = explicitDest; + if (destRef && typeof destRef === "object") { + pageNumber = this.pdfDocument.cachedPageNumber(destRef); + if (!pageNumber) { + try { + pageNumber = (await this.pdfDocument.getPageIndex(destRef)) + 1; + } catch { + console.error(`goToDestination: "${destRef}" is not a valid page reference, for dest="${dest}".`); + return; + } + } + } else if (Number.isInteger(destRef)) { + pageNumber = destRef + 1; + } + if (!pageNumber || pageNumber < 1 || pageNumber > this.pagesCount) { + console.error(`goToDestination: "${pageNumber}" is not a valid page number, for dest="${dest}".`); + return; + } + if (this.pdfHistory) { + this.pdfHistory.pushCurrentPosition(); + this.pdfHistory.push({ + namedDest, + explicitDest, + pageNumber + }); + } + this.pdfViewer.scrollPageIntoView({ + pageNumber, + destArray: explicitDest, + ignoreDestinationZoom: this._ignoreDestinationZoom + }); + } + goToPage(val) { + if (!this.pdfDocument) { + return; + } + const pageNumber = typeof val === "string" && this.pdfViewer.pageLabelToPageNumber(val) || val | 0; + if (!(Number.isInteger(pageNumber) && pageNumber > 0 && pageNumber <= this.pagesCount)) { + console.error(`PDFLinkService.goToPage: "${val}" is not a valid page.`); + return; + } + if (this.pdfHistory) { + this.pdfHistory.pushCurrentPosition(); + this.pdfHistory.pushPage(pageNumber); + } + this.pdfViewer.scrollPageIntoView({ + pageNumber + }); + } + addLinkAttributes(link, url, newWindow = false) { + if (!url || typeof url !== "string") { + throw new Error('A valid "url" parameter must provided.'); + } + const target = newWindow ? LinkTarget.BLANK : this.externalLinkTarget, + rel = this.externalLinkRel; + if (this.externalLinkEnabled) { + link.href = link.title = url; + } else { + link.href = ""; + link.title = `Disabled: ${url}`; + link.onclick = () => false; + } + let targetStr = ""; + switch (target) { + case LinkTarget.NONE: + break; + case LinkTarget.SELF: + targetStr = "_self"; + break; + case LinkTarget.BLANK: + targetStr = "_blank"; + break; + case LinkTarget.PARENT: + targetStr = "_parent"; + break; + case LinkTarget.TOP: + targetStr = "_top"; + break; + } + link.target = targetStr; + link.rel = typeof rel === "string" ? rel : DEFAULT_LINK_REL; + } + getDestinationHash(dest) { + if (typeof dest === "string") { + if (dest.length > 0) { + return this.getAnchorUrl("#" + escape(dest)); + } + } else if (Array.isArray(dest)) { + const str = JSON.stringify(dest); + if (str.length > 0) { + return this.getAnchorUrl("#" + escape(str)); + } + } + return this.getAnchorUrl(""); + } + getAnchorUrl(anchor) { + return this.baseUrl ? this.baseUrl + anchor : anchor; + } + setHash(hash) { + if (!this.pdfDocument) { + return; + } + let pageNumber, dest; + if (hash.includes("=")) { + const params = parseQueryString(hash); + if (params.has("search")) { + const query = params.get("search").replaceAll('"', ""), + phrase = params.get("phrase") === "true"; + this.eventBus.dispatch("findfromurlhash", { + source: this, + query: phrase ? query : query.match(/\S+/g) + }); + } + if (params.has("page")) { + pageNumber = params.get("page") | 0 || 1; + } + if (params.has("zoom")) { + const zoomArgs = params.get("zoom").split(","); + const zoomArg = zoomArgs[0]; + const zoomArgNumber = parseFloat(zoomArg); + if (!zoomArg.includes("Fit")) { + dest = [null, { + name: "XYZ" + }, zoomArgs.length > 1 ? zoomArgs[1] | 0 : null, zoomArgs.length > 2 ? zoomArgs[2] | 0 : null, zoomArgNumber ? zoomArgNumber / 100 : zoomArg]; + } else if (zoomArg === "Fit" || zoomArg === "FitB") { + dest = [null, { + name: zoomArg + }]; + } else if (zoomArg === "FitH" || zoomArg === "FitBH" || zoomArg === "FitV" || zoomArg === "FitBV") { + dest = [null, { + name: zoomArg + }, zoomArgs.length > 1 ? zoomArgs[1] | 0 : null]; + } else if (zoomArg === "FitR") { + if (zoomArgs.length !== 5) { + console.error('PDFLinkService.setHash: Not enough parameters for "FitR".'); + } else { + dest = [null, { + name: zoomArg + }, zoomArgs[1] | 0, zoomArgs[2] | 0, zoomArgs[3] | 0, zoomArgs[4] | 0]; + } + } else { + console.error(`PDFLinkService.setHash: "${zoomArg}" is not a valid zoom value.`); + } + } + if (dest) { + this.pdfViewer.scrollPageIntoView({ + pageNumber: pageNumber || this.page, + destArray: dest, + allowNegativeOffset: true + }); + } else if (pageNumber) { + this.page = pageNumber; + } + if (params.has("pagemode")) { + this.eventBus.dispatch("pagemode", { + source: this, + mode: params.get("pagemode") + }); + } + if (params.has("nameddest")) { + this.goToDestination(params.get("nameddest")); + } + return; + } + dest = unescape(hash); + try { + dest = JSON.parse(dest); + if (!Array.isArray(dest)) { + dest = dest.toString(); + } + } catch {} + if (typeof dest === "string" || PDFLinkService.#isValidExplicitDest(dest)) { + this.goToDestination(dest); + return; + } + console.error(`PDFLinkService.setHash: "${unescape(hash)}" is not a valid destination.`); + } + executeNamedAction(action) { + if (!this.pdfDocument) { + return; + } + switch (action) { + case "GoBack": + this.pdfHistory?.back(); + break; + case "GoForward": + this.pdfHistory?.forward(); + break; + case "NextPage": + this.pdfViewer.nextPage(); + break; + case "PrevPage": + this.pdfViewer.previousPage(); + break; + case "LastPage": + this.page = this.pagesCount; + break; + case "FirstPage": + this.page = 1; + break; + default: + break; + } + this.eventBus.dispatch("namedaction", { + source: this, + action + }); + } + async executeSetOCGState(action) { + if (!this.pdfDocument) { + return; + } + const pdfDocument = this.pdfDocument, + optionalContentConfig = await this.pdfViewer.optionalContentConfigPromise; + if (pdfDocument !== this.pdfDocument) { + return; + } + optionalContentConfig.setOCGState(action); + this.pdfViewer.optionalContentConfigPromise = Promise.resolve(optionalContentConfig); + } + static #isValidExplicitDest(dest) { + if (!Array.isArray(dest) || dest.length < 2) { + return false; + } + const [page, zoom, ...args] = dest; + if (!(typeof page === "object" && Number.isInteger(page?.num) && Number.isInteger(page?.gen)) && !Number.isInteger(page)) { + return false; + } + if (!(typeof zoom === "object" && typeof zoom?.name === "string")) { + return false; + } + const argsLen = args.length; + let allowNull = true; + switch (zoom.name) { + case "XYZ": + if (argsLen < 2 || argsLen > 3) { + return false; + } + break; + case "Fit": + case "FitB": + return argsLen === 0; + case "FitH": + case "FitBH": + case "FitV": + case "FitBV": + if (argsLen > 1) { + return false; + } + break; + case "FitR": + if (argsLen !== 4) { + return false; + } + allowNull = false; + break; + default: + return false; + } + for (const arg of args) { + if (!(typeof arg === "number" || allowNull && arg === null)) { + return false; + } + } + return true; + } +} +class SimpleLinkService extends PDFLinkService { + setDocument(pdfDocument, baseUrl = null) {} +} + +;// ./web/pdfjs.js +const { + AbortException, + AnnotationEditorLayer, + AnnotationEditorParamsType, + AnnotationEditorType, + AnnotationEditorUIManager, + AnnotationLayer, + AnnotationMode, + build, + ColorPicker, + createValidAbsoluteUrl, + DOMSVGFactory, + DrawLayer, + FeatureTest, + fetchData, + getDocument, + getFilenameFromUrl, + getPdfFilenameFromUrl: pdfjs_getPdfFilenameFromUrl, + getXfaPageViewport, + GlobalWorkerOptions, + ImageKind, + InvalidPDFException, + isDataScheme, + isPdfFile, + MissingPDFException, + noContextMenu, + normalizeUnicode, + OPS, + OutputScale, + PasswordResponses, + PDFDataRangeTransport, + PDFDateString, + PDFWorker, + PermissionFlag, + PixelsPerInch, + RenderingCancelledException, + setLayerDimensions, + shadow, + stopEvent, + TextLayer, + TouchManager, + UnexpectedResponseException, + Util, + VerbosityLevel, + version, + XfaLayer +} = globalThis.pdfjsLib; + +;// ./web/event_utils.js +const WaitOnType = { + EVENT: "event", + TIMEOUT: "timeout" +}; +async function waitOnEventOrTimeout({ + target, + name, + delay = 0 +}) { + if (typeof target !== "object" || !(name && typeof name === "string") || !(Number.isInteger(delay) && delay >= 0)) { + throw new Error("waitOnEventOrTimeout - invalid parameters."); + } + const { + promise, + resolve + } = Promise.withResolvers(); + const ac = new AbortController(); + function handler(type) { + ac.abort(); + clearTimeout(timeout); + resolve(type); + } + const evtMethod = target instanceof EventBus ? "_on" : "addEventListener"; + target[evtMethod](name, handler.bind(null, WaitOnType.EVENT), { + signal: ac.signal + }); + const timeout = setTimeout(handler.bind(null, WaitOnType.TIMEOUT), delay); + return promise; +} +class EventBus { + #listeners = Object.create(null); + on(eventName, listener, options = null) { + this._on(eventName, listener, { + external: true, + once: options?.once, + signal: options?.signal + }); + } + off(eventName, listener, options = null) { + this._off(eventName, listener); + } + dispatch(eventName, data) { + const eventListeners = this.#listeners[eventName]; + if (!eventListeners || eventListeners.length === 0) { + return; + } + let externalListeners; + for (const { + listener, + external, + once + } of eventListeners.slice(0)) { + if (once) { + this._off(eventName, listener); + } + if (external) { + (externalListeners ||= []).push(listener); + continue; + } + listener(data); + } + if (externalListeners) { + for (const listener of externalListeners) { + listener(data); + } + externalListeners = null; + } + } + _on(eventName, listener, options = null) { + let rmAbort = null; + if (options?.signal instanceof AbortSignal) { + const { + signal + } = options; + if (signal.aborted) { + console.error("Cannot use an `aborted` signal."); + return; + } + const onAbort = () => this._off(eventName, listener); + rmAbort = () => signal.removeEventListener("abort", onAbort); + signal.addEventListener("abort", onAbort); + } + const eventListeners = this.#listeners[eventName] ||= []; + eventListeners.push({ + listener, + external: options?.external === true, + once: options?.once === true, + rmAbort + }); + } + _off(eventName, listener, options = null) { + const eventListeners = this.#listeners[eventName]; + if (!eventListeners) { + return; + } + for (let i = 0, ii = eventListeners.length; i < ii; i++) { + const evt = eventListeners[i]; + if (evt.listener === listener) { + evt.rmAbort?.(); + eventListeners.splice(i, 1); + return; + } + } + } +} +class FirefoxEventBus extends EventBus { + #externalServices; + #globalEventNames; + #isInAutomation; + constructor(globalEventNames, externalServices, isInAutomation) { + super(); + this.#globalEventNames = globalEventNames; + this.#externalServices = externalServices; + this.#isInAutomation = isInAutomation; + } + dispatch(eventName, data) { + throw new Error("Not implemented: FirefoxEventBus.dispatch"); + } +} + +;// ./web/external_services.js +class BaseExternalServices { + updateFindControlState(data) {} + updateFindMatchesCount(data) {} + initPassiveLoading() {} + reportTelemetry(data) {} + async createL10n() { + throw new Error("Not implemented: createL10n"); + } + createScripting() { + throw new Error("Not implemented: createScripting"); + } + updateEditorStates(data) { + throw new Error("Not implemented: updateEditorStates"); + } + dispatchGlobalEvent(_event) {} +} + +;// ./web/preferences.js + +class BasePreferences { + #defaults = Object.freeze({ + altTextLearnMoreUrl: "", + annotationEditorMode: 0, + annotationMode: 2, + cursorToolOnLoad: 0, + defaultZoomDelay: 400, + defaultZoomValue: "", + disablePageLabels: false, + enableAltText: false, + enableAltTextModelDownload: true, + enableGuessAltText: true, + enableHighlightFloatingButton: false, + enableNewAltTextWhenAddingImage: true, + enablePermissions: false, + enablePrintAutoRotate: true, + enableScripting: true, + enableUpdatedAddImage: false, + externalLinkTarget: 0, + highlightEditorColors: "yellow=#FFFF98,green=#53FFBC,blue=#80EBFF,pink=#FFCBE6,red=#FF4F5F", + historyUpdateUrl: false, + ignoreDestinationZoom: false, + forcePageColors: false, + pageColorsBackground: "Canvas", + pageColorsForeground: "CanvasText", + pdfBugEnabled: false, + sidebarViewOnLoad: -1, + scrollModeOnLoad: -1, + spreadModeOnLoad: -1, + textLayerMode: 1, + viewOnLoad: 0, + disableAutoFetch: false, + disableFontFace: false, + disableRange: false, + disableStream: false, + enableHWA: true, + enableXfa: true, + viewerCssTheme: 0 + }); + #initializedPromise = null; + constructor() { + this.#initializedPromise = this._readFromStorage(this.#defaults).then(({ + browserPrefs, + prefs + }) => { + if (AppOptions._checkDisablePreferences()) { + return; + } + AppOptions.setAll({ + ...browserPrefs, + ...prefs + }, true); + }); + } + async _writeToStorage(prefObj) { + throw new Error("Not implemented: _writeToStorage"); + } + async _readFromStorage(prefObj) { + throw new Error("Not implemented: _readFromStorage"); + } + async reset() { + await this.#initializedPromise; + AppOptions.setAll(this.#defaults, true); + await this._writeToStorage(this.#defaults); + } + async set(name, value) { + await this.#initializedPromise; + AppOptions.setAll({ + [name]: value + }, true); + await this._writeToStorage(AppOptions.getAll(OptionKind.PREFERENCE)); + } + async get(name) { + await this.#initializedPromise; + return AppOptions.get(name); + } + get initializedPromise() { + return this.#initializedPromise; + } +} + +;// ./node_modules/@fluent/bundle/esm/types.js +class FluentType { + constructor(value) { + this.value = value; + } + valueOf() { + return this.value; + } +} +class FluentNone extends FluentType { + constructor(value = "???") { + super(value); + } + toString(scope) { + return `{${this.value}}`; + } +} +class FluentNumber extends FluentType { + constructor(value, opts = {}) { + super(value); + this.opts = opts; + } + toString(scope) { + try { + const nf = scope.memoizeIntlObject(Intl.NumberFormat, this.opts); + return nf.format(this.value); + } catch (err) { + scope.reportError(err); + return this.value.toString(10); + } + } +} +class FluentDateTime extends FluentType { + constructor(value, opts = {}) { + super(value); + this.opts = opts; + } + toString(scope) { + try { + const dtf = scope.memoizeIntlObject(Intl.DateTimeFormat, this.opts); + return dtf.format(this.value); + } catch (err) { + scope.reportError(err); + return new Date(this.value).toISOString(); + } + } +} +;// ./node_modules/@fluent/bundle/esm/resolver.js + +const MAX_PLACEABLES = 100; +const FSI = "\u2068"; +const PDI = "\u2069"; +function match(scope, selector, key) { + if (key === selector) { + return true; + } + if (key instanceof FluentNumber && selector instanceof FluentNumber && key.value === selector.value) { + return true; + } + if (selector instanceof FluentNumber && typeof key === "string") { + let category = scope.memoizeIntlObject(Intl.PluralRules, selector.opts).select(selector.value); + if (key === category) { + return true; + } + } + return false; +} +function getDefault(scope, variants, star) { + if (variants[star]) { + return resolvePattern(scope, variants[star].value); + } + scope.reportError(new RangeError("No default")); + return new FluentNone(); +} +function getArguments(scope, args) { + const positional = []; + const named = Object.create(null); + for (const arg of args) { + if (arg.type === "narg") { + named[arg.name] = resolveExpression(scope, arg.value); + } else { + positional.push(resolveExpression(scope, arg)); + } + } + return { + positional, + named + }; +} +function resolveExpression(scope, expr) { + switch (expr.type) { + case "str": + return expr.value; + case "num": + return new FluentNumber(expr.value, { + minimumFractionDigits: expr.precision + }); + case "var": + return resolveVariableReference(scope, expr); + case "mesg": + return resolveMessageReference(scope, expr); + case "term": + return resolveTermReference(scope, expr); + case "func": + return resolveFunctionReference(scope, expr); + case "select": + return resolveSelectExpression(scope, expr); + default: + return new FluentNone(); + } +} +function resolveVariableReference(scope, { + name +}) { + let arg; + if (scope.params) { + if (Object.prototype.hasOwnProperty.call(scope.params, name)) { + arg = scope.params[name]; + } else { + return new FluentNone(`$${name}`); + } + } else if (scope.args && Object.prototype.hasOwnProperty.call(scope.args, name)) { + arg = scope.args[name]; + } else { + scope.reportError(new ReferenceError(`Unknown variable: $${name}`)); + return new FluentNone(`$${name}`); + } + if (arg instanceof FluentType) { + return arg; + } + switch (typeof arg) { + case "string": + return arg; + case "number": + return new FluentNumber(arg); + case "object": + if (arg instanceof Date) { + return new FluentDateTime(arg.getTime()); + } + default: + scope.reportError(new TypeError(`Variable type not supported: $${name}, ${typeof arg}`)); + return new FluentNone(`$${name}`); + } +} +function resolveMessageReference(scope, { + name, + attr +}) { + const message = scope.bundle._messages.get(name); + if (!message) { + scope.reportError(new ReferenceError(`Unknown message: ${name}`)); + return new FluentNone(name); + } + if (attr) { + const attribute = message.attributes[attr]; + if (attribute) { + return resolvePattern(scope, attribute); + } + scope.reportError(new ReferenceError(`Unknown attribute: ${attr}`)); + return new FluentNone(`${name}.${attr}`); + } + if (message.value) { + return resolvePattern(scope, message.value); + } + scope.reportError(new ReferenceError(`No value: ${name}`)); + return new FluentNone(name); +} +function resolveTermReference(scope, { + name, + attr, + args +}) { + const id = `-${name}`; + const term = scope.bundle._terms.get(id); + if (!term) { + scope.reportError(new ReferenceError(`Unknown term: ${id}`)); + return new FluentNone(id); + } + if (attr) { + const attribute = term.attributes[attr]; + if (attribute) { + scope.params = getArguments(scope, args).named; + const resolved = resolvePattern(scope, attribute); + scope.params = null; + return resolved; + } + scope.reportError(new ReferenceError(`Unknown attribute: ${attr}`)); + return new FluentNone(`${id}.${attr}`); + } + scope.params = getArguments(scope, args).named; + const resolved = resolvePattern(scope, term.value); + scope.params = null; + return resolved; +} +function resolveFunctionReference(scope, { + name, + args +}) { + let func = scope.bundle._functions[name]; + if (!func) { + scope.reportError(new ReferenceError(`Unknown function: ${name}()`)); + return new FluentNone(`${name}()`); + } + if (typeof func !== "function") { + scope.reportError(new TypeError(`Function ${name}() is not callable`)); + return new FluentNone(`${name}()`); + } + try { + let resolved = getArguments(scope, args); + return func(resolved.positional, resolved.named); + } catch (err) { + scope.reportError(err); + return new FluentNone(`${name}()`); + } +} +function resolveSelectExpression(scope, { + selector, + variants, + star +}) { + let sel = resolveExpression(scope, selector); + if (sel instanceof FluentNone) { + return getDefault(scope, variants, star); + } + for (const variant of variants) { + const key = resolveExpression(scope, variant.key); + if (match(scope, sel, key)) { + return resolvePattern(scope, variant.value); + } + } + return getDefault(scope, variants, star); +} +function resolveComplexPattern(scope, ptn) { + if (scope.dirty.has(ptn)) { + scope.reportError(new RangeError("Cyclic reference")); + return new FluentNone(); + } + scope.dirty.add(ptn); + const result = []; + const useIsolating = scope.bundle._useIsolating && ptn.length > 1; + for (const elem of ptn) { + if (typeof elem === "string") { + result.push(scope.bundle._transform(elem)); + continue; + } + scope.placeables++; + if (scope.placeables > MAX_PLACEABLES) { + scope.dirty.delete(ptn); + throw new RangeError(`Too many placeables expanded: ${scope.placeables}, ` + `max allowed is ${MAX_PLACEABLES}`); + } + if (useIsolating) { + result.push(FSI); + } + result.push(resolveExpression(scope, elem).toString(scope)); + if (useIsolating) { + result.push(PDI); + } + } + scope.dirty.delete(ptn); + return result.join(""); +} +function resolvePattern(scope, value) { + if (typeof value === "string") { + return scope.bundle._transform(value); + } + return resolveComplexPattern(scope, value); +} +;// ./node_modules/@fluent/bundle/esm/scope.js +class Scope { + constructor(bundle, errors, args) { + this.dirty = new WeakSet(); + this.params = null; + this.placeables = 0; + this.bundle = bundle; + this.errors = errors; + this.args = args; + } + reportError(error) { + if (!this.errors || !(error instanceof Error)) { + throw error; + } + this.errors.push(error); + } + memoizeIntlObject(ctor, opts) { + let cache = this.bundle._intls.get(ctor); + if (!cache) { + cache = {}; + this.bundle._intls.set(ctor, cache); + } + let id = JSON.stringify(opts); + if (!cache[id]) { + cache[id] = new ctor(this.bundle.locales, opts); + } + return cache[id]; + } +} +;// ./node_modules/@fluent/bundle/esm/builtins.js + +function values(opts, allowed) { + const unwrapped = Object.create(null); + for (const [name, opt] of Object.entries(opts)) { + if (allowed.includes(name)) { + unwrapped[name] = opt.valueOf(); + } + } + return unwrapped; +} +const NUMBER_ALLOWED = ["unitDisplay", "currencyDisplay", "useGrouping", "minimumIntegerDigits", "minimumFractionDigits", "maximumFractionDigits", "minimumSignificantDigits", "maximumSignificantDigits"]; +function NUMBER(args, opts) { + let arg = args[0]; + if (arg instanceof FluentNone) { + return new FluentNone(`NUMBER(${arg.valueOf()})`); + } + if (arg instanceof FluentNumber) { + return new FluentNumber(arg.valueOf(), { + ...arg.opts, + ...values(opts, NUMBER_ALLOWED) + }); + } + if (arg instanceof FluentDateTime) { + return new FluentNumber(arg.valueOf(), { + ...values(opts, NUMBER_ALLOWED) + }); + } + throw new TypeError("Invalid argument to NUMBER"); +} +const DATETIME_ALLOWED = ["dateStyle", "timeStyle", "fractionalSecondDigits", "dayPeriod", "hour12", "weekday", "era", "year", "month", "day", "hour", "minute", "second", "timeZoneName"]; +function DATETIME(args, opts) { + let arg = args[0]; + if (arg instanceof FluentNone) { + return new FluentNone(`DATETIME(${arg.valueOf()})`); + } + if (arg instanceof FluentDateTime) { + return new FluentDateTime(arg.valueOf(), { + ...arg.opts, + ...values(opts, DATETIME_ALLOWED) + }); + } + if (arg instanceof FluentNumber) { + return new FluentDateTime(arg.valueOf(), { + ...values(opts, DATETIME_ALLOWED) + }); + } + throw new TypeError("Invalid argument to DATETIME"); +} +;// ./node_modules/@fluent/bundle/esm/memoizer.js +const cache = new Map(); +function getMemoizerForLocale(locales) { + const stringLocale = Array.isArray(locales) ? locales.join(" ") : locales; + let memoizer = cache.get(stringLocale); + if (memoizer === undefined) { + memoizer = new Map(); + cache.set(stringLocale, memoizer); + } + return memoizer; +} +;// ./node_modules/@fluent/bundle/esm/bundle.js + + + + + +class FluentBundle { + constructor(locales, { + functions, + useIsolating = true, + transform = v => v + } = {}) { + this._terms = new Map(); + this._messages = new Map(); + this.locales = Array.isArray(locales) ? locales : [locales]; + this._functions = { + NUMBER: NUMBER, + DATETIME: DATETIME, + ...functions + }; + this._useIsolating = useIsolating; + this._transform = transform; + this._intls = getMemoizerForLocale(locales); + } + hasMessage(id) { + return this._messages.has(id); + } + getMessage(id) { + return this._messages.get(id); + } + addResource(res, { + allowOverrides = false + } = {}) { + const errors = []; + for (let i = 0; i < res.body.length; i++) { + let entry = res.body[i]; + if (entry.id.startsWith("-")) { + if (allowOverrides === false && this._terms.has(entry.id)) { + errors.push(new Error(`Attempt to override an existing term: "${entry.id}"`)); + continue; + } + this._terms.set(entry.id, entry); + } else { + if (allowOverrides === false && this._messages.has(entry.id)) { + errors.push(new Error(`Attempt to override an existing message: "${entry.id}"`)); + continue; + } + this._messages.set(entry.id, entry); + } + } + return errors; + } + formatPattern(pattern, args = null, errors = null) { + if (typeof pattern === "string") { + return this._transform(pattern); + } + let scope = new Scope(this, errors, args); + try { + let value = resolveComplexPattern(scope, pattern); + return value.toString(scope); + } catch (err) { + if (scope.errors && err instanceof Error) { + scope.errors.push(err); + return new FluentNone().toString(scope); + } + throw err; + } + } +} +;// ./node_modules/@fluent/bundle/esm/resource.js +const RE_MESSAGE_START = /^(-?[a-zA-Z][\w-]*) *= */gm; +const RE_ATTRIBUTE_START = /\.([a-zA-Z][\w-]*) *= */y; +const RE_VARIANT_START = /\*?\[/y; +const RE_NUMBER_LITERAL = /(-?[0-9]+(?:\.([0-9]+))?)/y; +const RE_IDENTIFIER = /([a-zA-Z][\w-]*)/y; +const RE_REFERENCE = /([$-])?([a-zA-Z][\w-]*)(?:\.([a-zA-Z][\w-]*))?/y; +const RE_FUNCTION_NAME = /^[A-Z][A-Z0-9_-]*$/; +const RE_TEXT_RUN = /([^{}\n\r]+)/y; +const RE_STRING_RUN = /([^\\"\n\r]*)/y; +const RE_STRING_ESCAPE = /\\([\\"])/y; +const RE_UNICODE_ESCAPE = /\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{6})/y; +const RE_LEADING_NEWLINES = /^\n+/; +const RE_TRAILING_SPACES = / +$/; +const RE_BLANK_LINES = / *\r?\n/g; +const RE_INDENT = /( *)$/; +const TOKEN_BRACE_OPEN = /{\s*/y; +const TOKEN_BRACE_CLOSE = /\s*}/y; +const TOKEN_BRACKET_OPEN = /\[\s*/y; +const TOKEN_BRACKET_CLOSE = /\s*] */y; +const TOKEN_PAREN_OPEN = /\s*\(\s*/y; +const TOKEN_ARROW = /\s*->\s*/y; +const TOKEN_COLON = /\s*:\s*/y; +const TOKEN_COMMA = /\s*,?\s*/y; +const TOKEN_BLANK = /\s+/y; +class FluentResource { + constructor(source) { + this.body = []; + RE_MESSAGE_START.lastIndex = 0; + let cursor = 0; + while (true) { + let next = RE_MESSAGE_START.exec(source); + if (next === null) { + break; + } + cursor = RE_MESSAGE_START.lastIndex; + try { + this.body.push(parseMessage(next[1])); + } catch (err) { + if (err instanceof SyntaxError) { + continue; + } + throw err; + } + } + function test(re) { + re.lastIndex = cursor; + return re.test(source); + } + function consumeChar(char, errorClass) { + if (source[cursor] === char) { + cursor++; + return true; + } + if (errorClass) { + throw new errorClass(`Expected ${char}`); + } + return false; + } + function consumeToken(re, errorClass) { + if (test(re)) { + cursor = re.lastIndex; + return true; + } + if (errorClass) { + throw new errorClass(`Expected ${re.toString()}`); + } + return false; + } + function match(re) { + re.lastIndex = cursor; + let result = re.exec(source); + if (result === null) { + throw new SyntaxError(`Expected ${re.toString()}`); + } + cursor = re.lastIndex; + return result; + } + function match1(re) { + return match(re)[1]; + } + function parseMessage(id) { + let value = parsePattern(); + let attributes = parseAttributes(); + if (value === null && Object.keys(attributes).length === 0) { + throw new SyntaxError("Expected message value or attributes"); + } + return { + id, + value, + attributes + }; + } + function parseAttributes() { + let attrs = Object.create(null); + while (test(RE_ATTRIBUTE_START)) { + let name = match1(RE_ATTRIBUTE_START); + let value = parsePattern(); + if (value === null) { + throw new SyntaxError("Expected attribute value"); + } + attrs[name] = value; + } + return attrs; + } + function parsePattern() { + let first; + if (test(RE_TEXT_RUN)) { + first = match1(RE_TEXT_RUN); + } + if (source[cursor] === "{" || source[cursor] === "}") { + return parsePatternElements(first ? [first] : [], Infinity); + } + let indent = parseIndent(); + if (indent) { + if (first) { + return parsePatternElements([first, indent], indent.length); + } + indent.value = trim(indent.value, RE_LEADING_NEWLINES); + return parsePatternElements([indent], indent.length); + } + if (first) { + return trim(first, RE_TRAILING_SPACES); + } + return null; + } + function parsePatternElements(elements = [], commonIndent) { + while (true) { + if (test(RE_TEXT_RUN)) { + elements.push(match1(RE_TEXT_RUN)); + continue; + } + if (source[cursor] === "{") { + elements.push(parsePlaceable()); + continue; + } + if (source[cursor] === "}") { + throw new SyntaxError("Unbalanced closing brace"); + } + let indent = parseIndent(); + if (indent) { + elements.push(indent); + commonIndent = Math.min(commonIndent, indent.length); + continue; + } + break; + } + let lastIndex = elements.length - 1; + let lastElement = elements[lastIndex]; + if (typeof lastElement === "string") { + elements[lastIndex] = trim(lastElement, RE_TRAILING_SPACES); + } + let baked = []; + for (let element of elements) { + if (element instanceof Indent) { + element = element.value.slice(0, element.value.length - commonIndent); + } + if (element) { + baked.push(element); + } + } + return baked; + } + function parsePlaceable() { + consumeToken(TOKEN_BRACE_OPEN, SyntaxError); + let selector = parseInlineExpression(); + if (consumeToken(TOKEN_BRACE_CLOSE)) { + return selector; + } + if (consumeToken(TOKEN_ARROW)) { + let variants = parseVariants(); + consumeToken(TOKEN_BRACE_CLOSE, SyntaxError); + return { + type: "select", + selector, + ...variants + }; + } + throw new SyntaxError("Unclosed placeable"); + } + function parseInlineExpression() { + if (source[cursor] === "{") { + return parsePlaceable(); + } + if (test(RE_REFERENCE)) { + let [, sigil, name, attr = null] = match(RE_REFERENCE); + if (sigil === "$") { + return { + type: "var", + name + }; + } + if (consumeToken(TOKEN_PAREN_OPEN)) { + let args = parseArguments(); + if (sigil === "-") { + return { + type: "term", + name, + attr, + args + }; + } + if (RE_FUNCTION_NAME.test(name)) { + return { + type: "func", + name, + args + }; + } + throw new SyntaxError("Function names must be all upper-case"); + } + if (sigil === "-") { + return { + type: "term", + name, + attr, + args: [] + }; + } + return { + type: "mesg", + name, + attr + }; + } + return parseLiteral(); + } + function parseArguments() { + let args = []; + while (true) { + switch (source[cursor]) { + case ")": + cursor++; + return args; + case undefined: + throw new SyntaxError("Unclosed argument list"); + } + args.push(parseArgument()); + consumeToken(TOKEN_COMMA); + } + } + function parseArgument() { + let expr = parseInlineExpression(); + if (expr.type !== "mesg") { + return expr; + } + if (consumeToken(TOKEN_COLON)) { + return { + type: "narg", + name: expr.name, + value: parseLiteral() + }; + } + return expr; + } + function parseVariants() { + let variants = []; + let count = 0; + let star; + while (test(RE_VARIANT_START)) { + if (consumeChar("*")) { + star = count; + } + let key = parseVariantKey(); + let value = parsePattern(); + if (value === null) { + throw new SyntaxError("Expected variant value"); + } + variants[count++] = { + key, + value + }; + } + if (count === 0) { + return null; + } + if (star === undefined) { + throw new SyntaxError("Expected default variant"); + } + return { + variants, + star + }; + } + function parseVariantKey() { + consumeToken(TOKEN_BRACKET_OPEN, SyntaxError); + let key; + if (test(RE_NUMBER_LITERAL)) { + key = parseNumberLiteral(); + } else { + key = { + type: "str", + value: match1(RE_IDENTIFIER) + }; + } + consumeToken(TOKEN_BRACKET_CLOSE, SyntaxError); + return key; + } + function parseLiteral() { + if (test(RE_NUMBER_LITERAL)) { + return parseNumberLiteral(); + } + if (source[cursor] === '"') { + return parseStringLiteral(); + } + throw new SyntaxError("Invalid expression"); + } + function parseNumberLiteral() { + let [, value, fraction = ""] = match(RE_NUMBER_LITERAL); + let precision = fraction.length; + return { + type: "num", + value: parseFloat(value), + precision + }; + } + function parseStringLiteral() { + consumeChar('"', SyntaxError); + let value = ""; + while (true) { + value += match1(RE_STRING_RUN); + if (source[cursor] === "\\") { + value += parseEscapeSequence(); + continue; + } + if (consumeChar('"')) { + return { + type: "str", + value + }; + } + throw new SyntaxError("Unclosed string literal"); + } + } + function parseEscapeSequence() { + if (test(RE_STRING_ESCAPE)) { + return match1(RE_STRING_ESCAPE); + } + if (test(RE_UNICODE_ESCAPE)) { + let [, codepoint4, codepoint6] = match(RE_UNICODE_ESCAPE); + let codepoint = parseInt(codepoint4 || codepoint6, 16); + return codepoint <= 0xd7ff || 0xe000 <= codepoint ? String.fromCodePoint(codepoint) : "�"; + } + throw new SyntaxError("Unknown escape sequence"); + } + function parseIndent() { + let start = cursor; + consumeToken(TOKEN_BLANK); + switch (source[cursor]) { + case ".": + case "[": + case "*": + case "}": + case undefined: + return false; + case "{": + return makeIndent(source.slice(start, cursor)); + } + if (source[cursor - 1] === " ") { + return makeIndent(source.slice(start, cursor)); + } + return false; + } + function trim(text, re) { + return text.replace(re, ""); + } + function makeIndent(blank) { + let value = blank.replace(RE_BLANK_LINES, "\n"); + let length = RE_INDENT.exec(blank)[1].length; + return new Indent(value, length); + } + } +} +class Indent { + constructor(value, length) { + this.value = value; + this.length = length; + } +} +;// ./node_modules/@fluent/bundle/esm/index.js + + + +;// ./node_modules/@fluent/dom/esm/overlay.js +const reOverlay = /<|&#?\w+;/; +const TEXT_LEVEL_ELEMENTS = { + "http://www.w3.org/1999/xhtml": ["em", "strong", "small", "s", "cite", "q", "dfn", "abbr", "data", "time", "code", "var", "samp", "kbd", "sub", "sup", "i", "b", "u", "mark", "bdi", "bdo", "span", "br", "wbr"] +}; +const LOCALIZABLE_ATTRIBUTES = { + "http://www.w3.org/1999/xhtml": { + global: ["title", "aria-label", "aria-valuetext"], + a: ["download"], + area: ["download", "alt"], + input: ["alt", "placeholder"], + menuitem: ["label"], + menu: ["label"], + optgroup: ["label"], + option: ["label"], + track: ["label"], + img: ["alt"], + textarea: ["placeholder"], + th: ["abbr"] + }, + "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul": { + global: ["accesskey", "aria-label", "aria-valuetext", "label", "title", "tooltiptext"], + description: ["value"], + key: ["key", "keycode"], + label: ["value"], + textbox: ["placeholder", "value"] + } +}; +function translateElement(element, translation) { + const { + value + } = translation; + if (typeof value === "string") { + if (element.localName === "title" && element.namespaceURI === "http://www.w3.org/1999/xhtml") { + element.textContent = value; + } else if (!reOverlay.test(value)) { + element.textContent = value; + } else { + const templateElement = element.ownerDocument.createElementNS("http://www.w3.org/1999/xhtml", "template"); + templateElement.innerHTML = value; + overlayChildNodes(templateElement.content, element); + } + } + overlayAttributes(translation, element); +} +function overlayChildNodes(fromFragment, toElement) { + for (const childNode of fromFragment.childNodes) { + if (childNode.nodeType === childNode.TEXT_NODE) { + continue; + } + if (childNode.hasAttribute("data-l10n-name")) { + const sanitized = getNodeForNamedElement(toElement, childNode); + fromFragment.replaceChild(sanitized, childNode); + continue; + } + if (isElementAllowed(childNode)) { + const sanitized = createSanitizedElement(childNode); + fromFragment.replaceChild(sanitized, childNode); + continue; + } + console.warn(`An element of forbidden type "${childNode.localName}" was found in ` + "the translation. Only safe text-level elements and elements with " + "data-l10n-name are allowed."); + fromFragment.replaceChild(createTextNodeFromTextContent(childNode), childNode); + } + toElement.textContent = ""; + toElement.appendChild(fromFragment); +} +function hasAttribute(attributes, name) { + if (!attributes) { + return false; + } + for (let attr of attributes) { + if (attr.name === name) { + return true; + } + } + return false; +} +function overlayAttributes(fromElement, toElement) { + const explicitlyAllowed = toElement.hasAttribute("data-l10n-attrs") ? toElement.getAttribute("data-l10n-attrs").split(",").map(i => i.trim()) : null; + for (const attr of Array.from(toElement.attributes)) { + if (isAttrNameLocalizable(attr.name, toElement, explicitlyAllowed) && !hasAttribute(fromElement.attributes, attr.name)) { + toElement.removeAttribute(attr.name); + } + } + if (!fromElement.attributes) { + return; + } + for (const attr of Array.from(fromElement.attributes)) { + if (isAttrNameLocalizable(attr.name, toElement, explicitlyAllowed) && toElement.getAttribute(attr.name) !== attr.value) { + toElement.setAttribute(attr.name, attr.value); + } + } +} +function getNodeForNamedElement(sourceElement, translatedChild) { + const childName = translatedChild.getAttribute("data-l10n-name"); + const sourceChild = sourceElement.querySelector(`[data-l10n-name="${childName}"]`); + if (!sourceChild) { + console.warn(`An element named "${childName}" wasn't found in the source.`); + return createTextNodeFromTextContent(translatedChild); + } + if (sourceChild.localName !== translatedChild.localName) { + console.warn(`An element named "${childName}" was found in the translation ` + `but its type ${translatedChild.localName} didn't match the ` + `element found in the source (${sourceChild.localName}).`); + return createTextNodeFromTextContent(translatedChild); + } + sourceElement.removeChild(sourceChild); + const clone = sourceChild.cloneNode(false); + return shallowPopulateUsing(translatedChild, clone); +} +function createSanitizedElement(element) { + const clone = element.ownerDocument.createElement(element.localName); + return shallowPopulateUsing(element, clone); +} +function createTextNodeFromTextContent(element) { + return element.ownerDocument.createTextNode(element.textContent); +} +function isElementAllowed(element) { + const allowed = TEXT_LEVEL_ELEMENTS[element.namespaceURI]; + return allowed && allowed.includes(element.localName); +} +function isAttrNameLocalizable(name, element, explicitlyAllowed = null) { + if (explicitlyAllowed && explicitlyAllowed.includes(name)) { + return true; + } + const allowed = LOCALIZABLE_ATTRIBUTES[element.namespaceURI]; + if (!allowed) { + return false; + } + const attrName = name.toLowerCase(); + const elemName = element.localName; + if (allowed.global.includes(attrName)) { + return true; + } + if (!allowed[elemName]) { + return false; + } + if (allowed[elemName].includes(attrName)) { + return true; + } + if (element.namespaceURI === "http://www.w3.org/1999/xhtml" && elemName === "input" && attrName === "value") { + const type = element.type.toLowerCase(); + if (type === "submit" || type === "button" || type === "reset") { + return true; + } + } + return false; +} +function shallowPopulateUsing(fromElement, toElement) { + toElement.textContent = fromElement.textContent; + overlayAttributes(fromElement, toElement); + return toElement; +} +;// ./node_modules/cached-iterable/src/cached_iterable.mjs +class CachedIterable extends Array { + static from(iterable) { + if (iterable instanceof this) { + return iterable; + } + return new this(iterable); + } +} +;// ./node_modules/cached-iterable/src/cached_sync_iterable.mjs + +class CachedSyncIterable extends CachedIterable { + constructor(iterable) { + super(); + if (Symbol.iterator in Object(iterable)) { + this.iterator = iterable[Symbol.iterator](); + } else { + throw new TypeError("Argument must implement the iteration protocol."); + } + } + [Symbol.iterator]() { + const cached = this; + let cur = 0; + return { + next() { + if (cached.length <= cur) { + cached.push(cached.iterator.next()); + } + return cached[cur++]; + } + }; + } + touchNext(count = 1) { + let idx = 0; + while (idx++ < count) { + const last = this[this.length - 1]; + if (last && last.done) { + break; + } + this.push(this.iterator.next()); + } + return this[this.length - 1]; + } +} +;// ./node_modules/cached-iterable/src/cached_async_iterable.mjs + +class CachedAsyncIterable extends CachedIterable { + constructor(iterable) { + super(); + if (Symbol.asyncIterator in Object(iterable)) { + this.iterator = iterable[Symbol.asyncIterator](); + } else if (Symbol.iterator in Object(iterable)) { + this.iterator = iterable[Symbol.iterator](); + } else { + throw new TypeError("Argument must implement the iteration protocol."); + } + } + [Symbol.asyncIterator]() { + const cached = this; + let cur = 0; + return { + async next() { + if (cached.length <= cur) { + cached.push(cached.iterator.next()); + } + return cached[cur++]; + } + }; + } + async touchNext(count = 1) { + let idx = 0; + while (idx++ < count) { + const last = this[this.length - 1]; + if (last && (await last).done) { + break; + } + this.push(this.iterator.next()); + } + return this[this.length - 1]; + } +} +;// ./node_modules/cached-iterable/src/index.mjs + + +;// ./node_modules/@fluent/dom/esm/localization.js + +class Localization { + constructor(resourceIds = [], generateBundles) { + this.resourceIds = resourceIds; + this.generateBundles = generateBundles; + this.onChange(true); + } + addResourceIds(resourceIds, eager = false) { + this.resourceIds.push(...resourceIds); + this.onChange(eager); + return this.resourceIds.length; + } + removeResourceIds(resourceIds) { + this.resourceIds = this.resourceIds.filter(r => !resourceIds.includes(r)); + this.onChange(); + return this.resourceIds.length; + } + async formatWithFallback(keys, method) { + const translations = []; + let hasAtLeastOneBundle = false; + for await (const bundle of this.bundles) { + hasAtLeastOneBundle = true; + const missingIds = keysFromBundle(method, bundle, keys, translations); + if (missingIds.size === 0) { + break; + } + if (typeof console !== "undefined") { + const locale = bundle.locales[0]; + const ids = Array.from(missingIds).join(", "); + console.warn(`[fluent] Missing translations in ${locale}: ${ids}`); + } + } + if (!hasAtLeastOneBundle && typeof console !== "undefined") { + console.warn(`[fluent] Request for keys failed because no resource bundles got generated. + keys: ${JSON.stringify(keys)}. + resourceIds: ${JSON.stringify(this.resourceIds)}.`); + } + return translations; + } + formatMessages(keys) { + return this.formatWithFallback(keys, messageFromBundle); + } + formatValues(keys) { + return this.formatWithFallback(keys, valueFromBundle); + } + async formatValue(id, args) { + const [val] = await this.formatValues([{ + id, + args + }]); + return val; + } + handleEvent() { + this.onChange(); + } + onChange(eager = false) { + this.bundles = CachedAsyncIterable.from(this.generateBundles(this.resourceIds)); + if (eager) { + this.bundles.touchNext(2); + } + } +} +function valueFromBundle(bundle, errors, message, args) { + if (message.value) { + return bundle.formatPattern(message.value, args, errors); + } + return null; +} +function messageFromBundle(bundle, errors, message, args) { + const formatted = { + value: null, + attributes: null + }; + if (message.value) { + formatted.value = bundle.formatPattern(message.value, args, errors); + } + let attrNames = Object.keys(message.attributes); + if (attrNames.length > 0) { + formatted.attributes = new Array(attrNames.length); + for (let [i, name] of attrNames.entries()) { + let value = bundle.formatPattern(message.attributes[name], args, errors); + formatted.attributes[i] = { + name, + value + }; + } + } + return formatted; +} +function keysFromBundle(method, bundle, keys, translations) { + const messageErrors = []; + const missingIds = new Set(); + keys.forEach(({ + id, + args + }, i) => { + if (translations[i] !== undefined) { + return; + } + let message = bundle.getMessage(id); + if (message) { + messageErrors.length = 0; + translations[i] = method(bundle, messageErrors, message, args); + if (messageErrors.length > 0 && typeof console !== "undefined") { + const locale = bundle.locales[0]; + const errors = messageErrors.join(", "); + console.warn(`[fluent][resolver] errors in ${locale}/${id}: ${errors}.`); + } + } else { + missingIds.add(id); + } + }); + return missingIds; +} +;// ./node_modules/@fluent/dom/esm/dom_localization.js + + +const L10NID_ATTR_NAME = "data-l10n-id"; +const L10NARGS_ATTR_NAME = "data-l10n-args"; +const L10N_ELEMENT_QUERY = `[${L10NID_ATTR_NAME}]`; +class DOMLocalization extends Localization { + constructor(resourceIds, generateBundles) { + super(resourceIds, generateBundles); + this.roots = new Set(); + this.pendingrAF = null; + this.pendingElements = new Set(); + this.windowElement = null; + this.mutationObserver = null; + this.observerConfig = { + attributes: true, + characterData: false, + childList: true, + subtree: true, + attributeFilter: [L10NID_ATTR_NAME, L10NARGS_ATTR_NAME] + }; + } + onChange(eager = false) { + super.onChange(eager); + if (this.roots) { + this.translateRoots(); + } + } + setAttributes(element, id, args) { + element.setAttribute(L10NID_ATTR_NAME, id); + if (args) { + element.setAttribute(L10NARGS_ATTR_NAME, JSON.stringify(args)); + } else { + element.removeAttribute(L10NARGS_ATTR_NAME); + } + return element; + } + getAttributes(element) { + return { + id: element.getAttribute(L10NID_ATTR_NAME), + args: JSON.parse(element.getAttribute(L10NARGS_ATTR_NAME) || null) + }; + } + connectRoot(newRoot) { + for (const root of this.roots) { + if (root === newRoot || root.contains(newRoot) || newRoot.contains(root)) { + throw new Error("Cannot add a root that overlaps with existing root."); + } + } + if (this.windowElement) { + if (this.windowElement !== newRoot.ownerDocument.defaultView) { + throw new Error(`Cannot connect a root: + DOMLocalization already has a root from a different window.`); + } + } else { + this.windowElement = newRoot.ownerDocument.defaultView; + this.mutationObserver = new this.windowElement.MutationObserver(mutations => this.translateMutations(mutations)); + } + this.roots.add(newRoot); + this.mutationObserver.observe(newRoot, this.observerConfig); + } + disconnectRoot(root) { + this.roots.delete(root); + this.pauseObserving(); + if (this.roots.size === 0) { + this.mutationObserver = null; + if (this.windowElement && this.pendingrAF) { + this.windowElement.cancelAnimationFrame(this.pendingrAF); + } + this.windowElement = null; + this.pendingrAF = null; + this.pendingElements.clear(); + return true; + } + this.resumeObserving(); + return false; + } + translateRoots() { + const roots = Array.from(this.roots); + return Promise.all(roots.map(root => this.translateFragment(root))); + } + pauseObserving() { + if (!this.mutationObserver) { + return; + } + this.translateMutations(this.mutationObserver.takeRecords()); + this.mutationObserver.disconnect(); + } + resumeObserving() { + if (!this.mutationObserver) { + return; + } + for (const root of this.roots) { + this.mutationObserver.observe(root, this.observerConfig); + } + } + translateMutations(mutations) { + for (const mutation of mutations) { + switch (mutation.type) { + case "attributes": + if (mutation.target.hasAttribute("data-l10n-id")) { + this.pendingElements.add(mutation.target); + } + break; + case "childList": + for (const addedNode of mutation.addedNodes) { + if (addedNode.nodeType === addedNode.ELEMENT_NODE) { + if (addedNode.childElementCount) { + for (const element of this.getTranslatables(addedNode)) { + this.pendingElements.add(element); + } + } else if (addedNode.hasAttribute(L10NID_ATTR_NAME)) { + this.pendingElements.add(addedNode); + } + } + } + break; + } + } + if (this.pendingElements.size > 0) { + if (this.pendingrAF === null) { + this.pendingrAF = this.windowElement.requestAnimationFrame(() => { + this.translateElements(Array.from(this.pendingElements)); + this.pendingElements.clear(); + this.pendingrAF = null; + }); + } + } + } + translateFragment(frag) { + return this.translateElements(this.getTranslatables(frag)); + } + async translateElements(elements) { + if (!elements.length) { + return undefined; + } + const keys = elements.map(this.getKeysForElement); + const translations = await this.formatMessages(keys); + return this.applyTranslations(elements, translations); + } + applyTranslations(elements, translations) { + this.pauseObserving(); + for (let i = 0; i < elements.length; i++) { + if (translations[i] !== undefined) { + translateElement(elements[i], translations[i]); + } + } + this.resumeObserving(); + } + getTranslatables(element) { + const nodes = Array.from(element.querySelectorAll(L10N_ELEMENT_QUERY)); + if (typeof element.hasAttribute === "function" && element.hasAttribute(L10NID_ATTR_NAME)) { + nodes.push(element); + } + return nodes; + } + getKeysForElement(element) { + return { + id: element.getAttribute(L10NID_ATTR_NAME), + args: JSON.parse(element.getAttribute(L10NARGS_ATTR_NAME) || null) + }; + } +} +;// ./node_modules/@fluent/dom/esm/index.js + + +;// ./web/l10n.js +class L10n { + #dir; + #elements; + #lang; + #l10n; + constructor({ + lang, + isRTL + }, l10n = null) { + this.#lang = L10n.#fixupLangCode(lang); + this.#l10n = l10n; + this.#dir = isRTL ?? L10n.#isRTL(this.#lang) ? "rtl" : "ltr"; + } + _setL10n(l10n) { + this.#l10n = l10n; + } + getLanguage() { + return this.#lang; + } + getDirection() { + return this.#dir; + } + async get(ids, args = null, fallback) { + if (Array.isArray(ids)) { + ids = ids.map(id => ({ + id + })); + const messages = await this.#l10n.formatMessages(ids); + return messages.map(message => message.value); + } + const messages = await this.#l10n.formatMessages([{ + id: ids, + args + }]); + return messages[0]?.value || fallback; + } + async translate(element) { + (this.#elements ||= new Set()).add(element); + try { + this.#l10n.connectRoot(element); + await this.#l10n.translateRoots(); + } catch {} + } + async translateOnce(element) { + try { + await this.#l10n.translateElements([element]); + } catch (ex) { + console.error("translateOnce:", ex); + } + } + async destroy() { + if (this.#elements) { + for (const element of this.#elements) { + this.#l10n.disconnectRoot(element); + } + this.#elements.clear(); + this.#elements = null; + } + this.#l10n.pauseObserving(); + } + pause() { + this.#l10n.pauseObserving(); + } + resume() { + this.#l10n.resumeObserving(); + } + static #fixupLangCode(langCode) { + langCode = langCode?.toLowerCase() || "en-us"; + const PARTIAL_LANG_CODES = { + en: "en-us", + es: "es-es", + fy: "fy-nl", + ga: "ga-ie", + gu: "gu-in", + hi: "hi-in", + hy: "hy-am", + nb: "nb-no", + ne: "ne-np", + nn: "nn-no", + pa: "pa-in", + pt: "pt-pt", + sv: "sv-se", + zh: "zh-cn" + }; + return PARTIAL_LANG_CODES[langCode] || langCode; + } + static #isRTL(lang) { + const shortCode = lang.split("-", 1)[0]; + return ["ar", "he", "fa", "ps", "ur"].includes(shortCode); + } +} +const GenericL10n = null; + +;// ./web/genericl10n.js + + + + +function createBundle(lang, text) { + const resource = new FluentResource(text); + const bundle = new FluentBundle(lang); + const errors = bundle.addResource(resource); + if (errors.length) { + console.error("L10n errors", errors); + } + return bundle; +} +class genericl10n_GenericL10n extends L10n { + constructor(lang) { + super({ + lang + }); + const generateBundles = !lang ? genericl10n_GenericL10n.#generateBundlesFallback.bind(genericl10n_GenericL10n, this.getLanguage()) : genericl10n_GenericL10n.#generateBundles.bind(genericl10n_GenericL10n, "en-us", this.getLanguage()); + this._setL10n(new DOMLocalization([], generateBundles)); + } + static async *#generateBundles(defaultLang, baseLang) { + const { + baseURL, + paths + } = await this.#getPaths(); + const langs = [baseLang]; + if (defaultLang !== baseLang) { + const shortLang = baseLang.split("-", 1)[0]; + if (shortLang !== baseLang) { + langs.push(shortLang); + } + langs.push(defaultLang); + } + for (const lang of langs) { + const bundle = await this.#createBundle(lang, baseURL, paths); + if (bundle) { + yield bundle; + } else if (lang === "en-us") { + yield this.#createBundleFallback(lang); + } + } + } + static async #createBundle(lang, baseURL, paths) { + const path = paths[lang]; + if (!path) { + return null; + } + const url = new URL(path, baseURL); + const text = await fetchData(url, "text"); + return createBundle(lang, text); + } + static async #getPaths() { + try { + const { + href + } = document.querySelector(`link[type="application/l10n"]`); + const paths = await fetchData(href, "json"); + return { + baseURL: href.replace(/[^/]*$/, "") || "./", + paths + }; + } catch {} + return { + baseURL: "./", + paths: Object.create(null) + }; + } + static async *#generateBundlesFallback(lang) { + yield this.#createBundleFallback(lang); + } + static async #createBundleFallback(lang) { + const text = "pdfjs-previous-button =\n .title = Previous Page\npdfjs-previous-button-label = Previous\npdfjs-next-button =\n .title = Next Page\npdfjs-next-button-label = Next\npdfjs-page-input =\n .title = Page\npdfjs-of-pages = of { $pagesCount }\npdfjs-page-of-pages = ({ $pageNumber } of { $pagesCount })\npdfjs-zoom-out-button =\n .title = Zoom Out\npdfjs-zoom-out-button-label = Zoom Out\npdfjs-zoom-in-button =\n .title = Zoom In\npdfjs-zoom-in-button-label = Zoom In\npdfjs-zoom-select =\n .title = Zoom\npdfjs-presentation-mode-button =\n .title = Switch to Presentation Mode\npdfjs-presentation-mode-button-label = Presentation Mode\npdfjs-open-file-button =\n .title = Open File\npdfjs-open-file-button-label = Open\npdfjs-print-button =\n .title = Print\npdfjs-print-button-label = Print\npdfjs-save-button =\n .title = Save\npdfjs-save-button-label = Save\npdfjs-download-button =\n .title = Download\npdfjs-download-button-label = Download\npdfjs-bookmark-button =\n .title = Current Page (View URL from Current Page)\npdfjs-bookmark-button-label = Current Page\npdfjs-tools-button =\n .title = Tools\npdfjs-tools-button-label = Tools\npdfjs-first-page-button =\n .title = Go to First Page\npdfjs-first-page-button-label = Go to First Page\npdfjs-last-page-button =\n .title = Go to Last Page\npdfjs-last-page-button-label = Go to Last Page\npdfjs-page-rotate-cw-button =\n .title = Rotate Clockwise\npdfjs-page-rotate-cw-button-label = Rotate Clockwise\npdfjs-page-rotate-ccw-button =\n .title = Rotate Counterclockwise\npdfjs-page-rotate-ccw-button-label = Rotate Counterclockwise\npdfjs-cursor-text-select-tool-button =\n .title = Enable Text Selection Tool\npdfjs-cursor-text-select-tool-button-label = Text Selection Tool\npdfjs-cursor-hand-tool-button =\n .title = Enable Hand Tool\npdfjs-cursor-hand-tool-button-label = Hand Tool\npdfjs-scroll-page-button =\n .title = Use Page Scrolling\npdfjs-scroll-page-button-label = Page Scrolling\npdfjs-scroll-vertical-button =\n .title = Use Vertical Scrolling\npdfjs-scroll-vertical-button-label = Vertical Scrolling\npdfjs-scroll-horizontal-button =\n .title = Use Horizontal Scrolling\npdfjs-scroll-horizontal-button-label = Horizontal Scrolling\npdfjs-scroll-wrapped-button =\n .title = Use Wrapped Scrolling\npdfjs-scroll-wrapped-button-label = Wrapped Scrolling\npdfjs-spread-none-button =\n .title = Do not join page spreads\npdfjs-spread-none-button-label = No Spreads\npdfjs-spread-odd-button =\n .title = Join page spreads starting with odd-numbered pages\npdfjs-spread-odd-button-label = Odd Spreads\npdfjs-spread-even-button =\n .title = Join page spreads starting with even-numbered pages\npdfjs-spread-even-button-label = Even Spreads\npdfjs-document-properties-button =\n .title = Document Properties\u2026\npdfjs-document-properties-button-label = Document Properties\u2026\npdfjs-document-properties-file-name = File name:\npdfjs-document-properties-file-size = File size:\npdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } bytes)\npdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } bytes)\npdfjs-document-properties-title = Title:\npdfjs-document-properties-author = Author:\npdfjs-document-properties-subject = Subject:\npdfjs-document-properties-keywords = Keywords:\npdfjs-document-properties-creation-date = Creation Date:\npdfjs-document-properties-modification-date = Modification Date:\npdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: \"short\", timeStyle: \"medium\") }\npdfjs-document-properties-creator = Creator:\npdfjs-document-properties-producer = PDF Producer:\npdfjs-document-properties-version = PDF Version:\npdfjs-document-properties-page-count = Page Count:\npdfjs-document-properties-page-size = Page Size:\npdfjs-document-properties-page-size-unit-inches = in\npdfjs-document-properties-page-size-unit-millimeters = mm\npdfjs-document-properties-page-size-orientation-portrait = portrait\npdfjs-document-properties-page-size-orientation-landscape = landscape\npdfjs-document-properties-page-size-name-a-three = A3\npdfjs-document-properties-page-size-name-a-four = A4\npdfjs-document-properties-page-size-name-letter = Letter\npdfjs-document-properties-page-size-name-legal = Legal\npdfjs-document-properties-page-size-dimension-string = { $width } \xD7 { $height } { $unit } ({ $orientation })\npdfjs-document-properties-page-size-dimension-name-string = { $width } \xD7 { $height } { $unit } ({ $name }, { $orientation })\npdfjs-document-properties-linearized = Fast Web View:\npdfjs-document-properties-linearized-yes = Yes\npdfjs-document-properties-linearized-no = No\npdfjs-document-properties-close-button = Close\npdfjs-print-progress-message = Preparing document for printing\u2026\npdfjs-print-progress-percent = { $progress }%\npdfjs-print-progress-close-button = Cancel\npdfjs-printing-not-supported = Warning: Printing is not fully supported by this browser.\npdfjs-printing-not-ready = Warning: The PDF is not fully loaded for printing.\npdfjs-toggle-sidebar-button =\n .title = Toggle Sidebar\npdfjs-toggle-sidebar-notification-button =\n .title = Toggle Sidebar (document contains outline/attachments/layers)\npdfjs-toggle-sidebar-button-label = Toggle Sidebar\npdfjs-document-outline-button =\n .title = Show Document Outline (double-click to expand/collapse all items)\npdfjs-document-outline-button-label = Document Outline\npdfjs-attachments-button =\n .title = Show Attachments\npdfjs-attachments-button-label = Attachments\npdfjs-layers-button =\n .title = Show Layers (double-click to reset all layers to the default state)\npdfjs-layers-button-label = Layers\npdfjs-thumbs-button =\n .title = Show Thumbnails\npdfjs-thumbs-button-label = Thumbnails\npdfjs-current-outline-item-button =\n .title = Find Current Outline Item\npdfjs-current-outline-item-button-label = Current Outline Item\npdfjs-findbar-button =\n .title = Find in Document\npdfjs-findbar-button-label = Find\npdfjs-additional-layers = Additional Layers\npdfjs-thumb-page-title =\n .title = Page { $page }\npdfjs-thumb-page-canvas =\n .aria-label = Thumbnail of Page { $page }\npdfjs-find-input =\n .title = Find\n .placeholder = Find in document\u2026\npdfjs-find-previous-button =\n .title = Find the previous occurrence of the phrase\npdfjs-find-previous-button-label = Previous\npdfjs-find-next-button =\n .title = Find the next occurrence of the phrase\npdfjs-find-next-button-label = Next\npdfjs-find-highlight-checkbox = Highlight All\npdfjs-find-match-case-checkbox-label = Match Case\npdfjs-find-match-diacritics-checkbox-label = Match Diacritics\npdfjs-find-entire-word-checkbox-label = Whole Words\npdfjs-find-reached-top = Reached top of document, continued from bottom\npdfjs-find-reached-bottom = Reached end of document, continued from top\npdfjs-find-match-count =\n { $total ->\n [one] { $current } of { $total } match\n *[other] { $current } of { $total } matches\n }\npdfjs-find-match-count-limit =\n { $limit ->\n [one] More than { $limit } match\n *[other] More than { $limit } matches\n }\npdfjs-find-not-found = Phrase not found\npdfjs-page-scale-width = Page Width\npdfjs-page-scale-fit = Page Fit\npdfjs-page-scale-auto = Automatic Zoom\npdfjs-page-scale-actual = Actual Size\npdfjs-page-scale-percent = { $scale }%\npdfjs-page-landmark =\n .aria-label = Page { $page }\npdfjs-loading-error = An error occurred while loading the PDF.\npdfjs-invalid-file-error = Invalid or corrupted PDF file.\npdfjs-missing-file-error = Missing PDF file.\npdfjs-unexpected-response-error = Unexpected server response.\npdfjs-rendering-error = An error occurred while rendering the page.\npdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: \"short\", timeStyle: \"medium\") }\npdfjs-text-annotation-type =\n .alt = [{ $type } Annotation]\npdfjs-password-label = Enter the password to open this PDF file.\npdfjs-password-invalid = Invalid password. Please try again.\npdfjs-password-ok-button = OK\npdfjs-password-cancel-button = Cancel\npdfjs-web-fonts-disabled = Web fonts are disabled: unable to use embedded PDF fonts.\npdfjs-editor-free-text-button =\n .title = Text\npdfjs-editor-free-text-button-label = Text\npdfjs-editor-ink-button =\n .title = Draw\npdfjs-editor-ink-button-label = Draw\npdfjs-editor-stamp-button =\n .title = Add or edit images\npdfjs-editor-stamp-button-label = Add or edit images\npdfjs-editor-highlight-button =\n .title = Highlight\npdfjs-editor-highlight-button-label = Highlight\npdfjs-highlight-floating-button1 =\n .title = Highlight\n .aria-label = Highlight\npdfjs-highlight-floating-button-label = Highlight\npdfjs-editor-remove-ink-button =\n .title = Remove drawing\npdfjs-editor-remove-freetext-button =\n .title = Remove text\npdfjs-editor-remove-stamp-button =\n .title = Remove image\npdfjs-editor-remove-highlight-button =\n .title = Remove highlight\npdfjs-editor-free-text-color-input = Color\npdfjs-editor-free-text-size-input = Size\npdfjs-editor-ink-color-input = Color\npdfjs-editor-ink-thickness-input = Thickness\npdfjs-editor-ink-opacity-input = Opacity\npdfjs-editor-stamp-add-image-button =\n .title = Add image\npdfjs-editor-stamp-add-image-button-label = Add image\npdfjs-editor-free-highlight-thickness-input = Thickness\npdfjs-editor-free-highlight-thickness-title =\n .title = Change thickness when highlighting items other than text\npdfjs-free-text2 =\n .aria-label = Text Editor\n .default-content = Start typing\u2026\npdfjs-ink =\n .aria-label = Draw Editor\npdfjs-ink-canvas =\n .aria-label = User-created image\npdfjs-editor-alt-text-button =\n .aria-label = Alt text\npdfjs-editor-alt-text-button-label = Alt text\npdfjs-editor-alt-text-edit-button =\n .aria-label = Edit alt text\npdfjs-editor-alt-text-dialog-label = Choose an option\npdfjs-editor-alt-text-dialog-description = Alt text (alternative text) helps when people can\u2019t see the image or when it doesn\u2019t load.\npdfjs-editor-alt-text-add-description-label = Add a description\npdfjs-editor-alt-text-add-description-description = Aim for 1-2 sentences that describe the subject, setting, or actions.\npdfjs-editor-alt-text-mark-decorative-label = Mark as decorative\npdfjs-editor-alt-text-mark-decorative-description = This is used for ornamental images, like borders or watermarks.\npdfjs-editor-alt-text-cancel-button = Cancel\npdfjs-editor-alt-text-save-button = Save\npdfjs-editor-alt-text-decorative-tooltip = Marked as decorative\npdfjs-editor-alt-text-textarea =\n .placeholder = For example, \u201CA young man sits down at a table to eat a meal\u201D\npdfjs-editor-resizer-top-left =\n .aria-label = Top left corner \u2014 resize\npdfjs-editor-resizer-top-middle =\n .aria-label = Top middle \u2014 resize\npdfjs-editor-resizer-top-right =\n .aria-label = Top right corner \u2014 resize\npdfjs-editor-resizer-middle-right =\n .aria-label = Middle right \u2014 resize\npdfjs-editor-resizer-bottom-right =\n .aria-label = Bottom right corner \u2014 resize\npdfjs-editor-resizer-bottom-middle =\n .aria-label = Bottom middle \u2014 resize\npdfjs-editor-resizer-bottom-left =\n .aria-label = Bottom left corner \u2014 resize\npdfjs-editor-resizer-middle-left =\n .aria-label = Middle left \u2014 resize\npdfjs-editor-highlight-colorpicker-label = Highlight color\npdfjs-editor-colorpicker-button =\n .title = Change color\npdfjs-editor-colorpicker-dropdown =\n .aria-label = Color choices\npdfjs-editor-colorpicker-yellow =\n .title = Yellow\npdfjs-editor-colorpicker-green =\n .title = Green\npdfjs-editor-colorpicker-blue =\n .title = Blue\npdfjs-editor-colorpicker-pink =\n .title = Pink\npdfjs-editor-colorpicker-red =\n .title = Red\npdfjs-editor-highlight-show-all-button-label = Show all\npdfjs-editor-highlight-show-all-button =\n .title = Show all\npdfjs-editor-new-alt-text-dialog-edit-label = Edit alt text (image description)\npdfjs-editor-new-alt-text-dialog-add-label = Add alt text (image description)\npdfjs-editor-new-alt-text-textarea =\n .placeholder = Write your description here\u2026\npdfjs-editor-new-alt-text-description = Short description for people who can\u2019t see the image or when the image doesn\u2019t load.\npdfjs-editor-new-alt-text-disclaimer1 = This alt text was created automatically and may be inaccurate.\npdfjs-editor-new-alt-text-disclaimer-learn-more-url = Learn more\npdfjs-editor-new-alt-text-create-automatically-button-label = Create alt text automatically\npdfjs-editor-new-alt-text-not-now-button = Not now\npdfjs-editor-new-alt-text-error-title = Couldn\u2019t create alt text automatically\npdfjs-editor-new-alt-text-error-description = Please write your own alt text or try again later.\npdfjs-editor-new-alt-text-error-close-button = Close\npdfjs-editor-new-alt-text-ai-model-downloading-progress = Downloading alt text AI model ({ $downloadedSize } of { $totalSize } MB)\n .aria-valuetext = Downloading alt text AI model ({ $downloadedSize } of { $totalSize } MB)\npdfjs-editor-new-alt-text-added-button =\n .aria-label = Alt text added\npdfjs-editor-new-alt-text-added-button-label = Alt text added\npdfjs-editor-new-alt-text-missing-button =\n .aria-label = Missing alt text\npdfjs-editor-new-alt-text-missing-button-label = Missing alt text\npdfjs-editor-new-alt-text-to-review-button =\n .aria-label = Review alt text\npdfjs-editor-new-alt-text-to-review-button-label = Review alt text\npdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Created automatically: { $generatedAltText }\npdfjs-image-alt-text-settings-button =\n .title = Image alt text settings\npdfjs-image-alt-text-settings-button-label = Image alt text settings\npdfjs-editor-alt-text-settings-dialog-label = Image alt text settings\npdfjs-editor-alt-text-settings-automatic-title = Automatic alt text\npdfjs-editor-alt-text-settings-create-model-button-label = Create alt text automatically\npdfjs-editor-alt-text-settings-create-model-description = Suggests descriptions to help people who can\u2019t see the image or when the image doesn\u2019t load.\npdfjs-editor-alt-text-settings-download-model-label = Alt text AI model ({ $totalSize } MB)\npdfjs-editor-alt-text-settings-ai-model-description = Runs locally on your device so your data stays private. Required for automatic alt text.\npdfjs-editor-alt-text-settings-delete-model-button = Delete\npdfjs-editor-alt-text-settings-download-model-button = Download\npdfjs-editor-alt-text-settings-downloading-model-button = Downloading\u2026\npdfjs-editor-alt-text-settings-editor-title = Alt text editor\npdfjs-editor-alt-text-settings-show-dialog-button-label = Show alt text editor right away when adding an image\npdfjs-editor-alt-text-settings-show-dialog-description = Helps you make sure all your images have alt text.\npdfjs-editor-alt-text-settings-close-button = Close\npdfjs-editor-undo-bar-message-highlight = Highlight removed\npdfjs-editor-undo-bar-message-freetext = Text removed\npdfjs-editor-undo-bar-message-ink = Drawing removed\npdfjs-editor-undo-bar-message-stamp = Image removed\npdfjs-editor-undo-bar-message-multiple =\n { $count ->\n [one] { $count } annotation removed\n *[other] { $count } annotations removed\n }\npdfjs-editor-undo-bar-undo-button =\n .title = Undo\npdfjs-editor-undo-bar-undo-button-label = Undo\npdfjs-editor-undo-bar-close-button =\n .title = Close\npdfjs-editor-undo-bar-close-button-label = Close"; + return createBundle(lang, text); + } +} + +;// ./web/generic_scripting.js + +async function docProperties(pdfDocument) { + const url = "", + baseUrl = url.split("#", 1)[0]; + let { + info, + metadata, + contentDispositionFilename, + contentLength + } = await pdfDocument.getMetadata(); + if (!contentLength) { + const { + length + } = await pdfDocument.getDownloadInfo(); + contentLength = length; + } + return { + ...info, + baseURL: baseUrl, + filesize: contentLength, + filename: contentDispositionFilename || getPdfFilenameFromUrl(url), + metadata: metadata?.getRaw(), + authors: metadata?.get("dc:creator"), + numPages: pdfDocument.numPages, + URL: url + }; +} +class GenericScripting { + constructor(sandboxBundleSrc) { + this._ready = new Promise((resolve, reject) => { + const sandbox = import(/*webpackIgnore: true*/sandboxBundleSrc); + sandbox.then(pdfjsSandbox => { + resolve(pdfjsSandbox.QuickJSSandbox()); + }).catch(reject); + }); + } + async createSandbox(data) { + const sandbox = await this._ready; + sandbox.create(data); + } + async dispatchEventInSandbox(event) { + const sandbox = await this._ready; + setTimeout(() => sandbox.dispatchEvent(event), 0); + } + async destroySandbox() { + const sandbox = await this._ready; + sandbox.nukeSandbox(); + } +} + +;// ./web/genericcom.js + + + + + +function initCom(app) {} +class Preferences extends BasePreferences { + async _writeToStorage(prefObj) { + localStorage.setItem("pdfjs.preferences", JSON.stringify(prefObj)); + } + async _readFromStorage(prefObj) { + return { + prefs: JSON.parse(localStorage.getItem("pdfjs.preferences")) + }; + } +} +class ExternalServices extends BaseExternalServices { + async createL10n() { + return new genericl10n_GenericL10n(AppOptions.get("localeProperties")?.lang); + } + createScripting() { + return new GenericScripting(AppOptions.get("sandboxBundleSrc")); + } +} +class MLManager { + async isEnabledFor(_name) { + return false; + } + async deleteModel(_service) { + return null; + } + isReady(_name) { + return false; + } + guess(_data) {} + toggleService(_name, _enabled) {} + static getFakeMLManager(options) { + return new FakeMLManager(options); + } +} +class FakeMLManager { + eventBus = null; + hasProgress = false; + constructor({ + enableGuessAltText, + enableAltTextModelDownload + }) { + this.enableGuessAltText = enableGuessAltText; + this.enableAltTextModelDownload = enableAltTextModelDownload; + } + setEventBus(eventBus, abortSignal) { + this.eventBus = eventBus; + } + async isEnabledFor(_name) { + return this.enableGuessAltText; + } + async deleteModel(_name) { + this.enableAltTextModelDownload = false; + return null; + } + async loadModel(_name) {} + async downloadModel(_name) { + this.hasProgress = true; + const { + promise, + resolve + } = Promise.withResolvers(); + const total = 1e8; + const end = 1.5 * total; + const increment = 5e6; + let loaded = 0; + const id = setInterval(() => { + loaded += increment; + if (loaded <= end) { + this.eventBus.dispatch("loadaiengineprogress", { + source: this, + detail: { + total, + totalLoaded: loaded, + finished: loaded + increment >= end + } + }); + return; + } + clearInterval(id); + this.hasProgress = false; + this.enableAltTextModelDownload = true; + resolve(true); + }, 900); + return promise; + } + isReady(_name) { + return this.enableAltTextModelDownload; + } + guess({ + request: { + data + } + }) { + return new Promise(resolve => { + setTimeout(() => { + resolve(data ? { + output: "Fake alt text." + } : { + error: true + }); + }, 3000); + }); + } + toggleService(_name, enabled) { + this.enableGuessAltText = enabled; + } +} + +;// ./web/new_alt_text_manager.js + +class NewAltTextManager { + #boundCancel = this.#cancel.bind(this); + #createAutomaticallyButton; + #currentEditor = null; + #cancelButton; + #descriptionContainer; + #dialog; + #disclaimer; + #downloadModel; + #downloadModelDescription; + #eventBus; + #firstTime = false; + #guessedAltText; + #hasAI = null; + #isEditing = null; + #imagePreview; + #imageData; + #isAILoading = false; + #wasAILoading = false; + #learnMore; + #notNowButton; + #overlayManager; + #textarea; + #title; + #uiManager; + #previousAltText = null; + constructor({ + descriptionContainer, + dialog, + imagePreview, + cancelButton, + disclaimer, + notNowButton, + saveButton, + textarea, + learnMore, + errorCloseButton, + createAutomaticallyButton, + downloadModel, + downloadModelDescription, + title + }, overlayManager, eventBus) { + this.#cancelButton = cancelButton; + this.#createAutomaticallyButton = createAutomaticallyButton; + this.#descriptionContainer = descriptionContainer; + this.#dialog = dialog; + this.#disclaimer = disclaimer; + this.#notNowButton = notNowButton; + this.#imagePreview = imagePreview; + this.#textarea = textarea; + this.#learnMore = learnMore; + this.#title = title; + this.#downloadModel = downloadModel; + this.#downloadModelDescription = downloadModelDescription; + this.#overlayManager = overlayManager; + this.#eventBus = eventBus; + dialog.addEventListener("close", this.#close.bind(this)); + dialog.addEventListener("contextmenu", event => { + if (event.target !== this.#textarea) { + event.preventDefault(); + } + }); + cancelButton.addEventListener("click", this.#boundCancel); + notNowButton.addEventListener("click", this.#boundCancel); + saveButton.addEventListener("click", this.#save.bind(this)); + errorCloseButton.addEventListener("click", () => { + this.#toggleError(false); + }); + createAutomaticallyButton.addEventListener("click", async () => { + const checked = createAutomaticallyButton.getAttribute("aria-pressed") !== "true"; + this.#currentEditor._reportTelemetry({ + action: "pdfjs.image.alt_text.ai_generation_check", + data: { + status: checked + } + }); + if (this.#uiManager) { + this.#uiManager.setPreference("enableGuessAltText", checked); + await this.#uiManager.mlManager.toggleService("altText", checked); + } + this.#toggleGuessAltText(checked, false); + }); + textarea.addEventListener("focus", () => { + this.#wasAILoading = this.#isAILoading; + this.#toggleLoading(false); + this.#toggleTitleAndDisclaimer(); + }); + textarea.addEventListener("blur", () => { + if (!textarea.value) { + this.#toggleLoading(this.#wasAILoading); + } + this.#toggleTitleAndDisclaimer(); + }); + textarea.addEventListener("input", () => { + this.#toggleTitleAndDisclaimer(); + }); + eventBus._on("enableguessalttext", ({ + value + }) => { + this.#toggleGuessAltText(value, false); + }); + this.#overlayManager.register(dialog); + this.#learnMore.addEventListener("click", () => { + this.#currentEditor._reportTelemetry({ + action: "pdfjs.image.alt_text.info", + data: { + topic: "alt_text" + } + }); + }); + } + #toggleLoading(value) { + if (!this.#uiManager || this.#isAILoading === value) { + return; + } + this.#isAILoading = value; + this.#descriptionContainer.classList.toggle("loading", value); + } + #toggleError(value) { + if (!this.#uiManager) { + return; + } + this.#dialog.classList.toggle("error", value); + } + async #toggleGuessAltText(value, isInitial = false) { + if (!this.#uiManager) { + return; + } + this.#dialog.classList.toggle("aiDisabled", !value); + this.#createAutomaticallyButton.setAttribute("aria-pressed", value); + if (value) { + const { + altTextLearnMoreUrl + } = this.#uiManager.mlManager; + if (altTextLearnMoreUrl) { + this.#learnMore.href = altTextLearnMoreUrl; + } + this.#mlGuessAltText(isInitial); + } else { + this.#toggleLoading(false); + this.#isAILoading = false; + this.#toggleTitleAndDisclaimer(); + } + } + #toggleNotNow() { + this.#notNowButton.classList.toggle("hidden", !this.#firstTime); + this.#cancelButton.classList.toggle("hidden", this.#firstTime); + } + #toggleAI(value) { + if (!this.#uiManager || this.#hasAI === value) { + return; + } + this.#hasAI = value; + this.#dialog.classList.toggle("noAi", !value); + this.#toggleTitleAndDisclaimer(); + } + #toggleTitleAndDisclaimer() { + const visible = this.#isAILoading || this.#guessedAltText && this.#guessedAltText === this.#textarea.value; + this.#disclaimer.hidden = !visible; + const isEditing = this.#isAILoading || !!this.#textarea.value; + if (this.#isEditing === isEditing) { + return; + } + this.#isEditing = isEditing; + this.#title.setAttribute("data-l10n-id", isEditing ? "pdfjs-editor-new-alt-text-dialog-edit-label" : "pdfjs-editor-new-alt-text-dialog-add-label"); + } + async #mlGuessAltText(isInitial) { + if (this.#isAILoading) { + return; + } + if (this.#textarea.value) { + return; + } + if (isInitial && this.#previousAltText !== null) { + return; + } + this.#guessedAltText = this.#currentEditor.guessedAltText; + if (this.#previousAltText === null && this.#guessedAltText) { + this.#addAltText(this.#guessedAltText); + return; + } + this.#toggleLoading(true); + this.#toggleTitleAndDisclaimer(); + let hasError = false; + try { + const altText = await this.#currentEditor.mlGuessAltText(this.#imageData, false); + if (altText) { + this.#guessedAltText = altText; + this.#wasAILoading = this.#isAILoading; + if (this.#isAILoading) { + this.#addAltText(altText); + } + } + } catch (e) { + console.error(e); + hasError = true; + } + this.#toggleLoading(false); + this.#toggleTitleAndDisclaimer(); + if (hasError && this.#uiManager) { + this.#toggleError(true); + } + } + #addAltText(altText) { + if (!this.#uiManager || this.#textarea.value) { + return; + } + this.#textarea.value = altText; + this.#toggleTitleAndDisclaimer(); + } + #setProgress() { + this.#downloadModel.classList.toggle("hidden", false); + const callback = async ({ + detail: { + finished, + total, + totalLoaded + } + }) => { + const ONE_MEGA_BYTES = 1e6; + totalLoaded = Math.min(0.99 * total, totalLoaded); + const totalSize = this.#downloadModelDescription.ariaValueMax = Math.round(total / ONE_MEGA_BYTES); + const downloadedSize = this.#downloadModelDescription.ariaValueNow = Math.round(totalLoaded / ONE_MEGA_BYTES); + this.#downloadModelDescription.setAttribute("data-l10n-args", JSON.stringify({ + totalSize, + downloadedSize + })); + if (!finished) { + return; + } + this.#eventBus._off("loadaiengineprogress", callback); + this.#downloadModel.classList.toggle("hidden", true); + this.#toggleAI(true); + if (!this.#uiManager) { + return; + } + const { + mlManager + } = this.#uiManager; + mlManager.toggleService("altText", true); + this.#toggleGuessAltText(await mlManager.isEnabledFor("altText"), true); + }; + this.#eventBus._on("loadaiengineprogress", callback); + } + async editAltText(uiManager, editor, firstTime) { + if (this.#currentEditor || !editor) { + return; + } + if (firstTime && editor.hasAltTextData()) { + editor.altTextFinish(); + return; + } + this.#firstTime = firstTime; + let { + mlManager + } = uiManager; + let hasAI = !!mlManager; + this.#toggleTitleAndDisclaimer(); + if (mlManager && !mlManager.isReady("altText")) { + hasAI = false; + if (mlManager.hasProgress) { + this.#setProgress(); + } else { + mlManager = null; + } + } else { + this.#downloadModel.classList.toggle("hidden", true); + } + const isAltTextEnabledPromise = mlManager?.isEnabledFor("altText"); + this.#currentEditor = editor; + this.#uiManager = uiManager; + this.#uiManager.removeEditListeners(); + ({ + altText: this.#previousAltText + } = editor.altTextData); + this.#textarea.value = this.#previousAltText ?? ""; + const AI_MAX_IMAGE_DIMENSION = 224; + const MAX_PREVIEW_DIMENSION = 180; + let canvas, width, height; + if (mlManager) { + ({ + canvas, + width, + height, + imageData: this.#imageData + } = editor.copyCanvas(AI_MAX_IMAGE_DIMENSION, MAX_PREVIEW_DIMENSION, true)); + if (hasAI) { + this.#toggleGuessAltText(await isAltTextEnabledPromise, true); + } + } else { + ({ + canvas, + width, + height + } = editor.copyCanvas(AI_MAX_IMAGE_DIMENSION, MAX_PREVIEW_DIMENSION, false)); + } + canvas.setAttribute("role", "presentation"); + const { + style + } = canvas; + style.width = `${width}px`; + style.height = `${height}px`; + this.#imagePreview.append(canvas); + this.#toggleNotNow(); + this.#toggleAI(hasAI); + this.#toggleError(false); + try { + await this.#overlayManager.open(this.#dialog); + } catch (ex) { + this.#close(); + throw ex; + } + } + #cancel() { + this.#currentEditor.altTextData = { + cancel: true + }; + const altText = this.#textarea.value.trim(); + this.#currentEditor._reportTelemetry({ + action: "pdfjs.image.alt_text.dismiss", + data: { + alt_text_type: altText ? "present" : "empty", + flow: this.#firstTime ? "image_add" : "alt_text_edit" + } + }); + this.#currentEditor._reportTelemetry({ + action: "pdfjs.image.image_added", + data: { + alt_text_modal: true, + alt_text_type: "skipped" + } + }); + this.#finish(); + } + #finish() { + if (this.#overlayManager.active === this.#dialog) { + this.#overlayManager.close(this.#dialog); + } + } + #close() { + const canvas = this.#imagePreview.firstChild; + canvas.remove(); + canvas.width = canvas.height = 0; + this.#imageData = null; + this.#toggleLoading(false); + this.#uiManager?.addEditListeners(); + this.#currentEditor.altTextFinish(); + this.#uiManager?.setSelected(this.#currentEditor); + this.#currentEditor = null; + this.#uiManager = null; + } + #extractWords(text) { + return new Set(text.toLowerCase().split(/[^\p{L}\p{N}]+/gu).filter(x => !!x)); + } + #save() { + const altText = this.#textarea.value.trim(); + this.#currentEditor.altTextData = { + altText, + decorative: false + }; + this.#currentEditor.altTextData.guessedAltText = this.#guessedAltText; + if (this.#guessedAltText && this.#guessedAltText !== altText) { + const guessedWords = this.#extractWords(this.#guessedAltText); + const words = this.#extractWords(altText); + this.#currentEditor._reportTelemetry({ + action: "pdfjs.image.alt_text.user_edit", + data: { + total_words: guessedWords.size, + words_removed: guessedWords.difference(words).size, + words_added: words.difference(guessedWords).size + } + }); + } + this.#currentEditor._reportTelemetry({ + action: "pdfjs.image.image_added", + data: { + alt_text_modal: true, + alt_text_type: altText ? "present" : "empty" + } + }); + this.#currentEditor._reportTelemetry({ + action: "pdfjs.image.alt_text.save", + data: { + alt_text_type: altText ? "present" : "empty", + flow: this.#firstTime ? "image_add" : "alt_text_edit" + } + }); + this.#finish(); + } + destroy() { + this.#uiManager = null; + this.#finish(); + } +} +class ImageAltTextSettings { + #aiModelSettings; + #createModelButton; + #downloadModelButton; + #dialog; + #eventBus; + #mlManager; + #overlayManager; + #showAltTextDialogButton; + constructor({ + dialog, + createModelButton, + aiModelSettings, + learnMore, + closeButton, + deleteModelButton, + downloadModelButton, + showAltTextDialogButton + }, overlayManager, eventBus, mlManager) { + this.#dialog = dialog; + this.#aiModelSettings = aiModelSettings; + this.#createModelButton = createModelButton; + this.#downloadModelButton = downloadModelButton; + this.#showAltTextDialogButton = showAltTextDialogButton; + this.#overlayManager = overlayManager; + this.#eventBus = eventBus; + this.#mlManager = mlManager; + const { + altTextLearnMoreUrl + } = mlManager; + if (altTextLearnMoreUrl) { + learnMore.href = altTextLearnMoreUrl; + } + dialog.addEventListener("contextmenu", noContextMenu); + createModelButton.addEventListener("click", async e => { + const checked = this.#togglePref("enableGuessAltText", e); + await mlManager.toggleService("altText", checked); + this.#reportTelemetry({ + type: "stamp", + action: "pdfjs.image.alt_text.settings_ai_generation_check", + data: { + status: checked + } + }); + }); + showAltTextDialogButton.addEventListener("click", e => { + const checked = this.#togglePref("enableNewAltTextWhenAddingImage", e); + this.#reportTelemetry({ + type: "stamp", + action: "pdfjs.image.alt_text.settings_edit_alt_text_check", + data: { + status: checked + } + }); + }); + deleteModelButton.addEventListener("click", this.#delete.bind(this, true)); + downloadModelButton.addEventListener("click", this.#download.bind(this, true)); + closeButton.addEventListener("click", this.#finish.bind(this)); + learnMore.addEventListener("click", () => { + this.#reportTelemetry({ + type: "stamp", + action: "pdfjs.image.alt_text.info", + data: { + topic: "ai_generation" + } + }); + }); + eventBus._on("enablealttextmodeldownload", ({ + value + }) => { + if (value) { + this.#download(false); + } else { + this.#delete(false); + } + }); + this.#overlayManager.register(dialog); + } + #reportTelemetry(data) { + this.#eventBus.dispatch("reporttelemetry", { + source: this, + details: { + type: "editing", + data + } + }); + } + async #download(isFromUI = false) { + if (isFromUI) { + this.#downloadModelButton.disabled = true; + const span = this.#downloadModelButton.firstChild; + span.setAttribute("data-l10n-id", "pdfjs-editor-alt-text-settings-downloading-model-button"); + await this.#mlManager.downloadModel("altText"); + span.setAttribute("data-l10n-id", "pdfjs-editor-alt-text-settings-download-model-button"); + this.#createModelButton.disabled = false; + this.#setPref("enableGuessAltText", true); + this.#mlManager.toggleService("altText", true); + this.#setPref("enableAltTextModelDownload", true); + this.#downloadModelButton.disabled = false; + } + this.#aiModelSettings.classList.toggle("download", false); + this.#createModelButton.setAttribute("aria-pressed", true); + } + async #delete(isFromUI = false) { + if (isFromUI) { + await this.#mlManager.deleteModel("altText"); + this.#setPref("enableGuessAltText", false); + this.#setPref("enableAltTextModelDownload", false); + } + this.#aiModelSettings.classList.toggle("download", true); + this.#createModelButton.disabled = true; + this.#createModelButton.setAttribute("aria-pressed", false); + } + async open({ + enableGuessAltText, + enableNewAltTextWhenAddingImage + }) { + const { + enableAltTextModelDownload + } = this.#mlManager; + this.#createModelButton.disabled = !enableAltTextModelDownload; + this.#createModelButton.setAttribute("aria-pressed", enableAltTextModelDownload && enableGuessAltText); + this.#showAltTextDialogButton.setAttribute("aria-pressed", enableNewAltTextWhenAddingImage); + this.#aiModelSettings.classList.toggle("download", !enableAltTextModelDownload); + await this.#overlayManager.open(this.#dialog); + this.#reportTelemetry({ + type: "stamp", + action: "pdfjs.image.alt_text.settings_displayed" + }); + } + #togglePref(name, { + target + }) { + const checked = target.getAttribute("aria-pressed") !== "true"; + this.#setPref(name, checked); + target.setAttribute("aria-pressed", checked); + return checked; + } + #setPref(name, value) { + this.#eventBus.dispatch("setpreference", { + source: this, + name, + value + }); + } + #finish() { + if (this.#overlayManager.active === this.#dialog) { + this.#overlayManager.close(this.#dialog); + } + } +} + +;// ./web/alt_text_manager.js + +class AltTextManager { + #clickAC = null; + #currentEditor = null; + #cancelButton; + #dialog; + #eventBus; + #hasUsedPointer = false; + #optionDescription; + #optionDecorative; + #overlayManager; + #saveButton; + #textarea; + #uiManager; + #previousAltText = null; + #resizeAC = null; + #svgElement = null; + #rectElement = null; + #container; + #telemetryData = null; + constructor({ + dialog, + optionDescription, + optionDecorative, + textarea, + cancelButton, + saveButton + }, container, overlayManager, eventBus) { + this.#dialog = dialog; + this.#optionDescription = optionDescription; + this.#optionDecorative = optionDecorative; + this.#textarea = textarea; + this.#cancelButton = cancelButton; + this.#saveButton = saveButton; + this.#overlayManager = overlayManager; + this.#eventBus = eventBus; + this.#container = container; + const onUpdateUIState = this.#updateUIState.bind(this); + dialog.addEventListener("close", this.#close.bind(this)); + dialog.addEventListener("contextmenu", event => { + if (event.target !== this.#textarea) { + event.preventDefault(); + } + }); + cancelButton.addEventListener("click", this.#finish.bind(this)); + saveButton.addEventListener("click", this.#save.bind(this)); + optionDescription.addEventListener("change", onUpdateUIState); + optionDecorative.addEventListener("change", onUpdateUIState); + this.#overlayManager.register(dialog); + } + #createSVGElement() { + if (this.#svgElement) { + return; + } + const svgFactory = new DOMSVGFactory(); + const svg = this.#svgElement = svgFactory.createElement("svg"); + svg.setAttribute("width", "0"); + svg.setAttribute("height", "0"); + const defs = svgFactory.createElement("defs"); + svg.append(defs); + const mask = svgFactory.createElement("mask"); + defs.append(mask); + mask.setAttribute("id", "alttext-manager-mask"); + mask.setAttribute("maskContentUnits", "objectBoundingBox"); + let rect = svgFactory.createElement("rect"); + mask.append(rect); + rect.setAttribute("fill", "white"); + rect.setAttribute("width", "1"); + rect.setAttribute("height", "1"); + rect.setAttribute("x", "0"); + rect.setAttribute("y", "0"); + rect = this.#rectElement = svgFactory.createElement("rect"); + mask.append(rect); + rect.setAttribute("fill", "black"); + this.#dialog.append(svg); + } + async editAltText(uiManager, editor) { + if (this.#currentEditor || !editor) { + return; + } + this.#createSVGElement(); + this.#hasUsedPointer = false; + this.#clickAC = new AbortController(); + const clickOpts = { + signal: this.#clickAC.signal + }, + onClick = this.#onClick.bind(this); + for (const element of [this.#optionDescription, this.#optionDecorative, this.#textarea, this.#saveButton, this.#cancelButton]) { + element.addEventListener("click", onClick, clickOpts); + } + const { + altText, + decorative + } = editor.altTextData; + if (decorative === true) { + this.#optionDecorative.checked = true; + this.#optionDescription.checked = false; + } else { + this.#optionDecorative.checked = false; + this.#optionDescription.checked = true; + } + this.#previousAltText = this.#textarea.value = altText?.trim() || ""; + this.#updateUIState(); + this.#currentEditor = editor; + this.#uiManager = uiManager; + this.#uiManager.removeEditListeners(); + this.#resizeAC = new AbortController(); + this.#eventBus._on("resize", this.#setPosition.bind(this), { + signal: this.#resizeAC.signal + }); + try { + await this.#overlayManager.open(this.#dialog); + this.#setPosition(); + } catch (ex) { + this.#close(); + throw ex; + } + } + #setPosition() { + if (!this.#currentEditor) { + return; + } + const dialog = this.#dialog; + const { + style + } = dialog; + const { + x: containerX, + y: containerY, + width: containerW, + height: containerH + } = this.#container.getBoundingClientRect(); + const { + innerWidth: windowW, + innerHeight: windowH + } = window; + const { + width: dialogW, + height: dialogH + } = dialog.getBoundingClientRect(); + const { + x, + y, + width, + height + } = this.#currentEditor.getClientDimensions(); + const MARGIN = 10; + const isLTR = this.#uiManager.direction === "ltr"; + const xs = Math.max(x, containerX); + const xe = Math.min(x + width, containerX + containerW); + const ys = Math.max(y, containerY); + const ye = Math.min(y + height, containerY + containerH); + this.#rectElement.setAttribute("width", `${(xe - xs) / windowW}`); + this.#rectElement.setAttribute("height", `${(ye - ys) / windowH}`); + this.#rectElement.setAttribute("x", `${xs / windowW}`); + this.#rectElement.setAttribute("y", `${ys / windowH}`); + let left = null; + let top = Math.max(y, 0); + top += Math.min(windowH - (top + dialogH), 0); + if (isLTR) { + if (x + width + MARGIN + dialogW < windowW) { + left = x + width + MARGIN; + } else if (x > dialogW + MARGIN) { + left = x - dialogW - MARGIN; + } + } else if (x > dialogW + MARGIN) { + left = x - dialogW - MARGIN; + } else if (x + width + MARGIN + dialogW < windowW) { + left = x + width + MARGIN; + } + if (left === null) { + top = null; + left = Math.max(x, 0); + left += Math.min(windowW - (left + dialogW), 0); + if (y > dialogH + MARGIN) { + top = y - dialogH - MARGIN; + } else if (y + height + MARGIN + dialogH < windowH) { + top = y + height + MARGIN; + } + } + if (top !== null) { + dialog.classList.add("positioned"); + if (isLTR) { + style.left = `${left}px`; + } else { + style.right = `${windowW - left - dialogW}px`; + } + style.top = `${top}px`; + } else { + dialog.classList.remove("positioned"); + style.left = ""; + style.top = ""; + } + } + #finish() { + if (this.#overlayManager.active === this.#dialog) { + this.#overlayManager.close(this.#dialog); + } + } + #close() { + this.#currentEditor._reportTelemetry(this.#telemetryData || { + action: "alt_text_cancel", + alt_text_keyboard: !this.#hasUsedPointer + }); + this.#telemetryData = null; + this.#removeOnClickListeners(); + this.#uiManager?.addEditListeners(); + this.#resizeAC?.abort(); + this.#resizeAC = null; + this.#currentEditor.altTextFinish(); + this.#currentEditor = null; + this.#uiManager = null; + } + #updateUIState() { + this.#textarea.disabled = this.#optionDecorative.checked; + } + #save() { + const altText = this.#textarea.value.trim(); + const decorative = this.#optionDecorative.checked; + this.#currentEditor.altTextData = { + altText, + decorative + }; + this.#telemetryData = { + action: "alt_text_save", + alt_text_description: !!altText, + alt_text_edit: !!this.#previousAltText && this.#previousAltText !== altText, + alt_text_decorative: decorative, + alt_text_keyboard: !this.#hasUsedPointer + }; + this.#finish(); + } + #onClick(evt) { + if (evt.detail === 0) { + return; + } + this.#hasUsedPointer = true; + this.#removeOnClickListeners(); + } + #removeOnClickListeners() { + this.#clickAC?.abort(); + this.#clickAC = null; + } + destroy() { + this.#uiManager = null; + this.#finish(); + this.#svgElement?.remove(); + this.#svgElement = this.#rectElement = null; + } +} + +;// ./web/annotation_editor_params.js + +class AnnotationEditorParams { + constructor(options, eventBus) { + this.eventBus = eventBus; + this.#bindListeners(options); + } + #bindListeners({ + editorFreeTextFontSize, + editorFreeTextColor, + editorInkColor, + editorInkThickness, + editorInkOpacity, + editorStampAddImage, + editorFreeHighlightThickness, + editorHighlightShowAll + }) { + const dispatchEvent = (typeStr, value) => { + this.eventBus.dispatch("switchannotationeditorparams", { + source: this, + type: AnnotationEditorParamsType[typeStr], + value + }); + }; + editorFreeTextFontSize.addEventListener("input", function () { + dispatchEvent("FREETEXT_SIZE", this.valueAsNumber); + }); + editorFreeTextColor.addEventListener("input", function () { + dispatchEvent("FREETEXT_COLOR", this.value); + }); + editorInkColor.addEventListener("input", function () { + dispatchEvent("INK_COLOR", this.value); + }); + editorInkThickness.addEventListener("input", function () { + dispatchEvent("INK_THICKNESS", this.valueAsNumber); + }); + editorInkOpacity.addEventListener("input", function () { + dispatchEvent("INK_OPACITY", this.valueAsNumber); + }); + editorStampAddImage.addEventListener("click", () => { + this.eventBus.dispatch("reporttelemetry", { + source: this, + details: { + type: "editing", + data: { + action: "pdfjs.image.add_image_click" + } + } + }); + dispatchEvent("CREATE"); + }); + editorFreeHighlightThickness.addEventListener("input", function () { + dispatchEvent("HIGHLIGHT_THICKNESS", this.valueAsNumber); + }); + editorHighlightShowAll.addEventListener("click", function () { + const checked = this.getAttribute("aria-pressed") === "true"; + this.setAttribute("aria-pressed", !checked); + dispatchEvent("HIGHLIGHT_SHOW_ALL", !checked); + }); + this.eventBus._on("annotationeditorparamschanged", evt => { + for (const [type, value] of evt.details) { + switch (type) { + case AnnotationEditorParamsType.FREETEXT_SIZE: + editorFreeTextFontSize.value = value; + break; + case AnnotationEditorParamsType.FREETEXT_COLOR: + editorFreeTextColor.value = value; + break; + case AnnotationEditorParamsType.INK_COLOR: + editorInkColor.value = value; + break; + case AnnotationEditorParamsType.INK_THICKNESS: + editorInkThickness.value = value; + break; + case AnnotationEditorParamsType.INK_OPACITY: + editorInkOpacity.value = value; + break; + case AnnotationEditorParamsType.HIGHLIGHT_THICKNESS: + editorFreeHighlightThickness.value = value; + break; + case AnnotationEditorParamsType.HIGHLIGHT_FREE: + editorFreeHighlightThickness.disabled = !value; + break; + case AnnotationEditorParamsType.HIGHLIGHT_SHOW_ALL: + editorHighlightShowAll.setAttribute("aria-pressed", value); + break; + } + } + }); + } +} + +;// ./web/caret_browsing.js +const PRECISION = 1e-1; +class CaretBrowsingMode { + #mainContainer; + #toolBarHeight = 0; + #viewerContainer; + constructor(abortSignal, mainContainer, viewerContainer, toolbarContainer) { + this.#mainContainer = mainContainer; + this.#viewerContainer = viewerContainer; + if (!toolbarContainer) { + return; + } + this.#toolBarHeight = toolbarContainer.getBoundingClientRect().height; + const toolbarObserver = new ResizeObserver(entries => { + for (const entry of entries) { + if (entry.target === toolbarContainer) { + this.#toolBarHeight = Math.floor(entry.borderBoxSize[0].blockSize); + break; + } + } + }); + toolbarObserver.observe(toolbarContainer); + abortSignal.addEventListener("abort", () => toolbarObserver.disconnect(), { + once: true + }); + } + #isOnSameLine(rect1, rect2) { + const top1 = rect1.y; + const bot1 = rect1.bottom; + const mid1 = rect1.y + rect1.height / 2; + const top2 = rect2.y; + const bot2 = rect2.bottom; + const mid2 = rect2.y + rect2.height / 2; + return top1 <= mid2 && mid2 <= bot1 || top2 <= mid1 && mid1 <= bot2; + } + #isUnderOver(rect, x, y, isUp) { + const midY = rect.y + rect.height / 2; + return (isUp ? y >= midY : y <= midY) && rect.x - PRECISION <= x && x <= rect.right + PRECISION; + } + #isVisible(rect) { + return rect.top >= this.#toolBarHeight && rect.left >= 0 && rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && rect.right <= (window.innerWidth || document.documentElement.clientWidth); + } + #getCaretPosition(selection, isUp) { + const { + focusNode, + focusOffset + } = selection; + const range = document.createRange(); + range.setStart(focusNode, focusOffset); + range.setEnd(focusNode, focusOffset); + const rect = range.getBoundingClientRect(); + return [rect.x, isUp ? rect.top : rect.bottom]; + } + static #caretPositionFromPoint(x, y) { + if (!document.caretPositionFromPoint) { + const { + startContainer: offsetNode, + startOffset: offset + } = document.caretRangeFromPoint(x, y); + return { + offsetNode, + offset + }; + } + return document.caretPositionFromPoint(x, y); + } + #setCaretPositionHelper(selection, caretX, select, element, rect) { + rect ||= element.getBoundingClientRect(); + if (caretX <= rect.x + PRECISION) { + if (select) { + selection.extend(element.firstChild, 0); + } else { + selection.setPosition(element.firstChild, 0); + } + return; + } + if (rect.right - PRECISION <= caretX) { + const { + lastChild + } = element; + if (select) { + selection.extend(lastChild, lastChild.length); + } else { + selection.setPosition(lastChild, lastChild.length); + } + return; + } + const midY = rect.y + rect.height / 2; + let caretPosition = CaretBrowsingMode.#caretPositionFromPoint(caretX, midY); + let parentElement = caretPosition.offsetNode?.parentElement; + if (parentElement && parentElement !== element) { + const elementsAtPoint = document.elementsFromPoint(caretX, midY); + const savedVisibilities = []; + for (const el of elementsAtPoint) { + if (el === element) { + break; + } + const { + style + } = el; + savedVisibilities.push([el, style.visibility]); + style.visibility = "hidden"; + } + caretPosition = CaretBrowsingMode.#caretPositionFromPoint(caretX, midY); + parentElement = caretPosition.offsetNode?.parentElement; + for (const [el, visibility] of savedVisibilities) { + el.style.visibility = visibility; + } + } + if (parentElement !== element) { + if (select) { + selection.extend(element.firstChild, 0); + } else { + selection.setPosition(element.firstChild, 0); + } + return; + } + if (select) { + selection.extend(caretPosition.offsetNode, caretPosition.offset); + } else { + selection.setPosition(caretPosition.offsetNode, caretPosition.offset); + } + } + #setCaretPosition(select, selection, newLineElement, newLineElementRect, caretX) { + if (this.#isVisible(newLineElementRect)) { + this.#setCaretPositionHelper(selection, caretX, select, newLineElement, newLineElementRect); + return; + } + this.#mainContainer.addEventListener("scrollend", this.#setCaretPositionHelper.bind(this, selection, caretX, select, newLineElement, null), { + once: true + }); + newLineElement.scrollIntoView(); + } + #getNodeOnNextPage(textLayer, isUp) { + while (true) { + const page = textLayer.closest(".page"); + const pageNumber = parseInt(page.getAttribute("data-page-number")); + const nextPage = isUp ? pageNumber - 1 : pageNumber + 1; + textLayer = this.#viewerContainer.querySelector(`.page[data-page-number="${nextPage}"] .textLayer`); + if (!textLayer) { + return null; + } + const walker = document.createTreeWalker(textLayer, NodeFilter.SHOW_TEXT); + const node = isUp ? walker.lastChild() : walker.firstChild(); + if (node) { + return node; + } + } + } + moveCaret(isUp, select) { + const selection = document.getSelection(); + if (selection.rangeCount === 0) { + return; + } + const { + focusNode + } = selection; + const focusElement = focusNode.nodeType !== Node.ELEMENT_NODE ? focusNode.parentElement : focusNode; + const root = focusElement.closest(".textLayer"); + if (!root) { + return; + } + const walker = document.createTreeWalker(root, NodeFilter.SHOW_TEXT); + walker.currentNode = focusNode; + const focusRect = focusElement.getBoundingClientRect(); + let newLineElement = null; + const nodeIterator = (isUp ? walker.previousSibling : walker.nextSibling).bind(walker); + while (nodeIterator()) { + const element = walker.currentNode.parentElement; + if (!this.#isOnSameLine(focusRect, element.getBoundingClientRect())) { + newLineElement = element; + break; + } + } + if (!newLineElement) { + const node = this.#getNodeOnNextPage(root, isUp); + if (!node) { + return; + } + if (select) { + const lastNode = (isUp ? walker.firstChild() : walker.lastChild()) || focusNode; + selection.extend(lastNode, isUp ? 0 : lastNode.length); + const range = document.createRange(); + range.setStart(node, isUp ? node.length : 0); + range.setEnd(node, isUp ? node.length : 0); + selection.addRange(range); + return; + } + const [caretX] = this.#getCaretPosition(selection, isUp); + const { + parentElement + } = node; + this.#setCaretPosition(select, selection, parentElement, parentElement.getBoundingClientRect(), caretX); + return; + } + const [caretX, caretY] = this.#getCaretPosition(selection, isUp); + const newLineElementRect = newLineElement.getBoundingClientRect(); + if (this.#isUnderOver(newLineElementRect, caretX, caretY, isUp)) { + this.#setCaretPosition(select, selection, newLineElement, newLineElementRect, caretX); + return; + } + while (nodeIterator()) { + const element = walker.currentNode.parentElement; + const elementRect = element.getBoundingClientRect(); + if (!this.#isOnSameLine(newLineElementRect, elementRect)) { + break; + } + if (this.#isUnderOver(elementRect, caretX, caretY, isUp)) { + this.#setCaretPosition(select, selection, element, elementRect, caretX); + return; + } + } + this.#setCaretPosition(select, selection, newLineElement, newLineElementRect, caretX); + } +} + +;// ./web/download_manager.js + +function download(blobUrl, filename) { + const a = document.createElement("a"); + if (!a.click) { + throw new Error('DownloadManager: "a.click()" is not supported.'); + } + a.href = blobUrl; + a.target = "_parent"; + if ("download" in a) { + a.download = filename; + } + (document.body || document.documentElement).append(a); + a.click(); + a.remove(); +} +class DownloadManager { + #openBlobUrls = new WeakMap(); + downloadData(data, filename, contentType) { + const blobUrl = URL.createObjectURL(new Blob([data], { + type: contentType + })); + download(blobUrl, filename); + } + openOrDownloadData(data, filename, dest = null) { + const isPdfData = isPdfFile(filename); + const contentType = isPdfData ? "application/pdf" : ""; + if (isPdfData) { + let blobUrl = this.#openBlobUrls.get(data); + if (!blobUrl) { + blobUrl = URL.createObjectURL(new Blob([data], { + type: contentType + })); + this.#openBlobUrls.set(data, blobUrl); + } + let viewerUrl; + viewerUrl = "?file=" + encodeURIComponent(blobUrl + "#" + filename); + if (dest) { + viewerUrl += `#${escape(dest)}`; + } + try { + window.open(viewerUrl); + return true; + } catch (ex) { + console.error("openOrDownloadData:", ex); + URL.revokeObjectURL(blobUrl); + this.#openBlobUrls.delete(data); + } + } + this.downloadData(data, filename, contentType); + return false; + } + download(data, url, filename) { + let blobUrl; + if (data) { + blobUrl = URL.createObjectURL(new Blob([data], { + type: "application/pdf" + })); + } else { + if (!createValidAbsoluteUrl(url, "http://example.com")) { + console.error(`download - not a valid URL: ${url}`); + return; + } + blobUrl = url + "#pdfjs.action=download"; + } + download(blobUrl, filename); + } +} + +;// ./web/editor_undo_bar.js + +class EditorUndoBar { + #closeButton = null; + #container; + #eventBus = null; + #focusTimeout = null; + #initController = null; + isOpen = false; + #message; + #showController = null; + #undoButton; + static #l10nMessages = Object.freeze({ + highlight: "pdfjs-editor-undo-bar-message-highlight", + freetext: "pdfjs-editor-undo-bar-message-freetext", + stamp: "pdfjs-editor-undo-bar-message-stamp", + ink: "pdfjs-editor-undo-bar-message-ink", + _multiple: "pdfjs-editor-undo-bar-message-multiple" + }); + constructor({ + container, + message, + undoButton, + closeButton + }, eventBus) { + this.#container = container; + this.#message = message; + this.#undoButton = undoButton; + this.#closeButton = closeButton; + this.#eventBus = eventBus; + } + destroy() { + this.#initController?.abort(); + this.#initController = null; + this.hide(); + } + show(undoAction, messageData) { + if (!this.#initController) { + this.#initController = new AbortController(); + const opts = { + signal: this.#initController.signal + }; + const boundHide = this.hide.bind(this); + this.#container.addEventListener("contextmenu", noContextMenu, opts); + this.#closeButton.addEventListener("click", boundHide, opts); + this.#eventBus._on("beforeprint", boundHide, opts); + this.#eventBus._on("download", boundHide, opts); + } + this.hide(); + if (typeof messageData === "string") { + this.#message.setAttribute("data-l10n-id", EditorUndoBar.#l10nMessages[messageData]); + } else { + this.#message.setAttribute("data-l10n-id", EditorUndoBar.#l10nMessages._multiple); + this.#message.setAttribute("data-l10n-args", JSON.stringify({ + count: messageData + })); + } + this.isOpen = true; + this.#container.hidden = false; + this.#showController = new AbortController(); + this.#undoButton.addEventListener("click", () => { + undoAction(); + this.hide(); + }, { + signal: this.#showController.signal + }); + this.#focusTimeout = setTimeout(() => { + this.#container.focus(); + this.#focusTimeout = null; + }, 100); + } + hide() { + if (!this.isOpen) { + return; + } + this.isOpen = false; + this.#container.hidden = true; + this.#showController?.abort(); + this.#showController = null; + if (this.#focusTimeout) { + clearTimeout(this.#focusTimeout); + this.#focusTimeout = null; + } + } +} + +;// ./web/overlay_manager.js +class OverlayManager { + #overlays = new WeakMap(); + #active = null; + get active() { + return this.#active; + } + async register(dialog, canForceClose = false) { + if (typeof dialog !== "object") { + throw new Error("Not enough parameters."); + } else if (this.#overlays.has(dialog)) { + throw new Error("The overlay is already registered."); + } + this.#overlays.set(dialog, { + canForceClose + }); + dialog.addEventListener("cancel", evt => { + this.#active = null; + }); + } + async open(dialog) { + if (!this.#overlays.has(dialog)) { + throw new Error("The overlay does not exist."); + } else if (this.#active) { + if (this.#active === dialog) { + throw new Error("The overlay is already active."); + } else if (this.#overlays.get(dialog).canForceClose) { + await this.close(); + } else { + throw new Error("Another overlay is currently active."); + } + } + this.#active = dialog; + dialog.showModal(); + } + async close(dialog = this.#active) { + if (!this.#overlays.has(dialog)) { + throw new Error("The overlay does not exist."); + } else if (!this.#active) { + throw new Error("The overlay is currently not active."); + } else if (this.#active !== dialog) { + throw new Error("Another overlay is currently active."); + } + dialog.close(); + this.#active = null; + } +} + +;// ./web/password_prompt.js + +class PasswordPrompt { + #activeCapability = null; + #updateCallback = null; + #reason = null; + constructor(options, overlayManager, isViewerEmbedded = false) { + this.dialog = options.dialog; + this.label = options.label; + this.input = options.input; + this.submitButton = options.submitButton; + this.cancelButton = options.cancelButton; + this.overlayManager = overlayManager; + this._isViewerEmbedded = isViewerEmbedded; + this.submitButton.addEventListener("click", this.#verify.bind(this)); + this.cancelButton.addEventListener("click", this.close.bind(this)); + this.input.addEventListener("keydown", e => { + if (e.keyCode === 13) { + this.#verify(); + } + }); + this.overlayManager.register(this.dialog, true); + this.dialog.addEventListener("close", this.#cancel.bind(this)); + } + async open() { + await this.#activeCapability?.promise; + this.#activeCapability = Promise.withResolvers(); + try { + await this.overlayManager.open(this.dialog); + } catch (ex) { + this.#activeCapability.resolve(); + throw ex; + } + const passwordIncorrect = this.#reason === PasswordResponses.INCORRECT_PASSWORD; + if (!this._isViewerEmbedded || passwordIncorrect) { + this.input.focus(); + } + this.label.setAttribute("data-l10n-id", passwordIncorrect ? "pdfjs-password-invalid" : "pdfjs-password-label"); + } + async close() { + if (this.overlayManager.active === this.dialog) { + this.overlayManager.close(this.dialog); + } + } + #verify() { + const password = this.input.value; + if (password?.length > 0) { + this.#invokeCallback(password); + } + } + #cancel() { + this.#invokeCallback(new Error("PasswordPrompt cancelled.")); + this.#activeCapability.resolve(); + } + #invokeCallback(password) { + if (!this.#updateCallback) { + return; + } + this.close(); + this.input.value = ""; + this.#updateCallback(password); + this.#updateCallback = null; + } + async setUpdateCallback(updateCallback, reason) { + if (this.#activeCapability) { + await this.#activeCapability.promise; + } + this.#updateCallback = updateCallback; + this.#reason = reason; + } +} + +;// ./web/base_tree_viewer.js + +const TREEITEM_OFFSET_TOP = -100; +const TREEITEM_SELECTED_CLASS = "selected"; +class BaseTreeViewer { + constructor(options) { + this.container = options.container; + this.eventBus = options.eventBus; + this._l10n = options.l10n; + this.reset(); + } + reset() { + this._pdfDocument = null; + this._lastToggleIsShow = true; + this._currentTreeItem = null; + this.container.textContent = ""; + this.container.classList.remove("treeWithDeepNesting"); + } + _dispatchEvent(count) { + throw new Error("Not implemented: _dispatchEvent"); + } + _bindLink(element, params) { + throw new Error("Not implemented: _bindLink"); + } + _normalizeTextContent(str) { + return removeNullCharacters(str, true) || "\u2013"; + } + _addToggleButton(div, hidden = false) { + const toggler = document.createElement("div"); + toggler.className = "treeItemToggler"; + if (hidden) { + toggler.classList.add("treeItemsHidden"); + } + toggler.onclick = evt => { + evt.stopPropagation(); + toggler.classList.toggle("treeItemsHidden"); + if (evt.shiftKey) { + const shouldShowAll = !toggler.classList.contains("treeItemsHidden"); + this._toggleTreeItem(div, shouldShowAll); + } + }; + div.prepend(toggler); + } + _toggleTreeItem(root, show = false) { + this._l10n.pause(); + this._lastToggleIsShow = show; + for (const toggler of root.querySelectorAll(".treeItemToggler")) { + toggler.classList.toggle("treeItemsHidden", !show); + } + this._l10n.resume(); + } + _toggleAllTreeItems() { + this._toggleTreeItem(this.container, !this._lastToggleIsShow); + } + _finishRendering(fragment, count, hasAnyNesting = false) { + if (hasAnyNesting) { + this.container.classList.add("treeWithDeepNesting"); + this._lastToggleIsShow = !fragment.querySelector(".treeItemsHidden"); + } + this._l10n.pause(); + this.container.append(fragment); + this._l10n.resume(); + this._dispatchEvent(count); + } + render(params) { + throw new Error("Not implemented: render"); + } + _updateCurrentTreeItem(treeItem = null) { + if (this._currentTreeItem) { + this._currentTreeItem.classList.remove(TREEITEM_SELECTED_CLASS); + this._currentTreeItem = null; + } + if (treeItem) { + treeItem.classList.add(TREEITEM_SELECTED_CLASS); + this._currentTreeItem = treeItem; + } + } + _scrollToCurrentTreeItem(treeItem) { + if (!treeItem) { + return; + } + this._l10n.pause(); + let currentNode = treeItem.parentNode; + while (currentNode && currentNode !== this.container) { + if (currentNode.classList.contains("treeItem")) { + const toggler = currentNode.firstElementChild; + toggler?.classList.remove("treeItemsHidden"); + } + currentNode = currentNode.parentNode; + } + this._l10n.resume(); + this._updateCurrentTreeItem(treeItem); + this.container.scrollTo(treeItem.offsetLeft, treeItem.offsetTop + TREEITEM_OFFSET_TOP); + } +} + +;// ./web/pdf_attachment_viewer.js + + +class PDFAttachmentViewer extends BaseTreeViewer { + constructor(options) { + super(options); + this.downloadManager = options.downloadManager; + this.eventBus._on("fileattachmentannotation", this.#appendAttachment.bind(this)); + } + reset(keepRenderedCapability = false) { + super.reset(); + this._attachments = null; + if (!keepRenderedCapability) { + this._renderedCapability = Promise.withResolvers(); + } + this._pendingDispatchEvent = false; + } + async _dispatchEvent(attachmentsCount) { + this._renderedCapability.resolve(); + if (attachmentsCount === 0 && !this._pendingDispatchEvent) { + this._pendingDispatchEvent = true; + await waitOnEventOrTimeout({ + target: this.eventBus, + name: "annotationlayerrendered", + delay: 1000 + }); + if (!this._pendingDispatchEvent) { + return; + } + } + this._pendingDispatchEvent = false; + this.eventBus.dispatch("attachmentsloaded", { + source: this, + attachmentsCount + }); + } + _bindLink(element, { + content, + description, + filename + }) { + if (description) { + element.title = description; + } + element.onclick = () => { + this.downloadManager.openOrDownloadData(content, filename); + return false; + }; + } + render({ + attachments, + keepRenderedCapability = false + }) { + if (this._attachments) { + this.reset(keepRenderedCapability); + } + this._attachments = attachments || null; + if (!attachments) { + this._dispatchEvent(0); + return; + } + const fragment = document.createDocumentFragment(); + let attachmentsCount = 0; + for (const name in attachments) { + const item = attachments[name]; + const div = document.createElement("div"); + div.className = "treeItem"; + const element = document.createElement("a"); + this._bindLink(element, item); + element.textContent = this._normalizeTextContent(item.filename); + div.append(element); + fragment.append(div); + attachmentsCount++; + } + this._finishRendering(fragment, attachmentsCount); + } + #appendAttachment(item) { + const renderedPromise = this._renderedCapability.promise; + renderedPromise.then(() => { + if (renderedPromise !== this._renderedCapability.promise) { + return; + } + const attachments = this._attachments || Object.create(null); + for (const name in attachments) { + if (item.filename === name) { + return; + } + } + attachments[item.filename] = item; + this.render({ + attachments, + keepRenderedCapability: true + }); + }); + } +} + +;// ./web/grab_to_pan.js + +const CSS_CLASS_GRAB = "grab-to-pan-grab"; +class GrabToPan { + #activateAC = null; + #mouseDownAC = null; + #scrollAC = null; + constructor({ + element + }) { + this.element = element; + this.document = element.ownerDocument; + const overlay = this.overlay = document.createElement("div"); + overlay.className = "grab-to-pan-grabbing"; + } + activate() { + if (!this.#activateAC) { + this.#activateAC = new AbortController(); + this.element.addEventListener("mousedown", this.#onMouseDown.bind(this), { + capture: true, + signal: this.#activateAC.signal + }); + this.element.classList.add(CSS_CLASS_GRAB); + } + } + deactivate() { + if (this.#activateAC) { + this.#activateAC.abort(); + this.#activateAC = null; + this.#endPan(); + this.element.classList.remove(CSS_CLASS_GRAB); + } + } + toggle() { + if (this.#activateAC) { + this.deactivate(); + } else { + this.activate(); + } + } + ignoreTarget(node) { + return node.matches("a[href], a[href] *, input, textarea, button, button *, select, option"); + } + #onMouseDown(event) { + if (event.button !== 0 || this.ignoreTarget(event.target)) { + return; + } + if (event.originalTarget) { + try { + event.originalTarget.tagName; + } catch { + return; + } + } + this.scrollLeftStart = this.element.scrollLeft; + this.scrollTopStart = this.element.scrollTop; + this.clientXStart = event.clientX; + this.clientYStart = event.clientY; + this.#mouseDownAC = new AbortController(); + const boundEndPan = this.#endPan.bind(this), + mouseOpts = { + capture: true, + signal: this.#mouseDownAC.signal + }; + this.document.addEventListener("mousemove", this.#onMouseMove.bind(this), mouseOpts); + this.document.addEventListener("mouseup", boundEndPan, mouseOpts); + this.#scrollAC = new AbortController(); + this.element.addEventListener("scroll", boundEndPan, { + capture: true, + signal: this.#scrollAC.signal + }); + stopEvent(event); + const focusedElement = document.activeElement; + if (focusedElement && !focusedElement.contains(event.target)) { + focusedElement.blur(); + } + } + #onMouseMove(event) { + this.#scrollAC?.abort(); + this.#scrollAC = null; + if (!(event.buttons & 1)) { + this.#endPan(); + return; + } + const xDiff = event.clientX - this.clientXStart; + const yDiff = event.clientY - this.clientYStart; + this.element.scrollTo({ + top: this.scrollTopStart - yDiff, + left: this.scrollLeftStart - xDiff, + behavior: "instant" + }); + if (!this.overlay.parentNode) { + document.body.append(this.overlay); + } + } + #endPan() { + this.#mouseDownAC?.abort(); + this.#mouseDownAC = null; + this.#scrollAC?.abort(); + this.#scrollAC = null; + this.overlay.remove(); + } +} + +;// ./web/pdf_cursor_tools.js + + + +class PDFCursorTools { + #active = CursorTool.SELECT; + #prevActive = null; + constructor({ + container, + eventBus, + cursorToolOnLoad = CursorTool.SELECT + }) { + this.container = container; + this.eventBus = eventBus; + this.#addEventListeners(); + Promise.resolve().then(() => { + this.switchTool(cursorToolOnLoad); + }); + } + get activeTool() { + return this.#active; + } + switchTool(tool) { + if (this.#prevActive !== null) { + return; + } + this.#switchTool(tool); + } + #switchTool(tool, disabled = false) { + if (tool === this.#active) { + if (this.#prevActive !== null) { + this.eventBus.dispatch("cursortoolchanged", { + source: this, + tool, + disabled + }); + } + return; + } + const disableActiveTool = () => { + switch (this.#active) { + case CursorTool.SELECT: + break; + case CursorTool.HAND: + this._handTool.deactivate(); + break; + case CursorTool.ZOOM: + } + }; + switch (tool) { + case CursorTool.SELECT: + disableActiveTool(); + break; + case CursorTool.HAND: + disableActiveTool(); + this._handTool.activate(); + break; + case CursorTool.ZOOM: + default: + console.error(`switchTool: "${tool}" is an unsupported value.`); + return; + } + this.#active = tool; + this.eventBus.dispatch("cursortoolchanged", { + source: this, + tool, + disabled + }); + } + #addEventListeners() { + this.eventBus._on("switchcursortool", evt => { + if (!evt.reset) { + this.switchTool(evt.tool); + } else if (this.#prevActive !== null) { + annotationEditorMode = AnnotationEditorType.NONE; + presentationModeState = PresentationModeState.NORMAL; + enableActive(); + } + }); + let annotationEditorMode = AnnotationEditorType.NONE, + presentationModeState = PresentationModeState.NORMAL; + const disableActive = () => { + this.#prevActive ??= this.#active; + this.#switchTool(CursorTool.SELECT, true); + }; + const enableActive = () => { + if (this.#prevActive !== null && annotationEditorMode === AnnotationEditorType.NONE && presentationModeState === PresentationModeState.NORMAL) { + this.#switchTool(this.#prevActive); + this.#prevActive = null; + } + }; + this.eventBus._on("annotationeditormodechanged", ({ + mode + }) => { + annotationEditorMode = mode; + if (mode === AnnotationEditorType.NONE) { + enableActive(); + } else { + disableActive(); + } + }); + this.eventBus._on("presentationmodechanged", ({ + state + }) => { + presentationModeState = state; + if (state === PresentationModeState.NORMAL) { + enableActive(); + } else if (state === PresentationModeState.FULLSCREEN) { + disableActive(); + } + }); + } + get _handTool() { + return shadow(this, "_handTool", new GrabToPan({ + element: this.container + })); + } +} + +;// ./web/pdf_document_properties.js + + +const NON_METRIC_LOCALES = ["en-us", "en-lr", "my"]; +const US_PAGE_NAMES = { + "8.5x11": "pdfjs-document-properties-page-size-name-letter", + "8.5x14": "pdfjs-document-properties-page-size-name-legal" +}; +const METRIC_PAGE_NAMES = { + "297x420": "pdfjs-document-properties-page-size-name-a-three", + "210x297": "pdfjs-document-properties-page-size-name-a-four" +}; +function getPageName(size, isPortrait, pageNames) { + const width = isPortrait ? size.width : size.height; + const height = isPortrait ? size.height : size.width; + return pageNames[`${width}x${height}`]; +} +class PDFDocumentProperties { + #fieldData = null; + constructor({ + dialog, + fields, + closeButton + }, overlayManager, eventBus, l10n, fileNameLookup) { + this.dialog = dialog; + this.fields = fields; + this.overlayManager = overlayManager; + this.l10n = l10n; + this._fileNameLookup = fileNameLookup; + this.#reset(); + closeButton.addEventListener("click", this.close.bind(this)); + this.overlayManager.register(this.dialog); + eventBus._on("pagechanging", evt => { + this._currentPageNumber = evt.pageNumber; + }); + eventBus._on("rotationchanging", evt => { + this._pagesRotation = evt.pagesRotation; + }); + } + async open() { + await Promise.all([this.overlayManager.open(this.dialog), this._dataAvailableCapability.promise]); + const currentPageNumber = this._currentPageNumber; + const pagesRotation = this._pagesRotation; + if (this.#fieldData && currentPageNumber === this.#fieldData._currentPageNumber && pagesRotation === this.#fieldData._pagesRotation) { + this.#updateUI(); + return; + } + const [{ + info, + contentLength + }, pdfPage] = await Promise.all([this.pdfDocument.getMetadata(), this.pdfDocument.getPage(currentPageNumber)]); + const [fileName, fileSize, creationDate, modificationDate, pageSize, isLinearized] = await Promise.all([this._fileNameLookup(), this.#parseFileSize(contentLength), this.#parseDate(info.CreationDate), this.#parseDate(info.ModDate), this.#parsePageSize(getPageSizeInches(pdfPage), pagesRotation), this.#parseLinearization(info.IsLinearized)]); + this.#fieldData = Object.freeze({ + fileName, + fileSize, + title: info.Title, + author: info.Author, + subject: info.Subject, + keywords: info.Keywords, + creationDate, + modificationDate, + creator: info.Creator, + producer: info.Producer, + version: info.PDFFormatVersion, + pageCount: this.pdfDocument.numPages, + pageSize, + linearized: isLinearized, + _currentPageNumber: currentPageNumber, + _pagesRotation: pagesRotation + }); + this.#updateUI(); + const { + length + } = await this.pdfDocument.getDownloadInfo(); + if (contentLength === length) { + return; + } + const data = Object.assign(Object.create(null), this.#fieldData); + data.fileSize = await this.#parseFileSize(length); + this.#fieldData = Object.freeze(data); + this.#updateUI(); + } + async close() { + this.overlayManager.close(this.dialog); + } + setDocument(pdfDocument) { + if (this.pdfDocument) { + this.#reset(); + this.#updateUI(); + } + if (!pdfDocument) { + return; + } + this.pdfDocument = pdfDocument; + this._dataAvailableCapability.resolve(); + } + #reset() { + this.pdfDocument = null; + this.#fieldData = null; + this._dataAvailableCapability = Promise.withResolvers(); + this._currentPageNumber = 1; + this._pagesRotation = 0; + } + #updateUI() { + if (this.#fieldData && this.overlayManager.active !== this.dialog) { + return; + } + for (const id in this.fields) { + const content = this.#fieldData?.[id]; + this.fields[id].textContent = content || content === 0 ? content : "-"; + } + } + async #parseFileSize(b = 0) { + const kb = b / 1024, + mb = kb / 1024; + return kb ? this.l10n.get(mb >= 1 ? "pdfjs-document-properties-size-mb" : "pdfjs-document-properties-size-kb", { + mb, + kb, + b + }) : undefined; + } + async #parsePageSize(pageSizeInches, pagesRotation) { + if (!pageSizeInches) { + return undefined; + } + if (pagesRotation % 180 !== 0) { + pageSizeInches = { + width: pageSizeInches.height, + height: pageSizeInches.width + }; + } + const isPortrait = isPortraitOrientation(pageSizeInches), + nonMetric = NON_METRIC_LOCALES.includes(this.l10n.getLanguage()); + let sizeInches = { + width: Math.round(pageSizeInches.width * 100) / 100, + height: Math.round(pageSizeInches.height * 100) / 100 + }; + let sizeMillimeters = { + width: Math.round(pageSizeInches.width * 25.4 * 10) / 10, + height: Math.round(pageSizeInches.height * 25.4 * 10) / 10 + }; + let nameId = getPageName(sizeInches, isPortrait, US_PAGE_NAMES) || getPageName(sizeMillimeters, isPortrait, METRIC_PAGE_NAMES); + if (!nameId && !(Number.isInteger(sizeMillimeters.width) && Number.isInteger(sizeMillimeters.height))) { + const exactMillimeters = { + width: pageSizeInches.width * 25.4, + height: pageSizeInches.height * 25.4 + }; + const intMillimeters = { + width: Math.round(sizeMillimeters.width), + height: Math.round(sizeMillimeters.height) + }; + if (Math.abs(exactMillimeters.width - intMillimeters.width) < 0.1 && Math.abs(exactMillimeters.height - intMillimeters.height) < 0.1) { + nameId = getPageName(intMillimeters, isPortrait, METRIC_PAGE_NAMES); + if (nameId) { + sizeInches = { + width: Math.round(intMillimeters.width / 25.4 * 100) / 100, + height: Math.round(intMillimeters.height / 25.4 * 100) / 100 + }; + sizeMillimeters = intMillimeters; + } + } + } + const [{ + width, + height + }, unit, name, orientation] = await Promise.all([nonMetric ? sizeInches : sizeMillimeters, this.l10n.get(nonMetric ? "pdfjs-document-properties-page-size-unit-inches" : "pdfjs-document-properties-page-size-unit-millimeters"), nameId && this.l10n.get(nameId), this.l10n.get(isPortrait ? "pdfjs-document-properties-page-size-orientation-portrait" : "pdfjs-document-properties-page-size-orientation-landscape")]); + return this.l10n.get(name ? "pdfjs-document-properties-page-size-dimension-name-string" : "pdfjs-document-properties-page-size-dimension-string", { + width, + height, + unit, + name, + orientation + }); + } + async #parseDate(inputDate) { + const dateObj = PDFDateString.toDateObject(inputDate); + return dateObj ? this.l10n.get("pdfjs-document-properties-date-time-string", { + dateObj: dateObj.valueOf() + }) : undefined; + } + #parseLinearization(isLinearized) { + return this.l10n.get(isLinearized ? "pdfjs-document-properties-linearized-yes" : "pdfjs-document-properties-linearized-no"); + } +} + +;// ./web/pdf_find_utils.js +const CharacterType = { + SPACE: 0, + ALPHA_LETTER: 1, + PUNCT: 2, + HAN_LETTER: 3, + KATAKANA_LETTER: 4, + HIRAGANA_LETTER: 5, + HALFWIDTH_KATAKANA_LETTER: 6, + THAI_LETTER: 7 +}; +function isAlphabeticalScript(charCode) { + return charCode < 0x2e80; +} +function isAscii(charCode) { + return (charCode & 0xff80) === 0; +} +function isAsciiAlpha(charCode) { + return charCode >= 0x61 && charCode <= 0x7a || charCode >= 0x41 && charCode <= 0x5a; +} +function isAsciiDigit(charCode) { + return charCode >= 0x30 && charCode <= 0x39; +} +function isAsciiSpace(charCode) { + return charCode === 0x20 || charCode === 0x09 || charCode === 0x0d || charCode === 0x0a; +} +function isHan(charCode) { + return charCode >= 0x3400 && charCode <= 0x9fff || charCode >= 0xf900 && charCode <= 0xfaff; +} +function isKatakana(charCode) { + return charCode >= 0x30a0 && charCode <= 0x30ff; +} +function isHiragana(charCode) { + return charCode >= 0x3040 && charCode <= 0x309f; +} +function isHalfwidthKatakana(charCode) { + return charCode >= 0xff60 && charCode <= 0xff9f; +} +function isThai(charCode) { + return (charCode & 0xff80) === 0x0e00; +} +function getCharacterType(charCode) { + if (isAlphabeticalScript(charCode)) { + if (isAscii(charCode)) { + if (isAsciiSpace(charCode)) { + return CharacterType.SPACE; + } else if (isAsciiAlpha(charCode) || isAsciiDigit(charCode) || charCode === 0x5f) { + return CharacterType.ALPHA_LETTER; + } + return CharacterType.PUNCT; + } else if (isThai(charCode)) { + return CharacterType.THAI_LETTER; + } else if (charCode === 0xa0) { + return CharacterType.SPACE; + } + return CharacterType.ALPHA_LETTER; + } + if (isHan(charCode)) { + return CharacterType.HAN_LETTER; + } else if (isKatakana(charCode)) { + return CharacterType.KATAKANA_LETTER; + } else if (isHiragana(charCode)) { + return CharacterType.HIRAGANA_LETTER; + } else if (isHalfwidthKatakana(charCode)) { + return CharacterType.HALFWIDTH_KATAKANA_LETTER; + } + return CharacterType.ALPHA_LETTER; +} +let NormalizeWithNFKC; +function getNormalizeWithNFKC() { + NormalizeWithNFKC ||= ` ¨ª¯²-µ¸-º¼-¾IJ-ijĿ-ŀʼnſDŽ-njDZ-dzʰ-ʸ˘-˝ˠ-ˤʹͺ;΄-΅·ϐ-ϖϰ-ϲϴ-ϵϹևٵ-ٸक़-य़ড়-ঢ়য়ਲ਼ਸ਼ਖ਼-ਜ਼ਫ਼ଡ଼-ଢ଼ำຳໜ-ໝ༌གྷཌྷདྷབྷཛྷཀྵჼᴬ-ᴮᴰ-ᴺᴼ-ᵍᵏ-ᵪᵸᶛ-ᶿẚ-ẛάέήίόύώΆ᾽-῁ΈΉ῍-῏ΐΊ῝-῟ΰΎ῭-`ΌΏ´-῾ - ‑‗․-… ″-‴‶-‷‼‾⁇-⁉⁗ ⁰-ⁱ⁴-₎ₐ-ₜ₨℀-℃℅-ℇ℉-ℓℕ-№ℙ-ℝ℠-™ℤΩℨK-ℭℯ-ℱℳ-ℹ℻-⅀ⅅ-ⅉ⅐-ⅿ↉∬-∭∯-∰〈-〉①-⓪⨌⩴-⩶⫝̸ⱼ-ⱽⵯ⺟⻳⼀-⿕ 〶〸-〺゛-゜ゟヿㄱ-ㆎ㆒-㆟㈀-㈞㈠-㉇㉐-㉾㊀-㏿ꚜ-ꚝꝰꟲ-ꟴꟸ-ꟹꭜ-ꭟꭩ豈-嗀塚晴凞-羽蘒諸逸-都飯-舘並-龎ff-stﬓ-ﬗיִײַ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-﷼︐-︙︰-﹄﹇-﹒﹔-﹦﹨-﹫ﹰ-ﹲﹴﹶ-ﻼ!-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ¢-₩`; + return NormalizeWithNFKC; +} + +;// ./web/pdf_find_controller.js + + +const FindState = { + FOUND: 0, + NOT_FOUND: 1, + WRAPPED: 2, + PENDING: 3 +}; +const FIND_TIMEOUT = 250; +const MATCH_SCROLL_OFFSET_TOP = -50; +const MATCH_SCROLL_OFFSET_LEFT = -400; +const CHARACTERS_TO_NORMALIZE = { + "\u2010": "-", + "\u2018": "'", + "\u2019": "'", + "\u201A": "'", + "\u201B": "'", + "\u201C": '"', + "\u201D": '"', + "\u201E": '"', + "\u201F": '"', + "\u00BC": "1/4", + "\u00BD": "1/2", + "\u00BE": "3/4" +}; +const DIACRITICS_EXCEPTION = new Set([0x3099, 0x309a, 0x094d, 0x09cd, 0x0a4d, 0x0acd, 0x0b4d, 0x0bcd, 0x0c4d, 0x0ccd, 0x0d3b, 0x0d3c, 0x0d4d, 0x0dca, 0x0e3a, 0x0eba, 0x0f84, 0x1039, 0x103a, 0x1714, 0x1734, 0x17d2, 0x1a60, 0x1b44, 0x1baa, 0x1bab, 0x1bf2, 0x1bf3, 0x2d7f, 0xa806, 0xa82c, 0xa8c4, 0xa953, 0xa9c0, 0xaaf6, 0xabed, 0x0c56, 0x0f71, 0x0f72, 0x0f7a, 0x0f7b, 0x0f7c, 0x0f7d, 0x0f80, 0x0f74]); +let DIACRITICS_EXCEPTION_STR; +const DIACRITICS_REG_EXP = /\p{M}+/gu; +const SPECIAL_CHARS_REG_EXP = /([.*+?^${}()|[\]\\])|(\p{P})|(\s+)|(\p{M})|(\p{L})/gu; +const NOT_DIACRITIC_FROM_END_REG_EXP = /([^\p{M}])\p{M}*$/u; +const NOT_DIACRITIC_FROM_START_REG_EXP = /^\p{M}*([^\p{M}])/u; +const SYLLABLES_REG_EXP = /[\uAC00-\uD7AF\uFA6C\uFACF-\uFAD1\uFAD5-\uFAD7]+/g; +const SYLLABLES_LENGTHS = new Map(); +const FIRST_CHAR_SYLLABLES_REG_EXP = "[\\u1100-\\u1112\\ud7a4-\\ud7af\\ud84a\\ud84c\\ud850\\ud854\\ud857\\ud85f]"; +const NFKC_CHARS_TO_NORMALIZE = new Map(); +let noSyllablesRegExp = null; +let withSyllablesRegExp = null; +function normalize(text) { + const syllablePositions = []; + let m; + while ((m = SYLLABLES_REG_EXP.exec(text)) !== null) { + let { + index + } = m; + for (const char of m[0]) { + let len = SYLLABLES_LENGTHS.get(char); + if (!len) { + len = char.normalize("NFD").length; + SYLLABLES_LENGTHS.set(char, len); + } + syllablePositions.push([len, index++]); + } + } + let normalizationRegex; + if (syllablePositions.length === 0 && noSyllablesRegExp) { + normalizationRegex = noSyllablesRegExp; + } else if (syllablePositions.length > 0 && withSyllablesRegExp) { + normalizationRegex = withSyllablesRegExp; + } else { + const replace = Object.keys(CHARACTERS_TO_NORMALIZE).join(""); + const toNormalizeWithNFKC = getNormalizeWithNFKC(); + const CJK = "(?:\\p{Ideographic}|[\u3040-\u30FF])"; + const HKDiacritics = "(?:\u3099|\u309A)"; + const CompoundWord = "\\p{Ll}-\\n\\p{Lu}"; + const regexp = `([${replace}])|([${toNormalizeWithNFKC}])|(${HKDiacritics}\\n)|(\\p{M}+(?:-\\n)?)|(${CompoundWord})|(\\S-\\n)|(${CJK}\\n)|(\\n)`; + if (syllablePositions.length === 0) { + normalizationRegex = noSyllablesRegExp = new RegExp(regexp + "|(\\u0000)", "gum"); + } else { + normalizationRegex = withSyllablesRegExp = new RegExp(regexp + `|(${FIRST_CHAR_SYLLABLES_REG_EXP})`, "gum"); + } + } + const rawDiacriticsPositions = []; + while ((m = DIACRITICS_REG_EXP.exec(text)) !== null) { + rawDiacriticsPositions.push([m[0].length, m.index]); + } + let normalized = text.normalize("NFD"); + const positions = [0, 0]; + let rawDiacriticsIndex = 0; + let syllableIndex = 0; + let shift = 0; + let shiftOrigin = 0; + let eol = 0; + let hasDiacritics = false; + normalized = normalized.replace(normalizationRegex, (match, p1, p2, p3, p4, p5, p6, p7, p8, p9, i) => { + i -= shiftOrigin; + if (p1) { + const replacement = CHARACTERS_TO_NORMALIZE[p1]; + const jj = replacement.length; + for (let j = 1; j < jj; j++) { + positions.push(i - shift + j, shift - j); + } + shift -= jj - 1; + return replacement; + } + if (p2) { + let replacement = NFKC_CHARS_TO_NORMALIZE.get(p2); + if (!replacement) { + replacement = p2.normalize("NFKC"); + NFKC_CHARS_TO_NORMALIZE.set(p2, replacement); + } + const jj = replacement.length; + for (let j = 1; j < jj; j++) { + positions.push(i - shift + j, shift - j); + } + shift -= jj - 1; + return replacement; + } + if (p3) { + hasDiacritics = true; + if (i + eol === rawDiacriticsPositions[rawDiacriticsIndex]?.[1]) { + ++rawDiacriticsIndex; + } else { + positions.push(i - 1 - shift + 1, shift - 1); + shift -= 1; + shiftOrigin += 1; + } + positions.push(i - shift + 1, shift); + shiftOrigin += 1; + eol += 1; + return p3.charAt(0); + } + if (p4) { + const hasTrailingDashEOL = p4.endsWith("\n"); + const len = hasTrailingDashEOL ? p4.length - 2 : p4.length; + hasDiacritics = true; + let jj = len; + if (i + eol === rawDiacriticsPositions[rawDiacriticsIndex]?.[1]) { + jj -= rawDiacriticsPositions[rawDiacriticsIndex][0]; + ++rawDiacriticsIndex; + } + for (let j = 1; j <= jj; j++) { + positions.push(i - 1 - shift + j, shift - j); + } + shift -= jj; + shiftOrigin += jj; + if (hasTrailingDashEOL) { + i += len - 1; + positions.push(i - shift + 1, 1 + shift); + shift += 1; + shiftOrigin += 1; + eol += 1; + return p4.slice(0, len); + } + return p4; + } + if (p5) { + shiftOrigin += 1; + eol += 1; + return p5.replace("\n", ""); + } + if (p6) { + const len = p6.length - 2; + positions.push(i - shift + len, 1 + shift); + shift += 1; + shiftOrigin += 1; + eol += 1; + return p6.slice(0, -2); + } + if (p7) { + const len = p7.length - 1; + positions.push(i - shift + len, shift); + shiftOrigin += 1; + eol += 1; + return p7.slice(0, -1); + } + if (p8) { + positions.push(i - shift + 1, shift - 1); + shift -= 1; + shiftOrigin += 1; + eol += 1; + return " "; + } + if (i + eol === syllablePositions[syllableIndex]?.[1]) { + const newCharLen = syllablePositions[syllableIndex][0] - 1; + ++syllableIndex; + for (let j = 1; j <= newCharLen; j++) { + positions.push(i - (shift - j), shift - j); + } + shift -= newCharLen; + shiftOrigin += newCharLen; + } + return p9; + }); + positions.push(normalized.length, shift); + const starts = new Uint32Array(positions.length >> 1); + const shifts = new Int32Array(positions.length >> 1); + for (let i = 0, ii = positions.length; i < ii; i += 2) { + starts[i >> 1] = positions[i]; + shifts[i >> 1] = positions[i + 1]; + } + return [normalized, [starts, shifts], hasDiacritics]; +} +function getOriginalIndex(diffs, pos, len) { + if (!diffs) { + return [pos, len]; + } + const [starts, shifts] = diffs; + const start = pos; + const end = pos + len - 1; + let i = binarySearchFirstItem(starts, x => x >= start); + if (starts[i] > start) { + --i; + } + let j = binarySearchFirstItem(starts, x => x >= end, i); + if (starts[j] > end) { + --j; + } + const oldStart = start + shifts[i]; + const oldEnd = end + shifts[j]; + const oldLen = oldEnd + 1 - oldStart; + return [oldStart, oldLen]; +} +class PDFFindController { + #state = null; + #updateMatchesCountOnProgress = true; + #visitedPagesCount = 0; + constructor({ + linkService, + eventBus, + updateMatchesCountOnProgress = true + }) { + this._linkService = linkService; + this._eventBus = eventBus; + this.#updateMatchesCountOnProgress = updateMatchesCountOnProgress; + this.onIsPageVisible = null; + this.#reset(); + eventBus._on("find", this.#onFind.bind(this)); + eventBus._on("findbarclose", this.#onFindBarClose.bind(this)); + } + get highlightMatches() { + return this._highlightMatches; + } + get pageMatches() { + return this._pageMatches; + } + get pageMatchesLength() { + return this._pageMatchesLength; + } + get selected() { + return this._selected; + } + get state() { + return this.#state; + } + setDocument(pdfDocument) { + if (this._pdfDocument) { + this.#reset(); + } + if (!pdfDocument) { + return; + } + this._pdfDocument = pdfDocument; + this._firstPageCapability.resolve(); + } + #onFind(state) { + if (!state) { + return; + } + const pdfDocument = this._pdfDocument; + const { + type + } = state; + if (this.#state === null || this.#shouldDirtyMatch(state)) { + this._dirtyMatch = true; + } + this.#state = state; + if (type !== "highlightallchange") { + this.#updateUIState(FindState.PENDING); + } + this._firstPageCapability.promise.then(() => { + if (!this._pdfDocument || pdfDocument && this._pdfDocument !== pdfDocument) { + return; + } + this.#extractText(); + const findbarClosed = !this._highlightMatches; + const pendingTimeout = !!this._findTimeout; + if (this._findTimeout) { + clearTimeout(this._findTimeout); + this._findTimeout = null; + } + if (!type) { + this._findTimeout = setTimeout(() => { + this.#nextMatch(); + this._findTimeout = null; + }, FIND_TIMEOUT); + } else if (this._dirtyMatch) { + this.#nextMatch(); + } else if (type === "again") { + this.#nextMatch(); + if (findbarClosed && this.#state.highlightAll) { + this.#updateAllPages(); + } + } else if (type === "highlightallchange") { + if (pendingTimeout) { + this.#nextMatch(); + } else { + this._highlightMatches = true; + } + this.#updateAllPages(); + } else { + this.#nextMatch(); + } + }); + } + scrollMatchIntoView({ + element = null, + selectedLeft = 0, + pageIndex = -1, + matchIndex = -1 + }) { + if (!this._scrollMatches || !element) { + return; + } else if (matchIndex === -1 || matchIndex !== this._selected.matchIdx) { + return; + } else if (pageIndex === -1 || pageIndex !== this._selected.pageIdx) { + return; + } + this._scrollMatches = false; + const spot = { + top: MATCH_SCROLL_OFFSET_TOP, + left: selectedLeft + MATCH_SCROLL_OFFSET_LEFT + }; + scrollIntoView(element, spot, true); + } + #reset() { + this._highlightMatches = false; + this._scrollMatches = false; + this._pdfDocument = null; + this._pageMatches = []; + this._pageMatchesLength = []; + this.#visitedPagesCount = 0; + this.#state = null; + this._selected = { + pageIdx: -1, + matchIdx: -1 + }; + this._offset = { + pageIdx: null, + matchIdx: null, + wrapped: false + }; + this._extractTextPromises = []; + this._pageContents = []; + this._pageDiffs = []; + this._hasDiacritics = []; + this._matchesCountTotal = 0; + this._pagesToSearch = null; + this._pendingFindMatches = new Set(); + this._resumePageIdx = null; + this._dirtyMatch = false; + clearTimeout(this._findTimeout); + this._findTimeout = null; + this._firstPageCapability = Promise.withResolvers(); + } + get #query() { + const { + query + } = this.#state; + if (typeof query === "string") { + if (query !== this._rawQuery) { + this._rawQuery = query; + [this._normalizedQuery] = normalize(query); + } + return this._normalizedQuery; + } + return (query || []).filter(q => !!q).map(q => normalize(q)[0]); + } + #shouldDirtyMatch(state) { + const newQuery = state.query, + prevQuery = this.#state.query; + const newType = typeof newQuery, + prevType = typeof prevQuery; + if (newType !== prevType) { + return true; + } + if (newType === "string") { + if (newQuery !== prevQuery) { + return true; + } + } else if (JSON.stringify(newQuery) !== JSON.stringify(prevQuery)) { + return true; + } + switch (state.type) { + case "again": + const pageNumber = this._selected.pageIdx + 1; + const linkService = this._linkService; + return pageNumber >= 1 && pageNumber <= linkService.pagesCount && pageNumber !== linkService.page && !(this.onIsPageVisible?.(pageNumber) ?? true); + case "highlightallchange": + return false; + } + return true; + } + #isEntireWord(content, startIdx, length) { + let match = content.slice(0, startIdx).match(NOT_DIACRITIC_FROM_END_REG_EXP); + if (match) { + const first = content.charCodeAt(startIdx); + const limit = match[1].charCodeAt(0); + if (getCharacterType(first) === getCharacterType(limit)) { + return false; + } + } + match = content.slice(startIdx + length).match(NOT_DIACRITIC_FROM_START_REG_EXP); + if (match) { + const last = content.charCodeAt(startIdx + length - 1); + const limit = match[1].charCodeAt(0); + if (getCharacterType(last) === getCharacterType(limit)) { + return false; + } + } + return true; + } + #convertToRegExpString(query, hasDiacritics) { + const { + matchDiacritics + } = this.#state; + let isUnicode = false; + query = query.replaceAll(SPECIAL_CHARS_REG_EXP, (match, p1, p2, p3, p4, p5) => { + if (p1) { + return `[ ]*\\${p1}[ ]*`; + } + if (p2) { + return `[ ]*${p2}[ ]*`; + } + if (p3) { + return "[ ]+"; + } + if (matchDiacritics) { + return p4 || p5; + } + if (p4) { + return DIACRITICS_EXCEPTION.has(p4.charCodeAt(0)) ? p4 : ""; + } + if (hasDiacritics) { + isUnicode = true; + return `${p5}\\p{M}*`; + } + return p5; + }); + const trailingSpaces = "[ ]*"; + if (query.endsWith(trailingSpaces)) { + query = query.slice(0, query.length - trailingSpaces.length); + } + if (matchDiacritics) { + if (hasDiacritics) { + DIACRITICS_EXCEPTION_STR ||= String.fromCharCode(...DIACRITICS_EXCEPTION); + isUnicode = true; + query = `${query}(?=[${DIACRITICS_EXCEPTION_STR}]|[^\\p{M}]|$)`; + } + } + return [isUnicode, query]; + } + #calculateMatch(pageIndex) { + const query = this.#query; + if (query.length === 0) { + return; + } + const pageContent = this._pageContents[pageIndex]; + const matcherResult = this.match(query, pageContent, pageIndex); + const matches = this._pageMatches[pageIndex] = []; + const matchesLength = this._pageMatchesLength[pageIndex] = []; + const diffs = this._pageDiffs[pageIndex]; + matcherResult?.forEach(({ + index, + length + }) => { + const [matchPos, matchLen] = getOriginalIndex(diffs, index, length); + if (matchLen) { + matches.push(matchPos); + matchesLength.push(matchLen); + } + }); + if (this.#state.highlightAll) { + this.#updatePage(pageIndex); + } + if (this._resumePageIdx === pageIndex) { + this._resumePageIdx = null; + this.#nextPageMatch(); + } + const pageMatchesCount = matches.length; + this._matchesCountTotal += pageMatchesCount; + if (this.#updateMatchesCountOnProgress) { + if (pageMatchesCount > 0) { + this.#updateUIResultsCount(); + } + } else if (++this.#visitedPagesCount === this._linkService.pagesCount) { + this.#updateUIResultsCount(); + } + } + match(query, pageContent, pageIndex) { + const hasDiacritics = this._hasDiacritics[pageIndex]; + let isUnicode = false; + if (typeof query === "string") { + [isUnicode, query] = this.#convertToRegExpString(query, hasDiacritics); + } else { + query = query.sort().reverse().map(q => { + const [isUnicodePart, queryPart] = this.#convertToRegExpString(q, hasDiacritics); + isUnicode ||= isUnicodePart; + return `(${queryPart})`; + }).join("|"); + } + if (!query) { + return undefined; + } + const { + caseSensitive, + entireWord + } = this.#state; + const flags = `g${isUnicode ? "u" : ""}${caseSensitive ? "" : "i"}`; + query = new RegExp(query, flags); + const matches = []; + let match; + while ((match = query.exec(pageContent)) !== null) { + if (entireWord && !this.#isEntireWord(pageContent, match.index, match[0].length)) { + continue; + } + matches.push({ + index: match.index, + length: match[0].length + }); + } + return matches; + } + #extractText() { + if (this._extractTextPromises.length > 0) { + return; + } + let deferred = Promise.resolve(); + const textOptions = { + disableNormalization: true + }; + for (let i = 0, ii = this._linkService.pagesCount; i < ii; i++) { + const { + promise, + resolve + } = Promise.withResolvers(); + this._extractTextPromises[i] = promise; + deferred = deferred.then(() => { + return this._pdfDocument.getPage(i + 1).then(pdfPage => pdfPage.getTextContent(textOptions)).then(textContent => { + const strBuf = []; + for (const textItem of textContent.items) { + strBuf.push(textItem.str); + if (textItem.hasEOL) { + strBuf.push("\n"); + } + } + [this._pageContents[i], this._pageDiffs[i], this._hasDiacritics[i]] = normalize(strBuf.join("")); + resolve(); + }, reason => { + console.error(`Unable to get text content for page ${i + 1}`, reason); + this._pageContents[i] = ""; + this._pageDiffs[i] = null; + this._hasDiacritics[i] = false; + resolve(); + }); + }); + } + } + #updatePage(index) { + if (this._scrollMatches && this._selected.pageIdx === index) { + this._linkService.page = index + 1; + } + this._eventBus.dispatch("updatetextlayermatches", { + source: this, + pageIndex: index + }); + } + #updateAllPages() { + this._eventBus.dispatch("updatetextlayermatches", { + source: this, + pageIndex: -1 + }); + } + #nextMatch() { + const previous = this.#state.findPrevious; + const currentPageIndex = this._linkService.page - 1; + const numPages = this._linkService.pagesCount; + this._highlightMatches = true; + if (this._dirtyMatch) { + this._dirtyMatch = false; + this._selected.pageIdx = this._selected.matchIdx = -1; + this._offset.pageIdx = currentPageIndex; + this._offset.matchIdx = null; + this._offset.wrapped = false; + this._resumePageIdx = null; + this._pageMatches.length = 0; + this._pageMatchesLength.length = 0; + this.#visitedPagesCount = 0; + this._matchesCountTotal = 0; + this.#updateAllPages(); + for (let i = 0; i < numPages; i++) { + if (this._pendingFindMatches.has(i)) { + continue; + } + this._pendingFindMatches.add(i); + this._extractTextPromises[i].then(() => { + this._pendingFindMatches.delete(i); + this.#calculateMatch(i); + }); + } + } + const query = this.#query; + if (query.length === 0) { + this.#updateUIState(FindState.FOUND); + return; + } + if (this._resumePageIdx) { + return; + } + const offset = this._offset; + this._pagesToSearch = numPages; + if (offset.matchIdx !== null) { + const numPageMatches = this._pageMatches[offset.pageIdx].length; + if (!previous && offset.matchIdx + 1 < numPageMatches || previous && offset.matchIdx > 0) { + offset.matchIdx = previous ? offset.matchIdx - 1 : offset.matchIdx + 1; + this.#updateMatch(true); + return; + } + this.#advanceOffsetPage(previous); + } + this.#nextPageMatch(); + } + #matchesReady(matches) { + const offset = this._offset; + const numMatches = matches.length; + const previous = this.#state.findPrevious; + if (numMatches) { + offset.matchIdx = previous ? numMatches - 1 : 0; + this.#updateMatch(true); + return true; + } + this.#advanceOffsetPage(previous); + if (offset.wrapped) { + offset.matchIdx = null; + if (this._pagesToSearch < 0) { + this.#updateMatch(false); + return true; + } + } + return false; + } + #nextPageMatch() { + if (this._resumePageIdx !== null) { + console.error("There can only be one pending page."); + } + let matches = null; + do { + const pageIdx = this._offset.pageIdx; + matches = this._pageMatches[pageIdx]; + if (!matches) { + this._resumePageIdx = pageIdx; + break; + } + } while (!this.#matchesReady(matches)); + } + #advanceOffsetPage(previous) { + const offset = this._offset; + const numPages = this._linkService.pagesCount; + offset.pageIdx = previous ? offset.pageIdx - 1 : offset.pageIdx + 1; + offset.matchIdx = null; + this._pagesToSearch--; + if (offset.pageIdx >= numPages || offset.pageIdx < 0) { + offset.pageIdx = previous ? numPages - 1 : 0; + offset.wrapped = true; + } + } + #updateMatch(found = false) { + let state = FindState.NOT_FOUND; + const wrapped = this._offset.wrapped; + this._offset.wrapped = false; + if (found) { + const previousPage = this._selected.pageIdx; + this._selected.pageIdx = this._offset.pageIdx; + this._selected.matchIdx = this._offset.matchIdx; + state = wrapped ? FindState.WRAPPED : FindState.FOUND; + if (previousPage !== -1 && previousPage !== this._selected.pageIdx) { + this.#updatePage(previousPage); + } + } + this.#updateUIState(state, this.#state.findPrevious); + if (this._selected.pageIdx !== -1) { + this._scrollMatches = true; + this.#updatePage(this._selected.pageIdx); + } + } + #onFindBarClose(evt) { + const pdfDocument = this._pdfDocument; + this._firstPageCapability.promise.then(() => { + if (!this._pdfDocument || pdfDocument && this._pdfDocument !== pdfDocument) { + return; + } + if (this._findTimeout) { + clearTimeout(this._findTimeout); + this._findTimeout = null; + } + if (this._resumePageIdx) { + this._resumePageIdx = null; + this._dirtyMatch = true; + } + this.#updateUIState(FindState.FOUND); + this._highlightMatches = false; + this.#updateAllPages(); + }); + } + #requestMatchesCount() { + const { + pageIdx, + matchIdx + } = this._selected; + let current = 0, + total = this._matchesCountTotal; + if (matchIdx !== -1) { + for (let i = 0; i < pageIdx; i++) { + current += this._pageMatches[i]?.length || 0; + } + current += matchIdx + 1; + } + if (current < 1 || current > total) { + current = total = 0; + } + return { + current, + total + }; + } + #updateUIResultsCount() { + this._eventBus.dispatch("updatefindmatchescount", { + source: this, + matchesCount: this.#requestMatchesCount() + }); + } + #updateUIState(state, previous = false) { + if (!this.#updateMatchesCountOnProgress && (this.#visitedPagesCount !== this._linkService.pagesCount || state === FindState.PENDING)) { + return; + } + this._eventBus.dispatch("updatefindcontrolstate", { + source: this, + state, + previous, + entireWord: this.#state?.entireWord ?? null, + matchesCount: this.#requestMatchesCount(), + rawQuery: this.#state?.query ?? null + }); + } +} + +;// ./web/pdf_find_bar.js + + +const MATCHES_COUNT_LIMIT = 1000; +class PDFFindBar { + #mainContainer; + #resizeObserver = new ResizeObserver(this.#resizeObserverCallback.bind(this)); + constructor(options, mainContainer, eventBus) { + this.opened = false; + this.bar = options.bar; + this.toggleButton = options.toggleButton; + this.findField = options.findField; + this.highlightAll = options.highlightAllCheckbox; + this.caseSensitive = options.caseSensitiveCheckbox; + this.matchDiacritics = options.matchDiacriticsCheckbox; + this.entireWord = options.entireWordCheckbox; + this.findMsg = options.findMsg; + this.findResultsCount = options.findResultsCount; + this.findPreviousButton = options.findPreviousButton; + this.findNextButton = options.findNextButton; + this.eventBus = eventBus; + this.#mainContainer = mainContainer; + const checkedInputs = new Map([[this.highlightAll, "highlightallchange"], [this.caseSensitive, "casesensitivitychange"], [this.entireWord, "entirewordchange"], [this.matchDiacritics, "diacriticmatchingchange"]]); + this.toggleButton.addEventListener("click", () => { + this.toggle(); + }); + this.findField.addEventListener("input", () => { + this.dispatchEvent(""); + }); + this.bar.addEventListener("keydown", ({ + keyCode, + shiftKey, + target + }) => { + switch (keyCode) { + case 13: + if (target === this.findField) { + this.dispatchEvent("again", shiftKey); + } else if (checkedInputs.has(target)) { + target.checked = !target.checked; + this.dispatchEvent(checkedInputs.get(target)); + } + break; + case 27: + this.close(); + break; + } + }); + this.findPreviousButton.addEventListener("click", () => { + this.dispatchEvent("again", true); + }); + this.findNextButton.addEventListener("click", () => { + this.dispatchEvent("again", false); + }); + for (const [elem, evtName] of checkedInputs) { + elem.addEventListener("click", () => { + this.dispatchEvent(evtName); + }); + } + } + reset() { + this.updateUIState(); + } + dispatchEvent(type, findPrev = false) { + this.eventBus.dispatch("find", { + source: this, + type, + query: this.findField.value, + caseSensitive: this.caseSensitive.checked, + entireWord: this.entireWord.checked, + highlightAll: this.highlightAll.checked, + findPrevious: findPrev, + matchDiacritics: this.matchDiacritics.checked + }); + } + updateUIState(state, previous, matchesCount) { + const { + findField, + findMsg + } = this; + let findMsgId = "", + status = ""; + switch (state) { + case FindState.FOUND: + break; + case FindState.PENDING: + status = "pending"; + break; + case FindState.NOT_FOUND: + findMsgId = "pdfjs-find-not-found"; + status = "notFound"; + break; + case FindState.WRAPPED: + findMsgId = previous ? "pdfjs-find-reached-top" : "pdfjs-find-reached-bottom"; + break; + } + findField.setAttribute("data-status", status); + findField.setAttribute("aria-invalid", state === FindState.NOT_FOUND); + findMsg.setAttribute("data-status", status); + if (findMsgId) { + findMsg.setAttribute("data-l10n-id", findMsgId); + } else { + findMsg.removeAttribute("data-l10n-id"); + findMsg.textContent = ""; + } + this.updateResultsCount(matchesCount); + } + updateResultsCount({ + current = 0, + total = 0 + } = {}) { + const { + findResultsCount + } = this; + if (total > 0) { + const limit = MATCHES_COUNT_LIMIT; + findResultsCount.setAttribute("data-l10n-id", total > limit ? "pdfjs-find-match-count-limit" : "pdfjs-find-match-count"); + findResultsCount.setAttribute("data-l10n-args", JSON.stringify({ + limit, + current, + total + })); + } else { + findResultsCount.removeAttribute("data-l10n-id"); + findResultsCount.textContent = ""; + } + } + open() { + if (!this.opened) { + this.#resizeObserver.observe(this.#mainContainer); + this.#resizeObserver.observe(this.bar); + this.opened = true; + toggleExpandedBtn(this.toggleButton, true, this.bar); + } + this.findField.select(); + this.findField.focus(); + } + close() { + if (!this.opened) { + return; + } + this.#resizeObserver.disconnect(); + this.opened = false; + toggleExpandedBtn(this.toggleButton, false, this.bar); + this.eventBus.dispatch("findbarclose", { + source: this + }); + } + toggle() { + if (this.opened) { + this.close(); + } else { + this.open(); + } + } + #resizeObserverCallback() { + const { + bar + } = this; + bar.classList.remove("wrapContainers"); + const findbarHeight = bar.clientHeight; + const inputContainerHeight = bar.firstElementChild.clientHeight; + if (findbarHeight > inputContainerHeight) { + bar.classList.add("wrapContainers"); + } + } +} + +;// ./web/pdf_history.js + + +const HASH_CHANGE_TIMEOUT = 1000; +const POSITION_UPDATED_THRESHOLD = 50; +const UPDATE_VIEWAREA_TIMEOUT = 1000; +function getCurrentHash() { + return document.location.hash; +} +class PDFHistory { + #eventAbortController = null; + constructor({ + linkService, + eventBus + }) { + this.linkService = linkService; + this.eventBus = eventBus; + this._initialized = false; + this._fingerprint = ""; + this.reset(); + this.eventBus._on("pagesinit", () => { + this._isPagesLoaded = false; + this.eventBus._on("pagesloaded", evt => { + this._isPagesLoaded = !!evt.pagesCount; + }, { + once: true + }); + }); + } + initialize({ + fingerprint, + resetHistory = false, + updateUrl = false + }) { + if (!fingerprint || typeof fingerprint !== "string") { + console.error('PDFHistory.initialize: The "fingerprint" must be a non-empty string.'); + return; + } + if (this._initialized) { + this.reset(); + } + const reInitialized = this._fingerprint !== "" && this._fingerprint !== fingerprint; + this._fingerprint = fingerprint; + this._updateUrl = updateUrl === true; + this._initialized = true; + this.#bindEvents(); + const state = window.history.state; + this._popStateInProgress = false; + this._blockHashChange = 0; + this._currentHash = getCurrentHash(); + this._numPositionUpdates = 0; + this._uid = this._maxUid = 0; + this._destination = null; + this._position = null; + if (!this.#isValidState(state, true) || resetHistory) { + const { + hash, + page, + rotation + } = this.#parseCurrentHash(true); + if (!hash || reInitialized || resetHistory) { + this.#pushOrReplaceState(null, true); + return; + } + this.#pushOrReplaceState({ + hash, + page, + rotation + }, true); + return; + } + const destination = state.destination; + this.#updateInternalState(destination, state.uid, true); + if (destination.rotation !== undefined) { + this._initialRotation = destination.rotation; + } + if (destination.dest) { + this._initialBookmark = JSON.stringify(destination.dest); + this._destination.page = null; + } else if (destination.hash) { + this._initialBookmark = destination.hash; + } else if (destination.page) { + this._initialBookmark = `page=${destination.page}`; + } + } + reset() { + if (this._initialized) { + this.#pageHide(); + this._initialized = false; + this.#unbindEvents(); + } + if (this._updateViewareaTimeout) { + clearTimeout(this._updateViewareaTimeout); + this._updateViewareaTimeout = null; + } + this._initialBookmark = null; + this._initialRotation = null; + } + push({ + namedDest = null, + explicitDest, + pageNumber + }) { + if (!this._initialized) { + return; + } + if (namedDest && typeof namedDest !== "string") { + console.error("PDFHistory.push: " + `"${namedDest}" is not a valid namedDest parameter.`); + return; + } else if (!Array.isArray(explicitDest)) { + console.error("PDFHistory.push: " + `"${explicitDest}" is not a valid explicitDest parameter.`); + return; + } else if (!this.#isValidPage(pageNumber)) { + if (pageNumber !== null || this._destination) { + console.error("PDFHistory.push: " + `"${pageNumber}" is not a valid pageNumber parameter.`); + return; + } + } + const hash = namedDest || JSON.stringify(explicitDest); + if (!hash) { + return; + } + let forceReplace = false; + if (this._destination && (isDestHashesEqual(this._destination.hash, hash) || isDestArraysEqual(this._destination.dest, explicitDest))) { + if (this._destination.page) { + return; + } + forceReplace = true; + } + if (this._popStateInProgress && !forceReplace) { + return; + } + this.#pushOrReplaceState({ + dest: explicitDest, + hash, + page: pageNumber, + rotation: this.linkService.rotation + }, forceReplace); + if (!this._popStateInProgress) { + this._popStateInProgress = true; + Promise.resolve().then(() => { + this._popStateInProgress = false; + }); + } + } + pushPage(pageNumber) { + if (!this._initialized) { + return; + } + if (!this.#isValidPage(pageNumber)) { + console.error(`PDFHistory.pushPage: "${pageNumber}" is not a valid page number.`); + return; + } + if (this._destination?.page === pageNumber) { + return; + } + if (this._popStateInProgress) { + return; + } + this.#pushOrReplaceState({ + dest: null, + hash: `page=${pageNumber}`, + page: pageNumber, + rotation: this.linkService.rotation + }); + if (!this._popStateInProgress) { + this._popStateInProgress = true; + Promise.resolve().then(() => { + this._popStateInProgress = false; + }); + } + } + pushCurrentPosition() { + if (!this._initialized || this._popStateInProgress) { + return; + } + this.#tryPushCurrentPosition(); + } + back() { + if (!this._initialized || this._popStateInProgress) { + return; + } + const state = window.history.state; + if (this.#isValidState(state) && state.uid > 0) { + window.history.back(); + } + } + forward() { + if (!this._initialized || this._popStateInProgress) { + return; + } + const state = window.history.state; + if (this.#isValidState(state) && state.uid < this._maxUid) { + window.history.forward(); + } + } + get popStateInProgress() { + return this._initialized && (this._popStateInProgress || this._blockHashChange > 0); + } + get initialBookmark() { + return this._initialized ? this._initialBookmark : null; + } + get initialRotation() { + return this._initialized ? this._initialRotation : null; + } + #pushOrReplaceState(destination, forceReplace = false) { + const shouldReplace = forceReplace || !this._destination; + const newState = { + fingerprint: this._fingerprint, + uid: shouldReplace ? this._uid : this._uid + 1, + destination + }; + this.#updateInternalState(destination, newState.uid); + let newUrl; + if (this._updateUrl && destination?.hash) { + const baseUrl = document.location.href.split("#", 1)[0]; + if (!baseUrl.startsWith("file://")) { + newUrl = `${baseUrl}#${destination.hash}`; + } + } + if (shouldReplace) { + window.history.replaceState(newState, "", newUrl); + } else { + window.history.pushState(newState, "", newUrl); + } + } + #tryPushCurrentPosition(temporary = false) { + if (!this._position) { + return; + } + let position = this._position; + if (temporary) { + position = Object.assign(Object.create(null), this._position); + position.temporary = true; + } + if (!this._destination) { + this.#pushOrReplaceState(position); + return; + } + if (this._destination.temporary) { + this.#pushOrReplaceState(position, true); + return; + } + if (this._destination.hash === position.hash) { + return; + } + if (!this._destination.page && (POSITION_UPDATED_THRESHOLD <= 0 || this._numPositionUpdates <= POSITION_UPDATED_THRESHOLD)) { + return; + } + let forceReplace = false; + if (this._destination.page >= position.first && this._destination.page <= position.page) { + if (this._destination.dest !== undefined || !this._destination.first) { + return; + } + forceReplace = true; + } + this.#pushOrReplaceState(position, forceReplace); + } + #isValidPage(val) { + return Number.isInteger(val) && val > 0 && val <= this.linkService.pagesCount; + } + #isValidState(state, checkReload = false) { + if (!state) { + return false; + } + if (state.fingerprint !== this._fingerprint) { + if (checkReload) { + if (typeof state.fingerprint !== "string" || state.fingerprint.length !== this._fingerprint.length) { + return false; + } + const [perfEntry] = performance.getEntriesByType("navigation"); + if (perfEntry?.type !== "reload") { + return false; + } + } else { + return false; + } + } + if (!Number.isInteger(state.uid) || state.uid < 0) { + return false; + } + if (state.destination === null || typeof state.destination !== "object") { + return false; + } + return true; + } + #updateInternalState(destination, uid, removeTemporary = false) { + if (this._updateViewareaTimeout) { + clearTimeout(this._updateViewareaTimeout); + this._updateViewareaTimeout = null; + } + if (removeTemporary && destination?.temporary) { + delete destination.temporary; + } + this._destination = destination; + this._uid = uid; + this._maxUid = Math.max(this._maxUid, uid); + this._numPositionUpdates = 0; + } + #parseCurrentHash(checkNameddest = false) { + const hash = unescape(getCurrentHash()).substring(1); + const params = parseQueryString(hash); + const nameddest = params.get("nameddest") || ""; + let page = params.get("page") | 0; + if (!this.#isValidPage(page) || checkNameddest && nameddest.length > 0) { + page = null; + } + return { + hash, + page, + rotation: this.linkService.rotation + }; + } + #updateViewarea({ + location + }) { + if (this._updateViewareaTimeout) { + clearTimeout(this._updateViewareaTimeout); + this._updateViewareaTimeout = null; + } + this._position = { + hash: location.pdfOpenParams.substring(1), + page: this.linkService.page, + first: location.pageNumber, + rotation: location.rotation + }; + if (this._popStateInProgress) { + return; + } + if (POSITION_UPDATED_THRESHOLD > 0 && this._isPagesLoaded && this._destination && !this._destination.page) { + this._numPositionUpdates++; + } + if (UPDATE_VIEWAREA_TIMEOUT > 0) { + this._updateViewareaTimeout = setTimeout(() => { + if (!this._popStateInProgress) { + this.#tryPushCurrentPosition(true); + } + this._updateViewareaTimeout = null; + }, UPDATE_VIEWAREA_TIMEOUT); + } + } + #popState({ + state + }) { + const newHash = getCurrentHash(), + hashChanged = this._currentHash !== newHash; + this._currentHash = newHash; + if (!state) { + this._uid++; + const { + hash, + page, + rotation + } = this.#parseCurrentHash(); + this.#pushOrReplaceState({ + hash, + page, + rotation + }, true); + return; + } + if (!this.#isValidState(state)) { + return; + } + this._popStateInProgress = true; + if (hashChanged) { + this._blockHashChange++; + waitOnEventOrTimeout({ + target: window, + name: "hashchange", + delay: HASH_CHANGE_TIMEOUT + }).then(() => { + this._blockHashChange--; + }); + } + const destination = state.destination; + this.#updateInternalState(destination, state.uid, true); + if (isValidRotation(destination.rotation)) { + this.linkService.rotation = destination.rotation; + } + if (destination.dest) { + this.linkService.goToDestination(destination.dest); + } else if (destination.hash) { + this.linkService.setHash(destination.hash); + } else if (destination.page) { + this.linkService.page = destination.page; + } + Promise.resolve().then(() => { + this._popStateInProgress = false; + }); + } + #pageHide() { + if (!this._destination || this._destination.temporary) { + this.#tryPushCurrentPosition(); + } + } + #bindEvents() { + if (this.#eventAbortController) { + return; + } + this.#eventAbortController = new AbortController(); + const { + signal + } = this.#eventAbortController; + this.eventBus._on("updateviewarea", this.#updateViewarea.bind(this), { + signal + }); + window.addEventListener("popstate", this.#popState.bind(this), { + signal + }); + window.addEventListener("pagehide", this.#pageHide.bind(this), { + signal + }); + } + #unbindEvents() { + this.#eventAbortController?.abort(); + this.#eventAbortController = null; + } +} +function isDestHashesEqual(destHash, pushHash) { + if (typeof destHash !== "string" || typeof pushHash !== "string") { + return false; + } + if (destHash === pushHash) { + return true; + } + const nameddest = parseQueryString(destHash).get("nameddest"); + if (nameddest === pushHash) { + return true; + } + return false; +} +function isDestArraysEqual(firstDest, secondDest) { + function isEntryEqual(first, second) { + if (typeof first !== typeof second) { + return false; + } + if (Array.isArray(first) || Array.isArray(second)) { + return false; + } + if (first !== null && typeof first === "object" && second !== null) { + if (Object.keys(first).length !== Object.keys(second).length) { + return false; + } + for (const key in first) { + if (!isEntryEqual(first[key], second[key])) { + return false; + } + } + return true; + } + return first === second || Number.isNaN(first) && Number.isNaN(second); + } + if (!(Array.isArray(firstDest) && Array.isArray(secondDest))) { + return false; + } + if (firstDest.length !== secondDest.length) { + return false; + } + for (let i = 0, ii = firstDest.length; i < ii; i++) { + if (!isEntryEqual(firstDest[i], secondDest[i])) { + return false; + } + } + return true; +} + +;// ./web/pdf_layer_viewer.js + +class PDFLayerViewer extends BaseTreeViewer { + constructor(options) { + super(options); + this.eventBus._on("optionalcontentconfigchanged", evt => { + this.#updateLayers(evt.promise); + }); + this.eventBus._on("resetlayers", () => { + this.#updateLayers(); + }); + this.eventBus._on("togglelayerstree", this._toggleAllTreeItems.bind(this)); + } + reset() { + super.reset(); + this._optionalContentConfig = null; + this._optionalContentVisibility?.clear(); + this._optionalContentVisibility = null; + } + _dispatchEvent(layersCount) { + this.eventBus.dispatch("layersloaded", { + source: this, + layersCount + }); + } + _bindLink(element, { + groupId, + input + }) { + const setVisibility = () => { + const visible = input.checked; + this._optionalContentConfig.setVisibility(groupId, visible); + const cached = this._optionalContentVisibility.get(groupId); + if (cached) { + cached.visible = visible; + } + this.eventBus.dispatch("optionalcontentconfig", { + source: this, + promise: Promise.resolve(this._optionalContentConfig) + }); + }; + element.onclick = evt => { + if (evt.target === input) { + setVisibility(); + return true; + } else if (evt.target !== element) { + return true; + } + input.checked = !input.checked; + setVisibility(); + return false; + }; + } + _setNestedName(element, { + name = null + }) { + if (typeof name === "string") { + element.textContent = this._normalizeTextContent(name); + return; + } + element.setAttribute("data-l10n-id", "pdfjs-additional-layers"); + element.style.fontStyle = "italic"; + this._l10n.translateOnce(element); + } + _addToggleButton(div, { + name = null + }) { + super._addToggleButton(div, name === null); + } + _toggleAllTreeItems() { + if (!this._optionalContentConfig) { + return; + } + super._toggleAllTreeItems(); + } + render({ + optionalContentConfig, + pdfDocument + }) { + if (this._optionalContentConfig) { + this.reset(); + } + this._optionalContentConfig = optionalContentConfig || null; + this._pdfDocument = pdfDocument || null; + const groups = optionalContentConfig?.getOrder(); + if (!groups) { + this._dispatchEvent(0); + return; + } + this._optionalContentVisibility = new Map(); + const fragment = document.createDocumentFragment(), + queue = [{ + parent: fragment, + groups + }]; + let layersCount = 0, + hasAnyNesting = false; + while (queue.length > 0) { + const levelData = queue.shift(); + for (const groupId of levelData.groups) { + const div = document.createElement("div"); + div.className = "treeItem"; + const element = document.createElement("a"); + div.append(element); + if (typeof groupId === "object") { + hasAnyNesting = true; + this._addToggleButton(div, groupId); + this._setNestedName(element, groupId); + const itemsDiv = document.createElement("div"); + itemsDiv.className = "treeItems"; + div.append(itemsDiv); + queue.push({ + parent: itemsDiv, + groups: groupId.order + }); + } else { + const group = optionalContentConfig.getGroup(groupId); + const input = document.createElement("input"); + this._bindLink(element, { + groupId, + input + }); + input.type = "checkbox"; + input.checked = group.visible; + this._optionalContentVisibility.set(groupId, { + input, + visible: input.checked + }); + const label = document.createElement("label"); + label.textContent = this._normalizeTextContent(group.name); + label.append(input); + element.append(label); + layersCount++; + } + levelData.parent.append(div); + } + } + this._finishRendering(fragment, layersCount, hasAnyNesting); + } + async #updateLayers(promise = null) { + if (!this._optionalContentConfig) { + return; + } + const pdfDocument = this._pdfDocument; + const optionalContentConfig = await (promise || pdfDocument.getOptionalContentConfig({ + intent: "display" + })); + if (pdfDocument !== this._pdfDocument) { + return; + } + if (promise) { + for (const [groupId, cached] of this._optionalContentVisibility) { + const group = optionalContentConfig.getGroup(groupId); + if (group && cached.visible !== group.visible) { + cached.input.checked = cached.visible = !cached.visible; + } + } + return; + } + this.eventBus.dispatch("optionalcontentconfig", { + source: this, + promise: Promise.resolve(optionalContentConfig) + }); + this.render({ + optionalContentConfig, + pdfDocument: this._pdfDocument + }); + } +} + +;// ./web/pdf_outline_viewer.js + + +class PDFOutlineViewer extends BaseTreeViewer { + constructor(options) { + super(options); + this.linkService = options.linkService; + this.downloadManager = options.downloadManager; + this.eventBus._on("toggleoutlinetree", this._toggleAllTreeItems.bind(this)); + this.eventBus._on("currentoutlineitem", this._currentOutlineItem.bind(this)); + this.eventBus._on("pagechanging", evt => { + this._currentPageNumber = evt.pageNumber; + }); + this.eventBus._on("pagesloaded", evt => { + this._isPagesLoaded = !!evt.pagesCount; + this._currentOutlineItemCapability?.resolve(this._isPagesLoaded); + }); + this.eventBus._on("sidebarviewchanged", evt => { + this._sidebarView = evt.view; + }); + } + reset() { + super.reset(); + this._outline = null; + this._pageNumberToDestHashCapability = null; + this._currentPageNumber = 1; + this._isPagesLoaded = null; + this._currentOutlineItemCapability?.resolve(false); + this._currentOutlineItemCapability = null; + } + _dispatchEvent(outlineCount) { + this._currentOutlineItemCapability = Promise.withResolvers(); + if (outlineCount === 0 || this._pdfDocument?.loadingParams.disableAutoFetch) { + this._currentOutlineItemCapability.resolve(false); + } else if (this._isPagesLoaded !== null) { + this._currentOutlineItemCapability.resolve(this._isPagesLoaded); + } + this.eventBus.dispatch("outlineloaded", { + source: this, + outlineCount, + currentOutlineItemPromise: this._currentOutlineItemCapability.promise + }); + } + _bindLink(element, { + url, + newWindow, + action, + attachment, + dest, + setOCGState + }) { + const { + linkService + } = this; + if (url) { + linkService.addLinkAttributes(element, url, newWindow); + return; + } + if (action) { + element.href = linkService.getAnchorUrl(""); + element.onclick = () => { + linkService.executeNamedAction(action); + return false; + }; + return; + } + if (attachment) { + element.href = linkService.getAnchorUrl(""); + element.onclick = () => { + this.downloadManager.openOrDownloadData(attachment.content, attachment.filename); + return false; + }; + return; + } + if (setOCGState) { + element.href = linkService.getAnchorUrl(""); + element.onclick = () => { + linkService.executeSetOCGState(setOCGState); + return false; + }; + return; + } + element.href = linkService.getDestinationHash(dest); + element.onclick = evt => { + this._updateCurrentTreeItem(evt.target.parentNode); + if (dest) { + linkService.goToDestination(dest); + } + return false; + }; + } + _setStyles(element, { + bold, + italic + }) { + if (bold) { + element.style.fontWeight = "bold"; + } + if (italic) { + element.style.fontStyle = "italic"; + } + } + _addToggleButton(div, { + count, + items + }) { + let hidden = false; + if (count < 0) { + let totalCount = items.length; + if (totalCount > 0) { + const queue = [...items]; + while (queue.length > 0) { + const { + count: nestedCount, + items: nestedItems + } = queue.shift(); + if (nestedCount > 0 && nestedItems.length > 0) { + totalCount += nestedItems.length; + queue.push(...nestedItems); + } + } + } + if (Math.abs(count) === totalCount) { + hidden = true; + } + } + super._addToggleButton(div, hidden); + } + _toggleAllTreeItems() { + if (!this._outline) { + return; + } + super._toggleAllTreeItems(); + } + render({ + outline, + pdfDocument + }) { + if (this._outline) { + this.reset(); + } + this._outline = outline || null; + this._pdfDocument = pdfDocument || null; + if (!outline) { + this._dispatchEvent(0); + return; + } + const fragment = document.createDocumentFragment(); + const queue = [{ + parent: fragment, + items: outline + }]; + let outlineCount = 0, + hasAnyNesting = false; + while (queue.length > 0) { + const levelData = queue.shift(); + for (const item of levelData.items) { + const div = document.createElement("div"); + div.className = "treeItem"; + const element = document.createElement("a"); + this._bindLink(element, item); + this._setStyles(element, item); + element.textContent = this._normalizeTextContent(item.title); + div.append(element); + if (item.items.length > 0) { + hasAnyNesting = true; + this._addToggleButton(div, item); + const itemsDiv = document.createElement("div"); + itemsDiv.className = "treeItems"; + div.append(itemsDiv); + queue.push({ + parent: itemsDiv, + items: item.items + }); + } + levelData.parent.append(div); + outlineCount++; + } + } + this._finishRendering(fragment, outlineCount, hasAnyNesting); + } + async _currentOutlineItem() { + if (!this._isPagesLoaded) { + throw new Error("_currentOutlineItem: All pages have not been loaded."); + } + if (!this._outline || !this._pdfDocument) { + return; + } + const pageNumberToDestHash = await this._getPageNumberToDestHash(this._pdfDocument); + if (!pageNumberToDestHash) { + return; + } + this._updateCurrentTreeItem(null); + if (this._sidebarView !== SidebarView.OUTLINE) { + return; + } + for (let i = this._currentPageNumber; i > 0; i--) { + const destHash = pageNumberToDestHash.get(i); + if (!destHash) { + continue; + } + const linkElement = this.container.querySelector(`a[href="${destHash}"]`); + if (!linkElement) { + continue; + } + this._scrollToCurrentTreeItem(linkElement.parentNode); + break; + } + } + async _getPageNumberToDestHash(pdfDocument) { + if (this._pageNumberToDestHashCapability) { + return this._pageNumberToDestHashCapability.promise; + } + this._pageNumberToDestHashCapability = Promise.withResolvers(); + const pageNumberToDestHash = new Map(), + pageNumberNesting = new Map(); + const queue = [{ + nesting: 0, + items: this._outline + }]; + while (queue.length > 0) { + const levelData = queue.shift(), + currentNesting = levelData.nesting; + for (const { + dest, + items + } of levelData.items) { + let explicitDest, pageNumber; + if (typeof dest === "string") { + explicitDest = await pdfDocument.getDestination(dest); + if (pdfDocument !== this._pdfDocument) { + return null; + } + } else { + explicitDest = dest; + } + if (Array.isArray(explicitDest)) { + const [destRef] = explicitDest; + if (destRef && typeof destRef === "object") { + pageNumber = pdfDocument.cachedPageNumber(destRef); + } else if (Number.isInteger(destRef)) { + pageNumber = destRef + 1; + } + if (Number.isInteger(pageNumber) && (!pageNumberToDestHash.has(pageNumber) || currentNesting > pageNumberNesting.get(pageNumber))) { + const destHash = this.linkService.getDestinationHash(dest); + pageNumberToDestHash.set(pageNumber, destHash); + pageNumberNesting.set(pageNumber, currentNesting); + } + } + if (items.length > 0) { + queue.push({ + nesting: currentNesting + 1, + items + }); + } + } + } + this._pageNumberToDestHashCapability.resolve(pageNumberToDestHash.size > 0 ? pageNumberToDestHash : null); + return this._pageNumberToDestHashCapability.promise; + } +} + +;// ./web/pdf_presentation_mode.js + + +const DELAY_BEFORE_HIDING_CONTROLS = 3000; +const ACTIVE_SELECTOR = "pdfPresentationMode"; +const CONTROLS_SELECTOR = "pdfPresentationModeControls"; +const MOUSE_SCROLL_COOLDOWN_TIME = 50; +const PAGE_SWITCH_THRESHOLD = 0.1; +const SWIPE_MIN_DISTANCE_THRESHOLD = 50; +const SWIPE_ANGLE_THRESHOLD = Math.PI / 6; +class PDFPresentationMode { + #state = PresentationModeState.UNKNOWN; + #args = null; + #fullscreenChangeAbortController = null; + #windowAbortController = null; + constructor({ + container, + pdfViewer, + eventBus + }) { + this.container = container; + this.pdfViewer = pdfViewer; + this.eventBus = eventBus; + this.contextMenuOpen = false; + this.mouseScrollTimeStamp = 0; + this.mouseScrollDelta = 0; + this.touchSwipeState = null; + } + async request() { + const { + container, + pdfViewer + } = this; + if (this.active || !pdfViewer.pagesCount || !container.requestFullscreen) { + return false; + } + this.#addFullscreenChangeListeners(); + this.#notifyStateChange(PresentationModeState.CHANGING); + const promise = container.requestFullscreen(); + this.#args = { + pageNumber: pdfViewer.currentPageNumber, + scaleValue: pdfViewer.currentScaleValue, + scrollMode: pdfViewer.scrollMode, + spreadMode: null, + annotationEditorMode: null + }; + if (pdfViewer.spreadMode !== SpreadMode.NONE && !(pdfViewer.pageViewsReady && pdfViewer.hasEqualPageSizes)) { + console.warn("Ignoring Spread modes when entering PresentationMode, " + "since the document may contain varying page sizes."); + this.#args.spreadMode = pdfViewer.spreadMode; + } + if (pdfViewer.annotationEditorMode !== AnnotationEditorType.DISABLE) { + this.#args.annotationEditorMode = pdfViewer.annotationEditorMode; + } + try { + await promise; + pdfViewer.focus(); + return true; + } catch { + this.#removeFullscreenChangeListeners(); + this.#notifyStateChange(PresentationModeState.NORMAL); + } + return false; + } + get active() { + return this.#state === PresentationModeState.CHANGING || this.#state === PresentationModeState.FULLSCREEN; + } + #mouseWheel(evt) { + if (!this.active) { + return; + } + evt.preventDefault(); + const delta = normalizeWheelEventDelta(evt); + const currentTime = Date.now(); + const storedTime = this.mouseScrollTimeStamp; + if (currentTime > storedTime && currentTime - storedTime < MOUSE_SCROLL_COOLDOWN_TIME) { + return; + } + if (this.mouseScrollDelta > 0 && delta < 0 || this.mouseScrollDelta < 0 && delta > 0) { + this.#resetMouseScrollState(); + } + this.mouseScrollDelta += delta; + if (Math.abs(this.mouseScrollDelta) >= PAGE_SWITCH_THRESHOLD) { + const totalDelta = this.mouseScrollDelta; + this.#resetMouseScrollState(); + const success = totalDelta > 0 ? this.pdfViewer.previousPage() : this.pdfViewer.nextPage(); + if (success) { + this.mouseScrollTimeStamp = currentTime; + } + } + } + #notifyStateChange(state) { + this.#state = state; + this.eventBus.dispatch("presentationmodechanged", { + source: this, + state + }); + } + #enter() { + this.#notifyStateChange(PresentationModeState.FULLSCREEN); + this.container.classList.add(ACTIVE_SELECTOR); + setTimeout(() => { + this.pdfViewer.scrollMode = ScrollMode.PAGE; + if (this.#args.spreadMode !== null) { + this.pdfViewer.spreadMode = SpreadMode.NONE; + } + this.pdfViewer.currentPageNumber = this.#args.pageNumber; + this.pdfViewer.currentScaleValue = "page-fit"; + if (this.#args.annotationEditorMode !== null) { + this.pdfViewer.annotationEditorMode = { + mode: AnnotationEditorType.NONE + }; + } + }, 0); + this.#addWindowListeners(); + this.#showControls(); + this.contextMenuOpen = false; + document.getSelection().empty(); + } + #exit() { + const pageNumber = this.pdfViewer.currentPageNumber; + this.container.classList.remove(ACTIVE_SELECTOR); + setTimeout(() => { + this.#removeFullscreenChangeListeners(); + this.#notifyStateChange(PresentationModeState.NORMAL); + this.pdfViewer.scrollMode = this.#args.scrollMode; + if (this.#args.spreadMode !== null) { + this.pdfViewer.spreadMode = this.#args.spreadMode; + } + this.pdfViewer.currentScaleValue = this.#args.scaleValue; + this.pdfViewer.currentPageNumber = pageNumber; + if (this.#args.annotationEditorMode !== null) { + this.pdfViewer.annotationEditorMode = { + mode: this.#args.annotationEditorMode + }; + } + this.#args = null; + }, 0); + this.#removeWindowListeners(); + this.#hideControls(); + this.#resetMouseScrollState(); + this.contextMenuOpen = false; + } + #mouseDown(evt) { + if (this.contextMenuOpen) { + this.contextMenuOpen = false; + evt.preventDefault(); + return; + } + if (evt.button !== 0) { + return; + } + if (evt.target.href && evt.target.parentNode?.hasAttribute("data-internal-link")) { + return; + } + evt.preventDefault(); + if (evt.shiftKey) { + this.pdfViewer.previousPage(); + } else { + this.pdfViewer.nextPage(); + } + } + #contextMenu() { + this.contextMenuOpen = true; + } + #showControls() { + if (this.controlsTimeout) { + clearTimeout(this.controlsTimeout); + } else { + this.container.classList.add(CONTROLS_SELECTOR); + } + this.controlsTimeout = setTimeout(() => { + this.container.classList.remove(CONTROLS_SELECTOR); + delete this.controlsTimeout; + }, DELAY_BEFORE_HIDING_CONTROLS); + } + #hideControls() { + if (!this.controlsTimeout) { + return; + } + clearTimeout(this.controlsTimeout); + this.container.classList.remove(CONTROLS_SELECTOR); + delete this.controlsTimeout; + } + #resetMouseScrollState() { + this.mouseScrollTimeStamp = 0; + this.mouseScrollDelta = 0; + } + #touchSwipe(evt) { + if (!this.active) { + return; + } + if (evt.touches.length > 1) { + this.touchSwipeState = null; + return; + } + switch (evt.type) { + case "touchstart": + this.touchSwipeState = { + startX: evt.touches[0].pageX, + startY: evt.touches[0].pageY, + endX: evt.touches[0].pageX, + endY: evt.touches[0].pageY + }; + break; + case "touchmove": + if (this.touchSwipeState === null) { + return; + } + this.touchSwipeState.endX = evt.touches[0].pageX; + this.touchSwipeState.endY = evt.touches[0].pageY; + evt.preventDefault(); + break; + case "touchend": + if (this.touchSwipeState === null) { + return; + } + let delta = 0; + const dx = this.touchSwipeState.endX - this.touchSwipeState.startX; + const dy = this.touchSwipeState.endY - this.touchSwipeState.startY; + const absAngle = Math.abs(Math.atan2(dy, dx)); + if (Math.abs(dx) > SWIPE_MIN_DISTANCE_THRESHOLD && (absAngle <= SWIPE_ANGLE_THRESHOLD || absAngle >= Math.PI - SWIPE_ANGLE_THRESHOLD)) { + delta = dx; + } else if (Math.abs(dy) > SWIPE_MIN_DISTANCE_THRESHOLD && Math.abs(absAngle - Math.PI / 2) <= SWIPE_ANGLE_THRESHOLD) { + delta = dy; + } + if (delta > 0) { + this.pdfViewer.previousPage(); + } else if (delta < 0) { + this.pdfViewer.nextPage(); + } + break; + } + } + #addWindowListeners() { + if (this.#windowAbortController) { + return; + } + this.#windowAbortController = new AbortController(); + const { + signal + } = this.#windowAbortController; + const touchSwipeBind = this.#touchSwipe.bind(this); + window.addEventListener("mousemove", this.#showControls.bind(this), { + signal + }); + window.addEventListener("mousedown", this.#mouseDown.bind(this), { + signal + }); + window.addEventListener("wheel", this.#mouseWheel.bind(this), { + passive: false, + signal + }); + window.addEventListener("keydown", this.#resetMouseScrollState.bind(this), { + signal + }); + window.addEventListener("contextmenu", this.#contextMenu.bind(this), { + signal + }); + window.addEventListener("touchstart", touchSwipeBind, { + signal + }); + window.addEventListener("touchmove", touchSwipeBind, { + signal + }); + window.addEventListener("touchend", touchSwipeBind, { + signal + }); + } + #removeWindowListeners() { + this.#windowAbortController?.abort(); + this.#windowAbortController = null; + } + #addFullscreenChangeListeners() { + if (this.#fullscreenChangeAbortController) { + return; + } + this.#fullscreenChangeAbortController = new AbortController(); + window.addEventListener("fullscreenchange", () => { + if (document.fullscreenElement) { + this.#enter(); + } else { + this.#exit(); + } + }, { + signal: this.#fullscreenChangeAbortController.signal + }); + } + #removeFullscreenChangeListeners() { + this.#fullscreenChangeAbortController?.abort(); + this.#fullscreenChangeAbortController = null; + } +} + +;// ./web/xfa_layer_builder.js + +class XfaLayerBuilder { + constructor({ + pdfPage, + annotationStorage = null, + linkService, + xfaHtml = null + }) { + this.pdfPage = pdfPage; + this.annotationStorage = annotationStorage; + this.linkService = linkService; + this.xfaHtml = xfaHtml; + this.div = null; + this._cancelled = false; + } + async render(viewport, intent = "display") { + if (intent === "print") { + const parameters = { + viewport: viewport.clone({ + dontFlip: true + }), + div: this.div, + xfaHtml: this.xfaHtml, + annotationStorage: this.annotationStorage, + linkService: this.linkService, + intent + }; + this.div = document.createElement("div"); + parameters.div = this.div; + return XfaLayer.render(parameters); + } + const xfaHtml = await this.pdfPage.getXfa(); + if (this._cancelled || !xfaHtml) { + return { + textDivs: [] + }; + } + const parameters = { + viewport: viewport.clone({ + dontFlip: true + }), + div: this.div, + xfaHtml, + annotationStorage: this.annotationStorage, + linkService: this.linkService, + intent + }; + if (this.div) { + return XfaLayer.update(parameters); + } + this.div = document.createElement("div"); + parameters.div = this.div; + return XfaLayer.render(parameters); + } + cancel() { + this._cancelled = true; + } + hide() { + if (!this.div) { + return; + } + this.div.hidden = true; + } +} + +;// ./web/print_utils.js + + + +function getXfaHtmlForPrinting(printContainer, pdfDocument) { + const xfaHtml = pdfDocument.allXfaHtml; + const linkService = new SimpleLinkService(); + const scale = Math.round(PixelsPerInch.PDF_TO_CSS_UNITS * 100) / 100; + for (const xfaPage of xfaHtml.children) { + const page = document.createElement("div"); + page.className = "xfaPrintedPage"; + printContainer.append(page); + const builder = new XfaLayerBuilder({ + pdfPage: null, + annotationStorage: pdfDocument.annotationStorage, + linkService, + xfaHtml: xfaPage + }); + const viewport = getXfaPageViewport(xfaPage, { + scale + }); + builder.render(viewport, "print"); + page.append(builder.div); + } +} + +;// ./web/pdf_print_service.js + + +let activeService = null; +let dialog = null; +let overlayManager = null; +let viewerApp = { + initialized: false +}; +function renderPage(activeServiceOnEntry, pdfDocument, pageNumber, size, printResolution, optionalContentConfigPromise, printAnnotationStoragePromise) { + const scratchCanvas = activeService.scratchCanvas; + const PRINT_UNITS = printResolution / PixelsPerInch.PDF; + scratchCanvas.width = Math.floor(size.width * PRINT_UNITS); + scratchCanvas.height = Math.floor(size.height * PRINT_UNITS); + const ctx = scratchCanvas.getContext("2d"); + ctx.save(); + ctx.fillStyle = "rgb(255, 255, 255)"; + ctx.fillRect(0, 0, scratchCanvas.width, scratchCanvas.height); + ctx.restore(); + return Promise.all([pdfDocument.getPage(pageNumber), printAnnotationStoragePromise]).then(function ([pdfPage, printAnnotationStorage]) { + const renderContext = { + canvasContext: ctx, + transform: [PRINT_UNITS, 0, 0, PRINT_UNITS, 0, 0], + viewport: pdfPage.getViewport({ + scale: 1, + rotation: size.rotation + }), + intent: "print", + annotationMode: AnnotationMode.ENABLE_STORAGE, + optionalContentConfigPromise, + printAnnotationStorage + }; + const renderTask = pdfPage.render(renderContext); + return renderTask.promise.catch(reason => { + if (!(reason instanceof RenderingCancelledException)) { + console.error(reason); + } + throw reason; + }); + }); +} +class PDFPrintService { + constructor({ + pdfDocument, + pagesOverview, + printContainer, + printResolution, + printAnnotationStoragePromise = null + }) { + this.pdfDocument = pdfDocument; + this.pagesOverview = pagesOverview; + this.printContainer = printContainer; + this._printResolution = printResolution || 150; + this._optionalContentConfigPromise = pdfDocument.getOptionalContentConfig({ + intent: "print" + }); + this._printAnnotationStoragePromise = printAnnotationStoragePromise || Promise.resolve(); + this.currentPage = -1; + this.scratchCanvas = document.createElement("canvas"); + } + layout() { + this.throwIfInactive(); + const body = document.querySelector("body"); + body.setAttribute("data-pdfjsprinting", true); + const { + width, + height + } = this.pagesOverview[0]; + const hasEqualPageSizes = this.pagesOverview.every(size => size.width === width && size.height === height); + if (!hasEqualPageSizes) { + console.warn("Not all pages have the same size. The printed result may be incorrect!"); + } + this.pageStyleSheet = document.createElement("style"); + this.pageStyleSheet.textContent = `@page { size: ${width}pt ${height}pt;}`; + body.append(this.pageStyleSheet); + } + destroy() { + if (activeService !== this) { + return; + } + this.printContainer.textContent = ""; + const body = document.querySelector("body"); + body.removeAttribute("data-pdfjsprinting"); + if (this.pageStyleSheet) { + this.pageStyleSheet.remove(); + this.pageStyleSheet = null; + } + this.scratchCanvas.width = this.scratchCanvas.height = 0; + this.scratchCanvas = null; + activeService = null; + ensureOverlay().then(function () { + if (overlayManager.active === dialog) { + overlayManager.close(dialog); + } + }); + } + renderPages() { + if (this.pdfDocument.isPureXfa) { + getXfaHtmlForPrinting(this.printContainer, this.pdfDocument); + return Promise.resolve(); + } + const pageCount = this.pagesOverview.length; + const renderNextPage = (resolve, reject) => { + this.throwIfInactive(); + if (++this.currentPage >= pageCount) { + renderProgress(pageCount, pageCount); + resolve(); + return; + } + const index = this.currentPage; + renderProgress(index, pageCount); + renderPage(this, this.pdfDocument, index + 1, this.pagesOverview[index], this._printResolution, this._optionalContentConfigPromise, this._printAnnotationStoragePromise).then(this.useRenderedPage.bind(this)).then(function () { + renderNextPage(resolve, reject); + }, reject); + }; + return new Promise(renderNextPage); + } + useRenderedPage() { + this.throwIfInactive(); + const img = document.createElement("img"); + this.scratchCanvas.toBlob(blob => { + img.src = URL.createObjectURL(blob); + }); + const wrapper = document.createElement("div"); + wrapper.className = "printedPage"; + wrapper.append(img); + this.printContainer.append(wrapper); + const { + promise, + resolve, + reject + } = Promise.withResolvers(); + img.onload = resolve; + img.onerror = reject; + promise.catch(() => {}).then(() => { + URL.revokeObjectURL(img.src); + }); + return promise; + } + performPrint() { + this.throwIfInactive(); + return new Promise(resolve => { + setTimeout(() => { + if (!this.active) { + resolve(); + return; + } + print.call(window); + setTimeout(resolve, 20); + }, 0); + }); + } + get active() { + return this === activeService; + } + throwIfInactive() { + if (!this.active) { + throw new Error("This print request was cancelled or completed."); + } + } +} +const print = window.print; +window.print = function () { + if (activeService) { + console.warn("Ignored window.print() because of a pending print job."); + return; + } + ensureOverlay().then(function () { + if (activeService) { + overlayManager.open(dialog); + } + }); + try { + dispatchEvent("beforeprint"); + } finally { + if (!activeService) { + console.error("Expected print service to be initialized."); + ensureOverlay().then(function () { + if (overlayManager.active === dialog) { + overlayManager.close(dialog); + } + }); + return; + } + const activeServiceOnEntry = activeService; + activeService.renderPages().then(function () { + return activeServiceOnEntry.performPrint(); + }).catch(function () {}).then(function () { + if (activeServiceOnEntry.active) { + abort(); + } + }); + } +}; +function dispatchEvent(eventType) { + const event = new CustomEvent(eventType, { + bubbles: false, + cancelable: false, + detail: "custom" + }); + window.dispatchEvent(event); +} +function abort() { + if (activeService) { + activeService.destroy(); + dispatchEvent("afterprint"); + } +} +function renderProgress(index, total) { + dialog ||= document.getElementById("printServiceDialog"); + const progress = Math.round(100 * index / total); + const progressBar = dialog.querySelector("progress"); + const progressPerc = dialog.querySelector(".relative-progress"); + progressBar.value = progress; + progressPerc.setAttribute("data-l10n-args", JSON.stringify({ + progress + })); +} +window.addEventListener("keydown", function (event) { + if (event.keyCode === 80 && (event.ctrlKey || event.metaKey) && !event.altKey && (!event.shiftKey || window.chrome || window.opera)) { + window.print(); + event.preventDefault(); + event.stopImmediatePropagation(); + } +}, true); +if ("onbeforeprint" in window) { + const stopPropagationIfNeeded = function (event) { + if (event.detail !== "custom") { + event.stopImmediatePropagation(); + } + }; + window.addEventListener("beforeprint", stopPropagationIfNeeded); + window.addEventListener("afterprint", stopPropagationIfNeeded); +} +let overlayPromise; +function ensureOverlay() { + if (!overlayPromise) { + overlayManager = viewerApp.overlayManager; + if (!overlayManager) { + throw new Error("The overlay manager has not yet been initialized."); + } + dialog ||= document.getElementById("printServiceDialog"); + overlayPromise = overlayManager.register(dialog, true); + document.getElementById("printCancel").onclick = abort; + dialog.addEventListener("close", abort); + } + return overlayPromise; +} +class PDFPrintServiceFactory { + static initGlobals(app) { + viewerApp = app; + } + static get supportsPrinting() { + return shadow(this, "supportsPrinting", true); + } + static createPrintService(params) { + if (activeService) { + throw new Error("The print service is created and active."); + } + return activeService = new PDFPrintService(params); + } +} + +;// ./web/pdf_rendering_queue.js + + +const CLEANUP_TIMEOUT = 30000; +class PDFRenderingQueue { + constructor() { + this.pdfViewer = null; + this.pdfThumbnailViewer = null; + this.onIdle = null; + this.highestPriorityPage = null; + this.idleTimeout = null; + this.printing = false; + this.isThumbnailViewEnabled = false; + Object.defineProperty(this, "hasViewer", { + value: () => !!this.pdfViewer + }); + } + setViewer(pdfViewer) { + this.pdfViewer = pdfViewer; + } + setThumbnailViewer(pdfThumbnailViewer) { + this.pdfThumbnailViewer = pdfThumbnailViewer; + } + isHighestPriority(view) { + return this.highestPriorityPage === view.renderingId; + } + renderHighestPriority(currentlyVisiblePages) { + if (this.idleTimeout) { + clearTimeout(this.idleTimeout); + this.idleTimeout = null; + } + if (this.pdfViewer.forceRendering(currentlyVisiblePages)) { + return; + } + if (this.isThumbnailViewEnabled && this.pdfThumbnailViewer?.forceRendering()) { + return; + } + if (this.printing) { + return; + } + if (this.onIdle) { + this.idleTimeout = setTimeout(this.onIdle.bind(this), CLEANUP_TIMEOUT); + } + } + getHighestPriority(visible, views, scrolledDown, preRenderExtra = false) { + const visibleViews = visible.views, + numVisible = visibleViews.length; + if (numVisible === 0) { + return null; + } + for (let i = 0; i < numVisible; i++) { + const view = visibleViews[i].view; + if (!this.isViewFinished(view)) { + return view; + } + } + const firstId = visible.first.id, + lastId = visible.last.id; + if (lastId - firstId + 1 > numVisible) { + const visibleIds = visible.ids; + for (let i = 1, ii = lastId - firstId; i < ii; i++) { + const holeId = scrolledDown ? firstId + i : lastId - i; + if (visibleIds.has(holeId)) { + continue; + } + const holeView = views[holeId - 1]; + if (!this.isViewFinished(holeView)) { + return holeView; + } + } + } + let preRenderIndex = scrolledDown ? lastId : firstId - 2; + let preRenderView = views[preRenderIndex]; + if (preRenderView && !this.isViewFinished(preRenderView)) { + return preRenderView; + } + if (preRenderExtra) { + preRenderIndex += scrolledDown ? 1 : -1; + preRenderView = views[preRenderIndex]; + if (preRenderView && !this.isViewFinished(preRenderView)) { + return preRenderView; + } + } + return null; + } + isViewFinished(view) { + return view.renderingState === RenderingStates.FINISHED; + } + renderView(view) { + switch (view.renderingState) { + case RenderingStates.FINISHED: + return false; + case RenderingStates.PAUSED: + this.highestPriorityPage = view.renderingId; + view.resume(); + break; + case RenderingStates.RUNNING: + this.highestPriorityPage = view.renderingId; + break; + case RenderingStates.INITIAL: + this.highestPriorityPage = view.renderingId; + view.draw().finally(() => { + this.renderHighestPriority(); + }).catch(reason => { + if (reason instanceof RenderingCancelledException) { + return; + } + console.error("renderView:", reason); + }); + break; + } + return true; + } +} + +;// ./web/pdf_scripting_manager.js + + +class PDFScriptingManager { + #closeCapability = null; + #destroyCapability = null; + #docProperties = null; + #eventAbortController = null; + #eventBus = null; + #externalServices = null; + #pdfDocument = null; + #pdfViewer = null; + #ready = false; + #scripting = null; + #willPrintCapability = null; + constructor({ + eventBus, + externalServices = null, + docProperties = null + }) { + this.#eventBus = eventBus; + this.#externalServices = externalServices; + this.#docProperties = docProperties; + } + setViewer(pdfViewer) { + this.#pdfViewer = pdfViewer; + } + async setDocument(pdfDocument) { + if (this.#pdfDocument) { + await this.#destroyScripting(); + } + this.#pdfDocument = pdfDocument; + if (!pdfDocument) { + return; + } + const [objects, calculationOrder, docActions] = await Promise.all([pdfDocument.getFieldObjects(), pdfDocument.getCalculationOrderIds(), pdfDocument.getJSActions()]); + if (!objects && !docActions) { + await this.#destroyScripting(); + return; + } + if (pdfDocument !== this.#pdfDocument) { + return; + } + try { + this.#scripting = this.#initScripting(); + } catch (error) { + console.error("setDocument:", error); + await this.#destroyScripting(); + return; + } + const eventBus = this.#eventBus; + this.#eventAbortController = new AbortController(); + const { + signal + } = this.#eventAbortController; + eventBus._on("updatefromsandbox", event => { + if (event?.source === window) { + this.#updateFromSandbox(event.detail); + } + }, { + signal + }); + eventBus._on("dispatcheventinsandbox", event => { + this.#scripting?.dispatchEventInSandbox(event.detail); + }, { + signal + }); + eventBus._on("pagechanging", ({ + pageNumber, + previous + }) => { + if (pageNumber === previous) { + return; + } + this.#dispatchPageClose(previous); + this.#dispatchPageOpen(pageNumber); + }, { + signal + }); + eventBus._on("pagerendered", ({ + pageNumber + }) => { + if (!this._pageOpenPending.has(pageNumber)) { + return; + } + if (pageNumber !== this.#pdfViewer.currentPageNumber) { + return; + } + this.#dispatchPageOpen(pageNumber); + }, { + signal + }); + eventBus._on("pagesdestroy", async () => { + await this.#dispatchPageClose(this.#pdfViewer.currentPageNumber); + await this.#scripting?.dispatchEventInSandbox({ + id: "doc", + name: "WillClose" + }); + this.#closeCapability?.resolve(); + }, { + signal + }); + try { + const docProperties = await this.#docProperties(pdfDocument); + if (pdfDocument !== this.#pdfDocument) { + return; + } + await this.#scripting.createSandbox({ + objects, + calculationOrder, + appInfo: { + platform: navigator.platform, + language: navigator.language + }, + docInfo: { + ...docProperties, + actions: docActions + } + }); + eventBus.dispatch("sandboxcreated", { + source: this + }); + } catch (error) { + console.error("setDocument:", error); + await this.#destroyScripting(); + return; + } + await this.#scripting?.dispatchEventInSandbox({ + id: "doc", + name: "Open" + }); + await this.#dispatchPageOpen(this.#pdfViewer.currentPageNumber, true); + Promise.resolve().then(() => { + if (pdfDocument === this.#pdfDocument) { + this.#ready = true; + } + }); + } + async dispatchWillSave() { + return this.#scripting?.dispatchEventInSandbox({ + id: "doc", + name: "WillSave" + }); + } + async dispatchDidSave() { + return this.#scripting?.dispatchEventInSandbox({ + id: "doc", + name: "DidSave" + }); + } + async dispatchWillPrint() { + if (!this.#scripting) { + return; + } + await this.#willPrintCapability?.promise; + this.#willPrintCapability = Promise.withResolvers(); + try { + await this.#scripting.dispatchEventInSandbox({ + id: "doc", + name: "WillPrint" + }); + } catch (ex) { + this.#willPrintCapability.resolve(); + this.#willPrintCapability = null; + throw ex; + } + await this.#willPrintCapability.promise; + } + async dispatchDidPrint() { + return this.#scripting?.dispatchEventInSandbox({ + id: "doc", + name: "DidPrint" + }); + } + get destroyPromise() { + return this.#destroyCapability?.promise || null; + } + get ready() { + return this.#ready; + } + get _pageOpenPending() { + return shadow(this, "_pageOpenPending", new Set()); + } + get _visitedPages() { + return shadow(this, "_visitedPages", new Map()); + } + async #updateFromSandbox(detail) { + const pdfViewer = this.#pdfViewer; + const isInPresentationMode = pdfViewer.isInPresentationMode || pdfViewer.isChangingPresentationMode; + const { + id, + siblings, + command, + value + } = detail; + if (!id) { + switch (command) { + case "clear": + console.clear(); + break; + case "error": + console.error(value); + break; + case "layout": + if (!isInPresentationMode) { + const modes = apiPageLayoutToViewerModes(value); + pdfViewer.spreadMode = modes.spreadMode; + } + break; + case "page-num": + pdfViewer.currentPageNumber = value + 1; + break; + case "print": + await pdfViewer.pagesPromise; + this.#eventBus.dispatch("print", { + source: this + }); + break; + case "println": + console.log(value); + break; + case "zoom": + if (!isInPresentationMode) { + pdfViewer.currentScaleValue = value; + } + break; + case "SaveAs": + this.#eventBus.dispatch("download", { + source: this + }); + break; + case "FirstPage": + pdfViewer.currentPageNumber = 1; + break; + case "LastPage": + pdfViewer.currentPageNumber = pdfViewer.pagesCount; + break; + case "NextPage": + pdfViewer.nextPage(); + break; + case "PrevPage": + pdfViewer.previousPage(); + break; + case "ZoomViewIn": + if (!isInPresentationMode) { + pdfViewer.increaseScale(); + } + break; + case "ZoomViewOut": + if (!isInPresentationMode) { + pdfViewer.decreaseScale(); + } + break; + case "WillPrintFinished": + this.#willPrintCapability?.resolve(); + this.#willPrintCapability = null; + break; + } + return; + } + if (isInPresentationMode && detail.focus) { + return; + } + delete detail.id; + delete detail.siblings; + const ids = siblings ? [id, ...siblings] : [id]; + for (const elementId of ids) { + const element = document.querySelector(`[data-element-id="${elementId}"]`); + if (element) { + element.dispatchEvent(new CustomEvent("updatefromsandbox", { + detail + })); + } else { + this.#pdfDocument?.annotationStorage.setValue(elementId, detail); + } + } + } + async #dispatchPageOpen(pageNumber, initialize = false) { + const pdfDocument = this.#pdfDocument, + visitedPages = this._visitedPages; + if (initialize) { + this.#closeCapability = Promise.withResolvers(); + } + if (!this.#closeCapability) { + return; + } + const pageView = this.#pdfViewer.getPageView(pageNumber - 1); + if (pageView?.renderingState !== RenderingStates.FINISHED) { + this._pageOpenPending.add(pageNumber); + return; + } + this._pageOpenPending.delete(pageNumber); + const actionsPromise = (async () => { + const actions = await (!visitedPages.has(pageNumber) ? pageView.pdfPage?.getJSActions() : null); + if (pdfDocument !== this.#pdfDocument) { + return; + } + await this.#scripting?.dispatchEventInSandbox({ + id: "page", + name: "PageOpen", + pageNumber, + actions + }); + })(); + visitedPages.set(pageNumber, actionsPromise); + } + async #dispatchPageClose(pageNumber) { + const pdfDocument = this.#pdfDocument, + visitedPages = this._visitedPages; + if (!this.#closeCapability) { + return; + } + if (this._pageOpenPending.has(pageNumber)) { + return; + } + const actionsPromise = visitedPages.get(pageNumber); + if (!actionsPromise) { + return; + } + visitedPages.set(pageNumber, null); + await actionsPromise; + if (pdfDocument !== this.#pdfDocument) { + return; + } + await this.#scripting?.dispatchEventInSandbox({ + id: "page", + name: "PageClose", + pageNumber + }); + } + #initScripting() { + this.#destroyCapability = Promise.withResolvers(); + if (this.#scripting) { + throw new Error("#initScripting: Scripting already exists."); + } + return this.#externalServices.createScripting(); + } + async #destroyScripting() { + if (!this.#scripting) { + this.#pdfDocument = null; + this.#destroyCapability?.resolve(); + return; + } + if (this.#closeCapability) { + await Promise.race([this.#closeCapability.promise, new Promise(resolve => { + setTimeout(resolve, 1000); + })]).catch(() => {}); + this.#closeCapability = null; + } + this.#pdfDocument = null; + try { + await this.#scripting.destroySandbox(); + } catch {} + this.#willPrintCapability?.reject(new Error("Scripting destroyed.")); + this.#willPrintCapability = null; + this.#eventAbortController?.abort(); + this.#eventAbortController = null; + this._pageOpenPending.clear(); + this._visitedPages.clear(); + this.#scripting = null; + this.#ready = false; + this.#destroyCapability?.resolve(); + } +} + +;// ./web/pdf_sidebar.js + +const SIDEBAR_WIDTH_VAR = "--sidebar-width"; +const SIDEBAR_MIN_WIDTH = 200; +const SIDEBAR_RESIZING_CLASS = "sidebarResizing"; +const UI_NOTIFICATION_CLASS = "pdfSidebarNotification"; +class PDFSidebar { + #isRTL = false; + #mouseAC = null; + #outerContainerWidth = null; + #width = null; + constructor({ + elements, + eventBus, + l10n + }) { + this.isOpen = false; + this.active = SidebarView.THUMBS; + this.isInitialViewSet = false; + this.isInitialEventDispatched = false; + this.onToggled = null; + this.onUpdateThumbnails = null; + this.outerContainer = elements.outerContainer; + this.sidebarContainer = elements.sidebarContainer; + this.toggleButton = elements.toggleButton; + this.resizer = elements.resizer; + this.thumbnailButton = elements.thumbnailButton; + this.outlineButton = elements.outlineButton; + this.attachmentsButton = elements.attachmentsButton; + this.layersButton = elements.layersButton; + this.thumbnailView = elements.thumbnailView; + this.outlineView = elements.outlineView; + this.attachmentsView = elements.attachmentsView; + this.layersView = elements.layersView; + this._currentOutlineItemButton = elements.currentOutlineItemButton; + this.eventBus = eventBus; + this.#isRTL = l10n.getDirection() === "rtl"; + this.#addEventListeners(); + } + reset() { + this.isInitialViewSet = false; + this.isInitialEventDispatched = false; + this.#hideUINotification(true); + this.switchView(SidebarView.THUMBS); + this.outlineButton.disabled = false; + this.attachmentsButton.disabled = false; + this.layersButton.disabled = false; + this._currentOutlineItemButton.disabled = true; + } + get visibleView() { + return this.isOpen ? this.active : SidebarView.NONE; + } + setInitialView(view = SidebarView.NONE) { + if (this.isInitialViewSet) { + return; + } + this.isInitialViewSet = true; + if (view === SidebarView.NONE || view === SidebarView.UNKNOWN) { + this.#dispatchEvent(); + return; + } + this.switchView(view, true); + if (!this.isInitialEventDispatched) { + this.#dispatchEvent(); + } + } + switchView(view, forceOpen = false) { + const isViewChanged = view !== this.active; + let forceRendering = false; + switch (view) { + case SidebarView.NONE: + if (this.isOpen) { + this.close(); + } + return; + case SidebarView.THUMBS: + if (this.isOpen && isViewChanged) { + forceRendering = true; + } + break; + case SidebarView.OUTLINE: + if (this.outlineButton.disabled) { + return; + } + break; + case SidebarView.ATTACHMENTS: + if (this.attachmentsButton.disabled) { + return; + } + break; + case SidebarView.LAYERS: + if (this.layersButton.disabled) { + return; + } + break; + default: + console.error(`PDFSidebar.switchView: "${view}" is not a valid view.`); + return; + } + this.active = view; + toggleCheckedBtn(this.thumbnailButton, view === SidebarView.THUMBS, this.thumbnailView); + toggleCheckedBtn(this.outlineButton, view === SidebarView.OUTLINE, this.outlineView); + toggleCheckedBtn(this.attachmentsButton, view === SidebarView.ATTACHMENTS, this.attachmentsView); + toggleCheckedBtn(this.layersButton, view === SidebarView.LAYERS, this.layersView); + if (forceOpen && !this.isOpen) { + this.open(); + return; + } + if (forceRendering) { + this.onUpdateThumbnails(); + this.onToggled(); + } + if (isViewChanged) { + this.#dispatchEvent(); + } + } + open() { + if (this.isOpen) { + return; + } + this.isOpen = true; + toggleExpandedBtn(this.toggleButton, true); + this.outerContainer.classList.add("sidebarMoving", "sidebarOpen"); + if (this.active === SidebarView.THUMBS) { + this.onUpdateThumbnails(); + } + this.onToggled(); + this.#dispatchEvent(); + this.#hideUINotification(); + } + close(evt = null) { + if (!this.isOpen) { + return; + } + this.isOpen = false; + toggleExpandedBtn(this.toggleButton, false); + this.outerContainer.classList.add("sidebarMoving"); + this.outerContainer.classList.remove("sidebarOpen"); + this.onToggled(); + this.#dispatchEvent(); + if (evt?.detail > 0) { + this.toggleButton.blur(); + } + } + toggle(evt = null) { + if (this.isOpen) { + this.close(evt); + } else { + this.open(); + } + } + #dispatchEvent() { + if (this.isInitialViewSet) { + this.isInitialEventDispatched ||= true; + } + this.eventBus.dispatch("sidebarviewchanged", { + source: this, + view: this.visibleView + }); + } + #showUINotification() { + this.toggleButton.setAttribute("data-l10n-id", "pdfjs-toggle-sidebar-notification-button"); + if (!this.isOpen) { + this.toggleButton.classList.add(UI_NOTIFICATION_CLASS); + } + } + #hideUINotification(reset = false) { + if (this.isOpen || reset) { + this.toggleButton.classList.remove(UI_NOTIFICATION_CLASS); + } + if (reset) { + this.toggleButton.setAttribute("data-l10n-id", "pdfjs-toggle-sidebar-button"); + } + } + #addEventListeners() { + const { + eventBus, + outerContainer + } = this; + this.sidebarContainer.addEventListener("transitionend", evt => { + if (evt.target === this.sidebarContainer) { + outerContainer.classList.remove("sidebarMoving"); + eventBus.dispatch("resize", { + source: this + }); + } + }); + this.toggleButton.addEventListener("click", evt => { + this.toggle(evt); + }); + this.thumbnailButton.addEventListener("click", () => { + this.switchView(SidebarView.THUMBS); + }); + this.outlineButton.addEventListener("click", () => { + this.switchView(SidebarView.OUTLINE); + }); + this.outlineButton.addEventListener("dblclick", () => { + eventBus.dispatch("toggleoutlinetree", { + source: this + }); + }); + this.attachmentsButton.addEventListener("click", () => { + this.switchView(SidebarView.ATTACHMENTS); + }); + this.layersButton.addEventListener("click", () => { + this.switchView(SidebarView.LAYERS); + }); + this.layersButton.addEventListener("dblclick", () => { + eventBus.dispatch("resetlayers", { + source: this + }); + }); + this._currentOutlineItemButton.addEventListener("click", () => { + eventBus.dispatch("currentoutlineitem", { + source: this + }); + }); + const onTreeLoaded = (count, button, view) => { + button.disabled = !count; + if (count) { + this.#showUINotification(); + } else if (this.active === view) { + this.switchView(SidebarView.THUMBS); + } + }; + eventBus._on("outlineloaded", evt => { + onTreeLoaded(evt.outlineCount, this.outlineButton, SidebarView.OUTLINE); + evt.currentOutlineItemPromise.then(enabled => { + if (!this.isInitialViewSet) { + return; + } + this._currentOutlineItemButton.disabled = !enabled; + }); + }); + eventBus._on("attachmentsloaded", evt => { + onTreeLoaded(evt.attachmentsCount, this.attachmentsButton, SidebarView.ATTACHMENTS); + }); + eventBus._on("layersloaded", evt => { + onTreeLoaded(evt.layersCount, this.layersButton, SidebarView.LAYERS); + }); + eventBus._on("presentationmodechanged", evt => { + if (evt.state === PresentationModeState.NORMAL && this.visibleView === SidebarView.THUMBS) { + this.onUpdateThumbnails(); + } + }); + this.resizer.addEventListener("mousedown", evt => { + if (evt.button !== 0) { + return; + } + outerContainer.classList.add(SIDEBAR_RESIZING_CLASS); + this.#mouseAC = new AbortController(); + const opts = { + signal: this.#mouseAC.signal + }; + window.addEventListener("mousemove", this.#mouseMove.bind(this), opts); + window.addEventListener("mouseup", this.#mouseUp.bind(this), opts); + window.addEventListener("blur", this.#mouseUp.bind(this), opts); + }); + eventBus._on("resize", evt => { + if (evt.source !== window) { + return; + } + this.#outerContainerWidth = null; + if (!this.#width) { + return; + } + if (!this.isOpen) { + this.#updateWidth(this.#width); + return; + } + outerContainer.classList.add(SIDEBAR_RESIZING_CLASS); + const updated = this.#updateWidth(this.#width); + Promise.resolve().then(() => { + outerContainer.classList.remove(SIDEBAR_RESIZING_CLASS); + if (updated) { + eventBus.dispatch("resize", { + source: this + }); + } + }); + }); + } + get outerContainerWidth() { + return this.#outerContainerWidth ||= this.outerContainer.clientWidth; + } + #updateWidth(width = 0) { + const maxWidth = Math.floor(this.outerContainerWidth / 2); + if (width > maxWidth) { + width = maxWidth; + } + if (width < SIDEBAR_MIN_WIDTH) { + width = SIDEBAR_MIN_WIDTH; + } + if (width === this.#width) { + return false; + } + this.#width = width; + docStyle.setProperty(SIDEBAR_WIDTH_VAR, `${width}px`); + return true; + } + #mouseMove(evt) { + let width = evt.clientX; + if (this.#isRTL) { + width = this.outerContainerWidth - width; + } + this.#updateWidth(width); + } + #mouseUp(evt) { + this.outerContainer.classList.remove(SIDEBAR_RESIZING_CLASS); + this.eventBus.dispatch("resize", { + source: this + }); + this.#mouseAC?.abort(); + this.#mouseAC = null; + } +} + +;// ./web/pdf_thumbnail_view.js + + +const DRAW_UPSCALE_FACTOR = 2; +const MAX_NUM_SCALING_STEPS = 3; +const THUMBNAIL_WIDTH = 98; +class TempImageFactory { + static #tempCanvas = null; + static getCanvas(width, height) { + const tempCanvas = this.#tempCanvas ||= document.createElement("canvas"); + tempCanvas.width = width; + tempCanvas.height = height; + const ctx = tempCanvas.getContext("2d", { + alpha: false + }); + ctx.save(); + ctx.fillStyle = "rgb(255, 255, 255)"; + ctx.fillRect(0, 0, width, height); + ctx.restore(); + return [tempCanvas, tempCanvas.getContext("2d")]; + } + static destroyCanvas() { + const tempCanvas = this.#tempCanvas; + if (tempCanvas) { + tempCanvas.width = 0; + tempCanvas.height = 0; + } + this.#tempCanvas = null; + } +} +class PDFThumbnailView { + constructor({ + container, + eventBus, + id, + defaultViewport, + optionalContentConfigPromise, + linkService, + renderingQueue, + pageColors, + enableHWA + }) { + this.id = id; + this.renderingId = "thumbnail" + id; + this.pageLabel = null; + this.pdfPage = null; + this.rotation = 0; + this.viewport = defaultViewport; + this.pdfPageRotate = defaultViewport.rotation; + this._optionalContentConfigPromise = optionalContentConfigPromise || null; + this.pageColors = pageColors || null; + this.enableHWA = enableHWA || false; + this.eventBus = eventBus; + this.linkService = linkService; + this.renderingQueue = renderingQueue; + this.renderTask = null; + this.renderingState = RenderingStates.INITIAL; + this.resume = null; + const anchor = document.createElement("a"); + anchor.href = linkService.getAnchorUrl("#page=" + id); + anchor.setAttribute("data-l10n-id", "pdfjs-thumb-page-title"); + anchor.setAttribute("data-l10n-args", this.#pageL10nArgs); + anchor.onclick = function () { + linkService.goToPage(id); + return false; + }; + this.anchor = anchor; + const div = document.createElement("div"); + div.className = "thumbnail"; + div.setAttribute("data-page-number", this.id); + this.div = div; + this.#updateDims(); + const img = document.createElement("div"); + img.className = "thumbnailImage"; + this._placeholderImg = img; + div.append(img); + anchor.append(div); + container.append(anchor); + } + #updateDims() { + const { + width, + height + } = this.viewport; + const ratio = width / height; + this.canvasWidth = THUMBNAIL_WIDTH; + this.canvasHeight = this.canvasWidth / ratio | 0; + this.scale = this.canvasWidth / width; + const { + style + } = this.div; + style.setProperty("--thumbnail-width", `${this.canvasWidth}px`); + style.setProperty("--thumbnail-height", `${this.canvasHeight}px`); + } + setPdfPage(pdfPage) { + this.pdfPage = pdfPage; + this.pdfPageRotate = pdfPage.rotate; + const totalRotation = (this.rotation + this.pdfPageRotate) % 360; + this.viewport = pdfPage.getViewport({ + scale: 1, + rotation: totalRotation + }); + this.reset(); + } + reset() { + this.cancelRendering(); + this.renderingState = RenderingStates.INITIAL; + this.div.removeAttribute("data-loaded"); + this.image?.replaceWith(this._placeholderImg); + this.#updateDims(); + if (this.image) { + this.image.removeAttribute("src"); + delete this.image; + } + } + update({ + rotation = null + }) { + if (typeof rotation === "number") { + this.rotation = rotation; + } + const totalRotation = (this.rotation + this.pdfPageRotate) % 360; + this.viewport = this.viewport.clone({ + scale: 1, + rotation: totalRotation + }); + this.reset(); + } + cancelRendering() { + if (this.renderTask) { + this.renderTask.cancel(); + this.renderTask = null; + } + this.resume = null; + } + #getPageDrawContext(upscaleFactor = 1, enableHWA = this.enableHWA) { + const canvas = document.createElement("canvas"); + const ctx = canvas.getContext("2d", { + alpha: false, + willReadFrequently: !enableHWA + }); + const outputScale = new OutputScale(); + canvas.width = upscaleFactor * this.canvasWidth * outputScale.sx | 0; + canvas.height = upscaleFactor * this.canvasHeight * outputScale.sy | 0; + const transform = outputScale.scaled ? [outputScale.sx, 0, 0, outputScale.sy, 0, 0] : null; + return { + ctx, + canvas, + transform + }; + } + #convertCanvasToImage(canvas) { + if (this.renderingState !== RenderingStates.FINISHED) { + throw new Error("#convertCanvasToImage: Rendering has not finished."); + } + const reducedCanvas = this.#reduceImage(canvas); + const image = document.createElement("img"); + image.className = "thumbnailImage"; + image.setAttribute("data-l10n-id", "pdfjs-thumb-page-canvas"); + image.setAttribute("data-l10n-args", this.#pageL10nArgs); + image.src = reducedCanvas.toDataURL(); + this.image = image; + this.div.setAttribute("data-loaded", true); + this._placeholderImg.replaceWith(image); + reducedCanvas.width = 0; + reducedCanvas.height = 0; + } + async #finishRenderTask(renderTask, canvas, error = null) { + if (renderTask === this.renderTask) { + this.renderTask = null; + } + if (error instanceof RenderingCancelledException) { + return; + } + this.renderingState = RenderingStates.FINISHED; + this.#convertCanvasToImage(canvas); + if (error) { + throw error; + } + } + async draw() { + if (this.renderingState !== RenderingStates.INITIAL) { + console.error("Must be in new state before drawing"); + return undefined; + } + const { + pdfPage + } = this; + if (!pdfPage) { + this.renderingState = RenderingStates.FINISHED; + throw new Error("pdfPage is not loaded"); + } + this.renderingState = RenderingStates.RUNNING; + const { + ctx, + canvas, + transform + } = this.#getPageDrawContext(DRAW_UPSCALE_FACTOR); + const drawViewport = this.viewport.clone({ + scale: DRAW_UPSCALE_FACTOR * this.scale + }); + const renderContinueCallback = cont => { + if (!this.renderingQueue.isHighestPriority(this)) { + this.renderingState = RenderingStates.PAUSED; + this.resume = () => { + this.renderingState = RenderingStates.RUNNING; + cont(); + }; + return; + } + cont(); + }; + const renderContext = { + canvasContext: ctx, + transform, + viewport: drawViewport, + optionalContentConfigPromise: this._optionalContentConfigPromise, + pageColors: this.pageColors + }; + const renderTask = this.renderTask = pdfPage.render(renderContext); + renderTask.onContinue = renderContinueCallback; + const resultPromise = renderTask.promise.then(() => this.#finishRenderTask(renderTask, canvas), error => this.#finishRenderTask(renderTask, canvas, error)); + resultPromise.finally(() => { + canvas.width = 0; + canvas.height = 0; + this.eventBus.dispatch("thumbnailrendered", { + source: this, + pageNumber: this.id, + pdfPage: this.pdfPage + }); + }); + return resultPromise; + } + setImage(pageView) { + if (this.renderingState !== RenderingStates.INITIAL) { + return; + } + const { + thumbnailCanvas: canvas, + pdfPage, + scale + } = pageView; + if (!canvas) { + return; + } + if (!this.pdfPage) { + this.setPdfPage(pdfPage); + } + if (scale < this.scale) { + return; + } + this.renderingState = RenderingStates.FINISHED; + this.#convertCanvasToImage(canvas); + } + #reduceImage(img) { + const { + ctx, + canvas + } = this.#getPageDrawContext(1, true); + if (img.width <= 2 * canvas.width) { + ctx.drawImage(img, 0, 0, img.width, img.height, 0, 0, canvas.width, canvas.height); + return canvas; + } + let reducedWidth = canvas.width << MAX_NUM_SCALING_STEPS; + let reducedHeight = canvas.height << MAX_NUM_SCALING_STEPS; + const [reducedImage, reducedImageCtx] = TempImageFactory.getCanvas(reducedWidth, reducedHeight); + while (reducedWidth > img.width || reducedHeight > img.height) { + reducedWidth >>= 1; + reducedHeight >>= 1; + } + reducedImageCtx.drawImage(img, 0, 0, img.width, img.height, 0, 0, reducedWidth, reducedHeight); + while (reducedWidth > 2 * canvas.width) { + reducedImageCtx.drawImage(reducedImage, 0, 0, reducedWidth, reducedHeight, 0, 0, reducedWidth >> 1, reducedHeight >> 1); + reducedWidth >>= 1; + reducedHeight >>= 1; + } + ctx.drawImage(reducedImage, 0, 0, reducedWidth, reducedHeight, 0, 0, canvas.width, canvas.height); + return canvas; + } + get #pageL10nArgs() { + return JSON.stringify({ + page: this.pageLabel ?? this.id + }); + } + setPageLabel(label) { + this.pageLabel = typeof label === "string" ? label : null; + this.anchor.setAttribute("data-l10n-args", this.#pageL10nArgs); + if (this.renderingState !== RenderingStates.FINISHED) { + return; + } + this.image?.setAttribute("data-l10n-args", this.#pageL10nArgs); + } +} + +;// ./web/pdf_thumbnail_viewer.js + + +const THUMBNAIL_SCROLL_MARGIN = -19; +const THUMBNAIL_SELECTED_CLASS = "selected"; +class PDFThumbnailViewer { + constructor({ + container, + eventBus, + linkService, + renderingQueue, + pageColors, + abortSignal, + enableHWA + }) { + this.container = container; + this.eventBus = eventBus; + this.linkService = linkService; + this.renderingQueue = renderingQueue; + this.pageColors = pageColors || null; + this.enableHWA = enableHWA || false; + this.scroll = watchScroll(this.container, this.#scrollUpdated.bind(this), abortSignal); + this.#resetView(); + } + #scrollUpdated() { + this.renderingQueue.renderHighestPriority(); + } + getThumbnail(index) { + return this._thumbnails[index]; + } + #getVisibleThumbs() { + return getVisibleElements({ + scrollEl: this.container, + views: this._thumbnails + }); + } + scrollThumbnailIntoView(pageNumber) { + if (!this.pdfDocument) { + return; + } + const thumbnailView = this._thumbnails[pageNumber - 1]; + if (!thumbnailView) { + console.error('scrollThumbnailIntoView: Invalid "pageNumber" parameter.'); + return; + } + if (pageNumber !== this._currentPageNumber) { + const prevThumbnailView = this._thumbnails[this._currentPageNumber - 1]; + prevThumbnailView.div.classList.remove(THUMBNAIL_SELECTED_CLASS); + thumbnailView.div.classList.add(THUMBNAIL_SELECTED_CLASS); + } + const { + first, + last, + views + } = this.#getVisibleThumbs(); + if (views.length > 0) { + let shouldScroll = false; + if (pageNumber <= first.id || pageNumber >= last.id) { + shouldScroll = true; + } else { + for (const { + id, + percent + } of views) { + if (id !== pageNumber) { + continue; + } + shouldScroll = percent < 100; + break; + } + } + if (shouldScroll) { + scrollIntoView(thumbnailView.div, { + top: THUMBNAIL_SCROLL_MARGIN + }); + } + } + this._currentPageNumber = pageNumber; + } + get pagesRotation() { + return this._pagesRotation; + } + set pagesRotation(rotation) { + if (!isValidRotation(rotation)) { + throw new Error("Invalid thumbnails rotation angle."); + } + if (!this.pdfDocument) { + return; + } + if (this._pagesRotation === rotation) { + return; + } + this._pagesRotation = rotation; + const updateArgs = { + rotation + }; + for (const thumbnail of this._thumbnails) { + thumbnail.update(updateArgs); + } + } + cleanup() { + for (const thumbnail of this._thumbnails) { + if (thumbnail.renderingState !== RenderingStates.FINISHED) { + thumbnail.reset(); + } + } + TempImageFactory.destroyCanvas(); + } + #resetView() { + this._thumbnails = []; + this._currentPageNumber = 1; + this._pageLabels = null; + this._pagesRotation = 0; + this.container.textContent = ""; + } + setDocument(pdfDocument) { + if (this.pdfDocument) { + this.#cancelRendering(); + this.#resetView(); + } + this.pdfDocument = pdfDocument; + if (!pdfDocument) { + return; + } + const firstPagePromise = pdfDocument.getPage(1); + const optionalContentConfigPromise = pdfDocument.getOptionalContentConfig({ + intent: "display" + }); + firstPagePromise.then(firstPdfPage => { + const pagesCount = pdfDocument.numPages; + const viewport = firstPdfPage.getViewport({ + scale: 1 + }); + for (let pageNum = 1; pageNum <= pagesCount; ++pageNum) { + const thumbnail = new PDFThumbnailView({ + container: this.container, + eventBus: this.eventBus, + id: pageNum, + defaultViewport: viewport.clone(), + optionalContentConfigPromise, + linkService: this.linkService, + renderingQueue: this.renderingQueue, + pageColors: this.pageColors, + enableHWA: this.enableHWA + }); + this._thumbnails.push(thumbnail); + } + this._thumbnails[0]?.setPdfPage(firstPdfPage); + const thumbnailView = this._thumbnails[this._currentPageNumber - 1]; + thumbnailView.div.classList.add(THUMBNAIL_SELECTED_CLASS); + }).catch(reason => { + console.error("Unable to initialize thumbnail viewer", reason); + }); + } + #cancelRendering() { + for (const thumbnail of this._thumbnails) { + thumbnail.cancelRendering(); + } + } + setPageLabels(labels) { + if (!this.pdfDocument) { + return; + } + if (!labels) { + this._pageLabels = null; + } else if (!(Array.isArray(labels) && this.pdfDocument.numPages === labels.length)) { + this._pageLabels = null; + console.error("PDFThumbnailViewer_setPageLabels: Invalid page labels."); + } else { + this._pageLabels = labels; + } + for (let i = 0, ii = this._thumbnails.length; i < ii; i++) { + this._thumbnails[i].setPageLabel(this._pageLabels?.[i] ?? null); + } + } + async #ensurePdfPageLoaded(thumbView) { + if (thumbView.pdfPage) { + return thumbView.pdfPage; + } + try { + const pdfPage = await this.pdfDocument.getPage(thumbView.id); + if (!thumbView.pdfPage) { + thumbView.setPdfPage(pdfPage); + } + return pdfPage; + } catch (reason) { + console.error("Unable to get page for thumb view", reason); + return null; + } + } + #getScrollAhead(visible) { + if (visible.first?.id === 1) { + return true; + } else if (visible.last?.id === this._thumbnails.length) { + return false; + } + return this.scroll.down; + } + forceRendering() { + const visibleThumbs = this.#getVisibleThumbs(); + const scrollAhead = this.#getScrollAhead(visibleThumbs); + const thumbView = this.renderingQueue.getHighestPriority(visibleThumbs, this._thumbnails, scrollAhead); + if (thumbView) { + this.#ensurePdfPageLoaded(thumbView).then(() => { + this.renderingQueue.renderView(thumbView); + }); + return true; + } + return false; + } +} + +;// ./web/annotation_editor_layer_builder.js + + +class AnnotationEditorLayerBuilder { + #annotationLayer = null; + #drawLayer = null; + #onAppend = null; + #structTreeLayer = null; + #textLayer = null; + #uiManager; + constructor(options) { + this.pdfPage = options.pdfPage; + this.accessibilityManager = options.accessibilityManager; + this.l10n = options.l10n; + this.l10n ||= new genericl10n_GenericL10n(); + this.annotationEditorLayer = null; + this.div = null; + this._cancelled = false; + this.#uiManager = options.uiManager; + this.#annotationLayer = options.annotationLayer || null; + this.#textLayer = options.textLayer || null; + this.#drawLayer = options.drawLayer || null; + this.#onAppend = options.onAppend || null; + this.#structTreeLayer = options.structTreeLayer || null; + } + async render(viewport, intent = "display") { + if (intent !== "display") { + return; + } + if (this._cancelled) { + return; + } + const clonedViewport = viewport.clone({ + dontFlip: true + }); + if (this.div) { + this.annotationEditorLayer.update({ + viewport: clonedViewport + }); + this.show(); + return; + } + const div = this.div = document.createElement("div"); + div.className = "annotationEditorLayer"; + div.hidden = true; + div.dir = this.#uiManager.direction; + this.#onAppend?.(div); + this.annotationEditorLayer = new AnnotationEditorLayer({ + uiManager: this.#uiManager, + div, + structTreeLayer: this.#structTreeLayer, + accessibilityManager: this.accessibilityManager, + pageIndex: this.pdfPage.pageNumber - 1, + l10n: this.l10n, + viewport: clonedViewport, + annotationLayer: this.#annotationLayer, + textLayer: this.#textLayer, + drawLayer: this.#drawLayer + }); + const parameters = { + viewport: clonedViewport, + div, + annotations: null, + intent + }; + this.annotationEditorLayer.render(parameters); + this.show(); + } + cancel() { + this._cancelled = true; + if (!this.div) { + return; + } + this.annotationEditorLayer.destroy(); + } + hide() { + if (!this.div) { + return; + } + this.annotationEditorLayer.pause(true); + this.div.hidden = true; + } + show() { + if (!this.div || this.annotationEditorLayer.isInvisible) { + return; + } + this.div.hidden = false; + this.annotationEditorLayer.pause(false); + } +} + +;// ./web/annotation_layer_builder.js + + +class AnnotationLayerBuilder { + #onAppend = null; + #eventAbortController = null; + constructor({ + pdfPage, + linkService, + downloadManager, + annotationStorage = null, + imageResourcesPath = "", + renderForms = true, + enableScripting = false, + hasJSActionsPromise = null, + fieldObjectsPromise = null, + annotationCanvasMap = null, + accessibilityManager = null, + annotationEditorUIManager = null, + onAppend = null + }) { + this.pdfPage = pdfPage; + this.linkService = linkService; + this.downloadManager = downloadManager; + this.imageResourcesPath = imageResourcesPath; + this.renderForms = renderForms; + this.annotationStorage = annotationStorage; + this.enableScripting = enableScripting; + this._hasJSActionsPromise = hasJSActionsPromise || Promise.resolve(false); + this._fieldObjectsPromise = fieldObjectsPromise || Promise.resolve(null); + this._annotationCanvasMap = annotationCanvasMap; + this._accessibilityManager = accessibilityManager; + this._annotationEditorUIManager = annotationEditorUIManager; + this.#onAppend = onAppend; + this.annotationLayer = null; + this.div = null; + this._cancelled = false; + this._eventBus = linkService.eventBus; + } + async render(viewport, options, intent = "display") { + if (this.div) { + if (this._cancelled || !this.annotationLayer) { + return; + } + this.annotationLayer.update({ + viewport: viewport.clone({ + dontFlip: true + }) + }); + return; + } + const [annotations, hasJSActions, fieldObjects] = await Promise.all([this.pdfPage.getAnnotations({ + intent + }), this._hasJSActionsPromise, this._fieldObjectsPromise]); + if (this._cancelled) { + return; + } + const div = this.div = document.createElement("div"); + div.className = "annotationLayer"; + this.#onAppend?.(div); + if (annotations.length === 0) { + this.hide(); + return; + } + this.annotationLayer = new AnnotationLayer({ + div, + accessibilityManager: this._accessibilityManager, + annotationCanvasMap: this._annotationCanvasMap, + annotationEditorUIManager: this._annotationEditorUIManager, + page: this.pdfPage, + viewport: viewport.clone({ + dontFlip: true + }), + structTreeLayer: options?.structTreeLayer || null + }); + await this.annotationLayer.render({ + annotations, + imageResourcesPath: this.imageResourcesPath, + renderForms: this.renderForms, + linkService: this.linkService, + downloadManager: this.downloadManager, + annotationStorage: this.annotationStorage, + enableScripting: this.enableScripting, + hasJSActions, + fieldObjects + }); + if (this.linkService.isInPresentationMode) { + this.#updatePresentationModeState(PresentationModeState.FULLSCREEN); + } + if (!this.#eventAbortController) { + this.#eventAbortController = new AbortController(); + this._eventBus?._on("presentationmodechanged", evt => { + this.#updatePresentationModeState(evt.state); + }, { + signal: this.#eventAbortController.signal + }); + } + } + cancel() { + this._cancelled = true; + this.#eventAbortController?.abort(); + this.#eventAbortController = null; + } + hide() { + if (!this.div) { + return; + } + this.div.hidden = true; + } + hasEditableAnnotations() { + return !!this.annotationLayer?.hasEditableAnnotations(); + } + #updatePresentationModeState(state) { + if (!this.div) { + return; + } + let disableFormElements = false; + switch (state) { + case PresentationModeState.FULLSCREEN: + disableFormElements = true; + break; + case PresentationModeState.NORMAL: + break; + default: + return; + } + for (const section of this.div.childNodes) { + if (section.hasAttribute("data-internal-link")) { + continue; + } + section.inert = disableFormElements; + } + } +} + +;// ./web/draw_layer_builder.js + +class DrawLayerBuilder { + #drawLayer = null; + constructor(options) { + this.pageIndex = options.pageIndex; + } + async render(intent = "display") { + if (intent !== "display" || this.#drawLayer || this._cancelled) { + return; + } + this.#drawLayer = new DrawLayer({ + pageIndex: this.pageIndex + }); + } + cancel() { + this._cancelled = true; + if (!this.#drawLayer) { + return; + } + this.#drawLayer.destroy(); + this.#drawLayer = null; + } + setParent(parent) { + this.#drawLayer?.setParent(parent); + } + getDrawLayer() { + return this.#drawLayer; + } +} + +;// ./web/struct_tree_layer_builder.js + +const PDF_ROLE_TO_HTML_ROLE = { + Document: null, + DocumentFragment: null, + Part: "group", + Sect: "group", + Div: "group", + Aside: "note", + NonStruct: "none", + P: null, + H: "heading", + Title: null, + FENote: "note", + Sub: "group", + Lbl: null, + Span: null, + Em: null, + Strong: null, + Link: "link", + Annot: "note", + Form: "form", + Ruby: null, + RB: null, + RT: null, + RP: null, + Warichu: null, + WT: null, + WP: null, + L: "list", + LI: "listitem", + LBody: null, + Table: "table", + TR: "row", + TH: "columnheader", + TD: "cell", + THead: "columnheader", + TBody: null, + TFoot: null, + Caption: null, + Figure: "figure", + Formula: null, + Artifact: null +}; +const HEADING_PATTERN = /^H(\d+)$/; +class StructTreeLayerBuilder { + #promise; + #treeDom = null; + #treePromise; + #elementAttributes = new Map(); + #rawDims; + #elementsToAddToTextLayer = null; + constructor(pdfPage, rawDims) { + this.#promise = pdfPage.getStructTree(); + this.#rawDims = rawDims; + } + async render() { + if (this.#treePromise) { + return this.#treePromise; + } + const { + promise, + resolve, + reject + } = Promise.withResolvers(); + this.#treePromise = promise; + try { + this.#treeDom = this.#walk(await this.#promise); + } catch (ex) { + reject(ex); + } + this.#promise = null; + this.#treeDom?.classList.add("structTree"); + resolve(this.#treeDom); + return promise; + } + async getAriaAttributes(annotationId) { + try { + await this.render(); + return this.#elementAttributes.get(annotationId); + } catch {} + return null; + } + hide() { + if (this.#treeDom && !this.#treeDom.hidden) { + this.#treeDom.hidden = true; + } + } + show() { + if (this.#treeDom?.hidden) { + this.#treeDom.hidden = false; + } + } + #setAttributes(structElement, htmlElement) { + const { + alt, + id, + lang + } = structElement; + if (alt !== undefined) { + let added = false; + const label = removeNullCharacters(alt); + for (const child of structElement.children) { + if (child.type === "annotation") { + let attrs = this.#elementAttributes.get(child.id); + if (!attrs) { + attrs = new Map(); + this.#elementAttributes.set(child.id, attrs); + } + attrs.set("aria-label", label); + added = true; + } + } + if (!added) { + htmlElement.setAttribute("aria-label", label); + } + } + if (id !== undefined) { + htmlElement.setAttribute("aria-owns", id); + } + if (lang !== undefined) { + htmlElement.setAttribute("lang", removeNullCharacters(lang, true)); + } + } + #addImageInTextLayer(node, element) { + const { + alt, + bbox, + children + } = node; + const child = children?.[0]; + if (!this.#rawDims || !alt || !bbox || child?.type !== "content") { + return false; + } + const { + id + } = child; + if (!id) { + return false; + } + element.setAttribute("aria-owns", id); + const img = document.createElement("span"); + (this.#elementsToAddToTextLayer ||= new Map()).set(id, img); + img.setAttribute("role", "img"); + img.setAttribute("aria-label", removeNullCharacters(alt)); + const { + pageHeight, + pageX, + pageY + } = this.#rawDims; + const calc = "calc(var(--scale-factor)*"; + const { + style + } = img; + style.width = `${calc}${bbox[2] - bbox[0]}px)`; + style.height = `${calc}${bbox[3] - bbox[1]}px)`; + style.left = `${calc}${bbox[0] - pageX}px)`; + style.top = `${calc}${pageHeight - bbox[3] + pageY}px)`; + return true; + } + addElementsToTextLayer() { + if (!this.#elementsToAddToTextLayer) { + return; + } + for (const [id, img] of this.#elementsToAddToTextLayer) { + document.getElementById(id)?.append(img); + } + this.#elementsToAddToTextLayer.clear(); + this.#elementsToAddToTextLayer = null; + } + #walk(node) { + if (!node) { + return null; + } + const element = document.createElement("span"); + if ("role" in node) { + const { + role + } = node; + const match = role.match(HEADING_PATTERN); + if (match) { + element.setAttribute("role", "heading"); + element.setAttribute("aria-level", match[1]); + } else if (PDF_ROLE_TO_HTML_ROLE[role]) { + element.setAttribute("role", PDF_ROLE_TO_HTML_ROLE[role]); + } + if (role === "Figure" && this.#addImageInTextLayer(node, element)) { + return element; + } + } + this.#setAttributes(node, element); + if (node.children) { + if (node.children.length === 1 && "id" in node.children[0]) { + this.#setAttributes(node.children[0], element); + } else { + for (const kid of node.children) { + element.append(this.#walk(kid)); + } + } + } + return element; + } +} + +;// ./web/text_accessibility.js + +class TextAccessibilityManager { + #enabled = false; + #textChildren = null; + #textNodes = new Map(); + #waitingElements = new Map(); + setTextMapping(textDivs) { + this.#textChildren = textDivs; + } + static #compareElementPositions(e1, e2) { + const rect1 = e1.getBoundingClientRect(); + const rect2 = e2.getBoundingClientRect(); + if (rect1.width === 0 && rect1.height === 0) { + return +1; + } + if (rect2.width === 0 && rect2.height === 0) { + return -1; + } + const top1 = rect1.y; + const bot1 = rect1.y + rect1.height; + const mid1 = rect1.y + rect1.height / 2; + const top2 = rect2.y; + const bot2 = rect2.y + rect2.height; + const mid2 = rect2.y + rect2.height / 2; + if (mid1 <= top2 && mid2 >= bot1) { + return -1; + } + if (mid2 <= top1 && mid1 >= bot2) { + return +1; + } + const centerX1 = rect1.x + rect1.width / 2; + const centerX2 = rect2.x + rect2.width / 2; + return centerX1 - centerX2; + } + enable() { + if (this.#enabled) { + throw new Error("TextAccessibilityManager is already enabled."); + } + if (!this.#textChildren) { + throw new Error("Text divs and strings have not been set."); + } + this.#enabled = true; + this.#textChildren = this.#textChildren.slice(); + this.#textChildren.sort(TextAccessibilityManager.#compareElementPositions); + if (this.#textNodes.size > 0) { + const textChildren = this.#textChildren; + for (const [id, nodeIndex] of this.#textNodes) { + const element = document.getElementById(id); + if (!element) { + this.#textNodes.delete(id); + continue; + } + this.#addIdToAriaOwns(id, textChildren[nodeIndex]); + } + } + for (const [element, isRemovable] of this.#waitingElements) { + this.addPointerInTextLayer(element, isRemovable); + } + this.#waitingElements.clear(); + } + disable() { + if (!this.#enabled) { + return; + } + this.#waitingElements.clear(); + this.#textChildren = null; + this.#enabled = false; + } + removePointerInTextLayer(element) { + if (!this.#enabled) { + this.#waitingElements.delete(element); + return; + } + const children = this.#textChildren; + if (!children || children.length === 0) { + return; + } + const { + id + } = element; + const nodeIndex = this.#textNodes.get(id); + if (nodeIndex === undefined) { + return; + } + const node = children[nodeIndex]; + this.#textNodes.delete(id); + let owns = node.getAttribute("aria-owns"); + if (owns?.includes(id)) { + owns = owns.split(" ").filter(x => x !== id).join(" "); + if (owns) { + node.setAttribute("aria-owns", owns); + } else { + node.removeAttribute("aria-owns"); + node.setAttribute("role", "presentation"); + } + } + } + #addIdToAriaOwns(id, node) { + const owns = node.getAttribute("aria-owns"); + if (!owns?.includes(id)) { + node.setAttribute("aria-owns", owns ? `${owns} ${id}` : id); + } + node.removeAttribute("role"); + } + addPointerInTextLayer(element, isRemovable) { + const { + id + } = element; + if (!id) { + return null; + } + if (!this.#enabled) { + this.#waitingElements.set(element, isRemovable); + return null; + } + if (isRemovable) { + this.removePointerInTextLayer(element); + } + const children = this.#textChildren; + if (!children || children.length === 0) { + return null; + } + const index = binarySearchFirstItem(children, node => TextAccessibilityManager.#compareElementPositions(element, node) < 0); + const nodeIndex = Math.max(0, index - 1); + const child = children[nodeIndex]; + this.#addIdToAriaOwns(id, child); + this.#textNodes.set(id, nodeIndex); + const parent = child.parentNode; + return parent?.classList.contains("markedContent") ? parent.id : null; + } + moveElementInDOM(container, element, contentElement, isRemovable) { + const id = this.addPointerInTextLayer(contentElement, isRemovable); + if (!container.hasChildNodes()) { + container.append(element); + return id; + } + const children = Array.from(container.childNodes).filter(node => node !== element); + if (children.length === 0) { + return id; + } + const elementToCompare = contentElement || element; + const index = binarySearchFirstItem(children, node => TextAccessibilityManager.#compareElementPositions(elementToCompare, node) < 0); + if (index === 0) { + children[0].before(element); + } else { + children[index - 1].after(element); + } + return id; + } +} + +;// ./web/text_highlighter.js +class TextHighlighter { + #eventAbortController = null; + constructor({ + findController, + eventBus, + pageIndex + }) { + this.findController = findController; + this.matches = []; + this.eventBus = eventBus; + this.pageIdx = pageIndex; + this.textDivs = null; + this.textContentItemsStr = null; + this.enabled = false; + } + setTextMapping(divs, texts) { + this.textDivs = divs; + this.textContentItemsStr = texts; + } + enable() { + if (!this.textDivs || !this.textContentItemsStr) { + throw new Error("Text divs and strings have not been set."); + } + if (this.enabled) { + throw new Error("TextHighlighter is already enabled."); + } + this.enabled = true; + if (!this.#eventAbortController) { + this.#eventAbortController = new AbortController(); + this.eventBus._on("updatetextlayermatches", evt => { + if (evt.pageIndex === this.pageIdx || evt.pageIndex === -1) { + this._updateMatches(); + } + }, { + signal: this.#eventAbortController.signal + }); + } + this._updateMatches(); + } + disable() { + if (!this.enabled) { + return; + } + this.enabled = false; + this.#eventAbortController?.abort(); + this.#eventAbortController = null; + this._updateMatches(true); + } + _convertMatches(matches, matchesLength) { + if (!matches) { + return []; + } + const { + textContentItemsStr + } = this; + let i = 0, + iIndex = 0; + const end = textContentItemsStr.length - 1; + const result = []; + for (let m = 0, mm = matches.length; m < mm; m++) { + let matchIdx = matches[m]; + while (i !== end && matchIdx >= iIndex + textContentItemsStr[i].length) { + iIndex += textContentItemsStr[i].length; + i++; + } + if (i === textContentItemsStr.length) { + console.error("Could not find a matching mapping"); + } + const match = { + begin: { + divIdx: i, + offset: matchIdx - iIndex + } + }; + matchIdx += matchesLength[m]; + while (i !== end && matchIdx > iIndex + textContentItemsStr[i].length) { + iIndex += textContentItemsStr[i].length; + i++; + } + match.end = { + divIdx: i, + offset: matchIdx - iIndex + }; + result.push(match); + } + return result; + } + _renderMatches(matches) { + if (matches.length === 0) { + return; + } + const { + findController, + pageIdx + } = this; + const { + textContentItemsStr, + textDivs + } = this; + const isSelectedPage = pageIdx === findController.selected.pageIdx; + const selectedMatchIdx = findController.selected.matchIdx; + const highlightAll = findController.state.highlightAll; + let prevEnd = null; + const infinity = { + divIdx: -1, + offset: undefined + }; + function beginText(begin, className) { + const divIdx = begin.divIdx; + textDivs[divIdx].textContent = ""; + return appendTextToDiv(divIdx, 0, begin.offset, className); + } + function appendTextToDiv(divIdx, fromOffset, toOffset, className) { + let div = textDivs[divIdx]; + if (div.nodeType === Node.TEXT_NODE) { + const span = document.createElement("span"); + div.before(span); + span.append(div); + textDivs[divIdx] = span; + div = span; + } + const content = textContentItemsStr[divIdx].substring(fromOffset, toOffset); + const node = document.createTextNode(content); + if (className) { + const span = document.createElement("span"); + span.className = `${className} appended`; + span.append(node); + div.append(span); + if (className.includes("selected")) { + const { + left + } = span.getClientRects()[0]; + const parentLeft = div.getBoundingClientRect().left; + return left - parentLeft; + } + return 0; + } + div.append(node); + return 0; + } + let i0 = selectedMatchIdx, + i1 = i0 + 1; + if (highlightAll) { + i0 = 0; + i1 = matches.length; + } else if (!isSelectedPage) { + return; + } + let lastDivIdx = -1; + let lastOffset = -1; + for (let i = i0; i < i1; i++) { + const match = matches[i]; + const begin = match.begin; + if (begin.divIdx === lastDivIdx && begin.offset === lastOffset) { + continue; + } + lastDivIdx = begin.divIdx; + lastOffset = begin.offset; + const end = match.end; + const isSelected = isSelectedPage && i === selectedMatchIdx; + const highlightSuffix = isSelected ? " selected" : ""; + let selectedLeft = 0; + if (!prevEnd || begin.divIdx !== prevEnd.divIdx) { + if (prevEnd !== null) { + appendTextToDiv(prevEnd.divIdx, prevEnd.offset, infinity.offset); + } + beginText(begin); + } else { + appendTextToDiv(prevEnd.divIdx, prevEnd.offset, begin.offset); + } + if (begin.divIdx === end.divIdx) { + selectedLeft = appendTextToDiv(begin.divIdx, begin.offset, end.offset, "highlight" + highlightSuffix); + } else { + selectedLeft = appendTextToDiv(begin.divIdx, begin.offset, infinity.offset, "highlight begin" + highlightSuffix); + for (let n0 = begin.divIdx + 1, n1 = end.divIdx; n0 < n1; n0++) { + textDivs[n0].className = "highlight middle" + highlightSuffix; + } + beginText(end, "highlight end" + highlightSuffix); + } + prevEnd = end; + if (isSelected) { + findController.scrollMatchIntoView({ + element: textDivs[begin.divIdx], + selectedLeft, + pageIndex: pageIdx, + matchIndex: selectedMatchIdx + }); + } + } + if (prevEnd) { + appendTextToDiv(prevEnd.divIdx, prevEnd.offset, infinity.offset); + } + } + _updateMatches(reset = false) { + if (!this.enabled && !reset) { + return; + } + const { + findController, + matches, + pageIdx + } = this; + const { + textContentItemsStr, + textDivs + } = this; + let clearedUntilDivIdx = -1; + for (const match of matches) { + const begin = Math.max(clearedUntilDivIdx, match.begin.divIdx); + for (let n = begin, end = match.end.divIdx; n <= end; n++) { + const div = textDivs[n]; + div.textContent = textContentItemsStr[n]; + div.className = ""; + } + clearedUntilDivIdx = match.end.divIdx + 1; + } + if (!findController?.highlightMatches || reset) { + return; + } + const pageMatches = findController.pageMatches[pageIdx] || null; + const pageMatchesLength = findController.pageMatchesLength[pageIdx] || null; + this.matches = this._convertMatches(pageMatches, pageMatchesLength); + this._renderMatches(this.matches); + } +} + +;// ./web/text_layer_builder.js + + +class TextLayerBuilder { + #enablePermissions = false; + #onAppend = null; + #renderingDone = false; + #textLayer = null; + static #textLayers = new Map(); + static #selectionChangeAbortController = null; + constructor({ + pdfPage, + highlighter = null, + accessibilityManager = null, + enablePermissions = false, + onAppend = null + }) { + this.pdfPage = pdfPage; + this.highlighter = highlighter; + this.accessibilityManager = accessibilityManager; + this.#enablePermissions = enablePermissions === true; + this.#onAppend = onAppend; + this.div = document.createElement("div"); + this.div.tabIndex = 0; + this.div.className = "textLayer"; + } + async render(viewport, textContentParams = null) { + if (this.#renderingDone && this.#textLayer) { + this.#textLayer.update({ + viewport, + onBefore: this.hide.bind(this) + }); + this.show(); + return; + } + this.cancel(); + this.#textLayer = new TextLayer({ + textContentSource: this.pdfPage.streamTextContent(textContentParams || { + includeMarkedContent: true, + disableNormalization: true + }), + container: this.div, + viewport + }); + const { + textDivs, + textContentItemsStr + } = this.#textLayer; + this.highlighter?.setTextMapping(textDivs, textContentItemsStr); + this.accessibilityManager?.setTextMapping(textDivs); + await this.#textLayer.render(); + this.#renderingDone = true; + const endOfContent = document.createElement("div"); + endOfContent.className = "endOfContent"; + this.div.append(endOfContent); + this.#bindMouse(endOfContent); + this.#onAppend?.(this.div); + this.highlighter?.enable(); + this.accessibilityManager?.enable(); + } + hide() { + if (!this.div.hidden && this.#renderingDone) { + this.highlighter?.disable(); + this.div.hidden = true; + } + } + show() { + if (this.div.hidden && this.#renderingDone) { + this.div.hidden = false; + this.highlighter?.enable(); + } + } + cancel() { + this.#textLayer?.cancel(); + this.#textLayer = null; + this.highlighter?.disable(); + this.accessibilityManager?.disable(); + TextLayerBuilder.#removeGlobalSelectionListener(this.div); + } + #bindMouse(end) { + const { + div + } = this; + div.addEventListener("mousedown", () => { + div.classList.add("selecting"); + }); + div.addEventListener("copy", event => { + if (!this.#enablePermissions) { + const selection = document.getSelection(); + event.clipboardData.setData("text/plain", removeNullCharacters(normalizeUnicode(selection.toString()))); + } + stopEvent(event); + }); + TextLayerBuilder.#textLayers.set(div, end); + TextLayerBuilder.#enableGlobalSelectionListener(); + } + static #removeGlobalSelectionListener(textLayerDiv) { + this.#textLayers.delete(textLayerDiv); + if (this.#textLayers.size === 0) { + this.#selectionChangeAbortController?.abort(); + this.#selectionChangeAbortController = null; + } + } + static #enableGlobalSelectionListener() { + if (this.#selectionChangeAbortController) { + return; + } + this.#selectionChangeAbortController = new AbortController(); + const { + signal + } = this.#selectionChangeAbortController; + const reset = (end, textLayer) => { + textLayer.append(end); + end.style.width = ""; + end.style.height = ""; + textLayer.classList.remove("selecting"); + }; + let isPointerDown = false; + document.addEventListener("pointerdown", () => { + isPointerDown = true; + }, { + signal + }); + document.addEventListener("pointerup", () => { + isPointerDown = false; + this.#textLayers.forEach(reset); + }, { + signal + }); + window.addEventListener("blur", () => { + isPointerDown = false; + this.#textLayers.forEach(reset); + }, { + signal + }); + document.addEventListener("keyup", () => { + if (!isPointerDown) { + this.#textLayers.forEach(reset); + } + }, { + signal + }); + var isFirefox, prevRange; + document.addEventListener("selectionchange", () => { + const selection = document.getSelection(); + if (selection.rangeCount === 0) { + this.#textLayers.forEach(reset); + return; + } + const activeTextLayers = new Set(); + for (let i = 0; i < selection.rangeCount; i++) { + const range = selection.getRangeAt(i); + for (const textLayerDiv of this.#textLayers.keys()) { + if (!activeTextLayers.has(textLayerDiv) && range.intersectsNode(textLayerDiv)) { + activeTextLayers.add(textLayerDiv); + } + } + } + for (const [textLayerDiv, endDiv] of this.#textLayers) { + if (activeTextLayers.has(textLayerDiv)) { + textLayerDiv.classList.add("selecting"); + } else { + reset(endDiv, textLayerDiv); + } + } + isFirefox ??= getComputedStyle(this.#textLayers.values().next().value).getPropertyValue("-moz-user-select") === "none"; + if (isFirefox) { + return; + } + const range = selection.getRangeAt(0); + const modifyStart = prevRange && (range.compareBoundaryPoints(Range.END_TO_END, prevRange) === 0 || range.compareBoundaryPoints(Range.START_TO_END, prevRange) === 0); + let anchor = modifyStart ? range.startContainer : range.endContainer; + if (anchor.nodeType === Node.TEXT_NODE) { + anchor = anchor.parentNode; + } + const parentTextLayer = anchor.parentElement?.closest(".textLayer"); + const endDiv = this.#textLayers.get(parentTextLayer); + if (endDiv) { + endDiv.style.width = parentTextLayer.style.width; + endDiv.style.height = parentTextLayer.style.height; + anchor.parentElement.insertBefore(endDiv, modifyStart ? anchor : anchor.nextSibling); + } + prevRange = range.cloneRange(); + }, { + signal + }); + } +} + +;// ./web/pdf_page_view.js + + + + + + + + + + + + + +const DEFAULT_LAYER_PROPERTIES = null; +const LAYERS_ORDER = new Map([["canvasWrapper", 0], ["textLayer", 1], ["annotationLayer", 2], ["annotationEditorLayer", 3], ["xfaLayer", 3]]); +class PDFPageView { + #annotationMode = AnnotationMode.ENABLE_FORMS; + #canvasWrapper = null; + #enableHWA = false; + #hasRestrictedScaling = false; + #isEditing = false; + #layerProperties = null; + #loadingId = null; + #originalViewport = null; + #previousRotation = null; + #scaleRoundX = 1; + #scaleRoundY = 1; + #renderError = null; + #renderingState = RenderingStates.INITIAL; + #textLayerMode = TextLayerMode.ENABLE; + #useThumbnailCanvas = { + directDrawing: true, + initialOptionalContent: true, + regularAnnotations: true + }; + #layers = [null, null, null, null]; + constructor(options) { + const container = options.container; + const defaultViewport = options.defaultViewport; + this.id = options.id; + this.renderingId = "page" + this.id; + this.#layerProperties = options.layerProperties || DEFAULT_LAYER_PROPERTIES; + this.pdfPage = null; + this.pageLabel = null; + this.rotation = 0; + this.scale = options.scale || DEFAULT_SCALE; + this.viewport = defaultViewport; + this.pdfPageRotate = defaultViewport.rotation; + this._optionalContentConfigPromise = options.optionalContentConfigPromise || null; + this.#textLayerMode = options.textLayerMode ?? TextLayerMode.ENABLE; + this.#annotationMode = options.annotationMode ?? AnnotationMode.ENABLE_FORMS; + this.imageResourcesPath = options.imageResourcesPath || ""; + this.maxCanvasPixels = options.maxCanvasPixels ?? AppOptions.get("maxCanvasPixels"); + this.pageColors = options.pageColors || null; + this.#enableHWA = options.enableHWA || false; + this.eventBus = options.eventBus; + this.renderingQueue = options.renderingQueue; + this.l10n = options.l10n; + this.l10n ||= new genericl10n_GenericL10n(); + this.renderTask = null; + this.resume = null; + this._isStandalone = !this.renderingQueue?.hasViewer(); + this._container = container; + this._annotationCanvasMap = null; + this.annotationLayer = null; + this.annotationEditorLayer = null; + this.textLayer = null; + this.xfaLayer = null; + this.structTreeLayer = null; + this.drawLayer = null; + const div = document.createElement("div"); + div.className = "page"; + div.setAttribute("data-page-number", this.id); + div.setAttribute("role", "region"); + div.setAttribute("data-l10n-id", "pdfjs-page-landmark"); + div.setAttribute("data-l10n-args", JSON.stringify({ + page: this.id + })); + this.div = div; + this.#setDimensions(); + container?.append(div); + if (this._isStandalone) { + container?.style.setProperty("--scale-factor", this.scale * PixelsPerInch.PDF_TO_CSS_UNITS); + if (this.pageColors?.background) { + container?.style.setProperty("--page-bg-color", this.pageColors.background); + } + const { + optionalContentConfigPromise + } = options; + if (optionalContentConfigPromise) { + optionalContentConfigPromise.then(optionalContentConfig => { + if (optionalContentConfigPromise !== this._optionalContentConfigPromise) { + return; + } + this.#useThumbnailCanvas.initialOptionalContent = optionalContentConfig.hasInitialVisibility; + }); + } + if (!options.l10n) { + this.l10n.translate(this.div); + } + } + } + #addLayer(div, name) { + const pos = LAYERS_ORDER.get(name); + const oldDiv = this.#layers[pos]; + this.#layers[pos] = div; + if (oldDiv) { + oldDiv.replaceWith(div); + return; + } + for (let i = pos - 1; i >= 0; i--) { + const layer = this.#layers[i]; + if (layer) { + layer.after(div); + return; + } + } + this.div.prepend(div); + } + get renderingState() { + return this.#renderingState; + } + set renderingState(state) { + if (state === this.#renderingState) { + return; + } + this.#renderingState = state; + if (this.#loadingId) { + clearTimeout(this.#loadingId); + this.#loadingId = null; + } + switch (state) { + case RenderingStates.PAUSED: + this.div.classList.remove("loading"); + break; + case RenderingStates.RUNNING: + this.div.classList.add("loadingIcon"); + this.#loadingId = setTimeout(() => { + this.div.classList.add("loading"); + this.#loadingId = null; + }, 0); + break; + case RenderingStates.INITIAL: + case RenderingStates.FINISHED: + this.div.classList.remove("loadingIcon", "loading"); + break; + } + } + #setDimensions() { + const { + viewport + } = this; + if (this.pdfPage) { + if (this.#previousRotation === viewport.rotation) { + return; + } + this.#previousRotation = viewport.rotation; + } + setLayerDimensions(this.div, viewport, true, false); + } + setPdfPage(pdfPage) { + if (this._isStandalone && (this.pageColors?.foreground === "CanvasText" || this.pageColors?.background === "Canvas")) { + this._container?.style.setProperty("--hcm-highlight-filter", pdfPage.filterFactory.addHighlightHCMFilter("highlight", "CanvasText", "Canvas", "HighlightText", "Highlight")); + this._container?.style.setProperty("--hcm-highlight-selected-filter", pdfPage.filterFactory.addHighlightHCMFilter("highlight_selected", "CanvasText", "Canvas", "HighlightText", "Highlight")); + } + this.pdfPage = pdfPage; + this.pdfPageRotate = pdfPage.rotate; + const totalRotation = (this.rotation + this.pdfPageRotate) % 360; + this.viewport = pdfPage.getViewport({ + scale: this.scale * PixelsPerInch.PDF_TO_CSS_UNITS, + rotation: totalRotation + }); + this.#setDimensions(); + this.reset(); + } + destroy() { + this.reset(); + this.pdfPage?.cleanup(); + } + hasEditableAnnotations() { + return !!this.annotationLayer?.hasEditableAnnotations(); + } + get _textHighlighter() { + return shadow(this, "_textHighlighter", new TextHighlighter({ + pageIndex: this.id - 1, + eventBus: this.eventBus, + findController: this.#layerProperties.findController + })); + } + #dispatchLayerRendered(name, error) { + this.eventBus.dispatch(name, { + source: this, + pageNumber: this.id, + error + }); + } + async #renderAnnotationLayer() { + let error = null; + try { + await this.annotationLayer.render(this.viewport, { + structTreeLayer: this.structTreeLayer + }, "display"); + } catch (ex) { + console.error("#renderAnnotationLayer:", ex); + error = ex; + } finally { + this.#dispatchLayerRendered("annotationlayerrendered", error); + } + } + async #renderAnnotationEditorLayer() { + let error = null; + try { + await this.annotationEditorLayer.render(this.viewport, "display"); + } catch (ex) { + console.error("#renderAnnotationEditorLayer:", ex); + error = ex; + } finally { + this.#dispatchLayerRendered("annotationeditorlayerrendered", error); + } + } + async #renderDrawLayer() { + try { + await this.drawLayer.render("display"); + } catch (ex) { + console.error("#renderDrawLayer:", ex); + } + } + async #renderXfaLayer() { + let error = null; + try { + const result = await this.xfaLayer.render(this.viewport, "display"); + if (result?.textDivs && this._textHighlighter) { + this.#buildXfaTextContentItems(result.textDivs); + } + } catch (ex) { + console.error("#renderXfaLayer:", ex); + error = ex; + } finally { + if (this.xfaLayer?.div) { + this.l10n.pause(); + this.#addLayer(this.xfaLayer.div, "xfaLayer"); + this.l10n.resume(); + } + this.#dispatchLayerRendered("xfalayerrendered", error); + } + } + async #renderTextLayer() { + if (!this.textLayer) { + return; + } + let error = null; + try { + await this.textLayer.render(this.viewport); + } catch (ex) { + if (ex instanceof AbortException) { + return; + } + console.error("#renderTextLayer:", ex); + error = ex; + } + this.#dispatchLayerRendered("textlayerrendered", error); + this.#renderStructTreeLayer(); + } + async #renderStructTreeLayer() { + if (!this.textLayer) { + return; + } + const treeDom = await this.structTreeLayer?.render(); + if (treeDom) { + this.l10n.pause(); + this.structTreeLayer?.addElementsToTextLayer(); + if (this.canvas && treeDom.parentNode !== this.canvas) { + this.canvas.append(treeDom); + } + this.l10n.resume(); + } + this.structTreeLayer?.show(); + } + async #buildXfaTextContentItems(textDivs) { + const text = await this.pdfPage.getTextContent(); + const items = []; + for (const item of text.items) { + items.push(item.str); + } + this._textHighlighter.setTextMapping(textDivs, items); + this._textHighlighter.enable(); + } + #resetCanvas() { + const { + canvas + } = this; + if (!canvas) { + return; + } + canvas.remove(); + canvas.width = canvas.height = 0; + this.canvas = null; + this.#originalViewport = null; + } + reset({ + keepAnnotationLayer = false, + keepAnnotationEditorLayer = false, + keepXfaLayer = false, + keepTextLayer = false, + keepCanvasWrapper = false + } = {}) { + this.cancelRendering({ + keepAnnotationLayer, + keepAnnotationEditorLayer, + keepXfaLayer, + keepTextLayer + }); + this.renderingState = RenderingStates.INITIAL; + const div = this.div; + const childNodes = div.childNodes, + annotationLayerNode = keepAnnotationLayer && this.annotationLayer?.div || null, + annotationEditorLayerNode = keepAnnotationEditorLayer && this.annotationEditorLayer?.div || null, + xfaLayerNode = keepXfaLayer && this.xfaLayer?.div || null, + textLayerNode = keepTextLayer && this.textLayer?.div || null, + canvasWrapperNode = keepCanvasWrapper && this.#canvasWrapper || null; + for (let i = childNodes.length - 1; i >= 0; i--) { + const node = childNodes[i]; + switch (node) { + case annotationLayerNode: + case annotationEditorLayerNode: + case xfaLayerNode: + case textLayerNode: + case canvasWrapperNode: + continue; + } + node.remove(); + const layerIndex = this.#layers.indexOf(node); + if (layerIndex >= 0) { + this.#layers[layerIndex] = null; + } + } + div.removeAttribute("data-loaded"); + if (annotationLayerNode) { + this.annotationLayer.hide(); + } + if (annotationEditorLayerNode) { + this.annotationEditorLayer.hide(); + } + if (xfaLayerNode) { + this.xfaLayer.hide(); + } + if (textLayerNode) { + this.textLayer.hide(); + } + this.structTreeLayer?.hide(); + if (!keepCanvasWrapper && this.#canvasWrapper) { + this.#canvasWrapper = null; + this.#resetCanvas(); + } + } + toggleEditingMode(isEditing) { + if (!this.hasEditableAnnotations()) { + return; + } + this.#isEditing = isEditing; + this.reset({ + keepAnnotationLayer: true, + keepAnnotationEditorLayer: true, + keepXfaLayer: true, + keepTextLayer: true, + keepCanvasWrapper: true + }); + } + update({ + scale = 0, + rotation = null, + optionalContentConfigPromise = null, + drawingDelay = -1 + }) { + this.scale = scale || this.scale; + if (typeof rotation === "number") { + this.rotation = rotation; + } + if (optionalContentConfigPromise instanceof Promise) { + this._optionalContentConfigPromise = optionalContentConfigPromise; + optionalContentConfigPromise.then(optionalContentConfig => { + if (optionalContentConfigPromise !== this._optionalContentConfigPromise) { + return; + } + this.#useThumbnailCanvas.initialOptionalContent = optionalContentConfig.hasInitialVisibility; + }); + } + this.#useThumbnailCanvas.directDrawing = true; + const totalRotation = (this.rotation + this.pdfPageRotate) % 360; + this.viewport = this.viewport.clone({ + scale: this.scale * PixelsPerInch.PDF_TO_CSS_UNITS, + rotation: totalRotation + }); + this.#setDimensions(); + if (this._isStandalone) { + this._container?.style.setProperty("--scale-factor", this.viewport.scale); + } + if (this.canvas) { + let onlyCssZoom = false; + if (this.#hasRestrictedScaling) { + if (this.maxCanvasPixels === 0) { + onlyCssZoom = true; + } else if (this.maxCanvasPixels > 0) { + const { + width, + height + } = this.viewport; + const { + sx, + sy + } = this.outputScale; + onlyCssZoom = (Math.floor(width) * sx | 0) * (Math.floor(height) * sy | 0) > this.maxCanvasPixels; + } + } + const postponeDrawing = drawingDelay >= 0 && drawingDelay < 1000; + if (postponeDrawing || onlyCssZoom) { + if (postponeDrawing && !onlyCssZoom && this.renderingState !== RenderingStates.FINISHED) { + this.cancelRendering({ + keepAnnotationLayer: true, + keepAnnotationEditorLayer: true, + keepXfaLayer: true, + keepTextLayer: true, + cancelExtraDelay: drawingDelay + }); + this.renderingState = RenderingStates.FINISHED; + this.#useThumbnailCanvas.directDrawing = false; + } + this.cssTransform({ + redrawAnnotationLayer: true, + redrawAnnotationEditorLayer: true, + redrawXfaLayer: true, + redrawTextLayer: !postponeDrawing, + hideTextLayer: postponeDrawing + }); + if (postponeDrawing) { + return; + } + this.eventBus.dispatch("pagerendered", { + source: this, + pageNumber: this.id, + cssTransform: true, + timestamp: performance.now(), + error: this.#renderError + }); + return; + } + } + this.cssTransform({}); + this.reset({ + keepAnnotationLayer: true, + keepAnnotationEditorLayer: true, + keepXfaLayer: true, + keepTextLayer: true, + keepCanvasWrapper: true + }); + } + cancelRendering({ + keepAnnotationLayer = false, + keepAnnotationEditorLayer = false, + keepXfaLayer = false, + keepTextLayer = false, + cancelExtraDelay = 0 + } = {}) { + if (this.renderTask) { + this.renderTask.cancel(cancelExtraDelay); + this.renderTask = null; + } + this.resume = null; + if (this.textLayer && (!keepTextLayer || !this.textLayer.div)) { + this.textLayer.cancel(); + this.textLayer = null; + } + if (this.annotationLayer && (!keepAnnotationLayer || !this.annotationLayer.div)) { + this.annotationLayer.cancel(); + this.annotationLayer = null; + this._annotationCanvasMap = null; + } + if (this.structTreeLayer && !this.textLayer) { + this.structTreeLayer = null; + } + if (this.annotationEditorLayer && (!keepAnnotationEditorLayer || !this.annotationEditorLayer.div)) { + if (this.drawLayer) { + this.drawLayer.cancel(); + this.drawLayer = null; + } + this.annotationEditorLayer.cancel(); + this.annotationEditorLayer = null; + } + if (this.xfaLayer && (!keepXfaLayer || !this.xfaLayer.div)) { + this.xfaLayer.cancel(); + this.xfaLayer = null; + this._textHighlighter?.disable(); + } + } + cssTransform({ + redrawAnnotationLayer = false, + redrawAnnotationEditorLayer = false, + redrawXfaLayer = false, + redrawTextLayer = false, + hideTextLayer = false + }) { + const { + canvas + } = this; + if (!canvas) { + return; + } + const originalViewport = this.#originalViewport; + if (this.viewport !== originalViewport) { + const relativeRotation = (360 + this.viewport.rotation - originalViewport.rotation) % 360; + if (relativeRotation === 90 || relativeRotation === 270) { + const { + width, + height + } = this.viewport; + const scaleX = height / width; + const scaleY = width / height; + canvas.style.transform = `rotate(${relativeRotation}deg) scale(${scaleX},${scaleY})`; + } else { + canvas.style.transform = relativeRotation === 0 ? "" : `rotate(${relativeRotation}deg)`; + } + } + if (redrawAnnotationLayer && this.annotationLayer) { + this.#renderAnnotationLayer(); + } + if (redrawAnnotationEditorLayer && this.annotationEditorLayer) { + if (this.drawLayer) { + this.#renderDrawLayer(); + } + this.#renderAnnotationEditorLayer(); + } + if (redrawXfaLayer && this.xfaLayer) { + this.#renderXfaLayer(); + } + if (this.textLayer) { + if (hideTextLayer) { + this.textLayer.hide(); + this.structTreeLayer?.hide(); + } else if (redrawTextLayer) { + this.#renderTextLayer(); + } + } + } + get width() { + return this.viewport.width; + } + get height() { + return this.viewport.height; + } + getPagePoint(x, y) { + return this.viewport.convertToPdfPoint(x, y); + } + async #finishRenderTask(renderTask, error = null) { + if (renderTask === this.renderTask) { + this.renderTask = null; + } + if (error instanceof RenderingCancelledException) { + this.#renderError = null; + return; + } + this.#renderError = error; + this.renderingState = RenderingStates.FINISHED; + this.#useThumbnailCanvas.regularAnnotations = !renderTask.separateAnnots; + this.eventBus.dispatch("pagerendered", { + source: this, + pageNumber: this.id, + cssTransform: false, + timestamp: performance.now(), + error: this.#renderError + }); + if (error) { + throw error; + } + } + async draw() { + if (this.renderingState !== RenderingStates.INITIAL) { + console.error("Must be in new state before drawing"); + this.reset(); + } + const { + div, + l10n, + pageColors, + pdfPage, + viewport + } = this; + if (!pdfPage) { + this.renderingState = RenderingStates.FINISHED; + throw new Error("pdfPage is not loaded"); + } + this.renderingState = RenderingStates.RUNNING; + let canvasWrapper = this.#canvasWrapper; + if (!canvasWrapper) { + canvasWrapper = this.#canvasWrapper = document.createElement("div"); + canvasWrapper.classList.add("canvasWrapper"); + this.#addLayer(canvasWrapper, "canvasWrapper"); + } + if (!this.textLayer && this.#textLayerMode !== TextLayerMode.DISABLE && !pdfPage.isPureXfa) { + this._accessibilityManager ||= new TextAccessibilityManager(); + this.textLayer = new TextLayerBuilder({ + pdfPage, + highlighter: this._textHighlighter, + accessibilityManager: this._accessibilityManager, + enablePermissions: this.#textLayerMode === TextLayerMode.ENABLE_PERMISSIONS, + onAppend: textLayerDiv => { + this.l10n.pause(); + this.#addLayer(textLayerDiv, "textLayer"); + this.l10n.resume(); + } + }); + } + if (!this.annotationLayer && this.#annotationMode !== AnnotationMode.DISABLE) { + const { + annotationStorage, + annotationEditorUIManager, + downloadManager, + enableScripting, + fieldObjectsPromise, + hasJSActionsPromise, + linkService + } = this.#layerProperties; + this._annotationCanvasMap ||= new Map(); + this.annotationLayer = new AnnotationLayerBuilder({ + pdfPage, + annotationStorage, + imageResourcesPath: this.imageResourcesPath, + renderForms: this.#annotationMode === AnnotationMode.ENABLE_FORMS, + linkService, + downloadManager, + enableScripting, + hasJSActionsPromise, + fieldObjectsPromise, + annotationCanvasMap: this._annotationCanvasMap, + accessibilityManager: this._accessibilityManager, + annotationEditorUIManager, + onAppend: annotationLayerDiv => { + this.#addLayer(annotationLayerDiv, "annotationLayer"); + } + }); + } + const renderContinueCallback = cont => { + showCanvas?.(false); + if (this.renderingQueue && !this.renderingQueue.isHighestPriority(this)) { + this.renderingState = RenderingStates.PAUSED; + this.resume = () => { + this.renderingState = RenderingStates.RUNNING; + cont(); + }; + return; + } + cont(); + }; + const { + width, + height + } = viewport; + const canvas = document.createElement("canvas"); + canvas.setAttribute("role", "presentation"); + const hasHCM = !!(pageColors?.background && pageColors?.foreground); + const prevCanvas = this.canvas; + const updateOnFirstShow = !prevCanvas && !hasHCM; + this.canvas = canvas; + this.#originalViewport = viewport; + let showCanvas = isLastShow => { + if (updateOnFirstShow) { + canvasWrapper.prepend(canvas); + showCanvas = null; + return; + } + if (!isLastShow) { + return; + } + if (prevCanvas) { + prevCanvas.replaceWith(canvas); + prevCanvas.width = prevCanvas.height = 0; + } else { + canvasWrapper.prepend(canvas); + } + showCanvas = null; + }; + const ctx = canvas.getContext("2d", { + alpha: false, + willReadFrequently: !this.#enableHWA + }); + const outputScale = this.outputScale = new OutputScale(); + if (this.maxCanvasPixels === 0) { + const invScale = 1 / this.scale; + outputScale.sx *= invScale; + outputScale.sy *= invScale; + this.#hasRestrictedScaling = true; + } else if (this.maxCanvasPixels > 0) { + const pixelsInViewport = width * height; + const maxScale = Math.sqrt(this.maxCanvasPixels / pixelsInViewport); + if (outputScale.sx > maxScale || outputScale.sy > maxScale) { + outputScale.sx = maxScale; + outputScale.sy = maxScale; + this.#hasRestrictedScaling = true; + } else { + this.#hasRestrictedScaling = false; + } + } + const sfx = approximateFraction(outputScale.sx); + const sfy = approximateFraction(outputScale.sy); + const canvasWidth = canvas.width = floorToDivide(calcRound(width * outputScale.sx), sfx[0]); + const canvasHeight = canvas.height = floorToDivide(calcRound(height * outputScale.sy), sfy[0]); + const pageWidth = floorToDivide(calcRound(width), sfx[1]); + const pageHeight = floorToDivide(calcRound(height), sfy[1]); + outputScale.sx = canvasWidth / pageWidth; + outputScale.sy = canvasHeight / pageHeight; + if (this.#scaleRoundX !== sfx[1]) { + div.style.setProperty("--scale-round-x", `${sfx[1]}px`); + this.#scaleRoundX = sfx[1]; + } + if (this.#scaleRoundY !== sfy[1]) { + div.style.setProperty("--scale-round-y", `${sfy[1]}px`); + this.#scaleRoundY = sfy[1]; + } + const transform = outputScale.scaled ? [outputScale.sx, 0, 0, outputScale.sy, 0, 0] : null; + const renderContext = { + canvasContext: ctx, + transform, + viewport, + annotationMode: this.#annotationMode, + optionalContentConfigPromise: this._optionalContentConfigPromise, + annotationCanvasMap: this._annotationCanvasMap, + pageColors, + isEditing: this.#isEditing + }; + const renderTask = this.renderTask = pdfPage.render(renderContext); + renderTask.onContinue = renderContinueCallback; + const resultPromise = renderTask.promise.then(async () => { + showCanvas?.(true); + await this.#finishRenderTask(renderTask); + this.structTreeLayer ||= new StructTreeLayerBuilder(pdfPage, viewport.rawDims); + this.#renderTextLayer(); + if (this.annotationLayer) { + await this.#renderAnnotationLayer(); + } + const { + annotationEditorUIManager + } = this.#layerProperties; + if (!annotationEditorUIManager) { + return; + } + this.drawLayer ||= new DrawLayerBuilder({ + pageIndex: this.id + }); + await this.#renderDrawLayer(); + this.drawLayer.setParent(canvasWrapper); + this.annotationEditorLayer ||= new AnnotationEditorLayerBuilder({ + uiManager: annotationEditorUIManager, + pdfPage, + l10n, + structTreeLayer: this.structTreeLayer, + accessibilityManager: this._accessibilityManager, + annotationLayer: this.annotationLayer?.annotationLayer, + textLayer: this.textLayer, + drawLayer: this.drawLayer.getDrawLayer(), + onAppend: annotationEditorLayerDiv => { + this.#addLayer(annotationEditorLayerDiv, "annotationEditorLayer"); + } + }); + this.#renderAnnotationEditorLayer(); + }, error => { + if (!(error instanceof RenderingCancelledException)) { + showCanvas?.(true); + } else { + prevCanvas?.remove(); + this.#resetCanvas(); + } + return this.#finishRenderTask(renderTask, error); + }); + if (pdfPage.isPureXfa) { + if (!this.xfaLayer) { + const { + annotationStorage, + linkService + } = this.#layerProperties; + this.xfaLayer = new XfaLayerBuilder({ + pdfPage, + annotationStorage, + linkService + }); + } + this.#renderXfaLayer(); + } + div.setAttribute("data-loaded", true); + this.eventBus.dispatch("pagerender", { + source: this, + pageNumber: this.id + }); + return resultPromise; + } + setPageLabel(label) { + this.pageLabel = typeof label === "string" ? label : null; + this.div.setAttribute("data-l10n-args", JSON.stringify({ + page: this.pageLabel ?? this.id + })); + if (this.pageLabel !== null) { + this.div.setAttribute("data-page-label", this.pageLabel); + } else { + this.div.removeAttribute("data-page-label"); + } + } + get thumbnailCanvas() { + const { + directDrawing, + initialOptionalContent, + regularAnnotations + } = this.#useThumbnailCanvas; + return directDrawing && initialOptionalContent && regularAnnotations ? this.canvas : null; + } +} + +;// ./web/pdf_viewer.js + + + + + + +const DEFAULT_CACHE_SIZE = 10; +const PagesCountLimit = { + FORCE_SCROLL_MODE_PAGE: 10000, + FORCE_LAZY_PAGE_INIT: 5000, + PAUSE_EAGER_PAGE_INIT: 250 +}; +function isValidAnnotationEditorMode(mode) { + return Object.values(AnnotationEditorType).includes(mode) && mode !== AnnotationEditorType.DISABLE; +} +class PDFPageViewBuffer { + #buf = new Set(); + #size = 0; + constructor(size) { + this.#size = size; + } + push(view) { + const buf = this.#buf; + if (buf.has(view)) { + buf.delete(view); + } + buf.add(view); + if (buf.size > this.#size) { + this.#destroyFirstView(); + } + } + resize(newSize, idsToKeep = null) { + this.#size = newSize; + const buf = this.#buf; + if (idsToKeep) { + const ii = buf.size; + let i = 1; + for (const view of buf) { + if (idsToKeep.has(view.id)) { + buf.delete(view); + buf.add(view); + } + if (++i > ii) { + break; + } + } + } + while (buf.size > this.#size) { + this.#destroyFirstView(); + } + } + has(view) { + return this.#buf.has(view); + } + [Symbol.iterator]() { + return this.#buf.keys(); + } + #destroyFirstView() { + const firstView = this.#buf.keys().next().value; + firstView?.destroy(); + this.#buf.delete(firstView); + } +} +class PDFViewer { + #buffer = null; + #altTextManager = null; + #annotationEditorHighlightColors = null; + #annotationEditorMode = AnnotationEditorType.NONE; + #annotationEditorUIManager = null; + #annotationMode = AnnotationMode.ENABLE_FORMS; + #containerTopLeft = null; + #editorUndoBar = null; + #enableHWA = false; + #enableHighlightFloatingButton = false; + #enablePermissions = false; + #enableUpdatedAddImage = false; + #enableNewAltTextWhenAddingImage = false; + #eventAbortController = null; + #mlManager = null; + #switchAnnotationEditorModeAC = null; + #switchAnnotationEditorModeTimeoutId = null; + #getAllTextInProgress = false; + #hiddenCopyElement = null; + #interruptCopyCondition = false; + #previousContainerHeight = 0; + #resizeObserver = new ResizeObserver(this.#resizeObserverCallback.bind(this)); + #scrollModePageState = null; + #scaleTimeoutId = null; + #supportsPinchToZoom = true; + #textLayerMode = TextLayerMode.ENABLE; + constructor(options) { + const viewerVersion = "4.10.38"; + if (version !== viewerVersion) { + throw new Error(`The API version "${version}" does not match the Viewer version "${viewerVersion}".`); + } + this.container = options.container; + this.viewer = options.viewer || options.container.firstElementChild; + if (this.container?.tagName !== "DIV" || this.viewer?.tagName !== "DIV") { + throw new Error("Invalid `container` and/or `viewer` option."); + } + if (this.container.offsetParent && getComputedStyle(this.container).position !== "absolute") { + throw new Error("The `container` must be absolutely positioned."); + } + this.#resizeObserver.observe(this.container); + this.eventBus = options.eventBus; + this.linkService = options.linkService || new SimpleLinkService(); + this.downloadManager = options.downloadManager || null; + this.findController = options.findController || null; + this.#altTextManager = options.altTextManager || null; + this.#editorUndoBar = options.editorUndoBar || null; + if (this.findController) { + this.findController.onIsPageVisible = pageNumber => this._getVisiblePages().ids.has(pageNumber); + } + this._scriptingManager = options.scriptingManager || null; + this.#textLayerMode = options.textLayerMode ?? TextLayerMode.ENABLE; + this.#annotationMode = options.annotationMode ?? AnnotationMode.ENABLE_FORMS; + this.#annotationEditorMode = options.annotationEditorMode ?? AnnotationEditorType.NONE; + this.#annotationEditorHighlightColors = options.annotationEditorHighlightColors || null; + this.#enableHighlightFloatingButton = options.enableHighlightFloatingButton === true; + this.#enableUpdatedAddImage = options.enableUpdatedAddImage === true; + this.#enableNewAltTextWhenAddingImage = options.enableNewAltTextWhenAddingImage === true; + this.imageResourcesPath = options.imageResourcesPath || ""; + this.enablePrintAutoRotate = options.enablePrintAutoRotate || false; + this.removePageBorders = options.removePageBorders || false; + this.maxCanvasPixels = options.maxCanvasPixels; + this.l10n = options.l10n; + this.l10n ||= new genericl10n_GenericL10n(); + this.#enablePermissions = options.enablePermissions || false; + this.pageColors = options.pageColors || null; + this.#mlManager = options.mlManager || null; + this.#enableHWA = options.enableHWA || false; + this.#supportsPinchToZoom = options.supportsPinchToZoom !== false; + this.defaultRenderingQueue = !options.renderingQueue; + if (this.defaultRenderingQueue) { + this.renderingQueue = new PDFRenderingQueue(); + this.renderingQueue.setViewer(this); + } else { + this.renderingQueue = options.renderingQueue; + } + const { + abortSignal + } = options; + abortSignal?.addEventListener("abort", () => { + this.#resizeObserver.disconnect(); + this.#resizeObserver = null; + }, { + once: true + }); + this.scroll = watchScroll(this.container, this._scrollUpdate.bind(this), abortSignal); + this.presentationModeState = PresentationModeState.UNKNOWN; + this._resetView(); + if (this.removePageBorders) { + this.viewer.classList.add("removePageBorders"); + } + this.#updateContainerHeightCss(); + this.eventBus._on("thumbnailrendered", ({ + pageNumber, + pdfPage + }) => { + const pageView = this._pages[pageNumber - 1]; + if (!this.#buffer.has(pageView)) { + pdfPage?.cleanup(); + } + }); + if (!options.l10n) { + this.l10n.translate(this.container); + } + } + get pagesCount() { + return this._pages.length; + } + getPageView(index) { + return this._pages[index]; + } + getCachedPageViews() { + return new Set(this.#buffer); + } + get pageViewsReady() { + return this._pages.every(pageView => pageView?.pdfPage); + } + get renderForms() { + return this.#annotationMode === AnnotationMode.ENABLE_FORMS; + } + get enableScripting() { + return !!this._scriptingManager; + } + get currentPageNumber() { + return this._currentPageNumber; + } + set currentPageNumber(val) { + if (!Number.isInteger(val)) { + throw new Error("Invalid page number."); + } + if (!this.pdfDocument) { + return; + } + if (!this._setCurrentPageNumber(val, true)) { + console.error(`currentPageNumber: "${val}" is not a valid page.`); + } + } + _setCurrentPageNumber(val, resetCurrentPageView = false) { + if (this._currentPageNumber === val) { + if (resetCurrentPageView) { + this.#resetCurrentPageView(); + } + return true; + } + if (!(0 < val && val <= this.pagesCount)) { + return false; + } + const previous = this._currentPageNumber; + this._currentPageNumber = val; + this.eventBus.dispatch("pagechanging", { + source: this, + pageNumber: val, + pageLabel: this._pageLabels?.[val - 1] ?? null, + previous + }); + if (resetCurrentPageView) { + this.#resetCurrentPageView(); + } + return true; + } + get currentPageLabel() { + return this._pageLabels?.[this._currentPageNumber - 1] ?? null; + } + set currentPageLabel(val) { + if (!this.pdfDocument) { + return; + } + let page = val | 0; + if (this._pageLabels) { + const i = this._pageLabels.indexOf(val); + if (i >= 0) { + page = i + 1; + } + } + if (!this._setCurrentPageNumber(page, true)) { + console.error(`currentPageLabel: "${val}" is not a valid page.`); + } + } + get currentScale() { + return this._currentScale !== UNKNOWN_SCALE ? this._currentScale : DEFAULT_SCALE; + } + set currentScale(val) { + if (isNaN(val)) { + throw new Error("Invalid numeric scale."); + } + if (!this.pdfDocument) { + return; + } + this.#setScale(val, { + noScroll: false + }); + } + get currentScaleValue() { + return this._currentScaleValue; + } + set currentScaleValue(val) { + if (!this.pdfDocument) { + return; + } + this.#setScale(val, { + noScroll: false + }); + } + get pagesRotation() { + return this._pagesRotation; + } + set pagesRotation(rotation) { + if (!isValidRotation(rotation)) { + throw new Error("Invalid pages rotation angle."); + } + if (!this.pdfDocument) { + return; + } + rotation %= 360; + if (rotation < 0) { + rotation += 360; + } + if (this._pagesRotation === rotation) { + return; + } + this._pagesRotation = rotation; + const pageNumber = this._currentPageNumber; + this.refresh(true, { + rotation + }); + if (this._currentScaleValue) { + this.#setScale(this._currentScaleValue, { + noScroll: true + }); + } + this.eventBus.dispatch("rotationchanging", { + source: this, + pagesRotation: rotation, + pageNumber + }); + if (this.defaultRenderingQueue) { + this.update(); + } + } + get firstPagePromise() { + return this.pdfDocument ? this._firstPageCapability.promise : null; + } + get onePageRendered() { + return this.pdfDocument ? this._onePageRenderedCapability.promise : null; + } + get pagesPromise() { + return this.pdfDocument ? this._pagesCapability.promise : null; + } + get _layerProperties() { + const self = this; + return shadow(this, "_layerProperties", { + get annotationEditorUIManager() { + return self.#annotationEditorUIManager; + }, + get annotationStorage() { + return self.pdfDocument?.annotationStorage; + }, + get downloadManager() { + return self.downloadManager; + }, + get enableScripting() { + return !!self._scriptingManager; + }, + get fieldObjectsPromise() { + return self.pdfDocument?.getFieldObjects(); + }, + get findController() { + return self.findController; + }, + get hasJSActionsPromise() { + return self.pdfDocument?.hasJSActions(); + }, + get linkService() { + return self.linkService; + } + }); + } + #initializePermissions(permissions) { + const params = { + annotationEditorMode: this.#annotationEditorMode, + annotationMode: this.#annotationMode, + textLayerMode: this.#textLayerMode + }; + if (!permissions) { + return params; + } + if (!permissions.includes(PermissionFlag.COPY) && this.#textLayerMode === TextLayerMode.ENABLE) { + params.textLayerMode = TextLayerMode.ENABLE_PERMISSIONS; + } + if (!permissions.includes(PermissionFlag.MODIFY_CONTENTS)) { + params.annotationEditorMode = AnnotationEditorType.DISABLE; + } + if (!permissions.includes(PermissionFlag.MODIFY_ANNOTATIONS) && !permissions.includes(PermissionFlag.FILL_INTERACTIVE_FORMS) && this.#annotationMode === AnnotationMode.ENABLE_FORMS) { + params.annotationMode = AnnotationMode.ENABLE; + } + return params; + } + async #onePageRenderedOrForceFetch(signal) { + if (document.visibilityState === "hidden" || !this.container.offsetParent || this._getVisiblePages().views.length === 0) { + return; + } + const hiddenCapability = Promise.withResolvers(), + ac = new AbortController(); + document.addEventListener("visibilitychange", () => { + if (document.visibilityState === "hidden") { + hiddenCapability.resolve(); + } + }, { + signal: typeof AbortSignal.any === "function" ? AbortSignal.any([signal, ac.signal]) : signal + }); + await Promise.race([this._onePageRenderedCapability.promise, hiddenCapability.promise]); + ac.abort(); + } + async getAllText() { + const texts = []; + const buffer = []; + for (let pageNum = 1, pagesCount = this.pdfDocument.numPages; pageNum <= pagesCount; ++pageNum) { + if (this.#interruptCopyCondition) { + return null; + } + buffer.length = 0; + const page = await this.pdfDocument.getPage(pageNum); + const { + items + } = await page.getTextContent(); + for (const item of items) { + if (item.str) { + buffer.push(item.str); + } + if (item.hasEOL) { + buffer.push("\n"); + } + } + texts.push(removeNullCharacters(buffer.join(""))); + } + return texts.join("\n"); + } + #copyCallback(textLayerMode, event) { + const selection = document.getSelection(); + const { + focusNode, + anchorNode + } = selection; + if (anchorNode && focusNode && selection.containsNode(this.#hiddenCopyElement)) { + if (this.#getAllTextInProgress || textLayerMode === TextLayerMode.ENABLE_PERMISSIONS) { + stopEvent(event); + return; + } + this.#getAllTextInProgress = true; + const { + classList + } = this.viewer; + classList.add("copyAll"); + const ac = new AbortController(); + window.addEventListener("keydown", ev => this.#interruptCopyCondition = ev.key === "Escape", { + signal: ac.signal + }); + this.getAllText().then(async text => { + if (text !== null) { + await navigator.clipboard.writeText(text); + } + }).catch(reason => { + console.warn(`Something goes wrong when extracting the text: ${reason.message}`); + }).finally(() => { + this.#getAllTextInProgress = false; + this.#interruptCopyCondition = false; + ac.abort(); + classList.remove("copyAll"); + }); + stopEvent(event); + } + } + setDocument(pdfDocument) { + if (this.pdfDocument) { + this.eventBus.dispatch("pagesdestroy", { + source: this + }); + this._cancelRendering(); + this._resetView(); + this.findController?.setDocument(null); + this._scriptingManager?.setDocument(null); + this.#annotationEditorUIManager?.destroy(); + this.#annotationEditorUIManager = null; + } + this.pdfDocument = pdfDocument; + if (!pdfDocument) { + return; + } + const pagesCount = pdfDocument.numPages; + const firstPagePromise = pdfDocument.getPage(1); + const optionalContentConfigPromise = pdfDocument.getOptionalContentConfig({ + intent: "display" + }); + const permissionsPromise = this.#enablePermissions ? pdfDocument.getPermissions() : Promise.resolve(); + const { + eventBus, + pageColors, + viewer + } = this; + this.#eventAbortController = new AbortController(); + const { + signal + } = this.#eventAbortController; + if (pagesCount > PagesCountLimit.FORCE_SCROLL_MODE_PAGE) { + console.warn("Forcing PAGE-scrolling for performance reasons, given the length of the document."); + const mode = this._scrollMode = ScrollMode.PAGE; + eventBus.dispatch("scrollmodechanged", { + source: this, + mode + }); + } + this._pagesCapability.promise.then(() => { + eventBus.dispatch("pagesloaded", { + source: this, + pagesCount + }); + }, () => {}); + const onBeforeDraw = evt => { + const pageView = this._pages[evt.pageNumber - 1]; + if (!pageView) { + return; + } + this.#buffer.push(pageView); + }; + eventBus._on("pagerender", onBeforeDraw, { + signal + }); + const onAfterDraw = evt => { + if (evt.cssTransform) { + return; + } + this._onePageRenderedCapability.resolve({ + timestamp: evt.timestamp + }); + eventBus._off("pagerendered", onAfterDraw); + }; + eventBus._on("pagerendered", onAfterDraw, { + signal + }); + Promise.all([firstPagePromise, permissionsPromise]).then(([firstPdfPage, permissions]) => { + if (pdfDocument !== this.pdfDocument) { + return; + } + this._firstPageCapability.resolve(firstPdfPage); + this._optionalContentConfigPromise = optionalContentConfigPromise; + const { + annotationEditorMode, + annotationMode, + textLayerMode + } = this.#initializePermissions(permissions); + if (textLayerMode !== TextLayerMode.DISABLE) { + const element = this.#hiddenCopyElement = document.createElement("div"); + element.id = "hiddenCopyElement"; + viewer.before(element); + } + if (typeof AbortSignal.any === "function" && annotationEditorMode !== AnnotationEditorType.DISABLE) { + const mode = annotationEditorMode; + if (pdfDocument.isPureXfa) { + console.warn("Warning: XFA-editing is not implemented."); + } else if (isValidAnnotationEditorMode(mode)) { + this.#annotationEditorUIManager = new AnnotationEditorUIManager(this.container, viewer, this.#altTextManager, eventBus, pdfDocument, pageColors, this.#annotationEditorHighlightColors, this.#enableHighlightFloatingButton, this.#enableUpdatedAddImage, this.#enableNewAltTextWhenAddingImage, this.#mlManager, this.#editorUndoBar, this.#supportsPinchToZoom); + eventBus.dispatch("annotationeditoruimanager", { + source: this, + uiManager: this.#annotationEditorUIManager + }); + if (mode !== AnnotationEditorType.NONE) { + if (mode === AnnotationEditorType.STAMP) { + this.#mlManager?.loadModel("altText"); + } + this.#annotationEditorUIManager.updateMode(mode); + } + } else { + console.error(`Invalid AnnotationEditor mode: ${mode}`); + } + } + const viewerElement = this._scrollMode === ScrollMode.PAGE ? null : viewer; + const scale = this.currentScale; + const viewport = firstPdfPage.getViewport({ + scale: scale * PixelsPerInch.PDF_TO_CSS_UNITS + }); + viewer.style.setProperty("--scale-factor", viewport.scale); + if (pageColors?.background) { + viewer.style.setProperty("--page-bg-color", pageColors.background); + } + if (pageColors?.foreground === "CanvasText" || pageColors?.background === "Canvas") { + viewer.style.setProperty("--hcm-highlight-filter", pdfDocument.filterFactory.addHighlightHCMFilter("highlight", "CanvasText", "Canvas", "HighlightText", "Highlight")); + viewer.style.setProperty("--hcm-highlight-selected-filter", pdfDocument.filterFactory.addHighlightHCMFilter("highlight_selected", "CanvasText", "Canvas", "HighlightText", "ButtonText")); + } + for (let pageNum = 1; pageNum <= pagesCount; ++pageNum) { + const pageView = new PDFPageView({ + container: viewerElement, + eventBus, + id: pageNum, + scale, + defaultViewport: viewport.clone(), + optionalContentConfigPromise, + renderingQueue: this.renderingQueue, + textLayerMode, + annotationMode, + imageResourcesPath: this.imageResourcesPath, + maxCanvasPixels: this.maxCanvasPixels, + pageColors, + l10n: this.l10n, + layerProperties: this._layerProperties, + enableHWA: this.#enableHWA + }); + this._pages.push(pageView); + } + this._pages[0]?.setPdfPage(firstPdfPage); + if (this._scrollMode === ScrollMode.PAGE) { + this.#ensurePageViewVisible(); + } else if (this._spreadMode !== SpreadMode.NONE) { + this._updateSpreadMode(); + } + this.#onePageRenderedOrForceFetch(signal).then(async () => { + if (pdfDocument !== this.pdfDocument) { + return; + } + this.findController?.setDocument(pdfDocument); + this._scriptingManager?.setDocument(pdfDocument); + if (this.#hiddenCopyElement) { + document.addEventListener("copy", this.#copyCallback.bind(this, textLayerMode), { + signal + }); + } + if (this.#annotationEditorUIManager) { + eventBus.dispatch("annotationeditormodechanged", { + source: this, + mode: this.#annotationEditorMode + }); + } + if (pdfDocument.loadingParams.disableAutoFetch || pagesCount > PagesCountLimit.FORCE_LAZY_PAGE_INIT) { + this._pagesCapability.resolve(); + return; + } + let getPagesLeft = pagesCount - 1; + if (getPagesLeft <= 0) { + this._pagesCapability.resolve(); + return; + } + for (let pageNum = 2; pageNum <= pagesCount; ++pageNum) { + const promise = pdfDocument.getPage(pageNum).then(pdfPage => { + const pageView = this._pages[pageNum - 1]; + if (!pageView.pdfPage) { + pageView.setPdfPage(pdfPage); + } + if (--getPagesLeft === 0) { + this._pagesCapability.resolve(); + } + }, reason => { + console.error(`Unable to get page ${pageNum} to initialize viewer`, reason); + if (--getPagesLeft === 0) { + this._pagesCapability.resolve(); + } + }); + if (pageNum % PagesCountLimit.PAUSE_EAGER_PAGE_INIT === 0) { + await promise; + } + } + }); + eventBus.dispatch("pagesinit", { + source: this + }); + pdfDocument.getMetadata().then(({ + info + }) => { + if (pdfDocument !== this.pdfDocument) { + return; + } + if (info.Language) { + viewer.lang = info.Language; + } + }); + if (this.defaultRenderingQueue) { + this.update(); + } + }).catch(reason => { + console.error("Unable to initialize viewer", reason); + this._pagesCapability.reject(reason); + }); + } + setPageLabels(labels) { + if (!this.pdfDocument) { + return; + } + if (!labels) { + this._pageLabels = null; + } else if (!(Array.isArray(labels) && this.pdfDocument.numPages === labels.length)) { + this._pageLabels = null; + console.error(`setPageLabels: Invalid page labels.`); + } else { + this._pageLabels = labels; + } + for (let i = 0, ii = this._pages.length; i < ii; i++) { + this._pages[i].setPageLabel(this._pageLabels?.[i] ?? null); + } + } + _resetView() { + this._pages = []; + this._currentPageNumber = 1; + this._currentScale = UNKNOWN_SCALE; + this._currentScaleValue = null; + this._pageLabels = null; + this.#buffer = new PDFPageViewBuffer(DEFAULT_CACHE_SIZE); + this._location = null; + this._pagesRotation = 0; + this._optionalContentConfigPromise = null; + this._firstPageCapability = Promise.withResolvers(); + this._onePageRenderedCapability = Promise.withResolvers(); + this._pagesCapability = Promise.withResolvers(); + this._scrollMode = ScrollMode.VERTICAL; + this._previousScrollMode = ScrollMode.UNKNOWN; + this._spreadMode = SpreadMode.NONE; + this.#scrollModePageState = { + previousPageNumber: 1, + scrollDown: true, + pages: [] + }; + this.#eventAbortController?.abort(); + this.#eventAbortController = null; + this.viewer.textContent = ""; + this._updateScrollMode(); + this.viewer.removeAttribute("lang"); + this.#hiddenCopyElement?.remove(); + this.#hiddenCopyElement = null; + this.#cleanupSwitchAnnotationEditorMode(); + } + #ensurePageViewVisible() { + if (this._scrollMode !== ScrollMode.PAGE) { + throw new Error("#ensurePageViewVisible: Invalid scrollMode value."); + } + const pageNumber = this._currentPageNumber, + state = this.#scrollModePageState, + viewer = this.viewer; + viewer.textContent = ""; + state.pages.length = 0; + if (this._spreadMode === SpreadMode.NONE && !this.isInPresentationMode) { + const pageView = this._pages[pageNumber - 1]; + viewer.append(pageView.div); + state.pages.push(pageView); + } else { + const pageIndexSet = new Set(), + parity = this._spreadMode - 1; + if (parity === -1) { + pageIndexSet.add(pageNumber - 1); + } else if (pageNumber % 2 !== parity) { + pageIndexSet.add(pageNumber - 1); + pageIndexSet.add(pageNumber); + } else { + pageIndexSet.add(pageNumber - 2); + pageIndexSet.add(pageNumber - 1); + } + const spread = document.createElement("div"); + spread.className = "spread"; + if (this.isInPresentationMode) { + const dummyPage = document.createElement("div"); + dummyPage.className = "dummyPage"; + spread.append(dummyPage); + } + for (const i of pageIndexSet) { + const pageView = this._pages[i]; + if (!pageView) { + continue; + } + spread.append(pageView.div); + state.pages.push(pageView); + } + viewer.append(spread); + } + state.scrollDown = pageNumber >= state.previousPageNumber; + state.previousPageNumber = pageNumber; + } + _scrollUpdate() { + if (this.pagesCount === 0) { + return; + } + this.update(); + } + #scrollIntoView(pageView, pageSpot = null) { + const { + div, + id + } = pageView; + if (this._currentPageNumber !== id) { + this._setCurrentPageNumber(id); + } + if (this._scrollMode === ScrollMode.PAGE) { + this.#ensurePageViewVisible(); + this.update(); + } + if (!pageSpot && !this.isInPresentationMode) { + const left = div.offsetLeft + div.clientLeft, + right = left + div.clientWidth; + const { + scrollLeft, + clientWidth + } = this.container; + if (this._scrollMode === ScrollMode.HORIZONTAL || left < scrollLeft || right > scrollLeft + clientWidth) { + pageSpot = { + left: 0, + top: 0 + }; + } + } + scrollIntoView(div, pageSpot); + if (!this._currentScaleValue && this._location) { + this._location = null; + } + } + #isSameScale(newScale) { + return newScale === this._currentScale || Math.abs(newScale - this._currentScale) < 1e-15; + } + #setScaleUpdatePages(newScale, newValue, { + noScroll = false, + preset = false, + drawingDelay = -1, + origin = null + }) { + this._currentScaleValue = newValue.toString(); + if (this.#isSameScale(newScale)) { + if (preset) { + this.eventBus.dispatch("scalechanging", { + source: this, + scale: newScale, + presetValue: newValue + }); + } + return; + } + this.viewer.style.setProperty("--scale-factor", newScale * PixelsPerInch.PDF_TO_CSS_UNITS); + const postponeDrawing = drawingDelay >= 0 && drawingDelay < 1000; + this.refresh(true, { + scale: newScale, + drawingDelay: postponeDrawing ? drawingDelay : -1 + }); + if (postponeDrawing) { + this.#scaleTimeoutId = setTimeout(() => { + this.#scaleTimeoutId = null; + this.refresh(); + }, drawingDelay); + } + const previousScale = this._currentScale; + this._currentScale = newScale; + if (!noScroll) { + let page = this._currentPageNumber, + dest; + if (this._location && !(this.isInPresentationMode || this.isChangingPresentationMode)) { + page = this._location.pageNumber; + dest = [null, { + name: "XYZ" + }, this._location.left, this._location.top, null]; + } + this.scrollPageIntoView({ + pageNumber: page, + destArray: dest, + allowNegativeOffset: true + }); + if (Array.isArray(origin)) { + const scaleDiff = newScale / previousScale - 1; + const [top, left] = this.containerTopLeft; + this.container.scrollLeft += (origin[0] - left) * scaleDiff; + this.container.scrollTop += (origin[1] - top) * scaleDiff; + } + } + this.eventBus.dispatch("scalechanging", { + source: this, + scale: newScale, + presetValue: preset ? newValue : undefined + }); + if (this.defaultRenderingQueue) { + this.update(); + } + } + get #pageWidthScaleFactor() { + if (this._spreadMode !== SpreadMode.NONE && this._scrollMode !== ScrollMode.HORIZONTAL) { + return 2; + } + return 1; + } + #setScale(value, options) { + let scale = parseFloat(value); + if (scale > 0) { + options.preset = false; + this.#setScaleUpdatePages(scale, value, options); + } else { + const currentPage = this._pages[this._currentPageNumber - 1]; + if (!currentPage) { + return; + } + let hPadding = SCROLLBAR_PADDING, + vPadding = VERTICAL_PADDING; + if (this.isInPresentationMode) { + hPadding = vPadding = 4; + if (this._spreadMode !== SpreadMode.NONE) { + hPadding *= 2; + } + } else if (this.removePageBorders) { + hPadding = vPadding = 0; + } else if (this._scrollMode === ScrollMode.HORIZONTAL) { + [hPadding, vPadding] = [vPadding, hPadding]; + } + const pageWidthScale = (this.container.clientWidth - hPadding) / currentPage.width * currentPage.scale / this.#pageWidthScaleFactor; + const pageHeightScale = (this.container.clientHeight - vPadding) / currentPage.height * currentPage.scale; + switch (value) { + case "page-actual": + scale = 1; + break; + case "page-width": + scale = pageWidthScale; + break; + case "page-height": + scale = pageHeightScale; + break; + case "page-fit": + scale = Math.min(pageWidthScale, pageHeightScale); + break; + case "auto": + const horizontalScale = isPortraitOrientation(currentPage) ? pageWidthScale : Math.min(pageHeightScale, pageWidthScale); + scale = Math.min(MAX_AUTO_SCALE, horizontalScale); + break; + default: + console.error(`#setScale: "${value}" is an unknown zoom value.`); + return; + } + options.preset = true; + this.#setScaleUpdatePages(scale, value, options); + } + } + #resetCurrentPageView() { + const pageView = this._pages[this._currentPageNumber - 1]; + if (this.isInPresentationMode) { + this.#setScale(this._currentScaleValue, { + noScroll: true + }); + } + this.#scrollIntoView(pageView); + } + pageLabelToPageNumber(label) { + if (!this._pageLabels) { + return null; + } + const i = this._pageLabels.indexOf(label); + if (i < 0) { + return null; + } + return i + 1; + } + scrollPageIntoView({ + pageNumber, + destArray = null, + allowNegativeOffset = false, + ignoreDestinationZoom = false + }) { + if (!this.pdfDocument) { + return; + } + const pageView = Number.isInteger(pageNumber) && this._pages[pageNumber - 1]; + if (!pageView) { + console.error(`scrollPageIntoView: "${pageNumber}" is not a valid pageNumber parameter.`); + return; + } + if (this.isInPresentationMode || !destArray) { + this._setCurrentPageNumber(pageNumber, true); + return; + } + let x = 0, + y = 0; + let width = 0, + height = 0, + widthScale, + heightScale; + const changeOrientation = pageView.rotation % 180 !== 0; + const pageWidth = (changeOrientation ? pageView.height : pageView.width) / pageView.scale / PixelsPerInch.PDF_TO_CSS_UNITS; + const pageHeight = (changeOrientation ? pageView.width : pageView.height) / pageView.scale / PixelsPerInch.PDF_TO_CSS_UNITS; + let scale = 0; + switch (destArray[1].name) { + case "XYZ": + x = destArray[2]; + y = destArray[3]; + scale = destArray[4]; + x = x !== null ? x : 0; + y = y !== null ? y : pageHeight; + break; + case "Fit": + case "FitB": + scale = "page-fit"; + break; + case "FitH": + case "FitBH": + y = destArray[2]; + scale = "page-width"; + if (y === null && this._location) { + x = this._location.left; + y = this._location.top; + } else if (typeof y !== "number" || y < 0) { + y = pageHeight; + } + break; + case "FitV": + case "FitBV": + x = destArray[2]; + width = pageWidth; + height = pageHeight; + scale = "page-height"; + break; + case "FitR": + x = destArray[2]; + y = destArray[3]; + width = destArray[4] - x; + height = destArray[5] - y; + let hPadding = SCROLLBAR_PADDING, + vPadding = VERTICAL_PADDING; + if (this.removePageBorders) { + hPadding = vPadding = 0; + } + widthScale = (this.container.clientWidth - hPadding) / width / PixelsPerInch.PDF_TO_CSS_UNITS; + heightScale = (this.container.clientHeight - vPadding) / height / PixelsPerInch.PDF_TO_CSS_UNITS; + scale = Math.min(Math.abs(widthScale), Math.abs(heightScale)); + break; + default: + console.error(`scrollPageIntoView: "${destArray[1].name}" is not a valid destination type.`); + return; + } + if (!ignoreDestinationZoom) { + if (scale && scale !== this._currentScale) { + this.currentScaleValue = scale; + } else if (this._currentScale === UNKNOWN_SCALE) { + this.currentScaleValue = DEFAULT_SCALE_VALUE; + } + } + if (scale === "page-fit" && !destArray[4]) { + this.#scrollIntoView(pageView); + return; + } + const boundingRect = [pageView.viewport.convertToViewportPoint(x, y), pageView.viewport.convertToViewportPoint(x + width, y + height)]; + let left = Math.min(boundingRect[0][0], boundingRect[1][0]); + let top = Math.min(boundingRect[0][1], boundingRect[1][1]); + if (!allowNegativeOffset) { + left = Math.max(left, 0); + top = Math.max(top, 0); + } + this.#scrollIntoView(pageView, { + left, + top + }); + } + _updateLocation(firstPage) { + const currentScale = this._currentScale; + const currentScaleValue = this._currentScaleValue; + const normalizedScaleValue = parseFloat(currentScaleValue) === currentScale ? Math.round(currentScale * 10000) / 100 : currentScaleValue; + const pageNumber = firstPage.id; + const currentPageView = this._pages[pageNumber - 1]; + const container = this.container; + const topLeft = currentPageView.getPagePoint(container.scrollLeft - firstPage.x, container.scrollTop - firstPage.y); + const intLeft = Math.round(topLeft[0]); + const intTop = Math.round(topLeft[1]); + let pdfOpenParams = `#page=${pageNumber}`; + if (!this.isInPresentationMode) { + pdfOpenParams += `&zoom=${normalizedScaleValue},${intLeft},${intTop}`; + } + this._location = { + pageNumber, + scale: normalizedScaleValue, + top: intTop, + left: intLeft, + rotation: this._pagesRotation, + pdfOpenParams + }; + } + update() { + const visible = this._getVisiblePages(); + const visiblePages = visible.views, + numVisiblePages = visiblePages.length; + if (numVisiblePages === 0) { + return; + } + const newCacheSize = Math.max(DEFAULT_CACHE_SIZE, 2 * numVisiblePages + 1); + this.#buffer.resize(newCacheSize, visible.ids); + this.renderingQueue.renderHighestPriority(visible); + const isSimpleLayout = this._spreadMode === SpreadMode.NONE && (this._scrollMode === ScrollMode.PAGE || this._scrollMode === ScrollMode.VERTICAL); + const currentId = this._currentPageNumber; + let stillFullyVisible = false; + for (const page of visiblePages) { + if (page.percent < 100) { + break; + } + if (page.id === currentId && isSimpleLayout) { + stillFullyVisible = true; + break; + } + } + this._setCurrentPageNumber(stillFullyVisible ? currentId : visiblePages[0].id); + this._updateLocation(visible.first); + this.eventBus.dispatch("updateviewarea", { + source: this, + location: this._location + }); + } + #switchToEditAnnotationMode() { + const visible = this._getVisiblePages(); + const pagesToRefresh = []; + const { + ids, + views + } = visible; + for (const page of views) { + const { + view + } = page; + if (!view.hasEditableAnnotations()) { + ids.delete(view.id); + continue; + } + pagesToRefresh.push(page); + } + if (pagesToRefresh.length === 0) { + return null; + } + this.renderingQueue.renderHighestPriority({ + first: pagesToRefresh[0], + last: pagesToRefresh.at(-1), + views: pagesToRefresh, + ids + }); + return ids; + } + containsElement(element) { + return this.container.contains(element); + } + focus() { + this.container.focus(); + } + get _isContainerRtl() { + return getComputedStyle(this.container).direction === "rtl"; + } + get isInPresentationMode() { + return this.presentationModeState === PresentationModeState.FULLSCREEN; + } + get isChangingPresentationMode() { + return this.presentationModeState === PresentationModeState.CHANGING; + } + get isHorizontalScrollbarEnabled() { + return this.isInPresentationMode ? false : this.container.scrollWidth > this.container.clientWidth; + } + get isVerticalScrollbarEnabled() { + return this.isInPresentationMode ? false : this.container.scrollHeight > this.container.clientHeight; + } + _getVisiblePages() { + const views = this._scrollMode === ScrollMode.PAGE ? this.#scrollModePageState.pages : this._pages, + horizontal = this._scrollMode === ScrollMode.HORIZONTAL, + rtl = horizontal && this._isContainerRtl; + return getVisibleElements({ + scrollEl: this.container, + views, + sortByVisibility: true, + horizontal, + rtl + }); + } + cleanup() { + for (const pageView of this._pages) { + if (pageView.renderingState !== RenderingStates.FINISHED) { + pageView.reset(); + } + } + } + _cancelRendering() { + for (const pageView of this._pages) { + pageView.cancelRendering(); + } + } + async #ensurePdfPageLoaded(pageView) { + if (pageView.pdfPage) { + return pageView.pdfPage; + } + try { + const pdfPage = await this.pdfDocument.getPage(pageView.id); + if (!pageView.pdfPage) { + pageView.setPdfPage(pdfPage); + } + return pdfPage; + } catch (reason) { + console.error("Unable to get page for page view", reason); + return null; + } + } + #getScrollAhead(visible) { + if (visible.first?.id === 1) { + return true; + } else if (visible.last?.id === this.pagesCount) { + return false; + } + switch (this._scrollMode) { + case ScrollMode.PAGE: + return this.#scrollModePageState.scrollDown; + case ScrollMode.HORIZONTAL: + return this.scroll.right; + } + return this.scroll.down; + } + forceRendering(currentlyVisiblePages) { + const visiblePages = currentlyVisiblePages || this._getVisiblePages(); + const scrollAhead = this.#getScrollAhead(visiblePages); + const preRenderExtra = this._spreadMode !== SpreadMode.NONE && this._scrollMode !== ScrollMode.HORIZONTAL; + const pageView = this.renderingQueue.getHighestPriority(visiblePages, this._pages, scrollAhead, preRenderExtra); + if (pageView) { + this.#ensurePdfPageLoaded(pageView).then(() => { + this.renderingQueue.renderView(pageView); + }); + return true; + } + return false; + } + get hasEqualPageSizes() { + const firstPageView = this._pages[0]; + for (let i = 1, ii = this._pages.length; i < ii; ++i) { + const pageView = this._pages[i]; + if (pageView.width !== firstPageView.width || pageView.height !== firstPageView.height) { + return false; + } + } + return true; + } + getPagesOverview() { + let initialOrientation; + return this._pages.map(pageView => { + const viewport = pageView.pdfPage.getViewport({ + scale: 1 + }); + const orientation = isPortraitOrientation(viewport); + if (initialOrientation === undefined) { + initialOrientation = orientation; + } else if (this.enablePrintAutoRotate && orientation !== initialOrientation) { + return { + width: viewport.height, + height: viewport.width, + rotation: (viewport.rotation - 90) % 360 + }; + } + return { + width: viewport.width, + height: viewport.height, + rotation: viewport.rotation + }; + }); + } + get optionalContentConfigPromise() { + if (!this.pdfDocument) { + return Promise.resolve(null); + } + if (!this._optionalContentConfigPromise) { + console.error("optionalContentConfigPromise: Not initialized yet."); + return this.pdfDocument.getOptionalContentConfig({ + intent: "display" + }); + } + return this._optionalContentConfigPromise; + } + set optionalContentConfigPromise(promise) { + if (!(promise instanceof Promise)) { + throw new Error(`Invalid optionalContentConfigPromise: ${promise}`); + } + if (!this.pdfDocument) { + return; + } + if (!this._optionalContentConfigPromise) { + return; + } + this._optionalContentConfigPromise = promise; + this.refresh(false, { + optionalContentConfigPromise: promise + }); + this.eventBus.dispatch("optionalcontentconfigchanged", { + source: this, + promise + }); + } + get scrollMode() { + return this._scrollMode; + } + set scrollMode(mode) { + if (this._scrollMode === mode) { + return; + } + if (!isValidScrollMode(mode)) { + throw new Error(`Invalid scroll mode: ${mode}`); + } + if (this.pagesCount > PagesCountLimit.FORCE_SCROLL_MODE_PAGE) { + return; + } + this._previousScrollMode = this._scrollMode; + this._scrollMode = mode; + this.eventBus.dispatch("scrollmodechanged", { + source: this, + mode + }); + this._updateScrollMode(this._currentPageNumber); + } + _updateScrollMode(pageNumber = null) { + const scrollMode = this._scrollMode, + viewer = this.viewer; + viewer.classList.toggle("scrollHorizontal", scrollMode === ScrollMode.HORIZONTAL); + viewer.classList.toggle("scrollWrapped", scrollMode === ScrollMode.WRAPPED); + if (!this.pdfDocument || !pageNumber) { + return; + } + if (scrollMode === ScrollMode.PAGE) { + this.#ensurePageViewVisible(); + } else if (this._previousScrollMode === ScrollMode.PAGE) { + this._updateSpreadMode(); + } + if (this._currentScaleValue && isNaN(this._currentScaleValue)) { + this.#setScale(this._currentScaleValue, { + noScroll: true + }); + } + this._setCurrentPageNumber(pageNumber, true); + this.update(); + } + get spreadMode() { + return this._spreadMode; + } + set spreadMode(mode) { + if (this._spreadMode === mode) { + return; + } + if (!isValidSpreadMode(mode)) { + throw new Error(`Invalid spread mode: ${mode}`); + } + this._spreadMode = mode; + this.eventBus.dispatch("spreadmodechanged", { + source: this, + mode + }); + this._updateSpreadMode(this._currentPageNumber); + } + _updateSpreadMode(pageNumber = null) { + if (!this.pdfDocument) { + return; + } + const viewer = this.viewer, + pages = this._pages; + if (this._scrollMode === ScrollMode.PAGE) { + this.#ensurePageViewVisible(); + } else { + viewer.textContent = ""; + if (this._spreadMode === SpreadMode.NONE) { + for (const pageView of this._pages) { + viewer.append(pageView.div); + } + } else { + const parity = this._spreadMode - 1; + let spread = null; + for (let i = 0, ii = pages.length; i < ii; ++i) { + if (spread === null) { + spread = document.createElement("div"); + spread.className = "spread"; + viewer.append(spread); + } else if (i % 2 === parity) { + spread = spread.cloneNode(false); + viewer.append(spread); + } + spread.append(pages[i].div); + } + } + } + if (!pageNumber) { + return; + } + if (this._currentScaleValue && isNaN(this._currentScaleValue)) { + this.#setScale(this._currentScaleValue, { + noScroll: true + }); + } + this._setCurrentPageNumber(pageNumber, true); + this.update(); + } + _getPageAdvance(currentPageNumber, previous = false) { + switch (this._scrollMode) { + case ScrollMode.WRAPPED: + { + const { + views + } = this._getVisiblePages(), + pageLayout = new Map(); + for (const { + id, + y, + percent, + widthPercent + } of views) { + if (percent === 0 || widthPercent < 100) { + continue; + } + let yArray = pageLayout.get(y); + if (!yArray) { + pageLayout.set(y, yArray ||= []); + } + yArray.push(id); + } + for (const yArray of pageLayout.values()) { + const currentIndex = yArray.indexOf(currentPageNumber); + if (currentIndex === -1) { + continue; + } + const numPages = yArray.length; + if (numPages === 1) { + break; + } + if (previous) { + for (let i = currentIndex - 1, ii = 0; i >= ii; i--) { + const currentId = yArray[i], + expectedId = yArray[i + 1] - 1; + if (currentId < expectedId) { + return currentPageNumber - expectedId; + } + } + } else { + for (let i = currentIndex + 1, ii = numPages; i < ii; i++) { + const currentId = yArray[i], + expectedId = yArray[i - 1] + 1; + if (currentId > expectedId) { + return expectedId - currentPageNumber; + } + } + } + if (previous) { + const firstId = yArray[0]; + if (firstId < currentPageNumber) { + return currentPageNumber - firstId + 1; + } + } else { + const lastId = yArray[numPages - 1]; + if (lastId > currentPageNumber) { + return lastId - currentPageNumber + 1; + } + } + break; + } + break; + } + case ScrollMode.HORIZONTAL: + { + break; + } + case ScrollMode.PAGE: + case ScrollMode.VERTICAL: + { + if (this._spreadMode === SpreadMode.NONE) { + break; + } + const parity = this._spreadMode - 1; + if (previous && currentPageNumber % 2 !== parity) { + break; + } else if (!previous && currentPageNumber % 2 === parity) { + break; + } + const { + views + } = this._getVisiblePages(), + expectedId = previous ? currentPageNumber - 1 : currentPageNumber + 1; + for (const { + id, + percent, + widthPercent + } of views) { + if (id !== expectedId) { + continue; + } + if (percent > 0 && widthPercent === 100) { + return 2; + } + break; + } + break; + } + } + return 1; + } + nextPage() { + const currentPageNumber = this._currentPageNumber, + pagesCount = this.pagesCount; + if (currentPageNumber >= pagesCount) { + return false; + } + const advance = this._getPageAdvance(currentPageNumber, false) || 1; + this.currentPageNumber = Math.min(currentPageNumber + advance, pagesCount); + return true; + } + previousPage() { + const currentPageNumber = this._currentPageNumber; + if (currentPageNumber <= 1) { + return false; + } + const advance = this._getPageAdvance(currentPageNumber, true) || 1; + this.currentPageNumber = Math.max(currentPageNumber - advance, 1); + return true; + } + updateScale({ + drawingDelay, + scaleFactor = null, + steps = null, + origin + }) { + if (steps === null && scaleFactor === null) { + throw new Error("Invalid updateScale options: either `steps` or `scaleFactor` must be provided."); + } + if (!this.pdfDocument) { + return; + } + let newScale = this._currentScale; + if (scaleFactor > 0 && scaleFactor !== 1) { + newScale = Math.round(newScale * scaleFactor * 100) / 100; + } else if (steps) { + const delta = steps > 0 ? DEFAULT_SCALE_DELTA : 1 / DEFAULT_SCALE_DELTA; + const round = steps > 0 ? Math.ceil : Math.floor; + steps = Math.abs(steps); + do { + newScale = round((newScale * delta).toFixed(2) * 10) / 10; + } while (--steps > 0); + } + newScale = Math.max(MIN_SCALE, Math.min(MAX_SCALE, newScale)); + this.#setScale(newScale, { + noScroll: false, + drawingDelay, + origin + }); + } + increaseScale(options = {}) { + this.updateScale({ + ...options, + steps: options.steps ?? 1 + }); + } + decreaseScale(options = {}) { + this.updateScale({ + ...options, + steps: -(options.steps ?? 1) + }); + } + #updateContainerHeightCss(height = this.container.clientHeight) { + if (height !== this.#previousContainerHeight) { + this.#previousContainerHeight = height; + docStyle.setProperty("--viewer-container-height", `${height}px`); + } + } + #resizeObserverCallback(entries) { + for (const entry of entries) { + if (entry.target === this.container) { + this.#updateContainerHeightCss(Math.floor(entry.borderBoxSize[0].blockSize)); + this.#containerTopLeft = null; + break; + } + } + } + get containerTopLeft() { + return this.#containerTopLeft ||= [this.container.offsetTop, this.container.offsetLeft]; + } + #cleanupSwitchAnnotationEditorMode() { + this.#switchAnnotationEditorModeAC?.abort(); + this.#switchAnnotationEditorModeAC = null; + if (this.#switchAnnotationEditorModeTimeoutId !== null) { + clearTimeout(this.#switchAnnotationEditorModeTimeoutId); + this.#switchAnnotationEditorModeTimeoutId = null; + } + } + get annotationEditorMode() { + return this.#annotationEditorUIManager ? this.#annotationEditorMode : AnnotationEditorType.DISABLE; + } + set annotationEditorMode({ + mode, + editId = null, + isFromKeyboard = false + }) { + if (!this.#annotationEditorUIManager) { + throw new Error(`The AnnotationEditor is not enabled.`); + } + if (this.#annotationEditorMode === mode) { + return; + } + if (!isValidAnnotationEditorMode(mode)) { + throw new Error(`Invalid AnnotationEditor mode: ${mode}`); + } + if (!this.pdfDocument) { + return; + } + if (mode === AnnotationEditorType.STAMP) { + this.#mlManager?.loadModel("altText"); + } + const { + eventBus + } = this; + const updater = () => { + this.#cleanupSwitchAnnotationEditorMode(); + this.#annotationEditorMode = mode; + this.#annotationEditorUIManager.updateMode(mode, editId, isFromKeyboard); + eventBus.dispatch("annotationeditormodechanged", { + source: this, + mode + }); + }; + if (mode === AnnotationEditorType.NONE || this.#annotationEditorMode === AnnotationEditorType.NONE) { + const isEditing = mode !== AnnotationEditorType.NONE; + if (!isEditing) { + this.pdfDocument.annotationStorage.resetModifiedIds(); + } + for (const pageView of this._pages) { + pageView.toggleEditingMode(isEditing); + } + const idsToRefresh = this.#switchToEditAnnotationMode(); + if (isEditing && idsToRefresh) { + this.#cleanupSwitchAnnotationEditorMode(); + this.#switchAnnotationEditorModeAC = new AbortController(); + const signal = AbortSignal.any([this.#eventAbortController.signal, this.#switchAnnotationEditorModeAC.signal]); + eventBus._on("pagerendered", ({ + pageNumber + }) => { + idsToRefresh.delete(pageNumber); + if (idsToRefresh.size === 0) { + this.#switchAnnotationEditorModeTimeoutId = setTimeout(updater, 0); + } + }, { + signal + }); + return; + } + } + updater(); + } + refresh(noUpdate = false, updateArgs = Object.create(null)) { + if (!this.pdfDocument) { + return; + } + for (const pageView of this._pages) { + pageView.update(updateArgs); + } + if (this.#scaleTimeoutId !== null) { + clearTimeout(this.#scaleTimeoutId); + this.#scaleTimeoutId = null; + } + if (!noUpdate) { + this.update(); + } + } +} + +;// ./web/secondary_toolbar.js + + +class SecondaryToolbar { + #opts; + constructor(options, eventBus) { + this.#opts = options; + const buttons = [{ + element: options.presentationModeButton, + eventName: "presentationmode", + close: true + }, { + element: options.printButton, + eventName: "print", + close: true + }, { + element: options.downloadButton, + eventName: "download", + close: true + }, { + element: options.viewBookmarkButton, + eventName: null, + close: true + }, { + element: options.firstPageButton, + eventName: "firstpage", + close: true + }, { + element: options.lastPageButton, + eventName: "lastpage", + close: true + }, { + element: options.pageRotateCwButton, + eventName: "rotatecw", + close: false + }, { + element: options.pageRotateCcwButton, + eventName: "rotateccw", + close: false + }, { + element: options.cursorSelectToolButton, + eventName: "switchcursortool", + eventDetails: { + tool: CursorTool.SELECT + }, + close: true + }, { + element: options.cursorHandToolButton, + eventName: "switchcursortool", + eventDetails: { + tool: CursorTool.HAND + }, + close: true + }, { + element: options.scrollPageButton, + eventName: "switchscrollmode", + eventDetails: { + mode: ScrollMode.PAGE + }, + close: true + }, { + element: options.scrollVerticalButton, + eventName: "switchscrollmode", + eventDetails: { + mode: ScrollMode.VERTICAL + }, + close: true + }, { + element: options.scrollHorizontalButton, + eventName: "switchscrollmode", + eventDetails: { + mode: ScrollMode.HORIZONTAL + }, + close: true + }, { + element: options.scrollWrappedButton, + eventName: "switchscrollmode", + eventDetails: { + mode: ScrollMode.WRAPPED + }, + close: true + }, { + element: options.spreadNoneButton, + eventName: "switchspreadmode", + eventDetails: { + mode: SpreadMode.NONE + }, + close: true + }, { + element: options.spreadOddButton, + eventName: "switchspreadmode", + eventDetails: { + mode: SpreadMode.ODD + }, + close: true + }, { + element: options.spreadEvenButton, + eventName: "switchspreadmode", + eventDetails: { + mode: SpreadMode.EVEN + }, + close: true + }, { + element: options.imageAltTextSettingsButton, + eventName: "imagealttextsettings", + close: true + }, { + element: options.documentPropertiesButton, + eventName: "documentproperties", + close: true + }]; + buttons.push({ + element: options.openFileButton, + eventName: "openfile", + close: true + }); + this.eventBus = eventBus; + this.opened = false; + this.#bindListeners(buttons); + this.reset(); + } + get isOpen() { + return this.opened; + } + setPageNumber(pageNumber) { + this.pageNumber = pageNumber; + this.#updateUIState(); + } + setPagesCount(pagesCount) { + this.pagesCount = pagesCount; + this.#updateUIState(); + } + reset() { + this.pageNumber = 0; + this.pagesCount = 0; + this.#updateUIState(); + this.eventBus.dispatch("switchcursortool", { + source: this, + reset: true + }); + this.#scrollModeChanged({ + mode: ScrollMode.VERTICAL + }); + this.#spreadModeChanged({ + mode: SpreadMode.NONE + }); + } + #updateUIState() { + const { + firstPageButton, + lastPageButton, + pageRotateCwButton, + pageRotateCcwButton + } = this.#opts; + firstPageButton.disabled = this.pageNumber <= 1; + lastPageButton.disabled = this.pageNumber >= this.pagesCount; + pageRotateCwButton.disabled = this.pagesCount === 0; + pageRotateCcwButton.disabled = this.pagesCount === 0; + } + #bindListeners(buttons) { + const { + eventBus + } = this; + const { + toggleButton + } = this.#opts; + toggleButton.addEventListener("click", this.toggle.bind(this)); + for (const { + element, + eventName, + close, + eventDetails + } of buttons) { + element.addEventListener("click", evt => { + if (eventName !== null) { + eventBus.dispatch(eventName, { + source: this, + ...eventDetails + }); + } + if (close) { + this.close(); + } + eventBus.dispatch("reporttelemetry", { + source: this, + details: { + type: "buttons", + data: { + id: element.id + } + } + }); + }); + } + eventBus._on("cursortoolchanged", this.#cursorToolChanged.bind(this)); + eventBus._on("scrollmodechanged", this.#scrollModeChanged.bind(this)); + eventBus._on("spreadmodechanged", this.#spreadModeChanged.bind(this)); + } + #cursorToolChanged({ + tool, + disabled + }) { + const { + cursorSelectToolButton, + cursorHandToolButton + } = this.#opts; + toggleCheckedBtn(cursorSelectToolButton, tool === CursorTool.SELECT); + toggleCheckedBtn(cursorHandToolButton, tool === CursorTool.HAND); + cursorSelectToolButton.disabled = disabled; + cursorHandToolButton.disabled = disabled; + } + #scrollModeChanged({ + mode + }) { + const { + scrollPageButton, + scrollVerticalButton, + scrollHorizontalButton, + scrollWrappedButton, + spreadNoneButton, + spreadOddButton, + spreadEvenButton + } = this.#opts; + toggleCheckedBtn(scrollPageButton, mode === ScrollMode.PAGE); + toggleCheckedBtn(scrollVerticalButton, mode === ScrollMode.VERTICAL); + toggleCheckedBtn(scrollHorizontalButton, mode === ScrollMode.HORIZONTAL); + toggleCheckedBtn(scrollWrappedButton, mode === ScrollMode.WRAPPED); + const forceScrollModePage = this.pagesCount > PagesCountLimit.FORCE_SCROLL_MODE_PAGE; + scrollPageButton.disabled = forceScrollModePage; + scrollVerticalButton.disabled = forceScrollModePage; + scrollHorizontalButton.disabled = forceScrollModePage; + scrollWrappedButton.disabled = forceScrollModePage; + const isHorizontal = mode === ScrollMode.HORIZONTAL; + spreadNoneButton.disabled = isHorizontal; + spreadOddButton.disabled = isHorizontal; + spreadEvenButton.disabled = isHorizontal; + } + #spreadModeChanged({ + mode + }) { + const { + spreadNoneButton, + spreadOddButton, + spreadEvenButton + } = this.#opts; + toggleCheckedBtn(spreadNoneButton, mode === SpreadMode.NONE); + toggleCheckedBtn(spreadOddButton, mode === SpreadMode.ODD); + toggleCheckedBtn(spreadEvenButton, mode === SpreadMode.EVEN); + } + open() { + if (this.opened) { + return; + } + this.opened = true; + const { + toggleButton, + toolbar + } = this.#opts; + toggleExpandedBtn(toggleButton, true, toolbar); + } + close() { + if (!this.opened) { + return; + } + this.opened = false; + const { + toggleButton, + toolbar + } = this.#opts; + toggleExpandedBtn(toggleButton, false, toolbar); + } + toggle() { + if (this.opened) { + this.close(); + } else { + this.open(); + } + } +} + +;// ./web/toolbar.js + + +class Toolbar { + #opts; + constructor(options, eventBus, toolbarDensity = 0) { + this.#opts = options; + this.eventBus = eventBus; + const buttons = [{ + element: options.previous, + eventName: "previouspage" + }, { + element: options.next, + eventName: "nextpage" + }, { + element: options.zoomIn, + eventName: "zoomin" + }, { + element: options.zoomOut, + eventName: "zoomout" + }, { + element: options.print, + eventName: "print" + }, { + element: options.download, + eventName: "download" + }, { + element: options.editorFreeTextButton, + eventName: "switchannotationeditormode", + eventDetails: { + get mode() { + const { + classList + } = options.editorFreeTextButton; + return classList.contains("toggled") ? AnnotationEditorType.NONE : AnnotationEditorType.FREETEXT; + } + } + }, { + element: options.editorHighlightButton, + eventName: "switchannotationeditormode", + eventDetails: { + get mode() { + const { + classList + } = options.editorHighlightButton; + return classList.contains("toggled") ? AnnotationEditorType.NONE : AnnotationEditorType.HIGHLIGHT; + } + } + }, { + element: options.editorInkButton, + eventName: "switchannotationeditormode", + eventDetails: { + get mode() { + const { + classList + } = options.editorInkButton; + return classList.contains("toggled") ? AnnotationEditorType.NONE : AnnotationEditorType.INK; + } + } + }, { + element: options.editorStampButton, + eventName: "switchannotationeditormode", + eventDetails: { + get mode() { + const { + classList + } = options.editorStampButton; + return classList.contains("toggled") ? AnnotationEditorType.NONE : AnnotationEditorType.STAMP; + } + }, + telemetry: { + type: "editing", + data: { + action: "pdfjs.image.icon_click" + } + } + }]; + this.#bindListeners(buttons); + this.#updateToolbarDensity({ + value: toolbarDensity + }); + this.reset(); + } + #updateToolbarDensity({ + value + }) { + let name = "normal"; + switch (value) { + case 1: + name = "compact"; + break; + case 2: + name = "touch"; + break; + } + document.documentElement.setAttribute("data-toolbar-density", name); + } + #setAnnotationEditorUIManager(uiManager, parentContainer) { + const colorPicker = new ColorPicker({ + uiManager + }); + uiManager.setMainHighlightColorPicker(colorPicker); + parentContainer.append(colorPicker.renderMainDropdown()); + } + setPageNumber(pageNumber, pageLabel) { + this.pageNumber = pageNumber; + this.pageLabel = pageLabel; + this.#updateUIState(false); + } + setPagesCount(pagesCount, hasPageLabels) { + this.pagesCount = pagesCount; + this.hasPageLabels = hasPageLabels; + this.#updateUIState(true); + } + setPageScale(pageScaleValue, pageScale) { + this.pageScaleValue = (pageScaleValue || pageScale).toString(); + this.pageScale = pageScale; + this.#updateUIState(false); + } + reset() { + this.pageNumber = 0; + this.pageLabel = null; + this.hasPageLabels = false; + this.pagesCount = 0; + this.pageScaleValue = DEFAULT_SCALE_VALUE; + this.pageScale = DEFAULT_SCALE; + this.#updateUIState(true); + this.updateLoadingIndicatorState(); + this.#editorModeChanged({ + mode: AnnotationEditorType.DISABLE + }); + } + #bindListeners(buttons) { + const { + eventBus + } = this; + const { + editorHighlightColorPicker, + editorHighlightButton, + pageNumber, + scaleSelect + } = this.#opts; + const self = this; + for (const { + element, + eventName, + eventDetails, + telemetry + } of buttons) { + element.addEventListener("click", evt => { + if (eventName !== null) { + eventBus.dispatch(eventName, { + source: this, + ...eventDetails, + isFromKeyboard: evt.detail === 0 + }); + } + if (telemetry) { + eventBus.dispatch("reporttelemetry", { + source: this, + details: telemetry + }); + } + }); + } + pageNumber.addEventListener("click", function () { + this.select(); + }); + pageNumber.addEventListener("change", function () { + eventBus.dispatch("pagenumberchanged", { + source: self, + value: this.value + }); + }); + scaleSelect.addEventListener("change", function () { + if (this.value === "custom") { + return; + } + eventBus.dispatch("scalechanged", { + source: self, + value: this.value + }); + }); + scaleSelect.addEventListener("click", function ({ + target + }) { + if (this.value === self.pageScaleValue && target.tagName.toUpperCase() === "OPTION") { + this.blur(); + } + }); + scaleSelect.oncontextmenu = noContextMenu; + eventBus._on("annotationeditormodechanged", this.#editorModeChanged.bind(this)); + eventBus._on("showannotationeditorui", ({ + mode + }) => { + switch (mode) { + case AnnotationEditorType.HIGHLIGHT: + editorHighlightButton.click(); + break; + } + }); + eventBus._on("toolbardensity", this.#updateToolbarDensity.bind(this)); + if (editorHighlightColorPicker) { + eventBus._on("annotationeditoruimanager", ({ + uiManager + }) => { + this.#setAnnotationEditorUIManager(uiManager, editorHighlightColorPicker); + }, { + once: true + }); + } + } + #editorModeChanged({ + mode + }) { + const { + editorFreeTextButton, + editorFreeTextParamsToolbar, + editorHighlightButton, + editorHighlightParamsToolbar, + editorInkButton, + editorInkParamsToolbar, + editorStampButton, + editorStampParamsToolbar + } = this.#opts; + toggleExpandedBtn(editorFreeTextButton, mode === AnnotationEditorType.FREETEXT, editorFreeTextParamsToolbar); + toggleExpandedBtn(editorHighlightButton, mode === AnnotationEditorType.HIGHLIGHT, editorHighlightParamsToolbar); + toggleExpandedBtn(editorInkButton, mode === AnnotationEditorType.INK, editorInkParamsToolbar); + toggleExpandedBtn(editorStampButton, mode === AnnotationEditorType.STAMP, editorStampParamsToolbar); + const isDisable = mode === AnnotationEditorType.DISABLE; + editorFreeTextButton.disabled = isDisable; + editorHighlightButton.disabled = isDisable; + editorInkButton.disabled = isDisable; + editorStampButton.disabled = isDisable; + } + #updateUIState(resetNumPages = false) { + const { + pageNumber, + pagesCount, + pageScaleValue, + pageScale + } = this; + const opts = this.#opts; + if (resetNumPages) { + if (this.hasPageLabels) { + opts.pageNumber.type = "text"; + opts.numPages.setAttribute("data-l10n-id", "pdfjs-page-of-pages"); + } else { + opts.pageNumber.type = "number"; + opts.numPages.setAttribute("data-l10n-id", "pdfjs-of-pages"); + opts.numPages.setAttribute("data-l10n-args", JSON.stringify({ + pagesCount + })); + } + opts.pageNumber.max = pagesCount; + } + if (this.hasPageLabels) { + opts.pageNumber.value = this.pageLabel; + opts.numPages.setAttribute("data-l10n-args", JSON.stringify({ + pageNumber, + pagesCount + })); + } else { + opts.pageNumber.value = pageNumber; + } + opts.previous.disabled = pageNumber <= 1; + opts.next.disabled = pageNumber >= pagesCount; + opts.zoomOut.disabled = pageScale <= MIN_SCALE; + opts.zoomIn.disabled = pageScale >= MAX_SCALE; + let predefinedValueFound = false; + for (const option of opts.scaleSelect.options) { + if (option.value !== pageScaleValue) { + option.selected = false; + continue; + } + option.selected = true; + predefinedValueFound = true; + } + if (!predefinedValueFound) { + opts.customScaleOption.selected = true; + opts.customScaleOption.setAttribute("data-l10n-args", JSON.stringify({ + scale: Math.round(pageScale * 10000) / 100 + })); + } + } + updateLoadingIndicatorState(loading = false) { + const { + pageNumber + } = this.#opts; + pageNumber.classList.toggle("loading", loading); + } +} + +;// ./web/view_history.js +const DEFAULT_VIEW_HISTORY_CACHE_SIZE = 20; +class ViewHistory { + constructor(fingerprint, cacheSize = DEFAULT_VIEW_HISTORY_CACHE_SIZE) { + this.fingerprint = fingerprint; + this.cacheSize = cacheSize; + this._initializedPromise = this._readFromStorage().then(databaseStr => { + const database = JSON.parse(databaseStr || "{}"); + let index = -1; + if (!Array.isArray(database.files)) { + database.files = []; + } else { + while (database.files.length >= this.cacheSize) { + database.files.shift(); + } + for (let i = 0, ii = database.files.length; i < ii; i++) { + const branch = database.files[i]; + if (branch.fingerprint === this.fingerprint) { + index = i; + break; + } + } + } + if (index === -1) { + index = database.files.push({ + fingerprint: this.fingerprint + }) - 1; + } + this.file = database.files[index]; + this.database = database; + }); + } + async _writeToStorage() { + const databaseStr = JSON.stringify(this.database); + localStorage.setItem("pdfjs.history", databaseStr); + } + async _readFromStorage() { + return localStorage.getItem("pdfjs.history"); + } + async set(name, val) { + await this._initializedPromise; + this.file[name] = val; + return this._writeToStorage(); + } + async setMultiple(properties) { + await this._initializedPromise; + for (const name in properties) { + this.file[name] = properties[name]; + } + return this._writeToStorage(); + } + async get(name, defaultValue) { + await this._initializedPromise; + const val = this.file[name]; + return val !== undefined ? val : defaultValue; + } + async getMultiple(properties) { + await this._initializedPromise; + const values = Object.create(null); + for (const name in properties) { + const val = this.file[name]; + values[name] = val !== undefined ? val : properties[name]; + } + return values; + } +} + +;// ./web/app.js + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +const FORCE_PAGES_LOADED_TIMEOUT = 10000; +const ViewOnLoad = { + UNKNOWN: -1, + PREVIOUS: 0, + INITIAL: 1 +}; +const PDFViewerApplication = { + initialBookmark: document.location.hash.substring(1), + _initializedCapability: { + ...Promise.withResolvers(), + settled: false + }, + appConfig: null, + pdfDocument: null, + pdfLoadingTask: null, + printService: null, + pdfViewer: null, + pdfThumbnailViewer: null, + pdfRenderingQueue: null, + pdfPresentationMode: null, + pdfDocumentProperties: null, + pdfLinkService: null, + pdfHistory: null, + pdfSidebar: null, + pdfOutlineViewer: null, + pdfAttachmentViewer: null, + pdfLayerViewer: null, + pdfCursorTools: null, + pdfScriptingManager: null, + store: null, + downloadManager: null, + overlayManager: null, + preferences: new Preferences(), + toolbar: null, + secondaryToolbar: null, + eventBus: null, + l10n: null, + annotationEditorParams: null, + imageAltTextSettings: null, + isInitialViewSet: false, + isViewerEmbedded: window.parent !== window, + url: "", + baseUrl: "", + mlManager: null, + _downloadUrl: "", + _eventBusAbortController: null, + _windowAbortController: null, + _globalAbortController: new AbortController(), + documentInfo: null, + metadata: null, + _contentDispositionFilename: null, + _contentLength: null, + _saveInProgress: false, + _wheelUnusedTicks: 0, + _wheelUnusedFactor: 1, + _touchManager: null, + _touchUnusedTicks: 0, + _touchUnusedFactor: 1, + _PDFBug: null, + _hasAnnotationEditors: false, + _title: document.title, + _printAnnotationStoragePromise: null, + _isCtrlKeyDown: false, + _caretBrowsing: null, + _isScrolling: false, + editorUndoBar: null, + async initialize(appConfig) { + this.appConfig = appConfig; + try { + await this.preferences.initializedPromise; + } catch (ex) { + console.error("initialize:", ex); + } + if (AppOptions.get("pdfBugEnabled")) { + await this._parseHashParams(); + } + let mode; + switch (AppOptions.get("viewerCssTheme")) { + case 1: + mode = "is-light"; + break; + case 2: + mode = "is-dark"; + break; + } + if (mode) { + document.documentElement.classList.add(mode); + } + this.l10n = await this.externalServices.createL10n(); + document.getElementsByTagName("html")[0].dir = this.l10n.getDirection(); + this.l10n.translate(appConfig.appContainer || document.documentElement); + if (this.isViewerEmbedded && AppOptions.get("externalLinkTarget") === LinkTarget.NONE) { + AppOptions.set("externalLinkTarget", LinkTarget.TOP); + } + await this._initializeViewerComponents(); + this.bindEvents(); + this.bindWindowEvents(); + this._initializedCapability.settled = true; + this._initializedCapability.resolve(); + }, + async _parseHashParams() { + const hash = document.location.hash.substring(1); + if (!hash) { + return; + } + const { + mainContainer, + viewerContainer + } = this.appConfig, + params = parseQueryString(hash); + const loadPDFBug = async () => { + if (this._PDFBug) { + return; + } + const { + PDFBug + } = await import(/*webpackIgnore: true*/AppOptions.get("debuggerSrc")); + this._PDFBug = PDFBug; + }; + if (params.get("disableworker") === "true") { + try { + GlobalWorkerOptions.workerSrc ||= AppOptions.get("workerSrc"); + await import(/*webpackIgnore: true*/PDFWorker.workerSrc); + } catch (ex) { + console.error("_parseHashParams:", ex); + } + } + if (params.has("textlayer")) { + switch (params.get("textlayer")) { + case "off": + AppOptions.set("textLayerMode", TextLayerMode.DISABLE); + break; + case "visible": + case "shadow": + case "hover": + viewerContainer.classList.add(`textLayer-${params.get("textlayer")}`); + try { + await loadPDFBug(); + this._PDFBug.loadCSS(); + } catch (ex) { + console.error("_parseHashParams:", ex); + } + break; + } + } + if (params.has("pdfbug")) { + AppOptions.setAll({ + pdfBug: true, + fontExtraProperties: true + }); + const enabled = params.get("pdfbug").split(","); + try { + await loadPDFBug(); + this._PDFBug.init(mainContainer, enabled); + } catch (ex) { + console.error("_parseHashParams:", ex); + } + } + if (params.has("locale")) { + AppOptions.set("localeProperties", { + lang: params.get("locale") + }); + } + const opts = { + disableAutoFetch: x => x === "true", + disableFontFace: x => x === "true", + disableHistory: x => x === "true", + disableRange: x => x === "true", + disableStream: x => x === "true", + verbosity: x => x | 0 + }; + for (const name in opts) { + const check = opts[name], + key = name.toLowerCase(); + if (params.has(key)) { + AppOptions.set(name, check(params.get(key))); + } + } + }, + async _initializeViewerComponents() { + const { + appConfig, + externalServices, + l10n + } = this; + const eventBus = new EventBus(); + this.eventBus = AppOptions.eventBus = eventBus; + this.mlManager?.setEventBus(eventBus, this._globalAbortController.signal); + this.overlayManager = new OverlayManager(); + const pdfRenderingQueue = new PDFRenderingQueue(); + pdfRenderingQueue.onIdle = this._cleanup.bind(this); + this.pdfRenderingQueue = pdfRenderingQueue; + const pdfLinkService = new PDFLinkService({ + eventBus, + externalLinkTarget: AppOptions.get("externalLinkTarget"), + externalLinkRel: AppOptions.get("externalLinkRel"), + ignoreDestinationZoom: AppOptions.get("ignoreDestinationZoom") + }); + this.pdfLinkService = pdfLinkService; + const downloadManager = this.downloadManager = new DownloadManager(); + const findController = new PDFFindController({ + linkService: pdfLinkService, + eventBus, + updateMatchesCountOnProgress: true + }); + this.findController = findController; + const pdfScriptingManager = new PDFScriptingManager({ + eventBus, + externalServices, + docProperties: this._scriptingDocProperties.bind(this) + }); + this.pdfScriptingManager = pdfScriptingManager; + const container = appConfig.mainContainer, + viewer = appConfig.viewerContainer; + const annotationEditorMode = AppOptions.get("annotationEditorMode"); + const pageColors = AppOptions.get("forcePageColors") || window.matchMedia("(forced-colors: active)").matches ? { + background: AppOptions.get("pageColorsBackground"), + foreground: AppOptions.get("pageColorsForeground") + } : null; + let altTextManager; + if (AppOptions.get("enableUpdatedAddImage")) { + altTextManager = appConfig.newAltTextDialog ? new NewAltTextManager(appConfig.newAltTextDialog, this.overlayManager, eventBus) : null; + } else { + altTextManager = appConfig.altTextDialog ? new AltTextManager(appConfig.altTextDialog, container, this.overlayManager, eventBus) : null; + } + if (appConfig.editorUndoBar) { + this.editorUndoBar = new EditorUndoBar(appConfig.editorUndoBar, eventBus); + } + const enableHWA = AppOptions.get("enableHWA"); + const pdfViewer = new PDFViewer({ + container, + viewer, + eventBus, + renderingQueue: pdfRenderingQueue, + linkService: pdfLinkService, + downloadManager, + altTextManager, + editorUndoBar: this.editorUndoBar, + findController, + scriptingManager: AppOptions.get("enableScripting") && pdfScriptingManager, + l10n, + textLayerMode: AppOptions.get("textLayerMode"), + annotationMode: AppOptions.get("annotationMode"), + annotationEditorMode, + annotationEditorHighlightColors: AppOptions.get("highlightEditorColors"), + enableHighlightFloatingButton: AppOptions.get("enableHighlightFloatingButton"), + enableUpdatedAddImage: AppOptions.get("enableUpdatedAddImage"), + enableNewAltTextWhenAddingImage: AppOptions.get("enableNewAltTextWhenAddingImage"), + imageResourcesPath: AppOptions.get("imageResourcesPath"), + enablePrintAutoRotate: AppOptions.get("enablePrintAutoRotate"), + maxCanvasPixels: AppOptions.get("maxCanvasPixels"), + enablePermissions: AppOptions.get("enablePermissions"), + pageColors, + mlManager: this.mlManager, + abortSignal: this._globalAbortController.signal, + enableHWA, + supportsPinchToZoom: this.supportsPinchToZoom + }); + this.pdfViewer = pdfViewer; + pdfRenderingQueue.setViewer(pdfViewer); + pdfLinkService.setViewer(pdfViewer); + pdfScriptingManager.setViewer(pdfViewer); + if (appConfig.sidebar?.thumbnailView) { + this.pdfThumbnailViewer = new PDFThumbnailViewer({ + container: appConfig.sidebar.thumbnailView, + eventBus, + renderingQueue: pdfRenderingQueue, + linkService: pdfLinkService, + pageColors, + abortSignal: this._globalAbortController.signal, + enableHWA + }); + pdfRenderingQueue.setThumbnailViewer(this.pdfThumbnailViewer); + } + if (!this.isViewerEmbedded && !AppOptions.get("disableHistory")) { + this.pdfHistory = new PDFHistory({ + linkService: pdfLinkService, + eventBus + }); + pdfLinkService.setHistory(this.pdfHistory); + } + if (!this.supportsIntegratedFind && appConfig.findBar) { + this.findBar = new PDFFindBar(appConfig.findBar, appConfig.principalContainer, eventBus); + } + if (appConfig.annotationEditorParams) { + if (typeof AbortSignal.any === "function" && annotationEditorMode !== AnnotationEditorType.DISABLE) { + this.annotationEditorParams = new AnnotationEditorParams(appConfig.annotationEditorParams, eventBus); + } else { + for (const id of ["editorModeButtons", "editorModeSeparator"]) { + document.getElementById(id)?.classList.add("hidden"); + } + } + } + if (this.mlManager && appConfig.secondaryToolbar?.imageAltTextSettingsButton) { + this.imageAltTextSettings = new ImageAltTextSettings(appConfig.altTextSettingsDialog, this.overlayManager, eventBus, this.mlManager); + } + if (appConfig.documentProperties) { + this.pdfDocumentProperties = new PDFDocumentProperties(appConfig.documentProperties, this.overlayManager, eventBus, l10n, () => this._docFilename); + } + if (appConfig.secondaryToolbar?.cursorHandToolButton) { + this.pdfCursorTools = new PDFCursorTools({ + container, + eventBus, + cursorToolOnLoad: AppOptions.get("cursorToolOnLoad") + }); + } + if (appConfig.toolbar) { + this.toolbar = new Toolbar(appConfig.toolbar, eventBus, AppOptions.get("toolbarDensity")); + } + if (appConfig.secondaryToolbar) { + if (AppOptions.get("enableAltText")) { + appConfig.secondaryToolbar.imageAltTextSettingsButton?.classList.remove("hidden"); + appConfig.secondaryToolbar.imageAltTextSettingsSeparator?.classList.remove("hidden"); + } + this.secondaryToolbar = new SecondaryToolbar(appConfig.secondaryToolbar, eventBus); + } + if (this.supportsFullscreen && appConfig.secondaryToolbar?.presentationModeButton) { + this.pdfPresentationMode = new PDFPresentationMode({ + container, + pdfViewer, + eventBus + }); + } + if (appConfig.passwordOverlay) { + this.passwordPrompt = new PasswordPrompt(appConfig.passwordOverlay, this.overlayManager, this.isViewerEmbedded); + } + if (appConfig.sidebar?.outlineView) { + this.pdfOutlineViewer = new PDFOutlineViewer({ + container: appConfig.sidebar.outlineView, + eventBus, + l10n, + linkService: pdfLinkService, + downloadManager + }); + } + if (appConfig.sidebar?.attachmentsView) { + this.pdfAttachmentViewer = new PDFAttachmentViewer({ + container: appConfig.sidebar.attachmentsView, + eventBus, + l10n, + downloadManager + }); + } + if (appConfig.sidebar?.layersView) { + this.pdfLayerViewer = new PDFLayerViewer({ + container: appConfig.sidebar.layersView, + eventBus, + l10n + }); + } + if (appConfig.sidebar) { + this.pdfSidebar = new PDFSidebar({ + elements: appConfig.sidebar, + eventBus, + l10n + }); + this.pdfSidebar.onToggled = this.forceRendering.bind(this); + this.pdfSidebar.onUpdateThumbnails = () => { + for (const pageView of pdfViewer.getCachedPageViews()) { + if (pageView.renderingState === RenderingStates.FINISHED) { + this.pdfThumbnailViewer.getThumbnail(pageView.id - 1)?.setImage(pageView); + } + } + this.pdfThumbnailViewer.scrollThumbnailIntoView(pdfViewer.currentPageNumber); + }; + } + }, + async run(config) { + await this.initialize(config); + const { + appConfig, + eventBus + } = this; + let file; + const queryString = document.location.search.substring(1); + const params = parseQueryString(queryString); + file = params.get("file") ?? AppOptions.get("defaultUrl"); + validateFileURL(file); + const fileInput = this._openFileInput = document.createElement("input"); + fileInput.id = "fileInput"; + fileInput.hidden = true; + fileInput.type = "file"; + fileInput.value = null; + document.body.append(fileInput); + fileInput.addEventListener("change", function (evt) { + const { + files + } = evt.target; + if (!files || files.length === 0) { + return; + } + eventBus.dispatch("fileinputchange", { + source: this, + fileInput: evt.target + }); + }); + appConfig.mainContainer.addEventListener("dragover", function (evt) { + for (const item of evt.dataTransfer.items) { + if (item.type === "application/pdf") { + evt.dataTransfer.dropEffect = evt.dataTransfer.effectAllowed === "copy" ? "copy" : "move"; + stopEvent(evt); + return; + } + } + }); + appConfig.mainContainer.addEventListener("drop", function (evt) { + if (evt.dataTransfer.files?.[0].type !== "application/pdf") { + return; + } + stopEvent(evt); + eventBus.dispatch("fileinputchange", { + source: this, + fileInput: evt.dataTransfer + }); + }); + if (!AppOptions.get("supportsDocumentFonts")) { + AppOptions.set("disableFontFace", true); + this.l10n.get("pdfjs-web-fonts-disabled").then(msg => { + console.warn(msg); + }); + } + if (!this.supportsPrinting) { + appConfig.toolbar?.print?.classList.add("hidden"); + appConfig.secondaryToolbar?.printButton.classList.add("hidden"); + } + if (!this.supportsFullscreen) { + appConfig.secondaryToolbar?.presentationModeButton.classList.add("hidden"); + } + if (this.supportsIntegratedFind) { + appConfig.findBar?.toggleButton?.classList.add("hidden"); + } + if (file) { + this.open({ + url: file + }); + } else { + this._hideViewBookmark(); + } + }, + get externalServices() { + return shadow(this, "externalServices", new ExternalServices()); + }, + get initialized() { + return this._initializedCapability.settled; + }, + get initializedPromise() { + return this._initializedCapability.promise; + }, + updateZoom(steps, scaleFactor, origin) { + if (this.pdfViewer.isInPresentationMode) { + return; + } + this.pdfViewer.updateScale({ + drawingDelay: AppOptions.get("defaultZoomDelay"), + steps, + scaleFactor, + origin + }); + }, + zoomIn() { + this.updateZoom(1); + }, + zoomOut() { + this.updateZoom(-1); + }, + zoomReset() { + if (this.pdfViewer.isInPresentationMode) { + return; + } + this.pdfViewer.currentScaleValue = DEFAULT_SCALE_VALUE; + }, + touchPinchCallback(origin, prevDistance, distance) { + if (this.supportsPinchToZoom) { + const newScaleFactor = this._accumulateFactor(this.pdfViewer.currentScale, distance / prevDistance, "_touchUnusedFactor"); + this.updateZoom(null, newScaleFactor, origin); + } else { + const PIXELS_PER_LINE_SCALE = 30; + const ticks = this._accumulateTicks((distance - prevDistance) / PIXELS_PER_LINE_SCALE, "_touchUnusedTicks"); + this.updateZoom(ticks, null, origin); + } + }, + touchPinchEndCallback() { + this._touchUnusedTicks = 0; + this._touchUnusedFactor = 1; + }, + get pagesCount() { + return this.pdfDocument ? this.pdfDocument.numPages : 0; + }, + get page() { + return this.pdfViewer.currentPageNumber; + }, + set page(val) { + this.pdfViewer.currentPageNumber = val; + }, + get supportsPrinting() { + return PDFPrintServiceFactory.supportsPrinting; + }, + get supportsFullscreen() { + return shadow(this, "supportsFullscreen", document.fullscreenEnabled); + }, + get supportsPinchToZoom() { + return shadow(this, "supportsPinchToZoom", AppOptions.get("supportsPinchToZoom")); + }, + get supportsIntegratedFind() { + return shadow(this, "supportsIntegratedFind", AppOptions.get("supportsIntegratedFind")); + }, + get loadingBar() { + const barElement = document.getElementById("loadingBar"); + const bar = barElement ? new ProgressBar(barElement) : null; + return shadow(this, "loadingBar", bar); + }, + get supportsMouseWheelZoomCtrlKey() { + return shadow(this, "supportsMouseWheelZoomCtrlKey", AppOptions.get("supportsMouseWheelZoomCtrlKey")); + }, + get supportsMouseWheelZoomMetaKey() { + return shadow(this, "supportsMouseWheelZoomMetaKey", AppOptions.get("supportsMouseWheelZoomMetaKey")); + }, + get supportsCaretBrowsingMode() { + return AppOptions.get("supportsCaretBrowsingMode"); + }, + moveCaret(isUp, select) { + this._caretBrowsing ||= new CaretBrowsingMode(this._globalAbortController.signal, this.appConfig.mainContainer, this.appConfig.viewerContainer, this.appConfig.toolbar?.container); + this._caretBrowsing.moveCaret(isUp, select); + }, + setTitleUsingUrl(url = "", downloadUrl = null) { + this.url = url; + this.baseUrl = url.split("#", 1)[0]; + if (downloadUrl) { + this._downloadUrl = downloadUrl === url ? this.baseUrl : downloadUrl.split("#", 1)[0]; + } + if (isDataScheme(url)) { + this._hideViewBookmark(); + } + let title = pdfjs_getPdfFilenameFromUrl(url, ""); + if (!title) { + try { + title = decodeURIComponent(getFilenameFromUrl(url)); + } catch {} + } + this.setTitle(title || url); + }, + setTitle(title = this._title) { + this._title = title; + if (this.isViewerEmbedded) { + return; + } + const editorIndicator = this._hasAnnotationEditors && !this.pdfRenderingQueue.printing; + document.title = `${editorIndicator ? "* " : ""}${title}`; + }, + get _docFilename() { + return this._contentDispositionFilename || pdfjs_getPdfFilenameFromUrl(this.url); + }, + _hideViewBookmark() { + const { + secondaryToolbar + } = this.appConfig; + secondaryToolbar?.viewBookmarkButton.classList.add("hidden"); + if (secondaryToolbar?.presentationModeButton.classList.contains("hidden")) { + document.getElementById("viewBookmarkSeparator")?.classList.add("hidden"); + } + }, + async close() { + this._unblockDocumentLoadEvent(); + this._hideViewBookmark(); + if (!this.pdfLoadingTask) { + return; + } + if (this.pdfDocument?.annotationStorage.size > 0 && this._annotationStorageModified) { + try { + await this.save(); + } catch {} + } + const promises = []; + promises.push(this.pdfLoadingTask.destroy()); + this.pdfLoadingTask = null; + if (this.pdfDocument) { + this.pdfDocument = null; + this.pdfThumbnailViewer?.setDocument(null); + this.pdfViewer.setDocument(null); + this.pdfLinkService.setDocument(null); + this.pdfDocumentProperties?.setDocument(null); + } + this.pdfLinkService.externalLinkEnabled = true; + this.store = null; + this.isInitialViewSet = false; + this.url = ""; + this.baseUrl = ""; + this._downloadUrl = ""; + this.documentInfo = null; + this.metadata = null; + this._contentDispositionFilename = null; + this._contentLength = null; + this._saveInProgress = false; + this._hasAnnotationEditors = false; + promises.push(this.pdfScriptingManager.destroyPromise, this.passwordPrompt.close()); + this.setTitle(); + this.pdfSidebar?.reset(); + this.pdfOutlineViewer?.reset(); + this.pdfAttachmentViewer?.reset(); + this.pdfLayerViewer?.reset(); + this.pdfHistory?.reset(); + this.findBar?.reset(); + this.toolbar?.reset(); + this.secondaryToolbar?.reset(); + this._PDFBug?.cleanup(); + await Promise.all(promises); + }, + async open(args) { + if (this.pdfLoadingTask) { + await this.close(); + } + const workerParams = AppOptions.getAll(OptionKind.WORKER); + Object.assign(GlobalWorkerOptions, workerParams); + if (args.url) { + this.setTitleUsingUrl(args.originalUrl || args.url, args.url); + } + const apiParams = AppOptions.getAll(OptionKind.API); + const loadingTask = getDocument({ + ...apiParams, + ...args + }); + this.pdfLoadingTask = loadingTask; + loadingTask.onPassword = (updateCallback, reason) => { + if (this.isViewerEmbedded) { + this._unblockDocumentLoadEvent(); + } + this.pdfLinkService.externalLinkEnabled = false; + this.passwordPrompt.setUpdateCallback(updateCallback, reason); + this.passwordPrompt.open(); + }; + loadingTask.onProgress = ({ + loaded, + total + }) => { + this.progress(loaded / total); + }; + return loadingTask.promise.then(pdfDocument => { + this.load(pdfDocument); + }, reason => { + if (loadingTask !== this.pdfLoadingTask) { + return undefined; + } + let key = "pdfjs-loading-error"; + if (reason instanceof InvalidPDFException) { + key = "pdfjs-invalid-file-error"; + } else if (reason instanceof MissingPDFException) { + key = "pdfjs-missing-file-error"; + } else if (reason instanceof UnexpectedResponseException) { + key = "pdfjs-unexpected-response-error"; + } + return this._documentError(key, { + message: reason.message + }).then(() => { + throw reason; + }); + }); + }, + async download() { + let data; + try { + data = await this.pdfDocument.getData(); + } catch {} + this.downloadManager.download(data, this._downloadUrl, this._docFilename); + }, + async save() { + if (this._saveInProgress) { + return; + } + this._saveInProgress = true; + await this.pdfScriptingManager.dispatchWillSave(); + try { + const data = await this.pdfDocument.saveDocument(); + this.downloadManager.download(data, this._downloadUrl, this._docFilename); + } catch (reason) { + console.error(`Error when saving the document:`, reason); + await this.download(); + } finally { + await this.pdfScriptingManager.dispatchDidSave(); + this._saveInProgress = false; + } + if (this._hasAnnotationEditors) { + this.externalServices.reportTelemetry({ + type: "editing", + data: { + type: "save", + stats: this.pdfDocument?.annotationStorage.editorStats + } + }); + } + }, + async downloadOrSave() { + const { + classList + } = this.appConfig.appContainer; + classList.add("wait"); + await (this.pdfDocument?.annotationStorage.size > 0 ? this.save() : this.download()); + classList.remove("wait"); + }, + async _documentError(key, moreInfo = null) { + this._unblockDocumentLoadEvent(); + const message = await this._otherError(key || "pdfjs-loading-error", moreInfo); + this.eventBus.dispatch("documenterror", { + source: this, + message, + reason: moreInfo?.message ?? null + }); + }, + async _otherError(key, moreInfo = null) { + const message = await this.l10n.get(key); + const moreInfoText = [`PDF.js v${version || "?"} (build: ${build || "?"})`]; + if (moreInfo) { + moreInfoText.push(`Message: ${moreInfo.message}`); + if (moreInfo.stack) { + moreInfoText.push(`Stack: ${moreInfo.stack}`); + } else { + if (moreInfo.filename) { + moreInfoText.push(`File: ${moreInfo.filename}`); + } + if (moreInfo.lineNumber) { + moreInfoText.push(`Line: ${moreInfo.lineNumber}`); + } + } + } + console.error(`${message}\n\n${moreInfoText.join("\n")}`); + return message; + }, + progress(level) { + const percent = Math.round(level * 100); + if (!this.loadingBar || percent <= this.loadingBar.percent) { + return; + } + this.loadingBar.percent = percent; + if (this.pdfDocument?.loadingParams.disableAutoFetch ?? AppOptions.get("disableAutoFetch")) { + this.loadingBar.setDisableAutoFetch(); + } + }, + load(pdfDocument) { + this.pdfDocument = pdfDocument; + pdfDocument.getDownloadInfo().then(({ + length + }) => { + this._contentLength = length; + this.loadingBar?.hide(); + firstPagePromise.then(() => { + this.eventBus.dispatch("documentloaded", { + source: this + }); + }); + }); + const pageLayoutPromise = pdfDocument.getPageLayout().catch(() => {}); + const pageModePromise = pdfDocument.getPageMode().catch(() => {}); + const openActionPromise = pdfDocument.getOpenAction().catch(() => {}); + this.toolbar?.setPagesCount(pdfDocument.numPages, false); + this.secondaryToolbar?.setPagesCount(pdfDocument.numPages); + this.pdfLinkService.setDocument(pdfDocument); + this.pdfDocumentProperties?.setDocument(pdfDocument); + const pdfViewer = this.pdfViewer; + pdfViewer.setDocument(pdfDocument); + const { + firstPagePromise, + onePageRendered, + pagesPromise + } = pdfViewer; + this.pdfThumbnailViewer?.setDocument(pdfDocument); + const storedPromise = (this.store = new ViewHistory(pdfDocument.fingerprints[0])).getMultiple({ + page: null, + zoom: DEFAULT_SCALE_VALUE, + scrollLeft: "0", + scrollTop: "0", + rotation: null, + sidebarView: SidebarView.UNKNOWN, + scrollMode: ScrollMode.UNKNOWN, + spreadMode: SpreadMode.UNKNOWN + }).catch(() => {}); + firstPagePromise.then(pdfPage => { + this.loadingBar?.setWidth(this.appConfig.viewerContainer); + this._initializeAnnotationStorageCallbacks(pdfDocument); + Promise.all([animationStarted, storedPromise, pageLayoutPromise, pageModePromise, openActionPromise]).then(async ([timeStamp, stored, pageLayout, pageMode, openAction]) => { + const viewOnLoad = AppOptions.get("viewOnLoad"); + this._initializePdfHistory({ + fingerprint: pdfDocument.fingerprints[0], + viewOnLoad, + initialDest: openAction?.dest + }); + const initialBookmark = this.initialBookmark; + const zoom = AppOptions.get("defaultZoomValue"); + let hash = zoom ? `zoom=${zoom}` : null; + let rotation = null; + let sidebarView = AppOptions.get("sidebarViewOnLoad"); + let scrollMode = AppOptions.get("scrollModeOnLoad"); + let spreadMode = AppOptions.get("spreadModeOnLoad"); + if (stored?.page && viewOnLoad !== ViewOnLoad.INITIAL) { + hash = `page=${stored.page}&zoom=${zoom || stored.zoom},` + `${stored.scrollLeft},${stored.scrollTop}`; + rotation = parseInt(stored.rotation, 10); + if (sidebarView === SidebarView.UNKNOWN) { + sidebarView = stored.sidebarView | 0; + } + if (scrollMode === ScrollMode.UNKNOWN) { + scrollMode = stored.scrollMode | 0; + } + if (spreadMode === SpreadMode.UNKNOWN) { + spreadMode = stored.spreadMode | 0; + } + } + if (pageMode && sidebarView === SidebarView.UNKNOWN) { + sidebarView = apiPageModeToSidebarView(pageMode); + } + if (pageLayout && scrollMode === ScrollMode.UNKNOWN && spreadMode === SpreadMode.UNKNOWN) { + const modes = apiPageLayoutToViewerModes(pageLayout); + spreadMode = modes.spreadMode; + } + this.setInitialView(hash, { + rotation, + sidebarView, + scrollMode, + spreadMode + }); + this.eventBus.dispatch("documentinit", { + source: this + }); + if (!this.isViewerEmbedded) { + pdfViewer.focus(); + } + await Promise.race([pagesPromise, new Promise(resolve => { + setTimeout(resolve, FORCE_PAGES_LOADED_TIMEOUT); + })]); + if (!initialBookmark && !hash) { + return; + } + if (pdfViewer.hasEqualPageSizes) { + return; + } + this.initialBookmark = initialBookmark; + pdfViewer.currentScaleValue = pdfViewer.currentScaleValue; + this.setInitialView(hash); + }).catch(() => { + this.setInitialView(); + }).then(function () { + pdfViewer.update(); + }); + }); + pagesPromise.then(() => { + this._unblockDocumentLoadEvent(); + this._initializeAutoPrint(pdfDocument, openActionPromise); + }, reason => { + this._documentError("pdfjs-loading-error", { + message: reason.message + }); + }); + onePageRendered.then(data => { + this.externalServices.reportTelemetry({ + type: "pageInfo", + timestamp: data.timestamp + }); + if (this.pdfOutlineViewer) { + pdfDocument.getOutline().then(outline => { + if (pdfDocument !== this.pdfDocument) { + return; + } + this.pdfOutlineViewer.render({ + outline, + pdfDocument + }); + }); + } + if (this.pdfAttachmentViewer) { + pdfDocument.getAttachments().then(attachments => { + if (pdfDocument !== this.pdfDocument) { + return; + } + this.pdfAttachmentViewer.render({ + attachments + }); + }); + } + if (this.pdfLayerViewer) { + pdfViewer.optionalContentConfigPromise.then(optionalContentConfig => { + if (pdfDocument !== this.pdfDocument) { + return; + } + this.pdfLayerViewer.render({ + optionalContentConfig, + pdfDocument + }); + }); + } + }); + this._initializePageLabels(pdfDocument); + this._initializeMetadata(pdfDocument); + }, + async _scriptingDocProperties(pdfDocument) { + if (!this.documentInfo) { + await new Promise(resolve => { + this.eventBus._on("metadataloaded", resolve, { + once: true + }); + }); + if (pdfDocument !== this.pdfDocument) { + return null; + } + } + if (!this._contentLength) { + await new Promise(resolve => { + this.eventBus._on("documentloaded", resolve, { + once: true + }); + }); + if (pdfDocument !== this.pdfDocument) { + return null; + } + } + return { + ...this.documentInfo, + baseURL: this.baseUrl, + filesize: this._contentLength, + filename: this._docFilename, + metadata: this.metadata?.getRaw(), + authors: this.metadata?.get("dc:creator"), + numPages: this.pagesCount, + URL: this.url + }; + }, + async _initializeAutoPrint(pdfDocument, openActionPromise) { + const [openAction, jsActions] = await Promise.all([openActionPromise, this.pdfViewer.enableScripting ? null : pdfDocument.getJSActions()]); + if (pdfDocument !== this.pdfDocument) { + return; + } + let triggerAutoPrint = openAction?.action === "Print"; + if (jsActions) { + console.warn("Warning: JavaScript support is not enabled"); + for (const name in jsActions) { + if (triggerAutoPrint) { + break; + } + switch (name) { + case "WillClose": + case "WillSave": + case "DidSave": + case "WillPrint": + case "DidPrint": + continue; + } + triggerAutoPrint = jsActions[name].some(js => AutoPrintRegExp.test(js)); + } + } + if (triggerAutoPrint) { + this.triggerPrinting(); + } + }, + async _initializeMetadata(pdfDocument) { + const { + info, + metadata, + contentDispositionFilename, + contentLength + } = await pdfDocument.getMetadata(); + if (pdfDocument !== this.pdfDocument) { + return; + } + this.documentInfo = info; + this.metadata = metadata; + this._contentDispositionFilename ??= contentDispositionFilename; + this._contentLength ??= contentLength; + console.log(`PDF ${pdfDocument.fingerprints[0]} [${info.PDFFormatVersion} ` + `${(info.Producer || "-").trim()} / ${(info.Creator || "-").trim()}] ` + `(PDF.js: ${version || "?"} [${build || "?"}])`); + let pdfTitle = info.Title; + const metadataTitle = metadata?.get("dc:title"); + if (metadataTitle) { + if (metadataTitle !== "Untitled" && !/[\uFFF0-\uFFFF]/g.test(metadataTitle)) { + pdfTitle = metadataTitle; + } + } + if (pdfTitle) { + this.setTitle(`${pdfTitle} - ${this._contentDispositionFilename || this._title}`); + } else if (this._contentDispositionFilename) { + this.setTitle(this._contentDispositionFilename); + } + if (info.IsXFAPresent && !info.IsAcroFormPresent && !pdfDocument.isPureXfa) { + if (pdfDocument.loadingParams.enableXfa) { + console.warn("Warning: XFA Foreground documents are not supported"); + } else { + console.warn("Warning: XFA support is not enabled"); + } + } else if ((info.IsAcroFormPresent || info.IsXFAPresent) && !this.pdfViewer.renderForms) { + console.warn("Warning: Interactive form support is not enabled"); + } + if (info.IsSignaturesPresent) { + console.warn("Warning: Digital signatures validation is not supported"); + } + this.eventBus.dispatch("metadataloaded", { + source: this + }); + }, + async _initializePageLabels(pdfDocument) { + const labels = await pdfDocument.getPageLabels(); + if (pdfDocument !== this.pdfDocument) { + return; + } + if (!labels || AppOptions.get("disablePageLabels")) { + return; + } + const numLabels = labels.length; + let standardLabels = 0, + emptyLabels = 0; + for (let i = 0; i < numLabels; i++) { + const label = labels[i]; + if (label === (i + 1).toString()) { + standardLabels++; + } else if (label === "") { + emptyLabels++; + } else { + break; + } + } + if (standardLabels >= numLabels || emptyLabels >= numLabels) { + return; + } + const { + pdfViewer, + pdfThumbnailViewer, + toolbar + } = this; + pdfViewer.setPageLabels(labels); + pdfThumbnailViewer?.setPageLabels(labels); + toolbar?.setPagesCount(numLabels, true); + toolbar?.setPageNumber(pdfViewer.currentPageNumber, pdfViewer.currentPageLabel); + }, + _initializePdfHistory({ + fingerprint, + viewOnLoad, + initialDest = null + }) { + if (!this.pdfHistory) { + return; + } + this.pdfHistory.initialize({ + fingerprint, + resetHistory: viewOnLoad === ViewOnLoad.INITIAL, + updateUrl: AppOptions.get("historyUpdateUrl") + }); + if (this.pdfHistory.initialBookmark) { + this.initialBookmark = this.pdfHistory.initialBookmark; + this.initialRotation = this.pdfHistory.initialRotation; + } + if (initialDest && !this.initialBookmark && viewOnLoad === ViewOnLoad.UNKNOWN) { + this.initialBookmark = JSON.stringify(initialDest); + this.pdfHistory.push({ + explicitDest: initialDest, + pageNumber: null + }); + } + }, + _initializeAnnotationStorageCallbacks(pdfDocument) { + if (pdfDocument !== this.pdfDocument) { + return; + } + const { + annotationStorage + } = pdfDocument; + annotationStorage.onSetModified = () => { + window.addEventListener("beforeunload", beforeUnload); + this._annotationStorageModified = true; + }; + annotationStorage.onResetModified = () => { + window.removeEventListener("beforeunload", beforeUnload); + delete this._annotationStorageModified; + }; + annotationStorage.onAnnotationEditor = typeStr => { + this._hasAnnotationEditors = !!typeStr; + this.setTitle(); + }; + }, + setInitialView(storedHash, { + rotation, + sidebarView, + scrollMode, + spreadMode + } = {}) { + const setRotation = angle => { + if (isValidRotation(angle)) { + this.pdfViewer.pagesRotation = angle; + } + }; + const setViewerModes = (scroll, spread) => { + if (isValidScrollMode(scroll)) { + this.pdfViewer.scrollMode = scroll; + } + if (isValidSpreadMode(spread)) { + this.pdfViewer.spreadMode = spread; + } + }; + this.isInitialViewSet = true; + this.pdfSidebar?.setInitialView(sidebarView); + setViewerModes(scrollMode, spreadMode); + if (this.initialBookmark) { + setRotation(this.initialRotation); + delete this.initialRotation; + this.pdfLinkService.setHash(this.initialBookmark); + this.initialBookmark = null; + } else if (storedHash) { + setRotation(rotation); + this.pdfLinkService.setHash(storedHash); + } + this.toolbar?.setPageNumber(this.pdfViewer.currentPageNumber, this.pdfViewer.currentPageLabel); + this.secondaryToolbar?.setPageNumber(this.pdfViewer.currentPageNumber); + if (!this.pdfViewer.currentScaleValue) { + this.pdfViewer.currentScaleValue = DEFAULT_SCALE_VALUE; + } + }, + _cleanup() { + if (!this.pdfDocument) { + return; + } + this.pdfViewer.cleanup(); + this.pdfThumbnailViewer?.cleanup(); + this.pdfDocument.cleanup(AppOptions.get("fontExtraProperties")); + }, + forceRendering() { + this.pdfRenderingQueue.printing = !!this.printService; + this.pdfRenderingQueue.isThumbnailViewEnabled = this.pdfSidebar?.visibleView === SidebarView.THUMBS; + this.pdfRenderingQueue.renderHighestPriority(); + }, + beforePrint() { + this._printAnnotationStoragePromise = this.pdfScriptingManager.dispatchWillPrint().catch(() => {}).then(() => this.pdfDocument?.annotationStorage.print); + if (this.printService) { + return; + } + if (!this.supportsPrinting) { + this._otherError("pdfjs-printing-not-supported"); + return; + } + if (!this.pdfViewer.pageViewsReady) { + this.l10n.get("pdfjs-printing-not-ready").then(msg => { + window.alert(msg); + }); + return; + } + this.printService = PDFPrintServiceFactory.createPrintService({ + pdfDocument: this.pdfDocument, + pagesOverview: this.pdfViewer.getPagesOverview(), + printContainer: this.appConfig.printContainer, + printResolution: AppOptions.get("printResolution"), + printAnnotationStoragePromise: this._printAnnotationStoragePromise + }); + this.forceRendering(); + this.setTitle(); + this.printService.layout(); + if (this._hasAnnotationEditors) { + this.externalServices.reportTelemetry({ + type: "editing", + data: { + type: "print", + stats: this.pdfDocument?.annotationStorage.editorStats + } + }); + } + }, + afterPrint() { + if (this._printAnnotationStoragePromise) { + this._printAnnotationStoragePromise.then(() => { + this.pdfScriptingManager.dispatchDidPrint(); + }); + this._printAnnotationStoragePromise = null; + } + if (this.printService) { + this.printService.destroy(); + this.printService = null; + this.pdfDocument?.annotationStorage.resetModified(); + } + this.forceRendering(); + this.setTitle(); + }, + rotatePages(delta) { + this.pdfViewer.pagesRotation += delta; + }, + requestPresentationMode() { + this.pdfPresentationMode?.request(); + }, + triggerPrinting() { + if (this.supportsPrinting) { + window.print(); + } + }, + bindEvents() { + if (this._eventBusAbortController) { + return; + } + const ac = this._eventBusAbortController = new AbortController(); + const opts = { + signal: ac.signal + }; + const { + eventBus, + externalServices, + pdfDocumentProperties, + pdfViewer, + preferences + } = this; + eventBus._on("resize", onResize.bind(this), opts); + eventBus._on("hashchange", onHashchange.bind(this), opts); + eventBus._on("beforeprint", this.beforePrint.bind(this), opts); + eventBus._on("afterprint", this.afterPrint.bind(this), opts); + eventBus._on("pagerender", onPageRender.bind(this), opts); + eventBus._on("pagerendered", onPageRendered.bind(this), opts); + eventBus._on("updateviewarea", onUpdateViewarea.bind(this), opts); + eventBus._on("pagechanging", onPageChanging.bind(this), opts); + eventBus._on("scalechanging", onScaleChanging.bind(this), opts); + eventBus._on("rotationchanging", onRotationChanging.bind(this), opts); + eventBus._on("sidebarviewchanged", onSidebarViewChanged.bind(this), opts); + eventBus._on("pagemode", onPageMode.bind(this), opts); + eventBus._on("namedaction", onNamedAction.bind(this), opts); + eventBus._on("presentationmodechanged", evt => pdfViewer.presentationModeState = evt.state, opts); + eventBus._on("presentationmode", this.requestPresentationMode.bind(this), opts); + eventBus._on("switchannotationeditormode", evt => pdfViewer.annotationEditorMode = evt, opts); + eventBus._on("print", this.triggerPrinting.bind(this), opts); + eventBus._on("download", this.downloadOrSave.bind(this), opts); + eventBus._on("firstpage", () => this.page = 1, opts); + eventBus._on("lastpage", () => this.page = this.pagesCount, opts); + eventBus._on("nextpage", () => pdfViewer.nextPage(), opts); + eventBus._on("previouspage", () => pdfViewer.previousPage(), opts); + eventBus._on("zoomin", this.zoomIn.bind(this), opts); + eventBus._on("zoomout", this.zoomOut.bind(this), opts); + eventBus._on("zoomreset", this.zoomReset.bind(this), opts); + eventBus._on("pagenumberchanged", onPageNumberChanged.bind(this), opts); + eventBus._on("scalechanged", evt => pdfViewer.currentScaleValue = evt.value, opts); + eventBus._on("rotatecw", this.rotatePages.bind(this, 90), opts); + eventBus._on("rotateccw", this.rotatePages.bind(this, -90), opts); + eventBus._on("optionalcontentconfig", evt => pdfViewer.optionalContentConfigPromise = evt.promise, opts); + eventBus._on("switchscrollmode", evt => pdfViewer.scrollMode = evt.mode, opts); + eventBus._on("scrollmodechanged", onViewerModesChanged.bind(this, "scrollMode"), opts); + eventBus._on("switchspreadmode", evt => pdfViewer.spreadMode = evt.mode, opts); + eventBus._on("spreadmodechanged", onViewerModesChanged.bind(this, "spreadMode"), opts); + eventBus._on("imagealttextsettings", onImageAltTextSettings.bind(this), opts); + eventBus._on("documentproperties", () => pdfDocumentProperties?.open(), opts); + eventBus._on("findfromurlhash", onFindFromUrlHash.bind(this), opts); + eventBus._on("updatefindmatchescount", onUpdateFindMatchesCount.bind(this), opts); + eventBus._on("updatefindcontrolstate", onUpdateFindControlState.bind(this), opts); + eventBus._on("fileinputchange", onFileInputChange.bind(this), opts); + eventBus._on("openfile", onOpenFile.bind(this), opts); + }, + bindWindowEvents() { + if (this._windowAbortController) { + return; + } + this._windowAbortController = new AbortController(); + const { + eventBus, + appConfig: { + mainContainer + }, + pdfViewer, + _windowAbortController: { + signal + } + } = this; + if (typeof AbortSignal.any === "function") { + this._touchManager = new TouchManager({ + container: window, + isPinchingDisabled: () => pdfViewer.isInPresentationMode, + isPinchingStopped: () => this.overlayManager?.active, + onPinching: this.touchPinchCallback.bind(this), + onPinchEnd: this.touchPinchEndCallback.bind(this), + signal + }); + } + function addWindowResolutionChange(evt = null) { + if (evt) { + pdfViewer.refresh(); + } + const mediaQueryList = window.matchMedia(`(resolution: ${window.devicePixelRatio || 1}dppx)`); + mediaQueryList.addEventListener("change", addWindowResolutionChange, { + once: true, + signal + }); + } + addWindowResolutionChange(); + window.addEventListener("wheel", onWheel.bind(this), { + passive: false, + signal + }); + window.addEventListener("click", onClick.bind(this), { + signal + }); + window.addEventListener("keydown", onKeyDown.bind(this), { + signal + }); + window.addEventListener("keyup", onKeyUp.bind(this), { + signal + }); + window.addEventListener("resize", () => eventBus.dispatch("resize", { + source: window + }), { + signal + }); + window.addEventListener("hashchange", () => { + eventBus.dispatch("hashchange", { + source: window, + hash: document.location.hash.substring(1) + }); + }, { + signal + }); + window.addEventListener("beforeprint", () => eventBus.dispatch("beforeprint", { + source: window + }), { + signal + }); + window.addEventListener("afterprint", () => eventBus.dispatch("afterprint", { + source: window + }), { + signal + }); + window.addEventListener("updatefromsandbox", evt => { + eventBus.dispatch("updatefromsandbox", { + source: window, + detail: evt.detail + }); + }, { + signal + }); + if (!("onscrollend" in document.documentElement)) { + return; + } + ({ + scrollTop: this._lastScrollTop, + scrollLeft: this._lastScrollLeft + } = mainContainer); + const scrollend = () => { + ({ + scrollTop: this._lastScrollTop, + scrollLeft: this._lastScrollLeft + } = mainContainer); + this._isScrolling = false; + mainContainer.addEventListener("scroll", scroll, { + passive: true, + signal + }); + mainContainer.removeEventListener("scrollend", scrollend); + mainContainer.removeEventListener("blur", scrollend); + }; + const scroll = () => { + if (this._isCtrlKeyDown) { + return; + } + if (this._lastScrollTop === mainContainer.scrollTop && this._lastScrollLeft === mainContainer.scrollLeft) { + return; + } + mainContainer.removeEventListener("scroll", scroll); + this._isScrolling = true; + mainContainer.addEventListener("scrollend", scrollend, { + signal + }); + mainContainer.addEventListener("blur", scrollend, { + signal + }); + }; + mainContainer.addEventListener("scroll", scroll, { + passive: true, + signal + }); + }, + unbindEvents() { + this._eventBusAbortController?.abort(); + this._eventBusAbortController = null; + }, + unbindWindowEvents() { + this._windowAbortController?.abort(); + this._windowAbortController = null; + this._touchManager = null; + }, + async testingClose() { + this.unbindEvents(); + this.unbindWindowEvents(); + this._globalAbortController?.abort(); + this._globalAbortController = null; + this.findBar?.close(); + await Promise.all([this.l10n?.destroy(), this.close()]); + }, + _accumulateTicks(ticks, prop) { + if (this[prop] > 0 && ticks < 0 || this[prop] < 0 && ticks > 0) { + this[prop] = 0; + } + this[prop] += ticks; + const wholeTicks = Math.trunc(this[prop]); + this[prop] -= wholeTicks; + return wholeTicks; + }, + _accumulateFactor(previousScale, factor, prop) { + if (factor === 1) { + return 1; + } + if (this[prop] > 1 && factor < 1 || this[prop] < 1 && factor > 1) { + this[prop] = 1; + } + const newFactor = Math.floor(previousScale * factor * this[prop] * 100) / (100 * previousScale); + this[prop] = factor / newFactor; + return newFactor; + }, + _unblockDocumentLoadEvent() { + document.blockUnblockOnload?.(false); + this._unblockDocumentLoadEvent = () => {}; + }, + get scriptingReady() { + return this.pdfScriptingManager.ready; + } +}; +initCom(PDFViewerApplication); +{ + PDFPrintServiceFactory.initGlobals(PDFViewerApplication); +} +{ + const HOSTED_VIEWER_ORIGINS = ["null", "http://mozilla.github.io", "https://mozilla.github.io"]; + var validateFileURL = function (file) { + if (!file) { + return; + } + try { + const viewerOrigin = new URL(window.location.href).origin || "null"; + if (HOSTED_VIEWER_ORIGINS.includes(viewerOrigin)) { + return; + } + const fileOrigin = new URL(file, window.location.href).origin; + if (fileOrigin !== viewerOrigin) { + throw new Error("file origin does not match viewer's"); + } + } catch (ex) { + PDFViewerApplication._documentError("pdfjs-loading-error", { + message: ex.message + }); + throw ex; + } + }; + var onFileInputChange = function (evt) { + if (this.pdfViewer?.isInPresentationMode) { + return; + } + const file = evt.fileInput.files[0]; + this.open({ + url: URL.createObjectURL(file), + originalUrl: file.name + }); + }; + var onOpenFile = function (evt) { + this._openFileInput?.click(); + }; +} +function onPageRender({ + pageNumber +}) { + if (pageNumber === this.page) { + this.toolbar?.updateLoadingIndicatorState(true); + } +} +function onPageRendered({ + pageNumber, + error +}) { + if (pageNumber === this.page) { + this.toolbar?.updateLoadingIndicatorState(false); + } + if (this.pdfSidebar?.visibleView === SidebarView.THUMBS) { + const pageView = this.pdfViewer.getPageView(pageNumber - 1); + const thumbnailView = this.pdfThumbnailViewer?.getThumbnail(pageNumber - 1); + if (pageView) { + thumbnailView?.setImage(pageView); + } + } + if (error) { + this._otherError("pdfjs-rendering-error", error); + } +} +function onPageMode({ + mode +}) { + let view; + switch (mode) { + case "thumbs": + view = SidebarView.THUMBS; + break; + case "bookmarks": + case "outline": + view = SidebarView.OUTLINE; + break; + case "attachments": + view = SidebarView.ATTACHMENTS; + break; + case "layers": + view = SidebarView.LAYERS; + break; + case "none": + view = SidebarView.NONE; + break; + default: + console.error('Invalid "pagemode" hash parameter: ' + mode); + return; + } + this.pdfSidebar?.switchView(view, true); +} +function onNamedAction(evt) { + switch (evt.action) { + case "GoToPage": + this.appConfig.toolbar?.pageNumber.select(); + break; + case "Find": + if (!this.supportsIntegratedFind) { + this.findBar?.toggle(); + } + break; + case "Print": + this.triggerPrinting(); + break; + case "SaveAs": + this.downloadOrSave(); + break; + } +} +function onSidebarViewChanged({ + view +}) { + this.pdfRenderingQueue.isThumbnailViewEnabled = view === SidebarView.THUMBS; + if (this.isInitialViewSet) { + this.store?.set("sidebarView", view).catch(() => {}); + } +} +function onUpdateViewarea({ + location +}) { + if (this.isInitialViewSet) { + this.store?.setMultiple({ + page: location.pageNumber, + zoom: location.scale, + scrollLeft: location.left, + scrollTop: location.top, + rotation: location.rotation + }).catch(() => {}); + } + if (this.appConfig.secondaryToolbar) { + this.appConfig.secondaryToolbar.viewBookmarkButton.href = this.pdfLinkService.getAnchorUrl(location.pdfOpenParams); + } +} +function onViewerModesChanged(name, evt) { + if (this.isInitialViewSet && !this.pdfViewer.isInPresentationMode) { + this.store?.set(name, evt.mode).catch(() => {}); + } +} +function onResize() { + const { + pdfDocument, + pdfViewer, + pdfRenderingQueue + } = this; + if (pdfRenderingQueue.printing && window.matchMedia("print").matches) { + return; + } + if (!pdfDocument) { + return; + } + const currentScaleValue = pdfViewer.currentScaleValue; + if (currentScaleValue === "auto" || currentScaleValue === "page-fit" || currentScaleValue === "page-width") { + pdfViewer.currentScaleValue = currentScaleValue; + } + pdfViewer.update(); +} +function onHashchange(evt) { + const hash = evt.hash; + if (!hash) { + return; + } + if (!this.isInitialViewSet) { + this.initialBookmark = hash; + } else if (!this.pdfHistory?.popStateInProgress) { + this.pdfLinkService.setHash(hash); + } +} +function onPageNumberChanged(evt) { + const { + pdfViewer + } = this; + if (evt.value !== "") { + this.pdfLinkService.goToPage(evt.value); + } + if (evt.value !== pdfViewer.currentPageNumber.toString() && evt.value !== pdfViewer.currentPageLabel) { + this.toolbar?.setPageNumber(pdfViewer.currentPageNumber, pdfViewer.currentPageLabel); + } +} +function onImageAltTextSettings() { + this.imageAltTextSettings?.open({ + enableGuessAltText: AppOptions.get("enableGuessAltText"), + enableNewAltTextWhenAddingImage: AppOptions.get("enableNewAltTextWhenAddingImage") + }); +} +function onFindFromUrlHash(evt) { + this.eventBus.dispatch("find", { + source: evt.source, + type: "", + query: evt.query, + caseSensitive: false, + entireWord: false, + highlightAll: true, + findPrevious: false, + matchDiacritics: true + }); +} +function onUpdateFindMatchesCount({ + matchesCount +}) { + if (this.supportsIntegratedFind) { + this.externalServices.updateFindMatchesCount(matchesCount); + } else { + this.findBar?.updateResultsCount(matchesCount); + } +} +function onUpdateFindControlState({ + state, + previous, + entireWord, + matchesCount, + rawQuery +}) { + if (this.supportsIntegratedFind) { + this.externalServices.updateFindControlState({ + result: state, + findPrevious: previous, + entireWord, + matchesCount, + rawQuery + }); + } else { + this.findBar?.updateUIState(state, previous, matchesCount); + } +} +function onScaleChanging(evt) { + this.toolbar?.setPageScale(evt.presetValue, evt.scale); + this.pdfViewer.update(); +} +function onRotationChanging(evt) { + if (this.pdfThumbnailViewer) { + this.pdfThumbnailViewer.pagesRotation = evt.pagesRotation; + } + this.forceRendering(); + this.pdfViewer.currentPageNumber = evt.pageNumber; +} +function onPageChanging({ + pageNumber, + pageLabel +}) { + this.toolbar?.setPageNumber(pageNumber, pageLabel); + this.secondaryToolbar?.setPageNumber(pageNumber); + if (this.pdfSidebar?.visibleView === SidebarView.THUMBS) { + this.pdfThumbnailViewer?.scrollThumbnailIntoView(pageNumber); + } + const currentPage = this.pdfViewer.getPageView(pageNumber - 1); + this.toolbar?.updateLoadingIndicatorState(currentPage?.renderingState === RenderingStates.RUNNING); +} +function onWheel(evt) { + const { + pdfViewer, + supportsMouseWheelZoomCtrlKey, + supportsMouseWheelZoomMetaKey, + supportsPinchToZoom + } = this; + if (pdfViewer.isInPresentationMode) { + return; + } + const deltaMode = evt.deltaMode; + let scaleFactor = Math.exp(-evt.deltaY / 100); + const isBuiltInMac = false; + const isPinchToZoom = evt.ctrlKey && !this._isCtrlKeyDown && deltaMode === WheelEvent.DOM_DELTA_PIXEL && evt.deltaX === 0 && (Math.abs(scaleFactor - 1) < 0.05 || isBuiltInMac) && evt.deltaZ === 0; + const origin = [evt.clientX, evt.clientY]; + if (isPinchToZoom || evt.ctrlKey && supportsMouseWheelZoomCtrlKey || evt.metaKey && supportsMouseWheelZoomMetaKey) { + evt.preventDefault(); + if (this._isScrolling || document.visibilityState === "hidden" || this.overlayManager.active) { + return; + } + if (isPinchToZoom && supportsPinchToZoom) { + scaleFactor = this._accumulateFactor(pdfViewer.currentScale, scaleFactor, "_wheelUnusedFactor"); + this.updateZoom(null, scaleFactor, origin); + } else { + const delta = normalizeWheelEventDirection(evt); + let ticks = 0; + if (deltaMode === WheelEvent.DOM_DELTA_LINE || deltaMode === WheelEvent.DOM_DELTA_PAGE) { + ticks = Math.abs(delta) >= 1 ? Math.sign(delta) : this._accumulateTicks(delta, "_wheelUnusedTicks"); + } else { + const PIXELS_PER_LINE_SCALE = 30; + ticks = this._accumulateTicks(delta / PIXELS_PER_LINE_SCALE, "_wheelUnusedTicks"); + } + this.updateZoom(ticks, null, origin); + } + } +} +function closeSecondaryToolbar(evt) { + if (!this.secondaryToolbar?.isOpen) { + return; + } + const appConfig = this.appConfig; + if (this.pdfViewer.containsElement(evt.target) || appConfig.toolbar?.container.contains(evt.target) && !appConfig.secondaryToolbar?.toggleButton.contains(evt.target)) { + this.secondaryToolbar.close(); + } +} +function closeEditorUndoBar(evt) { + if (!this.editorUndoBar?.isOpen) { + return; + } + if (this.appConfig.secondaryToolbar?.toolbar.contains(evt.target)) { + this.editorUndoBar.hide(); + } +} +function onClick(evt) { + closeSecondaryToolbar.call(this, evt); + closeEditorUndoBar.call(this, evt); +} +function onKeyUp(evt) { + if (evt.key === "Control") { + this._isCtrlKeyDown = false; + } +} +function onKeyDown(evt) { + this._isCtrlKeyDown = evt.key === "Control"; + if (this.editorUndoBar?.isOpen && evt.keyCode !== 9 && evt.keyCode !== 16 && !((evt.keyCode === 13 || evt.keyCode === 32) && getActiveOrFocusedElement() === this.appConfig.editorUndoBar.undoButton)) { + this.editorUndoBar.hide(); + } + if (this.overlayManager.active) { + return; + } + const { + eventBus, + pdfViewer + } = this; + const isViewerInPresentationMode = pdfViewer.isInPresentationMode; + let handled = false, + ensureViewerFocused = false; + const cmd = (evt.ctrlKey ? 1 : 0) | (evt.altKey ? 2 : 0) | (evt.shiftKey ? 4 : 0) | (evt.metaKey ? 8 : 0); + if (cmd === 1 || cmd === 8 || cmd === 5 || cmd === 12) { + switch (evt.keyCode) { + case 70: + if (!this.supportsIntegratedFind && !evt.shiftKey) { + this.findBar?.open(); + handled = true; + } + break; + case 71: + if (!this.supportsIntegratedFind) { + const { + state + } = this.findController; + if (state) { + const newState = { + source: window, + type: "again", + findPrevious: cmd === 5 || cmd === 12 + }; + eventBus.dispatch("find", { + ...state, + ...newState + }); + } + handled = true; + } + break; + case 61: + case 107: + case 187: + case 171: + this.zoomIn(); + handled = true; + break; + case 173: + case 109: + case 189: + this.zoomOut(); + handled = true; + break; + case 48: + case 96: + if (!isViewerInPresentationMode) { + setTimeout(() => { + this.zoomReset(); + }); + handled = false; + } + break; + case 38: + if (isViewerInPresentationMode || this.page > 1) { + this.page = 1; + handled = true; + ensureViewerFocused = true; + } + break; + case 40: + if (isViewerInPresentationMode || this.page < this.pagesCount) { + this.page = this.pagesCount; + handled = true; + ensureViewerFocused = true; + } + break; + } + } + if (cmd === 1 || cmd === 8) { + switch (evt.keyCode) { + case 83: + eventBus.dispatch("download", { + source: window + }); + handled = true; + break; + case 79: + { + eventBus.dispatch("openfile", { + source: window + }); + handled = true; + } + break; + } + } + if (cmd === 3 || cmd === 10) { + switch (evt.keyCode) { + case 80: + this.requestPresentationMode(); + handled = true; + this.externalServices.reportTelemetry({ + type: "buttons", + data: { + id: "presentationModeKeyboard" + } + }); + break; + case 71: + if (this.appConfig.toolbar) { + this.appConfig.toolbar.pageNumber.select(); + handled = true; + } + break; + } + } + if (handled) { + if (ensureViewerFocused && !isViewerInPresentationMode) { + pdfViewer.focus(); + } + evt.preventDefault(); + return; + } + const curElement = getActiveOrFocusedElement(); + const curElementTagName = curElement?.tagName.toUpperCase(); + if (curElementTagName === "INPUT" || curElementTagName === "TEXTAREA" || curElementTagName === "SELECT" || curElementTagName === "BUTTON" && (evt.keyCode === 13 || evt.keyCode === 32) || curElement?.isContentEditable) { + if (evt.keyCode !== 27) { + return; + } + } + if (cmd === 0) { + let turnPage = 0, + turnOnlyIfPageFit = false; + switch (evt.keyCode) { + case 38: + if (this.supportsCaretBrowsingMode) { + this.moveCaret(true, false); + handled = true; + break; + } + case 33: + if (pdfViewer.isVerticalScrollbarEnabled) { + turnOnlyIfPageFit = true; + } + turnPage = -1; + break; + case 8: + if (!isViewerInPresentationMode) { + turnOnlyIfPageFit = true; + } + turnPage = -1; + break; + case 37: + if (this.supportsCaretBrowsingMode) { + return; + } + if (pdfViewer.isHorizontalScrollbarEnabled) { + turnOnlyIfPageFit = true; + } + case 75: + case 80: + turnPage = -1; + break; + case 27: + if (this.secondaryToolbar?.isOpen) { + this.secondaryToolbar.close(); + handled = true; + } + if (!this.supportsIntegratedFind && this.findBar?.opened) { + this.findBar.close(); + handled = true; + } + break; + case 40: + if (this.supportsCaretBrowsingMode) { + this.moveCaret(false, false); + handled = true; + break; + } + case 34: + if (pdfViewer.isVerticalScrollbarEnabled) { + turnOnlyIfPageFit = true; + } + turnPage = 1; + break; + case 13: + case 32: + if (!isViewerInPresentationMode) { + turnOnlyIfPageFit = true; + } + turnPage = 1; + break; + case 39: + if (this.supportsCaretBrowsingMode) { + return; + } + if (pdfViewer.isHorizontalScrollbarEnabled) { + turnOnlyIfPageFit = true; + } + case 74: + case 78: + turnPage = 1; + break; + case 36: + if (isViewerInPresentationMode || this.page > 1) { + this.page = 1; + handled = true; + ensureViewerFocused = true; + } + break; + case 35: + if (isViewerInPresentationMode || this.page < this.pagesCount) { + this.page = this.pagesCount; + handled = true; + ensureViewerFocused = true; + } + break; + case 83: + this.pdfCursorTools?.switchTool(CursorTool.SELECT); + break; + case 72: + this.pdfCursorTools?.switchTool(CursorTool.HAND); + break; + case 82: + this.rotatePages(90); + break; + case 115: + this.pdfSidebar?.toggle(); + break; + } + if (turnPage !== 0 && (!turnOnlyIfPageFit || pdfViewer.currentScaleValue === "page-fit")) { + if (turnPage > 0) { + pdfViewer.nextPage(); + } else { + pdfViewer.previousPage(); + } + handled = true; + } + } + if (cmd === 4) { + switch (evt.keyCode) { + case 13: + case 32: + if (!isViewerInPresentationMode && pdfViewer.currentScaleValue !== "page-fit") { + break; + } + pdfViewer.previousPage(); + handled = true; + break; + case 38: + this.moveCaret(true, true); + handled = true; + break; + case 40: + this.moveCaret(false, true); + handled = true; + break; + case 82: + this.rotatePages(-90); + break; + } + } + if (!handled && !isViewerInPresentationMode) { + if (evt.keyCode >= 33 && evt.keyCode <= 40 || evt.keyCode === 32 && curElementTagName !== "BUTTON") { + ensureViewerFocused = true; + } + } + if (ensureViewerFocused && !pdfViewer.containsElement(curElement)) { + pdfViewer.focus(); + } + if (handled) { + evt.preventDefault(); + } +} +function beforeUnload(evt) { + evt.preventDefault(); + evt.returnValue = ""; + return false; +} + +;// ./web/viewer.js + + + + +const pdfjsVersion = "4.10.38"; +const pdfjsBuild = "f9bea397f"; +const AppConstants = { + LinkTarget: LinkTarget, + RenderingStates: RenderingStates, + ScrollMode: ScrollMode, + SpreadMode: SpreadMode +}; +window.PDFViewerApplication = PDFViewerApplication; +window.PDFViewerApplicationConstants = AppConstants; +window.PDFViewerApplicationOptions = AppOptions; +function getViewerConfiguration() { + return { + appContainer: document.body, + principalContainer: document.getElementById("mainContainer"), + mainContainer: document.getElementById("viewerContainer"), + viewerContainer: document.getElementById("viewer"), + toolbar: { + container: document.getElementById("toolbarContainer"), + numPages: document.getElementById("numPages"), + pageNumber: document.getElementById("pageNumber"), + scaleSelect: document.getElementById("scaleSelect"), + customScaleOption: document.getElementById("customScaleOption"), + previous: document.getElementById("previous"), + next: document.getElementById("next"), + zoomIn: document.getElementById("zoomInButton"), + zoomOut: document.getElementById("zoomOutButton"), + print: document.getElementById("printButton"), + editorFreeTextButton: document.getElementById("editorFreeTextButton"), + editorFreeTextParamsToolbar: document.getElementById("editorFreeTextParamsToolbar"), + editorHighlightButton: document.getElementById("editorHighlightButton"), + editorHighlightParamsToolbar: document.getElementById("editorHighlightParamsToolbar"), + editorHighlightColorPicker: document.getElementById("editorHighlightColorPicker"), + editorInkButton: document.getElementById("editorInkButton"), + editorInkParamsToolbar: document.getElementById("editorInkParamsToolbar"), + editorStampButton: document.getElementById("editorStampButton"), + editorStampParamsToolbar: document.getElementById("editorStampParamsToolbar"), + download: document.getElementById("downloadButton") + }, + secondaryToolbar: { + toolbar: document.getElementById("secondaryToolbar"), + toggleButton: document.getElementById("secondaryToolbarToggleButton"), + presentationModeButton: document.getElementById("presentationMode"), + openFileButton: document.getElementById("secondaryOpenFile"), + printButton: document.getElementById("secondaryPrint"), + downloadButton: document.getElementById("secondaryDownload"), + viewBookmarkButton: document.getElementById("viewBookmark"), + firstPageButton: document.getElementById("firstPage"), + lastPageButton: document.getElementById("lastPage"), + pageRotateCwButton: document.getElementById("pageRotateCw"), + pageRotateCcwButton: document.getElementById("pageRotateCcw"), + cursorSelectToolButton: document.getElementById("cursorSelectTool"), + cursorHandToolButton: document.getElementById("cursorHandTool"), + scrollPageButton: document.getElementById("scrollPage"), + scrollVerticalButton: document.getElementById("scrollVertical"), + scrollHorizontalButton: document.getElementById("scrollHorizontal"), + scrollWrappedButton: document.getElementById("scrollWrapped"), + spreadNoneButton: document.getElementById("spreadNone"), + spreadOddButton: document.getElementById("spreadOdd"), + spreadEvenButton: document.getElementById("spreadEven"), + imageAltTextSettingsButton: document.getElementById("imageAltTextSettings"), + imageAltTextSettingsSeparator: document.getElementById("imageAltTextSettingsSeparator"), + documentPropertiesButton: document.getElementById("documentProperties") + }, + sidebar: { + outerContainer: document.getElementById("outerContainer"), + sidebarContainer: document.getElementById("sidebarContainer"), + toggleButton: document.getElementById("sidebarToggleButton"), + resizer: document.getElementById("sidebarResizer"), + thumbnailButton: document.getElementById("viewThumbnail"), + outlineButton: document.getElementById("viewOutline"), + attachmentsButton: document.getElementById("viewAttachments"), + layersButton: document.getElementById("viewLayers"), + thumbnailView: document.getElementById("thumbnailView"), + outlineView: document.getElementById("outlineView"), + attachmentsView: document.getElementById("attachmentsView"), + layersView: document.getElementById("layersView"), + currentOutlineItemButton: document.getElementById("currentOutlineItem") + }, + findBar: { + bar: document.getElementById("findbar"), + toggleButton: document.getElementById("viewFindButton"), + findField: document.getElementById("findInput"), + highlightAllCheckbox: document.getElementById("findHighlightAll"), + caseSensitiveCheckbox: document.getElementById("findMatchCase"), + matchDiacriticsCheckbox: document.getElementById("findMatchDiacritics"), + entireWordCheckbox: document.getElementById("findEntireWord"), + findMsg: document.getElementById("findMsg"), + findResultsCount: document.getElementById("findResultsCount"), + findPreviousButton: document.getElementById("findPreviousButton"), + findNextButton: document.getElementById("findNextButton") + }, + passwordOverlay: { + dialog: document.getElementById("passwordDialog"), + label: document.getElementById("passwordText"), + input: document.getElementById("password"), + submitButton: document.getElementById("passwordSubmit"), + cancelButton: document.getElementById("passwordCancel") + }, + documentProperties: { + dialog: document.getElementById("documentPropertiesDialog"), + closeButton: document.getElementById("documentPropertiesClose"), + fields: { + fileName: document.getElementById("fileNameField"), + fileSize: document.getElementById("fileSizeField"), + title: document.getElementById("titleField"), + author: document.getElementById("authorField"), + subject: document.getElementById("subjectField"), + keywords: document.getElementById("keywordsField"), + creationDate: document.getElementById("creationDateField"), + modificationDate: document.getElementById("modificationDateField"), + creator: document.getElementById("creatorField"), + producer: document.getElementById("producerField"), + version: document.getElementById("versionField"), + pageCount: document.getElementById("pageCountField"), + pageSize: document.getElementById("pageSizeField"), + linearized: document.getElementById("linearizedField") + } + }, + altTextDialog: { + dialog: document.getElementById("altTextDialog"), + optionDescription: document.getElementById("descriptionButton"), + optionDecorative: document.getElementById("decorativeButton"), + textarea: document.getElementById("descriptionTextarea"), + cancelButton: document.getElementById("altTextCancel"), + saveButton: document.getElementById("altTextSave") + }, + newAltTextDialog: { + dialog: document.getElementById("newAltTextDialog"), + title: document.getElementById("newAltTextTitle"), + descriptionContainer: document.getElementById("newAltTextDescriptionContainer"), + textarea: document.getElementById("newAltTextDescriptionTextarea"), + disclaimer: document.getElementById("newAltTextDisclaimer"), + learnMore: document.getElementById("newAltTextLearnMore"), + imagePreview: document.getElementById("newAltTextImagePreview"), + createAutomatically: document.getElementById("newAltTextCreateAutomatically"), + createAutomaticallyButton: document.getElementById("newAltTextCreateAutomaticallyButton"), + downloadModel: document.getElementById("newAltTextDownloadModel"), + downloadModelDescription: document.getElementById("newAltTextDownloadModelDescription"), + error: document.getElementById("newAltTextError"), + errorCloseButton: document.getElementById("newAltTextCloseButton"), + cancelButton: document.getElementById("newAltTextCancel"), + notNowButton: document.getElementById("newAltTextNotNow"), + saveButton: document.getElementById("newAltTextSave") + }, + altTextSettingsDialog: { + dialog: document.getElementById("altTextSettingsDialog"), + createModelButton: document.getElementById("createModelButton"), + aiModelSettings: document.getElementById("aiModelSettings"), + learnMore: document.getElementById("altTextSettingsLearnMore"), + deleteModelButton: document.getElementById("deleteModelButton"), + downloadModelButton: document.getElementById("downloadModelButton"), + showAltTextDialogButton: document.getElementById("showAltTextDialogButton"), + altTextSettingsCloseButton: document.getElementById("altTextSettingsCloseButton"), + closeButton: document.getElementById("altTextSettingsCloseButton") + }, + annotationEditorParams: { + editorFreeTextFontSize: document.getElementById("editorFreeTextFontSize"), + editorFreeTextColor: document.getElementById("editorFreeTextColor"), + editorInkColor: document.getElementById("editorInkColor"), + editorInkThickness: document.getElementById("editorInkThickness"), + editorInkOpacity: document.getElementById("editorInkOpacity"), + editorStampAddImage: document.getElementById("editorStampAddImage"), + editorFreeHighlightThickness: document.getElementById("editorFreeHighlightThickness"), + editorHighlightShowAll: document.getElementById("editorHighlightShowAll") + }, + printContainer: document.getElementById("printContainer"), + editorUndoBar: { + container: document.getElementById("editorUndoBar"), + message: document.getElementById("editorUndoBarMessage"), + undoButton: document.getElementById("editorUndoBarUndoButton"), + closeButton: document.getElementById("editorUndoBarCloseButton") + } + }; +} +function webViewerLoad() { + const config = getViewerConfiguration(); + const event = new CustomEvent("webviewerloaded", { + bubbles: true, + cancelable: true, + detail: { + source: window + } + }); + try { + parent.document.dispatchEvent(event); + } catch (ex) { + console.error("webviewerloaded:", ex); + document.dispatchEvent(event); + } + PDFViewerApplication.run(config); +} +document.blockUnblockOnload?.(true); +if (document.readyState === "interactive" || document.readyState === "complete") { + webViewerLoad(); +} else { + document.addEventListener("DOMContentLoaded", webViewerLoad, true); +} + +var __webpack_exports__PDFViewerApplication = __webpack_exports__.PDFViewerApplication; +var __webpack_exports__PDFViewerApplicationConstants = __webpack_exports__.PDFViewerApplicationConstants; +var __webpack_exports__PDFViewerApplicationOptions = __webpack_exports__.PDFViewerApplicationOptions; +export { __webpack_exports__PDFViewerApplication as PDFViewerApplication, __webpack_exports__PDFViewerApplicationConstants as PDFViewerApplicationConstants, __webpack_exports__PDFViewerApplicationOptions as PDFViewerApplicationOptions }; + +//# sourceMappingURL=viewer.mjs.map \ No newline at end of file diff --git a/public/vite.svg b/public/vite.svg deleted file mode 100644 index e7b8dfb..0000000 --- a/public/vite.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/scripts/i18n_checker.py b/scripts/i18n_checker.py new file mode 100644 index 0000000..cb487c6 --- /dev/null +++ b/scripts/i18n_checker.py @@ -0,0 +1,108 @@ +import os +import re +import json +import csv +import argparse + +# Customize as needed +I18N_FUNCTIONS = ['t', 'i18next.t'] +FILE_EXTENSIONS = ['.tsx', '.ts'] +EXCLUDED_DIRS = ['node_modules', 'build', 'dist'] + +# Regex patterns +STRING_LITERAL_REGEX = re.compile(r'(?\s*([A-Z][a-z].*?)\s*<') + +def is_excluded(path): + return any(excluded in path for excluded in EXCLUDED_DIRS) + +def is_ignorable(text, line): + if re.fullmatch(r'[A-Z0-9_]+', text): + if re.search(r'\b(case|action|status)\b', line, re.IGNORECASE): + return True + return False + +def is_console_log_line(line): + return any(kw in line for kw in ['console.log', 'console.error', 'console.warn']) + +def find_untranslated_strings(file_path): + issues = [] + with open(file_path, 'r', encoding='utf-8') as f: + content = f.read() + lines = content.splitlines() + + for idx, line in enumerate(lines, start=1): + if is_console_log_line(line): + continue # Skip entire line if it's a console log statement + + # Match suspicious string literals + for match in STRING_LITERAL_REGEX.finditer(line): + string = match.group(1).strip() + if is_ignorable(string, line): + continue + if not any(fn + '(' in line[:match.start()] for fn in I18N_FUNCTIONS): + issues.append({ + 'file': file_path, + 'line': idx, + 'type': 'StringLiteral', + 'text': string + }) + + # Match JSX text nodes + for match in JSX_TEXT_REGEX.finditer(line): + text = match.group(1).strip() + if is_ignorable(text, line): + continue + if not text.startswith('{t('): + issues.append({ + 'file': file_path, + 'line': idx, + 'type': 'JSXText', + 'text': text + }) + + return issues + + +def scan_directory(directory): + all_issues = [] + for root, _, files in os.walk(directory): + if is_excluded(root): + continue + for file in files: + if any(file.endswith(ext) for ext in FILE_EXTENSIONS): + file_path = os.path.join(root, file) + issues = find_untranslated_strings(file_path) + all_issues.extend(issues) + return all_issues + +def save_report(results, output_file): + _, ext = os.path.splitext(output_file) + if ext.lower() == '.json': + with open(output_file, 'w', encoding='utf-8') as f: + json.dump(results, f, indent=2) + elif ext.lower() == '.csv': + with open(output_file, 'w', newline='', encoding='utf-8') as f: + writer = csv.DictWriter(f, fieldnames=['file', 'line', 'type', 'text']) + writer.writeheader() + for row in results: + writer.writerow(row) + else: + raise ValueError("Unsupported output format. Use .json or .csv") + +def main(): + parser = argparse.ArgumentParser(description='Detect untranslated strings in React (.tsx) files.') + parser.add_argument('-path', default='../src/', help='Path to the source directory (e.g. ./src)') + parser.add_argument('-o', '--output', default='./i18n_report.json', help='Report output file (.json or .csv)') + + args = parser.parse_args() + results = scan_directory(args.path) + + if results: + save_report(results, args.output) + print(f"⚠️ Found {len(results)} potential untranslated strings. Report saved to {args.output}") + else: + print("✅ No obvious untranslated strings found.") + +if __name__ == "__main__": + main() diff --git a/scripts/i18n_translate_json.py b/scripts/i18n_translate_json.py new file mode 100644 index 0000000..c43ec4a --- /dev/null +++ b/scripts/i18n_translate_json.py @@ -0,0 +1,91 @@ +import os +import json +import time +from deep_translator import GoogleTranslator +from concurrent.futures import ThreadPoolExecutor, as_completed + +# === CONFIGURATION === +base_folder = "./src/i18n/locales" +source_lang = "en" +filenames = ["auth.json", "core.json", "group.json", "question.json", "tutorial.json"] +all_target_langs = ["de", "es", "fr", "it", "ja", "ru", "zh-CN"] + + +# === SAFE TRANSLATION === +def safe_translate(translator, text, retries=3): + for attempt in range(retries): + try: + return translator.translate(text=text) + except Exception as e: + if attempt < retries - 1: + time.sleep(2) + else: + print(f"[{translator.target}] Failed to translate '{text}': {e}") + return text + + +# === TRANSLATION LOGIC === +def translate_json(obj, translator): + if isinstance(obj, dict): + return {k: translate_json(v, translator) for k, v in obj.items()} + elif isinstance(obj, list): + return [translate_json(item, translator) for item in obj] + elif isinstance(obj, str): + if not obj.strip() or "{{" in obj or "}}" in obj or "<" in obj: + return obj + return safe_translate(translator, obj) + return obj + + +# === WORKER FUNCTION === +def translate_for_language(filename, data, target_lang): + print(f"🔁 Translating {filename} → {target_lang}") + translator = GoogleTranslator(source=source_lang, target=target_lang) + translated = translate_json(data, translator) + + target_dir = os.path.join(base_folder, target_lang) + os.makedirs(target_dir, exist_ok=True) + target_path = os.path.join(target_dir, filename) + + with open(target_path, "w", encoding="utf-8") as f: + json.dump(translated, f, ensure_ascii=False, indent=2) + + print(f"✅ Saved: {target_path}") + return target_path + + +# === MAIN FUNCTION === +def main(): + print("Available files:") + for name in filenames: + print(f" - {name}") + filename = input("Enter the filename to translate: ").strip() + if filename not in filenames: + print(f"❌ Invalid filename: {filename}") + return + + exclude_input = input("Enter languages to exclude (comma-separated, e.g., 'fr,ja'): ").strip() + excluded_langs = [lang.strip() for lang in exclude_input.split(",") if lang.strip()] + target_langs = [lang for lang in all_target_langs if lang not in excluded_langs] + + if not target_langs: + print("❌ All target languages excluded. Nothing to do.") + return + + source_path = os.path.join(base_folder, source_lang, filename) + if not os.path.isfile(source_path): + print(f"❌ File not found: {source_path}") + return + + with open(source_path, "r", encoding="utf-8") as f: + data = json.load(f) + + # Parallel execution per language + with ThreadPoolExecutor(max_workers=len(target_langs)) as executor: + futures = [executor.submit(translate_for_language, filename, data, lang) for lang in target_langs] + for future in as_completed(futures): + _ = future.result() + + +if __name__ == "__main__": + main() diff --git a/src/App-styles.ts b/src/App-styles.ts deleted file mode 100644 index 4fcf3c0..0000000 --- a/src/App-styles.ts +++ /dev/null @@ -1,229 +0,0 @@ -import { - AppBar, - Button, - Toolbar, - Typography, - Box, - TextField, - InputLabel, -} from "@mui/material"; -import { styled } from "@mui/system"; - -export const AppContainer = styled(Box)(({ theme }) => ({ - display: "flex", - alignItems: "center", - flexDirection: 'column', - width: "100vw", - background: "rgba(39, 40, 44, 1)", - height: "100vh", - radius: "15px", - overflow: 'hidden' -})); -export const AuthenticatedContainer = styled(Box)(({ theme }) => ({ - display: "flex", - width: "100%", - height: "100%", - justifyContent: "space-between" -})); -export const AuthenticatedContainerInnerLeft = styled(Box)(({ theme }) => ({ - display: "flex", - alignItems: "center", - flexDirection: 'column', - height: "100%", - width: "100%" -})); -export const AuthenticatedContainerInnerRight = styled(Box)(({ theme }) => ({ - display: "flex", - alignItems: "center", - flexDirection: 'column', - width: "60px", - height: "100%", - background: "rgba(0, 0, 0, 0.1)" - -})); -export const AuthenticatedContainerInnerTop = styled(Box)(({ theme }) => ({ - display: "flex", - alignItems: "center", - justifyContent: "flex-start", - width: "100%px", - height: "60px", - background: "rgba(0, 0, 0, 0.1)", - padding: '20px' -})); - -export const TextP = styled(Typography)(({ theme }) => ({ - fontSize: "13px", - fontWeight: 600, - fontFamily: "Inter", - color: "white" -})); - -export const TextItalic = styled("span")(({ theme }) => ({ - fontSize: "13px", - fontWeight: 600, - fontFamily: "Inter", - color: "white", - fontStyle: "italic" -})); - -export const TextSpan = styled("span")(({ theme }) => ({ - fontSize: "13px", - fontFamily: "Inter", - fontWeight: 800, - color: "white" -})); - -export const AddressBox = styled(Box)` -display: flex; -border: 1px solid var(--50-white, rgba(255, 255, 255, 0.5)); -justify-content: space-between; -align-items: center; -width: auto; -height: 25px; -padding: 5px 15px 5px 15px; -gap: 5px; -border-radius: 100px; -font-family: Inter; -font-size: 12px; -font-weight: 600; -line-height: 14.52px; -text-align: left; -color: var(--50-white, rgba(255, 255, 255, 0.5)); -cursor: pointer; -transition: all 0.2s; -&:hover { - background-color: rgba(41, 41, 43, 1); - color: white; - svg path { - fill: white; // Fill color changes to white on hover - } - } - -` - -export const CustomButton = styled(Box)` - -/* Authenticate */ - -box-sizing: border-box; - -padding: 15px 20px; -gap: 10px; - - -border: 0.5px solid rgba(255, 255, 255, 0.5); -filter: drop-shadow(1px 4px 10.5px rgba(0, 0, 0, 0.3)); -border-radius: 5px; - - display: inline-flex; - - justify-content: center; - align-items: center; - - width: fit-content; - transition: all 0.2s; - color: black; - min-width: 160px; - cursor: pointer; - font-weight: 600; - font-family: Inter; - color: white; - text-align: center; - &:hover { - background-color: rgba(41, 41, 43, 1); - color: white; - svg path { - fill: white; // Fill color changes to white on hover - } - } -`; -interface CustomButtonProps { - bgColor?: string; - color?: string; -} -export const CustomButtonAccept = styled(Box)( - ({ bgColor, color }) => ({ - boxSizing: "border-box", - padding: "15px 20px", - gap: "10px", - border: "0.5px solid rgba(255, 255, 255, 0.5)", - filter: "drop-shadow(1px 4px 10.5px rgba(0,0,0,0.3))", - borderRadius: 5, - display: "inline-flex", - justifyContent: "center", - alignItems: "center", - width: "fit-content", - transition: "all 0.2s", - minWidth: 160, - cursor: "pointer", - fontWeight: 600, - fontFamily: "Inter", - textAlign: "center", - opacity: 0.7, - // Use the passed-in props or fallback defaults - backgroundColor: bgColor || "transparent", - color: color || "white", - - "&:hover": { - opacity: 1, - backgroundColor: bgColor - ? bgColor - : "rgba(41, 41, 43, 1)", // fallback hover bg - color: color || "white", - svg: { - path: { - fill: color || "white", - }, - }, - }, - }) -); - - -export const CustomInput = styled(TextField)({ - width: "183px", // Adjust the width as needed - borderRadius: "5px", - // backgroundColor: "rgba(30, 30, 32, 1)", - outline: "none", - input: { - fontSize: 10, - fontFamily: "Inter", - fontWeight: 400, - color: "white", - "&::placeholder": { - fontSize: 16, - color: "rgba(255, 255, 255, 0.2)", - }, - outline: "none", - padding: "10px", - }, - "& .MuiOutlinedInput-root": { - "& fieldset": { - border: '0.5px solid rgba(255, 255, 255, 0.5)', - }, - "&:hover fieldset": { - border: '0.5px solid rgba(255, 255, 255, 0.5)', - }, - "&.Mui-focused fieldset": { - border: '0.5px solid rgba(255, 255, 255, 0.5)', - }, - }, - "& .MuiInput-underline:before": { - borderBottom: "none", - }, - "& .MuiInput-underline:hover:not(.Mui-disabled):before": { - borderBottom: "none", - }, - "& .MuiInput-underline:after": { - borderBottom: "none", - }, -}); - -export const CustomLabel = styled(InputLabel)` - font-weight: 400; - font-family: Inter; - font-size: 10px; - line-height: 12px; - color: rgba(255, 255, 255, 0.5); - -` \ No newline at end of file diff --git a/src/App.css b/src/App.css deleted file mode 100644 index e69de29..0000000 diff --git a/src/App.tsx b/src/App.tsx index 6e432c5..407d8d8 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -5,9 +5,8 @@ import { useMemo, useRef, useState, -} from "react"; -import "./App.css"; -import { useDropzone } from "react-dropzone"; +} from 'react'; +import { useDropzone } from 'react-dropzone'; import { Box, Button, @@ -19,45 +18,34 @@ import { DialogContent, DialogContentText, DialogTitle, - Input, - InputLabel, - Popover, + FormControlLabel, Tooltip, Typography, -} from "@mui/material"; + useTheme, +} from '@mui/material'; import { JsonView, allExpanded, darkStyles } from 'react-json-view-lite'; import 'react-json-view-lite/dist/index.css'; -import { decryptStoredWallet } from "./utils/decryptWallet"; -import { CountdownCircleTimer } from "react-countdown-circle-timer"; -import Logo1 from "./assets/svgs/Logo1.svg"; -import Logo1Dark from "./assets/svgs/Logo1Dark.svg"; -import RefreshIcon from "@mui/icons-material/Refresh"; -import Logo2 from "./assets/svgs/Logo2.svg"; -import Copy from "./assets/svgs/Copy.svg"; -import ltcLogo from "./assets/ltc.png"; +import { decryptStoredWallet } from './utils/decryptWallet'; +import { CountdownCircleTimer } from 'react-countdown-circle-timer'; +import Logo1Dark from './assets/svgs/Logo1Dark.svg'; +import RefreshIcon from '@mui/icons-material/Refresh'; +import DownloadIcon from '@mui/icons-material/Download'; +import ltcLogo from './assets/ltc.png'; import PersonSearchIcon from '@mui/icons-material/PersonSearch'; -import qortLogo from "./assets/qort.png"; -import { CopyToClipboard } from "react-copy-to-clipboard"; -import Download from "./assets/svgs/Download.svg"; -import Logout from "./assets/svgs/Logout.svg"; -import Return from "./assets/svgs/Return.svg"; +import qortLogo from './assets/qort.png'; +import { Return } from './assets/Icons/Return.tsx'; import WarningIcon from '@mui/icons-material/Warning'; -import Success from "./assets/svgs/Success.svg"; -import Info from "./assets/svgs/Info.svg"; -import CloseIcon from "@mui/icons-material/Close"; -import './utils/seedPhrase/RandomSentenceGenerator'; +import './utils/seedPhrase/randomSentenceGenerator.ts'; import EngineeringIcon from '@mui/icons-material/Engineering'; import AccountBalanceWalletIcon from '@mui/icons-material/AccountBalanceWallet'; +import PriorityHighIcon from '@mui/icons-material/PriorityHigh'; import { createAccount, - generateRandomSentence, saveFileToDisk, saveSeedPhraseToDisk, -} from "./utils/generateWallet/generateWallet"; -import { kdf } from "./deps/kdf"; -import { generateSaveWalletData } from "./utils/generateWallet/storeWallet"; -import { crypto, walletVersion } from "./constants/decryptWallet"; -import PhraseWallet from "./utils/generateWallet/phrase-wallet"; +} from './utils/generateWallet/generateWallet'; +import { crypto, walletVersion } from './constants/decryptWallet'; +import PhraseWallet from './utils/generateWallet/phrase-wallet'; import { AddressBox, AppContainer, @@ -66,120 +54,115 @@ import { AuthenticatedContainerInnerRight, CustomButton, CustomButtonAccept, - CustomInput, CustomLabel, TextItalic, TextP, TextSpan, -} from "./App-styles"; -import { Spacer } from "./common/Spacer"; -import { Loader } from "./components/Loader"; -import { PasswordField, ErrorText } from "./components"; -import { ChatGroup } from "./components/Chat/ChatGroup"; -import { Group, requestQueueMemberNames } from "./components/Group/Group"; -import { TaskManager } from "./components/TaskManager/TaskManger"; -import { useModal } from "./common/useModal"; -import { LoadingButton } from "@mui/lab"; -import { Label } from "./components/Group/AddGroup"; -import { CustomizedSnackbars } from "./components/Snackbar/Snackbar"; -import SettingsIcon from "@mui/icons-material/Settings"; +} from './styles/App-styles.ts'; +import { Spacer } from './common/Spacer'; +import { Loader } from './components/Loader'; +import { PasswordField, ErrorText } from './components'; +import { Group, requestQueueMemberNames } from './components/Group/Group'; +import { TaskManager } from './components/TaskManager/TaskManager.tsx'; +import { useModal } from './hooks/useModal.tsx'; +import { CustomizedSnackbars } from './components/Snackbar/Snackbar'; +import SettingsIcon from '@mui/icons-material/Settings'; +import LogoutIcon from '@mui/icons-material/Logout'; import HelpIcon from '@mui/icons-material/Help'; - import { cleanUrl, - getFee, getProtocol, getWallets, groupApi, - groupApiLocal, groupApiSocket, - groupApiSocketLocal, storeWallets, -} from "./background"; +} from './background/background.ts'; import { executeEvent, subscribeToEvent, unsubscribeFromEvent, -} from "./utils/events"; +} from './utils/events'; import { requestQueueCommentCount, requestQueuePublishedAccouncements, -} from "./components/Chat/GroupAnnouncements"; -import { requestQueueGroupJoinRequests } from "./components/Group/GroupJoinRequests"; -import { DrawerComponent } from "./components/Drawer/Drawer"; -import { AddressQRCode } from "./components/AddressQRCode"; -import { Settings } from "./components/Group/Settings"; -import { MainAvatar } from "./components/MainAvatar"; -import { useRetrieveDataLocalStorage } from "./useRetrieveDataLocalStorage"; -import { useQortalGetSaveSettings } from "./useQortalGetSaveSettings"; -import { useRecoilState, useResetRecoilState, useSetRecoilState } from "recoil"; +} from './components/Chat/GroupAnnouncements'; +import { requestQueueGroupJoinRequests } from './components/Group/GroupJoinRequests'; +import { DrawerComponent } from './components/Drawer/Drawer'; +import { AddressQRCode } from './components/AddressQRCode'; +import { Settings } from './components/Group/Settings'; +import { MainAvatar } from './components/MainAvatar'; +import { useRetrieveDataLocalStorage } from './hooks/useRetrieveDataLocalStorage.tsx'; +import { useQortalGetSaveSettings } from './hooks/useQortalGetSaveSettings.tsx'; import { canSaveSettingToQdnAtom, enabledDevModeAtom, - fullScreenAtom, + groupAnnouncementsAtom, + groupChatTimestampsAtom, + groupsOwnerNamesAtom, groupsPropertiesAtom, hasSettingsChangedAtom, isDisabledEditorEnterAtom, + isRunningPublicNodeAtom, isUsingImportExportSettingsAtom, lastPaymentSeenTimestampAtom, mailsAtom, + memberGroupsAtom, + mutedGroupsAtom, + myGroupsWhereIAmAdminAtom, oldPinnedAppsAtom, qMailLastEnteredTimestampAtom, settingsLocalLastUpdatedAtom, settingsQDNLastUpdatedAtom, sortablePinnedAppsAtom, -} from "./atoms/global"; -import { useAppFullScreen } from "./useAppFullscreen"; -import { NotAuthenticated } from "./ExtStates/NotAuthenticated"; -import { - openIndexedDB, - showSaveFilePicker, -} from "./components/Apps/useQortalMessageListener"; -import { fileToBase64 } from "./utils/fileReading"; -import { handleGetFileFromIndexedDB } from "./utils/indexedDB"; -import { CoreSyncStatus } from "./components/CoreSyncStatus"; -import { Wallets } from "./Wallets"; -import { RandomSentenceGenerator } from "./utils/seedPhrase/RandomSentenceGenerator"; -import { useFetchResources } from "./common/useFetchResources"; -import { Tutorials } from "./components/Tutorials/Tutorials"; -import { useHandleTutorials } from "./components/Tutorials/useHandleTutorials"; -import BoundedNumericTextField from "./common/BoundedNumericTextField"; -import { useHandleUserInfo } from "./components/Group/useHandleUserInfo"; -import { Minting } from "./components/Minting/Minting"; -import { isRunningGateway } from "./qortalRequests"; -import { QMailStatus } from "./components/QMailStatus"; -import { GlobalActions } from "./components/GlobalActions/GlobalActions"; -import { useBlockedAddresses } from "./components/Group/useBlockUsers"; -import { WalletIcon } from "./assets/Icons/WalletIcon"; -import { DrawerUserLookup } from "./components/Drawer/DrawerUserLookup"; -import { UserLookup } from "./components/UserLookup.tsx/UserLookup"; -import { RegisterName } from "./components/RegisterName"; -import { BuyQortInformation } from "./components/BuyQortInformation"; -import { QortPayment } from "./components/QortPayment"; -import { GeneralNotifications } from "./components/GeneralNotifications"; + timestampEnterDataAtom, + txListAtom, +} from './atoms/global'; +import { NotAuthenticated } from './components/NotAuthenticated.tsx'; +import { handleGetFileFromIndexedDB } from './utils/indexedDB'; +import { Wallets } from './components/Wallets.tsx'; +import { useFetchResources } from './hooks/useFetchResources.tsx'; +import { Tutorials } from './components/Tutorials/Tutorials'; +import { useHandleTutorials } from './hooks/useHandleTutorials.tsx'; +import { useHandleUserInfo } from './hooks/useHandleUserInfo.tsx'; +import { Minting } from './components/Minting/Minting'; +import { isRunningGateway } from './qortal/qortal-requests.ts'; +import { QMailStatus } from './components/QMailStatus'; +import { GlobalActions } from './components/GlobalActions/GlobalActions'; +import { useBlockedAddresses } from './hooks/useBlockUsers.tsx'; +import { WalletIcon } from './assets/Icons/WalletIcon'; +import { UserLookup } from './components/UserLookup.tsx/UserLookup'; +import { RegisterName } from './components/RegisterName'; +import { BuyQortInformation } from './components/BuyQortInformation'; +import { QortPayment } from './components/QortPayment'; +import { GeneralNotifications } from './components/GeneralNotifications'; +import { PdfViewer } from './common/PdfViewer'; +import ThemeSelector from './components/Theme/ThemeSelector.tsx'; +import { Trans, useTranslation } from 'react-i18next'; +import LanguageSelector from './components/Language/LanguageSelector.tsx'; +import { DownloadWallet } from './components/Auth/DownloadWallet.tsx'; +import { CopyIcon } from './assets/Icons/CopyIcon.tsx'; +import { SuccessIcon } from './assets/Icons/SuccessIcon.tsx'; +import { useAtom, useSetAtom } from 'jotai'; +import { useResetAtom } from 'jotai/utils'; type extStates = - | "not-authenticated" - | "authenticated" - | "send-qort" - | "web-app-request-connection" - | "web-app-request-payment" - | "web-app-request-authentication" - | "download-wallet" - | "create-wallet" - | "transfer-success-regular" - | "transfer-success-request" - | "wallet-dropped" - | "web-app-request-buy-order" - | "buy-order-submitted" - | "wallets" - | "group"; + | 'authenticated' + | 'buy-order-submitted' + | 'create-wallet' + | 'download-wallet' + | 'group' + | 'not-authenticated' + | 'send-qort' + | 'transfer-success-regular' + | 'transfer-success-request' + | 'wallet-dropped' + | 'wallets' + | 'web-app-request-authentication' + | 'web-app-request-buy-order' + | 'web-app-request-connection' + | 'web-app-request-payment'; interface MyContextInterface { - txList: any[]; - memberGroups: any[]; - setTxList: (val) => void; - setMemberGroups: (val) => void; isShow: boolean; onCancel: () => void; onOk: () => void; @@ -188,41 +171,15 @@ interface MyContextInterface { } const defaultValues: MyContextInterface = { - txList: [], - memberGroups: [], - setTxList: () => {}, - setMemberGroups: () => {}, isShow: false, onCancel: () => {}, onOk: () => {}, show: () => {}, message: { - publishFee: "", - message: "", + publishFee: '', + message: '', }, }; -export let isMobile = false; - -const isMobileDevice = () => { - const userAgent = navigator.userAgent || navigator.vendor || window.opera; - - if (/android/i.test(userAgent)) { - return true; // Android device - } - - if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) { - return true; // iOS device - } - - return false; -}; - -if (isMobileDevice()) { - isMobile = true; - console.log("Running on a mobile device"); -} else { - console.log("Running on a desktop"); -} export const allQueues = { requestQueueCommentCount: requestQueueCommentCount, @@ -235,7 +192,7 @@ const controlAllQueues = (action) => { Object.keys(allQueues).forEach((key) => { const val = allQueues[key]; try { - if (typeof val[action] === "function") { + if (typeof val[action] === 'function') { val[action](); } } catch (error) { @@ -244,7 +201,6 @@ const controlAllQueues = (action) => { }); }; - export const clearAllQueues = () => { Object.keys(allQueues).forEach((key) => { const val = allQueues[key]; @@ -257,31 +213,32 @@ export const clearAllQueues = () => { }; export const pauseAllQueues = () => { - controlAllQueues("pause"); - window.sendMessage("pauseAllQueues", {}).catch((error) => { + controlAllQueues('pause'); + window.sendMessage('pauseAllQueues', {}).catch((error) => { console.error( - "Failed to pause all queues:", - error.message || "An error occurred" - ); - }); -}; -export const resumeAllQueues = () => { - controlAllQueues("resume"); - window.sendMessage("resumeAllQueues", {}).catch((error) => { - console.error( - "Failed to resume all queues:", - error.message || "An error occurred" + 'Failed to pause all queues:', + error.message || 'An error occurred' ); }); }; +export const resumeAllQueues = () => { + controlAllQueues('resume'); + window.sendMessage('resumeAllQueues', {}).catch((error) => { + console.error( + 'Failed to resume all queues:', + error.message || 'An error occurred' + ); + }); +}; const defaultValuesGlobal = { openTutorialModal: null, - setOpenTutorialModal: ()=> {} -} -export const MyContext = createContext(defaultValues); -export const GlobalContext = createContext(defaultValuesGlobal); + setOpenTutorialModal: () => {}, +}; + +export const QORTAL_APP_CONTEXT = + createContext(defaultValues); export let globalApiKey: string | null = null; @@ -296,14 +253,7 @@ export const getBaseApiReact = (customApi?: string) => { return groupApi; } }; -// export const getArbitraryEndpointReact = () => { -// if (globalApiKey) { -// return `/arbitrary/resources/search`; -// } else { -// return `/arbitrary/resources/searchsimple`; -// } -// }; export const getArbitraryEndpointReact = () => { if (globalApiKey) { return `/arbitrary/resources/searchsimple`; @@ -311,6 +261,7 @@ export const getArbitraryEndpointReact = () => { return `/arbitrary/resources/searchsimple`; } }; + export const getBaseApiReactSocket = (customApi?: string) => { if (customApi) { return customApi; @@ -318,17 +269,18 @@ export const getBaseApiReactSocket = (customApi?: string) => { if (globalApiKey?.url) { return `${ - getProtocol(globalApiKey?.url) === "http" ? "ws://" : "wss://" + getProtocol(globalApiKey?.url) === 'http' ? 'ws://' : 'wss://' }${cleanUrl(globalApiKey?.url)}`; } else { return groupApiSocket; } }; -export const isMainWindow = true; -function App() { - const [extState, setExtstate] = useState("not-authenticated"); - const [desktopViewMode, setDesktopViewMode] = useState("home"); +export const isMainWindow = true; + +function App() { + const [extState, setExtstate] = useState('not-authenticated'); + const [desktopViewMode, setDesktopViewMode] = useState('home'); const [backupjson, setBackupjson] = useState(null); const [rawWallet, setRawWallet] = useState(null); const [ltcBalanceLoading, setLtcBalanceLoading] = useState(false); @@ -336,47 +288,68 @@ function App() { const [decryptedWallet, setdecryptedWallet] = useState(null); const [requestConnection, setRequestConnection] = useState(null); const [requestBuyOrder, setRequestBuyOrder] = useState(null); - const [authenticatedMode, setAuthenticatedMode] = useState("qort"); + const [authenticatedMode, setAuthenticatedMode] = useState('qort'); const [requestAuthentication, setRequestAuthentication] = useState(null); const [userInfo, setUserInfo] = useState(null); const [balance, setBalance] = useState(null); const [ltcBalance, setLtcBalance] = useState(null); - const [paymentTo, setPaymentTo] = useState(""); + const [paymentTo, setPaymentTo] = useState(''); const [paymentAmount, setPaymentAmount] = useState(0); - const [paymentPassword, setPaymentPassword] = useState(""); - const [sendPaymentError, setSendPaymentError] = useState(""); - const [sendPaymentSuccess, setSendPaymentSuccess] = useState(""); + const [paymentPassword, setPaymentPassword] = useState(''); + const [sendPaymentError, setSendPaymentError] = useState(''); + const [sendPaymentSuccess, setSendPaymentSuccess] = useState(''); const [countdown, setCountdown] = useState(null); const [walletToBeDownloaded, setWalletToBeDownloaded] = useState(null); const [walletToBeDownloadedPassword, setWalletToBeDownloadedPassword] = - useState(""); + useState(''); const [isMain, setIsMain] = useState(true); const isMainRef = useRef(false); - const [authenticatePassword, setAuthenticatePassword] = useState(""); + const [authenticatePassword, setAuthenticatePassword] = useState(''); const [sendqortState, setSendqortState] = useState(null); const [isLoading, setIsLoading] = useState(false); const [isLoadingSendCoin, setIsLoadingSendCoin] = useState(false); + const isAuthenticated = extState === 'authenticated'; + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + const theme = useTheme(); const [ walletToBeDownloadedPasswordConfirm, setWalletToBeDownloadedPasswordConfirm, - ] = useState(""); + ] = useState(''); + const [walletToBeDownloadedError, setWalletToBeDownloadedError] = - useState(""); + useState(''); + const [walletToBeDecryptedError, setWalletToBeDecryptedError] = - useState(""); - const [txList, setTxList] = useState([]); - const [memberGroups, setMemberGroups] = useState([]); + useState(''); + const [isFocused, setIsFocused] = useState(true); - const [hasSettingsChanged, setHasSettingsChanged] = useRecoilState( + + const [hasSettingsChanged, setHasSettingsChanged] = useAtom( hasSettingsChangedAtom ); - const balanceSetIntervalRef = useRef(null) - const {downloadResource} = useFetchResources() - const holdRefExtState = useRef("not-authenticated"); + + const balanceSetIntervalRef = useRef(null); + const downloadResource = useFetchResources(); + const holdRefExtState = useRef('not-authenticated'); const isFocusedRef = useRef(true); - const {showTutorial, openTutorialModal, shownTutorialsInitiated, setOpenTutorialModal, hasSeenGettingStarted} = useHandleTutorials() + + const { + showTutorial, + openTutorialModal, + shownTutorialsInitiated, + setOpenTutorialModal, + hasSeenGettingStarted, + } = useHandleTutorials(); + const { isShow, onCancel, onOk, show, message } = useModal(); + const { isShow: isShowUnsavedChanges, onCancel: onCancelUnsavedChanges, @@ -384,6 +357,7 @@ function App() { show: showUnsavedChanges, message: messageUnsavedChanges, } = useModal(); + const { isShow: isShowInfo, onCancel: onCancelInfo, @@ -391,7 +365,7 @@ function App() { show: showInfo, message: messageInfo, } = useModal(); - + const { onCancel: onCancelQortalRequest, onOk: onOkQortalRequest, @@ -399,6 +373,7 @@ function App() { isShow: isShowQortalRequest, message: messageQortalRequest, } = useModal(); + const { onCancel: onCancelQortalRequestExtension, onOk: onOkQortalRequestExtension, @@ -407,198 +382,239 @@ function App() { message: messageQortalRequestExtension, } = useModal(); - const [isRunningPublicNode, setIsRunningPublicNode] = useState(false) + const setIsRunningPublicNode = useSetAtom(isRunningPublicNodeAtom); const [infoSnack, setInfoSnack] = useState(null); const [openSnack, setOpenSnack] = useState(false); const [hasLocalNode, setHasLocalNode] = useState(false); const [isOpenDrawerProfile, setIsOpenDrawerProfile] = useState(false); - const [isOpenDrawerLookup, setIsOpenDrawerLookup] = useState(false) - const [apiKey, setApiKey] = useState(""); + const [isOpenDrawerLookup, setIsOpenDrawerLookup] = useState(false); + const [apiKey, setApiKey] = useState(''); const [isOpenSendQort, setIsOpenSendQort] = useState(false); const [isOpenSendQortSuccess, setIsOpenSendQortSuccess] = useState(false); - const [rootHeight, setRootHeight] = useState("100%"); - const {isUserBlocked, + + const { + isUserBlocked, addToBlockList, - removeBlockFromList, getAllBlockedUsers} = useBlockedAddresses() - const [currentNode, setCurrentNode] = useState({ - url: "http://127.0.0.1:12391", - }); - const [useLocalNode, setUseLocalNode] = useState(false); - + removeBlockFromList, + getAllBlockedUsers, + } = useBlockedAddresses(extState === 'authenticated'); + + const [currentNode, setCurrentNode] = useState({ + url: 'http://127.0.0.1:12391', + }); + + const [useLocalNode, setUseLocalNode] = useState(false); + + const [confirmRequestRead, setConfirmRequestRead] = useState(false); const [isSettingsOpen, setIsSettingsOpen] = useState(false); - const [showSeed, setShowSeed] = useState(false) - const [creationStep, setCreationStep] = useState(1) - const {getIndividualUserInfo} = useHandleUserInfo() + const [showSeed, setShowSeed] = useState(false); + const [creationStep, setCreationStep] = useState(1); + const getIndividualUserInfo = useHandleUserInfo(); const qortalRequestCheckbox1Ref = useRef(null); useRetrieveDataLocalStorage(userInfo?.address); - useQortalGetSaveSettings(userInfo?.name, extState === "authenticated"); - const [fullScreen, setFullScreen] = useRecoilState(fullScreenAtom); - const [isEnabledDevMode, setIsEnabledDevMode] = - useRecoilState(enabledDevModeAtom); - const setIsDisabledEditorEnter = useSetRecoilState(isDisabledEditorEnterAtom) - const [isOpenMinting, setIsOpenMinting] = useState(false) - const { toggleFullScreen } = useAppFullScreen(setFullScreen); - const generatorRef = useRef(null) - const exportSeedphrase = ()=> { - const seedPhrase = generatorRef.current.parsedString - saveSeedPhraseToDisk(seedPhrase) - } + useQortalGetSaveSettings(userInfo?.name, extState === 'authenticated'); + const setIsEnabledDevMode = useSetAtom(enabledDevModeAtom); + + const setIsDisabledEditorEnter = useSetAtom(isDisabledEditorEnterAtom); + + const [isOpenMinting, setIsOpenMinting] = useState(false); + const generatorRef = useRef(null); + + const exportSeedphrase = () => { + const seedPhrase = generatorRef.current.parsedString; + saveSeedPhraseToDisk(seedPhrase); + }; + const passwordRef = useRef(null); + useEffect(() => { - if (extState === "wallet-dropped" && passwordRef.current) { + if (extState === 'wallet-dropped' && passwordRef.current) { passwordRef.current.focus(); } }, [extState]); + useEffect(() => { - const isDevModeFromStorage = localStorage.getItem("isEnabledDevMode"); + const isDevModeFromStorage = localStorage.getItem('isEnabledDevMode'); if (isDevModeFromStorage) { setIsEnabledDevMode(JSON.parse(isDevModeFromStorage)); } }, []); - useEffect(()=> { - isRunningGateway().then((res)=> { - setIsRunningPublicNode(res) - }).catch((error)=> { - console.error(error) + useEffect(() => { + isRunningGateway() + .then((res) => { + setIsRunningPublicNode(res); }) - }, [extState]) - - useEffect(()=> { - if(!shownTutorialsInitiated) return - if(extState === 'not-authenticated'){ - showTutorial('create-account') - } else if(extState === "create-wallet" && walletToBeDownloaded){ - showTutorial('important-information') - } else if(extState === "authenticated"){ - showTutorial('getting-started') - } - }, [extState, walletToBeDownloaded, shownTutorialsInitiated]) + .catch((error) => { + console.error(error); + }); + }, [extState]); useEffect(() => { - // Attach a global event listener for double-click - const handleDoubleClick = () => { - toggleFullScreen(); - }; + if (!shownTutorialsInitiated) return; + if (extState === 'not-authenticated') { + showTutorial('create-account'); + } else if (extState === 'create-wallet' && walletToBeDownloaded) { + showTutorial('important-information'); + } else if (extState === 'authenticated') { + showTutorial('getting-started'); + } + }, [extState, walletToBeDownloaded, shownTutorialsInitiated]); - // Add the event listener to the root HTML document - document.documentElement.addEventListener("dblclick", handleDoubleClick); - - // Clean up the event listener on unmount - return () => { - document.documentElement.removeEventListener( - "dblclick", - handleDoubleClick - ); - }; - }, [toggleFullScreen]); //resets for recoil - const resetAtomSortablePinnedAppsAtom = useResetRecoilState( - sortablePinnedAppsAtom + const resetAtomSortablePinnedAppsAtom = useResetAtom(sortablePinnedAppsAtom); + const resetAtomIsUsingImportExportSettingsAtom = useResetAtom( + isUsingImportExportSettingsAtom ); - const resetAtomIsUsingImportExportSettingsAtom = useResetRecoilState(isUsingImportExportSettingsAtom) - const resetAtomCanSaveSettingToQdnAtom = useResetRecoilState( + const resetAtomCanSaveSettingToQdnAtom = useResetAtom( canSaveSettingToQdnAtom ); - const resetAtomSettingsQDNLastUpdatedAtom = useResetRecoilState( + const resetAtomSettingsQDNLastUpdatedAtom = useResetAtom( settingsQDNLastUpdatedAtom ); - const resetAtomSettingsLocalLastUpdatedAtom = useResetRecoilState( + const resetAtomSettingsLocalLastUpdatedAtom = useResetAtom( settingsLocalLastUpdatedAtom ); - const resetAtomOldPinnedAppsAtom = useResetRecoilState(oldPinnedAppsAtom); - const resetAtomQMailLastEnteredTimestampAtom = useResetRecoilState(qMailLastEnteredTimestampAtom) - const resetAtomMailsAtom = useResetRecoilState(mailsAtom) - const resetGroupPropertiesAtom = useResetRecoilState(groupsPropertiesAtom) - const resetLastPaymentSeenTimestampAtom = useResetRecoilState(lastPaymentSeenTimestampAtom) + const resetAtomOldPinnedAppsAtom = useResetAtom(oldPinnedAppsAtom); + const resetAtomQMailLastEnteredTimestampAtom = useResetAtom( + qMailLastEnteredTimestampAtom + ); + const resetAtomMailsAtom = useResetAtom(mailsAtom); + const resetGroupPropertiesAtom = useResetAtom(groupsPropertiesAtom); + const resetLastPaymentSeenTimestampAtom = useResetAtom( + lastPaymentSeenTimestampAtom + ); + const resetMyGroupsWhereIAmAdminAtom = useResetAtom( + myGroupsWhereIAmAdminAtom + ); + const resetGroupsOwnerNamesAtom = useResetAtom(groupsOwnerNamesAtom); + const resetGroupAnnouncementsAtom = useResetAtom(groupAnnouncementsAtom); + const resetMutedGroupsAtom = useResetAtom(mutedGroupsAtom); + const resetGroupChatTimestampsAtom = useResetAtom(groupChatTimestampsAtom); + const resetTimestampEnterAtom = useResetAtom(timestampEnterDataAtom); + const resettxListAtomAtom = useResetAtom(txListAtom); + const resetmemberGroupsAtomAtom = useResetAtom(memberGroupsAtom); + const resetAllRecoil = () => { resetAtomSortablePinnedAppsAtom(); resetAtomCanSaveSettingToQdnAtom(); resetAtomSettingsQDNLastUpdatedAtom(); resetAtomSettingsLocalLastUpdatedAtom(); resetAtomOldPinnedAppsAtom(); - resetAtomIsUsingImportExportSettingsAtom() - resetAtomQMailLastEnteredTimestampAtom() - resetAtomMailsAtom() - resetGroupPropertiesAtom() - resetLastPaymentSeenTimestampAtom() - + resetAtomIsUsingImportExportSettingsAtom(); + resetAtomQMailLastEnteredTimestampAtom(); + resetAtomMailsAtom(); + resetGroupPropertiesAtom(); + resetLastPaymentSeenTimestampAtom(); + resetGroupsOwnerNamesAtom(); + resetGroupAnnouncementsAtom(); + resetMutedGroupsAtom(); + resetGroupChatTimestampsAtom(); + resetTimestampEnterAtom(); + resettxListAtomAtom(); + resetmemberGroupsAtomAtom(); + resetMyGroupsWhereIAmAdminAtom(); }; - useEffect(() => { - if (!isMobile) return; - // Function to set the height of the app to the viewport height - const resetHeight = () => { - const height = window.visualViewport - ? window.visualViewport.height - : window.innerHeight; - // Set the height to the root element (usually #root) - document.getElementById("root").style.height = height + "px"; - setRootHeight(height + "px"); - }; - // Set the initial height - resetHeight(); + const contextValue = useMemo( + () => ({ + isShow, + onCancel, + onOk, + show, + userInfo, + message, + showInfo, + openSnackGlobal: openSnack, + setOpenSnackGlobal: setOpenSnack, + infoSnackCustom: infoSnack, + setInfoSnackCustom: setInfoSnack, + downloadResource, + getIndividualUserInfo, + isUserBlocked, + addToBlockList, + removeBlockFromList, + getAllBlockedUsers, + showTutorial, + openTutorialModal, + setOpenTutorialModal, + hasSeenGettingStarted, + }), + [ + isShow, + onCancel, + onOk, + show, + userInfo, + message, + showInfo, + openSnack, + setOpenSnack, + infoSnack, + setInfoSnack, + downloadResource, + getIndividualUserInfo, + isUserBlocked, + addToBlockList, + removeBlockFromList, + getAllBlockedUsers, + showTutorial, + openTutorialModal, + setOpenTutorialModal, + hasSeenGettingStarted, + ] + ); - // Add event listeners for resize and visualViewport changes - window.addEventListener("resize", resetHeight); - window.visualViewport?.addEventListener("resize", resetHeight); - - // Clean up the event listeners when the component unmounts - return () => { - window.removeEventListener("resize", resetHeight); - window.visualViewport?.removeEventListener("resize", resetHeight); - }; - }, []); const handleSetGlobalApikey = (key) => { globalApiKey = key; }; + useEffect(() => { try { setIsLoading(true); window - .sendMessage("getApiKey") - .then((response) => { - if (response) { - handleSetGlobalApikey(response); - setApiKey(response); - } - }) - .catch((error) => { - console.error( - "Failed to get API key:", - error?.message || "An error occurred" - ); - }).finally(()=> { - window - .sendMessage("getWalletInfo") + .sendMessage('getApiKey') .then((response) => { - if (response && response?.walletInfo) { - setRawWallet(response?.walletInfo); - if ( - holdRefExtState.current === "web-app-request-payment" || - holdRefExtState.current === "web-app-request-connection" || - holdRefExtState.current === "web-app-request-buy-order" - ) - return; - if (response?.hasKeyPair) { - setExtstate("authenticated"); - } else { - setExtstate("wallet-dropped"); - } + if (response) { + handleSetGlobalApikey(response); + setApiKey(response); } }) .catch((error) => { - console.error("Failed to get wallet info:", error); + console.error( + 'Failed to get API key:', + error?.message || 'An error occurred' + ); + }) + .finally(() => { + window + .sendMessage('getWalletInfo') + .then((response) => { + if (response && response?.walletInfo) { + setRawWallet(response?.walletInfo); + if ( + holdRefExtState.current === 'web-app-request-payment' || + holdRefExtState.current === 'web-app-request-connection' || + holdRefExtState.current === 'web-app-request-buy-order' + ) + return; + if (response?.hasKeyPair) { + setExtstate('authenticated'); + } else { + setExtstate('wallet-dropped'); + } + } + }) + .catch((error) => { + console.error('Failed to get wallet info:', error); + }); }); - }) } catch (error) { - + console.log(error); } finally { setIsLoading(false); - } - }, []); useEffect(() => { if (extState) { @@ -606,51 +622,31 @@ function App() { } }, [extState]); - useEffect(()=> { + useEffect(() => { try { - const val = localStorage.getItem('settings-disable-editor-enter'); - if(val){ - const parsedVal = JSON.parse(val) - if(parsedVal === false || parsedVal === true){ - setIsDisabledEditorEnter(parsedVal) + const val = localStorage.getItem('settings-disable-editor-enter'); + if (val) { + const parsedVal = JSON.parse(val); + if (parsedVal === false || parsedVal === true) { + setIsDisabledEditorEnter(parsedVal); } } } catch (error) { - + console.log(error); } - }, []) + }, []); useEffect(() => { isFocusedRef.current = isFocused; }, [isFocused]); - // const checkIfUserHasLocalNode = useCallback(async () => { - // try { - // const url = `http://127.0.0.1:12391/admin/status`; - // const response = await fetch(url, { - // method: "GET", - // headers: { - // "Content-Type": "application/json", - // }, - // }); - // const data = await response.json(); - // if (data?.isSynchronizing === false && data?.syncPercent === 100) { - // setHasLocalNode(true); - // } - // } catch (error) {} - // }, []); - - // useEffect(() => { - // checkIfUserHasLocalNode(); - // }, [extState]); - const address = useMemo(() => { - if (!rawWallet?.address0) return ""; + if (!rawWallet?.address0) return ''; return rawWallet.address0; }, [rawWallet]); const { getRootProps, getInputProps } = useDropzone({ accept: { - "application/json": [".json"], // Only accept JSON files + 'application/json': ['.json'], // Only accept JSON files }, maxFiles: 1, onDrop: async (acceptedFiles) => { @@ -658,8 +654,8 @@ function App() { const fileContents = await new Promise((resolve, reject) => { const reader = new FileReader(); - reader.onabort = () => reject("File reading was aborted"); - reader.onerror = () => reject("File reading has failed"); + reader.onabort = () => reject('File reading was aborted'); + reader.onerror = () => reject('File reading has failed'); reader.onload = () => { // Resolve the promise with the reader result when reading completes resolve(reader.result); @@ -673,26 +669,33 @@ function App() { let pf: any; try { - if (typeof fileContents !== "string") return; + if (typeof fileContents !== 'string') return; pf = JSON.parse(fileContents); - } catch (e) {} + } catch (e) { + console.log(error); + } try { const requiredFields = [ - "address0", - "salt", - "iv", - "version", - "encryptedSeed", - "mac", - "kdfThreads", + 'address0', + 'salt', + 'iv', + 'version', + 'encryptedSeed', + 'mac', + 'kdfThreads', ]; for (const field of requiredFields) { - if (!(field in pf)) throw new Error(field + " not found in JSON"); + if (!(field in pf)) + throw new Error( + t('auth:message.error.field_not_found_json', { + field: field, + postProcess: 'capitalizeFirstChar', + }) + ); } setRawWallet(pf); - // setExtstate("authenticated"); - setExtstate("wallet-dropped"); + setExtstate('wallet-dropped'); setdecryptedWallet(null); } catch (e) { console.log(e); @@ -721,57 +724,75 @@ function App() { }; }; - - const balanceSetInterval = ()=> { + const balanceSetInterval = () => { try { - if(balanceSetIntervalRef?.current){ + if (balanceSetIntervalRef?.current) { clearInterval(balanceSetIntervalRef?.current); } let isCalling = false; - balanceSetIntervalRef.current = setInterval(async () => { + balanceSetIntervalRef.current = setInterval(async () => { if (isCalling) return; isCalling = true; window - .sendMessage("balance") - .then((response) => { - if (!response?.error && !isNaN(+response)) { - setBalance(response); - } - isCalling = false; - }) - .catch((error) => { - console.error("Failed to get balance:", error); - isCalling = false; - }); + .sendMessage('balance') + .then((response) => { + if (!response?.error && !isNaN(+response)) { + setBalance(response); + } + isCalling = false; + }) + .catch((error) => { + console.error('Failed to get balance:', error); + isCalling = false; + }); }, 40000); } catch (error) { - console.error(error) + console.error(error); } - } + }; const getBalanceFunc = () => { setQortBalanceLoading(true); window - .sendMessage("balance") + .sendMessage('balance') .then((response) => { if (!response?.error && !isNaN(+response)) { setBalance(response); } - + setQortBalanceLoading(false); }) .catch((error) => { - console.error("Failed to get balance:", error); + console.error('Failed to get balance:', error); setQortBalanceLoading(false); - }).finally(()=> { - balanceSetInterval() + }) + .finally(() => { + balanceSetInterval(); }); }; + + const refetchUserInfo = () => { + window + .sendMessage('userInfo') + .then((response) => { + if (response && !response.error) { + setUserInfo(response); + } + }) + .catch((error) => { + console.error('Failed to get user info:', error); + }); + }; + + const getBalanceAndUserInfoFunc = () => { + getBalanceFunc(); + refetchUserInfo(); + }; const getLtcBalanceFunc = () => { setLtcBalanceLoading(true); window - .sendMessage("ltcBalance") + .sendMessage('ltcBalance') .then((response) => { if (!response?.error && !isNaN(+response)) { setLtcBalance(response); @@ -779,11 +800,10 @@ function App() { setLtcBalanceLoading(false); }) .catch((error) => { - console.error("Failed to get LTC balance:", error); + console.error('Failed to get LTC balance:', error); setLtcBalanceLoading(false); }); }; - const clearAllStates = () => { setRequestConnection(null); @@ -791,18 +811,19 @@ function App() { }; const qortalRequestPermissonFromExtension = async (message, event) => { - if (message.action === "QORTAL_REQUEST_PERMISSION") { + if (message.action === 'QORTAL_REQUEST_PERMISSION') { try { if (message?.payload?.checkbox1) { qortalRequestCheckbox1Ref.current = message?.payload?.checkbox1?.value || false; } + setConfirmRequestRead(false); await showQortalRequestExtension(message?.payload); if (qortalRequestCheckbox1Ref.current) { event.source.postMessage( { - action: "QORTAL_REQUEST_PERMISSION_RESPONSE", + action: 'QORTAL_REQUEST_PERMISSION_RESPONSE', requestId: message?.requestId, result: { accepted: true, @@ -815,7 +836,7 @@ function App() { } event.source.postMessage( { - action: "QORTAL_REQUEST_PERMISSION_RESPONSE", + action: 'QORTAL_REQUEST_PERMISSION_RESPONSE', requestId: message?.requestId, result: { accepted: true, @@ -826,7 +847,7 @@ function App() { } catch (error) { event.source.postMessage( { - action: "QORTAL_REQUEST_PERMISSION_RESPONSE", + action: 'QORTAL_REQUEST_PERMISSION_RESPONSE', requestId: message?.requestId, result: { accepted: false, @@ -846,43 +867,43 @@ function App() { } const message = event.data; - if (message?.action === "CHECK_FOCUS") { + if (message?.action === 'CHECK_FOCUS') { event.source.postMessage( - { action: "CHECK_FOCUS_RESPONSE", isFocused: isFocusedRef.current }, + { action: 'CHECK_FOCUS_RESPONSE', isFocused: isFocusedRef.current }, event.origin ); - } else if (message.action === "NOTIFICATION_OPEN_DIRECT") { - executeEvent("openDirectMessage", { + } else if (message.action === 'NOTIFICATION_OPEN_DIRECT') { + executeEvent('openDirectMessage', { from: message.payload.from, }); - } else if (message.action === "NOTIFICATION_OPEN_GROUP") { - executeEvent("openGroupMessage", { + } else if (message.action === 'NOTIFICATION_OPEN_GROUP') { + executeEvent('openGroupMessage', { from: message.payload.from, }); - } else if (message.action === "NOTIFICATION_OPEN_ANNOUNCEMENT_GROUP") { - executeEvent("openGroupAnnouncement", { + } else if (message.action === 'NOTIFICATION_OPEN_ANNOUNCEMENT_GROUP') { + executeEvent('openGroupAnnouncement', { from: message.payload.from, }); - } else if (message.action === "NOTIFICATION_OPEN_THREAD_NEW_POST") { - executeEvent("openThreadNewPost", { + } else if (message.action === 'NOTIFICATION_OPEN_THREAD_NEW_POST') { + executeEvent('openThreadNewPost', { data: message.payload.data, }); } else if ( - message.action === "QORTAL_REQUEST_PERMISSION" && + message.action === 'QORTAL_REQUEST_PERMISSION' && message?.isFromExtension ) { qortalRequestPermissonFromExtension(message, event); - } else if (message?.action === "getFileFromIndexedDB") { + } else if (message?.action === 'getFileFromIndexedDB') { handleGetFileFromIndexedDB(event); } }; // Attach the event listener - window.addEventListener("message", messageHandler); + window.addEventListener('message', messageHandler); // Clean up the event listener on component unmount return () => { - window.removeEventListener("message", messageHandler); + window.removeEventListener('message', messageHandler); }; }, []); @@ -902,7 +923,6 @@ function App() { // REMOVED FOR MOBILE APP }; - const getUserInfo = useCallback(async (useTimer?: boolean) => { try { if (useTimer) { @@ -913,18 +933,20 @@ function App() { }); } window - .sendMessage("userInfo") + .sendMessage('userInfo') .then((response) => { if (response && !response.error) { setUserInfo(response); } }) .catch((error) => { - console.error("Failed to get user info:", error); + console.error('Failed to get user info:', error); }); getBalanceFunc(); - } catch (error) {} + } catch (error) { + console.log(error); + } }, []); useEffect(() => { @@ -934,13 +956,13 @@ function App() { useEffect(() => { return () => { - console.log("exit"); + console.log('exit'); }; }, []); useEffect(() => { if ( - authenticatedMode === "ltc" && + authenticatedMode === 'ltc' && !ltcBalanceLoading && ltcBalance === null ) { @@ -948,27 +970,6 @@ function App() { } }, [authenticatedMode]); - const confirmPasswordToDownload = async () => { - try { - setWalletToBeDownloadedError(""); - if (!walletToBeDownloadedPassword) { - setSendPaymentError("Please enter your password"); - return; - } - setIsLoading(true); - await new Promise((res) => { - setTimeout(() => { - res(); - }, 250); - }); - const res = await saveWalletFunc(walletToBeDownloadedPassword); - } catch (error: any) { - setWalletToBeDownloadedError(error?.message); - } finally { - setIsLoading(false); - } - }; - const saveFileToDiskFunc = async () => { try { await saveFileToDisk( @@ -977,52 +978,66 @@ function App() { ); } catch (error: any) { setWalletToBeDownloadedError(error?.message); - } finally { } }; - const saveWalletToLocalStorage = async (newWallet)=> { + const saveWalletToLocalStorage = async (newWallet) => { try { - getWallets().then((res)=> { - - if(res && Array.isArray(res)){ - const wallets = [...res, newWallet] - storeWallets(wallets) - } else { - storeWallets([newWallet]) - } - setIsLoading(false) - }).catch((error)=> { - console.error(error) - setIsLoading(false) - }) + getWallets() + .then((res) => { + if (res && Array.isArray(res)) { + const wallets = [...res, newWallet]; + storeWallets(wallets); + } else { + storeWallets([newWallet]); + } + setIsLoading(false); + }) + .catch((error) => { + console.error(error); + setIsLoading(false); + }); } catch (error) { - console.error(error) + console.error(error); } - } + }; const createAccountFunc = async () => { try { if (!walletToBeDownloadedPassword) { - setWalletToBeDownloadedError("Please enter a password"); + setWalletToBeDownloadedError( + t('core:message.generic.password_enter', { + postProcess: 'capitalizeFirstChar', + }) + ); return; } if (!walletToBeDownloadedPasswordConfirm) { - setWalletToBeDownloadedError("Please confirm your password"); + setWalletToBeDownloadedError( + t('core:message.generic.password_confirm', { + postProcess: 'capitalizeFirstChar', + }) + ); return; } if ( walletToBeDownloadedPasswordConfirm !== walletToBeDownloadedPassword ) { - setWalletToBeDownloadedError("Password fields do not match!"); + setWalletToBeDownloadedError( + t('core:message.error.password_not_matching', { + postProcess: 'capitalizeFirstChar', + }) + ); return; } setIsLoading(true); + await new Promise((res) => { setTimeout(() => { res(); }, 250); }); + const res = await createAccount(generatorRef.current.parsedString); const wallet = await res.generateSaveWalletData( walletToBeDownloadedPassword, @@ -1030,21 +1045,21 @@ function App() { () => {} ); window - .sendMessage("decryptWallet", { + .sendMessage('decryptWallet', { password: walletToBeDownloadedPassword, wallet, }) .then((response) => { if (response && !response.error) { setRawWallet(wallet); - saveWalletToLocalStorage(wallet) + saveWalletToLocalStorage(wallet); setWalletToBeDownloaded({ wallet, qortAddress: wallet.address0, }); window - .sendMessage("userInfo") + .sendMessage('userInfo') .then((response2) => { setIsLoading(false); if (response2 && !response2.error) { @@ -1053,7 +1068,7 @@ function App() { }) .catch((error) => { setIsLoading(false); - console.error("Failed to get user info:", error); + console.error('Failed to get user info:', error); }); getBalanceFunc(); @@ -1064,7 +1079,7 @@ function App() { }) .catch((error) => { setIsLoading(false); - console.error("Failed to decrypt wallet:", error); + console.error('Failed to decrypt wallet:', error); }); } catch (error: any) { setWalletToBeDownloadedError(error?.message); @@ -1072,55 +1087,53 @@ function App() { } }; - const logoutFunc = async () => { + const logoutFunc = useCallback(async () => { try { - if (hasSettingsChanged) { + if (extState === 'authenticated') { await showUnsavedChanges({ - message: - "Your settings have changed. If you logout you will lose your changes. Click on the save button in the header to keep your changed settings.", - }); - } else if(extState === 'authenticated') { - await showUnsavedChanges({ - message: - "Are you sure you would like to logout?", + message: t('core:message.question.logout', { + postProcess: 'capitalizeFirstChar', + }), }); } window - .sendMessage("logout", {}) + .sendMessage('logout', {}) .then((response) => { if (response) { - executeEvent("logout-event", {}); + executeEvent('logout-event', {}); resetAllStates(); } }) .catch((error) => { console.error( - "Failed to log out:", - error.message || "An error occurred" + 'Failed to log out:', + error.message || 'An error occurred' ); }); - } catch (error) {} - }; + } catch (error) { + console.log(error); + } + }, [hasSettingsChanged, extState]); const returnToMain = () => { - setPaymentTo(""); + setPaymentTo(''); setPaymentAmount(0); - setPaymentPassword(""); - setSendPaymentError(""); - setSendPaymentSuccess(""); + setPaymentPassword(''); + setSendPaymentError(''); + setSendPaymentSuccess(''); setCountdown(null); setWalletToBeDownloaded(null); - setWalletToBeDownloadedPassword(""); - setShowSeed(false) - setCreationStep(1) - setExtstate("authenticated"); + setWalletToBeDownloadedPassword(''); + setShowSeed(false); + setCreationStep(1); + setExtstate('authenticated'); setIsOpenSendQort(false); setIsOpenSendQortSuccess(false); }; const resetAllStates = () => { - setExtstate("not-authenticated"); - setAuthenticatedMode("qort"); + setExtstate('not-authenticated'); + setAuthenticatedMode('qort'); setBackupjson(null); setRawWallet(null); setdecryptedWallet(null); @@ -1130,25 +1143,22 @@ function App() { setUserInfo(null); setBalance(null); setLtcBalance(null); - setPaymentTo(""); + setPaymentTo(''); setPaymentAmount(0); - setPaymentPassword(""); - setSendPaymentError(""); - setSendPaymentSuccess(""); + setPaymentPassword(''); + setSendPaymentError(''); + setSendPaymentSuccess(''); setCountdown(null); setWalletToBeDownloaded(null); - setWalletToBeDownloadedPassword(""); - setShowSeed(false) - setCreationStep(1) - - setWalletToBeDownloadedPasswordConfirm(""); - setWalletToBeDownloadedError(""); + setWalletToBeDownloadedPassword(''); + setShowSeed(false); + setCreationStep(1); + setWalletToBeDownloadedPasswordConfirm(''); + setWalletToBeDownloadedError(''); setSendqortState(null); setHasLocalNode(false); - setTxList([]); - setMemberGroups([]); resetAllRecoil(); - if(balanceSetIntervalRef?.current){ + if (balanceSetIntervalRef?.current) { clearInterval(balanceSetIntervalRef?.current); } }; @@ -1161,7 +1171,7 @@ function App() { const authenticateWallet = async () => { try { setIsLoading(true); - setWalletToBeDecryptedError(""); + setWalletToBeDecryptedError(''); await new Promise((res) => { setTimeout(() => { res(); @@ -1169,7 +1179,7 @@ function App() { }); window .sendMessage( - "decryptWallet", + 'decryptWallet', { password: authenticatePassword, wallet: rawWallet, @@ -1178,12 +1188,12 @@ function App() { ) .then((response) => { if (response && !response.error) { - setAuthenticatePassword(""); - setExtstate("authenticated"); - setWalletToBeDecryptedError(""); + setAuthenticatePassword(''); + setExtstate('authenticated'); + setWalletToBeDecryptedError(''); window - .sendMessage("userInfo") + .sendMessage('userInfo') .then((response) => { setIsLoading(false); if (response && !response.error) { @@ -1192,20 +1202,20 @@ function App() { }) .catch((error) => { setIsLoading(false); - console.error("Failed to get user info:", error); + console.error('Failed to get user info:', error); }); getBalanceFunc(); window - .sendMessage("getWalletInfo") + .sendMessage('getWalletInfo') .then((response) => { if (response && response.walletInfo) { setRawWallet(response.walletInfo); } }) .catch((error) => { - console.error("Failed to get wallet info:", error); + console.error('Failed to get wallet info:', error); }); } else if (response?.error) { setIsLoading(false); @@ -1214,10 +1224,14 @@ function App() { }) .catch((error) => { setIsLoading(false); - console.error("Failed to decrypt wallet:", error); + console.error('Failed to decrypt wallet:', error); }); } catch (error) { - setWalletToBeDecryptedError("Unable to authenticate. Wrong password"); + setWalletToBeDecryptedError( + t('core:message.error.password_wrong', { + postProcess: 'capitalizeFirstChar', + }) + ); } }; @@ -1226,14 +1240,6 @@ function App() { // Handler for when the window gains focus const handleFocus = () => { setIsFocused(true); - if (isMobile) { - window.sendMessage("clearAllNotifications", {}).catch((error) => { - console.error( - "Failed to clear notifications:", - error.message || "An error occurred" - ); - }); - } }; // Handler for when the window loses focus @@ -1242,33 +1248,25 @@ function App() { }; // Attach the event listeners - window.addEventListener("focus", handleFocus); - window.addEventListener("blur", handleBlur); + window.addEventListener('focus', handleFocus); + window.addEventListener('blur', handleBlur); // Optionally, listen for visibility changes const handleVisibilityChange = () => { - if (document.visibilityState === "visible") { + if (document.visibilityState === 'visible') { setIsFocused(true); - if (isMobile) { - window.sendMessage("clearAllNotifications", {}).catch((error) => { - console.error( - "Failed to clear notifications:", - error.message || "An error occurred" - ); - }); - } } else { setIsFocused(false); } }; - document.addEventListener("visibilitychange", handleVisibilityChange); + document.addEventListener('visibilitychange', handleVisibilityChange); // Cleanup the event listeners on component unmount return () => { - window.removeEventListener("focus", handleFocus); - window.removeEventListener("blur", handleBlur); - document.removeEventListener("visibilitychange", handleVisibilityChange); + window.removeEventListener('focus', handleFocus); + window.removeEventListener('blur', handleBlur); + document.removeEventListener('visibilitychange', handleVisibilityChange); }; }, []); @@ -1278,15 +1276,15 @@ function App() { setOpenSnack(true); setInfoSnack({ type, - message + message, }); }; useEffect(() => { - subscribeToEvent("openGlobalSnackBar", openGlobalSnackBarFunc); + subscribeToEvent('openGlobalSnackBar', openGlobalSnackBarFunc); return () => { - unsubscribeFromEvent("openGlobalSnackBar", openGlobalSnackBarFunc); + unsubscribeFromEvent('openGlobalSnackBar', openGlobalSnackBarFunc); }; }, []); @@ -1298,342 +1296,384 @@ function App() { }; useEffect(() => { - subscribeToEvent("openPaymentInternal", openPaymentInternal); + subscribeToEvent('openPaymentInternal', openPaymentInternal); return () => { - unsubscribeFromEvent("openPaymentInternal", openPaymentInternal); + unsubscribeFromEvent('openPaymentInternal', openPaymentInternal); }; }, []); - + const renderProfileLeft = () => { + return ( + + - const renderProfileLeft = ()=> { - - return - - - {authenticatedMode === "qort" && ( - LITECOIN WALLET} - placement="left" - arrow - sx={{ fontSize: "24" }} - slotProps={{ - tooltip: { - sx: { - color: "#ffffff", - backgroundColor: "#444444", - }, + + {authenticatedMode === 'qort' && ( + + {t('core:wallet.litecoin', { postProcess: 'capitalizeAll' })} + + } + placement="left" + arrow + sx={{ fontSize: '24' }} + slotProps={{ + tooltip: { + sx: { + color: theme.palette.text.primary, + backgroundColor: theme.palette.background.default, }, - arrow: { - sx: { - color: "#444444", - }, + }, + arrow: { + sx: { + color: theme.palette.text.primary, }, - }} - > - { - - setAuthenticatedMode("ltc"); - }} - src={ltcLogo} - style={{ - cursor: "pointer", - width: "20px", - height: "auto", - }} - /> - - )} - {authenticatedMode === "ltc" && ( - QORTAL WALLET} - placement="left" - arrow - sx={{ fontSize: "24" }} - slotProps={{ - tooltip: { - sx: { - color: "#ffffff", - backgroundColor: "#444444", - }, - }, - arrow: { - sx: { - color: "#444444", - }, - }, - }} - > - { - setAuthenticatedMode("qort"); - }} - src={qortLogo} - style={{ - cursor: "pointer", - width: "20px", - height: "auto", - }} - /> - - )} - - - - {authenticatedMode === "ltc" ? ( - <> - - - - - {rawWallet?.ltcAddress?.slice(0, 6)}... - {rawWallet?.ltcAddress?.slice(-4)} - - - - {ltcBalanceLoading && ( - - )} - {!isNaN(+ltcBalance) && !ltcBalanceLoading && ( - - - {ltcBalance} LTC - - { + setAuthenticatedMode('ltc'); + }} + src={ltcLogo} + style={{ + cursor: 'pointer', + height: 'auto', + width: '20px', + }} + /> + + )} + + {authenticatedMode === 'ltc' && ( + + {t('core:wallet.qortal', { postProcess: 'capitalizeAll' })} + + } + placement="left" + arrow + sx={{ fontSize: '24' }} + slotProps={{ + tooltip: { + sx: { + color: theme.palette.text.primary, + backgroundColor: theme.palette.background.default, + }, + }, + arrow: { + sx: { + color: theme.palette.text.primary, + }, + }, }} + > + { + setAuthenticatedMode('qort'); + }} + src={qortLogo} + style={{ + cursor: 'pointer', + width: '20px', + height: 'auto', + }} + /> + + )} + + + + + {authenticatedMode === 'ltc' ? ( + <> + + + + + { + if (rawWallet?.ltcAddress) { + navigator.clipboard + .writeText(rawWallet.ltcAddress) + .catch((err) => { + console.error('Failed to copy LTC address:', err); + }); + } + }} + > + + {rawWallet?.ltcAddress?.slice(0, 6)}... + {rawWallet?.ltcAddress?.slice(-4)}{' '} + + + + + + + {ltcBalanceLoading && ( + + )} + {!isNaN(+ltcBalance) && !ltcBalanceLoading && ( + + + {ltcBalance} LTC + + + + + )} + + + ) : ( + <> + - + + + + + {userInfo?.name} + + + + + { + if (rawWallet?.address0) { + navigator.clipboard + .writeText(rawWallet.address0) + .catch((err) => { + console.error('Failed to copy address:', err); + }); + } + }} + > + + {rawWallet?.address0?.slice(0, 6)}... + {rawWallet?.address0?.slice(-4)}{' '} + + + + + + + {qortBalanceLoading && ( + + )} + + {!qortBalanceLoading && balance >= 0 && ( + + + {balance?.toFixed(2)} QORT + + + + + )} + + + + {userInfo && !userInfo?.name && ( + { + executeEvent('openRegisterName', {}); + }} + > + {t('core:action.register_name', { + postProcess: 'capitalizeAll', + })} + + )} + + + + { + setIsOpenSendQort(true); + setIsOpenDrawerProfile(false); + }} + > + {t('core:action.transfer_qort', { + postProcess: 'capitalizeFirstChar', + })} + + + )} - - - ) : ( - <> - - + { + executeEvent('addTab', { + data: { service: 'APP', name: 'q-trade' }, + }); + executeEvent('open-apps-mode', {}); }} > - {userInfo?.name} + {t('core:action.get_qort_trade', { + postProcess: 'capitalizeFirstChar', + })} - - - - {rawWallet?.address0?.slice(0, 6)}... - {rawWallet?.address0?.slice(-4)} - - - - {qortBalanceLoading && ( - - )} - {!qortBalanceLoading && balance >= 0 && ( - - - {balance?.toFixed(2)} QORT - - - - )} - - - {userInfo && !userInfo?.name && ( - { - executeEvent('openRegisterName', {}) - }} - > - REGISTER NAME - - )} - - { - setIsOpenSendQort(true); - // setExtstate("send-qort"); - setIsOpenDrawerProfile(false); - }} - > - Transfer QORT - - - - )} - { - executeEvent("addTab", { - data: { service: "APP", name: "q-trade" }, - }); - executeEvent("open-apps-mode", {}); - }} - > - Get QORT at Q-Trade - - - } + + ); + }; const renderProfile = () => { return ( - {isMobile && ( - - { - setIsOpenDrawerProfile(false); - }} - sx={{ - cursor: "pointer", - color: "white", - }} - /> - - )} - {desktopViewMode !== "apps" && - desktopViewMode !== "dev" && - desktopViewMode !== "chat" && ( - <> - {renderProfileLeft()} - - )} + {desktopViewMode !== 'apps' && + desktopViewMode !== 'dev' && + desktopViewMode !== 'chat' && <>{renderProfileLeft()}} - - {!isMobile && ( - <> - - LOG OUT} - placement="left" - arrow - sx={{ fontSize: "24" }} - slotProps={{ - tooltip: { - sx: { - color: "#ffffff", - backgroundColor: "#444444", - }, - }, - arrow: { - sx: { - color: "#444444", - }, - }, - }} - > - { - logoutFunc(); - setIsOpenDrawerProfile(false); - }} + + { + logoutFunc(); + setIsOpenDrawerProfile(false); + }} + > + - - - )} + > + {t('core:action.logout')} + + } + placement="left" + arrow + sx={{ fontSize: '24' }} + slotProps={{ + tooltip: { + sx: { + color: theme.palette.text.primary, + backgroundColor: theme.palette.background.paper, + }, + }, + arrow: { + sx: { + color: theme.palette.text.primary, + }, + }, + }} + > + + + + SETTINGS} + title={ + + {t('core:settings')} + + } placement="left" arrow - sx={{ fontSize: "24" }} + sx={{ fontSize: '24' }} slotProps={{ tooltip: { sx: { - color: "#ffffff", - backgroundColor: "#444444", + color: theme.palette.text.primary, + backgroundColor: theme.palette.background.paper, }, }, arrow: { sx: { - color: "#444444", + color: theme.palette.text.primary, }, }, }} > + + { setIsOpenDrawerLookup(true); }} > USER LOOKUP} + title={ + + {t('core:user_lookup', { + postProcess: 'capitalizeAll', + })} + + } placement="left" arrow - sx={{ fontSize: "24" }} + sx={{ fontSize: '24' }} slotProps={{ tooltip: { sx: { - color: "#ffffff", - backgroundColor: "#444444", + color: theme.palette.text.primary, + backgroundColor: theme.palette.background.paper, }, }, arrow: { sx: { - color: "#444444", + color: theme.palette.text.primary, }, }, }} > + + { - executeEvent('openWalletsApp', {}) + executeEvent('openWalletsApp', {}); }} > WALLETS} + title={ + + {t('core:wallet.wallet_other')} + + } placement="left" arrow - sx={{ fontSize: "24" }} + sx={{ fontSize: '24' }} slotProps={{ tooltip: { sx: { - color: "#ffffff", - backgroundColor: "#444444", + color: theme.palette.text.primary, + backgroundColor: theme.palette.background.paper, }, }, arrow: { sx: { - color: "#444444", + color: theme.palette.text.primary, }, }, }} > - - + {desktopViewMode !== 'home' && ( <> - - YOUR ACCOUNT} - placement="left" - arrow - sx={{ fontSize: "24" }} - slotProps={{ - tooltip: { - sx: { - color: "#ffffff", - backgroundColor: "#444444", - }, - }, - arrow: { - sx: { - color: "#444444", - }, - }, - }} - > - { - setIsOpenDrawerProfile(true); - }}> - - - - + + {t('auth:account.your')} + + } + placement="left" + arrow + sx={{ fontSize: '24' }} + slotProps={{ + tooltip: { + sx: { + color: theme.palette.text.primary, + backgroundColor: theme.palette.background.paper, + }, + }, + arrow: { + sx: { + color: theme.palette.text.primary, + }, + }, + }} + > + { + setIsOpenDrawerProfile(true); + }} + > + + + )} - - - - + + - + + + {extState === 'authenticated' && ( )} - + - {extState === "authenticated" && isMainWindow && ( - - - - - + {extState === 'authenticated' && isMainWindow && ( + <> + + + )} - - { - try { - const res = await isRunningGateway() - if(res) throw new Error('Cannot view minting details on the gateway') - setIsOpenMinting(true) - } catch (error) { - setOpenSnack(true) - setInfoSnack({ - type: 'error', - message: error?.message - }) - } - }}> + + + { + try { + const res = await isRunningGateway(); + if (res) + throw new Error( + t('core:message.generic.no_minting_details', { + postProcess: 'capitalizeFirstChar', + }) + ); + setIsOpenMinting(true); + } catch (error) { + setOpenSnack(true); + setInfoSnack({ + type: 'error', + message: error?.message, + }); + } + }} + > MINTING STATUS} + title={ + + {t('core:minting.status_title')} + + } placement="left" arrow - sx={{ fontSize: "24" }} + sx={{ fontSize: '24' }} slotProps={{ tooltip: { sx: { - color: "#ffffff", - backgroundColor: "#444444", + color: theme.palette.text.primary, + backgroundColor: theme.palette.background.paper, }, }, arrow: { sx: { - color: "#444444", + color: theme.palette.text.primary, }, }, }} > - + - + - {(desktopViewMode === "apps" || desktopViewMode === "home") && ( - { - if(desktopViewMode === "apps"){ - showTutorial('qapps', true) - } else { - showTutorial('getting-started', true) - } - }} > - TUTORIAL} - placement="left" - arrow - sx={{ fontSize: "24" }} - slotProps={{ - tooltip: { - sx: { - color: "#ffffff", - backgroundColor: "#444444", - }, + + {(desktopViewMode === 'apps' || desktopViewMode === 'home') && ( + { + if (desktopViewMode === 'apps') { + showTutorial('qapps', true); + } else { + showTutorial('getting-started', true); + } + }} + > + + {t('core:tutorial')} + + } + placement="left" + arrow + sx={{ fontSize: '24' }} + slotProps={{ + tooltip: { + sx: { + color: theme.palette.text.primary, + backgroundColor: theme.palette.background.paper, }, - arrow: { - sx: { - color: "#444444", - }, + }, + arrow: { + sx: { + color: theme.palette.text.primary, }, + }, + }} + > + - - - - )} - - - BACKUP WALLET} - placement="left" - arrow - sx={{ fontSize: "24" }} - slotProps={{ - tooltip: { - sx: { - color: "#ffffff", - backgroundColor: "#444444", - }, - }, - arrow: { - sx: { - color: "#444444", - }, - }, - }} - > - + + + )} + + + + { - setExtstate("download-wallet"); + setExtstate('download-wallet'); setIsOpenDrawerProfile(false); }} - src={Download} - style={{ - cursor: "pointer", - width: '20px' - }} - /> - + > + + {t('core:action.backup_wallet')} + + } + placement="left" + arrow + sx={{ fontSize: '24' }} + slotProps={{ + tooltip: { + sx: { + color: theme.palette.text.primary, + backgroundColor: theme.palette.background.paper, + }, + }, + arrow: { + sx: { + color: theme.palette.text.primary, + }, + }, + }} + > + + + - + ); @@ -1932,1478 +2043,249 @@ function App() { return ( - - - {extState === "not-authenticated" && ( - - )} - {/* {extState !== "not-authenticated" && ( - - )} */} - {extState === "authenticated" && isMainWindow && ( - + + + + + {extState === 'not-authenticated' && ( + + )} + + {extState === 'authenticated' && isMainWindow && ( - {!isMobile && renderProfile()} + {renderProfile()} + )} - - - )} - {isOpenSendQort && isMainWindow && ( - - + {isOpenSendQort && isMainWindow && ( - - - - { - setIsOpenSendQort(false); - setIsOpenSendQortSuccess(true); - }} - defaultPaymentTo={paymentTo} - /> - - )} + - {isShowQortalRequest && !isMainWindow && ( - <> - - - - {messageQortalRequest?.text1} - - - {messageQortalRequest?.text2 && ( - <> - - - - {messageQortalRequest?.text2} - - - - - )} - {messageQortalRequest?.text3 && ( - <> - - - {messageQortalRequest?.text3} - - - - - )} - - {messageQortalRequest?.text4 && ( - - {messageQortalRequest?.text4} - - - )} - - {messageQortalRequest?.html && ( -
- )} - - - - {messageQortalRequest?.highlightedText} - - - {messageQortalRequest?.fee && ( - <> - - - - {"Fee: "} - {messageQortalRequest?.fee} - {" QORT"} - - - - )} - {messageQortalRequest?.checkbox1 && ( - - { - qortalRequestCheckbox1Ref.current = e.target.checked; - }} - edge="start" - tabIndex={-1} - disableRipple - defaultChecked={messageQortalRequest?.checkbox1?.value} - sx={{ - "&.Mui-checked": { - color: "white", // Customize the color when checked - }, - "& .MuiSvgIcon-root": { - color: "white", - }, - }} - /> - - - {messageQortalRequest?.checkbox1?.label} - - - )} - - - - onOkQortalRequest("accepted")} - > - accept - - onCancelQortalRequest()} - > - decline - - - {sendPaymentError} - - )} - {extState === "web-app-request-buy-order" && !isMainWindow && ( - <> - - - - The Application

{" "} - {requestBuyOrder?.hostname}

- - is requesting {requestBuyOrder?.crosschainAtInfo?.length}{" "} - {`buy order${ - requestBuyOrder?.crosschainAtInfo.length === 1 ? "" : "s" - }`} - -
- - - {requestBuyOrder?.crosschainAtInfo?.reduce((latest, cur) => { - return latest + +cur?.qortAmount; - }, 0)}{" "} - QORT - - - - FOR - - - - {roundUpToDecimals( - requestBuyOrder?.crosschainAtInfo?.reduce((latest, cur) => { - return latest + +cur?.expectedForeignAmount; - }, 0) - )} - {` ${requestBuyOrder?.crosschainAtInfo?.[0]?.foreignBlockchain}`} - - {/* - - - Confirm Wallet Password - - - setPaymentPassword(e.target.value)} - /> */} - - - confirmBuyOrder(false)} - > - accept - - confirmBuyOrder(true)} - > - decline - - - {sendPaymentError} - - )} - - {extState === "web-app-request-payment" && !isMainWindow && ( - <> - - - - The Application

{" "} - {sendqortState?.hostname}

- is requesting a payment -
- - - {sendqortState?.description} - - - - {sendqortState?.amount} QORT - - {/* - - - Confirm Wallet Password - - - setPaymentPassword(e.target.value)} - /> */} - - - confirmPayment(false)} - > - accept - - confirmPayment(true)} - > - decline - - - {sendPaymentError} - - )} - {extState === "web-app-request-connection" && !isMainWindow && ( - <> - -
- -
- - - The Application

{" "} - {requestConnection?.hostname}

- is requestion a connection -
- - - - responseToConnectionRequest( - true, - requestConnection?.hostname, - requestConnection.interactionId - ) - } - > - accept - - - responseToConnectionRequest( - false, - requestConnection?.hostname, - requestConnection.interactionId - ) - } - > - decline - - - - )} - {extState === "web-app-request-authentication" && !isMainWindow && ( - <> - -
- -
- - - The Application

{" "} - {requestConnection?.hostname}

- requests authentication -
- - - - - - Authenticate - - - { - setExtstate("create-wallet"); - }} - > - Create account - - - )} - {extState === "wallets" && ( - <> - - - { - setRawWallet(null); - setExtstate("not-authenticated"); - logoutFunc(); - }} - src={Return} - /> - - - - - )} - {rawWallet && extState === "wallet-dropped" && ( - <> - - - { - setRawWallet(null); - setExtstate("wallets"); - logoutFunc(); - }} - src={Return} - /> - - -
- -
- - - {rawWallet?.name ? rawWallet?.name : rawWallet?.address0} - - - Authenticate - - - - - <> - - Wallet Password - - - setAuthenticatePassword(e.target.value)} - onKeyDown={(e) => { - if (e.key === "Enter") { - authenticateWallet(); - } - }} - ref={passwordRef} - /> - {useLocalNode ? ( - <> - - - {"Using node: "} {currentNode?.url} - - - ) : ( - <> - - - {"Using public node"} - - - )} - - - - Authenticate - - {walletToBeDecryptedError} - - - )} - {extState === "download-wallet" && ( - <> - - - - - -
- -
- - - - Download Account - - - - {!walletToBeDownloaded && ( - <> - - Confirm Wallet Password - - - - setWalletToBeDownloadedPassword(e.target.value) - - } - /> - - - Confirm password - - {walletToBeDownloadedError} - - )} - - {walletToBeDownloaded && ( - <> - { - await saveFileToDiskFunc(); - await showInfo({ - message: `Keep your account file secure.`, - }); - }} - > - Download account - - - )} - - )} - {extState === "create-wallet" && ( - <> - {!walletToBeDownloaded && ( - <> - - - { - if(creationStep === 2){ - setCreationStep(1) - return - } - setExtstate("not-authenticated"); - setShowSeed(false) - setCreationStep(1) - setWalletToBeDownloadedPasswordConfirm('') - setWalletToBeDownloadedPassword('') - }} - src={Return} - /> - - -
- -
- - - Set up your Qortal account - - - - - - A ‘ { - setShowSeed(true) - }} style={{ - fontSize: '14px', - color: 'steelblue', - cursor: 'pointer' - }}>SEEDPHRASE ’ has been randomly generated in the background. - - - - - If you wish to VIEW THE SEEDPHRASE, click the word 'SEEDPHRASE' in this text. Seedphrases are used to generate the private key for your Qortal account. For security by default, seedphrases are NOT displayed unless specifically chosen. - - - Create your Qortal account by clicking NEXT below. - - - - { - setCreationStep(2) - }}> - Next - - -
- -
- - - - Your seedphrase - - - {generatorRef.current?.parsedString} - - - - Export Seedphrase - - - - - - - - - - -
- - - - Wallet Password - - - - setWalletToBeDownloadedPassword(e.target.value) - } + onClick={returnToMain} /> - - - Confirm Wallet Password - - - - setWalletToBeDownloadedPasswordConfirm(e.target.value) - } - /> - - There is no minimum length requirement - + - - Create Account - - - {walletToBeDownloadedError} - - )} + + + { + setIsOpenSendQort(false); + setIsOpenSendQortSuccess(true); + }} + defaultPaymentTo={paymentTo} + /> + + )} + + {isShowQortalRequest && !isMainWindow && ( + <> + - {walletToBeDownloaded && ( - <> - - - - - Congrats, you’re all set up! - - - - - Save your account in a place where you will remember it! - - - { - await saveFileToDiskFunc(); - returnToMain(); - await showInfo({ - message: `Keep your wallet file secure.`, - }); - }} - > - Backup Account - - - )} - - )} - {isOpenSendQortSuccess && ( - - - - - - The transfer was succesful! - - - { - returnToMain(); - }} - > - Continue - - - )} - {extState === "transfer-success-request" && ( - <> - - - - - The transfer was succesful! - - - { - window.close(); - }} - > - Continue - - - )} - {extState === "buy-order-submitted" && ( - <> - - - - - Your buy order was submitted - - - { - window.close(); - }} - > - Close - - - )} - {countdown && ( - - {/* */} - { - window.close(); - }} - size={75} - strokeWidth={8} - > - {({ remainingTime }) => {remainingTime}} - - - )} - {isLoading && } - {isShow && ( - - {message.paymentFee ? "Payment" : "Publish"} - - - {message.message} - - {message?.paymentFee && ( - - payment fee: {message.paymentFee} - - )} - {message?.publishFee && ( - - publish fee: {message.publishFee} - - )} - - - - - - - - )} - {isShowInfo && ( - - {"Important Info"} - - - {messageInfo.message} - - - - - - - )} - {isShowUnsavedChanges && ( - - {"LOGOUT"} - - - {messageUnsavedChanges.message} - - - - - - - - )} - {isShowQortalRequestExtension && isMainWindow && ( - - { - onCancelQortalRequestExtension(); - }} - size={50} - strokeWidth={5} - > - {({ remainingTime }) => {remainingTime}} - - - {messageQortalRequestExtension?.text1} + {messageQortalRequest?.text1} - {messageQortalRequestExtension?.text2 && ( + + {messageQortalRequest?.text2 && ( <> + - {messageQortalRequestExtension?.text2} + {messageQortalRequest?.text2} + )} - {messageQortalRequestExtension?.text3 && ( + + {messageQortalRequest?.text3 && ( <> - {messageQortalRequestExtension?.text3} + {messageQortalRequest?.text3} + )} - {messageQortalRequestExtension?.text4 && ( + {messageQortalRequest?.text4 && ( - {messageQortalRequestExtension?.text4} + {messageQortalRequest?.text4} )} - {messageQortalRequestExtension?.html && ( + {messageQortalRequest?.html && (
)} + - {messageQortalRequestExtension?.highlightedText} + {messageQortalRequest?.highlightedText} - {messageQortalRequestExtension?.json && ( - <> - - - - - - - )} - - {messageQortalRequestExtension?.fee && ( + {messageQortalRequest?.fee && ( <> - {"Fee: "} - {messageQortalRequestExtension?.fee} - {" QORT"} + {t('core:message.generic.fee_qort', { + message: messageQortalRequest?.fee, + postProcess: 'capitalizeFirstChar', + })} - - - )} - {messageQortalRequestExtension?.appFee && ( - <> - - {"App Fee: "} - {messageQortalRequestExtension?.appFee} - {" QORT"} - - - - )} - {messageQortalRequestExtension?.foreignFee && ( - <> - - - {"Foreign Fee: "} - {messageQortalRequestExtension?.foreignFee} - )} - {messageQortalRequestExtension?.checkbox1 && ( + + {messageQortalRequest?.checkbox1 && ( - {messageQortalRequestExtension?.checkbox1?.label} + {messageQortalRequest?.checkbox1?.label} )} + - onOkQortalRequestExtension("accepted")} + onClick={() => onOkQortalRequest('accepted')} > - accept - - + + onCancelQortalRequestExtension()} + onClick={() => onCancelQortalRequest()} > - decline - + {t('core:action.decline', { + postProcess: 'capitalizeFirstChar', + })} + + {sendPaymentError} + + )} + + {extState === 'web-app-request-buy-order' && !isMainWindow && ( + <> + + + + , + italic: , + span: , + }} + values={{ + hostname: requestBuyOrder?.hostname, + count: requestBuyOrder?.crosschainAtInfo?.length || 0, + }} + tOptions={{ postProcess: ['capitalizeFirstChar'] }} + > + + + + + + {requestBuyOrder?.crosschainAtInfo?.reduce((latest, cur) => { + return latest + +cur?.qortAmount; + }, 0)}{' '} + QORT + + + + + + {t('core:for', { postProcess: 'capitalizeAll' })} + + + + + + {roundUpToDecimals( + requestBuyOrder?.crosschainAtInfo?.reduce((latest, cur) => { + return latest + +cur?.expectedForeignAmount; + }, 0) + )} + {` ${requestBuyOrder?.crosschainAtInfo?.[0]?.foreignBlockchain}`} + + + + + + confirmBuyOrder(false)} + > + {t('core:action.accept', { + postProcess: 'capitalizeFirstChar', + })} + + + confirmBuyOrder(true)} + > + {t('core:action.decline', { + postProcess: 'capitalizeFirstChar', + })} + + + + {sendPaymentError} + + )} + {extState === 'web-app-request-payment' && !isMainWindow && ( + <> + + + + , + italic: , + span: , + }} + values={{ + hostname: requestBuyOrder?.hostname, + count: requestBuyOrder?.crosschainAtInfo?.length || 0, + }} + tOptions={{ postProcess: ['capitalizeFirstChar'] }} + > + + + + + + {sendqortState?.description} + + + + + + {sendqortState?.amount} QORT + + + + + + confirmPayment(false)} + > + {t('core:action.accept', { + postProcess: 'capitalizeFirstChar', + })} + + + confirmPayment(true)} + > + {t('core:action.decline', { + postProcess: 'capitalizeFirstChar', + })} + + + + {sendPaymentError} + + )} + + {extState === 'web-app-request-connection' && !isMainWindow && ( + <> + + +
+ +
+ + + + + The Application

+ {requestConnection?.hostname}

+ is requestion a connection +
+ + + + + + responseToConnectionRequest( + true, + requestConnection?.hostname, + requestConnection.interactionId + ) + } + > + {t('core:action.accept', { + postProcess: 'capitalizeFirstChar', + })} + + + + responseToConnectionRequest( + false, + requestConnection?.hostname, + requestConnection.interactionId + ) + } + > + {t('core:action.decline', { + postProcess: 'capitalizeFirstChar', + })} + + + + )} + + {extState === 'web-app-request-authentication' && !isMainWindow && ( + <> + + +
+ +
+ + + + + The Application

+ {requestConnection?.hostname}

+ requests authentication +
+ + + + + + + + + + {t('auth:action.authenticate', { + postProcess: 'capitalizeFirstChar', + })} + + + + + { + setExtstate('create-wallet'); + }} + > + {t('auth:action.create_account', { + postProcess: 'capitalizeFirstChar', + })} + + + )} + + {extState === 'wallets' && ( + <> + + + + { + setRawWallet(null); + setExtstate('not-authenticated'); + logoutFunc(); + }} + /> + + + + + )} + + {rawWallet && extState === 'wallet-dropped' && ( + <> + + + { + setRawWallet(null); + setExtstate('wallets'); + logoutFunc(); + }} + /> + + + + +
+ +
+ + + + + + {rawWallet?.name ? rawWallet?.name : rawWallet?.address0} + + + + + + {t('auth:authentication', { + postProcess: 'capitalizeFirstChar', + })} + + + + + + <> + + {t('auth:wallet.password', { + postProcess: 'capitalizeFirstChar', + })} + + + + + setAuthenticatePassword(e.target.value)} + onKeyDown={(e) => { + if (e.key === 'Enter') { + authenticateWallet(); + } + }} + ref={passwordRef} + /> + {useLocalNode ? ( + <> + + + + {t('auth:node.using', { + postProcess: 'capitalizeFirstChar', + })} + : {currentNode?.url} + + + ) : ( + <> + + + + {t('auth:node.using_public', { + postProcess: 'capitalizeFirstChar', + })} + + + )} + + + + + {t('auth:action.authenticate', { + postProcess: 'capitalizeFirstChar', + })} + + + {walletToBeDecryptedError} + + + )} + {extState === 'download-wallet' && ( + + )} + + {extState === 'create-wallet' && ( + <> + {!walletToBeDownloaded && ( + <> + + + + { + if (creationStep === 2) { + setCreationStep(1); + return; + } + setExtstate('not-authenticated'); + setShowSeed(false); + setCreationStep(1); + setWalletToBeDownloadedPasswordConfirm(''); + setWalletToBeDownloadedPassword(''); + }} + /> + + + + +
+ +
+ + + + + {t('auth:action.setup_qortal_account', { + postProcess: 'capitalizeFirstChar', + })} + + + + + + + + setShowSeed(true)} + style={{ + fontSize: '14px', + color: 'steelblue', + cursor: 'pointer', + }} + /> + ), + }} + tOptions={{ postProcess: ['capitalizeFirstChar'] }} + > + + + + {t('auth:tips.view_seedphrase', { + postProcess: 'capitalizeFirstChar', + })} + + + + + ), + }} + tOptions={{ postProcess: ['capitalizeFirstChar'] }} + > + + + + + { + setCreationStep(2); + }} + > + {t('core:page.next', { + postProcess: 'capitalizeFirstChar', + })} + + + +
+ +
+ + + + + + {t('auth:seed_your', { + postProcess: 'capitalizeFirstChar', + })} + + + + {generatorRef.current?.parsedString} + + + + {t('auth:action.export_seedphrase', { + postProcess: 'capitalizeFirstChar', + })} + + + + + + + + +
+ + + + + + {t('auth:wallet.password', { + postProcess: 'capitalizeFirstChar', + })} + + + + + + setWalletToBeDownloadedPassword(e.target.value) + } + /> + + + + + {t('auth:wallet.password_confirmation', { + postProcess: 'capitalizeFirstChar', + })} + + + + + + setWalletToBeDownloadedPasswordConfirm(e.target.value) + } + /> + + + + {t('auth:message.generic.no_minimum_length', { + postProcess: 'capitalizeFirstChar', + })} + + + + + + {t('auth:action.create_account', { + postProcess: 'capitalizeFirstChar', + })} + + + + {walletToBeDownloadedError} + + )} + + {walletToBeDownloaded && ( + <> + + + + + + + + {t('auth:message.generic.congrats_setup', { + postProcess: 'capitalizeFirstChar', + })} + + + + + + + + + {t('auth:tips.safe_place', { + postProcess: 'capitalizeFirstChar', + })} + + + + + + { + await saveFileToDiskFunc(); + returnToMain(); + await showInfo({ + message: t('auth:tips.wallet_secure', { + postProcess: 'capitalizeFirstChar', + }), + }); + }} + > + {t('core:action.backup_account', { + postProcess: 'capitalizeFirstChar', + })} + + + )} + + )} + + {isOpenSendQortSuccess && ( + + + + + + + + + {t('core:message.success.transfer', { + postProcess: 'capitalizeFirstChar', + })} + + + + + { + returnToMain(); + }} + > + + {t('core:action.continue', { + postProcess: 'capitalizeFirstChar', + })} + + -
+ )} + + {extState === 'transfer-success-request' && ( + <> + + + + + + + + {t('core:message.success.transfer', { + postProcess: 'capitalizeFirstChar', + })} + + + + + { + window.close(); + }} + > + {t('core:action.continue', { + postProcess: 'capitalizeFirstChar', + })} + + + )} + + {extState === 'buy-order-submitted' && ( + <> + + + + + + + + {t('core:message.success.order_submitted', { + postProcess: 'capitalizeFirstChar', + })} + + + + + { + window.close(); + }} + > + {t('core:action.close', { postProcess: 'capitalizeFirstChar' })} + + + )} + + {countdown && ( + + { + window.close(); + }} + size={75} + strokeWidth={8} + > + {({ remainingTime }) => {remainingTime}} + + + )} + + {isLoading && } + {isShow && ( + + + {message.paymentFee + ? t('core:payment', { + postProcess: 'capitalizeFirstChar', + }) + : t('core:publish', { + postProcess: 'capitalizeFirstChar', + })} + + + + + {message.message} + + + {message?.paymentFee && ( + + {t('core:fee.payment', { + postProcess: 'capitalizeFirstChar', + })} + : {message.paymentFee} + + )} + + {message?.publishFee && ( + + {t('core:fee.publish', { + postProcess: 'capitalizeFirstChar', + })} + : {message.publishFee} + + )} + + + + + + + + + )} + + {isShowInfo && ( + + + {t('tutorial:important_info', { + postProcess: 'capitalizeAll', + })} + + + + + {messageInfo.message} + + + + + + + + )} + + {isShowUnsavedChanges && ( + + + {t('core:action.logout', { postProcess: 'capitalizeAll' })} + + + + + {messageUnsavedChanges.message} + + + + + + + + + + )} + + {isShowQortalRequestExtension && isMainWindow && ( + + { + onCancelQortalRequestExtension(); + }} + size={50} + strokeWidth={5} + > + {({ remainingTime }) => {remainingTime}} + + + + + + {messageQortalRequestExtension?.text1} + + + + {messageQortalRequestExtension?.text2 && ( + <> + + + + + {messageQortalRequestExtension?.text2} + + + + + + )} + + {messageQortalRequestExtension?.text3 && ( + <> + + + {messageQortalRequestExtension?.text3} + + + + + + )} + + {messageQortalRequestExtension?.text4 && ( + + + {messageQortalRequestExtension?.text4} + + + )} + + {messageQortalRequestExtension?.html && ( + <> + + +
+ + )} + + + + + {messageQortalRequestExtension?.highlightedText} + + + {messageQortalRequestExtension?.json && ( + <> + + + + + + )} + + {messageQortalRequestExtension?.fee && ( + <> + + + + {'Fee: '} + {messageQortalRequestExtension?.fee} + {' QORT'} + + + + )} + {messageQortalRequestExtension?.appFee && ( + <> + + {t('core:message.generic.fee_qort', { + message: messageQortalRequestExtension?.appFee, + postProcess: 'capitalizeFirstChar', + })} + + + + + )} + + {messageQortalRequestExtension?.foreignFee && ( + <> + + + + {t('core:message.generic.foreign_fee', { + message: messageQortalRequestExtension?.foreignFee, + postProcess: 'capitalizeFirstChar', + })} + + + + + )} + + {messageQortalRequestExtension?.checkbox1 && ( + + { + qortalRequestCheckbox1Ref.current = e.target.checked; + }} + edge="start" + tabIndex={-1} + disableRipple + defaultChecked={ + messageQortalRequestExtension?.checkbox1?.value + } + sx={{ + '&.Mui-checked': { + color: theme.palette.text.secondary, // Customize the color when checked + }, + '& .MuiSvgIcon-root': { + color: theme.palette.text.secondary, + }, + }} + /> + + + {messageQortalRequestExtension?.checkbox1?.label} + + + )} + + {messageQortalRequestExtension?.confirmCheckbox && ( + setConfirmRequestRead(e.target.checked)} + checked={confirmRequestRead} + edge="start" + tabIndex={-1} + disableRipple + sx={{ + '&.Mui-checked': { + color: theme.palette.text.secondary, + }, + '& .MuiSvgIcon-root': { + color: theme.palette.text.secondary, + }, + }} + /> + } + label={ + + + {t('core:message.success.request_read', { + postProcess: 'capitalizeFirstChar', + })} + + + + } + /> + )} + + + + + { + if ( + messageQortalRequestExtension?.confirmCheckbox && + !confirmRequestRead + ) + return; + onOkQortalRequestExtension('accepted'); + }} + > + {t('core:action.accept', { + postProcess: 'capitalizeFirstChar', + })} + + + onCancelQortalRequestExtension()} + > + {t('core:action.decline', { + postProcess: 'capitalizeFirstChar', + })} + + + {sendPaymentError} + +
+ )} + + {isSettingsOpen && ( + + )} + + + + + {renderProfileLeft()} + + + + + + + + + {extState === 'create-wallet' && walletToBeDownloaded && ( + { + showTutorial('important-information', true); + }} + sx={{ + bottom: '25px', + position: 'fixed', + right: '25px', + }} + > + + )} - {isSettingsOpen && ( - + + {isOpenMinting && ( + )} - - - {renderProfileLeft()} - - - - - - {extState === "create-wallet" && walletToBeDownloaded && ( - { - showTutorial('important-information', true) - }} sx={{ - position: 'fixed', - bottom: '25px', - right: '25px' - }}> - - + + {!isAuthenticated && ( + + + + + + + + + )} - {isOpenMinting && ( - - )} ); } diff --git a/src/ExtStates/NotAuthenticated.tsx b/src/ExtStates/NotAuthenticated.tsx deleted file mode 100644 index 978ff49..0000000 --- a/src/ExtStates/NotAuthenticated.tsx +++ /dev/null @@ -1,1011 +0,0 @@ -import React, { useCallback, useContext, useEffect, useRef, useState } from "react"; -import { Spacer } from "../common/Spacer"; -import { CustomButton, TextItalic, TextP, TextSpan } from "../App-styles"; -import { - Box, - Button, - ButtonBase, - Checkbox, - Dialog, - DialogActions, - DialogContent, - DialogTitle, - FormControlLabel, - Input, - styled, - Switch, - TextField, - Typography, -} from "@mui/material"; -import Logo1 from "../assets/svgs/Logo1.svg"; -import Logo1Dark from "../assets/svgs/Logo1Dark.svg"; -import Info from "../assets/svgs/Info.svg"; -import HelpIcon from '@mui/icons-material/Help'; -import { CustomizedSnackbars } from "../components/Snackbar/Snackbar"; -import { set } from "lodash"; -import { cleanUrl, gateways, isUsingLocal } from "../background"; -import { GlobalContext } from "../App"; -import Tooltip, { TooltipProps, tooltipClasses } from '@mui/material/Tooltip'; - -const manifestData = { - version: "0.5.3", -}; - - -export const HtmlTooltip = styled(({ className, ...props }: TooltipProps) => ( - -))(({ theme }) => ({ - [`& .${tooltipClasses.tooltip}`]: { - backgroundColor: '#232428', - color: 'white', - maxWidth: 320, - padding: '20px', - fontSize: theme.typography.pxToRem(12), - }, -})); -function removeTrailingSlash(url) { - return url.replace(/\/+$/, ''); -} - - -export const NotAuthenticated = ({ - getRootProps, - getInputProps, - setExtstate, - - apiKey, - setApiKey, - globalApiKey, - handleSetGlobalApikey, - currentNode, - setCurrentNode, - useLocalNode, - setUseLocalNode -}) => { - const [isValidApiKey, setIsValidApiKey] = useState(null); - const [hasLocalNode, setHasLocalNode] = useState(null); - // const [useLocalNode, setUseLocalNode] = useState(false); - const [openSnack, setOpenSnack] = React.useState(false); - const [infoSnack, setInfoSnack] = React.useState(null); - const [show, setShow] = React.useState(false); - const [mode, setMode] = React.useState("list"); - const [customNodes, setCustomNodes] = React.useState(null); - // const [currentNode, setCurrentNode] = React.useState({ - // url: "http://127.0.0.1:12391", - // }); - const [importedApiKey, setImportedApiKey] = React.useState(null); - //add and edit states - const [url, setUrl] = React.useState("https://"); - const [customApikey, setCustomApiKey] = React.useState(""); - const [showSelectApiKey, setShowSelectApiKey] = useState(false) - const [enteredApiKey, setEnteredApiKey] = useState('') - const [customNodeToSaveIndex, setCustomNodeToSaveIndex] = - React.useState(null); - const { showTutorial, hasSeenGettingStarted } = useContext(GlobalContext); - - const importedApiKeyRef = useRef(null); - const currentNodeRef = useRef(null); - const hasLocalNodeRef = useRef(null); - const isLocal = cleanUrl(currentNode?.url) === "127.0.0.1:12391"; - const handleFileChangeApiKey = (event) => { - setShowSelectApiKey(false) - const file = event.target.files[0]; // Get the selected file - if (file) { - const reader = new FileReader(); - reader.onload = (e) => { - const text = e.target.result; // Get the file content - - setImportedApiKey(text); // Store the file content in the state - if(customNodes){ - setCustomNodes((prev)=> { - const copyPrev = [...prev] - const findLocalIndex = copyPrev?.findIndex((item)=> item?.url === 'http://127.0.0.1:12391') - if(findLocalIndex === -1){ - copyPrev.unshift({ - url: "http://127.0.0.1:12391", - apikey: text - }) - } else { - copyPrev[findLocalIndex] = { - url: "http://127.0.0.1:12391", - apikey: text - } - } - window - .sendMessage("setCustomNodes", copyPrev) - .catch((error) => { - console.error( - "Failed to set custom nodes:", - error.message || "An error occurred" - ); - }); - return copyPrev - }) - - } - - }; - reader.readAsText(file); // Read the file as text - } - }; - - const checkIfUserHasLocalNode = useCallback(async () => { - try { - const url = `http://127.0.0.1:12391/admin/status`; - const response = await fetch(url, { - method: "GET", - headers: { - "Content-Type": "application/json", - }, - }); - const data = await response.json(); - if (data?.height) { - setHasLocalNode(true); - return true - } - return false - - } catch (error) { - return false - - } - }, []); - - useEffect(() => { - checkIfUserHasLocalNode(); - }, []); - - useEffect(() => { - window - .sendMessage("getCustomNodesFromStorage") - .then((response) => { - - setCustomNodes(response || []); - if(window?.electronAPI?.setAllowedDomains){ - window.electronAPI.setAllowedDomains(response?.map((node)=> node.url)) - } - if(Array.isArray(response)){ - const findLocal = response?.find((item)=> item?.url === 'http://127.0.0.1:12391') - if(findLocal && findLocal?.apikey){ - setImportedApiKey(findLocal?.apikey) - } - } - - }) - .catch((error) => { - console.error( - "Failed to get custom nodes from storage:", - error.message || "An error occurred" - ); - }); - }, []); - - useEffect(() => { - importedApiKeyRef.current = importedApiKey; - }, [importedApiKey]); - useEffect(() => { - currentNodeRef.current = currentNode; - }, [currentNode]); - - useEffect(() => { - hasLocalNodeRef.current = hasLocalNode; - }, [hasLocalNode]); - - - - const validateApiKey = useCallback(async (key, fromStartUp) => { - try { - if(key === "isGateway") return - const isLocalKey = cleanUrl(key?.url) === "127.0.0.1:12391"; - if (fromStartUp && key?.url && key?.apikey && !isLocalKey && !gateways.some(gateway => key?.url?.includes(gateway))) { - setCurrentNode({ - url: key?.url, - apikey: key?.apikey, - }); - - let isValid = false - - - const url = `${key?.url}/admin/settings/localAuthBypassEnabled`; - const response = await fetch(url); - - // Assuming the response is in plain text and will be 'true' or 'false' - const data = await response.text(); - if(data && data === 'true'){ - isValid = true - } else { - const url2 = `${key?.url}/admin/apikey/test?apiKey=${key?.apikey}`; - const response2 = await fetch(url2); - - // Assuming the response is in plain text and will be 'true' or 'false' - const data2 = await response2.text(); - if (data2 === "true") { - isValid = true - } - } - - if (isValid) { - setIsValidApiKey(true); - setUseLocalNode(true); - return - } - - } - if (!currentNodeRef.current) return; - const stillHasLocal = await checkIfUserHasLocalNode() - - if (isLocalKey && !stillHasLocal && !fromStartUp) { - throw new Error("Please turn on your local node"); - } - //check custom nodes - // !gateways.some(gateway => apiKey?.url?.includes(gateway)) - const isCurrentNodeLocal = - cleanUrl(currentNodeRef.current?.url) === "127.0.0.1:12391"; - if (isLocalKey && !isCurrentNodeLocal) { - setIsValidApiKey(false); - setUseLocalNode(false); - return; - } - let payload = {}; - - if (currentNodeRef.current?.url === "http://127.0.0.1:12391") { - payload = { - apikey: importedApiKeyRef.current || key?.apikey, - url: currentNodeRef.current?.url, - }; - if(!payload?.apikey){ - try { - const generateUrl = "http://127.0.0.1:12391/admin/apikey/generate"; - const generateRes = await fetch(generateUrl, { - method: "POST", - }) - let res; - try { - res = await generateRes.clone().json(); - } catch (e) { - res = await generateRes.text(); - } - if (res != null && !res.error && res.length >= 8) { - payload = { - apikey: res, - url: currentNodeRef.current?.url, - }; - - setImportedApiKey(res); // Store the file content in the state - - setCustomNodes((prev)=> { - const copyPrev = [...prev] - const findLocalIndex = copyPrev?.findIndex((item)=> item?.url === 'http://127.0.0.1:12391') - if(findLocalIndex === -1){ - copyPrev.unshift({ - url: "http://127.0.0.1:12391", - apikey: res - }) - } else { - copyPrev[findLocalIndex] = { - url: "http://127.0.0.1:12391", - apikey: res - } - } - window - .sendMessage("setCustomNodes", copyPrev) - .catch((error) => { - console.error( - "Failed to set custom nodes:", - error.message || "An error occurred" - ); - }); - return copyPrev - }) - - - } - } catch (error) { - console.error(error) - } - } - } else if (currentNodeRef.current) { - payload = currentNodeRef.current; - } - let isValid = false - - - const url = `${payload?.url}/admin/settings/localAuthBypassEnabled`; - const response = await fetch(url); - - // Assuming the response is in plain text and will be 'true' or 'false' - const data = await response.text(); - if(data && data === 'true'){ - isValid = true - } else { - const url2 = `${payload?.url}/admin/apikey/test?apiKey=${payload?.apikey}`; - const response2 = await fetch(url2); - - // Assuming the response is in plain text and will be 'true' or 'false' - const data2 = await response2.text(); - if (data2 === "true") { - isValid = true - } - } - - - if (isValid) { - window - .sendMessage("setApiKey", payload) - .then((response) => { - if (response) { - handleSetGlobalApikey(payload); - setIsValidApiKey(true); - setUseLocalNode(true); - if (!fromStartUp) { - setApiKey(payload); - } - } - }) - .catch((error) => { - console.error( - "Failed to set API key:", - error.message || "An error occurred" - ); - }); - } else { - setIsValidApiKey(false); - setUseLocalNode(false); - if(!fromStartUp){ - setInfoSnack({ - type: "error", - message: "Select a valid apikey", - }); - setOpenSnack(true); - } - - } - } catch (error) { - setIsValidApiKey(false); - setUseLocalNode(false); - if (fromStartUp) { - setCurrentNode({ - url: "http://127.0.0.1:12391", - }); - window - .sendMessage("setApiKey", "isGateway") - .then((response) => { - if (response) { - setApiKey(null); - handleSetGlobalApikey(null); - } - }) - .catch((error) => { - console.error( - "Failed to set API key:", - error.message || "An error occurred" - ); - }); - return - } - if(!fromStartUp){ - setInfoSnack({ - type: "error", - message: error?.message || "Select a valid apikey", - }); - setOpenSnack(true); - } - console.error("Error validating API key:", error); - } - }, []); - - useEffect(() => { - if (apiKey) { - validateApiKey(apiKey, true); - } - }, [apiKey]); - - const addCustomNode = () => { - setMode("add-node"); - }; - const saveCustomNodes = (myNodes, isFullListOfNodes) => { - let nodes = [...(myNodes || [])]; - if (!isFullListOfNodes && customNodeToSaveIndex !== null) { - nodes.splice(customNodeToSaveIndex, 1, { - url: removeTrailingSlash(url), - apikey: customApikey, - }); - } else if (!isFullListOfNodes && url) { - nodes.push({ - url: removeTrailingSlash(url), - apikey: customApikey, - }); - } - - setCustomNodes(nodes); - - setCustomNodeToSaveIndex(null); - if (!nodes) return; - window - .sendMessage("setCustomNodes", nodes) - .then((response) => { - if (response) { - setMode("list"); - setUrl("https://"); - setCustomApiKey(""); - if(window?.electronAPI?.setAllowedDomains){ - window.electronAPI.setAllowedDomains(nodes?.map((node) => node.url)) - } - // add alert if needed - } - }) - .catch((error) => { - console.error( - "Failed to set custom nodes:", - error.message || "An error occurred" - ); - }); - }; - - return ( - <> - -
- -
- - - WELCOME TO - QORTAL - - - - - - Your wallet is like your digital ID on Qortal, and is how you will login to the Qortal User Interface. It holds your public address and the Qortal name you will eventually choose. Every transaction you make is linked to your ID, and this is where you manage all your QORT and other tradeable cryptocurrencies on Qortal. - - } - > - setExtstate('wallets')}> - {/* */} - Accounts - - - {/* - - */} - - - - - - New users start here! - - Creating an account means creating a new wallet and digital ID to start using Qortal. Once you have made your account, you can start doing things like obtaining some QORT, buying a name and avatar, publishing videos and blogs, and much more. - - } - > - { - setExtstate("create-wallet"); - }} - sx={{ - backgroundColor: hasSeenGettingStarted === false && 'var(--green)', - color: hasSeenGettingStarted === false && 'black', - "&:hover": { - backgroundColor: hasSeenGettingStarted === false && 'var(--green)', - color: hasSeenGettingStarted === false && 'black' - } - }} - > - Create account - - - - - - - - {"Using node: "} {currentNode?.url} - - <> - - - <> - For advanced users - - { - if (event.target.checked) { - validateApiKey(currentNode); - } else { - setCurrentNode({ - url: "http://127.0.0.1:12391", - }); - setUseLocalNode(false); - window - .sendMessage("setApiKey", null) - .then((response) => { - if (response) { - setApiKey(null); - handleSetGlobalApikey(null); - } - }) - .catch((error) => { - console.error( - "Failed to set API key:", - error.message || "An error occurred" - ); - }); - } - }} - disabled={false} - defaultChecked - /> - } - label={`Use ${isLocal ? "Local" : "Custom"} Node`} - /> - - {currentNode?.url === "http://127.0.0.1:12391" && ( - <> - - {`api key : ${importedApiKey}`} - - )} - - - - Build version: {manifestData?.version} - - - - - {show && ( - - {"Custom nodes"} - - - {mode === "list" && ( - - - - http://127.0.0.1:12391 - - - - - - - {customNodes?.map((node, index) => { - return ( - - - {node?.url} - - - - - - - - ); - })} - - )} - {mode === "add-node" && ( - - { - setUrl(e.target.value); - }} - /> - { - setCustomApiKey(e.target.value); - }} - /> - - )} - - - - {mode === "list" && ( - <> - - - )} - {mode === "list" && ( - - )} - - {mode === "add-node" && ( - <> - - - - - )} - - - )} - - {showSelectApiKey && ( - - {"Enter apikey"} - - - setEnteredApiKey(e.target.value)}/> - - - - - - - - - - - - - )} - { - showTutorial('create-account', true) - }} sx={{ - position: 'fixed', - bottom: '25px', - right: '25px' - }}> - - - - ); -}; diff --git a/src/Wallets.tsx b/src/Wallets.tsx deleted file mode 100644 index 4211fd0..0000000 --- a/src/Wallets.tsx +++ /dev/null @@ -1,533 +0,0 @@ -import React, { useContext, useEffect, useRef, useState } from "react"; -import List from "@mui/material/List"; -import ListItem from "@mui/material/ListItem"; -import Divider from "@mui/material/Divider"; -import ListItemText from "@mui/material/ListItemText"; -import ListItemAvatar from "@mui/material/ListItemAvatar"; -import Avatar from "@mui/material/Avatar"; -import Typography from "@mui/material/Typography"; -import { Box, Button, ButtonBase, Dialog, DialogActions, DialogContent, DialogTitle, IconButton, Input } from "@mui/material"; -import { CustomButton } from "./App-styles"; -import { useDropzone } from "react-dropzone"; -import EditIcon from "@mui/icons-material/Edit"; -import { Label } from "./components/Group/AddGroup"; -import { Spacer } from "./common/Spacer"; -import { getWallets, storeWallets, walletVersion } from "./background"; -import { useModal } from "./common/useModal"; -import PhraseWallet from "./utils/generateWallet/phrase-wallet"; -import { decryptStoredWalletFromSeedPhrase } from "./utils/decryptWallet"; -import { crypto } from "./constants/decryptWallet"; -import { LoadingButton } from "@mui/lab"; -import { PasswordField } from "./components"; -import { HtmlTooltip } from "./ExtStates/NotAuthenticated"; -import { GlobalContext } from "./App"; - -const parsefilenameQortal = (filename)=> { - return filename.startsWith("qortal_backup_") ? filename.slice(14) : filename; - } - -export const Wallets = ({ setExtState, setRawWallet, rawWallet }) => { - const [wallets, setWallets] = useState([]); - const [isLoading, setIsLoading] = useState(true); - const [seedValue, setSeedValue] = useState(""); - const [seedName, setSeedName] = useState(""); - const [seedError, setSeedError] = useState(""); - const { hasSeenGettingStarted } = useContext(GlobalContext); - - const [password, setPassword] = useState(""); - const [isOpenSeedModal, setIsOpenSeedModal] = useState(false); - const [isLoadingEncryptSeed, setIsLoadingEncryptSeed] = useState(false); - - const { isShow, onCancel, onOk, show, } = useModal(); - - const { getRootProps, getInputProps } = useDropzone({ - accept: { - "application/json": [".json"], // Only accept JSON files - }, - onDrop: async (acceptedFiles) => { - const files: any = acceptedFiles; - let importedWallets: any = []; - - for (const file of files) { - try { - const fileContents = await new Promise((resolve, reject) => { - const reader = new FileReader(); - - reader.onabort = () => reject("File reading was aborted"); - reader.onerror = () => reject("File reading has failed"); - reader.onload = () => { - // Resolve the promise with the reader result when reading completes - resolve(reader.result); - }; - - // Read the file as text - reader.readAsText(file); - }); - if (typeof fileContents !== "string") continue; - const parsedData = JSON.parse(fileContents) - importedWallets.push({...parsedData, filename: file?.name}); - } catch (error) { - console.error(error); - } - } - - let error: any = null; - let uniqueInitialMap = new Map(); - - // Only add a message if it doesn't already exist in the Map - importedWallets.forEach((wallet) => { - if (!wallet?.address0) return; - if (!uniqueInitialMap.has(wallet?.address0)) { - uniqueInitialMap.set(wallet?.address0, wallet); - } - }); - const data = Array.from(uniqueInitialMap.values()); - if (data && data?.length > 0) { - const uniqueNewWallets = data.filter( - (newWallet) => - !wallets.some( - (existingWallet) => - existingWallet?.address0 === newWallet?.address0 - ) - ); - setWallets([...wallets, ...uniqueNewWallets]); - } - }, - }); - - const updateWalletItem = (idx, wallet) => { - setWallets((prev) => { - let copyPrev = [...prev]; - if (wallet === null) { - copyPrev.splice(idx, 1); // Use splice to remove the item - return copyPrev; - } else { - copyPrev[idx] = wallet; // Update the wallet at the specified index - return copyPrev; - } - }); - }; - - const handleSetSeedValue = async ()=> { - try { - setIsOpenSeedModal(true) - const {seedValue, seedName, password} = await show({ - message: "", - publishFee: "", - }); - setIsLoadingEncryptSeed(true) - const res = await decryptStoredWalletFromSeedPhrase(seedValue) - const wallet2 = new PhraseWallet(res, walletVersion); - const wallet = await wallet2.generateSaveWalletData( - password, - crypto.kdfThreads, - () => {} - ); - if(wallet?.address0){ - setWallets([...wallets, { - ...wallet, - name: seedName - }]); - setIsOpenSeedModal(false) - setSeedValue('') - setSeedName('') - setPassword('') - setSeedError('') - } else { - setSeedError('Could not create account.') - } - - } catch (error) { - setSeedError(error?.message || 'Could not create account.') - } finally { - setIsLoadingEncryptSeed(false) - } - } - - const selectedWalletFunc = (wallet) => { - setRawWallet(wallet); - setExtState("wallet-dropped"); - }; - - useEffect(()=> { - setIsLoading(true) - getWallets().then((res)=> { - - if(res && Array.isArray(res)){ - setWallets(res) - } - setIsLoading(false) - }).catch((error)=> { - console.error(error) - setIsLoading(false) - }) - }, []) - - useEffect(()=> { - if(!isLoading && wallets && Array.isArray(wallets)){ - storeWallets(wallets) - } - }, [wallets, isLoading]) - - if(isLoading) return null - - return ( -
- {(wallets?.length === 0 || - !wallets) ? ( - <> - No accounts saved - - - ): ( - <> - Your saved accounts - - - )} - - {rawWallet && ( - - Selected Account: - {rawWallet?.name && {rawWallet.name}} - {rawWallet?.address0 && ( - {rawWallet?.address0} - )} - - )} - {wallets?.length > 0 && ( - - {wallets?.map((wallet, idx) => { - return ( - <> - - - - ); - })} - - )} - - - - Already have a Qortal account? Enter your secret backup phrase here to access it. This phrase is one of the ways to recover your account. - - } - > - - - Add seed-phrase - - - - Use this option to connect additional Qortal wallets you've already made, in order to login with them afterwards. You will need access to your backup JSON file in order to do so. - - } - > - - - Add account - - - - - { - if (e.key === 'Enter' && seedValue && seedName && password) { - onOk({seedValue, seedName, password}); - } - }} - > - - Type or paste in your seed-phrase - - - - - setSeedName(e.target.value)} - /> - - - setSeedValue(e.target.value)} - autoComplete="off" - sx={{ - width: '100%' - }} - /> - - - - setPassword(e.target.value)} - autoComplete="off" - sx={{ - width: '100%' - }} - /> - - - - - - - { - if(!seedValue || !seedName || !password) return - onOk({seedValue, seedName, password}); - }} - autoFocus - > - Add - - {seedError} - - - -
- - ); -}; - -const WalletItem = ({ wallet, updateWalletItem, idx, setSelectedWallet }) => { - const [name, setName] = useState(""); - const [note, setNote] = useState(""); - const [isEdit, setIsEdit] = useState(false); - - useEffect(() => { - if (wallet?.name) { - setName(wallet.name); - } - if (wallet?.note) { - setNote(wallet.note); - } - }, [wallet]); - return ( - <> - { - setSelectedWallet(wallet); - }} - sx={{ - width: '100%', - padding: '10px' - }} - - > - - - - - - - {wallet?.address0} - - {wallet?.note} - Login - - } - /> - - { - e.stopPropagation(); - setIsEdit(true); - }} - edge="end" - aria-label="edit" - > - - - - {isEdit && ( - - - setName(e.target.value)} - sx={{ - width: "100%", - }} - /> - - - setNote(e.target.value)} - inputProps={{ - maxLength: 100, - }} - sx={{ - width: "100%", - }} - /> - - - - - - - - )} - - - - - ); -}; diff --git a/src/assets/Icons/AppsIcon.tsx b/src/assets/Icons/AppsIcon.tsx index 753fe17..631c2e2 100644 --- a/src/assets/Icons/AppsIcon.tsx +++ b/src/assets/Icons/AppsIcon.tsx @@ -1,6 +1,10 @@ -import React from "react"; +import { useTheme } from '@mui/material'; + +export const AppsIcon = ({ height = 31, width = 31, color }) => { + const theme = useTheme(); + + const setColor = color ? color : theme.palette.text.primary; -export const AppsIcon = ({ color, height = 31, width = 31 }) => { return ( { > ); diff --git a/src/assets/Icons/ChatIcon.tsx b/src/assets/Icons/ChatIcon.tsx index f68ed35..8546949 100644 --- a/src/assets/Icons/ChatIcon.tsx +++ b/src/assets/Icons/ChatIcon.tsx @@ -1,12 +1,18 @@ import React from 'react'; -export const ChatIcon= ({ color = 'white', height = 15, width = 15 }) => { - return ( - - - - - - ); - }; - \ No newline at end of file +export const ChatIcon = ({ color = 'white', height = 15, width = 15 }) => { + return ( + + + + ); +}; diff --git a/src/assets/Icons/ComposeIcon.tsx b/src/assets/Icons/ComposeIcon.tsx new file mode 100644 index 0000000..3e04687 --- /dev/null +++ b/src/assets/Icons/ComposeIcon.tsx @@ -0,0 +1,33 @@ +import { useTheme } from '@mui/material'; +import { SVGProps } from './interfaces'; + +export const ComposeIcon: React.FC = ({ + color, + height = 20, + width = 20, + opacity, + ...children +}) => { + const theme = useTheme(); + + const setColor = color ? color : theme.palette.text.primary; + const setOpacity = opacity ? opacity : 1; + + return ( + + + + ); +}; diff --git a/src/assets/Icons/CopyIcon.tsx b/src/assets/Icons/CopyIcon.tsx new file mode 100644 index 0000000..6029cd8 --- /dev/null +++ b/src/assets/Icons/CopyIcon.tsx @@ -0,0 +1,24 @@ +import { useTheme } from '@mui/material'; + +export const CopyIcon = ({ color, height = 11, width = 10 }) => { + const theme = useTheme(); + const setColor = color ? color : theme.palette.text.primary; + + return ( + + + + ); +}; diff --git a/src/assets/Icons/CreateThreadIcon.tsx b/src/assets/Icons/CreateThreadIcon.tsx new file mode 100644 index 0000000..f85f3ac --- /dev/null +++ b/src/assets/Icons/CreateThreadIcon.tsx @@ -0,0 +1,31 @@ +import React from 'react'; +import { styled } from '@mui/system'; +import { SVGProps } from './interfaces'; +import { useTheme } from '@mui/material'; + +// Create a styled container with hover effects +const SvgContainer = styled('svg')<{ color?: string }>(({ color }) => ({ + '& path': { + fill: color, + }, +})); +export const CreateThreadIcon: React.FC = ({ color }) => { + const theme = useTheme(); + + const setColor = color || theme.palette.text.primary; + return ( + + + + ); +}; diff --git a/src/assets/Icons/ExitIcon.tsx b/src/assets/Icons/ExitIcon.tsx index cfbeefa..eaa0cbb 100644 --- a/src/assets/Icons/ExitIcon.tsx +++ b/src/assets/Icons/ExitIcon.tsx @@ -1,13 +1,20 @@ -import React from 'react'; +import { useTheme } from '@mui/material'; -export const ExitIcon= ({ color = 'white', height, width }) => { - return ( - - - - +export const ExitIcon = () => { + const theme = useTheme(); - - ); - }; - \ No newline at end of file + return ( + + + + ); +}; diff --git a/src/assets/Icons/HomeIcon.tsx b/src/assets/Icons/HomeIcon.tsx index 38f880d..4432c42 100644 --- a/src/assets/Icons/HomeIcon.tsx +++ b/src/assets/Icons/HomeIcon.tsx @@ -1,12 +1,21 @@ -import React from 'react'; +import { useTheme } from '@mui/material'; -export const HomeIcon= ({ color, height = 20, width = 23 }) => { - return ( - - - - +export const HomeIcon = ({ height = 20, width = 23, color }) => { + const theme = useTheme(); - ); - }; - \ No newline at end of file + const setColor = color ? color : theme.palette.text.primary; + return ( + + + + ); +}; diff --git a/src/assets/Icons/LogoutIcon.tsx b/src/assets/Icons/LogoutIcon.tsx deleted file mode 100644 index 9288de1..0000000 --- a/src/assets/Icons/LogoutIcon.tsx +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react'; - -export const LogoutIcon= ({ color, height = 20, width = 18}) => { - return ( - - - - - - ); - }; - \ No newline at end of file diff --git a/src/assets/Icons/MessagingIcon.tsx b/src/assets/Icons/MessagingIcon.tsx index 0de459b..c14d1d3 100644 --- a/src/assets/Icons/MessagingIcon.tsx +++ b/src/assets/Icons/MessagingIcon.tsx @@ -1,13 +1,30 @@ -import React from 'react'; +import { useTheme } from "@mui/material"; -export const MessagingIcon= ({ color, height = 31, width = 31 }) => { - return ( - - - - - +export const MessagingIcon = ({ color, height = 31, width = 31 }) => { + const theme = useTheme(); - ); - }; - \ No newline at end of file + const setColor = color ? color : theme.palette.text.primary + + return ( + + + + + ); +}; diff --git a/src/assets/Icons/MessagingIcon2.tsx b/src/assets/Icons/MessagingIcon2.tsx deleted file mode 100644 index 5cbdb98..0000000 --- a/src/assets/Icons/MessagingIcon2.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import React from 'react'; - -export const MessagingIcon2= ({ color = '#8F8F91', height = 24, width =24 }) => { - return ( - - - - - - - - ); - }; - \ No newline at end of file diff --git a/src/assets/Icons/MessagingIconFilled.tsx b/src/assets/Icons/MessagingIconFilled.tsx new file mode 100644 index 0000000..5dc6e04 --- /dev/null +++ b/src/assets/Icons/MessagingIconFilled.tsx @@ -0,0 +1,24 @@ +import { useTheme } from '@mui/material'; +import React from 'react'; + +export const MessagingIconFilled = ({ color, height = 31, width = 31 }) => { + const theme = useTheme(); + + const setColor = color ? color : theme.palette.text.primary; + return ( + + + + ); +}; diff --git a/src/assets/Icons/NavAdd.tsx b/src/assets/Icons/NavAdd.tsx new file mode 100644 index 0000000..c234be2 --- /dev/null +++ b/src/assets/Icons/NavAdd.tsx @@ -0,0 +1,32 @@ +import { useTheme } from '@mui/material'; +import { SVGProps } from './interfaces'; + +export const NavAdd: React.FC = ({ color, opacity, ...children }) => { + const theme = useTheme(); + + const setColor = color ? color : theme.palette.text.primary; + const setOpacity = opacity ? opacity : 1; + + return ( + + + + + ); +}; diff --git a/src/assets/Icons/NavBack.tsx b/src/assets/Icons/NavBack.tsx new file mode 100644 index 0000000..d5865f9 --- /dev/null +++ b/src/assets/Icons/NavBack.tsx @@ -0,0 +1,30 @@ +import { useTheme } from '@mui/material'; +import { SVGProps } from './interfaces'; + +export const NavBack: React.FC = ({ + color, + opacity, + ...children +}) => { + const theme = useTheme(); + + const setColor = color ? color : theme.palette.text.primary; + const setOpacity = opacity ? opacity : 1; + + return ( + + + + ); +}; diff --git a/src/assets/Icons/NavCloseTab.tsx b/src/assets/Icons/NavCloseTab.tsx new file mode 100644 index 0000000..b8f295a --- /dev/null +++ b/src/assets/Icons/NavCloseTab.tsx @@ -0,0 +1,46 @@ +import { useTheme } from '@mui/material'; +import { SVGProps } from './interfaces'; + +export const NavCloseTab: React.FC = ({ + color, + opacity, + ...children +}) => { + const theme = useTheme(); + + const setColor = color ? color : theme.palette.text.primary; + const setOpacity = opacity ? opacity : 1; + + return ( + + + + + + + ); +}; diff --git a/src/assets/Icons/NavMoreMenu.tsx b/src/assets/Icons/NavMoreMenu.tsx new file mode 100644 index 0000000..2916f49 --- /dev/null +++ b/src/assets/Icons/NavMoreMenu.tsx @@ -0,0 +1,30 @@ +import { useTheme } from '@mui/material'; +import { SVGProps } from './interfaces'; + +export const NavMoreMenu: React.FC = ({ + color, + opacity, + ...children +}) => { + const theme = useTheme(); + + const setColor = color ? color : theme.palette.text.primary; + const setOpacity = opacity ? opacity : 1; + + return ( + + + + ); +}; diff --git a/src/assets/Icons/NotificationIcon2.tsx b/src/assets/Icons/NotificationIcon2.tsx index 10d7a03..3626d71 100644 --- a/src/assets/Icons/NotificationIcon2.tsx +++ b/src/assets/Icons/NotificationIcon2.tsx @@ -3,7 +3,7 @@ import React from 'react'; export const NotificationIcon2= ({ color = 'white', height = 15, width = 15 }) => { return ( - + ); diff --git a/src/assets/Icons/QappDevelopText.tsx b/src/assets/Icons/QappDevelopText.tsx new file mode 100644 index 0000000..9bd30f9 --- /dev/null +++ b/src/assets/Icons/QappDevelopText.tsx @@ -0,0 +1,30 @@ +import { useTheme } from '@mui/material'; +import { SVGProps } from './interfaces'; + +export const QappDevelopText: React.FC = ({ + color, + opacity, + ...children +}) => { + const theme = useTheme(); + + const setColor = color ? color : theme.palette.text.primary; + const setOpacity = opacity ? opacity : 1; + + return ( + + + + ); +}; diff --git a/src/assets/Icons/QappLibraryText.tsx b/src/assets/Icons/QappLibraryText.tsx new file mode 100644 index 0000000..146717e --- /dev/null +++ b/src/assets/Icons/QappLibraryText.tsx @@ -0,0 +1,34 @@ +import { useTheme } from '@mui/material'; +import { SVGProps } from './interfaces'; + +export const QappLibraryText: React.FC = ({ + color, + opacity, + ...children +}) => { + const theme = useTheme(); + + const setColor = color ? color : theme.palette.text.primary; + const setOpacity = opacity ? opacity : 1; + + return ( + + + + + ); +}; diff --git a/src/assets/Icons/Return.tsx b/src/assets/Icons/Return.tsx new file mode 100644 index 0000000..5506a57 --- /dev/null +++ b/src/assets/Icons/Return.tsx @@ -0,0 +1,27 @@ +import { useTheme } from '@mui/material'; +import { SVGProps } from './interfaces'; + +export const Return: React.FC = ({ color, opacity, ...children }) => { + const theme = useTheme(); + + const setColor = color ? color : theme.palette.text.primary; + + return ( + + + + ); +}; diff --git a/src/assets/Icons/ReturnIcon.tsx b/src/assets/Icons/ReturnIcon.tsx index 633eafc..98e0fea 100644 --- a/src/assets/Icons/ReturnIcon.tsx +++ b/src/assets/Icons/ReturnIcon.tsx @@ -1,14 +1,20 @@ -import React from 'react'; +import { useTheme } from '@mui/material'; -export const ReturnIcon= ({ color = 'white', height, width }) => { - return ( - - - - - +export const ReturnIcon = () => { + const theme = useTheme(); - - ); - }; - \ No newline at end of file + return ( + + + + ); +}; diff --git a/src/assets/Icons/SaveIcon.tsx b/src/assets/Icons/SaveIcon.tsx new file mode 100644 index 0000000..ff39072 --- /dev/null +++ b/src/assets/Icons/SaveIcon.tsx @@ -0,0 +1,26 @@ +import { useTheme } from '@mui/material'; +import { SVGProps } from './interfaces'; + +export const SaveIcon: React.FC = ({ color, ...children }) => { + const theme = useTheme(); + + const setColor = color ? color : theme.palette.text.primary; + + return ( + + + + ); +}; diff --git a/src/assets/Icons/Search.tsx b/src/assets/Icons/Search.tsx new file mode 100644 index 0000000..64ae644 --- /dev/null +++ b/src/assets/Icons/Search.tsx @@ -0,0 +1,26 @@ +import { useTheme } from '@mui/material'; +import { SVGProps } from './interfaces'; + +export const Search: React.FC = ({ color, opacity, ...children }) => { + const theme = useTheme(); + + const setColor = color ? color : theme.palette.text.primary; + const setOpacity = opacity ? opacity : 1; + + return ( + + + + ); +}; diff --git a/src/assets/Icons/SendNewMessage.tsx b/src/assets/Icons/SendNewMessage.tsx new file mode 100644 index 0000000..5885791 --- /dev/null +++ b/src/assets/Icons/SendNewMessage.tsx @@ -0,0 +1,34 @@ +import React from 'react'; +import { styled } from '@mui/system'; +import { SVGProps } from './interfaces'; +import { useTheme } from '@mui/material'; + +// Make SvgContainer accept a prop +const SvgContainer = styled('svg')<{ color?: string }>(({ color }) => ({ + '& path': { + fill: color, + }, +})); + +export const SendNewMessage: React.FC = ({ color, ...props }) => { + const theme = useTheme(); + + const setColor = color || theme.palette.text.primary; + return ( + + + + ); +}; diff --git a/src/assets/Icons/SortIcon.tsx b/src/assets/Icons/SortIcon.tsx new file mode 100644 index 0000000..93b03b6 --- /dev/null +++ b/src/assets/Icons/SortIcon.tsx @@ -0,0 +1,37 @@ +import { useTheme } from '@mui/material'; +import { SVGProps } from './interfaces'; + +export const SortIcon: React.FC = ({ + color, + height = 16, + width = 15, + opacity, + ...children +}) => { + const theme = useTheme(); + + const setColor = color ? color : theme.palette.text.primary; + const setOpacity = opacity ? opacity : 1; + + return ( + + + + + ); +}; diff --git a/src/assets/Icons/StarEmpty.tsx b/src/assets/Icons/StarEmpty.tsx new file mode 100644 index 0000000..fdd0f0c --- /dev/null +++ b/src/assets/Icons/StarEmpty.tsx @@ -0,0 +1,21 @@ +import { useTheme } from '@mui/material'; + +export const StarEmptyIcon = () => { + const theme = useTheme(); + + const setColor = theme.palette.text.secondary; + return ( + + + + ); +}; diff --git a/src/assets/svgs/StarFilled.tsx b/src/assets/Icons/StarFilled.tsx similarity index 88% rename from src/assets/svgs/StarFilled.tsx rename to src/assets/Icons/StarFilled.tsx index fb82e49..b6645cf 100644 --- a/src/assets/svgs/StarFilled.tsx +++ b/src/assets/Icons/StarFilled.tsx @@ -1,6 +1,9 @@ -import React from "react"; +import { useTheme } from '@mui/material'; export const StarFilledIcon = () => { + const theme = useTheme(); + + const setColor = theme.palette.text.primary; return ( { > ); diff --git a/src/assets/Icons/SuccessIcon.tsx b/src/assets/Icons/SuccessIcon.tsx new file mode 100644 index 0000000..0319446 --- /dev/null +++ b/src/assets/Icons/SuccessIcon.tsx @@ -0,0 +1,32 @@ +import { useTheme } from '@mui/material'; +import { SVGProps } from './interfaces'; + +export const SuccessIcon: React.FC = ({ + color, + height = 155, + width = 156, + opacity, + ...children +}) => { + const theme = useTheme(); + + const setColor = color ? color : theme.palette.text.primary; + const setOpacity = opacity ? opacity : 1; + + return ( + + + + ); +}; diff --git a/src/assets/Icons/ThreadsIcon.tsx b/src/assets/Icons/ThreadsIcon.tsx index 86dfeaa..ed45696 100644 --- a/src/assets/Icons/ThreadsIcon.tsx +++ b/src/assets/Icons/ThreadsIcon.tsx @@ -1,13 +1,18 @@ -import React from 'react'; - -export const ThreadsIcon= ({ color = 'white', height = 11, width = 15 }) => { - return ( - - - - - - - ); - }; - \ No newline at end of file +export const ThreadsIcon = ({ color = 'white', height = 11, width = 15 }) => { + return ( + + + + ); +}; diff --git a/src/assets/Icons/TradingIcon.tsx b/src/assets/Icons/TradingIcon.tsx index 2c72300..e6723da 100644 --- a/src/assets/Icons/TradingIcon.tsx +++ b/src/assets/Icons/TradingIcon.tsx @@ -1,11 +1,16 @@ -import React from 'react'; - -export const TradingIcon= ({ color, height, width }) => { - return ( - - - - - ); - }; - \ No newline at end of file +export const TradingIcon = ({ color, height, width }) => { + return ( + + + + ); +}; diff --git a/src/assets/Icons/WalletIcon.tsx b/src/assets/Icons/WalletIcon.tsx index 7a0cc58..84c6775 100644 --- a/src/assets/Icons/WalletIcon.tsx +++ b/src/assets/Icons/WalletIcon.tsx @@ -1,12 +1,36 @@ -import React from 'react'; +import { useTheme } from '@mui/material'; +import { SVGProps } from './interfaces'; -export const WalletIcon= ({ color, height, width }) => { - return ( - - - - +export const WalletIcon: React.FC = ({ + color, + width, + ...children +}) => { + const theme = useTheme(); - ); - }; - \ No newline at end of file + const setColor = color ? color : theme.palette.text.primary; + + return ( + + + + + ); +}; diff --git a/src/assets/Icons/interfaces.ts b/src/assets/Icons/interfaces.ts new file mode 100644 index 0000000..b53eeb4 --- /dev/null +++ b/src/assets/Icons/interfaces.ts @@ -0,0 +1,8 @@ +import React from 'react'; + +export interface SVGProps extends React.SVGProps { + color?: string; + height?: string; + opacity?: number; + width?: string; +} diff --git a/src/assets/QMailLogo.png b/src/assets/QMailLogo.png deleted file mode 100644 index 60214df..0000000 Binary files a/src/assets/QMailLogo.png and /dev/null differ diff --git a/src/assets/react.svg b/src/assets/react.svg deleted file mode 100644 index 6c87de9..0000000 --- a/src/assets/react.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/svgs/ComposeIcon copy.svg b/src/assets/svgs/ComposeIcon copy.svg deleted file mode 100644 index e2fc3fc..0000000 --- a/src/assets/svgs/ComposeIcon copy.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/src/assets/svgs/Copy.svg b/src/assets/svgs/Copy.svg deleted file mode 100644 index 0348fc9..0000000 --- a/src/assets/svgs/Copy.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/assets/svgs/CreateThreadIcon.tsx b/src/assets/svgs/CreateThreadIcon.tsx deleted file mode 100644 index 549ec2e..0000000 --- a/src/assets/svgs/CreateThreadIcon.tsx +++ /dev/null @@ -1,20 +0,0 @@ -import React from 'react'; -import { styled } from '@mui/system'; -import { SVGProps } from './interfaces'; - -// Create a styled container with hover effects -const SvgContainer = styled('svg')({ - '& path': { - fill: 'rgba(41, 41, 43, 1)', // Default to red if no color prop - } -}); - -export const CreateThreadIcon:React.FC = ({ color, opacity }) => { - return ( - - - - - - ); -}; diff --git a/src/assets/svgs/Download.svg b/src/assets/svgs/Download.svg deleted file mode 100644 index 4fb9e52..0000000 --- a/src/assets/svgs/Download.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/assets/svgs/Forum.svg b/src/assets/svgs/Forum.svg deleted file mode 100644 index 7957b06..0000000 --- a/src/assets/svgs/Forum.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/assets/svgs/Info.svg b/src/assets/svgs/Info.svg deleted file mode 100644 index 63f9bfc..0000000 --- a/src/assets/svgs/Info.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/assets/svgs/Logout.svg b/src/assets/svgs/Logout.svg deleted file mode 100644 index 6ba462d..0000000 --- a/src/assets/svgs/Logout.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/assets/svgs/ModalClose.svg b/src/assets/svgs/ModalClose.svg deleted file mode 100644 index 1a8b18e..0000000 --- a/src/assets/svgs/ModalClose.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/assets/svgs/NavAdd.svg b/src/assets/svgs/NavAdd.svg deleted file mode 100644 index 1d38c05..0000000 --- a/src/assets/svgs/NavAdd.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/src/assets/svgs/NavBack.svg b/src/assets/svgs/NavBack.svg deleted file mode 100644 index 07df29e..0000000 --- a/src/assets/svgs/NavBack.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/src/assets/svgs/NavCloseTab.svg b/src/assets/svgs/NavCloseTab.svg deleted file mode 100644 index a4595df..0000000 --- a/src/assets/svgs/NavCloseTab.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/src/assets/svgs/NavMoreMenu.svg b/src/assets/svgs/NavMoreMenu.svg deleted file mode 100644 index f64cdab..0000000 --- a/src/assets/svgs/NavMoreMenu.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/src/assets/svgs/Return.svg b/src/assets/svgs/Return.svg deleted file mode 100644 index e4ff9b3..0000000 --- a/src/assets/svgs/Return.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/assets/svgs/SaveIcon.tsx b/src/assets/svgs/SaveIcon.tsx deleted file mode 100644 index 12c4999..0000000 --- a/src/assets/svgs/SaveIcon.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import React from 'react' - -export const SaveIcon = ({color = '#8F8F91'}) => { - return ( - - - - - ) -} diff --git a/src/assets/svgs/Search.svg b/src/assets/svgs/Search.svg deleted file mode 100644 index b6cb06b..0000000 --- a/src/assets/svgs/Search.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/assets/svgs/SendNewMessage.tsx b/src/assets/svgs/SendNewMessage.tsx deleted file mode 100644 index 33d7e86..0000000 --- a/src/assets/svgs/SendNewMessage.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import React from 'react'; -import { styled } from '@mui/system'; -import { SVGProps } from './interfaces'; - -// Create a styled container with hover effects -const SvgContainer = styled('svg')({ - '& path': { - fill: 'rgba(41, 41, 43, 1)', // Default to red if no color prop - } -}); - -export const SendNewMessage:React.FC = ({ color, opacity }) => { - return ( - - - - - ); -}; diff --git a/src/assets/svgs/Sort.svg b/src/assets/svgs/Sort.svg deleted file mode 100644 index c399db8..0000000 --- a/src/assets/svgs/Sort.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/src/assets/svgs/StarEmpty.tsx b/src/assets/svgs/StarEmpty.tsx deleted file mode 100644 index 8375111..0000000 --- a/src/assets/svgs/StarEmpty.tsx +++ /dev/null @@ -1,16 +0,0 @@ - - - -import React from 'react'; - - -export const StarEmptyIcon = () => { - return ( - - - - - - - ); -}; diff --git a/src/assets/svgs/Success.svg b/src/assets/svgs/Success.svg deleted file mode 100644 index c721476..0000000 --- a/src/assets/svgs/Success.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/assets/svgs/interfaces.ts b/src/assets/svgs/interfaces.ts deleted file mode 100644 index 0cbd14f..0000000 --- a/src/assets/svgs/interfaces.ts +++ /dev/null @@ -1,6 +0,0 @@ -export interface SVGProps { - color: string - height: string - width: string - opacity?: number -} diff --git a/src/assets/svgs/qappDevelopText.svg b/src/assets/svgs/qappDevelopText.svg deleted file mode 100644 index 3aa786a..0000000 --- a/src/assets/svgs/qappDevelopText.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/assets/svgs/qappLibraryText.svg b/src/assets/svgs/qappLibraryText.svg deleted file mode 100644 index 297c466..0000000 --- a/src/assets/svgs/qappLibraryText.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/src/assets/syncStatus/synced.png b/src/assets/syncStatus/synced.png deleted file mode 100644 index f944bad..0000000 Binary files a/src/assets/syncStatus/synced.png and /dev/null differ diff --git a/src/assets/syncStatus/synced.webp b/src/assets/syncStatus/synced.webp new file mode 100644 index 0000000..0036186 Binary files /dev/null and b/src/assets/syncStatus/synced.webp differ diff --git a/src/assets/syncStatus/synced_minting.png b/src/assets/syncStatus/synced_minting.png deleted file mode 100644 index 567e784..0000000 Binary files a/src/assets/syncStatus/synced_minting.png and /dev/null differ diff --git a/src/assets/syncStatus/synced_minting.webp b/src/assets/syncStatus/synced_minting.webp new file mode 100644 index 0000000..01093c8 Binary files /dev/null and b/src/assets/syncStatus/synced_minting.webp differ diff --git a/src/assets/syncStatus/syncing.png b/src/assets/syncStatus/syncing.png deleted file mode 100644 index 82d39bb..0000000 Binary files a/src/assets/syncStatus/syncing.png and /dev/null differ diff --git a/src/assets/syncStatus/syncing.webp b/src/assets/syncStatus/syncing.webp new file mode 100644 index 0000000..7d6e2de Binary files /dev/null and b/src/assets/syncStatus/syncing.webp differ diff --git a/src/atoms/global.ts b/src/atoms/global.ts index d546bf0..baa96d5 100644 --- a/src/atoms/global.ts +++ b/src/atoms/global.ts @@ -1,176 +1,83 @@ -import { atom, selectorFamily } from 'recoil'; +import { atom } from 'jotai'; +import { atomWithReset, atomFamily } from 'jotai/utils'; +// Atoms (resettable) +export const sortablePinnedAppsAtom = atomWithReset([ + { name: 'Q-Tube', service: 'APP' }, + { name: 'Q-Mail', service: 'APP' }, + { name: 'Q-Share', service: 'APP' }, + { name: 'Q-Fund', service: 'APP' }, + { name: 'Q-Shop', service: 'APP' }, + { name: 'Q-Trade', service: 'APP' }, + { name: 'Q-Support', service: 'APP' }, + { name: 'Q-Manager', service: 'APP' }, + { name: 'Q-Blog', service: 'APP' }, + { name: 'Q-Mintership', service: 'APP' }, + { name: 'Q-Wallets', service: 'APP' }, + { name: 'Q-Search', service: 'APP' }, + { name: 'Q-Nodecontrol', service: 'APP' }, +]); -export const sortablePinnedAppsAtom = atom({ - key: 'sortablePinnedAppsFromAtom', - default: [{ - name: 'Q-Tube', - service: 'APP' - }, { - name: 'Q-Mail', - service: 'APP' - }, { - name: 'Q-Share', - service: 'APP' - }, { - name: 'Q-Fund', - service: 'APP' - }, { - name: 'Q-Shop', - service: 'APP' - }, - { - name: 'Q-Trade', - service: 'APP' - }, - { - name: 'Q-Support', - service: 'APP' - }, - { - name: 'Q-Manager', - service: 'APP' - }, - { - name: 'Q-Blog', - service: 'APP' - }, - { - name: 'Q-Mintership', - service: 'APP' - }, - { - name: 'Q-Wallets', - service: 'APP' - } -], -}); +export const addressInfoControllerAtom = atomWithReset({}); +export const blobControllerAtom = atomWithReset({}); +export const canSaveSettingToQdnAtom = atomWithReset(false); +export const enabledDevModeAtom = atomWithReset(false); +export const fullScreenAtom = atomWithReset(false); +export const groupAnnouncementsAtom = atomWithReset({}); +export const groupChatTimestampsAtom = atomWithReset({}); +export const groupsOwnerNamesAtom = atomWithReset({}); +export const groupsPropertiesAtom = atomWithReset({}); +export const hasSettingsChangedAtom = atomWithReset(false); +export const isDisabledEditorEnterAtom = atomWithReset(false); +export const isOpenBlockedModalAtom = atomWithReset(false); +export const isRunningPublicNodeAtom = atomWithReset(false); +export const isUsingImportExportSettingsAtom = atomWithReset(null); +export const lastPaymentSeenTimestampAtom = atomWithReset(null); +export const mailsAtom = atomWithReset([]); +export const memberGroupsAtom = atomWithReset([]); +export const mutedGroupsAtom = atomWithReset([]); +export const myGroupsWhereIAmAdminAtom = atomWithReset([]); +export const navigationControllerAtom = atomWithReset({}); +export const oldPinnedAppsAtom = atomWithReset([]); +export const promotionsAtom = atomWithReset([]); +export const promotionTimeIntervalAtom = atomWithReset(0); +export const qMailLastEnteredTimestampAtom = atomWithReset(null); +export const resourceDownloadControllerAtom = atomWithReset({}); +export const selectedGroupIdAtom = atomWithReset(null); +export const settingsLocalLastUpdatedAtom = atomWithReset(0); +export const settingsQDNLastUpdatedAtom = atomWithReset(-100); +export const timestampEnterDataAtom = atomWithReset({}); +export const txListAtom = atomWithReset([]); -export const canSaveSettingToQdnAtom = atom({ - key: 'canSaveSettingToQdnAtom', - default: false, -}); +// Atom Families (replacing selectorFamily) +export const resourceKeySelector = atomFamily((key) => + atom((get) => get(resourceDownloadControllerAtom)[key] || null) +); -export const settingsQDNLastUpdatedAtom = atom({ - key: 'settingsQDNLastUpdatedAtom', - default: -100, -}); +export const blobKeySelector = atomFamily((key) => + atom((get) => get(blobControllerAtom)[key] || null) +); -export const settingsLocalLastUpdatedAtom = atom({ - key: 'settingsLocalLastUpdatedAtom', - default: 0, -}); +export const addressInfoKeySelector = atomFamily((key) => + atom((get) => get(addressInfoControllerAtom)[key] || null) +); -export const oldPinnedAppsAtom = atom({ - key: 'oldPinnedAppsAtom', - default: [], -}); -export const isUsingImportExportSettingsAtom = atom({ - key: 'isUsingImportExportSettingsAtom', - default: null, -}); +export const groupsOwnerNamesSelector = atomFamily((key) => + atom((get) => get(groupsOwnerNamesAtom)[key] || null) +); +export const groupAnnouncementSelector = atomFamily((key) => + atom((get) => get(groupAnnouncementsAtom)[key] || null) +); -export const fullScreenAtom = atom({ - key: 'fullScreenAtom', - default: false, -}); +export const groupPropertySelector = atomFamily((key) => + atom((get) => get(groupsPropertiesAtom)[key] || null) +); -export const hasSettingsChangedAtom = atom({ - key: 'hasSettingsChangedAtom', - default: false, -}); +export const groupChatTimestampSelector = atomFamily((key) => + atom((get) => get(groupChatTimestampsAtom)[key] || null) +); -export const navigationControllerAtom = atom({ - key: 'navigationControllerAtom', - default: {}, -}); - -export const enabledDevModeAtom = atom({ - key: 'enabledDevModeAtom', - default: false, -}); - -export const myGroupsWhereIAmAdminAtom = atom({ - key: 'myGroupsWhereIAmAdminAtom', - default: [], -}); - -export const promotionTimeIntervalAtom = atom({ - key: 'promotionTimeIntervalAtom', - default: 0, -}); - -export const promotionsAtom = atom({ - key: 'promotionsAtom', - default: [], -}); - -export const resourceDownloadControllerAtom = atom({ - key: 'resourceDownloadControllerAtom', - default: {}, -}); - -export const resourceKeySelector = selectorFamily({ - key: 'resourceKeySelector', - get: (key) => ({ get }) => { - const resources = get(resourceDownloadControllerAtom); - return resources[key] || null; // Return the value for the key or null if not found - }, -}); - -export const blobControllerAtom = atom({ - key: 'blobControllerAtom', - default: {}, -}); - -export const blobKeySelector = selectorFamily({ - key: 'blobKeySelector', - get: (key) => ({ get }) => { - const blobs = get(blobControllerAtom); - return blobs[key] || null; // Return the value for the key or null if not found - }, -}); - -export const selectedGroupIdAtom = atom({ - key: 'selectedGroupIdAtom', - default: null, -}); - -export const addressInfoControllerAtom = atom({ - key: 'addressInfoControllerAtom', - default: {}, -}); - -export const addressInfoKeySelector = selectorFamily({ - key: 'addressInfoKeySelector', - get: (key) => ({ get }) => { - const userInfo = get(addressInfoControllerAtom); - return userInfo[key] || null; // Return the value for the key or null if not found - }, -}); - -export const isDisabledEditorEnterAtom = atom({ - key: 'isDisabledEditorEnterAtom', - default: false, -}); - -export const qMailLastEnteredTimestampAtom = atom({ - key: 'qMailLastEnteredTimestampAtom', - default: null, -}); - -export const lastPaymentSeenTimestampAtom = atom({ - key: 'lastPaymentSeenTimestampAtom', - default: null, -}); - -export const mailsAtom = atom({ - key: 'mailsAtom', - default: [], -}); - -export const groupsPropertiesAtom = atom({ - key: 'groupsPropertiesAtom', - default: {}, -}); \ No newline at end of file +export const timestampEnterDataSelector = atomFamily((key) => + atom((get) => get(timestampEnterDataAtom)[key] || null) +); diff --git a/src/background-cases.ts b/src/background-cases.ts deleted file mode 100644 index d4ab82a..0000000 --- a/src/background-cases.ts +++ /dev/null @@ -1,2118 +0,0 @@ -import { - addDataPublishes, - addEnteredQmailTimestamp, - addTimestampEnterChat, - addTimestampGroupAnnouncement, - addTimestampMention, - addUserSettings, - banFromGroup, - cancelBan, - cancelInvitationToGroup, - checkLocalFunc, - checkNewMessages, - checkThreads, - clearAllNotifications, - createEndpoint, - createGroup, - decryptDirectFunc, - decryptSingleForPublishes, - decryptSingleFunc, - decryptWallet, - findUsableApi, - getApiKeyFromStorage, - getBalanceInfo, - getCustomNodesFromStorage, - getDataPublishes, - getEnteredQmailTimestamp, - getGroupDataSingle, - getKeyPair, - getLTCBalance, - getLastRef, - getNameInfo, - getTempPublish, - getTimestampEnterChat, - getTimestampGroupAnnouncement, - getTimestampMention, - getUserInfo, - getUserSettings, - handleActiveGroupDataFromSocket, - inviteToGroup, - joinGroup, - kickFromGroup, - leaveGroup, - makeAdmin, - notifyAdminRegenerateSecretKey, - pauseAllQueues, - processTransactionVersion2, - registerName, - removeAdmin, - resumeAllQueues, - saveTempPublish, - sendChatDirect, - sendChatGroup, - sendChatNotification, - sendCoin, - setChatHeads, - setGroupData, - updateThreadActivity, - walletVersion, -} from "./background"; -import { decryptGroupEncryption, encryptAndPublishSymmetricKeyGroupChat, encryptAndPublishSymmetricKeyGroupChatForAdmins, publishGroupEncryptedResource, publishOnQDN } from "./backgroundFunctions/encryption"; -import { PUBLIC_NOTIFICATION_CODE_FIRST_SECRET_KEY } from "./constants/codes"; -import Base58 from "./deps/Base58"; -import { encryptSingle } from "./qdn/encryption/group-encryption"; -import { _createPoll, _voteOnPoll } from "./qortalRequests/get"; -import { createTransaction } from "./transactions/transactions"; -import { getData, storeData } from "./utils/chromeStorage"; - -export function versionCase(request, event) { - event.source.postMessage( - { - requestId: request.requestId, - action: "version", - payload: { version: "1.0" }, - type: "backgroundMessageResponse", - }, - event.origin - ); -} - -export async function getWalletInfoCase(request, event) { - try { - const response = await getKeyPair(); - - try { - const walletInfo = await getData('walletInfo').catch((error)=> null) - if(walletInfo){ - event.source.postMessage( - { - requestId: request.requestId, - action: "getWalletInfo", - payload: { walletInfo, hasKeyPair: true }, - type: "backgroundMessageResponse", - }, - event.origin - ); - } else { - event.source.postMessage( - { - requestId: request.requestId, - action: "getWalletInfo", - error: "No wallet info found", - type: "backgroundMessageResponse", - }, - event.origin - ); - } - - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "getWalletInfo", - error: "No wallet info found", - type: "backgroundMessageResponse", - }, - event.origin - ); - } - - } catch (error) { - try { - const walletInfo = await getData('walletInfo').catch((error)=> null) - if(walletInfo){ - event.source.postMessage( - { - requestId: request.requestId, - action: "getWalletInfo", - payload: { walletInfo, hasKeyPair: false }, - type: "backgroundMessageResponse", - }, - event.origin - ); - } else { - event.source.postMessage( - { - requestId: request.requestId, - action: "getWalletInfo", - error: "Wallet not authenticated", - type: "backgroundMessageResponse", - }, - event.origin - ); - } - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "getWalletInfo", - error: "Wallet not authenticated", - type: "backgroundMessageResponse", - }, - event.origin - ); - } - - } -} - -export async function validApiCase(request, event) { - try { - const usableApi = await findUsableApi(); - - event.source.postMessage( - { - requestId: request.requestId, - action: "validApi", - payload: usableApi, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "validApi", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } -} - -export async function nameCase(request, event) { - try { - const response = await getNameInfo(); - - event.source.postMessage( - { - requestId: request.requestId, - action: "name", - payload: response, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "name", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } -} - -export async function userInfoCase(request, event) { - try { - const response = await getUserInfo(); - - event.source.postMessage( - { - requestId: request.requestId, - action: "userInfo", - payload: response, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "userInfo", - error: "User not authenticated", - type: "backgroundMessageResponse", - }, - event.origin - ); - } -} - -export async function decryptWalletCase(request, event) { - try { - const { password, wallet } = request.payload; - const response = await decryptWallet({password, wallet, walletVersion: wallet?.version || walletVersion}); - event.source.postMessage( - { - requestId: request.requestId, - action: "decryptWallet", - payload: response, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "decryptWallet", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } -} - -export async function balanceCase(request, event) { - try { - const response = await getBalanceInfo(); - - event.source.postMessage( - { - requestId: request.requestId, - action: "balance", - payload: response, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "balance", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } -} -export async function ltcBalanceCase(request, event) { - try { - const response = await getLTCBalance(); - - event.source.postMessage( - { - requestId: request.requestId, - action: "ltcBalance", - payload: response, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "ltcBalance", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } -} - -export async function sendCoinCase(request, event) { - try { - const { receiver, password, amount } = request.payload; - const { res } = await sendCoin({ receiver, password, amount }); - if (!res?.success) { - event.source.postMessage( - { - requestId: request.requestId, - action: "sendCoin", - error: res?.data?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - return; - } - event.source.postMessage( - { - requestId: request.requestId, - action: "sendCoin", - payload: true, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "sendCoin", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } -} - -export async function inviteToGroupCase(request, event) { - try { - const { groupId, qortalAddress, inviteTime } = request.payload; - const response = await inviteToGroup({ - groupId, - qortalAddress, - inviteTime, - }); - - event.source.postMessage( - { - requestId: request.requestId, - action: "inviteToGroup", - payload: response, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "inviteToGroup", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } -} - -export async function saveTempPublishCase(request, event) { - try { - const { data, key } = request.payload; - const response = await saveTempPublish({ data, key }); - - event.source.postMessage( - { - requestId: request.requestId, - action: "saveTempPublish", - payload: response, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "saveTempPublish", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } -} - -export async function getTempPublishCase(request, event) { - try { - const response = await getTempPublish(); - - event.source.postMessage( - { - requestId: request.requestId, - action: "getTempPublish", - payload: response, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "getTempPublish", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } -} - -export async function createGroupCase(request, event) { - try { - const { - groupName, - groupDescription, - groupType, - groupApprovalThreshold, - minBlock, - maxBlock, - } = request.payload; - const response = await createGroup({ - groupName, - groupDescription, - groupType, - groupApprovalThreshold, - minBlock, - maxBlock, - }); - - event.source.postMessage( - { - requestId: request.requestId, - action: "createGroup", - payload: response, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "createGroup", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } -} - -export async function cancelInvitationToGroupCase(request, event) { - try { - const { groupId, qortalAddress } = request.payload; - const response = await cancelInvitationToGroup({ groupId, qortalAddress }); - - event.source.postMessage( - { - requestId: request.requestId, - action: "cancelInvitationToGroup", - payload: response, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "cancelInvitationToGroup", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } -} - -export async function leaveGroupCase(request, event) { - try { - const { groupId } = request.payload; - const response = await leaveGroup({ groupId }); - - event.source.postMessage( - { - requestId: request.requestId, - action: "leaveGroup", - payload: response, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "leaveGroup", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } -} - -export async function joinGroupCase(request, event) { - try { - const { groupId } = request.payload; - const response = await joinGroup({ groupId }); - - event.source.postMessage( - { - requestId: request.requestId, - action: "joinGroup", - payload: response, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "joinGroup", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } -} - -export async function kickFromGroupCase(request, event) { - try { - const { groupId, qortalAddress, rBanReason } = request.payload; - const response = await kickFromGroup({ - groupId, - qortalAddress, - rBanReason, - }); - - event.source.postMessage( - { - requestId: request.requestId, - action: "kickFromGroup", - payload: response, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "kickFromGroup", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } -} - -export async function banFromGroupCase(request, event) { - try { - const { groupId, qortalAddress, rBanReason, rBanTime } = request.payload; - const response = await banFromGroup({ - groupId, - qortalAddress, - rBanReason, - rBanTime, - }); - - event.source.postMessage( - { - requestId: request.requestId, - action: "banFromGroup", - payload: response, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "banFromGroup", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } -} - -export async function addDataPublishesCase(request, event) { - try { - const { data, groupId, type } = request.payload; - const response = await addDataPublishes( data, groupId, type ); - - event.source.postMessage( - { - requestId: request.requestId, - action: "addDataPublishes", - payload: response, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "addDataPublishes", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } -} - -export async function getDataPublishesCase(request, event) { - try { - const { groupId, type } = request.payload; - const response = await getDataPublishes(groupId, type ); - - event.source.postMessage( - { - requestId: request.requestId, - action: "getDataPublishes", - payload: response, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "getDataPublishes", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } -} -export async function addUserSettingsCase(request, event) { - try { - const { keyValue } = request.payload; - const response = await addUserSettings({ keyValue }); - - event.source.postMessage( - { - requestId: request.requestId, - action: "addUserSettings", - payload: response, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "addUserSettings", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } -} - -export async function getUserSettingsCase(request, event) { - try { - const { key } = request.payload; - const response = await getUserSettings({ key }); - - event.source.postMessage( - { - requestId: request.requestId, - action: "getUserSettings", - payload: response, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "getUserSettings", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } -} - -export async function cancelBanCase(request, event) { - try { - const { groupId, qortalAddress } = request.payload; - const response = await cancelBan({ groupId, qortalAddress }); - - event.source.postMessage( - { - requestId: request.requestId, - action: "cancelBan", - payload: response, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "cancelBan", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } -} - -export async function registerNameCase(request, event) { - try { - const { name } = request.payload; - const response = await registerName({ name }); - - event.source.postMessage( - { - requestId: request.requestId, - action: "registerName", - payload: response, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "registerName", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } -} -export async function createPollCase(request, event) { - try { - const { pollName, pollDescription, pollOptions } = request.payload; - const resCreatePoll = await _createPoll( - { - pollName, - pollDescription, - options: pollOptions, - }, - true, - true // skip permission - ); - - event.source.postMessage( - { - requestId: request.requestId, - action: "registerName", - payload: resCreatePoll, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "registerName", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } -} -export async function voteOnPollCase(request, event) { - try { - const res = await _voteOnPoll(request.payload, true, true); - - - event.source.postMessage( - { - requestId: request.requestId, - action: "registerName", - payload: res, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "registerName", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } -} - -export async function makeAdminCase(request, event) { - try { - const { groupId, qortalAddress } = request.payload; - const response = await makeAdmin({ groupId, qortalAddress }); - - event.source.postMessage( - { - requestId: request.requestId, - action: "makeAdmin", - payload: response, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "makeAdmin", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } -} - -export async function removeAdminCase(request, event) { - try { - const { groupId, qortalAddress } = request.payload; - const response = await removeAdmin({ groupId, qortalAddress }); - - event.source.postMessage( - { - requestId: request.requestId, - action: "removeAdmin", - payload: response, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "removeAdmin", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } -} - -export async function notificationCase(request, event) { - try { - const notificationId = "chat_notification_" + Date.now(); // Create a unique ID - - // chrome.notifications.create(notificationId, { - // type: "basic", - // iconUrl: "qort.png", // Add an appropriate icon for chat notifications - // title: "New Group Message!", - // message: "You have received a new message from one of your groups", - // priority: 2, // Use the maximum priority to ensure it's - // }); - // Set a timeout to clear the notification after 'timeout' milliseconds - // setTimeout(() => { - // chrome.notifications.clear(notificationId); - // }, 3000); - - // event.source.postMessage( - // { - // requestId: request.requestId, - // action: "notification", - // payload: true, - // type: "backgroundMessageResponse", - // }, - // event.origin - // ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "notification", - error: "Error displaying notifaction", - type: "backgroundMessageResponse", - }, - event.origin - ); - } -} - -export async function addTimestampEnterChatCase(request, event) { - try { - const { groupId, timestamp } = request.payload; - const response = await addTimestampEnterChat({ groupId, timestamp }); - - event.source.postMessage( - { - requestId: request.requestId, - action: "addTimestampEnterChat", - payload: response, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "addTimestampEnterChat", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } -} - -export async function setApiKeyCase(request, event) { - try { - const payload = request.payload; - storeData('apiKey', payload) - event.source.postMessage( - { - requestId: request.requestId, - action: "setApiKey", - payload: true, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "setApiKey", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } -} -export async function setCustomNodesCase(request, event) { - try { - const nodes = request.payload; - storeData('customNodes', nodes) - - event.source.postMessage( - { - requestId: request.requestId, - action: "setCustomNodes", - payload: true, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "setCustomNodes", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } -} - -export async function getApiKeyCase(request, event) { - try { - const response = await getApiKeyFromStorage(); - - event.source.postMessage( - { - requestId: request.requestId, - action: "getApiKey", - payload: response, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "getApiKey", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } -} - -export async function getCustomNodesFromStorageCase(request, event) { - try { - const response = await getCustomNodesFromStorage(); - - event.source.postMessage( - { - requestId: request.requestId, - action: "getCustomNodesFromStorage", - payload: response, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "getCustomNodesFromStorage", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } -} - -export async function notifyAdminRegenerateSecretKeyCase(request, event) { - try { - const { groupName, adminAddress } = request.payload; - const response = await notifyAdminRegenerateSecretKey({ - groupName, - adminAddress, - }); - - event.source.postMessage( - { - requestId: request.requestId, - action: "notifyAdminRegenerateSecretKey", - payload: response, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "notifyAdminRegenerateSecretKey", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } -} - -export async function addGroupNotificationTimestampCase(request, event) { - try { - const { groupId, timestamp } = request.payload; - const response = await addTimestampGroupAnnouncement({ - groupId, - timestamp, - seenTimestamp: true - }); - - event.source.postMessage( - { - requestId: request.requestId, - action: "addGroupNotificationTimestamp", - payload: response, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "addGroupNotificationTimestamp", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } -} -export async function addEnteredQmailTimestampCase(request, event) { - try { - const response = await addEnteredQmailTimestamp(); - - event.source.postMessage( - { - requestId: request.requestId, - action: "addEnteredQmailTimestamp", - payload: response, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "addEnteredQmailTimestamp", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } -} -export async function getEnteredQmailTimestampCase(request, event) { - try { - const response = await getEnteredQmailTimestamp(); - - event.source.postMessage( - { - requestId: request.requestId, - action: "getEnteredQmailTimestamp", - payload: {timestamp: response}, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "getEnteredQmailTimestamp", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } -} - -export async function clearAllNotificationsCase(request, event) { - try { - await clearAllNotifications(); - - event.source.postMessage( - { - requestId: request.requestId, - action: "clearAllNotifications", - payload: true, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "clearAllNotifications", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } -} - -export async function setGroupDataCase(request, event) { - try { - const { groupId, secretKeyData, secretKeyResource, admins } = - request.payload; - const response = await setGroupData({ - groupId, - secretKeyData, - secretKeyResource, - admins, - }); - - event.source.postMessage( - { - requestId: request.requestId, - action: "setGroupData", - payload: response, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "setGroupData", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } -} - -export async function getGroupDataSingleCase(request, event) { - try { - const { groupId } = request.payload; - const response = await getGroupDataSingle({ groupId }); - - event.source.postMessage( - { - requestId: request.requestId, - action: "getGroupDataSingle", - payload: response, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "getGroupDataSingle", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } -} - -export async function getTimestampEnterChatCase(request, event) { - try { - const response = await getTimestampEnterChat(); - - event.source.postMessage( - { - requestId: request.requestId, - action: "getTimestampEnterChat", - payload: response, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "getTimestampEnterChat", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } -} - -export async function listActionsCase(request, event) { - try { - const { type, listName = '', items = [] } = request.payload; - let responseData - - if(type === 'get'){ - const url = await createEndpoint(`/lists/${listName}`); - const response = await fetch(url); - if (!response.ok) throw new Error("Failed to fetch"); - - responseData = await response.json(); - } else if(type === 'remove'){ - const url = await createEndpoint(`/lists/${listName}`); - const body = { - items: items , - }; - const bodyToString = JSON.stringify(body); - const response = await fetch(url, { - method: "DELETE", - headers: { - "Content-Type": "application/json", - }, - body: bodyToString, - }); - - if (!response.ok) throw new Error("Failed to remove from list"); - let res; - try { - res = await response.clone().json(); - } catch (e) { - res = await response.text(); - } - responseData = res; - } else if(type === 'add'){ - const url = await createEndpoint(`/lists/${listName}`); - const body = { - items: items , - }; - const bodyToString = JSON.stringify(body); - const response = await fetch(url, { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: bodyToString, - }); - - if (!response.ok) throw new Error("Failed to add to list"); - let res; - try { - res = await response.clone().json(); - } catch (e) { - res = await response.text(); - } - responseData = res; - } - - event.source.postMessage( - { - requestId: request.requestId, - action: "listActions", - payload: responseData, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "listActions", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } -} - -export async function getTimestampMentionCase(request, event) { - try { - const response = await getTimestampMention(); - - event.source.postMessage( - { - requestId: request.requestId, - action: "getTimestampMention", - payload: response, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "getTimestampMention", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } -} - -export async function addTimestampMentionCase(request, event) { - try { - const { groupId, timestamp } = request.payload; - const response = await addTimestampMention({ groupId, timestamp }); - - event.source.postMessage( - { - requestId: request.requestId, - action: "addTimestampMention", - payload: response, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "addTimestampMention", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } -} - -export async function getGroupNotificationTimestampCase(request, event) { - try { - const response = await getTimestampGroupAnnouncement(); - - event.source.postMessage( - { - requestId: request.requestId, - action: "getGroupNotificationTimestamp", - payload: response, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "getGroupNotificationTimestamp", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } -} - -export async function encryptAndPublishSymmetricKeyGroupChatCase( - request, - event -) { - try { - const { groupId, previousData, previousNumber } = request.payload; - const { data, numberOfMembers } = - await encryptAndPublishSymmetricKeyGroupChat({ - groupId, - previousData, - previousNumber, - }); - - event.source.postMessage( - { - requestId: request.requestId, - action: "encryptAndPublishSymmetricKeyGroupChat", - payload: data, - type: "backgroundMessageResponse", - }, - event.origin - ); - if (!previousData) { - try { - sendChatGroup({ - groupId, - typeMessage: undefined, - chatReference: undefined, - messageText: PUBLIC_NOTIFICATION_CODE_FIRST_SECRET_KEY, - }); - } catch (error) { - // error in sending chat message - } - } - try { - sendChatNotification(data, groupId, previousData, numberOfMembers); - } catch (error) { - // error in sending notification - } - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "encryptAndPublishSymmetricKeyGroupChat", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } -} - -export async function encryptAndPublishSymmetricKeyGroupChatForAdminsCase( - request, - event -) { - try { - const { groupId, previousData, admins } = request.payload; - const { data, numberOfMembers } = - await encryptAndPublishSymmetricKeyGroupChatForAdmins({ - groupId, - previousData, - admins - }); - - event.source.postMessage( - { - requestId: request.requestId, - action: "encryptAndPublishSymmetricKeyGroupChatForAdmins", - payload: data, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "encryptAndPublishSymmetricKeyGroupChat", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } -} - -export async function publishGroupEncryptedResourceCase(request, event) { - try { - const {encryptedData, identifier} = request.payload; - const response = await publishGroupEncryptedResource({encryptedData, identifier}); - - event.source.postMessage( - { - requestId: request.requestId, - action: "publishGroupEncryptedResource", - payload: response, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "publishGroupEncryptedResource", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } - } - - export async function publishOnQDNCase(request, event) { - try { - const {data, identifier, service, title, - description, - category, - tag1, - tag2, - tag3, - tag4, - tag5, uploadType} = request.payload; - const response = await publishOnQDN({data, identifier, service, title, - description, - category, - tag1, - tag2, - tag3, - tag4, - tag5, uploadType}); - - event.source.postMessage( - { - requestId: request.requestId, - action: "publishOnQDN", - payload: response, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "publishOnQDN", - error: error?.message || 'Unable to publish', - type: "backgroundMessageResponse", - }, - event.origin - ); - } - } - - export async function handleActiveGroupDataFromSocketCase(request, event) { - try { - const {groups, directs} = request.payload; - const response = await handleActiveGroupDataFromSocket({groups, directs}); - - event.source.postMessage( - { - requestId: request.requestId, - action: "handleActiveGroupDataFromSocket", - payload: true, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "handleActiveGroupDataFromSocket", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } - } - - export async function getThreadActivityCase(request, event) { - try { - const response = await checkThreads(true) - - event.source.postMessage( - { - requestId: request.requestId, - action: "getThreadActivity", - payload: response, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "getThreadActivity", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } - } - - export async function updateThreadActivityCase(request, event) { - try { - const { threadId, qortalName, groupId, thread} = request.payload; - const response = await updateThreadActivity({ threadId, qortalName, groupId, thread }); - - event.source.postMessage( - { - requestId: request.requestId, - action: "updateThreadActivity", - payload: response, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "updateThreadActivity", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } - } - - export async function decryptGroupEncryptionCase(request, event) { - try { - const { data} = request.payload; - const response = await decryptGroupEncryption({ data }); - event.source.postMessage( - { - requestId: request.requestId, - action: "decryptGroupEncryption", - payload: response, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "decryptGroupEncryption", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } - } - - export async function encryptSingleCase(request, event) { - try { - const { data, secretKeyObject, typeNumber} = request.payload; - const response = await encryptSingle({ data64: data, secretKeyObject, typeNumber }); - - event.source.postMessage( - { - requestId: request.requestId, - action: "encryptSingle", - payload: response, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "encryptSingle", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } - } - - export async function decryptSingleCase(request, event) { - try { - const { data, secretKeyObject, skipDecodeBase64} = request.payload; - const response = await decryptSingleFunc({ messages: data, secretKeyObject, skipDecodeBase64 }); - event.source.postMessage( - { - requestId: request.requestId, - action: "decryptSingle", - payload: response, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "decryptSingle", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } - } - - export async function pauseAllQueuesCase(request, event) { - try { - await pauseAllQueues(); - - event.source.postMessage( - { - requestId: request.requestId, - action: "pauseAllQueues", - payload: true, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "pauseAllQueues", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } - } - - export async function resumeAllQueuesCase(request, event) { - try { - await resumeAllQueues(); - - event.source.postMessage( - { - requestId: request.requestId, - action: "resumeAllQueues", - payload: true, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "resumeAllQueues", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } - } - export async function checkLocalCase(request, event) { - try { - const response = await checkLocalFunc() - event.source.postMessage( - { - requestId: request.requestId, - action: "pauseAllQueues", - payload: response, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "checkLocal", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } - } - - export async function decryptSingleForPublishesCase(request, event) { - try { - const { data, secretKeyObject, skipDecodeBase64} = request.payload; - const response = await decryptSingleForPublishes({ messages: data, secretKeyObject, skipDecodeBase64 }); - - event.source.postMessage( - { - requestId: request.requestId, - action: "decryptSingleForPublishes", - payload: response, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "decryptSingle", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } - } - - export async function decryptDirectCase(request, event) { - try { - const { data, involvingAddress} = request.payload; - const response = await decryptDirectFunc({ messages: data, involvingAddress }); - - event.source.postMessage( - { - requestId: request.requestId, - action: "decryptDirect", - payload: response, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "decryptDirect", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } - } - export async function sendChatGroupCase(request, event) { - try { - const { groupId, - typeMessage = undefined, - chatReference = undefined, - messageText} = request.payload; - const response = await sendChatGroup({ groupId, typeMessage, chatReference, messageText }); - - event.source.postMessage( - { - requestId: request.requestId, - action: "sendChatGroup", - payload: response, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "sendChatGroup", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } - } - export async function sendChatDirectCase(request, event) { - try { - const { directTo, - typeMessage = undefined, - chatReference = undefined, - messageText, - publicKeyOfRecipient, - address, - otherData} = request.payload; - const response = await sendChatDirect({ directTo, - chatReference, - messageText, - typeMessage, - publicKeyOfRecipient, - address, - otherData }); - - event.source.postMessage( - { - requestId: request.requestId, - action: "sendChatDirect", - payload: response, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "sendChatDirect", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } - } - - export async function setupGroupWebsocketCase(request, event) { - try { - - checkNewMessages(); - checkThreads(); - event.source.postMessage( - { - requestId: request.requestId, - action: "sendChatDirect", - payload: true, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "sendChatDirect", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } - } - - export async function createRewardShareCase(request, event) { - try { - const {recipientPublicKey} = request.payload; - const resKeyPair = await getKeyPair(); - const parsedData = resKeyPair; - const uint8PrivateKey = Base58.decode(parsedData.privateKey); - const uint8PublicKey = Base58.decode(parsedData.publicKey); - const keyPair = { - privateKey: uint8PrivateKey, - publicKey: uint8PublicKey, - }; - let lastRef = await getLastRef(); - - const tx = await createTransaction(38, keyPair, { - recipientPublicKey, - percentageShare: 0, - lastReference: lastRef, - }); - - const signedBytes = Base58.encode(tx.signedBytes); - - const res = await processTransactionVersion2(signedBytes); - if (!res?.signature) - throw new Error("Transaction was not able to be processed"); - event.source.postMessage( - { - requestId: request.requestId, - action: "createRewardShare", - payload: res, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "createRewardShare", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } - } - - export async function removeRewardShareCase(request, event) { - try { - const {rewardShareKeyPairPublicKey, recipient, percentageShare} = request.payload; - const resKeyPair = await getKeyPair(); - const parsedData = resKeyPair; - const uint8PrivateKey = Base58.decode(parsedData.privateKey); - const uint8PublicKey = Base58.decode(parsedData.publicKey); - const keyPair = { - privateKey: uint8PrivateKey, - publicKey: uint8PublicKey, - }; - let lastRef = await getLastRef(); - - const tx = await createTransaction(381, keyPair, { - rewardShareKeyPairPublicKey, - recipient, - percentageShare, - lastReference: lastRef, - }); - - const signedBytes = Base58.encode(tx.signedBytes); - - const res = await processTransactionVersion2(signedBytes); - if (!res?.signature) - throw new Error("Transaction was not able to be processed"); - event.source.postMessage( - { - requestId: request.requestId, - action: "removeRewardShare", - payload: res, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "removeRewardShare", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } - } - - export async function getRewardSharePrivateKeyCase(request, event) { - try { - const {recipientPublicKey} = request.payload; - const resKeyPair = await getKeyPair(); - const parsedData = resKeyPair; - const uint8PrivateKey = Base58.decode(parsedData.privateKey); - const uint8PublicKey = Base58.decode(parsedData.publicKey); - const keyPair = { - privateKey: uint8PrivateKey, - publicKey: uint8PublicKey, - }; - let lastRef = await getLastRef(); - - const tx = await createTransaction(38, keyPair, { - recipientPublicKey, - percentageShare: 0, - lastReference: lastRef, - }); - - event.source.postMessage( - { - requestId: request.requestId, - action: "getRewardSharePrivateKey", - payload: tx?._base58RewardShareSeed, - type: "backgroundMessageResponse", - }, - event.origin - ); - } catch (error) { - event.source.postMessage( - { - requestId: request.requestId, - action: "getRewardSharePrivateKey", - error: error?.message, - type: "backgroundMessageResponse", - }, - event.origin - ); - } - } - - \ No newline at end of file diff --git a/src/background/background-cases.ts b/src/background/background-cases.ts new file mode 100644 index 0000000..04777fb --- /dev/null +++ b/src/background/background-cases.ts @@ -0,0 +1,2137 @@ +import { + addDataPublishes, + addEnteredQmailTimestamp, + addTimestampEnterChat, + addTimestampGroupAnnouncement, + addTimestampMention, + addUserSettings, + banFromGroup, + cancelBan, + cancelInvitationToGroup, + checkLocalFunc, + checkNewMessages, + checkThreads, + createEndpoint, + createGroup, + decryptDirectFunc, + decryptSingleForPublishes, + decryptSingleFunc, + decryptWallet, + findUsableApi, + getApiKeyFromStorage, + getBalanceInfo, + getCustomNodesFromStorage, + getDataPublishes, + getEnteredQmailTimestamp, + getGroupDataSingle, + getKeyPair, + getLTCBalance, + getLastRef, + getNameInfo, + getTempPublish, + getTimestampEnterChat, + getTimestampGroupAnnouncement, + getTimestampMention, + getUserInfo, + getUserSettings, + handleActiveGroupDataFromSocket, + inviteToGroup, + joinGroup, + kickFromGroup, + leaveGroup, + makeAdmin, + notifyAdminRegenerateSecretKey, + pauseAllQueues, + processTransactionVersion2, + registerName, + removeAdmin, + resumeAllQueues, + saveTempPublish, + sendChatDirect, + sendChatGroup, + sendChatNotification, + sendCoin, + setGroupData, + updateThreadActivity, + walletVersion, +} from '../background/background.ts'; +import { + decryptGroupEncryption, + encryptAndPublishSymmetricKeyGroupChat, + encryptAndPublishSymmetricKeyGroupChatForAdmins, + publishGroupEncryptedResource, + publishOnQDN, +} from '../encryption/encryption.ts'; +import { PUBLIC_NOTIFICATION_CODE_FIRST_SECRET_KEY } from '../constants/constants'; +import Base58 from '../encryption/Base58.ts'; +import { encryptSingle } from '../qdn/encryption/group-encryption'; +import { _createPoll, _voteOnPoll } from '../qortal/get.ts'; +import { createTransaction } from '../transactions/transactions'; +import { getData, storeData } from '../utils/chromeStorage'; + +export function versionCase(request, event) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'version', + payload: { version: '1.0' }, + type: 'backgroundMessageResponse', + }, + event.origin + ); +} + +export async function getWalletInfoCase(request, event) { + try { + const response = await getKeyPair(); + + try { + const walletInfo = await getData('walletInfo').catch((error) => null); + + if (walletInfo) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'getWalletInfo', + payload: { walletInfo, hasKeyPair: true }, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } else { + event.source.postMessage( + { + requestId: request.requestId, + action: 'getWalletInfo', + error: 'No wallet info found', // TODO translate + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'getWalletInfo', + error: 'No wallet info found', + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + } catch (error) { + try { + const walletInfo = await getData('walletInfo').catch((error) => null); + + if (walletInfo) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'getWalletInfo', + payload: { walletInfo, hasKeyPair: false }, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } else { + event.source.postMessage( + { + requestId: request.requestId, + action: 'getWalletInfo', + error: 'Wallet not authenticated', + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'getWalletInfo', + error: 'Wallet not authenticated', + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + } +} + +export async function validApiCase(request, event) { + try { + const usableApi = await findUsableApi(); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'validApi', + payload: usableApi, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'validApi', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function nameCase(request, event) { + try { + const response = await getNameInfo(); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'name', + payload: response, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'name', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function userInfoCase(request, event) { + try { + const response = await getUserInfo(); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'userInfo', + payload: response, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'userInfo', + error: 'User not authenticated', + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function decryptWalletCase(request, event) { + try { + const { password, wallet } = request.payload; + const response = await decryptWallet({ + password, + wallet, + walletVersion: wallet?.version || walletVersion, + }); + event.source.postMessage( + { + requestId: request.requestId, + action: 'decryptWallet', + payload: response, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'decryptWallet', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function balanceCase(request, event) { + try { + const response = await getBalanceInfo(); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'balance', + payload: response, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'balance', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} +export async function ltcBalanceCase(request, event) { + try { + const response = await getLTCBalance(); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'ltcBalance', + payload: response, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'ltcBalance', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function sendCoinCase(request, event) { + try { + const { receiver, password, amount } = request.payload; + const { res } = await sendCoin({ receiver, password, amount }); + if (!res?.success) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'sendCoin', + error: res?.data?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + return; + } + event.source.postMessage( + { + requestId: request.requestId, + action: 'sendCoin', + payload: true, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'sendCoin', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function inviteToGroupCase(request, event) { + try { + const { + groupId, + qortalAddress, + inviteTime, + txGroupId = 0, + } = request.payload; + const response = await inviteToGroup({ + groupId, + qortalAddress, + inviteTime, + txGroupId, + }); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'inviteToGroup', + payload: response, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'inviteToGroup', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function saveTempPublishCase(request, event) { + try { + const { data, key } = request.payload; + const response = await saveTempPublish({ data, key }); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'saveTempPublish', + payload: response, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'saveTempPublish', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function getTempPublishCase(request, event) { + try { + const response = await getTempPublish(); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'getTempPublish', + payload: response, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'getTempPublish', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function createGroupCase(request, event) { + try { + const { + groupName, + groupDescription, + groupType, + groupApprovalThreshold, + minBlock, + maxBlock, + } = request.payload; + const response = await createGroup({ + groupName, + groupDescription, + groupType, + groupApprovalThreshold, + minBlock, + maxBlock, + }); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'createGroup', + payload: response, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'createGroup', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function cancelInvitationToGroupCase(request, event) { + try { + const { groupId, qortalAddress, txGroupId = 0 } = request.payload; + const response = await cancelInvitationToGroup({ + groupId, + qortalAddress, + txGroupId, + }); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'cancelInvitationToGroup', + payload: response, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'cancelInvitationToGroup', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function leaveGroupCase(request, event) { + try { + const { groupId } = request.payload; + const response = await leaveGroup({ groupId }); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'leaveGroup', + payload: response, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'leaveGroup', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function joinGroupCase(request, event) { + try { + const { groupId } = request.payload; + const response = await joinGroup({ groupId }); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'joinGroup', + payload: response, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'joinGroup', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function kickFromGroupCase(request, event) { + try { + const { + groupId, + qortalAddress, + rBanReason, + txGroupId = 0, + } = request.payload; + const response = await kickFromGroup({ + groupId, + qortalAddress, + rBanReason, + txGroupId, + }); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'kickFromGroup', + payload: response, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'kickFromGroup', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function banFromGroupCase(request, event) { + try { + const { + groupId, + qortalAddress, + rBanReason, + rBanTime, + txGroupId = 0, + } = request.payload; + const response = await banFromGroup({ + groupId, + qortalAddress, + rBanReason, + rBanTime, + txGroupId, + }); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'banFromGroup', + payload: response, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'banFromGroup', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function addDataPublishesCase(request, event) { + try { + const { data, groupId, type } = request.payload; + const response = await addDataPublishes(data, groupId, type); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'addDataPublishes', + payload: response, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'addDataPublishes', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function getDataPublishesCase(request, event) { + try { + const { groupId, type } = request.payload; + const response = await getDataPublishes(groupId, type); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'getDataPublishes', + payload: response, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'getDataPublishes', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} +export async function addUserSettingsCase(request, event) { + try { + const { keyValue } = request.payload; + const response = await addUserSettings({ keyValue }); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'addUserSettings', + payload: response, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'addUserSettings', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function getUserSettingsCase(request, event) { + try { + const { key } = request.payload; + const response = await getUserSettings({ key }); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'getUserSettings', + payload: response, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'getUserSettings', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function cancelBanCase(request, event) { + try { + const { groupId, qortalAddress, txGroupId = 0 } = request.payload; + const response = await cancelBan({ groupId, qortalAddress, txGroupId }); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'cancelBan', + payload: response, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'cancelBan', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function registerNameCase(request, event) { + try { + const { name } = request.payload; + const response = await registerName({ name }); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'registerName', + payload: response, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'registerName', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} +export async function createPollCase(request, event) { + try { + const { pollName, pollDescription, pollOptions } = request.payload; + const resCreatePoll = await _createPoll( + { + pollName, + pollDescription, + options: pollOptions, + }, + true, + true // skip permission + ); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'registerName', + payload: resCreatePoll, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'registerName', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} +export async function voteOnPollCase(request, event) { + try { + const res = await _voteOnPoll(request.payload, true, true); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'registerName', + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'registerName', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function makeAdminCase(request, event) { + try { + const { groupId, qortalAddress, txGroupId = 0 } = request.payload; + const response = await makeAdmin({ groupId, qortalAddress, txGroupId }); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'makeAdmin', + payload: response, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'makeAdmin', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function removeAdminCase(request, event) { + try { + const { groupId, qortalAddress, txGroupId = 0 } = request.payload; + const response = await removeAdmin({ groupId, qortalAddress, txGroupId }); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'removeAdmin', + payload: response, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'removeAdmin', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function addTimestampEnterChatCase(request, event) { + try { + const { groupId, timestamp } = request.payload; + const response = await addTimestampEnterChat({ groupId, timestamp }); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'addTimestampEnterChat', + payload: response, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'addTimestampEnterChat', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function setApiKeyCase(request, event) { + try { + const payload = request.payload; + storeData('apiKey', payload); + event.source.postMessage( + { + requestId: request.requestId, + action: 'setApiKey', + payload: true, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'setApiKey', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} +export async function setCustomNodesCase(request, event) { + try { + const nodes = request.payload; + storeData('customNodes', nodes); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'setCustomNodes', + payload: true, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'setCustomNodes', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function getApiKeyCase(request, event) { + try { + const response = await getApiKeyFromStorage(); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'getApiKey', + payload: response, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'getApiKey', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function getCustomNodesFromStorageCase(request, event) { + try { + const response = await getCustomNodesFromStorage(); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'getCustomNodesFromStorage', + payload: response, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'getCustomNodesFromStorage', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function notifyAdminRegenerateSecretKeyCase(request, event) { + try { + const { groupName, adminAddress } = request.payload; + const response = await notifyAdminRegenerateSecretKey({ + groupName, + adminAddress, + }); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'notifyAdminRegenerateSecretKey', + payload: response, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'notifyAdminRegenerateSecretKey', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function addGroupNotificationTimestampCase(request, event) { + try { + const { groupId, timestamp } = request.payload; + const response = await addTimestampGroupAnnouncement({ + groupId, + timestamp, + seenTimestamp: true, + }); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'addGroupNotificationTimestamp', + payload: response, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'addGroupNotificationTimestamp', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} +export async function addEnteredQmailTimestampCase(request, event) { + try { + const response = await addEnteredQmailTimestamp(); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'addEnteredQmailTimestamp', + payload: response, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'addEnteredQmailTimestamp', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} +export async function getEnteredQmailTimestampCase(request, event) { + try { + const response = await getEnteredQmailTimestamp(); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'getEnteredQmailTimestamp', + payload: { timestamp: response }, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'getEnteredQmailTimestamp', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function setGroupDataCase(request, event) { + try { + const { groupId, secretKeyData, secretKeyResource, admins } = + request.payload; + const response = await setGroupData({ + groupId, + secretKeyData, + secretKeyResource, + admins, + }); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'setGroupData', + payload: response, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'setGroupData', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function getGroupDataSingleCase(request, event) { + try { + const { groupId } = request.payload; + const response = await getGroupDataSingle({ groupId }); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'getGroupDataSingle', + payload: response, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'getGroupDataSingle', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function getTimestampEnterChatCase(request, event) { + try { + const response = await getTimestampEnterChat(); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'getTimestampEnterChat', + payload: response, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'getTimestampEnterChat', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function listActionsCase(request, event) { + try { + const { type, listName = '', items = [] } = request.payload; + let responseData; + + if (type === 'get') { + const url = await createEndpoint(`/lists/${listName}`); + const response = await fetch(url); + if (!response.ok) throw new Error('Failed to fetch'); + + responseData = await response.json(); + } else if (type === 'remove') { + const url = await createEndpoint(`/lists/${listName}`); + const body = { + items: items, + }; + const bodyToString = JSON.stringify(body); + const response = await fetch(url, { + method: 'DELETE', + headers: { + 'Content-Type': 'application/json', + }, + body: bodyToString, + }); + + if (!response.ok) throw new Error('Failed to remove from list'); + let res; + try { + res = await response.clone().json(); + } catch (e) { + res = await response.text(); + } + responseData = res; + } else if (type === 'add') { + const url = await createEndpoint(`/lists/${listName}`); + const body = { + items: items, + }; + const bodyToString = JSON.stringify(body); + const response = await fetch(url, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: bodyToString, + }); + + if (!response.ok) throw new Error('Failed to add to list'); + let res; + try { + res = await response.clone().json(); + } catch (e) { + res = await response.text(); + } + responseData = res; + } + + event.source.postMessage( + { + requestId: request.requestId, + action: 'listActions', + payload: responseData, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'listActions', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function getTimestampMentionCase(request, event) { + try { + const response = await getTimestampMention(); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'getTimestampMention', + payload: response, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'getTimestampMention', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function addTimestampMentionCase(request, event) { + try { + const { groupId, timestamp } = request.payload; + const response = await addTimestampMention({ groupId, timestamp }); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'addTimestampMention', + payload: response, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'addTimestampMention', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function getGroupNotificationTimestampCase(request, event) { + try { + const response = await getTimestampGroupAnnouncement(); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'getGroupNotificationTimestamp', + payload: response, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'getGroupNotificationTimestamp', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function encryptAndPublishSymmetricKeyGroupChatCase( + request, + event +) { + try { + const { groupId, previousData, previousNumber } = request.payload; + const { data, numberOfMembers } = + await encryptAndPublishSymmetricKeyGroupChat({ + groupId, + previousData, + previousNumber, + }); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'encryptAndPublishSymmetricKeyGroupChat', + payload: data, + type: 'backgroundMessageResponse', + }, + event.origin + ); + if (!previousData) { + try { + sendChatGroup({ + groupId, + typeMessage: undefined, + chatReference: undefined, + messageText: PUBLIC_NOTIFICATION_CODE_FIRST_SECRET_KEY, + }); + } catch (error) { + // error in sending chat message + } + } + try { + sendChatNotification(data, groupId, previousData, numberOfMembers); + } catch (error) { + // error in sending notification + } + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'encryptAndPublishSymmetricKeyGroupChat', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function encryptAndPublishSymmetricKeyGroupChatForAdminsCase( + request, + event +) { + try { + const { groupId, previousData, admins } = request.payload; + const { data, numberOfMembers } = + await encryptAndPublishSymmetricKeyGroupChatForAdmins({ + groupId, + previousData, + admins, + }); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'encryptAndPublishSymmetricKeyGroupChatForAdmins', + payload: data, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'encryptAndPublishSymmetricKeyGroupChat', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function publishGroupEncryptedResourceCase(request, event) { + try { + const { encryptedData, identifier } = request.payload; + const response = await publishGroupEncryptedResource({ + encryptedData, + identifier, + }); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'publishGroupEncryptedResource', + payload: response, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'publishGroupEncryptedResource', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function publishOnQDNCase(request, event) { + try { + const { + data, + name = '', + identifier, + service, + title, + description, + category, + tag1, + tag2, + tag3, + tag4, + tag5, + uploadType, + } = request.payload; + + const response = await publishOnQDN({ + data, + name, + identifier, + service, + title, + description, + category, + tag1, + tag2, + tag3, + tag4, + tag5, + uploadType, + }); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'publishOnQDN', + payload: response, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'publishOnQDN', + error: error?.message || 'Unable to publish', + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function handleActiveGroupDataFromSocketCase(request, event) { + try { + const { groups, directs } = request.payload; + const response = await handleActiveGroupDataFromSocket({ groups, directs }); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'handleActiveGroupDataFromSocket', + payload: true, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'handleActiveGroupDataFromSocket', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function getThreadActivityCase(request, event) { + try { + const response = await checkThreads(true); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'getThreadActivity', + payload: response, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'getThreadActivity', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function updateThreadActivityCase(request, event) { + try { + const { threadId, qortalName, groupId, thread } = request.payload; + const response = await updateThreadActivity({ + threadId, + qortalName, + groupId, + thread, + }); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'updateThreadActivity', + payload: response, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'updateThreadActivity', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function decryptGroupEncryptionCase(request, event) { + try { + const { data } = request.payload; + const response = await decryptGroupEncryption({ data }); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'decryptGroupEncryption', + payload: response, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'decryptGroupEncryption', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function encryptSingleCase(request, event) { + try { + const { data, secretKeyObject, typeNumber } = request.payload; + const response = await encryptSingle({ + data64: data, + secretKeyObject, + typeNumber, + }); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'encryptSingle', + payload: response, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'encryptSingle', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function decryptSingleCase(request, event) { + try { + const { data, secretKeyObject, skipDecodeBase64 } = request.payload; + + const response = await decryptSingleFunc({ + messages: data, + secretKeyObject, + skipDecodeBase64, + }); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'decryptSingle', + payload: response, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'decryptSingle', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function pauseAllQueuesCase(request, event) { + try { + await pauseAllQueues(); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'pauseAllQueues', + payload: true, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'pauseAllQueues', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function resumeAllQueuesCase(request, event) { + try { + await resumeAllQueues(); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'resumeAllQueues', + payload: true, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'resumeAllQueues', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function checkLocalCase(request, event) { + try { + const response = await checkLocalFunc(); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'pauseAllQueues', + payload: response, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'checkLocal', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function decryptSingleForPublishesCase(request, event) { + try { + const { data, secretKeyObject, skipDecodeBase64 } = request.payload; + const response = await decryptSingleForPublishes({ + messages: data, + secretKeyObject, + skipDecodeBase64, + }); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'decryptSingleForPublishes', + payload: response, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'decryptSingle', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function decryptDirectCase(request, event) { + try { + const { data, involvingAddress } = request.payload; + const response = await decryptDirectFunc({ + messages: data, + involvingAddress, + }); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'decryptDirect', + payload: response, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'decryptDirect', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function sendChatGroupCase(request, event) { + try { + const { + groupId, + typeMessage = undefined, + chatReference = undefined, + messageText, + } = request.payload; + const response = await sendChatGroup({ + groupId, + typeMessage, + chatReference, + messageText, + }); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'sendChatGroup', + payload: response, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'sendChatGroup', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function sendChatDirectCase(request, event) { + try { + const { + directTo, + typeMessage = undefined, + chatReference = undefined, + messageText, + publicKeyOfRecipient, + address, + otherData, + } = request.payload; + const response = await sendChatDirect({ + directTo, + chatReference, + messageText, + typeMessage, + publicKeyOfRecipient, + address, + otherData, + }); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'sendChatDirect', + payload: response, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'sendChatDirect', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function setupGroupWebsocketCase(request, event) { + try { + checkNewMessages(); + checkThreads(); + event.source.postMessage( + { + requestId: request.requestId, + action: 'sendChatDirect', + payload: true, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'sendChatDirect', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function createRewardShareCase(request, event) { + try { + const { recipientPublicKey } = request.payload; + const resKeyPair = await getKeyPair(); + const parsedData = resKeyPair; + const uint8PrivateKey = Base58.decode(parsedData.privateKey); + const uint8PublicKey = Base58.decode(parsedData.publicKey); + const keyPair = { + privateKey: uint8PrivateKey, + publicKey: uint8PublicKey, + }; + let lastRef = await getLastRef(); + + const tx = await createTransaction(38, keyPair, { + recipientPublicKey, + percentageShare: 0, + lastReference: lastRef, + }); + + const signedBytes = Base58.encode(tx.signedBytes); + + const res = await processTransactionVersion2(signedBytes); + if (!res?.signature) + throw new Error('Transaction was not able to be processed'); + event.source.postMessage( + { + requestId: request.requestId, + action: 'createRewardShare', + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'createRewardShare', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function removeRewardShareCase(request, event) { + try { + const { rewardShareKeyPairPublicKey, recipient, percentageShare } = + request.payload; + const resKeyPair = await getKeyPair(); + const parsedData = resKeyPair; + const uint8PrivateKey = Base58.decode(parsedData.privateKey); + const uint8PublicKey = Base58.decode(parsedData.publicKey); + const keyPair = { + privateKey: uint8PrivateKey, + publicKey: uint8PublicKey, + }; + let lastRef = await getLastRef(); + + const tx = await createTransaction(381, keyPair, { + rewardShareKeyPairPublicKey, + recipient, + percentageShare, + lastReference: lastRef, + }); + + const signedBytes = Base58.encode(tx.signedBytes); + const res = await processTransactionVersion2(signedBytes); + + if (!res?.signature) + throw new Error('Transaction was not able to be processed'); + event.source.postMessage( + { + requestId: request.requestId, + action: 'removeRewardShare', + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'removeRewardShare', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} + +export async function getRewardSharePrivateKeyCase(request, event) { + try { + const { recipientPublicKey } = request.payload; + const resKeyPair = await getKeyPair(); + const parsedData = resKeyPair; + const uint8PrivateKey = Base58.decode(parsedData.privateKey); + const uint8PublicKey = Base58.decode(parsedData.publicKey); + const keyPair = { + privateKey: uint8PrivateKey, + publicKey: uint8PublicKey, + }; + let lastRef = await getLastRef(); + + const tx = await createTransaction(38, keyPair, { + recipientPublicKey, + percentageShare: 0, + lastReference: lastRef, + }); + + event.source.postMessage( + { + requestId: request.requestId, + action: 'getRewardSharePrivateKey', + payload: tx?._base58RewardShareSeed, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: 'getRewardSharePrivateKey', + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } +} diff --git a/src/background.ts b/src/background/background.ts similarity index 72% rename from src/background.ts rename to src/background/background.ts index eab57c7..cd8a8f8 100644 --- a/src/background.ts +++ b/src/background/background.ts @@ -1,37 +1,27 @@ // @ts-nocheck - -import "./qortalRequests"; -import { isArray } from "lodash"; -import { - decryptGroupEncryption, - encryptAndPublishSymmetricKeyGroupChat, - publishGroupEncryptedResource, - publishOnQDN, - uint8ArrayToObject, -} from "./backgroundFunctions/encryption"; -import { PUBLIC_NOTIFICATION_CODE_FIRST_SECRET_KEY } from "./constants/codes"; -import Base58 from "./deps/Base58"; -import axios from 'axios' +import '../qortal/qortal-requests.ts'; +import { isArray } from 'lodash'; +import { uint8ArrayToObject } from '../encryption/encryption.ts'; +import Base58 from '../encryption/Base58'; +import axios from 'axios'; import { base64ToUint8Array, decryptSingle, - encryptDataGroup, encryptSingle, objectToBase64, -} from "./qdn/encryption/group-encryption"; -import ChatComputePowWorker from './chatComputePow.worker.js?worker'; -import { reusableGet } from "./qdn/publish/pubish"; -import { signChat } from "./transactions/signChat"; -import { createTransaction } from "./transactions/transactions"; -import { decryptChatMessage } from "./utils/decryptChatMessage"; -import { decryptStoredWallet } from "./utils/decryptWallet"; -import PhraseWallet from "./utils/generateWallet/phrase-wallet"; -import { RequestQueueWithPromise } from "./utils/queue/queue"; -import { validateAddress } from "./utils/validateAddress"; -import { Sha256 } from "asmcrypto.js"; -import { TradeBotRespondMultipleRequest } from "./transactions/TradeBotRespondMultipleRequest"; - -import { RESOURCE_TYPE_NUMBER_GROUP_CHAT_REACTIONS } from "./constants/resourceTypes"; +} from '../qdn/encryption/group-encryption'; +import ChatComputePowWorker from '../chatComputePow.worker.js?worker'; +import { reusableGet } from '../qdn/publish/publish.ts'; +import { signChat } from '../transactions/signChat'; +import { createTransaction } from '../transactions/transactions'; +import { decryptChatMessage } from '../utils/decryptChatMessage'; +import { decryptStoredWallet } from '../utils/decryptWallet'; +import PhraseWallet from '../utils/generateWallet/phrase-wallet'; +import { RequestQueueWithPromise } from '../utils/queue/queue'; +import { validateAddress } from '../utils/validateAddress'; +import { Sha256 } from 'asmcrypto.js'; +import { TradeBotRespondMultipleRequest } from '../transactions/TradeBotRespondMultipleRequest'; +import { RESOURCE_TYPE_NUMBER_GROUP_CHAT_REACTIONS } from '../constants/constants'; import { addDataPublishesCase, addEnteredQmailTimestampCase, @@ -44,7 +34,6 @@ import { cancelBanCase, cancelInvitationToGroupCase, checkLocalCase, - clearAllNotificationsCase, createGroupCase, createPollCase, createRewardShareCase, @@ -78,7 +67,6 @@ import { ltcBalanceCase, makeAdminCase, nameCase, - notificationCase, notifyAdminRegenerateSecretKeyCase, pauseAllQueuesCase, publishGroupEncryptedResourceCase, @@ -92,7 +80,6 @@ import { sendChatGroupCase, sendCoinCase, setApiKeyCase, - setChatHeadsCase, setCustomNodesCase, setGroupDataCase, setupGroupWebsocketCase, @@ -101,47 +88,52 @@ import { validApiCase, versionCase, voteOnPollCase, -} from "./background-cases"; -import { getData, removeKeysAndLogout, storeData } from "./utils/chromeStorage"; -import TradeBotRespondRequest from "./transactions/TradeBotRespondRequest"; -// import {BackgroundFetch} from '@transistorsoft/capacitor-background-fetch'; +} from '../background/background-cases'; +import { + getData, + removeKeysAndLogout, + storeData, +} from '../utils/chromeStorage'; +import TradeBotRespondRequest from '../transactions/TradeBotRespondRequest'; -export let groupSecretkeys = {} +export let groupSecretkeys = {}; export function cleanUrl(url) { - return url?.replace(/^(https?:\/\/)?(www\.)?/, ""); + return url?.replace(/^(https?:\/\/)?(www\.)?/, ''); } + export function getProtocol(url) { - if (url?.startsWith("https://")) { - return "https"; - } else if (url?.startsWith("http://")) { - return "http"; + if (url?.startsWith('https://')) { + return 'https'; + } else if (url?.startsWith('http://')) { + return 'http'; } else { - return "unknown"; // If neither protocol is present + return 'unknown'; // If neither protocol is present } } -export const gateways = ['ext-node.qortal.link'] - +export const gateways = ['ext-node.qortal.link']; let lastGroupNotification; -export const groupApi = "https://ext-node.qortal.link"; -export const groupApiSocket = "wss://ext-node.qortal.link"; -export const groupApiLocal = "http://127.0.0.1:12391"; -export const groupApiSocketLocal = "ws://127.0.0.1:12391"; +export const groupApi = 'https://ext-node.qortal.link'; +export const groupApiSocket = 'wss://ext-node.qortal.link'; +export const groupApiLocal = 'http://127.0.0.1:12391'; +export const groupApiSocketLocal = 'ws://127.0.0.1:12391'; + const timeDifferenceForNotificationChatsBackground = 86400000; const requestQueueAnnouncements = new RequestQueueWithPromise(1); -let isMobile = true; function handleNotificationClick(notificationId) { // Decode the notificationId if it was encoded const decodedNotificationId = decodeURIComponent(notificationId); // Determine the type of notification by parsing decodedNotificationId - const isDirect = decodedNotificationId.includes("_type=direct_"); - const isGroup = decodedNotificationId.includes("_type=group_"); - const isGroupAnnouncement = decodedNotificationId.includes("_type=group-announcement_"); - const isNewThreadPost = decodedNotificationId.includes("_type=thread-post_"); + const isDirect = decodedNotificationId.includes('_type=direct_'); + const isGroup = decodedNotificationId.includes('_type=group_'); + const isGroupAnnouncement = decodedNotificationId.includes( + '_type=group-announcement_' + ); + const isNewThreadPost = decodedNotificationId.includes('_type=thread-post_'); // Helper function to extract parameter values safely function getParameterValue(id, key) { @@ -151,65 +143,47 @@ function handleNotificationClick(notificationId) { const targetOrigin = window.location.origin; // Handle specific notification types and post the message accordingly if (isDirect) { - const fromValue = getParameterValue(decodedNotificationId, "_from"); + const fromValue = getParameterValue(decodedNotificationId, '_from'); window.postMessage( - { action: "NOTIFICATION_OPEN_DIRECT", payload: { from: fromValue } }, + { action: 'NOTIFICATION_OPEN_DIRECT', payload: { from: fromValue } }, targetOrigin ); } else if (isGroup) { - const fromValue = getParameterValue(decodedNotificationId, "_from"); + const fromValue = getParameterValue(decodedNotificationId, '_from'); window.postMessage( - { action: "NOTIFICATION_OPEN_GROUP", payload: { from: fromValue } }, + { action: 'NOTIFICATION_OPEN_GROUP', payload: { from: fromValue } }, targetOrigin ); } else if (isGroupAnnouncement) { - const fromValue = getParameterValue(decodedNotificationId, "_from"); + const fromValue = getParameterValue(decodedNotificationId, '_from'); window.postMessage( { - action: "NOTIFICATION_OPEN_ANNOUNCEMENT_GROUP", + action: 'NOTIFICATION_OPEN_ANNOUNCEMENT_GROUP', payload: { from: fromValue }, }, targetOrigin ); } else if (isNewThreadPost) { - const dataValue = getParameterValue(decodedNotificationId, "_data"); + const dataValue = getParameterValue(decodedNotificationId, '_data'); try { const targetOrigin = window.location.origin; const dataParsed = JSON.parse(dataValue); window.postMessage( { - action: "NOTIFICATION_OPEN_THREAD_NEW_POST", + action: 'NOTIFICATION_OPEN_THREAD_NEW_POST', payload: { data: dataParsed }, }, targetOrigin ); } catch (error) { - console.error("Error parsing JSON data for thread post notification:", error); + console.error( + 'Error parsing JSON data for thread post notification:', + error + ); } } } - -const isMobileDevice = () => { - const userAgent = navigator.userAgent || navigator.vendor || window.opera; - - if (/android/i.test(userAgent)) { - return true; // Android device - } - - if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) { - return true; // iOS device - } - - return false; -}; - -if (isMobileDevice()) { - isMobile = true; - console.log("Running on a mobile device"); -} else { - console.log("Running on a desktop"); -} const allQueues = { requestQueueAnnouncements: requestQueueAnnouncements, }; @@ -218,7 +192,7 @@ const controlAllQueues = (action) => { Object.keys(allQueues).forEach((key) => { const val = allQueues[key]; try { - if (typeof val[action] === "function") { + if (typeof val[action] === 'function') { val[action](); } } catch (error) { @@ -238,42 +212,45 @@ export const clearAllQueues = () => { }); }; -export const getForeignKey = async (foreignBlockchain)=> { +export const getForeignKey = async (foreignBlockchain) => { const resKeyPair = await getKeyPair(); const parsedData = resKeyPair; switch (foreignBlockchain) { - case "LITECOIN": - return parsedData.ltcPrivateKey - case "DOGECOIN": - return parsedData.dogePrivateKey - case "BITCOIN": - return parsedData.btcPrivateKey - case "DIGIBYTE": - return parsedData.dgbPrivateKey - case "RAVENCOIN": - return parsedData.rvnPrivateKey - case "PIRATECHAIN": - return parsedData.arrrSeed58 - default: - return null + case 'LITECOIN': + return parsedData.ltcPrivateKey; + case 'DOGECOIN': + return parsedData.dogePrivateKey; + case 'BITCOIN': + return parsedData.btcPrivateKey; + case 'DIGIBYTE': + return parsedData.dgbPrivateKey; + case 'RAVENCOIN': + return parsedData.rvnPrivateKey; + case 'PIRATECHAIN': + return parsedData.arrrSeed58; + default: + return null; } -} +}; -export const pauseAllQueues = () => controlAllQueues("pause"); -export const resumeAllQueues = () => controlAllQueues("resume"); -export const checkDifference = (createdTimestamp, diff = timeDifferenceForNotificationChatsBackground) => { - return ( - Date.now() - createdTimestamp < diff - ); +export const pauseAllQueues = () => controlAllQueues('pause'); + +export const resumeAllQueues = () => controlAllQueues('resume'); + +export const checkDifference = ( + createdTimestamp, + diff = timeDifferenceForNotificationChatsBackground +) => { + return Date.now() - createdTimestamp < diff; }; export const getApiKeyFromStorage = async (): Promise => { - return getData("apiKey").catch(() => null); + return getData('apiKey').catch(() => null); }; export const getCustomNodesFromStorage = async (): Promise => { - return getData("customNodes").catch(() => null); + return getData('customNodes').catch(() => null); }; const getArbitraryEndpoint = async () => { @@ -291,13 +268,14 @@ export const getBaseApi = async (customApi?: string) => { } const apiKey = await getApiKeyFromStorage(); // Retrieve apiKey asynchronously - + if (apiKey?.url) { return apiKey?.url; } else { return groupApi; } }; + export const isUsingLocal = async () => { const apiKey = await getApiKeyFromStorage(); // Retrieve apiKey asynchronously if (apiKey?.url) { @@ -316,7 +294,7 @@ export const createEndpoint = async (endpoint, customApi?: string) => { if (apiKey?.url) { // Check if the endpoint already contains a query string - const separator = endpoint.includes("?") ? "&" : "?"; + const separator = endpoint.includes('?') ? '&' : '?'; return `${apiKey?.url}${endpoint}${separator}apiKey=${apiKey?.apikey}`; } else { return `${groupApi}${endpoint}`; @@ -324,36 +302,37 @@ export const createEndpoint = async (endpoint, customApi?: string) => { }; export const walletVersion = 2; + // List of your API endpoints const apiEndpoints = [ - "https://api.qortal.org", - "https://api2.qortal.org", - "https://appnode.qortal.org", - "https://apinode.qortalnodes.live", - "https://apinode1.qortalnodes.live", - "https://apinode2.qortalnodes.live", - "https://apinode3.qortalnodes.live", - "https://apinode4.qortalnodes.live", + 'https://api.qortal.org', + 'https://api2.qortal.org', + 'https://appnode.qortal.org', + 'https://apinode.qortalnodes.live', + 'https://apinode1.qortalnodes.live', + 'https://apinode2.qortalnodes.live', + 'https://apinode3.qortalnodes.live', + 'https://apinode4.qortalnodes.live', ]; -const buyTradeNodeBaseUrl = "https://appnode.qortal.org"; -const proxyAccountAddress = "QXPejUe5Za1KD3zCMViWCX35AreMQ9H7ku"; -const proxyAccountPublicKey = "5hP6stDWybojoDw5t8z9D51nV945oMPX7qBd29rhX1G7"; +const buyTradeNodeBaseUrl = 'https://appnode.qortal.org'; +const proxyAccountAddress = 'QXPejUe5Za1KD3zCMViWCX35AreMQ9H7ku'; +const proxyAccountPublicKey = '5hP6stDWybojoDw5t8z9D51nV945oMPX7qBd29rhX1G7'; const pendingResponses = new Map(); let groups = null; - let socket; let timeoutId; let groupSocketTimeout; let socketTimeout: any; let interval; let intervalThreads; + // Function to check each API endpoint export async function findUsableApi() { for (const endpoint of apiEndpoints) { try { const response = await fetch(`${endpoint}/admin/status`); - if (!response.ok) throw new Error("Failed to fetch"); + if (!response.ok) throw new Error('Failed to fetch'); const data = await response.json(); if (data.isSynchronizing === false && data.syncPercent === 100) { @@ -367,7 +346,7 @@ export async function findUsableApi() { } } - throw new Error("No usable API found"); + throw new Error('No usable API found'); } export function isExtMsg(data) { @@ -417,21 +396,22 @@ async function checkWebviewFocus() { }, 1000); const targetOrigin = window.location.origin; // Send a message to check focus - window.postMessage({ action: "CHECK_FOCUS" }, targetOrigin); + window.postMessage({ action: 'CHECK_FOCUS' }, targetOrigin); // Listen for the response const handleMessage = (event) => { - if (event.data?.action === "CHECK_FOCUS_RESPONSE") { + if (event.data?.action === 'CHECK_FOCUS_RESPONSE') { clearTimeout(timeout); - window.removeEventListener("message", handleMessage); // Clean up listener + window.removeEventListener('message', handleMessage); // Clean up listener resolve(event.data.isFocused); // Resolve with the response } }; - window.addEventListener("message", handleMessage); + window.addEventListener('message', handleMessage); }); } -const worker = new ChatComputePowWorker() + +const worker = new ChatComputePowWorker(); export async function performPowTask(chatBytes, difficulty) { return new Promise((resolve, reject) => { @@ -450,22 +430,18 @@ export async function performPowTask(chatBytes, difficulty) { // Send the task to the worker worker.postMessage({ chatBytes, - path: `${import.meta.env.BASE_URL}memory-pow.wasm.full`, + path: `${import.meta.env.BASE_URL}memory-pow.wasm.full`, // TODO move into ./wasm/ folder difficulty, }); }); } -function playNotificationSound() { - // chrome.runtime.sendMessage({ action: "PLAY_NOTIFICATION_SOUND" }); -} - const handleNotificationDirect = async (directs) => { let isFocused; const wallet = await getSaveWallet(); const address = wallet.address0; - let isDisableNotifications = - (await getUserSettings({ key: "disable-push-notifications" })) || false; + const isDisableNotifications = + (await getUserSettings({ key: 'disable-push-notifications' })) || false; const dataDirects = directs.filter((direct) => direct?.sender !== address); try { if (isDisableNotifications) return; @@ -473,7 +449,7 @@ const handleNotificationDirect = async (directs) => { isFocused = await checkWebviewFocus(); if (isFocused) { - throw new Error("isFocused"); + throw new Error('isFocused'); } const newActiveChats = dataDirects; const oldActiveChats = await getChatHeadsDirect(); @@ -510,17 +486,18 @@ const handleNotificationDirect = async (directs) => { ) { // Create the notification and assign the onclick handler const title = `New Direct message! ${ - newestLatestTimestamp?.name ? `from ${newestLatestTimestamp.name}` : "" + newestLatestTimestamp?.name ? `from ${newestLatestTimestamp.name}` : '' }`; - const body = "You have received a new direct message"; - const notificationId = - encodeURIComponent("chat_notification_" + - Date.now() + - "_type=direct" + - `_from=${newestLatestTimestamp.address}`); + const body = 'You have received a new direct message'; + const notificationId = encodeURIComponent( + 'chat_notification_' + + Date.now() + + '_type=direct' + + `_from=${newestLatestTimestamp.address}` + ); const notification = new window.Notification(title, { body, - icon: window.location.origin + "/qortal192.png", + icon: window.location.origin + '/qortal192.png', data: { id: notificationId }, }); @@ -537,7 +514,7 @@ const handleNotificationDirect = async (directs) => { } catch (error) { if (!isFocused) { window - .sendMessage("notification", {}) + .sendMessage('notification', {}) .then((response) => { if (!response?.error) { // Handle success if needed @@ -545,24 +522,22 @@ const handleNotificationDirect = async (directs) => { }) .catch((error) => { console.error( - "Failed to send notification:", - error.message || "An error occurred" + 'Failed to send notification:', + error.message || 'An error occurred' ); }); // Create a unique notification ID with type and sender information - const notificationId = - encodeURIComponent("chat_notification_" + - Date.now() + - "_type=direct" + - `_from=""`); + const notificationId = encodeURIComponent( + 'chat_notification_' + Date.now() + '_type=direct' + `_from=""` + ); - const title = "New Direct message!"; - const body = "You have received a new direct message"; + const title = 'New Direct message!'; + const body = 'You have received a new direct message'; const notification = new window.Notification(title, { body, - icon: window.location.origin + "/qortal192.png", + icon: window.location.origin + '/qortal192.png', data: { id: notificationId }, }); @@ -581,6 +556,7 @@ const handleNotificationDirect = async (directs) => { setChatHeadsDirect(dataDirects); } }; + async function getThreadActivity(): Promise { const wallet = await getSaveWallet(); const address = wallet.address0; @@ -623,7 +599,7 @@ export function updateThreadActivity({ threads = JSON.parse(storedData); } - let lastResetTime = threads.lastResetTime || 0; + const lastResetTime = threads.lastResetTime || 0; // Check if a week has passed since the last reset if (currentTime - lastResetTime > ONE_WEEK_IN_MS) { @@ -673,17 +649,15 @@ export function updateThreadActivity({ const handleNotification = async (groups) => { const wallet = await getSaveWallet(); const address = wallet.address0; - let isDisableNotifications = - (await getUserSettings({ key: "disable-push-notifications" })) || false; + const isDisableNotifications = + (await getUserSettings({ key: 'disable-push-notifications' })) || false; - let mutedGroups = (await getUserSettings({ key: "mutedGroups" })) || []; + let mutedGroups = (await getUserSettings({ key: 'mutedGroups' })) || []; if (!isArray(mutedGroups)) mutedGroups = []; - mutedGroups.push('0') + mutedGroups.push('0'); let isFocused; const data = groups.filter( - (group) => - group?.sender !== address && - !mutedGroups.includes(group.groupId) + (group) => group?.sender !== address && !mutedGroups.includes(group.groupId) ); const dataWithUpdates = groups.filter( (group) => group?.sender !== address && !mutedGroups.includes(group.groupId) @@ -695,12 +669,11 @@ const handleNotification = async (groups) => { isFocused = await checkWebviewFocus(); if (isFocused) { - throw new Error("isFocused"); + throw new Error('isFocused'); } const newActiveChats = data; const oldActiveChats = await getChatHeads(); - let results = []; let newestLatestTimestamp = null; let oldestLatestTimestamp = null; // Find the latest timestamp from newActiveChats @@ -733,24 +706,22 @@ const handleNotification = async (groups) => { !lastGroupNotification || Date.now() - lastGroupNotification >= 120000 ) { - if ( - !newestLatestTimestamp?.data - ) - return; + if (!newestLatestTimestamp?.data) return; // Create a unique notification ID with type and group information - const notificationId = - encodeURIComponent("chat_notification_" + - Date.now() + - "_type=group" + - `_from=${newestLatestTimestamp.groupId}`); + const notificationId = encodeURIComponent( + 'chat_notification_' + + Date.now() + + '_type=group' + + `_from=${newestLatestTimestamp.groupId}` + ); - const title = "New Group Message!"; + const title = 'New Group Message!'; const body = `You have received a new message from ${newestLatestTimestamp?.groupName}`; const notification = new window.Notification(title, { body, - icon: window.location.origin + "/qortal192.png", + icon: window.location.origin + '/qortal192.png', data: { id: notificationId }, }); @@ -771,7 +742,7 @@ const handleNotification = async (groups) => { } catch (error) { if (!isFocused) { window - .sendMessage("notification", {}) + .sendMessage('notification', {}) .then((response) => { if (!response?.error) { // Handle success if needed @@ -779,21 +750,23 @@ const handleNotification = async (groups) => { }) .catch((error) => { console.error( - "Failed to send notification:", - error.message || "An error occurred" + 'Failed to send notification:', + error.message || 'An error occurred' ); }); // Generate a unique notification ID - const notificationId = encodeURIComponent("chat_notification_" + Date.now()); + const notificationId = encodeURIComponent( + 'chat_notification_' + Date.now() + ); - const title = "New Group Message!"; - const body = "You have received a new message from one of your groups"; + const title = 'New Group Message!'; + const body = 'You have received a new message from one of your groups'; // Create and show the notification immediately const notification = new window.Notification(title, { body, - icon: window.location.origin + "/qortal192.png", + icon: window.location.origin + '/qortal192.png', data: { id: notificationId }, }); @@ -823,7 +796,7 @@ const forceCloseWebSocket = () => { clearTimeout(socketTimeout); timeoutId = null; groupSocketTimeout = null; - socket.close(1000, "forced"); + socket.close(1000, 'forced'); socket = null; } }; @@ -832,32 +805,34 @@ export async function getNameInfo() { const wallet = await getSaveWallet(); const address = wallet.address0; const validApi = await getBaseApi(); - const response = await fetch(validApi + "/names/address/" + address); + const response = await fetch(validApi + '/names/primary/' + address); const nameData = await response.json(); - if (nameData?.length > 0) { - return nameData[0].name; + if (nameData?.name) { + return nameData.name; } else { - return ""; + return ''; } } export async function getNameInfoForOthers(address) { + if (!address) return ''; const validApi = await getBaseApi(); - const response = await fetch(validApi + "/names/address/" + address); + const response = await fetch(validApi + '/names/primary/' + address); const nameData = await response.json(); - if (nameData?.length > 0) { - return nameData[0].name; + if (nameData?.name) { + return nameData?.name; } else { - return ""; + return ''; } } + export async function getAddressInfo(address) { const validApi = await getBaseApi(); - const response = await fetch(validApi + "/addresses/" + address); + const response = await fetch(validApi + '/addresses/' + address); const data = await response.json(); if (!response?.ok && data?.error !== 124) - throw new Error("Cannot fetch address info"); + throw new Error('Cannot retrieve address info'); // TODO translate if (data?.error === 124) { return { address, @@ -867,45 +842,36 @@ export async function getAddressInfo(address) { } export async function getKeyPair() { - const res = await getData("keyPair").catch(() => null); + const res = await getData('keyPair').catch(() => null); if (res) { return res; } else { - throw new Error("Wallet not authenticated"); + throw new Error('Wallet not authenticated'); } } export async function getSaveWallet() { - const res = await getData("walletInfo").catch(() => null); + const res = await getData('walletInfo').catch(() => null); if (res) { return res; } else { - throw new Error("No wallet saved"); + throw new Error('No wallet saved'); } } export async function getWallets() { - const res = await getData("wallets").catch(() => null); + const res = await getData('wallets').catch(() => null); if (res) { return res; } else { - return null + return null; } } export async function storeWallets(wallets) { - storeData("wallets", wallets) - .catch((error) => { - console.error(error) - }); -} - - -export async function clearAllNotifications() { - // const notifications = await chrome.notifications.getAll(); - // for (const notificationId of Object.keys(notifications)) { - // await chrome.notifications.clear(notificationId); - // } + storeData('wallets', wallets).catch((error) => { + console.error(error); + }); } export async function getUserInfo() { @@ -927,12 +893,13 @@ async function connection(hostname: string) { async function getTradeInfo(qortalAtAddress) { const response = await fetch( - buyTradeNodeBaseUrl + "/crosschain/trade/" + qortalAtAddress + buyTradeNodeBaseUrl + '/crosschain/trade/' + qortalAtAddress ); - if (!response?.ok) throw new Error("Cannot crosschain trade information"); + if (!response?.ok) throw new Error('Cannot crosschain trade information'); const data = await response.json(); return data; } + async function getTradesInfo(qortalAtAddresses) { // Use Promise.all to fetch data for all addresses concurrently const trades = await Promise.all( @@ -946,12 +913,36 @@ export async function getBalanceInfo() { const address = wallet.address0; const validApi = await getBaseApi(); - const response = await fetch(validApi + "/addresses/balance/" + address); + const response = await fetch(validApi + '/addresses/balance/' + address); - if (!response?.ok) throw new Error("0 QORT in your balance"); + if (!response?.ok) throw new Error('0 QORT in your balance'); const data = await response.json(); return data; } + +export async function getAssetBalanceInfo(assetId: number) { + const wallet = await getSaveWallet(); + const address = wallet.address0; + const validApi = await getBaseApi(); + const response = await fetch( + validApi + + `/assets/balances?address=${address}&assetid=${assetId}&ordering=ASSET_BALANCE_ACCOUNT&limit=1` + ); + + if (!response?.ok) throw new Error('Cannot fetch asset balance'); + const data = await response.json(); + return +data?.[0]?.balance; +} + +export async function getAssetInfo(assetId: number) { + const validApi = await getBaseApi(); + const response = await fetch(validApi + `/assets/info?assetId=${assetId}`); + + if (!response?.ok) throw new Error('Cannot fetch asset info'); + const data = await response.json(); + return data; +} + export async function getLTCBalance() { const wallet = await getSaveWallet(); let _url = `${buyTradeNodeBaseUrl}/crosschain/ltc/walletbalance`; @@ -959,9 +950,9 @@ export async function getLTCBalance() { const parsedKeyPair = keyPair; let _body = parsedKeyPair.ltcPublicKey; const response = await fetch(_url, { - method: "POST", + method: 'POST', headers: { - "Content-Type": "application/json", + 'Content-Type': 'application/json', }, body: _body, }); @@ -969,10 +960,13 @@ export async function getLTCBalance() { const data = await response.text(); const dataLTCBalance = (Number(data) / 1e8).toFixed(8); return +dataLTCBalance; - } else throw new Error("Onable to get LTC balance"); + } else throw new Error('Onable to get LTC balance'); } -export async function parseErrorResponse(response, defaultMessage = "Request failed") { +export async function parseErrorResponse( + response, + defaultMessage = 'Request failed' +) { let message = defaultMessage; try { @@ -998,15 +992,14 @@ export async function parseErrorResponse(response, defaultMessage = "Request fai return message; } - const processTransactionVersion2Chat = async (body: any, customApi) => { // const validApi = await findUsableApi(); const url = await createEndpoint( - "/transactions/process?apiVersion=2", + '/transactions/process?apiVersion=2', customApi ); return fetch(url, { - method: "POST", + method: 'POST', headers: {}, body: Base58.encode(body), }).then(async (response) => { @@ -1024,9 +1017,9 @@ export const processTransactionVersion2 = async (body: any) => { try { const response = await fetch(url, { - method: "POST", + method: 'POST', headers: { - "Content-Type": "application/json", // Ensure the body is correctly parsed + 'Content-Type': 'application/json', // Ensure the body is correctly parsed }, body, // Convert body to JSON string }); @@ -1048,7 +1041,7 @@ export const processTransactionVersion2 = async (body: any) => { } } } catch (error) { - console.error("Error processing transaction:", error); + console.error('Error processing transaction:', error); throw error; // Re-throw the error after logging it } }; @@ -1074,6 +1067,7 @@ const transaction = async ( data: res, }; }; + const makeTransactionRequest = async ( receiver, lastRef, @@ -1106,20 +1100,21 @@ export const getLastRef = async () => { const address = wallet.address0; const validApi = await getBaseApi(); const response = await fetch( - validApi + "/addresses/lastreference/" + address + validApi + '/addresses/lastreference/' + address ); - if (!response?.ok) throw new Error("0 QORT in your balance"); + if (!response?.ok) throw new Error('0 QORT in your balance'); const data = await response.text(); return data; }; + export const sendQortFee = async (): Promise => { const validApi = await getBaseApi(); const response = await fetch( - validApi + "/transactions/unitfee?txType=PAYMENT" + validApi + '/transactions/unitfee?txType=PAYMENT' ); if (!response.ok) { - throw new Error("Error when fetching join fee"); + throw new Error('Error when fetching join fee'); } const data = await response.json(); @@ -1135,16 +1130,16 @@ export async function getNameOrAddress(receiver) { } const validApi = await getBaseApi(); - const response = await fetch(validApi + "/names/" + receiver); + const response = await fetch(validApi + '/names/' + receiver); const data = await response.json(); if (data?.owner) return data.owner; if (data?.error) { - throw new Error("Name does not exist"); + throw new Error('Name does not exist'); } - if (!response?.ok) throw new Error("Cannot fetch name"); - return { error: "cannot validate address or name" }; + if (!response?.ok) throw new Error('Cannot fetch name'); + return { error: 'cannot validate address or name' }; } catch (error) { - throw new Error(error?.message || "cannot validate address or name"); + throw new Error(error?.message || 'cannot validate address or name'); } } @@ -1152,17 +1147,17 @@ export async function getPublicKey(receiver) { try { const validApi = await getBaseApi(); - const response = await fetch(validApi + "/addresses/publickey/" + receiver); + const response = await fetch(validApi + '/addresses/publickey/' + receiver); if (!response?.ok) throw new Error("Cannot fetch recipient's public key"); const data = await response.text(); - if (!data?.error && data !== "false") return data; + if (!data?.error && data !== 'false') return data; if (data?.error) { throw new Error("Cannot fetch recipient's public key"); } throw new Error("Cannot fetch recipient's public key"); } catch (error) { - throw new Error(error?.message || "cannot validate address or name"); + throw new Error(error?.message || 'cannot validate address or name'); } } @@ -1182,7 +1177,7 @@ export async function getDataPublishes(groupId, type) { resolve(typeData); // Resolve with the data inside the specific type }) .catch((error) => { - console.error("Error retrieving data:", error); + console.error('Error retrieving data:', error); resolve(null); // Return null in case of an error }); }); @@ -1240,16 +1235,16 @@ export async function addDataPublishes(newData, groupId, type) { storeData(`${address}-publishData`, storedData) .then(() => res(true)) // Successfully added .catch((error) => { - console.error("Error saving data:", error); + console.error('Error saving data:', error); res(false); // Save failed }); } else { - console.error("Failed to add data, still exceeds storage limit."); + console.error('Failed to add data, still exceeds storage limit.'); res(false); // Failure due to storage limit } }) .catch((error) => { - console.error("Error retrieving data:", error); + console.error('Error retrieving data:', error); res(false); // Failure due to retrieval error }); }); @@ -1286,19 +1281,18 @@ export async function addUserSettings({ keyValue }) { getData(`${address}-userSettings`) .then((storedData) => { storedData = storedData || {}; // Initialize if no data found - storedData[key] = value; // Update the key-value pair within stored data // Save updated structure back to localStorage storeData(`${address}-userSettings`, storedData) .then(() => res(true)) // Data successfully added .catch((error) => { - console.error("Error saving data:", error); + console.error('Error saving data:', error); res(false); // Save failed }); }) .catch((error) => { - console.error("Error retrieving data:", error); + console.error('Error retrieving data:', error); res(false); // Failure due to retrieval error }); }); @@ -1338,10 +1332,10 @@ export async function decryptWallet({ password, wallet, walletVersion }) { rvnPrivateKey: wallet2._addresses[0].rvnWallet.derivedMasterPrivateKey, }; await new Promise((resolve, reject) => { - storeData("keyPair", toSave) + storeData('keyPair', toSave) .then(() => resolve(true)) .catch((error) => { - reject(new Error(error.message || "Error saving data")); + reject(new Error(error.message || 'Error saving data')); }); }); const newWallet = { @@ -1350,10 +1344,10 @@ export async function decryptWallet({ password, wallet, walletVersion }) { ltcAddress: ltcAddress, }; await new Promise((resolve, reject) => { - storeData("walletInfo", newWallet) + storeData('walletInfo', newWallet) .then(() => resolve(true)) .catch((error) => { - reject(new Error(error.message || "Error saving data")); + reject(new Error(error.message || 'Error saving data')); }); }); @@ -1385,11 +1379,12 @@ export async function signChatFunc( } return response; } + function sbrk(size, heap) { let brk = 512 * 1024; // stack top let old = brk; brk += size; - if (brk > heap.length) throw new Error("heap exhausted"); + if (brk > heap.length) throw new Error('heap exhausted'); return old; } @@ -1453,14 +1448,14 @@ export async function handleActiveGroupDataFromSocket({ groups, directs }) { const targetOrigin = window.location.origin; window.postMessage( { - action: "SET_GROUPS", + action: 'SET_GROUPS', payload: groups, }, targetOrigin ); window.postMessage( { - action: "SET_DIRECTS", + action: 'SET_DIRECTS', payload: directs, }, targetOrigin @@ -1473,18 +1468,28 @@ export async function handleActiveGroupDataFromSocket({ groups, directs }) { directs: directs || [], // Your directs data here }; // Save the active data to localStorage - storeData("active-groups-directs", activeData).catch((error) => { - console.error("Error saving data:", error); + storeData('active-groups-directs', activeData).catch((error) => { + console.error('Error saving data:', error); }); try { handleNotification(groups); handleNotificationDirect(directs); - } catch (error) {} - } catch (error) {} + } catch (error) { + console.log(error); + } + } catch (error) { + console.log(error); + } } -async function sendChatForBuyOrder({ qortAddress, recipientPublicKey, message, atAddresses, isSingle }) { +async function sendChatForBuyOrder({ + qortAddress, + recipientPublicKey, + message, + atAddresses, + isSingle, +}) { let _reference = new Uint8Array(64); self.crypto.getRandomValues(_reference); @@ -1510,7 +1515,7 @@ async function sendChatForBuyOrder({ qortAddress, recipientPublicKey, message, a const finalJson = { callRequest: jsonData, extra: { - type: isSingle ? "single" : "multiple" + type: isSingle ? 'single' : 'multiple', }, }; const messageStringified = JSON.stringify(finalJson); @@ -1528,50 +1533,63 @@ async function sendChatForBuyOrder({ qortAddress, recipientPublicKey, message, a }); //TODO // if (!hasEnoughBalance) { - if(!hasEnoughBalance){ + if (!hasEnoughBalance) { const _encryptedMessage = tx._encryptedMessage; const encryptedMessageToBase58 = Base58.encode(_encryptedMessage); - const signature = "id-" + Date.now() + "-" + Math.floor(Math.random() * 1000) - const checkGatewayStatusRes = await fetch(`${buyTradeNodeBaseUrl}/admin/status`) - const checkGatewayStatusData = await checkGatewayStatusRes.json() - if(+checkGatewayStatusData?.syncPercent !== 100 || checkGatewayStatusData?.isSynchronizing !== false){ - throw new Error("Cannot make trade. Gateway node is synchronizing") + const signature = + 'id-' + Date.now() + '-' + Math.floor(Math.random() * 1000); + const checkGatewayStatusRes = await fetch( + `${buyTradeNodeBaseUrl}/admin/status` + ); + const checkGatewayStatusData = await checkGatewayStatusRes.json(); + if ( + +checkGatewayStatusData?.syncPercent !== 100 || + checkGatewayStatusData?.isSynchronizing !== false + ) { + throw new Error('Cannot make trade. Gateway node is synchronizing'); } - const healthCheckRes = await fetch('https://www.qort.trade/api/transaction/healthcheck') - const healthcheckData = await healthCheckRes.json() - if(healthcheckData?.dbConnection !== 'healthy'){ - throw new Error('Could not connect to db. Try again later.') + const healthCheckRes = await fetch( + 'https://www.qort.trade/api/transaction/healthcheck' + ); + const healthcheckData = await healthCheckRes.json(); + if (healthcheckData?.dbConnection !== 'healthy') { + throw new Error('Could not connect to db. Try again later.'); } const res = await axios.post( `https://www.qort.trade/api/transaction/updatetxgateway`, { - qortalAtAddresses: atAddresses, qortAddress: address, node: buyTradeNodeBaseUrl, status: "message-sent", encryptedMessageToBase58, signature , - reference, senderPublicKey: parsedData.publicKey, + qortalAtAddresses: atAddresses, + qortAddress: address, + node: buyTradeNodeBaseUrl, + status: 'message-sent', + encryptedMessageToBase58, + signature, + reference, + senderPublicKey: parsedData.publicKey, sender: address, }, { headers: { - "Content-Type": "application/json" + 'Content-Type': 'application/json', }, } ); return { encryptedMessageToBase58, - status: "message-sent", - signature - } + status: 'message-sent', + signature, + }; } - const chatBytes = tx.chatBytes; const difficulty = 8; - const { nonce, chatBytesArray } = await performPowTask(chatBytes, difficulty); + const { nonce, chatBytesArray } = await performPowTask(chatBytes, difficulty); let _response = await signChatFunc( chatBytesArray, nonce, - "https://appnode.qortal.org", + 'https://appnode.qortal.org', keyPair ); if (_response?.error) { @@ -1580,9 +1598,6 @@ async function sendChatForBuyOrder({ qortAddress, recipientPublicKey, message, a return _response; } - - - export async function sendChatGroup({ groupId, typeMessage, @@ -1604,7 +1619,6 @@ export async function sendChatGroup({ // const balance = await getBalanceInfo(); // const hasEnoughBalance = +balance < 4 ? false : true; - const txBody = { timestamp: Date.now(), groupID: Number(groupId), @@ -1618,7 +1632,7 @@ export async function sendChatGroup({ }; if (chatReference) { - txBody["chatReference"] = chatReference; + txBody['chatReference'] = chatReference; } const tx = await createTransaction(181, keyPair, txBody); @@ -1629,9 +1643,8 @@ export async function sendChatGroup({ const chatBytes = tx.chatBytes; const difficulty = 8; - const { nonce, chatBytesArray } = await performPowTask(chatBytes, difficulty); + const { nonce, chatBytesArray } = await performPowTask(chatBytes, difficulty); - let _response = await signChatFunc(chatBytesArray, nonce, null, keyPair); if (_response?.error) { throw new Error(_response?.message); @@ -1660,7 +1673,7 @@ export async function sendChatDirect({ recipientAddress = await getNameOrAddress(directTo); } - if (!recipientPublicKey) throw new Error("Cannot retrieve publickey"); + if (!recipientPublicKey) throw new Error('Cannot retrieve publickey'); let _reference = new Uint8Array(64); self.crypto.getRandomValues(_reference); @@ -1677,7 +1690,6 @@ export async function sendChatDirect({ // const balance = await getBalanceInfo(); // const hasEnoughBalance = +balance < 4 ? false : true; - const finalJson = { message: messageText, version: 2, @@ -1697,7 +1709,7 @@ export async function sendChatDirect({ isText: 1, }; if (chatReference) { - txBody["chatReference"] = chatReference; + txBody['chatReference'] = chatReference; } const tx = await createTransaction(18, keyPair, txBody); @@ -1707,7 +1719,7 @@ export async function sendChatDirect({ const chatBytes = tx.chatBytes; const difficulty = 8; - const { nonce, chatBytesArray } = await performPowTask(chatBytes, difficulty); + const { nonce, chatBytesArray } = await performPowTask(chatBytes, difficulty); let _response = await signChatFunc(chatBytesArray, nonce, null, keyPair); if (_response?.error) { @@ -1721,7 +1733,7 @@ export async function decryptSingleFunc({ secretKeyObject, skipDecodeBase64, }) { - let holdMessages = []; + const holdMessages = []; for (const message of messages) { try { @@ -1731,10 +1743,14 @@ export async function decryptSingleFunc({ skipDecodeBase64, }); - const decryptToUnit8Array = base64ToUint8Array(res); - const responseData = uint8ArrayToObject(decryptToUnit8Array); - holdMessages.push({ ...message, decryptedData: responseData }); - } catch (error) {} + if (res) { + const decryptToUnit8Array = base64ToUint8Array(res); + const responseData = uint8ArrayToObject(decryptToUnit8Array); + holdMessages.push({ ...message, decryptedData: responseData }); + } + } catch (error) { + console.error(error); + } } return holdMessages; } @@ -1743,7 +1759,7 @@ export async function decryptSingleForPublishes({ secretKeyObject, skipDecodeBase64, }) { - let holdMessages = []; + const holdMessages = []; for (const message of messages) { try { @@ -1756,12 +1772,13 @@ export async function decryptSingleForPublishes({ const decryptToUnit8Array = base64ToUint8Array(res); const responseData = uint8ArrayToObject(decryptToUnit8Array); holdMessages.push({ ...message, decryptedData: responseData }); - } catch (error) {} + } catch (error) { + console.error(error); + } } return holdMessages; } - export async function decryptDirectFunc({ messages, involvingAddress }) { const senderPublicKey = await getPublicKey(involvingAddress); let holdMessages = []; @@ -1784,72 +1801,68 @@ export async function decryptDirectFunc({ messages, involvingAddress }) { ); const parsedMessage = JSON.parse(decodedMessage); holdMessages.push({ ...message, ...parsedMessage }); - } catch (error) {} + } catch (error) { + console.error(error); + } } return holdMessages; } -export async function createBuyOrderTx({ crosschainAtInfo, isGateway, foreignBlockchain }) { +export async function createBuyOrderTx({ + crosschainAtInfo, + isGateway, + foreignBlockchain, +}) { try { - if (!isGateway) { const wallet = await getSaveWallet(); const address = wallet.address0; - let message - if(foreignBlockchain === 'PIRATECHAIN'){ - message = { + let message; + if (foreignBlockchain === 'PIRATECHAIN') { + message = { atAddress: crosschainAtInfo[0].qortalAtAddress, foreignKey: await getForeignKey(foreignBlockchain), receivingAddress: address, }; } else { - message = { - addresses: crosschainAtInfo.map((order)=> order.qortalAtAddress), + message = { + addresses: crosschainAtInfo.map((order) => order.qortalAtAddress), foreignKey: await getForeignKey(foreignBlockchain), receivingAddress: address, }; } - + let responseVar; - let txn - let url - if(foreignBlockchain === 'PIRATECHAIN'){ - txn = new TradeBotRespondRequest().createTransaction( - message - ); - - - url = await createEndpoint('/crosschain/tradebot/respond') + let txn; + let url; + if (foreignBlockchain === 'PIRATECHAIN') { + txn = new TradeBotRespondRequest().createTransaction(message); + + url = await createEndpoint('/crosschain/tradebot/respond'); } else { - txn = new TradeBotRespondMultipleRequest().createTransaction( - message - ); - - - url = await createEndpoint('/crosschain/tradebot/respondmultiple') + txn = new TradeBotRespondMultipleRequest().createTransaction(message); + + url = await createEndpoint('/crosschain/tradebot/respondmultiple'); } - - const responseFetch = await fetch( - url, - { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(txn), - } - ); + + const responseFetch = await fetch(url, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify(txn), + }); const res = await responseFetch.json(); - if(res?.error && res?.message){ - throw new Error(res?.message) + if (res?.error && res?.message) { + throw new Error(res?.message); } - if(!responseFetch?.ok) throw new Error('Failed to submit buy order') + if (!responseFetch?.ok) throw new Error('Failed to submit buy order'); if (res === false) { responseVar = { - response: "Unable to execute buy order", + response: 'Unable to execute buy order', success: false, }; } else { @@ -1861,32 +1874,40 @@ export async function createBuyOrderTx({ crosschainAtInfo, isGateway, foreignBlo responseMessage = { callResponse: response, extra: { - message: "Transaction processed successfully!", - atAddresses: foreignBlockchain === 'PIRATECHAIN' ? [crosschainAtInfo[0].qortalAtAddress] : crosschainAtInfo.map((order)=> order.qortalAtAddress), + message: 'Transaction processed successfully!', + atAddresses: + foreignBlockchain === 'PIRATECHAIN' + ? [crosschainAtInfo[0].qortalAtAddress] + : crosschainAtInfo.map((order) => order.qortalAtAddress), senderAddress: address, - node: url + node: url, }, }; } else { responseMessage = { - callResponse: "ERROR", + callResponse: 'ERROR', extra: { message: response, - atAddresses: foreignBlockchain === 'PIRATECHAIN' ? [crosschainAtInfo[0].qortalAtAddress] : crosschainAtInfo.map((order)=> order.qortalAtAddress), + atAddresses: + foreignBlockchain === 'PIRATECHAIN' + ? [crosschainAtInfo[0].qortalAtAddress] + : crosschainAtInfo.map((order) => order.qortalAtAddress), senderAddress: address, - node: url + node: url, }, }; } - return responseMessage + return responseMessage; } const wallet = await getSaveWallet(); const address = wallet.address0; - const message = { - addresses: foreignBlockchain === 'PIRATECHAIN' ? [crosschainAtInfo[0].qortalAtAddress] : crosschainAtInfo.map((order)=> order.qortalAtAddress), + addresses: + foreignBlockchain === 'PIRATECHAIN' + ? [crosschainAtInfo[0].qortalAtAddress] + : crosschainAtInfo.map((order) => order.qortalAtAddress), foreignKey: await getForeignKey(foreignBlockchain), receivingAddress: address, }; @@ -1894,33 +1915,37 @@ export async function createBuyOrderTx({ crosschainAtInfo, isGateway, foreignBlo qortAddress: proxyAccountAddress, recipientPublicKey: proxyAccountPublicKey, message, - atAddresses: foreignBlockchain === 'PIRATECHAIN' ? [crosschainAtInfo[0].qortalAtAddress] : crosschainAtInfo.map((order)=> order.qortalAtAddress), - isSingle: foreignBlockchain === 'PIRATECHAIN' + atAddresses: + foreignBlockchain === 'PIRATECHAIN' + ? [crosschainAtInfo[0].qortalAtAddress] + : crosschainAtInfo.map((order) => order.qortalAtAddress), + isSingle: foreignBlockchain === 'PIRATECHAIN', }); - if (res?.signature) { - - const message = await listenForChatMessageForBuyOrder({ - nodeBaseUrl: buyTradeNodeBaseUrl, - senderAddress: proxyAccountAddress, - senderPublicKey: proxyAccountPublicKey, - signature: res?.signature, - }); + const message = await listenForChatMessageForBuyOrder({ + nodeBaseUrl: buyTradeNodeBaseUrl, + senderAddress: proxyAccountAddress, + senderPublicKey: proxyAccountPublicKey, + signature: res?.signature, + }); const responseMessage = { - callResponse: message.callResponse, - extra: { - message: message?.extra?.message, - senderAddress: address, - node: buyTradeNodeBaseUrl, - atAddresses: foreignBlockchain === 'PIRATECHAIN' ? [crosschainAtInfo[0].qortalAtAddress] : crosschainAtInfo.map((order)=> order.qortalAtAddress), - } - } - - return responseMessage + callResponse: message.callResponse, + extra: { + message: message?.extra?.message, + senderAddress: address, + node: buyTradeNodeBaseUrl, + atAddresses: + foreignBlockchain === 'PIRATECHAIN' + ? [crosschainAtInfo[0].qortalAtAddress] + : crosschainAtInfo.map((order) => order.qortalAtAddress), + }, + }; + + return responseMessage; } else { - throw new Error("Unable to send buy order message"); + throw new Error('Unable to send buy order message'); } } catch (error) { throw new Error(error.message); @@ -1935,8 +1960,8 @@ export async function sendChatNotification( ) { try { const data = await objectToBase64({ - type: "notification", - subType: "new-group-encryption", + type: 'notification', + subType: 'new-group-encryption', data: { timestamp: res.timestamp, name: res.name, @@ -1959,16 +1984,18 @@ export async function sendChatNotification( }) .then(() => {}) .catch((error) => { - console.error("1", error.message); + console.error('1', error.message); }) .finally(() => { resumeAllQueues(); }); }) .catch((error) => { - console.error("2", error.message); + console.error('2', error.message); }); - } catch (error) {} + } catch (error) { + console.log(error); + } } export const getFee = async (txType) => { @@ -1996,7 +2023,7 @@ export async function leaveGroup({ groupId }) { privateKey: uint8PrivateKey, publicKey: uint8PublicKey, }; - const feeres = await getFee("LEAVE_GROUP"); + const feeres = await getFee('LEAVE_GROUP'); const tx = await createTransaction(32, keyPair, { fee: feeres.fee, @@ -2009,7 +2036,7 @@ export async function leaveGroup({ groupId }) { const res = await processTransactionVersion2(signedBytes); if (!res?.signature) - throw new Error(res?.message || "Transaction was not able to be processed"); + throw new Error(res?.message || 'Transaction was not able to be processed'); return res; } @@ -2025,7 +2052,7 @@ export async function joinGroup({ groupId }) { privateKey: uint8PrivateKey, publicKey: uint8PublicKey, }; - const feeres = await getFee("JOIN_GROUP"); + const feeres = await getFee('JOIN_GROUP'); const tx = await createTransaction(31, keyPair, { fee: feeres.fee, @@ -2038,11 +2065,15 @@ export async function joinGroup({ groupId }) { const res = await processTransactionVersion2(signedBytes); if (!res?.signature) - throw new Error(res?.message || "Transaction was not able to be processed"); + throw new Error(res?.message || 'Transaction was not able to be processed'); return res; } -export async function cancelInvitationToGroup({ groupId, qortalAddress }) { +export async function cancelInvitationToGroup({ + groupId, + qortalAddress, + txGroupId = 0, +}) { const lastReference = await getLastRef(); const resKeyPair = await getKeyPair(); const parsedData = resKeyPair; @@ -2052,24 +2083,25 @@ export async function cancelInvitationToGroup({ groupId, qortalAddress }) { privateKey: uint8PrivateKey, publicKey: uint8PublicKey, }; - const feeres = await getFee("CANCEL_GROUP_INVITE"); + const feeres = await getFee('CANCEL_GROUP_INVITE'); const tx = await createTransaction(30, keyPair, { fee: feeres.fee, recipient: qortalAddress, rGroupId: groupId, lastReference: lastReference, + groupID: txGroupId, }); const signedBytes = Base58.encode(tx.signedBytes); const res = await processTransactionVersion2(signedBytes); if (!res?.signature) - throw new Error(res?.message || "Transaction was not able to be processed"); + throw new Error(res?.message || 'Transaction was not able to be processed'); return res; } -export async function cancelBan({ groupId, qortalAddress }) { +export async function cancelBan({ groupId, qortalAddress, txGroupId = 0 }) { const lastReference = await getLastRef(); const resKeyPair = await getKeyPair(); const parsedData = resKeyPair; @@ -2079,23 +2111,24 @@ export async function cancelBan({ groupId, qortalAddress }) { privateKey: uint8PrivateKey, publicKey: uint8PublicKey, }; - const feeres = await getFee("CANCEL_GROUP_BAN"); + const feeres = await getFee('CANCEL_GROUP_BAN'); const tx = await createTransaction(27, keyPair, { fee: feeres.fee, recipient: qortalAddress, rGroupId: groupId, lastReference: lastReference, + groupID: txGroupId, }); const signedBytes = Base58.encode(tx.signedBytes); const res = await processTransactionVersion2(signedBytes); if (!res?.signature) - throw new Error(res?.message || "Transaction was not able to be processed"); + throw new Error(res?.message || 'Transaction was not able to be processed'); return res; } -export async function registerName({ name, description = "" }) { +export async function registerName({ name, description = '' }) { const lastReference = await getLastRef(); const resKeyPair = await getKeyPair(); const parsedData = resKeyPair; @@ -2105,12 +2138,12 @@ export async function registerName({ name, description = "" }) { privateKey: uint8PrivateKey, publicKey: uint8PublicKey, }; - const feeres = await getFee("REGISTER_NAME"); + const feeres = await getFee('REGISTER_NAME'); const tx = await createTransaction(3, keyPair, { fee: feeres.fee, name, - value: description || "", + value: description || '', lastReference: lastReference, }); @@ -2118,7 +2151,7 @@ export async function registerName({ name, description = "" }) { const res = await processTransactionVersion2(signedBytes); if (!res?.signature) - throw new Error(res?.message || "Transaction was not able to be processed"); + throw new Error(res?.message || 'Transaction was not able to be processed'); return res; } export async function updateName({ newName, oldName, description }) { @@ -2131,13 +2164,13 @@ export async function updateName({ newName, oldName, description }) { privateKey: uint8PrivateKey, publicKey: uint8PublicKey, }; - const feeres = await getFee("UPDATE_NAME"); + const feeres = await getFee('UPDATE_NAME'); const tx = await createTransaction(4, keyPair, { fee: feeres.fee, name: oldName, newName, - newData: description || "", + newData: description || '', lastReference: lastReference, }); @@ -2145,10 +2178,10 @@ export async function updateName({ newName, oldName, description }) { const res = await processTransactionVersion2(signedBytes); if (!res?.signature) - throw new Error(res?.message || "Transaction was not able to be processed"); + throw new Error(res?.message || 'Transaction was not able to be processed'); return res; } -export async function makeAdmin({ groupId, qortalAddress }) { +export async function makeAdmin({ groupId, qortalAddress, txGroupId = 0 }) { const lastReference = await getLastRef(); const resKeyPair = await getKeyPair(); const parsedData = resKeyPair; @@ -2158,24 +2191,25 @@ export async function makeAdmin({ groupId, qortalAddress }) { privateKey: uint8PrivateKey, publicKey: uint8PublicKey, }; - const feeres = await getFee("ADD_GROUP_ADMIN"); + const feeres = await getFee('ADD_GROUP_ADMIN'); const tx = await createTransaction(24, keyPair, { fee: feeres.fee, recipient: qortalAddress, rGroupId: groupId, lastReference: lastReference, + groupID: txGroupId, }); const signedBytes = Base58.encode(tx.signedBytes); const res = await processTransactionVersion2(signedBytes); if (!res?.signature) - throw new Error(res?.message || "Transaction was not able to be processed"); + throw new Error(res?.message || 'Transaction was not able to be processed'); return res; } -export async function removeAdmin({ groupId, qortalAddress }) { +export async function removeAdmin({ groupId, qortalAddress, txGroupId = 0 }) { const lastReference = await getLastRef(); const resKeyPair = await getKeyPair(); const parsedData = resKeyPair; @@ -2185,28 +2219,30 @@ export async function removeAdmin({ groupId, qortalAddress }) { privateKey: uint8PrivateKey, publicKey: uint8PublicKey, }; - const feeres = await getFee("REMOVE_GROUP_ADMIN"); + const feeres = await getFee('REMOVE_GROUP_ADMIN'); const tx = await createTransaction(25, keyPair, { fee: feeres.fee, recipient: qortalAddress, rGroupId: groupId, lastReference: lastReference, + groupID: txGroupId, }); const signedBytes = Base58.encode(tx.signedBytes); const res = await processTransactionVersion2(signedBytes); if (!res?.signature) - throw new Error(res?.message || "Transaction was not able to be processed"); + throw new Error(res?.message || 'Transaction was not able to be processed'); return res; } export async function banFromGroup({ groupId, qortalAddress, - rBanReason = "", + rBanReason = '', rBanTime, + txGroupId = 0, }) { const lastReference = await getLastRef(); const resKeyPair = await getKeyPair(); @@ -2217,7 +2253,7 @@ export async function banFromGroup({ privateKey: uint8PrivateKey, publicKey: uint8PublicKey, }; - const feeres = await getFee("GROUP_BAN"); + const feeres = await getFee('GROUP_BAN'); const tx = await createTransaction(26, keyPair, { fee: feeres.fee, @@ -2226,20 +2262,22 @@ export async function banFromGroup({ rBanReason: rBanReason, rBanTime, lastReference: lastReference, + groupID: txGroupId, }); const signedBytes = Base58.encode(tx.signedBytes); const res = await processTransactionVersion2(signedBytes); if (!res?.signature) - throw new Error(res?.message || "Transaction was not able to be processed"); + throw new Error(res?.message || 'Transaction was not able to be processed'); return res; } export async function kickFromGroup({ groupId, qortalAddress, - rBanReason = "", + rBanReason = '', + txGroupId = 0, }) { const lastReference = await getLastRef(); const resKeyPair = await getKeyPair(); @@ -2250,7 +2288,7 @@ export async function kickFromGroup({ privateKey: uint8PrivateKey, publicKey: uint8PublicKey, }; - const feeres = await getFee("GROUP_KICK"); + const feeres = await getFee('GROUP_KICK'); const tx = await createTransaction(28, keyPair, { fee: feeres.fee, @@ -2258,13 +2296,42 @@ export async function kickFromGroup({ rGroupId: groupId, rBanReason: rBanReason, lastReference: lastReference, + groupID: txGroupId, }); const signedBytes = Base58.encode(tx.signedBytes); const res = await processTransactionVersion2(signedBytes); if (!res?.signature) - throw new Error(res?.message || "Transaction was not able to be processed"); + throw new Error(res?.message || 'Transaction was not able to be processed'); + return res; +} + +export async function transferAsset({ amount, recipient, assetId }) { + const lastReference = await getLastRef(); + const resKeyPair = await getKeyPair(); + const parsedData = resKeyPair; + const uint8PrivateKey = Base58.decode(parsedData.privateKey); + const uint8PublicKey = Base58.decode(parsedData.publicKey); + const keyPair = { + privateKey: uint8PrivateKey, + publicKey: uint8PublicKey, + }; + const feeres = await getFee('TRANSFER_ASSET'); + + const tx = await createTransaction(12, keyPair, { + fee: feeres.fee, + recipient: recipient, + amount: amount, + assetId: assetId, + lastReference: lastReference, + }); + + const signedBytes = Base58.encode(tx.signedBytes); + + const res = await processTransactionVersion2(signedBytes); + if (!res?.signature) + throw new Error(res?.message || 'Transaction was not able to be processed'); return res; } @@ -2278,9 +2345,9 @@ export async function createGroup({ }) { const wallet = await getSaveWallet(); const address = wallet.address0; - if (!address) throw new Error("Cannot find user"); + if (!address) throw new Error('Cannot find user'); const lastReference = await getLastRef(); - const feeres = await getFee("CREATE_GROUP"); + const feeres = await getFee('CREATE_GROUP'); const resKeyPair = await getKeyPair(); const parsedData = resKeyPair; const uint8PrivateKey = Base58.decode(parsedData.privateKey); @@ -2306,14 +2373,152 @@ export async function createGroup({ const res = await processTransactionVersion2(signedBytes); if (!res?.signature) - throw new Error(res?.message || "Transaction was not able to be processed"); + throw new Error(res?.message || 'Transaction was not able to be processed'); return res; } -export async function inviteToGroup({ groupId, qortalAddress, inviteTime }) { - const address = await getNameOrAddress(qortalAddress); - if (!address) throw new Error("Cannot find user"); +export async function sellName({ name, sellPrice }) { + const wallet = await getSaveWallet(); + const address = wallet.address0; + if (!address) throw new Error('Cannot find user'); const lastReference = await getLastRef(); - const feeres = await getFee("GROUP_INVITE"); + const feeres = await getFee('SELL_NAME'); + const resKeyPair = await getKeyPair(); + const parsedData = resKeyPair; + const uint8PrivateKey = Base58.decode(parsedData.privateKey); + const uint8PublicKey = Base58.decode(parsedData.publicKey); + const keyPair = { + privateKey: uint8PrivateKey, + publicKey: uint8PublicKey, + }; + + const tx = await createTransaction(5, keyPair, { + fee: feeres.fee, + name, + sellPrice: sellPrice, + lastReference: lastReference, + }); + + const signedBytes = Base58.encode(tx.signedBytes); + + const res = await processTransactionVersion2(signedBytes); + if (!res?.signature) + throw new Error(res?.message || 'Transaction was not able to be processed'); + return res; +} + +export async function cancelSellName({ name }) { + const wallet = await getSaveWallet(); + const address = wallet.address0; + if (!address) throw new Error('Cannot find user'); + const lastReference = await getLastRef(); + const feeres = await getFee('SELL_NAME'); + const resKeyPair = await getKeyPair(); + const parsedData = resKeyPair; + const uint8PrivateKey = Base58.decode(parsedData.privateKey); + const uint8PublicKey = Base58.decode(parsedData.publicKey); + const keyPair = { + privateKey: uint8PrivateKey, + publicKey: uint8PublicKey, + }; + + const tx = await createTransaction(6, keyPair, { + fee: feeres.fee, + name, + lastReference: lastReference, + }); + + const signedBytes = Base58.encode(tx.signedBytes); + + const res = await processTransactionVersion2(signedBytes); + if (!res?.signature) + throw new Error(res?.message || 'Transaction was not able to be processed'); + return res; +} + +export async function buyName({ name, sellerAddress, sellPrice }) { + const wallet = await getSaveWallet(); + const address = wallet.address0; + if (!address) throw new Error('Cannot find user'); + const lastReference = await getLastRef(); + const feeres = await getFee('BUY_NAME'); + const resKeyPair = await getKeyPair(); + const parsedData = resKeyPair; + const uint8PrivateKey = Base58.decode(parsedData.privateKey); + const uint8PublicKey = Base58.decode(parsedData.publicKey); + const keyPair = { + privateKey: uint8PrivateKey, + publicKey: uint8PublicKey, + }; + + const tx = await createTransaction(7, keyPair, { + fee: feeres.fee, + name, + sellPrice, + recipient: sellerAddress, + lastReference: lastReference, + }); + + const signedBytes = Base58.encode(tx.signedBytes); + + const res = await processTransactionVersion2(signedBytes); + if (!res?.signature) + throw new Error(res?.message || 'Transaction was not able to be processed'); + return res; +} +export async function updateGroup({ + groupId, + newOwner, + newIsOpen, + newDescription, + newApprovalThreshold, + newMinimumBlockDelay, + newMaximumBlockDelay, + txGroupId = 0, +}) { + const wallet = await getSaveWallet(); + const address = wallet.address0; + if (!address) throw new Error('Cannot find user'); + const lastReference = await getLastRef(); + const feeres = await getFee('UPDATE_GROUP'); + const resKeyPair = await getKeyPair(); + const parsedData = resKeyPair; + const uint8PrivateKey = Base58.decode(parsedData.privateKey); + const uint8PublicKey = Base58.decode(parsedData.publicKey); + const keyPair = { + privateKey: uint8PrivateKey, + publicKey: uint8PublicKey, + }; + + const tx = await createTransaction(23, keyPair, { + fee: feeres.fee, + _groupId: groupId, + newOwner, + newIsOpen, + newDescription, + newApprovalThreshold, + newMinimumBlockDelay, + newMaximumBlockDelay, + lastReference: lastReference, + groupID: txGroupId, + }); + + const signedBytes = Base58.encode(tx.signedBytes); + + const res = await processTransactionVersion2(signedBytes); + if (!res?.signature) + throw new Error(res?.message || 'Transaction was not able to be processed'); + return res; +} +export async function inviteToGroup({ + groupId, + qortalAddress, + inviteTime, + txGroupId = 0, +}) { + const address = await getNameOrAddress(qortalAddress); + if (!address) throw new Error('Cannot find user'); + const lastReference = await getLastRef(); + const feeres = await getFee('GROUP_INVITE'); const resKeyPair = await getKeyPair(); const parsedData = resKeyPair; const uint8PrivateKey = Base58.decode(parsedData.privateKey); @@ -2324,6 +2529,7 @@ export async function inviteToGroup({ groupId, qortalAddress, inviteTime }) { }; const tx = await createTransaction(29, keyPair, { + groupID: txGroupId, fee: feeres.fee, recipient: address, rGroupId: groupId, @@ -2335,7 +2541,7 @@ export async function inviteToGroup({ groupId, qortalAddress, inviteTime }) { const res = await processTransactionVersion2(signedBytes); if (!res?.signature) - throw new Error("Transaction was not able to be processed"); + throw new Error(res?.message || 'Transaction was not able to be processed'); return res; } @@ -2346,12 +2552,12 @@ export async function sendCoin( try { const confirmReceiver = await getNameOrAddress(receiver); if (confirmReceiver.error) - throw new Error("Invalid receiver address or name"); + throw new Error('Invalid receiver address or name'); const wallet = await getSaveWallet(); - let keyPair = ""; + let keyPair = ''; if (skipConfirmPassword) { const resKeyPair = await getKeyPair(); - + const parsedData = resKeyPair; const uint8PrivateKey = Base58.decode(parsedData.privateKey); const uint8PublicKey = Base58.decode(parsedData.publicKey); @@ -2361,7 +2567,10 @@ export async function sendCoin( }; } else { const response = await decryptStoredWallet(password, wallet); - const wallet2 = new PhraseWallet(response, wallet?.version || walletVersion); + const wallet2 = new PhraseWallet( + response, + wallet?.version || walletVersion + ); keyPair = wallet2._addresses[0].keyPair; } @@ -2394,7 +2603,7 @@ function fetchMessages(apiCall) { return new Promise((resolve, reject) => { const attemptFetch = async () => { if (Date.now() - startTime > maxDuration) { - return reject(new Error("Maximum polling time exceeded")); + return reject(new Error('Maximum polling time exceeded')); } try { @@ -2429,7 +2638,7 @@ async function fetchMessagesForBuyOrders(apiCall, signature, senderPublicKey) { return new Promise((resolve, reject) => { const attemptFetch = async () => { if (Date.now() - startTime > maxDuration) { - return reject(new Error("Maximum polling time exceeded")); + return reject(new Error('Maximum polling time exceeded')); } try { @@ -2485,7 +2694,7 @@ async function listenForChatMessage({ timestamp, }) { try { - let validApi = ""; + let validApi = ''; const checkIfNodeBaseUrlIsAcceptable = apiEndpoints.find( (item) => item === nodeBaseUrl ); @@ -2530,7 +2739,7 @@ async function listenForChatMessageForBuyOrder({ signature, }) { try { - let validApi = ""; + let validApi = ''; const checkIfNodeBaseUrlIsAcceptable = apiEndpoints.find( (item) => item === nodeBaseUrl ); @@ -2550,7 +2759,7 @@ async function listenForChatMessageForBuyOrder({ senderPublicKey ); - return parsedMessageObj + return parsedMessageObj; // chrome.tabs.query({}, function (tabs) { // tabs.forEach((tab) => { @@ -2608,7 +2817,7 @@ export async function setChatHeads(data) { storeData(`chatheads-${address}`, data) .then(() => resolve(true)) .catch((error) => { - reject(new Error(error.message || "Error saving data")); + reject(new Error(error.message || 'Error saving data')); }); }); } @@ -2671,7 +2880,7 @@ export async function saveTempPublish({ data, key }) { storeData(`tempPublish-${address}`, newTemp) .then(() => resolve(newTemp[key])) .catch((error) => { - reject(new Error(error.message || "Error saving data")); + reject(new Error(error.message || 'Error saving data')); }); }); } @@ -2683,7 +2892,7 @@ async function setChatHeadsDirect(data) { storeData(`chatheads-direct-${address}`, data) .then(() => resolve(true)) .catch((error) => { - reject(new Error(error.message || "Error saving data")); + reject(new Error(error.message || 'Error saving data')); }); }); } @@ -2700,6 +2909,7 @@ export async function getTimestampEnterChat() { return {}; } } + export async function getTimestampMention() { const wallet = await getSaveWallet(); const address = wallet.address0; @@ -2712,6 +2922,7 @@ export async function getTimestampMention() { return {}; } } + export async function getTimestampGroupAnnouncement() { const wallet = await getSaveWallet(); const address = wallet.address0; @@ -2741,7 +2952,7 @@ export async function addTimestampGroupAnnouncement({ storeData(`group-announcement-${address}`, data) .then(() => resolve(true)) .catch((error) => { - reject(new Error(error.message || "Error saving data")); + reject(new Error(error.message || 'Error saving data')); }); }); } @@ -2754,32 +2965,31 @@ export async function getTimestampLatestPayment() { if (res) { const parsedData = res; return parsedData; - } else return 0 + } else return 0; } export async function addTimestampLatestPayment(timestamp) { const wallet = await getSaveWallet(); const address = wallet.address0; - + return await new Promise((resolve, reject) => { storeData(`latest-payment-${address}`, timestamp) .then(() => resolve(true)) .catch((error) => { - reject(new Error(error.message || "Error saving data")); + reject(new Error(error.message || 'Error saving data')); }); }); } - export async function addEnteredQmailTimestamp() { const wallet = await getSaveWallet(); const address = wallet.address0; - + return await new Promise((resolve, reject) => { storeData(`qmail-entered-timestamp-${address}`, Date.now()) .then(() => resolve(true)) .catch((error) => { - reject(new Error(error.message || "Error saving data")); + reject(new Error(error.message || 'Error saving data')); }); }); } @@ -2793,7 +3003,7 @@ export async function getEnteredQmailTimestamp() { const parsedData = res; return parsedData; } else { - return null + return null; } } @@ -2809,6 +3019,7 @@ async function getGroupData() { return {}; } } + export async function getGroupDataSingle(groupId) { const wallet = await getSaveWallet(); const address = wallet.address0; @@ -2841,7 +3052,7 @@ export async function setGroupData({ storeData(`group-data-${address}`, data) .then(() => resolve(true)) .catch((error) => { - reject(new Error(error.message || "Error saving data")); + reject(new Error(error.message || 'Error saving data')); }); }); } @@ -2855,7 +3066,7 @@ export async function addTimestampEnterChat({ groupId, timestamp }) { storeData(`enter-chat-timestamp-${address}`, data) .then(() => resolve(true)) .catch((error) => { - reject(new Error(error.message || "Error saving data")); + reject(new Error(error.message || 'Error saving data')); }); }); } @@ -2869,12 +3080,11 @@ export async function addTimestampMention({ groupId, timestamp }) { storeData(`enter-mention-timestamp-${address}`, data) .then(() => resolve(true)) .catch((error) => { - reject(new Error(error.message || "Error saving data")); + reject(new Error(error.message || 'Error saving data')); }); }); } - export async function notifyAdminRegenerateSecretKey({ groupName, adminAddress, @@ -2901,7 +3111,7 @@ async function getChatHeads() { const parsedData = res; return parsedData; } else { - throw new Error("No Chatheads saved"); + throw new Error('No Chatheads saved'); } } @@ -2914,22 +3124,22 @@ async function getChatHeadsDirect() { const parsedData = res; return parsedData; } else { - throw new Error("No Chatheads saved"); + throw new Error('No Chatheads saved'); } } function setupMessageListener() { - window.addEventListener("message", async (event) => { + window.addEventListener('message', async (event) => { if (event.origin !== window.location.origin) { return; } const request = event.data; // Check if the message is intended for this listener - if (request?.type !== "backgroundMessage") return; // Only process messages of type 'backgroundMessage' + if (request?.type !== 'backgroundMessage') return; // Only process messages of type 'backgroundMessage' switch (request.action) { - case "version": + case 'version': versionCase(request, event); break; @@ -2937,208 +3147,199 @@ function setupMessageListener() { // storeWalletInfoCase(request, event); // break; - case "getWalletInfo": + case 'getWalletInfo': getWalletInfoCase(request, event); break; - - case "validApi": + case 'validApi': validApiCase(request, event); break; - - case "name": + case 'name': nameCase(request, event); break; - case "userInfo": + case 'userInfo': userInfoCase(request, event); break; - case "decryptWallet": + case 'decryptWallet': decryptWalletCase(request, event); break; - case "balance": + case 'balance': balanceCase(request, event); break; - case "ltcBalance": + case 'ltcBalance': ltcBalanceCase(request, event); break; - case "sendCoin": + case 'sendCoin': sendCoinCase(request, event); break; - case "inviteToGroup": + case 'inviteToGroup': inviteToGroupCase(request, event); break; - case "saveTempPublish": + case 'saveTempPublish': saveTempPublishCase(request, event); break; - case "getTempPublish": + case 'getTempPublish': getTempPublishCase(request, event); break; - case "createGroup": + case 'createGroup': createGroupCase(request, event); break; - case "cancelInvitationToGroup": + case 'cancelInvitationToGroup': cancelInvitationToGroupCase(request, event); break; - case "leaveGroup": + case 'leaveGroup': leaveGroupCase(request, event); break; - case "joinGroup": + case 'joinGroup': joinGroupCase(request, event); break; - case "kickFromGroup": + case 'kickFromGroup': kickFromGroupCase(request, event); break; - case "banFromGroup": + case 'banFromGroup': banFromGroupCase(request, event); break; - - case "addDataPublishes": + case 'addDataPublishes': addDataPublishesCase(request, event); break; - - case "getDataPublishes": + case 'getDataPublishes': getDataPublishesCase(request, event); break; - case "addUserSettings": + case 'addUserSettings': addUserSettingsCase(request, event); break; - case "cancelBan": + case 'cancelBan': cancelBanCase(request, event); break; - case "registerName": + case 'registerName': registerNameCase(request, event); break; - case "createPoll": + case 'createPoll': createPollCase(request, event); break; - case "voteOnPoll": + case 'voteOnPoll': voteOnPollCase(request, event); - break; - case "makeAdmin": + break; + case 'makeAdmin': makeAdminCase(request, event); break; - case "removeAdmin": + case 'removeAdmin': removeAdminCase(request, event); break; - case "notification": - notificationCase(request, event); - break; - - case "addTimestampEnterChat": + case 'addTimestampEnterChat': addTimestampEnterChatCase(request, event); break; - case "setApiKey": + case 'setApiKey': setApiKeyCase(request, event); break; - case "setCustomNodes": + case 'setCustomNodes': setCustomNodesCase(request, event); - case "getApiKey": + break; + case 'getApiKey': getApiKeyCase(request, event); break; - case "getCustomNodesFromStorage": + case 'getCustomNodesFromStorage': getCustomNodesFromStorageCase(request, event); break; - case "notifyAdminRegenerateSecretKey": + case 'notifyAdminRegenerateSecretKey': notifyAdminRegenerateSecretKeyCase(request, event); break; - case "addGroupNotificationTimestamp": + case 'addGroupNotificationTimestamp': addGroupNotificationTimestampCase(request, event); break; - case "clearAllNotifications": - clearAllNotificationsCase(request, event); - break; - case "setGroupData": + case 'setGroupData': setGroupDataCase(request, event); break; - case "getGroupDataSingle": + case 'getGroupDataSingle': getGroupDataSingleCase(request, event); break; - case "getTimestampEnterChat": + case 'getTimestampEnterChat': getTimestampEnterChatCase(request, event); break; - case "listActions": - listActionsCase(request, event); - break; - case "addTimestampMention": - addTimestampMentionCase(request, event); - break; - case "getTimestampMention": - getTimestampMentionCase(request, event); - break; - case "getGroupNotificationTimestamp": + case 'listActions': + listActionsCase(request, event); + break; + case 'addTimestampMention': + addTimestampMentionCase(request, event); + break; + case 'getTimestampMention': + getTimestampMentionCase(request, event); + break; + case 'getGroupNotificationTimestamp': getGroupNotificationTimestampCase(request, event); break; - case "encryptAndPublishSymmetricKeyGroupChat": + case 'encryptAndPublishSymmetricKeyGroupChat': encryptAndPublishSymmetricKeyGroupChatCase(request, event); break; - case "encryptAndPublishSymmetricKeyGroupChatForAdmins": + case 'encryptAndPublishSymmetricKeyGroupChatForAdmins': encryptAndPublishSymmetricKeyGroupChatForAdminsCase(request, event); break; - case "publishGroupEncryptedResource": + case 'publishGroupEncryptedResource': publishGroupEncryptedResourceCase(request, event); break; - case "publishOnQDN": + case 'publishOnQDN': publishOnQDNCase(request, event); break; - case "getUserSettings": + case 'getUserSettings': getUserSettingsCase(request, event); break; - case "handleActiveGroupDataFromSocket": + case 'handleActiveGroupDataFromSocket': handleActiveGroupDataFromSocketCase(request, event); break; - case "getThreadActivity": + case 'getThreadActivity': getThreadActivityCase(request, event); break; - case "updateThreadActivity": + case 'updateThreadActivity': updateThreadActivityCase(request, event); - case "decryptGroupEncryption": + break; + case 'decryptGroupEncryption': decryptGroupEncryptionCase(request, event); break; - case "encryptSingle": + case 'encryptSingle': encryptSingleCase(request, event); break; - case "decryptSingle": + case 'decryptSingle': decryptSingleCase(request, event); break; - case "pauseAllQueues": + case 'pauseAllQueues': pauseAllQueuesCase(request, event); break; - case "resumeAllQueues": + case 'resumeAllQueues': resumeAllQueuesCase(request, event); break; - case "checkLocal": + case 'checkLocal': checkLocalCase(request, event); break; - case "decryptSingleForPublishes": + case 'decryptSingleForPublishes': decryptSingleForPublishesCase(request, event); break; - case "decryptDirect": + case 'decryptDirect': decryptDirectCase(request, event); break; - case "sendChatGroup": + case 'sendChatGroup': sendChatGroupCase(request, event); break; - case "sendChatDirect": + case 'sendChatDirect': sendChatDirectCase(request, event); break; - case "setupGroupWebsocket": + case 'setupGroupWebsocket': setupGroupWebsocketCase(request, event); break; - case "createRewardShare": + case 'createRewardShare': createRewardShareCase(request, event); break; - case "getRewardSharePrivateKey": - getRewardSharePrivateKeyCase(request, event); - break; - case "removeRewardShare" : + case 'getRewardSharePrivateKey': + getRewardSharePrivateKeyCase(request, event); + break; + case 'removeRewardShare': removeRewardShareCase(request, event); break; - case "addEnteredQmailTimestamp": + case 'addEnteredQmailTimestamp': addEnteredQmailTimestampCase(request, event); break; - case "getEnteredQmailTimestamp": + case 'getEnteredQmailTimestamp': getEnteredQmailTimestampCase(request, event); break; - case "logout": + case 'logout': { try { const logoutFunc = async () => { @@ -3148,16 +3349,16 @@ function setupMessageListener() { // for announcement notification clearInterval(interval); } - groupSecretkeys = {} + groupSecretkeys = {}; const wallet = await getSaveWallet(); const address = wallet.address0; const key1 = `tempPublish-${address}`; const key2 = `group-data-${address}`; const key3 = `${address}-publishData`; const keysToRemove = [ - "keyPair", - "walletInfo", - "active-groups-directs", + 'keyPair', + 'walletInfo', + 'active-groups-directs', key1, key2, key3, @@ -3166,7 +3367,9 @@ function setupMessageListener() { removeKeysAndLogout(keysToRemove, event, request); }; logoutFunc(); - } catch (error) {} + } catch (error) { + console.log(error); + } } break; @@ -3182,23 +3385,25 @@ const checkGroupList = async () => { try { const wallet = await getSaveWallet(); const address = wallet.address0; - const url = await createEndpoint(`/chat/active/${address}?encoding=BASE64&haschatreference=false`); + const url = await createEndpoint( + `/chat/active/${address}?encoding=BASE64&haschatreference=false` + ); const response = await fetch(url, { - method: "GET", + method: 'GET', headers: { - "Content-Type": "application/json", + 'Content-Type': 'application/json', }, }); const data = await response.json(); - const copyGroups = [...(data?.groups || [])] - const findIndex = copyGroups?.findIndex(item => item?.groupId === 0) - if(findIndex !== -1){ - copyGroups[findIndex] = { - ...(copyGroups[findIndex] || {}), - groupId: "0" - } - } - const filteredGroups = copyGroups + const copyGroups = [...(data?.groups || [])]; + const findIndex = copyGroups?.findIndex((item) => item?.groupId === 0); + if (findIndex !== -1) { + copyGroups[findIndex] = { + ...(copyGroups[findIndex] || {}), + groupId: '0', + }; + } + const filteredGroups = copyGroups; const sortedGroups = filteredGroups.sort( (a, b) => (b.timestamp || 0) - (a.timestamp || 0) @@ -3206,8 +3411,8 @@ const checkGroupList = async () => { const sortedDirects = (data?.direct || []) .filter( (item) => - item?.name !== "extension-proxy" && - item?.address !== "QSMMGSgysEuqDCuLw3S4cHrQkBrh3vP3VH" + item?.name !== 'extension-proxy' && + item?.address !== 'QSMMGSgysEuqDCuLw3S4cHrQkBrh3vP3VH' // TODO put address in a specific file ) .sort((a, b) => (b.timestamp || 0) - (a.timestamp || 0)); @@ -3216,24 +3421,23 @@ const checkGroupList = async () => { directs: sortedDirects, }); } catch (error) { - console.error(error); - } finally { + console.log(error); } }; export const checkNewMessages = async () => { try { - let mutedGroups = (await getUserSettings({ key: "mutedGroups" })) || []; + let mutedGroups = (await getUserSettings({ key: 'mutedGroups' })) || []; if (!isArray(mutedGroups)) mutedGroups = []; - mutedGroups.push('0') - let myName = ""; + mutedGroups.push('0'); + let myName = ''; const userData = await getUserInfo(); if (userData?.name) { myName = userData.name; } - let newAnnouncements = []; - const activeData = (await getStoredData("active-groups-directs")) || { + const newAnnouncements = []; + const activeData = (await getStoredData('active-groups-directs')) || { groups: [], directs: [], }; @@ -3251,9 +3455,9 @@ export const checkNewMessages = async () => { ); const response = await requestQueueAnnouncements.enqueue(() => { return fetch(url, { - method: "GET", + method: 'GET', headers: { - "Content-Type": "application/json", + 'Content-Type': 'application/json', }, }); }); @@ -3262,6 +3466,7 @@ export const checkNewMessages = async () => { const latestMessage = responseData.filter( (pub) => pub?.name !== myName )[0]; + if (!latestMessage) { return; // continue to the next group } @@ -3284,8 +3489,9 @@ export const checkNewMessages = async () => { } }) ); - let isDisableNotifications = - (await getUserSettings({ key: "disable-push-notifications" })) || false; + + const isDisableNotifications = + (await getUserSettings({ key: 'disable-push-notifications' })) || false; if ( newAnnouncements.length > 0 && @@ -3293,19 +3499,20 @@ export const checkNewMessages = async () => { !isDisableNotifications ) { // Create a unique notification ID with type and group announcement details - const notificationId = - encodeURIComponent("chat_notification_" + - Date.now() + - "_type=group-announcement" + - `_from=${newAnnouncements[0]?.groupId}`); + const notificationId = encodeURIComponent( + 'chat_notification_' + + Date.now() + + '_type=group-announcement' + + `_from=${newAnnouncements[0]?.groupId}` + ); - const title = "New group announcement!"; + const title = 'New group announcement!'; const body = `You have received a new announcement from ${newAnnouncements[0]?.groupName}`; // Create and show the notification const notification = new window.Notification(title, { body, - icon: window.location.origin + "/qortal192.png", + icon: window.location.origin + '/qortal192.png', data: { id: notificationId }, }); @@ -3325,75 +3532,68 @@ export const checkNewMessages = async () => { window.postMessage( { - action: "SET_GROUP_ANNOUNCEMENTS", + action: 'SET_GROUP_ANNOUNCEMENTS', payload: savedtimestampAfter, }, targetOrigin ); } catch (error) { - } finally { + console.log(error); } }; export const checkPaymentsForNotifications = async (address) => { try { const isDisableNotifications = - (await getUserSettings({ key: "disable-push-notifications" })) || false; - if(isDisableNotifications) return - let latestPayment = null - const savedtimestamp = await getTimestampLatestPayment(); + (await getUserSettings({ key: 'disable-push-notifications' })) || false; + if (isDisableNotifications) return; + let latestPayment = null; + const savedtimestamp = await getTimestampLatestPayment(); - const url = await createEndpoint( - `/transactions/search?txType=PAYMENT&address=${address}&confirmationStatus=CONFIRMED&limit=5&reverse=true` - ); - - const response = await fetch(url, { - method: "GET", - headers: { - "Content-Type": "application/json", - }, - }); - - const responseData = await response.json(); + const url = await createEndpoint( + `/transactions/search?txType=PAYMENT&address=${address}&confirmationStatus=CONFIRMED&limit=5&reverse=true` + ); - const latestTx = responseData.filter( - (tx) => tx?.creatorAddress !== address && tx?.recipient === address - )[0]; - if (!latestTx) { - return; // continue to the next group - } - if ( - checkDifference(latestTx.timestamp) && - (!savedtimestamp || - latestTx.timestamp > - savedtimestamp) - ) { - if(latestTx.timestamp){ - latestPayment = latestTx - await addTimestampLatestPayment(latestTx.timestamp); - } - - // save new timestamp - } - - + const response = await fetch(url, { + method: 'GET', + headers: { + 'Content-Type': 'application/json', + }, + }); + const responseData = await response.json(); + + const latestTx = responseData.filter( + (tx) => tx?.creatorAddress !== address && tx?.recipient === address + )[0]; + if (!latestTx) { + return; // continue to the next group + } if ( - latestPayment + checkDifference(latestTx.timestamp) && + (!savedtimestamp || latestTx.timestamp > savedtimestamp) ) { - // Create a unique notification ID with type and group announcement details - const notificationId = - encodeURIComponent("payment_notification_" + - Date.now() + - "_type=payment-announcement"); + if (latestTx.timestamp) { + latestPayment = latestTx; + await addTimestampLatestPayment(latestTx.timestamp); + } - const title = "New payment!"; + // save new timestamp + } + + if (latestPayment) { + // Create a unique notification ID with type and group announcement details + const notificationId = encodeURIComponent( + 'payment_notification_' + Date.now() + '_type=payment-announcement' + ); + + const title = 'New payment!'; const body = `You have received a new payment of ${latestPayment?.amount} QORT`; // Create and show the notification const notification = new window.Notification(title, { body, - icon: window.location.origin + "/qortal192.png", + icon: window.location.origin + '/qortal192.png', data: { id: notificationId }, }); @@ -3412,33 +3612,34 @@ export const checkPaymentsForNotifications = async (address) => { window.postMessage( { - action: "SET_PAYMENT_ANNOUNCEMENT", + action: 'SET_PAYMENT_ANNOUNCEMENT', payload: latestPayment, }, targetOrigin ); } - } catch (error) { - console.error(error) - } + console.error(error); + } }; const checkActiveChatsForNotifications = async () => { try { checkGroupList(); - } catch (error) {} + } catch (error) { + console.log(error); + } }; export const checkThreads = async (bringBack) => { try { - let myName = ""; + let myName = ''; const userData = await getUserInfo(); if (userData?.name) { myName = userData.name; } - let newAnnouncements = []; - let dataToBringBack = []; + const newAnnouncements = []; + const dataToBringBack = []; const threadActivity = await getThreadActivity(); if (!threadActivity) return null; @@ -3453,15 +3654,14 @@ export const checkThreads = async (bringBack) => { for (const thread of selectedThreads) { try { const identifier = `thmsg-${thread?.threadId}`; - const name = thread?.qortalName; const endpoint = await getArbitraryEndpoint(); const url = await createEndpoint( `${endpoint}?mode=ALL&service=DOCUMENT&identifier=${identifier}&limit=1&includemetadata=false&offset=${0}&reverse=true&prefix=true` ); const response = await fetch(url, { - method: "GET", + method: 'GET', headers: { - "Content-Type": "application/json", + 'Content-Type': 'application/json', }, }); const responseData = await response.json(); @@ -3469,7 +3669,6 @@ export const checkThreads = async (bringBack) => { const latestMessage = responseData.filter( (pub) => pub?.name !== myName )[0]; - // const latestMessage = responseData[0] if (!latestMessage) { continue; @@ -3487,7 +3686,7 @@ export const checkThreads = async (bringBack) => { dataToBringBack.push(thread); } } catch (error) { - conosle.log({ error }); + console.log({ error }); } } @@ -3537,29 +3736,28 @@ export const checkThreads = async (bringBack) => { chrome.storage.local.set({ [`threadactivity-${address}`]: dataString }); if (newAnnouncements.length > 0) { - const notificationId = - encodeURIComponent("chat_notification_" + - Date.now() + - "_type=thread-post" + - `_data=${JSON.stringify(newAnnouncements[0])}`); - let isDisableNotifications = - (await getUserSettings({ key: "disable-push-notifications" })) || false; + const notificationId = encodeURIComponent( + 'chat_notification_' + + Date.now() + + '_type=thread-post' + + `_data=${JSON.stringify(newAnnouncements[0])}` + ); + const isDisableNotifications = + (await getUserSettings({ key: 'disable-push-notifications' })) || false; if (!isDisableNotifications) { - - // Check user settings to see if notifications are disabled const isDisableNotifications = - (await getUserSettings({ key: "disable-push-notifications" })) || + (await getUserSettings({ key: 'disable-push-notifications' })) || false; if (!isDisableNotifications) { - const title = "New thread post!"; + const title = 'New thread post!'; const body = `New post in ${newAnnouncements[0]?.thread?.threadData?.title}`; // Create and show the notification const notification = new window.Notification(title, { body, - icon: window.location.origin + "/qortal192.png", + icon: window.location.origin + '/qortal192.png', data: { id: notificationId }, }); @@ -3581,79 +3779,59 @@ export const checkThreads = async (bringBack) => { window.postMessage( { - action: "SET_GROUP_ANNOUNCEMENTS", + action: 'SET_GROUP_ANNOUNCEMENTS', payload: savedtimestampAfter, }, targetOrigin ); } catch (error) { - } finally { + console.log(error); } }; -// Configure Background Fetch -// BackgroundFetch.configure({ -// minimumFetchInterval: 15, // Minimum 15-minute interval -// enableHeadless: true, // Enable headless mode for Android -// }, async (taskId) => { -// // This is where your background task logic goes -// const wallet = await getSaveWallet(); -// const address = wallet.address0; -// if (!address) return; -// checkActiveChatsForNotifications(); -// checkNewMessages(); -// checkThreads(); - -// await new Promise((res)=> { -// setTimeout(() => { -// res() -// }, 55000); -// }) -// // Always finish the task when complete -// BackgroundFetch.finish(taskId); -// }, (taskId) => { -// // Optional timeout callback -// BackgroundFetch.finish(taskId); -// }); - -let notificationCheckInterval -let paymentsCheckInterval +let notificationCheckInterval; +let paymentsCheckInterval; const createNotificationCheck = () => { // Check if an interval already exists before creating it if (!notificationCheckInterval) { - notificationCheckInterval = setInterval(async () => { - try { - // This would replace the Chrome alarm callback - const wallet = await getSaveWallet(); - const address = wallet?.address0; - if (!address) return; + notificationCheckInterval = setInterval( + async () => { + try { + // This would replace the Chrome alarm callback + const wallet = await getSaveWallet(); + const address = wallet?.address0; + if (!address) return; - checkActiveChatsForNotifications(); - checkNewMessages(); - checkThreads(); - } catch (error) { - console.error('Error checking notifications:', error); - } - }, 10 * 60 * 1000); // 10 minutes + checkActiveChatsForNotifications(); + checkNewMessages(); + checkThreads(); + } catch (error) { + console.error('Error checking notifications:', error); + } + }, + 10 * 60 * 1000 + ); // 10 minutes } if (!paymentsCheckInterval) { - paymentsCheckInterval = setInterval(async () => { - try { - // This would replace the Chrome alarm callback - const wallet = await getSaveWallet(); - const address = wallet?.address0; - if (!address) return; + paymentsCheckInterval = setInterval( + async () => { + try { + // This would replace the Chrome alarm callback + const wallet = await getSaveWallet(); + const address = wallet?.address0; + if (!address) return; - checkPaymentsForNotifications(address); - - } catch (error) { - console.error('Error checking payments:', error); - } - }, 3 * 60 * 1000); // 3 minutes + checkPaymentsForNotifications(address); + } catch (error) { + console.error('Error checking payments:', error); + } + }, + 3 * 60 * 1000 + ); // 3 minutes } }; // Call this function when initializing your app -createNotificationCheck(); \ No newline at end of file +createNotificationCheck(); diff --git a/src/backgroundFunctions/encryption.ts b/src/backgroundFunctions/encryption.ts deleted file mode 100644 index 8c7ec8b..0000000 --- a/src/backgroundFunctions/encryption.ts +++ /dev/null @@ -1,327 +0,0 @@ -import { getBaseApi } from "../background"; -import { createSymmetricKeyAndNonce, decryptGroupData, encryptDataGroup, objectToBase64 } from "../qdn/encryption/group-encryption"; -import { publishData } from "../qdn/publish/pubish"; -import { getData } from "../utils/chromeStorage"; -import { RequestQueueWithPromise } from "../utils/queue/queue"; - - -export const requestQueueGetPublicKeys = new RequestQueueWithPromise(10); - -const apiEndpoints = [ - "https://api.qortal.org", - "https://api2.qortal.org", - "https://appnode.qortal.org", - "https://apinode.qortalnodes.live", - "https://apinode1.qortalnodes.live", - "https://apinode2.qortalnodes.live", - "https://apinode3.qortalnodes.live", - "https://apinode4.qortalnodes.live", -]; - -async function findUsableApi() { - for (const endpoint of apiEndpoints) { - try { - const response = await fetch(`${endpoint}/admin/status`); - if (!response.ok) throw new Error("Failed to fetch"); - - const data = await response.json(); - if (data.isSynchronizing === false && data.syncPercent === 100) { - console.log(`Usable API found: ${endpoint}`); - return endpoint; - } else { - console.log(`API not ready: ${endpoint}`); - } - } catch (error) { - console.error(`Error checking API ${endpoint}:`, error); - } - } - - throw new Error("No usable API found"); - } - - -async function getSaveWallet() { - const res = await getData("walletInfo").catch(() => null); - - if (res) { - return res - } else { - throw new Error("No wallet saved"); - } - } -export async function getNameInfo() { - const wallet = await getSaveWallet(); - const address = wallet.address0; - const validApi = await getBaseApi() - const response = await fetch(validApi + "/names/address/" + address); - const nameData = await response.json(); - if (nameData?.length > 0) { - return nameData[0].name; - } else { - return ""; - } - } -async function getKeyPair() { - const res = await getData("keyPair").catch(() => null); - if (res) { - return res - } else { - throw new Error("Wallet not authenticated"); - } - } - const getPublicKeys = async (groupNumber: number) => { - const validApi = await getBaseApi(); - const response = await fetch(`${validApi}/groups/members/${groupNumber}?limit=0`); - const groupData = await response.json(); - - if (groupData && Array.isArray(groupData.members)) { - // Use the request queue for fetching public keys - const memberPromises = groupData.members - .filter((member) => member.member) - .map((member) => - requestQueueGetPublicKeys.enqueue(async () => { - const resAddress = await fetch(`${validApi}/addresses/${member.member}`); - const resData = await resAddress.json(); - return resData.publicKey; - }) - ); - - const members = await Promise.all(memberPromises); - return members; - } - - return []; - }; - - export const getPublicKeysByAddress = async (admins: string[]) => { - const validApi = await getBaseApi(); - - if (Array.isArray(admins)) { - // Use the request queue to limit concurrent fetches - const memberPromises = admins - .filter((address) => address) // Ensure the address is valid - .map((address) => - requestQueueGetPublicKeys.enqueue(async () => { - const resAddress = await fetch(`${validApi}/addresses/${address}`); - const resData = await resAddress.json(); - return resData.publicKey; - }) - ); - - const members = await Promise.all(memberPromises); - return members; - } - - return []; // Return empty array if admins is not an array - }; - - - - -export const encryptAndPublishSymmetricKeyGroupChat = async ({groupId, previousData}: { - groupId: number, - previousData: Object, -}) => { - try { - - let highestKey = 0 - if(previousData){ - highestKey = Math.max(...Object.keys((previousData || {})).filter(item=> !isNaN(+item)).map(Number)); - - } - - const resKeyPair = await getKeyPair() - const parsedData = resKeyPair - const privateKey = parsedData.privateKey - const userPublicKey = parsedData.publicKey - const groupmemberPublicKeys = await getPublicKeys(groupId) - const symmetricKey = createSymmetricKeyAndNonce() - const nextNumber = highestKey + 1 - const objectToSave = { - ...previousData, - [nextNumber]: symmetricKey - } - - const symmetricKeyAndNonceBase64 = await objectToBase64(objectToSave) - - const encryptedData = encryptDataGroup({ - data64: symmetricKeyAndNonceBase64, - publicKeys: groupmemberPublicKeys, - privateKey, - userPublicKey - }) - if(encryptedData){ - const registeredName = await getNameInfo() - const data = await publishData({ - registeredName, file: encryptedData, service: 'DOCUMENT_PRIVATE', identifier: `symmetric-qchat-group-${groupId}`, uploadType: 'file', isBase64: true, withFee: true - }) - return { - data, - numberOfMembers: groupmemberPublicKeys.length - } - - } else { - throw new Error('Cannot encrypt content') - } - } catch (error: any) { - throw new Error(error.message); - } -} -export const encryptAndPublishSymmetricKeyGroupChatForAdmins = async ({groupId, previousData, admins}: { - groupId: number, - previousData: Object, -}) => { - try { - - let highestKey = 0 - if(previousData){ - highestKey = Math.max(...Object.keys((previousData || {})).filter(item=> !isNaN(+item)).map(Number)); - - } - - const resKeyPair = await getKeyPair() - const parsedData = resKeyPair - const privateKey = parsedData.privateKey - const userPublicKey = parsedData.publicKey - const groupmemberPublicKeys = await getPublicKeysByAddress(admins.map((admin)=> admin.address)) - - - const symmetricKey = createSymmetricKeyAndNonce() - const nextNumber = highestKey + 1 - const objectToSave = { - ...previousData, - [nextNumber]: symmetricKey - } - - const symmetricKeyAndNonceBase64 = await objectToBase64(objectToSave) - - const encryptedData = encryptDataGroup({ - data64: symmetricKeyAndNonceBase64, - publicKeys: groupmemberPublicKeys, - privateKey, - userPublicKey - }) - if(encryptedData){ - const registeredName = await getNameInfo() - const data = await publishData({ - registeredName, file: encryptedData, service: 'DOCUMENT_PRIVATE', identifier: `admins-symmetric-qchat-group-${groupId}`, uploadType: 'file', isBase64: true, withFee: true - }) - return { - data, - numberOfMembers: groupmemberPublicKeys.length - } - - } else { - throw new Error('Cannot encrypt content') - } - } catch (error: any) { - throw new Error(error.message); - } -} -export const publishGroupEncryptedResource = async ({encryptedData, identifier}) => { - try { - - if(encryptedData && identifier){ - const registeredName = await getNameInfo() - if(!registeredName) throw new Error('You need a name to publish') - const data = await publishData({ - registeredName, file: encryptedData, service: 'DOCUMENT', identifier, uploadType: 'file', isBase64: true, withFee: true - }) - return data - - } else { - throw new Error('Cannot encrypt content') - } - } catch (error: any) { - throw new Error(error.message); - } -} -export const publishOnQDN = async ({data, identifier, service, title, - description, - category, - tag1, - tag2, - tag3, - tag4, - tag5, - uploadType = 'file' -}) => { - - if(data && service){ - const registeredName = await getNameInfo() - if(!registeredName) throw new Error('You need a name to publish') - - const res = await publishData({ - registeredName, file: data, service, identifier, uploadType, isBase64: true, withFee: true, title, - description, - category, - tag1, - tag2, - tag3, - tag4, - tag5 - - }) - return res - - - - } else { - throw new Error('Cannot publish content') - } - -} - -export function uint8ArrayToBase64(uint8Array: any) { - const length = uint8Array.length - let binaryString = '' - const chunkSize = 1024 * 1024; // Process 1MB at a time - for (let i = 0; i < length; i += chunkSize) { - const chunkEnd = Math.min(i + chunkSize, length) - const chunk = uint8Array.subarray(i, chunkEnd) - - // @ts-ignore - binaryString += Array.from(chunk, byte => String.fromCharCode(byte)).join('') - } - return btoa(binaryString) -} - -export function base64ToUint8Array(base64: string) { - const binaryString = atob(base64) - const len = binaryString.length - const bytes = new Uint8Array(len) - - for (let i = 0; i < len; i++) { - bytes[i] = binaryString.charCodeAt(i) - } - - return bytes - } - -export const decryptGroupEncryption = async ({data}: { - data: string -}) => { - try { - const resKeyPair = await getKeyPair() - const parsedData = resKeyPair - const privateKey = parsedData.privateKey - const encryptedData = decryptGroupData( - data, - privateKey, - ) - return { - data: uint8ArrayToBase64(encryptedData.decryptedData), - count: encryptedData.count - } - } catch (error: any) { - throw new Error(error.message); - } -} - -export function uint8ArrayToObject(uint8Array: any) { - // Decode the byte array using TextDecoder - const decoder = new TextDecoder() - const jsonString = decoder.decode(uint8Array) - // Convert the JSON string back into an object - return JSON.parse(jsonString) -} \ No newline at end of file diff --git a/src/common/BoundedNumericTextField.tsx b/src/common/BoundedNumericTextField.tsx index c997f8a..b3c995e 100644 --- a/src/common/BoundedNumericTextField.tsx +++ b/src/common/BoundedNumericTextField.tsx @@ -1,17 +1,17 @@ import { IconButton, InputAdornment, - TextField, TextFieldProps, -} from "@mui/material"; -import React, { useRef, useState } from "react"; -import AddIcon from "@mui/icons-material/Add"; -import RemoveIcon from "@mui/icons-material/Remove"; + useTheme, +} from '@mui/material'; +import React, { useRef, useState } from 'react'; +import AddIcon from '@mui/icons-material/Add'; +import RemoveIcon from '@mui/icons-material/Remove'; import { removeTrailingZeros, setNumberWithinBounds, -} from "./numberFunctions.ts"; -import { CustomInput } from "../App-styles.ts"; +} from './numberFunctions.ts'; +import { CustomInput } from '../styles/App-styles.ts'; type eventType = React.ChangeEvent; type BoundedNumericTextFieldProps = { @@ -37,18 +37,19 @@ export const BoundedNumericTextField = ({ ...props }: BoundedNumericTextFieldProps) => { const [textFieldValue, setTextFieldValue] = useState( - initialValue || "" + initialValue || '' ); const ref = useRef(null); const stringIsEmpty = (value: string) => { - return value === ""; + return value === ''; }; + const theme = useTheme(); const isAllZerosNum = /^0*\.?0*$/; const isFloatNum = /^-?[0-9]*\.?[0-9]*$/; const isIntegerNum = /^-?[0-9]+$/; const skipMinMaxCheck = (value: string) => { - const lastIndexIsDecimal = value.charAt(value.length - 1) === "."; + const lastIndexIsDecimal = value.charAt(value.length - 1) === '.'; const isEmpty = stringIsEmpty(value); const isAllZeros = isAllZerosNum.test(value); const isInteger = isIntegerNum.test(value); @@ -69,7 +70,7 @@ export const BoundedNumericTextField = ({ const getSigDigits = (number: string) => { if (isIntegerNum.test(number)) return 0; - const decimalSplit = number.split("."); + const decimalSplit = number.split('.'); return decimalSplit[decimalSplit.length - 1].length; }; @@ -78,15 +79,16 @@ export const BoundedNumericTextField = ({ }; const filterTypes = (value: string) => { - if (allowDecimals === false) value = value.replace(".", ""); - if (allowNegatives === false) value = value.replace("-", ""); + if (allowDecimals === false) value = value.replace('.', ''); + if (allowNegatives === false) value = value.replace('-', ''); if (sigDigitsExceeded(value, maxSigDigits)) { value = value.substring(0, value.length - 1); } return value; }; + const filterValue = (value: string) => { - if (stringIsEmpty(value)) return ""; + if (stringIsEmpty(value)) return ''; value = filterTypes(value); if (isFloatNum.test(value)) { return setMinMaxValue(value); @@ -109,8 +111,8 @@ export const BoundedNumericTextField = ({ const formatValueOnBlur = (e: eventType) => { let value = e.target.value; - if (stringIsEmpty(value) || value === ".") { - setTextFieldValue(""); + if (stringIsEmpty(value) || value === '.') { + setTextFieldValue(''); return; } @@ -120,6 +122,7 @@ export const BoundedNumericTextField = ({ setTextFieldValue(value); }; + // eslint-disable-next-line @typescript-eslint/no-unused-vars const { onChange, ...noChangeProps } = { ...props }; return ( @@ -129,23 +132,41 @@ export const BoundedNumericTextField = ({ ...props?.InputProps, endAdornment: addIconButtons ? ( - changeValueWithIncDecButton(1)}> - {" "} + changeValueWithIncDecButton(1)} + sx={{ + bgcolor: theme.palette.background.default, + color: theme.palette.text.primary, + }} + > + - changeValueWithIncDecButton(-1)}> - {" "} + changeValueWithIncDecButton(-1)} + sx={{ + bgcolor: theme.palette.background.default, + color: theme.palette.text.primary, + }} + > + ) : ( <> ), }} - onChange={e => listeners(e as eventType)} - onBlur={e => { + onChange={(e) => listeners(e as eventType)} + onBlur={(e) => { formatValueOnBlur(e as eventType); }} autoComplete="off" diff --git a/src/common/CustomLoader.tsx b/src/common/CustomLoader.tsx index 5998f4b..84dbfac 100644 --- a/src/common/CustomLoader.tsx +++ b/src/common/CustomLoader.tsx @@ -1,7 +1,19 @@ -import React from 'react' -import './customloader.css' +import './customloader.css'; +import { Box, useTheme } from '@mui/material'; + export const CustomLoader = () => { + const theme = useTheme(); return ( -
- ) -} + +
+
+
+
+
+ ); +}; diff --git a/src/common/CustomSvg.tsx b/src/common/CustomSvg.tsx deleted file mode 100644 index c1d8f09..0000000 --- a/src/common/CustomSvg.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import React from 'react'; - -export const CustomSvg = ({ src, color = 'black', size = 24 }) => { - return ( - - {src} - - ); - }; - \ No newline at end of file diff --git a/src/common/ImageUploader.tsx b/src/common/ImageUploader.tsx index f21c17f..e820a53 100644 --- a/src/common/ImageUploader.tsx +++ b/src/common/ImageUploader.tsx @@ -1,44 +1,48 @@ -import React, { useCallback } from 'react' -import { Box } from '@mui/material' -import { useDropzone, DropzoneRootProps, DropzoneInputProps } from 'react-dropzone' -import Compressor from 'compressorjs' +import React, { useCallback } from 'react'; +import { Box } from '@mui/material'; +import { + useDropzone, + DropzoneRootProps, + DropzoneInputProps, +} from 'react-dropzone'; +import Compressor from 'compressorjs'; const toBase64 = (file: File): Promise => new Promise((resolve, reject) => { - const reader = new FileReader() - reader.readAsDataURL(file) - reader.onload = () => resolve(reader.result) + const reader = new FileReader(); + reader.readAsDataURL(file); + reader.onload = () => resolve(reader.result); reader.onerror = (error) => { - reject(error) - } - }) + reject(error); + }; + }); // TODO toBase64 seems unused. Remove? interface ImageUploaderProps { - children: React.ReactNode - onPick: (file: File) => void + children: React.ReactNode; + onPick: (file: File) => void; } const ImageUploader: React.FC = ({ children, onPick }) => { const onDrop = useCallback( async (acceptedFiles: File[]) => { if (acceptedFiles.length > 1) { - return + return; } - const image = acceptedFiles[0] - let compressedFile: File | undefined + const image = acceptedFiles[0]; + let compressedFile: File | undefined; try { // Check if the file is a GIF if (image.type === 'image/gif') { // Check if the GIF is larger than 500 KB if (image.size > 500 * 1024) { - console.error('GIF file size exceeds 500KB limit.') - return + console.error('GIF file size exceeds 500KB limit.'); + return; } // No compression for GIF, pass the original file - compressedFile = image + compressedFile = image; } else { // For non-GIF files, compress them await new Promise((resolve) => { @@ -48,55 +52,55 @@ const ImageUploader: React.FC = ({ children, onPick }) => { mimeType: 'image/webp', success(result) { const file = new File([result], image.name, { - type: 'image/webp' - }) - compressedFile = file - resolve() + type: 'image/webp', + }); + compressedFile = file; + resolve(); }, error(err) { - console.error('Compression error:', err) - resolve() // Proceed even if there's an error - } - }) - }) + console.error('Compression error:', err); + resolve(); // Proceed even if there's an error + }, + }); + }); } - if (!compressedFile) return + if (!compressedFile) return; - onPick(compressedFile) + onPick(compressedFile); } catch (error) { - console.error('File processing error:', error) + console.error('File processing error:', error); } }, [onPick] - ) + ); const { getRootProps, getInputProps, - isDragActive + isDragActive, }: { - getRootProps: () => DropzoneRootProps - getInputProps: () => DropzoneInputProps - isDragActive: boolean + getRootProps: () => DropzoneRootProps; + getInputProps: () => DropzoneInputProps; + isDragActive: boolean; } = useDropzone({ onDrop, accept: { - 'image/*': [] - } - }) + 'image/*': [], + }, + }); return ( {children} - ) -} + ); +}; -export default ImageUploader +export default ImageUploader; diff --git a/src/common/LazyLoad.tsx b/src/common/LazyLoad.tsx index 6369d0d..9155f63 100644 --- a/src/common/LazyLoad.tsx +++ b/src/common/LazyLoad.tsx @@ -1,28 +1,29 @@ -import React, { useState, useEffect, useRef } from 'react' -import { useInView } from 'react-intersection-observer' -import CircularProgress from '@mui/material/CircularProgress' +import React, { useState, useEffect, useRef } from 'react'; +import { useInView } from 'react-intersection-observer'; +import CircularProgress from '@mui/material/CircularProgress'; +import { useTheme } from '@mui/material'; interface Props { - onLoadMore: () => Promise + onLoadMore: () => Promise; } const LazyLoad: React.FC = ({ onLoadMore }) => { - const [isFetching, setIsFetching] = useState(false) - - const firstLoad = useRef(false) + const [isFetching, setIsFetching] = useState(false); + const theme = useTheme(); + const firstLoad = useRef(false); const [ref, inView] = useInView({ - threshold: 0.7 - }) + threshold: 0.7, + }); useEffect(() => { if (inView) { - setIsFetching(true) + setIsFetching(true); onLoadMore().finally(() => { - setIsFetching(false) - firstLoad.current = true - }) + setIsFetching(false); + firstLoad.current = true; + }); } - }, [inView]) + }, [inView]); return (
= ({ onLoadMore }) => { style={{ display: 'flex', justifyContent: 'center', - minHeight: '25px' + minHeight: '25px', }} >
- +
- ) -} + ); +}; -export default LazyLoad +export default LazyLoad; diff --git a/src/common/PdfViewer.tsx b/src/common/PdfViewer.tsx new file mode 100644 index 0000000..e4a7bad --- /dev/null +++ b/src/common/PdfViewer.tsx @@ -0,0 +1,80 @@ +import { useEffect, useState } from "react"; +import { subscribeToEvent, unsubscribeFromEvent } from "../utils/events"; +import { Box, Button } from "@mui/material"; + +export const PdfViewer = () => { + const [pdfUrl, setPdfUrl] = useState(""); + + const openPdf = (e) => { + try { + const blob = e.detail?.blob; + if (blob) { + // Create Object URL + const url = URL.createObjectURL(blob); + setPdfUrl(url); + } + } catch (error) { + console.error(error); + } + }; + + useEffect(() => { + return () => { + if (pdfUrl) { + URL.revokeObjectURL(pdfUrl); + } + }; + }, [pdfUrl]); + + useEffect(() => { + subscribeToEvent("openPdf", openPdf); + + return () => { + unsubscribeFromEvent("openPdf", openPdf); + }; + }, []); + + if (!pdfUrl) return null; + + return ( + + + + + + + ); } -}; - - - return ( - - - - - - ); -}); +); diff --git a/src/components/Apps/AppViewerContainer.tsx b/src/components/Apps/AppViewerContainer.tsx index 5e6d086..5f6e30d 100644 --- a/src/components/Apps/AppViewerContainer.tsx +++ b/src/components/Apps/AppViewerContainer.tsx @@ -1,16 +1,23 @@ -import React, { useContext, } from 'react'; +import { forwardRef } from 'react'; import { AppViewer } from './AppViewer'; import Frame from 'react-frame-component'; -import { MyContext, isMobile } from '../../App'; - -const AppViewerContainer = React.forwardRef(({ app, isSelected, hide, isDevMode, customHeight, skipAuth }, ref) => { - const { rootHeight } = useContext(MyContext); +type AppViewerContainerProps = { + app: any; + isSelected: boolean; + hide: boolean; + isDevMode: boolean; + customHeight?: string; + skipAuth?: boolean; +}; +const AppViewerContainer = forwardRef< + HTMLIFrameElement, + AppViewerContainerProps +>(({ app, isSelected, hide, isDevMode, customHeight, skipAuth }, ref) => { return ( } style={{ - position: (!isSelected || hide) && 'fixed', - left: (!isSelected || hide) && '-200vw', - height: customHeight ? customHeight : !isMobile ? '100vh' : `calc(${rootHeight} - 60px - 45px)`, border: 'none', - width: '100%', + height: customHeight || '100vh', + left: (!isSelected || hide) && '-200vw', overflow: 'hidden', + position: (!isSelected || hide) && 'fixed', + width: '100%', }} > - + ); }); diff --git a/src/components/Apps/Apps-styles.tsx b/src/components/Apps/Apps-styles.tsx index 995cd70..55ed470 100644 --- a/src/components/Apps/Apps-styles.tsx +++ b/src/components/Apps/Apps-styles.tsx @@ -1,315 +1,392 @@ -import { - AppBar, - Button, - Toolbar, - Typography, - Box, - TextField, - InputLabel, - ButtonBase, - } from "@mui/material"; - import { styled } from "@mui/system"; - - export const AppsParent = styled(Box)(({ theme }) => ({ - display: "flex", - width: "100%", - flexDirection: "column", - height: "100%", - alignItems: "center", - overflow: 'auto', - // For WebKit-based browsers (Chrome, Safari, etc.) - "::-webkit-scrollbar": { - width: "0px", // Set the width to 0 to hide the scrollbar - height: "0px", // Set the height to 0 for horizontal scrollbar - }, - - // For Firefox - scrollbarWidth: "none", // Hides the scrollbar in Firefox - - // Optional for better cross-browser consistency - "-ms-overflow-style": "none" // Hides scrollbar in IE and Edge - })); - export const AppsContainer = styled(Box)(({ theme }) => ({ - display: "flex", - width: "90%", - justifyContent: 'space-evenly', - gap: '24px', - flexWrap: 'wrap', - alignItems: 'flex-start', - alignSelf: 'center' - - })); - export const AppsLibraryContainer = styled(Box)(({ theme }) => ({ - display: "flex", - width: "100%", - flexDirection: 'column', - justifyContent: 'flex-start', - alignItems: 'center', - })); - export const AppsWidthLimiter = styled(Box)(({ theme }) => ({ - display: "flex", - width: "90%", - flexDirection: 'column', - justifyContent: 'flex-start', - alignItems: 'flex-start', - })); - export const AppsSearchContainer = styled(Box)(({ theme }) => ({ - display: "flex", - width: "90%", - justifyContent: 'space-between', - alignItems: 'center', - backgroundColor: '#434343', - borderRadius: '8px', - padding: '0px 10px', - height: '36px' - })); - export const AppsSearchLeft = styled(Box)(({ theme }) => ({ - display: "flex", - width: "90%", - justifyContent: 'flex-start', - alignItems: 'center', - gap: '10px', - flexGrow: 1, - flexShrink: 0 - })); - export const AppsSearchRight = styled(Box)(({ theme }) => ({ - display: "flex", - width: "90%", - justifyContent: 'flex-end', - alignItems: 'center', - flexShrink: 1 - })); - export const AppCircleContainer = styled(Box)(({ theme }) => ({ - display: "flex", - flexDirection: "column", - gap: '5px', - alignItems: 'center', - width: '100%' - })); - export const Add = styled(Typography)(({ theme }) => ({ - fontSize: '36px', - fontWeight: 500, - lineHeight: '43.57px', - textAlign: 'left' - - })); - export const AppCircleLabel = styled(Typography)(({ theme }) => ({ - fontSize: '14px', - fontWeight: 500, - lineHeight: 1.2, - // whiteSpace: 'nowrap', - overflow: 'hidden', - textOverflow: 'ellipsis', +import { Typography, Box, ButtonBase } from '@mui/material'; +import { styled } from '@mui/system'; + +export const AppsParent = styled(Box)(({ theme }) => ({ + alignItems: 'center', + backgroundColor: theme.palette.background.default, + color: theme.palette.text.primary, + display: 'flex', + flexDirection: 'column', + height: '100%', + msOverflowStyle: 'none', // Hides scrollbar in IE and Edge + overflow: 'auto', + scrollbarWidth: 'none', // Hides the scrollbar in Firefox + width: '100%', + // For WebKit-based browsers (Chrome, Safari, etc.) + '::-webkit-scrollbar': { + width: '0px', // Set the width to 0 to hide the scrollbar + height: '0px', // Set the height to 0 for horizontal scrollbar + }, +})); + +export const AppsContainer = styled(Box)(({ theme }) => ({ + alignItems: 'flex-start', + alignSelf: 'center', + backgroundColor: theme.palette.background.default, + color: theme.palette.text.primary, + display: 'flex', + flexWrap: 'wrap', + gap: '24px', + justifyContent: 'space-evenly', + width: '90%', +})); + +export const AppsDesktopLibraryHeader = styled(Box)(({ theme }) => ({ + backgroundColor: theme.palette.background.default, + color: theme.palette.text.primary, + display: 'flex', + flexDirection: 'column', + flexShrink: 0, + width: '100%', +})); + +export const AppsDesktopLibraryBody = styled(Box)(({ theme }) => ({ + backgroundColor: theme.palette.background.default, + color: theme.palette.text.primary, + display: 'flex', + flexDirection: 'column', + flexGrow: 1, + width: '100%', +})); + +export const AppsLibraryContainer = styled(Box)(({ theme }) => ({ + alignItems: 'center', + backgroundColor: theme.palette.background.default, + display: 'flex', + flexDirection: 'column', + justifyContent: 'flex-start', + width: '100%', +})); + +export const AppsWidthLimiter = styled(Box)(({ theme }) => ({ + alignItems: 'flex-start', + backgroundColor: theme.palette.background.default, + color: theme.palette.text.primary, + display: 'flex', + flexDirection: 'column', + justifyContent: 'flex-start', + width: '90%', +})); + +export const AppsSearchContainer = styled(Box)(({ theme }) => ({ + alignItems: 'center', + backgroundColor: theme.palette.background.paper, + borderRadius: '8px', + color: theme.palette.text.primary, + display: 'flex', + height: '36px', + justifyContent: 'space-between', + padding: '0px 10px', + width: '90%', +})); + +export const AppsSearchLeft = styled(Box)(({ theme }) => ({ + alignItems: 'center', + backgroundColor: theme.palette.background.paper, + color: theme.palette.text.primary, + display: 'flex', + flexGrow: 1, + flexShrink: 0, + gap: '10px', + justifyContent: 'flex-start', + width: '90%', +})); + +export const AppsSearchRight = styled(Box)(({ theme }) => ({ + alignItems: 'center', + backgroundColor: theme.palette.background.paper, + color: theme.palette.text.primary, + display: 'flex', + flexShrink: 1, + justifyContent: 'flex-end', + width: '90%', +})); + +export const AppCircleContainer = styled(Box)(({ theme }) => ({ + alignItems: 'center', + backgroundColor: theme.palette.background.default, + color: theme.palette.text.primary, + display: 'flex', + flexDirection: 'column', + gap: '5px', + width: '100%', +})); + +export const AppCircleLabel = styled(Typography)(({ theme }) => ({ + backgroundColor: theme.palette.background.default, + color: theme.palette.text.primary, + display: '-webkit-box', + fontSize: '14px', + fontWeight: 500, + lineHeight: 1.2, + overflow: 'hidden', + textOverflow: 'ellipsis', + WebkitBoxOrient: 'vertical', + WebkitLineClamp: '2', width: '120%', - '-webkit-line-clamp': '2', - '-webkit-box-orient': 'vertical', - 'display': '-webkit-box', - - })); - export const AppLibrarySubTitle = styled(Typography)(({ theme }) => ({ - fontSize: '16px', - fontWeight: 500, - lineHeight: 1.2, - })); - export const AppCircle = styled(Box)(({ theme }) => ({ - display: "flex", - width: "75px", - flexDirection: "column", - height: "75px", - alignItems: 'center', - justifyContent: 'center', - borderRadius: '50%', - backgroundColor: "var(--apps-circle)", - border: '1px solid #FFFFFF' - })); +})); - export const AppInfoSnippetContainer = styled(Box)(({ theme }) => ({ - display: "flex", - justifyContent: 'space-between', - alignItems: 'center', - width: '100%' - })); +export const AppLibrarySubTitle = styled(Typography)(({ theme }) => ({ + backgroundColor: theme.palette.background.default, + color: theme.palette.text.primary, + fontSize: '16px', + fontWeight: 500, + lineHeight: 1.2, +})); - export const AppInfoSnippetLeft = styled(Box)(({ theme }) => ({ - display: "flex", - justifyContent: 'flex-start', - alignItems: 'center', - gap: '12px' - })); - export const AppInfoSnippetRight = styled(Box)(({ theme }) => ({ - display: "flex", - justifyContent: 'flex-end', - alignItems: 'center', - })); +export const AppCircle = styled(Box)(({ theme }) => ({ + alignItems: 'center', + backgroundColor: theme.palette.background.surface, + borderColor: + theme.palette.mode === 'dark' + ? 'rgb(209, 209, 209)' + : 'rgba(41, 41, 43, 1)', + borderRadius: '50%', + borderStyle: 'solid', + borderWidth: '1px', + color: theme.palette.text.primary, + display: 'flex', + flexDirection: 'column', + height: '75px', + justifyContent: 'center', + width: '75px', +})); - export const AppDownloadButton = styled(ButtonBase)(({ theme }) => ({ - backgroundColor: "#247C0E", - width: '101px', - height: '29px', - display: 'flex', - justifyContent: 'center', - alignItems: 'center', - borderRadius: '25px', - alignSelf: 'center' - })); +export const AppInfoSnippetContainer = styled(Box)(({ theme }) => ({ + alignItems: 'center', + backgroundColor: theme.palette.background.default, + color: theme.palette.text.primary, + display: 'flex', + justifyContent: 'space-between', + width: '100%', +})); - export const AppDownloadButtonText = styled(Typography)(({ theme }) => ({ - fontSize: '14px', - fontWeight: 500, - lineHeight: 1.2, - })); +export const AppInfoSnippetLeft = styled(Box)(({ theme }) => ({ + alignItems: 'center', + backgroundColor: theme.palette.background.default, + color: theme.palette.text.primary, + display: 'flex', + gap: '12px', + justifyContent: 'flex-start', +})); - export const AppPublishTagsContainer = styled(Box)(({theme})=> ({ - gap: '10px', - flexWrap: 'wrap', - justifyContent: 'flex-start', - width: '100%', - display: 'flex' - })) +export const AppInfoSnippetRight = styled(Box)(({ theme }) => ({ + alignItems: 'center', + backgroundColor: theme.palette.background.default, + color: theme.palette.text.primary, + display: 'flex', + justifyContent: 'flex-end', +})); +export const AppDownloadButton = styled(ButtonBase)(({ theme }) => ({ + alignItems: 'center', + alignSelf: 'center', + backgroundColor: theme.palette.background.default, + borderRadius: '25px', + color: theme.palette.text.primary, + display: 'flex', + height: '29px', + justifyContent: 'center', + width: '101px', +})); - export const AppInfoSnippetMiddle = styled(Box)(({ theme }) => ({ - display: "flex", - flexDirection: "column", - justifyContent: 'center', - alignItems: 'flex-start', - })); +export const AppDownloadButtonText = styled(Typography)({ + fontSize: '14px', + fontWeight: 500, + lineHeight: 1.2, +}); - export const AppInfoAppName = styled(Typography)(({ theme }) => ({ - fontSize: '16px', - fontWeight: 500, - lineHeight: 1.2, - textAlign: 'start' - })); - export const AppInfoUserName = styled(Typography)(({ theme }) => ({ - fontSize: '13px', - fontWeight: 400, - lineHeight: 1.2, - color: '#8D8F93', - textAlign: 'start' - })); +export const AppPublishTagsContainer = styled(Box)(({ theme }) => ({ + backgroundColor: theme.palette.background.default, + color: theme.palette.text.primary, + display: 'flex', + flexWrap: 'wrap', + gap: '10px', + justifyContent: 'flex-start', + width: '100%', +})); +export const AppInfoSnippetMiddle = styled(Box)(({ theme }) => ({ + alignItems: 'flex-start', + backgroundColor: theme.palette.background.default, + display: 'flex', + flexDirection: 'column', + justifyContent: 'center', + color: theme.palette.text.primary, +})); - export const AppsNavBarParent = styled(Box)(({ theme }) => ({ - display: "flex", - justifyContent: 'space-between', - alignItems: 'center', - width: '100%', - height: '60px', - backgroundColor: '#1F2023', - padding: '0px 10px', - position: "fixed", - bottom: 0, - zIndex: 1, - })); +export const AppInfoAppName = styled(Typography)(({ theme }) => ({ + backgroundColor: theme.palette.background.default, + color: theme.palette.text.primary, + fontSize: '16px', + fontWeight: 500, + lineHeight: 1.2, + textAlign: 'start', +})); - export const AppsNavBarLeft = styled(Box)(({ theme }) => ({ - display: "flex", - justifyContent: 'flex-start', - alignItems: 'center', - flexGrow: 1 - })); - export const AppsNavBarRight = styled(Box)(({ theme }) => ({ - display: "flex", - justifyContent: 'flex-end', - alignItems: 'center', - })); +export const AppInfoUserName = styled(Typography)(({ theme }) => ({ + backgroundColor: theme.palette.background.default, + color: theme.palette.text.primary, + fontSize: '13px', + fontWeight: 400, + lineHeight: 1.2, + textAlign: 'start', +})); - export const TabParent = styled(Box)(({ theme }) => ({ - height: '36px', - width: '36px', - backgroundColor: '#434343', - position: 'relative', - borderRadius: '50%', - display: 'flex', - alignItems: 'center', - justifyContent: 'center' - })); +export const AppsNavBarParent = styled(Box)(({ theme }) => ({ + alignItems: 'center', + backgroundColor: theme.palette.background.default, + bottom: 0, + color: theme.palette.text.primary, + display: 'flex', + height: '60px', + justifyContent: 'space-between', + padding: '0px 10px', + position: 'fixed', + width: '100%', + zIndex: 1, +})); - export const PublishQAppCTAParent = styled(Box)(({ theme }) => ({ - display: "flex", - justifyContent: 'space-between', - alignItems: 'center', - width: '100%', - backgroundColor: '#181C23' - })); +export const AppsNavBarLeft = styled(Box)(({ theme }) => ({ + alignItems: 'center', + backgroundColor: theme.palette.background.default, + color: theme.palette.text.primary, + display: 'flex', + flexGrow: 1, + justifyContent: 'flex-start', +})); - export const PublishQAppCTALeft = styled(Box)(({ theme }) => ({ - display: "flex", - justifyContent: 'flex-start', - alignItems: 'center', - })); - export const PublishQAppCTARight = styled(Box)(({ theme }) => ({ - display: "flex", - justifyContent: 'flex-end', - alignItems: 'center', - })); +export const AppsNavBarRight = styled(Box)(({ theme }) => ({ + alignItems: 'center', + backgroundColor: theme.palette.background.default, + color: theme.palette.text.primary, + display: 'flex', + justifyContent: 'flex-end', +})); - export const PublishQAppCTAButton = styled(ButtonBase)(({ theme }) => ({ - width: '101px', - height: '29px', - display: 'flex', - justifyContent: 'center', - alignItems: 'center', - borderRadius: '25px', - border: '1px solid #FFFFFF' - })); - export const PublishQAppDotsBG = styled(Box)(({ theme }) => ({ - display: "flex", - justifyContent: 'center', - alignItems: 'center', - width: '60px', - height: '60px', - backgroundColor: '#4BBCFE' - })); - - export const PublishQAppInfo = styled(Typography)(({ theme }) => ({ - fontSize: '10px', - fontWeight: 400, - lineHeight: 1.2, - fontStyle: 'italic' - })); +export const TabParent = styled(Box)(({ theme }) => ({ + alignItems: 'center', + backgroundColor: theme.palette.background.default, + borderRadius: '50%', + color: theme.palette.text.primary, + display: 'flex', + height: '36px', + justifyContent: 'center', + position: 'relative', + width: '36px', +})); - export const PublishQAppChoseFile = styled(ButtonBase)(({ theme }) => ({ - width: '101px', - height: '30px', - display: 'flex', - justifyContent: 'center', - alignItems: 'center', - borderRadius: '5px', - backgroundColor: '#0091E1', - color: 'white', - fontWeight: 600, - fontSize: '10px' - })); +export const PublishQAppCTAParent = styled(Box)(({ theme }) => ({ + alignItems: 'center', + backgroundColor: theme.palette.background.paper, + color: theme.palette.text.primary, + display: 'flex', + justifyContent: 'space-between', + width: '100%', +})); +export const PublishQAppCTALeft = styled(Box)(({ theme }) => ({ + alignItems: 'center', + backgroundColor: theme.palette.background.paper, + color: theme.palette.text.primary, + display: 'flex', + justifyContent: 'flex-start', +})); - export const AppsCategoryInfo = styled(Box)(({ theme }) => ({ - display: "flex", - alignItems: 'center', - width: '100%', - })); +export const PublishQAppCTARight = styled(Box)(({ theme }) => ({ + alignItems: 'center', + backgroundColor: theme.palette.background.paper, + color: theme.palette.text.primary, + display: 'flex', + justifyContent: 'flex-end', +})); - export const AppsCategoryInfoSub = styled(Box)(({ theme }) => ({ - display: "flex", - flexDirection: 'column', - })); - export const AppsCategoryInfoLabel = styled(Typography)(({ theme }) => ({ - fontSize: '12px', - fontWeight: 700, - lineHeight: 1.2, - color: '#8D8F93', - })); - export const AppsCategoryInfoValue = styled(Typography)(({ theme }) => ({ - fontSize: '12px', - fontWeight: 500, - lineHeight: 1.2, - color: '#8D8F93', - })); - export const AppsInfoDescription = styled(Typography)(({ theme }) => ({ - fontSize: '13px', - fontWeight: 300, - lineHeight: 1.2, - width: '90%', - textAlign: 'start' - })); \ No newline at end of file +export const PublishQAppCTAButton = styled(ButtonBase)(({ theme }) => ({ + alignItems: 'center', + backgroundColor: theme.palette.background.default, + borderColor: theme.palette.text.primary, + borderRadius: '25px', + borderStyle: 'solid', + borderWidth: '1px', + color: theme.palette.text.primary, + display: 'flex', + height: '29px', + justifyContent: 'center', + width: '101px', +})); + +export const PublishQAppDotsBG = styled(Box)(({ theme }) => ({ + alignItems: 'center', + backgroundColor: theme.palette.background.paper, + color: theme.palette.text.primary, + display: 'flex', + height: '80px', + justifyContent: 'center', + width: '60px', +})); + +export const PublishQAppInfo = styled(Typography)(({ theme }) => ({ + backgroundColor: theme.palette.background.default, + color: theme.palette.text.primary, + fontSize: '16px', + fontStyle: 'italic', + fontWeight: 400, + lineHeight: 1.2, +})); + +export const PublishQAppChoseFile = styled(ButtonBase)(({ theme }) => ({ + alignItems: 'center', + backgroundColor: theme.palette.background.paper, + borderRadius: '8px', + color: theme.palette.text.primary, + display: 'flex', + fontSize: '16px', + fontWeight: 600, + height: '40px', + justifyContent: 'center', + width: '120px', + '&:hover': { + backgroundColor: 'action.hover', + }, +})); + +export const AppsCategoryInfo = styled(Box)(({ theme }) => ({ + alignItems: 'center', + backgroundColor: theme.palette.background.default, + color: theme.palette.text.primary, + display: 'flex', + width: '100%', +})); + +export const AppsCategoryInfoSub = styled(Box)(({ theme }) => ({ + backgroundColor: theme.palette.background.default, + color: theme.palette.text.primary, + display: 'flex', + flexDirection: 'column', +})); + +export const AppsCategoryInfoLabel = styled(Typography)(({ theme }) => ({ + backgroundColor: theme.palette.background.default, + color: theme.palette.text.primary, + fontSize: '12px', + fontWeight: 700, + lineHeight: 1.2, +})); + +export const AppsCategoryInfoValue = styled(Typography)(({ theme }) => ({ + fontSize: '12px', + fontWeight: 500, + lineHeight: 1.2, + backgroundColor: theme.palette.background.default, + color: theme.palette.text.primary, +})); + +export const AppsInfoDescription = styled(Typography)(({ theme }) => ({ + fontSize: '13px', + fontWeight: 300, + lineHeight: 1.2, + width: '90%', + textAlign: 'start', + backgroundColor: theme.palette.background.default, + color: theme.palette.text.primary, +})); diff --git a/src/components/Apps/Apps.tsx b/src/components/Apps/Apps.tsx deleted file mode 100644 index b444c22..0000000 --- a/src/components/Apps/Apps.tsx +++ /dev/null @@ -1,326 +0,0 @@ -import React, { useEffect, useMemo, useRef, useState } from "react"; -import { AppsHome } from "./AppsHome"; -import { Spacer } from "../../common/Spacer"; -import { getBaseApiReact } from "../../App"; -import { AppInfo } from "./AppInfo"; -import { - executeEvent, - subscribeToEvent, - unsubscribeFromEvent, -} from "../../utils/events"; -import { AppsParent } from "./Apps-styles"; -import AppViewerContainer from "./AppViewerContainer"; -import ShortUniqueId from "short-unique-id"; -import { AppPublish } from "./AppPublish"; -import { AppsCategory } from "./AppsCategory"; -import { AppsLibrary } from "./AppsLibrary"; - -const uid = new ShortUniqueId({ length: 8 }); - -export const Apps = ({ mode, setMode, show , myName}) => { - const [availableQapps, setAvailableQapps] = useState([]); - const [selectedAppInfo, setSelectedAppInfo] = useState(null); - const [selectedCategory, setSelectedCategory] = useState(null) - const [tabs, setTabs] = useState([]); - const [selectedTab, setSelectedTab] = useState(null); - const [isNewTabWindow, setIsNewTabWindow] = useState(false); - const [categories, setCategories] = useState([]) - const iframeRefs = useRef({}); - - - const myApp = useMemo(()=> { - - return availableQapps.find((app)=> app.name === myName && app.service === 'APP') - }, [myName, availableQapps]) - const myWebsite = useMemo(()=> { - - return availableQapps.find((app)=> app.name === myName && app.service === 'WEBSITE') - }, [myName, availableQapps]) - - useEffect(() => { - setTimeout(() => { - executeEvent("setTabsToNav", { - data: { - tabs: tabs, - selectedTab: selectedTab, - isNewTabWindow: isNewTabWindow, - }, - }); - }, 100); - }, [show, tabs, selectedTab, isNewTabWindow]); - - const getCategories = React.useCallback(async () => { - try { - const url = `${getBaseApiReact()}/arbitrary/categories`; - - const response = await fetch(url, { - method: "GET", - headers: { - "Content-Type": "application/json", - }, - }); - if (!response?.ok) return; - const responseData = await response.json(); - - setCategories(responseData); - - } catch (error) { - } finally { - // dispatch(setIsLoadingGlobal(false)) - } - }, []); - - const getQapps = React.useCallback(async () => { - try { - let apps = []; - let websites = []; - // dispatch(setIsLoadingGlobal(true)) - const url = `${getBaseApiReact()}/arbitrary/resources/search?service=APP&mode=ALL&limit=0&includestatus=true&includemetadata=true`; - - const response = await fetch(url, { - method: "GET", - headers: { - "Content-Type": "application/json", - }, - }); - if (!response?.ok) return; - const responseData = await response.json(); - const urlWebsites = `${getBaseApiReact()}/arbitrary/resources/search?service=WEBSITE&mode=ALL&limit=0&includestatus=true&includemetadata=true`; - - const responseWebsites = await fetch(urlWebsites, { - method: "GET", - headers: { - "Content-Type": "application/json", - }, - }); - if (!responseWebsites?.ok) return; - const responseDataWebsites = await responseWebsites.json(); - - apps = responseData; - websites = responseDataWebsites; - const combine = [...apps, ...websites]; - setAvailableQapps(combine); - } catch (error) { - } finally { - // dispatch(setIsLoadingGlobal(false)) - } - }, []); - useEffect(() => { - getQapps(); - getCategories() - }, [getQapps, getCategories]); - - const selectedAppInfoFunc = (e) => { - const data = e.detail?.data; - setSelectedAppInfo(data); - setMode("appInfo"); - }; - - useEffect(() => { - subscribeToEvent("selectedAppInfo", selectedAppInfoFunc); - - return () => { - unsubscribeFromEvent("selectedAppInfo", selectedAppInfoFunc); - }; - }, []); - - const selectedAppInfoCategoryFunc = (e) => { - const data = e.detail?.data; - setSelectedAppInfo(data); - setMode("appInfo-from-category"); - }; - - useEffect(() => { - subscribeToEvent("selectedAppInfoCategory", selectedAppInfoCategoryFunc); - - return () => { - unsubscribeFromEvent("selectedAppInfoCategory", selectedAppInfoCategoryFunc); - }; - }, []); - - - - const selectedCategoryFunc = (e) => { - const data = e.detail?.data; - setSelectedCategory(data); - setMode("category"); - }; - - useEffect(() => { - subscribeToEvent("selectedCategory", selectedCategoryFunc); - - return () => { - unsubscribeFromEvent("selectedCategory", selectedCategoryFunc); - }; - }, []); - - - const navigateBackFunc = (e) => { - if (['category', 'appInfo-from-category', 'appInfo', 'library', 'publish'].includes(mode)) { - // Handle the various modes as needed - if (mode === 'category') { - setMode('library'); - setSelectedCategory(null); - } else if (mode === 'appInfo-from-category') { - setMode('category'); - } else if (mode === 'appInfo') { - setMode('library'); - } else if (mode === 'library') { - if (isNewTabWindow) { - setMode('viewer'); - } else { - setMode('home'); - } - } else if (mode === 'publish') { - setMode('library'); - } - } else if(selectedTab?.tabId) { - executeEvent(`navigateBackApp-${selectedTab?.tabId}`, {}) - } - }; - - useEffect(() => { - subscribeToEvent("navigateBack", navigateBackFunc); - - return () => { - unsubscribeFromEvent("navigateBack", navigateBackFunc); - }; - }, [mode, selectedTab]); - - const addTabFunc = (e) => { - const data = e.detail?.data; - const newTab = { - ...data, - tabId: uid.rnd(), - }; - setTabs((prev) => [...prev, newTab]); - setSelectedTab(newTab); - setMode("viewer"); - - setIsNewTabWindow(false); - }; - - useEffect(() => { - subscribeToEvent("addTab", addTabFunc); - - return () => { - unsubscribeFromEvent("addTab", addTabFunc); - }; - }, [tabs]); - - const setSelectedTabFunc = (e) => { - const data = e.detail?.data; - - setSelectedTab(data); - setTimeout(() => { - executeEvent("setTabsToNav", { - data: { - tabs: tabs, - selectedTab: data, - isNewTabWindow: isNewTabWindow, - }, - }); - }, 100); - setIsNewTabWindow(false); - }; - - useEffect(() => { - subscribeToEvent("setSelectedTab", setSelectedTabFunc); - - return () => { - unsubscribeFromEvent("setSelectedTab", setSelectedTabFunc); - }; - }, [tabs, isNewTabWindow]); - - const removeTabFunc = (e) => { - const data = e.detail?.data; - const copyTabs = [...tabs].filter((tab) => tab?.tabId !== data?.tabId); - if (copyTabs?.length === 0) { - setMode("home"); - } else { - setSelectedTab(copyTabs[0]); - } - setTabs(copyTabs); - setSelectedTab(copyTabs[0]); - setTimeout(() => { - executeEvent("setTabsToNav", { - data: { - tabs: copyTabs, - selectedTab: copyTabs[0], - }, - }); - }, 400); - }; - - useEffect(() => { - subscribeToEvent("removeTab", removeTabFunc); - - return () => { - unsubscribeFromEvent("removeTab", removeTabFunc); - }; - }, [tabs]); - - const setNewTabWindowFunc = (e) => { - setIsNewTabWindow(true); - setSelectedTab(null) - }; - - useEffect(() => { - subscribeToEvent("newTabWindow", setNewTabWindowFunc); - - return () => { - unsubscribeFromEvent("newTabWindow", setNewTabWindowFunc); - }; - }, [tabs]); - - - return ( - - {mode !== "viewer" && !selectedTab && } - {mode === "home" && ( - - )} - - - - {mode === "appInfo" && !selectedTab && } - {mode === "appInfo-from-category" && !selectedTab && } - - {mode === "publish" && !selectedTab && } - - {tabs.map((tab) => { - if (!iframeRefs.current[tab.tabId]) { - iframeRefs.current[tab.tabId] = React.createRef(); - } - return ( - - ); - })} - - {isNewTabWindow && mode === "viewer" && ( - <> - - - - )} - {mode !== "viewer" && !selectedTab && } - - ); -}; diff --git a/src/components/Apps/AppsCategory.tsx b/src/components/Apps/AppsCategory.tsx deleted file mode 100644 index d1a1420..0000000 --- a/src/components/Apps/AppsCategory.tsx +++ /dev/null @@ -1,191 +0,0 @@ -import React, { useCallback, useContext, useEffect, useMemo, useRef, useState } from "react"; -import { - AppCircle, - AppCircleContainer, - AppCircleLabel, - AppLibrarySubTitle, - AppsContainer, - AppsLibraryContainer, - AppsParent, - AppsSearchContainer, - AppsSearchLeft, - AppsSearchRight, - AppsWidthLimiter, - PublishQAppCTAButton, - PublishQAppCTALeft, - PublishQAppCTAParent, - PublishQAppCTARight, - PublishQAppDotsBG, -} from "./Apps-styles"; -import { Avatar, Box, ButtonBase, InputBase, styled } from "@mui/material"; -import { Add } from "@mui/icons-material"; -import { MyContext, getBaseApiReact } from "../../App"; -import LogoSelected from "../../assets/svgs/LogoSelected.svg"; -import IconSearch from "../../assets/svgs/Search.svg"; -import IconClearInput from "../../assets/svgs/ClearInput.svg"; -import qappDevelopText from "../../assets/svgs/qappDevelopText.svg"; -import qappDots from "../../assets/svgs/qappDots.svg"; - -import { Spacer } from "../../common/Spacer"; -import { AppInfoSnippet } from "./AppInfoSnippet"; -import { Virtuoso } from "react-virtuoso"; -import { executeEvent } from "../../utils/events"; -const officialAppList = [ - "q-tube", - "q-blog", - "q-share", - "q-support", - "q-mail", - "q-fund", - "q-shop", - "q-trade", - "q-support", - "q-manager", - "q-wallets" -]; - -const ScrollerStyled = styled('div')({ - // Hide scrollbar for WebKit browsers (Chrome, Safari) - "::-webkit-scrollbar": { - width: "0px", - height: "0px", - }, - - // Hide scrollbar for Firefox - scrollbarWidth: "none", - - // Hide scrollbar for IE and older Edge - "-ms-overflow-style": "none", - }); - - const StyledVirtuosoContainer = styled('div')({ - position: 'relative', - width: '100%', - display: 'flex', - flexDirection: 'column', - - // Hide scrollbar for WebKit browsers (Chrome, Safari) - "::-webkit-scrollbar": { - width: "0px", - height: "0px", - }, - - // Hide scrollbar for Firefox - scrollbarWidth: "none", - - // Hide scrollbar for IE and older Edge - "-ms-overflow-style": "none", - }); - -export const AppsCategory = ({ availableQapps, myName, category, isShow }) => { - const [searchValue, setSearchValue] = useState(""); - const virtuosoRef = useRef(); - const { rootHeight } = useContext(MyContext); - - - - const categoryList = useMemo(() => { - return availableQapps.filter( - (app) => - app?.metadata?.category === category?.id - ); - }, [availableQapps, category]); - - const [debouncedValue, setDebouncedValue] = useState(""); // Debounced value - - // Debounce logic - useEffect(() => { - const handler = setTimeout(() => { - setDebouncedValue(searchValue); - }, 350); - - // Cleanup timeout if searchValue changes before the timeout completes - return () => { - clearTimeout(handler); - }; - }, [searchValue]); // Runs effect when searchValue changes - - // Example: Perform search or other actions based on debouncedValue - - const searchedList = useMemo(() => { - if (!debouncedValue) return categoryList - return categoryList.filter((app) => - app.name.toLowerCase().includes(debouncedValue.toLowerCase()) - ); - }, [debouncedValue, categoryList]); - - const rowRenderer = (index) => { - - let app = searchedList[index]; - return ; - }; - - - - return ( - - - - - - - setSearchValue(e.target.value)} - sx={{ ml: 1, flex: 1 }} - placeholder="Search for apps" - inputProps={{ - "aria-label": "Search for apps", - fontSize: "16px", - fontWeight: 400, - }} - /> - - - {searchValue && ( - { - setSearchValue(""); - }} - > - - - )} - - - - - - - {`Category: ${category?.name}`} - - - - - - - - - - - ); -}; diff --git a/src/components/Apps/AppsCategoryDesktop.tsx b/src/components/Apps/AppsCategoryDesktop.tsx index f6ba48d..3752353 100644 --- a/src/components/Apps/AppsCategoryDesktop.tsx +++ b/src/components/Apps/AppsCategoryDesktop.tsx @@ -1,88 +1,39 @@ -import React, { - useCallback, - useContext, - useEffect, - useMemo, - useRef, - useState, -} from "react"; +import { useEffect, useMemo, useRef, useState } from 'react'; import { - AppCircle, - AppCircleContainer, - AppCircleLabel, AppLibrarySubTitle, - AppsContainer, + AppsDesktopLibraryBody, + AppsDesktopLibraryHeader, AppsLibraryContainer, - AppsParent, AppsSearchContainer, AppsSearchLeft, AppsSearchRight, AppsWidthLimiter, - PublishQAppCTAButton, - PublishQAppCTALeft, - PublishQAppCTAParent, - PublishQAppCTARight, - PublishQAppDotsBG, -} from "./Apps-styles"; -import { Avatar, Box, ButtonBase, InputBase, styled } from "@mui/material"; -import { Add } from "@mui/icons-material"; -import { MyContext, getBaseApiReact } from "../../App"; -import LogoSelected from "../../assets/svgs/LogoSelected.svg"; -import IconSearch from "../../assets/svgs/Search.svg"; -import IconClearInput from "../../assets/svgs/ClearInput.svg"; -import qappDevelopText from "../../assets/svgs/qappDevelopText.svg"; -import qappDots from "../../assets/svgs/qappDots.svg"; +} from './Apps-styles'; +import { ButtonBase, InputBase, styled, useTheme } from '@mui/material'; +import SearchIcon from '@mui/icons-material/Search'; +import IconClearInput from '../../assets/svgs/ClearInput.svg'; +import { Spacer } from '../../common/Spacer'; +import { AppInfoSnippet } from './AppInfoSnippet'; +import { Virtuoso } from 'react-virtuoso'; +import { useTranslation } from 'react-i18next'; -import { Spacer } from "../../common/Spacer"; -import { AppInfoSnippet } from "./AppInfoSnippet"; -import { Virtuoso } from "react-virtuoso"; -import { executeEvent } from "../../utils/events"; -import { AppsDesktopLibraryBody, AppsDesktopLibraryHeader } from "./AppsDesktop-styles"; -const officialAppList = [ - "q-tube", - "q-blog", - "q-share", - "q-support", - "q-mail", - "q-fund", - "q-shop", - "q-trade", - "q-support", - "q-manager", - "q-wallets" -]; +const StyledVirtuosoContainer = styled('div')({ + position: 'relative', + width: '100%', + display: 'flex', + flexDirection: 'column', -const ScrollerStyled = styled("div")({ // Hide scrollbar for WebKit browsers (Chrome, Safari) - "::-webkit-scrollbar": { - width: "0px", - height: "0px", + '::-webkit-scrollbar': { + width: '0px', + height: '0px', }, // Hide scrollbar for Firefox - scrollbarWidth: "none", + scrollbarWidth: 'none', // Hide scrollbar for IE and older Edge - "-ms-overflow-style": "none", -}); - -const StyledVirtuosoContainer = styled("div")({ - position: "relative", - width: "100%", - display: "flex", - flexDirection: "column", - - // Hide scrollbar for WebKit browsers (Chrome, Safari) - "::-webkit-scrollbar": { - width: "0px", - height: "0px", - }, - - // Hide scrollbar for Firefox - scrollbarWidth: "none", - - // Hide scrollbar for IE and older Edge - "-ms-overflow-style": "none", + msOverflowStyle: 'none', }); export const AppsCategoryDesktop = ({ @@ -91,29 +42,35 @@ export const AppsCategoryDesktop = ({ category, isShow, }) => { - const [searchValue, setSearchValue] = useState(""); - const virtuosoRef = useRef(); - const { rootHeight } = useContext(MyContext); + const [searchValue, setSearchValue] = useState(''); + const virtuosoRef = useRef(null); + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); const categoryList = useMemo(() => { - if(category?.id === 'all') return availableQapps + if (category?.id === 'all') return availableQapps; return availableQapps.filter( (app) => app?.metadata?.category === category?.id ); }, [availableQapps, category]); - const [debouncedValue, setDebouncedValue] = useState(""); // Debounced value + const [debouncedValue, setDebouncedValue] = useState(''); // Debounced value // Debounce logic useEffect(() => { const handler = setTimeout(() => { setDebouncedValue(searchValue); - }, 350); setTimeout(() => { - virtuosoRef.current.scrollToIndex({ - index: 0 - }); + if (virtuosoRef.current) { + virtuosoRef.current.scrollToIndex({ index: 0 }); + } }, 500); // Cleanup timeout if searchValue changes before the timeout completes return () => { @@ -125,13 +82,19 @@ export const AppsCategoryDesktop = ({ const searchedList = useMemo(() => { if (!debouncedValue) return categoryList; - return categoryList.filter((app) => - app.name.toLowerCase().includes(debouncedValue.toLowerCase()) || (app?.metadata?.title && app?.metadata?.title?.toLowerCase().includes(debouncedValue.toLowerCase())) + return categoryList.filter( + (app) => + app.name.toLowerCase().includes(debouncedValue.toLowerCase()) || + (app?.metadata?.title && + app?.metadata?.title + ?.toLowerCase() + .includes(debouncedValue.toLowerCase())) ); }, [debouncedValue, categoryList]); const rowRenderer = (index) => { - let app = searchedList[index]; + const app = searchedList[index]; + return ( ); @@ -148,46 +111,60 @@ export const AppsCategoryDesktop = ({ return ( - + - + + setSearchValue(e.target.value)} - sx={{ ml: 1, flex: 1 }} - placeholder="Search for apps" + sx={{ + background: theme.palette.background.paper, + borderRadius: '6px', + flex: 1, + ml: 1, + paddingLeft: '12px', + }} + placeholder={t('core:action.search_apps', { + postProcess: 'capitalizeFirstChar', + })} inputProps={{ - "aria-label": "Search for apps", - fontSize: "16px", + 'aria-label': t('core:action.search_apps', { + postProcess: 'capitalizeFirstChar', + }), + fontSize: '16px', fontWeight: 400, }} /> + {searchValue && ( { - setSearchValue(""); + setSearchValue(''); }} > @@ -197,23 +174,27 @@ export const AppsCategoryDesktop = ({ + + {`Category: ${category?.name}`} + @@ -223,9 +204,6 @@ export const AppsCategoryDesktop = ({ itemContent={rowRenderer} atBottomThreshold={50} followOutput="smooth" - // components={{ - // Scroller: ScrollerStyled, // Use the styled scroller component - // }} /> diff --git a/src/components/Apps/AppsDesktop-styles.tsx b/src/components/Apps/AppsDesktop-styles.tsx deleted file mode 100644 index 26cb567..0000000 --- a/src/components/Apps/AppsDesktop-styles.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import { - AppBar, - Button, - Toolbar, - Typography, - Box, - TextField, - InputLabel, - ButtonBase, - } from "@mui/material"; - import { styled } from "@mui/system"; - - export const AppsDesktopLibraryHeader = styled(Box)(({ theme }) => ({ - display: "flex", - flexDirection: 'column', - flexShrink: 0, - width: '100%' - })); - export const AppsDesktopLibraryBody = styled(Box)(({ theme }) => ({ - display: "flex", - flexDirection: 'column', - flexGrow: 1, - width: '100%' - })); \ No newline at end of file diff --git a/src/components/Apps/AppsDesktop.tsx b/src/components/Apps/AppsDesktop.tsx index eb7ab49..805c2c3 100644 --- a/src/components/Apps/AppsDesktop.tsx +++ b/src/components/Apps/AppsDesktop.tsx @@ -1,65 +1,97 @@ -import React, { useCallback, useContext, useEffect, useMemo, useRef, useState } from "react"; -import { AppsHomeDesktop } from "./AppsHomeDesktop"; -import { Spacer } from "../../common/Spacer"; -import { GlobalContext, MyContext, getBaseApiReact } from "../../App"; -import { AppInfo } from "./AppInfo"; +import React, { useContext, useEffect, useMemo, useRef, useState } from 'react'; +import { AppsHomeDesktop } from './AppsHomeDesktop'; +import { Spacer } from '../../common/Spacer'; +import { QORTAL_APP_CONTEXT, getBaseApiReact } from '../../App'; +import { AppInfo } from './AppInfo'; import { executeEvent, subscribeToEvent, unsubscribeFromEvent, -} from "../../utils/events"; -import { AppsParent } from "./Apps-styles"; -import AppViewerContainer from "./AppViewerContainer"; -import ShortUniqueId from "short-unique-id"; -import { AppPublish } from "./AppPublish"; -import { AppsLibraryDesktop } from "./AppsLibraryDesktop"; -import { AppsCategoryDesktop } from "./AppsCategoryDesktop"; -import { AppsNavBarDesktop } from "./AppsNavBarDesktop"; -import { Box, ButtonBase } from "@mui/material"; -import { HomeIcon } from "../../assets/Icons/HomeIcon"; -import { MessagingIcon } from "../../assets/Icons/MessagingIcon"; -import { Save } from "../Save/Save"; -import { HubsIcon } from "../../assets/Icons/HubsIcon"; -import { CoreSyncStatus } from "../CoreSyncStatus"; -import { IconWrapper } from "../Desktop/DesktopFooter"; -import AppIcon from "../../assets/svgs/AppIcon.svg"; -import { useRecoilState } from "recoil"; -import { enabledDevModeAtom } from "../../atoms/global"; -import { AppsIcon } from "../../assets/Icons/AppsIcon"; +} from '../../utils/events'; +import { AppsParent } from './Apps-styles'; +import AppViewerContainer from './AppViewerContainer'; +import ShortUniqueId from 'short-unique-id'; +import { AppPublish } from './AppPublish'; +import { AppsLibraryDesktop } from './AppsLibraryDesktop'; +import { AppsCategoryDesktop } from './AppsCategoryDesktop'; +import { AppsNavBarDesktop } from './AppsNavBarDesktop'; +import { Box, ButtonBase, useTheme } from '@mui/material'; +import { HomeIcon } from '../../assets/Icons/HomeIcon'; +import { Save } from '../Save/Save'; +import { IconWrapper } from '../Desktop/DesktopFooter'; +import { enabledDevModeAtom } from '../../atoms/global'; +import { AppsIcon } from '../../assets/Icons/AppsIcon'; +import { CoreSyncStatus } from '../CoreSyncStatus'; +import { MessagingIconFilled } from '../../assets/Icons/MessagingIconFilled'; +import { useAtom } from 'jotai'; +import { useTranslation } from 'react-i18next'; +import LanguageSelector from '../Language/LanguageSelector'; +import ThemeSelector from '../Theme/ThemeSelector'; const uid = new ShortUniqueId({ length: 8 }); -export const AppsDesktop = ({ mode, setMode, show , myName, goToHome, setDesktopSideView, hasUnreadDirects, isDirects, isGroups, hasUnreadGroups, toggleSideViewGroups, toggleSideViewDirects, setDesktopViewMode, isApps, desktopViewMode}) => { +export const AppsDesktop = ({ + mode, + setMode, + show, + myName, + goToHome, + hasUnreadDirects, + hasUnreadGroups, + setDesktopViewMode, + desktopViewMode, + myAddress, +}) => { const [availableQapps, setAvailableQapps] = useState([]); const [selectedAppInfo, setSelectedAppInfo] = useState(null); - const [selectedCategory, setSelectedCategory] = useState(null) + const [selectedCategory, setSelectedCategory] = useState(null); const [tabs, setTabs] = useState([]); const [selectedTab, setSelectedTab] = useState(null); const [isNewTabWindow, setIsNewTabWindow] = useState(false); - const [categories, setCategories] = useState([]) + const [categories, setCategories] = useState([]); const iframeRefs = useRef({}); - const [isEnabledDevMode, setIsEnabledDevMode] = useRecoilState(enabledDevModeAtom) - const { showTutorial } = useContext(GlobalContext); + const [isEnabledDevMode, setIsEnabledDevMode] = useAtom(enabledDevModeAtom); + const { showTutorial } = useContext(QORTAL_APP_CONTEXT); + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); - const myApp = useMemo(()=> { - - return availableQapps.find((app)=> app.name === myName && app.service === 'APP') - }, [myName, availableQapps]) - const myWebsite = useMemo(()=> { - - return availableQapps.find((app)=> app.name === myName && app.service === 'WEBSITE') - }, [myName, availableQapps]) + const myApp = useMemo(() => { + return availableQapps.find( + (app) => + app.name === myName && + app.service === + t('core:app', { + postProcess: 'capitalizeAll', + }) + ); + }, [myName, availableQapps]); + const myWebsite = useMemo(() => { + return availableQapps.find( + (app) => + app.name === myName && + app.service === + t('core:website', { + postProcess: 'capitalizeAll', + }) + ); + }, [myName, availableQapps]); - useEffect(()=> { - if(show){ - showTutorial('qapps') + useEffect(() => { + if (show) { + showTutorial('qapps'); } - }, [show]) + }, [show]); useEffect(() => { setTimeout(() => { - executeEvent("setTabsToNav", { + executeEvent('setTabsToNav', { data: { tabs: tabs, selectedTab: selectedTab, @@ -74,19 +106,17 @@ export const AppsDesktop = ({ mode, setMode, show , myName, goToHome, setDesktop const url = `${getBaseApiReact()}/arbitrary/categories`; const response = await fetch(url, { - method: "GET", + method: 'GET', headers: { - "Content-Type": "application/json", + 'Content-Type': 'application/json', }, }); if (!response?.ok) return; const responseData = await response.json(); - + setCategories(responseData); - } catch (error) { - } finally { - // dispatch(setIsLoadingGlobal(false)) + console.log(error); } }, []); @@ -94,47 +124,50 @@ export const AppsDesktop = ({ mode, setMode, show , myName, goToHome, setDesktop try { let apps = []; let websites = []; - // dispatch(setIsLoadingGlobal(true)) const url = `${getBaseApiReact()}/arbitrary/resources/search?service=APP&mode=ALL&limit=0&includestatus=true&includemetadata=true`; const response = await fetch(url, { - method: "GET", + method: 'GET', headers: { - "Content-Type": "application/json", + 'Content-Type': 'application/json', }, }); + if (!response?.ok) return; const responseData = await response.json(); const urlWebsites = `${getBaseApiReact()}/arbitrary/resources/search?service=WEBSITE&mode=ALL&limit=0&includestatus=true&includemetadata=true`; const responseWebsites = await fetch(urlWebsites, { - method: "GET", + method: 'GET', headers: { - "Content-Type": "application/json", + 'Content-Type': 'application/json', }, }); + if (!responseWebsites?.ok) return; const responseDataWebsites = await responseWebsites.json(); - + apps = responseData; websites = responseDataWebsites; const combine = [...apps, ...websites]; setAvailableQapps(combine); } catch (error) { - } finally { - // dispatch(setIsLoadingGlobal(false)) + console.log(error); } }, []); useEffect(() => { - getCategories() + getCategories(); }, [getCategories]); useEffect(() => { getQapps(); - const interval = setInterval(() => { - getQapps(); - }, 20 * 60 * 1000); // 20 minutes in milliseconds + const interval = setInterval( + () => { + getQapps(); + }, + 20 * 60 * 1000 + ); // 20 minutes in milliseconds return () => clearInterval(interval); }, [getQapps]); @@ -142,54 +175,58 @@ export const AppsDesktop = ({ mode, setMode, show , myName, goToHome, setDesktop const selectedAppInfoFunc = (e) => { const data = e.detail?.data; setSelectedAppInfo(data); - setMode("appInfo"); + setMode('appInfo'); }; useEffect(() => { - subscribeToEvent("selectedAppInfo", selectedAppInfoFunc); + subscribeToEvent('selectedAppInfo', selectedAppInfoFunc); return () => { - unsubscribeFromEvent("selectedAppInfo", selectedAppInfoFunc); + unsubscribeFromEvent('selectedAppInfo', selectedAppInfoFunc); }; }, []); const selectedAppInfoCategoryFunc = (e) => { const data = e.detail?.data; setSelectedAppInfo(data); - setMode("appInfo-from-category"); + setMode('appInfo-from-category'); }; useEffect(() => { - subscribeToEvent("selectedAppInfoCategory", selectedAppInfoCategoryFunc); + subscribeToEvent('selectedAppInfoCategory', selectedAppInfoCategoryFunc); return () => { - unsubscribeFromEvent("selectedAppInfoCategory", selectedAppInfoCategoryFunc); + unsubscribeFromEvent( + 'selectedAppInfoCategory', + selectedAppInfoCategoryFunc + ); }; }, []); - - const selectedCategoryFunc = (e) => { const data = e.detail?.data; setSelectedCategory(data); - setMode("category"); + setMode('category'); }; useEffect(() => { - subscribeToEvent("selectedCategory", selectedCategoryFunc); + subscribeToEvent('selectedCategory', selectedCategoryFunc); return () => { - unsubscribeFromEvent("selectedCategory", selectedCategoryFunc); + unsubscribeFromEvent('selectedCategory', selectedCategoryFunc); }; }, []); - - - - - const navigateBackFunc = (e) => { - if (['category', 'appInfo-from-category', 'appInfo', 'library', 'publish'].includes(mode)) { + if ( + [ + 'category', + 'appInfo-from-category', + 'appInfo', + 'library', + 'publish', + ].includes(mode) + ) { // Handle the various modes as needed if (mode === 'category') { setMode('library'); @@ -207,17 +244,16 @@ export const AppsDesktop = ({ mode, setMode, show , myName, goToHome, setDesktop } else if (mode === 'publish') { setMode('library'); } - } else if(selectedTab?.tabId) { - executeEvent(`navigateBackApp-${selectedTab?.tabId}`, {}) + } else if (selectedTab?.tabId) { + executeEvent(`navigateBackApp-${selectedTab?.tabId}`, {}); } }; - useEffect(() => { - subscribeToEvent("navigateBack", navigateBackFunc); + subscribeToEvent('navigateBack', navigateBackFunc); return () => { - unsubscribeFromEvent("navigateBack", navigateBackFunc); + unsubscribeFromEvent('navigateBack', navigateBackFunc); }; }, [mode, selectedTab]); @@ -229,27 +265,25 @@ export const AppsDesktop = ({ mode, setMode, show , myName, goToHome, setDesktop }; setTabs((prev) => [...prev, newTab]); setSelectedTab(newTab); - setMode("viewer"); - + setMode('viewer'); setIsNewTabWindow(false); }; - - useEffect(() => { - subscribeToEvent("addTab", addTabFunc); + subscribeToEvent('addTab', addTabFunc); return () => { - unsubscribeFromEvent("addTab", addTabFunc); + unsubscribeFromEvent('addTab', addTabFunc); }; }, [tabs]); + const setSelectedTabFunc = (e) => { const data = e.detail?.data; - if(e.detail?.isDevMode) return + if (e.detail?.isDevMode) return; setSelectedTab(data); setTimeout(() => { - executeEvent("setTabsToNav", { + executeEvent('setTabsToNav', { data: { tabs: tabs, selectedTab: data, @@ -259,13 +293,12 @@ export const AppsDesktop = ({ mode, setMode, show , myName, goToHome, setDesktop }, 100); setIsNewTabWindow(false); }; - useEffect(() => { - subscribeToEvent("setSelectedTab", setSelectedTabFunc); + subscribeToEvent('setSelectedTab', setSelectedTabFunc); return () => { - unsubscribeFromEvent("setSelectedTab", setSelectedTabFunc); + unsubscribeFromEvent('setSelectedTab', setSelectedTabFunc); }; }, [tabs, isNewTabWindow]); @@ -273,14 +306,14 @@ export const AppsDesktop = ({ mode, setMode, show , myName, goToHome, setDesktop const data = e.detail?.data; const copyTabs = [...tabs].filter((tab) => tab?.tabId !== data?.tabId); if (copyTabs?.length === 0) { - setMode("home"); + setMode('home'); } else { setSelectedTab(copyTabs[0]); } setTabs(copyTabs); setSelectedTab(copyTabs[0]); setTimeout(() => { - executeEvent("setTabsToNav", { + executeEvent('setTabsToNav', { data: { tabs: copyTabs, selectedTab: copyTabs[0], @@ -290,216 +323,267 @@ export const AppsDesktop = ({ mode, setMode, show , myName, goToHome, setDesktop }; useEffect(() => { - subscribeToEvent("removeTab", removeTabFunc); + subscribeToEvent('removeTab', removeTabFunc); return () => { - unsubscribeFromEvent("removeTab", removeTabFunc); + unsubscribeFromEvent('removeTab', removeTabFunc); }; }, [tabs]); const setNewTabWindowFunc = (e) => { setIsNewTabWindow(true); - setSelectedTab(null) + setSelectedTab(null); }; useEffect(() => { - subscribeToEvent("newTabWindow", setNewTabWindowFunc); + subscribeToEvent('newTabWindow', setNewTabWindowFunc); return () => { - unsubscribeFromEvent("newTabWindow", setNewTabWindowFunc); + unsubscribeFromEvent('newTabWindow', setNewTabWindowFunc); }; }, [tabs]); return ( - - + + + + + { goToHome(); - }} > - - - + + { - setDesktopViewMode('apps') + setDesktopViewMode('apps'); }} > - + + { - setDesktopViewMode('chat') + setDesktopViewMode('chat'); }} > - - - + - {/* { - setDesktopSideView("directs"); - toggleSideViewDirects() - }} - > - - - - { - setDesktopSideView("groups"); - toggleSideViewGroups() - }} - > - - - */} - + {isEnabledDevMode && ( - { - setDesktopViewMode('dev') - }} - > - - - - + { + setDesktopViewMode('dev'); + }} + > + + + + )} + {mode !== 'home' && ( - - + )} + - - - - {mode === "home" && ( - + {mode === 'home' && ( + + - - + )} - - + + {mode === 'appInfo' && !selectedTab && ( + + )} + + {mode === 'appInfo-from-category' && !selectedTab && ( + + )} + + + + {mode === 'publish' && !selectedTab && ( + - - {mode === "appInfo" && !selectedTab && } - {mode === "appInfo-from-category" && !selectedTab && } - - {mode === "publish" && !selectedTab && } + )} + {tabs.map((tab) => { if (!iframeRefs.current[tab.tabId]) { iframeRefs.current[tab.tabId] = React.createRef(); } return ( ); })} - {isNewTabWindow && mode === "viewer" && ( + {isNewTabWindow && mode === 'viewer' && ( <> - + + - - + )} + + + + + + + + + + ); }; diff --git a/src/components/Apps/AppsDevMode.tsx b/src/components/Apps/AppsDevMode.tsx index d4edc0c..52680cd 100644 --- a/src/components/Apps/AppsDevMode.tsx +++ b/src/components/Apps/AppsDevMode.tsx @@ -1,46 +1,65 @@ -import React, { useCallback, useContext, useEffect, useMemo, useRef, useState } from "react"; -import { AppsDevModeHome } from "./AppsDevModeHome"; -import { Spacer } from "../../common/Spacer"; -import { MyContext, getBaseApiReact } from "../../App"; -import { AppInfo } from "./AppInfo"; - +import React, { useEffect, useRef, useState } from 'react'; +import { AppsDevModeHome } from './AppsDevModeHome'; +import { Spacer } from '../../common/Spacer'; import { executeEvent, subscribeToEvent, unsubscribeFromEvent, -} from "../../utils/events"; -import { AppsParent } from "./Apps-styles"; -import AppViewerContainer from "./AppViewerContainer"; -import ShortUniqueId from "short-unique-id"; -import { AppPublish } from "./AppPublish"; -import { AppsLibraryDesktop } from "./AppsLibraryDesktop"; -import { AppsCategoryDesktop } from "./AppsCategoryDesktop"; -import { AppsNavBarDesktop } from "./AppsNavBarDesktop"; -import { Box, ButtonBase } from "@mui/material"; -import { HomeIcon } from "../../assets/Icons/HomeIcon"; -import { MessagingIcon } from "../../assets/Icons/MessagingIcon"; -import { Save } from "../Save/Save"; -import { HubsIcon } from "../../assets/Icons/HubsIcon"; -import { AppsDevModeNavBar } from "./AppsDevModeNavBar"; -import { CoreSyncStatus } from "../CoreSyncStatus"; -import { AppsIcon } from "../../assets/Icons/AppsIcon"; -import { IconWrapper } from "../Desktop/DesktopFooter"; +} from '../../utils/events'; +import { AppsParent } from './Apps-styles'; +import AppViewerContainer from './AppViewerContainer'; +import ShortUniqueId from 'short-unique-id'; +import { Box, ButtonBase, useTheme } from '@mui/material'; +import { HomeIcon } from '../../assets/Icons/HomeIcon'; +import { Save } from '../Save/Save'; +import { AppsDevModeNavBar } from './AppsDevModeNavBar'; +import { AppsIcon } from '../../assets/Icons/AppsIcon'; +import { IconWrapper } from '../Desktop/DesktopFooter'; +import { CoreSyncStatus } from '../CoreSyncStatus'; +import { MessagingIconFilled } from '../../assets/Icons/MessagingIconFilled'; +import { useTranslation } from 'react-i18next'; +import LanguageSelector from '../Language/LanguageSelector'; +import ThemeSelector from '../Theme/ThemeSelector'; const uid = new ShortUniqueId({ length: 8 }); -export const AppsDevMode = ({ mode, setMode, show , myName, goToHome, setDesktopSideView, hasUnreadDirects, isDirects, isGroups, hasUnreadGroups, toggleSideViewGroups, toggleSideViewDirects, setDesktopViewMode, desktopViewMode, isApps}) => { +export const AppsDevMode = ({ + mode, + setMode, + show, + myName, + goToHome, + setDesktopSideView, + hasUnreadDirects, + isDirects, + isGroups, + hasUnreadGroups, + toggleSideViewGroups, + toggleSideViewDirects, + setDesktopViewMode, + desktopViewMode, + isApps, +}) => { const [availableQapps, setAvailableQapps] = useState([]); const [selectedAppInfo, setSelectedAppInfo] = useState(null); - const [selectedCategory, setSelectedCategory] = useState(null) + const [selectedCategory, setSelectedCategory] = useState(null); const [tabs, setTabs] = useState([]); const [selectedTab, setSelectedTab] = useState(null); const [isNewTabWindow, setIsNewTabWindow] = useState(false); - const [categories, setCategories] = useState([]) + const [categories, setCategories] = useState([]); const iframeRefs = useRef({}); - + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + useEffect(() => { setTimeout(() => { - executeEvent("appsDevModeSetTabsToNav", { + executeEvent('appsDevModeSetTabsToNav', { data: { tabs: tabs, selectedTab: selectedTab, @@ -50,17 +69,16 @@ export const AppsDevMode = ({ mode, setMode, show , myName, goToHome, setDesktop }, 100); }, [show, tabs, selectedTab, isNewTabWindow]); - - - - - - - - - const navigateBackFunc = (e) => { - if (['category', 'appInfo-from-category', 'appInfo', 'library', 'publish'].includes(mode)) { + if ( + [ + 'category', + 'appInfo-from-category', + 'appInfo', + 'library', + 'publish', + ].includes(mode) + ) { // Handle the various modes as needed if (mode === 'category') { setMode('library'); @@ -78,17 +96,16 @@ export const AppsDevMode = ({ mode, setMode, show , myName, goToHome, setDesktop } else if (mode === 'publish') { setMode('library'); } - } else if(selectedTab?.tabId) { - executeEvent(`navigateBackApp-${selectedTab?.tabId}`, {}) + } else if (selectedTab?.tabId) { + executeEvent(`navigateBackApp-${selectedTab?.tabId}`, {}); } }; - useEffect(() => { - subscribeToEvent("devModeNavigateBack", navigateBackFunc); + subscribeToEvent('devModeNavigateBack', navigateBackFunc); return () => { - unsubscribeFromEvent("devModeNavigateBack", navigateBackFunc); + unsubscribeFromEvent('devModeNavigateBack', navigateBackFunc); }; }, [mode, selectedTab]); @@ -100,58 +117,50 @@ export const AppsDevMode = ({ mode, setMode, show , myName, goToHome, setDesktop }; setTabs((prev) => [...prev, newTab]); setSelectedTab(newTab); - setMode("viewer"); - + setMode('viewer'); setIsNewTabWindow(false); }; - - useEffect(() => { - subscribeToEvent("appsDevModeAddTab", addTabFunc); + subscribeToEvent('appsDevModeAddTab', addTabFunc); return () => { - unsubscribeFromEvent("appsDevModeAddTab", addTabFunc); + unsubscribeFromEvent('appsDevModeAddTab', addTabFunc); }; }, [tabs]); const updateTabFunc = (e) => { const data = e.detail?.data; - if(!data.tabId) return - const findIndexTab = tabs.findIndex((tab)=> tab?.tabId === data?.tabId) - if(findIndexTab === -1) return - const copyTabs = [...tabs] - const newTab ={ + if (!data.tabId) return; + const findIndexTab = tabs.findIndex((tab) => tab?.tabId === data?.tabId); + if (findIndexTab === -1) return; + const copyTabs = [...tabs]; + const newTab = { ...copyTabs[findIndexTab], - url: data.url + url: data.url, + }; + copyTabs[findIndexTab] = newTab; - } - copyTabs[findIndexTab] = newTab - setTabs(copyTabs); setSelectedTab(newTab); - setMode("viewer"); - + setMode('viewer'); setIsNewTabWindow(false); }; - - useEffect(() => { - subscribeToEvent("appsDevModeUpdateTab", updateTabFunc); + subscribeToEvent('appsDevModeUpdateTab', updateTabFunc); return () => { - unsubscribeFromEvent("appsDevModeUpdateTab", updateTabFunc); + unsubscribeFromEvent('appsDevModeUpdateTab', updateTabFunc); }; }, [tabs]); - const setSelectedTabFunc = (e) => { const data = e.detail?.data; - if(!e.detail?.isDevMode) return + if (!e.detail?.isDevMode) return; setSelectedTab(data); setTimeout(() => { - executeEvent("appsDevModeSetTabsToNav", { + executeEvent('appsDevModeSetTabsToNav', { data: { tabs: tabs, selectedTab: data, @@ -161,13 +170,12 @@ export const AppsDevMode = ({ mode, setMode, show , myName, goToHome, setDesktop }, 100); setIsNewTabWindow(false); }; - useEffect(() => { - subscribeToEvent("setSelectedTabDevMode", setSelectedTabFunc); + subscribeToEvent('setSelectedTabDevMode', setSelectedTabFunc); return () => { - unsubscribeFromEvent("setSelectedTabDevMode", setSelectedTabFunc); + unsubscribeFromEvent('setSelectedTabDevMode', setSelectedTabFunc); }; }, [tabs, isNewTabWindow]); @@ -175,14 +183,14 @@ export const AppsDevMode = ({ mode, setMode, show , myName, goToHome, setDesktop const data = e.detail?.data; const copyTabs = [...tabs].filter((tab) => tab?.tabId !== data?.tabId); if (copyTabs?.length === 0) { - setMode("home"); + setMode('home'); } else { setSelectedTab(copyTabs[0]); } setTabs(copyTabs); setSelectedTab(copyTabs[0]); setTimeout(() => { - executeEvent("appsDevModeSetTabsToNav", { + executeEvent('appsDevModeSetTabsToNav', { data: { tabs: copyTabs, selectedTab: copyTabs[0], @@ -192,143 +200,209 @@ export const AppsDevMode = ({ mode, setMode, show , myName, goToHome, setDesktop }; useEffect(() => { - subscribeToEvent("removeTabDevMode", removeTabFunc); + subscribeToEvent('removeTabDevMode', removeTabFunc); return () => { - unsubscribeFromEvent("removeTabDevMode", removeTabFunc); + unsubscribeFromEvent('removeTabDevMode', removeTabFunc); }; }, [tabs]); const setNewTabWindowFunc = (e) => { setIsNewTabWindow(true); - setSelectedTab(null) + setSelectedTab(null); }; useEffect(() => { - subscribeToEvent("devModeNewTabWindow", setNewTabWindowFunc); + subscribeToEvent('devModeNewTabWindow', setNewTabWindowFunc); return () => { - unsubscribeFromEvent("devModeNewTabWindow", setNewTabWindowFunc); + unsubscribeFromEvent('devModeNewTabWindow', setNewTabWindowFunc); }; }, [tabs]); - return ( - - + + + + + { goToHome(); - }} > - - - + + { - setDesktopViewMode('apps') + setDesktopViewMode('apps'); }} > - - - - { - setDesktopViewMode('chat') - }} - > - - - + - + { - setDesktopViewMode('dev') - }} - > - - - - - {mode !== 'home' && ( - + onClick={() => { + setDesktopViewMode('chat'); + }} + > + + + + - )} + - - - - {mode === "home" && ( - + { + setDesktopViewMode('dev'); + }} + > + + + + - - + {mode !== 'home' && } + + + + + + + + + + + + {mode === 'home' && ( + + + + )} - - - - + {tabs.map((tab) => { if (!iframeRefs.current[tab.tabId]) { iframeRefs.current[tab.tabId] = React.createRef(); } return ( - + + - - + )} diff --git a/src/components/Apps/AppsDevModeHome.tsx b/src/components/Apps/AppsDevModeHome.tsx index d9def9b..9e56d93 100644 --- a/src/components/Apps/AppsDevModeHome.tsx +++ b/src/components/Apps/AppsDevModeHome.tsx @@ -1,14 +1,12 @@ -import React, { useContext, useMemo, useState } from "react"; +import { useContext, useState } from 'react'; import { AppCircle, AppCircleContainer, AppCircleLabel, AppLibrarySubTitle, AppsContainer, - AppsParent, -} from "./Apps-styles"; -import { Buffer } from "buffer"; - +} from './Apps-styles'; +import { Buffer } from 'buffer'; import { Avatar, Box, @@ -17,20 +15,21 @@ import { Dialog, DialogActions, DialogContent, - DialogContentText, DialogTitle, Input, -} from "@mui/material"; -import { Add } from "@mui/icons-material"; -import { MyContext, getBaseApiReact, isMobile } from "../../App"; -import LogoSelected from "../../assets/svgs/LogoSelected.svg"; -import { executeEvent } from "../../utils/events"; -import { Spacer } from "../../common/Spacer"; -import { useModal } from "../../common/useModal"; -import { createEndpoint, isUsingLocal } from "../../background"; -import { Label } from "../Group/AddGroup"; -import ShortUniqueId from "short-unique-id"; -import swaggerSVG from '../../assets/svgs/swagger.svg' + useTheme, +} from '@mui/material'; +import { Add } from '@mui/icons-material'; +import { QORTAL_APP_CONTEXT, getBaseApiReact } from '../../App'; +import { executeEvent } from '../../utils/events'; +import { Spacer } from '../../common/Spacer'; +import { useModal } from '../../hooks/useModal.tsx'; +import { createEndpoint, isUsingLocal } from '../../background/background.ts'; +import { Label } from '../Group/AddGroup'; +import ShortUniqueId from 'short-unique-id'; +import swaggerSVG from '../../assets/svgs/swagger.svg'; +import { useTranslation } from 'react-i18next'; + const uid = new ShortUniqueId({ length: 8 }); export const AppsDevModeHome = ({ @@ -40,17 +39,24 @@ export const AppsDevModeHome = ({ availableQapps, myName, }) => { - const [domain, setDomain] = useState("127.0.0.1"); - const [port, setPort] = useState(""); + const [domain, setDomain] = useState('127.0.0.1'); + const [port, setPort] = useState(''); const [selectedPreviewFile, setSelectedPreviewFile] = useState(null); - + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); const { isShow, onCancel, onOk, show, message } = useModal(); const { openSnackGlobal, setOpenSnackGlobal, infoSnackCustom, setInfoSnackCustom, - } = useContext(MyContext); + } = useContext(QORTAL_APP_CONTEXT); const handleSelectFile = async (existingFilePath) => { const filePath = existingFilePath || (await window.electron.selectFile()); @@ -58,16 +64,17 @@ export const AppsDevModeHome = ({ const content = await window.electron.readFile(filePath); return { buffer: content, filePath }; } else { - console.log("No file selected."); + console.log('No file selected.'); } }; + const handleSelectDirectry = async (existingDirectoryPath) => { const { buffer, directoryPath } = await window.electron.selectAndZipDirectory(existingDirectoryPath); if (buffer) { return { buffer, directoryPath }; } else { - console.log("No file selected."); + console.log('No file selected.'); } }; @@ -78,34 +85,35 @@ export const AppsDevModeHome = ({ setOpenSnackGlobal(true); setInfoSnackCustom({ - type: "error", - message: - "Please use your local node for dev mode! Logout and use Local node.", + type: 'error', + message: '', }); return; } const { portVal, domainVal } = await show({ - message: "", - publishFee: "", + message: '', + publishFee: '', }); - const framework = domainVal + ":" + portVal; + const framework = domainVal + ':' + portVal; const response = await fetch( `${getBaseApiReact()}/developer/proxy/start`, { - method: "POST", + method: 'POST', headers: { - "Content-Type": "text/plain", + 'Content-Type': 'text/plain', }, body: framework, } ); const responseData = await response.text(); - executeEvent("appsDevModeAddTab", { + executeEvent('appsDevModeAddTab', { data: { - url: "http://127.0.0.1:" + responseData, + url: 'http://127.0.0.1:' + responseData, }, }); - } catch (error) {} + } catch (error) { + console.log(error); + } }; const addPreviewApp = async (isRefresh, existingFilePath, tabId) => { @@ -113,20 +121,21 @@ export const AppsDevModeHome = ({ const usingLocal = await isUsingLocal(); if (!usingLocal) { setOpenSnackGlobal(true); - setInfoSnackCustom({ - type: "error", - message: - "Please use your local node for dev mode! Logout and use Local node.", + type: 'error', + message: t('core:message.generic.devmode_local_node', { + postProcess: 'capitalizeFirstChar', + }), }); return; } if (!myName) { setOpenSnackGlobal(true); - setInfoSnackCustom({ - type: "error", - message: "You need a name to use preview", + type: 'error', + message: t('core:message.generic.name_preview', { + postProcess: 'capitalizeFirstChar', + }), }); return; } @@ -135,31 +144,33 @@ export const AppsDevModeHome = ({ if (!buffer) { setOpenSnackGlobal(true); - setInfoSnackCustom({ - type: "error", - message: "Please select a file", + type: 'error', + message: t('core:message.generic.select_file', { + postProcess: 'capitalizeFirstChar', + }), }); return; } - const postBody = Buffer.from(buffer).toString("base64"); + const postBody = Buffer.from(buffer).toString('base64'); const endpoint = await createEndpoint( `/arbitrary/APP/${myName}/zip?preview=true` ); const response = await fetch(endpoint, { - method: "POST", + method: 'POST', headers: { - "Content-Type": "text/plain", + 'Content-Type': 'text/plain', }, body: postBody, }); - if (!response?.ok) throw new Error("Invalid zip"); + + if (!response?.ok) throw new Error('Invalid zip'); const previewPath = await response.text(); if (tabId) { - executeEvent("appsDevModeUpdateTab", { + executeEvent('appsDevModeUpdateTab', { data: { - url: "http://127.0.0.1:12391" + previewPath, + url: 'http://127.0.0.1:12391' + previewPath, isPreview: true, filePath, refreshFunc: (tabId) => { @@ -170,9 +181,9 @@ export const AppsDevModeHome = ({ }); return; } - executeEvent("appsDevModeAddTab", { + executeEvent('appsDevModeAddTab', { data: { - url: "http://127.0.0.1:12391" + previewPath, + url: 'http://127.0.0.1:12391' + previewPath, isPreview: true, filePath, refreshFunc: (tabId) => { @@ -190,20 +201,21 @@ export const AppsDevModeHome = ({ const usingLocal = await isUsingLocal(); if (!usingLocal) { setOpenSnackGlobal(true); - setInfoSnackCustom({ - type: "error", - message: - "Please use your local node for dev mode! Logout and use Local node.", + type: 'error', + message: t('core:message.generic.devmode_local_node', { + postProcess: 'capitalizeFirstChar', + }), }); return; } if (!myName) { setOpenSnackGlobal(true); - setInfoSnackCustom({ - type: "error", - message: "You need a name to use preview", + type: 'error', + message: t('core:message.generic.name_preview', { + postProcess: 'capitalizeFirstChar', + }), }); return; } @@ -212,31 +224,39 @@ export const AppsDevModeHome = ({ if (!buffer) { setOpenSnackGlobal(true); - setInfoSnackCustom({ - type: "error", - message: "Please select a file", + type: 'error', + message: t('core:message.generic.select_file', { + postProcess: 'capitalizeFirstChar', + }), }); return; } - const postBody = Buffer.from(buffer).toString("base64"); + const postBody = Buffer.from(buffer).toString('base64'); const endpoint = await createEndpoint( `/arbitrary/APP/${myName}/zip?preview=true` ); const response = await fetch(endpoint, { - method: "POST", + method: 'POST', headers: { - "Content-Type": "text/plain", + 'Content-Type': 'text/plain', }, body: postBody, }); - if (!response?.ok) throw new Error("Invalid zip"); + + if (!response?.ok) + throw new Error( + t('core:message.error.invalid_zip', { + postProcess: 'capitalizeFirstChar', + }) + ); const previewPath = await response.text(); + if (tabId) { - executeEvent("appsDevModeUpdateTab", { + executeEvent('appsDevModeUpdateTab', { data: { - url: "http://127.0.0.1:12391" + previewPath, + url: 'http://127.0.0.1:12391' + previewPath, isPreview: true, directoryPath, refreshFunc: (tabId) => { @@ -247,9 +267,9 @@ export const AppsDevModeHome = ({ }); return; } - executeEvent("appsDevModeAddTab", { + executeEvent('appsDevModeAddTab', { data: { - url: "http://127.0.0.1:12391" + previewPath, + url: 'http://127.0.0.1:12391' + previewPath, isPreview: true, directoryPath, refreshFunc: (tabId) => { @@ -266,22 +286,24 @@ export const AppsDevModeHome = ({ <> - Dev Mode Apps + {t('core:devmode_apps', { postProcess: 'capitalizeFirstChar' })} + + + - Server + + + {t('core:server', { postProcess: 'capitalizeFirstChar' })} + + { addPreviewApp(); @@ -307,15 +333,19 @@ export const AppsDevModeHome = ({ > + - Zip + + + {t('core:zip', { postProcess: 'capitalizeFirstChar' })} + + { addPreviewAppWithDirectory(); @@ -323,21 +353,25 @@ export const AppsDevModeHome = ({ > + - Directory + + + {t('core:directory', { postProcess: 'capitalizeFirstChar' })} + + { - executeEvent("appsDevModeAddTab", { + executeEvent('appsDevModeAddTab', { data: { - service: "APP", - name: "Q-Sandbox", + service: 'APP', + name: 'Q-Sandbox', tabId: uid.rnd(), }, }); @@ -345,130 +379,178 @@ export const AppsDevModeHome = ({ > center-icon - Q-Sandbox + + + {t('core:q_apps.q_sandbox', { + postProcess: 'capitalizeFirstChar', + })} + + { - executeEvent("appsDevModeAddTab", { + executeEvent('appsDevModeAddTab', { data: { - url: "http://127.0.0.1:12391", + url: 'http://127.0.0.1:12391', isPreview: false, - customIcon: swaggerSVG + customIcon: swaggerSVG, }, }); }} > center-icon - API + + + {t('core:api', { + postProcess: 'capitalizeAll', + })} + + {isShow && ( { - if (e.key === "Enter" && domain && port) { + if (e.key === 'Enter' && domain && port) { onOk({ portVal: port, domainVal: domain }); } }} > - - {"Add custom framework"} + + {t('core:action.add_custom_framework', { + postProcess: 'capitalizeFirstChar', + })} + - + + setDomain(e.target.value)} /> + - + + setPort(e.target.value)} /> + + diff --git a/src/components/Apps/AppsDevModeNavBar.tsx b/src/components/Apps/AppsDevModeNavBar.tsx index 983aef3..6a39c16 100644 --- a/src/components/Apps/AppsDevModeNavBar.tsx +++ b/src/components/Apps/AppsDevModeNavBar.tsx @@ -1,83 +1,63 @@ -import React, { useEffect, useMemo, useRef, useState } from "react"; +import { useEffect, useMemo, useRef, useState } from 'react'; import { AppsNavBarLeft, AppsNavBarParent, AppsNavBarRight, -} from "./Apps-styles"; -import NavBack from "../../assets/svgs/NavBack.svg"; -import NavAdd from "../../assets/svgs/NavAdd.svg"; -import NavMoreMenu from "../../assets/svgs/NavMoreMenu.svg"; -import { - ButtonBase, - ListItemIcon, - ListItemText, - Menu, - MenuItem, - Tab, - Tabs, -} from "@mui/material"; +} from './Apps-styles'; +import { NavBack } from '../../assets/Icons/NavBack.tsx'; +import { NavAdd } from '../../assets/Icons/NavAdd.tsx'; +import { ButtonBase, Tab, Tabs, useTheme } from '@mui/material'; import { executeEvent, subscribeToEvent, unsubscribeFromEvent, -} from "../../utils/events"; -import TabComponent from "./TabComponent"; -import PushPinIcon from "@mui/icons-material/PushPin"; -import RefreshIcon from "@mui/icons-material/Refresh"; -import { useRecoilState, useSetRecoilState } from "recoil"; -import { - navigationControllerAtom, - settingsLocalLastUpdatedAtom, - sortablePinnedAppsAtom, -} from "../../atoms/global"; -import { AppsDevModeTabComponent } from "./AppsDevModeTabComponent"; - - +} from '../../utils/events'; +import RefreshIcon from '@mui/icons-material/Refresh'; +import { navigationControllerAtom } from '../../atoms/global'; +import { AppsDevModeTabComponent } from './AppsDevModeTabComponent'; +import { useAtom } from 'jotai'; +import { useTranslation } from 'react-i18next'; export const AppsDevModeNavBar = () => { const [tabs, setTabs] = useState([]); const [selectedTab, setSelectedTab] = useState(null); - const [navigationController, setNavigationController] = useRecoilState(navigationControllerAtom) + const [navigationController, setNavigationController] = useAtom( + navigationControllerAtom + ); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + const theme = useTheme(); const [isNewTabWindow, setIsNewTabWindow] = useState(false); const tabsRef = useRef(null); - const [anchorEl, setAnchorEl] = useState(null); - const open = Boolean(anchorEl); - - - - const handleClick = (event) => { - setAnchorEl(event.currentTarget); - }; - - const handleClose = () => { - setAnchorEl(null); - }; useEffect(() => { // Scroll to the last tab whenever the tabs array changes (e.g., when a new tab is added) if (tabsRef.current) { - const tabElements = tabsRef.current.querySelectorAll(".MuiTab-root"); + const tabElements = tabsRef.current.querySelectorAll('.MuiTab-root'); if (tabElements.length > 0) { const lastTab = tabElements[tabElements.length - 1]; lastTab.scrollIntoView({ - behavior: "smooth", - block: "nearest", - inline: "end", + behavior: 'smooth', + block: 'nearest', + inline: 'end', }); } } }, [tabs.length]); // Dependency on the number of tabs - - const isDisableBackButton = useMemo(()=> { - if(selectedTab && navigationController[selectedTab?.tabId]?.hasBack) return false - if(selectedTab && !navigationController[selectedTab?.tabId]?.hasBack) return true - return false - }, [navigationController, selectedTab]) - - - + const isDisableBackButton = useMemo(() => { + if (selectedTab && navigationController[selectedTab?.tabId]?.hasBack) + return false; + if (selectedTab && !navigationController[selectedTab?.tabId]?.hasBack) + return true; + return false; + }, [navigationController, selectedTab]); const setTabsToNav = (e) => { const { tabs, selectedTab, isNewTabWindow } = e.detail?.data; @@ -88,57 +68,54 @@ export const AppsDevModeNavBar = () => { }; useEffect(() => { - subscribeToEvent("appsDevModeSetTabsToNav", setTabsToNav); + subscribeToEvent('appsDevModeSetTabsToNav', setTabsToNav); return () => { - unsubscribeFromEvent("appsDevModeSetTabsToNav", setTabsToNav); + unsubscribeFromEvent('appsDevModeSetTabsToNav', setTabsToNav); }; }, []); - - - return ( { - executeEvent("devModeNavigateBack", selectedTab?.tabId); + executeEvent('devModeNavigateBack', selectedTab?.tabId); }} disabled={isDisableBackButton} sx={{ opacity: !isDisableBackButton ? 1 : 0.1, - cursor: !isDisableBackButton ? 'pointer': 'default' + cursor: !isDisableBackButton ? 'pointer' : 'default', }} > - + + {tabs?.map((tab) => ( @@ -153,65 +130,61 @@ export const AppsDevModeNavBar = () => { /> } // Pass custom component sx={{ - "&.Mui-selected": { - color: "white", + '&.Mui-selected': { + color: theme.palette.text.primary, }, - padding: "0px", - margin: "0px", - minWidth: "0px", - width: "50px", + padding: '0px', + margin: '0px', + minWidth: '0px', + width: '50px', }} /> ))} + {selectedTab && ( - { - setSelectedTab(null); - executeEvent("devModeNewTabWindow", {}); + sx={{ + gap: '10px', + flexDirection: 'column', }} > - { + setSelectedTab(null); + executeEvent('devModeNewTabWindow', {}); }} - src={NavAdd} - /> - - - { - if(selectedTab?.refreshFunc){ - selectedTab.refreshFunc(selectedTab?.tabId) - } else { - executeEvent("refreshApp", { - tabId: selectedTab?.tabId, - }); - } - - }} - > - + - - + + + { + if (selectedTab?.refreshFunc) { + selectedTab.refreshFunc(selectedTab?.tabId); + } else { + executeEvent('refreshApp', { + tabId: selectedTab?.tabId, + }); + } + }} + > + + + )} - - ); }; diff --git a/src/components/Apps/AppsDevModeTabComponent.tsx b/src/components/Apps/AppsDevModeTabComponent.tsx index 46372a5..3e791c1 100644 --- a/src/components/Apps/AppsDevModeTabComponent.tsx +++ b/src/components/Apps/AppsDevModeTabComponent.tsx @@ -1,22 +1,21 @@ -import React from "react"; -import { TabParent } from "./Apps-styles"; -import NavCloseTab from "../../assets/svgs/NavCloseTab.svg"; -import { getBaseApiReact } from "../../App"; -import { Avatar, ButtonBase } from "@mui/material"; -import LogoSelected from "../../assets/svgs/LogoSelected.svg"; -import { executeEvent } from "../../utils/events"; +import { TabParent } from './Apps-styles'; +import { NavCloseTab } from '../../assets/Icons/NavCloseTab.tsx'; +import { getBaseApiReact } from '../../App'; +import { Avatar, ButtonBase } from '@mui/material'; +import LogoSelected from '../../assets/svgs/LogoSelected.svg'; +import { executeEvent } from '../../utils/events'; export const AppsDevModeTabComponent = ({ isSelected, app }) => { return ( { if (isSelected) { - executeEvent("removeTabDevMode", { + executeEvent('removeTabDevMode', { data: app, }); return; } - executeEvent("setSelectedTabDevMode", { + executeEvent('setSelectedTabDevMode', { data: app, isDevMode: true, }); @@ -24,39 +23,40 @@ export const AppsDevModeTabComponent = ({ isSelected, app }) => { > {isSelected && ( - )} center-icon diff --git a/src/components/Apps/AppsHome.tsx b/src/components/Apps/AppsHome.tsx deleted file mode 100644 index 81fc9b8..0000000 --- a/src/components/Apps/AppsHome.tsx +++ /dev/null @@ -1,57 +0,0 @@ -import React, { useMemo, useState } from "react"; -import { - AppCircle, - AppCircleContainer, - AppCircleLabel, - AppLibrarySubTitle, - AppsContainer, - AppsParent, -} from "./Apps-styles"; -import { Avatar, ButtonBase } from "@mui/material"; -import { Add } from "@mui/icons-material"; -import { getBaseApiReact, isMobile } from "../../App"; -import LogoSelected from "../../assets/svgs/LogoSelected.svg"; -import { executeEvent } from "../../utils/events"; -import { SortablePinnedApps } from "./SortablePinnedApps"; -import { Spacer } from "../../common/Spacer"; - -export const AppsHome = ({ setMode, myApp, myWebsite, availableQapps }) => { - return ( - <> - - - Apps Dashboard - - - - - - - { - setMode("library"); - }} - > - - - + - - Library - - - - - - - - ); -}; diff --git a/src/components/Apps/AppsHomeDesktop.tsx b/src/components/Apps/AppsHomeDesktop.tsx index 32f5abe..428b0cf 100644 --- a/src/components/Apps/AppsHomeDesktop.tsx +++ b/src/components/Apps/AppsHomeDesktop.tsx @@ -1,143 +1,165 @@ -import React, { useMemo, useState } from "react"; +import { useState } from 'react'; import { AppCircle, AppCircleContainer, AppCircleLabel, AppLibrarySubTitle, AppsContainer, - AppsParent, -} from "./Apps-styles"; -import { Avatar, Box, ButtonBase, Input } from "@mui/material"; -import { Add } from "@mui/icons-material"; -import { getBaseApiReact, isMobile } from "../../App"; -import LogoSelected from "../../assets/svgs/LogoSelected.svg"; -import { executeEvent } from "../../utils/events"; -import { Spacer } from "../../common/Spacer"; -import { SortablePinnedApps } from "./SortablePinnedApps"; -import { extractComponents } from "../Chat/MessageDisplay"; +} from './Apps-styles'; +import { Box, ButtonBase, Input, useTheme } from '@mui/material'; +import AddIcon from '@mui/icons-material/Add'; +import { executeEvent } from '../../utils/events'; +import { Spacer } from '../../common/Spacer'; +import { SortablePinnedApps } from './SortablePinnedApps'; +import { extractComponents } from '../Chat/MessageDisplay'; import ArrowOutwardIcon from '@mui/icons-material/ArrowOutward'; -import { AppsPrivate } from "./AppsPrivate"; +import { AppsPrivate } from './AppsPrivate'; +import { useTranslation } from 'react-i18next'; + export const AppsHomeDesktop = ({ setMode, myApp, myWebsite, availableQapps, - myName + myName, + myAddress, }) => { - const [qortalUrl, setQortalUrl] = useState('') + const [qortalUrl, setQortalUrl] = useState(''); + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); - const openQortalUrl = ()=> { + const openQortalUrl = () => { try { - if(!qortalUrl) return + if (!qortalUrl) return; const res = extractComponents(qortalUrl); if (res) { const { service, name, identifier, path } = res; - executeEvent("addTab", { data: { service, name, identifier, path } }); - executeEvent("open-apps-mode", { }); - setQortalUrl('qortal://') + executeEvent('addTab', { data: { service, name, identifier, path } }); + executeEvent('open-apps-mode', {}); + setQortalUrl('qortal://'); } } catch (error) { - + console.log(error); } - } + }; + return ( <> - - - Apps Dashboard - - - - - { - setQortalUrl(e.target.value) - }} - disableUnderline - autoComplete='off' - autoCorrect='off' - placeholder="qortal://" + + {t('core:apps_dashboard', { postProcess: 'capitalizeFirstChar' })} + + + + + + + + { + setQortalUrl(e.target.value); + }} + disableUnderline + autoComplete="off" + autoCorrect="off" + placeholder="qortal://" + sx={{ + borderRadius: '7px', + color: theme.palette.text.primary, + height: '35px', + width: '100%', + '& .MuiInput-input::placeholder': { + color: theme.palette.text.secondary, + fontSize: '20px', + fontStyle: 'normal', + fontWeight: 400, + lineHeight: '120%', // 24px + letterSpacing: '0.15px', + opacity: 1, + }, + '&:focus': { + outline: 'none', + }, + }} + onKeyDown={(e) => { + if (e.key === 'Enter' && qortalUrl) { + openQortalUrl(); + } + }} + /> + openQortalUrl()}> + { - if (e.key === 'Enter' && qortalUrl) { - openQortalUrl(); - } + color: qortalUrl + ? theme.palette.text.primary + : theme.palette.text.secondary, }} /> - openQortalUrl()}> - - - - + + + + + { - setMode("library"); + setMode('library'); }} > - + + - Library + + + {t('core:library', { postProcess: 'capitalizeFirstChar' })} + - + + + { - const [searchValue, setSearchValue] = useState(""); - const virtuosoRef = useRef(); - const { rootHeight } = useContext(MyContext); - - const officialApps = useMemo(() => { - return availableQapps.filter( - (app) => - app.service === "APP" && - officialAppList.includes(app?.name?.toLowerCase()) - ); - }, [availableQapps]); - - const [debouncedValue, setDebouncedValue] = useState(""); // Debounced value - - // Debounce logic - useEffect(() => { - const handler = setTimeout(() => { - setDebouncedValue(searchValue); - }, 350); - - // Cleanup timeout if searchValue changes before the timeout completes - return () => { - clearTimeout(handler); - }; - }, [searchValue]); // Runs effect when searchValue changes - - // Example: Perform search or other actions based on debouncedValue - - const searchedList = useMemo(() => { - if (!debouncedValue) return []; - return availableQapps.filter((app) => - app.name.toLowerCase().includes(debouncedValue.toLowerCase()) - ); - }, [debouncedValue]); - - const rowRenderer = (index) => { - - let app = searchedList[index]; - return ; - }; - - - - return ( - - - - - - - setSearchValue(e.target.value)} - sx={{ ml: 1, flex: 1 }} - placeholder="Search for apps" - inputProps={{ - "aria-label": "Search for apps", - fontSize: "16px", - fontWeight: 400, - }} - /> - - - {searchValue && ( - { - setSearchValue(""); - }} - > - - - )} - - - - - - { - executeEvent("navigateBack", {}); - - }}> - - Return to Apps Dashboard - - - {searchedList?.length > 0 ? ( - - - - - - ) : ( - <> - - Official Apps - - - {officialApps?.map((qapp) => { - return ( - { - // executeEvent("addTab", { - // data: qapp - // }) - executeEvent("selectedAppInfo", { - data: qapp, - }); - }} - > - - - - center-icon - - - - {qapp?.metadata?.title || qapp?.name} - - - - ); - })} - - - {hasPublishApp ? 'Update Apps!' : 'Create Apps!'} - - - - - - - - - - - - { - setMode('publish') - }}> - - {hasPublishApp ? 'Update' : 'Publish'} - - - - - - - - Categories - - - {categories?.map((category)=> { - return ( - { - executeEvent('selectedCategory', { - data: category - }) - }}> - - {category?.name} - - - ) - })} - - - - )} - - ); -}; diff --git a/src/components/Apps/AppsLibraryDesktop.tsx b/src/components/Apps/AppsLibraryDesktop.tsx index de356d4..910401b 100644 --- a/src/components/Apps/AppsLibraryDesktop.tsx +++ b/src/components/Apps/AppsLibraryDesktop.tsx @@ -1,19 +1,13 @@ -import React, { - useCallback, - useContext, - useEffect, - useMemo, - useRef, - useState, -} from "react"; +import { useEffect, useMemo, useRef, useState } from 'react'; import { AppCircle, AppCircleContainer, AppCircleLabel, AppLibrarySubTitle, AppsContainer, + AppsDesktopLibraryBody, + AppsDesktopLibraryHeader, AppsLibraryContainer, - AppsParent, AppsSearchContainer, AppsSearchLeft, AppsSearchRight, @@ -23,76 +17,80 @@ import { PublishQAppCTAParent, PublishQAppCTARight, PublishQAppDotsBG, -} from "./Apps-styles"; -import { Avatar, Box, ButtonBase, InputBase, Typography, styled } from "@mui/material"; -import { Add } from "@mui/icons-material"; -import { MyContext, getBaseApiReact } from "../../App"; -import LogoSelected from "../../assets/svgs/LogoSelected.svg"; -import IconSearch from "../../assets/svgs/Search.svg"; -import IconClearInput from "../../assets/svgs/ClearInput.svg"; -import qappDevelopText from "../../assets/svgs/qappDevelopText.svg"; -import qappLibraryText from "../../assets/svgs/qappLibraryText.svg"; -import RefreshIcon from "@mui/icons-material/Refresh"; - -import qappDots from "../../assets/svgs/qappDots.svg"; - -import { Spacer } from "../../common/Spacer"; -import { AppInfoSnippet } from "./AppInfoSnippet"; -import { Virtuoso } from "react-virtuoso"; -import { executeEvent } from "../../utils/events"; +} from './Apps-styles'; import { - AppsDesktopLibraryBody, - AppsDesktopLibraryHeader, -} from "./AppsDesktop-styles"; -import { AppsNavBarDesktop } from "./AppsNavBarDesktop"; -import ReturnSVG from '../../assets/svgs/Return.svg' -import { ComposeP, MailIconImg, ShowMessageReturnButton } from "../Group/Forum/Mail-styles"; + Avatar, + Box, + ButtonBase, + InputBase, + Typography, + styled, + useTheme, +} from '@mui/material'; +import { getBaseApiReact } from '../../App'; +import LogoSelected from '../../assets/svgs/LogoSelected.svg'; +import SearchIcon from '@mui/icons-material/Search'; +import IconClearInput from '../../assets/svgs/ClearInput.svg'; +import { QappDevelopText } from '../../assets/Icons/QappDevelopText.tsx'; +import { QappLibraryText } from '../../assets/Icons/QappLibraryText.tsx'; +import RefreshIcon from '@mui/icons-material/Refresh'; +import AppsIcon from '@mui/icons-material/Apps'; +import { Spacer } from '../../common/Spacer'; +import { AppInfoSnippet } from './AppInfoSnippet'; +import { Virtuoso } from 'react-virtuoso'; +import { executeEvent } from '../../utils/events'; +import { ComposeP, ShowMessageReturnButton } from '../Group/Forum/Mail-styles'; +import { ReturnIcon } from '../../assets/Icons/ReturnIcon.tsx'; +import { useTranslation } from 'react-i18next'; + const officialAppList = [ - "q-tube", - "q-blog", - "q-share", - "q-support", - "q-mail", - "q-fund", - "q-shop", - "q-trade", - "q-support", - "q-manager", - "q-mintership", - "q-wallets" + 'q-tube', + 'q-blog', + 'q-share', + 'q-support', + 'q-mail', + 'q-fund', + 'q-shop', + 'q-trade', + 'q-support', + 'q-manager', + 'q-mintership', + 'q-wallets', + 'q-search', + 'q-nodecontrol', ]; -const ScrollerStyled = styled("div")({ +const ScrollerStyled = styled('div')({ // Hide scrollbar for WebKit browsers (Chrome, Safari) - "::-webkit-scrollbar": { - width: "0px", - height: "0px", + '::-webkit-scrollbar': { + width: '0px', + height: '0px', }, // Hide scrollbar for Firefox - scrollbarWidth: "none", + scrollbarWidth: 'none', // Hide scrollbar for IE and older Edge - "-ms-overflow-style": "none", + msOverflowStyle: 'none', }); -const StyledVirtuosoContainer = styled("div")({ - position: "relative", - width: "100%", - display: "flex", - flexDirection: "column", +const StyledVirtuosoContainer = styled('div')({ + position: 'relative', + width: '100%', + display: 'flex', + flexDirection: 'column', // Hide scrollbar for WebKit browsers (Chrome, Safari) - "::-webkit-scrollbar": { - width: "0px", - height: "0px", + '::-webkit-scrollbar': { + width: '0px', + height: '0px', }, // Hide scrollbar for Firefox - scrollbarWidth: "none", + scrollbarWidth: 'none', // Hide scrollbar for IE and older Edge - "-ms-overflow-style": "none", + msOverflowStyle: 'none', }); export const AppsLibraryDesktop = ({ @@ -102,20 +100,28 @@ export const AppsLibraryDesktop = ({ hasPublishApp, isShow, categories, - getQapps + getQapps, }) => { - const [searchValue, setSearchValue] = useState(""); - const virtuosoRef = useRef(); + const [searchValue, setSearchValue] = useState(''); + const virtuosoRef = useRef(null); + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); const officialApps = useMemo(() => { return availableQapps.filter( (app) => - app.service === "APP" && + app.service === 'APP' && officialAppList.includes(app?.name?.toLowerCase()) ); }, [availableQapps]); - const [debouncedValue, setDebouncedValue] = useState(""); // Debounced value + const [debouncedValue, setDebouncedValue] = useState(''); // Debounced value // Debounce logic useEffect(() => { @@ -123,9 +129,9 @@ export const AppsLibraryDesktop = ({ setDebouncedValue(searchValue); }, 350); setTimeout(() => { - virtuosoRef.current.scrollToIndex({ - index: 0 - }); + if (virtuosoRef.current) { + virtuosoRef.current.scrollToIndex({ index: 0 }); + } }, 500); // Cleanup timeout if searchValue changes before the timeout completes return () => { @@ -137,8 +143,13 @@ export const AppsLibraryDesktop = ({ const searchedList = useMemo(() => { if (!debouncedValue) return []; - return availableQapps.filter((app) => - app.name.toLowerCase().includes(debouncedValue.toLowerCase()) || (app?.metadata?.title && app?.metadata?.title?.toLowerCase().includes(debouncedValue.toLowerCase())) + return availableQapps.filter( + (app) => + app.name.toLowerCase().includes(debouncedValue.toLowerCase()) || + (app?.metadata?.title && + app?.metadata?.title + ?.toLowerCase() + .includes(debouncedValue.toLowerCase())) ); }, [debouncedValue]); @@ -150,7 +161,7 @@ export const AppsLibraryDesktop = ({ app={app} myName={myName} parentStyles={{ - padding: '0px 10px' + padding: '0px 10px', }} /> ); @@ -159,111 +170,133 @@ export const AppsLibraryDesktop = ({ return ( - - - - + - - - setSearchValue(e.target.value)} - sx={{ ml: 1, flex: 1 }} - placeholder="Search for apps" - inputProps={{ - "aria-label": "Search for apps", - fontSize: "16px", - fontWeight: 400, + + + + + setSearchValue(e.target.value)} + sx={{ + background: theme.palette.background.paper, + borderRadius: '6px', + flex: 1, + ml: 1, + paddingLeft: '12px', + }} + placeholder={t('core:action.search_apps', { + postProcess: 'capitalizeFirstChar', + })} + inputProps={{ + 'aria-label': t('core:action.search_apps', { + postProcess: 'capitalizeFirstChar', + }), + fontSize: '16px', + fontWeight: 400, + }} + /> + + + + {searchValue && ( + { + setSearchValue(''); + }} + > + + + )} + + + + { + getQapps(); + }} + > + - - - {searchValue && ( - { - setSearchValue(""); - }} - > - - - )} - - - { - getQapps() - }} - > - - + - + - - { - executeEvent("navigateBack", {}); - }}> - - Return to Apps Dashboard - - + + { + executeEvent('navigateBack', {}); + }} + > + + + {t('core:action.return_apps_dashboard', { + postProcess: 'capitalizeFirstChar', + })} + + + + + {searchedList?.length > 0 ? ( ) : searchedList?.length === 0 && debouncedValue ? ( - No results + + {t('core:message.generic.no_results', { + postProcess: 'capitalizeFirstChar', + })} + ) : ( <> - Official Apps + {t('core:apps_official', { + postProcess: 'capitalizeFirstChar', + })} + - + + {officialApps?.map((qapp) => { return ( { - // executeEvent("addTab", { - // data: qapp - // }) - executeEvent("selectedAppInfo", { + executeEvent('selectedAppInfo', { data: qapp, }); }} > center-icon + {qapp?.metadata?.title || qapp?.name} @@ -355,122 +396,155 @@ export const AppsLibraryDesktop = ({ ); })} + + - {hasPublishApp ? "Update Apps!" : "Create Apps!"} + {hasPublishApp + ? t('core:action.update_app', { + postProcess: 'capitalizeFirstChar', + }) + : t('core:action.publish_app', { + postProcess: 'capitalizeFirstChar', + })} + + - + + - + + + { - setMode("publish"); + setMode('publish'); }} > - {hasPublishApp ? "Update" : "Publish"} + {hasPublishApp + ? t('core:action.update', { + postProcess: 'capitalizeFirstChar', + }) + : t('core:action.publish', { + postProcess: 'capitalizeFirstChar', + })} + + - Categories + {t('core:category_other', { + postProcess: 'capitalizeFirstChar', + })} + + - { - executeEvent("selectedCategory", { - data: { - id: 'all', - name: 'All' - }, - }); - }} - > - - All - - + { + executeEvent('selectedCategory', { + data: { + id: 'all', + name: 'All', + }, + }); + }} + > + + {t('core:all', { postProcess: 'capitalizeFirstChar' })} + + + {categories?.map((category) => { return ( { - executeEvent("selectedCategory", { + executeEvent('selectedCategory', { data: category, }); }} > {category?.name} diff --git a/src/components/Apps/AppsNavBar.tsx b/src/components/Apps/AppsNavBar.tsx deleted file mode 100644 index 67786db..0000000 --- a/src/components/Apps/AppsNavBar.tsx +++ /dev/null @@ -1,353 +0,0 @@ -import React, { useEffect, useMemo, useRef, useState } from "react"; -import { - AppsNavBarLeft, - AppsNavBarParent, - AppsNavBarRight, -} from "./Apps-styles"; -import NavBack from "../../assets/svgs/NavBack.svg"; -import NavAdd from "../../assets/svgs/NavAdd.svg"; -import NavMoreMenu from "../../assets/svgs/NavMoreMenu.svg"; -import { - ButtonBase, - ListItemIcon, - ListItemText, - Menu, - MenuItem, - Tab, - Tabs, -} from "@mui/material"; -import { - executeEvent, - subscribeToEvent, - unsubscribeFromEvent, -} from "../../utils/events"; -import TabComponent from "./TabComponent"; -import PushPinIcon from "@mui/icons-material/PushPin"; -import RefreshIcon from "@mui/icons-material/Refresh"; -import { useRecoilState, useSetRecoilState } from "recoil"; -import { - navigationControllerAtom, - settingsLocalLastUpdatedAtom, - sortablePinnedAppsAtom, -} from "../../atoms/global"; - -export function saveToLocalStorage(key, subKey, newValue, otherRootData = {}, deleteWholeKey) { - try { - if(deleteWholeKey){ - localStorage.setItem(key, null); - return - } - // Fetch existing data - const existingData = localStorage.getItem(key); - let combinedData = {}; - - if (existingData) { - // Parse the existing data - const parsedData = JSON.parse(existingData); - // Merge with the new data under the subKey - combinedData = { - ...parsedData, - ...otherRootData, - timestamp: Date.now(), // Update the root timestamp - [subKey]: newValue, // Assuming the data is an array - }; - } else { - // If no existing data, just use the new data under the subKey - combinedData = { - ...otherRootData, - timestamp: Date.now(), // Set the initial root timestamp - [subKey]: newValue, - }; - } - - // Save combined data back to localStorage - const serializedValue = JSON.stringify(combinedData); - localStorage.setItem(key, serializedValue); - } catch (error) { - console.error("Error saving to localStorage:", error); - } -} - -export const AppsNavBar = () => { - const [tabs, setTabs] = useState([]); - const [selectedTab, setSelectedTab] = useState(null); - const [isNewTabWindow, setIsNewTabWindow] = useState(false); - const tabsRef = useRef(null); - const [anchorEl, setAnchorEl] = useState(null); - const open = Boolean(anchorEl); - const [sortablePinnedApps, setSortablePinnedApps] = useRecoilState( - sortablePinnedAppsAtom - ); - const [navigationController, setNavigationController] = useRecoilState(navigationControllerAtom) - - const isDisableBackButton = useMemo(()=> { - if(selectedTab && navigationController[selectedTab?.tabId]?.hasBack) return false - if(selectedTab && !navigationController[selectedTab?.tabId]?.hasBack) return true - return false - }, [navigationController, selectedTab]) - - const setSettingsLocalLastUpdated = useSetRecoilState( - settingsLocalLastUpdatedAtom - ); - - const handleClick = (event) => { - setAnchorEl(event.currentTarget); - }; - - const handleClose = () => { - setAnchorEl(null); - }; - - useEffect(() => { - // Scroll to the last tab whenever the tabs array changes (e.g., when a new tab is added) - if (tabsRef.current) { - const tabElements = tabsRef.current.querySelectorAll(".MuiTab-root"); - if (tabElements.length > 0) { - const lastTab = tabElements[tabElements.length - 1]; - lastTab.scrollIntoView({ - behavior: "smooth", - block: "nearest", - inline: "end", - }); - } - } - }, [tabs.length]); // Dependency on the number of tabs - - const setTabsToNav = (e) => { - const { tabs, selectedTab, isNewTabWindow } = e.detail?.data; - - setTabs([...tabs]); - setSelectedTab(!selectedTab ? null : { ...selectedTab }); - setIsNewTabWindow(isNewTabWindow); - }; - - useEffect(() => { - subscribeToEvent("setTabsToNav", setTabsToNav); - - return () => { - unsubscribeFromEvent("setTabsToNav", setTabsToNav); - }; - }, []); - - const isSelectedAppPinned = !!sortablePinnedApps?.find( - (item) => - item?.name === selectedTab?.name && item?.service === selectedTab?.service - ); - return ( - - - { - executeEvent("navigateBack", selectedTab?.tabId); - }} - disabled={isDisableBackButton} - sx={{ - opacity: !isDisableBackButton ? 1 : 0.1, - cursor: !isDisableBackButton ? 'pointer': 'default' - }} - > - - - - {tabs?.map((tab) => ( - - } // Pass custom component - sx={{ - "&.Mui-selected": { - color: "white", - }, - padding: "0px", - margin: "0px", - minWidth: "0px", - width: "50px", - }} - /> - ))} - - - {selectedTab && ( - - { - setSelectedTab(null); - executeEvent("newTabWindow", {}); - }} - > - - - { - if (!selectedTab) return; - handleClick(e); - }} - > - - - - )} - - - { - if (!selectedTab) return; - - setSortablePinnedApps((prev) => { - let updatedApps; - - if (isSelectedAppPinned) { - // Remove the selected app if it is pinned - updatedApps = prev.filter( - (item) => - !( - item?.name === selectedTab?.name && - item?.service === selectedTab?.service - ) - ); - } else { - // Add the selected app if it is not pinned - updatedApps = [ - ...prev, - { - name: selectedTab?.name, - service: selectedTab?.service, - }, - ]; - } - - saveToLocalStorage( - "ext_saved_settings", - "sortablePinnedApps", - updatedApps - ); - return updatedApps; - }); - setSettingsLocalLastUpdated(Date.now()); - - handleClose(); - }} - > - - - - - - { - executeEvent("refreshApp", { - tabId: selectedTab?.tabId, - }); - handleClose(); - }} - > - - - - - - - - ); -}; diff --git a/src/components/Apps/AppsNavBarDesktop.tsx b/src/components/Apps/AppsNavBarDesktop.tsx index 8873e1a..ce358ab 100644 --- a/src/components/Apps/AppsNavBarDesktop.tsx +++ b/src/components/Apps/AppsNavBarDesktop.tsx @@ -1,12 +1,12 @@ -import React, { useEffect, useMemo, useRef, useState } from "react"; +import { useEffect, useMemo, useRef, useState } from 'react'; import { AppsNavBarLeft, AppsNavBarParent, AppsNavBarRight, -} from "./Apps-styles"; -import NavBack from "../../assets/svgs/NavBack.svg"; -import NavAdd from "../../assets/svgs/NavAdd.svg"; -import NavMoreMenu from "../../assets/svgs/NavMoreMenu.svg"; +} from './Apps-styles'; +import { NavBack } from '../../assets/Icons/NavBack.tsx'; +import { NavAdd } from '../../assets/Icons/NavAdd.tsx'; +import { NavMoreMenu } from '../../assets/Icons/NavMoreMenu.tsx'; import ContentCopyIcon from '@mui/icons-material/ContentCopy'; import { ButtonBase, @@ -16,21 +16,23 @@ import { MenuItem, Tab, Tabs, -} from "@mui/material"; + useTheme, +} from '@mui/material'; import { executeEvent, subscribeToEvent, unsubscribeFromEvent, -} from "../../utils/events"; -import TabComponent from "./TabComponent"; -import PushPinIcon from "@mui/icons-material/PushPin"; -import RefreshIcon from "@mui/icons-material/Refresh"; -import { useRecoilState, useSetRecoilState } from "recoil"; +} from '../../utils/events'; +import TabComponent from './TabComponent'; +import PushPinIcon from '@mui/icons-material/PushPin'; +import RefreshIcon from '@mui/icons-material/Refresh'; import { navigationControllerAtom, settingsLocalLastUpdatedAtom, sortablePinnedAppsAtom, -} from "../../atoms/global"; +} from '../../atoms/global'; +import { useAtom, useSetAtom } from 'jotai'; +import { useTranslation } from 'react-i18next'; export function saveToLocalStorage(key, subKey, newValue) { try { @@ -59,27 +61,34 @@ export function saveToLocalStorage(key, subKey, newValue) { const serializedValue = JSON.stringify(combinedData); localStorage.setItem(key, serializedValue); } catch (error) { - console.error("Error saving to localStorage:", error); + console.error('Error saving to localStorage:', error); } } -export const AppsNavBarDesktop = ({disableBack}) => { +export const AppsNavBarDesktop = ({ disableBack }) => { const [tabs, setTabs] = useState([]); const [selectedTab, setSelectedTab] = useState(null); - const [navigationController, setNavigationController] = useRecoilState(navigationControllerAtom) + const [navigationController, setNavigationController] = useAtom( + navigationControllerAtom + ); + const [sortablePinnedApps, setSortablePinnedApps] = useAtom( + sortablePinnedAppsAtom + ); + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); const [isNewTabWindow, setIsNewTabWindow] = useState(false); const tabsRef = useRef(null); const [anchorEl, setAnchorEl] = useState(null); const open = Boolean(anchorEl); - const [sortablePinnedApps, setSortablePinnedApps] = useRecoilState( - sortablePinnedAppsAtom - ); - - const setSettingsLocalLastUpdated = useSetRecoilState( - settingsLocalLastUpdatedAtom - ); + const setSettingsLocalLastUpdated = useSetAtom(settingsLocalLastUpdatedAtom); const handleClick = (event) => { setAnchorEl(event.currentTarget); @@ -92,29 +101,26 @@ export const AppsNavBarDesktop = ({disableBack}) => { useEffect(() => { // Scroll to the last tab whenever the tabs array changes (e.g., when a new tab is added) if (tabsRef.current) { - const tabElements = tabsRef.current.querySelectorAll(".MuiTab-root"); + const tabElements = tabsRef.current.querySelectorAll('.MuiTab-root'); if (tabElements.length > 0) { const lastTab = tabElements[tabElements.length - 1]; lastTab.scrollIntoView({ - behavior: "smooth", - block: "nearest", - inline: "end", + behavior: 'smooth', + block: 'nearest', + inline: 'end', }); } } }, [tabs.length]); // Dependency on the number of tabs - - - const isDisableBackButton = useMemo(()=> { - if(disableBack) return true - if(selectedTab && navigationController[selectedTab?.tabId]?.hasBack) return false - if(selectedTab && !navigationController[selectedTab?.tabId]?.hasBack) return true - return false - }, [navigationController, selectedTab, disableBack]) - - - + const isDisableBackButton = useMemo(() => { + if (disableBack) return true; + if (selectedTab && navigationController[selectedTab?.tabId]?.hasBack) + return false; + if (selectedTab && !navigationController[selectedTab?.tabId]?.hasBack) + return true; + return false; + }, [navigationController, selectedTab, disableBack]); const setTabsToNav = (e) => { const { tabs, selectedTab, isNewTabWindow } = e.detail?.data; @@ -124,75 +130,80 @@ export const AppsNavBarDesktop = ({disableBack}) => { }; useEffect(() => { - subscribeToEvent("setTabsToNav", setTabsToNav); + subscribeToEvent('setTabsToNav', setTabsToNav); return () => { - unsubscribeFromEvent("setTabsToNav", setTabsToNav); + unsubscribeFromEvent('setTabsToNav', setTabsToNav); }; }, []); - - - const isSelectedAppPinned = useMemo(()=> { - if(selectedTab?.isPrivate){ + const isSelectedAppPinned = useMemo(() => { + if (selectedTab?.isPrivate) { return !!sortablePinnedApps?.find( (item) => - item?.privateAppProperties?.name === selectedTab?.privateAppProperties?.name && item?.privateAppProperties?.service === selectedTab?.privateAppProperties?.service && item?.privateAppProperties?.identifier === selectedTab?.privateAppProperties?.identifier + item?.privateAppProperties?.name === + selectedTab?.privateAppProperties?.name && + item?.privateAppProperties?.service === + selectedTab?.privateAppProperties?.service && + item?.privateAppProperties?.identifier === + selectedTab?.privateAppProperties?.identifier ); } else { return !!sortablePinnedApps?.find( (item) => - item?.name === selectedTab?.name && item?.service === selectedTab?.service + item?.name === selectedTab?.name && + item?.service === selectedTab?.service ); } - }, [selectedTab,sortablePinnedApps]) + }, [selectedTab, sortablePinnedApps]); return ( { - executeEvent("navigateBack", selectedTab?.tabId); + executeEvent('navigateBack', selectedTab?.tabId); }} disabled={isDisableBackButton} sx={{ opacity: !isDisableBackButton ? 1 : 0.1, - cursor: !isDisableBackButton ? 'pointer': 'default' + cursor: !isDisableBackButton ? 'pointer' : 'default', }} > - + + {tabs?.map((tab) => ( { /> } // Pass custom component sx={{ - "&.Mui-selected": { - color: "white", + '&.Mui-selected': { + color: theme.palette.text.primary, }, - padding: "0px", - margin: "0px", - minWidth: "0px", - width: "50px", + padding: '0px', + margin: '0px', + minWidth: '0px', + width: '50px', }} /> ))} + {selectedTab && ( - { - setSelectedTab(null); - executeEvent("newTabWindow", {}); + sx={{ + gap: '10px', + flexDirection: 'column', }} > - { + setSelectedTab(null); + executeEvent('newTabWindow', {}); }} - src={NavAdd} - /> - - { - if (!selectedTab) return; - handleClick(e); - }} - > - + + + + { + if (!selectedTab) return; + handleClick(e); }} - src={NavMoreMenu} - /> - - + > + + + )} - + { if (isSelectedAppPinned) { // Remove the selected app if it is pinned - if(selectedTab?.isPrivate){ + if (selectedTab?.isPrivate) { updatedApps = prev.filter( (item) => !( - item?.privateAppProperties?.name === selectedTab?.privateAppProperties?.name && - item?.privateAppProperties?.service === selectedTab?.privateAppProperties?.service && - item?.privateAppProperties?.identifier === selectedTab?.privateAppProperties?.identifier + item?.privateAppProperties?.name === + selectedTab?.privateAppProperties?.name && + item?.privateAppProperties?.service === + selectedTab?.privateAppProperties?.service && + item?.privateAppProperties?.identifier === + selectedTab?.privateAppProperties?.identifier ) ); } else { @@ -309,21 +323,19 @@ export const AppsNavBarDesktop = ({disableBack}) => { ) ); } - } else { // Add the selected app if it is not pinned - if(selectedTab?.isPrivate){ + if (selectedTab?.isPrivate) { updatedApps = [ - ...prev, - { - isPreview: true, - isPrivate: true, - privateAppProperties: { - ...(selectedTab?.privateAppProperties || {}) - } - - }, - ]; + ...prev, + { + isPreview: true, + isPrivate: true, + privateAppProperties: { + ...(selectedTab?.privateAppProperties || {}), + }, + }, + ]; } else { updatedApps = [ ...prev, @@ -333,12 +345,11 @@ export const AppsNavBarDesktop = ({disableBack}) => { }, ]; } - } saveToLocalStorage( - "ext_saved_settings", - "sortablePinnedApps", + 'ext_saved_settings', + 'sortablePinnedApps', updatedApps ); return updatedApps; @@ -350,70 +361,86 @@ export const AppsNavBarDesktop = ({disableBack}) => { > + + { if (selectedTab?.refreshFunc) { selectedTab.refreshFunc(selectedTab?.tabId); - } else { - executeEvent("refreshApp", { + executeEvent('refreshApp', { tabId: selectedTab?.tabId, }); } - handleClose(); }} > + + {!selectedTab?.isPrivate && ( - { - executeEvent("copyLink", { + executeEvent('copyLink', { tabId: selectedTab?.tabId, }); handleClose(); @@ -421,26 +448,29 @@ export const AppsNavBarDesktop = ({disableBack}) => { > + )} diff --git a/src/components/Apps/AppsPrivate.tsx b/src/components/Apps/AppsPrivate.tsx index d18fcad..670e8e9 100644 --- a/src/components/Apps/AppsPrivate.tsx +++ b/src/components/Apps/AppsPrivate.tsx @@ -1,79 +1,111 @@ -import React, { useContext, useMemo, useState } from "react"; import { - Avatar, + SyntheticEvent, + useCallback, + useContext, + useEffect, + useMemo, + useState, +} from 'react'; +import { Box, Button, ButtonBase, Dialog, DialogActions, DialogContent, - DialogTitle, Input, MenuItem, Select, Tab, Tabs, - Typography, -} from "@mui/material"; -import { useDropzone } from "react-dropzone"; -import { useHandlePrivateApps } from "./useHandlePrivateApps"; -import { useRecoilState, useSetRecoilState } from "recoil"; -import { groupsPropertiesAtom, myGroupsWhereIAmAdminAtom } from "../../atoms/global"; -import { Label } from "../Group/AddGroup"; -import { Spacer } from "../../common/Spacer"; + useTheme, +} from '@mui/material'; +import { useDropzone } from 'react-dropzone'; +import { useHandlePrivateApps } from '../../hooks/useHandlePrivateApps'; +import { + groupsPropertiesAtom, + memberGroupsAtom, + myGroupsWhereIAmAdminAtom, +} from '../../atoms/global'; +import { Label } from '../Group/AddGroup'; +import { Spacer } from '../../common/Spacer'; import { - Add, AppCircle, AppCircleContainer, AppCircleLabel, PublishQAppChoseFile, PublishQAppInfo, -} from "./Apps-styles"; -import ImageUploader from "../../common/ImageUploader"; -import { isMobile, MyContext } from "../../App"; -import { fileToBase64 } from "../../utils/fileReading"; -import { objectToBase64 } from "../../qdn/encryption/group-encryption"; -import { getFee } from "../../background"; +} from './Apps-styles'; +import AddIcon from '@mui/icons-material/Add'; +import ImageUploader from '../../common/ImageUploader'; +import { getBaseApiReact, QORTAL_APP_CONTEXT } from '../../App'; +import { fileToBase64 } from '../../utils/fileReading'; +import { objectToBase64 } from '../../qdn/encryption/group-encryption'; +import { getFee } from '../../background/background.ts'; +import { useAtom } from 'jotai'; +import { useTranslation } from 'react-i18next'; +import { useSortedMyNames } from '../../hooks/useSortedMyNames'; const maxFileSize = 50 * 1024 * 1024; // 50MB -export const AppsPrivate = ({myName}) => { +export const AppsPrivate = ({ myName, myAddress }) => { + const [names, setNames] = useState([]); + const [name, setName] = useState(0); + const { openApp } = useHandlePrivateApps(); const [file, setFile] = useState(null); const [logo, setLogo] = useState(null); - const [qortalUrl, setQortalUrl] = useState(""); + const [qortalUrl, setQortalUrl] = useState(''); const [selectedGroup, setSelectedGroup] = useState(0); - const [groupsProperties] = useRecoilState(groupsPropertiesAtom) + const [valueTabPrivateApp, setValueTabPrivateApp] = useState(0); - const [myGroupsWhereIAmAdminFromGlobal] = useRecoilState( - myGroupsWhereIAmAdminAtom - ); + const [groupsProperties] = useAtom(groupsPropertiesAtom); + const [myGroupsWhereIAmAdminFromGlobal] = useAtom(myGroupsWhereIAmAdminAtom); + + const myGroupsWhereIAmAdmin = useMemo(() => { + return myGroupsWhereIAmAdminFromGlobal?.filter( + (group) => groupsProperties[group?.groupId]?.isOpen === false + ); + }, [myGroupsWhereIAmAdminFromGlobal, groupsProperties]); - const myGroupsWhereIAmAdmin = useMemo(()=> { - return myGroupsWhereIAmAdminFromGlobal?.filter((group)=> groupsProperties[group?.groupId]?.isOpen === false) - }, [myGroupsWhereIAmAdminFromGlobal, groupsProperties]) const [isOpenPrivateModal, setIsOpenPrivateModal] = useState(false); - const { show, setInfoSnackCustom, setOpenSnackGlobal, memberGroups } = useContext(MyContext); - + const { show, setInfoSnackCustom, setOpenSnackGlobal } = + useContext(QORTAL_APP_CONTEXT); + const [memberGroups] = useAtom(memberGroupsAtom); + + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + + const myGroupsPrivate = useMemo(() => { + return memberGroups?.filter( + (group) => groupsProperties[group?.groupId]?.isOpen === false + ); + }, [memberGroups, groupsProperties]); - const myGroupsPrivate = useMemo(()=> { - return memberGroups?.filter((group)=> groupsProperties[group?.groupId]?.isOpen === false) - }, [memberGroups, groupsProperties]) const [privateAppValues, setPrivateAppValues] = useState({ - name: "", - service: "DOCUMENT", - identifier: "", + name: '', + service: 'DOCUMENT', + identifier: '', groupId: 0, }); const [newPrivateAppValues, setNewPrivateAppValues] = useState({ - service: "DOCUMENT", - identifier: "", - name: "", + service: 'DOCUMENT', + identifier: '', + name: '', }); + + const mySortedNames = useSortedMyNames(names, myName); + const { getRootProps, getInputProps } = useDropzone({ accept: { - "application/zip": [".zip"], // Only accept zip files + 'application/zip': ['.zip'], // Only accept zip files }, maxSize: maxFileSize, multiple: false, // Disable multiple file uploads @@ -85,11 +117,13 @@ export const AppsPrivate = ({myName}) => { onDropRejected: (fileRejections) => { fileRejections.forEach(({ file, errors }) => { errors.forEach((error) => { - if (error.code === "file-too-large") { + if (error.code === 'file-too-large') { console.error( - `File ${file.name} is too large. Max size allowed is ${ - maxFileSize / (1024 * 1024) - } MB.` + t('core:message.error.file_too_large', { + filename: file.name, + size: maxFileSize / (1024 * 1024), + postProcess: 'capitalizeFirstChar', + }) ); } }); @@ -100,25 +134,23 @@ export const AppsPrivate = ({myName}) => { const addPrivateApp = async () => { try { if (privateAppValues?.groupId === 0) return; - - await openApp(privateAppValues, true); + await openApp(privateAppValues, true); } catch (error) { - console.error(error) - + console.error(error); } }; const clearFields = () => { setPrivateAppValues({ - name: "", - service: "DOCUMENT", - identifier: "", + name: '', + service: 'DOCUMENT', + identifier: '', groupId: 0, }); setNewPrivateAppValues({ - service: "DOCUMENT", - identifier: "", - name: "", + service: 'DOCUMENT', + identifier: '', + name: '', }); setFile(null); setValueTabPrivateApp(0); @@ -129,9 +161,28 @@ export const AppsPrivate = ({myName}) => { const publishPrivateApp = async () => { try { if (selectedGroup === 0) return; - if (!logo) throw new Error("Please select an image for a logo"); - if (!myName) throw new Error("You need a Qortal name to publish"); - if (!newPrivateAppValues?.name) throw new Error("Your app needs a name"); + + if (!logo) + throw new Error( + t('core:message.generic.select_image', { + postProcess: 'capitalizeFirstChar', + }) + ); + + if (!myName) + throw new Error( + t('core:message.generic.name_publish', { + postProcess: 'capitalizeFirstChar', + }) + ); + + if (!newPrivateAppValues?.name) + throw new Error( + t('core:message.error.app_need_name', { + postProcess: 'capitalizeFirstChar', + }) + ); + const base64Logo = await fileToBase64(logo); const base64App = await fileToBase64(file); const objectToSave = { @@ -141,30 +192,39 @@ export const AppsPrivate = ({myName}) => { }; const object64 = await objectToBase64(objectToSave); const decryptedData = await window.sendMessage( - "ENCRYPT_QORTAL_GROUP_DATA", - + 'ENCRYPT_QORTAL_GROUP_DATA', { base64: object64, groupId: selectedGroup, } ); + if (decryptedData?.error) { throw new Error( - decryptedData?.error || "Unable to encrypt app. App not published" + decryptedData?.error || + t('core:message.error.encrypt_app', { + postProcess: 'capitalizeFirstChar', + }) ); } - const fee = await getFee("ARBITRARY"); + + const fee = await getFee('ARBITRARY'); await show({ - message: "Would you like to publish this app?", - publishFee: fee.fee + " QORT", + message: t('core:message.question.publish_app', { + postProcess: 'capitalizeFirstChar', + }), + publishFee: fee.fee + ' QORT', }); + await new Promise((res, rej) => { window - .sendMessage("publishOnQDN", { + .sendMessage('publishOnQDN', { data: decryptedData, identifier: newPrivateAppValues?.identifier, service: newPrivateAppValues?.service, + uploadType: 'base64', + name, }) .then((response) => { if (!response?.error) { @@ -174,38 +234,67 @@ export const AppsPrivate = ({myName}) => { rej(response.error); }) .catch((error) => { - rej(error.message || "An error occurred"); + rej( + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }) + ); }); }); + openApp( { identifier: newPrivateAppValues?.identifier, service: newPrivateAppValues?.service, - name: myName, + name, groupId: selectedGroup, }, true ); clearFields(); } catch (error) { - setOpenSnackGlobal(true) + setOpenSnackGlobal(true); setInfoSnackCustom({ - type: "error", - message: error?.message || "Unable to publish app", + type: 'error', + message: + error?.message || + t('core:message.error.publish_app', { + postProcess: 'capitalizeFirstChar', + }), }); } }; - const handleChange = (event: React.SyntheticEvent, newValue: number) => { + const handleChange = (event: SyntheticEvent, newValue: number) => { setValueTabPrivateApp(newValue); }; function a11yProps(index: number) { return { id: `simple-tab-${index}`, - "aria-controls": `simple-tabpanel-${index}`, + 'aria-controls': `simple-tabpanel-${index}`, }; } + + const getNames = useCallback(async () => { + if (!myAddress) return; + try { + const res = await fetch( + `${getBaseApiReact()}/names/address/${myAddress}?limit=0` + ); + const data = await res.json(); + setNames(data?.map((item) => item.name)); + } catch (error) { + console.error(error); + } + }, [myAddress]); + useEffect(() => { + if (isOpenPrivateModal) { + getNames(); + } + }, [getNames, isOpenPrivateModal]); + return ( <> { setIsOpenPrivateModal(true); }} sx={{ - width: "80px", + width: '80px', }} > - + + - Private + + + {t('core:app_private', { + postProcess: 'capitalizeFirstChar', + })} + + {isOpenPrivateModal && ( { - if (e.key === "Enter") { + if (e.key === 'Enter') { if (valueTabPrivateApp === 0) { if ( !privateAppValues.name || @@ -248,66 +343,83 @@ export const AppsPrivate = ({myName}) => { }} maxWidth="md" fullWidth={true} + slotProps={{ + paper: { + style: { + backgroundColor: theme.palette.background.paper, + boxShadow: 'none', + }, + }, + }} > - - {valueTabPrivateApp === 0 - ? "Access private app" - : "Publish private app"} - - + {valueTabPrivateApp === 0 && ( <> - - + + + + + + - + + setPrivateAppValues((prev) => { @@ -353,17 +476,25 @@ export const AppsPrivate = ({myName}) => { } /> + - + + setPrivateAppValues((prev) => { @@ -376,6 +507,7 @@ export const AppsPrivate = ({myName}) => { /> + + )} + {valueTabPrivateApp === 1 && ( <> - Select .zip file containing static content:{" "} + {t('core:message.generic.select_zip', { + postProcess: 'capitalizeFirstChar', + })} + + {` - 50mb MB maximum`} + >{` 50mb MB max`} {file && ( <> + {`Selected: (${file?.name})`} )} - - {" "} + + + {' '} - {file ? "Change" : "Choose"} File + {file + ? t('core:action.change_file', { + postProcess: 'capitalizeFirstChar', + }) + : t('core:action.choose_file', { + postProcess: 'capitalizeFirstChar', + })} + + + + + + + + - + + + + - + + setNewPrivateAppValues((prev) => { @@ -486,18 +695,25 @@ export const AppsPrivate = ({myName}) => { } /> + + - + + setNewPrivateAppValues((prev) => { @@ -511,12 +727,20 @@ export const AppsPrivate = ({myName}) => { + setLogo(file)}> - + + {logo?.name} + + + diff --git a/src/components/Apps/SortablePinnedApps.tsx b/src/components/Apps/SortablePinnedApps.tsx index 98c2287..56e0aec 100644 --- a/src/components/Apps/SortablePinnedApps.tsx +++ b/src/components/Apps/SortablePinnedApps.tsx @@ -1,205 +1,262 @@ -import React, { useContext, useEffect, useMemo, useRef, useState } from 'react'; +import { useMemo } from 'react'; import { DndContext, closestCenter } from '@dnd-kit/core'; -import { arrayMove, SortableContext, sortableKeyboardCoordinates, useSortable } from '@dnd-kit/sortable'; -import { KeyboardSensor, PointerSensor, TouchSensor, useSensor, useSensors } from '@dnd-kit/core'; +import { + arrayMove, + SortableContext, + sortableKeyboardCoordinates, + useSortable, +} from '@dnd-kit/sortable'; +import { + KeyboardSensor, + PointerSensor, + TouchSensor, + useSensor, + useSensors, +} from '@dnd-kit/core'; import { CSS } from '@dnd-kit/utilities'; import { Avatar, ButtonBase } from '@mui/material'; import { AppCircle, AppCircleContainer, AppCircleLabel } from './Apps-styles'; -import { getBaseApiReact, MyContext } from '../../App'; +import { getBaseApiReact } from '../../App'; import { executeEvent } from '../../utils/events'; -import { settingsLocalLastUpdatedAtom, sortablePinnedAppsAtom } from '../../atoms/global'; -import { useRecoilState, useSetRecoilState } from 'recoil'; -import { saveToLocalStorage } from './AppsNavBar'; +import { + settingsLocalLastUpdatedAtom, + sortablePinnedAppsAtom, +} from '../../atoms/global'; +import { saveToLocalStorage } from './AppsNavBarDesktop'; import { ContextMenuPinnedApps } from '../ContextMenuPinnedApps'; -import LockIcon from "@mui/icons-material/Lock"; -import { useHandlePrivateApps } from './useHandlePrivateApps'; +import LockIcon from '@mui/icons-material/Lock'; +import { useHandlePrivateApps } from '../../hooks/useHandlePrivateApps'; +import { useAtom, useSetAtom } from 'jotai'; +import { useTranslation } from 'react-i18next'; + const SortableItem = ({ id, name, app, isDesktop }) => { - const {openApp} = useHandlePrivateApps() + const { openApp } = useHandlePrivateApps(); - const { attributes, listeners, setNodeRef, transform, transition } = useSortable({ id }); - const style = { - transform: CSS.Transform.toString(transform), - transition, - padding: '10px', - border: '1px solid #ccc', - marginBottom: '5px', - borderRadius: '4px', - backgroundColor: '#f9f9f9', - cursor: 'grab', - color: 'black' - }; + const { attributes, listeners, setNodeRef, transform, transition } = + useSortable({ id }); - return ( - - { - if(app?.isPrivate){ - try { - await openApp(app?.privateAppProperties) - } catch (error) { - console.error(error) - } - - } else { - executeEvent("addTab", { - data: app - }) - } - - }} - > - - - {app?.isPrivate && !app?.privateAppProperties?.logo ? ( - - ) : ( - - center-icon - - )} - - - {app?.isPrivate ? ( - - {`${app?.privateAppProperties?.appName || "Private"}`} - - ) : ( - - {app?.metadata?.title || app?.name} - - )} - - - - - ); -}; + const style = { + backgroundColor: '#f9f9f9', + border: '1px solid #ccc', + borderRadius: '4px', + color: 'black', + cursor: 'grab', + marginBottom: '5px', + padding: '10px', + transform: CSS.Transform.toString(transform), + transition, + }; -export const SortablePinnedApps = ({ isDesktop, myWebsite, myApp, availableQapps = [] }) => { - const [pinnedApps, setPinnedApps] = useRecoilState(sortablePinnedAppsAtom); - const setSettingsLocalLastUpdated = useSetRecoilState(settingsLocalLastUpdatedAtom); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); - const transformPinnedApps = useMemo(() => { - - // Clone the existing pinned apps list - let pinned = [...pinnedApps]; - - // Function to add or update `isMine` property - const addOrUpdateIsMine = (pinnedList, appToCheck) => { - if (!appToCheck) return pinnedList; - - const existingIndex = pinnedList.findIndex( - (item) => item?.service === appToCheck?.service && item?.name === appToCheck?.name - ); - - if (existingIndex !== -1) { - // If the app is already in the list, update it with `isMine: true` - pinnedList[existingIndex] = { ...pinnedList[existingIndex], isMine: true }; + return ( + + { + if (app?.isPrivate) { + try { + await openApp(app?.privateAppProperties); + } catch (error) { + console.error(error); + } } else { - // If not in the list, add it with `isMine: true` at the beginning - pinnedList.unshift({ ...appToCheck, isMine: true }); + executeEvent('addTab', { + data: app, + }); } - - return pinnedList; - }; - - // Update or add `myWebsite` and `myApp` while preserving their positions - pinned = addOrUpdateIsMine(pinned, myWebsite); - pinned = addOrUpdateIsMine(pinned, myApp); - - // Update pinned list based on availableQapps - pinned = pinned.map((pin) => { - const findIndex = availableQapps?.findIndex( - (item) => item?.service === pin?.service && item?.name === pin?.name - ); - if (findIndex !== -1) return { - ...availableQapps[findIndex], - ...pin - } - - return pin; - }); - - return pinned; - }, [myApp, myWebsite, pinnedApps, availableQapps]); - - - const sensors = useSensors( - useSensor(PointerSensor, { - activationConstraint: { - distance: 10, // Set a distance to avoid triggering drag on small movements - }, - }), - useSensor(TouchSensor, { - activationConstraint: { - distance: 10, // Also apply to touch - }, - }), - useSensor(KeyboardSensor, { - coordinateGetter: sortableKeyboardCoordinates, - }) - ); - - const handleDragEnd = (event) => { - const { active, over } = event; - - if (!over) return; // Make sure the drop target exists - - if (active.id !== over.id) { - const oldIndex = transformPinnedApps.findIndex((item) => `${item?.service}-${item?.name}` === active.id); - const newIndex = transformPinnedApps.findIndex((item) => `${item?.service}-${item?.name}` === over.id); - - const newOrder = arrayMove(transformPinnedApps, oldIndex, newIndex); - setPinnedApps(newOrder); - saveToLocalStorage('ext_saved_settings','sortablePinnedApps', newOrder) - setSettingsLocalLastUpdated(Date.now()) - } - }; - return ( - - `${app?.service}-${app?.name}`)}> - {transformPinnedApps.map((app) => ( - - ))} - - - ); + }} + > + + + {app?.isPrivate && !app?.privateAppProperties?.logo ? ( + + ) : ( + + center-icon + + )} + + {app?.isPrivate ? ( + + {`${ + app?.privateAppProperties?.appName || + t('core:app_private', { + postProcess: 'capitalizeFirstChar', + }) + }`} + + ) : ( + {app?.metadata?.title || app?.name} + )} + + + + ); }; +export const SortablePinnedApps = ({ + isDesktop, + myWebsite, + myApp, + availableQapps = [], +}) => { + const [pinnedApps, setPinnedApps] = useAtom(sortablePinnedAppsAtom); + const setSettingsLocalLastUpdated = useSetAtom(settingsLocalLastUpdatedAtom); + + const transformPinnedApps = useMemo(() => { + // Clone the existing pinned apps list + let pinned = [...pinnedApps]; + + // Function to add or update `isMine` property + const addOrUpdateIsMine = (pinnedList, appToCheck) => { + if (!appToCheck) return pinnedList; + + const existingIndex = pinnedList.findIndex( + (item) => + item?.service === appToCheck?.service && + item?.name === appToCheck?.name + ); + + if (existingIndex !== -1) { + // If the app is already in the list, update it with `isMine: true` + pinnedList[existingIndex] = { + ...pinnedList[existingIndex], + isMine: true, + }; + } else { + // If not in the list, add it with `isMine: true` at the beginning + pinnedList.unshift({ ...appToCheck, isMine: true }); + } + + return pinnedList; + }; + + // Update or add `myWebsite` and `myApp` while preserving their positions + pinned = addOrUpdateIsMine(pinned, myWebsite); + pinned = addOrUpdateIsMine(pinned, myApp); + + // Update pinned list based on availableQapps + pinned = pinned.map((pin) => { + const findIndex = availableQapps?.findIndex( + (item) => item?.service === pin?.service && item?.name === pin?.name + ); + if (findIndex !== -1) + return { + ...availableQapps[findIndex], + ...pin, + }; + + return pin; + }); + + return pinned; + }, [myApp, myWebsite, pinnedApps, availableQapps]); + + const sensors = useSensors( + useSensor(PointerSensor, { + activationConstraint: { + distance: 10, // Set a distance to avoid triggering drag on small movements + }, + }), + useSensor(TouchSensor, { + activationConstraint: { + distance: 10, // Also apply to touch + }, + }), + useSensor(KeyboardSensor, { + coordinateGetter: sortableKeyboardCoordinates, + }) + ); + + const handleDragEnd = (event) => { + const { active, over } = event; + + if (!over) return; // Make sure the drop target exists + + if (active.id !== over.id) { + const oldIndex = transformPinnedApps.findIndex( + (item) => `${item?.service}-${item?.name}` === active.id + ); + const newIndex = transformPinnedApps.findIndex( + (item) => `${item?.service}-${item?.name}` === over.id + ); + + const newOrder = arrayMove(transformPinnedApps, oldIndex, newIndex); + setPinnedApps(newOrder); + saveToLocalStorage('ext_saved_settings', 'sortablePinnedApps', newOrder); + setSettingsLocalLastUpdated(Date.now()); + } + }; + + return ( + + `${app?.service}-${app?.name}`)} + > + {transformPinnedApps.map((app) => ( + + ))} + + + ); +}; diff --git a/src/components/Apps/TabComponent.tsx b/src/components/Apps/TabComponent.tsx index ecf17a7..6aca3a9 100644 --- a/src/components/Apps/TabComponent.tsx +++ b/src/components/Apps/TabComponent.tsx @@ -1,71 +1,81 @@ -import React from 'react' -import { TabParent } from './Apps-styles' -import NavCloseTab from "../../assets/svgs/NavCloseTab.svg"; +import { TabParent } from './Apps-styles'; +import { NavCloseTab } from '../../assets/Icons/NavCloseTab.tsx'; import { getBaseApiReact } from '../../App'; -import { Avatar, ButtonBase } from '@mui/material'; -import LogoSelected from "../../assets/svgs/LogoSelected.svg"; +import { Avatar, ButtonBase, useTheme } from '@mui/material'; +import LogoSelected from '../../assets/svgs/LogoSelected.svg'; import { executeEvent } from '../../utils/events'; -import LockIcon from "@mui/icons-material/Lock"; +import LockIcon from '@mui/icons-material/Lock'; + +const TabComponent = ({ isSelected, app }) => { + const theme = useTheme(); -const TabComponent = ({isSelected, app}) => { return ( - { - if(isSelected){ - executeEvent('removeTab', { - data: app - }) - return + { + if (isSelected) { + executeEvent('removeTab', { + data: app, + }); + return; } executeEvent('setSelectedTab', { - data: app - }) - }}> - + data: app, + }); + }} + > + {isSelected && ( - - - - ) } - {app?.isPrivate && !app?.privateAppProperties?.logo ? ( + + )} + + {app?.isPrivate && !app?.privateAppProperties?.logo ? ( ) : ( center-icon )} - + - ) -} + ); +}; -export default TabComponent \ No newline at end of file +export default TabComponent; diff --git a/src/components/Apps/useHandlePrivateApps.tsx b/src/components/Apps/useHandlePrivateApps.tsx deleted file mode 100644 index 2eaa5f9..0000000 --- a/src/components/Apps/useHandlePrivateApps.tsx +++ /dev/null @@ -1,237 +0,0 @@ -import React, { useContext, useState } from "react"; -import { executeEvent } from "../../utils/events"; -import { getBaseApiReact, MyContext } from "../../App"; -import { createEndpoint } from "../../background"; -import { useRecoilState, useSetRecoilState } from "recoil"; -import { - settingsLocalLastUpdatedAtom, - sortablePinnedAppsAtom, -} from "../../atoms/global"; -import { saveToLocalStorage } from "./AppsNavBarDesktop"; -import { base64ToBlobUrl } from "../../utils/fileReading"; -import { base64ToUint8Array } from "../../qdn/encryption/group-encryption"; -import { uint8ArrayToObject } from "../../backgroundFunctions/encryption"; - -export const useHandlePrivateApps = () => { - const [status, setStatus] = useState(""); - const { - openSnackGlobal, - setOpenSnackGlobal, - infoSnackCustom, - setInfoSnackCustom, - } = useContext(MyContext); - const [sortablePinnedApps, setSortablePinnedApps] = useRecoilState( - sortablePinnedAppsAtom - ); - const setSettingsLocalLastUpdated = useSetRecoilState( - settingsLocalLastUpdatedAtom - ); - const openApp = async ( - privateAppProperties, - addToPinnedApps, - setLoadingStatePrivateApp - ) => { - try { - - - if(setLoadingStatePrivateApp){ - setLoadingStatePrivateApp(`Downloading and decrypting private app.`); - - } - setOpenSnackGlobal(true); - - setInfoSnackCustom({ - type: "info", - message: "Fetching app data", - duration: null - }); - const urlData = `${getBaseApiReact()}/arbitrary/${ - privateAppProperties?.service - }/${privateAppProperties?.name}/${ - privateAppProperties?.identifier - }?encoding=base64`; - let data; - try { - const responseData = await fetch(urlData, { - method: "GET", - headers: { - "Content-Type": "application/json", - }, - }); - - if(!responseData?.ok){ - if(setLoadingStatePrivateApp){ - setLoadingStatePrivateApp("Error! Unable to download private app."); - } - - throw new Error("Unable to fetch app"); - } - - data = await responseData.text(); - if (data?.error) { - if(setLoadingStatePrivateApp){ - - setLoadingStatePrivateApp("Error! Unable to download private app."); - } - throw new Error("Unable to fetch app"); - } - } catch (error) { - if(setLoadingStatePrivateApp){ - - setLoadingStatePrivateApp("Error! Unable to download private app."); - } - throw error; - } - - let decryptedData; - // eslint-disable-next-line no-useless-catch - try { - decryptedData = await window.sendMessage( - "DECRYPT_QORTAL_GROUP_DATA", - - { - base64: data, - groupId: privateAppProperties?.groupId, - } - ); - if (decryptedData?.error) { - if(setLoadingStatePrivateApp){ - - setLoadingStatePrivateApp("Error! Unable to decrypt private app."); - } - throw new Error(decryptedData?.error); - } - } catch (error) { - if(setLoadingStatePrivateApp){ - - setLoadingStatePrivateApp("Error! Unable to decrypt private app."); - } - throw error; - } - - try { - const convertToUint = base64ToUint8Array(decryptedData); - const UintToObject = uint8ArrayToObject(convertToUint); - - if (decryptedData) { - setInfoSnackCustom({ - type: "info", - message: "Building app", - }); - const endpoint = await createEndpoint( - `/arbitrary/APP/${privateAppProperties?.name}/zip?preview=true` - ); - const response = await fetch(endpoint, { - method: "POST", - headers: { - "Content-Type": "text/plain", - }, - body: UintToObject?.app, - }); - const previewPath = await response.text(); - const refreshfunc = async (tabId, privateAppProperties) => { - const checkIfPreviewLinkStillWorksUrl = await createEndpoint( - `/render/hash/HmtnZpcRPwisMfprUXuBp27N2xtv5cDiQjqGZo8tbZS?secret=E39WTiG4qBq3MFcMPeRZabtQuzyfHg9ZuR5SgY7nW1YH` - ); - const res = await fetch(checkIfPreviewLinkStillWorksUrl); - if (res.ok) { - executeEvent("refreshApp", { - tabId: tabId, - }); - } else { - const endpoint = await createEndpoint( - `/arbitrary/APP/${privateAppProperties?.name}/zip?preview=true` - ); - const response = await fetch(endpoint, { - method: "POST", - headers: { - "Content-Type": "text/plain", - }, - body: UintToObject?.app, - }); - const previewPath = await response.text(); - executeEvent("updateAppUrl", { - tabId: tabId, - url: await createEndpoint(previewPath), - }); - - setTimeout(() => { - executeEvent("refreshApp", { - tabId: tabId, - }); - }, 300); - } - }; - - const appName = UintToObject?.name; - const logo = UintToObject?.logo - ? `data:image/png;base64,${UintToObject?.logo}` - : null; - - const dataBody = { - url: await createEndpoint(previewPath), - isPreview: true, - isPrivate: true, - privateAppProperties: { ...privateAppProperties, logo, appName }, - filePath: "", - refreshFunc: (tabId) => { - refreshfunc(tabId, privateAppProperties); - }, - }; - executeEvent("addTab", { - data: dataBody, - }); - setInfoSnackCustom({ - type: "success", - message: "Opened", - }); - if(setLoadingStatePrivateApp){ - - setLoadingStatePrivateApp(``); - } - if (addToPinnedApps) { - setSortablePinnedApps((prev) => { - const updatedApps = [ - ...prev, - { - isPrivate: true, - isPreview: true, - privateAppProperties: { - ...privateAppProperties, - logo, - appName, - }, - }, - ]; - - saveToLocalStorage( - "ext_saved_settings", - "sortablePinnedApps", - updatedApps - ); - return updatedApps; - }); - setSettingsLocalLastUpdated(Date.now()); - } - } - } catch (error) { - if(setLoadingStatePrivateApp){ - - setLoadingStatePrivateApp(`Error! ${error?.message || 'Unable to build private app.'}`); - } - throw error - } - } - catch (error) { - setInfoSnackCustom({ - type: "error", - message: error?.message || "Unable to fetch app", - }); - } - - }; - return { - openApp, - status, - }; -}; diff --git a/src/components/Apps/useQortalMessageListener.tsx b/src/components/Apps/useQortalMessageListener.tsx deleted file mode 100644 index ffc0ccd..0000000 --- a/src/components/Apps/useQortalMessageListener.tsx +++ /dev/null @@ -1,693 +0,0 @@ -import { useCallback, useContext, useEffect, useMemo, useState } from 'react'; -import { executeEvent } from '../../utils/events'; -import { useSetRecoilState } from 'recoil'; -import { navigationControllerAtom } from '../../atoms/global'; -import { Filesystem, Directory, Encoding } from '@capacitor/filesystem'; -import { saveFile } from '../../qortalRequests/get'; -import { mimeToExtensionMap } from '../../utils/memeTypes'; -import { MyContext } from '../../App'; -import FileSaver from 'file-saver'; - - - - -export const saveFileInChunks = async ( - blob: Blob, - fileName: string, - chunkSize = 1024 * 1024 -) => { - try { - let offset = 0; - let isFirstChunk = true; - - // Extract the MIME type from the blob - const mimeType = blob.type || 'application/octet-stream'; - - // Create the dynamic base64 prefix - const base64Prefix = `data:${mimeType};base64,`; - - // Function to extract extension from fileName - const getExtensionFromFileName = (name: string): string => { - const lastDotIndex = name.lastIndexOf('.'); - if (lastDotIndex !== -1) { - return name.substring(lastDotIndex); // includes the dot - } - return ''; - }; - - // Extract existing extension from fileName - const existingExtension = getExtensionFromFileName(fileName); - - // Remove existing extension from fileName to avoid duplication - if (existingExtension) { - fileName = fileName.substring(0, fileName.lastIndexOf('.')); - } - - // Map MIME type to file extension - const mimeTypeToExtension = (mimeType: string): string => { - - return mimeToExtensionMap[mimeType] || existingExtension || ''; // Use existing extension if MIME type not found - }; - - // Determine the final extension to use - const extension = mimeTypeToExtension(mimeType); - - // Construct the full file name with timestamp and extension - const fullFileName = `${fileName}_${Date.now()}${extension}`; - - // Read the blob in chunks - while (offset < blob.size) { - // Extract the current chunk - const chunk = blob.slice(offset, offset + chunkSize); - - // Convert the chunk to Base64 - const base64Chunk = await blobToBase64(chunk); - - // Write the chunk to the file with the prefix added on the first chunk - await Filesystem.writeFile({ - path: fullFileName, - data: isFirstChunk ? base64Prefix + base64Chunk : base64Chunk, - directory: Directory.Documents, - recursive: true, - append: !isFirstChunk, // Append after the first chunk - }); - - // Update offset and flag - offset += chunkSize; - isFirstChunk = false; - } - - } catch (error) { - console.error('Error saving file in chunks:', error); - } -}; - - - -// Helper function to convert a Blob to a Base64 string -const blobToBase64 = (blob: Blob): Promise => { - return new Promise((resolve, reject) => { - const reader = new FileReader(); - reader.onloadend = () => { - const base64data = reader.result?.toString().split(",")[1]; - resolve(base64data || ""); - }; - reader.onerror = reject; - reader.readAsDataURL(blob); - }); -}; - -class Semaphore { - constructor(count) { - this.count = count - this.waiting = [] - } - acquire() { - return new Promise(resolve => { - if (this.count > 0) { - this.count-- - resolve() - } else { - this.waiting.push(resolve) - } - }) - } - release() { - if (this.waiting.length > 0) { - const resolve = this.waiting.shift() - resolve() - } else { - this.count++ - } - } -} -let semaphore = new Semaphore(1) -let reader = new FileReader() - -const fileToBase64 = (file) => new Promise(async (resolve, reject) => { - if (!reader) { - reader = new FileReader() - } - await semaphore.acquire() - reader.readAsDataURL(file) - reader.onload = () => { - const dataUrl = reader.result - if (typeof dataUrl === "string") { - const base64String = dataUrl.split(',')[1] - reader.onload = null - reader.onerror = null - resolve(base64String) - } else { - reader.onload = null - reader.onerror = null - reject(new Error('Invalid data URL')) - } - semaphore.release() - } - reader.onerror = (error) => { - reader.onload = null - reader.onerror = null - reject(error) - semaphore.release() - } -}) - -export function openIndexedDB() { - return new Promise((resolve, reject) => { - const request = indexedDB.open("fileStorageDB", 1); - - request.onupgradeneeded = function (event) { - const db = event.target.result; - if (!db.objectStoreNames.contains("files")) { - db.createObjectStore("files", { keyPath: "id" }); - } - }; - - request.onsuccess = function (event) { - resolve(event.target.result); - }; - - request.onerror = function () { - reject("Error opening IndexedDB"); - }; - }); - } - - -export const listOfAllQortalRequests = [ - 'GET_USER_ACCOUNT', - 'DECRYPT_DATA', - 'SEND_COIN', - 'GET_LIST_ITEMS', - 'ADD_LIST_ITEMS', - 'DELETE_LIST_ITEM', - 'VOTE_ON_POLL', - 'CREATE_POLL', - 'SEND_CHAT_MESSAGE', - 'JOIN_GROUP', - 'DEPLOY_AT', - 'GET_USER_WALLET', - 'GET_WALLET_BALANCE', - 'GET_USER_WALLET_INFO', - 'GET_CROSSCHAIN_SERVER_INFO', - 'GET_TX_ACTIVITY_SUMMARY', - 'GET_FOREIGN_FEE', - 'UPDATE_FOREIGN_FEE', - 'GET_SERVER_CONNECTION_HISTORY', - 'SET_CURRENT_FOREIGN_SERVER', - 'ADD_FOREIGN_SERVER', - 'REMOVE_FOREIGN_SERVER', - 'GET_DAY_SUMMARY', - 'CREATE_TRADE_BUY_ORDER', - 'CREATE_TRADE_SELL_ORDER', - 'CANCEL_TRADE_SELL_ORDER', - 'IS_USING_PUBLIC_NODE', - 'ADMIN_ACTION', - 'SIGN_TRANSACTION', - 'OPEN_NEW_TAB', - 'CREATE_AND_COPY_EMBED_LINK', - 'DECRYPT_QORTAL_GROUP_DATA', - 'DECRYPT_DATA_WITH_SHARING_KEY', - 'DELETE_HOSTED_DATA', - 'GET_HOSTED_DATA', - 'PUBLISH_MULTIPLE_QDN_RESOURCES', - 'PUBLISH_QDN_RESOURCE', - 'ENCRYPT_DATA', - 'ENCRYPT_DATA_WITH_SHARING_KEY', - 'ENCRYPT_QORTAL_GROUP_DATA', - 'SAVE_FILE', - 'GET_ACCOUNT_DATA', - 'GET_ACCOUNT_NAMES', - 'SEARCH_NAMES', - 'GET_NAME_DATA', - 'GET_QDN_RESOURCE_URL', - 'LINK_TO_QDN_RESOURCE', - 'LIST_QDN_RESOURCES', - 'SEARCH_QDN_RESOURCES', - 'FETCH_QDN_RESOURCE', - 'GET_QDN_RESOURCE_STATUS', - 'GET_QDN_RESOURCE_PROPERTIES', - 'GET_QDN_RESOURCE_METADATA', - 'SEARCH_CHAT_MESSAGES', - 'LIST_GROUPS', - 'GET_BALANCE', - 'GET_AT', - 'GET_AT_DATA', - 'LIST_ATS', - 'FETCH_BLOCK', - 'FETCH_BLOCK_RANGE', - 'SEARCH_TRANSACTIONS', - 'GET_PRICE', - 'SHOW_ACTIONS', - 'REGISTER_NAME', - 'UPDATE_NAME', - 'LEAVE_GROUP', - 'INVITE_TO_GROUP', - 'KICK_FROM_GROUP', - 'BAN_FROM_GROUP', - 'CANCEL_GROUP_BAN', - 'ADD_GROUP_ADMIN', - 'REMOVE_GROUP_ADMIN', - 'DECRYPT_AESGCM', - 'CANCEL_GROUP_INVITE', - 'CREATE_GROUP', - 'GET_USER_WALLET_TRANSACTIONS', - 'GET_NODE_INFO', - 'GET_NODE_STATUS', - 'GET_ARRR_SYNC_STATUS' -] - -export const UIQortalRequests = [ - 'GET_USER_ACCOUNT', - 'DECRYPT_DATA', - 'SEND_COIN', - 'GET_LIST_ITEMS', - 'ADD_LIST_ITEMS', - 'DELETE_LIST_ITEM', - 'VOTE_ON_POLL', - 'CREATE_POLL', - 'SEND_CHAT_MESSAGE', - 'JOIN_GROUP', - 'DEPLOY_AT', - 'GET_USER_WALLET', - 'GET_WALLET_BALANCE', - 'GET_USER_WALLET_INFO', - 'GET_CROSSCHAIN_SERVER_INFO', - 'GET_TX_ACTIVITY_SUMMARY', - 'GET_FOREIGN_FEE', - 'UPDATE_FOREIGN_FEE', - 'GET_SERVER_CONNECTION_HISTORY', - 'SET_CURRENT_FOREIGN_SERVER', - 'ADD_FOREIGN_SERVER', - 'REMOVE_FOREIGN_SERVER', - 'GET_DAY_SUMMARY', - 'CREATE_TRADE_BUY_ORDER', - 'CREATE_TRADE_SELL_ORDER', - 'CANCEL_TRADE_SELL_ORDER', - 'IS_USING_PUBLIC_NODE', - 'ADMIN_ACTION', - 'SIGN_TRANSACTION', - 'OPEN_NEW_TAB', - 'CREATE_AND_COPY_EMBED_LINK', - 'DECRYPT_QORTAL_GROUP_DATA', - 'DECRYPT_DATA_WITH_SHARING_KEY', - 'DELETE_HOSTED_DATA', - 'GET_HOSTED_DATA', - 'SHOW_ACTIONS', - 'REGISTER_NAME', - 'UPDATE_NAME', - 'LEAVE_GROUP', - 'INVITE_TO_GROUP', - 'KICK_FROM_GROUP', - 'BAN_FROM_GROUP', - 'CANCEL_GROUP_BAN', - 'ADD_GROUP_ADMIN', - 'REMOVE_GROUP_ADMIN', - 'DECRYPT_AESGCM', - 'CANCEL_GROUP_INVITE', - 'CREATE_GROUP', - 'GET_USER_WALLET_TRANSACTIONS', - 'GET_NODE_INFO', - 'GET_NODE_STATUS', - 'GET_ARRR_SYNC_STATUS' -]; - - - - - - async function retrieveFileFromIndexedDB(fileId) { - const db = await openIndexedDB(); - const transaction = db.transaction(["files"], "readwrite"); - const objectStore = transaction.objectStore("files"); - - return new Promise((resolve, reject) => { - const getRequest = objectStore.get(fileId); - - getRequest.onsuccess = function (event) { - if (getRequest.result) { - // File found, resolve it and delete from IndexedDB - const file = getRequest.result.data; - objectStore.delete(fileId); - resolve(file); - } else { - reject("File not found in IndexedDB"); - } - }; - - getRequest.onerror = function () { - reject("Error retrieving file from IndexedDB"); - }; - }); - } - - async function deleteQortalFilesFromIndexedDB() { - try { - const db = await openIndexedDB(); - const transaction = db.transaction(["files"], "readwrite"); - const objectStore = transaction.objectStore("files"); - - // Create a request to get all keys - const getAllKeysRequest = objectStore.getAllKeys(); - - getAllKeysRequest.onsuccess = function (event) { - const keys = event.target.result; - - // Iterate through keys to find and delete those containing '_qortalfile' - for (let key of keys) { - if (key.includes("_qortalfile")) { - const deleteRequest = objectStore.delete(key); - - deleteRequest.onsuccess = function () { - console.log(`File with key '${key}' has been deleted from IndexedDB`); - }; - - deleteRequest.onerror = function () { - console.error(`Failed to delete file with key '${key}' from IndexedDB`); - }; - } - } - }; - - getAllKeysRequest.onerror = function () { - console.error("Failed to retrieve keys from IndexedDB"); - }; - - transaction.oncomplete = function () { - console.log("Transaction complete for deleting files from IndexedDB"); - }; - - transaction.onerror = function () { - console.error("Error occurred during transaction for deleting files"); - }; - } catch (error) { - console.error("Error opening IndexedDB:", error); - } - } - - - - - export const showSaveFilePicker = async (data, {openSnackGlobal, - setOpenSnackGlobal, - infoSnackCustom, - setInfoSnackCustom}) => { - - - try { - const { filename, mimeType, blob, fileHandleOptions } = data; - - setInfoSnackCustom({ - type: "info", - message: - "Saving file...", - }); - - - setOpenSnackGlobal(true); - - - - FileSaver.saveAs(blob, filename) - - setInfoSnackCustom({ - type: "success", - message: - "Saving file success!", - }); - - - setOpenSnackGlobal(true); - } catch (error) { - setInfoSnackCustom({ - type: "error", - message: - error?.message ? `Error saving file: ${error?.message}` : 'Error saving file', - }); - - - setOpenSnackGlobal(true); - console.error("Error saving file:", error); - - } - }; - - declare var cordova: any; - - - - async function storeFilesInIndexedDB(obj) { - // First delete any existing files in IndexedDB with '_qortalfile' in their ID - await deleteQortalFilesFromIndexedDB(); - - // Open the IndexedDB - const db = await openIndexedDB(); - const transaction = db.transaction(["files"], "readwrite"); - const objectStore = transaction.objectStore("files"); - - // Handle the obj.file if it exists and is a File instance - if (obj.file) { - const fileId = Date.now() + "objFile_qortalfile"; - - // Store the file in IndexedDB - const fileData = { - id: fileId, - data: obj.file, - }; - objectStore.put(fileData); - - // Replace the file object with the file ID in the original object - obj.fileId = fileId; - delete obj.file; - } - if (obj.blob) { - const fileId = Date.now() + "objFile_qortalfile"; - - // Store the file in IndexedDB - const fileData = { - id: fileId, - data: obj.blob, - }; - objectStore.put(fileData); - - // Replace the file object with the file ID in the original object - let blobObj = { - type: obj.blob?.type - } - obj.fileId = fileId; - delete obj.blob; - obj.blob = blobObj - } - - // Iterate through resources to find files and save them to IndexedDB - for (let resource of (obj?.resources || [])) { - if (resource.file) { - const fileId = resource.identifier + Date.now() + "_qortalfile"; - - // Store the file in IndexedDB - const fileData = { - id: fileId, - data: resource.file, - }; - objectStore.put(fileData); - - // Replace the file object with the file ID in the original object - resource.fileId = fileId; - delete resource.file; - } - } - - // Set transaction completion handlers - transaction.oncomplete = function () { - console.log("Files saved successfully to IndexedDB"); - }; - - transaction.onerror = function () { - console.error("Error saving files to IndexedDB"); - }; - - return obj; // Updated object with references to stored files - } - -export const useQortalMessageListener = (frameWindow, iframeRef, tabId, isDevMode, appName, appService, skipAuth) => { - const [path, setPath] = useState('') - const [history, setHistory] = useState({ - customQDNHistoryPaths: [], -currentIndex: -1, -isDOMContentLoaded: false - }) - const setHasSettingsChangedAtom = useSetRecoilState(navigationControllerAtom); - const { openSnackGlobal, - setOpenSnackGlobal, - infoSnackCustom, - setInfoSnackCustom } = useContext(MyContext); - - - - useEffect(()=> { - if(tabId && !isNaN(history?.currentIndex)){ - setHasSettingsChangedAtom((prev)=> { - return { - ...prev, - [tabId]: { - hasBack: history?.currentIndex > 0, - } - } - }) - } - }, [history?.currentIndex, tabId]) - - - const changeCurrentIndex = useCallback((value)=> { - setHistory((prev)=> { - return { - ...prev, - currentIndex: value - } - }) - }, []) - - const resetHistory = useCallback(()=> { - setHistory({ - customQDNHistoryPaths: [], - currentIndex: -1, - isManualNavigation: true, - isDOMContentLoaded: false - }) - }, []) - - useEffect(() => { - - const listener = async (event) => { - - - if (event?.data?.requestedHandler !== 'UI') return; - - const sendMessageToRuntime = (message, eventPort) => { - window.sendMessage(message.action, message.payload, 300000, message.isExtension, { - name: appName, service: appService - }, skipAuth) - .then((response) => { - if (response.error) { - eventPort.postMessage({ - result: null, - error: { - error: response?.error, - message: typeof response?.error === 'string' ? response?.error : 'An error has occurred' - }, - }); - } else { - eventPort.postMessage({ - result: response, - error: null, - }); - } - }) - .catch((error) => { - console.error("Failed qortalRequest", error); - }); - - }; - - // Check if action is included in the predefined list of UI requests - if (UIQortalRequests.includes(event.data.action)) { - sendMessageToRuntime( - { action: event.data.action, type: 'qortalRequest', payload: event.data, isExtension: true }, - event.ports[0] - ); - } else if(event?.data?.action === 'SAVE_FILE' - ){ - try { - const res = await saveFile( event.data, null, true, { - openSnackGlobal, - setOpenSnackGlobal, - infoSnackCustom, - setInfoSnackCustom - }); - - } catch (error) { - - } - } else if ( - event?.data?.action === 'PUBLISH_MULTIPLE_QDN_RESOURCES' || - event?.data?.action === 'PUBLISH_QDN_RESOURCE' || - event?.data?.action === 'ENCRYPT_DATA' || event?.data?.action === 'ENCRYPT_DATA_WITH_SHARING_KEY' || event?.data?.action === 'ENCRYPT_QORTAL_GROUP_DATA' - - ) { - const data = event.data; - - if (data) { - sendMessageToRuntime( - { action: event.data.action, type: 'qortalRequest', payload: data, isExtension: true }, - event.ports[0] - ); - } else { - event.ports[0].postMessage({ - result: null, - error: 'Failed to prepare data for publishing', - }); - } - } else if(event?.data?.action === 'LINK_TO_QDN_RESOURCE' || - event?.data?.action === 'QDN_RESOURCE_DISPLAYED'){ - const pathUrl = event?.data?.path != null ? (event?.data?.path.startsWith('/') ? '' : '/') + event?.data?.path : null - setPath(pathUrl) - if(appName?.toLowerCase() === 'q-mail'){ - window.sendMessage("addEnteredQmailTimestamp").catch((error) => { - // error - }); - } else if(appName?.toLowerCase() === 'q-wallets'){ - executeEvent('setLastEnteredTimestampPaymentEvent', {}) - } - } else if(event?.data?.action === 'NAVIGATION_HISTORY'){ - if(event?.data?.payload?.isDOMContentLoaded){ - setHistory((prev)=> { - const copyPrev = {...prev} - if((copyPrev?.customQDNHistoryPaths || []).at(-1) === (event?.data?.payload?.customQDNHistoryPaths || []).at(-1)) { - return { - ...prev, - currentIndex: prev.customQDNHistoryPaths.length - 1 === -1 ? 0 : prev.customQDNHistoryPaths.length - 1 - } - } - const copyHistory = {...prev} - const paths = [...(copyHistory?.customQDNHistoryPaths.slice(0, copyHistory.currentIndex + 1) || []), ...(event?.data?.payload?.customQDNHistoryPaths || [])] - return { - ...prev, - customQDNHistoryPaths: paths, - currentIndex: paths.length - 1 - } - }) - } else { - setHistory(event?.data?.payload) - - } - } else if(event?.data?.action === 'SET_TAB' && !isDevMode){ - executeEvent("addTab", { - data: event?.data?.payload - }) - const targetOrigin = iframeRef.current ? new URL(iframeRef.current.src).origin : "*"; - iframeRef.current.contentWindow.postMessage( - { action: 'SET_TAB_SUCCESS', requestedHandler: 'UI',payload: { - name: event?.data?.payload?.name - } }, targetOrigin - ); - } - - - }; - - // Add the listener for messages coming from the frameWindow - frameWindow.addEventListener('message', listener); - - // Cleanup function to remove the event listener when the component is unmounted - return () => { - frameWindow.removeEventListener('message', listener); - }; - - - }, [isDevMode, appName, appService]); // Empty dependency array to run once when the component mounts - - - - return {path, history, resetHistory, changeCurrentIndex} -}; - diff --git a/src/components/Auth/DownloadWallet.tsx b/src/components/Auth/DownloadWallet.tsx new file mode 100644 index 0000000..909ad37 --- /dev/null +++ b/src/components/Auth/DownloadWallet.tsx @@ -0,0 +1,272 @@ +import { + Box, + Checkbox, + FormControlLabel, + Typography, + useTheme, +} from '@mui/material'; +import { Spacer } from '../../common/Spacer'; +import { Return } from '../../assets/Icons/Return'; +import { CustomButton, CustomLabel, TextP } from '../../styles/App-styles'; +import { PasswordField } from '../PasswordField/PasswordField'; +import { ErrorText } from '../ErrorText/ErrorText'; +import Logo1Dark from '../../assets/svgs/Logo1Dark.svg'; +import { useTranslation } from 'react-i18next'; +import { saveFileToDisk } from '../../utils/generateWallet/generateWallet'; +import { useState } from 'react'; +import { decryptStoredWallet } from '../../utils/decryptWallet'; +import PhraseWallet from '../../utils/generateWallet/phrase-wallet'; +import { crypto, walletVersion } from '../../constants/decryptWallet'; + +export const DownloadWallet = ({ + returnToMain, + setIsLoading, + showInfo, + rawWallet, + setWalletToBeDownloaded, + walletToBeDownloaded, +}) => { + const [walletToBeDownloadedPassword, setWalletToBeDownloadedPassword] = + useState(''); + const [newPassword, setNewPassword] = useState(''); + const [keepCurrentPassword, setKeepCurrentPassword] = useState(true); + const theme = useTheme(); + const [walletToBeDownloadedError, setWalletToBeDownloadedError] = + useState(''); + + const { t } = useTranslation(['auth']); + + const saveFileToDiskFunc = async () => { + try { + await saveFileToDisk( + walletToBeDownloaded.wallet, + walletToBeDownloaded.qortAddress + ); + } catch (error: any) { + setWalletToBeDownloadedError(error?.message); + } + }; + + const saveWalletFunc = async (password: string, newPassword) => { + let wallet = structuredClone(rawWallet); + + const res = await decryptStoredWallet(password, wallet); + const wallet2 = new PhraseWallet(res, wallet?.version || walletVersion); + const passwordToUse = newPassword || password; + wallet = await wallet2.generateSaveWalletData( + passwordToUse, + crypto.kdfThreads, + () => {} + ); + + setWalletToBeDownloaded({ + wallet, + qortAddress: rawWallet.address0, + }); + + return { + wallet, + qortAddress: rawWallet.address0, + }; + }; + + const confirmPasswordToDownload = async () => { + try { + setWalletToBeDownloadedError(''); + if (!keepCurrentPassword && !newPassword) { + setWalletToBeDownloadedError( + t('auth:wallet.error.missing_new_password', { + postProcess: 'capitalizeFirstChar', + }) + ); + return; + } + if (!walletToBeDownloadedPassword) { + setWalletToBeDownloadedError( + t('auth:wallet.error.missing_password', { + postProcess: 'capitalizeFirstChar', + }) + ); + return; + } + setIsLoading(true); + await new Promise((res) => { + setTimeout(() => { + res(); + }, 250); + }); + const newPasswordForWallet = !keepCurrentPassword ? newPassword : null; + const res = await saveWalletFunc( + walletToBeDownloadedPassword, + newPasswordForWallet + ); + } catch (error: any) { + setWalletToBeDownloadedError(error?.message); + } finally { + setIsLoading(false); + } + }; + + return ( + <> + + + + + + + +
+ +
+ + + + + + {t('auth:action.download_account', { + postProcess: 'capitalizeFirstChar', + })} + + + + + + {!walletToBeDownloaded && ( + <> + + {t('auth:wallet.password_confirmation', { + postProcess: 'capitalizeFirstChar', + })} + + + + + setWalletToBeDownloadedPassword(e.target.value)} + /> + + + + setKeepCurrentPassword(e.target.checked)} + checked={keepCurrentPassword} + edge="start" + tabIndex={-1} + disableRipple + sx={{ + '&.Mui-checked': { + color: theme.palette.text.secondary, + }, + '& .MuiSvgIcon-root': { + color: theme.palette.text.secondary, + }, + }} + /> + } + label={ + + + {t('auth:wallet.keep_password', { + postProcess: 'capitalizeFirstChar', + })} + + + } + /> + + + + {!keepCurrentPassword && ( + <> + + {t('auth:wallet.new_password', { + postProcess: 'capitalizeFirstChar', + })} + + + + + setNewPassword(e.target.value)} + /> + + + + )} + + + {t('auth:password_confirmation', { + postProcess: 'capitalizeFirstChar', + })} + + + {walletToBeDownloadedError} + + )} + + {walletToBeDownloaded && ( + <> + { + await saveFileToDiskFunc(); + await showInfo({ + message: t('auth:message.generic.keep_secure', { + postProcess: 'capitalizeFirstChar', + }), + }); + }} + > + {t('auth:action.download_account', { + postProcess: 'capitalizeFirstChar', + })} + + + )} + + ); +}; diff --git a/src/components/BuyQortInformation.tsx b/src/components/BuyQortInformation.tsx index b6aed75..86237ba 100644 --- a/src/components/BuyQortInformation.tsx +++ b/src/components/BuyQortInformation.tsx @@ -1,154 +1,186 @@ -import React, { useCallback, useContext, useEffect, useState } from 'react' +import { useCallback, useEffect, useState } from 'react'; import { - Avatar, - Box, - Button, - ButtonBase, - Collapse, - Dialog, - DialogActions, - DialogContent, - DialogContentText, - DialogTitle, - Input, - ListItem, - ListItemAvatar, - ListItemButton, - ListItemIcon, - ListItemText, - List, - MenuItem, - Popover, - Select, - TextField, - Typography, - } from "@mui/material"; -import { Label } from './Group/AddGroup'; + Box, + Button, + ButtonBase, + Dialog, + DialogActions, + DialogContent, + DialogTitle, + ListItem, + ListItemIcon, + ListItemText, + List, + Typography, + useTheme, +} from '@mui/material'; import { Spacer } from '../common/Spacer'; -import { LoadingButton } from '@mui/lab'; -import { getBaseApiReact, MyContext } from '../App'; -import { getFee } from '../background'; -import qTradeLogo from "../assets/Icons/q-trade-logo.webp"; - +import qTradeLogo from '../assets/Icons/q-trade-logo.webp'; import RadioButtonCheckedIcon from '@mui/icons-material/RadioButtonChecked'; -import { executeEvent, subscribeToEvent, unsubscribeFromEvent } from '../utils/events'; -import { BarSpinner } from '../common/Spinners/BarSpinner/BarSpinner'; +import { + executeEvent, + subscribeToEvent, + unsubscribeFromEvent, +} from '../utils/events'; +import { useTranslation } from 'react-i18next'; +export const BuyQortInformation = ({ balance }) => { + const [isOpen, setIsOpen] = useState(false); + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + const openBuyQortInfoFunc = useCallback( + (e) => { + setIsOpen(true); + }, + [setIsOpen] + ); -export const BuyQortInformation = ({balance}) => { - const [isOpen, setIsOpen] = useState(false) + useEffect(() => { + subscribeToEvent('openBuyQortInfo', openBuyQortInfoFunc); - const openBuyQortInfoFunc = useCallback((e) => { - setIsOpen(true) - - }, [ setIsOpen]); - - useEffect(() => { - subscribeToEvent("openBuyQortInfo", openBuyQortInfoFunc); - - return () => { - unsubscribeFromEvent("openBuyQortInfo", openBuyQortInfoFunc); - }; - }, [openBuyQortInfoFunc]); + return () => { + unsubscribeFromEvent('openBuyQortInfo', openBuyQortInfoFunc); + }; + }, [openBuyQortInfoFunc]); return ( - - {"Get QORT"} - - - - Get QORT using Qortal's crosschain trade portal - { - executeEvent("addTab", { - data: { service: "APP", name: "q-trade" }, - }); - executeEvent("open-apps-mode", {}); - setIsOpen(false) - }} - > - - - Trade QORT - - - - Benefits of having QORT - - - - - - - - - - - - - - - - - - - - - - - - - - ) -} + {t('core:action.trade_qort', { + postProcess: 'capitalizeFirstChar', + })} + +
+ + + + + {t('core:message.generic.benefits_qort', { + postProcess: 'capitalizeFirstChar', + })} + + + + + + + + + + + + + + + + + + + + + + + +
+ ); +}; diff --git a/src/components/Chat/AdminSpace.tsx b/src/components/Chat/AdminSpace.tsx index 6eaf541..62a8832 100644 --- a/src/components/Chat/AdminSpace.tsx +++ b/src/components/Chat/AdminSpace.tsx @@ -1,21 +1,7 @@ -import React, { - useCallback, - useContext, - useEffect, - useMemo, - useRef, - useState, -} from "react"; -import { GroupMail } from "../Group/Forum/GroupMail"; -import { MyContext, isMobile } from "../../App"; -import { getRootHeight } from "../../utils/mobile/mobileUtils"; -import { Box, Typography } from "@mui/material"; -import { AdminSpaceInner } from "./AdminSpaceInner"; - - - - - +import { useEffect, useState } from 'react'; +import { Box, Typography } from '@mui/material'; +import { AdminSpaceInner } from './AdminSpaceInner'; +import { useTranslation } from 'react-i18next'; export const AdminSpace = ({ selectedGroup, @@ -26,12 +12,21 @@ export const AdminSpace = ({ isAdmin, myAddress, hide, - defaultThread, + defaultThread, setDefaultThread, - setIsForceShowCreationKeyPopup + setIsForceShowCreationKeyPopup, + balance, + isOwner, }) => { - const { rootHeight } = useContext(MyContext); const [isMoved, setIsMoved] = useState(false); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + useEffect(() => { if (hide) { setTimeout(() => setIsMoved(true), 300); // Wait for the fade-out to complete before moving @@ -42,26 +37,45 @@ export const AdminSpace = ({ return (
- {!isAdmin && Sorry, this space is only for Admins.} - {isAdmin && } + style={{ + display: 'flex', + flexDirection: 'column', + height: 'calc(100vh - 70px)', + left: hide && '-1000px', + opacity: hide ? 0 : 1, + overflow: 'auto', + position: hide ? 'fixed' : 'relative', + visibility: hide && 'hidden', + width: '100%', + }} + > + {!isAdmin && ( + + + {t('core:message.generic.space_for_admins', { + postProcess: 'capitalizeFirstChar', + })} + + + )} -
+ {isAdmin && ( + + )} +
); }; diff --git a/src/components/Chat/AdminSpaceInner.tsx b/src/components/Chat/AdminSpaceInner.tsx index fa70120..d576bc7 100644 --- a/src/components/Chat/AdminSpaceInner.tsx +++ b/src/components/Chat/AdminSpaceInner.tsx @@ -1,39 +1,45 @@ -import React, { useCallback, useContext, useEffect, useState } from "react"; +import { useCallback, useContext, useEffect, useState } from 'react'; import { - MyContext, + QORTAL_APP_CONTEXT, getArbitraryEndpointReact, getBaseApiReact, -} from "../../App"; -import { Box, Button, Typography } from "@mui/material"; +} from '../../App'; +import { Box, Button, Typography } from '@mui/material'; import { decryptResource, getPublishesFromAdmins, validateSecretKey, -} from "../Group/Group"; -import { getFee } from "../../background"; -import { base64ToUint8Array } from "../../qdn/encryption/group-encryption"; -import { uint8ArrayToObject } from "../../backgroundFunctions/encryption"; -import { formatTimestampForum } from "../../utils/time"; -import { Spacer } from "../../common/Spacer"; +} from '../Group/Group'; +import { getFee } from '../../background/background.ts'; +import { base64ToUint8Array } from '../../qdn/encryption/group-encryption'; +import { uint8ArrayToObject } from '../../encryption/encryption.ts'; +import { formatTimestampForum } from '../../utils/time'; +import { Spacer } from '../../common/Spacer'; +import { GroupAvatar } from './GroupAvatar'; +import { useTranslation } from 'react-i18next'; +import i18next from 'i18next'; export const getPublishesFromAdminsAdminSpace = async ( admins: string[], groupId ) => { - const queryString = admins.map((name) => `name=${name}`).join("&"); + const queryString = admins.map((name) => `name=${name}`).join('&'); const url = `${getBaseApiReact()}${getArbitraryEndpointReact()}?mode=ALL&service=DOCUMENT_PRIVATE&identifier=admins-symmetric-qchat-group-${groupId}&exactmatchnames=true&limit=0&reverse=true&${queryString}&prefix=true`; const response = await fetch(url); + if (!response.ok) { - throw new Error("network error"); + throw new Error(i18next.t('core:message.error.network_generic')); } const adminData = await response.json(); const filterId = adminData.filter( (data: any) => data.identifier === `admins-symmetric-qchat-group-${groupId}` ); + if (filterId?.length === 0) { return false; } + const sortedData = filterId.sort((a: any, b: any) => { // Get the most recent date for both a and b const dateA = a.updated ? new Date(a.updated) : new Date(a.created); @@ -50,6 +56,9 @@ export const AdminSpaceInner = ({ selectedGroup, adminsWithNames, setIsForceShowCreationKeyPopup, + balance, + userInfo, + isOwner, }) => { const [adminGroupSecretKey, setAdminGroupSecretKey] = useState(null); const [isFetchingAdminGroupSecretKey, setIsFetchingAdminGroupSecretKey] = @@ -63,8 +72,15 @@ export const AdminSpaceInner = ({ const [groupSecretKeyPublishDetails, setGroupSecretKeyPublishDetails] = useState(null); const [isLoadingPublishKey, setIsLoadingPublishKey] = useState(false); - const { show, setTxList, setInfoSnackCustom, setOpenSnackGlobal } = - useContext(MyContext); + const { show, setInfoSnackCustom, setOpenSnackGlobal } = + useContext(QORTAL_APP_CONTEXT); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); const getAdminGroupSecretKey = useCallback(async () => { try { @@ -74,23 +90,28 @@ export const AdminSpaceInner = ({ selectedGroup ); if (getLatestPublish === false) return; - let data; const res = await fetch( `${getBaseApiReact()}/arbitrary/DOCUMENT_PRIVATE/${ getLatestPublish.name - }/${getLatestPublish.identifier}?encoding=base64` + }/${getLatestPublish.identifier}?encoding=base64&rebuild=true` ); - data = await res.text(); + const data = await res.text(); const decryptedKey: any = await decryptResource(data); const dataint8Array = base64ToUint8Array(decryptedKey.data); const decryptedKeyToObject = uint8ArrayToObject(dataint8Array); + if (!validateSecretKey(decryptedKeyToObject)) - throw new Error("SecretKey is not valid"); + throw new Error( + t('auth:message.error.invalid_secret_key', { + postProcess: 'capitalizeFirstChar', + }) + ); setAdminGroupSecretKey(decryptedKeyToObject); setAdminGroupSecretKeyPublishDetails(getLatestPublish); } catch (error) { + console.log(error); } finally { setIsFetchingAdminGroupSecretKey(false); } @@ -106,6 +127,7 @@ export const AdminSpaceInner = ({ if (getLatestPublish === false) setGroupSecretKeyPublishDetails(false); setGroupSecretKeyPublishDetails(getLatestPublish); } catch (error) { + console.log(error); } finally { setIsFetchingGroupSecretKey(false); } @@ -113,15 +135,20 @@ export const AdminSpaceInner = ({ const createCommonSecretForAdmins = async () => { try { - const fee = await getFee("ARBITRARY"); + const fee = await getFee('ARBITRARY'); + await show({ - message: "Would you like to perform an ARBITRARY transaction?", - publishFee: fee.fee + " QORT", + message: t('core:message.question.perform_transaction', { + action: 'ARBITRARY', + postProcess: 'capitalizeFirstChar', + }), + publishFee: fee.fee + ' QORT', }); + setIsLoadingPublishKey(true); window - .sendMessage("encryptAndPublishSymmetricKeyGroupChatForAdmins", { + .sendMessage('encryptAndPublishSymmetricKeyGroupChatForAdmins', { groupId: selectedGroup, previousData: adminGroupSecretKey, admins: adminsWithNames, @@ -129,27 +156,38 @@ export const AdminSpaceInner = ({ .then((response) => { if (!response?.error) { setInfoSnackCustom({ - type: "success", - message: - "Successfully re-encrypted secret key. It may take a couple of minutes for the changes to propagate. Refresh the group in 5 mins.", + type: 'success', + message: t('auth:message.success.reencrypted_secret_key', { + postProcess: 'capitalizeFirstChar', + }), }); setOpenSnackGlobal(true); return; } setInfoSnackCustom({ - type: "error", - message: response?.error || "unable to re-encrypt secret key", + type: 'error', + message: + response?.error || + t('auth:message.error.reencrypt_secret_key', { + postProcess: 'capitalizeFirstChar', + }), }); setOpenSnackGlobal(true); }) .catch((error) => { setInfoSnackCustom({ - type: "error", - message: error?.message || "unable to re-encrypt secret key", + type: 'error', + message: + error?.message || + t('auth:message.error.reencrypt_secret_key', { + postProcess: 'capitalizeFirstChar', + }), }); setOpenSnackGlobal(true); }); - } catch (error) {} + } catch (error) { + console.log(error); + } }; useEffect(() => { @@ -159,90 +197,186 @@ export const AdminSpaceInner = ({ return ( - Reminder: After publishing the key, it will take a couple of minutes for it to appear. Please just wait. + + {t('auth:message.generic.publishing_key', { + postProcess: 'capitalizeFirstChar', + })} + + + {isFetchingGroupSecretKey && ( - Fetching Group secret key publishes - )} - {!isFetchingGroupSecretKey && - groupSecretKeyPublishDetails === false && ( - No secret key published yet - )} - {groupSecretKeyPublishDetails && ( - Last encryption date:{" "} - {formatTimestampForum( - groupSecretKeyPublishDetails?.updated || - groupSecretKeyPublishDetails?.created - )}{" "} - {` by ${groupSecretKeyPublishDetails?.name}`} + {t('auth:message.generic.fetching_group_secret_key', { + postProcess: 'capitalizeFirstChar', + })} )} - + - This key is to encrypt GROUP related content. This is the only one used in this UI as of now. All group members will be able to see content encrypted with this key. + + + {t('auth:tips.key_encrypt_group', { + postProcess: 'capitalizeFirstChar', + })} + + + {isFetchingAdminGroupSecretKey && ( - Fetching Admins secret key - )} - {!isFetchingAdminGroupSecretKey && !adminGroupSecretKey && ( - No secret key published yet - )} - {adminGroupSecretKeyPublishDetails && ( - Last encryption date:{" "} - {formatTimestampForum( - adminGroupSecretKeyPublishDetails?.updated || - adminGroupSecretKeyPublishDetails?.created - )} + {t('auth:message.generic.fetching_admin_secret_key', { + postProcess: 'capitalizeFirstChar', + })} )} - + - This key is to encrypt ADMIN related content. Only admins would see content encrypted with it. + + + {t('auth:tips.key_encrypt_admin', { + postProcess: 'capitalizeFirstChar', + })} + + + + + {isOwner && ( + + + {t('group:group.avatar', { + postProcess: 'capitalizeFirstChar', + })} + + + + + )} ); }; diff --git a/src/components/Chat/AnnouncementDiscussion.tsx b/src/components/Chat/AnnouncementDiscussion.tsx index 5603de0..b248735 100644 --- a/src/components/Chat/AnnouncementDiscussion.tsx +++ b/src/components/Chat/AnnouncementDiscussion.tsx @@ -1,18 +1,32 @@ -import React, { useMemo, useRef, useState } from "react"; -import TipTap from "./TipTap"; -import { AuthenticatedContainerInnerTop, CustomButton } from "../../App-styles"; -import { Box, CircularProgress } from "@mui/material"; -import { objectToBase64 } from "../../qdn/encryption/group-encryption"; -import ShortUniqueId from "short-unique-id"; -import { LoadingSnackbar } from "../Snackbar/LoadingSnackbar"; -import { getBaseApi, getFee } from "../../background"; -import { decryptPublishes, getTempPublish, handleUnencryptedPublishes, saveTempPublish } from "./GroupAnnouncements"; -import { AnnouncementList } from "./AnnouncementList"; -import { Spacer } from "../../common/Spacer"; +import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; +import TipTap from './TipTap'; +import { + AuthenticatedContainerInnerTop, + CustomButton, +} from '../../styles/App-styles'; +import { Box, CircularProgress, useTheme } from '@mui/material'; +import { objectToBase64 } from '../../qdn/encryption/group-encryption'; +import ShortUniqueId from 'short-unique-id'; +import { LoadingSnackbar } from '../Snackbar/LoadingSnackbar'; +import { getFee } from '../../background/background.ts'; +import { + decryptPublishes, + getTempPublish, + handleUnencryptedPublishes, + saveTempPublish, +} from './GroupAnnouncements'; +import { AnnouncementList } from './AnnouncementList'; +import { Spacer } from '../../common/Spacer'; import ArrowBackIcon from '@mui/icons-material/ArrowBack'; -import { getArbitraryEndpointReact, getBaseApiReact, isMobile, pauseAllQueues, resumeAllQueues } from "../../App"; +import { + getArbitraryEndpointReact, + getBaseApiReact, + pauseAllQueues, + resumeAllQueues, +} from '../../App'; +import { useTranslation } from 'react-i18next'; -const tempKey = 'accouncement-comment' +const tempKey = 'accouncement-comment'; const uid = new ShortUniqueId({ length: 8 }); export const AnnouncementDiscussion = ({ @@ -23,43 +37,46 @@ export const AnnouncementDiscussion = ({ setSelectedAnnouncement, show, myName, - isPrivate + isPrivate, }) => { + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); const [isSending, setIsSending] = useState(false); const [isLoading, setIsLoading] = useState(false); const [isFocusedParent, setIsFocusedParent] = useState(false); - - const [comments, setComments] = useState([]) - const [tempPublishedList, setTempPublishedList] = useState([]) - const firstMountRef = useRef(false) - const [data, setData] = useState({}) + const [comments, setComments] = useState([]); + const [tempPublishedList, setTempPublishedList] = useState([]); + const firstMountRef = useRef(false); + const [data, setData] = useState({}); const editorRef = useRef(null); const setEditorRef = (editorInstance) => { editorRef.current = editorInstance; }; - + const clearEditorContent = () => { if (editorRef.current) { editorRef.current.chain().focus().clearContent().run(); - if(isMobile){ - setTimeout(() => { - editorRef.current?.chain().blur().run(); - setIsFocusedParent(false) - }, 200); - } } }; const getData = async ({ identifier, name }, isPrivate) => { try { - const res = await fetch( `${getBaseApiReact()}/arbitrary/DOCUMENT/${name}/${identifier}?encoding=base64` ); - if(!res?.ok) return + if (!res?.ok) return; const data = await res.text(); - const response = isPrivate === false ? handleUnencryptedPublishes([data]) : await decryptPublishes([{ data }], secretKey); - + const response = + isPrivate === false + ? handleUnencryptedPublishes([data]) + : await decryptPublishes([{ data }], secretKey); + const messageData = response[0]; setData((prev) => { return { @@ -67,19 +84,21 @@ export const AnnouncementDiscussion = ({ [`${identifier}-${name}`]: messageData, }; }); - - } catch (error) {} + } catch (error) { + console.log(error); + } }; const publishAnc = async ({ encryptedData, identifier }: any) => { try { if (!selectedAnnouncement) return; - + return new Promise((res, rej) => { - window.sendMessage("publishGroupEncryptedResource", { - encryptedData, - identifier, - }) + window + .sendMessage('publishGroupEncryptedResource', { + encryptedData, + identifier, + }) .then((response) => { if (!response?.error) { res(response); @@ -88,64 +107,75 @@ export const AnnouncementDiscussion = ({ rej(response.error); }) .catch((error) => { - rej(error.message || "An error occurred"); + rej( + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }) + ); }); - }); - } catch (error) {} + } catch (error) { + console.log(error); + } }; - const setTempData = async ()=> { + const setTempData = async () => { try { - const getTempAnnouncements = await getTempPublish() - if(getTempAnnouncements[tempKey]){ - let tempData = [] - Object.keys(getTempAnnouncements[tempKey] || {}).map((key)=> { - const value = getTempAnnouncements[tempKey][key] - if(value.data?.announcementId === selectedAnnouncement.identifier){ - tempData.push(value.data) + const getTempAnnouncements = await getTempPublish(); + if (getTempAnnouncements[tempKey]) { + let tempData = []; + Object.keys(getTempAnnouncements[tempKey] || {}).map((key) => { + const value = getTempAnnouncements[tempKey][key]; + if (value.data?.announcementId === selectedAnnouncement.identifier) { + tempData.push(value.data); + } + }); + setTempPublishedList(tempData); } - }) - setTempPublishedList(tempData) - } } catch (error) { - + console.log(error); } - - } + }; const publishComment = async () => { try { - pauseAllQueues() - const fee = await getFee('ARBITRARY') + pauseAllQueues(); + const fee = await getFee('ARBITRARY'); await show({ - message: "Would you like to perform a ARBITRARY transaction?" , - publishFee: fee.fee + ' QORT' - }) + message: t('core:message.question.perform_transaction', { + action: 'ARBITRARY', + postProcess: 'capitalizeFirstChar', + }), + publishFee: fee.fee + ' QORT', + }); + if (isSending) return; if (editorRef.current) { const htmlContent = editorRef.current.getHTML(); - - if (!htmlContent?.trim() || htmlContent?.trim() === "

") return; + + if (!htmlContent?.trim() || htmlContent?.trim() === '

') return; setIsSending(true); const message = { version: 1, extra: {}, message: htmlContent, }; - const secretKeyObject = isPrivate === false ? null : await getSecretKey(false, true); - const message64: any = await objectToBase64(message); - - const encryptSingle = isPrivate === false ? message64 : await encryptChatMessage( - message64, - secretKeyObject - ); + const secretKeyObject = + isPrivate === false ? null : await getSecretKey(false, true); + const message64: any = await objectToBase64(message); + + const encryptSingle = + isPrivate === false + ? message64 + : await encryptChatMessage(message64, secretKeyObject); const randomUid = uid.rnd(); const identifier = `cm-${selectedAnnouncement.identifier}-${randomUid}`; + const res = await publishAnc({ encryptedData: encryptSingle, - identifier - }); + identifier, + }); // TODO remove unused? const dataToSaveToStorage = { name: myName, @@ -153,169 +183,171 @@ export const AnnouncementDiscussion = ({ service: 'DOCUMENT', tempData: message, created: Date.now(), - announcementId: selectedAnnouncement.identifier - } - await saveTempPublish({data: dataToSaveToStorage, key: tempKey}) - setTempData() - + announcementId: selectedAnnouncement.identifier, + }; + + await saveTempPublish({ data: dataToSaveToStorage, key: tempKey }); + setTempData(); + clearEditorContent(); } // send chat message } catch (error) { console.error(error); } finally { - resumeAllQueues() + resumeAllQueues(); setIsSending(false); } }; - const getComments = React.useCallback( + const getComments = useCallback( async (selectedAnnouncement, isPrivate) => { try { - setIsLoading(true); const offset = 0; - - // dispatch(setIsLoadingGlobal(true)) const identifier = `cm-${selectedAnnouncement.identifier}`; const url = `${getBaseApiReact()}${getArbitraryEndpointReact()}?mode=ALL&service=DOCUMENT&identifier=${identifier}&limit=20&includemetadata=false&offset=${offset}&reverse=true&prefix=true`; const response = await fetch(url, { - method: "GET", + method: 'GET', headers: { - "Content-Type": "application/json", + 'Content-Type': 'application/json', }, }); const responseData = await response.json(); - setTempData() + setTempData(); setComments(responseData); setIsLoading(false); for (const data of responseData) { getData({ name: data.name, identifier: data.identifier }, isPrivate); } } catch (error) { + console.log(error); } finally { setIsLoading(false); - - // dispatch(setIsLoadingGlobal(false)) } }, [secretKey] ); - const loadMore = async()=> { + const loadMore = async () => { try { setIsLoading(true); - const offset = comments.length + const offset = comments.length; const identifier = `cm-${selectedAnnouncement.identifier}`; - const url = `${getBaseApiReact()}${getArbitraryEndpointReact()}?mode=ALL&service=DOCUMENT&identifier=${identifier}&limit=20&includemetadata=false&offset=${offset}&reverse=true&prefix=true`; - const response = await fetch(url, { - method: "GET", - headers: { - "Content-Type": "application/json", - }, - }); - const responseData = await response.json(); + const url = `${getBaseApiReact()}${getArbitraryEndpointReact()}?mode=ALL&service=DOCUMENT&identifier=${identifier}&limit=20&includemetadata=false&offset=${offset}&reverse=true&prefix=true`; + const response = await fetch(url, { + method: 'GET', + headers: { + 'Content-Type': 'application/json', + }, + }); + const responseData = await response.json(); - setComments((prev)=> [...prev, ...responseData]); - setIsLoading(false); - for (const data of responseData) { - getData({ name: data.name, identifier: data.identifier }, isPrivate); - } + setComments((prev) => [...prev, ...responseData]); + setIsLoading(false); + for (const data of responseData) { + getData({ name: data.name, identifier: data.identifier }, isPrivate); + } } catch (error) { - + console.log(error); } - - } + }; const combinedListTempAndReal = useMemo(() => { // Combine the two lists const combined = [...tempPublishedList, ...comments]; - + // Remove duplicates based on the "identifier" const uniqueItems = new Map(); - combined.forEach(item => { - uniqueItems.set(item.identifier, item); // This will overwrite duplicates, keeping the last occurrence + combined.forEach((item) => { + uniqueItems.set(item.identifier, item); // This will overwrite duplicates, keeping the last occurrence }); - + // Convert the map back to an array and sort by "created" timestamp in descending order - const sortedList = Array.from(uniqueItems.values()).sort((a, b) => b.created - a.created); - + const sortedList = Array.from(uniqueItems.values()).sort( + (a, b) => b.created - a.created + ); + return sortedList; }, [tempPublishedList, comments]); - React.useEffect(() => { - if(!secretKey && isPrivate) return + useEffect(() => { + if (!secretKey && isPrivate) return; if (selectedAnnouncement && !firstMountRef.current && isPrivate !== null) { getComments(selectedAnnouncement, isPrivate); - firstMountRef.current = true + firstMountRef.current = true; } }, [selectedAnnouncement, secretKey, isPrivate]); return (
-
+
+ + setSelectedAnnouncement(null)} + sx={{ + cursor: 'pointer', + }} + /> + - - setSelectedAnnouncement(null)} sx={{ - cursor: 'pointer' - }} /> - -
+ {}} + setSelectedAnnouncement={() => {}} disableComment showLoadMore={comments.length > 0 && comments.length % 20 === 0} loadMore={loadMore} myName={myName} - /> +
- - {isFocusedParent && ( - { - if(isSending) return - setIsFocusedParent(false) - clearEditorContent() - // Unfocus the editor - }} - style={{ - marginTop: 'auto', - alignSelf: 'center', - cursor: isSending ? 'default' : 'pointer', - flexShrink: 0, - padding: isMobile && '5px', - fontSize: isMobile && '14px', - background: 'red', - }} - > - - {` Close`} - - - )} - { - if (isSending) return; - publishComment(); - }} - style={{ - marginTop: "auto", - alignSelf: "center", - cursor: isSending ? "default" : "pointer", - background: isSending && "rgba(0, 0, 0, 0.8)", + + - {isSending && ( - { + if (isSending) return; + setIsFocusedParent(false); + clearEditorContent(); + // TODO Unfocus the editor }} - /> + style={{ + alignSelf: 'center', + background: 'red', + cursor: isSending ? 'default' : 'pointer', + flexShrink: 0, + fontSize: '14px', + marginTop: 'auto', + padding: '5px', + }} + > + {t('core:action.close', { postProcess: 'capitalizeFirstChar' })} + )} - {` Publish Comment`} - - - + { + if (isSending) return; + publishComment(); + }} + style={{ + alignSelf: 'center', + background: theme.palette.background.default, + cursor: isSending ? 'default' : 'pointer', + flexShrink: 0, + fontSize: '14px', + marginTop: 'auto', + padding: '5px', + }} + > + {isSending && ( + + )} + {t('core:action.publish_comment', { + postProcess: 'capitalizeFirstChar', + })} + +
- +
diff --git a/src/components/Chat/AnnouncementItem.tsx b/src/components/Chat/AnnouncementItem.tsx index 758a451..a20f58d 100644 --- a/src/components/Chat/AnnouncementItem.tsx +++ b/src/components/Chat/AnnouncementItem.tsx @@ -1,173 +1,218 @@ -import { Message } from "@chatscope/chat-ui-kit-react"; -import React, { useEffect, useState } from "react"; -import { useInView } from "react-intersection-observer"; -import { MessageDisplay } from "./MessageDisplay"; -import { Avatar, Box, Typography } from "@mui/material"; -import { formatTimestamp } from "../../utils/time"; +import { useCallback, useEffect, useState } from 'react'; +import { MessageDisplay } from './MessageDisplay'; +import { Avatar, Box, Typography, useTheme } from '@mui/material'; +import { formatTimestamp } from '../../utils/time'; import ChatBubbleIcon from '@mui/icons-material/ChatBubble'; import ArrowForwardIosIcon from '@mui/icons-material/ArrowForwardIos'; -import { getBaseApi } from "../../background"; -import { requestQueueCommentCount } from "./GroupAnnouncements"; -import { CustomLoader } from "../../common/CustomLoader"; -import { getArbitraryEndpointReact, getBaseApiReact } from "../../App"; -import { WrapperUserAction } from "../WrapperUserAction"; -export const AnnouncementItem = ({ message, messageData, setSelectedAnnouncement, disableComment, myName }) => { +import { requestQueueCommentCount } from './GroupAnnouncements'; +import { CustomLoader } from '../../common/CustomLoader'; +import { getArbitraryEndpointReact, getBaseApiReact } from '../../App'; +import { WrapperUserAction } from '../WrapperUserAction'; +import { useTranslation } from 'react-i18next'; - const [commentLength, setCommentLength] = useState(0) - const getNumberOfComments = React.useCallback( - async () => { - try { - const offset = 0; +export const AnnouncementItem = ({ + message, + messageData, + setSelectedAnnouncement, + disableComment, + myName, +}) => { + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + const [commentLength, setCommentLength] = useState(0); - // dispatch(setIsLoadingGlobal(true)) - const identifier = `cm-${message.identifier}`; - const url = `${getBaseApiReact()}${getArbitraryEndpointReact()}?mode=ALL&service=DOCUMENT&identifier=${identifier}&limit=0&includemetadata=false&offset=${offset}&reverse=true&prefix=true`; - - const response = await requestQueueCommentCount.enqueue(() => { - return fetch(url, { - method: "GET", - headers: { - "Content-Type": "application/json", - }, - }); - }) - const responseData = await response.json(); + const getNumberOfComments = useCallback(async () => { + try { + const offset = 0; + const identifier = `cm-${message.identifier}`; + const url = `${getBaseApiReact()}${getArbitraryEndpointReact()}?mode=ALL&service=DOCUMENT&identifier=${identifier}&limit=0&includemetadata=false&offset=${offset}&reverse=true&prefix=true`; + + const response = await requestQueueCommentCount.enqueue(() => { + return fetch(url, { + method: 'GET', + headers: { + 'Content-Type': 'application/json', + }, + }); + }); + const responseData = await response.json(); + + setCommentLength(responseData?.length); + } catch (error) { + console.log(error); + } + }, []); + + useEffect(() => { + if (disableComment) return; + getNumberOfComments(); + }, []); - setCommentLength(responseData?.length); - - } catch (error) { - } finally { - // dispatch(setIsLoadingGlobal(false)) - } - }, - [] - ); - useEffect(()=> { - if(disableComment) return - getNumberOfComments() - }, []) return (
- - - - {message?.name?.charAt(0)} - - - - + + {message?.name?.charAt(0)} + + + + - {message?.name} - - - {!messageData?.decryptedData && ( - - - - )} - {messageData?.decryptedData?.message && ( - <> - {messageData?.type === "notification" ? ( - - ) : ( - - )} - - )} + + + {message?.name} + + - - - {formatTimestamp(message.created)} + {!messageData?.decryptedData && ( + + + + )} + + {messageData?.decryptedData?.message && ( + <> + {messageData?.type === 'notification' ? ( + + ) : ( + + )} + + )} + + + + {formatTimestamp(message.created)} + + - - {!disableComment && ( - setSelectedAnnouncement(message)}> - - - - {commentLength ? ( - {`${commentLength > 1 ? `${commentLength} comments` : `${commentLength} comment`}`} - ) : ( - Leave comment - )} - + + {!disableComment && ( + setSelectedAnnouncement(message)} + > + + + {commentLength ? ( + {`${commentLength > 1 ? `${commentLength} comments` : `${commentLength} comment`}`} + ) : ( + + {t('core:action.leave_comment', { + postProcess: 'capitalizeFirstChar', + })} + + )} + + + - - - )} - + )}
); }; diff --git a/src/components/Chat/AnnouncementList.tsx b/src/components/Chat/AnnouncementList.tsx index b55ebb5..eea6c83 100644 --- a/src/components/Chat/AnnouncementList.tsx +++ b/src/components/Chat/AnnouncementList.tsx @@ -1,13 +1,9 @@ -import React, { useCallback, useState, useEffect, useRef } from "react"; -import { - List, - AutoSizer, - CellMeasurerCache, - CellMeasurer, -} from "react-virtualized"; -import { AnnouncementItem } from "./AnnouncementItem"; -import { Box } from "@mui/material"; -import { CustomButton } from "../../App-styles"; +import { useState, useEffect, useRef } from 'react'; +import { CellMeasurerCache } from 'react-virtualized'; +import { AnnouncementItem } from './AnnouncementItem'; +import { Box } from '@mui/material'; +import { CustomButton } from '../../styles/App-styles'; +import { useTranslation } from 'react-i18next'; const cache = new CellMeasurerCache({ fixedWidth: true, @@ -21,11 +17,16 @@ export const AnnouncementList = ({ disableComment, showLoadMore, loadMore, - myName + myName, }) => { - - const listRef = useRef(); const [messages, setMessages] = useState(initialMessages); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); useEffect(() => { cache.clearAll(); @@ -35,64 +36,63 @@ export const AnnouncementList = ({ setMessages(initialMessages); }, [initialMessages]); - return (
{messages.map((message) => { - const messageData = message?.tempData ? { - decryptedData: message?.tempData - } : announcementData[`${message.identifier}-${message.name}`]; + const messageData = message?.tempData + ? { + decryptedData: message?.tempData, + } + : announcementData[`${message.identifier}-${message.name}`]; return ( - -
- -
- +
+ +
); })} - {/* - {({ height, width }) => ( - + + + {showLoadMore && ( + + {t('core:action.load_announcements', { + postProcess: 'capitalizeFirstChar', + })} + )} - */} - - {showLoadMore && ( - Load older announcements - )} - +
); }; diff --git a/src/components/Chat/ChatContainer.tsx b/src/components/Chat/ChatContainer.tsx deleted file mode 100644 index 399e5a4..0000000 --- a/src/components/Chat/ChatContainer.tsx +++ /dev/null @@ -1,56 +0,0 @@ -import React, { useState } from "react"; -import InfiniteScroll from "react-infinite-scroller"; -import { - MainContainer, - ChatContainer, - MessageList, - Message, - MessageInput, - Avatar -} from "@chatscope/chat-ui-kit-react"; -import "@chatscope/chat-ui-kit-styles/dist/default/styles.min.css"; - -export const ChatContainerComp = ({messages}) => { - // const [messages, setMessages] = useState([ - // { id: 1, text: "Hello! How are you?", sender: "Joe"}, - // { id: 2, text: "I'm good, thank you!", sender: "Me" } - // ]); - - // const loadMoreMessages = () => { - // // Simulate loading more messages (you could fetch these from an API) - // const moreMessages = [ - // { id: 3, text: "What about you?", sender: "Joe", direction: "incoming" }, - // { id: 4, text: "I'm great, thanks!", sender: "Me", direction: "outgoing" } - // ]; - // setMessages((prevMessages) => [...moreMessages, ...prevMessages]); - // }; - - return ( -
- - - - {messages.map((msg) => ( - - {msg.direction === "incoming" && } - - ))} - - - - - -
- ); -}; - - diff --git a/src/components/Chat/ChatDirect.tsx b/src/components/Chat/ChatDirect.tsx index d23f026..5b5ac1f 100644 --- a/src/components/Chat/ChatDirect.tsx +++ b/src/components/Chat/ChatDirect.tsx @@ -1,96 +1,120 @@ -import React, { useCallback, useEffect, useMemo, useReducer, useRef, useState } from 'react' - -import { objectToBase64 } from '../../qdn/encryption/group-encryption' -import { ChatList } from './ChatList' -import "@chatscope/chat-ui-kit-styles/dist/default/styles.min.css"; -import Tiptap from './TipTap' -import { CustomButton } from '../../App-styles' +import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; +import { ChatList } from './ChatList'; +import Tiptap from './TipTap'; +import { CustomButton } from '../../styles/App-styles'; import CircularProgress from '@mui/material/CircularProgress'; -import { Box, ButtonBase, Input, Typography } from '@mui/material'; +import { Box, ButtonBase, Input, Typography, useTheme } from '@mui/material'; import { LoadingSnackbar } from '../Snackbar/LoadingSnackbar'; import { getNameInfo } from '../Group/Group'; import { Spacer } from '../../common/Spacer'; import { CustomizedSnackbars } from '../Snackbar/Snackbar'; -import { getBaseApiReact, getBaseApiReactSocket, isMobile, pauseAllQueues, resumeAllQueues } from '../../App'; -import { getPublicKey } from '../../background'; -import { useMessageQueue } from '../../MessageQueueContext'; -import { executeEvent, subscribeToEvent, unsubscribeFromEvent } from '../../utils/events'; +import { + getBaseApiReact, + getBaseApiReactSocket, + pauseAllQueues, + resumeAllQueues, +} from '../../App'; +import { getPublicKey } from '../../background/background.ts'; +import { useMessageQueue } from '../../messaging/MessageQueueContext.tsx'; +import { + executeEvent, + subscribeToEvent, + unsubscribeFromEvent, +} from '../../utils/events'; import ArrowBackIcon from '@mui/icons-material/ArrowBack'; -import ShortUniqueId from "short-unique-id"; -import { ReturnIcon } from '../../assets/Icons/ReturnIcon'; +import ShortUniqueId from 'short-unique-id'; import { ExitIcon } from '../../assets/Icons/ExitIcon'; -import { MessageItem, ReplyPreview } from './MessageItem'; - +import { ReplyPreview } from './MessageItem'; +import { useTranslation } from 'react-i18next'; const uid = new ShortUniqueId({ length: 5 }); - -export const ChatDirect = ({ myAddress, isNewChat, selectedDirect, setSelectedDirect, setNewChat, getTimestampEnterChat, myName, balance, close, setMobileViewModeKeepOpen}) => { - const { queueChats, addToQueue, processWithNewMessages} = useMessageQueue(); - const [isFocusedParent, setIsFocusedParent] = useState(false); - const [onEditMessage, setOnEditMessage] = useState(null) - - const [messages, setMessages] = useState([]) - const [isSending, setIsSending] = useState(false) - const [directToValue, setDirectToValue] = useState('') - const hasInitialized = useRef(false) - const [isLoading, setIsLoading] = useState(false) - const [openSnack, setOpenSnack] = React.useState(false); - const [infoSnack, setInfoSnack] = React.useState(null); - const [publicKeyOfRecipient, setPublicKeyOfRecipient] = React.useState("") - const hasInitializedWebsocket = useRef(false) - const [chatReferences, setChatReferences] = useState({}) - +export const ChatDirect = ({ + myAddress, + isNewChat, + selectedDirect, + setSelectedDirect, + setNewChat, + getTimestampEnterChat, + myName, + balance, + close, + setMobileViewModeKeepOpen, +}) => { + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + const { queueChats, addToQueue, processWithNewMessages } = useMessageQueue(); + const [isFocusedParent, setIsFocusedParent] = useState(false); + const [onEditMessage, setOnEditMessage] = useState(null); + const [messages, setMessages] = useState([]); + const [isSending, setIsSending] = useState(false); + const [directToValue, setDirectToValue] = useState(''); + const hasInitialized = useRef(false); + const [isLoading, setIsLoading] = useState(false); + const [openSnack, setOpenSnack] = useState(false); + const [infoSnack, setInfoSnack] = useState(null); + const [publicKeyOfRecipient, setPublicKeyOfRecipient] = useState(''); + const hasInitializedWebsocket = useRef(false); + const [chatReferences, setChatReferences] = useState({}); const editorRef = useRef(null); const socketRef = useRef(null); const timeoutIdRef = useRef(null); - const [messageSize, setMessageSize] = useState(0) + const [messageSize, setMessageSize] = useState(0); const groupSocketTimeoutRef = useRef(null); - const [replyMessage, setReplyMessage] = useState(null) + const [replyMessage, setReplyMessage] = useState(null); const setEditorRef = (editorInstance) => { editorRef.current = editorInstance; }; - const [, forceUpdate] = useReducer((x) => x + 1, 0); + const publicKeyOfRecipientRef = useRef(null); - const triggerRerender = () => { - forceUpdate(); // Trigger re-render by updating the state - }; - const publicKeyOfRecipientRef = useRef(null) - const getPublicKeyFunc = async (address)=> { + const getPublicKeyFunc = async (address) => { try { - const publicKey = await getPublicKey(address) - if(publicKeyOfRecipientRef.current !== selectedDirect?.address) return - setPublicKeyOfRecipient(publicKey) + const publicKey = await getPublicKey(address); + if (publicKeyOfRecipientRef.current !== selectedDirect?.address) return; + setPublicKeyOfRecipient(publicKey); } catch (error) { - + console.log(error); } - } + }; - const tempMessages = useMemo(()=> { - if(!selectedDirect?.address) return [] - if(queueChats[selectedDirect?.address]){ - return queueChats[selectedDirect?.address]?.filter((item)=> !item?.chatReference) + const tempMessages = useMemo(() => { + if (!selectedDirect?.address) return []; + if (queueChats[selectedDirect?.address]) { + return queueChats[selectedDirect?.address]?.filter( + (item) => !item?.chatReference + ); } - return [] - }, [selectedDirect?.address, queueChats]) + return []; + }, [selectedDirect?.address, queueChats]); - const tempChatReferences = useMemo(()=> { - if(!selectedDirect?.address) return [] - if(queueChats[selectedDirect?.address]){ - return queueChats[selectedDirect?.address]?.filter((item)=> !!item?.chatReference) + const tempChatReferences = useMemo(() => { + if (!selectedDirect?.address) return []; + if (queueChats[selectedDirect?.address]) { + return queueChats[selectedDirect?.address]?.filter( + (item) => !!item?.chatReference + ); } - return [] - }, [selectedDirect?.address, queueChats]) + return []; + }, [selectedDirect?.address, queueChats]); - useEffect(()=> { - if(selectedDirect?.address){ - publicKeyOfRecipientRef.current = selectedDirect?.address - getPublicKeyFunc(publicKeyOfRecipientRef.current) + useEffect(() => { + if (selectedDirect?.address) { + publicKeyOfRecipientRef.current = selectedDirect?.address; + getPublicKeyFunc(publicKeyOfRecipientRef.current); } - }, [selectedDirect?.address]) - + }, [selectedDirect?.address]); - const middletierFunc = async (data: any, selectedDirectAddress: string, myAddress: string) => { + const middletierFunc = async ( + data: any, + selectedDirectAddress: string, + myAddress: string + ) => { try { if (hasInitialized.current) { decryptMessages(data, true); @@ -99,9 +123,9 @@ export const ChatDirect = ({ myAddress, isNewChat, selectedDirect, setSelectedDi hasInitialized.current = true; const url = `${getBaseApiReact()}/chat/messages?involving=${selectedDirectAddress}&involving=${myAddress}&encoding=BASE64&limit=0&reverse=false`; const response = await fetch(url, { - method: "GET", + method: 'GET', headers: { - "Content-Type": "application/json", + 'Content-Type': 'application/json', }, }); const responseData = await response.json(); @@ -109,609 +133,656 @@ export const ChatDirect = ({ myAddress, isNewChat, selectedDirect, setSelectedDi } catch (error) { console.error(error); } - } + }; - const decryptMessages = (encryptedMessages: any[], isInitiated: boolean)=> { - try { - return new Promise((res, rej)=> { - window.sendMessage("decryptDirect", { + const decryptMessages = (encryptedMessages: any[], isInitiated: boolean) => { + try { + return new Promise((res, rej) => { + window + .sendMessage('decryptDirect', { data: encryptedMessages, involvingAddress: selectedDirect?.address, }) - .then((decryptResponse) => { - if (!decryptResponse?.error) { - const response = processWithNewMessages(decryptResponse, selectedDirect?.address); - res(response); - - if (isInitiated) { - const formatted = response.filter((rawItem) => !rawItem?.chatReference).map((item) => ({ + .then((decryptResponse) => { + if (!decryptResponse?.error) { + const response = processWithNewMessages( + decryptResponse, + selectedDirect?.address + ); + res(response); + + if (isInitiated) { + const formatted = response + .filter((rawItem) => !rawItem?.chatReference) + .map((item) => ({ ...item, id: item.signature, text: item.message, unread: item?.sender === myAddress ? false : true, })); - setMessages((prev) => [...prev, ...formatted]); - setChatReferences((prev) => { - const organizedChatReferences = { ...prev }; - response.filter((rawItem) => !!rawItem?.chatReference && rawItem?.type === 'edit').forEach((item) => { - try { - organizedChatReferences[item.chatReference] = { - ...(organizedChatReferences[item.chatReference] || {}), - edit: item - }; - } catch(error){ + setMessages((prev) => [...prev, ...formatted]); + setChatReferences((prev) => { + const organizedChatReferences = { ...prev }; - } - }) - return organizedChatReferences - }) - } else { - hasInitialized.current = true; - const formatted = response.filter((rawItem) => !rawItem?.chatReference) + response + .filter( + (rawItem) => + !!rawItem?.chatReference && rawItem?.type === 'edit' + ) + .forEach((item) => { + try { + organizedChatReferences[item.chatReference] = { + ...(organizedChatReferences[item.chatReference] || + {}), + edit: item, + }; + } catch (error) { + console.log(error); + } + }); + return organizedChatReferences; + }); + } else { + hasInitialized.current = true; + const formatted = response + .filter((rawItem) => !rawItem?.chatReference) .map((item) => ({ ...item, id: item.signature, text: item.message, unread: false, })); - setMessages(formatted); + setMessages(formatted); - setChatReferences((prev) => { - const organizedChatReferences = { ...prev }; + setChatReferences((prev) => { + const organizedChatReferences = { ...prev }; - response.filter((rawItem) => !!rawItem?.chatReference && rawItem?.type === 'edit').forEach((item) => { - try { - organizedChatReferences[item.chatReference] = { - ...(organizedChatReferences[item.chatReference] || {}), - edit: item - }; - } catch(error){ - - } - }) - return organizedChatReferences - }) - } - return; + response + .filter( + (rawItem) => + !!rawItem?.chatReference && rawItem?.type === 'edit' + ) + .forEach((item) => { + try { + organizedChatReferences[item.chatReference] = { + ...(organizedChatReferences[item.chatReference] || + {}), + edit: item, + }; + } catch (error) { + console.log(error); + } + }); + return organizedChatReferences; + }); } - rej(response.error); - }) - .catch((error) => { - rej(error.message || "An error occurred"); - }); - - }) - } catch (error) { - - } + return; + } + rej(response.error); + }) + .catch((error) => { + rej( + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }) + ); + }); + }); + } catch (error) { + console.log(error); } + }; - const forceCloseWebSocket = () => { + const forceCloseWebSocket = () => { + if (socketRef.current) { + clearTimeout(timeoutIdRef.current); + clearTimeout(groupSocketTimeoutRef.current); + socketRef.current.close(1000, 'forced'); + socketRef.current = null; + } + }; + + const pingWebSocket = () => { + try { + if (socketRef.current?.readyState === WebSocket.OPEN) { + socketRef.current.send('ping'); + timeoutIdRef.current = setTimeout(() => { + if (socketRef.current) { + socketRef.current.close(); + clearTimeout(groupSocketTimeoutRef.current); + } + }, 5000); // Close if no pong in 5 seconds + } + } catch (error) { + console.error('Error during ping:', error); + } + }; + + const initWebsocketMessageGroup = () => { + forceCloseWebSocket(); // Close any existing connection + + if (!selectedDirect?.address || !myAddress) return; + + const socketLink = `${getBaseApiReactSocket()}/websockets/chat/messages?involving=${selectedDirect?.address}&involving=${myAddress}&encoding=BASE64&limit=100`; + socketRef.current = new WebSocket(socketLink); + + socketRef.current.onopen = () => { + setTimeout(pingWebSocket, 50); // Initial ping + }; + + socketRef.current.onmessage = (e) => { + try { + if (e.data === 'pong') { + clearTimeout(timeoutIdRef.current); + groupSocketTimeoutRef.current = setTimeout(pingWebSocket, 45000); // Ping every 45 seconds + } else { + middletierFunc( + JSON.parse(e.data), + selectedDirect?.address, + myAddress + ); + + setIsLoading(false); + } + } catch (error) { + console.error('Error handling WebSocket message:', error); + } + }; + + socketRef.current.onclose = (event) => { + clearTimeout(groupSocketTimeoutRef.current); + clearTimeout(timeoutIdRef.current); + console.warn(`WebSocket closed: ${event.reason || 'unknown reason'}`); + if (event.reason !== 'forced' && event.code !== 1000) { + setTimeout(() => initWebsocketMessageGroup(), 10000); // Retry after 10 seconds + } + }; + + socketRef.current.onerror = (error) => { + console.error('WebSocket error:', error); + clearTimeout(groupSocketTimeoutRef.current); + clearTimeout(timeoutIdRef.current); if (socketRef.current) { - clearTimeout(timeoutIdRef.current); - clearTimeout(groupSocketTimeoutRef.current); - socketRef.current.close(1000, 'forced'); - socketRef.current = null; + socketRef.current.close(); } }; - - const pingWebSocket = () => { - try { - if (socketRef.current?.readyState === WebSocket.OPEN) { - socketRef.current.send('ping'); - timeoutIdRef.current = setTimeout(() => { - if (socketRef.current) { - socketRef.current.close(); - clearTimeout(groupSocketTimeoutRef.current); - } - }, 5000); // Close if no pong in 5 seconds - } - } catch (error) { - console.error('Error during ping:', error); - } + }; + + const setDirectChatValueFunc = async (e) => { + setDirectToValue(e.detail.directToValue); + }; + useEffect(() => { + subscribeToEvent('setDirectToValueNewChat', setDirectChatValueFunc); + + return () => { + unsubscribeFromEvent('setDirectToValueNewChat', setDirectChatValueFunc); }; - + }, []); - const initWebsocketMessageGroup = () => { - forceCloseWebSocket(); // Close any existing connection - - if (!selectedDirect?.address || !myAddress) return; - - const socketLink = `${getBaseApiReactSocket()}/websockets/chat/messages?involving=${selectedDirect?.address}&involving=${myAddress}&encoding=BASE64&limit=100`; - socketRef.current = new WebSocket(socketLink); - - socketRef.current.onopen = () => { - setTimeout(pingWebSocket, 50); // Initial ping - }; - - socketRef.current.onmessage = (e) => { - try { - if (e.data === 'pong') { - clearTimeout(timeoutIdRef.current); - groupSocketTimeoutRef.current = setTimeout(pingWebSocket, 45000); // Ping every 45 seconds - } else { - middletierFunc(JSON.parse(e.data), selectedDirect?.address, myAddress) + useEffect(() => { + if (hasInitializedWebsocket.current || isNewChat) return; + setIsLoading(true); + initWebsocketMessageGroup(); + hasInitializedWebsocket.current = true; - setIsLoading(false); - } - } catch (error) { - console.error('Error handling WebSocket message:', error); - } - }; - - socketRef.current.onclose = (event) => { - clearTimeout(groupSocketTimeoutRef.current); - clearTimeout(timeoutIdRef.current); - console.warn(`WebSocket closed: ${event.reason || 'unknown reason'}`); - if (event.reason !== 'forced' && event.code !== 1000) { - setTimeout(() => initWebsocketMessageGroup(), 10000); // Retry after 10 seconds - } - }; - - socketRef.current.onerror = (error) => { - console.error('WebSocket error:', error); - clearTimeout(groupSocketTimeoutRef.current); - clearTimeout(timeoutIdRef.current); - if (socketRef.current) { - socketRef.current.close(); - } - }; + return () => { + forceCloseWebSocket(); // Clean up WebSocket on component unmount }; + }, [selectedDirect?.address, myAddress, isNewChat]); - const setDirectChatValueFunc = async (e)=> { - setDirectToValue(e.detail.directToValue) - } - useEffect(() => { - subscribeToEvent("setDirectToValueNewChat", setDirectChatValueFunc); - - return () => { - unsubscribeFromEvent("setDirectToValueNewChat", setDirectChatValueFunc); - }; - }, []); - - useEffect(() => { - if (hasInitializedWebsocket.current || isNewChat) return; - setIsLoading(true); - initWebsocketMessageGroup(); - hasInitializedWebsocket.current = true; - - return () => { - forceCloseWebSocket(); // Clean up WebSocket on component unmount - }; - }, [selectedDirect?.address, myAddress, isNewChat]); + const sendChatDirect = async ( + { chatReference = undefined, messageText, otherData }: any, + address, + publicKeyOfRecipient, + isNewChatVar + ) => { + try { + const directTo = isNewChatVar ? directToValue : address; + if (!directTo) return; + return new Promise((res, rej) => { + window + .sendMessage( + 'sendChatDirect', + { + directTo, + chatReference, + messageText, + otherData, + publicKeyOfRecipient, + address: directTo, + }, + 120000 + ) + .then(async (response) => { + if (!response?.error) { + if (isNewChatVar) { + let getRecipientName = null; + try { + getRecipientName = await getNameInfo(response.recipient); + } catch (error) { + console.error('Error fetching recipient name:', error); + } + setSelectedDirect({ + address: response.recipient, + name: getRecipientName, + timestamp: Date.now(), + sender: myAddress, + senderName: myName, + }); + setNewChat(null); + window + .sendMessage('addTimestampEnterChat', { + timestamp: Date.now(), + groupId: response.recipient, + }) + .catch((error) => { + console.error( + 'Failed to add timestamp:', + error.message || 'An error occurred' + ); + }); - -const sendChatDirect = async ({ chatReference = undefined, messageText, otherData}: any, address, publicKeyOfRecipient, isNewChatVar)=> { - try { - const directTo = isNewChatVar ? directToValue : address - - if(!directTo) return - return new Promise((res, rej)=> { - window.sendMessage("sendChatDirect", { - directTo, - chatReference, - messageText, - otherData, - publicKeyOfRecipient, - address: directTo, - }, 120000) - .then(async (response) => { - if (!response?.error) { - if (isNewChatVar) { - let getRecipientName = null; - try { - getRecipientName = await getNameInfo(response.recipient); - } catch (error) { - console.error("Error fetching recipient name:", error); + setTimeout(() => { + getTimestampEnterChat(); + }, 400); } - setSelectedDirect({ - address: response.recipient, - name: getRecipientName, - timestamp: Date.now(), - sender: myAddress, - senderName: myName, - }); - setNewChat(null); - - window.sendMessage("addTimestampEnterChat", { - timestamp: Date.now(), - groupId: response.recipient, - }).catch((error) => { - console.error("Failed to add timestamp:", error.message || "An error occurred"); - }); - - setTimeout(() => { - getTimestampEnterChat(); - }, 400); + res(response); + return; } - res(response); - return; - } - rej(response.error); - }) - .catch((error) => { - rej(error.message || "An error occurred"); - }); - - }) - } catch (error) { - throw new Error(error) - } finally { - } -} -const clearEditorContent = () => { - if (editorRef.current) { - setMessageSize(0) - editorRef.current.chain().focus().clearContent().run(); - if(isMobile){ - setTimeout(() => { - editorRef.current?.chain().blur().run(); - setIsFocusedParent(false) - executeEvent("sent-new-message-group", {}) - setTimeout(() => { - triggerRerender(); - }, 300); - }, 200); + rej(response.error); + }) + .catch((error) => { + rej( + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }) + ); + }); + }); + } catch (error) { + if (error instanceof Error) { + throw new Error(error.message); + } else { + throw new Error(String(error)); + } } - } -}; -useEffect(() => { - if (!editorRef?.current) return; - const handleUpdate = () => { - const htmlContent = editorRef?.current.getHTML(); - const stringified = JSON.stringify(htmlContent); - const size = new Blob([stringified]).size; - setMessageSize(size + 200); }; - - // Add a listener for the editorRef?.current's content updates - editorRef?.current.on('update', handleUpdate); - - // Cleanup the listener on unmount - return () => { - editorRef?.current.off('update', handleUpdate); + const clearEditorContent = () => { + if (editorRef.current) { + setMessageSize(0); + editorRef.current.chain().focus().clearContent().run(); + } }; -}, [editorRef?.current]); + useEffect(() => { + if (!editorRef?.current) return; + const handleUpdate = () => { + const htmlContent = editorRef?.current.getHTML(); + const stringified = JSON.stringify(htmlContent); + const size = new Blob([stringified]).size; + setMessageSize(size + 200); + }; - const sendMessage = async ()=> { - try { - if(messageSize > 4000) return + // Add a listener for the editorRef?.current's content updates + editorRef?.current.on('update', handleUpdate); - - if(+balance < 4) throw new Error('You need at least 4 QORT to send a message') - if(isSending) return - if (editorRef.current) { - const htmlContent = editorRef.current.getHTML(); - - if(!htmlContent?.trim() || htmlContent?.trim() === '

') return - setIsSending(true) - pauseAllQueues() - const message = JSON.stringify(htmlContent) - - - if(isNewChat){ - await sendChatDirect({ messageText: htmlContent}, null, null, true) - return + // Cleanup the listener on unmount + return () => { + editorRef?.current.off('update', handleUpdate); + }; + }, [editorRef?.current]); + + const sendMessage = async () => { + try { + if (messageSize > 4000) return; + + // TODO set magic number in a proper file + if (+balance < 4) + throw new Error( + t('group:message.error.qortals_required', { + quantity: 4, + postProcess: 'capitalizeFirstChar', + }) + ); + if (isSending) return; + if (editorRef.current) { + const htmlContent = editorRef.current.getHTML(); + + if (!htmlContent?.trim() || htmlContent?.trim() === '

') return; + setIsSending(true); + pauseAllQueues(); + const message = JSON.stringify(htmlContent); + + if (isNewChat) { + await sendChatDirect({ messageText: htmlContent }, null, null, true); + return; } - let repliedTo = replyMessage?.signature + let repliedTo = replyMessage?.signature; - if (replyMessage?.chatReference) { - repliedTo = replyMessage?.chatReference - } - let chatReference = onEditMessage?.signature + if (replyMessage?.chatReference) { + repliedTo = replyMessage?.chatReference; + } + let chatReference = onEditMessage?.signature; const otherData = { ...(onEditMessage?.decryptedData || {}), specialId: uid.rnd(), repliedTo: onEditMessage ? onEditMessage?.repliedTo : repliedTo, - type: chatReference ? 'edit' : '' - } + type: chatReference ? 'edit' : '', + }; const sendMessageFunc = async () => { - return await sendChatDirect({ chatReference, messageText: htmlContent, otherData}, selectedDirect?.address, publicKeyOfRecipient, false) + return await sendChatDirect( + { chatReference, messageText: htmlContent, otherData }, + selectedDirect?.address, + publicKeyOfRecipient, + false + ); }; - - // Add the function to the queue const messageObj = { message: { timestamp: Date.now(), - senderName: myName, - sender: myAddress, - ...(otherData || {}), - text: htmlContent, + senderName: myName, + sender: myAddress, + ...(otherData || {}), + text: htmlContent, }, - chatReference - } - addToQueue(sendMessageFunc, messageObj, 'chat-direct', - selectedDirect?.address ); + chatReference, + }; + addToQueue( + sendMessageFunc, + messageObj, + 'chat-direct', + selectedDirect?.address + ); setTimeout(() => { - executeEvent("sent-new-message-group", {}) + executeEvent('sent-new-message-group', {}); }, 150); - clearEditorContent() - setReplyMessage(null) - setOnEditMessage(null) - - } - // send chat message - } catch (error) { - const errorMsg = error?.message || error - setInfoSnack({ - type: "error", - message: errorMsg === 'invalid signature' ? 'You need at least 4 QORT to send a message' : errorMsg, - }); - setOpenSnack(true); - console.error(error) - } finally { - setIsSending(false) - resumeAllQueues() + clearEditorContent(); + setReplyMessage(null); + setOnEditMessage(null); } + // send chat message + } catch (error) { + const errorMsg = error?.message || error; + setInfoSnack({ + type: 'error', + message: + errorMsg === 'invalid signature' + ? t('group:message.error.qortals_required', { + quantity: 4, + postProcess: 'capitalizeFirstChar', + }) + : errorMsg, + }); + setOpenSnack(true); + console.error(error); + } finally { + setIsSending(false); + resumeAllQueues(); } + }; - const onReply = useCallback((message)=> { - if(onEditMessage){ - clearEditorContent() + const onReply = useCallback( + (message) => { + if (onEditMessage) { + clearEditorContent(); } - setReplyMessage(message) - setOnEditMessage(null) - editorRef?.current?.chain().focus() - }, [onEditMessage]) - - - const onEdit = useCallback((message)=> { - setOnEditMessage(message) - setReplyMessage(null) - editorRef.current.chain().focus().setContent(message?.text).run(); - - }, []) - + setReplyMessage(message); + setOnEditMessage(null); + editorRef?.current?.chain().focus(); + }, + [onEditMessage] + ); + + const onEdit = useCallback((message) => { + setOnEditMessage(message); + setReplyMessage(null); + editorRef.current.chain().focus().setContent(message?.text).run(); + }, []); + return ( -
- {!isMobile && ( - + - - Close Direct Chat - - )} - {isMobile && ( - - - - { - close() - }} - > - - - - - {isNewChat ? '' : selectedDirect?.name || (selectedDirect?.address?.slice(0,10) + '...')} - - - { - setSelectedDirect(null) - setMobileViewModeKeepOpen('') - setNewChat(false) - }} - > - - - - - - )} + }} + > + + + {t('core:action.close_chat', { postProcess: 'capitalizeFirstChar' })} + + + {isNewChat && ( <> - - setDirectToValue(e.target.value)} /> + + setDirectToValue(e.target.value)} + /> )} - - - -
-
+ + + - {replyMessage && ( - - - - { - setReplyMessage(null) - setOnEditMessage(null) - - }} - > - - - - )} - {onEditMessage && ( - - - - { - setReplyMessage(null) - setOnEditMessage(null) - - clearEditorContent() - - - }} - > - - - - )} - - - {messageSize > 750 && ( - - 4000 ? 'var(--danger)' : 'unset' - }}>{`Your message size is of ${messageSize} bytes out of a maximum of 4000`} - - - )} -
- - - - { - - if(isSending) return - sendMessage() - }} - style={{ - marginTop: 'auto', - alignSelf: 'center', - cursor: isSending ? 'default' : 'pointer', - background: isSending && 'rgba(0, 0, 0, 0.8)', - flexShrink: 0, - padding: '5px', - width: '100px', - minWidth: 'auto' + }} + > + {replyMessage && ( + - {isSending && ( - + + { + setReplyMessage(null); + setOnEditMessage(null); + }} + > + + + + )} + {onEditMessage && ( + + + + { + setReplyMessage(null); + setOnEditMessage(null); + clearEditorContent(); + }} + > + + + + )} + + + {messageSize > 750 && ( + + 4000 ? theme.palette.other.danger : 'unset', + }} + > + {t('core:message.error.message_size', { + maximum: 4000, + size: messageSize, + postProcess: 'capitalizeFirstChar', + })} + + + )} + + + + { + if (isSending) return; + sendMessage(); + }} + style={{ + alignSelf: 'center', + background: isSending + ? theme.palette.background.default + : theme.palette.background.paper, + cursor: isSending ? 'default' : 'pointer', + flexShrink: 0, + marginTop: 'auto', + minWidth: 'auto', + padding: '5px', + width: '100px', + }} + > + {isSending && ( + - )} - {` Send`} - - - -
- - -
- ) -} + )} + {` Send`} + + + + + + + + + ); +}; diff --git a/src/components/Chat/ChatGroup.tsx b/src/components/Chat/ChatGroup.tsx index e054bd9..762f281 100644 --- a/src/components/Chat/ChatGroup.tsx +++ b/src/components/Chat/ChatGroup.tsx @@ -1,100 +1,158 @@ -import React, { useCallback, useContext, useEffect, useMemo, useReducer, useRef, useState } from 'react' -import { CreateCommonSecret } from './CreateCommonSecret' -import { reusableGet } from '../../qdn/publish/pubish' -import { uint8ArrayToObject } from '../../backgroundFunctions/encryption' -import { base64ToUint8Array, decodeBase64ForUIChatMessages, objectToBase64 } from '../../qdn/encryption/group-encryption' -import { ChatContainerComp } from './ChatContainer' -import { ChatList } from './ChatList' -import "@chatscope/chat-ui-kit-styles/dist/default/styles.min.css"; -import Tiptap from './TipTap' -import { CustomButton } from '../../App-styles' +import { + useCallback, + useContext, + useEffect, + useMemo, + useReducer, + useRef, + useState, +} from 'react'; +import { + decodeBase64ForUIChatMessages, + objectToBase64, +} from '../../qdn/encryption/group-encryption'; +import { ChatList } from './ChatList'; +import Tiptap from './TipTap'; +import { CustomButton } from '../../styles/App-styles'; import CircularProgress from '@mui/material/CircularProgress'; -import { LoadingSnackbar } from '../Snackbar/LoadingSnackbar' -import { getBaseApiReact, getBaseApiReactSocket, isMobile, MyContext, pauseAllQueues, resumeAllQueues } from '../../App' -import { CustomizedSnackbars } from '../Snackbar/Snackbar' -import { PUBLIC_NOTIFICATION_CODE_FIRST_SECRET_KEY } from '../../constants/codes' -import { useMessageQueue } from '../../MessageQueueContext' -import { executeEvent, subscribeToEvent, unsubscribeFromEvent } from '../../utils/events' -import { Box, ButtonBase, Divider, Typography } from '@mui/material' -import ShortUniqueId from "short-unique-id"; -import { ReplyPreview } from './MessageItem' -import { ExitIcon } from '../../assets/Icons/ExitIcon' -import { RESOURCE_TYPE_NUMBER_GROUP_CHAT_REACTIONS } from '../../constants/resourceTypes' -import { isExtMsg } from '../../background' -import AppViewerContainer from '../Apps/AppViewerContainer' -import CloseIcon from "@mui/icons-material/Close"; -import { throttle } from 'lodash' +import { LoadingSnackbar } from '../Snackbar/LoadingSnackbar'; +import { + getBaseApiReact, + getBaseApiReactSocket, + QORTAL_APP_CONTEXT, + pauseAllQueues, + resumeAllQueues, +} from '../../App'; +import { CustomizedSnackbars } from '../Snackbar/Snackbar'; +import { PUBLIC_NOTIFICATION_CODE_FIRST_SECRET_KEY } from '../../constants/constants'; +import { useMessageQueue } from '../../messaging/MessageQueueContext.tsx'; +import { + executeEvent, + subscribeToEvent, + unsubscribeFromEvent, +} from '../../utils/events'; +import { + Box, + ButtonBase, + Divider, + IconButton, + Tooltip, + Typography, + useTheme, +} from '@mui/material'; +import ShortUniqueId from 'short-unique-id'; +import { ReplyPreview } from './MessageItem'; +import { ExitIcon } from '../../assets/Icons/ExitIcon'; +import { RESOURCE_TYPE_NUMBER_GROUP_CHAT_REACTIONS } from '../../constants/constants'; +import { getFee, isExtMsg } from '../../background/background.ts'; +import AppViewerContainer from '../Apps/AppViewerContainer'; +import CloseIcon from '@mui/icons-material/Close'; +import { throttle } from 'lodash'; +import ImageIcon from '@mui/icons-material/Image'; +import { messageHasImage } from '../../utils/chat'; +import { useTranslation } from 'react-i18next'; const uid = new ShortUniqueId({ length: 5 }); +const uidImages = new ShortUniqueId({ length: 12 }); -export const ChatGroup = ({selectedGroup, secretKey, setSecretKey, getSecretKey, myAddress, handleNewEncryptionNotification, hide, handleSecretKeyCreationInProgress, triedToFetchSecretKey, myName, balance, getTimestampEnterChatParent, hideView, isPrivate}) => { - const {isUserBlocked} = useContext(MyContext) - const [messages, setMessages] = useState([]) - const [chatReferences, setChatReferences] = useState({}) - const [isSending, setIsSending] = useState(false) - const [isLoading, setIsLoading] = useState(false) +export const ChatGroup = ({ + selectedGroup, + secretKey, + getSecretKey, + myAddress, + handleNewEncryptionNotification, + hide, + handleSecretKeyCreationInProgress, + triedToFetchSecretKey, + myName, + balance, + getTimestampEnterChatParent, + hideView, + isPrivate, +}) => { + const { isUserBlocked, show } = useContext(QORTAL_APP_CONTEXT); + const [messages, setMessages] = useState([]); + const [chatReferences, setChatReferences] = useState({}); + const [isSending, setIsSending] = useState(false); + const [isLoading, setIsLoading] = useState(false); const [isMoved, setIsMoved] = useState(false); - const [openSnack, setOpenSnack] = React.useState(false); - const [infoSnack, setInfoSnack] = React.useState(null); - const hasInitialized = useRef(false) + const [openSnack, setOpenSnack] = useState(false); + const [infoSnack, setInfoSnack] = useState(null); + const hasInitialized = useRef(false); const [isFocusedParent, setIsFocusedParent] = useState(false); - const [replyMessage, setReplyMessage] = useState(null) - const [onEditMessage, setOnEditMessage] = useState(null) - const [isOpenQManager, setIsOpenQManager] = useState(null) - -const [messageSize, setMessageSize] = useState(0) - const hasInitializedWebsocket = useRef(false) + const [replyMessage, setReplyMessage] = useState(null); + const [onEditMessage, setOnEditMessage] = useState(null); + const [isOpenQManager, setIsOpenQManager] = useState(null); + const [isDeleteImage, setIsDeleteImage] = useState(false); + const [messageSize, setMessageSize] = useState(0); + const [chatImagesToSave, setChatImagesToSave] = useState([]); + const hasInitializedWebsocket = useRef(false); const socketRef = useRef(null); // WebSocket reference const timeoutIdRef = useRef(null); // Timeout ID reference const groupSocketTimeoutRef = useRef(null); // Group Socket Timeout reference const editorRef = useRef(null); const { queueChats, addToQueue, processWithNewMessages } = useMessageQueue(); const [, forceUpdate] = useReducer((x) => x + 1, 0); - const lastReadTimestamp = useRef(null) - + const lastReadTimestamp = useRef(null); const handleUpdateRef = useRef(null); - + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); const getTimestampEnterChat = async (selectedGroup) => { try { return new Promise((res, rej) => { - window.sendMessage("getTimestampEnterChat") - .then((response) => { - if (!response?.error) { - if(response && selectedGroup){ - lastReadTimestamp.current = response[selectedGroup] || undefined - window.sendMessage("addTimestampEnterChat", { - timestamp: Date.now(), - groupId: selectedGroup - }).catch((error) => { - console.error("Failed to add timestamp:", error.message || "An error occurred"); + window + .sendMessage('getTimestampEnterChat') + .then((response) => { + if (!response?.error) { + if (response && selectedGroup) { + lastReadTimestamp.current = + response[selectedGroup] || undefined; + window + .sendMessage('addTimestampEnterChat', { + timestamp: Date.now(), + groupId: selectedGroup, + }) + .catch((error) => { + console.error( + 'Failed to add timestamp:', + error.message || 'An error occurred' + ); + }); + + setTimeout(() => { + getTimestampEnterChatParent(); + }, 600); + } + + res(response); + return; + } + rej(response.error); + }) + .catch((error) => { + rej( + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }) + ); }); - - - setTimeout(() => { - getTimestampEnterChatParent(); - }, 600); - } - - res(response); - return; - } - rej(response.error); - }) - .catch((error) => { - rej(error.message || "An error occurred"); - }); - }); - } catch (error) {} + } catch (error) { + console.log(error); + } }; - useEffect(()=> { - if(!selectedGroup) return - getTimestampEnterChat(selectedGroup) - }, [selectedGroup]) - - + useEffect(() => { + if (!selectedGroup) return; + getTimestampEnterChat(selectedGroup); + }, [selectedGroup]); const members = useMemo(() => { const uniqueMembers = new Set(); @@ -108,77 +166,78 @@ const [messageSize, setMessageSize] = useState(0) return Array.from(uniqueMembers); }, [messages]); - const triggerRerender = () => { - forceUpdate(); // Trigger re-render by updating the state - }; const setEditorRef = (editorInstance) => { editorRef.current = editorInstance; }; - const tempMessages = useMemo(()=> { - if(!selectedGroup) return [] - if(queueChats[selectedGroup]){ - return queueChats[selectedGroup]?.filter((item)=> !item?.chatReference) + const tempMessages = useMemo(() => { + if (!selectedGroup) return []; + if (queueChats[selectedGroup]) { + return queueChats[selectedGroup]?.filter((item) => !item?.chatReference); } - return [] - }, [selectedGroup, queueChats]) - const tempChatReferences = useMemo(()=> { - if(!selectedGroup) return [] - if(queueChats[selectedGroup]){ - return queueChats[selectedGroup]?.filter((item)=> !!item?.chatReference) + return []; + }, [selectedGroup, queueChats]); + + const tempChatReferences = useMemo(() => { + if (!selectedGroup) return []; + if (queueChats[selectedGroup]) { + return queueChats[selectedGroup]?.filter((item) => !!item?.chatReference); } - return [] - }, [selectedGroup, queueChats]) + return []; + }, [selectedGroup, queueChats]); - const secretKeyRef = useRef(null) + const secretKeyRef = useRef(null); - useEffect(()=> { - if(secretKey){ - secretKeyRef.current = secretKey + useEffect(() => { + if (secretKey) { + secretKeyRef.current = secretKey; } - }, [secretKey]) + }, [secretKey]); - // const getEncryptedSecretKey = useCallback(()=> { - // const response = getResource() - // const decryptResponse = decryptResource() - // return - // }, []) - - - const checkForFirstSecretKeyNotification = (messages)=> { - messages?.forEach((message)=> { + const checkForFirstSecretKeyNotification = (messages) => { + messages?.forEach((message) => { try { - const decodeMsg = atob(message.data); - if(decodeMsg === PUBLIC_NOTIFICATION_CODE_FIRST_SECRET_KEY){ - handleSecretKeyCreationInProgress() - return + const decodeMsg = atob(message.data); + if (decodeMsg === PUBLIC_NOTIFICATION_CODE_FIRST_SECRET_KEY) { + handleSecretKeyCreationInProgress(); + return; } } catch (error) { - + console.log(error); } - }) - } + }); + }; - const updateChatMessagesWithBlocksFunc = (e) => { - if(e.detail){ - setMessages((prev)=> prev?.filter((item)=> { - return !isUserBlocked(item?.sender, item?.senderName) - })) - } - }; - - useEffect(() => { - subscribeToEvent("updateChatMessagesWithBlocks", updateChatMessagesWithBlocksFunc); - - return () => { - unsubscribeFromEvent("updateChatMessagesWithBlocks", updateChatMessagesWithBlocksFunc); - }; - }, []); + const updateChatMessagesWithBlocksFunc = (e) => { + if (e.detail) { + setMessages((prev) => + prev?.filter((item) => { + return !isUserBlocked(item?.sender, item?.senderName); + }) + ); + } + }; - const middletierFunc = async (data: any, groupId: string) => { + useEffect(() => { + subscribeToEvent( + 'updateChatMessagesWithBlocks', + updateChatMessagesWithBlocksFunc + ); + + return () => { + unsubscribeFromEvent( + 'updateChatMessagesWithBlocks', + updateChatMessagesWithBlocksFunc + ); + }; + }, []); + + const middletierFunc = async (data: any, groupId: string) => { try { if (hasInitialized.current) { - const dataRemovedBlock = data?.filter((item)=> !isUserBlocked(item?.sender, item?.senderName)) + const dataRemovedBlock = data?.filter( + (item) => !isUserBlocked(item?.sender, item?.senderName) + ); decryptMessages(dataRemovedBlock, true); return; @@ -186,351 +245,488 @@ const [messageSize, setMessageSize] = useState(0) hasInitialized.current = true; const url = `${getBaseApiReact()}/chat/messages?txGroupId=${groupId}&encoding=BASE64&limit=0&reverse=false`; const response = await fetch(url, { - method: "GET", + method: 'GET', headers: { - "Content-Type": "application/json", + 'Content-Type': 'application/json', }, }); const responseData = await response.json(); - const dataRemovedBlock = responseData?.filter((item)=> { - return !isUserBlocked(item?.sender, item?.senderName) - }) - + const dataRemovedBlock = responseData?.filter((item) => { + return !isUserBlocked(item?.sender, item?.senderName); + }); decryptMessages(dataRemovedBlock, false); } catch (error) { console.error(error); } - } - - const decryptMessages = (encryptedMessages: any[], isInitiated: boolean )=> { - try { - if(!secretKeyRef.current){ - checkForFirstSecretKeyNotification(encryptedMessages) - } - return new Promise((res, rej)=> { - window.sendMessage("decryptSingle", { + }; + + const decryptMessages = (encryptedMessages: any[], isInitiated: boolean) => { + try { + if (!secretKeyRef.current) { + checkForFirstSecretKeyNotification(encryptedMessages); + } + return new Promise((res, rej) => { + window + .sendMessage('decryptSingle', { data: encryptedMessages, secretKeyObject: secretKey, }) - .then((response) => { - if (!response?.error) { - const filterUIMessages = encryptedMessages.filter((item) => !isExtMsg(item.data)); - const decodedUIMessages = decodeBase64ForUIChatMessages(filterUIMessages); - - const combineUIAndExtensionMsgsBefore = [...decodedUIMessages, ...response]; - const combineUIAndExtensionMsgs = processWithNewMessages( - combineUIAndExtensionMsgsBefore.map((item) => ({ - ...item, - ...(item?.decryptedData || {}), - })), - selectedGroup - ); - res(combineUIAndExtensionMsgs); - - if (isInitiated) { + .then((response) => { + if (!response?.error) { + const filterUIMessages = encryptedMessages.filter( + (item) => !isExtMsg(item.data) + ); - const formatted = combineUIAndExtensionMsgs - .filter((rawItem) => !rawItem?.chatReference) - .map((item) => { - const additionalFields = item?.data === 'NDAwMQ==' ? { - text: "

First group key created.

" - } : {} - return { - ...item, - id: item.signature, - text: item?.decryptedData?.message || "", - repliedTo: item?.repliedTo || item?.decryptedData?.repliedTo, - unread: item?.sender === myAddress ? false : !!item?.chatReference ? false : true, - isNotEncrypted: !!item?.messageText, - ...additionalFields - } - }); - setMessages((prev) => [...prev, ...formatted]); - - setChatReferences((prev) => { - const organizedChatReferences = { ...prev }; - combineUIAndExtensionMsgs - .filter((rawItem) => rawItem && rawItem.chatReference && (rawItem?.decryptedData?.type === "reaction" || rawItem?.decryptedData?.type === "edit" || rawItem?.type === "edit" || rawItem?.isEdited || rawItem?.type === "reaction")) - .forEach((item) => { - try { - if(item?.decryptedData?.type === "edit"){ - organizedChatReferences[item.chatReference] = { - ...(organizedChatReferences[item.chatReference] || {}), - edit: item.decryptedData, - }; - } else if(item?.type === "edit" || item?.isEdited){ - organizedChatReferences[item.chatReference] = { - ...(organizedChatReferences[item.chatReference] || {}), - edit: item, - }; - } else { - const content = item?.content || item.decryptedData?.content; - const sender = item.sender; - const newTimestamp = item.timestamp; - const contentState = item?.contentState !== undefined ? item?.contentState : item.decryptedData?.contentState; - - if (!content || typeof content !== "string" || !sender || typeof sender !== "string" || !newTimestamp) { - console.warn("Invalid content, sender, or timestamp in reaction data", item); - return; - } - - organizedChatReferences[item.chatReference] = { - ...(organizedChatReferences[item.chatReference] || {}), - reactions: organizedChatReferences[item.chatReference]?.reactions || {}, - }; - - organizedChatReferences[item.chatReference].reactions[content] = - organizedChatReferences[item.chatReference].reactions[content] || []; - - let latestTimestampForSender = null; - - organizedChatReferences[item.chatReference].reactions[content] = - organizedChatReferences[item.chatReference].reactions[content].filter((reaction) => { - if (reaction.sender === sender) { - latestTimestampForSender = Math.max(latestTimestampForSender || 0, reaction.timestamp); - } - return reaction.sender !== sender; - }); - - if (latestTimestampForSender && newTimestamp < latestTimestampForSender) { - return; - } - - if (contentState !== false) { - organizedChatReferences[item.chatReference].reactions[content].push(item); - } - - if (organizedChatReferences[item.chatReference].reactions[content].length === 0) { - delete organizedChatReferences[item.chatReference].reactions[content]; - } + const decodedUIMessages = + decodeBase64ForUIChatMessages(filterUIMessages); + + const combineUIAndExtensionMsgsBefore = [ + ...decodedUIMessages, + ...response, + ]; + + const combineUIAndExtensionMsgs = processWithNewMessages( + combineUIAndExtensionMsgsBefore.map((item) => ({ + ...item, + ...(item?.decryptedData || {}), + })), + selectedGroup + ); + + res(combineUIAndExtensionMsgs); + + if (isInitiated) { + const formatted = combineUIAndExtensionMsgs + .filter((rawItem) => !rawItem?.chatReference) + .map((item) => { + const additionalFields = + item?.data === 'NDAwMQ==' // TODO put magic string somewhere in a file + ? { + text: `

${t( + 'group:message.generic.group_key_created', + { + postProcess: 'capitalizeFirstChar', + } + )}

`, } - - } catch (error) { - console.error("Error processing reaction/edit item:", error, item); - } - }); - - return organizedChatReferences; + : {}; + return { + ...item, + id: item.signature, + text: item?.decryptedData?.message || '', + repliedTo: + item?.repliedTo || item?.decryptedData?.repliedTo, + unread: + item?.sender === myAddress + ? false + : !!item?.chatReference + ? false + : true, + isNotEncrypted: !!item?.messageText, + ...additionalFields, + }; }); - } else { - let firstUnreadFound = false; - const formatted = combineUIAndExtensionMsgs - .filter((rawItem) => !rawItem?.chatReference) - .map((item) => { - const additionalFields = item?.data === 'NDAwMQ==' ? { - text: "

First group key created.

" - } : {} - const divide = lastReadTimestamp.current && !firstUnreadFound && item.timestamp > lastReadTimestamp.current && myAddress !== item?.sender; - - if(divide){ - firstUnreadFound = true - } - return { - ...item, - id: item.signature, - text: item?.decryptedData?.message || "", - repliedTo: item?.repliedTo || item?.decryptedData?.repliedTo, - isNotEncrypted: !!item?.messageText, - unread: false, - divide, - ...additionalFields - } - }); - setMessages(formatted); - - setChatReferences((prev) => { - const organizedChatReferences = { ...prev }; - - combineUIAndExtensionMsgs - .filter((rawItem) => rawItem && rawItem.chatReference && (rawItem?.decryptedData?.type === "reaction" || rawItem?.decryptedData?.type === "edit" || rawItem?.type === "edit" || rawItem?.isEdited || rawItem?.type === "reaction")) - .forEach((item) => { - try { - if(item?.decryptedData?.type === "edit"){ - organizedChatReferences[item.chatReference] = { - ...(organizedChatReferences[item.chatReference] || {}), - edit: item.decryptedData, - }; - } else if(item?.type === "edit" || item?.isEdited){ - organizedChatReferences[item.chatReference] = { - ...(organizedChatReferences[item.chatReference] || {}), - edit: item, - }; - } else { - const content = item?.content || item.decryptedData?.content; + setMessages((prev) => [...prev, ...formatted]); + + setChatReferences((prev) => { + const organizedChatReferences = { ...prev }; + combineUIAndExtensionMsgs + .filter( + (rawItem) => + rawItem && + rawItem.chatReference && + (rawItem?.decryptedData?.type === 'reaction' || + rawItem?.decryptedData?.type === 'edit' || + rawItem?.type === 'edit' || + rawItem?.isEdited || + rawItem?.type === 'reaction') + ) + .forEach((item) => { + try { + if (item?.decryptedData?.type === 'edit') { + organizedChatReferences[item.chatReference] = { + ...(organizedChatReferences[item.chatReference] || + {}), + edit: item.decryptedData, + }; + } else if (item?.type === 'edit' || item?.isEdited) { + organizedChatReferences[item.chatReference] = { + ...(organizedChatReferences[item.chatReference] || + {}), + edit: item, + }; + } else { + const content = + item?.content || item.decryptedData?.content; const sender = item.sender; const newTimestamp = item.timestamp; - const contentState = item?.contentState !== undefined ? item?.contentState : item.decryptedData?.contentState; - - if (!content || typeof content !== "string" || !sender || typeof sender !== "string" || !newTimestamp) { - console.warn("Invalid content, sender, or timestamp in reaction data", item); + const contentState = + item?.contentState !== undefined + ? item?.contentState + : item.decryptedData?.contentState; + + if ( + !content || + typeof content !== 'string' || + !sender || + typeof sender !== 'string' || + !newTimestamp + ) { + console.warn( + t('group:message.generic.invalid_content', { + postProcess: 'capitalizeFirstChar', + }), + item + ); return; } - + organizedChatReferences[item.chatReference] = { - ...(organizedChatReferences[item.chatReference] || {}), - reactions: organizedChatReferences[item.chatReference]?.reactions || {}, + ...(organizedChatReferences[item.chatReference] || + {}), + reactions: + organizedChatReferences[item.chatReference] + ?.reactions || {}, }; - - organizedChatReferences[item.chatReference].reactions[content] = - organizedChatReferences[item.chatReference].reactions[content] || []; - + + organizedChatReferences[item.chatReference].reactions[ + content + ] = + organizedChatReferences[item.chatReference] + .reactions[content] || []; + let latestTimestampForSender = null; - - organizedChatReferences[item.chatReference].reactions[content] = - organizedChatReferences[item.chatReference].reactions[content].filter((reaction) => { - if (reaction.sender === sender) { - latestTimestampForSender = Math.max(latestTimestampForSender || 0, reaction.timestamp); - } - return reaction.sender !== sender; - }); - - if (latestTimestampForSender && newTimestamp < latestTimestampForSender) { + + organizedChatReferences[item.chatReference].reactions[ + content + ] = organizedChatReferences[ + item.chatReference + ].reactions[content].filter((reaction) => { + if (reaction.sender === sender) { + latestTimestampForSender = Math.max( + latestTimestampForSender || 0, + reaction.timestamp + ); + } + return reaction.sender !== sender; + }); + + if ( + latestTimestampForSender && + newTimestamp < latestTimestampForSender + ) { return; } - + if (contentState !== false) { - organizedChatReferences[item.chatReference].reactions[content].push(item); + organizedChatReferences[ + item.chatReference + ].reactions[content].push(item); } - - if (organizedChatReferences[item.chatReference].reactions[content].length === 0) { - delete organizedChatReferences[item.chatReference].reactions[content]; + + if ( + organizedChatReferences[item.chatReference] + .reactions[content].length === 0 + ) { + delete organizedChatReferences[item.chatReference] + .reactions[content]; } } - } catch (error) { - console.error("Error processing reaction item:", error, item); - } - }); - - return organizedChatReferences; + } catch (error) { + console.error( + 'Error processing reaction/edit item:', + error, + item + ); + } + }); + + return organizedChatReferences; + }); + } else { + let firstUnreadFound = false; + const formatted = combineUIAndExtensionMsgs + .filter((rawItem) => !rawItem?.chatReference) + .map((item) => { + const additionalFields = + item?.data === 'NDAwMQ==' + ? { + text: `

${t( + 'group:message.generic.group_key_created', + { + postProcess: 'capitalizeFirstChar', + } + )}

`, + } + : {}; + const divide = + lastReadTimestamp.current && + !firstUnreadFound && + item.timestamp > lastReadTimestamp.current && + myAddress !== item?.sender; + + if (divide) { + firstUnreadFound = true; + } + return { + ...item, + id: item.signature, + text: item?.decryptedData?.message || '', + repliedTo: + item?.repliedTo || item?.decryptedData?.repliedTo, + isNotEncrypted: !!item?.messageText, + unread: false, + divide, + ...additionalFields, + }; }); - } + setMessages(formatted); + + setChatReferences((prev) => { + const organizedChatReferences = { ...prev }; + + combineUIAndExtensionMsgs + .filter( + (rawItem) => + rawItem && + rawItem.chatReference && + (rawItem?.decryptedData?.type === 'reaction' || + rawItem?.decryptedData?.type === 'edit' || + rawItem?.type === 'edit' || + rawItem?.isEdited || + rawItem?.type === 'reaction') + ) + .forEach((item) => { + try { + if (item?.decryptedData?.type === 'edit') { + organizedChatReferences[item.chatReference] = { + ...(organizedChatReferences[item.chatReference] || + {}), + edit: item.decryptedData, + }; + } else if (item?.type === 'edit' || item?.isEdited) { + organizedChatReferences[item.chatReference] = { + ...(organizedChatReferences[item.chatReference] || + {}), + edit: item, + }; + } else { + const content = + item?.content || item.decryptedData?.content; + const sender = item.sender; + const newTimestamp = item.timestamp; + const contentState = + item?.contentState !== undefined + ? item?.contentState + : item.decryptedData?.contentState; + + if ( + !content || + typeof content !== 'string' || + !sender || + typeof sender !== 'string' || + !newTimestamp + ) { + console.warn( + t('group:message.generic.invalid_content', { + postProcess: 'capitalizeFirstChar', + }), + item + ); + return; + } + + organizedChatReferences[item.chatReference] = { + ...(organizedChatReferences[item.chatReference] || + {}), + reactions: + organizedChatReferences[item.chatReference] + ?.reactions || {}, + }; + + organizedChatReferences[item.chatReference].reactions[ + content + ] = + organizedChatReferences[item.chatReference] + .reactions[content] || []; + + let latestTimestampForSender = null; + + organizedChatReferences[item.chatReference].reactions[ + content + ] = organizedChatReferences[ + item.chatReference + ].reactions[content].filter((reaction) => { + if (reaction.sender === sender) { + latestTimestampForSender = Math.max( + latestTimestampForSender || 0, + reaction.timestamp + ); + } + return reaction.sender !== sender; + }); + + if ( + latestTimestampForSender && + newTimestamp < latestTimestampForSender + ) { + return; + } + + if (contentState !== false) { + organizedChatReferences[ + item.chatReference + ].reactions[content].push(item); + } + + if ( + organizedChatReferences[item.chatReference] + .reactions[content].length === 0 + ) { + delete organizedChatReferences[item.chatReference] + .reactions[content]; + } + } + } catch (error) { + console.error( + 'Error processing reaction item:', + error, + item + ); + } + }); + + return organizedChatReferences; + }); } - rej(response.error); - }) - .catch((error) => { - rej(error.message || "An error occurred"); - }); - - }) - } catch (error) { - - } + } + rej(response.error); + }) + .catch((error) => { + rej( + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }) + ); + }); + }); + } catch (error) { + console.log(error); } + }; - + const forceCloseWebSocket = () => { + if (socketRef.current) { + clearTimeout(timeoutIdRef.current); + clearTimeout(groupSocketTimeoutRef.current); + socketRef.current.close(1000, 'forced'); + socketRef.current = null; + } + }; - const forceCloseWebSocket = () => { - if (socketRef.current) { - - clearTimeout(timeoutIdRef.current); - clearTimeout(groupSocketTimeoutRef.current); - socketRef.current.close(1000, 'forced'); - socketRef.current = null; + const pingGroupSocket = () => { + try { + if (socketRef.current?.readyState === WebSocket.OPEN) { + socketRef.current.send('ping'); + timeoutIdRef.current = setTimeout(() => { + if (socketRef.current) { + socketRef.current.close(); + clearTimeout(groupSocketTimeoutRef.current); + } + }, 5000); // Close if no pong in 5 seconds + } + } catch (error) { + console.error('Error during ping:', error); + } + }; + + const initWebsocketMessageGroup = () => { + let socketLink = `${getBaseApiReactSocket()}/websockets/chat/messages?txGroupId=${selectedGroup}&encoding=BASE64&limit=100`; + socketRef.current = new WebSocket(socketLink); + + socketRef.current.onopen = () => { + setTimeout(pingGroupSocket, 50); + }; + socketRef.current.onmessage = (e) => { + try { + if (e.data === 'pong') { + clearTimeout(timeoutIdRef.current); + groupSocketTimeoutRef.current = setTimeout(pingGroupSocket, 45000); // Ping every 45 seconds + } else { + middletierFunc(JSON.parse(e.data), selectedGroup); + setIsLoading(false); + } + } catch (error) { + console.log(error); } }; - - const pingGroupSocket = () => { - try { - if (socketRef.current?.readyState === WebSocket.OPEN) { - socketRef.current.send('ping'); - timeoutIdRef.current = setTimeout(() => { - if (socketRef.current) { - socketRef.current.close(); - clearTimeout(groupSocketTimeoutRef.current); - } - }, 5000); // Close if no pong in 5 seconds - } - } catch (error) { - console.error('Error during ping:', error); + socketRef.current.onclose = () => { + clearTimeout(groupSocketTimeoutRef.current); + clearTimeout(timeoutIdRef.current); + console.warn(`WebSocket closed: ${event.reason || 'unknown reason'}`); + if (event.reason !== 'forced' && event.code !== 1000) { + setTimeout(() => initWebsocketMessageGroup(), 1000); // Retry after 10 seconds + } + }; + socketRef.current.onerror = (e) => { + clearTimeout(groupSocketTimeoutRef.current); + clearTimeout(timeoutIdRef.current); + if (socketRef.current) { + socketRef.current.close(); + } + }; + }; + + useEffect(() => { + if (hasInitializedWebsocket.current) return; + if (triedToFetchSecretKey && !secretKey) { + forceCloseWebSocket(); + setMessages([]); + setIsLoading(true); + initWebsocketMessageGroup(); } - } - const initWebsocketMessageGroup = () => { - + }, [triedToFetchSecretKey, secretKey, isPrivate]); - let socketLink = `${getBaseApiReactSocket()}/websockets/chat/messages?txGroupId=${selectedGroup}&encoding=BASE64&limit=100` - socketRef.current = new WebSocket(socketLink) + useEffect(() => { + if (isPrivate === null) return; + if (isPrivate === false || !secretKey || hasInitializedWebsocket.current) + return; + forceCloseWebSocket(); + setMessages([]); + setIsLoading(true); + pauseAllQueues(); + setTimeout(() => { + resumeAllQueues(); + }, 6000); + initWebsocketMessageGroup(); + hasInitializedWebsocket.current = true; + }, [secretKey, isPrivate]); - - socketRef.current.onopen = () => { - setTimeout(pingGroupSocket, 50) - } - socketRef.current.onmessage = (e) => { - try { - if (e.data === 'pong') { - clearTimeout(timeoutIdRef.current); - groupSocketTimeoutRef.current = setTimeout(pingGroupSocket, 45000); // Ping every 45 seconds - } else { - middletierFunc(JSON.parse(e.data), selectedGroup) - setIsLoading(false) - } - } catch (error) { - - } - - - } - socketRef.current.onclose = () => { - clearTimeout(groupSocketTimeoutRef.current); - clearTimeout(timeoutIdRef.current); - console.warn(`WebSocket closed: ${event.reason || 'unknown reason'}`); - if (event.reason !== 'forced' && event.code !== 1000) { - setTimeout(() => initWebsocketMessageGroup(), 1000); // Retry after 10 seconds - } - } - socketRef.current.onerror = (e) => { - clearTimeout(groupSocketTimeoutRef.current); - clearTimeout(timeoutIdRef.current); - if (socketRef.current) { - socketRef.current.close(); - } - } - } + useEffect(() => { + const notifications = messages.filter( + (message) => message?.decryptedData?.type === 'notification' + ); + if (notifications.length === 0) return; + const latestNotification = notifications.reduce((latest, current) => { + return current.timestamp > latest.timestamp ? current : latest; + }, notifications[0]); + handleNewEncryptionNotification(latestNotification); + }, [messages]); - useEffect(()=> { - if(hasInitializedWebsocket.current) return - if(triedToFetchSecretKey && !secretKey){ - forceCloseWebSocket() - setMessages([]) - setIsLoading(true) - initWebsocketMessageGroup() - } - }, [triedToFetchSecretKey, secretKey, isPrivate]) - - useEffect(()=> { - if(isPrivate === null) return - if(isPrivate === false || !secretKey || hasInitializedWebsocket.current) return - forceCloseWebSocket() - setMessages([]) - setIsLoading(true) - pauseAllQueues() - setTimeout(() => { - resumeAllQueues() - }, 6000); - initWebsocketMessageGroup() - hasInitializedWebsocket.current = true - }, [secretKey, isPrivate]) - - - useEffect(()=> { - const notifications = messages.filter((message)=> message?.decryptedData - ?.type === 'notification') - if(notifications.length === 0) return - const latestNotification = notifications.reduce((latest, current) => { - return current.timestamp > latest.timestamp ? current : latest; - }, notifications[0]); - handleNewEncryptionNotification(latestNotification) - - }, [messages]) - - - const encryptChatMessage = async (data: string, secretKeyObject: any, reactiontypeNumber?: number)=> { + const encryptChatMessage = async ( + data: string, + secretKeyObject: any, + reactiontypeNumber?: number + ) => { try { - return new Promise((res, rej)=> { - window.sendMessage("encryptSingle", { - data, - secretKeyObject, - typeNumber: reactiontypeNumber, - }) + return new Promise((res, rej) => { + window + .sendMessage('encryptSingle', { + data, + secretKeyObject, + typeNumber: reactiontypeNumber, + }) .then((response) => { if (!response?.error) { res(response); @@ -539,172 +735,295 @@ const [messageSize, setMessageSize] = useState(0) rej(response.error); }) .catch((error) => { - rej(error.message || "An error occurred"); + rej( + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }) + ); }); - - }) + }); } catch (error) { - + console.log(error); } -} + }; -const sendChatGroup = async ({groupId, typeMessage = undefined, chatReference = undefined, messageText}: any)=> { - try { - return new Promise((res, rej)=> { - window.sendMessage("sendChatGroup", { - groupId, - typeMessage, - chatReference, - messageText, - }, 120000) - .then((response) => { - if (!response?.error) { - res(response); - return; - } - rej(response.error); - }) - .catch((error) => { - rej(error.message || "An error occurred"); - }); - - }) - } catch (error) { - throw new Error(error) - } -} -const clearEditorContent = () => { - if (editorRef.current) { - setMessageSize(0) - editorRef.current.chain().focus().clearContent().run(); - if(isMobile){ - setTimeout(() => { - editorRef.current?.chain().blur().run(); - setIsFocusedParent(false) - executeEvent("sent-new-message-group", {}) - setTimeout(() => { - triggerRerender(); - }, 300); - }, 200); + const sendChatGroup = async ({ + groupId, + typeMessage = undefined, + chatReference = undefined, + messageText, + }: any) => { + try { + return new Promise((res, rej) => { + window + .sendMessage( + 'sendChatGroup', + { + groupId, + typeMessage, + chatReference, + messageText, + }, + 120000 + ) + .then((response) => { + if (!response?.error) { + res(response); + return; + } + rej(response.error); + }) + .catch((error) => { + rej( + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }) + ); + }); + }); + } catch (error) { + throw new Error(error); } - } -}; + }; + const clearEditorContent = () => { + if (editorRef.current) { + setMessageSize(0); + editorRef.current.chain().focus().clearContent().run(); + } + }; + const sendMessage = async () => { + try { + if (messageSize > 4000) return; // TODO magic number + if (isPrivate === null) + throw new Error( + t('group:message.error:determine_group_private', { + postProcess: 'capitalizeFirstChar', + }) + ); + if (isSending) return; + if (+balance < 4) + // TODO magic number + throw new Error( + t('group:message.error.qortals_required', { + quantity: 4, + postProcess: 'capitalizeFirstChar', + }) + ); + pauseAllQueues(); + if (editorRef.current) { + let htmlContent = editorRef.current.getHTML(); + const deleteImage = + onEditMessage && isDeleteImage && messageHasImage(onEditMessage); - const sendMessage = async ()=> { - try { - if(messageSize > 4000) return - if(isPrivate === null) throw new Error('Unable to determine if group is private') - if(isSending) return - if(+balance < 4) throw new Error('You need at least 4 QORT to send a message') - pauseAllQueues() - if (editorRef.current) { - const htmlContent = editorRef.current.getHTML(); - - if(!htmlContent?.trim() || htmlContent?.trim() === '

') return - - - setIsSending(true) - const message = isPrivate === false ? editorRef.current.getJSON() : htmlContent - const secretKeyObject = await getSecretKey(false, true) - - let repliedTo = replyMessage?.signature - - if (replyMessage?.chatReference) { - repliedTo = replyMessage?.chatReference - } - let chatReference = onEditMessage?.signature - - const publicData = isPrivate ? {} : { - isEdited : chatReference ? true : false, + const hasImage = + chatImagesToSave?.length > 0 || onEditMessage?.images?.length > 0; + if ( + (!htmlContent?.trim() || htmlContent?.trim() === '

') && + !hasImage && + !deleteImage + ) + return; + if (htmlContent?.trim() === '

') { + htmlContent = null; } + setIsSending(true); + const message = + isPrivate === false + ? !htmlContent + ? '

' + : editorRef.current.getJSON() + : htmlContent; + const secretKeyObject = await getSecretKey(false, true); + + let repliedTo = replyMessage?.signature; + + if (replyMessage?.chatReference) { + repliedTo = replyMessage?.chatReference; + } + + const chatReference = onEditMessage?.signature; + + const publicData = isPrivate + ? {} + : { + isEdited: chatReference ? true : false, + }; + + interface ImageToPublish { + service: string; + identifier: string; + name: string; + base64: string; + } + + const imagesToPublish: ImageToPublish[] = []; + + if (deleteImage) { + const fee = await getFee('ARBITRARY'); + await show({ + publishFee: fee.fee + ' QORT', + message: t('core:message.question.delete_chat_image', { + postProcess: 'capitalizeFirstChar', + }), + }); + + // TODO magic string + await window.sendMessage('publishOnQDN', { + data: 'RA==', + identifier: onEditMessage?.images[0]?.identifier, + service: onEditMessage?.images[0]?.service, + uploadType: 'base64', + }); + } + + if (chatImagesToSave?.length > 0) { + const imageToSave = chatImagesToSave[0]; + + const base64ToSave = isPrivate + ? await encryptChatMessage(imageToSave, secretKeyObject) + : imageToSave; + + // 1 represents public group, 0 is private + const identifier = `grp-q-manager_${isPrivate ? 0 : 1}_group_${selectedGroup}_${uidImages.rnd()}`; + imagesToPublish.push({ + service: 'IMAGE', + identifier, + name: myName, + base64: base64ToSave, + }); + + const res = await window.sendMessage( + 'PUBLISH_MULTIPLE_QDN_RESOURCES', + { + resources: imagesToPublish, + }, + 240000, + true + ); + if (res?.error) + throw new Error( + t('core:message.error.publish_image', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + + const images = + imagesToPublish?.length > 0 + ? imagesToPublish.map((item) => { + return { + name: item.name, + identifier: item.identifier, + service: item.service, + timestamp: Date.now(), + }; + }) + : chatReference + ? isDeleteImage + ? [] + : onEditMessage?.images || [] + : []; + const otherData = { repliedTo, ...(onEditMessage?.decryptedData || {}), type: chatReference ? 'edit' : '', specialId: uid.rnd(), - ...publicData - } + images: images, + ...publicData, + }; const objectMessage = { ...(otherData || {}), [isPrivate ? 'message' : 'messageText']: message, - version: 3 - } - const message64: any = await objectToBase64(objectMessage) - - const encryptSingle = isPrivate === false ? JSON.stringify(objectMessage) : await encryptChatMessage(message64, secretKeyObject) - // const res = await sendChatGroup({groupId: selectedGroup,messageText: encryptSingle}) - - const sendMessageFunc = async () => { - return await sendChatGroup({groupId: selectedGroup,messageText: encryptSingle, chatReference}) + version: 3, }; - + const message64: any = await objectToBase64(objectMessage); + + const encryptSingle = + isPrivate === false + ? JSON.stringify(objectMessage) + : await encryptChatMessage(message64, secretKeyObject); + + const sendMessageFunc = async () => { + return await sendChatGroup({ + groupId: selectedGroup, + messageText: encryptSingle, + chatReference, + }); + }; + // Add the function to the queue const messageObj = { message: { text: htmlContent, timestamp: Date.now(), - senderName: myName, - sender: myAddress, - ...(otherData || {}) + senderName: myName, + sender: myAddress, + ...(otherData || {}), }, - chatReference - } - addToQueue(sendMessageFunc, messageObj, 'chat', - selectedGroup ); + chatReference, + }; + addToQueue(sendMessageFunc, messageObj, 'chat', selectedGroup); setTimeout(() => { - executeEvent("sent-new-message-group", {}) + executeEvent('sent-new-message-group', {}); }, 150); - clearEditorContent() - setReplyMessage(null) - setOnEditMessage(null) - } - // send chat message - } catch (error) { - const errorMsg = error?.message || error - setInfoSnack({ - type: "error", - message: errorMsg, - }); - setOpenSnack(true); - console.error(error) - } finally { - setIsSending(false) - resumeAllQueues() + clearEditorContent(); + setReplyMessage(null); + setOnEditMessage(null); + setIsDeleteImage(false); + setChatImagesToSave([]); } + // send chat message + } catch (error) { + const errorMsg = error?.message || error; + setInfoSnack({ + type: 'error', + message: errorMsg, + }); + setOpenSnack(true); + console.error(error); + } finally { + setIsSending(false); + resumeAllQueues(); } + }; - useEffect(() => { - if (!editorRef?.current) return; - - handleUpdateRef.current = throttle(async () => { - try { - if(isPrivate){ + useEffect(() => { + if (!editorRef?.current) return; + + handleUpdateRef.current = throttle(async () => { + try { + if (isPrivate) { const htmlContent = editorRef.current.getHTML(); - const message64 = await objectToBase64(JSON.stringify(htmlContent)) - const secretKeyObject = await getSecretKey(false, true) - const encryptSingle = await encryptChatMessage(message64, secretKeyObject) + const message64 = await objectToBase64(JSON.stringify(htmlContent)); + const secretKeyObject = await getSecretKey(false, true); + const encryptSingle = await encryptChatMessage( + message64, + secretKeyObject + ); setMessageSize((encryptSingle?.length || 0) + 200); } else { const htmlContent = editorRef.current.getJSON(); - const message = JSON.stringify(htmlContent) - const size = new Blob([message]).size + const message = JSON.stringify(htmlContent); + const size = new Blob([message]).size; setMessageSize(size + 300); } - - } catch (error) { + } catch (error) { // calc size error - } - }, 1200); - - const currentEditor = editorRef.current; - - currentEditor.on("update", handleUpdateRef.current); - - return () => { - currentEditor.off("update", handleUpdateRef.current); - }; - }, [editorRef, setMessageSize, isPrivate]); + } + }, 1200); + + const currentEditor = editorRef.current; + + currentEditor.on('update', handleUpdateRef.current); + + return () => { + currentEditor.off('update', handleUpdateRef.current); + }; + }, [editorRef, setMessageSize, isPrivate]); useEffect(() => { if (hide) { @@ -713,298 +1032,531 @@ const clearEditorContent = () => { setIsMoved(false); // Reset the position immediately when showing } }, [hide]); - - const onReply = useCallback((message)=> { - if(onEditMessage){ - clearEditorContent() - } - setReplyMessage(message) - setOnEditMessage(null) - editorRef?.current?.chain().focus() - }, [onEditMessage]) + const onReply = useCallback( + (message) => { + if (onEditMessage) { + clearEditorContent(); + } + setReplyMessage(message); + setOnEditMessage(null); + setIsDeleteImage(false); + setChatImagesToSave([]); + editorRef?.current?.chain().focus(); + }, + [onEditMessage] + ); - const onEdit = useCallback((message)=> { - setOnEditMessage(message) - setReplyMessage(null) - editorRef.current.chain().focus().setContent(message?.messageText || message?.text).run(); - - }, []) - const handleReaction = useCallback(async (reaction, chatMessage, reactionState = true)=> { + const onEdit = useCallback((message) => { + setOnEditMessage(message); + setReplyMessage(null); try { - - if(isSending) return - if(+balance < 4) throw new Error('You need at least 4 QORT to send a message') - pauseAllQueues() - - - setIsSending(true) - const message = '' - const secretKeyObject = await getSecretKey(false, true) - - - const otherData = { - specialId: uid.rnd(), - type: 'reaction', - content: reaction, - contentState: reactionState - } - const objectMessage = { - message, - ...(otherData || {}) - } - const message64: any = await objectToBase64(objectMessage) - const reactiontypeNumber = RESOURCE_TYPE_NUMBER_GROUP_CHAT_REACTIONS - const encryptSingle = isPrivate === false ? JSON.stringify(objectMessage) : await encryptChatMessage(message64, secretKeyObject, reactiontypeNumber) - // const res = await sendChatGroup({groupId: selectedGroup,messageText: encryptSingle}) - - const sendMessageFunc = async () => { - return await sendChatGroup({groupId: selectedGroup,messageText: encryptSingle, chatReference: chatMessage.signature}) - }; - - // Add the function to the queue - const messageObj = { - message: { - text: message, - timestamp: Date.now(), - senderName: myName, - sender: myAddress, - ...(otherData || {}) - }, - chatReference: chatMessage.signature - } - addToQueue(sendMessageFunc, messageObj, 'chat-reaction', - selectedGroup ); - // setTimeout(() => { - // executeEvent("sent-new-message-group", {}) - // }, 150); - // clearEditorContent() - // setReplyMessage(null) - - // send chat message + editorRef.current + .chain() + .focus() + .setContent(message?.messageText || message?.text || '

') + .run(); } catch (error) { - const errorMsg = error?.message || error - setInfoSnack({ - type: "error", - message: errorMsg, - }); - setOpenSnack(true); - console.error(error) - } finally { - setIsSending(false) - resumeAllQueues() + console.error(error); } - }, [isPrivate]) + }, []); + + const handleReaction = useCallback( + async (reaction, chatMessage, reactionState = true) => { + try { + if (isSending) return; + if (+balance < 4) + // TODO magic number + throw new Error( + t('group:message.error.qortals_required', { + quantity: 4, + postProcess: 'capitalizeFirstChar', + }) + ); + + pauseAllQueues(); + setIsSending(true); + + const message = ''; + const secretKeyObject = await getSecretKey(false, true); + const otherData = { + specialId: uid.rnd(), + type: 'reaction', + content: reaction, + contentState: reactionState, + }; + const objectMessage = { + message, + ...(otherData || {}), + }; + const message64: any = await objectToBase64(objectMessage); + const reactiontypeNumber = RESOURCE_TYPE_NUMBER_GROUP_CHAT_REACTIONS; + const encryptSingle = + isPrivate === false + ? JSON.stringify(objectMessage) + : await encryptChatMessage( + message64, + secretKeyObject, + reactiontypeNumber + ); + const sendMessageFunc = async () => { + return await sendChatGroup({ + groupId: selectedGroup, + messageText: encryptSingle, + chatReference: chatMessage.signature, + }); + }; + + // Add the function to the queue + const messageObj = { + message: { + text: message, + timestamp: Date.now(), + senderName: myName, + sender: myAddress, + ...(otherData || {}), + }, + chatReference: chatMessage.signature, + }; + addToQueue(sendMessageFunc, messageObj, 'chat-reaction', selectedGroup); + // send chat message + } catch (error) { + const errorMsg = error?.message || error; + setInfoSnack({ + type: 'error', + message: errorMsg, + }); + setOpenSnack(true); + console.error(error); + } finally { + setIsSending(false); + resumeAllQueues(); + } + }, + [isPrivate] + ); + + const openQManager = useCallback(() => { + setIsOpenQManager(true); + }, []); + + const theme = useTheme(); + + const insertImage = useCallback( + (img) => { + if ( + chatImagesToSave?.length > 0 || + (messageHasImage(onEditMessage) && !isDeleteImage) + ) { + setInfoSnack({ + type: 'error', + message: t('core:message.generic.message_with_image', { + postProcess: 'capitalizeFirstChar', + }), + }); + setOpenSnack(true); + return; + } + setChatImagesToSave((prev) => [...prev, img]); + }, + [chatImagesToSave, onEditMessage?.images, isDeleteImage] + ); - const openQManager = useCallback(()=> { - setIsOpenQManager(true) - }, []) - return ( -
- - - - {(!!secretKey || isPrivate === false) && ( -
- -
+ + + {(!!secretKey || isPrivate === false) && ( +
- {replyMessage && ( - - + minHeight: '150px', + overflow: 'hidden', + padding: '20px', + position: isFocusedParent ? 'fixed' : 'relative', + top: isFocusedParent ? '0px' : 'unset', + width: '100%', + zIndex: isFocusedParent ? 5 : 'unset', + }} + > +
+ + {!isDeleteImage && + onEditMessage && + messageHasImage(onEditMessage) && + onEditMessage?.images?.map((_, index) => ( +
+ - { - setReplyMessage(null) - - setOnEditMessage(null) + + setIsDeleteImage(true)} + size="small" + sx={{ + position: 'absolute', + top: '50%', + left: '50%', + transform: 'translate(-50%, -50%)', + backgroundColor: (theme) => + theme.palette.background.paper, + color: (theme) => theme.palette.text.primary, + borderRadius: '50%', + opacity: 0, + transition: 'opacity 0.2s', + boxShadow: (theme) => theme.shadows[2], + '&:hover': { + backgroundColor: (theme) => + theme.palette.background.default, + opacity: 1, + }, + pointerEvents: 'auto', + }} + > + + + +
+ ))} - }} - > - - -
- )} - {onEditMessage && ( - - + {chatImagesToSave.map((imgBase64, index) => ( +
+ - { - setReplyMessage(null) - setOnEditMessage(null) - - clearEditorContent() - - }} - > - - - - )} - - - - {messageSize > 750 && ( - - 4000 ? 'var(--danger)' : 'unset' - }}>{`Your message size is of ${messageSize} bytes out of a maximum of 4000`} + + + setChatImagesToSave((prev) => + prev.filter((_, i) => i !== index) + ) + } + size="small" + sx={{ + position: 'absolute', + top: '50%', + left: '50%', + transform: 'translate(-50%, -50%)', + backgroundColor: (theme) => + theme.palette.background.paper, + color: (theme) => theme.palette.text.primary, + borderRadius: '50%', + opacity: 0, + transition: 'opacity 0.2s', + boxShadow: (theme) => theme.shadows[2], + '&:hover': { + backgroundColor: (theme) => + theme.palette.background.default, + opacity: 1, + }, + pointerEvents: 'auto', + }} + > + + + +
+ ))} +
- - )} -
- - + {replyMessage && ( + + - { - - if(isSending) return - sendMessage() + { + setReplyMessage(null); + + setOnEditMessage(null); + setIsDeleteImage(false); + setChatImagesToSave([]); + }} + > + + + + )} + + {onEditMessage && ( + + + + { + setReplyMessage(null); + setOnEditMessage(null); + setIsDeleteImage(false); + setChatImagesToSave([]); + clearEditorContent(); + }} + > + + + + )} + + + {messageSize > 750 && ( + + 4000 ? theme.palette.other.danger : 'unset', + }} + > + {t('core:message.error.message_size', { + maximum: 4000, + size: messageSize, + postProcess: 'capitalizeFirstChar', + })} + + + )} +
+ + + { + if (isSending) return; + sendMessage(); }} style={{ - marginTop: 'auto', alignSelf: 'center', + background: isSending + ? theme.palette.background.default + : theme.palette.background.paper, cursor: isSending ? 'default' : 'pointer', - background: isSending && 'rgba(0, 0, 0, 0.8)', flexShrink: 0, + marginTop: 'auto', + minWidth: 'auto', padding: '5px', width: '100px', - minWidth: 'auto' - }} > {isSending && ( + size={18} + sx={{ + color: theme.palette.text.primary, + left: '50%', + marginLeft: '-12px', + marginTop: '-12px', + position: 'absolute', + top: '50%', + }} + /> )} {` Send`} - - -
- )} - {isOpenQManager !== null && ( - - - - Q-Manager - { - setIsOpenQManager(false) - }}> - - - - - + +
)} - - {/* */} - - + {isOpenQManager !== null && ( + + + + Q-Manager + + { + setIsOpenQManager(false); + }} + > + + + + + + + + + + )} + + + +
- ) -} + ); +}; diff --git a/src/components/Chat/ChatList.tsx b/src/components/Chat/ChatList.tsx index ef32e7e..839e48b 100644 --- a/src/components/Chat/ChatList.tsx +++ b/src/components/Chat/ChatList.tsx @@ -1,23 +1,25 @@ -import React, { - useCallback, - useState, - useEffect, - useRef, - useMemo, -} from "react"; -import { useVirtualizer } from "@tanstack/react-virtual"; -import { MessageItem } from "./MessageItem"; -import { subscribeToEvent, unsubscribeFromEvent } from "../../utils/events"; -import { useInView } from "react-intersection-observer"; -import { Box, Typography } from "@mui/material"; -import { ChatOptions } from "./ChatOptions"; -import ErrorBoundary from "../../common/ErrorBoundary"; +import { useCallback, useState, useEffect, useRef, useMemo } from 'react'; +import { useVirtualizer } from '@tanstack/react-virtual'; +import { MessageItem } from './MessageItem'; +import { subscribeToEvent, unsubscribeFromEvent } from '../../utils/events'; +import { Box, Button, Typography, useTheme } from '@mui/material'; +import { ChatOptions } from './ChatOptions'; +import ErrorBoundary from '../../common/ErrorBoundary'; +import { useTranslation } from 'react-i18next'; + +type ReactionItem = { + sender: string; + senderName?: string; +}; + +export type ReactionsMap = { + [reactionType: string]: ReactionItem[]; +}; export const ChatList = ({ initialMessages, myAddress, tempMessages, - chatId, onReply, onEdit, handleReaction, @@ -29,9 +31,9 @@ export const ChatList = ({ enableMentions, openQManager, hasSecretKey, - isPrivate + isPrivate, }) => { - const parentRef = useRef(); + const parentRef = useRef(null); const [messages, setMessages] = useState(initialMessages); const [showScrollButton, setShowScrollButton] = useState(false); const [showScrollDownButton, setShowScrollDownButton] = useState(false); @@ -42,33 +44,32 @@ export const ChatList = ({ // Initialize the virtualizer const rowVirtualizer = useVirtualizer({ count: messages.length, - getItemKey: (index) => messages[index]?.tempSignature || messages[index].signature, + getItemKey: (index) => + messages[index]?.tempSignature || messages[index].signature, getScrollElement: () => parentRef?.current, estimateSize: useCallback(() => 80, []), // Provide an estimated height of items, adjust this as needed overscan: 10, // Number of items to render outside the visible area to improve smoothness }); - const isAtBottom = useMemo(()=> { + const isAtBottom = useMemo(() => { if (parentRef.current && rowVirtualizer?.isScrolling !== undefined) { const { scrollTop, scrollHeight, clientHeight } = parentRef.current; - const atBottom = scrollTop + clientHeight >= scrollHeight - 10; // Adjust threshold as needed - return atBottom - } + const atBottom = scrollTop + clientHeight >= scrollHeight - 10; // Adjust threshold as needed + return atBottom; + } - return false - - }, [rowVirtualizer?.isScrolling]) + return false; + }, [rowVirtualizer?.isScrolling]); useEffect(() => { if (!parentRef.current || rowVirtualizer?.isScrolling === undefined) return; - if(isAtBottom){ + if (isAtBottom) { if (scrollingIntervalRef.current) { clearTimeout(scrollingIntervalRef.current); } setShowScrollDownButton(false); return; - } else - if (rowVirtualizer?.isScrolling) { + } else if (rowVirtualizer?.isScrolling) { if (scrollingIntervalRef.current) { clearTimeout(scrollingIntervalRef.current); } @@ -108,7 +109,13 @@ export const ChatList = ({ setTimeout(() => { const hasUnreadMessages = totalMessages.some( - (msg) => msg.unread && !msg?.chatReference && !msg?.isTemp && (!msg?.chatReference && msg?.timestamp > lastSeenUnreadMessageTimestamp.current || 0) + (msg) => + msg.unread && + !msg?.chatReference && + !msg?.isTemp && + ((!msg?.chatReference && + msg?.timestamp > lastSeenUnreadMessageTimestamp.current) || + 0) ); if (parentRef.current) { const { scrollTop, scrollHeight, clientHeight } = parentRef.current; @@ -136,9 +143,9 @@ export const ChatList = ({ const index = initialMsgs ? initialMsgs.length - 1 : messages.length - 1; if (rowVirtualizer) { if (divideIndex) { - rowVirtualizer.scrollToIndex(divideIndex, { align: "start" }); + rowVirtualizer.scrollToIndex(divideIndex, { align: 'start' }); } else { - rowVirtualizer.scrollToIndex(index, { align: "end" }); + rowVirtualizer.scrollToIndex(index, { align: 'end' }); } } handleMessageSeen(); @@ -152,7 +159,7 @@ export const ChatList = ({ })) ); setShowScrollButton(false); - lastSeenUnreadMessageTimestamp.current = Date.now() + lastSeenUnreadMessageTimestamp.current = Date.now(); }, []); const sentNewMessageGroupFunc = useCallback(() => { @@ -166,9 +173,9 @@ export const ChatList = ({ }, [messages]); useEffect(() => { - subscribeToEvent("sent-new-message-group", sentNewMessageGroupFunc); + subscribeToEvent('sent-new-message-group', sentNewMessageGroupFunc); return () => { - unsubscribeFromEvent("sent-new-message-group", sentNewMessageGroupFunc); + unsubscribeFromEvent('sent-new-message-group', sentNewMessageGroupFunc); }; }, [sentNewMessageGroupFunc]); @@ -181,57 +188,65 @@ export const ChatList = ({ const goToMessage = useCallback((idx) => { rowVirtualizer.scrollToIndex(idx); }, []); + + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + return ( -
-
-
-
- {rowVirtualizer.getVirtualItems().map((virtualRow) => { const index = virtualRow.index; let message = messages[index] || null; // Safeguard against undefined let replyIndex = -1; let reply = null; - let reactions = null; + let reactions: ReactionsMap | null = null; let isUpdating = false; - + try { // Safeguard for message existence if (message) { @@ -239,16 +254,19 @@ export const ChatList = ({ replyIndex = messages.findIndex( (msg) => msg?.signature === message?.repliedTo ); - + if (message?.repliedTo && replyIndex !== -1) { reply = { ...(messages[replyIndex] || {}) }; if (chatReferences?.[reply?.signature]?.edit) { - reply.decryptedData = chatReferences[reply?.signature]?.edit; - reply.text = chatReferences[reply?.signature]?.edit?.message; - reply.editTimestamp = chatReferences[reply?.signature]?.edit?.timestamp + reply.decryptedData = + chatReferences[reply?.signature]?.edit; + reply.text = + chatReferences[reply?.signature]?.edit?.message; + reply.editTimestamp = + chatReferences[reply?.signature]?.edit?.timestamp; } } - + // GroupDirectId logic if (message?.message && message?.groupDirectId) { replyIndex = messages.findIndex( @@ -264,24 +282,26 @@ export const ChatList = ({ status: message?.status, }; } - + // Check for reactions and edits if (chatReferences?.[message.signature]) { - reactions = chatReferences[message.signature]?.reactions || null; - - if (chatReferences[message.signature]?.edit?.message && message?.text) { - message.text = chatReferences[message.signature]?.edit?.message; - message.isEdit = true - message.editTimestamp = chatReferences[message.signature]?.edit?.timestamp + reactions = + chatReferences[message.signature]?.reactions || null; + + if (chatReferences[message.signature]?.edit) { + message.text = + chatReferences[message.signature]?.edit?.message; + message.messageText = + chatReferences[message.signature]?.edit?.messageText; + message.images = + chatReferences[message.signature]?.edit?.images; + + message.isEdit = true; + message.editTimestamp = + chatReferences[message.signature]?.edit?.timestamp; } - if (chatReferences[message.signature]?.edit?.messageText && message?.messageText) { - message.messageText = chatReferences[message.signature]?.edit?.messageText; - message.isEdit = true - message.editTimestamp = chatReferences[message.signature]?.edit?.timestamp - } - } - + // Check if message is updating if ( tempChatReferences?.some( @@ -292,138 +312,154 @@ export const ChatList = ({ } } } catch (error) { - console.error("Error processing message:", error, { index, message }); + console.error('Error processing message:', error, { + index, + message, + }); // Gracefully handle the error by providing fallback data message = null; reply = null; reactions = null; } - // Render fallback if message is null + // Render fallback if message is null if (!message) { - return ( -
- Error loading message. -
- ); - } + return ( + + + {t('core:message.error.message_loading', { + postProcess: 'capitalizeFirstChar', + })} + + + ); + } return ( -
- - Error loading content: Invalid Data + {t('group:message.generic.invalid_data', { + postProcess: 'capitalizeFirstChar', + })} } > - - -
+ + + ); })} - -
-
-
+ + + + {showScrollButton && ( - + {t('group:action.scroll_unread_messages', { + postProcess: 'capitalizeFirstChar', + })} + )} + {showScrollDownButton && !showScrollButton && ( - + {t('group:action.scroll_bottom', { + postProcess: 'capitalizeFirstChar', + })} + )} -
+
+ {enableMentions && (hasSecretKey || isPrivate === false) && ( )} diff --git a/src/components/Chat/ChatOptions.tsx b/src/components/Chat/ChatOptions.tsx index 4e7a7d3..f0b2c95 100644 --- a/src/components/Chat/ChatOptions.tsx +++ b/src/components/Chat/ChatOptions.tsx @@ -6,124 +6,145 @@ import { MenuItem, Select, Typography, - Tooltip -} from "@mui/material"; -import React, { useEffect, useMemo, useRef, useState } from "react"; -import SearchIcon from "@mui/icons-material/Search"; -import { Spacer } from "../../common/Spacer"; -import AlternateEmailIcon from "@mui/icons-material/AlternateEmail"; -import CloseIcon from "@mui/icons-material/Close"; + Tooltip, + useTheme, +} from '@mui/material'; +import React, { useEffect, useMemo, useRef, useState } from 'react'; +import SearchIcon from '@mui/icons-material/Search'; +import { Spacer } from '../../common/Spacer'; +import AlternateEmailIcon from '@mui/icons-material/AlternateEmail'; +import CloseIcon from '@mui/icons-material/Close'; import InsertLinkIcon from '@mui/icons-material/InsertLink'; -import Highlight from "@tiptap/extension-highlight"; -import Mention from "@tiptap/extension-mention"; -import StarterKit from "@tiptap/starter-kit"; -import Underline from "@tiptap/extension-underline"; +import Highlight from '@tiptap/extension-highlight'; +import Mention from '@tiptap/extension-mention'; +import StarterKit from '@tiptap/starter-kit'; +import Underline from '@tiptap/extension-underline'; import { AppsSearchContainer, AppsSearchLeft, AppsSearchRight, -} from "../Apps/Apps-styles"; -import IconSearch from "../../assets/svgs/Search.svg"; -import IconClearInput from "../../assets/svgs/ClearInput.svg"; -import { - AutoSizer, - CellMeasurer, - CellMeasurerCache, - List, -} from "react-virtualized"; -import { getBaseApiReact } from "../../App"; -import { MessageDisplay } from "./MessageDisplay"; -import { useVirtualizer } from "@tanstack/react-virtual"; -import { formatTimestamp } from "../../utils/time"; -import { ContextMenuMentions } from "../ContextMenuMentions"; +} from '../Apps/Apps-styles'; +import IconClearInput from '../../assets/svgs/ClearInput.svg'; +import { getBaseApiReact } from '../../App'; +import { MessageDisplay } from './MessageDisplay'; +import { useVirtualizer } from '@tanstack/react-virtual'; +import { formatTimestamp } from '../../utils/time'; +import { ContextMenuMentions } from '../ContextMenuMentions'; import { convert } from 'html-to-text'; -import { generateHTML } from "@tiptap/react"; -import ErrorBoundary from "../../common/ErrorBoundary"; +import { generateHTML } from '@tiptap/react'; +import ErrorBoundary from '../../common/ErrorBoundary'; +import { useTranslation } from 'react-i18next'; +import { isHtmlString } from '../../utils/chat'; +import TextStyle from '@tiptap/extension-text-style'; const extractTextFromHTML = (htmlString = '') => { return convert(htmlString, { wordwrap: false, // Disable word wrapping })?.toLowerCase(); }; -const cache = new CellMeasurerCache({ - fixedWidth: true, - defaultHeight: 50, -}); -export const ChatOptions = ({ messages : untransformedMessages, goToMessage, members, myName, selectedGroup, openQManager, isPrivate }) => { - const [mode, setMode] = useState("default"); - const [searchValue, setSearchValue] = useState(""); +export const ChatOptions = ({ + messages: untransformedMessages, + goToMessage, + members, + myName, + selectedGroup, + openQManager, + isPrivate, +}) => { + const [mode, setMode] = useState('default'); + const [searchValue, setSearchValue] = useState(''); const [selectedMember, setSelectedMember] = useState(0); + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + const parentRef = useRef(null); + const parentRefMentions = useRef(null); + const [lastMentionTimestamp, setLastMentionTimestamp] = useState(null); + const [debouncedValue, setDebouncedValue] = useState(''); // Debounced value - const parentRef = useRef(); - const parentRefMentions = useRef(); - const [lastMentionTimestamp, setLastMentionTimestamp] = useState(null) - const [debouncedValue, setDebouncedValue] = useState(""); // Debounced value - const messages = useMemo(()=> { - return untransformedMessages?.map((item)=> { - if(item?.messageText){ - let transformedMessage = item?.messageText + const messages = useMemo(() => { + return untransformedMessages?.map((item) => { + if (item?.messageText) { + let transformedMessage = item?.messageText; + const isHtml = isHtmlString(item?.messageText); try { - transformedMessage = generateHTML(item?.messageText, [ - StarterKit, - Underline, - Highlight, - Mention - ]) - return { - ...item, - messageText: transformedMessage - } + transformedMessage = isHtml + ? item?.messageText + : generateHTML(item?.messageText, [ + StarterKit, + Underline, + Highlight, + Mention, + TextStyle, + ]); + return { + ...item, + messageText: transformedMessage, + }; } catch (error) { - // error + console.log(error); } - } else return item - }) - }, [untransformedMessages]) + } else return item; + }); + }, [untransformedMessages]); + const getTimestampMention = async () => { try { return new Promise((res, rej) => { - window.sendMessage("getTimestampMention") - .then((response) => { - if (!response?.error) { - if(response && selectedGroup && response[selectedGroup]){ - setLastMentionTimestamp(response[selectedGroup]) - - - - - - } - - res(response); - return; - } - rej(response.error); - }) - .catch((error) => { - rej(error.message || "An error occurred"); - }); - + window + .sendMessage('getTimestampMention') + .then((response) => { + if (!response?.error) { + if (response && selectedGroup && response[selectedGroup]) { + setLastMentionTimestamp(response[selectedGroup]); + } + res(response); + return; + } + rej(response.error); + }) + .catch((error) => { + rej( + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }) + ); + }); }); - } catch (error) {} + } catch (error) { + console.log(error); + } }; - useEffect(()=> { - if(mode === 'mentions' && selectedGroup){ - window.sendMessage("addTimestampMention", { - timestamp: Date.now(), - groupId: selectedGroup - }).then((res)=> { - getTimestampMention() - }).catch((error) => { - console.error("Failed to add timestamp:", error.message || "An error occurred"); + useEffect(() => { + if (mode === 'mentions' && selectedGroup) { + window + .sendMessage('addTimestampMention', { + timestamp: Date.now(), + groupId: selectedGroup, + }) + .then((res) => { + getTimestampMention(); + }) + .catch((error) => { + console.error( + 'Failed to add timestamp:', + error.message || 'An error occurred' + ); }); } - }, [mode, selectedGroup]) + }, [mode, selectedGroup]); - useEffect(()=> { - getTimestampMention() - }, []) + useEffect(() => { + getTimestampMention(); + }, []); // Debounce logic useEffect(() => { @@ -146,37 +167,47 @@ export const ChatOptions = ({ messages : untransformedMessages, goToMessage, mem } return []; } + if (selectedMember) { return messages .filter( (message) => message?.senderName === selectedMember && - extractTextFromHTML(isPrivate ? message?.messageText : message?.decryptedData?.message)?.includes( - debouncedValue.toLowerCase() - ) + extractTextFromHTML( + isPrivate ? message?.messageText : message?.decryptedData?.message + )?.includes(debouncedValue.toLowerCase()) ) ?.sort((a, b) => b?.timestamp - a?.timestamp); } + return messages .filter((message) => - extractTextFromHTML(isPrivate === false ? message?.messageText : message?.decryptedData?.message)?.includes(debouncedValue.toLowerCase()) + extractTextFromHTML( + isPrivate === false + ? message?.messageText + : message?.decryptedData?.message + )?.includes(debouncedValue.toLowerCase()) ) ?.sort((a, b) => b?.timestamp - a?.timestamp); }, [debouncedValue, messages, selectedMember, isPrivate]); const mentionList = useMemo(() => { - if(!messages || messages.length === 0 || !myName) return [] - if(isPrivate === false){ + if (!messages || messages.length === 0 || !myName) return []; + if (isPrivate === false) { return messages - .filter((message) => - extractTextFromHTML(message?.messageText)?.includes(`@${myName?.toLowerCase()}`) - ) - ?.sort((a, b) => b?.timestamp - a?.timestamp); - + .filter((message) => + extractTextFromHTML(message?.messageText)?.includes( + `@${myName?.toLowerCase()}` + ) + ) + ?.sort((a, b) => b?.timestamp - a?.timestamp); } + return messages .filter((message) => - extractTextFromHTML(message?.decryptedData?.message)?.includes(`@${myName?.toLowerCase()}`) + extractTextFromHTML(message?.decryptedData?.message)?.includes( + `@${myName?.toLowerCase()}` + ) ) ?.sort((a, b) => b?.timestamp - a?.timestamp); }, [messages, myName, isPrivate]); @@ -203,133 +234,136 @@ export const ChatOptions = ({ messages : untransformedMessages, goToMessage, mem overscan: 10, // Number of items to render outside the visible area to improve smoothness }); - - - if (mode === "mentions") { + if (mode === 'mentions') { return ( { - setMode("default"); + setMode('default'); }} sx={{ - cursor: "pointer", - color: "white", + cursor: 'pointer', + color: theme.palette.text.primary, }} /> + - - - {mentionList?.length === 0 && ( - No results + {t('core:message.generic.no_results', { + postProcess: 'capitalizeFirstChar', + })} )} +
- {rowVirtualizerMentions.getVirtualItems().map((virtualRow) => { - const index = virtualRow.index; - let message = mentionList[index]; - return ( -
- - -
- ); - })} + {rowVirtualizerMentions + .getVirtualItems() + .map((virtualRow) => { + const index = virtualRow.index; + let message = mentionList[index]; + return ( +
+ +
+ ); + })}
@@ -340,69 +374,78 @@ export const ChatOptions = ({ messages : untransformedMessages, goToMessage, mem ); } - if (mode === "search") { + if (mode === 'search') { return ( { - setMode("default"); + setMode('default'); }} sx={{ - cursor: "pointer", - color: "white", + cursor: 'pointer', + color: theme.palette.text.primary, }} /> + - + setSearchValue(e.target.value)} sx={{ ml: 1, flex: 1 }} - placeholder="Search chat text" + placeholder={t('core:action.search_chat_text', { + postProcess: 'capitalizeFirstChar', + })} inputProps={{ - "aria-label": "Search for apps", - fontSize: "16px", + 'aria-label': t('core:action.search_apps', { + postProcess: 'capitalizeFirstChar', + }), + fontSize: '16px', fontWeight: 400, }} /> + {searchValue && ( { - setSearchValue(""); + setSearchValue(''); }} > @@ -410,133 +453,148 @@ export const ChatOptions = ({ messages : untransformedMessages, goToMessage, mem )} + - - {!!selectedMember && ( - { - setSelectedMember(0); - }} sx={{ - cursor: "pointer", - color: "white", + alignItems: 'center', + display: 'flex', + justifyContent: 'space-between', + padding: '10px', }} - /> - )} - - - + > + + + {!!selectedMember && ( + { + setSelectedMember(0); + }} + sx={{ + cursor: 'pointer', + color: theme.palette.text.primary, + }} + /> + )} + + {debouncedValue && searchedList?.length === 0 && ( - No results + {t('core:message.generic.no_results', { + postProcess: 'capitalizeFirstChar', + })} )} +
{rowVirtualizer.getVirtualItems().map((virtualRow) => { const index = virtualRow.index; let message = searchedList[index]; return ( -
- - Error loading content: Invalid Data - - } - > - + + {t('group:message.generic.invalid_data', { + postProcess: 'capitalizeFirstChar', + })} + + } + > +
- ); })}
@@ -548,49 +606,62 @@ export const ChatOptions = ({ messages : untransformedMessages, goToMessage, mem ); } + return ( - { - setMode("search") - }}> + { + setMode('search'); + }} + > SEARCH} + title={ + + {t('core:action.search', { postProcess: 'capitalizeAll' })} + + } placement="left" arrow - sx={{ fontSize: "24" }} + sx={{ fontSize: '24' }} slotProps={{ tooltip: { sx: { - color: "#ffffff", - backgroundColor: "#444444", + color: theme.palette.text.primary, + backgroundColor: theme.palette.background.default, }, }, arrow: { sx: { - color: "#444444", + color: theme.palette.text.secondary, }, }, }} @@ -598,157 +669,194 @@ export const ChatOptions = ({ messages : untransformedMessages, goToMessage, mem - { - setMode("default") - setSearchValue('') - setSelectedMember(0) - openQManager() - }}> + + { + setMode('default'); + setSearchValue(''); + setSelectedMember(0); + openQManager(); + }} + > Q-MANAGER} + title={ + + {t('core:q_apps.q_manager', { postProcess: 'capitalizeAll' })} + + } placement="left" arrow - sx={{ fontSize: "24" }} + sx={{ fontSize: '24' }} slotProps={{ tooltip: { sx: { - color: "#ffffff", - backgroundColor: "#444444", + color: theme.palette.text.primary, + backgroundColor: theme.palette.background.default, }, }, arrow: { sx: { - color: "#444444", + color: theme.palette.text.secondary, }, }, }} > - + - - { - setMode("mentions") - setSearchValue('') - setSelectedMember(0) - }}> - MENTIONED} - placement="left" - arrow - sx={{ fontSize: "24" }} - slotProps={{ - tooltip: { - sx: { - color: "#ffffff", - backgroundColor: "#444444", - }, - }, - arrow: { - sx: { - color: "#444444", - }, - }, + + + { + setMode('mentions'); + setSearchValue(''); + setSelectedMember(0); }} > - 0 && (!lastMentionTimestamp || lastMentionTimestamp < mentionList[0]?.timestamp) ? 'var(--unread)' : 'white' - }} /> - - - + + {t('core:message.generic.mentioned', { + postProcess: 'capitalizeAll', + })} + + } + placement="left" + arrow + sx={{ fontSize: '24' }} + slotProps={{ + tooltip: { + sx: { + color: theme.palette.text.primary, + backgroundColor: theme.palette.background.default, + }, + }, + arrow: { + sx: { + color: theme.palette.text.secondary, + }, + }, + }} + > + 0 && + (!lastMentionTimestamp || + lastMentionTimestamp < mentionList[0]?.timestamp) + ? theme.palette.other.unread + : theme.palette.text.primary, + }} + /> + + - - ); }; - -const ShowMessage = ({message, goToMessage, messages})=> { +const ShowMessage = ({ message, goToMessage, messages }) => { + const theme = useTheme(); return ( - - - - - {message?.senderName?.charAt(0)} - - - {message?.senderName} - - - - - {formatTimestamp(message.timestamp)} - { - const findMsgIndex = messages.findIndex( - (item) => - item?.signature === message?.signature - ); - if (findMsgIndex !== -1) { - goToMessage(findMsgIndex); - } - }} - > - {message?.messageText && ( - - )} - {message?.decryptedData?.message && ( -

" - } - /> - )} - -
-
- ) -} \ No newline at end of file + + + + + {message?.senderName?.charAt(0)} + + + + {message?.senderName} + + + + + + + + {formatTimestamp(message.timestamp)} + + + { + const findMsgIndex = messages.findIndex( + (item) => item?.signature === message?.signature + ); + if (findMsgIndex !== -1) { + goToMessage(findMsgIndex); + } + }} + > + {message?.messageText && ( + + )} + {message?.decryptedData?.message && ( +

'} + /> + )} +
+
+ ); +}; diff --git a/src/components/Chat/CreateCommonSecret.tsx b/src/components/Chat/CreateCommonSecret.tsx index e729386..a8d8961 100644 --- a/src/components/Chat/CreateCommonSecret.tsx +++ b/src/components/Chat/CreateCommonSecret.tsx @@ -1,186 +1,289 @@ -import { Box, Button, Typography } from '@mui/material' -import React, { useContext } from 'react' +import { useContext, useState } from 'react'; +import { Box, Button, Typography, useTheme } from '@mui/material'; import { CustomizedSnackbars } from '../Snackbar/Snackbar'; import { LoadingButton } from '@mui/lab'; -import { MyContext, getArbitraryEndpointReact, getBaseApiReact, pauseAllQueues } from '../../App'; -import { getFee } from '../../background'; -import { decryptResource, getGroupAdmins, validateSecretKey } from '../Group/Group'; +import { + QORTAL_APP_CONTEXT, + getArbitraryEndpointReact, + getBaseApiReact, + pauseAllQueues, +} from '../../App'; +import { getFee } from '../../background/background.ts'; +import { + decryptResource, + getGroupAdmins, + validateSecretKey, +} from '../Group/Group'; import { base64ToUint8Array } from '../../qdn/encryption/group-encryption'; -import { uint8ArrayToObject } from '../../backgroundFunctions/encryption'; +import { uint8ArrayToObject } from '../../encryption/encryption.ts'; +import { useSetAtom } from 'jotai'; +import { txListAtom } from '../../atoms/global'; +import { useTranslation } from 'react-i18next'; -export const CreateCommonSecret = ({groupId, secretKey, isOwner, myAddress, secretKeyDetails, userInfo, noSecretKey, setHideCommonKeyPopup, setIsForceShowCreationKeyPopup, isForceShowCreationKeyPopup}) => { - const { show, setTxList } = useContext(MyContext); +export const CreateCommonSecret = ({ + groupId, + secretKey, + isOwner, + myAddress, + secretKeyDetails, + userInfo, + noSecretKey, + setHideCommonKeyPopup, + setIsForceShowCreationKeyPopup, + isForceShowCreationKeyPopup, +}) => { + const { show } = useContext(QORTAL_APP_CONTEXT); + const setTxList = useSetAtom(txListAtom); - const [openSnack, setOpenSnack] = React.useState(false); - const [infoSnack, setInfoSnack] = React.useState(null); - const [isLoading, setIsLoading] = React.useState(false) + const [openSnack, setOpenSnack] = useState(false); + const [infoSnack, setInfoSnack] = useState(null); + const [isLoading, setIsLoading] = useState(false); + + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); const getPublishesFromAdmins = async (admins: string[]) => { - // const validApi = await findUsableApi(); - const queryString = admins.map((name) => `name=${name}`).join("&"); + const queryString = admins.map((name) => `name=${name}`).join('&'); const url = `${getBaseApiReact()}${getArbitraryEndpointReact()}?mode=ALL&service=DOCUMENT_PRIVATE&identifier=symmetric-qchat-group-${ groupId }&exactmatchnames=true&limit=0&reverse=true&${queryString}&prefix=true`; const response = await fetch(url); - if(!response.ok){ - throw new Error('network error') + if (!response.ok) { + throw new Error('network error'); } const adminData = await response.json(); - + const filterId = adminData.filter( - (data: any) => - data.identifier === `symmetric-qchat-group-${groupId}` + (data: any) => data.identifier === `symmetric-qchat-group-${groupId}` ); + if (filterId?.length === 0) { return false; } + const sortedData = filterId.sort((a: any, b: any) => { // Get the most recent date for both a and b const dateA = a.updated ? new Date(a.updated) : new Date(a.created); const dateB = b.updated ? new Date(b.updated) : new Date(b.created); - + // Sort by most recent return dateB.getTime() - dateA.getTime(); }); - + return sortedData[0]; }; - const getSecretKey = async (loadingGroupParam?: boolean, secretKeyToPublish?: boolean) => { + + const getSecretKey = async ( + loadingGroupParam?: boolean, + secretKeyToPublish?: boolean + ) => { try { - pauseAllQueues() - - - - const {names} = await getGroupAdmins(groupId); - if(!names.length){ - throw new Error('Network error') + pauseAllQueues(); + + const { names } = await getGroupAdmins(groupId); + + if (!names.length) { + throw new Error( + t('core:message.error.network_generic', { + postProcess: 'capitalizeFirstChar', + }) + ); } const publish = await getPublishesFromAdmins(names); - - + if (publish === false) { - return false; } - + const res = await fetch( `${getBaseApiReact()}/arbitrary/DOCUMENT_PRIVATE/${publish.name}/${ publish.identifier - }?encoding=base64` + }?encoding=base64&rebuild=true` ); + const data = await res.text(); - const decryptedKey: any = await decryptResource(data); - const dataint8Array = base64ToUint8Array(decryptedKey.data); const decryptedKeyToObject = uint8ArrayToObject(dataint8Array); - + if (!validateSecretKey(decryptedKeyToObject)) - throw new Error("SecretKey is not valid"); - + throw new Error( + t('auth:message.error.invalid_secret_key', { + postProcess: 'capitalizeFirstChar', + }) + ); + if (decryptedKeyToObject) { - return decryptedKeyToObject; - } else { } - } catch (error) { - - - } finally { + console.log(error); } }; - const createCommonSecret = async ()=> { - try { - const fee = await getFee('ARBITRARY') - await show({ - message: "Would you like to perform an ARBITRARY transaction?" , - publishFee: fee.fee + ' QORT' - }) - setIsLoading(true) + const createCommonSecret = async () => { + try { + const fee = await getFee('ARBITRARY'); - const secretKey2 = await getSecretKey() - if((!secretKey2 && secretKey2 !== false)) throw new Error('invalid secret key') - if (secretKey2 && !validateSecretKey(secretKey2)) throw new Error('invalid secret key') + await show({ + message: t('core:message.question.perform_transaction', { + action: 'ARBITRARY', + postProcess: 'capitalizeFirstChar', + }), + publishFee: fee.fee + ' QORT', + }); + setIsLoading(true); - const secretKeyToSend = !secretKey2 ? null : secretKey2 - - - window.sendMessage("encryptAndPublishSymmetricKeyGroupChat", { - groupId: groupId, - previousData: secretKeyToSend, + const secretKey2 = await getSecretKey(); + + if (!secretKey2 && secretKey2 !== false) + throw new Error( + t('auth:message.error.invalid_secret_key', { + postProcess: 'capitalizeFirstChar', }) - .then((response) => { - if (!response?.error) { - setInfoSnack({ - type: "success", - message: "Successfully re-encrypted secret key. It may take a couple of minutes for the changes to propagate. Refresh the group in 5 mins.", - }); - setOpenSnack(true); - setTxList((prev) => [ - { - ...response, - type: 'created-common-secret', - label: `Published secret key for group ${groupId}: awaiting confirmation`, - labelDone: `Published secret key for group ${groupId}: success!`, - done: false, - groupId, - }, - ...prev, - ]); - } - setIsLoading(false); - setTimeout(() => { - setIsForceShowCreationKeyPopup(false) - }, 1000); - }) - .catch((error) => { - console.error("Failed to encrypt and publish symmetric key for group chat:", error.message || "An error occurred"); - setIsLoading(false); + ); + + if (secretKey2 && !validateSecretKey(secretKey2)) + throw new Error( + t('auth:message.error.invalid_secret_key', { + postProcess: 'capitalizeFirstChar', + }) + ); + + const secretKeyToSend = !secretKey2 ? null : secretKey2; + + window + .sendMessage('encryptAndPublishSymmetricKeyGroupChat', { + groupId: groupId, + previousData: secretKeyToSend, + }) + .then((response) => { + if (!response?.error) { + setInfoSnack({ + type: 'success', + message: t('auth:message.success.reencrypted_secret_key', { + postProcess: 'capitalizeFirstChar', + }), }); - - } catch (error) { - - } + setOpenSnack(true); + setTxList((prev) => [ + { + ...response, + type: 'created-common-secret', + label: t('group:message.success.published_secret_key', { + group_id: groupId, + postProcess: 'capitalizeFirstChar', + }), + labelDone: t( + 'group:message.success.published_secret_key_label', + { + group_id: groupId, + postProcess: 'capitalizeFirstChar', + } + ), + done: false, + groupId, + }, + ...prev, + ]); + } + setIsLoading(false); + setTimeout(() => { + setIsForceShowCreationKeyPopup(false); + }, 1000); + }) + .catch((error) => { + console.error( + 'Failed to encrypt and publish symmetric key for group chat:', + error.message || 'An error occurred' + ); + setIsLoading(false); + }); + } catch (error) { + console.log(error); } - + }; return ( - - Re-encrypt key - {noSecretKey ? ( - - There is no group secret key. Be the first admin to publish one! - - ) : isOwner && secretKeyDetails && userInfo?.name && userInfo.name !== secretKeyDetails?.name ? ( - - The latest group secret key was published by a non-owner. As the owner of the group please re-encrypt the key as a safeguard - - ): isForceShowCreationKeyPopup ? null : ( - - The group member list has changed. Please re-encrypt the secret key. - - )} - - + flexDirection: 'column', + gap: '25px', + maxWidth: '350px', + padding: '25px', + }} + > + + {t('auth:action.reencrypt_key', { postProcess: 'capitalizeFirstChar' })} + + + {noSecretKey ? ( + + + {t('group:message.generic.group_no_secret_key', { + postProcess: 'capitalizeFirstChar', + })} + + + ) : isOwner && + secretKeyDetails && + userInfo?.name && + userInfo.name !== secretKeyDetails?.name ? ( + + + {t('group:message.generic.group_secret_key_no_owner', { + postProcess: 'capitalizeFirstChar', + })} + + + ) : isForceShowCreationKeyPopup ? null : ( + + + {t('group:message.generic.group_member_list_changed', { + postProcess: 'capitalizeFirstChar', + })} + + + )} + + + - + + - - ) -} + ); +}; diff --git a/src/components/Chat/GroupAnnouncements.tsx b/src/components/Chat/GroupAnnouncements.tsx index 9ba7668..7e1e5f9 100644 --- a/src/components/Chat/GroupAnnouncements.tsx +++ b/src/components/Chat/GroupAnnouncements.tsx @@ -1,57 +1,55 @@ -import React, { +import { useCallback, + useContext, useEffect, useMemo, + useReducer, useRef, useState, -} from "react"; -import { CreateCommonSecret } from "./CreateCommonSecret"; -import { reusableGet } from "../../qdn/publish/pubish"; -import { uint8ArrayToObject } from "../../backgroundFunctions/encryption"; +} from 'react'; +import { uint8ArrayToObject } from '../../encryption/encryption.ts'; import { base64ToUint8Array, objectToBase64, -} from "../../qdn/encryption/group-encryption"; -import { ChatContainerComp } from "./ChatContainer"; -import { ChatList } from "./ChatList"; -import "@chatscope/chat-ui-kit-styles/dist/default/styles.min.css"; -import Tiptap from "./TipTap"; -import { AuthenticatedContainerInnerTop, CustomButton } from "../../App-styles"; -import CircularProgress from "@mui/material/CircularProgress"; -import { getBaseApi, getFee } from "../../background"; -import { LoadingSnackbar } from "../Snackbar/LoadingSnackbar"; -import { Box, Typography } from "@mui/material"; -import { Spacer } from "../../common/Spacer"; -import ShortUniqueId from "short-unique-id"; -import { AnnouncementList } from "./AnnouncementList"; -const uid = new ShortUniqueId({ length: 8 }); -import CampaignIcon from "@mui/icons-material/Campaign"; -import ArrowBackIcon from "@mui/icons-material/ArrowBack"; -import { AnnouncementDiscussion } from "./AnnouncementDiscussion"; +} from '../../qdn/encryption/group-encryption'; +import Tiptap from './TipTap'; +import { CustomButton } from '../../styles/App-styles'; +import CircularProgress from '@mui/material/CircularProgress'; +import { getFee } from '../../background/background.ts'; +import { LoadingSnackbar } from '../Snackbar/LoadingSnackbar'; +import { Box, Typography, useTheme } from '@mui/material'; +import { Spacer } from '../../common/Spacer'; +import ShortUniqueId from 'short-unique-id'; +import { AnnouncementList } from './AnnouncementList'; +import CampaignIcon from '@mui/icons-material/Campaign'; +import { AnnouncementDiscussion } from './AnnouncementDiscussion'; import { - MyContext, + QORTAL_APP_CONTEXT, getArbitraryEndpointReact, getBaseApiReact, - isMobile, pauseAllQueues, resumeAllQueues, -} from "../../App"; -import { RequestQueueWithPromise } from "../../utils/queue/queue"; -import { CustomizedSnackbars } from "../Snackbar/Snackbar"; -import { addDataPublishesFunc, getDataPublishesFunc } from "../Group/Group"; -import { getRootHeight } from "../../utils/mobile/mobileUtils"; +} from '../../App'; +import { RequestQueueWithPromise } from '../../utils/queue/queue'; +import { CustomizedSnackbars } from '../Snackbar/Snackbar'; +import { addDataPublishesFunc, getDataPublishesFunc } from '../Group/Group'; +import { useTranslation } from 'react-i18next'; + +const uid = new ShortUniqueId({ length: 8 }); export const requestQueueCommentCount = new RequestQueueWithPromise(3); + export const requestQueuePublishedAccouncements = new RequestQueueWithPromise( 3 ); export const saveTempPublish = async ({ data, key }: any) => { return new Promise((res, rej) => { - window.sendMessage("saveTempPublish", { - data, - key, - }) + window + .sendMessage('saveTempPublish', { + data, + key, + }) .then((response) => { if (!response?.error) { res(response); @@ -60,37 +58,37 @@ export const saveTempPublish = async ({ data, key }: any) => { rej(response.error); }) .catch((error) => { - rej(error.message || "An error occurred"); + rej(error.message || 'An error occurred'); }); - }); }; export const getTempPublish = async () => { return new Promise((res, rej) => { - window.sendMessage("getTempPublish", {}) - .then((response) => { - if (!response?.error) { - res(response); - return; - } - rej(response.error); - }) - .catch((error) => { - rej(error.message || "An error occurred"); - }); - + window + .sendMessage('getTempPublish', {}) + .then((response) => { + if (!response?.error) { + res(response); + return; + } + rej(response.error); + }) + .catch((error) => { + rej(error.message || 'An error occurred'); + }); }); }; export const decryptPublishes = async (encryptedMessages: any[], secretKey) => { try { return await new Promise((res, rej) => { - window.sendMessage("decryptSingleForPublishes", { - data: encryptedMessages, - secretKeyObject: secretKey, - skipDecodeBase64: true, - }) + window + .sendMessage('decryptSingleForPublishes', { + data: encryptedMessages, + secretKeyObject: secretKey, + skipDecodeBase64: true, + }) .then((response) => { if (!response?.error) { res(response); @@ -99,27 +97,30 @@ export const decryptPublishes = async (encryptedMessages: any[], secretKey) => { rej(response.error); }) .catch((error) => { - rej(error.message || "An error occurred"); + rej(error.message || 'An error occurred'); }); - }); - } catch (error) {} + } catch (error) { + console.log(error); + } }; -export const handleUnencryptedPublishes = (publishes) => { - let publishesData = [] - publishes.forEach((pub)=> { + +export const handleUnencryptedPublishes = (publishes) => { + let publishesData = []; + publishes.forEach((pub) => { try { const decryptToUnit8Array = base64ToUint8Array(pub); const decodedData = uint8ArrayToObject(decryptToUnit8Array); - if(decodedData){ - publishesData.push({decryptedData: decodedData}) + if (decodedData) { + publishesData.push({ decryptedData: decodedData }); } } catch (error) { - + console.log(error); } - }) - return publishesData + }); + return publishesData; }; + export const GroupAnnouncements = ({ selectedGroup, secretKey, @@ -130,7 +131,7 @@ export const GroupAnnouncements = ({ isAdmin, hide, myName, - isPrivate + isPrivate, }) => { const [messages, setMessages] = useState([]); const [isSending, setIsSending] = useState(false); @@ -141,9 +142,9 @@ export const GroupAnnouncements = ({ const [selectedAnnouncement, setSelectedAnnouncement] = useState(null); const [isFocusedParent, setIsFocusedParent] = useState(false); - const { show, rootHeight } = React.useContext(MyContext); - const [openSnack, setOpenSnack] = React.useState(false); - const [infoSnack, setInfoSnack] = React.useState(null); + const { show } = useContext(QORTAL_APP_CONTEXT); + const [openSnack, setOpenSnack] = useState(false); + const [infoSnack, setInfoSnack] = useState(null); const hasInitialized = useRef(false); const hasInitializedWebsocket = useRef(false); const editorRef = useRef(null); @@ -151,20 +152,31 @@ export const GroupAnnouncements = ({ const setEditorRef = (editorInstance) => { editorRef.current = editorInstance; }; - const [, forceUpdate] = React.useReducer((x) => x + 1, 0); + const [, forceUpdate] = useReducer((x) => x + 1, 0); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); const triggerRerender = () => { forceUpdate(); // Trigger re-render by updating the state }; + useEffect(() => { if (!selectedGroup) return; (async () => { - const res = await getDataPublishesFunc(selectedGroup, "anc"); + const res = await getDataPublishesFunc(selectedGroup, 'anc'); dataPublishes.current = res || {}; })(); }, [selectedGroup]); - const getAnnouncementData = async ({ identifier, name, resource }, isPrivate) => { + const getAnnouncementData = async ( + { identifier, name, resource }, + isPrivate + ) => { try { let data = dataPublishes.current[`${name}-${identifier}`]; if ( @@ -179,14 +191,17 @@ export const GroupAnnouncements = ({ }); if (!res?.ok) return; data = await res.text(); - await addDataPublishesFunc({ ...resource, data }, selectedGroup, "anc"); + await addDataPublishesFunc({ ...resource, data }, selectedGroup, 'anc'); } else { data = data.data; } - const response = isPrivate === false ? handleUnencryptedPublishes([data]) : await decryptPublishes([{ data }], secretKey); + const response = + isPrivate === false + ? handleUnencryptedPublishes([data]) + : await decryptPublishes([{ data }], secretKey); const messageData = response[0]; - if(!messageData) return + if (!messageData) return; setAnnouncementData((prev) => { return { ...prev, @@ -194,24 +209,29 @@ export const GroupAnnouncements = ({ }; }); } catch (error) { - console.error("error", error); + console.error('error', error); } }; useEffect(() => { - if ((!secretKey && isPrivate) || hasInitializedWebsocket.current || isPrivate === null) return; + if ( + (!secretKey && isPrivate) || + hasInitializedWebsocket.current || + isPrivate === null + ) + return; setIsLoading(true); - // initWebsocketMessageGroup() hasInitializedWebsocket.current = true; }, [secretKey, isPrivate]); const encryptChatMessage = async (data: string, secretKeyObject: any) => { try { return new Promise((res, rej) => { - window.sendMessage("encryptSingle", { - data, - secretKeyObject, - }) + window + .sendMessage('encryptSingle', { + data, + secretKeyObject, + }) .then((response) => { if (!response?.error) { res(response); @@ -220,19 +240,26 @@ export const GroupAnnouncements = ({ rej(response.error); }) .catch((error) => { - rej(error.message || "An error occurred"); + rej( + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }) + ); }); - }); - } catch (error) {} + } catch (error) { + console.log(error); + } }; const publishAnc = async ({ encryptedData, identifier }: any) => { return new Promise((res, rej) => { - window.sendMessage("publishGroupEncryptedResource", { - encryptedData, - identifier, - }) + window + .sendMessage('publishGroupEncryptedResource', { + encryptedData, + identifier, + }) .then((response) => { if (!response?.error) { res(response); @@ -241,23 +268,19 @@ export const GroupAnnouncements = ({ rej(response.error); }) .catch((error) => { - rej(error.message || "An error occurred"); + rej( + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }) + ); }); - }); }; + const clearEditorContent = () => { if (editorRef.current) { editorRef.current.chain().focus().clearContent().run(); - if (isMobile) { - setTimeout(() => { - editorRef.current?.chain().blur().run(); - setIsFocusedParent(false); - setTimeout(() => { - triggerRerender(); - }, 300); - }, 200); - } } }; @@ -266,39 +289,49 @@ export const GroupAnnouncements = ({ const getTempAnnouncements = await getTempPublish(); if (getTempAnnouncements?.announcement) { let tempData = []; - Object.keys(getTempAnnouncements?.announcement || {}).filter((annKey)=> annKey?.startsWith(`grp-${selectedGroup}-anc`)).map((key) => { - const value = getTempAnnouncements?.announcement[key]; - tempData.push(value.data); - }); + Object.keys(getTempAnnouncements?.announcement || {}) + .filter((annKey) => annKey?.startsWith(`grp-${selectedGroup}-anc`)) + .map((key) => { + const value = getTempAnnouncements?.announcement[key]; + tempData.push(value.data); + }); setTempPublishedList(tempData); } - } catch (error) {} + } catch (error) { + console.log(error); + } }; const publishAnnouncement = async () => { try { pauseAllQueues(); - const fee = await getFee("ARBITRARY"); + const fee = await getFee('ARBITRARY'); + await show({ - message: "Would you like to perform a ARBITRARY transaction?", - publishFee: fee.fee + " QORT", + message: t('core:message.question.perform_transaction', { + action: 'ARBITRARY', + postProcess: 'capitalizeFirstChar', + }), + publishFee: fee.fee + ' QORT', }); + if (isSending) return; if (editorRef.current) { const htmlContent = editorRef.current.getHTML(); - if (!htmlContent?.trim() || htmlContent?.trim() === "

") return; + if (!htmlContent?.trim() || htmlContent?.trim() === '

') return; setIsSending(true); const message = { version: 1, extra: {}, message: htmlContent, }; - const secretKeyObject = isPrivate === false ? null : await getSecretKey(false, true); - const message64: any = await objectToBase64(message); - const encryptSingle = isPrivate === false ? message64 : await encryptChatMessage( - message64, - secretKeyObject - ); + const secretKeyObject = + isPrivate === false ? null : await getSecretKey(false, true); + const message64: any = await objectToBase64(message); + const encryptSingle = + isPrivate === false + ? message64 + : await encryptChatMessage(message64, secretKeyObject); const randomUid = uid.rnd(); const identifier = `grp-${selectedGroup}-anc-${randomUid}`; const res = await publishAnc({ @@ -309,13 +342,13 @@ export const GroupAnnouncements = ({ const dataToSaveToStorage = { name: myName, identifier, - service: "DOCUMENT", + service: 'DOCUMENT', tempData: message, created: Date.now(), }; await saveTempPublish({ data: dataToSaveToStorage, - key: "announcement", + key: 'announcement', }); setTempData(selectedGroup); clearEditorContent(); @@ -324,7 +357,7 @@ export const GroupAnnouncements = ({ } catch (error) { if (!error) return; setInfoSnack({ - type: "error", + type: 'error', message: error, }); setOpenSnack(true); @@ -334,7 +367,7 @@ export const GroupAnnouncements = ({ } }; - const getAnnouncements = React.useCallback( + const getAnnouncements = useCallback( async (selectedGroup, isPrivate) => { try { const offset = 0; @@ -343,9 +376,9 @@ export const GroupAnnouncements = ({ const identifier = `grp-${selectedGroup}-anc-`; const url = `${getBaseApiReact()}${getArbitraryEndpointReact()}?mode=ALL&service=DOCUMENT&identifier=${identifier}&limit=20&includemetadata=false&offset=${offset}&reverse=true&prefix=true`; const response = await fetch(url, { - method: "GET", + method: 'GET', headers: { - "Content-Type": "application/json", + 'Content-Type': 'application/json', }, }); const responseData = await response.json(); @@ -354,23 +387,30 @@ export const GroupAnnouncements = ({ setAnnouncements(responseData); setIsLoading(false); for (const data of responseData) { - getAnnouncementData({ - name: data.name, - identifier: data.identifier, - resource: data, - }, isPrivate); + getAnnouncementData( + { + name: data.name, + identifier: data.identifier, + resource: data, + }, + isPrivate + ); } } catch (error) { - } finally { - // dispatch(setIsLoadingGlobal(false)) + console.log(error); } }, [secretKey] ); - React.useEffect(() => { - if(!secretKey && isPrivate) return - if (selectedGroup && !hasInitialized.current && !hide && isPrivate !== null) { + useEffect(() => { + if (!secretKey && isPrivate) return; + if ( + selectedGroup && + !hasInitialized.current && + !hide && + isPrivate !== null + ) { getAnnouncements(selectedGroup, isPrivate); hasInitialized.current = true; } @@ -384,9 +424,9 @@ export const GroupAnnouncements = ({ const identifier = `grp-${selectedGroup}-anc-`; const url = `${getBaseApiReact()}${getArbitraryEndpointReact()}?mode=ALL&service=DOCUMENT&identifier=${identifier}&limit=20&includemetadata=false&offset=${offset}&reverse=true&prefix=true`; const response = await fetch(url, { - method: "GET", + method: 'GET', headers: { - "Content-Type": "application/json", + 'Content-Type': 'application/json', }, }); const responseData = await response.json(); @@ -394,21 +434,28 @@ export const GroupAnnouncements = ({ setAnnouncements((prev) => [...prev, ...responseData]); setIsLoading(false); for (const data of responseData) { - getAnnouncementData({ name: data.name, identifier: data.identifier }, isPrivate); + getAnnouncementData( + { name: data.name, identifier: data.identifier }, + isPrivate + ); } - } catch (error) {} + } catch (error) { + console.log(error); + } }; const interval = useRef(null); - const checkNewMessages = React.useCallback(async () => { + const theme = useTheme(); + + const checkNewMessages = useCallback(async () => { try { const identifier = `grp-${selectedGroup}-anc-`; const url = `${getBaseApiReact()}${getArbitraryEndpointReact()}?mode=ALL&service=DOCUMENT&identifier=${identifier}&limit=20&includemetadata=false&offset=${0}&reverse=true&prefix=true`; const response = await fetch(url, { - method: "GET", + method: 'GET', headers: { - "Content-Type": "application/json", + 'Content-Type': 'application/json', }, }); const responseData = await response.json(); @@ -416,11 +463,16 @@ export const GroupAnnouncements = ({ if (!latestMessage) { for (const data of responseData) { try { - getAnnouncementData({ - name: data.name, - identifier: data.identifier, - }, isPrivate); - } catch (error) {} + getAnnouncementData( + { + name: data.name, + identifier: data.identifier, + }, + isPrivate + ); + } catch (error) { + console.log(error); + } } setAnnouncements(responseData); return; @@ -434,12 +486,17 @@ export const GroupAnnouncements = ({ for (const data of newArray) { try { - getAnnouncementData({ name: data.name, identifier: data.identifier }, isPrivate); - } catch (error) {} + getAnnouncementData( + { name: data.name, identifier: data.identifier }, + isPrivate + ); + } catch (error) { + console.log(error); + } } setAnnouncements((prev) => [...newArray, ...prev]); } catch (error) { - } finally { + console.log(error); } }, [announcements, secretKey, selectedGroup]); @@ -485,14 +542,13 @@ export const GroupAnnouncements = ({ return (
- {!isMobile && ( - + - - Group Announcements - - )} + /> + {t('group:message.generic.group_announcement', { + postProcess: 'capitalizeFirstChar', + })} + - +
+ {!isLoading && combinedListTempAndReal?.length === 0 && ( - No announcements + {t('group:message.generic.no_announcement', { + postProcess: 'capitalizeFirstChar', + })} )} +
+ {isFocusedParent && ( @@ -639,53 +695,58 @@ export const GroupAnnouncements = ({ if (isSending) return; setIsFocusedParent(false); clearEditorContent(); - setTimeout(() => { - triggerRerender(); - }, 300); + setTimeout(() => { + triggerRerender(); + }, 300); // Unfocus the editor }} style={{ - marginTop: "auto", - alignSelf: "center", - cursor: isSending ? "default" : "pointer", - background: "var(--danger)", + alignSelf: 'center', + background: theme.palette.other.danger, + cursor: isSending ? 'default' : 'pointer', flexShrink: 0, - padding: isMobile && "5px", - fontSize: isMobile && "14px", + fontSize: '14px', + marginTop: 'auto', + padding: '5px', }} > - {` Close`} + {t('core:action.close', { postProcess: 'capitalizeFirstChar' })} )} + { if (isSending) return; publishAnnouncement(); }} style={{ - marginTop: "auto", - alignSelf: "center", - cursor: isSending ? "default" : "pointer", - background: isSending && "rgba(0, 0, 0, 0.8)", + alignSelf: 'center', + background: isSending + ? theme.palette.background.default + : theme.palette.background.paper, + cursor: isSending ? 'default' : 'pointer', flexShrink: 0, - padding: isMobile && "5px", - fontSize: isMobile && "14px", + fontSize: '14px', + marginTop: 'auto', + padding: '5px', }} > {isSending && ( )} - {` Publish Announcement`} + {t('group:action.publish_announcement', { + postProcess: 'capitalizeFirstChar', + })}
@@ -701,7 +762,9 @@ export const GroupAnnouncements = ({
diff --git a/src/components/Chat/GroupAvatar.tsx b/src/components/Chat/GroupAvatar.tsx new file mode 100644 index 0000000..c90d87e --- /dev/null +++ b/src/components/Chat/GroupAvatar.tsx @@ -0,0 +1,379 @@ +import { useCallback, useContext, useEffect, useState } from 'react'; +import Logo2 from '../../assets/svgs/Logo2.svg'; +import { + QORTAL_APP_CONTEXT, + getArbitraryEndpointReact, + getBaseApiReact, +} from '../../App'; +import { + Avatar, + Box, + Button, + ButtonBase, + Popover, + Typography, + useTheme, +} from '@mui/material'; +import { Spacer } from '../../common/Spacer'; +import ImageUploader from '../../common/ImageUploader'; +import { getFee } from '../../background/background.ts'; +import { fileToBase64 } from '../../utils/fileReading'; +import { LoadingButton } from '@mui/lab'; +import ErrorIcon from '@mui/icons-material/Error'; +import { useTranslation } from 'react-i18next'; + +export const GroupAvatar = ({ + myName, + balance, + setOpenSnack, + setInfoSnack, + groupId, +}) => { + const [hasAvatar, setHasAvatar] = useState(false); + const [avatarFile, setAvatarFile] = useState(null); + const [tempAvatar, setTempAvatar] = useState(null); + const { show } = useContext(QORTAL_APP_CONTEXT); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + const [anchorEl, setAnchorEl] = useState(null); + const [isLoading, setIsLoading] = useState(false); + // Handle child element click to open Popover + const handleChildClick = (event) => { + event.stopPropagation(); // Prevent parent onClick from firing + setAnchorEl(event.currentTarget); + }; + + // Handle closing the Popover + const handleClose = () => { + setAnchorEl(null); + }; + + // Determine if the popover is open + const open = Boolean(anchorEl); + const id = open ? 'avatar-img' : undefined; + + const checkIfAvatarExists = useCallback(async (name, groupId) => { + try { + const identifier = `qortal_group_avatar_${groupId}`; + const url = `${getBaseApiReact()}${getArbitraryEndpointReact()}?mode=ALL&service=THUMBNAIL&identifier=${identifier}&limit=1&name=${name}&includemetadata=false&prefix=true`; + const response = await fetch(url, { + method: 'GET', + headers: { + 'Content-Type': 'application/json', + }, + }); + const responseData = await response.json(); + if (responseData?.length > 0) { + setHasAvatar(true); + } + } catch (error) { + console.log(error); + } + }, []); + + useEffect(() => { + if (!myName || !groupId) return; + checkIfAvatarExists(myName, groupId); + }, [myName, groupId, checkIfAvatarExists]); + + const publishAvatar = async () => { + try { + if (!groupId) return; + const fee = await getFee('ARBITRARY'); + + if (+balance < +fee.fee) + throw new Error( + t('core:message.generic.avatar_publish_fee', { + fee: fee.fee, + postProcess: 'capitalizeFirstChar', + }) + ); + + await show({ + message: t('core:message.question.publish_avatar', { + postProcess: 'capitalizeFirstChar', + }), + publishFee: fee.fee + ' QORT', + }); + setIsLoading(true); + const avatarBase64 = await fileToBase64(avatarFile); + + await new Promise((res, rej) => { + window + .sendMessage('publishOnQDN', { + data: avatarBase64, + identifier: `qortal_group_avatar_${groupId}`, + service: 'THUMBNAIL', + uploadType: 'base64', + }) + .then((response) => { + if (!response?.error) { + res(response); + return; + } + rej(response.error); + }) + .catch((error) => { + rej( + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }) + ); + }); + }); + setAvatarFile(null); + setTempAvatar(`data:image/webp;base64,${avatarBase64}`); + handleClose(); + } catch (error) { + if (error?.message) { + setOpenSnack(true); + setInfoSnack({ + type: 'error', + message: error?.message, + }); + } + } finally { + setIsLoading(false); + } + }; + + if (tempAvatar) { + return ( + <> + + {myName?.charAt(0)} + + + + + {t('core:action.change_avatar', { + postProcess: 'capitalizeFirstChar', + })} + + + + + + ); + } + + if (hasAvatar) { + return ( + <> + + {myName?.charAt(0)} + + + + + {t('core:action.change_avatar', { + postProcess: 'capitalizeFirstChar', + })} + + + + + + ); + } + + return ( + <> + + + + {t('core:action.set_avatar', { postProcess: 'capitalizeFirstChar' })} + + + + + + ); +}; + +// TODO the following part is the same as in MainAvatar.tsx +const PopoverComp = ({ + avatarFile, + setAvatarFile, + id, + open, + anchorEl, + handleClose, + publishAvatar, + isLoading, + myName, +}) => { + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + + return ( + + + + {t('core:message.generic.avatar_size', { + size: 500, // TODO magic number + postProcess: 'capitalizeFirstChar', + })} + + + setAvatarFile(file)}> + + + + {avatarFile?.name} + + + + {!myName && ( + + + + {t('group:message.generic.avatar_registered_name', { + postProcess: 'capitalizeFirstChar', + })} + + + )} + + + + + {t('group:action.publish_avatar', { + postProcess: 'capitalizeFirstChar', + })} + + + + ); +}; diff --git a/src/components/Chat/GroupForum.tsx b/src/components/Chat/GroupForum.tsx index d8dd7e5..551a2db 100644 --- a/src/components/Chat/GroupForum.tsx +++ b/src/components/Chat/GroupForum.tsx @@ -1,19 +1,5 @@ -import React, { - useCallback, - useContext, - useEffect, - useMemo, - useRef, - useState, -} from "react"; -import { GroupMail } from "../Group/Forum/GroupMail"; -import { MyContext, isMobile } from "../../App"; -import { getRootHeight } from "../../utils/mobile/mobileUtils"; - - - - - +import { useEffect, useState } from 'react'; +import { GroupMail } from '../Group/Forum/GroupMail'; export const GroupForum = ({ selectedGroup, @@ -23,12 +9,12 @@ export const GroupForum = ({ isAdmin, myAddress, hide, - defaultThread, + defaultThread, setDefaultThread, - isPrivate + isPrivate, }) => { - const { rootHeight } = useContext(MyContext); const [isMoved, setIsMoved] = useState(false); + useEffect(() => { if (hide) { setTimeout(() => setIsMoved(true), 300); // Wait for the fade-out to complete before moving @@ -39,20 +25,27 @@ export const GroupForum = ({ return (
- - -
+ style={{ + display: 'flex', + flexDirection: 'column', + height: 'calc(100vh - 70px)', + left: hide && '-1000px', + opacity: hide ? 0 : 1, + position: hide ? 'fixed' : 'relative', + visibility: hide && 'hidden', + width: '100%', + }} + > + +
); }; diff --git a/src/components/Chat/MentionList.tsx b/src/components/Chat/MentionList.tsx index 85f6890..5ba4ec8 100644 --- a/src/components/Chat/MentionList.tsx +++ b/src/components/Chat/MentionList.tsx @@ -1,69 +1,81 @@ -import React, { - forwardRef, useEffect, useImperativeHandle, - useState, - } from 'react' - - export default forwardRef((props, ref) => { - const [selectedIndex, setSelectedIndex] = useState(0) - - const selectItem = index => { - const item = props.items[index] - - if (item) { - props.command(item) +import { forwardRef, useEffect, useImperativeHandle, useState } from 'react'; +import { useTranslation } from 'react-i18next'; + +export default forwardRef((props, ref) => { + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + + const [selectedIndex, setSelectedIndex] = useState(0); + + const selectItem = (index) => { + const item = props.items[index]; + + if (item) { + props.command(item); + } + }; + + const upHandler = () => { + setSelectedIndex( + (selectedIndex + props.items.length - 1) % props.items.length + ); + }; + + const downHandler = () => { + setSelectedIndex((selectedIndex + 1) % props.items.length); + }; + + const enterHandler = () => { + selectItem(selectedIndex); + }; + + useEffect(() => setSelectedIndex(0), [props.items]); + + useImperativeHandle(ref, () => ({ + onKeyDown: ({ event }) => { + if (event.key === 'ArrowUp') { + upHandler(); + return true; } - } - - const upHandler = () => { - setSelectedIndex((selectedIndex + props.items.length - 1) % props.items.length) - } - - const downHandler = () => { - setSelectedIndex((selectedIndex + 1) % props.items.length) - } - - const enterHandler = () => { - selectItem(selectedIndex) - } - - useEffect(() => setSelectedIndex(0), [props.items]) - - useImperativeHandle(ref, () => ({ - onKeyDown: ({ event }) => { - if (event.key === 'ArrowUp') { - upHandler() - return true - } - - if (event.key === 'ArrowDown') { - downHandler() - return true - } - - if (event.key === 'Enter') { - enterHandler() - return true - } - - return false - }, - })) - - return ( -
- {props.items.length - ? props.items.map((item, index) => ( - - )) - :
No result
- } -
- ) - }) - \ No newline at end of file + + if (event.key === 'ArrowDown') { + downHandler(); + return true; + } + + if (event.key === 'Enter') { + enterHandler(); + return true; + } + + return false; + }, + })); + + return ( +
+ {props.items.length ? ( + props.items.map((item, index) => ( + + )) + ) : ( +
+ {t('core:message.generic.no_results', { + postProcess: 'capitalizeFirstChar', + })} +
+ )} +
+ ); +}); diff --git a/src/components/Chat/MessageDisplay.tsx b/src/components/Chat/MessageDisplay.tsx index 52d0d93..dbe7208 100644 --- a/src/components/Chat/MessageDisplay.tsx +++ b/src/components/Chat/MessageDisplay.tsx @@ -1,28 +1,29 @@ -import React, { useEffect, useMemo } from 'react'; +import { useMemo } from 'react'; import DOMPurify from 'dompurify'; -import './styles.css'; +import './chat.css'; import { executeEvent } from '../../utils/events'; import { Embed } from '../Embeds/Embed'; +import { Box, useTheme } from '@mui/material'; export const extractComponents = (url) => { - if (!url || !url.startsWith("qortal://")) { + if (!url || !url.startsWith('qortal://')) { return null; } // Skip links starting with "qortal://use-" - if (url.startsWith("qortal://use-")) { + if (url.startsWith('qortal://use-')) { return null; } - url = url.replace(/^(qortal\:\/\/)/, ""); - if (url.includes("/")) { - let parts = url.split("/"); + url = url.replace(/^(qortal\:\/\/)/, ''); + if (url.includes('/')) { + let parts = url.split('/'); const service = parts[0].toUpperCase(); parts.shift(); const name = parts[0]; parts.shift(); let identifier; - const path = parts.join("/"); + const path = parts.join('/'); return { service, name, identifier, path }; } @@ -64,8 +65,7 @@ function processText(input) { } const linkify = (text) => { - if (!text) return ""; // Return an empty string if text is null or undefined - + if (!text) return ''; // Return an empty string if text is null or undefined let textFormatted = text; const urlPattern = /(\bhttps?:\/\/[^\s<]+|\bwww\.[^\s<]+)/g; textFormatted = text.replace(urlPattern, (url) => { @@ -75,22 +75,68 @@ const linkify = (text) => { return processText(textFormatted); }; +export const MessageDisplay = ({ htmlContent, isReply = false }) => { + const theme = useTheme(); -export const MessageDisplay = ({ htmlContent, isReply }) => { - - - const sanitizedContent = useMemo(()=> { + const sanitizedContent = useMemo(() => { return DOMPurify.sanitize(linkify(htmlContent), { ALLOWED_TAGS: [ - 'a', 'b', 'i', 'em', 'strong', 'p', 'br', 'div', 'span', 'img', - 'ul', 'ol', 'li', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'blockquote', 'code', 'pre', 'table', 'thead', 'tbody', 'tr', 'th', 'td', 's', 'hr' + 'a', + 'b', + 'i', + 'em', + 'strong', + 'p', + 'br', + 'div', + 'span', + 'img', + 'ul', + 'ol', + 'li', + 'h1', + 'h2', + 'h3', + 'h4', + 'h5', + 'h6', + 'blockquote', + 'code', + 'pre', + 'table', + 'thead', + 'tbody', + 'tr', + 'th', + 'td', + 's', + 'hr', ], ALLOWED_ATTR: [ - 'href', 'target', 'rel', 'class', 'src', 'alt', 'title', - 'width', 'height', 'style', 'align', 'valign', 'colspan', 'rowspan', 'border', 'cellpadding', 'cellspacing', 'data-url' + 'href', + 'target', + 'rel', + 'class', + 'src', + 'alt', + 'title', + 'width', + 'height', + 'style', + 'align', + 'valign', + 'colspan', + 'rowspan', + 'border', + 'cellpadding', + 'cellspacing', + 'data-url', ], - }).replace(/]*data-url="qortal:\/\/use-embed\/[^"]*"[^>]*>.*?<\/span>/g, ''); - }, [htmlContent]) + }).replace( + /]*data-url="qortal:\/\/use-embed\/[^"]*"[^>]*>.*?<\/span>/g, + '' + ); + }, [htmlContent]); const handleClick = async (e) => { e.preventDefault(); @@ -98,7 +144,7 @@ export const MessageDisplay = ({ htmlContent, isReply }) => { const target = e.target; if (target.tagName === 'A') { const href = target.getAttribute('href'); - if(window?.electronAPI){ + if (window?.electronAPI) { window.electronAPI.openExternal(href); } else { window.open(href, '_system'); @@ -106,32 +152,33 @@ export const MessageDisplay = ({ htmlContent, isReply }) => { } else if (target.getAttribute('data-url')) { const url = target.getAttribute('data-url'); - let copyUrl = url + let copyUrl = url; - try { - copyUrl = copyUrl.replace(/^(qortal:\/\/)/, '') - if (copyUrl.startsWith('use-')) { - // Handle the new 'use' format - const parts = copyUrl.split('/') - const type = parts[0].split('-')[1] // e.g., 'group' from 'use-group' - parts.shift() - const action = parts.length > 0 ? parts[0].split('-')[1] : null // e.g., 'invite' from 'action-invite' - parts.shift() - const idPrefix = parts.length > 0 ? parts[0].split('-')[0] : null // e.g., 'groupid' from 'groupid-321' - const id = parts.length > 0 ? parts[0].split('-')[1] : null // e.g., '321' from 'groupid-321' - if(action === 'join'){ - executeEvent("globalActionJoinGroup", { groupId: id}); - return + try { + copyUrl = copyUrl.replace(/^(qortal:\/\/)/, ''); + if (copyUrl.startsWith('use-')) { + // Handle the new 'use' format + const parts = copyUrl.split('/'); + const type = parts[0].split('-')[1]; // e.g., 'group' from 'use-group' + parts.shift(); + const action = parts.length > 0 ? parts[0].split('-')[1] : null; // e.g., 'invite' from 'action-invite' + parts.shift(); + const idPrefix = parts.length > 0 ? parts[0].split('-')[0] : null; // e.g., 'groupid' from 'groupid-321' + const id = parts.length > 0 ? parts[0].split('-')[1] : null; // e.g., '321' from 'groupid-321' + if (action === 'join') { + executeEvent('globalActionJoinGroup', { groupId: id }); + return; + } } + } catch (error) { + console.log(error); } - } catch (error) { - //error - } + const res = extractComponents(url); if (res) { const { service, name, identifier, path } = res; - executeEvent("addTab", { data: { service, name, identifier, path } }); - executeEvent("open-apps-mode", { }); + executeEvent('addTab', { data: { service, name, identifier, path } }); + executeEvent('open-apps-mode', {}); } } }; @@ -141,19 +188,24 @@ export const MessageDisplay = ({ htmlContent, isReply }) => { let embedData = null; if (embedLink) { - embedData = embedLink[0] + embedData = embedLink[0]; } return ( - <> - {embedLink && ( - - )} -
- + + {embedLink && } +
+ ); }; diff --git a/src/components/Chat/MessageItem.tsx b/src/components/Chat/MessageItem.tsx index 06db7f8..7b80ccd 100644 --- a/src/components/Chat/MessageItem.tsx +++ b/src/components/Chat/MessageItem.tsx @@ -1,591 +1,796 @@ -import { Message } from "@chatscope/chat-ui-kit-react"; -import React, { useCallback, useContext, useEffect, useMemo, useState } from "react"; -import { useInView } from "react-intersection-observer"; -import { MessageDisplay } from "./MessageDisplay"; -import { Avatar, Box, Button, ButtonBase, List, ListItem, ListItemText, Popover, Tooltip, Typography } from "@mui/material"; -import { formatTimestamp } from "../../utils/time"; -import { getBaseApi } from "../../background"; -import { MyContext, getBaseApiReact } from "../../App"; -import { generateHTML } from "@tiptap/react"; -import Highlight from "@tiptap/extension-highlight"; -import Mention from "@tiptap/extension-mention"; -import StarterKit from "@tiptap/starter-kit"; -import Underline from "@tiptap/extension-underline"; -import { executeEvent } from "../../utils/events"; -import { WrapperUserAction } from "../WrapperUserAction"; -import ReplyIcon from "@mui/icons-material/Reply"; -import { Spacer } from "../../common/Spacer"; -import { ReactionPicker } from "../ReactionPicker"; +import { + memo, + useCallback, + useContext, + useEffect, + useMemo, + useState, +} from 'react'; +import { useInView } from 'react-intersection-observer'; +import { MessageDisplay } from './MessageDisplay'; +import { + Avatar, + Box, + Button, + ButtonBase, + List, + ListItem, + ListItemText, + Popover, + Tooltip, + Typography, + useTheme, +} from '@mui/material'; +import { formatTimestamp } from '../../utils/time'; +import { QORTAL_APP_CONTEXT, getBaseApiReact } from '../../App'; +import { generateHTML } from '@tiptap/react'; +import Highlight from '@tiptap/extension-highlight'; +import Mention from '@tiptap/extension-mention'; +import StarterKit from '@tiptap/starter-kit'; +import Underline from '@tiptap/extension-underline'; +import { WrapperUserAction } from '../WrapperUserAction'; +import ReplyIcon from '@mui/icons-material/Reply'; +import { Spacer } from '../../common/Spacer'; +import { ReactionPicker } from '../ReactionPicker'; import KeyOffIcon from '@mui/icons-material/KeyOff'; import EditIcon from '@mui/icons-material/Edit'; import TextStyle from '@tiptap/extension-text-style'; -import { addressInfoKeySelector } from "../../atoms/global"; -import { useRecoilValue } from "recoil"; -import level0Img from "../../assets/badges/level-0.png" -import level1Img from "../../assets/badges/level-1.png" -import level2Img from "../../assets/badges/level-2.png" -import level3Img from "../../assets/badges/level-3.png" -import level4Img from "../../assets/badges/level-4.png" -import level5Img from "../../assets/badges/level-5.png" -import level6Img from "../../assets/badges/level-6.png" -import level7Img from "../../assets/badges/level-7.png" -import level8Img from "../../assets/badges/level-8.png" -import level9Img from "../../assets/badges/level-9.png" -import level10Img from "../../assets/badges/level-10.png" +import level0Img from '../../assets/badges/level-0.png'; +import level1Img from '../../assets/badges/level-1.png'; +import level2Img from '../../assets/badges/level-2.png'; +import level3Img from '../../assets/badges/level-3.png'; +import level4Img from '../../assets/badges/level-4.png'; +import level5Img from '../../assets/badges/level-5.png'; +import level6Img from '../../assets/badges/level-6.png'; +import level7Img from '../../assets/badges/level-7.png'; +import level8Img from '../../assets/badges/level-8.png'; +import level9Img from '../../assets/badges/level-9.png'; +import level10Img from '../../assets/badges/level-10.png'; +import { Embed } from '../Embeds/Embed'; +import CommentsDisabledIcon from '@mui/icons-material/CommentsDisabled'; +import { + buildImageEmbedLink, + isHtmlString, + messageHasImage, +} from '../../utils/chat'; +import { useTranslation } from 'react-i18next'; +import { ReactionsMap } from './ChatList'; -const getBadgeImg = (level)=> { - switch(level?.toString()){ - - case '0': return level0Img - case '1': return level1Img - case '2': return level2Img - case '3': return level3Img - case '4': return level4Img - case '5': return level5Img - case '6': return level6Img - case '7': return level7Img - case '8': return level8Img - case '9': return level9Img - case '10': return level10Img - default: return level0Img +const getBadgeImg = (level) => { + switch (level?.toString()) { + case '0': + return level0Img; + case '1': + return level1Img; + case '2': + return level2Img; + case '3': + return level3Img; + case '4': + return level4Img; + case '5': + return level5Img; + case '6': + return level6Img; + case '7': + return level7Img; + case '8': + return level8Img; + case '9': + return level9Img; + case '10': + return level10Img; + default: + return level0Img; } -} -export const MessageItem = React.memo(({ - message, - onSeen, +}; + +const UserBadge = memo(({ userInfo }) => { + return ( + + + + ); +}); + +type MessageItemProps = { + handleReaction: (reaction: string, messageId: string) => void; + isLast: boolean; + isPrivate: boolean; + isShowingAsReply?: boolean; + isTemp: boolean; + isUpdating: boolean; + lastSignature: string; + message: string; + myAddress: string; + onEdit: (messageId: string) => void; + onReply: (messageId: string) => void; + onSeen: () => void; + reactions: ReactionsMap | null; + reply: string | null; + replyIndex: number; + scrollToItem: (index: number) => void; +}; + +export const MessageItemComponent = ({ + handleReaction, isLast, - isTemp, - myAddress, - onReply, + isPrivate, isShowingAsReply, + isTemp, + isUpdating, + lastSignature, + message, + myAddress, + onEdit, + onReply, + onSeen, + reactions, reply, replyIndex, scrollToItem, - handleReaction, - reactions, - isUpdating, - lastSignature, - onEdit, - isPrivate -}) => { - -const {getIndividualUserInfo} = useContext(MyContext) +}: MessageItemProps) => { + const { getIndividualUserInfo } = useContext(QORTAL_APP_CONTEXT); const [anchorEl, setAnchorEl] = useState(null); const [selectedReaction, setSelectedReaction] = useState(null); - const [userInfo, setUserInfo] = useState(null) + const [userInfo, setUserInfo] = useState(null); + useEffect(() => { + const getInfo = async () => { + if (!message?.sender) return; + try { + const res = await getIndividualUserInfo(message?.sender); + if (!res) return null; + setUserInfo(res); + } catch (error) { + // + } + }; -useEffect(()=> { - const getInfo = async ()=> { - if(!message?.sender) return - try { - const res = await getIndividualUserInfo(message?.sender) - if(!res) return null - setUserInfo(res) - } catch (error) { - // + getInfo(); + }, [message?.sender, getIndividualUserInfo]); + + const htmlText = useMemo(() => { + if (message?.messageText) { + const isHtml = isHtmlString(message?.messageText); + if (isHtml) return message?.messageText; + return generateHTML(message?.messageText, [ + StarterKit, + Underline, + Highlight, + Mention, + TextStyle, + ]); } - } + }, [message?.editTimestamp]); - getInfo() -}, [message?.sender, getIndividualUserInfo]) + const htmlReply = useMemo(() => { + if (reply?.messageText) { + const isHtml = isHtmlString(reply?.messageText); + if (isHtml) return reply?.messageText; + return generateHTML(reply?.messageText, [ + StarterKit, + Underline, + Highlight, + Mention, + TextStyle, + ]); + } + }, [reply?.editTimestamp]); -const htmlText = useMemo(()=> { - - if(message?.messageText){ + const userAvatarUrl = useMemo(() => { + return message?.senderName + ? `${getBaseApiReact()}/arbitrary/THUMBNAIL/${ + message?.senderName + }/qortal_avatar?async=true` + : ''; + }, []); + + const onSeenFunc = useCallback(() => { + onSeen(message.id); + }, [message?.id]); + + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + + const hasNoMessage = + (!message.decryptedData?.data?.message || + message.decryptedData?.data?.message === '

') && + (message?.images || [])?.length === 0 && + (!message?.messageText || message?.messageText === '

') && + (!message?.text || message?.text === '

'); + + return ( + <> + {message?.divide && ( +
+ {t('core:message.generic.unread_messages', { + postProcess: 'capitalizeFirstChar', + })} +
+ )} + + + + {isShowingAsReply ? ( + + ) : ( + + + + {message?.senderName?.charAt(0)} + + + + + )} + + + + + + {message?.senderName || message?.sender} + + + + + {message?.sender === myAddress && + (!message?.isNotEncrypted || isPrivate === false) && ( + { + onEdit(message); + }} + > + + + )} + + {!isShowingAsReply && ( + { + onReply(message); + }} + > + + + )} + + {!isShowingAsReply && handleReaction && ( + { + if ( + reactions && + reactions[val] && + reactions[val]?.find( + (item) => item?.sender === myAddress + ) + ) { + handleReaction(val, message, false); + } else { + handleReaction(val, message, true); + } + }} + /> + )} + + + + {reply && ( + <> + + + { + scrollToItem(replyIndex); + }} + > + + + + + {t('core:message.generic.replied_to', { + person: reply?.senderName || reply?.senderAddress, + postProcess: 'capitalizeFirstChar', + })} + + + {reply?.messageText && ( + + )} + + {reply?.decryptedData?.type === 'notification' ? ( + + ) : ( + + )} + + + + )} + + {htmlText && !hasNoMessage && ( + + )} + + {message?.decryptedData?.type === 'notification' ? ( + + ) : hasNoMessage ? null : ( + + )} + {hasNoMessage && ( + + + + {t('core:message.generic.no_message', { + postProcess: 'capitalizeFirstChar', + })} + + + )} + {message?.images && messageHasImage(message) && ( + + )} + + + + {reactions && + Object.keys(reactions).map((reaction) => { + const numberOfReactions = reactions[reaction]?.length; + if (numberOfReactions === 0) return null; + return ( + { + event.stopPropagation(); // Prevent event bubbling + setAnchorEl(event.currentTarget); + setSelectedReaction(reaction); + }} + > +
+ {reaction} +
{' '} + {numberOfReactions > 1 && ( + + {numberOfReactions} + + )} +
+ ); + })} +
+ + {selectedReaction && ( + { + setAnchorEl(null); + setSelectedReaction(null); + }} + anchorOrigin={{ + vertical: 'top', + horizontal: 'center', + }} + transformOrigin={{ + vertical: 'bottom', + horizontal: 'center', + }} + slotProps={{ + paper: { + style: { + backgroundColor: theme.palette.background.default, + color: theme.palette.text.primary, + }, + }, + }} + > + + + {t('core:message.generic.people_reaction', { + reaction: selectedReaction, + postProcess: 'capitalizeFirstChar', + })} + + + + {reactions[selectedReaction]?.map((reactionItem) => ( + + + + ))} + + + + + + )} + + + {message?.isNotEncrypted && isPrivate && ( + + )} + + {isUpdating ? ( + + {message?.status === 'failed-permanent' + ? t('core:message.error.update_failed', { + postProcess: 'capitalizeFirstChar', + }) + : t('core:message.generic.updating', { + postProcess: 'capitalizeFirstChar', + })} + + ) : isTemp ? ( + + {message?.status === 'failed-permanent' + ? t('core:message.error.send_failed', { + postProcess: 'capitalizeFirstChar', + }) + : t('core:message.generic.sending', { + postProcess: 'capitalizeFirstChar', + })} + + ) : ( + <> + {message?.isEdit && ( + + {t('core:message.generic.edited', { + postProcess: 'capitalizeFirstChar', + })} + + )} + + + {formatTimestamp(message.timestamp)} + + + )} + +
+
+
+
+ + ); +}; + +const MemoizedMessageItem = memo(MessageItemComponent); +MemoizedMessageItem.displayName = 'MessageItem'; // It ensures React DevTools shows MessageItem as the name (instead of "Anonymous" or "Memo") + +export const MessageItem = MemoizedMessageItem; + +export const ReplyPreview = ({ message, isEdit = false }) => { + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + + const replyMessageText = useMemo(() => { + if (!message?.messageText) return null; + const isHtml = isHtmlString(message?.messageText); + if (isHtml) return message?.messageText; return generateHTML(message?.messageText, [ StarterKit, Underline, Highlight, Mention, - TextStyle - ]) - } - -}, [message?.editTimestamp]) - - - -const htmlReply = useMemo(()=> { - - if(reply?.messageText){ - return generateHTML(reply?.messageText, [ - StarterKit, - Underline, - Highlight, - Mention, - TextStyle - ]) - } - -}, [reply?.editTimestamp]) - -const userAvatarUrl = useMemo(()=> { - return message?.senderName ? `${getBaseApiReact()}/arbitrary/THUMBNAIL/${ - message?.senderName - }/qortal_avatar?async=true` : '' -}, []) - -const onSeenFunc = useCallback(()=> { - onSeen(message.id); -}, [message?.id]) - - - return ( - <> - {message?.divide && ( -
- Unread messages below -
- )} - - - - -
- {isShowingAsReply ? ( - - ) : ( - - - - - {message?.senderName?.charAt(0)} - - - - - - - - - - - )} - - - - - - {message?.senderName || message?.sender} - - - - - {message?.sender === myAddress && (!message?.isNotEncrypted || isPrivate === false) && ( - { - onEdit(message); - }} - > - - - )} - {!isShowingAsReply && ( - { - onReply(message); - }} - > - - - )} - {!isShowingAsReply && handleReaction && ( - { - - if(reactions && reactions[val] && reactions[val]?.find((item)=> item?.sender === myAddress)){ - handleReaction(val, message, false) - } else { - handleReaction(val, message, true) - } - - }} /> - )} - - - {reply && ( - <> - - { - scrollToItem(replyIndex) - - - }} - > - - - Replied to {reply?.senderName || reply?.senderAddress} - {reply?.messageText && ( - - )} - {reply?.decryptedData?.type === "notification" ? ( - - ) : ( - - )} - - - - )} - {htmlText && ( - - )} - - - {message?.decryptedData?.type === "notification" ? ( - - ) : ( - - )} - - - {reactions && Object.keys(reactions).map((reaction)=> { - const numberOfReactions = reactions[reaction]?.length - // const myReaction = reactions - if(numberOfReactions === 0) return null - return ( - { - event.stopPropagation(); // Prevent event bubbling - setAnchorEl(event.currentTarget); - setSelectedReaction(reaction); - }}> -
{reaction}
{numberOfReactions > 1 && ( - {' '} {numberOfReactions} - )} -
- ) - })} -
- {selectedReaction && ( - { - setAnchorEl(null); - setSelectedReaction(null); - }} - anchorOrigin={{ - vertical: "top", - horizontal: "center", - }} - transformOrigin={{ - vertical: "bottom", - horizontal: "center", - }} - PaperProps={{ - style: { - backgroundColor: "#232428", - color: "white", - }, - }} - > - - - People who reacted with {selectedReaction} - - - {reactions[selectedReaction]?.map((reactionItem) => ( - - - - ))} - - - - - )} - - {message?.isNotEncrypted && isPrivate && ( - - )} - - {isUpdating ? ( - - {message?.status === 'failed-permanent' ? 'Failed to update' : 'Updating...'} - - ) : isTemp ? ( - - {message?.status === 'failed-permanent' ? 'Failed to send' : 'Sending...'} - - ) : ( - <> - {message?.isEdit && ( - - Edited - - )} - - {formatTimestamp(message.timestamp)} - - - )} - -
-
- - -
-
- - ); -}); - - -export const ReplyPreview = ({message, isEdit})=> { + TextStyle, + ]); + }, [message?.messageText]); return ( + + {isEdit ? ( + - - - {isEdit ? ( - Editing Message - ) : ( - Replied to {message?.senderName || message?.senderAddress} - )} - - {message?.messageText && ( - - )} - {message?.decryptedData?.type === "notification" ? ( - - ) : ( - - )} - - - - ) -} + {t('core:message.generic.editing_message', { + postProcess: 'capitalizeFirstChar', + })} + + ) : ( + + {t('core:message.generic.replied_to', { + person: message?.senderName || message?.senderAddress, + postProcess: 'capitalizeFirstChar', + })} + + )} -const MessageWragger = ({lastMessage, onSeen, isLast, children})=> { + {replyMessageText && } - if(lastMessage){ + {message?.decryptedData?.type === 'notification' ? ( + + ) : ( + + )} + + + ); +}; + +const MessageWragger = ({ lastMessage, onSeen, isLast, children }) => { + if (lastMessage) { return ( - {children} - ) + + {children} + + ); } - return children -} + return children; +}; -const WatchComponent = ({onSeen, isLast, children})=> { +const WatchComponent = ({ onSeen, isLast, children }) => { const { ref, inView } = useInView({ threshold: 0.7, // Fully visible triggerOnce: true, // Only trigger once when it becomes visible + delay: 100, + trackVisibility: false, }); useEffect(() => { if (inView && isLast && onSeen) { - onSeen(); + setTimeout(() => { + onSeen(); + }, 100); } }, [inView, isLast, onSeen]); - return
- {children} -
- -} \ No newline at end of file + return ( +
+ {children} +
+ ); +}; diff --git a/src/components/Chat/ResizableImage.tsx b/src/components/Chat/ResizableImage.tsx index 8c29292..881c1d7 100644 --- a/src/components/Chat/ResizableImage.tsx +++ b/src/components/Chat/ResizableImage.tsx @@ -1,8 +1,10 @@ -import React, { useRef } from 'react'; +import { useRef } from 'react'; import { NodeViewWrapper } from '@tiptap/react'; +import { useTheme } from '@mui/material'; const ResizableImage = ({ node, updateAttributes, selected }) => { const imgRef = useRef(null); + const theme = useTheme(); const startResizing = (e) => { e.preventDefault(); @@ -40,18 +42,23 @@ const ResizableImage = ({ node, updateAttributes, selected }) => { src={node.attrs.src} alt={node.attrs.alt || ''} title={node.attrs.title || ''} - style={{ width: node.attrs.width || 'auto', display: 'block', margin: '0 auto' }} + style={{ + width: node.attrs.width || 'auto', + display: 'block', + margin: '0 auto', + }} draggable={false} // Prevent image dragging /> +
{ + const { editor } = useCurrentEditor(); + const fileInputRef = useRef(null); + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); - const start = from - match[0].length; - const query = match[0]; - return { start, query }; -} -const MenuBar = ({ setEditorRef, isChat, isDisabledEditorEnter, setIsDisabledEditorEnter }) => { - const { editor } = useCurrentEditor(); - const fileInputRef = useRef(null); + useEffect(() => { + if (editor && setEditorRef) { + setEditorRef(editor); + } + }, [editor, setEditorRef]); - if (!editor) { - return null; - } - - useEffect(() => { - if (editor && setEditorRef) { - setEditorRef(editor); + if (!editor) { + return null; } - }, [editor, setEditorRef]); - const handleImageUpload = async (file) => { - let compressedFile; - await new Promise((resolve) => { - new Compressor(file, { - quality: 0.6, - maxWidth: 1200, - mimeType: "image/webp", - success(result) { - compressedFile = new File([result], "image.webp", { - type: "image/webp", - }); - resolve(); - }, - error(err) { - console.error("Image compression error:", err); - }, + const handleImageUpload = async (file) => { + let compressedFile; + await new Promise((resolve) => { + new Compressor(file, { + quality: 0.6, + maxWidth: 1200, + mimeType: 'image/webp', + success(result) { + compressedFile = new File([result], 'image.webp', { + type: 'image/webp', + }); + resolve(); + }, + error(err) { + console.error('Image compression error:', err); + }, + }); }); - }); - if (compressedFile) { - const reader = new FileReader(); - reader.onload = () => { - const url = reader.result; - editor - .chain() - .focus() - .setImage({ src: url, style: "width: auto" }) - .run(); - fileInputRef.current.value = ""; - }; - reader.readAsDataURL(compressedFile); - } - }; + if (compressedFile) { + const reader = new FileReader(); + reader.onload = () => { + const url = reader.result; + editor + .chain() + .focus() + .setImage({ src: url, style: 'width: auto' }) + .run(); + fileInputRef.current.value = ''; + }; + reader.readAsDataURL(compressedFile); + } + }; - const triggerImageUpload = () => { - fileInputRef.current.click(); // Trigger the file input click - }; + const triggerImageUpload = () => { + fileInputRef.current.click(); // Trigger the file input click + }; - const handlePaste = (event) => { - const items = event.clipboardData.items; - for (const item of items) { - if (item.type.startsWith("image/")) { - const file = item.getAsFile(); - if (file) { - event.preventDefault(); // Prevent the default paste behavior - handleImageUpload(file); // Call the image upload function + const handlePaste = (event) => { + const items = event.clipboardData.items; + for (const item of items) { + if (item.type.startsWith('image/')) { + const file = item.getAsFile(); + if (file) { + event.preventDefault(); // Prevent the default paste behavior + handleImageUpload(file); // Call the image upload function + } } } - } - }; + }; - useEffect(() => { - if (editor) { - editor.view.dom.addEventListener("paste", handlePaste); - return () => { - editor.view.dom.removeEventListener("paste", handlePaste); - }; - } - }, [editor]); + useEffect(() => { + if (editor && !isChat) { + editor.view.dom.addEventListener('paste', handlePaste); + return () => { + editor.view.dom.removeEventListener('paste', handlePaste); + }; + } + }, [editor, isChat]); - return ( -
-
- editor.chain().focus().toggleBold().run()} - disabled={!editor.can().chain().focus().toggleBold().run()} - sx={{ - color: editor.isActive("bold") ? "white" : "gray", - padding: isMobile ? "5px" : "revert", + return ( +
+
- - - editor.chain().focus().toggleItalic().run()} - disabled={!editor.can().chain().focus().toggleItalic().run()} - sx={{ - color: editor.isActive("italic") ? "white" : "gray", - padding: isMobile ? "5px" : "revert", - }} - > - - - editor.chain().focus().toggleStrike().run()} - disabled={!editor.can().chain().focus().toggleStrike().run()} - sx={{ - color: editor.isActive("strike") ? "white" : "gray", - padding: isMobile ? "5px" : "revert", - }} - > - - - editor.chain().focus().toggleCode().run()} - disabled={!editor.can().chain().focus().toggleCode().run()} - sx={{ - color: editor.isActive("code") ? "white" : "gray", - padding: isMobile ? "5px" : "revert", - }} - > - - - editor.chain().focus().unsetAllMarks().run()} - sx={{ - color: - editor.isActive("bold") || - editor.isActive("italic") || - editor.isActive("strike") || - editor.isActive("code") - ? "white" - : "gray", - padding: isMobile ? "5px" : "revert", - }} - > - - - editor.chain().focus().toggleBulletList().run()} - sx={{ - color: editor.isActive("bulletList") ? "white" : "gray", - padding: isMobile ? "5px" : "revert", - }} - > - - - editor.chain().focus().toggleOrderedList().run()} - sx={{ - color: editor.isActive("orderedList") ? "white" : "gray", - padding: isMobile ? "5px" : "revert", - }} - > - - - editor.chain().focus().toggleCodeBlock().run()} - sx={{ - color: editor.isActive("codeBlock") ? "white" : "gray", - padding: isMobile ? "5px" : "revert", - }} - > - - - editor.chain().focus().toggleBlockquote().run()} - sx={{ - color: editor.isActive("blockquote") ? "white" : "gray", - padding: isMobile ? "5px" : "revert", - }} - > - - - editor.chain().focus().setHorizontalRule().run()} - disabled={!editor.can().chain().focus().setHorizontalRule().run()} - sx={{ color: "gray", padding: isMobile ? "5px" : "revert" }} - > - - - - editor.chain().focus().toggleHeading({ level: 1 }).run() - } - sx={{ - color: editor.isActive("heading", { level: 1 }) ? "white" : "gray", - padding: isMobile ? "5px" : "revert", - }} - > - - - editor.chain().focus().undo().run()} - disabled={!editor.can().chain().focus().undo().run()} - sx={{ color: "gray", padding: isMobile ? "5px" : "revert" }} - > - - - editor.chain().focus().redo().run()} - disabled={!editor.can().chain().focus().redo().run()} - sx={{ color: "gray" }} - > - - - {isChat && ( - { - setIsDisabledEditorEnter(!isDisabledEditorEnter) - }} - > - - editor.chain().focus().toggleBold().run()} + disabled={!editor.can().chain().focus().toggleBold().run()} + sx={{ + color: editor.isActive('bold') + ? theme.palette.text.primary + : theme.palette.text.secondary, + padding: 'revert', + }} + > + + + + editor.chain().focus().toggleItalic().run()} + disabled={!editor.can().chain().focus().toggleItalic().run()} + sx={{ + color: editor.isActive('italic') + ? theme.palette.text.primary + : theme.palette.text.secondary, + padding: 'revert', + }} + > + + + + editor.chain().focus().toggleStrike().run()} + disabled={!editor.can().chain().focus().toggleStrike().run()} + sx={{ + color: editor.isActive('strike') + ? theme.palette.text.primary + : theme.palette.text.secondary, + padding: 'revert', + }} + > + + + + editor.chain().focus().toggleCode().run()} + disabled={!editor.can().chain().focus().toggleCode().run()} + sx={{ + color: editor.isActive('code') + ? theme.palette.text.primary + : theme.palette.text.secondary, + padding: 'revert', + }} + > + + + + editor.chain().focus().unsetAllMarks().run()} + sx={{ + color: + editor.isActive('bold') || + editor.isActive('italic') || + editor.isActive('strike') || + editor.isActive('code') + ? theme.palette.text.primary + : theme.palette.text.secondary, + padding: 'revert', + }} + > + + + + editor.chain().focus().toggleBulletList().run()} + sx={{ + color: editor.isActive('bulletList') + ? theme.palette.text.primary + : theme.palette.text.secondary, + padding: 'revert', + }} + > + + + + editor.chain().focus().toggleOrderedList().run()} + sx={{ + color: editor.isActive('orderedList') + ? theme.palette.text.primary + : theme.palette.text.secondary, + padding: 'revert', + }} + > + + + + editor.chain().focus().toggleCodeBlock().run()} + sx={{ + color: editor.isActive('codeBlock') + ? theme.palette.text.primary + : theme.palette.text.secondary, + padding: 'revert', + }} + > + + + + editor.chain().focus().toggleBlockquote().run()} + sx={{ + color: editor.isActive('blockquote') + ? theme.palette.text.primary + : theme.palette.text.secondary, + padding: 'revert', + }} + > + + + + editor.chain().focus().setHorizontalRule().run()} + disabled={!editor.can().chain().focus().setHorizontalRule().run()} + sx={{ color: 'gray', padding: 'revert' }} + > + + + + + editor.chain().focus().toggleHeading({ level: 1 }).run() + } + sx={{ + color: editor.isActive('heading', { level: 1 }) + ? theme.palette.text.primary + : theme.palette.text.secondary, + padding: 'revert', + }} + > + + + + editor.chain().focus().undo().run()} + disabled={!editor.can().chain().focus().undo().run()} + sx={{ color: 'gray', padding: 'revert' }} + > + + + + editor.chain().focus().redo().run()} + disabled={!editor.can().chain().focus().redo().run()} + sx={{ color: 'gray' }} + > + + + + {isChat && ( + { + setIsDisabledEditorEnter(!isDisabledEditorEnter); + }} + > + + - disable enter + {t('core:action.disable_enter', { + postProcess: 'capitalizeFirstChar', + })} - - )} - {!isChat && ( - <> - - - - handleImageUpload(event.target.files[0])} - accept="image/*" - /> - - )} + + )} + + {!isChat && ( + <> + + + + + handleImageUpload(event.target.files[0])} + accept="image/*" + /> + + )} +
-
- ); -}; + ); + } +); const extensions = [ + TextStyle, Color.configure({ types: [TextStyle.name, ListItem.name] }), - TextStyle.configure({ types: [ListItem.name] }), StarterKit.configure({ bulletList: { keepMarks: true, @@ -322,77 +364,114 @@ const extensions = [ }, }), Placeholder.configure({ - placeholder: "Start typing here...", + placeholder: i18n.t('core:action.start_typing', { + postProcess: 'capitalizeFirstChar', + }), }), ImageResize, ]; const content = ``; -export default ({ +type TiptapProps = { + setEditorRef: (editorInstance: Editor | null) => void; + onEnter: () => void | Promise; + disableEnter?: boolean; + isChat?: boolean; + maxHeightOffset?: number; + overrideMobile?: boolean; + customEditorHeight?: number | null; + setIsFocusedParent: React.Dispatch>; + isFocusedParent: boolean; + membersWithNames: unknown[]; + enableMentions?: boolean; + insertImage: (image: any) => void; +}; + +const Tiptap = ({ setEditorRef, onEnter, - disableEnter, - isChat, + disableEnter = false, + isChat = false, maxHeightOffset, setIsFocusedParent, isFocusedParent, overrideMobile, customEditorHeight, membersWithNames, - enableMentions -}) => { - const [isDisabledEditorEnter, setIsDisabledEditorEnter] = useRecoilState(isDisabledEditorEnterAtom) + enableMentions, + insertImage, +}: TiptapProps) => { + const theme = useTheme(); + const [isDisabledEditorEnter, setIsDisabledEditorEnter] = useAtom( + isDisabledEditorEnterAtom + ); + + const handleImageUpload = useCallback( + async (file) => { + try { + if (!file.type.includes('image')) return; + let compressedFile = file; + if (file.type !== 'image/gif') { + await new Promise((resolve) => { + new Compressor(file, { + quality: 0.6, + maxWidth: 1200, + mimeType: 'image/webp', + success(result) { + compressedFile = result; + resolve(); + }, + error(err) { + console.error('Image compression error:', err); + }, + }); + }); + } + + if (compressedFile) { + const toBase64 = await fileToBase64(compressedFile); + insertImage(toBase64); + } + } catch (error) { + console.error(error); + } + }, + [insertImage] + ); const extensionsFiltered = isChat - ? extensions.filter((item) => item?.name !== "image") + ? extensions.filter((item) => item?.name !== 'image') : extensions; const editorRef = useRef(null); - const setEditorRefFunc = (editorInstance) => { + const setEditorRefFunc = useCallback((editorInstance) => { editorRef.current = editorInstance; setEditorRef(editorInstance); - }; + }, []); - // const users = [ - // { id: 1, label: 'Alice' }, - // { id: 2, label: 'Bob' }, - // { id: 3, label: 'Charlie' }, - // ]; - - - - const users = useMemo(()=> { - return (membersWithNames || [])?.map((item)=> { + const users = useMemo(() => { + return (membersWithNames || [])?.map((item) => { return { id: item, - label: item - } - }) - }, [membersWithNames]) - - - - + label: item, + }; + }); + }, [membersWithNames]); const usersRef = useRef([]); useEffect(() => { usersRef.current = users; // Keep users up-to-date }, [users]); - const handleFocus = () => { - if (!isMobile) return; - setIsFocusedParent(true); - }; - const handleBlur = () => { const htmlContent = editorRef.current.getHTML(); - if (!htmlContent?.trim() || htmlContent?.trim() === "

") { + if (!htmlContent?.trim() || htmlContent?.trim() === '

') { // Set focus state based on content } }; - const additionalExtensions = useMemo(()=> { - if(!enableMentions) return [] + const additionalExtensions = useMemo(() => { + if (!enableMentions) return []; return [ Mention.configure({ HTMLAttributes: { @@ -409,122 +488,145 @@ export default ({ let popup; // Reference to the Tippy.js instance let component; - return { - onStart: props => { - component = new ReactRenderer(MentionList, { - props, - editor: props.editor, - }) - - if (!props.clientRect) { - return - } - - popup = tippy('body', { - getReferenceClientRect: props.clientRect, - appendTo: () => document.body, - content: component.element, - showOnCreate: true, - interactive: true, - trigger: 'manual', - placement: 'bottom-start', - }) - }, - - onUpdate(props) { - component.updateProps(props) - - if (!props.clientRect) { - return - } - - popup[0].setProps({ - getReferenceClientRect: props.clientRect, - }) - }, - - onKeyDown(props) { - if (props.event.key === 'Escape') { - popup[0].hide() - - return true - } - - return component.ref?.onKeyDown(props) - }, - - onExit() { - popup[0].destroy() - component.destroy() - }, - } + return { + onStart: (props) => { + component = new ReactRenderer(MentionList, { + props, + editor: props.editor, + }); + + if (!props.clientRect) { + return; + } + + popup = tippy('body', { + getReferenceClientRect: props.clientRect, + appendTo: () => document.body, + content: component.element, + showOnCreate: true, + interactive: true, + trigger: 'manual', + placement: 'bottom-start', + }); + }, + + onUpdate(props) { + component.updateProps(props); + + if (!props.clientRect) { + return; + } + + popup[0].setProps({ + getReferenceClientRect: props.clientRect, + }); + }, + + onKeyDown(props) { + if (props.event.key === 'Escape') { + popup[0].hide(); + + return true; + } + + return component.ref?.onKeyDown(props); + }, + + onExit() { + popup[0].destroy(); + component.destroy(); + }, + }; }, }, - }) - ] - }, [enableMentions]) + }), + ]; + }, [enableMentions]); - const handleSetIsDisabledEditorEnter = useCallback((val)=> { - setIsDisabledEditorEnter(val) + const handleSetIsDisabledEditorEnter = useCallback((val) => { + setIsDisabledEditorEnter(val); localStorage.setItem('settings-disable-editor-enter', JSON.stringify(val)); - - }, []) - + }, []); return ( -
- - ) - } - extensions={[...extensionsFiltered, ...additionalExtensions - ]} - content={content} - onCreate={({ editor }) => { - editor.on("focus", handleFocus); // Listen for focus event - editor.on("blur", handleBlur); // Listen for blur event + { - editor.on('focus', handleFocus); // Ensure focus is updated - editor.on('blur', handleBlur); // Ensure blur is updated - }} - editorProps={{ - attributes: { - class: "tiptap-prosemirror", - style: - isMobile ? - `overflow: auto; min-height: ${ - customEditorHeight ? "200px" : "0px" - }; max-height:calc(100svh - ${customEditorHeight || "140px"})`: `overflow: auto; max-height: 250px`, - }, - handleKeyDown(view, event) { - if (!disableEnter && !isDisabledEditorEnter && event.key === "Enter") { - if (event.shiftKey) { - view.dispatch( - view.state.tr.replaceSelectionWith( - view.state.schema.nodes.hardBreak.create() - ) - ); - return true; - } else { - if (typeof onEnter === "function") { - onEnter(); + > + + } + extensions={[...extensionsFiltered, ...additionalExtensions]} + content={content} + onCreate={({ editor }) => { + editor.on('blur', handleBlur); // Listen for blur event + }} + onUpdate={({ editor }) => { + editor.on('blur', handleBlur); // Ensure blur is updated + }} + editorProps={{ + attributes: { + class: 'tiptap-prosemirror', + style: `overflow: auto; max-height: 250px`, + }, + handleKeyDown(view, event) { + if ( + !disableEnter && + !isDisabledEditorEnter && + event.key === 'Enter' + ) { + if (event.shiftKey) { + view.dispatch( + view.state.tr.replaceSelectionWith( + view.state.schema.nodes.hardBreak.create() + ) + ); + return true; + } else { + if (typeof onEnter === 'function') { + onEnter(); + } + return true; } - return true; } - } - return false; - }, - }} - /> -
+ return false; + }, + handlePaste(view, event) { + if (!isChat) return; + const items = event.clipboardData?.items; + if (!items) return false; + for (const item of items) { + if (item.type.startsWith('image/')) { + const file = item.getAsFile(); + if (file) { + event.preventDefault(); // Block the default paste + handleImageUpload(file); // Custom handler + return true; // Let ProseMirror know we handled it + } + } + } + + return false; // fallback to default behavior otherwise + }, + }} + /> + ); }; + +export default Tiptap; diff --git a/src/components/Chat/styles.css b/src/components/Chat/chat.css similarity index 66% rename from src/components/Chat/styles.css rename to src/components/Chat/chat.css index 3c7c570..d563d85 100644 --- a/src/components/Chat/styles.css +++ b/src/components/Chat/chat.css @@ -1,6 +1,6 @@ .tiptap { margin-top: 0; - color: white; /* Set default font color to white */ + color: var(--text-primary); width: 100%; } @@ -26,7 +26,7 @@ line-height: 1.1; margin-top: 2.5rem; text-wrap: pretty; - color: white; /* Ensure heading font color is white */ + color: var(--text-primary); } .tiptap h1, @@ -55,18 +55,18 @@ /* Code and preformatted text styles */ .tiptap code { - background-color: #27282c; /* Set code background color to #27282c */ + background-color: var(--background-default); border-radius: 0.4rem; - color: white; /* Ensure inline code text color is white */ + color: var(--text-primary); font-size: 0.85rem; padding: 0.25em 0.3em; text-wrap: pretty; } .tiptap pre { - background: #27282c; /* Set code block background color to #27282c */ + background: var(--background-default); border-radius: 0.5rem; - color: white; /* Ensure code block text color is white */ + color: var(--text-primary); font-family: 'JetBrainsMono', monospace; margin: 1.5rem 0; padding: 0.75rem 1rem; @@ -86,7 +86,7 @@ border-left: 3px solid var(--gray-3); margin: 1.5rem 0; padding-left: 1rem; - color: white; /* Ensure blockquote text color is white */ + color: var(--text-primary); text-wrap: pretty; } @@ -102,49 +102,49 @@ .tiptap p { font-size: 16px; - color: white; /* Ensure paragraph text color is white */ + color: var(--text-primary); margin: 0px; } - .tiptap p.is-editor-empty:first-child::before { - color: #adb5bd; - content: attr(data-placeholder); - float: left; - height: 0; - pointer-events: none; - } - .tiptap p:empty::before { - content: ''; - display: inline-block; - } +.tiptap p.is-editor-empty:first-child::before { + color: var(--text-primary); + content: attr(data-placeholder); + float: left; + height: 0; + pointer-events: none; +} + +.tiptap p:empty::before { + content: ''; + display: inline-block; +} .tiptap a { - color: cadetblue + color: cadetblue; } .tiptap img { display: block; - max-width: 100%; + max-width: 100%; } .isReply p { font-size: 12px !important; } -.tiptap [data-type="mention"] { +.tiptap [data-type='mention'] { box-decoration-break: clone; - color: lightblue; + color: var(--text-secondary); padding: 0.1rem 0.3rem; } - .unread-divider { + border-bottom: 1px solid var(--text-primary); + border-radius: 2px; + color: var(--text-primary); + display: flex; + justify-content: center; width: 90%; - color: white; - border-bottom: 1px solid white; - display: flex; - justify-content: center; - border-radius: 2px; } .mention-item { @@ -169,11 +169,10 @@ font-size: 16px; width: 100%; border: none; - color: white; - cursor: pointer; + color: var(--text-primary); &:hover, &:hover.is-selected { - background-color: gray; + background-color: var(--background-default); } } -} \ No newline at end of file +} diff --git a/src/components/ContextMenu.tsx b/src/components/ContextMenu.tsx index 491e1f7..a05b8fe 100644 --- a/src/components/ContextMenu.tsx +++ b/src/components/ContextMenu.tsx @@ -1,35 +1,45 @@ import React, { useState, useRef, useMemo, useEffect } from 'react'; -import { ListItemIcon, Menu, MenuItem, Typography, styled } from '@mui/material'; +import { + ListItemIcon, + Menu, + MenuItem, + Typography, + styled, + useTheme, +} from '@mui/material'; import MailOutlineIcon from '@mui/icons-material/MailOutline'; import NotificationsOffIcon from '@mui/icons-material/NotificationsOff'; import { executeEvent } from '../utils/events'; +import { mutedGroupsAtom } from '../atoms/global'; +import { useAtom } from 'jotai'; const CustomStyledMenu = styled(Menu)(({ theme }) => ({ - '& .MuiPaper-root': { - backgroundColor: '#f9f9f9', - borderRadius: '12px', - padding: theme.spacing(1), - boxShadow: '0 5px 15px rgba(0, 0, 0, 0.2)', + '& .MuiPaper-root': { + // backgroundColor: '#f9f9f9', + borderRadius: '12px', + padding: theme.spacing(1), + boxShadow: '0 5px 15px rgba(0, 0, 0, 0.2)', + }, + '& .MuiMenuItem-root': { + fontSize: '14px', // Smaller font size for the menu item text + // color: '#444', + transition: '0.3s background-color', + '&:hover': { + backgroundColor: theme.palette.action.hover, // Explicit hover state }, - '& .MuiMenuItem-root': { - fontSize: '14px', // Smaller font size for the menu item text - color: '#444', - transition: '0.3s background-color', - '&:hover': { - backgroundColor: '#f0f0f0', // Explicit hover state - }, - - }, - })); + }, +})); -export const ContextMenu = ({ children, groupId, getUserSettings, mutedGroups }) => { +export const ContextMenu = ({ children, groupId, getUserSettings }) => { const [menuPosition, setMenuPosition] = useState(null); const longPressTimeout = useRef(null); const preventClick = useRef(false); // Flag to prevent click after long-press or right-click + const theme = useTheme(); + const [mutedGroups] = useAtom(mutedGroupsAtom); - const isMuted = useMemo(()=> { - return mutedGroups.includes(groupId) - }, [mutedGroups, groupId]) + const isMuted = useMemo(() => { + return mutedGroups.includes(groupId); + }, [mutedGroups, groupId]); // Handle right-click (context menu) for desktop const handleContextMenu = (event) => { @@ -67,56 +77,52 @@ export const ContextMenu = ({ children, groupId, getUserSettings, mutedGroups }) } }; - - - const handleSetGroupMute = ()=> { + const handleSetGroupMute = () => { try { - let value = [...mutedGroups] - if(isMuted){ - value = value.filter((group)=> group !== groupId) - } else { - value.push(groupId) - } - window.sendMessage("addUserSettings", { + let value = [...mutedGroups]; + if (isMuted) { + value = value.filter((group) => group !== groupId); + } else { + value.push(groupId); + } + window + .sendMessage('addUserSettings', { keyValue: { key: 'mutedGroups', value, }, }) - .then((response) => { - if (response?.error) { - console.error("Error adding user settings:", response.error); - } else { - console.log("User settings added successfully"); - } - }) - .catch((error) => { - console.error("Failed to add user settings:", error.message || "An error occurred"); - }); - - setTimeout(() => { - getUserSettings() - }, 400); + .then((response) => { + if (response?.error) { + console.error('Error adding user settings:', response.error); + } else { + console.log('User settings added successfully'); + } + }) + .catch((error) => { + console.error( + 'Failed to add user settings:', + error.message || 'An error occurred' + ); + }); - } catch (error) { - - } - } - - + setTimeout(() => { + getUserSettings(); + }, 400); + } catch (error) {} + }; const handleClose = (e) => { e.preventDefault(); - e.stopPropagation(); + e.stopPropagation(); setMenuPosition(null); }; return (
{children} @@ -131,41 +137,52 @@ export const ContextMenu = ({ children, groupId, getUserSettings, mutedGroups }) ? { top: menuPosition.mouseY, left: menuPosition.mouseX } : undefined } - onClick={(e)=> { - e.stopPropagation(); - }} + onClick={(e) => { + e.stopPropagation(); + }} > - { - handleClose(e) - executeEvent("markAsRead", { - groupId - }); - }}> + { + handleClose(e); + executeEvent('markAsRead', { + groupId, + }); + }} + > - + Mark As Read - { - - handleClose(e) - handleSetGroupMute() - - }}> + { + handleClose(e); + handleSetGroupMute(); + }} + > - + - + {isMuted ? 'Unmute ' : 'Mute '}Push Notifications
); -}; - - +}; // TODO translate diff --git a/src/components/ContextMenuPinnedApps.tsx b/src/components/ContextMenuPinnedApps.tsx index bb64a4c..b7cea32 100644 --- a/src/components/ContextMenuPinnedApps.tsx +++ b/src/components/ContextMenuPinnedApps.tsx @@ -1,152 +1,188 @@ import React, { useState, useRef } from 'react'; -import { ListItemIcon, Menu, MenuItem, Typography, styled } from '@mui/material'; +import { + ListItemIcon, + Menu, + MenuItem, + Typography, + styled, + useTheme, +} from '@mui/material'; import PushPinIcon from '@mui/icons-material/PushPin'; -import { saveToLocalStorage } from './Apps/AppsNavBar'; -import { useRecoilState } from 'recoil'; +import { saveToLocalStorage } from './Apps/AppsNavBarDesktop'; import { sortablePinnedAppsAtom } from '../atoms/global'; +import { useSetAtom } from 'jotai'; const CustomStyledMenu = styled(Menu)(({ theme }) => ({ - '& .MuiPaper-root': { - backgroundColor: '#f9f9f9', - borderRadius: '12px', - padding: theme.spacing(1), - boxShadow: '0 5px 15px rgba(0, 0, 0, 0.2)', - }, - '& .MuiMenuItem-root': { - fontSize: '14px', - color: '#444', - transition: '0.3s background-color', - '&:hover': { - backgroundColor: '#f0f0f0', - }, + '& .MuiPaper-root': { + borderRadius: '12px', + padding: theme.spacing(1), + boxShadow: '0 5px 15px rgba(0, 0, 0, 0.2)', + }, + '& .MuiMenuItem-root': { + fontSize: '14px', + color: '#444', + transition: '0.3s background-color', + '&:hover': { + backgroundColor: theme.palette.action.hover, }, + }, })); export const ContextMenuPinnedApps = ({ children, app, isMine }) => { - const [menuPosition, setMenuPosition] = useState(null); - const longPressTimeout = useRef(null); - const maxHoldTimeout = useRef(null); - const preventClick = useRef(false); - const startTouchPosition = useRef({ x: 0, y: 0 }); // Track initial touch position - const [sortablePinnedApps, setSortablePinnedApps] = useRecoilState(sortablePinnedAppsAtom); + const [menuPosition, setMenuPosition] = useState(null); + const longPressTimeout = useRef(null); + const maxHoldTimeout = useRef(null); + const preventClick = useRef(false); + const startTouchPosition = useRef({ x: 0, y: 0 }); // Track initial touch position - const handleContextMenu = (event) => { - if(isMine) return - event.preventDefault(); - event.stopPropagation(); - preventClick.current = true; - setMenuPosition({ - mouseX: event.clientX, - mouseY: event.clientY, - }); - }; + const setSortablePinnedApps = useSetAtom(sortablePinnedAppsAtom); - const handleTouchStart = (event) => { - if(isMine) return + const theme = useTheme(); - const { clientX, clientY } = event.touches[0]; - startTouchPosition.current = { x: clientX, y: clientY }; + const handleContextMenu = (event) => { + if (isMine) return; + event.preventDefault(); + event.stopPropagation(); + preventClick.current = true; + setMenuPosition({ + mouseX: event.clientX, + mouseY: event.clientY, + }); + }; - longPressTimeout.current = setTimeout(() => { - preventClick.current = true; - - event.stopPropagation(); - setMenuPosition({ - mouseX: clientX, - mouseY: clientY, + const handleTouchStart = (event) => { + if (isMine) return; + + const { clientX, clientY } = event.touches[0]; + startTouchPosition.current = { x: clientX, y: clientY }; + + longPressTimeout.current = setTimeout(() => { + preventClick.current = true; + + event.stopPropagation(); + setMenuPosition({ + mouseX: clientX, + mouseY: clientY, + }); + }, 500); + + // Set a maximum hold duration (e.g., 1.5 seconds) + maxHoldTimeout.current = setTimeout(() => { + clearTimeout(longPressTimeout.current); + }, 1500); + }; + + const handleTouchMove = (event) => { + if (isMine) return; + + const { clientX, clientY } = event.touches[0]; + const { x, y } = startTouchPosition.current; + + // Determine if the touch has moved beyond a small threshold (e.g., 10px) + const movedEnough = + Math.abs(clientX - x) > 10 || Math.abs(clientY - y) > 10; + + if (movedEnough) { + clearTimeout(longPressTimeout.current); + clearTimeout(maxHoldTimeout.current); + } + }; + + const handleTouchEnd = (event) => { + if (isMine) return; + + clearTimeout(longPressTimeout.current); + clearTimeout(maxHoldTimeout.current); + if (preventClick.current) { + event.preventDefault(); + event.stopPropagation(); + preventClick.current = false; + } + }; + + const handleClose = (e) => { + if (isMine) return; + + e.preventDefault(); + e.stopPropagation(); + setMenuPosition(null); + }; + + return ( +
+ {children} + { + e.stopPropagation(); + }} + > + { + handleClose(e); + setSortablePinnedApps((prev) => { + if (app?.isPrivate) { + const updatedApps = prev.filter( + (item) => + !( + item?.privateAppProperties?.name === + app?.privateAppProperties?.name && + item?.privateAppProperties?.service === + app?.privateAppProperties?.service && + item?.privateAppProperties?.identifier === + app?.privateAppProperties?.identifier + ) + ); + saveToLocalStorage( + 'ext_saved_settings', + 'sortablePinnedApps', + updatedApps + ); + return updatedApps; + } else { + const updatedApps = prev.filter( + (item) => + !( + item?.name === app?.name && item?.service === app?.service + ) + ); + saveToLocalStorage( + 'ext_saved_settings', + 'sortablePinnedApps', + updatedApps + ); + return updatedApps; + } }); - }, 500); - - // Set a maximum hold duration (e.g., 1.5 seconds) - maxHoldTimeout.current = setTimeout(() => { - clearTimeout(longPressTimeout.current); - }, 1500); - }; - - const handleTouchMove = (event) => { - if(isMine) return - - const { clientX, clientY } = event.touches[0]; - const { x, y } = startTouchPosition.current; - - // Determine if the touch has moved beyond a small threshold (e.g., 10px) - const movedEnough = Math.abs(clientX - x) > 10 || Math.abs(clientY - y) > 10; - - if (movedEnough) { - clearTimeout(longPressTimeout.current); - clearTimeout(maxHoldTimeout.current); - } - }; - - const handleTouchEnd = (event) => { - if(isMine) return - - clearTimeout(longPressTimeout.current); - clearTimeout(maxHoldTimeout.current); - if (preventClick.current) { - event.preventDefault(); - event.stopPropagation(); - preventClick.current = false; - } - }; - - const handleClose = (e) => { - if(isMine) return - - e.preventDefault(); - e.stopPropagation(); - setMenuPosition(null); - }; - - return ( -
- {children} - { - e.stopPropagation(); - }} - > - { - handleClose(e); - setSortablePinnedApps((prev) => { - if(app?.isPrivate){ - const updatedApps = prev.filter( - (item) => !(item?.privateAppProperties?.name === app?.privateAppProperties?.name && item?.privateAppProperties?.service === app?.privateAppProperties?.service && item?.privateAppProperties?.identifier === app?.privateAppProperties?.identifier) - ); - saveToLocalStorage('ext_saved_settings', 'sortablePinnedApps', updatedApps); - return updatedApps; - } else { - const updatedApps = prev.filter( - (item) => !(item?.name === app?.name && item?.service === app?.service) - ); - saveToLocalStorage('ext_saved_settings', 'sortablePinnedApps', updatedApps); - return updatedApps; - } - }); - }}> - - - - - Unpin app - - - -
- ); + + + + + Unpin app + +
+
+
+ ); }; diff --git a/src/components/CoreSyncStatus.css b/src/components/CoreSyncStatus.css deleted file mode 100644 index 87bf9d7..0000000 --- a/src/components/CoreSyncStatus.css +++ /dev/null @@ -1,59 +0,0 @@ - .lineHeight { - line-height: 33%; - } - - .tooltip { - display: inline-block; - position: relative; - text-align: left; - } - - .tooltip .bottom { - min-width: 225px; - max-width: 250px; - top: 35px; - right: 0px; - /* transform: translate(-50%, 0); */ - padding: 10px 10px; - color: var(--black); - background-color: var(--bg-2); - font-weight: normal; - font-size: 13px; - border-radius: 8px; - position: absolute; - z-index: 99999999; - box-sizing: border-box; - box-shadow: 0 1px 8px rgba(0, 0, 0, 0.5); - border: 1px solid var(--black); - visibility: hidden; - opacity: 0; - transition: opacity 0.2s; - } - - .tooltip:hover .bottom { - visibility: visible; - opacity: 1; - z-index: 100; - } - - .tooltip .bottom i { - position: absolute; - bottom: 100%; - left: 50%; - margin-left: -12px; - width: 24px; - height: 12px; - overflow: hidden; - } - - .tooltip .bottom i::after { - content: ''; - position: absolute; - width: 12px; - height: 12px; - left: 50%; - transform: translate(-50%, 50%) rotate(45deg); - background-color: var(--white); - border: 1px solid var(--black); - box-shadow: 0 1px 8px rgba(0, 0, 0, 0.5); - } \ No newline at end of file diff --git a/src/components/CoreSyncStatus.tsx b/src/components/CoreSyncStatus.tsx index 2334bef..1bf2221 100644 --- a/src/components/CoreSyncStatus.tsx +++ b/src/components/CoreSyncStatus.tsx @@ -1,28 +1,39 @@ -import React, { useEffect, useState } from 'react'; -import syncedImg from '../assets/syncStatus/synced.png' -import syncedMintingImg from '../assets/syncStatus/synced_minting.png' -import syncingImg from '../assets/syncStatus/syncing.png' +import { useEffect, useState } from 'react'; +import syncedImg from '../assets/syncStatus/synced.webp'; +import syncedMintingImg from '../assets/syncStatus/synced_minting.webp'; +import syncingImg from '../assets/syncStatus/syncing.webp'; import { getBaseApiReact } from '../App'; -import './CoreSyncStatus.css' -export const CoreSyncStatus = ({imageSize, position}) => { +import '../styles/CoreSyncStatus.css'; +import { Box, useTheme } from '@mui/material'; +import { useTranslation } from 'react-i18next'; +import { manifestData } from './NotAuthenticated'; + +export const CoreSyncStatus = () => { const [nodeInfos, setNodeInfos] = useState({}); const [coreInfos, setCoreInfos] = useState({}); const [isUsingGateway, setIsUsingGateway] = useState(false); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + const theme = useTheme(); + useEffect(() => { const getNodeInfos = async () => { - - try { - setIsUsingGateway(!!getBaseApiReact()?.includes('ext-node.qortal.link')) - const url = `${getBaseApiReact()}/admin/status`; - const response = await fetch(url, { - method: "GET", - headers: { - "Content-Type": "application/json", - }, - }); - const data = await response.json(); + setIsUsingGateway(getBaseApiReact()?.includes('ext-node.qortal.link')); + const url = `${getBaseApiReact()}/admin/status`; + const response = await fetch(url, { + method: 'GET', + headers: { + 'Content-Type': 'application/json', + }, + }); + const data = await response.json(); setNodeInfos(data); } catch (error) { console.error('Request failed', error); @@ -30,14 +41,12 @@ export const CoreSyncStatus = ({imageSize, position}) => { }; const getCoreInfos = async () => { - - try { const url = `${getBaseApiReact()}/admin/info`; const response = await fetch(url, { - method: "GET", + method: 'GET', headers: { - "Content-Type": "application/json", + 'Content-Type': 'application/json', }, }); const data = await response.json(); @@ -59,55 +68,106 @@ export const CoreSyncStatus = ({imageSize, position}) => { }, []); const renderSyncStatusIcon = () => { - const { isSynchronizing = false, syncPercent = 0, isMintingPossible = false, height = 0, numberOfConnections = 0 } = nodeInfos; - const buildVersion = coreInfos?.buildVersion ? coreInfos?.buildVersion.substring(0, 12) : ''; + const { + isSynchronizing = false, + syncPercent = 0, + isMintingPossible = false, + height = 0, + numberOfConnections = 0, + } = nodeInfos; + const buildVersion = coreInfos?.buildVersion + ? coreInfos?.buildVersion.substring(0, 12) + : ''; let imagePath = syncingImg; - let message = `Synchronizing` - if (isMintingPossible && !isUsingGateway) { - imagePath = syncedMintingImg; - message = `${isSynchronizing ? 'Synchronizing' : 'Synchronized'} ${'(Minting)'}` - } else if (isSynchronizing === true && syncPercent === 99) { - imagePath = syncingImg - } else if (isSynchronizing && !isMintingPossible && syncPercent === 100) { + let message: string = ''; + + if (isUsingGateway) { imagePath = syncingImg; - message = `Synchronizing ${isUsingGateway ? '' :'(Not Minting)'}` - } else if (!isSynchronizing && !isMintingPossible && syncPercent === 100) { - imagePath = syncedImg - message = `Synchronized ${isUsingGateway ? '' :'(Not Minting)'}` - } else if (isSynchronizing && isMintingPossible && syncPercent === 100) { - imagePath = syncingImg; - message = `Synchronizing ${isUsingGateway ? '' :'(Minting)'}` - } else if (!isSynchronizing && isMintingPossible && syncPercent === 100) { - imagePath = syncedMintingImg; - message = `Synchronized ${isUsingGateway ? '' :'(Minting)'}` + message = `${t('core:minting.status.no_status')}`; + } else if (isMintingPossible) { + if (isSynchronizing) { + imagePath = syncingImg; + message = `${t(`core:minting.status.synchronizing`, { percent: syncPercent, postProcess: 'capitalizeFirstChar' })} ${t('core:minting.status.minting')}`; + } else { + imagePath = syncedMintingImg; + message = `${t(`core:minting.status.synchronized`, { percent: syncPercent, postProcess: 'capitalizeFirstChar' })} ${t('core:minting.status.minting')}`; + } + } else if (!isMintingPossible) { + if (syncPercent == 100) { + imagePath = syncedImg; + message = `${t(`core:minting.status.synchronized`, { percent: syncPercent, postProcess: 'capitalizeFirstChar' })} ${t('core:minting.status.not_minting')}`; + } else { + imagePath = syncingImg; + message = `${t(`core:minting.status.synchronizing`, { percent: syncPercent, postProcess: 'capitalizeFirstChar' })} ${t('core:minting.status.not_minting')}`; + } } - - return ( -
- sync status -
-

Core Information

-

Core Version: {buildVersion}

+ + + sync status + + + +

+ {t('core:core.information', { postProcess: 'capitalizeFirstChar' })} +

+ +

+ {t('core:core.version', { postProcess: 'capitalizeFirstChar' })}:{' '} + {buildVersion} +

+

{message}

-

Block Height: {height || ''}

-

Connected Peers: {numberOfConnections || ''}

-

Using public node: {isUsingGateway?.toString()}

- -
-
+ +

+ {t('core:core.block_height', { + postProcess: 'capitalizeFirstChar', + })} + : {height || ''} +

+ +

+ {t('core:core.peers', { postProcess: 'capitalizeFirstChar' })}:{' '} + + {numberOfConnections || ''} + +

+ +

+ {t('auth:node.using_public', { + postProcess: 'capitalizeFirstChar', + })} + :{' '} + + {isUsingGateway?.toString()} + +

+ +

+ {t('core:ui.version', { postProcess: 'capitalizeFirstChar' })}:{' '} + {manifestData.version} +

+ + ); }; - return ( -
- {renderSyncStatusIcon()} -
- ); + return {renderSyncStatusIcon()}; }; - diff --git a/src/components/Desktop/DesktopFooter.tsx b/src/components/Desktop/DesktopFooter.tsx index 6da8f4e..23bd474 100644 --- a/src/components/Desktop/DesktopFooter.tsx +++ b/src/components/Desktop/DesktopFooter.tsx @@ -1,47 +1,51 @@ -import * as React from "react"; -import { - BottomNavigation, - BottomNavigationAction, - ButtonBase, - Typography, -} from "@mui/material"; -import { Home, Groups, Message, ShowChart } from "@mui/icons-material"; -import Box from "@mui/material/Box"; -import BottomLogo from "../../assets/svgs/BottomLogo5.svg"; -import { CustomSvg } from "../../common/CustomSvg"; -import { WalletIcon } from "../../assets/Icons/WalletIcon"; -import { HubsIcon } from "../../assets/Icons/HubsIcon"; -import { TradingIcon } from "../../assets/Icons/TradingIcon"; -import { MessagingIcon } from "../../assets/Icons/MessagingIcon"; -import AppIcon from "../../assets/svgs/AppIcon.svg"; +import { ButtonBase, Typography, useTheme } from '@mui/material'; +import Box from '@mui/material/Box'; +import { HubsIcon } from '../../assets/Icons/HubsIcon'; +import { MessagingIcon } from '../../assets/Icons/MessagingIcon'; +import AppIcon from '../../assets/svgs/AppIcon.svg'; +import { HomeIcon } from '../../assets/Icons/HomeIcon'; +import { Save } from '../Save/Save'; +import { enabledDevModeAtom } from '../../atoms/global'; +import { useAtom } from 'jotai'; +import { useTranslation } from 'react-i18next'; -import { HomeIcon } from "../../assets/Icons/HomeIcon"; -import { Save } from "../Save/Save"; -import { useRecoilState } from "recoil"; -import { enabledDevModeAtom } from "../../atoms/global"; +export const IconWrapper = ({ + children, + label, + color, + selected, + disableWidth, + customWidth, +}) => { + const theme = useTheme(); -export const IconWrapper = ({ children, label, color, selected, disableWidth, customWidth }) => { return ( {children} {label} @@ -51,24 +55,7 @@ export const IconWrapper = ({ children, label, color, selected, disableWidth, cu }; export const DesktopFooter = ({ - selectedGroup, - groupSection, - isUnread, - goToAnnouncements, - isUnreadChat, - goToChat, - goToThreads, - setOpenManageMembers, - groupChatHasUnread, - groupsAnnHasUnread, - directChatHasUnread, - chatMode, - openDrawerGroups, goToHome, - setIsOpenDrawerProfile, - mobileViewMode, - setMobileViewMode, - setMobileViewModeKeepOpen, hasUnreadGroups, hasUnreadDirects, isHome, @@ -77,32 +64,38 @@ export const DesktopFooter = ({ setDesktopSideView, isApps, setDesktopViewMode, - desktopViewMode, hide, setIsOpenSideViewDirects, - setIsOpenSideViewGroups - + setIsOpenSideViewGroups, }) => { - const [isEnabledDevMode, setIsEnabledDevMode] = useRecoilState(enabledDevModeAtom) + const [isEnabledDevMode, setIsEnabledDevMode] = useAtom(enabledDevModeAtom); + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); - if(hide) return + if (hide) return; return ( - + + { - setDesktopViewMode('apps') - setIsOpenSideViewDirects(false) - setIsOpenSideViewGroups(false) + setDesktopViewMode('apps'); + setIsOpenSideViewDirects(false); + setIsOpenSideViewGroups(false); }} > - + + { - setDesktopSideView("groups"); + setDesktopSideView('groups'); }} > + { - setDesktopSideView("directs"); + setDesktopSideView('directs'); }} > - + {isEnabledDevMode && ( { - setDesktopViewMode('dev') - setIsOpenSideViewDirects(false) - setIsOpenSideViewGroups(false) - }} - > - { + setDesktopViewMode('dev'); + setIsOpenSideViewDirects(false); + setIsOpenSideViewGroups(false); + }} > - - - + + + + )} - ); diff --git a/src/components/Desktop/DesktopHeader.tsx b/src/components/Desktop/DesktopHeader.tsx index 4820054..ca0c478 100644 --- a/src/components/Desktop/DesktopHeader.tsx +++ b/src/components/Desktop/DesktopHeader.tsx @@ -1,49 +1,46 @@ -import * as React from "react"; -import { - BottomNavigation, - BottomNavigationAction, - ButtonBase, - Typography, -} from "@mui/material"; -import { Home, Groups, Message, ShowChart } from "@mui/icons-material"; -import Box from "@mui/material/Box"; -import BottomLogo from "../../assets/svgs/BottomLogo5.svg"; -import { CustomSvg } from "../../common/CustomSvg"; -import { WalletIcon } from "../../assets/Icons/WalletIcon"; -import { HubsIcon } from "../../assets/Icons/HubsIcon"; -import { TradingIcon } from "../../assets/Icons/TradingIcon"; -import { MessagingIcon } from "../../assets/Icons/MessagingIcon"; -import { HomeIcon } from "../../assets/Icons/HomeIcon"; -import { NotificationIcon2 } from "../../assets/Icons/NotificationIcon2"; -import { ChatIcon } from "../../assets/Icons/ChatIcon"; -import { ThreadsIcon } from "../../assets/Icons/ThreadsIcon"; -import { MembersIcon } from "../../assets/Icons/MembersIcon"; -import { AdminsIcon } from "../../assets/Icons/AdminsIcon"; +import { useState } from 'react'; +import { ButtonBase, Typography, useTheme } from '@mui/material'; +import Box from '@mui/material/Box'; +import { NotificationIcon2 } from '../../assets/Icons/NotificationIcon2'; +import { ChatIcon } from '../../assets/Icons/ChatIcon'; +import { ThreadsIcon } from '../../assets/Icons/ThreadsIcon'; +import { MembersIcon } from '../../assets/Icons/MembersIcon'; +import { AdminsIcon } from '../../assets/Icons/AdminsIcon'; import LockIcon from '@mui/icons-material/Lock'; import NoEncryptionGmailerrorredIcon from '@mui/icons-material/NoEncryptionGmailerrorred'; +import { useTranslation } from 'react-i18next'; -const IconWrapper = ({ children, label, color, selected, selectColor, customHeight }) => { +const IconWrapper = ({ + children, + label, + color, + selected, + selectColor, + customHeight, +}) => { return ( {children} {label} @@ -83,63 +80,88 @@ export const DesktopHeader = ({ isChat, isForum, setGroupSection, - isPrivate + isPrivate, }) => { - const [value, setValue] = React.useState(0); + const [value, setValue] = useState(0); + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + return ( - + {isPrivate && ( - + )} + {isPrivate === false && ( - + )} + - {selectedGroup?.groupId === '0' ? 'General' :selectedGroup?.groupName} + {selectedGroup?.groupId === '0' + ? t('core:general', { postProcess: 'capitalizeFirstChar' }) + : selectedGroup?.groupName} + - { - goToAnnouncements() + goToAnnouncements(); }} > @@ -158,14 +180,16 @@ export const DesktopHeader = ({ { - goToChat() + goToChat(); }} > @@ -184,15 +208,20 @@ export const DesktopHeader = ({ { - setGroupSection("forum"); - + setGroupSection('forum'); }} > + { - setOpenManageMembers(true) - + setOpenManageMembers(true); }} > + { - setGroupSection("adminSpace"); - + setGroupSection('adminSpace'); }} > diff --git a/src/components/Desktop/DesktopLeftSideBar.tsx b/src/components/Desktop/DesktopLeftSideBar.tsx new file mode 100644 index 0000000..5df4f57 --- /dev/null +++ b/src/components/Desktop/DesktopLeftSideBar.tsx @@ -0,0 +1,173 @@ +import { Box, ButtonBase, useTheme } from '@mui/material'; +import { HomeIcon } from '../../assets/Icons/HomeIcon'; +import { Save } from '../Save/Save'; +import { IconWrapper } from './DesktopFooter'; +import { enabledDevModeAtom } from '../../atoms/global'; +import { AppsIcon } from '../../assets/Icons/AppsIcon'; +import ThemeSelector from '../Theme/ThemeSelector'; +import { CoreSyncStatus } from '../CoreSyncStatus'; +import LanguageSelector from '../Language/LanguageSelector'; +import { MessagingIconFilled } from '../../assets/Icons/MessagingIconFilled'; +import { useAtom } from 'jotai'; +import { useTranslation } from 'react-i18next'; + +export const DesktopSideBar = ({ + goToHome, + setDesktopSideView, + toggleSideViewDirects, + hasUnreadDirects, + isDirects, + toggleSideViewGroups, + hasUnreadGroups, + isGroups, + isApps, + setDesktopViewMode, + desktopViewMode, + myName, +}) => { + const [isEnabledDevMode, setIsEnabledDevMode] = useAtom(enabledDevModeAtom); + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + + return ( + + + + + + { + goToHome(); + }} + > + + + + { + setDesktopViewMode('apps'); + }} + > + + + + + + { + setDesktopViewMode('chat'); + }} + > + + + + + + + + {isEnabledDevMode && ( + { + setDesktopViewMode('dev'); + }} + > + + + + + )} + + + + + + + + + + + + ); +}; diff --git a/src/components/DesktopSideBar.tsx b/src/components/DesktopSideBar.tsx deleted file mode 100644 index 76f2f2e..0000000 --- a/src/components/DesktopSideBar.tsx +++ /dev/null @@ -1,120 +0,0 @@ -import { Box, ButtonBase } from '@mui/material'; -import React from 'react' -import { HomeIcon } from "../assets/Icons/HomeIcon"; -import { MessagingIcon } from "../assets/Icons/MessagingIcon"; -import { Save } from "./Save/Save"; -import { HubsIcon } from "../assets/Icons/HubsIcon"; -import { CoreSyncStatus } from "./CoreSyncStatus"; -import { IconWrapper } from './Desktop/DesktopFooter'; -import AppIcon from "./../assets/svgs/AppIcon.svg"; -import { useRecoilState } from 'recoil'; -import { enabledDevModeAtom } from '../atoms/global'; -import { AppsIcon } from '../assets/Icons/AppsIcon'; - -export const DesktopSideBar = ({goToHome, setDesktopSideView, toggleSideViewDirects, hasUnreadDirects, isDirects, toggleSideViewGroups,hasUnreadGroups, isGroups, isApps, setDesktopViewMode, desktopViewMode, myName }) => { - const [isEnabledDevMode, setIsEnabledDevMode] = useRecoilState(enabledDevModeAtom) - - return ( - - { - goToHome(); - - }} - > - - - - - { - setDesktopViewMode('apps') - // setIsOpenSideViewDirects(false) - // setIsOpenSideViewGroups(false) - }} - > - - - - - { - setDesktopViewMode('chat') - }} - > - - - - - {/* { - setDesktopSideView("groups"); - toggleSideViewGroups() - }} - > - - - */} - - {/* */} - {isEnabledDevMode && ( - { - setDesktopViewMode('dev') - }} - > - - - - - )} - - ) -} diff --git a/src/components/Drawer/Drawer.tsx b/src/components/Drawer/Drawer.tsx index 0296088..a6491a7 100644 --- a/src/components/Drawer/Drawer.tsx +++ b/src/components/Drawer/Drawer.tsx @@ -1,32 +1,18 @@ -import * as React from 'react'; import Box from '@mui/material/Box'; import Drawer from '@mui/material/Drawer'; -import Button from '@mui/material/Button'; -import List from '@mui/material/List'; -import Divider from '@mui/material/Divider'; -import ListItem from '@mui/material/ListItem'; -import ListItemButton from '@mui/material/ListItemButton'; -import ListItemIcon from '@mui/material/ListItemIcon'; -import ListItemText from '@mui/material/ListItemText'; -import InboxIcon from '@mui/icons-material/MoveToInbox'; -import MailIcon from '@mui/icons-material/Mail'; -import CloseIcon from '@mui/icons-material/Close'; -import { isMobile } from '../../App'; -export const DrawerComponent = ({open, setOpen, children}) => { +export const DrawerComponent = ({ open, setOpen, children }) => { const toggleDrawer = (newOpen: boolean) => () => { setOpen(newOpen); }; - return (
- - - {children} - + + {children} +
); -} +}; diff --git a/src/components/Drawer/DrawerUserLookup.tsx b/src/components/Drawer/DrawerUserLookup.tsx index f64e096..962142e 100644 --- a/src/components/Drawer/DrawerUserLookup.tsx +++ b/src/components/Drawer/DrawerUserLookup.tsx @@ -1,22 +1,30 @@ -import * as React from 'react'; +import { useTheme } from '@mui/material'; import Box from '@mui/material/Box'; import Drawer from '@mui/material/Drawer'; -export const DrawerUserLookup = ({open, setOpen, children}) => { - +export const DrawerUserLookup = ({ open, setOpen, children }) => { const toggleDrawer = (newOpen: boolean) => () => { setOpen(newOpen); }; - + const theme = useTheme(); + return (
- - - - {children} - + + + {children} +
); -} +}; diff --git a/src/components/Embeds/AttachmentEmbed.tsx b/src/components/Embeds/AttachmentEmbed.tsx index 3480c31..46d18cc 100644 --- a/src/components/Embeds/AttachmentEmbed.tsx +++ b/src/components/Embeds/AttachmentEmbed.tsx @@ -1,299 +1,345 @@ -import React, { useContext, useEffect, useMemo, useRef, useState } from "react"; -import { MyContext, getBaseApiReact } from "../../App"; +import { useContext, useState } from 'react'; +import { QORTAL_APP_CONTEXT, getBaseApiReact } from '../../App'; import { Card, CardContent, - CardHeader, Typography, - RadioGroup, - Radio, - FormControlLabel, - Button, Box, ButtonBase, Divider, - Dialog, - IconButton, CircularProgress, -} from "@mui/material"; -import { base64ToBlobUrl } from "../../utils/fileReading"; -import { saveFileToDiskGeneric } from "../../utils/generateWallet/generateWallet"; + useTheme, +} from '@mui/material'; +import { base64ToBlobUrl } from '../../utils/fileReading'; +import { saveFileToDiskGeneric } from '../../utils/generateWallet/generateWallet'; import AttachmentIcon from '@mui/icons-material/Attachment'; -import RefreshIcon from "@mui/icons-material/Refresh"; -import OpenInNewIcon from "@mui/icons-material/OpenInNew"; -import { CustomLoader } from "../../common/CustomLoader"; -import { Spacer } from "../../common/Spacer"; -import { FileAttachmentContainer, FileAttachmentFont } from "./Embed-styles"; -import DownloadIcon from "@mui/icons-material/Download"; +import RefreshIcon from '@mui/icons-material/Refresh'; +import OpenInNewIcon from '@mui/icons-material/OpenInNew'; +import { CustomLoader } from '../../common/CustomLoader'; +import { Spacer } from '../../common/Spacer'; +import { FileAttachmentContainer, FileAttachmentFont } from './Embed-styles'; +import DownloadIcon from '@mui/icons-material/Download'; import SaveIcon from '@mui/icons-material/Save'; -import { useSetRecoilState } from "recoil"; -import { blobControllerAtom } from "../../atoms/global"; -import { decodeIfEncoded } from "../../utils/decode"; - +import { decodeIfEncoded } from '../../utils/decode'; +import { useTranslation } from 'react-i18next'; export const AttachmentCard = ({ - resourceData, - resourceDetails, - owner, - refresh, - openExternal, - external, - isLoadingParent, - errorMsg, - encryptionType, - selectedGroupId - }) => { + resourceData, + resourceDetails, + owner, + refresh, + openExternal, + external, + isLoadingParent, + errorMsg, + encryptionType, + selectedGroupId, +}) => { + const [isOpen, setIsOpen] = useState(true); + const { downloadResource } = useContext(QORTAL_APP_CONTEXT); + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + + const saveToDisk = async () => { + const { name, service, identifier } = resourceData; + + const url = `${getBaseApiReact()}/arbitrary/${service}/${name}/${identifier}`; + fetch(url) + .then((response) => response.blob()) + .then(async (blob) => { + await saveFileToDiskGeneric(blob, resourceData?.fileName); + }) + .catch((error) => { + console.error('Error fetching the video:', error); + }); + }; + + const saveToDiskEncrypted = async () => { + let blobUrl; + try { + const { name, service, identifier, key } = resourceData; + const url = `${getBaseApiReact()}/arbitrary/${service}/${name}/${identifier}?encoding=base64`; + const res = await fetch(url); + const data = await res.text(); + let decryptedData; - const [isOpen, setIsOpen] = useState(true); - const { downloadResource } = useContext(MyContext); - - const saveToDisk = async ()=> { - const { name, service, identifier } = resourceData; - - const url = `${getBaseApiReact()}/arbitrary/${service}/${name}/${identifier}`; - fetch(url) - .then(response => response.blob()) - .then(async blob => { - await saveFileToDiskGeneric(blob, resourceData?.fileName) - }) - .catch(error => { - console.error("Error fetching the video:", error); - }); - } - - const saveToDiskEncrypted = async ()=> { - let blobUrl try { - const { name, service, identifier,key } = resourceData; - - const url = `${getBaseApiReact()}/arbitrary/${service}/${name}/${identifier}?encoding=base64`; - const res = await fetch(url) - const data = await res.text(); - let decryptedData - try { - if(key && encryptionType === 'private'){ - decryptedData = await window.sendMessage( - "DECRYPT_DATA_WITH_SHARING_KEY", - - { - encryptedData: data, - key: decodeURIComponent(key), - } - - ); - } - if(encryptionType === 'group'){ - decryptedData = await window.sendMessage( - "DECRYPT_QORTAL_GROUP_DATA", - - { - data64: data, - groupId: selectedGroupId, - } - - ); - } - } catch (error) { - throw new Error('Unable to decrypt') + if (key && encryptionType === 'private') { + decryptedData = await window.sendMessage( + 'DECRYPT_DATA_WITH_SHARING_KEY', + { + encryptedData: data, + key: decodeURIComponent(key), + } + ); + } + if (encryptionType === 'group') { + decryptedData = await window.sendMessage( + 'DECRYPT_QORTAL_GROUP_DATA', + + { + data64: data, + groupId: selectedGroupId, + } + ); } - - if (!decryptedData || decryptedData?.error) throw new Error("Could not decrypt data"); - blobUrl = base64ToBlobUrl(decryptedData, resourceData?.mimeType) - const response = await fetch(blobUrl); - const blob = await response.blob(); - await saveFileToDiskGeneric(blob, resourceData?.fileName) - } catch (error) { - console.error(error) - } finally { - if(blobUrl){ - URL.revokeObjectURL(blobUrl); - } - + throw new Error( + t('auth:message.error.decrypt', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + + if (!decryptedData || decryptedData?.error) + throw new Error( + t('auth:message.error.decrypt_data', { + postProcess: 'capitalizeFirstChar', + }) + ); + blobUrl = base64ToBlobUrl(decryptedData, resourceData?.mimeType); + const response = await fetch(blobUrl); + const blob = await response.blob(); + await saveFileToDiskGeneric(blob, resourceData?.fileName); + } catch (error) { + console.error(error); + } finally { + if (blobUrl) { + URL.revokeObjectURL(blobUrl); } } - return ( - + - - + + {t('core:attachment', { postProcess: 'capitalizeAll' })} + + + + + + - ATTACHMENT embed - - +
+ + {external && ( - - {external && ( - - - - )} -
-
- - - Created by {decodeIfEncoded(owner)} - - - {encryptionType === 'private' ? "ENCRYPTED" : encryptionType === 'group' ? 'GROUP ENCRYPTED' : "Not encrypted"} - - - - - - - {isLoadingParent && isOpen && ( - - {" "} - {" "} - )} - {errorMsg && ( - + + + + + {t('core:message.generic.created_by', { + owner: decodeIfEncoded(owner), + postProcess: 'capitalizeFirstChar', + })} + + + + {encryptionType === 'private' + ? t('core:message.generic.encrypted', { + postProcess: 'capitalizeAll', + }) + : encryptionType === 'group' + ? t('group:message.generic.group_encrypted', { + postProcess: 'capitalizeAll', + }) + : t('core:message.generic.encrypted_not', { + postProcess: 'capitalizeFirstChar', + })} + + + + + + + {isLoadingParent && isOpen && ( + + + + )} + {errorMsg && ( + + - {" "} + {errorMsg} + + + )} + + + + + {resourceData?.fileName && ( + <> - {errorMsg} - {" "} - + {resourceData?.fileName} +
+ + )} -
- - - - {resourceData?.fileName && ( + { + if (resourceDetails?.status?.status === 'READY') { + if (encryptionType) { + saveToDiskEncrypted(); + return; + } + saveToDisk(); + return; + } + downloadResource(resourceData); + }} + > + + + {resourceDetails?.status?.status === 'DOWNLOADED' + ? t('core:message.error.generic.building', { + postProcess: 'capitalizeAll', + }) + : resourceDetails?.status?.status} + + + {!resourceDetails && ( <> - {resourceData?.fileName} - + + + {t('core:action.download_file', { + postProcess: 'capitalizeFirstChar', + })} + )} - { - if(resourceDetails?.status?.status === 'READY'){ - if(encryptionType){ - saveToDiskEncrypted() - return - } - saveToDisk() - return - } - downloadResource(resourceData) - }}> - - - {resourceDetails?.status?.status === 'DOWNLOADED' ? 'BUILDING' : resourceDetails?.status?.status} - {!resourceDetails && ( - <> - - Download File - - - )} - {resourceDetails && resourceDetails?.status?.status !== 'READY' && resourceDetails?.status?.status !== 'FAILED_TO_DOWNLOAD' && ( - <> - - Downloading: {resourceDetails?.status?.percentLoaded || '0'}% - - - )} - {resourceDetails && resourceDetails?.status?.status === 'READY' && ( - <> - - Save to Disk - - - )} - - - - - - - - - ); - }; \ No newline at end of file + + {resourceDetails && + resourceDetails?.status?.status !== 'READY' && + resourceDetails?.status?.status !== 'FAILED_TO_DOWNLOAD' && ( + <> + + + {t('core:message.generic.downloading', { + postProcess: 'capitalizeFirstChar', + })} + : {resourceDetails?.status?.percentLoaded || '0'}% + + + )} + + {resourceDetails && + resourceDetails?.status?.status === 'READY' && ( + <> + + + {t('core:action.save_disk', { + postProcess: 'capitalizeFirstChar', + })} + + + )} + + + +
+ + ); +}; diff --git a/src/components/Embeds/Embed-styles.tsx b/src/components/Embeds/Embed-styles.tsx index b0b5482..fa20b36 100644 --- a/src/components/Embeds/Embed-styles.tsx +++ b/src/components/Embeds/Embed-styles.tsx @@ -1,18 +1,18 @@ -import { Box, Typography, styled } from "@mui/material"; +import { Box, Typography, styled } from '@mui/material'; export const FileAttachmentContainer = styled(Box)(({ theme }) => ({ - display: "flex", - alignItems: "center", - padding: "5px 10px", - border: `1px solid ${theme.palette.text.primary}`, - width: "100%", - gap: '20px' - })); - - export const FileAttachmentFont = styled(Typography)(({ theme }) => ({ - fontSize: "20px", - letterSpacing: 0, - fontWeight: 400, - userSelect: "none", - whiteSpace: "nowrap", - })); \ No newline at end of file + alignItems: 'center', + border: `1px solid ${theme.palette.text.primary}`, + display: 'flex', + gap: '20px', + padding: '5px 10px', + width: '100%', +})); + +export const FileAttachmentFont = styled(Typography)(({ theme }) => ({ + fontSize: '20px', + fontWeight: 400, + letterSpacing: 0, + userSelect: 'none', + whiteSpace: 'nowrap', +})); diff --git a/src/components/Embeds/Embed.tsx b/src/components/Embeds/Embed.tsx index 65b2cef..7aa2e39 100644 --- a/src/components/Embeds/Embed.tsx +++ b/src/components/Embeds/Embed.tsx @@ -1,42 +1,44 @@ -import React, { useEffect, useMemo, useRef, useState } from "react"; -import { getBaseApiReact } from "../../App"; - - -import { CustomizedSnackbars } from "../Snackbar/Snackbar"; - -import { extractComponents } from "../Chat/MessageDisplay"; -import { executeEvent } from "../../utils/events"; - -import { base64ToBlobUrl } from "../../utils/fileReading"; -import { useRecoilState, useRecoilValue, useSetRecoilState } from "recoil"; -import { blobControllerAtom, blobKeySelector, resourceKeySelector, selectedGroupIdAtom } from "../../atoms/global"; -import { parseQortalLink } from "./embed-utils"; -import { PollCard } from "./PollEmbed"; -import { ImageCard } from "./ImageEmbed"; -import { AttachmentCard } from "./AttachmentEmbed"; -import { decodeIfEncoded } from "../../utils/decode"; +import { useEffect, useMemo, useRef, useState } from 'react'; +import { getBaseApiReact } from '../../App'; +import { CustomizedSnackbars } from '../Snackbar/Snackbar'; +import { extractComponents } from '../Chat/MessageDisplay'; +import { executeEvent } from '../../utils/events'; +import { base64ToBlobUrl } from '../../utils/fileReading'; +import { + blobControllerAtom, + blobKeySelector, + resourceKeySelector, + selectedGroupIdAtom, +} from '../../atoms/global'; +import { parseQortalLink } from './embed-utils'; +import { PollCard } from './PollEmbed'; +import { ImageCard } from './ImageEmbed'; +import { AttachmentCard } from './AttachmentEmbed'; +import { useAtom, useAtomValue, useSetAtom } from 'jotai'; +import { useTranslation } from 'react-i18next'; const getPoll = async (name) => { const pollName = name; const url = `${getBaseApiReact()}/polls/${pollName}`; const response = await fetch(url, { - method: "GET", + method: 'GET', headers: { - "Content-Type": "application/json", + 'Content-Type': 'application/json', }, }); const responseData = await response.json(); - if (responseData?.message?.includes("POLL_NO_EXISTS")) { - throw new Error("POLL_NO_EXISTS"); + + if (responseData?.message?.includes('POLL_NO_EXISTS')) { + throw new Error('POLL_NO_EXISTS'); } else if (responseData?.pollName) { const urlVotes = `${getBaseApiReact()}/polls/votes/${pollName}`; const responseVotes = await fetch(urlVotes, { - method: "GET", + method: 'GET', headers: { - "Content-Type": "application/json", + 'Content-Type': 'application/json', }, }); @@ -49,56 +51,81 @@ const getPoll = async (name) => { }; export const Embed = ({ embedLink }) => { - const [errorMsg, setErrorMsg] = useState(""); + const [errorMsg, setErrorMsg] = useState(''); const [isLoading, setIsLoading] = useState(false); const [poll, setPoll] = useState(null); - const [type, setType] = useState(""); + const [type, setType] = useState(''); const hasFetched = useRef(false); const [openSnack, setOpenSnack] = useState(false); const [infoSnack, setInfoSnack] = useState(null); const [external, setExternal] = useState(null); - const [imageUrl, setImageUrl] = useState(""); + const [imageUrl, setImageUrl] = useState(null); const [parsedData, setParsedData] = useState(null); - const setBlobs = useSetRecoilState(blobControllerAtom); - const [selectedGroupId] = useRecoilState(selectedGroupIdAtom) - const resourceData = useMemo(()=> { + const setBlobs = useSetAtom(blobControllerAtom); + const [selectedGroupId] = useAtom(selectedGroupIdAtom); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + const resourceData = useMemo(() => { const parsedDataOnTheFly = parseQortalLink(embedLink); - if(parsedDataOnTheFly?.service && parsedDataOnTheFly?.name && parsedDataOnTheFly?.identifier){ + if ( + parsedDataOnTheFly?.service && + parsedDataOnTheFly?.name && + parsedDataOnTheFly?.identifier + ) { return { - service : parsedDataOnTheFly?.service, + service: parsedDataOnTheFly?.service, name: parsedDataOnTheFly?.name, identifier: parsedDataOnTheFly?.identifier, - fileName: parsedDataOnTheFly?.fileName ? decodeURIComponent(parsedDataOnTheFly?.fileName) : null, - mimeType: parsedDataOnTheFly?.mimeType ? decodeURIComponent(parsedDataOnTheFly?.mimeType) : null, - key: parsedDataOnTheFly?.key ? decodeURIComponent(parsedDataOnTheFly?.key) : null, - } + fileName: parsedDataOnTheFly?.fileName + ? decodeURIComponent(parsedDataOnTheFly?.fileName) + : null, + mimeType: parsedDataOnTheFly?.mimeType + ? decodeURIComponent(parsedDataOnTheFly?.mimeType) + : null, + key: parsedDataOnTheFly?.key + ? decodeURIComponent(parsedDataOnTheFly?.key) + : null, + }; } else { - return null + return null; } - }, [embedLink]) + }, [embedLink]); - const keyIdentifier = useMemo(()=> { - - if(resourceData){ - return `${resourceData.service}-${resourceData.name}-${resourceData.identifier}` + const keyIdentifier = useMemo(() => { + if (resourceData) { + return `${resourceData.service}-${resourceData.name}-${resourceData.identifier}`; } else { - return undefined + return undefined; } - }, [resourceData]) - const blobUrl = useRecoilValue(blobKeySelector(keyIdentifier)); + }, [resourceData]); + + const blobUrl = useAtomValue(blobKeySelector(keyIdentifier)); const handlePoll = async (parsedData) => { try { setIsLoading(true); - setErrorMsg(""); - setType("POLL"); + setErrorMsg(''); + setType('POLL'); if (!parsedData?.name) - throw new Error("Invalid poll embed link. Missing name."); + throw new Error( + t('core:message.error.invalid_poll_embed_link_name', { + postProcess: 'capitalizeFirstChar', + }) + ); const pollRes = await getPoll(parsedData.name); setPoll(pollRes); - } catch (error) { - setErrorMsg(error?.message || "Invalid embed link"); + setErrorMsg( + error?.message || + t('core:message.error.invalid_embed_link', { + postProcess: 'capitalizeFirstChar', + }) + ); } finally { setIsLoading(false); } @@ -106,8 +133,8 @@ export const Embed = ({ embedLink }) => { const getImage = async ({ identifier, name, service }, key, parsedData) => { try { - if(blobUrl?.blobUrl){ - return blobUrl?.blobUrl + if (blobUrl?.blobUrl) { + return blobUrl?.blobUrl; } let numberOfTries = 0; let imageFinalUrl = null; @@ -116,76 +143,87 @@ export const Embed = ({ embedLink }) => { const urlStatus = `${getBaseApiReact()}/arbitrary/resource/status/${service}/${name}/${identifier}?build=true`; const responseStatus = await fetch(urlStatus, { - method: "GET", + method: 'GET', headers: { - "Content-Type": "application/json", + 'Content-Type': 'application/json', }, }); const responseData = await responseStatus.json(); - if (responseData?.status === "READY") { + if (responseData?.status === 'READY') { if (parsedData?.encryptionType) { const urlData = `${getBaseApiReact()}/arbitrary/${service}/${name}/${identifier}?encoding=base64`; const responseData = await fetch(urlData, { - method: "GET", + method: 'GET', headers: { - "Content-Type": "application/json", + 'Content-Type': 'application/json', }, }); + const data = await responseData.text(); + if (data) { - let decryptedData + let decryptedData; try { - if(key && encryptionType === 'private'){ + if (key && encryptionType === 'private') { decryptedData = await window.sendMessage( - "DECRYPT_DATA_WITH_SHARING_KEY", - - { - encryptedData: data, + 'DECRYPT_DATA_WITH_SHARING_KEY', + { + encryptedData: data, key: decodeURIComponent(key), - } - + } ); } - if(encryptionType === 'group'){ - + if (encryptionType === 'group') { decryptedData = await window.sendMessage( - "DECRYPT_QORTAL_GROUP_DATA", - - { - data64: data, + 'DECRYPT_QORTAL_GROUP_DATA', + { + data64: data, groupId: selectedGroupId, - } - + } ); - - } + } } catch (error) { - throw new Error('Unable to decrypt') + throw new Error( + t('auth:message.error.decrypt', { + postProcess: 'capitalizeFirstChar', + }) + ); } - - if (!decryptedData || decryptedData?.error) throw new Error("Could not decrypt data"); - imageFinalUrl = base64ToBlobUrl(decryptedData, parsedData?.mimeType ? decodeURIComponent(parsedData?.mimeType) : undefined) - setBlobs((prev=> { + + if (!decryptedData || decryptedData?.error) + throw new Error( + t('auth:message.error.decrypt_data', { + postProcess: 'capitalizeFirstChar', + }) + ); + imageFinalUrl = base64ToBlobUrl( + decryptedData, + parsedData?.mimeType + ? decodeURIComponent(parsedData?.mimeType) + : undefined + ); + setBlobs((prev) => { return { ...prev, [`${service}-${name}-${identifier}`]: { blobUrl: imageFinalUrl, - timestamp: Date.now() - } - } - })) + timestamp: Date.now(), + }, + }; + }); } else { - throw new Error('No data for image') + throw new Error( + t('core:message.generic.no_data_image', { + postProcess: 'capitalizeFirstChar', + }) + ); } - } else { - imageFinalUrl = `${getBaseApiReact()}/arbitrary/${service}/${name}/${identifier}?async=true`; - - // If parsedData is used here, it must be defined somewhere - - } + imageFinalUrl = `${getBaseApiReact()}/arbitrary/${service}/${name}/${identifier}?async=true`; + // If parsedData is used here, it must be defined somewhere + } } }; @@ -203,18 +241,23 @@ export const Embed = ({ embedLink }) => { } if (imageFinalUrl) { - return imageFinalUrl; } else { setErrorMsg( - "Unable to download IMAGE. Please try again later by clicking the refresh button" + t('core:message.error.download_image', { + postProcess: 'capitalizeFirstChar', + }) ); return null; } } catch (error) { - console.error("Error fetching image:", error); + console.error('Error fetching image:', error); setErrorMsg( - error?.error || error?.message || "An unexpected error occurred while trying to download the image" + error?.error || + error?.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }) ); return null; } @@ -223,25 +266,36 @@ export const Embed = ({ embedLink }) => { const handleImage = async (parsedData) => { try { setIsLoading(true); - setErrorMsg(""); + setErrorMsg(''); if (!parsedData?.name || !parsedData?.service || !parsedData?.identifier) - throw new Error("Invalid image embed link. Missing param."); - let image = await getImage({ - name: parsedData.name, - service: parsedData.service, - identifier: parsedData?.identifier, - }, parsedData?.key, parsedData); - - setImageUrl(image); + throw new Error( + t('core:message.error.invalid_image_embed_link_name', { + postProcess: 'capitalizeFirstChar', + }) + ); + let image = await getImage( + { + name: parsedData.name, + service: parsedData.service, + identifier: parsedData?.identifier, + }, + parsedData?.key, + parsedData + ); + setImageUrl(image); } catch (error) { - setErrorMsg(error?.message || "Invalid embed link"); + setErrorMsg( + error?.message || + t('core:message.error.invalid_embed_link', { + postProcess: 'capitalizeFirstChar', + }) + ); } finally { setIsLoading(false); } }; - const handleLink = () => { try { const parsedData = parseQortalLink(embedLink); @@ -254,28 +308,31 @@ export const Embed = ({ embedLink }) => { setExternal(res); } } - } catch (error) { - - } + } catch (error) {} switch (type) { - case "POLL": + case 'POLL': { handlePoll(parsedData); } break; - case "IMAGE": - setType("IMAGE"); + case 'IMAGE': + setType('IMAGE'); + + break; + case 'ATTACHMENT': + setType('ATTACHMENT'); break; - case "ATTACHMENT": - setType("ATTACHMENT"); - - break; default: break; } } catch (error) { - setErrorMsg(error?.message || "Invalid embed link"); + setErrorMsg( + error?.message || + t('core:message.error.invalid_embed_link', { + postProcess: 'capitalizeFirstChar', + }) + ); } }; @@ -284,13 +341,18 @@ export const Embed = ({ embedLink }) => { const parsedData = parseQortalLink(embedLink); handleImage(parsedData); } catch (error) { - setErrorMsg(error?.message || "Invalid embed link"); + setErrorMsg( + error?.message || + t('core:message.error.invalid_embed_link', { + postProcess: 'capitalizeFirstChar', + }) + ); } }; const openExternal = () => { - executeEvent("addTab", { data: external }); - executeEvent("open-apps-mode", {}); + executeEvent('addTab', { data: external }); + executeEvent('open-apps-mode', {}); }; useEffect(() => { @@ -299,9 +361,7 @@ export const Embed = ({ embedLink }) => { hasFetched.current = true; }, [embedLink]); - - - const resourceDetails = useRecoilValue(resourceKeySelector(keyIdentifier)); + const resourceDetails = useAtomValue(resourceKeySelector(keyIdentifier)); const { parsedType, encryptionType } = useMemo(() => { let parsedType; @@ -312,15 +372,17 @@ export const Embed = ({ embedLink }) => { parsedType = parsedDataOnTheFly.type; } if (parsedDataOnTheFly?.encryptionType) { - encryptionType = parsedDataOnTheFly?.encryptionType + encryptionType = parsedDataOnTheFly?.encryptionType; } - } catch (error) {} + } catch (error) { + console.log(error); + } return { parsedType, encryptionType }; }, [embedLink]); return (
- {parsedType === "POLL" && ( + {parsedType === 'POLL' && ( { errorMsg={errorMsg} /> )} - {parsedType === "IMAGE" && ( + {parsedType === 'IMAGE' && ( { )} {parsedType === 'ATTACHMENT' && ( {
); }; - - - - - - - - diff --git a/src/components/Embeds/ImageEmbed.tsx b/src/components/Embeds/ImageEmbed.tsx index f1cc859..f197f5b 100644 --- a/src/components/Embeds/ImageEmbed.tsx +++ b/src/components/Embeds/ImageEmbed.tsx @@ -1,265 +1,297 @@ -import React, { useEffect, useState } from "react"; +import { useEffect, useState } from 'react'; import { Card, CardContent, Typography, - Box, ButtonBase, Divider, Dialog, IconButton, - -} from "@mui/material"; - -import RefreshIcon from "@mui/icons-material/Refresh"; -import OpenInNewIcon from "@mui/icons-material/OpenInNew"; -import { CustomLoader } from "../../common/CustomLoader"; -import ImageIcon from "@mui/icons-material/Image"; -import CloseIcon from "@mui/icons-material/Close"; -import { decodeIfEncoded } from "../../utils/decode"; + useTheme, +} from '@mui/material'; +import RefreshIcon from '@mui/icons-material/Refresh'; +import OpenInNewIcon from '@mui/icons-material/OpenInNew'; +import { CustomLoader } from '../../common/CustomLoader'; +import ImageIcon from '@mui/icons-material/Image'; +import CloseIcon from '@mui/icons-material/Close'; +import { decodeIfEncoded } from '../../utils/decode'; +import { useTranslation } from 'react-i18next'; export const ImageCard = ({ - image, - fetchImage, - owner, - refresh, - openExternal, - external, - isLoadingParent, - errorMsg, - encryptionType, - }) => { - const [isOpen, setIsOpen] = useState(true); - const [height, setHeight] = useState('400px') - useEffect(() => { - if (isOpen) { - fetchImage(); - } - }, [isOpen]); - - // useEffect(()=> { - // if(errorMsg){ - // setHeight('300px') - // } - // }, [errorMsg]) - - return ( - { + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + const [isOpen, setIsOpen] = useState(true); + const [height, setHeight] = useState('400px'); + + useEffect(() => { + if (isOpen) { + fetchImage(); + } + }, [isOpen]); + + return ( + + - - + + {t('core:image_embed', { postProcess: 'capitalizeFirstWord' })} + + + + + + - IMAGE embed - - + + + {external && ( - - {external && ( - - - - )} - - - - - Created by {decodeIfEncoded(owner)} - - - {encryptionType === 'private' ? "ENCRYPTED" : encryptionType === 'group' ? 'GROUP ENCRYPTED' : "Not encrypted"} - - - - - - {isLoadingParent && isOpen && ( - - {" "} - {" "} - - )} - {errorMsg && ( - - {" "} - - {errorMsg} - {" "} - )} - - - - - - - - ); - }; + - export function ImageViewer({ src, alt = "" }) { - const [isFullscreen, setIsFullscreen] = useState(false); - - const handleOpenFullscreen = () => setIsFullscreen(true); - const handleCloseFullscreen = () => setIsFullscreen(false); - - return ( - <> - {/* Image in container */} + + + {t('core:message.generic.created_by', { + owner: decodeIfEncoded(owner), + postProcess: 'capitalizeFirstChar', + })} + + + + {encryptionType === 'private' + ? t('core:message.generic.encrypted', { + postProcess: 'capitalizeAll', + }) + : encryptionType === 'group' + ? t('group:message.generic.group_encrypted', { + postProcess: 'capitalizeAll', + }) + : t('core:message.generic.encrypted_not', { + postProcess: 'capitalizeFirstChar', + })} + + + + + + + {isLoadingParent && isOpen && ( + + + + )} + + {errorMsg && ( + + + {errorMsg} + + + )} + + + + + + + + + ); +}; + +export function ImageViewer({ src = null, alt = '' }) { + const [isFullscreen, setIsFullscreen] = useState(false); + const handleOpenFullscreen = () => setIsFullscreen(true); + const handleCloseFullscreen = () => setIsFullscreen(false); + const theme = useTheme(); + return ( + <> + {/* Image in container */} + + {alt} + + + {/* Fullscreen Viewer */} + + {/* Close Button */} + + + + + {/* Fullscreen Image */} {alt} - - {/* Fullscreen Viewer */} - - - {/* Close Button */} - - - - - {/* Fullscreen Image */} - {alt} - - - - ); - } \ No newline at end of file + + + ); +} diff --git a/src/components/Embeds/PollEmbed.tsx b/src/components/Embeds/PollEmbed.tsx index 3da02c3..84c28e4 100644 --- a/src/components/Embeds/PollEmbed.tsx +++ b/src/components/Embeds/PollEmbed.tsx @@ -1,5 +1,5 @@ -import React, { useContext, useEffect, useState } from "react"; -import { MyContext } from "../../App"; +import { useContext, useEffect, useState } from 'react'; +import { QORTAL_APP_CONTEXT } from '../../App'; import { Card, CardContent, @@ -12,384 +12,433 @@ import { Box, ButtonBase, Divider, - -} from "@mui/material"; -import { getNameInfo } from "../Group/Group"; -import PollIcon from "@mui/icons-material/Poll"; -import { getFee } from "../../background"; -import RefreshIcon from "@mui/icons-material/Refresh"; -import { Spacer } from "../../common/Spacer"; -import OpenInNewIcon from "@mui/icons-material/OpenInNew"; -import { CustomLoader } from "../../common/CustomLoader"; - + useTheme, +} from '@mui/material'; +import { getNameInfo } from '../Group/Group'; +import PollIcon from '@mui/icons-material/Poll'; +import { getFee } from '../../background/background.ts'; +import RefreshIcon from '@mui/icons-material/Refresh'; +import { Spacer } from '../../common/Spacer'; +import OpenInNewIcon from '@mui/icons-material/OpenInNew'; +import { CustomLoader } from '../../common/CustomLoader'; +import { useTranslation } from 'react-i18next'; export const PollCard = ({ - poll, - setInfoSnack, - setOpenSnack, - refresh, - openExternal, - external, - isLoadingParent, - errorMsg, - }) => { - const [selectedOption, setSelectedOption] = useState(""); - const [ownerName, setOwnerName] = useState(""); - const [showResults, setShowResults] = useState(false); - const [isOpen, setIsOpen] = useState(false); - const { show, userInfo } = useContext(MyContext); - const [isLoadingSubmit, setIsLoadingSubmit] = useState(false); - const handleVote = async () => { - const fee = await getFee("VOTE_ON_POLL"); - - await show({ - message: `Do you accept this VOTE_ON_POLL transaction? POLLS are public!`, - publishFee: fee.fee + " QORT", - }); - setIsLoadingSubmit(true); - - window - .sendMessage( - "voteOnPoll", - { - pollName: poll?.info?.pollName, - optionIndex: +selectedOption, - }, - 60000 - ) - .then((response) => { - setIsLoadingSubmit(false); - if (response.error) { - setInfoSnack({ - type: "error", - message: response?.error || "Unable to vote.", - }); - setOpenSnack(true); - return; - } else { - setInfoSnack({ - type: "success", - message: - "Successfully voted. Please wait a couple minutes for the network to propogate the changes.", - }); - setOpenSnack(true); - } - }) - .catch((error) => { - setIsLoadingSubmit(false); + poll, + setInfoSnack, + setOpenSnack, + refresh, + openExternal, + external, + isLoadingParent, + errorMsg, +}) => { + const [selectedOption, setSelectedOption] = useState(''); + const [ownerName, setOwnerName] = useState(''); + const [showResults, setShowResults] = useState(false); + const [isOpen, setIsOpen] = useState(false); + const { show, userInfo } = useContext(QORTAL_APP_CONTEXT); + const [isLoadingSubmit, setIsLoadingSubmit] = useState(false); + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + + const handleVote = async () => { + const fee = await getFee('VOTE_ON_POLL'); + + await show({ + message: t('core:question.accept_vote_on_poll', { + postProcess: 'capitalizeFirstChar', + }), + publishFee: fee.fee + ' QORT', + }); + setIsLoadingSubmit(true); + + window + .sendMessage( + 'voteOnPoll', + { + pollName: poll?.info?.pollName, + optionIndex: +selectedOption, + }, + 60000 + ) + .then((response) => { + setIsLoadingSubmit(false); + if (response.error) { setInfoSnack({ - type: "error", - message: error?.message || "Unable to vote.", + type: 'error', + message: + response?.error || + t('core:message.error.vote', { + postProcess: 'capitalizeFirstChar', + }), + }); + setOpenSnack(true); + return; + } else { + setInfoSnack({ + type: 'success', + message: t('core:message.success.voted', { + postProcess: 'capitalizeFirstChar', + }), }); setOpenSnack(true); - }); - }; - - const getName = async (owner) => { - try { - const res = await getNameInfo(owner); - if (res) { - setOwnerName(res); } - } catch (error) {} - }; - - useEffect(() => { - if (poll?.info?.owner) { - getName(poll.info.owner); + }) + .catch((error) => { + setIsLoadingSubmit(false); + setInfoSnack({ + type: 'error', + message: + error?.message || + t('core:message.error.vote', { + postProcess: 'capitalizeFirstChar', + }), + }); + setOpenSnack(true); + }); + }; + + const getName = async (owner) => { + try { + const res = await getNameInfo(owner); + if (res) { + setOwnerName(res); } - }, [poll?.info?.owner]); - - return ( - { + if (poll?.info?.owner) { + getName(poll.info.owner); + } + }, [poll?.info?.owner]); + + return ( + + - - + + {t('core:poll_embed', { postProcess: 'capitalizeFirstWord' })} + + + + + + - POLL embed - - + + + {external && ( - - {external && ( - - - - )} - + )} - + + - + + + + + + {!isOpen && !errorMsg && ( + <> + + + + )} + + {isLoadingParent && isOpen && ( + - Created by {ownerName || poll?.info?.owner} - - - - - {!isOpen && !errorMsg && ( - <> - - - - )} - {isLoadingParent && isOpen && ( - - {" "} - {" "} - - )} - {errorMsg && ( - - {" "} - - {errorMsg} - {" "} - - )} - - - - + + )} + + {errorMsg && ( + - + > - Options + {errorMsg} - setSelectedOption(e.target.value)} + + )} + + + + + + + + {t('core:option_other', { postProcess: 'capitalizeFirstChar' })} + + + setSelectedOption(e.target.value)} + > + {poll?.info?.pollOptions?.map((option, index) => ( + } + label={option?.optionName} + sx={{ + '& .MuiFormControlLabel-label': { + fontSize: '14px', + }, + }} + /> + ))} + + + + + {poll?.votes?.totalVotes}{' '} + {poll?.votes?.totalVotes === 1 ? ' vote' : ' votes'} + + + + + + item?.voterPublicKey === userInfo?.publicKey + ) + ? 'visible' + : 'hidden', + }} + > + {t('core:message.generic.already_voted', { + postProcess: 'capitalizeFirstChar', + })} + + + + + {isLoadingSubmit && ( + + {t('core:message.generic.processing_transaction', { + postProcess: 'capitalizeFirstChar', + })} + + )} + + { + setShowResults((prev) => !prev); + }} + > + {showResults + ? t('core:action.hide', { postProcess: 'capitalizeFirstChar' }) + : t('core:action.close', { postProcess: 'capitalizeFirstChar' })} + + + + {showResults && } + + + ); +}; + +const PollResults = ({ votes }) => { + const maxVotes = Math.max( + ...votes?.voteCounts?.map((option) => option.voteCount) + ); + const options = votes?.voteCounts; + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + + return ( + + {options + .sort((a, b) => b.voteCount - a.voteCount) // Sort options by votes (highest first) + .map((option, index) => ( + + - {" "} - {`${poll?.votes?.totalVotes} ${ - poll?.votes?.totalVotes === 1 ? " vote" : " votes" - }`} + {`${index + 1}. ${option.optionName}`} + + + + {t('core:vote', { count: option.voteCount })} - - - item?.voterPublicKey === userInfo?.publicKey - ) - ? "visible" - : "hidden", + backgroundColor: '#e0e0e0', + borderRadius: 5, + height: 10, + mt: 1, + overflow: 'hidden', }} > - You've already voted. - - - {isLoadingSubmit && ( - - Is processing transaction, please wait... - - )} - { - setShowResults((prev) => !prev); - }} - > - {showResults ? "hide " : "show "} results - - - {showResults && } - - - ); - }; - - const PollResults = ({ votes }) => { - const maxVotes = Math.max( - ...votes?.voteCounts?.map((option) => option.voteCount) - ); - const options = votes?.voteCounts; - return ( - - {options - .sort((a, b) => b.voteCount - a.voteCount) // Sort options by votes (highest first) - .map((option, index) => ( - - - - {`${index + 1}. ${option.optionName}`} - - - {option.voteCount} votes - - - - + /> - ))} - - ); - }; \ No newline at end of file + + ))} + + ); +}; diff --git a/src/components/Embeds/VideoPlayer.tsx b/src/components/Embeds/VideoPlayer.tsx index c28bc99..f0f1c4c 100644 --- a/src/components/Embeds/VideoPlayer.tsx +++ b/src/components/Embeds/VideoPlayer.tsx @@ -1,101 +1,106 @@ -import React, { useContext, useEffect, useMemo, useRef, useState } from 'react' -import ReactDOM from 'react-dom' -import { Box, IconButton, Slider } from '@mui/material' -import { CircularProgress, Typography } from '@mui/material' -import { Key } from 'ts-key-enum' +import { + FC, + KeyboardEvent, + useCallback, + useContext, + useEffect, + useMemo, + useRef, + useState, +} from 'react'; +import ReactDOM from 'react-dom'; +import { Box, IconButton, Slider } from '@mui/material'; +import { CircularProgress, Typography } from '@mui/material'; +import { Key } from 'ts-key-enum'; import { PlayArrow, Pause, VolumeUp, Fullscreen, - PictureInPicture, VolumeOff, Calculate -} from '@mui/icons-material' -import { styled } from '@mui/system' -import { Refresh } from '@mui/icons-material' + VolumeOff, +} from '@mui/icons-material'; +import { styled } from '@mui/system'; +import { Refresh } from '@mui/icons-material'; +import { QORTAL_APP_CONTEXT, getBaseApiReact } from '../../App'; +import { resourceKeySelector } from '../../atoms/global'; -import { Menu, MenuItem } from '@mui/material' -import { MoreVert as MoreIcon } from '@mui/icons-material' -import { GlobalContext, getBaseApiReact } from '../../App' -import { resourceKeySelector } from '../../atoms/global' -import { useRecoilValue } from 'recoil' +import { useAtomValue } from 'jotai'; const VideoContainer = styled(Box)` - position: relative; + align-items: center; display: flex; flex-direction: column; - align-items: center; - justify-content: center; - width: 100%; height: 100%; + justify-content: center; margin: 0px; padding: 0px; -` + position: relative; + width: 100%; +`; const VideoElement = styled('video')` - width: 100%; + background: rgb(33, 33, 33); height: auto; max-height: calc(100vh - 150px); - background: rgb(33, 33, 33); -` + width: 100%; +`; const ControlsContainer = styled(Box)` - position: absolute; - display: flex; align-items: center; - justify-content: space-between; - bottom: 0; - left: 0; - right: 0; - padding: 8px; background-color: rgba(0, 0, 0, 0.6); -` + bottom: 0; + display: flex; + justify-content: space-between; + left: 0; + padding: 8px; + position: absolute; + right: 0; +`; interface VideoPlayerProps { - src?: string - poster?: string - name?: string - identifier?: string - service?: string - autoplay?: boolean - from?: string | null - customStyle?: any - user?: string + autoplay?: boolean; + customStyle?: any; + from?: string | null; + identifier?: string; + name?: string; + poster?: string; + service?: string; + src?: string | null; + user?: string; } -export const VideoPlayer: React.FC = ({ - poster, - name, - identifier, - service, +// TODO translate and theme (optional) +export const VideoPlayer: FC = ({ autoplay = true, - from = null, customStyle = {}, - node + from = null, + identifier, + name, + node, + poster, + service, }) => { - - const keyIdentifier = useMemo(()=> { - - if(name && identifier && service){ - return `${service}-${name}-${identifier}` + const keyIdentifier = useMemo(() => { + if (name && identifier && service) { + return `${service}-${name}-${identifier}`; } else { - return undefined + return undefined; } - }, [service, name, identifier]) - const download = useRecoilValue(resourceKeySelector(keyIdentifier)); - const { downloadResource } = useContext(GlobalContext); + }, [service, name, identifier]); - const videoRef = useRef(null) - const [playing, setPlaying] = useState(false) - const [volume, setVolume] = useState(1) - const [mutedVolume, setMutedVolume] = useState(1) - const [isMuted, setIsMuted] = useState(false) - const [progress, setProgress] = useState(0) - const [isLoading, setIsLoading] = useState(false) - const [canPlay, setCanPlay] = useState(false) - const [startPlay, setStartPlay] = useState(false) - const [isMobileView, setIsMobileView] = useState(false) - const [playbackRate, setPlaybackRate] = useState(1) - const [anchorEl, setAnchorEl] = useState(null) - const reDownload = useRef(false) + const download = useAtomValue(resourceKeySelector(keyIdentifier)); + const { downloadResource } = useContext(QORTAL_APP_CONTEXT); + const videoRef = useRef(null); + const [playing, setPlaying] = useState(false); + const [volume, setVolume] = useState(1); + const [mutedVolume, setMutedVolume] = useState(1); + const [isMuted, setIsMuted] = useState(false); + const [progress, setProgress] = useState(0); + const [isLoading, setIsLoading] = useState(false); + const [canPlay, setCanPlay] = useState(false); + const [startPlay, setStartPlay] = useState(false); + const [playbackRate, setPlaybackRate] = useState(1); + const [anchorEl, setAnchorEl] = useState(null); + const reDownload = useRef(false); const resetVideoState = () => { // Reset all states to their initial values @@ -107,10 +112,9 @@ export const VideoPlayer: React.FC = ({ setIsLoading(false); setCanPlay(false); setStartPlay(false); - setIsMobileView(false); setPlaybackRate(1); setAnchorEl(null); - + // Reset refs to their initial values if (videoRef.current) { videoRef.current.pause(); // Ensure the video is paused @@ -120,18 +124,19 @@ export const VideoPlayer: React.FC = ({ }; const src = useMemo(() => { - if(name && identifier && service){ - return `${node || getBaseApiReact()}/arbitrary/${service}/${name}/${identifier}` - } - return '' - }, [service, name, identifier]) + if (name && identifier && service) { + return `${node || getBaseApiReact()}/arbitrary/${service}/${name}/${identifier}`; + } + return null; + }, [service, name, identifier]); + + useEffect(() => { + resetVideoState(); + }, [keyIdentifier]); - useEffect(()=> { - resetVideoState() - }, [keyIdentifier]) const resourceStatus = useMemo(() => { - return download?.status || {} - }, [download]) + return download?.status || {}; + }, [download]); const minSpeed = 0.25; const maxSpeed = 4.0; @@ -139,306 +144,342 @@ export const VideoPlayer: React.FC = ({ const updatePlaybackRate = (newSpeed: number) => { if (videoRef.current) { - if (newSpeed > maxSpeed || newSpeed < minSpeed) - newSpeed = minSpeed - videoRef.current.playbackRate = newSpeed - setPlaybackRate(newSpeed) + if (newSpeed > maxSpeed || newSpeed < minSpeed) newSpeed = minSpeed; + videoRef.current.playbackRate = newSpeed; + setPlaybackRate(newSpeed); } - } + }; const increaseSpeed = (wrapOverflow = true) => { - const changedSpeed = playbackRate + speedChange - let newSpeed = wrapOverflow ? changedSpeed : Math.min(changedSpeed, maxSpeed) - + const changedSpeed = playbackRate + speedChange; + let newSpeed = wrapOverflow + ? changedSpeed + : Math.min(changedSpeed, maxSpeed); if (videoRef.current) { updatePlaybackRate(newSpeed); } - } + }; const decreaseSpeed = () => { if (videoRef.current) { updatePlaybackRate(playbackRate - speedChange); } - } - + }; const togglePlay = async () => { - if (!videoRef.current) return - setStartPlay(true) + if (!videoRef.current) return; + setStartPlay(true); if (!src || resourceStatus?.status !== 'READY') { ReactDOM.flushSync(() => { - setIsLoading(true) - }) - getSrc() + setIsLoading(true); + }); + getSrc(); } if (playing) { - videoRef.current.pause() + videoRef.current.pause(); } else { - videoRef.current.play() + videoRef.current.play(); } - setPlaying(!playing) - } - + setPlaying(!playing); + }; const onVolumeChange = (_: any, value: number | number[]) => { - if (!videoRef.current) return - videoRef.current.volume = value as number - setVolume(value as number) - setIsMuted(false) - } + if (!videoRef.current) return; + videoRef.current.volume = value as number; + setVolume(value as number); + setIsMuted(false); + }; const onProgressChange = (_: any, value: number | number[]) => { - if (!videoRef.current) return - videoRef.current.currentTime = value as number - setProgress(value as number) + if (!videoRef.current) return; + videoRef.current.currentTime = value as number; + setProgress(value as number); if (!playing) { - videoRef.current.play() - setPlaying(true) + videoRef.current.play(); + setPlaying(true); } - } + }; const handleEnded = () => { - setPlaying(false) - } + setPlaying(false); + }; const updateProgress = () => { - if (!videoRef.current) return - setProgress(videoRef.current.currentTime) - } + if (!videoRef.current) return; + setProgress(videoRef.current.currentTime); + }; - const [isFullscreen, setIsFullscreen] = useState(false) + const [isFullscreen, setIsFullscreen] = useState(false); const enterFullscreen = () => { - if (!videoRef.current) return + if (!videoRef.current) return; if (videoRef.current.requestFullscreen) { - videoRef.current.requestFullscreen() + videoRef.current.requestFullscreen(); } - } + }; const exitFullscreen = () => { if (document.exitFullscreen) { - document.exitFullscreen() + document.exitFullscreen(); } - } + }; const toggleFullscreen = () => { - isFullscreen ? exitFullscreen() : enterFullscreen() - } - + isFullscreen ? exitFullscreen() : enterFullscreen(); + }; useEffect(() => { const handleFullscreenChange = () => { - setIsFullscreen(!!document.fullscreenElement) - } + setIsFullscreen(!!document.fullscreenElement); + }; - document.addEventListener('fullscreenchange', handleFullscreenChange) + document.addEventListener('fullscreenchange', handleFullscreenChange); return () => { - document.removeEventListener('fullscreenchange', handleFullscreenChange) - } - }, []) - - + document.removeEventListener('fullscreenchange', handleFullscreenChange); + }; + }, []); const handleCanPlay = () => { - setIsLoading(false) - setCanPlay(true) - } + setIsLoading(false); + setCanPlay(true); + }; - const getSrc = React.useCallback(async () => { - if (!name || !identifier || !service) return + const getSrc = useCallback(async () => { + if (!name || !identifier || !service) return; try { downloadResource({ name, service, - identifier - }) - } catch (error) { - console.error(error) + identifier, + }); + } catch (error) { + console.error(error); } - }, [identifier, name, service]) - - - + }, [identifier, name, service]); function formatTime(seconds: number): string { - seconds = Math.floor(seconds) - let minutes: number | string = Math.floor(seconds / 60) - let hours: number | string = Math.floor(minutes / 60) + seconds = Math.floor(seconds); + let minutes: number | string = Math.floor(seconds / 60); + let hours: number | string = Math.floor(minutes / 60); - let remainingSeconds: number | string = seconds % 60 - let remainingMinutes: number | string = minutes % 60 + let remainingSeconds: number | string = seconds % 60; + let remainingMinutes: number | string = minutes % 60; if (remainingSeconds < 10) { - remainingSeconds = '0' + remainingSeconds + remainingSeconds = '0' + remainingSeconds; } if (remainingMinutes < 10) { - remainingMinutes = '0' + remainingMinutes + remainingMinutes = '0' + remainingMinutes; } if (hours === 0) { - hours = '' - } - else { - hours = hours + ':' + hours = ''; + } else { + hours = hours + ':'; } - return hours + remainingMinutes + ':' + remainingSeconds + return hours + remainingMinutes + ':' + remainingSeconds; } const reloadVideo = () => { - if (!videoRef.current) return - const currentTime = videoRef.current.currentTime - videoRef.current.src = src - videoRef.current.load() - videoRef.current.currentTime = currentTime + if (!videoRef.current) return; + const currentTime = videoRef.current.currentTime; + videoRef.current.src = src; + videoRef.current.load(); + videoRef.current.currentTime = currentTime; if (playing) { - videoRef.current.play() + videoRef.current.play(); } - } + }; useEffect(() => { if ( resourceStatus?.status === 'DOWNLOADED' && reDownload?.current === false ) { - getSrc() - reDownload.current = true + getSrc(); + reDownload.current = true; } - }, [getSrc, resourceStatus]) + }, [getSrc, resourceStatus]); const handleMenuOpen = (event: any) => { - setAnchorEl(event.currentTarget) - } + setAnchorEl(event.currentTarget); + }; const handleMenuClose = () => { - setAnchorEl(null) - } + setAnchorEl(null); + }; useEffect(() => { - const videoWidth = videoRef?.current?.offsetWidth - if (videoWidth && videoWidth <= 600) { - setIsMobileView(true) - } - }, [canPlay]) + const videoWidth = videoRef?.current?.offsetWidth; + }, [canPlay]); const getDownloadProgress = (current: number, total: number) => { - const progress = current / total * 100; - return Number.isNaN(progress) ? '' : progress.toFixed(0) + '%' - } + const progress = (current / total) * 100; + return Number.isNaN(progress) ? '' : progress.toFixed(0) + '%'; + }; + const mute = () => { - setIsMuted(true) - setMutedVolume(volume) - setVolume(0) - if (videoRef.current) videoRef.current.volume = 0 - } + setIsMuted(true); + setMutedVolume(volume); + setVolume(0); + if (videoRef.current) videoRef.current.volume = 0; + }; + const unMute = () => { - setIsMuted(false) - setVolume(mutedVolume) - if (videoRef.current) videoRef.current.volume = mutedVolume - } + setIsMuted(false); + setVolume(mutedVolume); + if (videoRef.current) videoRef.current.volume = mutedVolume; + }; const toggleMute = () => { isMuted ? unMute() : mute(); - } + }; const changeVolume = (volumeChange: number) => { if (videoRef.current) { const minVolume = 0; const maxVolume = 1; + let newVolume = volumeChange + volume; - let newVolume = volumeChange + volume + newVolume = Math.max(newVolume, minVolume); + newVolume = Math.min(newVolume, maxVolume); - newVolume = Math.max(newVolume, minVolume) - newVolume = Math.min(newVolume, maxVolume) - - setIsMuted(false) - setMutedVolume(newVolume) - videoRef.current.volume = newVolume + setIsMuted(false); + setMutedVolume(newVolume); + videoRef.current.volume = newVolume; setVolume(newVolume); } + }; - } const setProgressRelative = (secondsChange: number) => { if (videoRef.current) { - const currentTime = videoRef.current?.currentTime - const minTime = 0 - const maxTime = videoRef.current?.duration || 100 + const currentTime = videoRef.current?.currentTime; + const minTime = 0; + const maxTime = videoRef.current?.duration || 100; let newTime = currentTime + secondsChange; - newTime = Math.max(newTime, minTime) - newTime = Math.min(newTime, maxTime) + newTime = Math.max(newTime, minTime); + newTime = Math.min(newTime, maxTime); videoRef.current.currentTime = newTime; setProgress(newTime); } - } + }; const setProgressAbsolute = (videoPercent: number) => { if (videoRef.current) { - videoPercent = Math.min(videoPercent, 100) - videoPercent = Math.max(videoPercent, 0) - const finalTime = videoRef.current?.duration * videoPercent / 100 - videoRef.current.currentTime = finalTime + videoPercent = Math.min(videoPercent, 100); + videoPercent = Math.max(videoPercent, 0); + const finalTime = (videoRef.current?.duration * videoPercent) / 100; + videoRef.current.currentTime = finalTime; setProgress(finalTime); } - } + }; - - const keyboardShortcutsDown = (e: React.KeyboardEvent) => { - e.preventDefault() + const keyboardShortcutsDown = (e: KeyboardEvent) => { + e.preventDefault(); switch (e.key) { - case Key.Add: increaseSpeed(false); break; - case '+': increaseSpeed(false); break; - case '>': increaseSpeed(false); break; + case Key.Add: + increaseSpeed(false); + break; + case '+': + increaseSpeed(false); + break; + case '>': + increaseSpeed(false); + break; - case Key.Subtract: decreaseSpeed(); break; - case '-': decreaseSpeed(); break; - case '<': decreaseSpeed(); break; + case Key.Subtract: + decreaseSpeed(); + break; + case '-': + decreaseSpeed(); + break; + case '<': + decreaseSpeed(); + break; - case Key.ArrowLeft: { - if (e.shiftKey) setProgressRelative(-300); - else if (e.ctrlKey) setProgressRelative(-60); - else if (e.altKey) setProgressRelative(-10); - else setProgressRelative(-5); - } break; + case Key.ArrowLeft: + { + if (e.shiftKey) setProgressRelative(-300); + else if (e.ctrlKey) setProgressRelative(-60); + else if (e.altKey) setProgressRelative(-10); + else setProgressRelative(-5); + } + break; - case Key.ArrowRight: { - if (e.shiftKey) setProgressRelative(300); - else if (e.ctrlKey) setProgressRelative(60); - else if (e.altKey) setProgressRelative(10); - else setProgressRelative(5); - } break; + case Key.ArrowRight: + { + if (e.shiftKey) setProgressRelative(300); + else if (e.ctrlKey) setProgressRelative(60); + else if (e.altKey) setProgressRelative(10); + else setProgressRelative(5); + } + break; - case Key.ArrowDown: changeVolume(-0.05); break; - case Key.ArrowUp: changeVolume(0.05); break; + case Key.ArrowDown: + changeVolume(-0.05); + break; + case Key.ArrowUp: + changeVolume(0.05); + break; } - } + }; - const keyboardShortcutsUp = (e: React.KeyboardEvent) => { - e.preventDefault() + const keyboardShortcutsUp = (e: KeyboardEvent) => { + e.preventDefault(); switch (e.key) { - case ' ': togglePlay(); break; - case 'm': toggleMute(); break; + case ' ': + togglePlay(); + break; + case 'm': + toggleMute(); + break; - case 'f': enterFullscreen(); break; - case Key.Escape: exitFullscreen(); break; + case 'f': + enterFullscreen(); + break; + case Key.Escape: + exitFullscreen(); + break; - case '0': setProgressAbsolute(0); break; - case '1': setProgressAbsolute(10); break; - case '2': setProgressAbsolute(20); break; - case '3': setProgressAbsolute(30); break; - case '4': setProgressAbsolute(40); break; - case '5': setProgressAbsolute(50); break; - case '6': setProgressAbsolute(60); break; - case '7': setProgressAbsolute(70); break; - case '8': setProgressAbsolute(80); break; - case '9': setProgressAbsolute(90); break; + case '0': + setProgressAbsolute(0); + break; + case '1': + setProgressAbsolute(10); + break; + case '2': + setProgressAbsolute(20); + break; + case '3': + setProgressAbsolute(30); + break; + case '4': + setProgressAbsolute(40); + break; + case '5': + setProgressAbsolute(50); + break; + case '6': + setProgressAbsolute(60); + break; + case '7': + setProgressAbsolute(70); + break; + case '8': + setProgressAbsolute(80); + break; + case '9': + setProgressAbsolute(90); + break; } - } + }; return ( = ({ height: '100%', }} > - {isLoading && ( = ({ sx={{ display: 'flex', flexDirection: 'column', - gap: '10px' + gap: '10px', }} > - - - {resourceStatus?.status === 'REFETCHING' ? ( - <> - <> - {getDownloadProgress(resourceStatus?.localChunkCount, resourceStatus?.totalChunkCount)} - - <> Refetching data in 25 seconds - - ) : resourceStatus?.status === 'DOWNLOADED' ? ( - <>Download Completed: building tutorial video... - ) : resourceStatus?.status !== 'READY' ? ( + + {resourceStatus?.status === 'REFETCHING' ? ( + <> <> - {getDownloadProgress(resourceStatus?.localChunkCount || 0, resourceStatus?.totalChunkCount || 100)} - + {getDownloadProgress( + resourceStatus?.localChunkCount, + resourceStatus?.totalChunkCount + )} - ) : ( - <>Fetching tutorial from the Qortal Network... - )} - - + + <> Refetching data in 25 seconds + + ) : resourceStatus?.status === 'DOWNLOADED' ? ( + <>Download Completed: building tutorial video... + ) : resourceStatus?.status !== 'READY' ? ( + <> + {getDownloadProgress( + resourceStatus?.localChunkCount || 0, + resourceStatus?.totalChunkCount || 100 + )} + + ) : ( + <>Fetching tutorial from the Qortal Network... + )} + )} {((!src && !isLoading) || !startPlay) && ( { - togglePlay() + togglePlay(); }} + position="absolute" + right={0} sx={{ - cursor: 'pointer' + cursor: 'pointer', }} + top={0} + zIndex={500} > )} - - + > + + - {isMobileView && canPlay ? ( + {canPlay ? ( <> @@ -577,82 +626,13 @@ export const VideoPlayer: React.FC = ({ - - - - - - - - - - - - increaseSpeed()}> - - Speed: {playbackRate}x - - - - - - - - ) : canPlay ? ( - <> - - {playing ? : } - - + = ({ max={videoRef.current?.duration || 100} sx={{ flexGrow: 1, mx: 2, color: 'var(--Mail-Background)' }} /> + = ({ !videoRef.current?.duration || !progress ? 'hidden' : 'visible', - flexShrink: 0 + flexShrink: 0, }} > {progress && videoRef.current?.duration && formatTime(progress)}/ @@ -677,15 +658,17 @@ export const VideoPlayer: React.FC = ({ videoRef.current?.duration && formatTime(videoRef.current?.duration)} + {isMuted ? : } + = ({ step={0.01} sx={{ maxWidth: '100px', - color: 'var(--Mail-Background)' + color: 'var(--Mail-Background)', }} /> increaseSpeed()} > Speed: {playbackRate}x + @@ -719,5 +703,5 @@ export const VideoPlayer: React.FC = ({ ) : null} - ) -} + ); +}; diff --git a/src/components/Explore/Explore.tsx b/src/components/Explore/Explore.tsx index 61037d7..4ec5195 100644 --- a/src/components/Explore/Explore.tsx +++ b/src/components/Explore/Explore.tsx @@ -1,129 +1,143 @@ -import { Box, ButtonBase, Typography } from "@mui/material"; -import React from "react"; -import ChatIcon from "@mui/icons-material/Chat"; -import qTradeLogo from "../../assets/Icons/q-trade-logo.webp"; -import AppsIcon from "@mui/icons-material/Apps"; -import { executeEvent } from "../../utils/events"; +import { Box, ButtonBase, Typography, useTheme } from '@mui/material'; +import ChatIcon from '@mui/icons-material/Chat'; +import qTradeLogo from '../../assets/Icons/q-trade-logo.webp'; +import AppsIcon from '@mui/icons-material/Apps'; +import { executeEvent } from '../../utils/events'; import AccountBalanceWalletIcon from '@mui/icons-material/AccountBalanceWallet'; +import { useTranslation } from 'react-i18next'; +export const Explore = ({ setDesktopViewMode }) => { + const theme = useTheme(); + const { t } = useTranslation(['auth', 'core', 'group', 'tutorial']); -export const Explore = ({setDesktopViewMode}) => { return ( { - executeEvent("addTab", { - data: { service: "APP", name: "q-trade" }, - }); - executeEvent("open-apps-mode", {}); - }} + executeEvent('addTab', { + data: { service: 'APP', name: 'q-trade' }, + }); + executeEvent('open-apps-mode', {}); + }} > + - Trade QORT + {t('tutorial:initial.trade_qort', { + postProcess: 'capitalizeFirstChar', + })} + { + setDesktopViewMode('apps'); }} - onClick={()=> { - setDesktopViewMode('apps') - - }} > + - See Apps + {t('tutorial:initial.see_apps', { + postProcess: 'capitalizeFirstChar', + })} + { - executeEvent("openGroupMessage", { - from: "0" , - }); - }} + executeEvent('openGroupMessage', { + from: '0', + }); + }} > + - General Chat + {t('tutorial:initial.general_chat', { + postProcess: 'capitalizeFirstChar', + })} + { - executeEvent("openWalletsApp", { - - }); - }} + executeEvent('openWalletsApp', {}); + }} > + - Wallets + {t('core:wallet.wallet_other', { + postProcess: 'capitalizeFirstChar', + })} diff --git a/src/components/GeneralNotifications.tsx b/src/components/GeneralNotifications.tsx index c7336dc..4164214 100644 --- a/src/components/GeneralNotifications.tsx +++ b/src/components/GeneralNotifications.tsx @@ -1,5 +1,4 @@ -import React, { useCallback, useEffect, useMemo, useRef, useState } from "react"; - +import { useState } from 'react'; import { Box, ButtonBase, @@ -8,58 +7,85 @@ import { Popover, Tooltip, Typography, -} from "@mui/material"; -import NotificationsIcon from "@mui/icons-material/Notifications"; -import AccountBalanceWalletIcon from "@mui/icons-material/AccountBalanceWallet"; -import { formatDate } from "../utils/time"; -import { useHandlePaymentNotification } from "../hooks/useHandlePaymentNotification"; -import { executeEvent } from "../utils/events"; + useTheme, +} from '@mui/material'; +import NotificationsIcon from '@mui/icons-material/Notifications'; +import AccountBalanceWalletIcon from '@mui/icons-material/AccountBalanceWallet'; +import { formatDate } from '../utils/time'; +import { useHandlePaymentNotification } from '../hooks/useHandlePaymentNotification'; +import { executeEvent } from '../utils/events'; +import { useTranslation } from 'react-i18next'; export const GeneralNotifications = ({ address }) => { const [anchorEl, setAnchorEl] = useState(null); - const {latestTx, + + const { + latestTx, getNameOrAddressOfSenderMiddle, - hasNewPayment, setLastEnteredTimestampPayment, nameAddressOfSender} = useHandlePaymentNotification(address) - + hasNewPayment, + setLastEnteredTimestampPayment, + nameAddressOfSender, + } = useHandlePaymentNotification(address); + const handlePopupClick = (event) => { event.stopPropagation(); // Prevent parent onClick from firing setAnchorEl(event.currentTarget); }; + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + const theme = useTheme(); + return ( <> { handlePopupClick(e); - - }} style={{}} > - PAYMENT NOTIFICATION} - placement="left" - arrow - sx={{ fontSize: "24" }} - slotProps={{ - tooltip: { - sx: { - color: "#ffffff", - backgroundColor: "#444444", - }, - }, - arrow: { - sx: { - color: "#444444", - }, - }, - }} - > - + {t('core:payment_notification')} + + } + placement="left" + arrow + sx={{ fontSize: '24' }} + slotProps={{ + tooltip: { + sx: { + color: theme.palette.text.primary, + backgroundColor: theme.palette.background.paper, + }, + }, + arrow: { + sx: { + color: theme.palette.text.primary, + }, + }, }} - /> + > + @@ -67,81 +93,93 @@ export const GeneralNotifications = ({ address }) => { open={!!anchorEl} anchorEl={anchorEl} onClose={() => { - if(hasNewPayment){ - setLastEnteredTimestampPayment(Date.now()) + if (hasNewPayment) { + setLastEnteredTimestampPayment(Date.now()); } - setAnchorEl(null) - + setAnchorEl(null); }} // Close popover on click outside > - {!hasNewPayment && No new notifications} + {!hasNewPayment && ( + + {t('core:message.generic.no_notifications')} + + )} {hasNewPayment && ( { - setAnchorEl(null) - executeEvent('openWalletsApp', {}) + onClick={() => { + setAnchorEl(null); + executeEvent('openWalletsApp', {}); }} > - - - {" "} - {formatDate(latestTx?.timestamp)} - - - - {latestTx?.amount} - - {nameAddressOfSender.current[latestTx?.creatorAddress] || getNameOrAddressOfSenderMiddle(latestTx?.creatorAddress)} - + > + + {formatDate(latestTx?.timestamp)} + + + + {latestTx?.amount} + + + + {nameAddressOfSender.current[latestTx?.creatorAddress] || + getNameOrAddressOfSenderMiddle(latestTx?.creatorAddress)} + )} diff --git a/src/components/GlobalActions/GlobalActions.tsx b/src/components/GlobalActions/GlobalActions.tsx index 6dd845c..0e5a34a 100644 --- a/src/components/GlobalActions/GlobalActions.tsx +++ b/src/components/GlobalActions/GlobalActions.tsx @@ -1,10 +1,9 @@ -import React from 'react' -import { JoinGroup } from './JoinGroup' +import { JoinGroup } from './JoinGroup'; -export const GlobalActions = ({memberGroups}) => { +export const GlobalActions = () => { return ( <> - + - ) -} + ); +}; diff --git a/src/components/GlobalActions/JoinGroup.tsx b/src/components/GlobalActions/JoinGroup.tsx index f03430b..c28176a 100644 --- a/src/components/GlobalActions/JoinGroup.tsx +++ b/src/components/GlobalActions/JoinGroup.tsx @@ -1,29 +1,43 @@ -import React, { useContext, useEffect, useMemo, useState } from "react"; -import { subscribeToEvent, unsubscribeFromEvent } from "../../utils/events"; +import { useContext, useEffect, useMemo, useState } from 'react'; +import { subscribeToEvent, unsubscribeFromEvent } from '../../utils/events'; import { Box, - Button, ButtonBase, CircularProgress, Dialog, DialogActions, DialogContent, Typography, -} from "@mui/material"; -import { CustomButton, CustomButtonAccept } from "../../App-styles"; -import { getBaseApiReact, MyContext } from "../../App"; -import { getFee } from "../../background"; -import { CustomizedSnackbars } from "../Snackbar/Snackbar"; -import { FidgetSpinner } from "react-loader-spinner"; + useTheme, +} from '@mui/material'; +import { CustomButtonAccept } from '../../styles/App-styles'; +import { getBaseApiReact, QORTAL_APP_CONTEXT } from '../../App'; +import { getFee } from '../../background/background.ts'; +import { CustomizedSnackbars } from '../Snackbar/Snackbar'; +import { FidgetSpinner } from 'react-loader-spinner'; +import { useAtom, useSetAtom } from 'jotai'; +import { memberGroupsAtom, txListAtom } from '../../atoms/global'; +import { useTranslation } from 'react-i18next'; -export const JoinGroup = ({ memberGroups }) => { - const { show, setTxList } = useContext(MyContext); +export const JoinGroup = () => { + const { show } = useContext(QORTAL_APP_CONTEXT); + const setTxList = useSetAtom(txListAtom); + const [memberGroups] = useAtom(memberGroupsAtom); const [openSnack, setOpenSnack] = useState(false); const [infoSnack, setInfoSnack] = useState(null); const [groupInfo, setGroupInfo] = useState(null); const [isLoadingInfo, setIsLoadingInfo] = useState(false); const [isOpen, setIsOpen] = useState(false); + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); const [isLoadingJoinGroup, setIsLoadingJoinGroup] = useState(false); + const handleJoinGroup = async (e) => { setGroupInfo(null); const groupId = e?.detail?.groupId; @@ -35,6 +49,7 @@ export const JoinGroup = ({ memberGroups }) => { const groupData = await response.json(); setGroupInfo(groupData); } catch (error) { + console.log(error); } finally { setIsLoadingInfo(false); } @@ -42,45 +57,61 @@ export const JoinGroup = ({ memberGroups }) => { }; useEffect(() => { - subscribeToEvent("globalActionJoinGroup", handleJoinGroup); + subscribeToEvent('globalActionJoinGroup', handleJoinGroup); return () => { - unsubscribeFromEvent("globalActionJoinGroup", handleJoinGroup); + unsubscribeFromEvent('globalActionJoinGroup', handleJoinGroup); }; }, []); - const isInGroup = useMemo(()=> { - return !!memberGroups.find((item)=> +item?.groupId === +groupInfo?.groupId) - }, [memberGroups, groupInfo]) + const isInGroup = useMemo(() => { + return !!memberGroups.find( + (item) => +item?.groupId === +groupInfo?.groupId + ); + }, [memberGroups, groupInfo]); + const joinGroup = async (group, isOpen) => { try { const groupId = group.groupId; - const fee = await getFee("JOIN_GROUP"); + const fee = await getFee('JOIN_GROUP'); + await show({ - message: "Would you like to perform an JOIN_GROUP transaction?", - publishFee: fee.fee + " QORT", + message: t('core:message.question.perform_transaction', { + action: 'JOIN_GROUP', + postProcess: 'capitalizeFirstChar', + }), + publishFee: fee.fee + ' QORT', }); + setIsLoadingJoinGroup(true); + await new Promise((res, rej) => { window - .sendMessage("joinGroup", { + .sendMessage('joinGroup', { groupId, }) .then((response) => { if (!response?.error) { setInfoSnack({ - type: "success", - message: - "Successfully requested to join group. It may take a couple of minutes for the changes to propagate", + type: 'success', + message: t('group:message.success.group_join', { + postProcess: 'capitalizeFirstChar', + }), }); if (isOpen) { setTxList((prev) => [ { ...response, - type: "joined-group", - label: `Joined Group ${group?.groupName}: awaiting confirmation`, - labelDone: `Joined Group ${group?.groupName}: success!`, + type: 'joined-group', + label: t('group:message.success.group_join_label', { + group_name: group?.groupName, + postProcess: 'capitalizeFirstChar', + }), + labelDone: t('group:message.success.group_join_label', { + group_name: group?.groupName, + postProcess: 'capitalizeFirstChar', + }), done: false, groupId, }, @@ -90,22 +121,27 @@ export const JoinGroup = ({ memberGroups }) => { setTxList((prev) => [ { ...response, - type: "joined-group-request", - label: `Requested to join Group ${group?.groupName}: awaiting confirmation`, - labelDone: `Requested to join Group ${group?.groupName}: success!`, + type: 'joined-group-request', + label: t('group:message.success.group_join_request', { + group_name: group?.groupName, + postProcess: 'capitalizeFirstChar', + }), + labelDone: t('group:message.success.group_join_outcome', { + group_name: group?.groupName, + postProcess: 'capitalizeFirstChar', + }), done: false, groupId, }, ...prev, ]); } - setOpenSnack(true); res(response); return; } else { setInfoSnack({ - type: "error", + type: 'error', message: response?.error, }); setOpenSnack(true); @@ -114,8 +150,12 @@ export const JoinGroup = ({ memberGroups }) => { }) .catch((error) => { setInfoSnack({ - type: "error", - message: error.message || "An error occurred", + type: 'error', + message: + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }), }); setOpenSnack(true); rej(error); @@ -123,10 +163,12 @@ export const JoinGroup = ({ memberGroups }) => { }); setIsLoadingJoinGroup(false); } catch (error) { + console.log(error); } finally { setIsLoadingJoinGroup(false); } }; + return ( <> { {!groupInfo && ( - {" "} {" "} + /> )} - Group name: {` ${groupInfo?.groupName}`} + {t('group:group.name', { postProcess: 'capitalizeFirstChar' })}:{' '} + {` ${groupInfo?.groupName}`} + - Number of members: {` ${groupInfo?.memberCount}`} + {t('group:group.member_number', { + postProcess: 'capitalizeFirstChar', + })} + : {` ${groupInfo?.memberCount}`} + {groupInfo?.description && ( @@ -193,59 +240,69 @@ export const JoinGroup = ({ memberGroups }) => { )} {isInGroup && ( - - *You are already in this group! - + + {t('group:message.generic.already_in_group', { + postProcess: 'capitalizeFirstChar', + })} + )} {!isInGroup && groupInfo?.isOpen === false && ( - *This is a closed/private group, so you will need to wait until - an admin accepts your request + {t('group:message.generic.closed_group', { + postProcess: 'capitalizeFirstChar', + })} )} + - { + { joinGroup(groupInfo, groupInfo?.isOpen); setIsOpen(false); - }} disabled={isInGroup}> - - Join - + + {t('core:action.join', { + postProcess: 'capitalizeFirstChar', + })} + - + setIsOpen(false)} > - Close + {t('core:action.close', { + postProcess: 'capitalizeFirstChar', + })} @@ -259,14 +316,14 @@ export const JoinGroup = ({ memberGroups }) => { {isLoadingJoinGroup && ( ` +export const Label = styled('label')` + display: block; font-family: 'IBM Plex Sans', sans-serif; font-size: 14px; - display: block; - margin-bottom: 4px; font-weight: 400; - ` -); -const Transition = React.forwardRef(function Transition( - props: TransitionProps & { - children: React.ReactElement; - }, - ref: React.Ref -) { - return ; -}); + margin-bottom: 4px; +`; export const AddGroup = ({ address, open, setOpen }) => { - const {show, setTxList} = React.useContext(MyContext) + const { show } = useContext(QORTAL_APP_CONTEXT); + const setTxList = useSetAtom(txListAtom); - const [tab, setTab] = React.useState("create"); - const [openAdvance, setOpenAdvance] = React.useState(false); + const [openAdvance, setOpenAdvance] = useState(false); + const [name, setName] = useState(''); + const [description, setDescription] = useState(''); + const [groupType, setGroupType] = useState('1'); + const [approvalThreshold, setApprovalThreshold] = useState('40'); + const [minBlock, setMinBlock] = useState('5'); + const [maxBlock, setMaxBlock] = useState('21600'); + const [value, setValue] = useState(0); + const [openSnack, setOpenSnack] = useState(false); + const [infoSnack, setInfoSnack] = useState(null); - const [name, setName] = React.useState(""); - const [description, setDescription] = React.useState(""); - const [groupType, setGroupType] = React.useState("1"); - const [approvalThreshold, setApprovalThreshold] = React.useState("40"); - const [minBlock, setMinBlock] = React.useState("5"); - const [maxBlock, setMaxBlock] = React.useState("21600"); - const [value, setValue] = React.useState(0); - const [openSnack, setOpenSnack] = React.useState(false); - const [infoSnack, setInfoSnack] = React.useState(null); - - const handleChange = (event: React.SyntheticEvent, newValue: number) => { + const handleChange = (event: SyntheticEvent, newValue: number) => { setValue(newValue); }; + const handleClose = () => { setOpen(false); }; @@ -89,400 +84,570 @@ export const AddGroup = ({ address, open, setOpen }) => { setMaxBlock(event.target.value as string); }; - + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + const theme = useTheme(); const handleCreateGroup = async () => { try { - if(!name) throw new Error('Please provide a name') - if(!description) throw new Error('Please provide a description') + if (!name) + throw new Error( + t('group:message.error.name_required', { + postProcess: 'capitalizeFirstChar', + }) + ); + if (!description) + throw new Error( + t('group:message.error.description_required', { + postProcess: 'capitalizeFirstChar', + }) + ); - const fee = await getFee('CREATE_GROUP') - await show({ - message: "Would you like to perform an CREATE_GROUP transaction?" , - publishFee: fee.fee + ' QORT' - }) + const fee = await getFee('CREATE_GROUP'); - await new Promise((res, rej) => { - window.sendMessage("createGroup", { - groupName: name, - groupDescription: description, - groupType: +groupType, - groupApprovalThreshold: +approvalThreshold, - minBlock: +minBlock, - maxBlock: +maxBlock, - }) - .then((response) => { - if (!response?.error) { - setInfoSnack({ - type: "success", - message: "Successfully created group. It may take a couple of minutes for the changes to propagate", - }); - setOpenSnack(true); - setTxList((prev) => [ - { - ...response, - type: 'created-group', - label: `Created group ${name}: awaiting confirmation`, - labelDone: `Created group ${name}: success!`, - done: false, - }, - ...prev, - ]); - res(response); - return; - } - rej({ message: response.error }); - }) - .catch((error) => { - rej({ message: error.message || "An error occurred" }); + try { + await show({ + message: t('core:message.question.perform_transaction', { + action: 'CREATE_GROUP', + postProcess: 'capitalizeFirstChar', + }), + publishFee: fee.fee + ' QORT', }); - + } catch (error) { + console.log(error); + } + + await new Promise((res, rej) => { + window + .sendMessage('createGroup', { + groupName: name, + groupDescription: description, + groupType: +groupType, + groupApprovalThreshold: +approvalThreshold, + minBlock: +minBlock, + maxBlock: +maxBlock, + }) + .then((response) => { + if (!response?.error) { + setInfoSnack({ + type: 'success', + message: t('group:message.success.group_creation', { + postProcess: 'capitalizeFirstChar', + }), + }); + setOpenSnack(true); + setTxList((prev) => [ + { + ...response, + type: 'created-group', + label: t('group:message.success.group_creation_name', { + group_name: name, + postProcess: 'capitalizeFirstChar', + }), + labelDone: t('group:message.success.group_creation_label', { + group_name: name, + postProcess: 'capitalizeFirstChar', + }), + done: false, + }, + ...prev, + ]); + setName(''); + setDescription(''); + setGroupType('1'); + res(response); + return; + } + rej({ message: response.error }); + }) + .catch((error) => { + rej({ + message: + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }), + }); + }); }); } catch (error) { setInfoSnack({ - type: "error", + type: 'error', message: error?.message, }); setOpenSnack(true); } }; - function CustomTabPanel(props: TabPanelProps) { - const { children, value, index, ...other } = props; - - return ( - - ); - } - function a11yProps(index: number) { return { id: `simple-tab-${index}`, - "aria-controls": `simple-tabpanel-${index}`, + 'aria-controls': `simple-tabpanel-${index}`, }; } + const openGroupInvitesRequestFunc = () => { + setValue(2); + }; - const openGroupInvitesRequestFunc = ()=> { - setValue(2) - } - - React.useEffect(() => { - subscribeToEvent("openGroupInvitesRequest", openGroupInvitesRequestFunc); + useEffect(() => { + subscribeToEvent('openGroupInvitesRequest', openGroupInvitesRequestFunc); return () => { - unsubscribeFromEvent("openGroupInvitesRequest", openGroupInvitesRequestFunc); + unsubscribeFromEvent( + 'openGroupInvitesRequest', + openGroupInvitesRequestFunc + ); }; }, []); + if (!open) return null; + return ( - + - + - - Group Mgmt + + {t('group:group.management', { + postProcess: 'capitalizeFirstChar', + })} - - {/* */} + - - - - - - + + + + + + - + {value === 0 && ( - - - setName(e.target.value)} - /> - - - - - setDescription(e.target.value)} - /> - - - - - - setOpenAdvance((prev) => !prev)} - > - Advanced options - - {openAdvance ? : } - - - + setName(e.target.value)} + /> + - + + setDescription(e.target.value)} + /> + + - - - + + {t('group:advanced_options', { + postProcess: 'capitalizeFirstChar', + })} + + + {openAdvance ? : } + + + + + + + + + + + + + + + + + + + + + + + + + - )} + {value === 1 && ( - - - + + - )} - - {value === 2 && ( - - - - )} - + {value === 2 && ( + + + + )} - + + - + ); }; diff --git a/src/components/Group/AddGroupList.tsx b/src/components/Group/AddGroupList.tsx index ccd4850..db4460c 100644 --- a/src/components/Group/AddGroupList.tsx +++ b/src/components/Group/AddGroupList.tsx @@ -1,50 +1,62 @@ import { Box, - Button, ListItem, ListItemButton, ListItemText, Popover, TextField, Typography, -} from "@mui/material"; -import React, { + useTheme, +} from '@mui/material'; +import { useCallback, useContext, useEffect, useMemo, useRef, useState, -} from "react"; +} from 'react'; import { AutoSizer, CellMeasurer, CellMeasurerCache, List, -} from "react-virtualized"; -import _ from "lodash"; -import { MyContext, getBaseApiReact } from "../../App"; -import { LoadingButton } from "@mui/lab"; -import { getBaseApi, getFee } from "../../background"; +} from 'react-virtualized'; +import _ from 'lodash'; +import { QORTAL_APP_CONTEXT, getBaseApiReact } from '../../App'; +import { LoadingButton } from '@mui/lab'; +import { getFee } from '../../background/background.ts'; import LockIcon from '@mui/icons-material/Lock'; import NoEncryptionGmailerrorredIcon from '@mui/icons-material/NoEncryptionGmailerrorred'; -import { Spacer } from "../../common/Spacer"; +import { Spacer } from '../../common/Spacer'; +import { useTranslation } from 'react-i18next'; +import { useAtom, useSetAtom } from 'jotai'; +import { memberGroupsAtom, txListAtom } from '../../atoms/global'; + const cache = new CellMeasurerCache({ fixedWidth: true, defaultHeight: 50, }); export const AddGroupList = ({ setInfoSnack, setOpenSnack }) => { - const { memberGroups, show, setTxList } = useContext(MyContext); - + const { show } = useContext(QORTAL_APP_CONTEXT); + const [memberGroups] = useAtom(memberGroupsAtom); + const setTxList = useSetAtom(txListAtom); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); const [groups, setGroups] = useState([]); const [popoverAnchor, setPopoverAnchor] = useState(null); // Track which list item the popover is anchored to const [openPopoverIndex, setOpenPopoverIndex] = useState(null); // Track which list item has the popover open - const listRef = useRef(); - const [inputValue, setInputValue] = useState(""); + const listRef = useRef(null); + const [inputValue, setInputValue] = useState(''); const [filteredItems, setFilteredItems] = useState(groups); const [isLoading, setIsLoading] = useState(false); - + const theme = useTheme(); const handleFilter = useCallback( (query) => { if (query) { @@ -72,9 +84,7 @@ export const AddGroupList = ({ setInfoSnack, setOpenSnack }) => { const getGroups = async () => { try { - const response = await fetch( - `${getBaseApiReact()}/groups/?limit=0` - ); + const response = await fetch(`${getBaseApiReact()}/groups/?limit=0`); const groupData = await response.json(); const filteredGroup = groupData.filter( (item) => !memberGroups.find((group) => group.groupId === item.groupId) @@ -103,30 +113,45 @@ export const AddGroupList = ({ setInfoSnack, setOpenSnack }) => { const handleJoinGroup = async (group, isOpen) => { try { const groupId = group.groupId; - const fee = await getFee('JOIN_GROUP') - await show({ - message: "Would you like to perform an JOIN_GROUP transaction?" , - publishFee: fee.fee + ' QORT' - }) + + const fee = await getFee('JOIN_GROUP'); + + await show({ + message: t('core:message.question.perform_transaction', { + action: 'JOIN_GROUP', + postProcess: 'capitalizeFirstChar', + }), + publishFee: fee.fee + ' QORT', + }); setIsLoading(true); + await new Promise((res, rej) => { - window.sendMessage("joinGroup", { - groupId, - }) + window + .sendMessage('joinGroup', { + groupId, + }) .then((response) => { if (!response?.error) { setInfoSnack({ - type: "success", - message: "Successfully requested to join group. It may take a couple of minutes for the changes to propagate", + type: 'success', + message: t('group:message.success.join_group', { + postProcess: 'capitalizeFirstChar', + }), }); - + if (isOpen) { setTxList((prev) => [ { ...response, type: 'joined-group', - label: `Joined Group ${group?.groupName}: awaiting confirmation`, - labelDone: `Joined Group ${group?.groupName}: success!`, + label: t('group:message.success.group_join_label', { + group_name: group?.groupName, + postProcess: 'capitalizeFirstChar', + }), + labelDone: t('group:message.success.group_join_label', { + group_name: group?.groupName, + postProcess: 'capitalizeFirstChar', + }), done: false, groupId, }, @@ -137,22 +162,28 @@ export const AddGroupList = ({ setInfoSnack, setOpenSnack }) => { { ...response, type: 'joined-group-request', - label: `Requested to join Group ${group?.groupName}: awaiting confirmation`, - labelDone: `Requested to join Group ${group?.groupName}: success!`, + label: t('group:message.success.group_join_request', { + group_name: group?.groupName, + postProcess: 'capitalizeFirstChar', + }), + labelDone: t('group:message.success.group_join_outcome', { + group_name: group?.groupName, + postProcess: 'capitalizeFirstChar', + }), done: false, groupId, }, ...prev, ]); } - + setOpenSnack(true); handlePopoverClose(); res(response); return; } else { setInfoSnack({ - type: "error", + type: 'error', message: response?.error, }); setOpenSnack(true); @@ -161,18 +192,22 @@ export const AddGroupList = ({ setInfoSnack, setOpenSnack }) => { }) .catch((error) => { setInfoSnack({ - type: "error", - message: error.message || "An error occurred", + type: 'error', + message: + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }), }); setOpenSnack(true); rej(error); }); - }); setIsLoading(false); - } catch (error) {} finally { + } catch (error) { + console.log(error); + } finally { setIsLoading(false); - } }; @@ -195,55 +230,74 @@ export const AddGroupList = ({ setInfoSnack, setOpenSnack }) => { anchorEl={popoverAnchor} onClose={handlePopoverClose} anchorOrigin={{ - vertical: "bottom", - horizontal: "center", + vertical: 'bottom', + horizontal: 'center', }} transformOrigin={{ - vertical: "top", - horizontal: "center", + vertical: 'top', + horizontal: 'center', }} - style={{ marginTop: "8px" }} + style={{ marginTop: '8px' }} > - Join {group?.groupName} + + {t('core:action.join', { + postProcess: 'capitalizeFirstChar', + })}{' '} + {group?.groupName} + + {group?.isOpen === false && - "This is a closed/private group, so you will need to wait until an admin accepts your request"} + t('group:message.generic.closed_group', { + postProcess: 'capitalizeFirstChar', + })} + handleJoinGroup(group, group?.isOpen)} > - Join group + {t('group:action.join_group', { + postProcess: 'capitalizeFirstChar', + })} + handlePopoverOpen(event, index)} > {group?.isOpen === false && ( - - )} - {group?.isOpen === true && ( - - )} - + + )} + + {group?.isOpen === true && ( + + )} + + + { }; return ( - -

Groups list

+ +

+ {t('core:list.groups', { + postProcess: 'capitalizeFirstChar', + })} +

{ />
diff --git a/src/components/Group/BlockedUsersModal.tsx b/src/components/Group/BlockedUsersModal.tsx index 84fa3fa..628b6ac 100644 --- a/src/components/Group/BlockedUsersModal.tsx +++ b/src/components/Group/BlockedUsersModal.tsx @@ -6,143 +6,335 @@ import { DialogContent, DialogContentText, DialogTitle, + IconButton, TextField, Typography, -} from "@mui/material"; -import React, { useContext, useEffect, useState } from "react"; -import { MyContext } from "../../App"; -import { Spacer } from "../../common/Spacer"; -import { executeEvent } from "../../utils/events"; + useTheme, +} from '@mui/material'; +import { useContext, useEffect, useState } from 'react'; +import { getBaseApiReact, QORTAL_APP_CONTEXT } from '../../App'; +import { Spacer } from '../../common/Spacer'; +import CloseIcon from '@mui/icons-material/Close'; -export const BlockedUsersModal = ({ close }) => { +import { + executeEvent, + subscribeToEvent, + unsubscribeFromEvent, +} from '../../utils/events'; +import { validateAddress } from '../../utils/validateAddress'; +import { getNameInfo, requestQueueMemberNames } from './Group'; +import { useModal } from '../../hooks/useModal'; +import { isOpenBlockedModalAtom } from '../../atoms/global'; +import InfoIcon from '@mui/icons-material/Info'; +import { useAtom } from 'jotai'; +import { useTranslation } from 'react-i18next'; + +export const BlockedUsersModal = () => { + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + const [isOpenBlockedModal, setIsOpenBlockedModal] = useAtom( + isOpenBlockedModalAtom + ); const [hasChanged, setHasChanged] = useState(false); - const [value, setValue] = useState(""); + const [value, setValue] = useState(''); + const [addressesWithNames, setAddressesWithNames] = useState({}); + const { isShow, onCancel, onOk, show, message } = useModal(); + const { + getAllBlockedUsers, + removeBlockFromList, + addToBlockList, + setOpenSnackGlobal, + setInfoSnackCustom, + } = useContext(QORTAL_APP_CONTEXT); - const { getAllBlockedUsers, removeBlockFromList, addToBlockList } = useContext(MyContext); const [blockedUsers, setBlockedUsers] = useState({ addresses: {}, names: {}, }); + const fetchBlockedUsers = () => { setBlockedUsers(getAllBlockedUsers()); }; useEffect(() => { + if (!isOpenBlockedModal) return; fetchBlockedUsers(); + }, [isOpenBlockedModal]); + + const getNames = async () => { + const addresses = Object.keys(blockedUsers?.addresses); + const addressNames = {}; + + const getMemNames = addresses.map(async (address) => { + const name = await requestQueueMemberNames.enqueue(() => { + return getNameInfo(address); + }); + if (name) { + addressNames[address] = name; + } + + return true; + }); + + await Promise.all(getMemNames); + + setAddressesWithNames(addressNames); + }; + + const blockUser = async (e, user?: string) => { + try { + const valUser = user || value; + if (!valUser) return; + const isAddress = validateAddress(valUser); + let userName = null; + let userAddress = null; + if (isAddress) { + userAddress = valUser; + const name = await getNameInfo(valUser); + if (name) { + userName = name; + } + } + if (!isAddress) { + const response = await fetch(`${getBaseApiReact()}/names/${valUser}`); + const data = await response.json(); + if (!data?.owner) + throw new Error( + t('auth:message.error.name_not_existing', { + postProcess: 'capitalizeFirstChar', + }) + ); + if (data?.owner) { + userAddress = data.owner; + userName = valUser; + } + } + if (!userName) { + await addToBlockList(userAddress, null); + fetchBlockedUsers(); + setHasChanged(true); + executeEvent('updateChatMessagesWithBlocks', true); + setValue(''); + return; + } + const responseModal = await show({ + userName, + userAddress, + }); + if (responseModal === 'both') { + await addToBlockList(userAddress, userName); + } else if (responseModal === 'address') { + await addToBlockList(userAddress, null); + } else if (responseModal === 'name') { + await addToBlockList(null, userName); + } + fetchBlockedUsers(); + setHasChanged(true); + setValue(''); + if (user) { + setIsOpenBlockedModal(false); + } + if (responseModal === 'both' || responseModal === 'address') { + executeEvent('updateChatMessagesWithBlocks', true); + } + } catch (error) { + if (error?.isCanceled) { + // user pressed Escape or canceled — do nothing + return; + } + setOpenSnackGlobal(true); + setInfoSnackCustom({ + type: 'error', + message: + error?.message || + t('auth:message.error.block_user', { + postProcess: 'capitalizeFirstChar', + }), + }); + } + }; + + const blockUserFromOutsideModalFunc = (e) => { + const user = e.detail?.user; + setIsOpenBlockedModal(true); + blockUser(null, user); + }; + + useEffect(() => { + subscribeToEvent('blockUserFromOutside', blockUserFromOutsideModalFunc); + + return () => { + unsubscribeFromEvent( + 'blockUserFromOutside', + blockUserFromOutsideModalFunc + ); + }; }, []); + return ( - Blocked Users - - - { - setValue(e.target.value); + > + {t('auth:blocked_users', { postProcess: 'capitalizeAll' })} + + + + - - - + > + { + setValue(e.target.value); + }} + /> + + + {Object.entries(blockedUsers?.addresses).length > 0 && ( <> + - Blocked Users for Chat ( addresses ) + {t('auth:message.generic.blocked_addresses', { + postProcess: 'capitalizeFirstChar', + })} + + + + + )} - + gap: '10px', + }} + > {Object.entries(blockedUsers?.addresses || {})?.map( ([key, value]) => { return ( - {key} + {addressesWithNames[key] || key} ); } )} + {Object.entries(blockedUsers?.names).length > 0 && ( <> + - Blocked Users for QDN and Chat (names) + {t('auth:message.generic.blocked_names', { + postProcess: 'capitalizeFirstChar', + })} + )} - + gap: '10px', + }} + > {Object.entries(blockedUsers?.names || {})?.map(([key, value]) => { return ( {key} + ); })} + + + + + {t('auth:message.generic.decide_block', { + postProcess: 'capitalizeAll', + })} + + + + + + + {t('auth:message.generic.blocking', { + name: message?.userName || message?.userAddress, + postProcess: 'capitalizeFirstChar', + })} + + + + + + {t('auth:message.generic.choose_block', { + postProcess: 'capitalizeFirstChar', + })} + + + + + + + + + + ); }; diff --git a/src/components/Group/Forum/DisplayHtml.tsx b/src/components/Group/Forum/DisplayHtml.tsx deleted file mode 100644 index 5bae4a7..0000000 --- a/src/components/Group/Forum/DisplayHtml.tsx +++ /dev/null @@ -1,45 +0,0 @@ -import { useMemo } from "react"; -import DOMPurify from "dompurify"; -import "react-quill/dist/quill.snow.css"; -import "react-quill/dist/quill.core.css"; -import "react-quill/dist/quill.bubble.css"; -import { Box, styled } from "@mui/material"; -import { convertQortalLinks } from "../../../utils/qortalLink"; - - -const CrowdfundInlineContent = styled(Box)(({ theme }) => ({ - display: "flex", - fontFamily: "Mulish", - fontSize: "19px", - fontWeight: 400, - letterSpacing: 0, - color: theme.palette.text.primary, - width: '100%' - })); - -export const DisplayHtml = ({ html, textColor }: any) => { - const cleanContent = useMemo(() => { - if (!html) return null; - - const sanitize: string = DOMPurify.sanitize(html, { - USE_PROFILES: { html: true }, - }); - const anchorQortal = convertQortalLinks(sanitize); - return anchorQortal; - }, [html]); - - if (!cleanContent) return null; - return ( - -
- - ); -}; diff --git a/src/components/Group/Forum/GroupMail.tsx b/src/components/Group/Forum/GroupMail.tsx index 38d93e9..ccad343 100644 --- a/src/components/Group/Forum/GroupMail.tsx +++ b/src/components/Group/Forum/GroupMail.tsx @@ -1,28 +1,17 @@ -import React, { - FC, - useCallback, - useEffect, - useMemo, - useRef, - useState, -} from "react"; -import { Avatar, Box, Popover, Typography } from "@mui/material"; -// import { MAIL_SERVICE_TYPE, THREAD_SERVICE_TYPE } from "../../constants/mail"; -import { Thread } from "./Thread"; +import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; +import { Avatar, Box, Popover, Typography, useTheme } from '@mui/material'; +import { Thread } from './Thread'; import { AllThreadP, ArrowDownIcon, ComposeContainer, ComposeContainerBlank, - ComposeIcon, ComposeP, GroupContainer, - GroupNameP, InstanceFooter, InstanceListContainer, InstanceListContainerRow, InstanceListContainerRowCheck, - InstanceListContainerRowCheckIcon, InstanceListContainerRowMain, InstanceListContainerRowMainP, InstanceListHeader, @@ -38,61 +27,73 @@ import { ThreadSingleLastMessageP, ThreadSingleLastMessageSpanP, ThreadSingleTitle, -} from "./Mail-styles"; +} from './Mail-styles'; import ArrowForwardIosIcon from '@mui/icons-material/ArrowForwardIos'; -import { Spacer } from "../../../common/Spacer"; -import { formatDate, formatTimestamp } from "../../../utils/time"; -import LazyLoad from "../../../common/LazyLoad"; -import { delay } from "../../../utils/helpers"; -import { NewThread } from "./NewThread"; -import { getBaseApi } from "../../../background"; -import { decryptPublishes, getTempPublish, handleUnencryptedPublishes } from "../../Chat/GroupAnnouncements"; -import CheckSVG from "../../../assets/svgs/Check.svg"; -import SortSVG from "../../../assets/svgs/Sort.svg"; -import ArrowDownSVG from "../../../assets/svgs/ArrowDown.svg"; -import { LoadingSnackbar } from "../../Snackbar/LoadingSnackbar"; -import { executeEvent, subscribeToEvent, unsubscribeFromEvent } from "../../../utils/events"; +import { Spacer } from '../../../common/Spacer'; +import { formatDate, formatTimestamp } from '../../../utils/time'; +import LazyLoad from '../../../common/LazyLoad'; +import { delay } from '../../../utils/helpers'; +import { NewThread } from './NewThread'; +import { + decryptPublishes, + getTempPublish, + handleUnencryptedPublishes, +} from '../../Chat/GroupAnnouncements'; +import ArrowDownSVG from '../../../assets/svgs/ArrowDown.svg'; +import { LoadingSnackbar } from '../../Snackbar/LoadingSnackbar'; +import { executeEvent } from '../../../utils/events'; import RefreshIcon from '@mui/icons-material/Refresh'; -import { getArbitraryEndpointReact, getBaseApiReact, isMobile } from "../../../App"; -import { WrapperUserAction } from "../../WrapperUserAction"; -import { addDataPublishesFunc, getDataPublishesFunc } from "../Group"; -const filterOptions = ["Recently active", "Newest", "Oldest"]; +import { getArbitraryEndpointReact, getBaseApiReact } from '../../../App'; +import { addDataPublishesFunc, getDataPublishesFunc } from '../Group'; +import { useTranslation } from 'react-i18next'; +import { SortIcon } from '../../../assets/Icons/SortIcon'; +import { CustomButton } from '../../../styles/App-styles'; + +const filterOptions = ['Recently active', 'Newest', 'Oldest']; +import CheckIcon from '@mui/icons-material/Check'; +export const threadIdentifier = 'DOCUMENT'; -export const threadIdentifier = "DOCUMENT"; export const GroupMail = ({ selectedGroup, userInfo, getSecretKey, secretKey, - defaultThread, + defaultThread, setDefaultThread, hide, - isPrivate + isPrivate, }) => { - const [viewedThreads, setViewedThreads] = React.useState({}); - const [filterMode, setFilterMode] = useState("Recently active"); - const [currentThread, setCurrentThread] = React.useState(null); + const [viewedThreads, setViewedThreads] = useState({}); + const [filterMode, setFilterMode] = useState('Recently active'); + const [currentThread, setCurrentThread] = useState(null); const [recentThreads, setRecentThreads] = useState([]); const [allThreads, setAllThreads] = useState([]); const [members, setMembers] = useState(null); const [isOpenFilterList, setIsOpenFilterList] = useState(false); const anchorElInstanceFilter = useRef(null); - const [tempPublishedList, setTempPublishedList] = useState([]) - const dataPublishes = useRef({}) - - const [isLoading, setIsLoading] = useState(false) + const [tempPublishedList, setTempPublishedList] = useState([]); + const dataPublishes = useRef({}); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + const theme = useTheme(); + const [isLoading, setIsLoading] = useState(false); const groupIdRef = useRef(null); const groupId = useMemo(() => { return selectedGroup?.groupId; }, [selectedGroup]); - useEffect(()=> { - if(!groupId) return - (async ()=> { - const res = await getDataPublishesFunc(groupId, 'thread') - dataPublishes.current = res || {} - })() - }, [groupId]) + useEffect(() => { + if (!groupId) return; + (async () => { + const res = await getDataPublishesFunc(groupId, 'thread'); + dataPublishes.current = res || {}; + })(); + }, [groupId]); useEffect(() => { if (groupId !== groupIdRef?.current) { @@ -103,55 +104,68 @@ export const GroupMail = ({ } }, [groupId]); - const setTempData = async ()=> { + const setTempData = async () => { try { - const getTempAnnouncements = await getTempPublish() - - if(getTempAnnouncements?.thread){ - let tempData = [] - Object.keys(getTempAnnouncements?.thread || {}).map((key)=> { - const value = getTempAnnouncements?.thread[key] - if(value?.data?.groupId === groupIdRef?.current){ - tempData.push(value.data) + const getTempAnnouncements = await getTempPublish(); + + if (getTempAnnouncements?.thread) { + let tempData = []; + Object.keys(getTempAnnouncements?.thread || {}).map((key) => { + const value = getTempAnnouncements?.thread[key]; + if (value?.data?.groupId === groupIdRef?.current) { + tempData.push(value.data); + } + }); + setTempPublishedList(tempData); } - - }) - setTempPublishedList(tempData) - } } catch (error) { - + console.log(error); } - - } - - const getEncryptedResource = async ({ name, identifier, resource }, isPrivate) => { - let data = dataPublishes.current[`${name}-${identifier}`] - if(!data || (data?.update || data?.created !== (resource?.updated || resource?.created))){ - const res = await fetch( - `${getBaseApiReact()}/arbitrary/DOCUMENT/${name}/${identifier}?encoding=base64` - ); - if(!res?.ok) return - data = await res.text(); - await addDataPublishesFunc({...resource, data}, groupId, 'thread') + }; + const getEncryptedResource = async ( + { name, identifier, resource }, + isPrivate + ) => { + let data = dataPublishes.current[`${name}-${identifier}`]; + if ( + !data || + data?.update || + data?.created !== (resource?.updated || resource?.created) + ) { + const res = await fetch( + `${getBaseApiReact()}/arbitrary/DOCUMENT/${name}/${identifier}?encoding=base64` + ); + if (!res?.ok) return; + data = await res.text(); + await addDataPublishesFunc({ ...resource, data }, groupId, 'thread'); } else { - data = data.data + data = data.data; } - const response = isPrivate === false ? handleUnencryptedPublishes([data]) : await decryptPublishes([{ data }], secretKey); + const response = + isPrivate === false + ? handleUnencryptedPublishes([data]) + : await decryptPublishes([{ data }], secretKey); const messageData = response[0]; return messageData.decryptedData; }; - const updateThreadActivity = async ({threadId, qortalName, groupId, thread}) => { + const updateThreadActivity = async ({ + threadId, + qortalName, + groupId, + thread, + }) => { try { await new Promise((res, rej) => { - window.sendMessage("updateThreadActivity", { - threadId, - qortalName, - groupId, - thread, - }) + window + .sendMessage('updateThreadActivity', { + threadId, + qortalName, + groupId, + thread, + }) .then((response) => { if (!response?.error) { res(response); @@ -160,23 +174,25 @@ export const GroupMail = ({ rej(response.error); }) .catch((error) => { - rej(error.message || "An error occurred"); + rej( + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }) + ); }); - }); - } catch (error) { - - } finally { + console.log(error); } }; - const getAllThreads = React.useCallback( + const getAllThreads = useCallback( async (groupId: string, mode: string, isInitial?: boolean) => { try { - setIsLoading(true) + setIsLoading(true); const offset = isInitial ? 0 : allThreads.length; - const isReverse = mode === "Newest" ? true : false; + const isReverse = mode === 'Newest' ? true : false; if (isInitial) { // dispatch(setIsLoadingCustom("Loading threads")); } @@ -184,14 +200,14 @@ export const GroupMail = ({ const url = `${getBaseApiReact()}${getArbitraryEndpointReact()}?mode=ALL&service=${threadIdentifier}&identifier=${identifier}&limit=${20}&includemetadata=false&offset=${offset}&reverse=${isReverse}&prefix=true`; const response = await fetch(url, { - method: "GET", + method: 'GET', headers: { - "Content-Type": "application/json", + 'Content-Type': 'application/json', }, }); const responseData = await response.json(); - let fullArrayMsg = isInitial ? [] : [...allThreads]; + const fullArrayMsg = isInitial ? [] : [...allThreads]; const getMessageForThreads = responseData.map(async (message: any) => { let fullObject: any = null; if (message?.metadata?.description) { @@ -209,21 +225,26 @@ export const GroupMail = ({ let threadRes = null; try { threadRes = await Promise.race([ - getEncryptedResource({ - name: message.name, - identifier: message.identifier, - resource: message - }, isPrivate), + getEncryptedResource( + { + name: message.name, + identifier: message.identifier, + resource: message, + }, + isPrivate + ), delay(5000), ]); - } catch (error) {} + } catch (error) { + console.log(error); + } if (threadRes?.title) { fullObject = { ...message, threadData: threadRes, threadOwner: message?.name, - threadId: message.identifier + threadId: message.identifier, }; } } @@ -245,37 +266,36 @@ export const GroupMail = ({ } else { sorted = fullArrayMsg.sort((a: any, b: any) => a.created - b.created); } - setAllThreads(sorted); } catch (error) { console.log({ error }); } finally { if (isInitial) { - setIsLoading(false) - // dispatch(setIsLoadingCustom(null)); + setIsLoading(false); } } }, [allThreads, isPrivate] ); - const getMailMessages = React.useCallback( + + const getMailMessages = useCallback( async (groupId: string, members: any) => { try { - setIsLoading(true) + setIsLoading(true); const identifier = `thmsg-grp-${groupId}-thread-`; const url = `${getBaseApiReact()}${getArbitraryEndpointReact()}?mode=ALL&service=${threadIdentifier}&identifier=${identifier}&limit=100&includemetadata=false&offset=${0}&reverse=true&prefix=true`; const response = await fetch(url, { - method: "GET", + method: 'GET', headers: { - "Content-Type": "application/json", + 'Content-Type': 'application/json', }, }); const responseData = await response.json(); const messagesForThread: any = {}; for (const message of responseData) { let str = message.identifier; - const parts = str.split("-"); + const parts = str.split('-'); // Get the second last element const secondLastId = parts[parts.length - 2]; @@ -295,19 +315,20 @@ export const GroupMail = ({ }) .sort((a, b) => b.created - a.created) .slice(0, 10); - - let fullThreadArray: any = []; + + const fullThreadArray: any = []; const getMessageForThreads = newArray.map(async (message: any) => { try { const identifierQuery = message.threadId; const url = `${getBaseApiReact()}${getArbitraryEndpointReact()}?mode=ALL&service=${threadIdentifier}&identifier=${identifierQuery}&limit=1&includemetadata=false&offset=${0}&reverse=true&prefix=true`; const response = await fetch(url, { - method: "GET", + method: 'GET', headers: { - "Content-Type": "application/json", + 'Content-Type': 'application/json', }, }); const responseData = await response.json(); + if (responseData.length > 0) { const thread = responseData[0]; if (thread?.metadata?.description) { @@ -323,12 +344,15 @@ export const GroupMail = ({ }; fullThreadArray.push(fullObject); } else { - let threadRes = await Promise.race([ - getEncryptedResource({ - name: thread.name, - identifier: message.threadId, - resource: thread - }, isPrivate), + const threadRes = await Promise.race([ + getEncryptedResource( + { + name: thread.name, + identifier: message.threadId, + resource: thread, + }, + isPrivate + ), delay(10000), ]); if (threadRes?.title) { @@ -352,16 +376,15 @@ export const GroupMail = ({ ); setRecentThreads(sorted); } catch (error) { + console.log(error); } finally { - setIsLoading(false) - // dispatch(setIsLoadingCustom(null)); + setIsLoading(false); } }, [secretKey, isPrivate] ); - const getMessages = React.useCallback(async () => { - + const getMessages = useCallback(async () => { // if ( !groupId || members?.length === 0) return; if (!groupId || isPrivate === null) return; @@ -369,25 +392,23 @@ export const GroupMail = ({ }, [getMailMessages, groupId, members, secretKey, isPrivate]); const interval = useRef(null); - const firstMount = useRef(false); - const filterModeRef = useRef(""); + const filterModeRef = useRef(''); useEffect(() => { - if(hide) return + if (hide) return; if (filterModeRef.current !== filterMode) { firstMount.current = false; } - // if (groupId && !firstMount.current && members.length > 0) { if (groupId && !firstMount.current && isPrivate !== null) { - if (filterMode === "Recently active") { + if (filterMode === 'Recently active') { getMessages(); - } else if (filterMode === "Newest") { - getAllThreads(groupId, "Newest", true); - } else if (filterMode === "Oldest") { - getAllThreads(groupId, "Oldest", true); + } else if (filterMode === 'Newest') { + getAllThreads(groupId, 'Newest', true); + } else if (filterMode === 'Oldest') { + getAllThreads(groupId, 'Oldest', true); } - setTempData() + setTempData(); firstMount.current = true; } }, [groupId, members, filterMode, hide, isPrivate]); @@ -405,11 +426,6 @@ export const GroupMail = ({ if (groupData && Array.isArray(groupData?.members)) { for (const member of groupData.members) { if (member.member) { - // const res = await getNameInfo(member.member); - // const resAddress = await qortalRequest({ - // action: "GET_ACCOUNT_DATA", - // address: member.member, - // }); const name = res; const publicKey = resAddress.publicKey; if (name) { @@ -421,112 +437,103 @@ export const GroupMail = ({ } } } - setMembers(members); } catch (error) { console.log({ error }); } }, []); - - - let listOfThreadsToDisplay = recentThreads; - if (filterMode === "Newest" || filterMode === "Oldest") { + if (filterMode === 'Newest' || filterMode === 'Oldest') { listOfThreadsToDisplay = allThreads; } const onSubmitNewThread = useCallback( (val: any) => { - if (filterMode === "Recently active") { + if (filterMode === 'Recently active') { setRecentThreads((prev) => [val, ...prev]); - } else if (filterMode === "Newest") { + } else if (filterMode === 'Newest') { setAllThreads((prev) => [val, ...prev]); } }, [filterMode] ); - // useEffect(()=> { - // if(user?.name){ - // const threads = JSON.parse( - // localStorage.getItem(`qmail_threads_viewedtimestamp_${user.name}`) || "{}" - // ); - // setViewedThreads(threads) - - // } - // }, [user?.name, currentThread]) - const handleCloseThreadFilterList = () => { setIsOpenFilterList(false); }; - const refetchThreadsLists = useCallback(()=> { - if (filterMode === "Recently active") { + const refetchThreadsLists = useCallback(() => { + if (filterMode === 'Recently active') { getMessages(); - } else if (filterMode === "Newest") { - getAllThreads(groupId, "Newest", true); - } else if (filterMode === "Oldest") { - getAllThreads(groupId, "Oldest", true); + } else if (filterMode === 'Newest') { + getAllThreads(groupId, 'Newest', true); + } else if (filterMode === 'Oldest') { + getAllThreads(groupId, 'Oldest', true); } - }, [filterMode, isPrivate]) + }, [filterMode, isPrivate]); - const updateThreadActivityCurrentThread = ()=> { - if(!currentThread) return - const thread = currentThread + const updateThreadActivityCurrentThread = () => { + if (!currentThread) return; + const thread = currentThread; updateThreadActivity({ - threadId: thread?.threadId, qortalName: thread?.threadData?.name, groupId: groupId, thread: thread - }) - } + threadId: thread?.threadId, + qortalName: thread?.threadData?.name, + groupId: groupId, + thread: thread, + }); + }; - const setThreadFunc = (data)=> { - const thread = data + const setThreadFunc = (data) => { + const thread = data; setCurrentThread(thread); - if(thread?.threadId && thread?.threadData?.name){ - updateThreadActivity({ - threadId: thread?.threadId, qortalName: thread?.threadData?.name, groupId: groupId, thread: thread - }) - } + if (thread?.threadId && thread?.threadData?.name) { + updateThreadActivity({ + threadId: thread?.threadId, + qortalName: thread?.threadData?.name, + groupId: groupId, + thread: thread, + }); + } setTimeout(() => { - executeEvent("threadFetchMode", { - mode: "last-page" + executeEvent('threadFetchMode', { + mode: 'last-page', }); }, 300); - } + }; - - useEffect(()=> { - if(defaultThread){ - setThreadFunc(defaultThread) - setDefaultThread(null) + useEffect(() => { + if (defaultThread) { + setThreadFunc(defaultThread); + setDefaultThread(null); } - }, [defaultThread]) + }, [defaultThread]); const combinedListTempAndReal = useMemo(() => { // Combine the two lists - const transformTempPublishedList = tempPublishedList.map((item)=> { + const transformTempPublishedList = tempPublishedList.map((item) => { return { ...item, threadData: item.tempData, threadOwner: item?.name, - threadId: item.identifier - } - }) + threadId: item.identifier, + }; + }); const combined = [...transformTempPublishedList, ...listOfThreadsToDisplay]; - + // Remove duplicates based on the "identifier" const uniqueItems = new Map(); - combined.forEach(item => { - uniqueItems.set(item.threadId, item); // This will overwrite duplicates, keeping the last occurrence + combined.forEach((item) => { + uniqueItems.set(item.threadId, item); // This will overwrite duplicates, keeping the last occurrence }); - + // Convert the map back to an array and sort by "created" timestamp in descending order const sortedList = Array.from(uniqueItems.values()).sort((a, b) => - filterMode === 'Oldest' - ? a.threadData?.createdAt - b.threadData?.createdAt - : b.threadData?.createdAt - a.threadData?.createdAt -); - + filterMode === 'Oldest' + ? a.threadData?.createdAt - b.threadData?.createdAt + : b.threadData?.createdAt - a.threadData?.createdAt + ); + return sortedList; }, [tempPublishedList, listOfThreadsToDisplay, filterMode]); @@ -548,9 +555,9 @@ export const GroupMail = ({ return ( - + + {filterOptions?.map((filter) => { return ( @@ -583,15 +591,22 @@ export const GroupMail = ({ }} sx={{ backgroundColor: - filterMode === filter ? "rgba(74, 158, 244, 1)" : "unset", + filterMode === filter + ? theme.palette.action.selected + : 'unset', }} key={filter} > {filter === filterMode && ( - + )} + {filter} @@ -601,17 +616,17 @@ export const GroupMail = ({ ); })} - + + - {selectedGroup && !currentThread && ( @@ -636,7 +651,7 @@ export const GroupMail = ({ }} ref={anchorElInstanceFilter} > - + Sort by @@ -646,19 +661,27 @@ export const GroupMail = ({ )} - - - {filterMode} - + + + + {filterMode} + + + {combinedListTempAndReal.map((thread) => { @@ -666,127 +689,140 @@ export const GroupMail = ({ viewedThreads[ `qmail_threads_${thread?.threadData?.groupId}_${thread?.threadId}` ]; + const shouldAppearLighter = hasViewedRecent && - filterMode === "Recently active" && + filterMode === 'Recently active' && thread?.threadData?.createdAt < hasViewedRecent?.timestamp; + return ( { setCurrentThread(thread); - if(thread?.threadId && thread?.threadData?.name){ + if (thread?.threadId && thread?.threadData?.name) { updateThreadActivity({ - threadId: thread?.threadId, qortalName: thread?.threadData?.name, groupId: groupId, thread: thread - }) + threadId: thread?.threadId, + qortalName: thread?.threadData?.name, + groupId: groupId, + thread: thread, + }); } }} > - {thread?.threadData?.name?.charAt(0)} - + - by {thread?.threadData?.name} - + {formatTimestamp(thread?.threadData?.createdAt)}
{thread?.threadData?.title} + - {filterMode === "Recently active" && ( + + {filterMode === 'Recently active' && (
- last message:{" "} + {t('group:last_message', { + postProcess: 'capitalizeFirstChar', + })} + :{' '} {formatDate(thread?.created)}
)} -
- { - setTimeout(() => { - executeEvent("threadFetchMode", { - mode: "last-page" - }); - }, 300); - - - }} sx={{ - position: 'absolute', - bottom: '2px', - right: '2px', - borderRadius: '5px', - backgroundColor: '#27282c', - display: 'flex', - gap: '10px', - alignItems: 'center', - padding: '5px', - cursor: 'pointer', - '&:hover': { - background: 'rgba(255, 255, 255, 0.60)' - } - }}> - Last page - - + + { + setTimeout(() => { + executeEvent('threadFetchMode', { + mode: 'last-page', + }); + }, 300); + }} + sx={{ + alignItems: 'center', + borderRadius: '8px', + bottom: '2px', + cursor: 'pointer', + display: 'flex', + gap: '10px', + padding: '5px', + position: 'absolute', + right: '2px', + minWidth: 'unset', + }} + > + + {t('core:page.last', { + postProcess: 'capitalizeFirstChar', + })} + + + +
); })} {listOfThreadsToDisplay.length >= 20 && - filterMode !== "Recently active" && ( + filterMode !== 'Recently active' && ( getAllThreads(groupId, filterMode, false)} > @@ -794,10 +830,13 @@ export const GroupMail = ({
+
diff --git a/src/components/Group/Forum/Mail-styles.ts b/src/components/Group/Forum/Mail-styles.ts index 534304d..28cd5c1 100644 --- a/src/components/Group/Forum/Mail-styles.ts +++ b/src/components/Group/Forum/Mail-styles.ts @@ -1,82 +1,63 @@ -import { - AppBar, - Button, - Toolbar, - Typography, - Box, - TextField, -} from "@mui/material"; -import { styled } from "@mui/system"; +import { Typography, Box } from '@mui/material'; +import { styled } from '@mui/system'; -export const InstanceContainer = styled(Box)(({ theme }) => ({ - display: "flex", - alignItems: "center", - width: "100%", - backgroundColor: "var(--color-instance)", - height: "59px", - flexShrink: 0, - justifyContent: "space-between", -})); export const MailContainer = styled(Box)(({ theme }) => ({ - display: "flex", - flexDirection: "column", - width: "100%", - height: "calc(100vh - 78px)", - overflow: "hidden", + display: 'flex', + flexDirection: 'column', + height: 'calc(100vh - 78px)', + overflow: 'hidden', + width: '100%', })); export const MailBody = styled(Box)(({ theme }) => ({ - display: "flex", - flexDirection: "row", - width: "100%", - height: "calc(100% - 59px)", - // overflow: 'auto !important' + display: 'flex', + flexDirection: 'row', + height: 'calc(100% - 59px)', + width: '100%', })); + export const MailBodyInner = styled(Box)(({ theme }) => ({ - display: "flex", - flexDirection: "column", - width: "50%", - height: "100%", + display: 'flex', + flexDirection: 'column', + height: '100%', + width: '50%', })); + export const MailBodyInnerHeader = styled(Box)(({ theme }) => ({ - display: "flex", - width: "100%", - height: "25px", - marginTop: "50px", - marginBottom: "35px", - justifyContent: "center", - alignItems: "center", - gap: "11px", + alignItems: 'center', + display: 'flex', + gap: '11px', + height: '25px', + justifyContent: 'center', + marginBottom: '35px', + marginTop: '50px', + width: '100%', })); export const MailBodyInnerScroll = styled(Box)` display: flex; flex-direction: column; + height: calc(100% - 110px); overflow: auto !important; transition: background-color 0.3s; - height: calc(100% - 110px); &::-webkit-scrollbar { width: 8px; height: 8px; background-color: transparent; /* Initially transparent */ transition: background-color 0.3s; /* Transition for background color */ } - &::-webkit-scrollbar-thumb { background-color: transparent; /* Initially transparent */ border-radius: 3px; /* Scrollbar thumb radius */ transition: background-color 0.3s; /* Transition for thumb color */ } - &:hover { &::-webkit-scrollbar { background-color: #494747; /* Scrollbar background color on hover */ } - &::-webkit-scrollbar-thumb { background-color: #ffffff3d; /* Scrollbar thumb color on hover */ } - &::-webkit-scrollbar-thumb:hover { background-color: #ffffff3d; /* Color when hovering over the thumb */ } @@ -84,694 +65,555 @@ export const MailBodyInnerScroll = styled(Box)` `; export const ComposeContainer = styled(Box)(({ theme }) => ({ - display: "flex", - width: "150px", - alignItems: "center", - gap: "7px", - height: "100%", - cursor: "pointer", - transition: "0.2s background-color", - justifyContent: "center", - "&:hover": { - backgroundColor: "rgba(67, 68, 72, 1)", + alignItems: 'center', + cursor: 'pointer', + display: 'flex', + gap: '7px', + height: '100%', + justifyContent: 'center', + transition: '0.2s background-color', + width: '150px', + '&:hover': { + backgroundColor: theme.palette.action.hover, }, })); + export const ComposeContainerBlank = styled(Box)(({ theme }) => ({ - display: "flex", - width: "150px", - alignItems: "center", - gap: "7px", - height: "100%", + alignItems: 'center', + display: 'flex', + gap: '7px', + height: '100%', + width: '150px', })); + export const ComposeP = styled(Typography)(({ theme }) => ({ - fontSize: "15px", + fontSize: '15px', fontWeight: 500, })); -export const ComposeIcon = styled("img")({ - width: "auto", - height: "auto", - userSelect: "none", - objectFit: "contain", - cursor: "pointer", -}); -export const ArrowDownIcon = styled("img")({ - width: "auto", - height: "auto", - userSelect: "none", - objectFit: "contain", - cursor: "pointer", -}); -export const MailIconImg = styled("img")({ - width: "auto", - height: "auto", - userSelect: "none", - objectFit: "contain", +export const ComposeIcon = styled('img')({ + cursor: 'pointer', + height: 'auto', + objectFit: 'contain', + userSelect: 'none', + width: 'auto', }); -export const MailMessageRowInfoImg = styled("img")({ - width: "auto", - height: "auto", - userSelect: "none", - objectFit: "contain", +export const ArrowDownIcon = styled('img')({ + cursor: 'pointer', + height: 'auto', + objectFit: 'contain', + userSelect: 'none', + width: 'auto', +}); + +export const MailIconImg = styled('img')({ + height: 'auto', + objectFit: 'contain', + userSelect: 'none', + width: 'auto', +}); + +export const MailMessageRowInfoImg = styled('img')({ + height: 'auto', + objectFit: 'contain', + userSelect: 'none', + width: 'auto', }); export const SelectInstanceContainer = styled(Box)(({ theme }) => ({ - display: "flex", - alignItems: "center", - gap: "17px", -})); -export const SelectInstanceContainerInner = styled(Box)(({ theme }) => ({ - display: "flex", - alignItems: "center", - gap: "3px", - cursor: "pointer", - padding: "8px", - transition: "all 0.2s", - "&:hover": { - borderRadius: "8px", - background: "#434448", - }, -})); -export const SelectInstanceContainerFilterInner = styled(Box)(({ theme }) => ({ - display: "flex", - alignItems: "center", - gap: "3px", - cursor: "pointer", - padding: "8px", - transition: "all 0.2s" + alignItems: 'center', + display: 'flex', + gap: '17px', })); +export const SelectInstanceContainerFilterInner = styled(Box)(({ theme }) => ({ + alignItems: 'center', + cursor: 'pointer', + display: 'flex', + gap: '3px', + padding: '8px', + transition: 'all 0.2s', +})); export const InstanceLabel = styled(Typography)(({ theme }) => ({ - fontSize: "16px", + color: '#FFFFFF33', + fontSize: '16px', fontWeight: 500, - color: "#FFFFFF33", })); export const InstanceP = styled(Typography)(({ theme }) => ({ - fontSize: "16px", + fontSize: '16px', fontWeight: 500, })); -export const MailMessageRowContainer = styled(Box)(({ theme }) => ({ - display: "flex", - alignItems: "center", - cursor: "pointer", - justifyContent: "space-between", - borderRadius: "56px 5px 10px 56px", - paddingRight: "15px", - transition: "background 0.2s", - gap: "10px", - "&:hover": { - background: "#434448", - }, -})); -export const MailMessageRowProfile = styled(Box)(({ theme }) => ({ - display: "flex", - alignItems: "center", - cursor: "pointer", - justifyContent: "flex-start", - gap: "10px", - width: "50%", - overflow: "hidden", -})); -export const MailMessageRowInfo = styled(Box)(({ theme }) => ({ - display: "flex", - alignItems: "center", - cursor: "pointer", - justifyContent: "flex-start", - gap: "7px", - width: "50%", -})); -export const MailMessageRowInfoStatusNotDecrypted = styled(Typography)( - ({ theme }) => ({ - fontSize: "16px", - fontWeight: 900, - textTransform: "uppercase", - paddingTop: "2px", - }) -); -export const MailMessageRowInfoStatusRead = styled(Typography)(({ theme }) => ({ - fontSize: "16px", - fontWeight: 300, +export const InstanceListParent = styled(Typography)(({ theme }) => ({ + border: '1px solid rgba(0, 0, 0, 0.1)', + display: 'flex', + flexDirection: 'column', + maxHeight: '325px', + minHeight: '246px', + padding: '10px 0px 7px 0px', + width: '425px', // only one width now })); -export const MessageExtraInfo = styled(Box)(({ theme }) => ({ - display: "flex", - flexDirection: "column", - gap: "2px", - overflow: "hidden", -})); -export const MessageExtraName = styled(Typography)(({ theme }) => ({ - fontSize: "16px", - fontWeight: 900, - whiteSpace: "nowrap", - textOverflow: "ellipsis", - overflow: "hidden", -})); -export const MessageExtraDate = styled(Typography)(({ theme }) => ({ - fontSize: "15px", - fontWeight: 500, +export const InstanceListHeader = styled(Typography)(({ theme }) => ({ + display: 'flex', + flexDirection: 'column', + width: '100%', })); -export const MessagesContainer = styled(Box)(({ theme }) => ({ - width: "460px", - maxWidth: "90%", - display: "flex", - flexDirection: "column", - gap: "12px", -})); - -export const InstanceListParent = styled(Box)` - display: flex; - flex-direction: column; - width: 100%; - min-height: 246px; - max-height: 325px; - width: 425px; - padding: 10px 0px 7px 0px; - background-color: var(--color-instance-popover-bg); - border: 1px solid rgba(0, 0, 0, 0.1); -`; -export const InstanceListHeader = styled(Box)` - display: flex; - flex-direction: column; - width: 100%; - background-color: var(--color-instance-popover-bg); -`; export const InstanceFooter = styled(Box)` display: flex; flex-direction: column; - width: 100%; flex-shrink: 0; -`; -export const InstanceListContainer = styled(Box)` width: 100%; +`; + +export const InstanceListContainer = styled(Box)` display: flex; flex-direction: column; flex-grow: 1; - overflow: auto !important; transition: background-color 0.3s; + width: 100%; &::-webkit-scrollbar { width: 8px; height: 8px; background-color: transparent; /* Initially transparent */ transition: background-color 0.3s; /* Transition for background color */ } - &::-webkit-scrollbar-thumb { background-color: transparent; /* Initially transparent */ border-radius: 3px; /* Scrollbar thumb radius */ transition: background-color 0.3s; /* Transition for thumb color */ } - &:hover { &::-webkit-scrollbar { background-color: #494747; /* Scrollbar background color on hover */ } - &::-webkit-scrollbar-thumb { background-color: #ffffff3d; /* Scrollbar thumb color on hover */ } - &::-webkit-scrollbar-thumb:hover { background-color: #ffffff3d; /* Color when hovering over the thumb */ } } `; + export const InstanceListContainerRowLabelContainer = styled(Box)( ({ theme }) => ({ - width: "100%", - display: "flex", - alignItems: "center", - gap: "10px", - height: "50px", + alignItems: 'center', + display: 'flex', + gap: '10px', + height: '50px', + width: '100%', }) ); + export const InstanceListContainerRow = styled(Box)(({ theme }) => ({ - width: "100%", - display: "flex", - alignItems: "center", - gap: "10px", - height: "50px", - cursor: "pointer", - transition: "0.2s background", - "&:hover": { - background: "rgba(67, 68, 72, 1)", - }, + alignItems: 'center', + cursor: 'pointer', + display: 'flex', flexShrink: 0, + gap: '10px', + height: '50px', + transition: '0.2s background', + width: '100%', + '&:hover': { + background: theme.palette.action.hover, + }, })); + export const InstanceListContainerRowCheck = styled(Box)(({ theme }) => ({ - width: "47px", - display: "flex", - alignItems: "center", - justifyContent: "center", + alignItems: 'center', + display: 'flex', + justifyContent: 'center', + width: '47px', })); + export const InstanceListContainerRowMain = styled(Box)(({ theme }) => ({ - display: "flex", - justifyContent: "space-between", - width: "100%", - alignItems: "center", - paddingRight: "30px", - overflow: "hidden", + alignItems: 'center', + display: 'flex', + justifyContent: 'space-between', + overflow: 'hidden', + paddingRight: '30px', + width: '100%', })); + export const CloseParent = styled(Box)(({ theme }) => ({ - display: "flex", - alignItems: "center", - gap: "20px", + alignItems: 'center', + display: 'flex', + gap: '20px', })); + export const InstanceListContainerRowMainP = styled(Typography)( ({ theme }) => ({ + fontSize: '16px', fontWeight: 500, - fontSize: "16px", - textOverflow: "ellipsis", - overflow: "hidden", + overflow: 'hidden', + textOverflow: 'ellipsis', }) ); -export const InstanceListContainerRowCheckIcon = styled("img")({ - width: "auto", - height: "auto", - userSelect: "none", - objectFit: "contain", -}); -export const InstanceListContainerRowGroupIcon = styled("img")({ - width: "auto", - height: "auto", - userSelect: "none", - objectFit: "contain", -}); -export const TypeInAliasTextfield = styled(TextField)({ - width: "340px", // Adjust the width as needed - borderRadius: "5px", - backgroundColor: "rgba(30, 30, 32, 1)", - border: "none", - outline: "none", - input: { - fontSize: 16, - color: "white", - "&::placeholder": { - fontSize: 16, - color: "rgba(255, 255, 255, 0.2)", - }, - border: "none", - outline: "none", - padding: "10px", - }, - "& .MuiOutlinedInput-root": { - "& fieldset": { - border: "none", - }, - "&:hover fieldset": { - border: "none", - }, - "&.Mui-focused fieldset": { - border: "none", - }, - }, - "& .MuiInput-underline:before": { - borderBottom: "none", - }, - "& .MuiInput-underline:hover:not(.Mui-disabled):before": { - borderBottom: "none", - }, - "& .MuiInput-underline:after": { - borderBottom: "none", - }, +export const InstanceListContainerRowCheckIcon = styled('img')({ + height: 'auto', + objectFit: 'contain', + userSelect: 'none', + width: 'auto', }); -export const NewMessageCloseImg = styled("img")({ - width: "auto", - height: "auto", - userSelect: "none", - objectFit: "contain", - cursor: "pointer", +export const InstanceListContainerRowGroupIcon = styled('img')({ + height: 'auto', + objectFit: 'contain', + userSelect: 'none', + width: 'auto', }); + +export const NewMessageCloseImg = styled('img')({ + cursor: 'pointer', + height: 'auto', + objectFit: 'contain', + userSelect: 'none', + width: 'auto', +}); + export const NewMessageHeaderP = styled(Typography)(({ theme }) => ({ - fontSize: "18px", + color: theme.palette.text.primary, + fontSize: '18px', fontWeight: 600, })); export const NewMessageInputRow = styled(Box)(({ theme }) => ({ - display: "flex", - alignItems: "center", - justifyContent: "space-between", - borderBottom: "3px solid rgba(237, 239, 241, 1)", - width: "100%", - paddingBottom: "6px", + alignItems: 'center', + borderBottom: '3px solid rgba(237, 239, 241, 1)', + display: 'flex', + justifyContent: 'space-between', + paddingBottom: '6px', + width: '100%', })); + export const NewMessageInputLabelP = styled(Typography)` color: rgba(84, 84, 84, 0.7); font-size: 20px; font-style: normal; font-weight: 400; - line-height: 120%; /* 24px */ letter-spacing: 0.15px; + line-height: 120%; /* 24px */ `; + export const AliasLabelP = styled(Typography)` color: rgba(84, 84, 84, 0.7); + cursor: pointer; font-size: 16px; font-style: normal; font-weight: 500; - line-height: 120%; /* 24px */ letter-spacing: 0.15px; + line-height: 120%; /* 24px */ transition: color 0.2s; - cursor: pointer; &:hover { color: rgba(43, 43, 43, 1); } `; + export const NewMessageAliasContainer = styled(Box)(({ theme }) => ({ - display: "flex", - alignItems: "center", - gap: "12px", -})); -export const AttachmentContainer = styled(Box)(({ theme }) => ({ - height: "36px", - width: "100%", - display: "flex", - alignItems: "center", + alignItems: 'center', + display: 'flex', + gap: '12px', })); -export const NewMessageAttachmentImg = styled("img")({ - width: "auto", - height: "auto", - userSelect: "none", - objectFit: "contain", - cursor: "pointer", - padding: "10px", - border: "1px dashed #646464", +export const AttachmentContainer = styled(Box)(({ theme }) => ({ + alignItems: 'center', + display: 'flex', + height: '36px', + width: '100%', +})); + +export const NewMessageAttachmentImg = styled('img')({ + border: '1px dashed #646464', + cursor: 'pointer', + height: 'auto', + objectFit: 'contain', + padding: '10px', + userSelect: 'none', + width: 'auto', }); -export const NewMessageSendButton = styled(Box)` - border-radius: 4px; - border: 1px solid rgba(0, 0, 0, 0.9); - display: inline-flex; - padding: 8px 16px 8px 12px; - justify-content: center; - align-items: center; - gap: 8px; - width: fit-content; - transition: all 0.2s; - color: black; - min-width: 120px; - gap: 8px; - position: relative; - cursor: pointer; - &:hover { - background-color: rgba(41, 41, 43, 1); - color: white; - svg path { - fill: white; // Fill color changes to white on hover - } - } -`; +export const NewMessageSendButton = styled(Box)(({ theme }) => ({ + alignItems: 'center', + border: `1px solid ${theme.palette.border.main}`, // you can replace with theme.palette.divider or whatever you want later + borderRadius: '4px', + color: theme.palette.text.primary, // replace later with theme.palette.text.primary if needed + cursor: 'pointer', + display: 'inline-flex', + gap: '8px', + justifyContent: 'center', + minWidth: '120px', + padding: '8px 16px 8px 12px', + position: 'relative', + transition: 'all 0.2s', + width: 'fit-content', + '&:hover': { + backgroundColor: theme.palette.action.hover, // replace with theme value if needed + }, +})); export const NewMessageSendP = styled(Typography)` font-family: Roboto; font-size: 16px; font-style: normal; font-weight: 500; - line-height: 120%; /* 19.2px */ letter-spacing: -0.16px; + line-height: 120%; /* 19.2px */ `; export const ShowMessageNameP = styled(Typography)` font-family: Roboto; font-size: 16px; font-weight: 900; - line-height: 19px; letter-spacing: 0em; - text-align: left; - white-space: nowrap; - text-overflow: ellipsis; + line-height: 19px; overflow: hidden; + text-align: left; + text-overflow: ellipsis; + white-space: nowrap; `; -export const ShowMessageTimeP = styled(Typography)` - color: rgba(255, 255, 255, 0.5); - font-family: Roboto; - font-size: 15px; - font-style: normal; - font-weight: 500; - line-height: normal; -`; + export const ShowMessageSubjectP = styled(Typography)` font-family: Roboto; font-size: 16px; font-weight: 500; - line-height: 19px; letter-spacing: 0.0075em; + line-height: 19px; text-align: left; `; -export const ShowMessageButton = styled(Box)` -display: inline-flex; -padding: 8px 16px 8px 16px; -align-items: center; -justify-content: center; -gap: 8px; -width: fit-content; -transition: all 0.2s; -color: white; -background-color: rgba(41, 41, 43, 1) -min-width: 120px; -gap: 8px; -border-radius: 4px; -border: 0.5px solid rgba(255, 255, 255, 0.70); -font-family: Roboto; +export const ShowMessageButton = styled(Box)(({ theme }) => ({ + alignItems: 'center', + border: theme.palette.border.main, // you'll replace + borderRadius: '4px', + color: theme.palette.text.primary, // you'll replace with theme value + cursor: 'pointer', + display: 'inline-flex', + fontFamily: 'Roboto', + gap: '8px', + justifyContent: 'center', + minWidth: '120px', + padding: '8px 16px', + transition: 'all 0.2s', + width: 'fit-content', + '&:hover': { + background: theme.palette.action.hover, // you'll replace + borderRadius: '4px', + }, +})); -min-width: 120px; -cursor: pointer; -&:hover { - border-radius: 4px; -border: 0.5px solid rgba(255, 255, 255, 0.70); -background: #434448; -} -`; -export const ShowMessageReturnButton = styled(Box)` -display: inline-flex; -padding: 8px 16px 8px 16px; -align-items: center; -justify-content: center; -gap: 8px; -width: fit-content; -transition: all 0.2s; -color: white; -background-color: rgba(41, 41, 43, 1) -min-width: 120px; -gap: 8px; -border-radius: 4px; -font-family: Roboto; +export const ShowMessageReturnButton = styled(Box)(({ theme }) => ({ + alignItems: 'center', + borderRadius: '4px', + color: theme.palette.text.primary, // you'll replace with theme value + cursor: 'pointer', + display: 'inline-flex', + fontFamily: 'Roboto', + gap: '8px', + justifyContent: 'center', + minWidth: '120px', + padding: '8px 16px', + transition: 'all 0.2s', + width: 'fit-content', + '&:hover': { + background: theme.palette.action.hover, // you'll replace + borderRadius: '4px', + }, +})); -min-width: 120px; -cursor: pointer; -&:hover { - border-radius: 4px; -background: #434448; -} -`; - -export const ShowMessageButtonP = styled(Typography)` - font-size: 16px; - font-style: normal; - font-weight: 500; - line-height: 120%; /* 19.2px */ - letter-spacing: -0.16px; - color: white; -`; - -export const ShowMessageButtonImg = styled("img")({ - width: "auto", - height: "auto", - userSelect: "none", - objectFit: "contain", - cursor: "pointer", +export const ShowMessageButtonImg = styled('img')({ + cursor: 'pointer', + height: 'auto', + objectFit: 'contain', + userSelect: 'none', + width: 'auto', }); -export const MailAttachmentImg = styled("img")({ - width: "auto", - height: "auto", - userSelect: "none", - objectFit: "contain", +export const MailAttachmentImg = styled('img')({ + height: 'auto', + objectFit: 'contain', + userSelect: 'none', + width: 'auto', }); -export const AliasAvatarImg = styled("img")({ - width: "auto", - height: "auto", - userSelect: "none", - objectFit: "contain", + +export const AliasAvatarImg = styled('img')({ + height: 'auto', + objectFit: 'contain', + userSelect: 'none', + width: 'auto', }); -export const MoreImg = styled("img")({ - width: "auto", - height: "auto", - userSelect: "none", - objectFit: "contain", - transition: "0.2s all", - "&:hover": { - transform: "scale(1.3)", + +export const MoreImg = styled('img')({ + height: 'auto', + objectFit: 'contain', + transition: '0.2s all', + userSelect: 'none', + width: 'auto', + '&:hover': { + transform: 'scale(1.3)', }, }); -export const MoreP = styled(Typography)` - color: rgba(255, 255, 255, 0.5); - - /* Attachments */ - font-family: Roboto; - font-size: 16px; - font-style: normal; - font-weight: 400; - line-height: 120%; /* 19.2px */ - letter-spacing: -0.16px; - white-space: nowrap; -`; -export const ThreadContainerFullWidth = styled(Box)(({ theme }) => ({ - display: "flex", - flexDirection: "column", - width: "100%", - alignItems: "center", +export const MoreP = styled(Typography)(({ theme }) => ({ + color: theme.palette.text.primary, // Now dynamic + fontFamily: 'Roboto', + fontSize: '16px', + fontStyle: 'normal', + fontWeight: 400, + letterSpacing: '-0.16px', + lineHeight: '120%', // 19.2px + whiteSpace: 'nowrap', })); + +export const ThreadContainerFullWidth = styled(Box)(({ theme }) => ({ + alignItems: 'center', + display: 'flex', + flexDirection: 'column', + width: '100%', +})); + export const ThreadContainer = styled(Box)(({ theme }) => ({ - display: "flex", - flexDirection: "column", - width: "100%", - maxWidth: "95%", + display: 'flex', + flexDirection: 'column', + maxWidth: '95%', + width: '100%', })); export const GroupNameP = styled(Typography)` - color: #fff; font-size: 25px; font-style: normal; font-weight: 700; - line-height: 120%; /* 30px */ letter-spacing: 0.188px; + line-height: 120%; /* 30px */ `; export const AllThreadP = styled(Typography)` - color: #FFF; -font-size: 20px; -font-style: normal; -font-weight: 400; -line-height: 120%; /* 24px */ -letter-spacing: 0.15px; + font-size: 20px; + font-style: normal; + font-weight: 400; + letter-spacing: 0.15px; + line-height: 120%; /* 24px */ `; -export const SingleThreadParent = styled(Box)` -border-radius: 35px 4px 4px 35px; -position: relative; -background: #434448; -display: flex; -padding: 13px; -cursor: pointer; -margin-bottom: 5px; -height: 76px; -align-items:center; -transition: 0.2s all; -&:hover { -background: rgba(255, 255, 255, 0.20) -} -`; -export const SingleTheadMessageParent = styled(Box)` -border-radius: 35px 4px 4px 35px; -background: #434448; -display: flex; -padding: 13px; -cursor: pointer; -margin-bottom: 5px; -height: 76px; -align-items:center; - -`; - -export const ThreadInfoColumn = styled(Box)(({ theme }) => ({ - display: "flex", - flexDirection: "column", - width: "170px", - gap: '2px', - marginLeft: '10px', - height: '100%', - justifyContent: 'center' +export const SingleThreadParent = styled(Box)(({ theme }) => ({ + alignItems: 'center', + backgroundColor: theme.palette.background.paper, // or remove if you want no background by default + borderRadius: '35px 4px 4px 35px', + cursor: 'pointer', + display: 'flex', + height: '76px', + marginBottom: '5px', + padding: '13px', + position: 'relative', + transition: '0.2s all', + '&:hover': { + backgroundColor: theme.palette.action.hover, + }, })); +export const SingleTheadMessageParent = styled(Box)(({ theme }) => ({ + alignItems: 'center', + background: theme.palette.background.paper, + borderRadius: '35px 4px 4px 35px', + cursor: 'pointer', + display: 'flex', + height: '76px', + marginBottom: '5px', + padding: '13px', +})); + +export const ThreadInfoColumn = styled(Box)(({ theme }) => ({ + display: 'flex', + flexDirection: 'column', + gap: '2px', + height: '100%', + justifyContent: 'center', + marginLeft: '10px', + width: '170px', +})); export const ThreadInfoColumnNameP = styled(Typography)` -color: #FFF; -font-family: Roboto; -font-size: 16px; -font-style: normal; -font-weight: 900; -line-height: normal; -white-space: nowrap; - text-overflow: ellipsis; + font-family: Roboto; + font-size: 16px; + font-style: normal; + font-weight: 900; + line-height: normal; overflow: hidden; -`; -export const ThreadInfoColumnbyP = styled('span')` -color: rgba(255, 255, 255, 0.80); -font-family: Roboto; -font-size: 16px; -font-style: normal; -font-weight: 500; -line-height: normal; + text-overflow: ellipsis; + white-space: nowrap; `; -export const ThreadInfoColumnTime = styled(Typography)` -color: rgba(255, 255, 255, 0.80); -font-family: Roboto; -font-size: 15px; -font-style: normal; -font-weight: 500; -line-height: normal; -` +export const ThreadInfoColumnbyP = styled('span')(({ theme }) => ({ + color: theme.palette.text.secondary, + fontFamily: 'Roboto', + fontSize: '16px', + fontStyle: 'normal', + fontWeight: 500, + lineHeight: 'normal', +})); + +export const ThreadInfoColumnTime = styled(Typography)(({ theme }) => ({ + color: theme.palette.text.secondary, + fontFamily: 'Roboto', + fontSize: '15px', + fontStyle: 'normal', + fontWeight: 500, + lineHeight: 'normal', +})); + export const ThreadSingleTitle = styled(Typography)` -color: #FFF; -font-family: Roboto; -font-size: 23px; -font-style: normal; -font-weight: 700; -line-height: normal; -white-space: wrap; - text-overflow: ellipsis; + font-family: Roboto; + font-size: 23px; + font-style: normal; + font-weight: 700; + line-height: normal; overflow: hidden; -` + text-overflow: ellipsis; + white-space: wrap; +`; + export const ThreadSingleLastMessageP = styled(Typography)` -color: #FFF; -font-family: Roboto; -font-size: 12px; -font-style: normal; -font-weight: 600; -line-height: normal; -` + font-family: Roboto; + font-size: 12px; + font-style: normal; + font-weight: 600; + line-height: normal; +`; + export const ThreadSingleLastMessageSpanP = styled('span')` -color: #FFF; -font-family: Roboto; -font-size: 12px; -font-style: normal; -font-weight: 400; -line-height: normal; + font-family: Roboto; + font-size: 12px; + font-style: normal; + font-weight: 400; + line-height: normal; `; export const GroupContainer = styled(Box)` -position: relative; - overflow: auto; - width: 100%; - - -` + overflow: auto; + position: relative; + width: 100%; +`; export const CloseContainer = styled(Box)(({ theme }) => ({ - display: "flex", - width: "50px", - overflow: "hidden", - alignItems: "center", - cursor: "pointer", - transition: "0.2s background-color", - justifyContent: "center", - position: 'absolute', - top: '0px', - right: '0px', - height: '50px', + alignItems: 'center', borderRadius: '0px 12px 0px 0px', - "&:hover": { - backgroundColor: "rgba(162, 31, 31, 1)", + cursor: 'pointer', + display: 'flex', + height: '50px', + justifyContent: 'center', + overflow: 'hidden', + position: 'absolute', + right: '0px', + top: '0px', + transition: '0.2s background-color', + width: '50px', + '&:hover': { + backgroundColor: theme.palette.action.hover, }, -})); \ No newline at end of file +})); diff --git a/src/components/Group/Forum/NewThread.tsx b/src/components/Group/Forum/NewThread.tsx index 4c237ec..f89e2aa 100644 --- a/src/components/Group/Forum/NewThread.tsx +++ b/src/components/Group/Forum/NewThread.tsx @@ -1,41 +1,35 @@ -import React, { useEffect, useRef, useState } from "react"; -import { Box, Button, CircularProgress, Input, Typography } from "@mui/material"; -import ShortUniqueId from "short-unique-id"; -import CloseIcon from "@mui/icons-material/Close"; - -import ModalCloseSVG from "../../../assets/svgs/ModalClose.svg"; - -import ComposeIconSVG from "../../../assets/svgs/ComposeIcon.svg"; - +import { useContext, useEffect, useRef, useState } from 'react'; +import { Box, CircularProgress, Input, useTheme } from '@mui/material'; +import ShortUniqueId from 'short-unique-id'; import { - AttachmentContainer, CloseContainer, ComposeContainer, - ComposeIcon, ComposeP, InstanceFooter, InstanceListContainer, InstanceListHeader, - NewMessageAttachmentImg, - NewMessageCloseImg, NewMessageHeaderP, NewMessageInputRow, NewMessageSendButton, NewMessageSendP, -} from "./Mail-styles"; - -import { ReusableModal } from "./ReusableModal"; -import { Spacer } from "../../../common/Spacer"; -import { formatBytes } from "../../../utils/Size"; -import { CreateThreadIcon } from "../../../assets/svgs/CreateThreadIcon"; -import { SendNewMessage } from "../../../assets/svgs/SendNewMessage"; -import { TextEditor } from "./TextEditor"; -import { MyContext, isMobile, pauseAllQueues, resumeAllQueues } from "../../../App"; -import { getFee } from "../../../background"; -import TipTap from "../../Chat/TipTap"; -import { MessageDisplay } from "../../Chat/MessageDisplay"; -import { CustomizedSnackbars } from "../../Snackbar/Snackbar"; -import { saveTempPublish } from "../../Chat/GroupAnnouncements"; +} from './Mail-styles'; +import { ReusableModal } from './ReusableModal'; +import { Spacer } from '../../../common/Spacer'; +import { CreateThreadIcon } from '../../../assets/Icons/CreateThreadIcon'; +import { SendNewMessage } from '../../../assets/Icons/SendNewMessage'; +import { + QORTAL_APP_CONTEXT, + pauseAllQueues, + resumeAllQueues, +} from '../../../App'; +import { getFee } from '../../../background/background'; +import TipTap from '../../Chat/TipTap'; +import { MessageDisplay } from '../../Chat/MessageDisplay'; +import { CustomizedSnackbars } from '../../Snackbar/Snackbar'; +import { saveTempPublish } from '../../Chat/GroupAnnouncements'; +import { useTranslation } from 'react-i18next'; +import { ComposeIcon } from '../../../assets/Icons/ComposeIcon'; +import CloseIcon from '@mui/icons-material/Close'; const uid = new ShortUniqueId({ length: 8 }); @@ -54,21 +48,21 @@ export function objectToBase64(obj: any) { const jsonString = JSON.stringify(obj); // Step 2: Create a Blob from the JSON string - const blob = new Blob([jsonString], { type: "application/json" }); + const blob = new Blob([jsonString], { type: 'application/json' }); // Step 3: Create a FileReader to read the Blob as a base64-encoded string return new Promise((resolve, reject) => { const reader = new FileReader(); reader.onloadend = () => { - if (typeof reader.result === "string") { + if (typeof reader.result === 'string') { // Remove 'data:application/json;base64,' prefix const base64 = reader.result.replace( - "data:application/json;base64,", - "" + 'data:application/json;base64,', + '' ); resolve(base64); } else { - reject(new Error("Failed to read the Blob as a base64-encoded string")); + reject(new Error('Failed to read the Blob as a base64-encoded string')); } }; reader.onerror = () => { @@ -94,10 +88,11 @@ export const publishGroupEncryptedResource = async ({ identifier, }) => { return new Promise((res, rej) => { - window.sendMessage("publishGroupEncryptedResource", { - encryptedData, - identifier, - }) + window + .sendMessage('publishGroupEncryptedResource', { + encryptedData, + identifier, + }) .then((response) => { if (!response?.error) { res(response); @@ -106,19 +101,19 @@ export const publishGroupEncryptedResource = async ({ rej(response.error); }) .catch((error) => { - rej(error.message || "An error occurred"); + rej(error.message || 'An error occurred'); }); - }); }; export const encryptSingleFunc = async (data: string, secretKeyObject: any) => { try { return new Promise((res, rej) => { - window.sendMessage("encryptSingle", { - data, - secretKeyObject, - }) + window + .sendMessage('encryptSingle', { + data, + secretKeyObject, + }) .then((response) => { if (!response?.error) { res(response); @@ -127,12 +122,14 @@ export const encryptSingleFunc = async (data: string, secretKeyObject: any) => { rej(response.error); }) .catch((error) => { - rej(error.message || "An error occurred"); + rej(error.message || 'An error occurred'); }); - }); - } catch (error) {} + } catch (error) { + console.log(error); + } }; + export const NewThread = ({ groupInfo, members, @@ -145,17 +142,24 @@ export const NewThread = ({ postReply, myName, setPostReply, - isPrivate + isPrivate, }: NewMessageProps) => { - const { show } = React.useContext(MyContext); - + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + const { show } = useContext(QORTAL_APP_CONTEXT); const [isOpen, setIsOpen] = useState(false); - const [value, setValue] = useState(""); + const [value, setValue] = useState(''); const [isSending, setIsSending] = useState(false); - const [threadTitle, setThreadTitle] = useState(""); - const [openSnack, setOpenSnack] = React.useState(false); - const [infoSnack, setInfoSnack] = React.useState(null); + const [threadTitle, setThreadTitle] = useState(''); + const [openSnack, setOpenSnack] = useState(false); + const [infoSnack, setInfoSnack] = useState(null); const editorRef = useRef(null); + const theme = useTheme(); const setEditorRef = (editorInstance) => { editorRef.current = editorInstance; }; @@ -168,66 +172,77 @@ export const NewThread = ({ const closeModal = () => { setIsOpen(false); - setValue(""); - if(setPostReply){ - setPostReply(null) + setValue(''); + if (setPostReply) { + setPostReply(null); } - }; async function publishQDNResource() { try { - pauseAllQueues() - if(isSending) return - setIsSending(true) - let name: string = ""; - let errorMsg = ""; + pauseAllQueues(); + if (isSending) return; + setIsSending(true); + let name: string = ''; + let errorMsg = ''; - name = userInfo?.name || ""; + name = userInfo?.name || ''; const missingFields: string[] = []; if (!isMessage && !threadTitle) { - errorMsg = "Please provide a thread title"; + errorMsg = t('core:message.question.provide_thread', { + postProcess: 'capitalizeFirstChar', + }); } if (!name) { - errorMsg = "Cannot send a message without a access to your name"; + errorMsg = t('group:message.error.access_name', { + postProcess: 'capitalizeFirstChar', + }); } + if (!groupInfo) { - errorMsg = "Cannot access group information"; + errorMsg = t('group:message.error.group_info', { + postProcess: 'capitalizeFirstChar', + }); } // if (!description) missingFields.push('subject') if (missingFields.length > 0) { - const missingFieldsString = missingFields.join(", "); - const errMsg = `Missing: ${missingFieldsString}`; + const missingFieldsString = missingFields.join(', '); + const errMsg = t('core:message.error.missing_fields', { + field: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); errorMsg = errMsg; } - if (errorMsg) { - // dispatch( - // setNotification({ - // msg: errorMsg, - // alertType: "error", - // }) - // ); throw new Error(errorMsg); } const htmlContent = editorRef.current.getHTML(); - - if (!htmlContent?.trim() || htmlContent?.trim() === "

") - throw new Error("Please provide a first message to the thread"); - const fee = await getFee("ARBITRARY"); + + if (!htmlContent?.trim() || htmlContent?.trim() === '

') { + const errMsg = t('group:message.generic.provide_message', { + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errMsg); + } + + const fee = await getFee('ARBITRARY'); let feeToShow = fee.fee; + if (!isMessage) { feeToShow = +feeToShow * 2; } await show({ - message: "Would you like to perform a ARBITRARY transaction?", - publishFee: feeToShow + " QORT", + message: t('core:message.question.perform_transaction', { + action: 'ARBITRARY', + postProcess: 'capitalizeFirstChar', + }), + publishFee: feeToShow + ' QORT', }); let reply = null; @@ -237,6 +252,7 @@ export const NewThread = ({ delete reply.reply; } } + const mailObject: any = { createdAt: Date.now(), version: 1, @@ -245,20 +261,24 @@ export const NewThread = ({ threadOwner: currentThread?.threadData?.name || name, reply, }; - - const secretKey = isPrivate === false ? null : await getSecretKey(false, true); + + const secretKey = + isPrivate === false ? null : await getSecretKey(false, true); if (!secretKey && isPrivate) { - throw new Error("Cannot get group secret key"); + const errMsg = t('group:message.error.group_secret_key', { + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errMsg); } - + if (!isMessage) { const idThread = uid.rnd(); const idMsg = uid.rnd(); const messageToBase64 = await objectToBase64(mailObject); - const encryptSingleFirstPost = isPrivate === false ? messageToBase64 : await encryptSingleFunc( - messageToBase64, - secretKey - ); + const encryptSingleFirstPost = + isPrivate === false + ? messageToBase64 + : await encryptSingleFunc(messageToBase64, secretKey); const threadObject = { title: threadTitle, groupId: groupInfo.id, @@ -267,184 +287,198 @@ export const NewThread = ({ }; const threadToBase64 = await objectToBase64(threadObject); - const encryptSingleThread = isPrivate === false ? threadToBase64 : await encryptSingleFunc( - threadToBase64, - secretKey - ); - let identifierThread = `grp-${groupInfo.groupId}-thread-${idThread}`; + const encryptSingleThread = + isPrivate === false + ? threadToBase64 + : await encryptSingleFunc(threadToBase64, secretKey); + const identifierThread = `grp-${groupInfo.groupId}-thread-${idThread}`; await publishGroupEncryptedResource({ identifier: identifierThread, encryptedData: encryptSingleThread, }); - let identifierPost = `thmsg-${identifierThread}-${idMsg}`; + const identifierPost = `thmsg-${identifierThread}-${idMsg}`; await publishGroupEncryptedResource({ identifier: identifierPost, encryptedData: encryptSingleFirstPost, }); + const dataToSaveToStorage = { name: myName, identifier: identifierThread, service: 'DOCUMENT', tempData: threadObject, created: Date.now(), - groupId: groupInfo.groupId - } + groupId: groupInfo.groupId, + }; + const dataToSaveToStoragePost = { name: myName, identifier: identifierPost, service: 'DOCUMENT', tempData: mailObject, created: Date.now(), - threadId: identifierThread - } - await saveTempPublish({data: dataToSaveToStorage, key: 'thread'}) - await saveTempPublish({data: dataToSaveToStoragePost, key: 'thread-post'}) - setInfoSnack({ - type: "success", - message: "Successfully created thread. It may take some time for the publish to propagate", - }); - setOpenSnack(true) + threadId: identifierThread, + }; + + await saveTempPublish({ data: dataToSaveToStorage, key: 'thread' }); + await saveTempPublish({ + data: dataToSaveToStoragePost, + key: 'thread-post', + }); + setInfoSnack({ + type: 'success', + message: t('group:message.success.thread_creation', { + postProcess: 'capitalizeFirstChar', + }), + }); + setOpenSnack(true); - // dispatch( - // setNotification({ - // msg: "Message sent", - // alertType: "success", - // }) - // ); if (publishCallback) { - publishCallback() - + publishCallback(); } closeModal(); } else { - - if (!currentThread) throw new Error("unable to locate thread Id"); + if (!currentThread) { + const errMsg = t('group:message.error.thread_id', { + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errMsg); + } const idThread = currentThread.threadId; const messageToBase64 = await objectToBase64(mailObject); - const encryptSinglePost = isPrivate === false ? messageToBase64 : await encryptSingleFunc( - messageToBase64, - secretKey - ); + const encryptSinglePost = + isPrivate === false + ? messageToBase64 + : await encryptSingleFunc(messageToBase64, secretKey); + const idMsg = uid.rnd(); - let identifier = `thmsg-${idThread}-${idMsg}`; - const res = await publishGroupEncryptedResource({ - identifier: identifier, - encryptedData: encryptSinglePost, - }); - + const identifier = `thmsg-${idThread}-${idMsg}`; const dataToSaveToStoragePost = { threadId: idThread, name: myName, identifier: identifier, service: 'DOCUMENT', tempData: mailObject, - created: Date.now() - } - await saveTempPublish({data: dataToSaveToStoragePost, key: 'thread-post'}) - // await qortalRequest(multiplePublishMsg); - // dispatch( - // setNotification({ - // msg: "Message sent", - // alertType: "success", - // }) - // ); - setInfoSnack({ - type: "success", - message: "Successfully created post. It may take some time for the publish to propagate", + created: Date.now(), + }; + await saveTempPublish({ + data: dataToSaveToStoragePost, + key: 'thread-post', }); - setOpenSnack(true) - if(publishCallback){ - publishCallback() + setInfoSnack({ + type: 'success', + message: t('group:message.success.post_creation', { + postProcess: 'capitalizeFirstChar', + }), + }); + setOpenSnack(true); + if (publishCallback) { + publishCallback(); } - // messageCallback({ - // identifier, - // id: identifier, - // name, - // service: MAIL_SERVICE_TYPE, - // created: Date.now(), - // ...mailObject, - // }); } - closeModal(); } catch (error: any) { - if(error?.message){ + if (error?.message) { setInfoSnack({ - type: "error", + type: 'error', message: error?.message, }); - setOpenSnack(true) + setOpenSnack(true); } - } finally { setIsSending(false); - resumeAllQueues() + resumeAllQueues(); } } const sendMail = () => { publishQDNResource(); }; + return ( setIsOpen(true)} > - - {currentThread ? "New Post" : "New Thread"} + + + {currentThread + ? t('core:action.new.post', { + postProcess: 'capitalizeFirstChar', + }) + : t('core:action.new.thread', { + postProcess: 'capitalizeFirstChar', + })} + - {isMessage ? "Post Message" : "New Thread"} + {isMessage + ? t('core:action.post_message', { + postProcess: 'capitalizeFirstChar', + }) + : t('core:action.new.thread', { + postProcess: 'capitalizeFirstChar', + })} - - + + + + {!isMessage && ( <> + { setThreadTitle(e.target.value); }} - placeholder="Thread Title" + placeholder={t('core:thread_title', { + postProcess: 'capitalizeFirstChar', + })} disableUnderline autoComplete="off" autoCorrect="off" sx={{ - width: "100%", - color: "white", - "& .MuiInput-input::placeholder": { - color: "rgba(255,255,255, 0.70) !important", - fontSize: isMobile ? '14px' : "20px", - fontStyle: "normal", + width: '100%', + '& .MuiInput-input::placeholder': { + fontSize: '20px', + fontStyle: 'normal', fontWeight: 400, - lineHeight: "120%", // 24px - letterSpacing: "0.15px", + lineHeight: '120%', // 24px + letterSpacing: '0.15px', opacity: 1, }, - "&:focus": { - outline: "none", + '&:focus': { + outline: 'none', }, // Add any additional styles for the input here }} @@ -481,21 +515,20 @@ export const NewThread = ({ {postReply && postReply.textContentV2 && ( )} - {!isMobile && ( - - )} + + - {/* { - setValue(val); - }} - /> */} + {isSending && ( - - + + )} + - {isMessage ? "Post" : "Create Thread"} + {isMessage + ? t('core:action.post', { + postProcess: 'capitalizeFirstChar', + }) + : t('core:action.create_thread', { + postProcess: 'capitalizeFirstChar', + })} + {isMessage ? ( - + ) : ( - - + + ); }; diff --git a/src/components/Group/Forum/ReadOnlySlate.tsx b/src/components/Group/Forum/ReadOnlySlate.tsx index d64cf9e..7fc90b1 100644 --- a/src/components/Group/Forum/ReadOnlySlate.tsx +++ b/src/components/Group/Forum/ReadOnlySlate.tsx @@ -1,18 +1,24 @@ -import React, { useCallback, useEffect, useMemo, useState } from 'react'; -import { createEditor} from 'slate'; -import { withReact, Slate, Editable, RenderElementProps, RenderLeafProps } from 'slate-react'; +import { FC, useCallback, useEffect, useMemo, useState } from 'react'; +import { createEditor } from 'slate'; +import { + withReact, + Slate, + Editable, + RenderElementProps, + RenderLeafProps, +} from 'slate-react'; -type ExtendedRenderElementProps = RenderElementProps & { mode?: string } +type ExtendedRenderElementProps = RenderElementProps & { mode?: string }; export const renderElement = ({ attributes, children, element, - mode + mode, }: ExtendedRenderElementProps) => { switch (element.type) { case 'block-quote': - return
{children}
+ return
{children}
; case 'heading-2': return (

{children}

- ) + ); case 'heading-3': return (

{children}

- ) + ); case 'code-block': return (
           {children}
         
- ) + ); case 'code-line': - return
{children}
+ return
{children}
; case 'link': return ( {children} - ) + ); default: return (

{children}

- ) + ); } -} - +}; export const renderLeaf = ({ attributes, children, leaf }: RenderLeafProps) => { - let el = children + let el = children; if (leaf.bold) { - el = {el} + el = {el}; } if (leaf.italic) { - el = {el} + el = {el}; } if (leaf.underline) { - el = {el} + el = {el}; } if (leaf.link) { @@ -81,39 +86,40 @@ export const renderLeaf = ({ attributes, children, leaf }: RenderLeafProps) => { {el} - ) + ); } - return {el} -} + return {el}; +}; interface ReadOnlySlateProps { - content: any - mode?: string + content: any; + mode?: string; } -const ReadOnlySlate: React.FC = ({ content, mode }) => { - const [load, setLoad] = useState(false) - const editor = useMemo(() => withReact(createEditor()), []) - const value = useMemo(() => content, [content]) - const performUpdate = useCallback(async()=> { - setLoad(true) - await new Promise((res)=> { - setTimeout(() => { - res() - }, 250); - }) - setLoad(false) - }, []) - useEffect(()=> { +const ReadOnlySlate: FC = ({ content, mode }) => { + const [load, setLoad] = useState(false); + const editor = useMemo(() => withReact(createEditor()), []); + const value = useMemo(() => content, [content]); - + const performUpdate = useCallback(async () => { + setLoad(true); + try { + await new Promise((res) => { + setTimeout(() => { + res(); + }, 250); + }); + } catch (error) { + console.log(error); + } + setLoad(false); + }, []); + useEffect(() => { + performUpdate(); + }, [value]); - - performUpdate() - }, [value]) - - if(load) return null + if (load) return null; return ( {}}> @@ -123,7 +129,7 @@ const ReadOnlySlate: React.FC = ({ content, mode }) => { renderLeaf={renderLeaf} /> - ) -} + ); +}; -export default ReadOnlySlate; \ No newline at end of file +export default ReadOnlySlate; diff --git a/src/components/Group/Forum/ReusableModal.tsx b/src/components/Group/Forum/ReusableModal.tsx index d081293..83ee927 100644 --- a/src/components/Group/Forum/ReusableModal.tsx +++ b/src/components/Group/Forum/ReusableModal.tsx @@ -1,30 +1,30 @@ -import React from 'react' -import { Box, Modal, useTheme } from '@mui/material' -import { isMobile } from '../../../App' +import { FC } from 'react'; +import { Box, Modal, useTheme } from '@mui/material'; interface MyModalProps { - open: boolean - onClose?: () => void - onSubmit?: (obj: any) => Promise - children: any - customStyles?: any + open: boolean; + onClose?: () => void; + onSubmit?: (obj: any) => Promise; + children: any; + customStyles?: any; } -export const ReusableModal: React.FC = ({ +export const ReusableModal: FC = ({ open, onClose, onSubmit, children, - customStyles = {} + customStyles = {}, }) => { - const theme = useTheme() + const theme = useTheme(); + return ( = ({ }, }} disableAutoFocus - disableEnforceFocus - disableRestoreFocus + disableEnforceFocus + disableRestoreFocus > {children} - ) -} + ); +}; diff --git a/src/components/Group/Forum/ShowMessageWithoutModal.tsx b/src/components/Group/Forum/ShowMessageWithoutModal.tsx index 9a079d6..ecf60e9 100644 --- a/src/components/Group/Forum/ShowMessageWithoutModal.tsx +++ b/src/components/Group/Forum/ShowMessageWithoutModal.tsx @@ -1,9 +1,8 @@ -import React, { useState } from "react"; -import { Avatar, Box, IconButton } from "@mui/material"; -import DOMPurify from "dompurify"; +import { useState } from 'react'; +import { Avatar, Box, IconButton } from '@mui/material'; +import DOMPurify from 'dompurify'; import FormatQuoteIcon from '@mui/icons-material/FormatQuote'; -import MoreSVG from '../../../assets/svgs/More.svg' - +import MoreSVG from '../../../assets/svgs/More.svg'; import { MoreImg, MoreP, @@ -11,20 +10,18 @@ import { ThreadInfoColumn, ThreadInfoColumnNameP, ThreadInfoColumnTime, -} from "./Mail-styles"; -import { Spacer } from "../../../common/Spacer"; -import { DisplayHtml } from "./DisplayHtml"; -import { formatTimestampForum } from "../../../utils/time"; -import ReadOnlySlate from "./ReadOnlySlate"; -import { MessageDisplay } from "../../Chat/MessageDisplay"; -import { getBaseApi } from "../../../background"; -import { getBaseApiReact } from "../../../App"; -import { WrapperUserAction } from "../../WrapperUserAction"; +} from './Mail-styles'; +import { Spacer } from '../../../common/Spacer'; +import { formatTimestampForum } from '../../../utils/time'; +import ReadOnlySlate from './ReadOnlySlate'; +import { MessageDisplay } from '../../Chat/MessageDisplay'; +import { getBaseApiReact } from '../../../App'; +import { WrapperUserAction } from '../../WrapperUserAction'; export const ShowMessage = ({ message, openNewPostWithQuote, myName }: any) => { const [expandAttachments, setExpandAttachments] = useState(false); - let cleanHTML = ""; + let cleanHTML = ''; if (message?.htmlContent) { cleanHTML = DOMPurify.sanitize(message.htmlContent); } @@ -32,173 +29,182 @@ export const ShowMessage = ({ message, openNewPostWithQuote, myName }: any) => { return ( - - {message?.name?.charAt(0)} - + + + {message?.name?.charAt(0)} + + + - - - {message?.name} + + {message?.name} + {formatTimestampForum(message?.created)} +
- {message?.attachments?.length > 0 && ( - - {message?.attachments - .map((file: any, index: number) => { - const isFirst = index === 0 - return ( - + {message?.attachments?.length > 0 && ( + + {message?.attachments.map((file: any, index: number) => { + const isFirst = index === 0; + return ( - {/* - - - - {file?.originalFilename || file?.filename} - - */} - {message?.attachments?.length > 1 && isFirst && ( - { - setExpandAttachments(prev => !prev); - }} - > - 1 && isFirst && ( + - - {expandAttachments ? 'hide' : `(${message?.attachments?.length - 1} more)`} - - - - )} + onClick={() => { + setExpandAttachments((prev) => !prev); + }} + > + + + {expandAttachments + ? 'hide' + : `(${message?.attachments?.length - 1} more)`} + + + )} + - - ); - }) - } - - )} - -
+ ); + })} +
+ )} +
+ + {message?.reply?.textContentV2 && ( <> - + + + {message?.reply?.name?.charAt(0)} + - }} - > - - {message?.reply?.name?.charAt(0)} - - {message?.reply?.name} - - - - - - + + + {message?.reply?.name} + + + + + + + + - )} - + {message?.textContent && ( )} @@ -208,22 +214,18 @@ export const ShowMessage = ({ message, openNewPostWithQuote, myName }: any) => { {message?.htmlContent && (
)} - - openNewPostWithQuote(message)} - + - - + openNewPostWithQuote(message)}> + + - - - ); }; diff --git a/src/components/Group/Forum/TextEditor.tsx b/src/components/Group/Forum/TextEditor.tsx deleted file mode 100644 index 874f2e3..0000000 --- a/src/components/Group/Forum/TextEditor.tsx +++ /dev/null @@ -1,39 +0,0 @@ -import React from "react"; -import ReactQuill, { Quill } from "react-quill"; -import "react-quill/dist/quill.snow.css"; -import ImageResize from "quill-image-resize-module-react"; -import './texteditor.css' -Quill.register("modules/imageResize", ImageResize); - -const modules = { - imageResize: { - parchment: Quill.import("parchment"), - modules: ["Resize", "DisplaySize"], - }, - toolbar: [ - ["bold", "italic", "underline", "strike"], // styled text - ["blockquote", "code-block"], // blocks - [{ header: 1 }, { header: 2 }], // custom button values - [{ list: "ordered" }, { list: "bullet" }], // lists - [{ script: "sub" }, { script: "super" }], // superscript/subscript - [{ indent: "-1" }, { indent: "+1" }], // outdent/indent - [{ direction: "rtl" }], // text direction - [{ size: ["small", false, "large", "huge"] }], // custom dropdown - [{ header: [1, 2, 3, 4, 5, 6, false] }], // custom button values - [{ color: [] }, { background: [] }], // dropdown with defaults - [{ font: [] }], // font family - [{ align: [] }], // text align - ["clean"], // remove formatting - // ["image"], // image - ], -}; -export const TextEditor = ({ inlineContent, setInlineContent }: any) => { - return ( - - ); -}; diff --git a/src/components/Group/Forum/Thread copy.tsx b/src/components/Group/Forum/Thread copy.tsx deleted file mode 100644 index 9091a2c..0000000 --- a/src/components/Group/Forum/Thread copy.tsx +++ /dev/null @@ -1,329 +0,0 @@ -import React, { - FC, - useCallback, - useEffect, - useRef, - useState -} from 'react' - -import { - Box, - - Skeleton, - -} from '@mui/material' -import { ShowMessage } from './ShowMessageWithoutModal' -// import { -// setIsLoadingCustom, -// } from '../../state/features/globalSlice' -import { ComposeP, GroupContainer, GroupNameP, MailIconImg, ShowMessageReturnButton, SingleThreadParent, ThreadContainer, ThreadContainerFullWidth } from './Mail-styles' -import { Spacer } from '../../../common/Spacer' -import { threadIdentifier } from './GroupMail' -import LazyLoad from '../../../common/LazyLoad' -import ReturnSVG from '../../../assets/svgs/Return.svg' -import { NewThread } from './NewThread' -import { decryptPublishes } from '../../Chat/GroupAnnouncements' -import { getBaseApi } from '../../../background' -import { getArbitraryEndpointReact, getBaseApiReact } from '../../../App' -interface ThreadProps { - currentThread: any - groupInfo: any - closeThread: () => void - members: any -} - -const getEncryptedResource = async ({name, identifier, secretKey})=> { - - const res = await fetch( - `${getBaseApiReact()}/arbitrary/DOCUMENT/${name}/${identifier}?encoding=base64` - ); - const data = await res.text(); - const response = await decryptPublishes([{ data }], secretKey); - const messageData = response[0]; - return messageData.decryptedData - -} - -export const Thread = ({ - currentThread, - groupInfo, - closeThread, - members, - userInfo, - secretKey, - getSecretKey -}: ThreadProps) => { - const [messages, setMessages] = useState([]) - const [hashMapMailMessages, setHashMapMailMessages] = useState({}) - const secretKeyRef = useRef(null) - - - useEffect(() => { - secretKeyRef.current = secretKey; - }, [secretKey]); - const getIndividualMsg = async (message: any) => { - try { - const responseDataMessage = await getEncryptedResource({identifier: message.identifier, name: message.name, secretKey}) - - - const fullObject = { - ...message, - ...(responseDataMessage || {}), - id: message.identifier - } - setHashMapMailMessages((prev)=> { - return { - ...prev, - [message.identifier]: fullObject - } - }) - } catch (error) {} - } - - const getMailMessages = React.useCallback( - async (groupInfo: any, reset?: boolean, hideAlert?: boolean) => { - try { - if(!hideAlert){ - // dispatch(setIsLoadingCustom('Loading messages')) - - } - let threadId = groupInfo.threadId - - const offset = messages.length - const identifier = `thmsg-${threadId}` - const url = `${getBaseApiReact()}${getArbitraryEndpointReact()}?mode=ALL&service=${threadIdentifier}&identifier=${identifier}&limit=20&includemetadata=false&offset=${offset}&reverse=true&prefix=true` - const response = await fetch(url, { - method: 'GET', - headers: { - 'Content-Type': 'application/json' - } - }) - const responseData = await response.json() - let fullArrayMsg = reset ? [] : [...messages] - let newMessages: any[] = [] - for (const message of responseData) { - const index = fullArrayMsg.findIndex( - (p) => p.identifier === message.identifier - ) - if (index !== -1) { - fullArrayMsg[index] = message - } else { - fullArrayMsg.push(message) - getIndividualMsg(message) - } - } - setMessages(fullArrayMsg) - } catch (error) { - } finally { - if(!hideAlert){ - // dispatch(setIsLoadingCustom(null)) - } - } - }, - [messages, secretKey] - ) - const getMessages = React.useCallback(async () => { - if (!currentThread || !secretKey) return - await getMailMessages(currentThread, true) - }, [getMailMessages, currentThread, secretKey]) - const firstMount = useRef(false) - - const saveTimestamp = useCallback((currentThread: any, username?: string)=> { - if(!currentThread?.threadData?.groupId || !currentThread?.threadId || !username) return - const threadIdForLocalStorage = `qmail_threads_${currentThread?.threadData?.groupId}_${currentThread?.threadId}` - const threads = JSON.parse( - localStorage.getItem(`qmail_threads_viewedtimestamp_${username}`) || "{}" - ); - // Convert to an array of objects with identifier and all fields - let dataArray = Object.entries(threads).map(([identifier, value]) => ({ - identifier, - ...(value as any), - })); - - // Sort the array based on timestamp in descending order - dataArray.sort((a, b) => b.timestamp - a.timestamp); - - // Slice the array to keep only the first 500 elements - let latest500 = dataArray.slice(0, 500); - - // Convert back to the original object format - let latest500Data: any = {}; - latest500.forEach(item => { - const { identifier, ...rest } = item; - latest500Data[identifier] = rest; - }); - latest500Data[threadIdForLocalStorage] = { - timestamp: Date.now(), - } - localStorage.setItem( - `qmail_threads_viewedtimestamp_${username}`, - JSON.stringify(latest500Data) - ); - }, []) - useEffect(() => { - if (currentThread && secretKey) { - getMessages() - firstMount.current = true - // saveTimestamp(currentThread, user.name) - } - }, [ currentThread, secretKey]) - const messageCallback = useCallback((msg: any) => { - // dispatch(addToHashMapMail(msg)) - setMessages((prev) => [msg, ...prev]) - }, []) - - const interval = useRef(null) - - const checkNewMessages = React.useCallback( - async (groupInfo: any) => { - try { - let threadId = groupInfo.threadId - - const identifier = `thmsg-${threadId}` - const url = `${getBaseApiReact()}${getArbitraryEndpointReact()}?mode=ALL&service=${threadIdentifier}&identifier=${identifier}&limit=20&includemetadata=false&offset=${0}&reverse=true&prefix=true` - const response = await fetch(url, { - method: 'GET', - headers: { - 'Content-Type': 'application/json' - } - }) - const responseData = await response.json() - const latestMessage = messages[0] - if (!latestMessage) return - const findMessage = responseData?.findIndex( - (item: any) => item?.identifier === latestMessage?.identifier - ) - let sliceLength = responseData.length - if (findMessage !== -1) { - sliceLength = findMessage - } - const newArray = responseData.slice(0, findMessage).reverse() - let fullArrayMsg = [...messages] - for (const message of newArray) { - try { - - const responseDataMessage = await getEncryptedResource({identifier: message.identifier, name: message.name, secretKey: secretKeyRef.current}) - - const fullObject = { - ...message, - ...(responseDataMessage || {}), - id: message.identifier - } - setHashMapMailMessages((prev)=> { - return { - ...prev, - [message.identifier]: fullObject - } - }) - const index = messages.findIndex( - (p) => p.identifier === fullObject.identifier - ) - if (index !== -1) { - fullArrayMsg[index] = fullObject - } else { - fullArrayMsg.unshift(fullObject) - } - } catch (error) {} - } - setMessages(fullArrayMsg) - } catch (error) { - } finally { - } - }, - [messages] - ) - - const checkNewMessagesFunc = useCallback(() => { - let isCalling = false - interval.current = setInterval(async () => { - if (isCalling) return - isCalling = true - const res = await checkNewMessages(currentThread) - isCalling = false - }, 8000) - }, [checkNewMessages, currentThread]) - - useEffect(() => { - checkNewMessagesFunc() - return () => { - if (interval?.current) { - clearInterval(interval.current) - } - } - }, [checkNewMessagesFunc]) - - - - if (!currentThread) return null - return ( - - - - - - - - {currentThread?.threadData?.title} - - { - setMessages([]) - closeThread() - }}> - - Return to Threads - - - - {messages.map((message) => { - let fullMessage = message - - if (hashMapMailMessages[message?.identifier]) { - fullMessage = hashMapMailMessages[message.identifier] - return - } - - return ( - - - - - - ) - })} - - - {messages.length >= 20 && ( - getMailMessages(currentThread, false, true)}> - - )} - - - ) -} diff --git a/src/components/Group/Forum/Thread.tsx b/src/components/Group/Forum/Thread.tsx index 22b2ba3..762db5d 100644 --- a/src/components/Group/Forum/Thread.tsx +++ b/src/components/Group/Forum/Thread.tsx @@ -1,26 +1,17 @@ -import React, { - FC, - useCallback, - useEffect, - useMemo, - useRef, - useState, -} from "react"; +import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import { Avatar, Box, Button, ButtonBase, - IconButton, - Skeleton, Typography, -} from "@mui/material"; -import { ShowMessage } from "./ShowMessageWithoutModal"; + useTheme, +} from '@mui/material'; +import { ShowMessage } from './ShowMessageWithoutModal'; import { ComposeP, GroupContainer, GroupNameP, - MailIconImg, ShowMessageReturnButton, SingleThreadParent, ThreadContainer, @@ -28,36 +19,35 @@ import { ThreadInfoColumn, ThreadInfoColumnNameP, ThreadInfoColumnTime, -} from "./Mail-styles"; -import { Spacer } from "../../../common/Spacer"; -import { threadIdentifier } from "./GroupMail"; -import LazyLoad from "../../../common/LazyLoad"; -import ReturnSVG from "../../../assets/svgs/Return.svg"; -import { NewThread } from "./NewThread"; +} from './Mail-styles'; +import { Spacer } from '../../../common/Spacer'; +import { threadIdentifier } from './GroupMail'; +import { NewThread } from './NewThread'; import { decryptPublishes, getTempPublish, handleUnencryptedPublishes, -} from "../../Chat/GroupAnnouncements"; -import { LoadingSnackbar } from "../../Snackbar/LoadingSnackbar"; -import { subscribeToEvent, unsubscribeFromEvent } from "../../../utils/events"; -import RefreshIcon from "@mui/icons-material/Refresh"; -import { - getArbitraryEndpointReact, - getBaseApiReact, - isMobile, -} from "../../../App"; +} from '../../Chat/GroupAnnouncements'; +import { LoadingSnackbar } from '../../Snackbar/LoadingSnackbar'; +import { subscribeToEvent, unsubscribeFromEvent } from '../../../utils/events'; +import RefreshIcon from '@mui/icons-material/Refresh'; +import { getArbitraryEndpointReact, getBaseApiReact } from '../../../App'; import { ArrowDownward as ArrowDownwardIcon, ArrowUpward as ArrowUpwardIcon, -} from "@mui/icons-material"; -import { addDataPublishesFunc, getDataPublishesFunc } from "../Group"; -import { RequestQueueWithPromise } from "../../../utils/queue/queue"; -import { CustomLoader } from "../../../common/CustomLoader"; -import { WrapperUserAction } from "../../WrapperUserAction"; -import { formatTimestampForum } from "../../../utils/time"; +} from '@mui/icons-material'; +import { addDataPublishesFunc, getDataPublishesFunc } from '../Group'; +import { RequestQueueWithPromise } from '../../../utils/queue/queue'; +import { CustomLoader } from '../../../common/CustomLoader'; +import { WrapperUserAction } from '../../WrapperUserAction'; +import { formatTimestampForum } from '../../../utils/time'; +import { useTranslation } from 'react-i18next'; +import { ReturnIcon } from '../../../assets/Icons/ReturnIcon'; + const requestQueueSaveToLocal = new RequestQueueWithPromise(1); + const requestQueueDownloadPost = new RequestQueueWithPromise(3); + interface ThreadProps { currentThread: any; groupInfo: any; @@ -65,14 +55,10 @@ interface ThreadProps { members: any; } -const getEncryptedResource = async ({ - name, - identifier, - secretKey, - resource, - groupId, - dataPublishes, -}, isPrivate) => { +const getEncryptedResource = async ( + { name, identifier, secretKey, resource, groupId, dataPublishes }, + isPrivate +) => { let data = dataPublishes[`${name}-${identifier}`]; if ( !data || @@ -92,15 +78,18 @@ const getEncryptedResource = async ({ }; } data = await res.text(); - - if (data?.error || typeof data !== "string") return; + + if (data?.error || typeof data !== 'string') return; await requestQueueSaveToLocal.enqueue(() => { - return addDataPublishesFunc({ ...resource, data }, groupId, "thmsg"); + return addDataPublishesFunc({ ...resource, data }, groupId, 'thmsg'); }); } else { data = data.data; } - const response = isPrivate === false ? handleUnencryptedPublishes([data]) : await decryptPublishes([{ data }], secretKey); + const response = + isPrivate === false + ? handleUnencryptedPublishes([data]) + : await decryptPublishes([{ data }], secretKey); const messageData = response[0]; return messageData.decryptedData; @@ -115,7 +104,7 @@ export const Thread = ({ secretKey, getSecretKey, updateThreadActivityCurrentThread, - isPrivate + isPrivate, }: ThreadProps) => { const [tempPublishedList, setTempPublishedList] = useState([]); const [messages, setMessages] = useState([]); @@ -126,10 +115,17 @@ export const Thread = ({ const [isLoading, setIsLoading] = useState(true); const [postReply, setPostReply] = useState(null); const [hasLastPage, setHasLastPage] = useState(false); - + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + const theme = useTheme(); // Update: Use a new ref for the scrollable container const threadContainerRef = useRef(null); - const threadBeginningRef = useRef(null) + const threadBeginningRef = useRef(null); // New state variables const [showScrollButton, setShowScrollButton] = useState(false); const [isAtBottom, setIsAtBottom] = useState(false); @@ -140,7 +136,7 @@ export const Thread = ({ const dataPublishes = useRef({}); const getSavedData = useCallback(async (groupId) => { - const res = await getDataPublishesFunc(groupId, "thmsg"); + const res = await getDataPublishesFunc(groupId, 'thmsg'); dataPublishes.current = res || {}; }, []); @@ -159,14 +155,17 @@ export const Thread = ({ const getIndividualMsg = async (message: any) => { try { - const responseDataMessage = await getEncryptedResource({ - identifier: message.identifier, - name: message.name, - secretKey, - resource: message, - groupId: groupInfo?.groupId, - dataPublishes: dataPublishes.current, - }, isPrivate); + const responseDataMessage = await getEncryptedResource( + { + identifier: message.identifier, + name: message.name, + secretKey, + resource: message, + groupId: groupInfo?.groupId, + dataPublishes: dataPublishes.current, + }, + isPrivate + ); if (responseDataMessage?.error) { const fullObject = { @@ -194,14 +193,16 @@ export const Thread = ({ [message.identifier]: fullObject, }; }); - } catch (error) {} + } catch (error) { + console.log(error); + } }; const setTempData = async () => { try { let threadId = currentThread.threadId; - const keyTemp = "thread-post"; + const keyTemp = 'thread-post'; const getTempAnnouncements = await getTempPublish(); if (getTempAnnouncements?.[keyTemp]) { @@ -215,10 +216,12 @@ export const Thread = ({ }); setTempPublishedList(tempData); } - } catch (error) {} + } catch (error) { + console.log(error); + } }; - const getMailMessages = React.useCallback( + const getMailMessages = useCallback( async (groupInfo: any, before, after, isReverse, groupId) => { try { setTempPublishedList([]); @@ -232,10 +235,10 @@ export const Thread = ({ const identifier = `thmsg-${threadId}`; let url = `${getBaseApiReact()}${getArbitraryEndpointReact()}?mode=ALL&service=${threadIdentifier}&identifier=${identifier}&limit=20&includemetadata=false&prefix=true`; if (!isReverse) { - url = url + "&reverse=false"; + url = url + '&reverse=false'; } if (isReverse) { - url = url + "&reverse=true"; + url = url + '&reverse=true'; } if (after) { url = url + `&after=${after}`; @@ -245,11 +248,12 @@ export const Thread = ({ } const response = await fetch(url, { - method: "GET", + method: 'GET', headers: { - "Content-Type": "application/json", + 'Content-Type': 'application/json', }, }); + const responseData = await response.json(); let fullArrayMsg = [...responseData]; @@ -263,14 +267,13 @@ export const Thread = ({ setMessages(fullArrayMsg); if (before === null && after === null && isReverse) { setTimeout(() => { - containerRef.current.scrollIntoView({ behavior: "smooth" }); + containerRef.current.scrollIntoView({ behavior: 'smooth' }); }, 300); } - if(after || before === null && after === null && !isReverse){ + if (after || (before === null && after === null && !isReverse)) { setTimeout(() => { threadBeginningRef.current.scrollIntoView(); }, 100); - } if (fullArrayMsg.length === 0) { @@ -281,12 +284,14 @@ export const Thread = ({ const urlNewer = `${getBaseApiReact()}${getArbitraryEndpointReact()}?mode=ALL&service=${threadIdentifier}&identifier=${identifier}&limit=1&includemetadata=false&reverse=false&prefix=true&before=${ fullArrayMsg[0].created }`; + const responseNewer = await fetch(urlNewer, { - method: "GET", + method: 'GET', headers: { - "Content-Type": "application/json", + 'Content-Type': 'application/json', }, }); + const responseDataNewer = await responseNewer.json(); if (responseDataNewer.length > 0) { setHasFirstPage(true); @@ -299,12 +304,14 @@ export const Thread = ({ const urlOlder = `${getBaseApiReact()}${getArbitraryEndpointReact()}?mode=ALL&service=${threadIdentifier}&identifier=${identifier}&limit=1&includemetadata=false&reverse=false&prefix=true&after=${ fullArrayMsg[fullArrayMsg.length - 1].created }`; + const responseOlder = await fetch(urlOlder, { - method: "GET", + method: 'GET', headers: { - "Content-Type": "application/json", + 'Content-Type': 'application/json', }, }); + const responseDataOlder = await responseOlder.json(); if (responseDataOlder.length > 0) { setHasLastPage(true); @@ -316,7 +323,7 @@ export const Thread = ({ updateThreadActivityCurrentThread(); } } catch (error) { - console.log("error", error); + console.log('error', error); } finally { setIsLoading(false); getSavedData(groupId); @@ -324,10 +331,24 @@ export const Thread = ({ }, [messages, secretKey] ); - const getMessages = React.useCallback(async () => { - if (!currentThread || (!secretKey && isPrivate) || !groupInfo?.groupId || isPrivate === null) return; + + const getMessages = useCallback(async () => { + if ( + !currentThread || + (!secretKey && isPrivate) || + !groupInfo?.groupId || + isPrivate === null + ) + return; await getMailMessages(currentThread, null, null, false, groupInfo?.groupId); - }, [getMailMessages, currentThread, secretKey, groupInfo?.groupId, isPrivate]); + }, [ + getMailMessages, + currentThread, + secretKey, + groupInfo?.groupId, + isPrivate, + ]); + const firstMount = useRef(false); const saveTimestamp = useCallback((currentThread: any, username?: string) => { @@ -339,7 +360,7 @@ export const Thread = ({ return; const threadIdForLocalStorage = `qmail_threads_${currentThread?.threadData?.groupId}_${currentThread?.threadId}`; const threads = JSON.parse( - localStorage.getItem(`qmail_threads_viewedtimestamp_${username}`) || "{}" + localStorage.getItem(`qmail_threads_viewedtimestamp_${username}`) || '{}' ); // Convert to an array of objects with identifier and all fields let dataArray = Object.entries(threads).map(([identifier, value]) => ({ @@ -382,8 +403,8 @@ export const Thread = ({ if (currentThreadRef.current?.threadId !== currentThread?.threadId) { firstMount.current = false; } - if(!secretKey && isPrivate) return - if (currentThread && !firstMount.current && isPrivate !== null) { + if (!secretKey && isPrivate) return; + if (currentThread && !firstMount.current && isPrivate !== null) { getMessagesMiddleware(); } }, [currentThread, secretKey, isPrivate]); @@ -394,7 +415,7 @@ export const Thread = ({ const interval = useRef(null); - const checkNewMessages = React.useCallback( + const checkNewMessages = useCallback( async (groupInfo: any) => { try { let threadId = groupInfo.threadId; @@ -402,9 +423,9 @@ export const Thread = ({ const identifier = `thmsg-${threadId}`; const url = `${getBaseApiReact()}${getArbitraryEndpointReact()}?mode=ALL&service=${threadIdentifier}&identifier=${identifier}&limit=20&includemetadata=false&offset=${0}&reverse=true&prefix=true`; const response = await fetch(url, { - method: "GET", + method: 'GET', headers: { - "Content-Type": "application/json", + 'Content-Type': 'application/json', }, }); const responseData = await response.json(); @@ -419,6 +440,7 @@ export const Thread = ({ } const newArray = responseData.slice(0, findMessage).reverse(); let fullArrayMsg = [...messages]; + for (const message of newArray) { try { const responseDataMessage = await getEncryptedResource({ @@ -449,11 +471,13 @@ export const Thread = ({ } else { fullArrayMsg.unshift(fullObject); } - } catch (error) {} + } catch (error) { + console.log(error); + } } setMessages(fullArrayMsg); } catch (error) { - } finally { + console.log(error); } }, [messages] @@ -469,17 +493,17 @@ export const Thread = ({ const threadFetchModeFunc = (e) => { const mode = e.detail?.mode; - if (mode === "last-page") { + if (mode === 'last-page') { getMailMessages(currentThread, null, null, true, groupInfo?.groupId); } firstMount.current = true; }; - React.useEffect(() => { - subscribeToEvent("threadFetchMode", threadFetchModeFunc); + useEffect(() => { + subscribeToEvent('threadFetchMode', threadFetchModeFunc); return () => { - unsubscribeFromEvent("threadFetchMode", threadFetchModeFunc); + unsubscribeFromEvent('threadFetchMode', threadFetchModeFunc); }; }, []); @@ -526,11 +550,11 @@ export const Thread = ({ handleScroll(); }, 400); - container.addEventListener("scroll", handleScroll); + container.addEventListener('scroll', handleScroll); // Cleanup return () => { - container.removeEventListener("scroll", handleScroll); + container.removeEventListener('scroll', handleScroll); }; }, [messages]); @@ -540,9 +564,9 @@ export const Thread = ({ if (!container) return; if (isAtBottom) { - container.scrollTo({ top: 0, behavior: "smooth" }); // Scroll to top + container.scrollTo({ top: 0, behavior: 'smooth' }); // Scroll to top } else { - container.scrollTo({ top: container.scrollHeight, behavior: "smooth" }); // Scroll to bottom + container.scrollTo({ top: container.scrollHeight, behavior: 'smooth' }); // Scroll to bottom } }; @@ -550,20 +574,20 @@ export const Thread = ({ return ( { setMessages([]); closeThread(); }} > - - {!isMobile && Return to Threads} + + + {t('group:action.return_to_thread', { + postProcess: 'capitalizeFirstChar', + })} + + {/* Conditionally render the scroll buttons */} {showScrollButton && (isAtBottom ? ( @@ -618,9 +642,9 @@ export const Thread = ({ @@ -631,45 +655,39 @@ export const Thread = ({ -
+
- - - - {currentThread?.threadData?.title} - - - + + {currentThread?.threadData?.title} + + + + + + + + - + + + {combinedListTempAndReal.map((message, index, list) => { let fullMessage = message; if (hashMapMailMessages[message?.identifier]) { fullMessage = hashMapMailMessages[message.identifier]; - if (fullMessage?.error) { return ( + + {formatTimestampForum(message?.created)} + {fullMessage?.error} - ); @@ -855,23 +872,23 @@ export const Thread = ({ return ( + + {formatTimestampForum(message?.created)} + + - Downloading from QDN + {t('core:downloading_qdn', { + postProcess: 'capitalizeFirstChar', + })} - ); })} - + {!hasLastPage && !isLoading && ( <> )} - - 4 ? 'visible' : 'hidden' - }}> - - 4 ? 'visible' : 'hidden', + }} + > + + + - - - - - + {t('core:page.first', { postProcess: 'capitalizeFirstChar' })} + + + + + + + - -
+ + + + +
+ diff --git a/src/components/Group/Forum/texteditor.css b/src/components/Group/Forum/texteditor.css deleted file mode 100644 index e3bbd50..0000000 --- a/src/components/Group/Forum/texteditor.css +++ /dev/null @@ -1,71 +0,0 @@ -.ql-editor { - min-height: 200px; - width: 100%; - color: black; - font-size: 16px; - font-family: Roboto; - max-height: 225px; - overflow-y: scroll; - padding: 0px !important; - } - - .ql-editor::-webkit-scrollbar-track { - background-color: transparent; - cursor: default; - } - .ql-editor::-webkit-scrollbar-track:hover { - background-color: transparent; - } - - .ql-editor::-webkit-scrollbar { - width: 16px; - height: 10px; - background-color: rgba(229, 229, 229, 0.70); - } - - .ql-editor::-webkit-scrollbar-thumb { - background-color: #B0B0B0; - border-radius: 8px; - background-clip: content-box; - border: 4px solid transparent; - } - - - .ql-editor img { - cursor: default; - } - - .ql-editor-display { - min-height: 20px; - width: 100%; - color: black; - font-size: 16px; - font-family: Roboto; - padding: 0px !important; - } - - .ql-editor-display img { - cursor: default; - } - - .ql-container { - font-size: 16px - } - - .ql-toolbar .ql-stroke { - fill: none !important; - stroke: black !important; -} - -.ql-toolbar .ql-fill { - fill: black !important; - stroke: none !important; -} - -.ql-toolbar .ql-picker { - color: black !important; -} - -.ql-toolbar .ql-picker-options { - background-color: white !important; -} \ No newline at end of file diff --git a/src/components/Group/Group.tsx b/src/components/Group/Group.tsx index ed3d6f0..29c37fc 100644 --- a/src/components/Group/Group.tsx +++ b/src/components/Group/Group.tsx @@ -7,101 +7,97 @@ import { ListItemAvatar, ListItemText, Typography, -} from "@mui/material"; -import React, { - useCallback, - useContext, - useEffect, - useMemo, - useRef, - useState, -} from "react"; -import { ChatGroup } from "../Chat/ChatGroup"; -import { CreateCommonSecret } from "../Chat/CreateCommonSecret"; -import { base64ToUint8Array } from "../../qdn/encryption/group-encryption"; -import { uint8ArrayToObject } from "../../backgroundFunctions/encryption"; -import CampaignIcon from "@mui/icons-material/Campaign"; -import { AddGroup } from "./AddGroup"; -import AddCircleOutlineIcon from "@mui/icons-material/AddCircleOutline"; -import CreateIcon from "@mui/icons-material/Create"; - + useTheme, +} from '@mui/material'; +import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; +import { ChatGroup } from '../Chat/ChatGroup'; +import { CreateCommonSecret } from '../Chat/CreateCommonSecret'; +import { base64ToUint8Array } from '../../qdn/encryption/group-encryption'; +import { uint8ArrayToObject } from '../../encryption/encryption'; +import { AddGroup } from './AddGroup'; +import CreateIcon from '@mui/icons-material/Create'; +import PersonOffIcon from '@mui/icons-material/PersonOff'; import { AuthenticatedContainerInnerRight, CustomButton, -} from "../../App-styles"; -import { Spacer } from "../../common/Spacer"; -import { ManageMembers } from "./ManageMembers"; -import MarkChatUnreadIcon from "@mui/icons-material/MarkChatUnread"; +} from '../../styles/App-styles'; +import { Spacer } from '../../common/Spacer'; +import { ManageMembers } from './ManageMembers'; +import MarkChatUnreadIcon from '@mui/icons-material/MarkChatUnread'; import { - MyContext, clearAllQueues, getArbitraryEndpointReact, getBaseApiReact, - isMobile, pauseAllQueues, resumeAllQueues, -} from "../../App"; -import { ChatDirect } from "../Chat/ChatDirect"; -import { CustomizedSnackbars } from "../Snackbar/Snackbar"; -import { LoadingButton } from "@mui/lab"; -import { LoadingSnackbar } from "../Snackbar/LoadingSnackbar"; -import { GroupAnnouncements } from "../Chat/GroupAnnouncements"; - - - -import { GroupForum } from "../Chat/GroupForum"; +} from '../../App'; +import { ChatDirect } from '../Chat/ChatDirect'; +import { CustomizedSnackbars } from '../Snackbar/Snackbar'; +import { LoadingButton } from '@mui/lab'; +import { LoadingSnackbar } from '../Snackbar/LoadingSnackbar'; +import { GroupAnnouncements } from '../Chat/GroupAnnouncements'; +import { GroupForum } from '../Chat/GroupForum'; import { executeEvent, subscribeToEvent, unsubscribeFromEvent, -} from "../../utils/events"; -import { RequestQueueWithPromise } from "../../utils/queue/queue"; -import { WebSocketActive } from "./WebsocketActive"; -import { useMessageQueue } from "../../MessageQueueContext"; -import { isExtMsg, isUpdateMsg } from "../../background"; -import { ContextMenu } from "../ContextMenu"; - -import { ReturnIcon } from "../../assets/Icons/ReturnIcon"; -import { ExitIcon } from "../../assets/Icons/ExitIcon"; -import { HomeDesktop } from "./HomeDesktop"; -import { IconWrapper } from "../Desktop/DesktopFooter"; -import { DesktopHeader } from "../Desktop/DesktopHeader"; -import { AppsDesktop } from "../Apps/AppsDesktop"; -import { AppsDevMode } from "../Apps/AppsDevMode"; -import { DesktopSideBar } from "../DesktopSideBar"; -import { HubsIcon } from "../../assets/Icons/HubsIcon"; -import { MessagingIcon } from "../../assets/Icons/MessagingIcon"; -import { formatEmailDate } from "./QMailMessages"; -import { AdminSpace } from "../Chat/AdminSpace"; -import { useRecoilState, useSetRecoilState } from "recoil"; -import { addressInfoControllerAtom, groupsPropertiesAtom, selectedGroupIdAtom } from "../../atoms/global"; -import { sortArrayByTimestampAndGroupName } from "../../utils/time"; -import BlockIcon from '@mui/icons-material/Block'; -import LockIcon from '@mui/icons-material/Lock'; -import NoEncryptionGmailerrorredIcon from '@mui/icons-material/NoEncryptionGmailerrorred'; -import { BlockedUsersModal } from "./BlockedUsersModal"; -import { WalletsAppWrapper } from "./WalletsAppWrapper"; - +} from '../../utils/events'; +import { RequestQueueWithPromise } from '../../utils/queue/queue'; +import { WebSocketActive } from './WebsocketActive'; +import { useMessageQueue } from '../../messaging/MessageQueueContext'; +import { HomeDesktop } from './HomeDesktop'; +import { IconWrapper } from '../Desktop/DesktopFooter'; +import { DesktopHeader } from '../Desktop/DesktopHeader'; +import { AppsDesktop } from '../Apps/AppsDesktop'; +import { AppsDevMode } from '../Apps/AppsDevMode'; +import { DesktopSideBar } from '../Desktop/DesktopLeftSideBar'; +import { HubsIcon } from '../../assets/Icons/HubsIcon'; +import { MessagingIcon } from '../../assets/Icons/MessagingIcon'; +import { formatEmailDate } from './QMailMessages'; +import { AdminSpace } from '../Chat/AdminSpace'; +import { + addressInfoControllerAtom, + groupAnnouncementsAtom, + groupChatTimestampsAtom, + groupsOwnerNamesAtom, + groupsPropertiesAtom, + isOpenBlockedModalAtom, + isRunningPublicNodeAtom, + memberGroupsAtom, + mutedGroupsAtom, + myGroupsWhereIAmAdminAtom, + selectedGroupIdAtom, + timestampEnterDataAtom, +} from '../../atoms/global'; +import { sortArrayByTimestampAndGroupName } from '../../utils/time'; +import { BlockedUsersModal } from './BlockedUsersModal'; +import { WalletsAppWrapper } from './WalletsAppWrapper'; +import { useTranslation } from 'react-i18next'; +import { GroupList } from './GroupList'; +import { useAtom, useSetAtom } from 'jotai'; +import { requestQueueGroupJoinRequests } from './GroupJoinRequests'; export const getPublishesFromAdmins = async (admins: string[], groupId) => { - const queryString = admins.map((name) => `name=${name}`).join("&"); + const queryString = admins.map((name) => `name=${name}`).join('&'); const url = `${getBaseApiReact()}${getArbitraryEndpointReact()}?mode=ALL&service=DOCUMENT_PRIVATE&identifier=symmetric-qchat-group-${ groupId }&exactmatchnames=true&limit=0&reverse=true&${queryString}&prefix=true`; const response = await fetch(url); + if (!response.ok) { - throw new Error("network error"); + throw new Error('network error'); } const adminData = await response.json(); const filterId = adminData.filter( - (data: any) => - data.identifier === `symmetric-qchat-group-${groupId}` + (data: any) => data.identifier === `symmetric-qchat-group-${groupId}` ); + if (filterId?.length === 0) { return false; } + const sortedData = filterId.sort((a: any, b: any) => { // Get the most recent date for both a and b const dateA = a.updated ? new Date(a.updated) : new Date(a.created); @@ -111,31 +107,25 @@ export const getPublishesFromAdmins = async (admins: string[], groupId) => { return dateB.getTime() - dateA.getTime(); }); - return sortedData[0]; }; interface GroupProps { - myAddress: string; - isFocused: boolean; - userInfo: any; balance: number; + isFocused: boolean; + myAddress: string; + userInfo: any; } -const timeDifferenceForNotificationChats = 900000; - +export const timeDifferenceForNotificationChats = 900000; export const requestQueueMemberNames = new RequestQueueWithPromise(5); export const requestQueueAdminMemberNames = new RequestQueueWithPromise(5); -// const audio = new Audio(chrome.runtime?.getURL("msg-not1.wav")); - export const getGroupAdminsAddress = async (groupNumber: number) => { - // const validApi = await findUsableApi(); - const response = await fetch( `${getBaseApiReact()}/groups/members/${groupNumber}?limit=0&onlyAdmins=true` ); const groupData = await response.json(); - let members: any = []; + const members: any = []; if (groupData && Array.isArray(groupData?.members)) { for (const member of groupData.members) { if (member.member) { @@ -149,12 +139,12 @@ export const getGroupAdminsAddress = async (groupNumber: number) => { export function validateSecretKey(obj) { // Check if the input is an object - if (typeof obj !== "object" || obj === null) { + if (typeof obj !== 'object' || obj === null) { return false; } // Iterate over each key in the object - for (let key in obj) { + for (const key in obj) { // Ensure the key is a string representation of a positive integer if (!/^\d+$/.test(key)) { return false; @@ -164,19 +154,19 @@ export function validateSecretKey(obj) { const value = obj[key]; // Check that value is an object and not null - if (typeof value !== "object" || value === null) { + if (typeof value !== 'object' || value === null) { return false; } - // Check for messageKey - if (!value.hasOwnProperty("messageKey")) { + // Check for messageKey + if (!value.hasOwnProperty('messageKey')) { return false; } // Ensure messageKey and nonce are non-empty strings if ( - typeof value.messageKey !== "string" || - value.messageKey.trim() === "" + typeof value.messageKey !== 'string' || + value.messageKey.trim() === '' ) { return false; } @@ -196,45 +186,49 @@ export const getGroupMembers = async (groupNumber: number) => { return groupData; }; - export const decryptResource = async (data: string, fromQortalRequest) => { try { return new Promise((res, rej) => { - window.sendMessage("decryptGroupEncryption", { - data, - }) + window + .sendMessage('decryptGroupEncryption', { + data, + }) .then((response) => { if (!response?.error) { res(response); return; } - if(fromQortalRequest){ - rej({error: response.error, message: response?.error}); + if (fromQortalRequest) { + rej({ error: response.error, message: response?.error }); } else { rej(response.error); - } }) .catch((error) => { - if(fromQortalRequest){ - rej({message: error.message || "An error occurred", error: error.message || "An error occurred"}); + if (fromQortalRequest) { + rej({ + message: error.message || 'An error occurred', + error: error.message || 'An error occurred', + }); } else { - rej(error.message || "An error occurred",); + rej(error.message || 'An error occurred'); } }); - }); - } catch (error) {} + } catch (error) { + console.log(error); + } }; export const addDataPublishesFunc = async (data: string, groupId, type) => { try { return new Promise((res, rej) => { - window.sendMessage("addDataPublishes", { - data, - groupId, - type, - }) + window + .sendMessage('addDataPublishes', { + data, + groupId, + type, + }) .then((response) => { if (!response?.error) { res(response); @@ -243,20 +237,22 @@ export const addDataPublishesFunc = async (data: string, groupId, type) => { rej(response.error); }) .catch((error) => { - rej(error.message || "An error occurred"); + rej(error.message || 'An error occurred'); }); - }); - } catch (error) {} + } catch (error) { + console.log(error); + } }; export const getDataPublishesFunc = async (groupId, type) => { try { return new Promise((res, rej) => { - window.sendMessage("getDataPublishes", { - groupId, - type, - }) + window + .sendMessage('getDataPublishes', { + groupId, + type, + }) .then((response) => { if (!response?.error) { res(response); @@ -265,35 +261,33 @@ export const getDataPublishesFunc = async (groupId, type) => { rej(response.error); }) .catch((error) => { - rej(error.message || "An error occurred"); + rej(error.message || 'An error occurred'); }); - }); - } catch (error) {} + } catch (error) { + console.log(error); + } }; export async function getNameInfo(address: string) { - const response = await fetch(`${getBaseApiReact()}/names/address/` + address); + const response = await fetch(`${getBaseApiReact()}/names/primary/` + address); const nameData = await response.json(); - if (nameData?.length > 0) { - return nameData[0]?.name; + if (nameData?.name) { + return nameData?.name; } else { - return ""; + return ''; } } export const getGroupAdmins = async (groupNumber: number) => { - // const validApi = await findUsableApi(); - const response = await fetch( `${getBaseApiReact()}/groups/members/${groupNumber}?limit=0&onlyAdmins=true` ); const groupData = await response.json(); - let members: any = []; - let membersAddresses = []; - let both = []; - + const members: any = []; + const membersAddresses = []; + const both = []; const getMemNames = groupData?.members?.map(async (member) => { if (member?.member) { @@ -327,7 +321,7 @@ export const getNames = async (listOfMembers) => { if (name) { members.push({ ...member, name }); } else { - members.push({ ...member, name: "" }); + members.push({ ...member, name: '' }); } } @@ -338,8 +332,8 @@ export const getNames = async (listOfMembers) => { return members; }; -export const getNamesForAdmins = async (admins) => { +export const getNamesForAdmins = async (admins) => { let members: any = []; const getMemNames = admins?.map(async (admin) => { @@ -379,10 +373,9 @@ export const Group = ({ balance, setIsOpenDrawerProfile, setDesktopViewMode, - desktopViewMode + desktopViewMode, }: GroupProps) => { - const [desktopSideView, setDesktopSideView] = useState('groups') - + const [desktopSideView, setDesktopSideView] = useState('groups'); const [secretKey, setSecretKey] = useState(null); const [secretKeyPublishDate, setSecretKeyPublishDate] = useState(null); const lastFetchedSecretKey = useRef(null); @@ -405,30 +398,34 @@ export const Group = ({ const [openAddGroup, setOpenAddGroup] = useState(false); const [isInitialGroups, setIsInitialGroups] = useState(false); const [openManageMembers, setOpenManageMembers] = useState(false); - const { setMemberGroups, rootHeight, isRunningPublicNode } = useContext(MyContext); + const setMemberGroups = useSetAtom(memberGroupsAtom); const lastGroupNotification = useRef(null); - const [timestampEnterData, setTimestampEnterData] = useState({}); - const [chatMode, setChatMode] = useState("groups"); + const [timestampEnterData, setTimestampEnterData] = useAtom( + timestampEnterDataAtom + ); + const groupsPropertiesRef = useRef({}); + const [chatMode, setChatMode] = useState('groups'); const [newChat, setNewChat] = useState(false); - const [openSnack, setOpenSnack] = React.useState(false); - const [infoSnack, setInfoSnack] = React.useState(null); - const [isLoadingNotifyAdmin, setIsLoadingNotifyAdmin] = React.useState(false); - const [isLoadingGroups, setIsLoadingGroups] = React.useState(true); - const [isLoadingGroup, setIsLoadingGroup] = React.useState(false); + const [openSnack, setOpenSnack] = useState(false); + const [infoSnack, setInfoSnack] = useState(null); + const [isLoadingNotifyAdmin, setIsLoadingNotifyAdmin] = useState(false); + const [isLoadingGroups, setIsLoadingGroups] = useState(true); + const [isLoadingGroup, setIsLoadingGroup] = useState(false); const [firstSecretKeyInCreation, setFirstSecretKeyInCreation] = - React.useState(false); - const [groupSection, setGroupSection] = React.useState("home"); - const [groupAnnouncements, setGroupAnnouncements] = React.useState({}); - const [defaultThread, setDefaultThread] = React.useState(null); - const [isOpenDrawer, setIsOpenDrawer] = React.useState(false); - const [isOpenBlockedUserModal, setIsOpenBlockedUserModal] = React.useState(false); - - const [hideCommonKeyPopup, setHideCommonKeyPopup] = React.useState(false); - const [isLoadingGroupMessage, setIsLoadingGroupMessage] = React.useState(""); - const [drawerMode, setDrawerMode] = React.useState("groups"); - const [mutedGroups, setMutedGroups] = useState([]); - const [mobileViewMode, setMobileViewMode] = useState("home"); - const [mobileViewModeKeepOpen, setMobileViewModeKeepOpen] = useState(""); + useState(false); + const [groupSection, setGroupSection] = useState('home'); + const [groupAnnouncements, setGroupAnnouncements] = useAtom( + groupAnnouncementsAtom + ); + const [defaultThread, setDefaultThread] = useState(null); + const [isOpenDrawer, setIsOpenDrawer] = useState(false); + const setIsOpenBlockedUserModal = useSetAtom(isOpenBlockedModalAtom); + const [hideCommonKeyPopup, setHideCommonKeyPopup] = useState(false); + const [isLoadingGroupMessage, setIsLoadingGroupMessage] = useState(''); + const [drawerMode, setDrawerMode] = useState('groups'); + const setMutedGroups = useSetAtom(mutedGroupsAtom); + const [mobileViewMode, setMobileViewMode] = useState('home'); + const [mobileViewModeKeepOpen, setMobileViewModeKeepOpen] = useState(''); const isFocusedRef = useRef(true); const timestampEnterDataRef = useRef({}); const selectedGroupRef = useRef(null); @@ -440,68 +437,79 @@ export const Group = ({ const settimeoutForRefetchSecretKey = useRef(null); const { clearStatesMessageQueueProvider } = useMessageQueue(); const initiatedGetMembers = useRef(false); - const [groupChatTimestamps, setGroupChatTimestamps] = React.useState({}); - const [appsMode, setAppsMode] = useState('home') - const [appsModeDev, setAppsModeDev] = useState('home') - const [isOpenSideViewDirects, setIsOpenSideViewDirects] = useState(false) - const [isOpenSideViewGroups, setIsOpenSideViewGroups] = useState(false) - const [isForceShowCreationKeyPopup, setIsForceShowCreationKeyPopup] = useState(false) + const [groupChatTimestamps, setGroupChatTimestamps] = useAtom( + groupChatTimestampsAtom + ); + const [isRunningPublicNode] = useAtom(isRunningPublicNodeAtom); - const [groupsProperties, setGroupsProperties] = useRecoilState(groupsPropertiesAtom) - const setUserInfoForLevels = useSetRecoilState(addressInfoControllerAtom); + const [appsMode, setAppsMode] = useState('home'); + const [appsModeDev, setAppsModeDev] = useState('home'); + const [isOpenSideViewDirects, setIsOpenSideViewDirects] = useState(false); + const [isOpenSideViewGroups, setIsOpenSideViewGroups] = useState(false); + const [isForceShowCreationKeyPopup, setIsForceShowCreationKeyPopup] = + useState(false); + const groupsOwnerNamesRef = useRef({}); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); - const isPrivate = useMemo(()=> { - if(selectedGroup?.groupId === '0') return false - if(!selectedGroup?.groupId || !groupsProperties[selectedGroup?.groupId]) return null - if(groupsProperties[selectedGroup?.groupId]?.isOpen === true) return false - if(groupsProperties[selectedGroup?.groupId]?.isOpen === false) return true - return null - }, [selectedGroup]) + const [groupsProperties, setGroupsProperties] = useAtom(groupsPropertiesAtom); + const setGroupsOwnerNames = useSetAtom(groupsOwnerNamesAtom); - + const setUserInfoForLevels = useSetAtom(addressInfoControllerAtom); + const setMyGroupsWhereIAmAdmin = useSetAtom(myGroupsWhereIAmAdminAtom); + const isPrivate = useMemo(() => { + if (selectedGroup?.groupId === '0') return false; + if (!selectedGroup?.groupId || !groupsProperties[selectedGroup?.groupId]) + return null; + if (groupsProperties[selectedGroup?.groupId]?.isOpen === true) return false; + if (groupsProperties[selectedGroup?.groupId]?.isOpen === false) return true; + return null; + }, [selectedGroup]); + const setSelectedGroupId = useSetAtom(selectedGroupIdAtom); - const setSelectedGroupId = useSetRecoilState(selectedGroupIdAtom) - const toggleSideViewDirects = ()=> { - if(isOpenSideViewGroups){ - setIsOpenSideViewGroups(false) + const toggleSideViewDirects = () => { + if (isOpenSideViewGroups) { + setIsOpenSideViewGroups(false); } - setIsOpenSideViewDirects((prev)=> !prev) - } - const toggleSideViewGroups = ()=> { - if(isOpenSideViewDirects){ - setIsOpenSideViewDirects(false) + setIsOpenSideViewDirects((prev) => !prev); + }; + const toggleSideViewGroups = () => { + if (isOpenSideViewDirects) { + setIsOpenSideViewDirects(false); } - setIsOpenSideViewGroups((prev)=> !prev) - } - useEffect(()=> { - timestampEnterDataRef.current = timestampEnterData - }, [timestampEnterData]) + setIsOpenSideViewGroups((prev) => !prev); + }; + useEffect(() => { + timestampEnterDataRef.current = timestampEnterData; + }, [timestampEnterData]); useEffect(() => { isFocusedRef.current = isFocused; }, [isFocused]); useEffect(() => { groupSectionRef.current = groupSection; }, [groupSection]); - useEffect(() => { selectedGroupRef.current = selectedGroup; - setSelectedGroupId(selectedGroup?.groupId) + setSelectedGroupId(selectedGroup?.groupId); }, [selectedGroup]); - useEffect(() => { selectedDirectRef.current = selectedDirect; }, [selectedDirect]); - - - const getUserSettings = async () => { + const getUserSettings = useCallback(async () => { try { return new Promise((res, rej) => { - window.sendMessage("getUserSettings", { - key: "mutedGroups", - }) + window + .sendMessage('getUserSettings', { + key: 'mutedGroups', + }) .then((response) => { if (!response?.error) { setMutedGroups(response || []); @@ -511,90 +519,108 @@ export const Group = ({ rej(response.error); }) .catch((error) => { - rej(error.message || "An error occurred"); + rej( + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }) + ); }); - }); } catch (error) { - console.log("error", error); + console.error(error); } - }; + }, [setMutedGroups]); useEffect(() => { getUserSettings(); - }, []); + }, [getUserSettings]); - const getTimestampEnterChat = async () => { + const getTimestampEnterChat = useCallback(async () => { try { return new Promise((res, rej) => { - window.sendMessage("getTimestampEnterChat") - .then((response) => { - if (!response?.error) { - setTimestampEnterData(response); - res(response); - return; - } - rej(response.error); - }) - .catch((error) => { - rej(error.message || "An error occurred"); - }); - + window + .sendMessage('getTimestampEnterChat') + .then((response) => { + if (!response?.error) { + setTimestampEnterData(response); + res(response); + return; + } + rej(response.error); + }) + .catch((error) => { + rej( + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }) + ); + }); }); - } catch (error) {} - }; + } catch (error) { + console.log(error); + } + }, []); const refreshHomeDataFunc = () => { - setGroupSection("default"); + setGroupSection('default'); setTimeout(() => { - setGroupSection("home"); + setGroupSection('home'); }, 300); }; const getGroupAnnouncements = async () => { try { return new Promise((res, rej) => { - window.sendMessage("getGroupNotificationTimestamp") - .then((response) => { - if (!response?.error) { - setGroupAnnouncements(response); - res(response); - return; - } - rej(response.error); - }) - .catch((error) => { - rej(error.message || "An error occurred"); - }); - + window + .sendMessage('getGroupNotificationTimestamp') + .then((response) => { + if (!response?.error) { + setGroupAnnouncements(response); + res(response); + return; + } + rej(response.error); + }) + .catch((error) => { + rej( + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }) + ); + }); }); - } catch (error) {} + } catch (error) { + console.log(error); + } }; - useEffect(()=> { - if(myAddress){ - getGroupAnnouncements() - getTimestampEnterChat() + useEffect(() => { + if (myAddress) { + getGroupAnnouncements(); + getTimestampEnterChat(); } - }, [myAddress]) + }, [myAddress]); const getGroupOwner = async (groupId) => { + if (groupId == '0') return; // general group has id=0 try { const url = `${getBaseApiReact()}/groups/${groupId}`; const response = await fetch(url); - let data = await response.json(); + const data = await response.json(); const name = await getNameInfo(data?.owner); if (name) { data.name = name; } setGroupOwner(data); - } catch (error) {} + } catch (error) { + console.log(error); + } }; - - - const directChatHasUnread = useMemo(() => { let hasUnread = false; directs.forEach((direct) => { @@ -615,13 +641,12 @@ export const Group = ({ const groupChatHasUnread = useMemo(() => { let hasUnread = false; groups.forEach((group) => { - - if ( group?.data && group?.sender !== myAddress && - group?.timestamp && groupChatTimestamps[group?.groupId] && - ((!timestampEnterData[group?.groupId] && + group?.timestamp && + groupChatTimestamps[group?.groupId] && + ((!timestampEnterData[group?.groupId] && Date.now() - group?.timestamp < timeDifferenceForNotificationChats) || timestampEnterData[group?.groupId] < group?.timestamp) ) { @@ -644,284 +669,396 @@ export const Group = ({ return hasUnread; }, [groupAnnouncements, groups]); + const getSecretKey = useCallback( + async (loadingGroupParam?: boolean, secretKeyToPublish?: boolean) => { + try { + setIsLoadingGroupMessage( + t('auth:message.generic.locating_encryption_keys', { + postProcess: 'capitalizeFirstChar', + }) + ); + pauseAllQueues(); + let dataFromStorage; + let publishFromStorage; + let adminsFromStorage; - - const getSecretKey = async ( - loadingGroupParam?: boolean, - secretKeyToPublish?: boolean - ) => { - try { - setIsLoadingGroupMessage("Locating encryption keys"); - pauseAllQueues(); - let dataFromStorage; - let publishFromStorage; - let adminsFromStorage; - if ( - secretKeyToPublish && - secretKey && - lastFetchedSecretKey.current - && - Date.now() - lastFetchedSecretKey.current < 600000 - ) - return secretKey; - if (loadingGroupParam) { - setIsLoadingGroup(true); - } - if (selectedGroup?.groupId !== selectedGroupRef.current.groupId) { - if (settimeoutForRefetchSecretKey.current) { - clearTimeout(settimeoutForRefetchSecretKey.current); + if ( + secretKeyToPublish && + secretKey && + lastFetchedSecretKey.current && + Date.now() - lastFetchedSecretKey.current < 600000 + ) { + return secretKey; } - return; + + if (loadingGroupParam) { + setIsLoadingGroup(true); + } + + if (selectedGroup?.groupId !== selectedGroupRef.current.groupId) { + if (settimeoutForRefetchSecretKey.current) { + clearTimeout(settimeoutForRefetchSecretKey.current); + } + return; + } + + const prevGroupId = selectedGroupRef.current.groupId; + + const { names, addresses, both } = + adminsFromStorage || (await getGroupAdmins(selectedGroup?.groupId)); + setAdmins(addresses); + setAdminsWithNames(both); + + if (!names.length) throw new Error('Network error'); + + const publish = + publishFromStorage || + (await getPublishesFromAdmins(names, selectedGroup?.groupId)); + + if (prevGroupId !== selectedGroupRef.current.groupId) { + if (settimeoutForRefetchSecretKey.current) { + clearTimeout(settimeoutForRefetchSecretKey.current); + } + return; + } + + if (publish === false) { + setTriedToFetchSecretKey(true); + settimeoutForRefetchSecretKey.current = setTimeout(() => { + getSecretKey(); + }, 120000); + return false; + } + + setSecretKeyPublishDate(publish?.updated || publish?.created); + + let data; + if (dataFromStorage) { + data = dataFromStorage; + } else { + setIsLoadingGroupMessage( + t('auth:message.generic.downloading_encryption_keys', { + postProcess: 'capitalizeFirstChar', + }) + ); + const res = await fetch( + `${getBaseApiReact()}/arbitrary/DOCUMENT_PRIVATE/${publish.name}/${publish.identifier}?encoding=base64&rebuild=true` + ); + data = await res.text(); + } + + const decryptedKey: any = await decryptResource(data, null); + const dataint8Array = base64ToUint8Array(decryptedKey.data); + const decryptedKeyToObject = uint8ArrayToObject(dataint8Array); + + if (!validateSecretKey(decryptedKeyToObject)) { + throw new Error('SecretKey is not valid'); + } + + setSecretKeyDetails(publish); + setSecretKey(decryptedKeyToObject); + lastFetchedSecretKey.current = Date.now(); + setMemberCountFromSecretKeyData(decryptedKey.count); + + window + .sendMessage('setGroupData', { + groupId: selectedGroup?.groupId, + secretKeyData: data, + secretKeyResource: publish, + admins: { names, addresses, both }, + }) + .catch((error) => { + console.error( + 'Failed to set group data:', + error.message || 'An error occurred' + ); + }); + + if (decryptedKeyToObject) { + setTriedToFetchSecretKey(true); + setFirstSecretKeyInCreation(false); + return decryptedKeyToObject; + } else { + setTriedToFetchSecretKey(true); + } + } catch (error) { + if (error === 'Unable to decrypt data') { + setTriedToFetchSecretKey(true); + settimeoutForRefetchSecretKey.current = setTimeout(() => { + getSecretKey(); + }, 120000); + } + } finally { + setIsLoadingGroup(false); + setIsLoadingGroupMessage(''); + resumeAllQueues(); } - const prevGroupId = selectedGroupRef.current.groupId; - // const validApi = await findUsableApi(); - const { names, addresses, both } = - adminsFromStorage || (await getGroupAdmins(selectedGroup?.groupId)); + }, + [ + secretKey, + selectedGroup?.groupId, + setIsLoadingGroup, + setIsLoadingGroupMessage, + setSecretKey, + setSecretKeyDetails, + setTriedToFetchSecretKey, + setFirstSecretKeyInCreation, + setMemberCountFromSecretKeyData, + setAdmins, + setAdminsWithNames, + setSecretKeyPublishDate, + ] + ); + + const getAdminsForPublic = async (selectedGroup) => { + try { + const { names, addresses, both } = await getGroupAdmins( + selectedGroup?.groupId + ); setAdmins(addresses); setAdminsWithNames(both); - if (!names.length) { - throw new Error("Network error"); - } - const publish = - publishFromStorage || (await getPublishesFromAdmins(names, selectedGroup?.groupId)); - - if (prevGroupId !== selectedGroupRef.current.groupId) { - if (settimeoutForRefetchSecretKey.current) { - clearTimeout(settimeoutForRefetchSecretKey.current); - } - return; - } - if (publish === false) { - setTriedToFetchSecretKey(true); - settimeoutForRefetchSecretKey.current = setTimeout(() => { - getSecretKey(); - }, 120000); - return false; - } - setSecretKeyPublishDate(publish?.updated || publish?.created); - let data; - if (dataFromStorage) { - data = dataFromStorage; - } else { - setIsLoadingGroupMessage("Downloading encryption keys"); - const res = await fetch( - `${getBaseApiReact()}/arbitrary/DOCUMENT_PRIVATE/${publish.name}/${ - publish.identifier - }?encoding=base64` - ); - data = await res.text(); - } - const decryptedKey: any = await decryptResource(data); - const dataint8Array = base64ToUint8Array(decryptedKey.data); - const decryptedKeyToObject = uint8ArrayToObject(dataint8Array); - if (!validateSecretKey(decryptedKeyToObject)) - throw new Error("SecretKey is not valid"); - setSecretKeyDetails(publish); - setSecretKey(decryptedKeyToObject); - lastFetchedSecretKey.current = Date.now(); - setMemberCountFromSecretKeyData(decryptedKey.count); - window.sendMessage("setGroupData", { - groupId: selectedGroup?.groupId, - secretKeyData: data, - secretKeyResource: publish, - admins: { names, addresses, both }, - }).catch((error) => { - console.error("Failed to set group data:", error.message || "An error occurred"); - }); - - if (decryptedKeyToObject) { - setTriedToFetchSecretKey(true); - setFirstSecretKeyInCreation(false); - return decryptedKeyToObject; - } else { - setTriedToFetchSecretKey(true); - } } catch (error) { - if (error === "Unable to decrypt data") { - setTriedToFetchSecretKey(true); - settimeoutForRefetchSecretKey.current = setTimeout(() => { - getSecretKey(); - }, 120000); - } - } finally { - setIsLoadingGroup(false); - setIsLoadingGroupMessage(""); - resumeAllQueues(); + console.log(error); } }; - - const getAdminsForPublic = async(selectedGroup)=> { - try { - const { names, addresses, both } = - await getGroupAdmins(selectedGroup?.groupId) - setAdmins(addresses); - setAdminsWithNames(both); - } catch (error) { - //error - } - } - useEffect(() => { if (selectedGroup && isPrivate !== null) { - if(isPrivate){ + if (isPrivate) { setTriedToFetchSecretKey(false); getSecretKey(true); } - + getGroupOwner(selectedGroup?.groupId); } - if(isPrivate === false){ + if (isPrivate === false) { setTriedToFetchSecretKey(true); - if(selectedGroup?.groupId !== '0'){ - getAdminsForPublic(selectedGroup) + if (selectedGroup?.groupId !== '0') { + getAdminsForPublic(selectedGroup); } - - } }, [selectedGroup, isPrivate]); - - - - - const getCountNewMesg = async (groupId, after)=> { + const getCountNewMesg = async (groupId, after) => { try { const response = await fetch( `${getBaseApiReact()}/chat/messages?after=${after}&txGroupId=${groupId}&haschatreference=false&encoding=BASE64&limit=1` ); const data = await response.json(); - if(data && data[0]) return data[0].timestamp + if (data && data[0]) return data[0].timestamp; } catch (error) { - + console.log(error); } - } + }; - const getLatestRegularChat = async (groups)=> { + const getLatestRegularChat = async (groups) => { try { - - const groupData = {} + const groupData = {}; - const getGroupData = groups.map(async(group)=> { - if(!group.groupId || !group?.timestamp) return null - if((!groupData[group.groupId] || groupData[group.groupId] < group.timestamp)){ - const hasMoreRecentMsg = await getCountNewMesg(group.groupId, timestampEnterDataRef.current[group?.groupId] || Date.now() - 24 * 60 * 60 * 1000) - if(hasMoreRecentMsg){ - groupData[group.groupId] = hasMoreRecentMsg + const getGroupData = groups.map(async (group) => { + if (!group.groupId || !group?.timestamp) return null; + if ( + !groupData[group.groupId] || + groupData[group.groupId] < group.timestamp + ) { + const hasMoreRecentMsg = await getCountNewMesg( + group.groupId, + timestampEnterDataRef.current[group?.groupId] || + Date.now() - 24 * 60 * 60 * 1000 + ); + if (hasMoreRecentMsg) { + groupData[group.groupId] = hasMoreRecentMsg; } } else { - return null + return null; } - }) + }); - await Promise.all(getGroupData) - setGroupChatTimestamps(groupData) + await Promise.all(getGroupData); + setGroupChatTimestamps(groupData); } catch (error) { - + console.log(error); } - } + }; - const getGroupsProperties = useCallback(async(address)=> { + const getOwnerNameForGroup = async (owner: string, groupId: string) => { + if (groupId == '0') return; // general group has id=0 + try { + if (!owner) return; + if (groupsOwnerNamesRef.current[groupId]) return; + const name = await requestQueueMemberNames.enqueue(() => { + return getNameInfo(owner); + }); + if (name) { + groupsOwnerNamesRef.current[groupId] = name; + setGroupsOwnerNames((prev) => { + return { ...prev, [groupId]: name }; + }); + } + } catch (error) { + console.error(error); + } + }; + + useEffect(() => { + groupsPropertiesRef.current = groupsProperties; + }, [groupsProperties]); + + const getGroupsProperties = useCallback(async (address) => { try { const url = `${getBaseApiReact()}/groups/member/${address}`; const response = await fetch(url); - if(!response.ok) throw new Error('Cannot get group properties') - let data = await response.json(); - const transformToObject = data.reduce((result, item) => { - - result[item.groupId] = item - return result; - }, {}); - setGroupsProperties(transformToObject) + if (!response.ok) throw new Error('Cannot get group properties'); + const data = await response.json(); + const transformToObject = data.reduce((result, item) => { + result[item.groupId] = item; + return result; + }, {}); + setGroupsProperties(transformToObject); + Object.keys(transformToObject).forEach((key) => { + getOwnerNameForGroup(transformToObject[key]?.owner || '', key); + }); } catch (error) { - // error + console.log(error); } - }, []) + }, []); + const getGroupsWhereIAmAMember = useCallback(async (groups) => { + try { + let groupsAsAdmin = []; + const getAllGroupsAsAdmin = groups + .filter((item) => item.groupId !== '0') + .map(async (group) => { + const isAdminResponse = await requestQueueGroupJoinRequests.enqueue( + () => { + return fetch( + `${getBaseApiReact()}/groups/members/${group.groupId}?limit=0&onlyAdmins=true` + ); + } + ); + const isAdminData = await isAdminResponse.json(); - useEffect(()=> { - if(!myAddress) return - if(areKeysEqual(groups?.map((grp)=> grp?.groupId), Object.keys(groupsProperties))){ - } else { - getGroupsProperties(myAddress) + const findMyself = isAdminData?.members?.find( + (member) => member.member === myAddress + ); + + if (findMyself) { + groupsAsAdmin.push(group); + } + return true; + }); + + await Promise.all(getAllGroupsAsAdmin); + setMyGroupsWhereIAmAdmin(groupsAsAdmin); + } catch (error) { + console.error(); } - }, [groups, myAddress]) + }, []); - + useEffect(() => { + if (!myAddress) return; + if ( + !areKeysEqual( + groups?.map((grp) => grp?.groupId), + Object.keys(groupsPropertiesRef.current) + ) + ) { + getGroupsProperties(myAddress); + getGroupsWhereIAmAMember(groups); + } + }, [groups, myAddress]); useEffect(() => { // Handler function for incoming messages const messageHandler = (event) => { if (event.origin !== window.location.origin) { - return; + return; } const message = event.data; - if (message?.action === "SET_GROUPS") { - + if (message?.action === 'SET_GROUPS') { // Update the component state with the received 'sendqort' state setGroups(sortArrayByTimestampAndGroupName(message.payload)); getLatestRegularChat(message.payload); - setMemberGroups(message.payload?.filter((item)=> item?.groupId !== '0')); - - if (selectedGroupRef.current && groupSectionRef.current === "chat") { - window.sendMessage("addTimestampEnterChat", { - timestamp: Date.now(), - groupId: selectedGroupRef.current.groupId, - }).catch((error) => { - console.error("Failed to add timestamp:", error.message || "An error occurred"); - }); + setMemberGroups( + message.payload?.filter((item) => item?.groupId !== '0') + ); + + if (selectedGroupRef.current && groupSectionRef.current === 'chat') { + window + .sendMessage('addTimestampEnterChat', { + timestamp: Date.now(), + groupId: selectedGroupRef.current.groupId, + }) + .catch((error) => { + console.error( + 'Failed to add timestamp:', + error.message || 'An error occurred' + ); + }); } - + if (selectedDirectRef.current) { - window.sendMessage("addTimestampEnterChat", { - timestamp: Date.now(), - groupId: selectedDirectRef.current.address, - }).catch((error) => { - console.error("Failed to add timestamp:", error.message || "An error occurred"); - }); + window + .sendMessage('addTimestampEnterChat', { + timestamp: Date.now(), + groupId: selectedDirectRef.current.address, + }) + .catch((error) => { + console.error( + 'Failed to add timestamp:', + error.message || 'An error occurred' + ); + }); } - + setTimeout(() => { getTimestampEnterChat(); }, 600); } - - if (message?.action === "SET_GROUP_ANNOUNCEMENTS") { + + if (message?.action === 'SET_GROUP_ANNOUNCEMENTS') { // Update the component state with the received 'sendqort' state setGroupAnnouncements(message.payload); - - if (selectedGroupRef.current && groupSectionRef.current === "announcement") { - window.sendMessage("addGroupNotificationTimestamp", { - timestamp: Date.now(), - groupId: selectedGroupRef.current.groupId, - }).catch((error) => { - console.error("Failed to add group notification timestamp:", error.message || "An error occurred"); - }); - + + if ( + selectedGroupRef.current && + groupSectionRef.current === 'announcement' + ) { + window + .sendMessage('addGroupNotificationTimestamp', { + timestamp: Date.now(), + groupId: selectedGroupRef.current.groupId, + }) + .catch((error) => { + console.error( + 'Failed to add group notification timestamp:', + error.message || 'An error occurred' + ); + }); + setTimeout(() => { getGroupAnnouncements(); }, 200); } } - - if (message?.action === "SET_DIRECTS") { + + if (message?.action === 'SET_DIRECTS') { // Update the component state with the received 'sendqort' state setDirects(message.payload); - } else if (message?.action === "PLAY_NOTIFICATION_SOUND") { + } else if (message?.action === 'PLAY_NOTIFICATION_SOUND') { // audio.play(); } }; - + // Attach the event listener - window.addEventListener("message", messageHandler); - + window.addEventListener('message', messageHandler); + // Clean up the event listener on component unmount return () => { - window.removeEventListener("message", messageHandler); + window.removeEventListener('message', messageHandler); }; }, []); - useEffect(() => { if ( @@ -932,11 +1069,12 @@ export const Group = ({ ) return; - window.sendMessage("setupGroupWebsocket", {}) - .catch((error) => { - console.error("Failed to setup group websocket:", error.message || "An error occurred"); - }); - + window.sendMessage('setupGroupWebsocket', {}).catch((error) => { + console.error( + 'Failed to setup group websocket:', + error.message || 'An error occurred' + ); + }); hasInitializedWebsocket.current = true; }, [myAddress, groups]); @@ -946,14 +1084,18 @@ export const Group = ({ const res = await getGroupMembers(groupId); if (groupId !== selectedGroupRef.current?.groupId) return; setMembers(res); - } catch (error) {} + } catch (error) { + console.log(error); + } }; + useEffect(() => { if ( !initiatedGetMembers.current && selectedGroup?.groupId && secretKey && - admins.includes(myAddress) && selectedGroup?.groupId !== '0' + admins.includes(myAddress) && + selectedGroup?.groupId !== '0' ) { // getAdmins(selectedGroup?.groupId); getMembers(selectedGroup?.groupId); @@ -999,10 +1141,11 @@ export const Group = ({ try { setIsLoadingNotifyAdmin(true); await new Promise((res, rej) => { - window.sendMessage("notifyAdminRegenerateSecretKey", { - adminAddress: admin.address, - groupName: selectedGroup?.groupName, - }) + window + .sendMessage('notifyAdminRegenerateSecretKey', { + adminAddress: admin.address, + groupName: selectedGroup?.groupName, + }) .then((response) => { if (!response?.error) { res(response); @@ -1011,19 +1154,23 @@ export const Group = ({ rej(response.error); }) .catch((error) => { - rej(error.message || "An error occurred"); + rej( + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }) + ); }); - }); setInfoSnack({ - type: "success", - message: "Successfully sent notification.", + type: 'success', + message: 'Successfully sent notification.', }); setOpenSnack(true); } catch (error) { setInfoSnack({ - type: "error", - message: "Unable to send notification", + type: 'error', + message: 'Unable to send notification', }); } finally { setIsLoadingNotifyAdmin(false); @@ -1037,7 +1184,8 @@ export const Group = ({ if (!findGroup) return false; if (!findGroup?.data) return false; return ( - findGroup?.timestamp && groupChatTimestamps[findGroup?.groupId] && + findGroup?.timestamp && + groupChatTimestamps[findGroup?.groupId] && ((!timestampEnterData[selectedGroup?.groupId] && Date.now() - findGroup?.timestamp < timeDifferenceForNotificationChats) || @@ -1065,23 +1213,23 @@ export const Group = ({ return; } if (findDirect) { - if(!isMobile){ - setDesktopSideView("directs"); - setDesktopViewMode('home') - } else { - setMobileViewModeKeepOpen("messaging"); - } + setDesktopSideView('directs'); + setDesktopViewMode('home'); setSelectedDirect(null); setNewChat(false); - window.sendMessage("addTimestampEnterChat", { - timestamp: Date.now(), - groupId: findDirect.address, - }).catch((error) => { - console.error("Failed to add timestamp:", error.message || "An error occurred"); + window + .sendMessage('addTimestampEnterChat', { + timestamp: Date.now(), + groupId: findDirect.address, + }) + .catch((error) => { + console.error( + 'Failed to add timestamp:', + error.message || 'An error occurred' + ); }); - setTimeout(() => { setSelectedDirect(findDirect); @@ -1101,36 +1249,32 @@ export const Group = ({ ); if (findDirect) { - if(!isMobile){ - setDesktopSideView("directs"); - } else { - setMobileViewModeKeepOpen("messaging"); - } + setDesktopSideView('directs'); setSelectedDirect(null); setNewChat(false); - window.sendMessage("addTimestampEnterChat", { - timestamp: Date.now(), - groupId: findDirect.address, - }).catch((error) => { - console.error("Failed to add timestamp:", error.message || "An error occurred"); + window + .sendMessage('addTimestampEnterChat', { + timestamp: Date.now(), + groupId: findDirect.address, + }) + .catch((error) => { + console.error( + 'Failed to add timestamp:', + error.message || 'An error occurred' + ); }); - setTimeout(() => { setSelectedDirect(findDirect); getTimestampEnterChat(); }, 200); } else { - if(!isMobile){ - setDesktopSideView("directs"); - } else { - setMobileViewModeKeepOpen("messaging"); - } + setDesktopSideView('directs'); setNewChat(true); setTimeout(() => { - executeEvent("setDirectToValueNewChat", { + executeEvent('setDirectToValueNewChat', { directToValue: name || directAddress, }); }, 500); @@ -1138,41 +1282,50 @@ export const Group = ({ }; useEffect(() => { - subscribeToEvent("openDirectMessageInternal", openDirectChatFromInternal); + subscribeToEvent('openDirectMessageInternal', openDirectChatFromInternal); return () => { unsubscribeFromEvent( - "openDirectMessageInternal", + 'openDirectMessageInternal', openDirectChatFromInternal ); }; }, [directs, selectedDirect]); useEffect(() => { - subscribeToEvent("openDirectMessage", openDirectChatFromNotification); + subscribeToEvent('openDirectMessage', openDirectChatFromNotification); return () => { - unsubscribeFromEvent("openDirectMessage", openDirectChatFromNotification); + unsubscribeFromEvent('openDirectMessage', openDirectChatFromNotification); }; }, [directs, selectedDirect]); const handleMarkAsRead = (e) => { const { groupId } = e.detail; - window.sendMessage("addTimestampEnterChat", { - timestamp: Date.now(), - groupId, - }).catch((error) => { - console.error("Failed to add timestamp:", error.message || "An error occurred"); - }); - - - window.sendMessage("addGroupNotificationTimestamp", { + window + .sendMessage('addTimestampEnterChat', { timestamp: Date.now(), groupId, - }).catch((error) => { - console.error("Failed to add group notification timestamp:", error.message || "An error occurred"); - }); - + }) + .catch((error) => { + console.error( + 'Failed to add timestamp:', + error.message || 'An error occurred' + ); + }); + + window + .sendMessage('addGroupNotificationTimestamp', { + timestamp: Date.now(), + groupId, + }) + .catch((error) => { + console.error( + 'Failed to add group notification timestamp:', + error.message || 'An error occurred' + ); + }); + setTimeout(() => { getGroupAnnouncements(); getTimestampEnterChat(); @@ -1180,10 +1333,10 @@ export const Group = ({ }; useEffect(() => { - subscribeToEvent("markAsRead", handleMarkAsRead); + subscribeToEvent('markAsRead', handleMarkAsRead); return () => { - unsubscribeFromEvent("markAsRead", handleMarkAsRead); + unsubscribeFromEvent('markAsRead', handleMarkAsRead); }; }, []); @@ -1195,7 +1348,7 @@ export const Group = ({ setSecretKeyDetails(null); setNewEncryptionNotification(null); setMemberCountFromSecretKeyData(null); - setIsForceShowCreationKeyPopup(false) + setIsForceShowCreationKeyPopup(false); setSelectedGroup(null); setSelectedDirect(null); setGroups([]); @@ -1209,9 +1362,8 @@ export const Group = ({ setOpenAddGroup(false); setIsInitialGroups(false); setOpenManageMembers(false); - setMemberGroups([]); // Assuming you're clearing the context here as well setTimestampEnterData({}); - setChatMode("groups"); + setChatMode('groups'); setNewChat(false); setOpenSnack(false); setInfoSnack(null); @@ -1219,10 +1371,10 @@ export const Group = ({ setIsLoadingGroups(false); setIsLoadingGroup(false); setFirstSecretKeyInCreation(false); - setGroupSection("home"); + setGroupSection('home'); setGroupAnnouncements({}); setDefaultThread(null); - setMobileViewMode("home"); + setMobileViewMode('home'); // Reset all useRef values to their initial states hasInitialized.current = false; hasInitializedWebsocket.current = false; @@ -1236,9 +1388,7 @@ export const Group = ({ setupGroupWebsocketInterval.current = null; settimeoutForRefetchSecretKey.current = null; initiatedGetMembers.current = false; - if(!isMobile){ - setDesktopViewMode('home') - } + setDesktopViewMode('home'); }; const logoutEventFunc = () => { @@ -1247,57 +1397,25 @@ export const Group = ({ }; useEffect(() => { - subscribeToEvent("logout-event", logoutEventFunc); + subscribeToEvent('logout-event', logoutEventFunc); return () => { - unsubscribeFromEvent("logout-event", logoutEventFunc); + unsubscribeFromEvent('logout-event', logoutEventFunc); }; }, []); const openAppsMode = () => { - if (isMobile) { - setMobileViewMode("apps"); - } - if (!isMobile) { - setDesktopViewMode('apps') - - } - if(isMobile){ - setIsOpenSideViewDirects(false) - setIsOpenSideViewGroups(false) - setGroupSection("default"); - setSelectedGroup(null); - setNewChat(false); - setSelectedDirect(null); - setSecretKey(null); - setGroupOwner(null) - lastFetchedSecretKey.current = null; - initiatedGetMembers.current = false; - setSecretKeyPublishDate(null); - setAdmins([]); - setSecretKeyDetails(null); - setAdminsWithNames([]); - setMembers([]); - setMemberCountFromSecretKeyData(null); - setTriedToFetchSecretKey(false); - setFirstSecretKeyInCreation(false); - setIsOpenSideViewDirects(false) - setIsOpenSideViewGroups(false) - } - - + setDesktopViewMode('apps'); }; useEffect(() => { - subscribeToEvent("open-apps-mode", openAppsMode); + subscribeToEvent('open-apps-mode', openAppsMode); return () => { - unsubscribeFromEvent("open-apps-mode", openAppsMode); + unsubscribeFromEvent('open-apps-mode', openAppsMode); }; }, []); - - const openGroupChatFromNotification = (e) => { if (isLoadingOpenSectionFromNotification.current) return; @@ -1305,18 +1423,18 @@ export const Group = ({ const findGroup = groups?.find((group) => +group?.groupId === +groupId); if (findGroup?.groupId === selectedGroup?.groupId) { isLoadingOpenSectionFromNotification.current = false; - setChatMode("groups"); - setDesktopViewMode('chat') + setChatMode('groups'); + setDesktopViewMode('chat'); return; } if (findGroup) { - setChatMode("groups"); + setChatMode('groups'); setSelectedGroup(null); setSelectedDirect(null); setNewChat(false); setSecretKey(null); - setGroupOwner(null) + setGroupOwner(null); lastFetchedSecretKey.current = null; initiatedGetMembers.current = false; setSecretKeyPublishDate(null); @@ -1325,26 +1443,28 @@ export const Group = ({ setAdminsWithNames([]); setMembers([]); setMemberCountFromSecretKeyData(null); - setIsForceShowCreationKeyPopup(false) + setIsForceShowCreationKeyPopup(false); setTriedToFetchSecretKey(false); setFirstSecretKeyInCreation(false); - setGroupSection("chat"); - if(!isMobile){ - setDesktopViewMode('chat') - } + setGroupSection('chat'); + setDesktopViewMode('chat'); - window.sendMessage("addTimestampEnterChat", { - timestamp: Date.now(), - groupId: findGroup.groupId, - }).catch((error) => { - console.error("Failed to add timestamp:", error.message || "An error occurred"); + window + .sendMessage('addTimestampEnterChat', { + timestamp: Date.now(), + groupId: findGroup.groupId, + }) + .catch((error) => { + console.error( + 'Failed to add timestamp:', + error.message || 'An error occurred' + ); }); - setTimeout(() => { setSelectedGroup(findGroup); - setMobileViewMode("group"); - setDesktopSideView('groups') + setMobileViewMode('group'); + setDesktopSideView('groups'); getTimestampEnterChat(); isLoadingOpenSectionFromNotification.current = false; }, 350); @@ -1354,10 +1474,10 @@ export const Group = ({ }; useEffect(() => { - subscribeToEvent("openGroupMessage", openGroupChatFromNotification); + subscribeToEvent('openGroupMessage', openGroupChatFromNotification); return () => { - unsubscribeFromEvent("openGroupMessage", openGroupChatFromNotification); + unsubscribeFromEvent('openGroupMessage', openGroupChatFromNotification); }; }, [groups, selectedGroup]); @@ -1367,10 +1487,10 @@ export const Group = ({ const findGroup = groups?.find((group) => +group?.groupId === +groupId); if (findGroup?.groupId === selectedGroup?.groupId) return; if (findGroup) { - setChatMode("groups"); + setChatMode('groups'); setSelectedGroup(null); setSecretKey(null); - setGroupOwner(null) + setGroupOwner(null); lastFetchedSecretKey.current = null; initiatedGetMembers.current = false; setSecretKeyPublishDate(null); @@ -1379,24 +1499,27 @@ export const Group = ({ setAdminsWithNames([]); setMembers([]); setMemberCountFromSecretKeyData(null); - setIsForceShowCreationKeyPopup(false) + setIsForceShowCreationKeyPopup(false); setTriedToFetchSecretKey(false); setFirstSecretKeyInCreation(false); - setGroupSection("announcement"); - if(!isMobile){ - setDesktopViewMode('chat') - } - window.sendMessage("addGroupNotificationTimestamp", { - timestamp: Date.now(), - groupId: findGroup.groupId, - }).catch((error) => { - console.error("Failed to add group notification timestamp:", error.message || "An error occurred"); + setGroupSection('announcement'); + setDesktopViewMode('chat'); + window + .sendMessage('addGroupNotificationTimestamp', { + timestamp: Date.now(), + groupId: findGroup.groupId, + }) + .catch((error) => { + console.error( + 'Failed to add group notification timestamp:', + error.message || 'An error occurred' + ); }); - + setTimeout(() => { setSelectedGroup(findGroup); - setMobileViewMode("group"); - setDesktopSideView('groups') + setMobileViewMode('group'); + setDesktopSideView('groups'); getGroupAnnouncements(); }, 350); } @@ -1404,13 +1527,13 @@ export const Group = ({ useEffect(() => { subscribeToEvent( - "openGroupAnnouncement", + 'openGroupAnnouncement', openGroupAnnouncementFromNotification ); return () => { unsubscribeFromEvent( - "openGroupAnnouncement", + 'openGroupAnnouncement', openGroupAnnouncementFromNotification ); }; @@ -1421,16 +1544,16 @@ export const Group = ({ const { groupId } = data; const findGroup = groups?.find((group) => +group?.groupId === +groupId); if (findGroup?.groupId === selectedGroup?.groupId) { - setGroupSection("forum"); + setGroupSection('forum'); setDefaultThread(data); return; } if (findGroup) { - setChatMode("groups"); + setChatMode('groups'); setSelectedGroup(null); setSecretKey(null); - setGroupOwner(null) + setGroupOwner(null); lastFetchedSecretKey.current = null; initiatedGetMembers.current = false; setSecretKeyPublishDate(null); @@ -1439,54 +1562,45 @@ export const Group = ({ setAdminsWithNames([]); setMembers([]); setMemberCountFromSecretKeyData(null); - setIsForceShowCreationKeyPopup(false) + setIsForceShowCreationKeyPopup(false); setTriedToFetchSecretKey(false); setFirstSecretKeyInCreation(false); - setGroupSection("forum"); + setGroupSection('forum'); setDefaultThread(data); - if(!isMobile){ - setDesktopViewMode('chat') - } + setDesktopViewMode('chat'); setTimeout(() => { setSelectedGroup(findGroup); - setMobileViewMode("group"); - setDesktopSideView('groups') + setMobileViewMode('group'); + setDesktopSideView('groups'); getGroupAnnouncements(); }, 350); } }; useEffect(() => { - subscribeToEvent("openThreadNewPost", openThreadNewPostFunc); + subscribeToEvent('openThreadNewPost', openThreadNewPostFunc); return () => { - unsubscribeFromEvent("openThreadNewPost", openThreadNewPostFunc); + unsubscribeFromEvent('openThreadNewPost', openThreadNewPostFunc); }; }, [groups, selectedGroup]); - const handleSecretKeyCreationInProgress = () => { + const handleSecretKeyCreationInProgress = useCallback(() => { setFirstSecretKeyInCreation(true); - }; + }, []); const goToHome = async () => { - if (isMobile) { - setMobileViewMode("home"); - } - if (!isMobile) { - } - setDesktopViewMode('home') - + setDesktopViewMode('home'); await new Promise((res) => { setTimeout(() => { res(null); }, 200); }); - }; const goToAnnouncements = async () => { - setGroupSection("default"); + setGroupSection('default'); await new Promise((res) => { setTimeout(() => { res(null); @@ -1494,14 +1608,19 @@ export const Group = ({ }); setSelectedDirect(null); setNewChat(false); - setGroupSection("announcement"); - window.sendMessage("addGroupNotificationTimestamp", { - timestamp: Date.now(), - groupId: selectedGroupRef.current.groupId, - }).catch((error) => { - console.error("Failed to add group notification timestamp:", error.message || "An error occurred"); + setGroupSection('announcement'); + window + .sendMessage('addGroupNotificationTimestamp', { + timestamp: Date.now(), + groupId: selectedGroupRef.current.groupId, + }) + .catch((error) => { + console.error( + 'Failed to add group notification timestamp:', + error.message || 'An error occurred' + ); }); - + setTimeout(() => { getGroupAnnouncements(); }, 200); @@ -1509,33 +1628,37 @@ export const Group = ({ const openDrawerGroups = () => { setIsOpenDrawer(true); - setDrawerMode("groups"); + setDrawerMode('groups'); }; const goToThreads = () => { setSelectedDirect(null); setNewChat(false); - setGroupSection("forum"); + setGroupSection('forum'); }; const goToChat = async () => { - setGroupSection("default"); + setGroupSection('default'); await new Promise((res) => { setTimeout(() => { res(null); }, 200); }); - setGroupSection("chat"); + setGroupSection('chat'); setNewChat(false); setSelectedDirect(null); if (selectedGroupRef.current) { - window.sendMessage("addTimestampEnterChat", { - timestamp: Date.now(), - groupId: selectedGroupRef.current.groupId, - }).catch((error) => { - console.error("Failed to add timestamp:", error.message || "An error occurred"); + window + .sendMessage('addTimestampEnterChat', { + timestamp: Date.now(), + groupId: selectedGroupRef.current.groupId, + }) + .catch((error) => { + console.error( + 'Failed to add timestamp:', + error.message || 'An error occurred' + ); }); - setTimeout(() => { getTimestampEnterChat(); @@ -1543,96 +1666,111 @@ export const Group = ({ } }; - + const theme = useTheme(); const renderDirects = () => { return ( -
- {!isMobile && ( - - { - setDesktopSideView("groups"); - }} - > - - - - - { - setDesktopSideView("directs"); - }} - > - + { + setDesktopSideView('groups'); + }} + > + - - - - - )} - -
+ + + + + { + setDesktopSideView('directs'); + }} + > + + + + + + + {directs.map((direct: any) => ( { - console.error("Failed to add timestamp:", error.message || "An error occurred"); + window + .sendMessage('addTimestampEnterChat', { + timestamp: Date.now(), + groupId: direct.address, + }) + .catch((error) => { + console.error( + 'Failed to add timestamp:', + error.message || 'An error occurred' + ); }); - + setTimeout(() => { setSelectedDirect(direct); @@ -1656,61 +1799,75 @@ export const Group = ({ }, 200); }} sx={{ - display: "flex", - width: "100%", - flexDirection: "column", - cursor: "pointer", - border: "1px #232428 solid", - padding: "2px", - borderRadius: "2px", background: - direct?.address === selectedDirect?.address && "white", + direct?.address === selectedDirect?.address && + theme.palette.background.surface, + borderRadius: '2px', + cursor: 'pointer', + display: 'flex', + flexDirection: 'column', + padding: '2px', + width: '100%', }} > {(direct?.name || direct?.address)?.charAt(0)} + + {direct?.sender !== myAddress && direct?.timestamp && ((!timestampEnterData[direct?.address] && @@ -1720,7 +1877,7 @@ export const Group = ({ direct?.timestamp) && ( )} @@ -1728,13 +1885,15 @@ export const Group = ({ ))} -
-
+ + - New Chat + {t('core:action.new.chat', { + postProcess: 'capitalizeFirstChar', + })} -
-
- ); - }; - - const renderGroups = () => { - return ( -
- {!isMobile && ( - - { - setDesktopSideView("groups"); - }} - > - - - - - { - setDesktopSideView("directs"); - }} - > - - - - - - )} - -
- {groups.map((group: any) => ( - { + setIsOpenBlockedUserModal(true); + }} sx={{ - width: "100%", - }} - className="group-list" - dense={true} - > - { - setMobileViewMode("group"); - setDesktopSideView('groups') - initiatedGetMembers.current = false; - clearAllQueues(); - setSelectedDirect(null); - setTriedToFetchSecretKey(false); - setNewChat(false); - setSelectedGroup(null); - setUserInfoForLevels({}) - setSecretKey(null); - lastFetchedSecretKey.current = null; - setSecretKeyPublishDate(null); - setAdmins([]); - setSecretKeyDetails(null); - setAdminsWithNames([]); - setGroupOwner(null) - setMembers([]); - setMemberCountFromSecretKeyData(null); - setHideCommonKeyPopup(false); - setFirstSecretKeyInCreation(false); - setGroupSection("chat"); - setIsOpenDrawer(false); - setIsForceShowCreationKeyPopup(false) - setTimeout(() => { - setSelectedGroup(group); - - }, 200); - }} - sx={{ - display: "flex", - width: "100%", - flexDirection: "column", - cursor: "pointer", - border: "1px #232428 solid", - padding: "2px", - borderRadius: "2px", - background: - group?.groupId === selectedGroup?.groupId && "white", - }} - > - - - - {groupsProperties[group?.groupId]?.isOpen === false ? ( - - - - ): ( - - - - // - // {group.groupName?.charAt(0)} - // - )} - - - - {groupAnnouncements[group?.groupId] && - !groupAnnouncements[group?.groupId]?.seentimestamp && ( - - )} - {group?.data && - groupChatTimestamps[group?.groupId] && - group?.sender !== myAddress && - group?.timestamp && - ((!timestampEnterData[group?.groupId] && - Date.now() - group?.timestamp < - timeDifferenceForNotificationChats) || - timestampEnterData[group?.groupId] < - group?.timestamp) && ( - - )} - - - - - ))} -
-
- {chatMode === "groups" && ( - <> - { - setOpenAddGroup(true); + minWidth: 'unset', + padding: '10px', }} > - - Group Mgmt - - {!isRunningPublicNode && ( - { - setIsOpenBlockedUserModal(true); - }} - sx={{ - minWidth: 'unset', - padding: '10px' - }} - > - - - )} - - - )} - {chatMode === "directs" && ( - { - setNewChat(true); - setSelectedDirect(null); - setIsOpenDrawer(false); - }} - > - - New Chat )} -
-
+ + ); }; - + + const selectGroupFunc = useCallback((group) => { + setMobileViewMode('group'); + setDesktopSideView('groups'); + initiatedGetMembers.current = false; + clearAllQueues(); + setSelectedDirect(null); + setTriedToFetchSecretKey(false); + setNewChat(false); + setSelectedGroup(null); + setUserInfoForLevels({}); + setSecretKey(null); + lastFetchedSecretKey.current = null; + setSecretKeyPublishDate(null); + setAdmins([]); + setSecretKeyDetails(null); + setAdminsWithNames([]); + setGroupOwner(null); + setMembers([]); + setMemberCountFromSecretKeyData(null); + setHideCommonKeyPopup(false); + setFirstSecretKeyInCreation(false); + setGroupSection('chat'); + setIsOpenDrawer(false); + setIsForceShowCreationKeyPopup(false); + setTimeout(() => { + setSelectedGroup(group); + }, 200); + }, []); + return ( <> + - - - -
- {!isMobile && ((desktopViewMode !== 'apps' && desktopViewMode !== 'dev') || isOpenSideViewGroups) && ( - + {((desktopViewMode !== 'apps' && desktopViewMode !== 'dev') || + isOpenSideViewGroups) && ( + )} - {!isMobile && desktopViewMode === 'chat' && desktopSideView !== 'directs' && renderGroups()} - {!isMobile && desktopViewMode === 'chat' && desktopSideView === 'directs' && renderDirects()} + {desktopViewMode === 'chat' && desktopSideView !== 'directs' && ( + + )} + + {desktopViewMode === 'chat' && + desktopSideView === 'directs' && + renderDirects()} - {newChat && ( <> - {isMobile && ( - - - - { - close() - }} - > - - - - - - { - setSelectedDirect(null) - setMobileViewModeKeepOpen('') - }} - > - - - - - - )} { setSelectedDirect(null); - setNewChat(false); }} setMobileViewModeKeepOpen={setMobileViewModeKeepOpen} @@ -2207,295 +2076,318 @@ export const Group = ({ )} {desktopViewMode === 'chat' && !selectedGroup && ( - - No group selected - - - )} - -
- {!isMobile && ( - - - - )} - - - - - {triedToFetchSecretKey && ( - + + )} + +
+ + + + {triedToFetchSecretKey && ( + + )} + {isPrivate && + firstSecretKeyInCreation && + triedToFetchSecretKey && + !secretKeyPublishDate && ( +
+ + {t('group:message.generic.encryption_key', { + postProcess: 'capitalizeFirstChar', + })} + +
+ )} + + {isPrivate && + !admins.includes(myAddress) && + !secretKey && + triedToFetchSecretKey ? ( + <> + {secretKeyPublishDate || + (!secretKeyPublishDate && !firstSecretKeyInCreation) ? ( +
+ + {t('group:message.generic.not_part_group', { + postProcess: 'capitalizeFirstChar', + })} + + + + + + + {t('group:message.generic.only_encrypted', { + postProcess: 'capitalizeFirstChar', + })} + + + + + + + {t('group:message.generic.notify_admins', { + postProcess: 'capitalizeFirstChar', + })} + + + + + {adminsWithNames.map((admin) => { + return ( + + {admin?.name} + notifyAdmin(admin)} + > + {t('core:action.notify', { + postProcess: 'capitalizeFirstChar', + })} + + + ); + })} +
+ ) : null} + + ) : admins.includes(myAddress) && + !secretKey && + isPrivate && + triedToFetchSecretKey ? null : !triedToFetchSecretKey ? null : ( + <> + + + {groupSection === 'adminSpace' && ( + + )} + + )} + + + {((isPrivate && + admins.includes(myAddress) && + shouldReEncrypt && + triedToFetchSecretKey && + !firstSecretKeyInCreation && + !hideCommonKeyPopup) || + isForceShowCreationKeyPopup) && ( + )} - {isPrivate && firstSecretKeyInCreation && - triedToFetchSecretKey && - !secretKeyPublishDate && ( -
- {" "} - - The group's first common encryption key is in the - process of creation. Please wait a few minutes for it to - be retrieved by the network. Checking every 2 minutes... - -
- )} - {isPrivate && !admins.includes(myAddress) && - !secretKey && - triedToFetchSecretKey ? ( - <> - {secretKeyPublishDate || - (!secretKeyPublishDate && !firstSecretKeyInCreation) ? ( -
- {" "} - - You are not part of the encrypted group of members. - Wait until an admin re-encrypts the keys. - - - - Only unencrypted messages will be displayed. - - - - Try notifying an admin from the list of admins below: - - - {adminsWithNames.map((admin) => { - return ( - - {admin?.name} - notifyAdmin(admin)} - > - Notify - - - ); - })} -
- ) : null} - - ) : admins.includes(myAddress) && - (!secretKey && isPrivate) && - triedToFetchSecretKey ? null : !triedToFetchSecretKey ? null : ( - <> - - - {groupSection === "adminSpace" && ( - - )} - - - )} - - - {((isPrivate && admins.includes(myAddress) && - shouldReEncrypt && - triedToFetchSecretKey && - !firstSecretKeyInCreation && - !hideCommonKeyPopup) || isForceShowCreationKeyPopup) && ( - - )} -
- {openManageMembers && ( - - )} -
- {isOpenBlockedUserModal && ( - { - setIsOpenBlockedUserModal(false) - }} /> - )} + + + {openManageMembers && ( + + )} +
+ {selectedDirect && !newChat && ( <> )} - - {!isMobile && ( - - )} - {!isMobile && ( - - )} - - - {!isMobile && ( - - - - )} + - + + + - + - - + > + -
+ ); }; - - diff --git a/src/components/Group/GroupInvites.tsx b/src/components/Group/GroupInvites.tsx index 13e5850..902bd73 100644 --- a/src/components/Group/GroupInvites.tsx +++ b/src/components/Group/GroupInvites.tsx @@ -1,30 +1,31 @@ -import * as React from "react"; -import List from "@mui/material/List"; -import ListItem from "@mui/material/ListItem"; -import ListItemButton from "@mui/material/ListItemButton"; -import ListItemIcon from "@mui/material/ListItemIcon"; -import ListItemText from "@mui/material/ListItemText"; -import Checkbox from "@mui/material/Checkbox"; -import IconButton from "@mui/material/IconButton"; -import CommentIcon from "@mui/icons-material/Comment"; -import InfoIcon from "@mui/icons-material/Info"; -import GroupAddIcon from "@mui/icons-material/GroupAdd"; -import { executeEvent } from "../../utils/events"; -import { Box, ButtonBase, Collapse, Typography } from "@mui/material"; -import { Spacer } from "../../common/Spacer"; -import { getGroupNames } from "./UserListOfInvites"; -import { CustomLoader } from "../../common/CustomLoader"; -import { getBaseApiReact, isMobile } from "../../App"; -import ExpandMoreIcon from "@mui/icons-material/ExpandMore"; -import ExpandLessIcon from "@mui/icons-material/ExpandLess"; +import { useEffect, useState } from 'react'; +import List from '@mui/material/List'; +import ListItem from '@mui/material/ListItem'; +import ListItemButton from '@mui/material/ListItemButton'; +import ListItemText from '@mui/material/ListItemText'; +import IconButton from '@mui/material/IconButton'; +import GroupAddIcon from '@mui/icons-material/GroupAdd'; +import { executeEvent } from '../../utils/events'; +import { Box, ButtonBase, Collapse, Typography, useTheme } from '@mui/material'; +import { getGroupNames } from './UserListOfInvites'; +import { CustomLoader } from '../../common/CustomLoader'; +import { getBaseApiReact } from '../../App'; +import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; +import ExpandLessIcon from '@mui/icons-material/ExpandLess'; +import { useTranslation } from 'react-i18next'; export const GroupInvites = ({ myAddress, setOpenAddGroup }) => { - const [groupsWithJoinRequests, setGroupsWithJoinRequests] = React.useState( - [] - ); - const [isExpanded, setIsExpanded] = React.useState(false); - - const [loading, setLoading] = React.useState(true); + const [groupsWithJoinRequests, setGroupsWithJoinRequests] = useState([]); + const [isExpanded, setIsExpanded] = useState(false); + const [loading, setLoading] = useState(true); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + const theme = useTheme(); const getJoinRequests = async () => { try { @@ -37,12 +38,13 @@ export const GroupInvites = ({ myAddress, setOpenAddGroup }) => { setGroupsWithJoinRequests(resMoreData); } catch (error) { + console.log(error); } finally { setLoading(false); } }; - React.useEffect(() => { + useEffect(() => { if (myAddress) { getJoinRequests(); } @@ -51,90 +53,103 @@ export const GroupInvites = ({ myAddress, setOpenAddGroup }) => { return ( setIsExpanded((prev)=> !prev)} + onClick={() => setIsExpanded((prev) => !prev)} > - Group Invites {groupsWithJoinRequests?.length > 0 && ` (${groupsWithJoinRequests?.length})`} + {t('group:group.invites', { postProcess: 'capitalizeFirstChar' })}{' '} + {groupsWithJoinRequests?.length > 0 && + ` (${groupsWithJoinRequests?.length})`} - {isExpanded ? : ( - - )} + + {isExpanded ? ( + + ) : ( + + )} + {loading && groupsWithJoinRequests.length === 0 && ( )} + {!loading && groupsWithJoinRequests.length === 0 && ( - Nothing to display + {t('group:message.generic.no_display', { + postProcess: 'capitalizeFirstChar', + })} )} + @@ -142,22 +157,31 @@ export const GroupInvites = ({ myAddress, setOpenAddGroup }) => { return ( { setOpenAddGroup(true); setTimeout(() => { - executeEvent("openGroupInvitesRequest", {}); + executeEvent('openGroupInvitesRequest', {}); }, 300); }} disablePadding secondaryAction={ - + @@ -166,12 +190,15 @@ export const GroupInvites = ({ myAddress, setOpenAddGroup }) => { diff --git a/src/components/Group/GroupJoinRequests.tsx b/src/components/Group/GroupJoinRequests.tsx index 76f958a..f113dbf 100644 --- a/src/components/Group/GroupJoinRequests.tsx +++ b/src/components/Group/GroupJoinRequests.tsx @@ -1,244 +1,280 @@ -import * as React from "react"; -import List from "@mui/material/List"; -import ListItem from "@mui/material/ListItem"; -import ListItemButton from "@mui/material/ListItemButton"; -import ListItemIcon from "@mui/material/ListItemIcon"; -import ListItemText from "@mui/material/ListItemText"; -import Checkbox from "@mui/material/Checkbox"; -import IconButton from "@mui/material/IconButton"; -import CommentIcon from "@mui/icons-material/Comment"; -import InfoIcon from "@mui/icons-material/Info"; -import { RequestQueueWithPromise } from "../../utils/queue/queue"; +import { useEffect, useMemo, useState } from 'react'; +import List from '@mui/material/List'; +import ListItem from '@mui/material/ListItem'; +import ListItemButton from '@mui/material/ListItemButton'; +import ListItemText from '@mui/material/ListItemText'; +import IconButton from '@mui/material/IconButton'; +import { RequestQueueWithPromise } from '../../utils/queue/queue'; import GroupAddIcon from '@mui/icons-material/GroupAdd'; -import { executeEvent } from "../../utils/events"; -import { Box, ButtonBase, Collapse, Typography } from "@mui/material"; -import { Spacer } from "../../common/Spacer"; -import { CustomLoader } from "../../common/CustomLoader"; -import { getBaseApi } from "../../background"; -import { MyContext, getBaseApiReact, isMobile } from "../../App"; -import { myGroupsWhereIAmAdminAtom } from "../../atoms/global"; -import { useSetRecoilState } from "recoil"; +import { executeEvent } from '../../utils/events'; +import { Box, ButtonBase, Collapse, Typography, useTheme } from '@mui/material'; +import { CustomLoader } from '../../common/CustomLoader'; +import { getBaseApiReact } from '../../App'; +import { myGroupsWhereIAmAdminAtom, txListAtom } from '../../atoms/global'; import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; import ExpandLessIcon from '@mui/icons-material/ExpandLess'; -export const requestQueueGroupJoinRequests = new RequestQueueWithPromise(2) +import { useTranslation } from 'react-i18next'; +import { useAtom, useSetAtom } from 'jotai'; +export const requestQueueGroupJoinRequests = new RequestQueueWithPromise(2); -export const GroupJoinRequests = ({ myAddress, groups, setOpenManageMembers, getTimestampEnterChat, setSelectedGroup, setGroupSection, setMobileViewMode, setDesktopViewMode }) => { - const [isExpanded, setIsExpanded] = React.useState(false) - - const [groupsWithJoinRequests, setGroupsWithJoinRequests] = React.useState([]) - const [loading, setLoading] = React.useState(true) - const {txList, setTxList} = React.useContext(MyContext) - const setMyGroupsWhereIAmAdmin = useSetRecoilState( - myGroupsWhereIAmAdminAtom - ); +export const GroupJoinRequests = ({ + myAddress, + groups, + setOpenManageMembers, + getTimestampEnterChat, + setSelectedGroup, + setGroupSection, + setMobileViewMode, + setDesktopViewMode, +}) => { + const [isExpanded, setIsExpanded] = useState(false); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + const [groupsWithJoinRequests, setGroupsWithJoinRequests] = useState([]); + const [loading, setLoading] = useState(true); + const [txList] = useAtom(txListAtom); + const [myGroupsWhereIAmAdmin] = useAtom(myGroupsWhereIAmAdminAtom); - const getJoinRequests = async ()=> { + const theme = useTheme(); + const getJoinRequests = async () => { try { - setLoading(true) - - let groupsAsAdmin = [] - const getAllGroupsAsAdmin = groups.filter((item)=> item.groupId !== '0').map(async (group)=> { - - const isAdminResponse = await requestQueueGroupJoinRequests.enqueue(()=> { - return fetch( - `${getBaseApiReact()}/groups/members/${group.groupId}?limit=0&onlyAdmins=true` - ); - }) - const isAdminData = await isAdminResponse.json() - + setLoading(true); + const res = await Promise.all( + myGroupsWhereIAmAdmin.map(async (group) => { + const joinRequestResponse = + await requestQueueGroupJoinRequests.enqueue(() => { + return fetch( + `${getBaseApiReact()}/groups/joinrequests/${group.groupId}` + ); + }); - const findMyself = isAdminData?.members?.find((member)=> member.member === myAddress) - - if(findMyself){ - groupsAsAdmin.push(group) - } - return true - }) - - - await Promise.all(getAllGroupsAsAdmin) - setMyGroupsWhereIAmAdmin(groupsAsAdmin) - const res = await Promise.all(groupsAsAdmin.map(async (group)=> { - - const joinRequestResponse = await requestQueueGroupJoinRequests.enqueue(()=> { - return fetch( - `${getBaseApiReact()}/groups/joinrequests/${group.groupId}` - ); - }) - - const joinRequestData = await joinRequestResponse.json() - return { - group, - data: joinRequestData - } - })) - setGroupsWithJoinRequests(res) + const joinRequestData = await joinRequestResponse.json(); + return { + group, + data: joinRequestData, + }; + }) + ); + setGroupsWithJoinRequests(res); } catch (error) { - + console.log(error); } finally { - setLoading(false) + setLoading(false); } - } + }; - React.useEffect(() => { - if (myAddress && groups.length > 0) { - getJoinRequests() + useEffect(() => { + if (myAddress && myGroupsWhereIAmAdmin.length > 0) { + getJoinRequests(); } else { - setLoading(false) + setLoading(false); } - }, [myAddress, groups]); + }, [myAddress, myGroupsWhereIAmAdmin]); - const filteredJoinRequests = React.useMemo(()=> { - return groupsWithJoinRequests.map((group)=> { - const filteredGroupRequests = group?.data?.filter((gd)=> { - const findJoinRequsetInTxList = txList?.find((tx)=> tx?.groupId === group?.group?.groupId && tx?.qortalAddress === gd?.joiner && tx?.type === 'join-request-accept') + const filteredJoinRequests = useMemo(() => { + return groupsWithJoinRequests.map((group) => { + const filteredGroupRequests = group?.data?.filter((gd) => { + const findJoinRequsetInTxList = txList?.find( + (tx) => + tx?.groupId === group?.group?.groupId && + tx?.qortalAddress === gd?.joiner && + tx?.type === 'join-request-accept' + ); - if(findJoinRequsetInTxList) return false - return true - }) + if (findJoinRequsetInTxList) return false; + return true; + }); return { ...group, - data: filteredGroupRequests - } - }) - }, [groupsWithJoinRequests, txList]) - - + data: filteredGroupRequests, + }; + }); + }, [groupsWithJoinRequests, txList]); return ( - + setIsExpanded((prev)=> !prev)} + onClick={() => setIsExpanded((prev) => !prev)} > - Join Requests {filteredJoinRequests?.filter((group)=> group?.data?.length > 0)?.length > 0 && ` (${filteredJoinRequests?.filter((group)=> group?.data?.length > 0)?.length})`} + {t('group:join_requests', { postProcess: 'capitalizeFirstChar' })}{' '} + {filteredJoinRequests?.filter((group) => group?.data?.length > 0) + ?.length > 0 && + ` (${filteredJoinRequests?.filter((group) => group?.data?.length > 0)?.length})`} - {isExpanded ? : ( - - )} + + {isExpanded ? ( + + ) : ( + + )} - - - {loading && filteredJoinRequests.length === 0 && ( - - - - )} - {!loading && (filteredJoinRequests.length === 0 || filteredJoinRequests?.filter((group)=> group?.data?.length > 0).length === 0) && ( - - - Nothing to display - - - )} - - {filteredJoinRequests?.map((group)=> { - if(group?.data?.length === 0) return null - return ( - { - setSelectedGroup(group?.group) - setMobileViewMode('group') - getTimestampEnterChat() - setGroupSection("announcement") - setOpenManageMembers(true) - if(!isMobile){ - setDesktopViewMode('chat') - } - setTimeout(() => { - executeEvent("openGroupJoinRequest", {}); - - }, 300); - }} + + - - - } > - - - - - - ) + {loading && filteredJoinRequests.length === 0 && ( + + + + )} - })} - - - - - - + {!loading && + (filteredJoinRequests.length === 0 || + filteredJoinRequests?.filter((group) => group?.data?.length > 0) + .length === 0) && ( + + + {t('group:message.generic.no_display', { + postProcess: 'capitalizeFirstChar', + })} + + + )} + + + {filteredJoinRequests?.map((group) => { + if (group?.data?.length === 0) return null; + return ( + { + setSelectedGroup(group?.group); + setMobileViewMode('group'); + getTimestampEnterChat(); + setGroupSection('announcement'); + setOpenManageMembers(true); + setDesktopViewMode('chat'); + setTimeout(() => { + executeEvent('openGroupJoinRequest', {}); + }, 300); + }} + sx={{ + marginBottom: '20px', + }} + disablePadding + secondaryAction={ + + + + } + > + + + + + ); + })} + + + ); }; diff --git a/src/components/Group/GroupList.tsx b/src/components/Group/GroupList.tsx new file mode 100644 index 0000000..4f461fd --- /dev/null +++ b/src/components/Group/GroupList.tsx @@ -0,0 +1,371 @@ +import { + Avatar, + Box, + ButtonBase, + List, + ListItem, + ListItemAvatar, + ListItemText, + useTheme, +} from '@mui/material'; +import React, { useCallback } from 'react'; +import { IconWrapper } from '../Desktop/DesktopFooter'; +import { HubsIcon } from '../../assets/Icons/HubsIcon'; +import { MessagingIcon } from '../../assets/Icons/MessagingIcon'; +import { ContextMenu } from '../ContextMenu'; +import { getBaseApiReact } from '../../App'; +import { formatEmailDate } from './QMailMessages'; +import CampaignIcon from '@mui/icons-material/Campaign'; +import MarkChatUnreadIcon from '@mui/icons-material/MarkChatUnread'; +import LockIcon from '@mui/icons-material/Lock'; +import { CustomButton } from '../../styles/App-styles'; +import AddCircleOutlineIcon from '@mui/icons-material/AddCircleOutline'; +import PersonOffIcon from '@mui/icons-material/PersonOff'; +import { + groupAnnouncementSelector, + groupChatTimestampSelector, + groupPropertySelector, + groupsOwnerNamesSelector, + isRunningPublicNodeAtom, + timestampEnterDataSelector, +} from '../../atoms/global'; +import { timeDifferenceForNotificationChats } from './Group'; +import { useAtom, useAtomValue } from 'jotai'; +import { useTranslation } from 'react-i18next'; + +export const GroupList = ({ + selectGroupFunc, + setDesktopSideView, + groupChatHasUnread, + groupsAnnHasUnread, + desktopSideView, + directChatHasUnread, + chatMode, + groups, + selectedGroup, + getUserSettings, + setOpenAddGroup, + setIsOpenBlockedUserModal, + myAddress, +}) => { + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + const [isRunningPublicNode] = useAtom(isRunningPublicNodeAtom); + + return ( + + + { + setDesktopSideView('groups'); + }} + > + + + + + + { + setDesktopSideView('directs'); + }} + > + + + + + + + + + {groups.map((group: any) => ( + + ))} + + + + + <> + { + setOpenAddGroup(true); + }} + > + + {t('group:group.group', { postProcess: 'capitalizeFirstChar' })} + + + {!isRunningPublicNode && ( + { + setIsOpenBlockedUserModal(true); + }} + sx={{ + minWidth: 'unset', + padding: '10px', + }} + > + + + )} + + + + ); +}; + +const GroupItem = React.memo( + ({ selectGroupFunc, group, selectedGroup, getUserSettings, myAddress }) => { + const theme = useTheme(); + const ownerName = useAtomValue(groupsOwnerNamesSelector(group?.groupId)); + const announcement = useAtomValue( + groupAnnouncementSelector(group?.groupId) + ); + const groupProperty = useAtomValue(groupPropertySelector(group?.groupId)); + const groupChatTimestamp = useAtomValue( + groupChatTimestampSelector(group?.groupId) + ); + const timestampEnterData = useAtomValue( + timestampEnterDataSelector(group?.groupId) + ); + + const selectGroupHandler = useCallback(() => { + selectGroupFunc(group); + }, [group, selectGroupFunc]); + + return ( + + + + + {ownerName ? ( + + {group?.groupName?.charAt(0).toUpperCase()} + + ) : ( + + {' '} + {group?.groupName?.charAt(0).toUpperCase() || 'G'} + + )} + + + + + {announcement && !announcement?.seentimestamp && ( + + )} + + + {group?.data && + groupChatTimestamp && + group?.sender !== myAddress && + group?.timestamp && + ((!timestampEnterData && + Date.now() - group?.timestamp < + timeDifferenceForNotificationChats) || + timestampEnterData < group?.timestamp) && ( + + )} + + {groupProperty?.isOpen === false && ( + + )} + + + + + ); + } +); diff --git a/src/components/Group/GroupMenu.tsx b/src/components/Group/GroupMenu.tsx deleted file mode 100644 index a44c480..0000000 --- a/src/components/Group/GroupMenu.tsx +++ /dev/null @@ -1,202 +0,0 @@ -import React, { useState } from "react"; -import { - Button, - Menu, - MenuItem, - ListItemIcon, - ListItemText, - Badge, - Box, -} from "@mui/material"; -import ForumIcon from "@mui/icons-material/Forum"; -import GroupIcon from "@mui/icons-material/Group"; -import { ArrowDownIcon } from "../../assets/Icons/ArrowDownIcon"; -import { NotificationIcon2 } from "../../assets/Icons/NotificationIcon2"; -import { ChatIcon } from "../../assets/Icons/ChatIcon"; -import { ThreadsIcon } from "../../assets/Icons/ThreadsIcon"; -import { MembersIcon } from "../../assets/Icons/MembersIcon"; - -export const GroupMenu = ({ setGroupSection, groupSection, setOpenManageMembers, goToAnnouncements, goToChat, hasUnreadChat, hasUnreadAnnouncements }) => { - const [anchorEl, setAnchorEl] = useState(null); - const open = Boolean(anchorEl); - - const handleClick = (event) => { - setAnchorEl(event.currentTarget); - }; - - const handleClose = () => { - setAnchorEl(null); - }; - - return ( - - - - { - goToChat() - handleClose(); - }} - > - - - - - - { - goToAnnouncements() - handleClose(); - }} - > - - - - - - { - setGroupSection("forum"); - handleClose(); - }} - > - - - - - - - { - setOpenManageMembers(true) - handleClose(); - }} - > - - - - - - - - - ); -}; diff --git a/src/components/Group/Home.tsx b/src/components/Group/Home.tsx deleted file mode 100644 index a8c804c..0000000 --- a/src/components/Group/Home.tsx +++ /dev/null @@ -1,112 +0,0 @@ -import { Box, Button, Typography } from "@mui/material"; -import React from "react"; -import { Spacer } from "../../common/Spacer"; -import { ListOfThreadPostsWatched } from "./ListOfThreadPostsWatched"; -import { ThingsToDoInitial } from "./ThingsToDoInitial"; -import { GroupJoinRequests } from "./GroupJoinRequests"; -import { GroupInvites } from "./GroupInvites"; -import RefreshIcon from "@mui/icons-material/Refresh"; - -export const Home = ({ - refreshHomeDataFunc, - myAddress, - isLoadingGroups, - balance, - userInfo, - groups, - setGroupSection, - setSelectedGroup, - getTimestampEnterChat, - setOpenManageMembers, - setOpenAddGroup, - setMobileViewMode, - setDesktopViewMode -}) => { - return ( - - - 15 ? "16px" : "20px", - padding: '10px' - }} - > - Welcome - {userInfo?.name ? ( - {`, ${userInfo?.name}`} - ) : null} - - - - {/* - - */} - {!isLoadingGroups && ( - - - - - - - - )} - - - ); -}; diff --git a/src/components/Group/HomeDesktop.tsx b/src/components/Group/HomeDesktop.tsx index d83f774..bcfff93 100644 --- a/src/components/Group/HomeDesktop.tsx +++ b/src/components/Group/HomeDesktop.tsx @@ -1,16 +1,16 @@ -import { Box, Button, Divider, Typography } from "@mui/material"; -import React from "react"; -import { Spacer } from "../../common/Spacer"; -import { ListOfThreadPostsWatched } from "./ListOfThreadPostsWatched"; -import { ThingsToDoInitial } from "./ThingsToDoInitial"; -import { GroupJoinRequests } from "./GroupJoinRequests"; -import { GroupInvites } from "./GroupInvites"; -import RefreshIcon from "@mui/icons-material/Refresh"; -import { ListOfGroupPromotions } from "./ListOfGroupPromotions"; -import { QortPrice } from "../Home/QortPrice"; -import ExploreIcon from "@mui/icons-material/Explore"; -import { Explore } from "../Explore/Explore"; -import { NewUsersCTA } from "../Home/NewUsersCTA"; +import { Box, Divider, Typography, useTheme } from '@mui/material'; +import { useEffect, useMemo, useState } from 'react'; +import { Spacer } from '../../common/Spacer'; +import { ThingsToDoInitial } from './ThingsToDoInitial'; +import { GroupJoinRequests } from './GroupJoinRequests'; +import { GroupInvites } from './GroupInvites'; +import { ListOfGroupPromotions } from './ListOfGroupPromotions'; +import { QortPrice } from '../QortPrice'; +import ExploreIcon from '@mui/icons-material/Explore'; +import { Explore } from '../Explore/Explore'; +import { NewUsersCTA } from '../NewUsersCTA'; +import { useTranslation } from 'react-i18next'; + export const HomeDesktop = ({ refreshHomeDataFunc, myAddress, @@ -28,95 +28,105 @@ export const HomeDesktop = ({ setDesktopViewMode, desktopViewMode, }) => { - const [checked1, setChecked1] = React.useState(false); - const [checked2, setChecked2] = React.useState(false); - React.useEffect(() => { - if (balance && +balance >= 6) { - setChecked1(true); - } - }, [balance]); - - - React.useEffect(() => { - if (name) setChecked2(true); - }, [name]); - - - const isLoaded = React.useMemo(()=> { - if(userInfo !== null) return true - return false - }, [ userInfo]) - - const hasDoneNameAndBalanceAndIsLoaded = React.useMemo(()=> { - if(isLoaded && checked1 && checked2) return true - return false - }, [checked1, isLoaded, checked2]) + const [checked1, setChecked1] = useState(false); + const [checked2, setChecked2] = useState(false); + + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + const theme = useTheme(); + + useEffect(() => { + if (balance && +balance >= 6) { + setChecked1(true); + } + }, [balance]); + + useEffect(() => { + if (name) setChecked2(true); + }, [name]); + + const isLoaded = useMemo(() => { + if (userInfo !== null) return true; + return false; + }, [userInfo]); + + const hasDoneNameAndBalanceAndIsLoaded = useMemo(() => { + if (isLoaded && checked1 && checked2) return true; + return false; + }, [checked1, isLoaded, checked2]); - return ( + 15 ? "16px" : "20px", - padding: "10px", + fontSize: userInfo?.name?.length > 15 ? '16px' : '20px', + padding: '10px', }} > - Welcome + {t('core:welcome', { postProcess: 'capitalizeFirstChar' })} {userInfo?.name ? ( {`, ${userInfo?.name}`} ) : null} + + {!isLoadingGroups && ( item?.groupId !== "0").length !== 0 + groups?.filter((item) => item?.groupId !== '0').length !== 0 } /> - - {desktopViewMode === "home" && ( + + {desktopViewMode === 'home' && ( <> - {/* - - */} - {hasDoneNameAndBalanceAndIsLoaded && ( - <> - - - - - - - - )} - + {hasDoneNameAndBalanceAndIsLoaded && ( + <> + + + + + + + + + )} )} )} - + {!isLoadingGroups && ( <> - - - {" "} - - Explore - {" "} - - - {!hasDoneNameAndBalanceAndIsLoaded && ( - - )} - - {hasDoneNameAndBalanceAndIsLoaded && ( - - - )} - - - - - - - - )} - - - - {/* - - */} + {t('tutorial:initial.explore', { + postProcess: 'capitalizeFirstChar', + })} + + + + + {!hasDoneNameAndBalanceAndIsLoaded && } + + {hasDoneNameAndBalanceAndIsLoaded && } + + + + + + + )} + diff --git a/src/components/Group/InviteMember.tsx b/src/components/Group/InviteMember.tsx index 147c9bb..e4dd93d 100644 --- a/src/components/Group/InviteMember.tsx +++ b/src/components/Group/InviteMember.tsx @@ -1,50 +1,61 @@ -import { LoadingButton } from "@mui/lab"; -import { - Box, - Button, - Input, - MenuItem, - Select, - SelectChangeEvent, -} from "@mui/material"; -import React, { useState } from "react"; -import { Spacer } from "../../common/Spacer"; -import { Label } from "./AddGroup"; -import { getFee } from "../../background"; +import { LoadingButton } from '@mui/lab'; +import { Box, Input, MenuItem, Select, SelectChangeEvent } from '@mui/material'; +import { useState } from 'react'; +import { Spacer } from '../../common/Spacer'; +import { Label } from './AddGroup'; +import { getFee } from '../../background/background.ts'; +import { useTranslation } from 'react-i18next'; export const InviteMember = ({ groupId, setInfoSnack, setOpenSnack, show }) => { - const [value, setValue] = useState(""); + const [value, setValue] = useState(''); const [expiryTime, setExpiryTime] = useState('259200'); - const [isLoadingInvite, setIsLoadingInvite] = useState(false) + const [isLoadingInvite, setIsLoadingInvite] = useState(false); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + const inviteMember = async () => { try { - const fee = await getFee('GROUP_INVITE') + const fee = await getFee('GROUP_INVITE'); + await show({ - message: "Would you like to perform a GROUP_INVITE transaction?" , - publishFee: fee.fee + ' QORT' - }) - setIsLoadingInvite(true) + message: t('core:message.question.perform_transaction', { + action: 'GROUP_INVITE', + postProcess: 'capitalizeFirstChar', + }), + publishFee: fee.fee + ' QORT', + }); + + setIsLoadingInvite(true); + if (!expiryTime || !value) return; new Promise((res, rej) => { - window.sendMessage("inviteToGroup", { - groupId, - qortalAddress: value, - inviteTime: +expiryTime, - }) + window + .sendMessage('inviteToGroup', { + groupId, + qortalAddress: value, + inviteTime: +expiryTime, + }) .then((response) => { if (!response?.error) { setInfoSnack({ - type: "success", - message: `Successfully invited ${value}. It may take a couple of minutes for the changes to propagate`, + type: 'success', + message: t('group:message.success.group_invite', { + invitee: value, + postProcess: 'capitalizeFirstChar', + }), }); setOpenSnack(true); res(response); - - setValue(""); + setValue(''); return; } setInfoSnack({ - type: "error", + type: 'error', message: response?.error, }); setOpenSnack(true); @@ -52,16 +63,21 @@ export const InviteMember = ({ groupId, setInfoSnack, setOpenSnack, show }) => { }) .catch((error) => { setInfoSnack({ - type: "error", - message: error?.message || "An error occurred", + type: 'error', + message: + error?.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }), }); setOpenSnack(true); rej(error); }); - }); - } catch (error) {} finally { - setIsLoadingInvite(false) + } catch (error) { + console.log(error); + } finally { + setIsLoadingInvite(false); } }; @@ -72,40 +88,59 @@ export const InviteMember = ({ groupId, setInfoSnack, setOpenSnack, show }) => { return ( - Invite member + {t('group:action.invite_member', { postProcess: 'capitalizeFirstChar' })} + + setValue(e.target.value)} /> - - + + + + + - Invite + + + {t('core:action.invite', { postProcess: 'capitalizeFirstChar' })} + ); }; diff --git a/src/components/Group/ListOfBans.tsx b/src/components/Group/ListOfBans.tsx index db4c6ba..aa70d00 100644 --- a/src/components/Group/ListOfBans.tsx +++ b/src/components/Group/ListOfBans.tsx @@ -1,16 +1,32 @@ -import React, { useEffect, useRef, useState } from 'react'; -import { Avatar, Box, Button, ListItem, ListItemAvatar, ListItemButton, ListItemText, Popover } from '@mui/material'; -import { AutoSizer, CellMeasurer, CellMeasurerCache, List } from 'react-virtualized'; +import { useEffect, useRef, useState } from 'react'; +import { + Avatar, + Box, + ListItem, + ListItemAvatar, + ListItemButton, + ListItemText, + Popover, +} from '@mui/material'; +import { + AutoSizer, + CellMeasurer, + CellMeasurerCache, + List, +} from 'react-virtualized'; import { getNameInfo } from './Group'; -import { getBaseApi, getFee } from '../../background'; +import { getFee } from '../../background/background.ts'; import { LoadingButton } from '@mui/lab'; import { getBaseApiReact } from '../../App'; +import { useTranslation } from 'react-i18next'; export const getMemberInvites = async (groupNumber) => { - const response = await fetch(`${getBaseApiReact()}/groups/bans/${groupNumber}?limit=0`); + const response = await fetch( + `${getBaseApiReact()}/groups/bans/${groupNumber}?limit=0` + ); const groupData = await response.json(); return groupData; -} +}; const getNames = async (listOfMembers, includeNoNames) => { let members = []; @@ -20,14 +36,14 @@ const getNames = async (listOfMembers, includeNoNames) => { const name = await getNameInfo(member.offender); if (name) { members.push({ ...member, name }); - } else if(includeNoNames){ - members.push({ ...member, name: name || "" }); + } else if (includeNoNames) { + members.push({ ...member, name: name || '' }); } } } } return members; -} +}; const cache = new CellMeasurerCache({ fixedWidth: true, @@ -38,8 +54,15 @@ export const ListOfBans = ({ groupId, setInfoSnack, setOpenSnack, show }) => { const [bans, setBans] = useState([]); const [popoverAnchor, setPopoverAnchor] = useState(null); // Track which list item the popover is anchored to const [openPopoverIndex, setOpenPopoverIndex] = useState(null); // Track which list item has the popover open - const listRef = useRef(); + const listRef = useRef(null); const [isLoadingUnban, setIsLoadingUnban] = useState(false); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); const getInvites = async (groupId) => { try { @@ -49,7 +72,7 @@ export const ListOfBans = ({ groupId, setInfoSnack, setOpenSnack, show }) => { } catch (error) { console.error(error); } - } + }; useEffect(() => { if (groupId) { @@ -67,33 +90,41 @@ export const ListOfBans = ({ groupId, setInfoSnack, setOpenSnack, show }) => { setOpenPopoverIndex(null); }; - const handleCancelBan = async (address)=> { + const handleCancelBan = async (address) => { try { - const fee = await getFee('CANCEL_GROUP_BAN') + const fee = await getFee('CANCEL_GROUP_BAN'); + await show({ - message: "Would you like to perform a CANCEL_GROUP_BAN transaction?" , - publishFee: fee.fee + ' QORT' - }) - setIsLoadingUnban(true) - new Promise((res, rej)=> { - window.sendMessage("cancelBan", { - groupId, - qortalAddress: address, - }) + message: t('core:message.question.perform_transaction', { + action: 'CANCEL_GROUP_BAN', + postProcess: 'capitalizeFirstChar', + }), + publishFee: fee.fee + ' QORT', + }); + + setIsLoadingUnban(true); + new Promise((res, rej) => { + window + .sendMessage('cancelBan', { + groupId, + qortalAddress: address, + }) .then((response) => { if (!response?.error) { res(response); setIsLoadingUnban(false); setInfoSnack({ - type: "success", - message: "Successfully unbanned user. It may take a couple of minutes for the changes to propagate", + type: 'success', + message: t('group:message.success.unbanned_user', { + postProcess: 'capitalizeFirstChar', + }), }); handlePopoverClose(); setOpenSnack(true); return; } setInfoSnack({ - type: "error", + type: 'error', message: response?.error, }); setOpenSnack(true); @@ -101,24 +132,27 @@ export const ListOfBans = ({ groupId, setInfoSnack, setOpenSnack, show }) => { }) .catch((error) => { setInfoSnack({ - type: "error", - message: error.message || "An error occurred", + type: 'error', + message: + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }), }); setOpenSnack(true); rej(error); }); - - }) + }); } catch (error) { - + console.log(error); } finally { - setIsLoadingUnban(false) + setIsLoadingUnban(false); } - } + }; const rowRenderer = ({ index, key, parent, style }) => { const member = bans[index]; - + return ( { anchorEl={popoverAnchor} onClose={handlePopoverClose} anchorOrigin={{ - vertical: "bottom", - horizontal: "center", + vertical: 'bottom', + horizontal: 'center', }} transformOrigin={{ - vertical: "top", - horizontal: "center", + vertical: 'top', + horizontal: 'center', }} - style={{ marginTop: "8px" }} + style={{ marginTop: '8px' }} > - - handleCancelBan(member?.offender)}>Cancel Ban + variant="contained" + onClick={() => handleCancelBan(member?.offender)} + > + {t('group:action.cancel_ban', { + postProcess: 'capitalizeFirstChar', + })} + - handlePopoverOpen(event, index)}> + + handlePopoverOpen(event, index)} + > @@ -178,8 +226,17 @@ export const ListOfBans = ({ groupId, setInfoSnack, setOpenSnack, show }) => { return (
-

Ban list

-
+

{t('core:list.bans', { postProcess: 'capitalizeFirstChar' })}

+
{({ height, width }) => ( {
); -} +}; diff --git a/src/components/Group/ListOfGroupPromotions.tsx b/src/components/Group/ListOfGroupPromotions.tsx index afeff14..a3a91c8 100644 --- a/src/components/Group/ListOfGroupPromotions.tsx +++ b/src/components/Group/ListOfGroupPromotions.tsx @@ -1,10 +1,4 @@ -import React, { - useCallback, - useContext, - useEffect, - useRef, - useState, -} from "react"; +import { useCallback, useContext, useEffect, useRef, useState } from 'react'; import { Avatar, Box, @@ -16,53 +10,52 @@ import { DialogContent, DialogContentText, DialogTitle, - ListItem, - ListItemAvatar, - ListItemButton, - ListItemText, MenuItem, Popover, Select, TextField, Typography, -} from "@mui/material"; - -import { getNameInfo } from "./Group"; -import { getBaseApi, getFee } from "../../background"; -import { LoadingButton } from "@mui/lab"; -import LockIcon from "@mui/icons-material/Lock"; -import NoEncryptionGmailerrorredIcon from "@mui/icons-material/NoEncryptionGmailerrorred"; + useTheme, +} from '@mui/material'; +import { LoadingButton } from '@mui/lab'; +import LockIcon from '@mui/icons-material/Lock'; +import NoEncryptionGmailerrorredIcon from '@mui/icons-material/NoEncryptionGmailerrorred'; import { - MyContext, + QORTAL_APP_CONTEXT, getArbitraryEndpointReact, getBaseApiReact, - isMobile, -} from "../../App"; -import { Spacer } from "../../common/Spacer"; -import { CustomLoader } from "../../common/CustomLoader"; -import { RequestQueueWithPromise } from "../../utils/queue/queue"; -import { useRecoilState } from "recoil"; +} from '../../App'; +import { Spacer } from '../../common/Spacer'; +import { CustomLoader } from '../../common/CustomLoader'; +import { RequestQueueWithPromise } from '../../utils/queue/queue'; import { myGroupsWhereIAmAdminAtom, promotionTimeIntervalAtom, promotionsAtom, -} from "../../atoms/global"; -import { Label } from "./AddGroup"; -import ShortUniqueId from "short-unique-id"; -import { CustomizedSnackbars } from "../Snackbar/Snackbar"; -import { getGroupNames } from "./UserListOfInvites"; -import { WrapperUserAction } from "../WrapperUserAction"; -import { useVirtualizer } from "@tanstack/react-virtual"; -import ErrorBoundary from "../../common/ErrorBoundary"; -import ExpandMoreIcon from "@mui/icons-material/ExpandMore"; -import ExpandLessIcon from "@mui/icons-material/ExpandLess"; -export const requestQueuePromos = new RequestQueueWithPromise(20); + txListAtom, +} from '../../atoms/global'; +import { Label } from './AddGroup'; +import ShortUniqueId from 'short-unique-id'; +import { CustomizedSnackbars } from '../Snackbar/Snackbar'; +import { getGroupNames } from './UserListOfInvites'; +import { useVirtualizer } from '@tanstack/react-virtual'; +import ErrorBoundary from '../../common/ErrorBoundary'; +import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; +import ExpandLessIcon from '@mui/icons-material/ExpandLess'; +import { getFee } from '../../background/background.ts'; +import { useAtom, useSetAtom } from 'jotai'; +import { useTranslation } from 'react-i18next'; + +const THIRTY_MINUTES = 30 * 60 * 1000; // 30 minutes in milliseconds +const uid = new ShortUniqueId({ length: 8 }); + +export const requestQueuePromos = new RequestQueueWithPromise(3); export function utf8ToBase64(inputString: string): string { // Encode the string as UTF-8 const utf8String = encodeURIComponent(inputString).replace( /%([0-9A-F]{2})/g, - (match, p1) => String.fromCharCode(Number("0x" + p1)) + (match, p1) => String.fromCharCode(Number('0x' + p1)) ); // Convert the UTF-8 encoded string to base64 @@ -70,40 +63,45 @@ export function utf8ToBase64(inputString: string): string { return base64String; } -const uid = new ShortUniqueId({ length: 8 }); - export function getGroupId(str) { const match = str.match(/group-(\d+)-/); return match ? match[1] : null; } -const THIRTY_MINUTES = 30 * 60 * 1000; // 30 minutes in milliseconds + export const ListOfGroupPromotions = () => { const [popoverAnchor, setPopoverAnchor] = useState(null); const [openPopoverIndex, setOpenPopoverIndex] = useState(null); const [selectedGroup, setSelectedGroup] = useState(null); const [loading, setLoading] = useState(false); const [isShowModal, setIsShowModal] = useState(false); - const [text, setText] = useState(""); - const [myGroupsWhereIAmAdmin, setMyGroupsWhereIAmAdmin] = useRecoilState( + const [text, setText] = useState(''); + const [myGroupsWhereIAmAdmin, setMyGroupsWhereIAmAdmin] = useAtom( myGroupsWhereIAmAdminAtom ); - const [promotions, setPromotions] = useRecoilState(promotionsAtom); - const [promotionTimeInterval, setPromotionTimeInterval] = useRecoilState( + const [promotions, setPromotions] = useAtom(promotionsAtom); + const [promotionTimeInterval, setPromotionTimeInterval] = useAtom( promotionTimeIntervalAtom ); - const [isExpanded, setIsExpanded] = React.useState(false); - + const [isExpanded, setIsExpanded] = useState(false); const [openSnack, setOpenSnack] = useState(false); const [infoSnack, setInfoSnack] = useState(null); const [fee, setFee] = useState(null); const [isLoadingJoinGroup, setIsLoadingJoinGroup] = useState(false); const [isLoadingPublish, setIsLoadingPublish] = useState(false); - const { show, setTxList } = useContext(MyContext); - - const listRef = useRef(); + const { show } = useContext(QORTAL_APP_CONTEXT); + const setTxList = useSetAtom(txListAtom); + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + const listRef = useRef(null); const rowVirtualizer = useVirtualizer({ count: promotions.length, - getItemKey: React.useCallback( + getItemKey: useCallback( (index) => promotions[index]?.identifier, [promotions] ), @@ -115,26 +113,30 @@ export const ListOfGroupPromotions = () => { useEffect(() => { try { (async () => { - const feeRes = await getFee("ARBITRARY"); + const feeRes = await getFee('ARBITRARY'); setFee(feeRes?.fee); })(); - } catch (error) {} + } catch (error) { + console.log(error); + } }, []); + const getPromotions = useCallback(async () => { try { setPromotionTimeInterval(Date.now()); const identifier = `group-promotions-ui24-`; const url = `${getBaseApiReact()}${getArbitraryEndpointReact()}?mode=ALL&service=DOCUMENT&identifier=${identifier}&limit=100&includemetadata=false&reverse=true&prefix=true`; const response = await fetch(url, { - method: "GET", + method: 'GET', headers: { - "Content-Type": "application/json", + 'Content-Type': 'application/json', }, }); const responseData = await response.json(); let data: any[] = []; const uniqueGroupIds = new Set(); const oneWeekAgo = Date.now() - 7 * 24 * 60 * 60 * 1000; + const getPromos = responseData?.map(async (promo: any) => { if (promo?.size < 200 && promo.created > oneWeekAgo) { const name = await requestQueuePromos.enqueue(async () => { @@ -142,7 +144,7 @@ export const ListOfGroupPromotions = () => { promo.name }/${promo.identifier}`; const response = await fetch(url, { - method: "GET", + method: 'GET', }); try { @@ -164,7 +166,7 @@ export const ListOfGroupPromotions = () => { } } } catch (error) { - console.error("Error fetching promo:", error); + console.error('Error fetching promo:', error); } }); } @@ -213,6 +215,7 @@ export const ListOfGroupPromotions = () => { setPopoverAnchor(null); setOpenPopoverIndex(null); }; + const publishPromo = async () => { try { setIsLoadingPublish(true); @@ -222,10 +225,11 @@ export const ListOfGroupPromotions = () => { await new Promise((res, rej) => { window - .sendMessage("publishOnQDN", { + .sendMessage('publishOnQDN', { data: data, identifier: identifier, - service: "DOCUMENT", + service: 'DOCUMENT', + uploadType: 'base64', }) .then((response) => { if (!response?.error) { @@ -235,23 +239,32 @@ export const ListOfGroupPromotions = () => { rej(response.error); }) .catch((error) => { - rej(error.message || "An error occurred"); + rej( + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }) + ); }); }); setInfoSnack({ - type: "success", - message: - "Successfully published promotion. It may take a couple of minutes for the promotion to appear", + type: 'success', + message: t('group:message.success.group_promotion', { + postProcess: 'capitalizeFirstChar', + }), }); setOpenSnack(true); - setText(""); + setText(''); setSelectedGroup(null); setIsShowModal(false); } catch (error) { setInfoSnack({ - type: "error", + type: 'error', message: - error?.message || "Error publishing the promotion. Please try again", + error?.message || + t('group:message.error.group_promotion', { + postProcess: 'capitalizeFirstChar', + }), }); setOpenSnack(true); } finally { @@ -262,32 +275,44 @@ export const ListOfGroupPromotions = () => { const handleJoinGroup = async (group, isOpen) => { try { const groupId = group.groupId; - const fee = await getFee("JOIN_GROUP"); + const fee = await getFee('JOIN_GROUP'); + await show({ - message: "Would you like to perform an JOIN_GROUP transaction?", - publishFee: fee.fee + " QORT", + message: t('core:message.question.perform_transaction', { + action: 'JOIN_GROUP', + postProcess: 'capitalizeFirstChar', + }), + publishFee: fee.fee + ' QORT', }); + setIsLoadingJoinGroup(true); await new Promise((res, rej) => { window - .sendMessage("joinGroup", { + .sendMessage('joinGroup', { groupId, }) .then((response) => { if (!response?.error) { setInfoSnack({ - type: "success", - message: - "Successfully requested to join group. It may take a couple of minutes for the changes to propagate", + type: 'success', + message: t('group:message.success.group_join', { + postProcess: 'capitalizeFirstChar', + }), }); if (isOpen) { setTxList((prev) => [ { ...response, - type: "joined-group", - label: `Joined Group ${group?.groupName}: awaiting confirmation`, - labelDone: `Joined Group ${group?.groupName}: success!`, + type: 'joined-group', + label: t('group:message.success.group_join_label', { + group_name: group?.groupName, + postProcess: 'capitalizeFirstChar', + }), + labelDone: t('group:message.success.group_join_label', { + group_name: group?.groupName, + postProcess: 'capitalizeFirstChar', + }), done: false, groupId, }, @@ -297,23 +322,28 @@ export const ListOfGroupPromotions = () => { setTxList((prev) => [ { ...response, - type: "joined-group-request", - label: `Requested to join Group ${group?.groupName}: awaiting confirmation`, - labelDone: `Requested to join Group ${group?.groupName}: success!`, + type: 'joined-group-request', + label: t('group:message.success.group_join_request', { + group_name: group?.groupName, + postProcess: 'capitalizeFirstChar', + }), + labelDone: t('group:message.success.group_join_outcome', { + group_name: group?.groupName, + postProcess: 'capitalizeFirstChar', + }), done: false, groupId, }, ...prev, ]); } - setOpenSnack(true); handlePopoverClose(); res(response); return; } else { setInfoSnack({ - type: "error", + type: 'error', message: response?.error, }); setOpenSnack(true); @@ -322,8 +352,12 @@ export const ListOfGroupPromotions = () => { }) .catch((error) => { setInfoSnack({ - type: "error", - message: error.message || "An error occurred", + type: 'error', + message: + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }), }); setOpenSnack(true); rej(error); @@ -331,6 +365,7 @@ export const ListOfGroupPromotions = () => { }); setIsLoadingJoinGroup(false); } catch (error) { + console.log(error); } finally { setIsLoadingJoinGroup(false); } @@ -339,55 +374,62 @@ export const ListOfGroupPromotions = () => { return ( - + setIsExpanded((prev) => !prev)} > - Group promotions {promotions.length > 0 && ` (${promotions.length})`} + {t('group:group.promotions', { + postProcess: 'capitalizeFirstChar', + })}{' '} + {promotions.length > 0 && ` (${promotions.length})`} + {isExpanded ? ( ) : ( )} + @@ -396,90 +438,99 @@ export const ListOfGroupPromotions = () => { <> + + + {loading && promotions.length === 0 && ( )} + {!loading && promotions.length === 0 && ( - Nothing to display + {t('group:message.generic.no_display', { + postProcess: 'capitalizeFirstChar', + })} )} +
{ className="scrollable-container" style={{ flexGrow: 1, - overflow: "auto", - position: "relative", - display: "flex", - height: "0px", + overflow: 'auto', + position: 'relative', + display: 'flex', + height: '0px', }} >
{rowVirtualizer.getVirtualItems().map((virtualRow) => { @@ -516,113 +567,125 @@ export const ListOfGroupPromotions = () => { ref={rowVirtualizer.measureElement} //measure dynamic row height key={promotion?.identifier} style={{ - position: "absolute", + alignItems: 'center', + display: 'flex', + flexDirection: 'column', + gap: '5px', + left: '50%', // Move to the center horizontally + overscrollBehavior: 'none', + padding: '10px 0', + position: 'absolute', top: 0, - left: "50%", // Move to the center horizontally transform: `translateY(${virtualRow.start}px) translateX(-50%)`, // Adjust for centering - width: "100%", // Control width (90% of the parent) - padding: "10px 0", - display: "flex", - alignItems: "center", - overscrollBehavior: "none", - flexDirection: "column", - gap: "5px", + width: '100%', // Control width (90% of the parent) }} > - Error loading content: Invalid Data + {t('group:message.generic.invalid_data', { + postProcess: 'capitalizeFirstChar', + })} } > { - if (reason === "backdropClick") { + onClose={(reason) => { + if (reason === 'backdropClick') { // Prevent closing on backdrop click return; } handlePopoverClose(); // Close only on other events like Esc key press }} anchorOrigin={{ - vertical: "top", - horizontal: "center", + vertical: 'top', + horizontal: 'center', }} transformOrigin={{ - vertical: "bottom", - horizontal: "center", + vertical: 'bottom', + horizontal: 'center', }} - style={{ marginTop: "8px" }} + style={{ marginTop: '8px' }} > - Group name: {` ${promotion?.groupName}`} + {t('group:group.name', { + postProcess: 'capitalizeFirstChar', + })} + : {` ${promotion?.groupName}`} + - Number of members:{" "} - {` ${promotion?.memberCount}`} + {t('group:group.member_number', { + postProcess: 'capitalizeFirstChar', + })} + : {` ${promotion?.memberCount}`} + {promotion?.description && ( {promotion?.description} )} + {promotion?.isOpen === false && ( - *This is a closed/private group, so you - will need to wait until an admin accepts - your request + {t('group:message.generic.closed_group', { + postProcess: 'capitalizeFirstChar', + })} )} + + { variant="contained" onClick={handlePopoverClose} > - Close + {t('core:action.close', { + postProcess: 'capitalizeFirstChar', + })} + { ) } > - Join + {t('core:action.join', { + postProcess: 'capitalizeFirstChar', + })} @@ -652,23 +720,23 @@ export const ListOfGroupPromotions = () => { { > {promotion?.name?.charAt(0)} + {promotion?.name} + {promotion?.groupName} + + {promotion?.isOpen === false && ( )} + {promotion?.isOpen === true && ( )} + {promotion?.isOpen - ? "Public group" - : "Private group"} + ? t('group:group.public', { + postProcess: 'capitalizeFirstChar', + }) + : t('group:group.private', { + postProcess: 'capitalizeFirstChar', + })} + + {promotion?.data} + + +
@@ -774,92 +857,131 @@ export const ListOfGroupPromotions = () => { + - {isShowModal && ( - + - - {"Promote your group to non-members"} - - - - Only the latest promotion from the week will be shown for your - group. - - - Max 200 characters. Publish Fee: {fee && fee} {" QORT"} - - - + + + + {t('group:message.generic.latest_promotion', { + postProcess: 'capitalizeFirstChar', + })} + + + + {t('group:message.generic.max_chars', { + postProcess: 'capitalizeFirstChar', + })} + : {fee && fee} {' QORT'} + + + + + + + + + + setSelectedGroup(e.target.value)} - variant="outlined" - > - {myGroupsWhereIAmAdmin?.map((group) => { - return ( - - {group?.groupName} - - ); - })} - - - - setText(e.target.value)} - inputProps={{ - maxLength: 200, - }} - multiline={true} - sx={{ - "& .MuiFormLabel-root": { - color: "white", - }, - "& .MuiFormLabel-root.Mui-focused": { - color: "white", - }, - }} - /> - - - - - - - )} + {myGroupsWhereIAmAdmin?.map((group) => { + return ( + + {group?.groupName} + + ); + })} + + + + + + setText(e.target.value)} + inputProps={{ + maxLength: 200, + }} + multiline={true} + sx={{ + '& .MuiFormLabel-root': { + color: theme.palette.text.primary, + }, + '& .MuiFormLabel-root.Mui-focused': { + color: theme.palette.text.primary, + }, + }} + /> + + + + + + + + { - const response = await fetch(`${getBaseApiReact()}/groups/invites/group/${groupNumber}?limit=0`); + const response = await fetch( + `${getBaseApiReact()}/groups/invites/group/${groupNumber}?limit=0` + ); const groupData = await response.json(); return groupData; -} +}; const getNames = async (listOfMembers, includeNoNames) => { let members = []; @@ -20,27 +36,38 @@ const getNames = async (listOfMembers, includeNoNames) => { const name = await getNameInfo(member.invitee); if (name) { members.push({ ...member, name }); - } else if(includeNoNames){ - members.push({ ...member, name: name || "" }); + } else if (includeNoNames) { + members.push({ ...member, name: name || '' }); } } } } return members; -} +}; const cache = new CellMeasurerCache({ fixedWidth: true, defaultHeight: 50, }); -export const ListOfInvites = ({ groupId, setInfoSnack, setOpenSnack, show }) => { +export const ListOfInvites = ({ + groupId, + setInfoSnack, + setOpenSnack, + show, +}) => { const [invites, setInvites] = useState([]); const [popoverAnchor, setPopoverAnchor] = useState(null); // Track which list item the popover is anchored to const [openPopoverIndex, setOpenPopoverIndex] = useState(null); // Track which list item has the popover open const [isLoadingCancelInvite, setIsLoadingCancelInvite] = useState(false); - - const listRef = useRef(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + const listRef = useRef(null); const getInvites = async (groupId) => { try { @@ -50,7 +77,7 @@ export const ListOfInvites = ({ groupId, setInfoSnack, setOpenSnack, show }) => } catch (error) { console.error(error); } - } + }; useEffect(() => { if (groupId) { @@ -68,24 +95,33 @@ export const ListOfInvites = ({ groupId, setInfoSnack, setOpenSnack, show }) => setOpenPopoverIndex(null); }; - const handleCancelInvitation = async (address)=> { + const handleCancelInvitation = async (address) => { try { - const fee = await getFee('CANCEL_GROUP_INVITE') + const fee = await getFee('CANCEL_GROUP_INVITE'); + await show({ - message: "Would you like to perform a CANCEL_GROUP_INVITE transaction?" , - publishFee: fee.fee + ' QORT' - }) - setIsLoadingCancelInvite(true) - await new Promise((res, rej)=> { - window.sendMessage("cancelInvitationToGroup", { - groupId, - qortalAddress: address, - }) + message: t('core:message.question.perform_transaction', { + action: 'CANCEL_GROUP_INVITE', + postProcess: 'capitalizeFirstChar', + }), + publishFee: fee.fee + ' QORT', + }); + + setIsLoadingCancelInvite(true); + + await new Promise((res, rej) => { + window + .sendMessage('cancelInvitationToGroup', { + groupId, + qortalAddress: address, + }) .then((response) => { if (!response?.error) { setInfoSnack({ - type: "success", - message: "Successfully canceled invitation. It may take a couple of minutes for the changes to propagate", + type: 'success', + message: t('group:message.success.invitation_cancellation', { + postProcess: 'capitalizeFirstChar', + }), }); setOpenSnack(true); handlePopoverClose(); @@ -94,7 +130,7 @@ export const ListOfInvites = ({ groupId, setInfoSnack, setOpenSnack, show }) => return; } setInfoSnack({ - type: "error", + type: 'error', message: response?.error, }); setOpenSnack(true); @@ -102,24 +138,27 @@ export const ListOfInvites = ({ groupId, setInfoSnack, setOpenSnack, show }) => }) .catch((error) => { setInfoSnack({ - type: "error", - message: error.message || "An error occurred", + type: 'error', + message: + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }), }); setOpenSnack(true); rej(error); }); - - }) + }); } catch (error) { - + console.log(error); } finally { - setIsLoadingCancelInvite(false) + setIsLoadingCancelInvite(false); } - } + }; const rowRenderer = ({ index, key, parent, style }) => { const member = invites[index]; - + return ( anchorEl={popoverAnchor} onClose={handlePopoverClose} anchorOrigin={{ - vertical: "bottom", - horizontal: "center", + vertical: 'bottom', + horizontal: 'center', }} transformOrigin={{ - vertical: "top", - horizontal: "center", + vertical: 'top', + horizontal: 'center', }} - style={{ marginTop: "8px" }} + style={{ marginTop: '8px' }} > - - handleCancelInvitation(member?.invitee)}>Cancel Invitation + variant="contained" + onClick={() => handleCancelInvitation(member?.invitee)} + > + {t('core:action.cancel_invitation', { + postProcess: 'capitalizeFirstChar', + })} + - handlePopoverOpen(event, index)}> + + handlePopoverOpen(event, index)} + > + @@ -179,8 +233,21 @@ export const ListOfInvites = ({ groupId, setInfoSnack, setOpenSnack, show }) => return (
-

Invitees list

-
+

+ {t('group:invitees_list', { + postProcess: 'capitalizeFirstChar', + })} +

+
{({ height, width }) => (
); -} +}; diff --git a/src/components/Group/ListOfJoinRequests.tsx b/src/components/Group/ListOfJoinRequests.tsx index 0f4bd81..60bdb0a 100644 --- a/src/components/Group/ListOfJoinRequests.tsx +++ b/src/components/Group/ListOfJoinRequests.tsx @@ -1,16 +1,34 @@ -import React, { useContext, useEffect, useRef, useState } from 'react'; -import { Avatar, Box, Button, ListItem, ListItemAvatar, ListItemButton, ListItemText, Popover } from '@mui/material'; -import { AutoSizer, CellMeasurer, CellMeasurerCache, List } from 'react-virtualized'; +import { useEffect, useRef, useState } from 'react'; +import { + Avatar, + Box, + ListItem, + ListItemAvatar, + ListItemButton, + ListItemText, + Popover, +} from '@mui/material'; +import { + AutoSizer, + CellMeasurer, + CellMeasurerCache, + List, +} from 'react-virtualized'; import { getNameInfo } from './Group'; -import { getBaseApi, getFee } from '../../background'; +import { getFee } from '../../background/background.ts'; import { LoadingButton } from '@mui/lab'; -import { MyContext, getBaseApiReact } from '../../App'; +import { getBaseApiReact } from '../../App'; +import { txListAtom } from '../../atoms/global'; +import { useAtom } from 'jotai'; +import { useTranslation } from 'react-i18next'; export const getMemberInvites = async (groupNumber) => { - const response = await fetch(`${getBaseApiReact()}/groups/joinrequests/${groupNumber}?limit=0`); + const response = await fetch( + `${getBaseApiReact()}/groups/joinrequests/${groupNumber}?limit=0` + ); const groupData = await response.json(); return groupData; -} +}; const getNames = async (listOfMembers, includeNoNames) => { let members = []; @@ -19,29 +37,40 @@ const getNames = async (listOfMembers, includeNoNames) => { if (member.joiner) { const name = await getNameInfo(member.joiner); if (name) { - members.push({ ...member, name: name || "" }); - } else if(includeNoNames){ - members.push({ ...member, name: name || "" }); + members.push({ ...member, name: name || '' }); + } else if (includeNoNames) { + members.push({ ...member, name: name || '' }); } } } } return members; -} +}; const cache = new CellMeasurerCache({ fixedWidth: true, defaultHeight: 50, }); -export const ListOfJoinRequests = ({ groupId, setInfoSnack, setOpenSnack, show }) => { +export const ListOfJoinRequests = ({ + groupId, + setInfoSnack, + setOpenSnack, + show, +}) => { const [invites, setInvites] = useState([]); - const {txList, setTxList} = useContext(MyContext) - + const [txList, setTxList] = useAtom(txListAtom); const [popoverAnchor, setPopoverAnchor] = useState(null); // Track which list item the popover is anchored to const [openPopoverIndex, setOpenPopoverIndex] = useState(null); // Track which list item has the popover open - const listRef = useRef(); + const listRef = useRef(null); const [isLoadingAccept, setIsLoadingAccept] = useState(false); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); const getInvites = async (groupId) => { try { @@ -51,7 +80,7 @@ export const ListOfJoinRequests = ({ groupId, setInfoSnack, setOpenSnack, show } } catch (error) { console.error(error); } - } + }; useEffect(() => { if (groupId) { @@ -69,49 +98,61 @@ export const ListOfJoinRequests = ({ groupId, setInfoSnack, setOpenSnack, show } setOpenPopoverIndex(null); }; - const handleAcceptJoinRequest = async (address)=> { + const handleAcceptJoinRequest = async (address) => { try { - const fee = await getFee('GROUP_INVITE') + const fee = await getFee('GROUP_INVITE'); + await show({ - message: "Would you like to perform a GROUP_INVITE transaction?" , - publishFee: fee.fee + ' QORT' - }) - setIsLoadingAccept(true) - await new Promise((res, rej)=> { - window.sendMessage("inviteToGroup", { - groupId, - qortalAddress: address, - inviteTime: 10800, - }) + message: t('core:message.question.perform_transaction', { + action: 'GROUP_INVITE', + postProcess: 'capitalizeFirstChar', + }), + publishFee: fee.fee + ' QORT', + }); + + setIsLoadingAccept(true); + + await new Promise((res, rej) => { + window + .sendMessage('inviteToGroup', { + groupId, + qortalAddress: address, + inviteTime: 10800, + }) .then((response) => { if (!response?.error) { setIsLoadingAccept(false); setInfoSnack({ - type: "success", - message: "Successfully accepted join request. It may take a couple of minutes for the changes to propagate", + type: 'success', + message: t('group:message.success.group_join', { + postProcess: 'capitalizeFirstChar', + }), }); setOpenSnack(true); handlePopoverClose(); res(response); - setTxList((prev) => [ { ...response, type: 'join-request-accept', - label: `Accepted join request: awaiting confirmation`, - labelDone: `User successfully joined!`, + label: t('group:message.success,invitation_request', { + postProcess: 'capitalizeFirstChar', + }), + labelDone: t('group:message.success,user_joined', { + postProcess: 'capitalizeFirstChar', + }), done: false, groupId, qortalAddress: address, }, ...prev, ]); - + return; } - + setInfoSnack({ - type: "error", + type: 'error', message: response?.error, }); setOpenSnack(true); @@ -119,25 +160,35 @@ export const ListOfJoinRequests = ({ groupId, setInfoSnack, setOpenSnack, show } }) .catch((error) => { setInfoSnack({ - type: "error", - message: error?.message || "An error occurred", + type: 'error', + message: + error?.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }), }); setOpenSnack(true); rej(error); }); - - }) + }); } catch (error) { - + console.log(error); } finally { - setIsLoadingAccept(false) + setIsLoadingAccept(false); } - } + }; const rowRenderer = ({ index, key, parent, style }) => { const member = invites[index]; - const findJoinRequsetInTxList = txList?.find((tx)=> tx?.groupId === groupId && tx?.qortalAddress === member?.joiner && tx?.type === 'join-request-accept') - if(findJoinRequsetInTxList) return null + const findJoinRequestInTxList = txList?.find( + (tx) => + tx?.groupId === groupId && + tx?.qortalAddress === member?.joiner && + tx?.type === 'join-request-accept' + ); + + if (findJoinRequestInTxList) return null; + return ( - - handleAcceptJoinRequest(member?.joiner)}>Accept + variant="contained" + onClick={() => handleAcceptJoinRequest(member?.joiner)} + > + {t('core:action.accept', { + postProcess: 'capitalizeFirstChar', + })} + - handlePopoverOpen(event, index)}> + + handlePopoverOpen(event, index)} + > @@ -197,8 +262,19 @@ export const ListOfJoinRequests = ({ groupId, setInfoSnack, setOpenSnack, show } return (
-

Join request list

-
+

+ {t('core:list.join_request', { postProcess: 'capitalizeFirstChar' })} +

+
{({ height, width }) => (
); -} +}; diff --git a/src/components/Group/ListOfMembers.tsx b/src/components/Group/ListOfMembers.tsx index 9910453..1d23b44 100644 --- a/src/components/Group/ListOfMembers.tsx +++ b/src/components/Group/ListOfMembers.tsx @@ -1,29 +1,31 @@ import { Avatar, Box, - Button, ListItem, ListItemAvatar, ListItemButton, ListItemText, Popover, Typography, -} from "@mui/material"; -import React, { useRef, useState } from "react"; + useTheme, +} from '@mui/material'; +import { useRef, useState } from 'react'; import { AutoSizer, CellMeasurer, CellMeasurerCache, List, -} from "react-virtualized"; -import { LoadingButton } from "@mui/lab"; -import { getBaseApi, getFee } from "../../background"; -import { getBaseApiReact } from "../../App"; +} from 'react-virtualized'; +import { LoadingButton } from '@mui/lab'; +import { getFee } from '../../background/background.ts'; +import { getBaseApiReact } from '../../App'; +import { useTranslation } from 'react-i18next'; const cache = new CellMeasurerCache({ fixedWidth: true, defaultHeight: 50, }); + const ListOfMembers = ({ members, groupId, @@ -39,9 +41,15 @@ const ListOfMembers = ({ const [isLoadingBan, setIsLoadingBan] = useState(false); const [isLoadingMakeAdmin, setIsLoadingMakeAdmin] = useState(false); const [isLoadingRemoveAdmin, setIsLoadingRemoveAdmin] = useState(false); - - - const listRef = useRef(); + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + const listRef = useRef(null); const handlePopoverOpen = (event, index) => { setPopoverAnchor(event.currentTarget); @@ -55,23 +63,29 @@ const ListOfMembers = ({ const handleKick = async (address) => { try { - const fee = await getFee("GROUP_KICK"); + const fee = await getFee('GROUP_KICK'); await show({ - message: "Would you like to perform a GROUP_KICK transaction?", - publishFee: fee.fee + " QORT", + message: t('core:message.question.perform_transaction', { + action: 'GROUP_KICK', + postProcess: 'capitalizeFirstChar', + }), + publishFee: fee.fee + ' QORT', }); setIsLoadingKick(true); new Promise((res, rej) => { - window.sendMessage("kickFromGroup", { - groupId, - qortalAddress: address, - }) + window + .sendMessage('kickFromGroup', { + groupId, + qortalAddress: address, + }) .then((response) => { if (!response?.error) { setInfoSnack({ - type: "success", - message: "Successfully kicked member from group. It may take a couple of minutes for the changes to propagate", + type: 'success', + message: t('group:message.success.group_kick', { + postProcess: 'capitalizeFirstChar', + }), }); setOpenSnack(true); handlePopoverClose(); @@ -79,7 +93,7 @@ const ListOfMembers = ({ return; } setInfoSnack({ - type: "error", + type: 'error', message: response?.error, }); setOpenSnack(true); @@ -87,38 +101,51 @@ const ListOfMembers = ({ }) .catch((error) => { setInfoSnack({ - type: "error", - message: error.message || "An error occurred", + type: 'error', + message: + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }), }); setOpenSnack(true); rej(error); }); - }); } catch (error) { + console.log(error); } finally { setIsLoadingKick(false); } }; const handleBan = async (address) => { try { - const fee = await getFee("GROUP_BAN"); + const fee = await getFee('GROUP_BAN'); + await show({ - message: "Would you like to perform a GROUP_BAN transaction?", - publishFee: fee.fee + " QORT", + message: t('core:message.question.perform_transaction', { + action: 'GROUP_BAN', + postProcess: 'capitalizeFirstChar', + }), + publishFee: fee.fee + ' QORT', }); + setIsLoadingBan(true); + await new Promise((res, rej) => { - window.sendMessage("banFromGroup", { - groupId, - qortalAddress: address, - rBanTime: 0, - }) + window + .sendMessage('banFromGroup', { + groupId, + qortalAddress: address, + rBanTime: 0, + }) .then((response) => { if (!response?.error) { setInfoSnack({ - type: "success", - message: "Successfully banned member from group. It may take a couple of minutes for the changes to propagate", + type: 'success', + message: t('group:message.success.group_ban', { + postProcess: 'capitalizeFirstChar', + }), }); setOpenSnack(true); handlePopoverClose(); @@ -126,7 +153,7 @@ const ListOfMembers = ({ return; } setInfoSnack({ - type: "error", + type: 'error', message: response?.error, }); setOpenSnack(true); @@ -134,15 +161,19 @@ const ListOfMembers = ({ }) .catch((error) => { setInfoSnack({ - type: "error", - message: error.message || "An error occurred", + type: 'error', + message: + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }), }); setOpenSnack(true); rej(error); }); - }); } catch (error) { + console.log(error); } finally { setIsLoadingBan(false); } @@ -150,22 +181,28 @@ const ListOfMembers = ({ const makeAdmin = async (address) => { try { - const fee = await getFee("ADD_GROUP_ADMIN"); + const fee = await getFee('ADD_GROUP_ADMIN'); await show({ - message: "Would you like to perform a ADD_GROUP_ADMIN transaction?", - publishFee: fee.fee + " QORT", + message: t('core:message.question.perform_transaction', { + action: 'ADD_GROUP_ADMIN', + postProcess: 'capitalizeFirstChar', + }), + publishFee: fee.fee + ' QORT', }); setIsLoadingMakeAdmin(true); await new Promise((res, rej) => { - window.sendMessage("makeAdmin", { - groupId, - qortalAddress: address, - }) + window + .sendMessage('makeAdmin', { + groupId, + qortalAddress: address, + }) .then((response) => { if (!response?.error) { setInfoSnack({ - type: "success", - message: "Successfully made member an admin. It may take a couple of minutes for the changes to propagate", + type: 'success', + message: t('group:message.success.group_member_admin', { + postProcess: 'capitalizeFirstChar', + }), }); setOpenSnack(true); handlePopoverClose(); @@ -173,7 +210,7 @@ const ListOfMembers = ({ return; } setInfoSnack({ - type: "error", + type: 'error', message: response?.error, }); setOpenSnack(true); @@ -181,15 +218,19 @@ const ListOfMembers = ({ }) .catch((error) => { setInfoSnack({ - type: "error", - message: error.message || "An error occurred", + type: 'error', + message: + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }), }); setOpenSnack(true); rej(error); }); - }); } catch (error) { + console.log(error); } finally { setIsLoadingMakeAdmin(false); } @@ -197,22 +238,28 @@ const ListOfMembers = ({ const removeAdmin = async (address) => { try { - const fee = await getFee("REMOVE_GROUP_ADMIN"); + const fee = await getFee('REMOVE_GROUP_ADMIN'); await show({ - message: "Would you like to perform a REMOVE_GROUP_ADMIN transaction?", - publishFee: fee.fee + " QORT", + message: t('core:message.question.perform_transaction', { + action: 'REMOVE_GROUP_ADMIN', + postProcess: 'capitalizeFirstChar', + }), + publishFee: fee.fee + ' QORT', }); setIsLoadingRemoveAdmin(true); await new Promise((res, rej) => { - window.sendMessage("removeAdmin", { - groupId, - qortalAddress: address, - }) + window + .sendMessage('removeAdmin', { + groupId, + qortalAddress: address, + }) .then((response) => { if (!response?.error) { setInfoSnack({ - type: "success", - message: "Successfully removed member as an admin. It may take a couple of minutes for the changes to propagate", + type: 'success', + message: t('group:message.success.group_remove_member', { + postProcess: 'capitalizeFirstChar', + }), }); setOpenSnack(true); handlePopoverClose(); @@ -220,7 +267,7 @@ const ListOfMembers = ({ return; } setInfoSnack({ - type: "error", + type: 'error', message: response?.error, }); setOpenSnack(true); @@ -228,15 +275,19 @@ const ListOfMembers = ({ }) .catch((error) => { setInfoSnack({ - type: "error", - message: error.message || "An error occurred", + type: 'error', + message: + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }), }); setOpenSnack(true); rej(error); }); - }); } catch (error) { + console.log(error); } finally { setIsLoadingRemoveAdmin(false); } @@ -260,24 +311,24 @@ const ListOfMembers = ({ anchorEl={popoverAnchor} onClose={handlePopoverClose} anchorOrigin={{ - vertical: "bottom", - horizontal: "center", + vertical: 'bottom', + horizontal: 'center', }} transformOrigin={{ - vertical: "top", - horizontal: "center", + vertical: 'top', + horizontal: 'center', }} - style={{ marginTop: "8px" }} + style={{ marginTop: '8px' }} > {isOwner && ( @@ -288,69 +339,80 @@ const ListOfMembers = ({ variant="contained" onClick={() => handleKick(member?.member)} > - Kick member from group + {t('group:action.kick_member', { + postProcess: 'capitalizeFirstChar', + })} + handleBan(member?.member)} > - Ban member from group + {t('group:action.ban', { + postProcess: 'capitalizeFirstChar', + })} + makeAdmin(member?.member)} > - Make an admin + {t('group:action.make_admin', { + postProcess: 'capitalizeFirstChar', + })} + removeAdmin(member?.member)} > - Remove as admin + {t('group:action.remove_admin', { + postProcess: 'capitalizeFirstChar', + })} )} - - // } - disablePadding - > + + handlePopoverOpen(event, index)} > + {member?.isAdmin && ( - Admin - )} + + {t('core:admin', { + postProcess: 'capitalizeFirstChar', + })} + + )} -
)} @@ -360,28 +422,31 @@ const ListOfMembers = ({ return (
-

Member list

+

+ {t('core:list.member', { + postProcess: 'capitalizeFirstChar', + })} +

{({ height, width }) => ( )} diff --git a/src/components/Group/ListOfThreadPostsWatched.tsx b/src/components/Group/ListOfThreadPostsWatched.tsx index 6e24ba3..ffb2fbd 100644 --- a/src/components/Group/ListOfThreadPostsWatched.tsx +++ b/src/components/Group/ListOfThreadPostsWatched.tsx @@ -1,180 +1,207 @@ -import * as React from "react"; -import List from "@mui/material/List"; -import ListItem from "@mui/material/ListItem"; -import ListItemButton from "@mui/material/ListItemButton"; -import ListItemIcon from "@mui/material/ListItemIcon"; -import ListItemText from "@mui/material/ListItemText"; -import Checkbox from "@mui/material/Checkbox"; -import IconButton from "@mui/material/IconButton"; -import CommentIcon from "@mui/icons-material/Comment"; -import InfoIcon from "@mui/icons-material/Info"; -import GroupAddIcon from "@mui/icons-material/GroupAdd"; -import { executeEvent } from "../../utils/events"; -import { Box, Typography } from "@mui/material"; -import { Spacer } from "../../common/Spacer"; -import { getGroupNames } from "./UserListOfInvites"; -import { CustomLoader } from "../../common/CustomLoader"; -import VisibilityIcon from "@mui/icons-material/Visibility"; -import { isMobile } from "../../App"; +import { useEffect, useState } from 'react'; +import List from '@mui/material/List'; +import ListItem from '@mui/material/ListItem'; +import ListItemButton from '@mui/material/ListItemButton'; +import ListItemText from '@mui/material/ListItemText'; +import IconButton from '@mui/material/IconButton'; +import { executeEvent } from '../../utils/events'; +import { Box, Typography, useTheme } from '@mui/material'; +import { Spacer } from '../../common/Spacer'; +import { CustomLoader } from '../../common/CustomLoader'; +import VisibilityIcon from '@mui/icons-material/Visibility'; +import { useTranslation } from 'react-i18next'; export const ListOfThreadPostsWatched = () => { - const [posts, setPosts] = React.useState([]); - const [loading, setLoading] = React.useState(true); + const [posts, setPosts] = useState([]); + const [loading, setLoading] = useState(true); + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); const getPosts = async () => { try { await new Promise((res, rej) => { - window.sendMessage("getThreadActivity", {}) - .then((response) => { - if (!response?.error) { - if (!response) { - res(null); + window + .sendMessage('getThreadActivity', {}) + .then((response) => { + if (!response?.error) { + if (!response) { + res(null); + return; + } + const uniquePosts = response.reduce((acc, current) => { + const x = acc.find( + (item) => item?.thread?.threadId === current?.thread?.threadId + ); + if (!x) { + return acc.concat([current]); + } else { + return acc; + } + }, []); + setPosts(uniquePosts); + res(uniquePosts); return; } - const uniquePosts = response.reduce((acc, current) => { - const x = acc.find( - (item) => item?.thread?.threadId === current?.thread?.threadId - ); - if (!x) { - return acc.concat([current]); - } else { - return acc; - } - }, []); - setPosts(uniquePosts); - res(uniquePosts); - return; - } - rej(response.error); - }) - .catch((error) => { - rej(error.message || "An error occurred"); - }); - + rej(response.error); + }) + .catch((error) => { + rej( + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }) + ); + }); }); } catch (error) { + console.log(error); } finally { setLoading(false); } }; - React.useEffect(() => { + useEffect(() => { getPosts(); }, []); return ( - + - New Thread Posts: + {t('group:thread_posts', { + postProcess: 'capitalizeFirstChar', + })} + : - + + {loading && posts.length === 0 && ( )} + {!loading && posts.length === 0 && ( - Nothing to display + {t('group:message.generic.no_display', { + postProcess: 'capitalizeFirstChar', + })} )} + {posts?.length > 0 && ( - - {posts?.map((post) => { - return ( - { - executeEvent("openThreadNewPost", { - data: post, - }); - }} - disablePadding - secondaryAction={ - - - - } - > - - - - - ); - })} - + + {posts?.map((post) => { + return ( + { + executeEvent('openThreadNewPost', { + data: post, + }); + }} + disablePadding + secondaryAction={ + + + + } + > + + + + + ); + })} + )} - ); diff --git a/src/components/Group/ManageMembers.tsx b/src/components/Group/ManageMembers.tsx index 8dab53f..8e58c21 100644 --- a/src/components/Group/ManageMembers.tsx +++ b/src/components/Group/ManageMembers.tsx @@ -1,96 +1,121 @@ -import * as React from "react"; -import Button from "@mui/material/Button"; -import Dialog from "@mui/material/Dialog"; -import ListItemText from "@mui/material/ListItemText"; -import ListItemButton from "@mui/material/ListItemButton"; -import List from "@mui/material/List"; -import Divider from "@mui/material/Divider"; -import AppBar from "@mui/material/AppBar"; -import Toolbar from "@mui/material/Toolbar"; -import IconButton from "@mui/material/IconButton"; -import Typography from "@mui/material/Typography"; -import CloseIcon from "@mui/icons-material/Close"; -import Slide from "@mui/material/Slide"; -import { TransitionProps } from "@mui/material/transitions"; -import ListOfMembers from "./ListOfMembers"; -import { InviteMember } from "./InviteMember"; -import { ListOfInvites } from "./ListOfInvites"; -import { ListOfBans } from "./ListOfBans"; -import { ListOfJoinRequests } from "./ListOfJoinRequests"; -import { Box, Card, Tab, Tabs } from "@mui/material"; -import { CustomizedSnackbars } from "../Snackbar/Snackbar"; -import { MyContext, getBaseApiReact, isMobile } from "../../App"; -import { getGroupMembers, getNames } from "./Group"; -import { LoadingSnackbar } from "../Snackbar/LoadingSnackbar"; -import { getFee } from "../../background"; -import { LoadingButton } from "@mui/lab"; -import { subscribeToEvent, unsubscribeFromEvent } from "../../utils/events"; -import { Spacer } from "../../common/Spacer"; +import { + forwardRef, + Fragment, + ReactElement, + Ref, + SyntheticEvent, + useCallback, + useContext, + useEffect, + useState, +} from 'react'; +import Button from '@mui/material/Button'; +import Dialog from '@mui/material/Dialog'; +import AppBar from '@mui/material/AppBar'; +import Toolbar from '@mui/material/Toolbar'; +import IconButton from '@mui/material/IconButton'; +import Typography from '@mui/material/Typography'; +import CloseIcon from '@mui/icons-material/Close'; +import Slide from '@mui/material/Slide'; +import { TransitionProps } from '@mui/material/transitions'; +import ListOfMembers from './ListOfMembers'; +import { InviteMember } from './InviteMember'; +import { ListOfInvites } from './ListOfInvites'; +import { ListOfBans } from './ListOfBans'; +import { ListOfJoinRequests } from './ListOfJoinRequests'; +import { Box, ButtonBase, Card, Tab, Tabs, useTheme } from '@mui/material'; +import { CustomizedSnackbars } from '../Snackbar/Snackbar'; +import { QORTAL_APP_CONTEXT, getBaseApiReact } from '../../App'; +import { getGroupMembers, getNames } from './Group'; +import { LoadingSnackbar } from '../Snackbar/LoadingSnackbar'; +import { getFee } from '../../background/background.ts'; +import { LoadingButton } from '@mui/lab'; +import { subscribeToEvent, unsubscribeFromEvent } from '../../utils/events'; +import { Spacer } from '../../common/Spacer'; +import InsertLinkIcon from '@mui/icons-material/InsertLink'; +import { useSetAtom } from 'jotai'; +import { txListAtom } from '../../atoms/global'; +import { useTranslation } from 'react-i18next'; function a11yProps(index: number) { return { id: `simple-tab-${index}`, - "aria-controls": `simple-tabpanel-${index}`, + 'aria-controls': `simple-tabpanel-${index}`, }; } -const Transition = React.forwardRef(function Transition( +const Transition = forwardRef(function Transition( props: TransitionProps & { - children: React.ReactElement; + children: ReactElement; }, - ref: React.Ref + ref: Ref ) { return ; }); export const ManageMembers = ({ - address, open, setOpen, selectedGroup, - isAdmin, - isOwner + isOwner, }) => { - const [membersWithNames, setMembersWithNames] = React.useState([]); - const [tab, setTab] = React.useState("create"); - const [value, setValue] = React.useState(0); - const [openSnack, setOpenSnack] = React.useState(false); - const [infoSnack, setInfoSnack] = React.useState(null); - const [isLoadingMembers, setIsLoadingMembers] = React.useState(false) - const [isLoadingLeave, setIsLoadingLeave] = React.useState(false) - const [groupInfo, setGroupInfo] = React.useState(null) - const handleChange = (event: React.SyntheticEvent, newValue: number) => { + const [membersWithNames, setMembersWithNames] = useState([]); + const [value, setValue] = useState(0); + const [openSnack, setOpenSnack] = useState(false); + const [infoSnack, setInfoSnack] = useState(null); + const [isLoadingMembers, setIsLoadingMembers] = useState(false); + const [isLoadingLeave, setIsLoadingLeave] = useState(false); + const [groupInfo, setGroupInfo] = useState(null); + const handleChange = (event: SyntheticEvent, newValue: number) => { setValue(newValue); }; - const { show, setTxList } = React.useContext(MyContext); + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + const { show } = useContext(QORTAL_APP_CONTEXT); + const setTxList = useSetAtom(txListAtom); const handleClose = () => { setOpen(false); }; - const handleLeaveGroup = async () => { try { - setIsLoadingLeave(true) - const fee = await getFee('LEAVE_GROUP') + setIsLoadingLeave(true); + const fee = await getFee('LEAVE_GROUP'); await show({ - message: "Would you like to perform an LEAVE_GROUP transaction?" , - publishFee: fee.fee + ' QORT' - }) + message: t('core:message.question.perform_transaction', { + action: 'LEAVE_GROUP', + postProcess: 'capitalizeFirstChar', + }), + publishFee: fee.fee + ' QORT', + }); await new Promise((res, rej) => { - window.sendMessage("leaveGroup", { - groupId: selectedGroup?.groupId, - }) + window + .sendMessage('leaveGroup', { + groupId: selectedGroup?.groupId, + }) .then((response) => { if (!response?.error) { setTxList((prev) => [ { ...response, type: 'leave-group', - label: `Left Group ${selectedGroup?.groupName}: awaiting confirmation`, - labelDone: `Left Group ${selectedGroup?.groupName}: success!`, + label: t('group:message.success.group_leave_name', { + group_name: selectedGroup?.groupName, + postProcess: 'capitalizeFirstChar', + }), + labelDone: t('group:message.success.group_leave_label', { + group_name: selectedGroup?.groupName, + postProcess: 'capitalizeFirstChar', + }), done: false, groupId: selectedGroup?.groupId, }, @@ -98,8 +123,10 @@ export const ManageMembers = ({ ]); res(response); setInfoSnack({ - type: "success", - message: "Successfully requested to leave group. It may take a couple of minutes for the changes to propagate", + type: 'success', + message: t('group:message.success.group_leave', { + postProcess: 'capitalizeFirstChar', + }), }); setOpenSnack(true); return; @@ -107,190 +134,282 @@ export const ManageMembers = ({ rej(response.error); }) .catch((error) => { - rej(error.message || "An error occurred"); + rej( + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }) + ); }); - }); - } catch (error) {} finally { - setIsLoadingLeave(false) + } catch (error) { + console.log(error); + } finally { + setIsLoadingLeave(false); } }; - const getMembersWithNames = React.useCallback(async (groupId) => { + const getMembersWithNames = useCallback(async (groupId) => { try { - setIsLoadingMembers(true) + setIsLoadingMembers(true); const res = await getGroupMembers(groupId); const resWithNames = await getNames(res.members); setMembersWithNames(resWithNames); - setIsLoadingMembers(false) - } catch (error) {} + setIsLoadingMembers(false); + } catch (error) { + console.log(error); + } }, []); const getMembers = async (groupId) => { try { const res = await getGroupMembers(groupId); setMembersWithNames(res?.members || []); - } catch (error) {} + } catch (error) { + console.log(error); + } }; + const getGroupInfo = async (groupId) => { try { - const response = await fetch( - `${getBaseApiReact()}/groups/${groupId}` - ); - const groupData = await response.json(); - setGroupInfo(groupData) - } catch (error) {} + const response = await fetch(`${getBaseApiReact()}/groups/${groupId}`); + const groupData = await response.json(); + setGroupInfo(groupData); + } catch (error) { + console.log(error); + } }; - React.useEffect(()=> { - if(selectedGroup?.groupId){ - getMembers(selectedGroup?.groupId) - getGroupInfo(selectedGroup?.groupId) + useEffect(() => { + if (selectedGroup?.groupId) { + getMembers(selectedGroup?.groupId); + getGroupInfo(selectedGroup?.groupId); } - }, [selectedGroup?.groupId]) + }, [selectedGroup?.groupId]); - const openGroupJoinRequestFunc = ()=> { - setValue(4) - } + const openGroupJoinRequestFunc = () => { + setValue(4); + }; - React.useEffect(() => { - subscribeToEvent("openGroupJoinRequest", openGroupJoinRequestFunc); + useEffect(() => { + subscribeToEvent('openGroupJoinRequest', openGroupJoinRequestFunc); return () => { - unsubscribeFromEvent("openGroupJoinRequest", openGroupJoinRequestFunc); + unsubscribeFromEvent('openGroupJoinRequest', openGroupJoinRequestFunc); }; }, []); return ( - + - + - - Manage Members + + {t('group:action.manage_members', { + postProcess: 'capitalizeFirstChar', + })} + + - - - - - - - - + + + + + + + + + + + + - + + - GroupId: {groupInfo?.groupId} - GroupName: {groupInfo?.groupName} - Number of members: {groupInfo?.memberCount} + + {t('group:group.id', { postProcess: 'capitalizeFirstChar' })}:{' '} + {groupInfo?.groupId} + + + + {t('group:group.name', { postProcess: 'capitalizeFirstChar' })}:{' '} + {groupInfo?.groupName} + + + + {t('group:group.member_number', { + postProcess: 'capitalizeFirstChar', + })} + : {groupInfo?.memberCount} + + + { + const link = `qortal://use-group/action-join/groupid-${groupInfo?.groupId}`; + await navigator.clipboard.writeText(link); + }} + > + + + + {t('group:join_link', { postProcess: 'capitalizeFirstChar' })} + + - - {selectedGroup?.groupId && !isOwner && ( - - Leave Group - - )} + + + + {selectedGroup?.groupId && !isOwner && ( + + {t('group:action.leave_group', { + postProcess: 'capitalizeFirstChar', + })} + + )} + {value === 0 && ( - + + + )} - {value === 1 && ( + + {value === 1 && ( - + )} {value === 2 && ( - - + )} {value === 3 && ( - + )} - + {value === 4 && ( - + )} - + + + - - + ); }; diff --git a/src/components/Group/QMailMessages.tsx b/src/components/Group/QMailMessages.tsx index c2d7370..93d96cb 100644 --- a/src/components/Group/QMailMessages.tsx +++ b/src/components/Group/QMailMessages.tsx @@ -1,279 +1,320 @@ -import React, { useCallback, useEffect, useMemo, useState } from 'react' -import List from "@mui/material/List"; -import ListItem from "@mui/material/ListItem"; -import ListItemButton from "@mui/material/ListItemButton"; -import ListItemIcon from "@mui/material/ListItemIcon"; -import ListItemText from "@mui/material/ListItemText"; -import moment from 'moment' -import { Box, ButtonBase, Collapse, Typography } from "@mui/material"; -import { Spacer } from "../../common/Spacer"; -import { getBaseApiReact, isMobile } from "../../App"; -import { MessagingIcon } from '../../assets/Icons/MessagingIcon'; +import { useCallback, useEffect, useMemo, useState } from 'react'; +import List from '@mui/material/List'; +import ListItem from '@mui/material/ListItem'; +import ListItemButton from '@mui/material/ListItemButton'; +import ListItemIcon from '@mui/material/ListItemIcon'; +import ListItemText from '@mui/material/ListItemText'; +import moment from 'moment'; +import { Box, ButtonBase, Collapse, Typography, useTheme } from '@mui/material'; +import { getBaseApiReact } from '../../App'; import MailIcon from '@mui/icons-material/Mail'; import MailOutlineIcon from '@mui/icons-material/MailOutline'; import { executeEvent } from '../../utils/events'; import { CustomLoader } from '../../common/CustomLoader'; -import { useRecoilState } from 'recoil'; import { mailsAtom, qMailLastEnteredTimestampAtom } from '../../atoms/global'; import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; import ExpandLessIcon from '@mui/icons-material/ExpandLess'; import MarkEmailUnreadIcon from '@mui/icons-material/MarkEmailUnread'; +import { useAtom } from 'jotai'; +import { useTranslation } from 'react-i18next'; + export const isLessThanOneWeekOld = (timestamp) => { // Current time in milliseconds const now = Date.now(); - + // One week ago in milliseconds (7 days * 24 hours * 60 minutes * 60 seconds * 1000 milliseconds) - const oneWeekAgo = now - (7 * 24 * 60 * 60 * 1000); - + const oneWeekAgo = now - 7 * 24 * 60 * 60 * 1000; + // Check if the timestamp is newer than one week ago return timestamp > oneWeekAgo; }; + export function formatEmailDate(timestamp: number) { - const date = moment(timestamp); - const now = moment(); + const date = moment(timestamp); + const now = moment(); - if (date.isSame(now, 'day')) { - // If the email was received today, show the time - return date.format('h:mm A'); - } else if (date.isSame(now, 'year')) { - // If the email was received this year, show the month and day - return date.format('MMM D'); - } else { - // For older emails, show the full date - return date.format('MMM D, YYYY'); - } + if (date.isSame(now, 'day')) { + // If the email was received today, show the time + return date.format('h:mm A'); + } else if (date.isSame(now, 'year')) { + // If the email was received this year, show the month and day + return date.format('MMM D'); + } else { + // For older emails, show the full date + return date.format('MMM D, YYYY'); + } } -export const QMailMessages = ({userName, userAddress}) => { - const [isExpanded, setIsExpanded] = useState(false) - const [mails, setMails] = useRecoilState(mailsAtom) - const [lastEnteredTimestamp, setLastEnteredTimestamp] = useRecoilState(qMailLastEnteredTimestampAtom) - const [loading, setLoading] = useState(true) - const getMails = useCallback(async () => { - try { - setLoading(true) - const query = `qortal_qmail_${userName.slice( - 0, - 20 - )}_${userAddress.slice(-6)}_mail_` - const response = await fetch(`${getBaseApiReact()}/arbitrary/resources/search?service=MAIL_PRIVATE&query=${query}&limit=10&includemetadata=false&offset=0&reverse=true&excludeblocked=true&mode=ALL`); - const mailData = await response.json(); - - - setMails(mailData); - } catch (error) { - console.error(error); - } finally { - setLoading(false) +export const QMailMessages = ({ userName, userAddress }) => { + const [isExpanded, setIsExpanded] = useState(false); + const [mails, setMails] = useAtom(mailsAtom); + const [lastEnteredTimestamp, setLastEnteredTimestamp] = useAtom( + qMailLastEnteredTimestampAtom + ); - } - }, []) + const [loading, setLoading] = useState(true); + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); - const getTimestamp = async () => { - try { - return new Promise((res, rej) => { - window.sendMessage("getEnteredQmailTimestamp") - .then((response) => { - if (!response?.error) { - if(response?.timestamp){ - setLastEnteredTimestamp(response?.timestamp) - } + const getMails = useCallback(async () => { + try { + setLoading(true); + const query = `qortal_qmail_${userName.slice( + 0, + 20 + )}_${userAddress.slice(-6)}_mail_`; + const response = await fetch( + `${getBaseApiReact()}/arbitrary/resources/search?service=MAIL_PRIVATE&query=${query}&limit=10&includemetadata=false&offset=0&reverse=true&excludeblocked=true&mode=ALL` + ); + const mailData = await response.json(); + + setMails(mailData); + } catch (error) { + console.error(error); + } finally { + setLoading(false); + } + }, []); + + const getTimestamp = async () => { + try { + return new Promise((res, rej) => { + window + .sendMessage('getEnteredQmailTimestamp') + .then((response) => { + if (!response?.error) { + if (response?.timestamp) { + setLastEnteredTimestamp(response?.timestamp); } - rej(response.error); - }) - .catch((error) => { - rej(error.message || "An error occurred"); - }); - + } + rej(response.error); + }) + .catch((error) => { + rej( + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }) + ); }); - } catch (error) {} - }; - - useEffect(() => { - getTimestamp() - if(!userName || !userAddress) return - getMails(); + }); + } catch (error) { + console.log(error); + } + }; - const interval = setInterval(() => { - getTimestamp() - getMails(); - }, 300000); - - return () => clearInterval(interval); - - }, [getMails, userName, userAddress]); + useEffect(() => { + getTimestamp(); + if (!userName || !userAddress) return; + getMails(); - const anyUnread = useMemo(()=> { - let unread = false - - mails.forEach((mail)=> { - if(!lastEnteredTimestamp && isLessThanOneWeekOld(mail?.created) || (lastEnteredTimestamp && isLessThanOneWeekOld(mail?.created) && lastEnteredTimestamp < mail?.created)){ - unread = true - } - }) - return unread - }, [mails, lastEnteredTimestamp]) + const interval = setInterval(() => { + getTimestamp(); + getMails(); + }, 300000); + + return () => clearInterval(interval); + }, [getMails, userName, userAddress]); + + const anyUnread = useMemo(() => { + let unread = false; + + mails.forEach((mail) => { + if ( + (!lastEnteredTimestamp && isLessThanOneWeekOld(mail?.created)) || + (lastEnteredTimestamp && + isLessThanOneWeekOld(mail?.created) && + lastEnteredTimestamp < mail?.created) + ) { + unread = true; + } + }); + return unread; + }, [mails, lastEnteredTimestamp]); return ( - - setIsExpanded((prev)=> !prev)} > - setIsExpanded((prev) => !prev)} > - Latest Q-Mails - - - {isExpanded ? : ( - - )} - - - - {loading && mails.length === 0 && ( - + {t('group:latest_mails', { postProcess: 'capitalizeFirstChar' })} + + + + {isExpanded ? ( + - - + /> + ) : ( + )} - {!loading && mails.length === 0 && ( - - + + + + {loading && mails.length === 0 && ( + - Nothing to display - - - )} - - - {mails?.map((mail)=> { - return ( - { - executeEvent("addTab", { data: { service: 'APP', name: 'q-mail' } }); - executeEvent("open-apps-mode", { }); - setLastEnteredTimestamp(Date.now()) + + + )} + {!loading && mails.length === 0 && ( + + + {t('group:message.generic.no_display', { + postProcess: 'capitalizeFirstChar', + })} + + + )} + + + {mails?.map((mail) => { + return ( + { + executeEvent('addTab', { + data: { service: 'APP', name: 'q-mail' }, + }); + executeEvent('open-apps-mode', {}); + setLastEnteredTimestamp(Date.now()); + }} + > + - + - - - {!lastEnteredTimestamp && isLessThanOneWeekOld(mail?.created) ? ( - - ) : !lastEnteredTimestamp ? ( - - ): (lastEnteredTimestamp < mail?.created) && isLessThanOneWeekOld(mail?.created) ? ( - - ) : ( - - ) - } - - - - - - - ) + {!lastEnteredTimestamp && + isLessThanOneWeekOld(mail?.created) ? ( + + ) : !lastEnteredTimestamp ? ( + + ) : lastEnteredTimestamp < mail?.created && + isLessThanOneWeekOld(mail?.created) ? ( + + ) : ( + + )} + + + + ); })} - - - - - + + + - - - ) -} + ); +}; diff --git a/src/components/Group/Settings.tsx b/src/components/Group/Settings.tsx index 2aba6f6..e94c957 100644 --- a/src/components/Group/Settings.tsx +++ b/src/components/Group/Settings.tsx @@ -1,39 +1,46 @@ -import * as React from "react"; -import Button from "@mui/material/Button"; -import Dialog from "@mui/material/Dialog"; -import ListItemText from "@mui/material/ListItemText"; -import ListItemButton from "@mui/material/ListItemButton"; -import List from "@mui/material/List"; -import Divider from "@mui/material/Divider"; -import AppBar from "@mui/material/AppBar"; -import Toolbar from "@mui/material/Toolbar"; -import IconButton from "@mui/material/IconButton"; -import Typography from "@mui/material/Typography"; -import CloseIcon from "@mui/icons-material/Close"; -import Slide from "@mui/material/Slide"; -import { TransitionProps } from "@mui/material/transitions"; -import ListOfMembers from "./ListOfMembers"; -import { InviteMember } from "./InviteMember"; -import { ListOfInvites } from "./ListOfInvites"; -import { ListOfBans } from "./ListOfBans"; -import { ListOfJoinRequests } from "./ListOfJoinRequests"; -import { Box, FormControlLabel, Switch, Tab, Tabs, styled } from "@mui/material"; -import { CustomizedSnackbars } from "../Snackbar/Snackbar"; -import { MyContext, isMobile } from "../../App"; -import { getGroupMembers, getNames } from "./Group"; -import { LoadingSnackbar } from "../Snackbar/LoadingSnackbar"; -import { getFee } from "../../background"; -import { LoadingButton } from "@mui/lab"; -import { subscribeToEvent, unsubscribeFromEvent } from "../../utils/events"; -import { enabledDevModeAtom } from "../../atoms/global"; -import { useRecoilState } from "recoil"; - -function a11yProps(index: number) { - return { - id: `simple-tab-${index}`, - "aria-controls": `simple-tabpanel-${index}`, - }; -} +import { + ChangeEvent, + forwardRef, + Fragment, + ReactElement, + Ref, + useContext, + useEffect, + useState, +} from 'react'; +import Dialog from '@mui/material/Dialog'; +import AppBar from '@mui/material/AppBar'; +import Toolbar from '@mui/material/Toolbar'; +import IconButton from '@mui/material/IconButton'; +import Typography from '@mui/material/Typography'; +import CloseIcon from '@mui/icons-material/Close'; +import Slide from '@mui/material/Slide'; +import { TransitionProps } from '@mui/material/transitions'; +import ContentCopyIcon from '@mui/icons-material/ContentCopy'; +import { + Box, + Button, + DialogActions, + DialogContent, + DialogContentText, + DialogTitle, + FormControlLabel, + Switch, + TextField, + styled, + useTheme, +} from '@mui/material'; +import { enabledDevModeAtom } from '../../atoms/global'; +import ThemeManager from '../Theme/ThemeManager'; +import { useAtom } from 'jotai'; +import { decryptStoredWallet } from '../../utils/decryptWallet'; +import { Spacer } from '../../common/Spacer'; +import PhraseWallet from '../../utils/generateWallet/phrase-wallet'; +import { walletVersion } from '../../background/background.ts'; +import Base58 from '../../encryption/Base58.ts'; +import { QORTAL_APP_CONTEXT } from '../../App'; +import { useTranslation } from 'react-i18next'; +import { TransitionUp } from '../../common/Transitions.tsx'; const LocalNodeSwitch = styled(Switch)(({ theme }) => ({ padding: 8, @@ -49,13 +56,13 @@ const LocalNodeSwitch = styled(Switch)(({ theme }) => ({ }, '&::before': { backgroundImage: `url('data:image/svg+xml;utf8,')`, left: 12, }, '&::after': { backgroundImage: `url('data:image/svg+xml;utf8,')`, right: 12, }, @@ -68,44 +75,40 @@ const LocalNodeSwitch = styled(Switch)(({ theme }) => ({ }, })); -const Transition = React.forwardRef(function Transition( - props: TransitionProps & { - children: React.ReactElement; - }, - ref: React.Ref -) { - return ; -}); +export const Settings = ({ open, setOpen, rawWallet }) => { + const [checked, setChecked] = useState(false); + const [isEnabledDevMode, setIsEnabledDevMode] = useAtom(enabledDevModeAtom); + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); -export const Settings = ({ - address, - open, - setOpen, -}) => { - const [checked, setChecked] = React.useState(false); - const [isEnabledDevMode, setIsEnabledDevMode] = useRecoilState(enabledDevModeAtom) - - - - const handleChange = (event: React.ChangeEvent) => { + const handleChange = (event: ChangeEvent) => { setChecked(event.target.checked); - window.sendMessage("addUserSettings", { - keyValue: { - key: 'disable-push-notifications', - value: event.target.checked, - }, - }) + window + .sendMessage('addUserSettings', { + keyValue: { + key: 'disable-push-notifications', + value: event.target.checked, + }, + }) .then((response) => { if (response?.error) { - console.error("Error adding user settings:", response.error); + console.error('Error adding user settings:', response.error); } else { - console.log("User settings added successfully"); + console.log('User settings added successfully'); } }) .catch((error) => { - console.error("Failed to add user settings:", error.message || "An error occurred"); + console.error( + 'Failed to add user settings:', + error.message || 'An error occurred' + ); }); - }; const handleClose = () => { @@ -115,9 +118,10 @@ export const Settings = ({ const getUserSettings = async () => { try { return new Promise((res, rej) => { - window.sendMessage("getUserSettings", { - key: "disable-push-notifications", - }) + window + .sendMessage('getUserSettings', { + key: 'disable-push-notifications', + }) .then((response) => { if (!response?.error) { setChecked(response || false); @@ -127,81 +131,264 @@ export const Settings = ({ rej(response.error); }) .catch((error) => { - rej(error.message || "An error occurred"); + rej( + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }) + ); }); - }); } catch (error) { - console.log("error", error); + console.log('error', error); } }; - React.useEffect(() => { + useEffect(() => { getUserSettings(); - }, []); - - + }); return ( - + - + - - General Settings + + {t('core:general_settings', { + postProcess: 'capitalizeFirstChar', + })} + + } - label="Disable all push notifications" + label={t('group:action.disable_push_notifications', { + postProcess: 'capitalizeFirstChar', + })} /> + {window?.electronAPI && ( { - setIsEnabledDevMode(e.target.checked) - localStorage.setItem('isEnabledDevMode', JSON.stringify(e.target.checked)) - }} /> - } - label="Enable dev mode" - /> + control={ + { + setIsEnabledDevMode(e.target.checked); + localStorage.setItem( + 'isEnabledDevMode', + JSON.stringify(e.target.checked) + ); + }} + /> + } + label={t('core:action.enable_dev_mode', { + postProcess: 'capitalizeFirstChar', + })} + /> )} + + {isEnabledDevMode && } + - + + ); +}; + +const ExportPrivateKey = ({ rawWallet }) => { + const [password, setPassword] = useState(''); + const [privateKey, setPrivateKey] = useState(''); + const [isOpen, setIsOpen] = useState(false); + const { setOpenSnackGlobal, setInfoSnackCustom } = + useContext(QORTAL_APP_CONTEXT); + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + + const exportPrivateKeyFunc = async () => { + try { + setInfoSnackCustom({ + type: 'info', + message: t('group:message.generic.descrypt_wallet', { + postProcess: 'capitalizeFirstChar', + }), + }); + + setOpenSnackGlobal(true); + const wallet = structuredClone(rawWallet); + + const res = await decryptStoredWallet(password, wallet); + const wallet2 = new PhraseWallet(res, wallet?.version || walletVersion); + + const keyPair = Base58.encode(wallet2._addresses[0].keyPair.privateKey); + setPrivateKey(keyPair); + setInfoSnackCustom({ + type: '', + message: '', + }); + + setOpenSnackGlobal(false); + } catch (error) { + setInfoSnackCustom({ + type: 'error', + message: error?.message + ? t('group:message.error.decrypt_wallet', { + message: error?.message, + postProcess: 'capitalizeFirstChar', + }) + : t('group:message.error.descrypt_wallet', { + postProcess: 'capitalizeFirstChar', + }), + }); + + setOpenSnackGlobal(true); + } + }; + + return ( + <> + + + + + {t('group:action.export_password', { + postProcess: 'capitalizeFirstChar', + })} + + + + + {t('group:message.generic.secure_place', { + postProcess: 'capitalizeFirstChar', + })} + + + + + setPassword(e.target.value)} + /> + + {privateKey && ( + + )} + + + + + + + + + ); }; diff --git a/src/components/Group/ThingsToDoInitial.tsx b/src/components/Group/ThingsToDoInitial.tsx index 367b3b1..f7c0466 100644 --- a/src/components/Group/ThingsToDoInitial.tsx +++ b/src/components/Group/ThingsToDoInitial.tsx @@ -1,230 +1,201 @@ -import * as React from "react"; -import List from "@mui/material/List"; -import ListItem from "@mui/material/ListItem"; -import ListItemButton from "@mui/material/ListItemButton"; -import ListItemIcon from "@mui/material/ListItemIcon"; -import ListItemText from "@mui/material/ListItemText"; -import Checkbox from "@mui/material/Checkbox"; -import IconButton from "@mui/material/IconButton"; -import CommentIcon from "@mui/icons-material/Comment"; -import InfoIcon from "@mui/icons-material/Info"; -import { Box, Typography } from "@mui/material"; -import { Spacer } from "../../common/Spacer"; -import { isMobile } from "../../App"; -import { QMailMessages } from "./QMailMessages"; -import { executeEvent } from "../../utils/events"; +import { useEffect, useMemo, useState } from 'react'; +import List from '@mui/material/List'; +import ListItem from '@mui/material/ListItem'; +import ListItemButton from '@mui/material/ListItemButton'; +import ListItemIcon from '@mui/material/ListItemIcon'; +import ListItemText from '@mui/material/ListItemText'; +import { Box, Typography, useTheme } from '@mui/material'; +import { Spacer } from '../../common/Spacer'; +import { QMailMessages } from './QMailMessages'; +import { executeEvent } from '../../utils/events'; +import { useTranslation } from 'react-i18next'; -export const ThingsToDoInitial = ({ myAddress, name, hasGroups, balance, userInfo }) => { - const [checked1, setChecked1] = React.useState(false); - const [checked2, setChecked2] = React.useState(false); - // const [checked3, setChecked3] = React.useState(false); +export const ThingsToDoInitial = ({ + myAddress, + name, + hasGroups, + balance, + userInfo, +}) => { + const [checked1, setChecked1] = useState(false); + const [checked2, setChecked2] = useState(false); + const { t } = useTranslation(['core', 'tutorial']); + const theme = useTheme(); - // React.useEffect(() => { - // if (hasGroups) setChecked3(true); - // }, [hasGroups]); - - - React.useEffect(() => { + useEffect(() => { if (balance && +balance >= 6) { setChecked1(true); } }, [balance]); - - React.useEffect(() => { + useEffect(() => { if (name) setChecked2(true); }, [name]); + const isLoaded = useMemo(() => { + if (userInfo !== null) return true; + return false; + }, [userInfo]); - const isLoaded = React.useMemo(()=> { - if(userInfo !== null) return true - return false - }, [ userInfo]) + const hasDoneNameAndBalanceAndIsLoaded = useMemo(() => { + if (isLoaded && checked1 && checked2) return true; + return false; + }, [checked1, isLoaded, checked2]); - const hasDoneNameAndBalanceAndIsLoaded = React.useMemo(()=> { - if(isLoaded && checked1 && checked2) return true - return false -}, [checked1, isLoaded, checked2]) - -if(hasDoneNameAndBalanceAndIsLoaded){ - return ( - - ); -} -if(!isLoaded) return null + if (hasDoneNameAndBalanceAndIsLoaded) { + return ( + + ); + } + if (!isLoaded) return null; return ( - {!isLoaded ? 'Loading...' : 'Getting Started' } + {!isLoaded + ? t('core:loading.generic', { postProcess: 'capitalizeFirstChar' }) + : t('tutorial:initial.getting_started', { + postProcess: 'capitalizeFirstChar', + })} + {isLoaded && ( - - - { - executeEvent("openBuyQortInfo", {}) - }} - > - - - - {/* */} - - - - - // - // - // } - disablePadding - > - - - { - executeEvent('openRegisterName', {}) - }} sx={{ - "& .MuiTypography-root": { - fontSize: "1rem", - fontWeight: 400, - }, - }} primary={`Register a name`} /> - - - - - - {/* - - - - - - - - */} - + + + { + executeEvent('openBuyQortInfo', {}); + }} + > + + + + + + + + + + + { + executeEvent('openRegisterName', {}); + }} + sx={{ + '& .MuiTypography-root': { + fontSize: '1rem', + fontWeight: 400, + }, + }} + primary={t('tutorial:initial.register_name', { + postProcess: 'capitalizeFirstChar', + })} + /> + + + + + + )} - ); diff --git a/src/components/Group/UserListOfInvites.tsx b/src/components/Group/UserListOfInvites.tsx index 2a63896..d28d514 100644 --- a/src/components/Group/UserListOfInvites.tsx +++ b/src/components/Group/UserListOfInvites.tsx @@ -1,240 +1,305 @@ -import { Box, Button, ListItem, ListItemButton, ListItemText, Popover, Typography } from '@mui/material'; -import React, { useContext, useEffect, useRef, useState } from 'react' -import { AutoSizer, CellMeasurer, CellMeasurerCache, List } from 'react-virtualized'; -import { MyContext, getBaseApiReact } from '../../App'; +import { + Box, + ListItem, + ListItemButton, + ListItemText, + Popover, + Typography, + useTheme, +} from '@mui/material'; +import { useContext, useEffect, useRef, useState } from 'react'; +import { + AutoSizer, + CellMeasurer, + CellMeasurerCache, + List, +} from 'react-virtualized'; +import { QORTAL_APP_CONTEXT, getBaseApiReact } from '../../App'; import { LoadingButton } from '@mui/lab'; -import { getBaseApi, getFee } from '../../background'; +import { getFee } from '../../background/background.ts'; import LockIcon from '@mui/icons-material/Lock'; import NoEncryptionGmailerrorredIcon from '@mui/icons-material/NoEncryptionGmailerrorred'; -import { Spacer } from "../../common/Spacer"; +import { Spacer } from '../../common/Spacer'; +import { useSetAtom } from 'jotai'; +import { txListAtom } from '../../atoms/global'; +import { useTranslation } from 'react-i18next'; const cache = new CellMeasurerCache({ - fixedWidth: true, - defaultHeight: 50, - }); + fixedWidth: true, + defaultHeight: 50, +}); - - -const getGroupInfo = async (groupId)=> { +const getGroupInfo = async (groupId) => { const response = await fetch(`${getBaseApiReact()}/groups/` + groupId); const groupData = await response.json(); if (groupData) { - return groupData - } -} - export const getGroupNames = async (listOfGroups) => { - let groups = []; - if (listOfGroups && Array.isArray(listOfGroups)) { - for (const group of listOfGroups) { - - const groupInfo = await getGroupInfo(group.groupId); - if (groupInfo) { - groups.push({ ...group, ...groupInfo }); - - } - } - } - return groups; + return groupData; } - -export const UserListOfInvites = ({myAddress, setInfoSnack, setOpenSnack}) => { - const {txList, setTxList, show} = useContext(MyContext) - const [invites, setInvites] = useState([]); - const [isLoading, setIsLoading] = useState(false); - - const [popoverAnchor, setPopoverAnchor] = useState(null); // Track which list item the popover is anchored to - const [openPopoverIndex, setOpenPopoverIndex] = useState(null); // Track which list item has the popover open - const listRef = useRef(); - - const getRequests = async () => { - try { - const response = await fetch(`${getBaseApiReact()}/groups/invites/${myAddress}/?limit=0`); - const inviteData = await response.json(); - - const resMoreData = await getGroupNames(inviteData) - setInvites(resMoreData); - } catch (error) { - console.error(error); +}; +export const getGroupNames = async (listOfGroups) => { + let groups = []; + if (listOfGroups && Array.isArray(listOfGroups)) { + for (const group of listOfGroups) { + const groupInfo = await getGroupInfo(group.groupId); + if (groupInfo) { + groups.push({ ...group, ...groupInfo }); } } - - useEffect(() => { - - getRequests(); - - }, []); - - const handlePopoverOpen = (event, index) => { - setPopoverAnchor(event.currentTarget); - setOpenPopoverIndex(index); - }; - - const handlePopoverClose = () => { - setPopoverAnchor(null); - setOpenPopoverIndex(null); - }; - - const handleJoinGroup = async (groupId, groupName)=> { - try { - - const fee = await getFee('JOIN_GROUP') - await show({ - message: "Would you like to perform an JOIN_GROUP transaction?" , - publishFee: fee.fee + ' QORT' - }) + } + return groups; +}; - setIsLoading(true); +export const UserListOfInvites = ({ + myAddress, + setInfoSnack, + setOpenSnack, +}) => { + const { show } = useContext(QORTAL_APP_CONTEXT); + const setTxList = useSetAtom(txListAtom); - await new Promise((res, rej)=> { - window.sendMessage("joinGroup", { + const [invites, setInvites] = useState([]); + const [isLoading, setIsLoading] = useState(false); + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + const [popoverAnchor, setPopoverAnchor] = useState(null); // Track which list item the popover is anchored to + const [openPopoverIndex, setOpenPopoverIndex] = useState(null); // Track which list item has the popover open + const listRef = useRef(null); + + const getRequests = async () => { + try { + const response = await fetch( + `${getBaseApiReact()}/groups/invites/${myAddress}/?limit=0` + ); + const inviteData = await response.json(); + + const resMoreData = await getGroupNames(inviteData); + setInvites(resMoreData); + } catch (error) { + console.error(error); + } + }; + + useEffect(() => { + getRequests(); + }, []); + + const handlePopoverOpen = (event, index) => { + setPopoverAnchor(event.currentTarget); + setOpenPopoverIndex(index); + }; + + const handlePopoverClose = () => { + setPopoverAnchor(null); + setOpenPopoverIndex(null); + }; + + const handleJoinGroup = async (groupId, groupName) => { + try { + const fee = await getFee('JOIN_GROUP'); + + await show({ + message: t('core:message.question.perform_transaction', { + action: 'JOIN_GROUP', + postProcess: 'capitalizeFirstChar', + }), + publishFee: fee.fee + ' QORT', + }); + + setIsLoading(true); + + await new Promise((res, rej) => { + window + .sendMessage('joinGroup', { groupId, }) - .then((response) => { - if (!response?.error) { - setTxList((prev) => [ - { - ...response, - type: 'joined-group', - label: `Joined Group ${groupName}: awaiting confirmation`, - labelDone: `Joined Group ${groupName}: success!`, - done: false, - groupId, - }, - ...prev, - ]); - res(response); - setInfoSnack({ - type: "success", - message: "Successfully requested to join group. It may take a couple of minutes for the changes to propagate", - }); - setOpenSnack(true); - handlePopoverClose(); - return; - } + .then((response) => { + if (!response?.error) { + setTxList((prev) => [ + { + ...response, + type: 'joined-group', + label: `Joined Group ${groupName}: awaiting confirmation`, + labelDone: `Joined Group ${groupName}: success!`, + done: false, + groupId, + }, + ...prev, + ]); + res(response); setInfoSnack({ - type: "error", - message: response?.error, + type: 'success', + message: t('group:message.success.group_join', { + postProcess: 'capitalizeFirstChar', + }), }); setOpenSnack(true); - rej(response.error); - }) - .catch((error) => { - setInfoSnack({ - type: "error", - message: error.message || "An error occurred", - }); - setOpenSnack(true); - rej(error); + handlePopoverClose(); + return; + } + setInfoSnack({ + type: 'error', + message: response?.error, }); - - }) - - } catch (error) { - - } finally { - setIsLoading(false); - - } + setOpenSnack(true); + rej(response.error); + }) + .catch((error) => { + setInfoSnack({ + type: 'error', + message: + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }), + }); + setOpenSnack(true); + rej(error); + }); + }); + } catch (error) { + console.log(error); + } finally { + setIsLoading(false); } - - const rowRenderer = ({ index, key, parent, style }) => { - const invite = invites[index]; - - return ( - - {({ measure }) => ( -
- - - { + const invite = invites[index]; + + return ( + + {({ measure }) => ( +
+ + + - Join {invite?.groupName} - + {t('core:action.join', { + postProcess: 'capitalizeFirstChar', + })}{' '} + {invite?.groupName} + + + handleJoinGroup(invite?.groupId, invite?.groupName)}>Join group - - - handlePopoverOpen(event, index)}> + variant="contained" + onClick={() => + handleJoinGroup(invite?.groupId, invite?.groupName) + } + > + {t('group:action.join_group', { + postProcess: 'capitalizeFirstChar', + })} + + + + + handlePopoverOpen(event, index)} + > {invite?.isOpen === false && ( - + + )} + {invite?.isOpen === true && ( + + )} + + + + + + +
)} - {invite?.isOpen === true && ( - - )} - - - -
-
- )} -
- ); - }; - - return ( - + ); + }; + + return ( + -

Invite list

-
+

+ {t('core:list.invites', { + postProcess: 'capitalizeFirstChar', + })} +

+ +
- - {({ height, width }) => ( - - )} - -
- - ); -} + + {({ height, width }) => ( + + )} + +
+
+ ); +}; diff --git a/src/components/Group/WalletsAppWrapper.tsx b/src/components/Group/WalletsAppWrapper.tsx index 788a36a..990544d 100644 --- a/src/components/Group/WalletsAppWrapper.tsx +++ b/src/components/Group/WalletsAppWrapper.tsx @@ -1,37 +1,39 @@ -import { Box, ButtonBase, Divider, Typography } from "@mui/material"; -import React, { - useCallback, - useEffect, - useMemo, - useRef, - useState, -} from "react"; -import CloseIcon from "@mui/icons-material/Close"; -import AppViewerContainer from "../Apps/AppViewerContainer"; +import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; +import { Box, ButtonBase, Divider, Typography, useTheme } from '@mui/material'; +import CloseIcon from '@mui/icons-material/Close'; +import AppViewerContainer from '../Apps/AppViewerContainer'; import { executeEvent, subscribeToEvent, unsubscribeFromEvent, -} from "../../utils/events"; -import { useRecoilState } from "recoil"; -import { navigationControllerAtom } from "../../atoms/global"; -import { AppsNavBarLeft, AppsNavBarParent } from "../Apps/Apps-styles"; -import NavBack from "../../assets/svgs/NavBack.svg"; -import RefreshIcon from "@mui/icons-material/Refresh"; +} from '../../utils/events'; +import { navigationControllerAtom } from '../../atoms/global'; +import { AppsNavBarLeft, AppsNavBarParent } from '../Apps/Apps-styles'; +import { NavBack } from '../../assets/Icons/NavBack.tsx'; +import RefreshIcon from '@mui/icons-material/Refresh'; +import { useAtom } from 'jotai'; +import { useTranslation } from 'react-i18next'; export const WalletsAppWrapper = () => { + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); const iframeRef = useRef(null); const [isOpen, setIsOpen] = useState(false); - const [navigationController, setNavigationController] = useRecoilState( + const [navigationController, setNavigationController] = useAtom( navigationControllerAtom ); const [selectedTab, setSelectedTab] = useState({ - tabId: "5558589", - name: "Q-Wallets", - service: "APP", - path: 'qortal?authOnMount=true' + tabId: '5558589', + name: 'Q-Wallets', + service: 'APP', + path: 'qortal?authOnMount=true', }); - + const theme = useTheme(); const isDisableBackButton = useMemo(() => { if (selectedTab && navigationController[selectedTab?.tabId]?.hasBack) return false; @@ -48,64 +50,68 @@ export const WalletsAppWrapper = () => { ); useEffect(() => { - subscribeToEvent("openWalletsApp", openWalletsAppFunc); + subscribeToEvent('openWalletsApp', openWalletsAppFunc); return () => { - unsubscribeFromEvent("openWalletsApp", openWalletsAppFunc); + unsubscribeFromEvent('openWalletsApp', openWalletsAppFunc); }; }, [openWalletsAppFunc]); - const handleClose = ()=> { + const handleClose = () => { setIsOpen(false); - iframeRef.current = null - } + iframeRef.current = null; + }; return ( <> {isOpen && ( - Q-Wallets - + + {t('core:q_apps.q_wallets', { + postProcess: 'capitalizeFirstChar', + })} + + + + + { ref={iframeRef} skipAuth={true} /> + - + { executeEvent(`navigateBackApp-${selectedTab?.tabId}`, {}); @@ -124,31 +133,31 @@ export const WalletsAppWrapper = () => { disabled={isDisableBackButton} sx={{ opacity: !isDisableBackButton ? 1 : 0.1, - cursor: !isDisableBackButton ? "pointer" : "default", + cursor: !isDisableBackButton ? 'pointer' : 'default', }} > - + - { - if (selectedTab?.refreshFunc) { - selectedTab.refreshFunc(selectedTab?.tabId); - - } else { - executeEvent("refreshApp", { - tabId: selectedTab?.tabId, - }); - } - - - }}> - + + { + if (selectedTab?.refreshFunc) { + selectedTab.refreshFunc(selectedTab?.tabId); + } else { + executeEvent('refreshApp', { + tabId: selectedTab?.tabId, + }); + } + }} + > + diff --git a/src/components/Group/WebsocketActive.tsx b/src/components/Group/WebsocketActive.tsx index b9da4d2..01f3ead 100644 --- a/src/components/Group/WebsocketActive.tsx +++ b/src/components/Group/WebsocketActive.tsx @@ -1,12 +1,16 @@ -import React, { useEffect, useRef } from 'react'; -import { getBaseApiReactSocket, pauseAllQueues, resumeAllQueues } from '../../App'; +import { useEffect, useRef } from 'react'; +import { + getBaseApiReactSocket, + pauseAllQueues, + resumeAllQueues, +} from '../../App'; import { subscribeToEvent, unsubscribeFromEvent } from '../../utils/events'; export const WebSocketActive = ({ myAddress, setIsLoadingGroups }) => { const socketRef = useRef(null); // WebSocket reference const timeoutIdRef = useRef(null); // Timeout ID reference const groupSocketTimeoutRef = useRef(null); // Group Socket Timeout reference - const initiateRef = useRef(null) + const initiateRef = useRef(null); const forceCloseWebSocket = () => { if (socketRef.current) { clearTimeout(timeoutIdRef.current); @@ -17,21 +21,20 @@ export const WebSocketActive = ({ myAddress, setIsLoadingGroups }) => { }; const logoutEventFunc = () => { - forceCloseWebSocket() + forceCloseWebSocket(); }; useEffect(() => { - subscribeToEvent("logout-event", logoutEventFunc); + subscribeToEvent('logout-event', logoutEventFunc); return () => { - unsubscribeFromEvent("logout-event", logoutEventFunc); + unsubscribeFromEvent('logout-event', logoutEventFunc); }; }, []); useEffect(() => { if (!myAddress) return; // Only proceed if myAddress is set - const pingHeads = () => { try { if (socketRef.current?.readyState === WebSocket.OPEN) { @@ -53,10 +56,9 @@ export const WebSocketActive = ({ myAddress, setIsLoadingGroups }) => { const currentAddress = myAddress; try { - if(!initiateRef.current) { - setIsLoadingGroups(true) - pauseAllQueues() - + if (!initiateRef.current) { + setIsLoadingGroups(true); + pauseAllQueues(); } const socketLink = `${getBaseApiReactSocket()}/websockets/chat/active/${currentAddress}?encoding=BASE64&haschatreference=false`; socketRef.current = new WebSocket(socketLink); @@ -71,34 +73,45 @@ export const WebSocketActive = ({ myAddress, setIsLoadingGroups }) => { clearTimeout(timeoutIdRef.current); groupSocketTimeoutRef.current = setTimeout(pingHeads, 45000); // Ping every 45 seconds } else { - if(!initiateRef.current) { - setIsLoadingGroups(false) - initiateRef.current = true - resumeAllQueues() - + if (!initiateRef.current) { + setIsLoadingGroups(false); + initiateRef.current = true; + resumeAllQueues(); } const data = JSON.parse(e.data); - const copyGroups = [...(data?.groups || [])] - const findIndex = copyGroups?.findIndex(item => item?.groupId === 0) - if(findIndex !== -1){ + const copyGroups = [...(data?.groups || [])]; + const findIndex = copyGroups?.findIndex( + (item) => item?.groupId === 0 + ); + if (findIndex !== -1) { copyGroups[findIndex] = { ...(copyGroups[findIndex] || {}), - groupId: "0" - } + groupId: '0', + }; } - const filteredGroups = copyGroups - const sortedGroups = filteredGroups.sort((a, b) => (b.timestamp || 0) - (a.timestamp || 0)); - const sortedDirects = (data?.direct || []).filter(item => - item?.name !== 'extension-proxy' && item?.address !== 'QSMMGSgysEuqDCuLw3S4cHrQkBrh3vP3VH' - ).sort((a, b) => (b.timestamp || 0) - (a.timestamp || 0)); + const filteredGroups = copyGroups; + const sortedGroups = filteredGroups.sort( + (a, b) => (b.timestamp || 0) - (a.timestamp || 0) + ); + const sortedDirects = (data?.direct || []) + .filter( + (item) => + item?.name !== 'extension-proxy' && + item?.address !== 'QSMMGSgysEuqDCuLw3S4cHrQkBrh3vP3VH' + ) + .sort((a, b) => (b.timestamp || 0) - (a.timestamp || 0)); - window.sendMessage("handleActiveGroupDataFromSocket", { - groups: sortedGroups, - directs: sortedDirects, - }).catch((error) => { - console.error("Failed to handle active group data from socket:", error.message || "An error occurred"); + window + .sendMessage('handleActiveGroupDataFromSocket', { + groups: sortedGroups, + directs: sortedDirects, + }) + .catch((error) => { + console.error( + 'Failed to handle active group data from socket:', + error.message || 'An error occurred' + ); }); - } } catch (error) { console.error('Error parsing onmessage data:', error); @@ -127,9 +140,7 @@ export const WebSocketActive = ({ myAddress, setIsLoadingGroups }) => { } }; - - initWebsocketMessageGroup(); // Initialize WebSocket on component mount - + initWebsocketMessageGroup(); // Initialize WebSocket on component mount return () => { forceCloseWebSocket(); // Clean up WebSocket on component unmount diff --git a/src/components/Group/useBlockUsers.tsx b/src/components/Group/useBlockUsers.tsx deleted file mode 100644 index 05cbe90..0000000 --- a/src/components/Group/useBlockUsers.tsx +++ /dev/null @@ -1,192 +0,0 @@ -import React, { useCallback, useEffect, useRef } from "react"; -import { getBaseApiReact } from "../../App"; -import { truncate } from "lodash"; - - - -export const useBlockedAddresses = () => { - const userBlockedRef = useRef({}) - const userNamesBlockedRef = useRef({}) - - const getAllBlockedUsers = useCallback(()=> { - - return { - names: userNamesBlockedRef.current, - addresses: userBlockedRef.current - } - }, []) - - const isUserBlocked = useCallback((address, name)=> { - try { - if(!address) return false - if(userBlockedRef.current[address] || userNamesBlockedRef.current[name]) return true - return false - - - } catch (error) { - //error - } - }, []) - - useEffect(()=> { - const fetchBlockedList = async ()=> { - try { - const response = await new Promise((res, rej) => { - window.sendMessage("listActions", { - - type: 'get', - listName: `blockedAddresses`, - - }) - .then((response) => { - if (response.error) { - rej(response?.message); - return; - } else { - res(response); - } - }) - .catch((error) => { - console.error("Failed qortalRequest", error); - }); - }) - const blockedUsers = {} - response?.forEach((item)=> { - blockedUsers[item] = true - }) - userBlockedRef.current = blockedUsers - - const response2 = await new Promise((res, rej) => { - window.sendMessage("listActions", { - - type: 'get', - listName: `blockedNames`, - - }) - .then((response) => { - if (response.error) { - rej(response?.message); - return; - } else { - res(response); - } - }) - .catch((error) => { - console.error("Failed qortalRequest", error); - }); - }) - const blockedUsers2 = {} - response2?.forEach((item)=> { - blockedUsers2[item] = true - }) - userNamesBlockedRef.current = blockedUsers2 - - - } catch (error) { - console.error(error) - } - } - fetchBlockedList() - }, []) - - const removeBlockFromList = useCallback(async (address, name)=> { - await new Promise((res, rej) => { - window.sendMessage("listActions", { - - type: 'remove', - items: name ? [name] : [address], - listName: name ? 'blockedNames' : 'blockedAddresses' - - }) - .then((response) => { - if (response.error) { - rej(response?.message); - return; - } else { - if(!name){ - const copyObject = {...userBlockedRef.current} - delete copyObject[address] - userBlockedRef.current = copyObject - } else { - const copyObject = {...userNamesBlockedRef.current} - delete copyObject[name] - userNamesBlockedRef.current = copyObject - } - - res(response); - } - }) - .catch((error) => { - console.error("Failed qortalRequest", error); - }); - }) - if(name && userBlockedRef.current[address]){ - await new Promise((res, rej) => { - window.sendMessage("listActions", { - - type: 'remove', - items: !name ? [name] : [address], - listName: !name ? 'blockedNames' : 'blockedAddresses' - - }) - .then((response) => { - if (response.error) { - rej(response?.message); - return; - } else { - const copyObject = {...userBlockedRef.current} - delete copyObject[address] - userBlockedRef.current = copyObject - res(response); - } - }) - .catch((error) => { - console.error("Failed qortalRequest", error); - }); - }) - } - - }, []) - - const addToBlockList = useCallback(async (address, name)=> { - await new Promise((res, rej) => { - window.sendMessage("listActions", { - - type: 'add', - items: name ? [name] : [address], - listName: name ? 'blockedNames' : 'blockedAddresses' - - }) - .then((response) => { - if (response.error) { - rej(response?.message); - return; - } else { - if(name){ - - const copyObject = {...userNamesBlockedRef.current} - copyObject[name] = true - userNamesBlockedRef.current = copyObject - }else { - const copyObject = {...userBlockedRef.current} - copyObject[address] = true - userBlockedRef.current = copyObject - - } - - res(response); - } - }) - .catch((error) => { - console.error("Failed qortalRequest", error); - }); - }) - }, []) - - return { - isUserBlocked, - addToBlockList, - removeBlockFromList, - getAllBlockedUsers - }; -}; diff --git a/src/components/Group/useHandleUserInfo.tsx b/src/components/Group/useHandleUserInfo.tsx deleted file mode 100644 index a497259..0000000 --- a/src/components/Group/useHandleUserInfo.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import React, { useCallback, useRef } from "react"; -import { getBaseApiReact } from "../../App"; - - - -export const useHandleUserInfo = () => { - const userInfoRef = useRef({}) - - - const getIndividualUserInfo = useCallback(async (address)=> { - try { - if(!address) return null - if(userInfoRef.current[address] !== undefined) return userInfoRef.current[address] - - const url = `${getBaseApiReact()}/addresses/${address}`; - const response = await fetch(url); - if (!response.ok) { - throw new Error("network error"); - } - const data = await response.json(); - userInfoRef.current = { - ...userInfoRef.current, - [address]: data?.level - } - return data?.level - } catch (error) { - //error - } - }, []) - - return { - getIndividualUserInfo, - }; -}; diff --git a/src/components/Home/NewUsersCTA.tsx b/src/components/Home/NewUsersCTA.tsx deleted file mode 100644 index 4ad5c79..0000000 --- a/src/components/Home/NewUsersCTA.tsx +++ /dev/null @@ -1,91 +0,0 @@ -import { Box, ButtonBase, Typography } from "@mui/material"; -import React from "react"; -import { Spacer } from "../../common/Spacer"; - -export const NewUsersCTA = ({ balance }) => { - if (balance === undefined || +balance > 0) return null; - return ( - - - - - - Are you a new user? - - - - Please message us on Telegram or Discord if you need 4 QORT to start - chatting without any limitations - - - - { - if (window?.electronAPI?.openExternal) { - window.electronAPI.openExternal( - "https://link.qortal.dev/telegram-invite" - ); - } else { - window.open( - "https://link.qortal.dev/telegram-invite", - "_blank" - ); - } - }} - > - Telegram - - { - if (window?.electronAPI?.openExternal) { - window.electronAPI.openExternal( - "https://link.qortal.dev/discord-invite" - ); - } else { - window.open("https://link.qortal.dev/discord-invite", "_blank"); - } - }} - > - Discord - - - - - ); -}; diff --git a/src/components/Language/LanguageSelector.tsx b/src/components/Language/LanguageSelector.tsx new file mode 100644 index 0000000..e15727b --- /dev/null +++ b/src/components/Language/LanguageSelector.tsx @@ -0,0 +1,76 @@ +import { useRef, useState } from 'react'; +import { useTranslation } from 'react-i18next'; +import { supportedLanguages } from '../../i18n/i18n'; +import { + Box, + Button, + FormControl, + MenuItem, + Select, + Tooltip, + useTheme, +} from '@mui/material'; + +const LanguageSelector = () => { + const { i18n, t } = useTranslation(['core']); + const [showSelect, setShowSelect] = useState(false); + const theme = useTheme(); + const selectorRef = useRef(null); + + const handleChange = (e) => { + const newLang = e.target.value; + i18n.changeLanguage(newLang); + setShowSelect(false); + }; + + const currentLang = i18n.language; + const { name, flag } = + supportedLanguages[currentLang] || supportedLanguages['en']; + + return ( + + {!showSelect && ( + + )} + + {showSelect && ( + + + + )} + + ); +}; + +export default LanguageSelector; diff --git a/src/components/Loader.tsx b/src/components/Loader.tsx index 8db908e..dadf8fd 100644 --- a/src/components/Loader.tsx +++ b/src/components/Loader.tsx @@ -1,9 +1,9 @@ -import React from 'react' -import { Box, CircularProgress } from "@mui/material"; +import { Box, CircularProgress } from '@mui/material'; export const Loader = () => { return ( - { height: '100%', position: 'fixed', top: '0px', - left:'0px', + left: '0px', right: '0px', bottom: '0px', zIndex: 10, - background: 'rgba(0, 0, 0, 0.4)' - }}> - + background: 'rgba(0, 0, 0, 0.4)', + }} + > + - ) -} + ); +}; diff --git a/src/components/MainAvatar.tsx b/src/components/MainAvatar.tsx index faca10a..fbacc18 100644 --- a/src/components/MainAvatar.tsx +++ b/src/components/MainAvatar.tsx @@ -1,22 +1,35 @@ -import React, { useContext, useEffect, useState } from "react"; -import Logo2 from "../assets/svgs/Logo2.svg"; -import { MyContext, getArbitraryEndpointReact, getBaseApiReact } from "../App"; -import { Avatar, Box, Button, ButtonBase, Popover, Typography } from "@mui/material"; -import { Spacer } from "../common/Spacer"; -import ImageUploader from "../common/ImageUploader"; -import { getFee } from "../background"; -import { fileToBase64 } from "../utils/fileReading"; -import { LoadingButton } from "@mui/lab"; +import { useContext, useEffect, useState } from 'react'; +import Logo2 from '../assets/svgs/Logo2.svg'; +import { + QORTAL_APP_CONTEXT, + getArbitraryEndpointReact, + getBaseApiReact, +} from '../App'; +import { + Avatar, + Box, + Button, + ButtonBase, + Popover, + Typography, + useTheme, +} from '@mui/material'; +import { Spacer } from '../common/Spacer'; +import ImageUploader from '../common/ImageUploader'; +import { getFee } from '../background/background.ts'; +import { fileToBase64 } from '../utils/fileReading'; +import { LoadingButton } from '@mui/lab'; import ErrorIcon from '@mui/icons-material/Error'; +import { useTranslation } from 'react-i18next'; export const MainAvatar = ({ myName, balance, setOpenSnack, setInfoSnack }) => { const [hasAvatar, setHasAvatar] = useState(false); const [avatarFile, setAvatarFile] = useState(null); - const [tempAvatar, setTempAvatar] = useState(null) - const { show } = useContext(MyContext); + const [tempAvatar, setTempAvatar] = useState(null); + const { show } = useContext(QORTAL_APP_CONTEXT); const [anchorEl, setAnchorEl] = useState(null); -const [isLoading, setIsLoading] = useState(false) + const [isLoading, setIsLoading] = useState(false); // Handle child element click to open Popover const handleChildClick = (event) => { event.stopPropagation(); // Prevent parent onClick from firing @@ -32,98 +45,139 @@ const [isLoading, setIsLoading] = useState(false) const open = Boolean(anchorEl); const id = open ? 'avatar-img' : undefined; + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + const checkIfAvatarExists = async () => { try { const identifier = `qortal_avatar`; const url = `${getBaseApiReact()}${getArbitraryEndpointReact()}?mode=ALL&service=THUMBNAIL&identifier=${identifier}&limit=1&name=${myName}&includemetadata=false&prefix=true`; const response = await fetch(url, { - method: "GET", + method: 'GET', headers: { - "Content-Type": "application/json", + 'Content-Type': 'application/json', }, }); const responseData = await response.json(); if (responseData?.length > 0) { setHasAvatar(true); } - } catch (error) {} + } catch (error) { + console.log(error); + } }; useEffect(() => { if (!myName) return; checkIfAvatarExists(); }, [myName]); - - const publishAvatar = async ()=> { + const publishAvatar = async () => { try { - const fee = await getFee('ARBITRARY') - if(+balance < +fee.fee) throw new Error(`Publishing an Avatar requires ${fee.fee}`) - await show({ - message: "Would you like to publish an avatar?" , - publishFee: fee.fee + ' QORT' - }) - setIsLoading(true); - const avatarBase64 = await fileToBase64(avatarFile) - await new Promise((res, rej) => { - window.sendMessage("publishOnQDN", { - data: avatarBase64, - identifier: "qortal_avatar", - service: "THUMBNAIL", - }) - .then((response) => { - if (!response?.error) { - res(response); - return; - } - rej(response.error); + const fee = await getFee('ARBITRARY'); + + if (+balance < +fee.fee) + throw new Error( + t('core:message.generic.avatar_publish_fee', { + fee: fee.fee, + postProcess: 'capitalizeFirstChar', + }) + ); + + await show({ + message: t('core:message.question.publish_avatar', { + postProcess: 'capitalizeFirstChar', + }), + publishFee: fee.fee + ' QORT', + }); + + setIsLoading(true); + const avatarBase64 = await fileToBase64(avatarFile); + + await new Promise((res, rej) => { + window + .sendMessage('publishOnQDN', { + data: avatarBase64, + identifier: 'qortal_avatar', + service: 'THUMBNAIL', + uploadType: 'base64', + }) + .then((response) => { + if (!response?.error) { + res(response); + return; + } + rej(response.error); + }) + .catch((error) => { + rej( + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', }) - .catch((error) => { - rej(error.message || "An error occurred"); - }); - - }); - setAvatarFile(null); - setTempAvatar(`data:image/webp;base64,${avatarBase64}`) - handleClose() + ); + }); + }); + setAvatarFile(null); + setTempAvatar(`data:image/webp;base64,${avatarBase64}`); + handleClose(); } catch (error) { if (error?.message) { - setOpenSnack(true) - setInfoSnack({ - type: "error", - message: error?.message, - }); - } + setOpenSnack(true); + setInfoSnack({ + type: 'error', + message: error?.message, + }); + } } finally { - setIsLoading(false); + setIsLoading(false); } - } + }; - if(tempAvatar){ + if (tempAvatar) { return ( - <> - + + {myName?.charAt(0)} + + + + - {myName?.charAt(0)} - - - - change avatar - - - - - ); + {t('core:action.change_avatar', { + postProcess: 'capitalizeFirstChar', + })} + + + + + + ); } if (hasAvatar) { @@ -131,25 +185,39 @@ const [isLoading, setIsLoading] = useState(false) <> {myName?.charAt(0)} + - change avatar + {t('core:action.change_avatar', { + postProcess: 'capitalizeFirstChar', + })} - + + ); } @@ -160,66 +228,147 @@ const [isLoading, setIsLoading] = useState(false) - set avatar + {t('core:action.set_avatar', { postProcess: 'capitalizeFirstChar' })} - + + ); }; +// TODO the following part is the same as in GroupAvatar.tsx +const PopoverComp = ({ + avatarFile, + setAvatarFile, + id, + open, + anchorEl, + handleClose, + publishAvatar, + isLoading, + myName, +}) => { + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); -const PopoverComp = ({avatarFile, setAvatarFile, id, open, anchorEl, handleClose, publishAvatar, isLoading, myName}) => { - return ( - - + - (500 KB max. for GIFS){" "} + {t('core:message.generic.avatar_size', { + size: 500, // TODO magic number + postProcess: 'capitalizeFirstChar', + })} + setAvatarFile(file)}> - + + {avatarFile?.name} + + {!myName && ( - - - A registered name is required to set an avatar + alignItems: 'center', + }} + > + + + {t('group:message.generic.avatar_registered_name', { + postProcess: 'capitalizeFirstChar', + })} + )} - - - - Publish avatar + + + + + {t('group:action.publish_avatar', { + postProcess: 'capitalizeFirstChar', + })} - ) - }; \ No newline at end of file + ); +}; diff --git a/src/components/Minting/Minting.tsx b/src/components/Minting/Minting.tsx index af63ece..6a26dc1 100644 --- a/src/components/Minting/Minting.tsx +++ b/src/components/Minting/Minting.tsx @@ -1,80 +1,121 @@ import { Alert, + alpha, + AppBar, Box, Button, Card, + Container, Dialog, DialogActions, DialogContent, DialogTitle, Divider, IconButton, - InputBase, - InputLabel, + Paper, Snackbar, + Tab, + Tabs, + Toolbar, Typography, -} from "@mui/material"; -import React, { + useTheme, +} from '@mui/material'; +import Grid from '@mui/material/Grid'; +import { + SyntheticEvent, useCallback, - useContext, useEffect, useMemo, + useRef, useState, -} from "react"; -import CloseIcon from "@mui/icons-material/Close"; -import { MyContext, getBaseApiReact } from "../../App"; +} from 'react'; +import CloseIcon from '@mui/icons-material/Close'; +import { getBaseApiReact } from '../../App'; import { executeEvent, subscribeToEvent, unsubscribeFromEvent, -} from "../../utils/events"; -import { getFee, getNameOrAddress } from "../../background"; -import CopyToClipboard from "react-copy-to-clipboard"; -import { AddressBox } from "../../App-styles"; -import { Spacer } from "../../common/Spacer"; -import Copy from "../../assets/svgs/Copy.svg"; -import { Loader } from "../Loader"; -import { FidgetSpinner } from "react-loader-spinner"; -import { useModal } from "../../common/useModal"; +} from '../../utils/events'; +import { getFee } from '../../background/background.ts'; +import { Spacer } from '../../common/Spacer'; +import { FidgetSpinner } from 'react-loader-spinner'; +import { useModal } from '../../hooks/useModal.tsx'; +import { useAtom, useSetAtom } from 'jotai'; +import { memberGroupsAtom, txListAtom } from '../../atoms/global'; +import { Trans, useTranslation } from 'react-i18next'; +import { TransitionUp } from '../../common/Transitions.tsx'; +import { + nextLevel, + averageBlockDay, + averageBlockTime, + dayReward, + levelUpBlocks, + levelUpDays, + mintingStatus, + countMintersInLevel, + currentTier, + tierPercent, + countReward, + countRewardDay, +} from './MintingStats.tsx'; + +export type AddressLevelEntry = { + level: number; + count: number; +}; + +export const Minting = ({ setIsOpenMinting, myAddress, show }) => { + const setTxList = useSetAtom(txListAtom); + const [groups] = useAtom(memberGroupsAtom); -export const Minting = ({ - setIsOpenMinting, - myAddress, - groups, - show, - setTxList, - txList, -}) => { const [mintingAccounts, setMintingAccounts] = useState([]); const [accountInfo, setAccountInfo] = useState(null); - const [rewardSharePublicKey, setRewardSharePublicKey] = useState(""); - const [mintingKey, setMintingKey] = useState(""); - const [rewardsharekey, setRewardsharekey] = useState(""); + const [mintingKey, setMintingKey] = useState(''); const [rewardShares, setRewardShares] = useState([]); - const [nodeInfos, setNodeInfos] = useState({}); + const [adminInfo, setAdminInfo] = useState({}); + const [nodeStatus, setNodeStatus] = useState({}); + const [addressLevel, setAddressLevel] = useState([]); + const [tier4Online, setTier4Online] = useState(0); const [openSnack, setOpenSnack] = useState(false); const [isLoading, setIsLoading] = useState(false); - const { show: showKey, message } = useModal(); - const { isShow: isShowNext, onOk, show: showNext } = useModal(); - + const [nodeHeightBlock, setNodeHeightBlock] = useState({}); + const [valueMintingTab, setValueMintingTab] = useState(0); + const { isShow: isShowNext, onOk, show: showNext } = useModal(); + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); const [info, setInfo] = useState(null); const [names, setNames] = useState({}); const [accountInfos, setAccountInfos] = useState({}); - const [showWaitDialog, setShowWaitDialog] = useState(false) + const [showWaitDialog, setShowWaitDialog] = useState(false); + const timeoutNodeStatusRef = useRef | null>( + null + ); + const timeoutAdminInfoRef = useRef | null>( + null + ); const isPartOfMintingGroup = useMemo(() => { if (groups?.length === 0) return false; - return !!groups?.find((item) => item?.groupId?.toString() === "694"); + return !!groups?.find((item) => item?.groupId?.toString() === '694'); }, [groups]); + const getMintingAccounts = useCallback(async () => { try { const url = `${getBaseApiReact()}/admin/mintingaccounts`; const response = await fetch(url); if (!response.ok) { - throw new Error("network error"); + throw new Error('network error'); } const data = await response.json(); setMintingAccounts(data); - } catch (error) {} + } catch (error) { + console.log(error); + } }, []); const accountIsMinting = useMemo(() => { @@ -85,15 +126,14 @@ export const Minting = ({ const getName = async (address) => { try { - const response = await fetch( - `${getBaseApiReact()}/names/address/${address}` - ); + const url = `${getBaseApiReact()}/names/primary/${address}`; + const response = await fetch(url); const nameData = await response.json(); - if (nameData?.length > 0) { + if (nameData?.name) { setNames((prev) => { return { ...prev, - [address]: nameData[0].name, + [address]: nameData?.name, }; }); } else { @@ -105,10 +145,17 @@ export const Minting = ({ }); } } catch (error) { - // error + console.log(error); } }; + function a11yProps(index: number) { + return { + id: `simple-tab-${index}`, + 'aria-controls': `simple-tabpanel-${index}`, + }; + } + const getAccountInfo = async (address: string, others?: boolean) => { try { if (!others) { @@ -117,7 +164,7 @@ export const Minting = ({ const url = `${getBaseApiReact()}/addresses/${address}`; const response = await fetch(url); if (!response.ok) { - throw new Error("network error"); + throw new Error('network error'); } const data = await response.json(); if (others) { @@ -131,6 +178,7 @@ export const Minting = ({ setAccountInfo(data); } } catch (error) { + console.log(error); } finally { if (!others) { setIsLoading(false); @@ -138,16 +186,23 @@ export const Minting = ({ } }; + const daysToNextLevel = levelUpDays( + accountInfo, + adminInfo, + nodeHeightBlock, + nodeStatus + ); + const refreshRewardShare = () => { if (!myAddress) return; getRewardShares(myAddress); }; useEffect(() => { - subscribeToEvent("refresh-rewardshare-list", refreshRewardShare); + subscribeToEvent('refresh-rewardshare-list', refreshRewardShare); return () => { - unsubscribeFromEvent("refresh-rewardshare-list", refreshRewardShare); + unsubscribeFromEvent('refresh-rewardshare-list', refreshRewardShare); }; }, [myAddress]); @@ -159,47 +214,81 @@ export const Minting = ({ return address; }; - const handleAccountInfos = (address, field) => { - if (!address) return undefined; - if (accountInfos[address]) return accountInfos[address]?.[field]; - if (accountInfos[address] === null) return undefined; - getAccountInfo(address, true); - return undefined; - }; + const getAdminInfo = useCallback(async () => { + try { + const url = `${getBaseApiReact()}/admin/info`; + const response = await fetch(url); + const data = await response.json(); + setAdminInfo(data); + } catch (error) { + console.log(error); + } finally { + timeoutAdminInfoRef.current = setTimeout(getAccountInfo, 30000); + } + }, []); - const calculateBlocksRemainingToLevel1 = (address) => { - if (!address) return undefined; - if (!accountInfos[address]) return undefined; - return 7200 - accountInfos[address]?.blocksMinted || 0; - }; - - const getNodeInfos = async () => { + const getNodeStatus = useCallback(async () => { try { const url = `${getBaseApiReact()}/admin/status`; - const response = await fetch(url, { - method: "GET", - headers: { - "Content-Type": "application/json", - }, - }); + const response = await fetch(url); const data = await response.json(); - setNodeInfos(data); + setNodeStatus(data); } catch (error) { - console.error("Request failed", error); + console.error('Request failed', error); + } finally { + timeoutNodeStatusRef.current = setTimeout(getNodeStatus, 30000); + } + }, []); + + useEffect(() => { + if (nodeStatus?.height) { + const getNodeHeightBlock = async () => { + try { + const nodeBlock = nodeStatus.height - 1440; + const url = `${getBaseApiReact()}/blocks/byheight/${nodeBlock}`; + const response = await fetch(url); + const data = await response.json(); + setNodeHeightBlock(data); + } catch (error) { + console.error('Request failed', error); + } + }; + + getNodeHeightBlock(); + } + }, [nodeStatus]); + + const getAddressLevel = async () => { + try { + const url = `${getBaseApiReact()}/addresses/online/levels`; + const response = await fetch(url); + const data: AddressLevelEntry[] = await response.json(); + if (Array.isArray(data)) { + setAddressLevel(data); + const level7 = data.find((entry) => entry.level === 7)?.count || 0; + const level8 = data.find((entry) => entry.level === 8)?.count || 0; + const tier4Count = + parseFloat(level7.toString()) + parseFloat(level8.toString()); + setTier4Online(tier4Count); + } + } catch (error) { + console.error('Request failed', error); } }; const getRewardShares = useCallback(async (address) => { try { - const url = `${getBaseApiReact()}/addresses/rewardshares?involving=${address}`; + const url = `${getBaseApiReact()}/addresses/rewardshares?involving=${address}`; // TODO check API (still useful?) const response = await fetch(url); if (!response.ok) { - throw new Error("network error"); + throw new Error('network error'); } const data = await response.json(); setRewardShares(data); - return data - } catch (error) {} + return data; + } catch (error) { + console.log(error); + } }, []); const addMintingAccount = useCallback(async (val) => { @@ -208,10 +297,9 @@ export const Minting = ({ return await new Promise((res, rej) => { window .sendMessage( - "ADMIN_ACTION", - + 'ADMIN_ACTION', { - type: "addmintingaccount", + type: 'addmintingaccount', value: val, }, 180000, @@ -220,7 +308,7 @@ export const Minting = ({ .then((response) => { if (!response?.error) { res(response); - setMintingKey(""); + setMintingKey(''); setTimeout(() => { getMintingAccounts(); }, 300); @@ -229,13 +317,23 @@ export const Minting = ({ rej({ message: response.error }); }) .catch((error) => { - rej({ message: error.message || "An error occurred" }); + rej({ + message: + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }), + }); }); }); } catch (error) { setInfo({ - type: "error", - message: error?.message || "Unable to add minting account", + type: 'error', + message: + error?.message || + t('core:message.error.minting_account_add', { + postProcess: 'capitalizeFirstChar', + }), }); setOpenSnack(true); } finally { @@ -249,10 +347,9 @@ export const Minting = ({ return await new Promise((res, rej) => { window .sendMessage( - "ADMIN_ACTION", - + 'ADMIN_ACTION', { - type: "removemintingaccount", + type: 'removemintingaccount', value: val, }, 180000, @@ -270,13 +367,23 @@ export const Minting = ({ rej({ message: response.error }); }) .catch((error) => { - rej({ message: error.message || "An error occurred" }); + rej({ + message: + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }), + }); }); }); } catch (error) { setInfo({ - type: "error", - message: error?.message || "Unable to remove minting account", + type: 'error', + message: + error?.message || + t('core:message.error.minting_account_remove', { + postProcess: 'capitalizeFirstChar', + }), }); setOpenSnack(true); } finally { @@ -285,14 +392,19 @@ export const Minting = ({ }, []); const createRewardShare = useCallback(async (publicKey, recipient) => { - const fee = await getFee("REWARD_SHARE"); + const fee = await getFee('REWARD_SHARE'); + await show({ - message: "Would you like to perform an REWARD_SHARE transaction?", - publishFee: fee.fee + " QORT", + message: t('core:message.question.perform_transaction', { + action: 'REWARD_SHARE', + postProcess: 'capitalizeFirstChar', + }), + publishFee: fee.fee + ' QORT', }); + return await new Promise((res, rej) => { window - .sendMessage("createRewardShare", { + .sendMessage('createRewardShare', { recipientPublicKey: publicKey, }) .then((response) => { @@ -301,9 +413,13 @@ export const Minting = ({ { recipient, ...response, - type: "add-rewardShare", - label: `Add rewardshare: awaiting confirmation`, - labelDone: `Add rewardshare: success!`, + type: 'add-rewardShare', + label: t('group:message.success.rewardshare_add', { + postProcess: 'capitalizeFirstChar', + }), + labelDone: t('group:message.success.rewardshare_add_label', { + postProcess: 'capitalizeFirstChar', + }), done: false, }, ...prev, @@ -314,7 +430,13 @@ export const Minting = ({ rej({ message: response.error }); }) .catch((error) => { - rej({ message: error.message || "An error occurred" }); + rej({ + message: + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }), + }); }); }); }, []); @@ -322,7 +444,7 @@ export const Minting = ({ const getRewardSharePrivateKey = useCallback(async (publicKey) => { return await new Promise((res, rej) => { window - .sendMessage("getRewardSharePrivateKey", { + .sendMessage('getRewardSharePrivateKey', { recipientPublicKey: publicKey, }) .then((response) => { @@ -333,7 +455,13 @@ export const Minting = ({ rej({ message: response.error }); }) .catch((error) => { - rej({ message: error.message || "An error occurred" }); + rej({ + message: + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }), + }); }); }); }, []); @@ -341,26 +469,26 @@ export const Minting = ({ const waitUntilRewardShareIsConfirmed = async (timeoutMs = 600000) => { const pollingInterval = 30000; const startTime = Date.now(); - const sleep = (ms) => new Promise((res) => setTimeout(res, ms)); - + while (Date.now() - startTime < timeoutMs) { - - const rewardShares = await getRewardShares(myAddress); - const findRewardShare = rewardShares?.find( - (item) => - item?.recipient === myAddress && item?.mintingAccount === myAddress - ); - - if (findRewardShare) { - return true; // Exit early if found - } - - + const rewardShares = await getRewardShares(myAddress); + const findRewardShare = rewardShares?.find( + (item) => + item?.recipient === myAddress && item?.mintingAccount === myAddress + ); + + if (findRewardShare) { + return true; // Exit early if found + } await sleep(pollingInterval); // Wait before the next poll } - - throw new Error("Timeout waiting for reward share confirmation"); + + throw new Error( + t('group:message.error.timeout_reward', { + postProcess: 'capitalizeFirstChar', + }) + ); }; const startMinting = async () => { @@ -377,118 +505,28 @@ export const Minting = ({ addMintingAccount(privateRewardShare); } else { await createRewardShare(accountInfo?.publicKey, myAddress); - setShowWaitDialog(true) - await waitUntilRewardShareIsConfirmed() + setShowWaitDialog(true); + await waitUntilRewardShareIsConfirmed(); await showNext({ - message: '' - }) + message: '', + }); + const privateRewardShare = await getRewardSharePrivateKey( accountInfo?.publicKey ); - setShowWaitDialog(false) + + setShowWaitDialog(false); addMintingAccount(privateRewardShare); - } } catch (error) { - setShowWaitDialog(false) + setShowWaitDialog(false); setInfo({ - type: "error", - message: error?.message || "Unable to start minting", - }); - setOpenSnack(true); - } finally { - setIsLoading(false); - } - }; - - const getPublicKeyFromAddress = async (address) => { - const url = `${getBaseApiReact()}/addresses/publickey/${address}`; - const response = await fetch(url); - const data = await response.text(); - return data; - }; - - const checkIfMinterGroup = async (address) => { - const url = `${getBaseApiReact()}/groups/member/${address}`; - const response = await fetch(url); - const data = await response.json(); - return !!data?.find((grp) => grp?.groupId?.toString() === "694"); - }; - - const removeRewardShare = useCallback(async (rewardShare) => { - return await new Promise((res, rej) => { - window - .sendMessage("removeRewardShare", { - rewardShareKeyPairPublicKey: rewardShare.rewardSharePublicKey, - recipient: rewardShare.recipient, - percentageShare: -1, - }) - .then((response) => { - if (!response?.error) { - res(response); - setTxList((prev) => [ - { - ...rewardShare, - ...response, - type: "remove-rewardShare", - label: `Remove rewardshare: awaiting confirmation`, - labelDone: `Remove rewardshare: success!`, - done: false, - }, - ...prev, - ]); - return; - } - rej({ message: response.error }); - }) - .catch((error) => { - rej({ message: error.message || "An error occurred" }); - }); - }); - }, []); - - const handleRemoveRewardShare = async (rewardShare) => { - try { - setIsLoading(true); - - const privateRewardShare = await removeRewardShare(rewardShare); - } catch (error) { - setInfo({ - type: "error", - message: error?.message || "Unable to remove reward share", - }); - setOpenSnack(true); - } finally { - setIsLoading(false); - } - }; - - const createRewardShareForPotentialMinter = async (receiver) => { - try { - setIsLoading(true); - const confirmReceiver = await getNameOrAddress(receiver); - if (confirmReceiver.error) - throw new Error("Invalid receiver address or name"); - const isInMinterGroup = await checkIfMinterGroup(confirmReceiver); - if (!isInMinterGroup) throw new Error("Account not in Minter Group"); - const publicKey = await getPublicKeyFromAddress(confirmReceiver); - const findRewardShare = rewardShares?.find( - (item) => - item?.recipient === confirmReceiver && - item?.mintingAccount === myAddress - ); - if (findRewardShare) { - const privateRewardShare = await getRewardSharePrivateKey(publicKey); - setRewardsharekey(privateRewardShare); - } else { - await createRewardShare(publicKey, confirmReceiver); - const privateRewardShare = await getRewardSharePrivateKey(publicKey); - setRewardsharekey(privateRewardShare); - } - } catch (error) { - setInfo({ - type: "error", - message: error?.message || "Unable to create reward share", + type: 'error', + message: + error?.message || + t('group:message.error:minting', { + postProcess: 'capitalizeFirstChar', + }), }); setOpenSnack(true); } finally { @@ -497,41 +535,29 @@ export const Minting = ({ }; useEffect(() => { - getNodeInfos(); + getAddressLevel(); + getAdminInfo(); getMintingAccounts(); + getNodeStatus(); + + return () => { + if (timeoutNodeStatusRef.current) { + clearTimeout(timeoutNodeStatusRef.current); + timeoutNodeStatusRef.current = null; + } + if (timeoutAdminInfoRef.current) { + clearTimeout(timeoutAdminInfoRef.current); + timeoutAdminInfoRef.current = null; + } + }; }, []); useEffect(() => { if (!myAddress) return; getRewardShares(myAddress); - getAccountInfo(myAddress); }, [myAddress]); - const _blocksNeed = () => { - if (accountInfo?.level === 0) { - return 7200; - } else if (accountInfo?.level === 1) { - return 72000; - } else if (accountInfo?.level === 2) { - return 201600; - } else if (accountInfo?.level === 3) { - return 374400; - } else if (accountInfo?.level === 4) { - return 618400; - } else if (accountInfo?.level === 5) { - return 964000; - } else if (accountInfo?.level === 6) { - return 1482400; - } else if (accountInfo?.level === 7) { - return 2173600; - } else if (accountInfo?.level === 8) { - return 3037600; - } else if (accountInfo?.level === 9) { - return 4074400; - } - }; - const handleClose = () => { setOpenSnack(false); setTimeout(() => { @@ -539,305 +565,671 @@ export const Minting = ({ }, 250); }; - const _levelUpBlocks = () => { - if ( - accountInfo?.blocksMinted === undefined || - nodeInfos?.height === undefined - ) - return null; - let countBlocks = - _blocksNeed() - - (accountInfo?.blocksMinted + accountInfo?.blocksMintedAdjustment); + const StatCard = ({ label, value }: { label: string; value: string }) => ( + + + + {label} + + {value} + + + ); - let countBlocksString = countBlocks.toString(); - return "" + countBlocksString; + const handleChange = (event: SyntheticEvent, newValue: number) => { + setValueMintingTab(newValue); }; - - return ( - {"Manage your minting"} - setIsOpenMinting(false)} - aria-label="close" - > - - - - {isLoading && ( - + + + {t('group:message.generic.manage_minting', { + postProcess: 'capitalizeFirstChar', + })} + + + setIsOpenMinting(false)} + aria-label={t('core:action.close', { + postProcess: 'capitalizeFirstChar', + })} sx={{ - position: "absolute", - top: 0, - left: 0, - right: 0, - bottom: 0, - display: "flex", - justifyContent: "center", - alignItems: "center", + bgcolor: theme.palette.background.default, + color: theme.palette.text.primary, }} > - - - )} - + + + + + + - Account: {handleNames(accountInfo?.address)} - Level: {accountInfo?.level} - - blocks remaining until next level: {_levelUpBlocks()} - - - This node is minting: {nodeInfos?.isMintingPossible?.toString()} - - - - {isPartOfMintingGroup && !accountIsMinting && ( - - - {mintingAccounts?.length > 1 && ( - - Only 2 minting keys are allowed per node. Please remove one if - you would like to mint with this account. - - )} - - )} - - {mintingAccounts?.length > 0 && ( - Node's minting accounts - )} - - {accountIsMinting && ( - + - - You currently have a minting key for this account attached to - this node - - - )} - - {mintingAccounts?.map((acct) => ( - + + + + {valueMintingTab === 0 && ( + <> + - - Minting account: {handleNames(acct?.mintingAccount)} - - - - - - ))} + + alpha(theme.palette.background.paper, 0.5), + p: 3, + mb: 4, + borderRadius: '10px', + }} + > + + {t('core:minting.blockchain_statistics', { + postProcess: 'capitalizeEachFirstChar', + })} + - {mintingAccounts?.length > 1 && ( - - Only 2 minting keys are allowed per node. Please remove one if you - would like to add a different account. - - )} - + + - - {!isPartOfMintingGroup && ( - - - - You are currently not part of the MINTER group - - - Visit the Q-Mintership app to apply to be a minter - - - - - - )} + + + - {showWaitDialog && ( - - - {isShowNext ? "Confirmed" : "Please Wait"} - - - {!isShowNext && ( - - Confirming creation of rewardshare on chain. Please be patient, this could take up to 90 seconds. - - )} - {isShowNext && ( - - Rewardshare confirmed. Please click Next. - - )} - + + alpha(theme.palette.background.paper, 0.5), + p: 3, + mb: 4, + borderRadius: '10px', + }} + > + + {t('core:minting.account_details', { + postProcess: 'capitalizeEachFirstChar', + })} + + + + + + + + + + + + , + }} + values={{ + level: nextLevel(accountInfo?.level), + count: daysToNextLevel?.toFixed(2), + }} + tOptions={{ postProcess: ['capitalizeFirstChar'] }} + > + + + + + + + alpha(theme.palette.background.paper, 0.5), + p: 3, + borderRadius: '10px', + }} + > + + {t('core:minting.rewards_info', { + postProcess: 'capitalizeEachFirstChar', + })} + + + + + + + + + + + - - - - - - - + )} - - - - + + {valueMintingTab === 1 && ( + <> + + {isLoading && ( + + + + )} + + + + {t('auth:account.account_one', { + postProcess: 'capitalizeFirstChar', + })} + : {handleNames(accountInfo?.address)} + + + + {t('core:level', { + postProcess: 'capitalizeFirstChar', + })} + : {accountInfo?.level} + + + + + + {isPartOfMintingGroup && !accountIsMinting && ( + + + + {mintingAccounts?.length > 1 && ( + + {t('group:message.generic.minting_keys_per_node', { + postProcess: 'capitalizeFirstChar', + })} + + )} + + )} + + + + {mintingAccounts?.length > 0 && ( + + {t('group:message.generic.node_minting_account', { + postProcess: 'capitalizeFirstChar', + })} + + )} + + {accountIsMinting && ( + + + {t('group:message.generic.node_minting_key', { + postProcess: 'capitalizeFirstChar', + })} + + + )} + + + + {mintingAccounts?.map((acct) => ( + + + {t('group:message.generic.minting_account', { + postProcess: 'capitalizeFirstChar', + })}{' '} + {handleNames(acct?.mintingAccount)} + + + + + + + + + ))} + + {mintingAccounts?.length > 1 && ( + + {t( + 'group:message.generic.minting_keys_per_node_different', + { + postProcess: 'capitalizeFirstChar', + } + )} + + )} + + + + + {!isPartOfMintingGroup && ( + + + + {t('group:message.generic.minter_group', { + postProcess: 'capitalizeFirstChar', + })} + + + + {t('group:message.generic.mintership_app', { + postProcess: 'capitalizeFirstChar', + })} + + + + + + + + )} + + {showWaitDialog && ( + + + {isShowNext + ? t('core:message.generic.confirmed', { + postProcess: 'capitalizeFirstChar', + }) + : t('core:message.generic.wait', { + postProcess: 'capitalizeFirstChar', + })} + + + + {!isShowNext && ( + + {t('group:message.success.rewardshare_creation', { + postProcess: 'capitalizeFirstChar', + })} + + )} + + {isShowNext && ( + + {t('group:message.success.rewardshare_confirmed', { + postProcess: 'capitalizeFirstChar', + })} + + )} + + + + + + + )} + + + )} + + {info?.message} diff --git a/src/components/Minting/MintingStats.tsx b/src/components/Minting/MintingStats.tsx new file mode 100644 index 0000000..95ece6a --- /dev/null +++ b/src/components/Minting/MintingStats.tsx @@ -0,0 +1,463 @@ +import i18n from '../../i18n/i18n'; +import { AddressLevelEntry } from './Minting'; + +const accountTargetBlocks = (level: number): number | undefined => { + if (level === 0) { + return 7200; + } else if (level === 1) { + return 72000; + } else if (level === 2) { + return 201600; + } else if (level === 3) { + return 374400; + } else if (level === 4) { + return 618400; + } else if (level === 5) { + return 964000; + } else if (level === 6) { + return 1482400; + } else if (level === 7) { + return 2173600; + } else if (level === 8) { + return 3037600; + } else if (level === 9) { + return 4074400; + } else { + return undefined; // fallback: should never reach this point + } +}; + +export const nextLevel = (level: number): number | undefined => { + if (level === 0) { + return 1; + } else if (level === 1) { + return 2; + } else if (level === 2) { + return 3; + } else if (level === 3) { + return 4; + } else if (level === 4) { + return 5; + } else if (level === 5) { + return 6; + } else if (level === 6) { + return 7; + } else if (level === 7) { + return 8; + } else if (level === 8) { + return 9; + } else if (level === 9) { + return 10; + } else { + return undefined; // fallback: should never reach this point + } +}; + +export const blockReward = (nodeStatus): number => { + if (nodeStatus.height < 259201) { + return 5.0; + } else if (nodeStatus.height < 518401) { + return 4.75; + } else if (nodeStatus.height < 777601) { + return 4.5; + } else if (nodeStatus.height < 1036801) { + return 4.25; + } else if (nodeStatus.height < 1296001) { + return 4.0; + } else if (nodeStatus.height < 1555201) { + return 3.75; + } else if (nodeStatus.height < 1814401) { + return 3.5; + } else if (nodeStatus.height < 2073601) { + return 3.25; + } else if (nodeStatus.height < 2332801) { + return 3.0; + } else if (nodeStatus.height < 2592001) { + return 2.75; + } else if (nodeStatus.height < 2851201) { + return 2.5; + } else if (nodeStatus.height < 3110401) { + return 2.25; + } else { + return 2.0; + } +}; + +export const currentTier = (level): [string, string] | undefined => { + if (level === 0) { + return ['0', '0']; + } else if (level === 1 || level === 2) { + return ['1', '1 + 2']; + } else if (level === 3 || level === 4) { + return ['2', '3 + 4']; + } else if (level === 5 || level === 6) { + return ['3', '5 + 6']; + } else if (level === 7 || level === 8) { + return ['4', '7 + 8']; + } else if (level === 9 || level === 10) { + return ['5', '9 + 10']; + } else { + return undefined; // fallback: should never reach this point + } +}; + +export const tierPercent = (accountInfo, tier4Online): number => { + if (accountInfo !== null) { + const level = accountInfo.level; + if (level === 0) { + return 0; + } else if (level === 1 || level === 2) { + return 6; + } else if (level === 3 || level === 4) { + return 13; + } else if (level === 5 || level === 6) { + if (tier4Online < 30) { + return 45; + } else { + return 19; + } + } else if (level === 7 || level === 8) { + if (tier4Online < 30) { + return 45; + } else { + return 26; + } + } else if (level === 9 || level === 10) { + return 32; + } + } + return 0; // fallback: should never reach this point +}; + +export const countMintersInLevel = ( + level: number, + addressLevel: AddressLevelEntry[], + tier4Online: number +): number | undefined => { + if (addressLevel && addressLevel.length > 0) { + if (level === 0) { + const countTier0 = addressLevel[0].count; + return countTier0; + } else if (level === 1 || level === 2) { + const countTier1 = addressLevel[1].count + addressLevel[2].count; + return countTier1; + } else if (level === 3 || level === 4) { + const countTier2 = addressLevel[3].count + addressLevel[4].count; + return countTier2; + } else if (level === 5 || level === 6) { + if (tier4Online < 30) { + const countTier3 = + addressLevel[5].count + + addressLevel[6].count + + addressLevel[7].count + + addressLevel[8].count; + return countTier3; + } else { + const countTier3 = addressLevel[5].count + addressLevel[6].count; + return countTier3; + } + } else if (level === 7 || level === 8) { + if (tier4Online < 30) { + const countTier4 = + addressLevel[5].count + + addressLevel[6].count + + addressLevel[7].count + + addressLevel[8].count; + return countTier4; + } else { + const countTier4 = addressLevel[7].count + addressLevel[8].count; + return countTier4; + } + } else if (level === 9 || level === 10) { + const countTier5 = addressLevel[9].count + addressLevel[10].count; + return countTier5; + } + } + + return undefined; // fallback: should never reach this point +}; + +export const countReward = ( + accountInfo, + addressLevel: AddressLevelEntry[], + nodeStatus, + tier4Online: number +): number => { + if (accountInfo != null && addressLevel && addressLevel.length > 0) { + const level = accountInfo.level; + if (level === 0) { + return 0; + } else if (level === 1 || level === 2) { + const countReward12: number = parseFloat( + ( + ((blockReward(nodeStatus) / 100) * + tierPercent(accountInfo, tier4Online)) / + (addressLevel[1].count + addressLevel[2].count) + ).toFixed(8) + ); + return countReward12; + } else if (level === 3 || level === 4) { + const countReward34 = parseFloat( + ( + ((blockReward(nodeStatus) / 100) * + tierPercent(accountInfo, tier4Online)) / + (addressLevel[3].count + addressLevel[4].count) + ).toFixed(8) + ); + return countReward34; + } else if (level === 5 || level === 6) { + if (tier4Online < 30) { + const countReward56 = parseFloat( + ( + ((blockReward(nodeStatus) / 100) * + tierPercent(accountInfo, tier4Online)) / + (addressLevel[5].count + + addressLevel[6].count + + addressLevel[7].count + + addressLevel[8].count) + ).toFixed(8) + ); + return countReward56; + } else { + const countReward56 = parseFloat( + ( + ((blockReward(nodeStatus) / 100) * + tierPercent(accountInfo, tier4Online)) / + (addressLevel[5].count + addressLevel[6].count) + ).toFixed(8) + ); + return countReward56; + } + } else if (level === 7 || level === 8) { + if (tier4Online < 30) { + const countReward78 = parseFloat( + ( + ((blockReward(nodeStatus) / 100) * + tierPercent(accountInfo, tier4Online)) / + (addressLevel[5].count + + addressLevel[6].count + + addressLevel[7].count + + addressLevel[8].count) + ).toFixed(8) + ); + return countReward78; + } else { + const countReward78 = parseFloat( + ( + ((blockReward(nodeStatus) / 100) * + tierPercent(accountInfo, tier4Online)) / + (addressLevel[7].count + addressLevel[8].count) + ).toFixed(8) + ); + return countReward78; + } + } else if (level === 9 || level === 10) { + const countReward910 = parseFloat( + ( + ((blockReward(nodeStatus) / 100) * + tierPercent(accountInfo, tier4Online)) / + (addressLevel[9].count + addressLevel[10].count) + ).toFixed(8) + ); + return countReward910; + } + } + return 0; // fallback: should never reach this point +}; + +export const countRewardDay = ( + accountInfo, + addressLevel: AddressLevelEntry[], + adminInfo, + nodeHeightBlock, + nodeStatus, + tier4Online: number +): number => { + if (accountInfo != null && addressLevel && addressLevel.length > 0) { + const level = accountInfo.level; + const timeCalc = averageBlockDay(adminInfo, nodeHeightBlock); + if (level === 0) { + return 0; + } else if (level === 1 || level === 2) { + const countRewardDay12 = parseFloat( + ( + (((blockReward(nodeStatus) / 100) * + tierPercent(accountInfo, tier4Online)) / + (addressLevel[1].count + addressLevel[2].count)) * + timeCalc + ).toFixed(8) + ); + return countRewardDay12; + } else if (level === 3 || level === 4) { + const countRewardDay34 = parseFloat( + ( + (((blockReward(nodeStatus) / 100) * + tierPercent(accountInfo, tier4Online)) / + (addressLevel[3].count + addressLevel[4].count)) * + timeCalc + ).toFixed(8) + ); + return countRewardDay34; + } else if (level === 5 || level === 6) { + if (tier4Online < 30) { + const countRewardDay56 = parseFloat( + ( + (((blockReward(nodeStatus) / 100) * + tierPercent(accountInfo, tier4Online)) / + (addressLevel[5].count + + addressLevel[6].count + + addressLevel[7].count + + addressLevel[8].count)) * + timeCalc + ).toFixed(8) + ); + return countRewardDay56; + } else { + const countRewardDay56 = parseFloat( + ( + (((blockReward(nodeStatus) / 100) * + tierPercent(accountInfo, tier4Online)) / + (addressLevel[5].count + addressLevel[6].count)) * + timeCalc + ).toFixed(8) + ); + return countRewardDay56; + } + } else if (level === 7 || level === 8) { + if (tier4Online < 30) { + const countRewardDay78 = parseFloat( + ( + (((blockReward(nodeStatus) / 100) * + tierPercent(accountInfo, tier4Online)) / + (addressLevel[5].count + + addressLevel[6].count + + addressLevel[7].count + + addressLevel[8].count)) * + timeCalc + ).toFixed(8) + ); + return countRewardDay78; + } else { + const countRewardDay78 = parseFloat( + ( + (((blockReward(nodeStatus) / 100) * + tierPercent(accountInfo, tier4Online)) / + (addressLevel[7].count + addressLevel[8].count)) * + timeCalc + ).toFixed(8) + ); + return countRewardDay78; + } + } else if (level === 9 || level === 10) { + const countRewardDay910 = parseFloat( + ( + (((blockReward(nodeStatus) / 100) * + tierPercent(accountInfo, tier4Online)) / + (addressLevel[9].count + addressLevel[10].count)) * + timeCalc + ).toFixed(8) + ); + return countRewardDay910; + } + } + return 0; // fallback: should never reach this point +}; + +export const mintingStatus = (nodeStatus): string => { + if ( + nodeStatus.isMintingPossible === true && + nodeStatus.isSynchronizing === true + ) { + return i18n.t('core:minting.status.minting', { + postProcess: 'capitalizeFirstChar', + }); + } else if ( + nodeStatus.isMintingPossible === true && + nodeStatus.isSynchronizing === false + ) { + return i18n.t('core:minting.status.minting', { + postProcess: 'capitalizeFirstChar', + }); + } else if ( + nodeStatus.isMintingPossible === false && + nodeStatus.isSynchronizing === true + ) { + return i18n.t('core:minting.status.synchronizing', { + postProcess: 'capitalizeFirstChar', + }) + + nodeStatus.syncPercent !== + undefined + ? nodeStatus.syncPercent + '%' + : ''; + } else if ( + nodeStatus.isMintingPossible === false && + nodeStatus.isSynchronizing === false + ) { + return i18n.t('core:minting.status.not_minting', { + postProcess: 'capitalizeFirstChar', + }); + } else { + return i18n.t('core:minting.status.no_status', { + postProcess: 'capitalizeFirstChar', + }); + } +}; + +export const averageBlockTime = (adminInfo, nodeHeightBlock) => { + const avgBlock = adminInfo.currentTimestamp - nodeHeightBlock.timestamp; + const averageTime = avgBlock / 1000 / 1440; + return averageTime; +}; + +export const averageBlockDay = (adminInfo, nodeHeightBlock) => { + const averageBlockDay = 86400 / averageBlockTime(adminInfo, nodeHeightBlock); + return averageBlockDay; +}; + +export const levelUpBlocks = (accountInfo, nodeStatus): number => { + if ( + accountInfo?.blocksMinted === undefined || + nodeStatus?.height === undefined || + accountTargetBlocks(accountInfo?.level) == undefined + ) + return 0; + + const nextBatch = 1000 - (nodeStatus.height % 1000); + const countBlocks = + accountTargetBlocks(accountInfo?.level)! - + (accountInfo?.blocksMinted + accountInfo?.blocksMintedAdjustment) + + 1000; + const countBlocksActual = countBlocks + nextBatch - (countBlocks % 1000); + return countBlocksActual; +}; + +export const levelUpDays = ( + accountInfo, + adminInfo, + nodeHeightBlock, + nodeStatus +): number | undefined => { + if ( + accountInfo?.blocksMinted === undefined || + nodeStatus?.height === undefined || + accountTargetBlocks(accountInfo?.level) == undefined + ) + return undefined; + + const nextBatch = 1000 - (nodeStatus.height % 1000); + const countBlocks = + accountTargetBlocks(accountInfo?.level)! - + (accountInfo?.blocksMinted + accountInfo?.blocksMintedAdjustment) + + 1000; + + const countBlocksActual = countBlocks + nextBatch - (countBlocks % 1000); + const countDays = + countBlocksActual / averageBlockDay(adminInfo, nodeHeightBlock); + return countDays; +}; + +export const dayReward = (adminInfo, nodeHeightBlock, nodeStatus) => { + const reward = + averageBlockDay(adminInfo, nodeHeightBlock) * blockReward(nodeStatus); + return reward; +}; diff --git a/src/components/Mobile/MobileFooter.tsx b/src/components/Mobile/MobileFooter.tsx deleted file mode 100644 index 52e5c7c..0000000 --- a/src/components/Mobile/MobileFooter.tsx +++ /dev/null @@ -1,203 +0,0 @@ -import * as React from "react"; -import { - BottomNavigation, - BottomNavigationAction, - ButtonBase, - Typography, -} from "@mui/material"; -import { Home, Groups, Message, ShowChart } from "@mui/icons-material"; -import Box from "@mui/material/Box"; -import BottomLogo from "../../assets/svgs/BottomLogo5.svg"; -import LogoSelected from "../../assets/svgs/LogoSelected.svg"; -import { Browser } from '@capacitor/browser'; - -import { CustomSvg } from "../../common/CustomSvg"; -import { WalletIcon } from "../../assets/Icons/WalletIcon"; -import { HubsIcon } from "../../assets/Icons/HubsIcon"; -import { TradingIcon } from "../../assets/Icons/TradingIcon"; -import { MessagingIcon } from "../../assets/Icons/MessagingIcon"; -import { executeEvent } from "../../utils/events"; - -const IconWrapper = ({ children, label, color }) => { - return ( - - {children} - - {label} - - - ); -}; - -export const MobileFooter = ({ - selectedGroup, - groupSection, - isUnread, - goToAnnouncements, - isUnreadChat, - goToChat, - goToThreads, - setOpenManageMembers, - groupChatHasUnread, - groupsAnnHasUnread, - directChatHasUnread, - chatMode, - openDrawerGroups, - goToHome, - setIsOpenDrawerProfile, - mobileViewMode, - setMobileViewMode, - setMobileViewModeKeepOpen, - hasUnreadGroups, - hasUnreadDirects -}) => { - const [value, setValue] = React.useState(0); - return ( - - setValue(newValue)} - sx={{ backgroundColor: "transparent", flexGrow: 1 }} - > - { - // setMobileViewMode('wallet') - setIsOpenDrawerProfile(true); - }} - icon={ - - - - } - sx={{ color: value === 0 ? "white" : "gray", padding: "0px 10px" }} - /> - { - setMobileViewMode("groups"); - }} - icon={ - - - - } - sx={{ - color: value === 0 ? "white" : "gray", - paddingLeft: "10px", - paddingRight: "42px", - }} - /> - - - {/* Floating Center Button */} - - { - if(mobileViewMode === 'home'){ - setMobileViewMode('apps') - - } else { - setMobileViewMode('home') - - } - }}> - - {/* Custom Center Icon */} - center-icon - - - - - setValue(newValue)} - sx={{ backgroundColor: "transparent", flexGrow: 1 }} - > - { - setMobileViewModeKeepOpen("messaging"); - }} - icon={ - - - - } - sx={{ - color: value === 2 ? "white" : "gray", - paddingLeft: "55px", - paddingRight: "10px", - }} - /> - { - executeEvent("addTab", { data: { service: 'APP', name: 'q-trade' } }); - executeEvent("open-apps-mode", { }); - }} - - icon={ - - - - } - sx={{ color: value === 3 ? "white" : "gray", padding: "0px 10px" }} - /> - - - ); -}; diff --git a/src/components/Mobile/MobileHeader.tsx b/src/components/Mobile/MobileHeader.tsx deleted file mode 100644 index cd98ba9..0000000 --- a/src/components/Mobile/MobileHeader.tsx +++ /dev/null @@ -1,472 +0,0 @@ -import React, { useState } from "react"; -import { - AppBar, - Toolbar, - IconButton, - Typography, - Box, - MenuItem, - Select, - ButtonBase, - Menu, - ListItemIcon, - ListItemText, -} from "@mui/material"; -import { HomeIcon } from "../../assets/Icons/HomeIcon"; -import { LogoutIcon } from "../../assets/Icons/LogoutIcon"; -import { NotificationIcon } from "../../assets/Icons/NotificationIcon"; -import { ArrowDownIcon } from "../../assets/Icons/ArrowDownIcon"; -import { MessagingIcon } from "../../assets/Icons/MessagingIcon"; -import { MessagingIcon2 } from "../../assets/Icons/MessagingIcon2"; -import { HubsIcon } from "../../assets/Icons/HubsIcon"; -import { Save } from "../Save/Save"; -import CloseFullscreenIcon from '@mui/icons-material/CloseFullscreen'; -import { useRecoilState } from "recoil"; -import { fullScreenAtom, hasSettingsChangedAtom } from "../../atoms/global"; -import { useAppFullScreen } from "../../useAppFullscreen"; - -const Header = ({ - logoutFunc, - goToHome, - setIsOpenDrawerProfile, - isThin, - setMobileViewModeKeepOpen, - hasUnreadGroups, - hasUnreadDirects, - setMobileViewMode, - myName, - setSelectedDirect, - setNewChat -}) => { - const [anchorEl, setAnchorEl] = useState(null); - const open = Boolean(anchorEl); - const [fullScreen, setFullScreen] = useRecoilState(fullScreenAtom); - const {exitFullScreen} = useAppFullScreen(setFullScreen) - const handleClick = (event) => { - setAnchorEl(event.currentTarget); - }; - - const handleClose = () => { - setAnchorEl(null); - }; - - if (isThin) { - return ( - - - {/* Left Home Icon */} - - { - setMobileViewModeKeepOpen(""); - goToHome(); - }} - // onClick={onHomeClick} - > - - - - - - {fullScreen && ( - { - exitFullScreen() - setFullScreen(false) - }}> - - - )} - - - - {/* Center Title */} - - QORTAL - - - {/* Right Logout Icon */} - - { - setMobileViewModeKeepOpen("messaging"); - }} - > - - - - - - - - - - { - setSelectedDirect(null) - setNewChat(false) - setMobileViewMode("groups"); - setMobileViewModeKeepOpen("") - handleClose(); - }} - > - - - - - - { - setMobileViewModeKeepOpen("messaging"); - - handleClose(); - }} - > - - - - - - - - ); - } - return ( - <> - {/* Main Header */} - - - {/* Left Home Icon */} - - - - - {fullScreen && ( - { - exitFullScreen() - setFullScreen(false) - }}> - - - )} - - {/* Center Title */} - - QORTAL - - - {/* Right Logout Icon */} - - - - - - - - - {/* Secondary Section */} - - - - {myName} - - {/* - */} - - - - - - - - - {/* Right Dropdown */} - {/* { - setIsOpenDrawerProfile(true); - }} - > - - - View Wallet - - - - - */} - - - { - setMobileViewMode("groups"); - setMobileViewModeKeepOpen("") - handleClose(); - }} - > - - - - - - { - setMobileViewModeKeepOpen("messaging"); - - handleClose(); - }} - > - - - - - - - - ); -}; - -export default Header; diff --git a/src/components/NewUsersCTA.tsx b/src/components/NewUsersCTA.tsx new file mode 100644 index 0000000..0618ce5 --- /dev/null +++ b/src/components/NewUsersCTA.tsx @@ -0,0 +1,103 @@ +import { Box, ButtonBase, Typography } from '@mui/material'; +import { Spacer } from '../common/Spacer'; +import { useTranslation } from 'react-i18next'; + +export const NewUsersCTA = ({ balance }) => { + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + + if (balance === undefined || +balance > 0) return null; + + return ( + + + + + + {t('core:message.question.new_user', { + postProcess: 'capitalizeFirstChar', + })} + + + + + + {t('core:message_us', { postProcess: 'capitalizeFirstChar' })} + + + + + + { + if (window?.electronAPI?.openExternal) { + window.electronAPI.openExternal( + 'https://link.qortal.dev/support' + ); + } else { + window.open('https://link.qortal.dev/support', '_blank'); + } + }} + > + Nextcloud + + + { + if (window?.electronAPI?.openExternal) { + window.electronAPI.openExternal( + 'https://link.qortal.dev/discord-invite' + ); + } else { + window.open('https://link.qortal.dev/discord-invite', '_blank'); + } + }} + > + Discord + + + + + ); +}; diff --git a/src/components/NotAuthenticated.tsx b/src/components/NotAuthenticated.tsx new file mode 100644 index 0000000..c3ec233 --- /dev/null +++ b/src/components/NotAuthenticated.tsx @@ -0,0 +1,1189 @@ +import { + Fragment, + useCallback, + useContext, + useEffect, + useRef, + useState, +} from 'react'; +import { Spacer } from '../common/Spacer'; +import { CustomButton, TextP, TextSpan } from '../styles/App-styles'; +import { + Box, + Button, + ButtonBase, + Dialog, + DialogActions, + DialogContent, + DialogTitle, + FormControlLabel, + Input, + styled, + Switch, + TextField, + Typography, + useTheme, +} from '@mui/material'; +import Logo1Dark from '../assets/svgs/Logo1Dark.svg'; +import HelpIcon from '@mui/icons-material/Help'; +import { CustomizedSnackbars } from './Snackbar/Snackbar'; +import { cleanUrl, gateways } from '../background/background.ts'; +import Tooltip, { TooltipProps, tooltipClasses } from '@mui/material/Tooltip'; +import { useTranslation } from 'react-i18next'; +import { QORTAL_APP_CONTEXT } from '../App'; + +export const manifestData = { + version: '0.5.4', +}; + +export const HtmlTooltip = styled(({ className, ...props }: TooltipProps) => ( + +))(({ theme }) => ({ + [`& .${tooltipClasses.tooltip}`]: { + backgroundColor: theme.palette.background.paper, + color: theme.palette.text.primary, + maxWidth: 320, + padding: '20px', + fontSize: theme.typography.pxToRem(12), + }, +})); + +function removeTrailingSlash(url) { + return url.replace(/\/+$/, ''); +} + +export const NotAuthenticated = ({ + getRootProps, + getInputProps, + setExtstate, + apiKey, + setApiKey, + globalApiKey, + handleSetGlobalApikey, + currentNode, + setCurrentNode, + useLocalNode, + setUseLocalNode, +}) => { + const [isValidApiKey, setIsValidApiKey] = useState(null); + const [hasLocalNode, setHasLocalNode] = useState(null); + const [openSnack, setOpenSnack] = useState(false); + const [infoSnack, setInfoSnack] = useState(null); + const [show, setShow] = useState(false); + const [mode, setMode] = useState('list'); + const [customNodes, setCustomNodes] = useState(null); + const [importedApiKey, setImportedApiKey] = useState(null); + const [url, setUrl] = useState('https://'); + const [customApikey, setCustomApiKey] = useState(''); + const [showSelectApiKey, setShowSelectApiKey] = useState(false); + const [enteredApiKey, setEnteredApiKey] = useState(''); + const [customNodeToSaveIndex, setCustomNodeToSaveIndex] = useState(null); + const { showTutorial, hasSeenGettingStarted } = + useContext(QORTAL_APP_CONTEXT); + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + + const importedApiKeyRef = useRef(null); + const currentNodeRef = useRef(null); + const hasLocalNodeRef = useRef(null); + const isLocal = cleanUrl(currentNode?.url) === '127.0.0.1:12391'; + const handleFileChangeApiKey = (event) => { + setShowSelectApiKey(false); + const file = event.target.files[0]; // Get the selected file + if (file) { + const reader = new FileReader(); + reader.onload = (e) => { + const text = e.target.result; // Get the file content + + setImportedApiKey(text); // Store the file content in the state + if (customNodes) { + setCustomNodes((prev) => { + const copyPrev = [...prev]; + const findLocalIndex = copyPrev?.findIndex( + (item) => item?.url === 'http://127.0.0.1:12391' + ); + if (findLocalIndex === -1) { + copyPrev.unshift({ + url: 'http://127.0.0.1:12391', + apikey: text, + }); + } else { + copyPrev[findLocalIndex] = { + url: 'http://127.0.0.1:12391', + apikey: text, + }; + } + window.sendMessage('setCustomNodes', copyPrev).catch((error) => { + console.error( + 'Failed to set custom nodes:', + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }) + ); + }); + return copyPrev; + }); + } + }; + reader.readAsText(file); // Read the file as text + } + }; + + const checkIfUserHasLocalNode = useCallback(async () => { + try { + const url = `http://127.0.0.1:12391/admin/status`; + const response = await fetch(url, { + method: 'GET', + headers: { + 'Content-Type': 'application/json', + }, + }); + const data = await response.json(); + if (data?.height) { + setHasLocalNode(true); + return true; + } + return false; + } catch (error) { + return false; + } + }, []); + + useEffect(() => { + checkIfUserHasLocalNode(); + }, []); + + useEffect(() => { + window + .sendMessage('getCustomNodesFromStorage') + .then((response) => { + setCustomNodes(response || []); + if (window?.electronAPI?.setAllowedDomains) { + window.electronAPI.setAllowedDomains( + response?.map((node) => node.url) + ); + } + if (Array.isArray(response)) { + const findLocal = response?.find( + (item) => item?.url === 'http://127.0.0.1:12391' + ); + if (findLocal && findLocal?.apikey) { + setImportedApiKey(findLocal?.apikey); + } + } + }) + .catch((error) => { + console.error( + 'Failed to get custom nodes from storage:', + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }) + ); + }); + }, []); + + useEffect(() => { + importedApiKeyRef.current = importedApiKey; + }, [importedApiKey]); + + useEffect(() => { + currentNodeRef.current = currentNode; + }, [currentNode]); + + useEffect(() => { + hasLocalNodeRef.current = hasLocalNode; + }, [hasLocalNode]); + + const validateApiKey = useCallback(async (key, fromStartUp) => { + try { + if (key === 'isGateway') return; + const isLocalKey = cleanUrl(key?.url) === '127.0.0.1:12391'; + if ( + fromStartUp && + key?.url && + key?.apikey && + !isLocalKey && + !gateways.some((gateway) => key?.url?.includes(gateway)) + ) { + setCurrentNode({ + url: key?.url, + apikey: key?.apikey, + }); + + let isValid = false; + + const url = `${key?.url}/admin/settings/localAuthBypassEnabled`; + const response = await fetch(url); + + // Assuming the response is in plain text and will be 'true' or 'false' + const data = await response.text(); + if (data && data === 'true') { + isValid = true; + } else { + const url2 = `${key?.url}/admin/apikey/test?apiKey=${key?.apikey}`; + const response2 = await fetch(url2); + + // Assuming the response is in plain text and will be 'true' or 'false' + const data2 = await response2.text(); + if (data2 === 'true') { + isValid = true; + } + } + + if (isValid) { + setIsValidApiKey(true); + setUseLocalNode(true); + return; + } + } + if (!currentNodeRef.current) return; + const stillHasLocal = await checkIfUserHasLocalNode(); + + if (isLocalKey && !stillHasLocal && !fromStartUp) { + throw new Error( + t('auth:message.generic.turn_local_node', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + //check custom nodes + // !gateways.some(gateway => apiKey?.url?.includes(gateway)) + const isCurrentNodeLocal = + cleanUrl(currentNodeRef.current?.url) === '127.0.0.1:12391'; + if (isLocalKey && !isCurrentNodeLocal) { + setIsValidApiKey(false); + setUseLocalNode(false); + return; + } + let payload = {}; + + if (currentNodeRef.current?.url === 'http://127.0.0.1:12391') { + payload = { + apikey: importedApiKeyRef.current || key?.apikey, + url: currentNodeRef.current?.url, + }; + if (!payload?.apikey) { + try { + const generateUrl = 'http://127.0.0.1:12391/admin/apikey/generate'; + const generateRes = await fetch(generateUrl, { + method: 'POST', + }); + let res; + try { + res = await generateRes.clone().json(); + } catch (e) { + res = await generateRes.text(); + } + if (res != null && !res.error && res.length >= 8) { + payload = { + apikey: res, + url: currentNodeRef.current?.url, + }; + + setImportedApiKey(res); // Store the file content in the state + + setCustomNodes((prev) => { + const copyPrev = [...prev]; + const findLocalIndex = copyPrev?.findIndex( + (item) => item?.url === 'http://127.0.0.1:12391' + ); + if (findLocalIndex === -1) { + copyPrev.unshift({ + url: 'http://127.0.0.1:12391', + apikey: res, + }); + } else { + copyPrev[findLocalIndex] = { + url: 'http://127.0.0.1:12391', + apikey: res, + }; + } + window + .sendMessage('setCustomNodes', copyPrev) + .catch((error) => { + console.error( + 'Failed to set custom nodes:', + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }) + ); + }); + return copyPrev; + }); + } + } catch (error) { + console.error(error); + } + } + } else if (currentNodeRef.current) { + payload = currentNodeRef.current; + } + + let isValid = false; + + const url = `${payload?.url}/admin/settings/localAuthBypassEnabled`; + const response = await fetch(url); + + // Assuming the response is in plain text and will be 'true' or 'false' + const data = await response.text(); + if (data && data === 'true') { + isValid = true; + } else { + const url2 = `${payload?.url}/admin/apikey/test?apiKey=${payload?.apikey}`; + const response2 = await fetch(url2); + + // Assuming the response is in plain text and will be 'true' or 'false' + const data2 = await response2.text(); + if (data2 === 'true') { + isValid = true; + } + } + + if (isValid) { + window + .sendMessage('setApiKey', payload) + .then((response) => { + if (response) { + handleSetGlobalApikey(payload); + setIsValidApiKey(true); + setUseLocalNode(true); + if (!fromStartUp) { + setApiKey(payload); + } + } + }) + .catch((error) => { + console.error( + t('auth:message.error.set_apikey', { + postProcess: 'capitalizeFirstChar', + }), + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }) + ); + }); + } else { + setIsValidApiKey(false); + setUseLocalNode(false); + if (!fromStartUp) { + setInfoSnack({ + type: 'error', + message: t('auth:apikey.select_valid', { + postProcess: 'capitalizeFirstChar', + }), + }); + setOpenSnack(true); + } + } + } catch (error) { + setIsValidApiKey(false); + setUseLocalNode(false); + if (fromStartUp) { + setCurrentNode({ + url: 'http://127.0.0.1:12391', + }); + window + .sendMessage('setApiKey', 'isGateway') + .then((response) => { + if (response) { + setApiKey(null); + handleSetGlobalApikey(null); + } + }) + .catch((error) => { + console.error( + t('auth:message.error.set_apikey', { + postProcess: 'capitalizeFirstChar', + }), + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }) + ); + }); + return; + } + if (!fromStartUp) { + setInfoSnack({ + type: 'error', + message: + error?.message || + t('auth:apikey.select_valid', { + postProcess: 'capitalizeFirstChar', + }), + }); + setOpenSnack(true); + } + console.error('Error validating API key:', error); + } + }, []); + + useEffect(() => { + if (apiKey) { + validateApiKey(apiKey, true); + } + }, [apiKey]); + + const addCustomNode = () => { + setMode('add-node'); + }; + + const saveCustomNodes = (myNodes, isFullListOfNodes) => { + let nodes = [...(myNodes || [])]; + if (!isFullListOfNodes && customNodeToSaveIndex !== null) { + nodes.splice(customNodeToSaveIndex, 1, { + url: removeTrailingSlash(url), + apikey: customApikey, + }); + } else if (!isFullListOfNodes && url) { + nodes.push({ + url: removeTrailingSlash(url), + apikey: customApikey, + }); + } + + setCustomNodes(nodes); + + setCustomNodeToSaveIndex(null); + if (!nodes) return; + window + .sendMessage('setCustomNodes', nodes) + .then((response) => { + if (response) { + setMode('list'); + setUrl('https://'); + setCustomApiKey(''); + if (window?.electronAPI?.setAllowedDomains) { + window.electronAPI.setAllowedDomains( + nodes?.map((node) => node.url) + ); + } + // add alert if needed + } + }) + .catch((error) => { + console.error( + 'Failed to set custom nodes:', + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }) + ); + }); + }; + + return ( + <> + + + + + + + + + + {t('auth:welcome', { postProcess: 'capitalizeFirstChar' })} + + {' '} + QORTAL + + + + + + + + + {t('auth:tips.digital_id', { + postProcess: 'capitalizeFirstChar', + })} + + + } + > + setExtstate('wallets')}> + {t('auth:account.account_many', { + postProcess: 'capitalizeFirstChar', + })} + + + + + + + + + + {t('auth:tips.new_users', { + postProcess: 'capitalizeFirstChar', + })} + + + + + + {t('auth:tips.new_account', { + postProcess: 'capitalizeFirstChar', + })} + + + } + > + { + setExtstate('create-wallet'); + }} + sx={{ + backgroundColor: + hasSeenGettingStarted === false && theme.palette.other.positive, + color: + hasSeenGettingStarted === false && theme.palette.text.primary, + '&:hover': { + backgroundColor: + hasSeenGettingStarted === false && theme.palette.other.unread, + color: + hasSeenGettingStarted === false && theme.palette.text.primary, + }, + }} + > + {t('auth:action.create_account', { + postProcess: 'capitalizeFirstChar', + })} + + + + + + + + {t('auth:node.using', { postProcess: 'capitalizeFirstChar' })}:{' '} + {currentNode?.url} + + + <> + + + + <> + + {t('auth:advanced_users', { postProcess: 'capitalizeFirstChar' })} + + + + { + if (event.target.checked) { + validateApiKey(currentNode); + } else { + setCurrentNode({ + url: 'http://127.0.0.1:12391', + }); + setUseLocalNode(false); + window + .sendMessage('setApiKey', null) + .then((response) => { + if (response) { + setApiKey(null); + handleSetGlobalApikey(null); + } + }) + .catch((error) => { + console.error( + t('auth:message.error.set_apikey', { + postProcess: 'capitalizeFirstChar', + }), + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }) + ); + }); + } + }} + disabled={false} + /> + } + label={ + isLocal + ? t('auth:node.use_local', { + postProcess: 'capitalizeFirstChar', + }) + : t('auth:node.use_custom', { + postProcess: 'capitalizeFirstChar', + }) + } + /> + + {currentNode?.url === 'http://127.0.0.1:12391' && ( + <> + + + + {t('auth:apikey.key', { postProcess: 'capitalizeFirstChar' })} + : {importedApiKey} + + + )} + + + + + + {t('auth:build_version', { postProcess: 'capitalizeFirstChar' })}: + {manifestData?.version} + + + + + + + {show && ( + + + {t('auth:node.custom_many', { postProcess: 'capitalizeAll' })} + + + + + {mode === 'list' && ( + + + + http://127.0.0.1:12391 + + + + + + + + {customNodes?.map((node, index) => { + return ( + + + {node?.url} + + + + + + + + + + + ); + })} + + )} + + {mode === 'add-node' && ( + + { + setUrl(e.target.value); + }} + /> + + { + setCustomApiKey(e.target.value); + }} + /> + + )} + + + + + {mode === 'list' && ( + + )} + + {mode === 'list' && ( + <> + + + )} + + {mode === 'add-node' && ( + <> + + + + + )} + + + )} + + {showSelectApiKey && ( + + + {t('auth:apikey.enter', { postProcess: 'capitalizeFirstChar' })} + + + + + setEnteredApiKey(e.target.value)} + /> + + + + + + + + + + + )} + + { + showTutorial('create-account', true); + }} + sx={{ + position: 'fixed', + bottom: '25px', + right: '25px', + }} + > + + + + ); +}; diff --git a/src/components/PasswordField/PasswordField.tsx b/src/components/PasswordField/PasswordField.tsx index 89bc8b4..5bf1839 100644 --- a/src/components/PasswordField/PasswordField.tsx +++ b/src/components/PasswordField/PasswordField.tsx @@ -1,67 +1,96 @@ -import { Button, ButtonBase, InputAdornment, TextField, TextFieldProps, styled } from "@mui/material"; -import { forwardRef, useState } from 'react' +import { + ButtonBase, + InputAdornment, + TextField, + TextFieldProps, + styled, +} from '@mui/material'; +import { forwardRef, useState } from 'react'; import VisibilityOffIcon from '@mui/icons-material/VisibilityOff'; import VisibilityIcon from '@mui/icons-material/Visibility'; -export const CustomInput = styled(TextField)({ - width: "183px", // Adjust the width as needed - borderRadius: "5px", - // backgroundColor: "rgba(30, 30, 32, 1)", - outline: "none", - input: { - fontSize: 10, - fontFamily: "Inter", - fontWeight: 400, - color: "white", - "&::placeholder": { - fontSize: 16, - color: "rgba(255, 255, 255, 0.2)", - }, - outline: "none", - padding: "10px", - }, - "& .MuiOutlinedInput-root": { - "& fieldset": { - border: '0.5px solid rgba(255, 255, 255, 0.5)', - }, - "&:hover fieldset": { - border: '0.5px solid rgba(255, 255, 255, 0.5)', - }, - "&.Mui-focused fieldset": { - border: '0.5px solid rgba(255, 255, 255, 0.5)', - }, - }, - "& .MuiInput-underline:before": { - borderBottom: "none", - }, - "& .MuiInput-underline:hover:not(.Mui-disabled):before": { - borderBottom: "none", - }, - "& .MuiInput-underline:after": { - borderBottom: "none", - }, -}); +export const CustomInput = styled(TextField)(({ theme }) => ({ + width: '183px', + borderRadius: '8px', + backgroundColor: theme.palette.background.paper, + outline: 'none', + input: { + fontSize: 10, + fontFamily: 'Inter', + fontWeight: 400, + color: theme.palette.text.primary, + '&::placeholder': { + fontSize: 16, + color: theme.palette.text.disabled, + }, + outline: 'none', + padding: '10px', + }, + '& .MuiOutlinedInput-root': { + '& fieldset': { + border: `0.5px solid ${theme.palette.divider}`, + }, + '&:hover fieldset': { + border: `0.5px solid ${theme.palette.divider}`, + }, + '&.Mui-focused fieldset': { + border: `0.5px solid ${theme.palette.divider}`, + }, + }, + '& .MuiInput-underline:before': { + borderBottom: 'none', + }, + '& .MuiInput-underline:hover:not(.Mui-disabled):before': { + borderBottom: 'none', + }, + '& .MuiInput-underline:after': { + borderBottom: 'none', + }, + '&:hover': { + backgroundColor: theme.palette.background.surface, + 'svg path': { + fill: theme.palette.secondary, + }, + }, +})); -export const PasswordField = forwardRef( ({ ...props }, ref) => { +export const PasswordField = forwardRef( + ({ ...props }, ref) => { const [canViewPassword, setCanViewPassword] = useState(false); + return ( - { - setCanViewPassword((prevState) => !prevState) - }}> - {canViewPassword ? : } - - ) - }} - inputRef={ref} - {...props} - /> - ) -}); \ No newline at end of file + { + setCanViewPassword((prevState) => !prevState); + }} + > + {canViewPassword ? ( + + + + ) : ( + + + + )} + + ), + }} + inputRef={ref} + {...props} + /> + ); + } +); diff --git a/src/components/QMailStatus.tsx b/src/components/QMailStatus.tsx index cb1642a..f0b51f3 100644 --- a/src/components/QMailStatus.tsx +++ b/src/components/QMailStatus.tsx @@ -1,63 +1,104 @@ -import React, { useMemo } from 'react' -import QMailLogo from '../assets/QMailLogo.png' -import { useRecoilState } from 'recoil' -import { mailsAtom, qMailLastEnteredTimestampAtom } from '../atoms/global' -import { isLessThanOneWeekOld } from './Group/QMailMessages' -import { ButtonBase, Tooltip } from '@mui/material' -import { executeEvent } from '../utils/events' -export const QMailStatus = () => { - const [lastEnteredTimestamp, setLastEnteredTimestamp] = useRecoilState(qMailLastEnteredTimestampAtom) - const [mails, setMails] = useRecoilState(mailsAtom) +import { useMemo } from 'react'; +import { mailsAtom, qMailLastEnteredTimestampAtom } from '../atoms/global'; +import { isLessThanOneWeekOld } from './Group/QMailMessages'; +import { ButtonBase, Tooltip, useTheme } from '@mui/material'; +import { executeEvent } from '../utils/events'; +import { Mail } from '@mui/icons-material'; +import { useTranslation } from 'react-i18next'; +import { useAtom } from 'jotai'; + +export const QMailStatus = () => { + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + const theme = useTheme(); + + const [lastEnteredTimestamp, setLastEnteredTimestamp] = useAtom( + qMailLastEnteredTimestampAtom + ); + const [mails, setMails] = useAtom(mailsAtom); + + const hasNewMail = useMemo(() => { + if (mails?.length === 0) return false; + const latestMail = mails[0]; + if (!lastEnteredTimestamp && isLessThanOneWeekOld(latestMail?.created)) + return true; + if ( + lastEnteredTimestamp < latestMail?.created && + isLessThanOneWeekOld(latestMail?.created) + ) + return true; + return false; + }, [lastEnteredTimestamp, mails]); - const hasNewMail = useMemo(()=> { - if(mails?.length === 0) return false - const latestMail = mails[0] - if(!lastEnteredTimestamp && isLessThanOneWeekOld(latestMail?.created)) return true - if((lastEnteredTimestamp < latestMail?.created) && isLessThanOneWeekOld(latestMail?.created)) return true - return false - }, [lastEnteredTimestamp, mails]) return ( - { - executeEvent("addTab", { data: { service: 'APP', name: 'q-mail' } }); - executeEvent("open-apps-mode", { }); - setLastEnteredTimestamp(Date.now()) - }} style={{ - position: 'relative' - }}> + { + executeEvent('addTab', { data: { service: 'APP', name: 'q-mail' } }); + executeEvent('open-apps-mode', {}); + setLastEnteredTimestamp(Date.now()); + }} + style={{ + position: 'relative', + }} + > {hasNewMail && ( -
+ height: '15px', + outline: '1px solid white', + position: 'absolute', + right: '-7px', + top: '-7px', + width: '15px', + zIndex: 1, + }} + /> )} Q-MAIL} + title={ + + {t('core:q_apps.q_mail', { + postProcess: 'capitalizeFirstChar', + })} + + } placement="left" arrow - sx={{ fontSize: "24" }} + sx={{ fontSize: '24' }} slotProps={{ tooltip: { sx: { - color: "#ffffff", - backgroundColor: "#444444", + color: theme.palette.text.primary, + backgroundColor: theme.palette.background.paper, }, }, arrow: { sx: { - color: "#444444", + color: theme.palette.text.primary, }, }, }} > - + - - ) -} + + ); +}; diff --git a/src/components/QortPayment.tsx b/src/components/QortPayment.tsx index 6add9b2..52954c1 100644 --- a/src/components/QortPayment.tsx +++ b/src/components/QortPayment.tsx @@ -1,167 +1,235 @@ -import { Box, CircularProgress } from '@mui/material'; -import React, { useEffect, useState } from 'react' -import { CustomButton, CustomInput, CustomLabel, TextP } from '../App-styles'; +import { Box, CircularProgress, useTheme } from '@mui/material'; +import { useState } from 'react'; +import { + CustomButton, + CustomInput, + CustomLabel, + TextP, +} from '../styles/App-styles'; import { Spacer } from '../common/Spacer'; -import BoundedNumericTextField from '../common/BoundedNumericTextField'; -import { PasswordField } from './PasswordField/PasswordField'; -import { ErrorText } from './ErrorText/ErrorText'; -import { getFee } from '../background'; +import { getFee } from '../background/background.ts'; +import { useTranslation } from 'react-i18next'; +import BoundedNumericTextField from '../common/BoundedNumericTextField.tsx'; +import { PasswordField } from './PasswordField/PasswordField.tsx'; +import { ErrorText } from './ErrorText/ErrorText.tsx'; -export const QortPayment = ({balance, show, onSuccess, defaultPaymentTo}) => { - const [paymentTo, setPaymentTo] = useState(defaultPaymentTo); - const [paymentAmount, setPaymentAmount] = useState(0); - const [paymentPassword, setPaymentPassword] = useState(""); - const [sendPaymentError, setSendPaymentError] = useState(""); - const [sendPaymentSuccess, setSendPaymentSuccess] = useState(""); - const [isLoadingSendCoin, setIsLoadingSendCoin] = useState(false); +export const QortPayment = ({ balance, show, onSuccess, defaultPaymentTo }) => { + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + const [paymentTo, setPaymentTo] = useState(defaultPaymentTo); + const [paymentAmount, setPaymentAmount] = useState(0); + const [paymentPassword, setPaymentPassword] = useState(''); + const [sendPaymentError, setSendPaymentError] = useState(''); + const [sendPaymentSuccess, setSendPaymentSuccess] = useState(''); + const [isLoadingSendCoin, setIsLoadingSendCoin] = useState(false); - - - const sendCoinFunc = async() => { - try { - setSendPaymentError(""); - setSendPaymentSuccess(""); - if (!paymentTo) { - setSendPaymentError("Please enter a recipient"); - return; - } - if (!paymentAmount) { - setSendPaymentError("Please enter an amount greater than 0"); - return; - } - if (!paymentPassword) { - setSendPaymentError("Please enter your wallet password"); - return; - } - const fee = await getFee('PAYMENT') - - await show({ - message: `Would you like to transfer ${Number(paymentAmount)} QORT?` , - paymentFee: fee.fee + ' QORT' + const sendCoinFunc = async () => { + try { + setSendPaymentError(''); + setSendPaymentSuccess(''); + if (!paymentTo) { + setSendPaymentError( + t('auth:action.enter_recipient', { + postProcess: 'capitalizeFirstChar', }) - setIsLoadingSendCoin(true); - window - .sendMessage("sendCoin", { - amount: Number(paymentAmount), - receiver: paymentTo.trim(), - password: paymentPassword, - }) - .then((response) => { - if (response?.error) { - setSendPaymentError(response.error); - } else { - onSuccess() - - } - setIsLoadingSendCoin(false); - }) - .catch((error) => { - console.error("Failed to send coin:", error); - setIsLoadingSendCoin(false); - }); - } catch (error) { - // error - } - }; + ); + return; + } + if (!paymentAmount) { + setSendPaymentError( + t('auth:action.enter_amount', { + postProcess: 'capitalizeFirstChar', + }) + ); + return; + } + if (!paymentPassword) { + setSendPaymentError( + t('auth:action.enter_wallet_password', { + postProcess: 'capitalizeFirstChar', + }) + ); + return; + } + + const fee = await getFee('PAYMENT'); + + await show({ + message: t('core:message.question.transfer_qort', { + amount: Number(paymentAmount), + postProcess: 'capitalizeFirstChar', + }), + paymentFee: fee.fee + ' QORT', + }); + + setIsLoadingSendCoin(true); + + window + .sendMessage('sendCoin', { + amount: Number(paymentAmount), + receiver: paymentTo.trim(), + password: paymentPassword, + }) + .then((response) => { + if (response?.error) { + setSendPaymentError(response.error); + } else { + onSuccess(); + } + setIsLoadingSendCoin(false); + }) + .catch((error) => { + console.error('Failed to send coin:', error); + setIsLoadingSendCoin(false); + }); + } catch (error) { + console.log(error); + } + }; + return ( <> - - Transfer QORT - - - - Balance: - - - {balance?.toFixed(2)} QORT - - - + sx={{ + alignItems: 'flex-start', + display: 'flex', + flexDirection: 'column', + }} + > + + {t('core:action.transfer_qort', { + postProcess: 'capitalizeFirstChar', + })} + - - To - - setPaymentTo(e.target.value)} - autoComplete="off" - /> - - - Amount - - - setPaymentAmount(+e)} - /> - - - Confirm Wallet Password - - - setPaymentPassword(e.target.value)} - autoComplete="off" - /> - - - {sendPaymentError} - {/* {sendPaymentSuccess} */} - - { - if(isLoadingSendCoin) return + + + + {t('core:balance', { + postProcess: 'capitalizeFirstChar', + })} + + + + {balance?.toFixed(2)} QORT + + + + + + + + {t('core:to', { + postProcess: 'capitalizeFirstChar', + })} + + + + + setPaymentTo(e.target.value)} + autoComplete="off" + /> + + + + + {t('core:amount', { + postProcess: 'capitalizeFirstChar', + })} + + + + + setPaymentAmount(+e)} + /> + + + + + {t('auth:wallet.password_confirmation', { + postProcess: 'capitalizeFirstChar', + })} + + + + + setPaymentPassword(e.target.value)} + autoComplete="off" + onKeyDown={(e) => { + if (e.key === 'Enter') { + if (isLoadingSendCoin) return; sendCoinFunc(); + } + }} + /> + + + + + {sendPaymentError} + + + + { + if (isLoadingSendCoin) return; + sendCoinFunc(); + }} + > + {isLoadingSendCoin && ( + - {isLoadingSendCoin && ( - - )} - Send - + /> + )} + {t('core:action.send', { postProcess: 'capitalizeFirstChar' })} + - ) -} + ); +}; diff --git a/src/components/Home/QortPrice.tsx b/src/components/QortPrice.tsx similarity index 54% rename from src/components/Home/QortPrice.tsx rename to src/components/QortPrice.tsx index f4586fb..e437a68 100644 --- a/src/components/Home/QortPrice.tsx +++ b/src/components/QortPrice.tsx @@ -1,8 +1,10 @@ -import React, { useCallback, useEffect, useState } from "react"; -import { getBaseApiReact } from "../../App"; -import { Box, Tooltip, Typography } from "@mui/material"; -import { BarSpinner } from "../../common/Spinners/BarSpinner/BarSpinner"; -import { formatDate } from "../../utils/time"; +import { useCallback, useEffect, useState } from 'react'; +import { getBaseApiReact } from '../App'; +import { Box, Tooltip, Typography, useTheme } from '@mui/material'; +import { BarSpinner } from '../common/Spinners/BarSpinner/BarSpinner'; +import { formatDate } from '../utils/time'; +import { useTranslation } from 'react-i18next'; +import i18next from 'i18next'; function getAverageLtcPerQort(trades) { let totalQort = 0; @@ -29,25 +31,26 @@ function getTwoWeeksAgoTimestamp() { return now.getTime(); // Get timestamp in milliseconds } -function formatWithCommasAndDecimals(number) { - return Number(number).toLocaleString(); +function formatWithCommasAndDecimals(number: number) { + const locale = i18next.language; + return Number(number).toLocaleString(locale); } export const QortPrice = () => { const [ltcPerQort, setLtcPerQort] = useState(null); - const [supply, setSupply] = useState(null); - const [lastBlock, setLastBlock] = useState(null); + const [supply, setSupply] = useState(''); + const [lastBlock, setLastBlock] = useState(''); const [loading, setLoading] = useState(true); + const { t } = useTranslation(['core', 'tutorial']); + const theme = useTheme(); const getPrice = useCallback(async () => { try { setLoading(true); - const response = await fetch( `${getBaseApiReact()}/crosschain/trades?foreignBlockchain=LITECOIN&minimumTimestamp=${getTwoWeeksAgoTimestamp()}&limit=20&reverse=true` ); const data = await response.json(); - setLtcPerQort(getAverageLtcPerQort(data)); } catch (error) { console.error(error); @@ -59,10 +62,8 @@ export const QortPrice = () => { const getLastBlock = useCallback(async () => { try { setLoading(true); - const response = await fetch(`${getBaseApiReact()}/blocks/last`); const data = await response.json(); - setLastBlock(data); } catch (error) { console.error(error); @@ -74,13 +75,11 @@ export const QortPrice = () => { const getSupplyInCirculation = useCallback(async () => { try { setLoading(true); - const response = await fetch( `${getBaseApiReact()}/stats/supply/circulating` ); const data = await response.text(); - formatWithCommasAndDecimals(data); - setSupply(formatWithCommasAndDecimals(data)); + setSupply(formatWithCommasAndDecimals(parseFloat(data))); } catch (error) { console.error(error); } finally { @@ -101,64 +100,63 @@ export const QortPrice = () => { return () => clearInterval(interval); }, [getPrice]); - return ( + Based on the latest 20 trades } placement="bottom" arrow - sx={{ fontSize: "24" }} + sx={{ fontSize: '24' }} slotProps={{ tooltip: { sx: { - color: "#ffffff", - backgroundColor: "#444444", + color: theme.palette.text.primary, + backgroundColor: theme.palette.background.paper, }, }, arrow: { sx: { - color: "#444444", + color: theme.palette.text.primary, }, }, }} > - Price + {t('core:price', { postProcess: 'capitalizeFirstChar' })} + {!ltcPerQort ? ( - + ) : ( {ltcPerQort} LTC/QORT @@ -166,91 +164,91 @@ export const QortPrice = () => { )} + - Supply + {t('core:supply', { postProcess: 'capitalizeFirstChar' })} + {!supply ? ( - + ) : ( {supply} QORT )} - - {lastBlock?.timestamp && formatDate(lastBlock?.timestamp)} - - } - placement="bottom" - arrow - sx={{ fontSize: "24" }} - slotProps={{ - tooltip: { - sx: { - color: "#ffffff", - backgroundColor: "#444444", - }, - }, - arrow: { - sx: { - color: "#444444", - }, - }, - }} - > - + {lastBlock?.timestamp && formatDate(lastBlock?.timestamp)} + + } + placement="bottom" + arrow + sx={{ fontSize: '24' }} + slotProps={{ + tooltip: { + sx: { + color: theme.palette.text.primary, + backgroundColor: theme.palette.background.paper, + }, + }, + arrow: { + sx: { + color: theme.palette.text.primary, + }, + }, }} > - + - Last height + {t('core:last_height', { postProcess: 'capitalizeFirstChar' })} + {!lastBlock?.height ? ( - + ) : ( - {lastBlock?.height} + {formatWithCommasAndDecimals(lastBlock?.height)} )} - - + ); diff --git a/src/components/ReactionPicker.css b/src/components/ReactionPicker.css deleted file mode 100644 index 89dbe39..0000000 --- a/src/components/ReactionPicker.css +++ /dev/null @@ -1,27 +0,0 @@ -.reaction-container { - position: relative; /* Parent must be positioned relatively */ - } - - .emoji-picker { - position: absolute; /* Picker positioned absolutely relative to the parent */ - right: 0; - z-index: 9000000000; /* Ensure picker appears above other content */ - } - - .message-container { - overflow: visible; /* Ensure the message container doesn't cut off the picker */ - } - - - .reaction-container { - position: relative; - } - - .emoji-picker { - overflow: hidden; - width: auto - } - - .EmojiPickerReact.epr-dark-theme { - --epr-emoji-size: 18px; /* Adjust emoji size for dark mode */ - } \ No newline at end of file diff --git a/src/components/ReactionPicker.tsx b/src/components/ReactionPicker.tsx index 2f5f08e..e7a4a43 100644 --- a/src/components/ReactionPicker.tsx +++ b/src/components/ReactionPicker.tsx @@ -1,9 +1,8 @@ -import React, { useState, useRef, useEffect } from 'react'; +import { useState, useRef, useEffect } from 'react'; import ReactDOM from 'react-dom'; import Picker, { EmojiStyle, Theme } from 'emoji-picker-react'; -import './ReactionPicker.css'; +import '../styles/ReactionPicker.css'; import { ButtonBase } from '@mui/material'; -import { isMobile } from '../App'; export const ReactionPicker = ({ onReaction }) => { const [showPicker, setShowPicker] = useState(false); @@ -28,15 +27,25 @@ export const ReactionPicker = ({ onReaction }) => { if (showPicker) { setShowPicker(false); } else { - // Get the button's position const buttonRect = buttonRef.current.getBoundingClientRect(); - const pickerWidth = isMobile ? 300 : 350; // Adjust based on picker width + const pickerWidth = 350; + const pickerHeight = 400; // Match Picker height prop - // Calculate position to align the right edge of the picker with the button's right edge - setPickerPosition({ - top: buttonRect.bottom + window.scrollY, // Position below the button - left: buttonRect.right + window.scrollX - pickerWidth, // Align right edges - }); + // Initial position (below the button) + let top = buttonRect.bottom + window.scrollY; + let left = buttonRect.right + window.scrollX - pickerWidth; + + // If picker would overflow bottom, show it above the button + const overflowBottom = + top + pickerHeight > window.innerHeight + window.scrollY; + if (overflowBottom) { + top = buttonRect.top + window.scrollY - pickerHeight; + } + + // Optional: prevent overflow on the left too + if (left < 0) left = 0; + + setPickerPosition({ top, left }); setShowPicker(true); } }; @@ -90,15 +99,14 @@ export const ReactionPicker = ({ onReaction }) => { }} >
, document.body diff --git a/src/components/RegisterName.tsx b/src/components/RegisterName.tsx index 35af458..faa6be5 100644 --- a/src/components/RegisterName.tsx +++ b/src/components/RegisterName.tsx @@ -1,312 +1,437 @@ -import React, { useCallback, useContext, useEffect, useState } from 'react' +import { useCallback, useEffect, useState } from 'react'; import { - Avatar, - Box, - Button, - ButtonBase, - Collapse, - Dialog, - DialogActions, - DialogContent, - DialogContentText, - DialogTitle, - Input, - ListItem, - ListItemAvatar, - ListItemButton, - ListItemIcon, - ListItemText, - List, - MenuItem, - Popover, - Select, - TextField, - Typography, - } from "@mui/material"; + Box, + Button, + Dialog, + DialogActions, + DialogContent, + DialogTitle, + ListItem, + ListItemIcon, + ListItemText, + List, + TextField, + Typography, + useTheme, +} from '@mui/material'; import { Label } from './Group/AddGroup'; import { Spacer } from '../common/Spacer'; -import { LoadingButton } from '@mui/lab'; -import { getBaseApiReact, MyContext } from '../App'; -import { getFee } from '../background'; +import { getBaseApiReact } from '../App'; +import { getFee } from '../background/background.ts'; import RadioButtonCheckedIcon from '@mui/icons-material/RadioButtonChecked'; import { subscribeToEvent, unsubscribeFromEvent } from '../utils/events'; import { BarSpinner } from '../common/Spinners/BarSpinner/BarSpinner'; import CheckIcon from '@mui/icons-material/Check'; import ErrorIcon from '@mui/icons-material/Error'; +import { useSetAtom } from 'jotai'; +import { txListAtom } from '../atoms/global'; +import { useTranslation } from 'react-i18next'; enum Availability { - NULL = 'null', - LOADING = 'loading', - AVAILABLE = 'available', - NOT_AVAILABLE = 'not-available' + NULL = 'null', + LOADING = 'loading', + AVAILABLE = 'available', + NOT_AVAILABLE = 'not-available', } -export const RegisterName = ({setOpenSnack, setInfoSnack, userInfo, show, setTxList, balance}) => { - const [isOpen, setIsOpen] = useState(false) - const [registerNameValue, setRegisterNameValue] = useState('') - const [isLoadingRegisterName, setIsLoadingRegisterName] = useState(false) - const [isNameAvailable, setIsNameAvailable] = useState(Availability.NULL) - const [nameFee, setNameFee] = useState(null) - const checkIfNameExisits = async (name)=> { - if(!name?.trim()){ - setIsNameAvailable(Availability.NULL) +export const RegisterName = ({ + setOpenSnack, + setInfoSnack, + userInfo, + show, + balance, +}) => { + const setTxList = useSetAtom(txListAtom); - return + const [isOpen, setIsOpen] = useState(false); + const [registerNameValue, setRegisterNameValue] = useState(''); + const [isLoadingRegisterName, setIsLoadingRegisterName] = useState(false); + const [isNameAvailable, setIsNameAvailable] = useState( + Availability.NULL + ); + const [nameFee, setNameFee] = useState(null); + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + const checkIfNameExisits = async (name) => { + if (!name?.trim()) { + setIsNameAvailable(Availability.NULL); + + return; } - setIsNameAvailable(Availability.LOADING) + setIsNameAvailable(Availability.LOADING); try { - const res = await fetch(`${getBaseApiReact()}/names/` + name); - const data = await res.json() - if(data?.message === 'name unknown'){ - setIsNameAvailable(Availability.AVAILABLE) - } else { - setIsNameAvailable(Availability.NOT_AVAILABLE) - } + const res = await fetch(`${getBaseApiReact()}/names/` + name); + const data = await res.json(); + if (data?.message === 'name unknown') { + setIsNameAvailable(Availability.AVAILABLE); + } else { + setIsNameAvailable(Availability.NOT_AVAILABLE); + } } catch (error) { - console.error(error) - } finally { + console.error(error); } - } - // Debounce logic - useEffect(() => { - const handler = setTimeout(() => { - checkIfNameExisits(registerNameValue); - }, 500); - - // Cleanup timeout if searchValue changes before the timeout completes - return () => { - clearTimeout(handler); - }; - }, [registerNameValue]); + }; + // Debounce logic + useEffect(() => { + const handler = setTimeout(() => { + checkIfNameExisits(registerNameValue); + }, 500); - const openRegisterNameFunc = useCallback((e) => { - setIsOpen(true) + // Cleanup timeout if searchValue changes before the timeout completes + return () => { + clearTimeout(handler); + }; + }, [registerNameValue]); - }, [ setIsOpen]); - - useEffect(() => { - subscribeToEvent("openRegisterName", openRegisterNameFunc); - - return () => { - unsubscribeFromEvent("openRegisterName", openRegisterNameFunc); - }; - }, [openRegisterNameFunc]); + const openRegisterNameFunc = useCallback( + (e) => { + setIsOpen(true); + }, + [setIsOpen] + ); - useEffect(()=> { - const nameRegistrationFee = async ()=> { - try { - const fee = await getFee("REGISTER_NAME"); - setNameFee(fee?.fee) - } catch (error) { - console.error(error) - } - } - nameRegistrationFee() - }, []) + useEffect(() => { + subscribeToEvent('openRegisterName', openRegisterNameFunc); - const registerName = async () => { + return () => { + unsubscribeFromEvent('openRegisterName', openRegisterNameFunc); + }; + }, [openRegisterNameFunc]); + + useEffect(() => { + const nameRegistrationFee = async () => { try { - if (!userInfo?.address) throw new Error("Your address was not found"); - if(!registerNameValue) throw new Error('Enter a name') - - const fee = await getFee("REGISTER_NAME"); - await show({ - message: "Would you like to register this name?", - publishFee: fee.fee + " QORT", - }); - setIsLoadingRegisterName(true); - new Promise((res, rej) => { - window - .sendMessage("registerName", { - name: registerNameValue, - }) - .then((response) => { - if (!response?.error) { - res(response); - setIsLoadingRegisterName(false); - setInfoSnack({ - type: "success", - message: - "Successfully registered. It may take a couple of minutes for the changes to propagate", - }); - setIsOpen(false); - setRegisterNameValue(""); - setOpenSnack(true); - setTxList((prev) => [ - { - ...response, - type: "register-name", - label: `Registered name: awaiting confirmation. This may take a couple minutes.`, - labelDone: `Registered name: success!`, - done: false, - }, - ...prev.filter((item) => !item.done), - ]); - return; - } - setInfoSnack({ - type: "error", - message: response?.error, - }); - setOpenSnack(true); - rej(response.error); - }) - .catch((error) => { - setInfoSnack({ - type: "error", - message: error.message || "An error occurred", - }); - setOpenSnack(true); - rej(error); - }); - }); + const fee = await getFee('REGISTER_NAME'); + setNameFee(fee?.fee); } catch (error) { - if (error?.message) { - setOpenSnack(true) - setInfoSnack({ - type: "error", - message: error?.message, - }); - } - } finally { - setIsLoadingRegisterName(false); + console.error(error); } }; + nameRegistrationFee(); + }, []); + + const registerName = async () => { + try { + if (!userInfo?.address) + throw new Error( + t('core:message.error.address_not_found', { + postProcess: 'capitalizeFirstChar', + }) + ); + if (!registerNameValue) + throw new Error( + t('core:action.enter_name', { + postProcess: 'capitalizeFirstChar', + }) + ); + + const fee = await getFee('REGISTER_NAME'); + await show({ + message: t('core:message.question.register_name', { + postProcess: 'capitalizeFirstChar', + }), + publishFee: fee.fee + ' QORT', + }); + setIsLoadingRegisterName(true); + new Promise((res, rej) => { + window + .sendMessage('registerName', { + name: registerNameValue, + }) + .then((response) => { + if (!response?.error) { + res(response); + setIsLoadingRegisterName(false); + setInfoSnack({ + type: 'success', + message: t('group:message.success.registered_name', { + postProcess: 'capitalizeFirstChar', + }), + }); + setIsOpen(false); + setRegisterNameValue(''); + setOpenSnack(true); + setTxList((prev) => [ + { + ...response, + type: 'register-name', + label: t('group:message.success.registered_name_label', { + postProcess: 'capitalizeFirstChar', + }), + labelDone: t( + 'group:message.success.registered_name_success', + { + postProcess: 'capitalizeFirstChar', + } + ), + done: false, + }, + ...prev.filter((item) => !item.done), + ]); + return; + } + setInfoSnack({ + type: 'error', + message: response?.error, + }); + setOpenSnack(true); + rej(response.error); + }) + .catch((error) => { + setInfoSnack({ + type: 'error', + message: + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }), + }); + setOpenSnack(true); + rej(error); + }); + }); + } catch (error) { + if (error?.message) { + setOpenSnack(true); + setInfoSnack({ + type: 'error', + message: error?.message, + }); + } + } finally { + setIsLoadingRegisterName(false); + } + }; return ( - - {"Register name"} - - - + + {t('core:action.register_name', { + postProcess: 'capitalizeAll', + })} + + + + - + + setRegisterNameValue(e.target.value)} value={registerNameValue} - placeholder="Choose a name" + placeholder={t('core:action.choose_name', { + postProcess: 'capitalizeFirstChar', + })} /> - {(!balance || (nameFee && balance && balance < nameFee))&& ( + {(!balance || (nameFee && balance && balance < nameFee)) && ( <> - - - - Your balance is {balance ?? 0} QORT. A name registration requires a {nameFee} QORT fee - - + + + + + + {t('core:message.generic.name_registration', { + balance: balance ?? 0, + fee: { nameFee }, + postProcess: 'capitalizeFirstChar', + })} + + + + )} + + {isNameAvailable === Availability.AVAILABLE && ( - - - {registerNameValue} is available - - )} - {isNameAvailable === Availability.NOT_AVAILABLE && ( - - - {registerNameValue} is unavailable - - )} - {isNameAvailable === Availability.LOADING && ( - - - Checking if name already existis - - )} - - Benefits of a name - - - - - - - - - - - - - - - - - - - - - - - - - - ) -} + + + {t('core:message.generic.name_unavailable', { + name: registerNameValue, + postProcess: 'capitalizeFirstChar', + })} + +
+ )} + + {isNameAvailable === Availability.LOADING && ( + + + + + {t('core:message.generic.name_checking', { + postProcess: 'capitalizeFirstChar', + })} + + + )} + + + + + {t('core:message.generic.name_benefits', { + postProcess: 'capitalizeFirstChar', + })} + + + + + + + + + + + + + + + + + + + + + + + + + + + ); +}; diff --git a/src/components/Save/Save.tsx b/src/components/Save/Save.tsx index 0c01315..49a3761 100644 --- a/src/components/Save/Save.tsx +++ b/src/components/Save/Save.tsx @@ -1,29 +1,38 @@ -import React, { useContext, useEffect, useMemo, useState } from "react"; -import { useRecoilState, useSetRecoilState } from "recoil"; -import isEqual from "lodash/isEqual"; // Import deep comparison utility +import { useContext, useEffect, useMemo, useState } from 'react'; +import isEqual from 'lodash/isEqual'; // TODO Import deep comparison utility import { - canSaveSettingToQdnAtom, hasSettingsChangedAtom, isUsingImportExportSettingsAtom, oldPinnedAppsAtom, settingsLocalLastUpdatedAtom, settingsQDNLastUpdatedAtom, sortablePinnedAppsAtom, -} from "../../atoms/global"; -import { Box, Button, ButtonBase, Popover, Typography } from "@mui/material"; -import { objectToBase64 } from "../../qdn/encryption/group-encryption"; -import { MyContext } from "../../App"; -import { getFee } from "../../background"; -import { CustomizedSnackbars } from "../Snackbar/Snackbar"; -import { SaveIcon } from "../../assets/svgs/SaveIcon"; -import { IconWrapper } from "../Desktop/DesktopFooter"; -import { Spacer } from "../../common/Spacer"; -import { LoadingButton } from "@mui/lab"; -import { saveToLocalStorage } from "../Apps/AppsNavBar"; -import { decryptData, encryptData } from "../../qortalRequests/get"; -import { saveFileToDiskGeneric } from "../../utils/generateWallet/generateWallet"; -import { base64ToUint8Array, uint8ArrayToObject } from "../../backgroundFunctions/encryption"; - +} from '../../atoms/global'; +import { + Box, + Button, + ButtonBase, + Popover, + Typography, + useTheme, +} from '@mui/material'; +import { objectToBase64 } from '../../qdn/encryption/group-encryption'; +import { QORTAL_APP_CONTEXT } from '../../App'; +import { getFee } from '../../background/background.ts'; +import { CustomizedSnackbars } from '../Snackbar/Snackbar'; +import { SaveIcon } from '../../assets/Icons/SaveIcon'; +import { IconWrapper } from '../Desktop/DesktopFooter'; +import { Spacer } from '../../common/Spacer'; +import { LoadingButton } from '@mui/lab'; +import { saveToLocalStorage } from '../Apps/AppsNavBarDesktop'; +import { decryptData, encryptData } from '../../qortal/get.ts'; +import { saveFileToDiskGeneric } from '../../utils/generateWallet/generateWallet'; +import { + base64ToUint8Array, + uint8ArrayToObject, +} from '../../encryption/encryption.ts'; +import { useTranslation } from 'react-i18next'; +import { useAtom, useSetAtom } from 'jotai'; export const handleImportClick = async () => { const fileInput = document.createElement('input'); @@ -53,27 +62,34 @@ export const handleImportClick = async () => { // Trigger the file input dialog fileInput.click(); }); - -} +}; export const Save = ({ isDesktop, disableWidth, myName }) => { - const [pinnedApps, setPinnedApps] = useRecoilState(sortablePinnedAppsAtom); - const [settingsQdnLastUpdated, setSettingsQdnLastUpdated] = useRecoilState( + const [pinnedApps, setPinnedApps] = useAtom(sortablePinnedAppsAtom); + const [settingsQdnLastUpdated, setSettingsQdnLastUpdated] = useAtom( settingsQDNLastUpdatedAtom ); - const [settingsLocalLastUpdated] = useRecoilState( - settingsLocalLastUpdatedAtom + const [settingsLocalLastUpdated] = useAtom(settingsLocalLastUpdatedAtom); + const setHasSettingsChangedAtom = useSetAtom(hasSettingsChangedAtom); + const [isUsingImportExportSettings, setIsUsingImportExportSettings] = useAtom( + isUsingImportExportSettingsAtom ); - const setHasSettingsChangedAtom = useSetRecoilState(hasSettingsChangedAtom); - const [isUsingImportExportSettings, setIsUsingImportExportSettings] = useRecoilState(isUsingImportExportSettingsAtom); - const [canSave] = useRecoilState(canSaveSettingToQdnAtom); const [openSnack, setOpenSnack] = useState(false); const [isLoading, setIsLoading] = useState(false); const [infoSnack, setInfoSnack] = useState(null); - const [oldPinnedApps, setOldPinnedApps] = useRecoilState(oldPinnedAppsAtom); + const [oldPinnedApps, setOldPinnedApps] = useAtom(oldPinnedAppsAtom); + const [anchorEl, setAnchorEl] = useState(null); - const { show } = useContext(MyContext); + const { show } = useContext(QORTAL_APP_CONTEXT); + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); const hasChanged = useMemo(() => { const newChanges = { @@ -104,8 +120,6 @@ export const Save = ({ isDesktop, disableWidth, myName }) => { settingsLocalLastUpdated, ]); - - useEffect(() => { setHasSettingsChangedAtom(hasChanged); }, [hasChanged]); @@ -124,7 +138,7 @@ export const Save = ({ isDesktop, disableWidth, myName }) => { const encryptData = await new Promise((res, rej) => { window .sendMessage( - "ENCRYPT_DATA", + 'ENCRYPT_DATA', { data64, }, @@ -139,23 +153,25 @@ export const Save = ({ isDesktop, disableWidth, myName }) => { } }) .catch((error) => { - console.error("Failed qortalRequest", error); + console.error('Failed qortalRequest', error); }); }); if (encryptData && !encryptData?.error) { - const fee = await getFee("ARBITRARY"); + const fee = await getFee('ARBITRARY'); await show({ - message: - "Would you like to publish your settings to QDN (encrypted) ?", - publishFee: fee.fee + " QORT", + message: t('core:message.generic.publish_qnd', { + postProcess: 'capitalizeFirstChar', + }), + publishFee: fee.fee + ' QORT', }); const response = await new Promise((res, rej) => { window - .sendMessage("publishOnQDN", { + .sendMessage('publishOnQDN', { data: encryptData, - identifier: "ext_saved_settings", - service: "DOCUMENT_PRIVATE", + identifier: 'ext_saved_settings', + service: 'DOCUMENT_PRIVATE', + uploadType: 'base64', }) .then((response) => { if (!response?.error) { @@ -165,24 +181,35 @@ export const Save = ({ isDesktop, disableWidth, myName }) => { rej(response.error); }) .catch((error) => { - rej(error.message || "An error occurred"); + rej( + error.message || + t('core:message.error.generic', { + postProcess: 'capitalizeFirstChar', + }) + ); }); }); if (response?.identifier) { setOldPinnedApps(pinnedApps); setSettingsQdnLastUpdated(Date.now()); setInfoSnack({ - type: "success", - message: "Sucessfully published to QDN", + type: 'success', + message: t('core:message.success.published_qdn', { + postProcess: 'capitalizeFirstChar', + }), }); setOpenSnack(true); - setAnchorEl(null) + setAnchorEl(null); } } } catch (error) { setInfoSnack({ - type: "error", - message: error?.message || "Unable to save to QDN", + type: 'error', + message: + error?.message || + t('core:message.error.save_qdn', { + postProcess: 'capitalizeFirstChar', + }), }); setOpenSnack(true); } finally { @@ -196,369 +223,407 @@ export const Save = ({ isDesktop, disableWidth, myName }) => { const revertChanges = () => { setPinnedApps(oldPinnedApps); - saveToLocalStorage("ext_saved_settings", "sortablePinnedApps", null); - setAnchorEl(null) + saveToLocalStorage('ext_saved_settings', 'sortablePinnedApps', null); + setAnchorEl(null); }; return ( <> - + {isDesktop ? ( ) : ( )} + setAnchorEl(null)} // Close popover on click outside anchorOrigin={{ - vertical: "bottom", - horizontal: "center", + vertical: 'bottom', + horizontal: 'center', }} transformOrigin={{ - vertical: "top", - horizontal: "center", + vertical: 'top', + horizontal: 'center', }} sx={{ - width: "300px", - maxWidth: "90%", - maxHeight: "80%", - overflow: "auto", + width: '300px', + maxWidth: '90%', + maxHeight: '80%', + overflow: 'auto', }} > {isUsingImportExportSettings && ( - + - You are using the export/import way of saving settings. + {t('core:message.generic.settings', { + postProcess: 'capitalizeFirstChar', + })} + + - - + size="small" + onClick={() => { + saveToLocalStorage( + 'ext_saved_settings_import_export', + 'sortablePinnedApps', + null, + true + ); + setIsUsingImportExportSettings(false); + }} + variant="contained" + sx={{ + backgroundColor: theme.palette.other.danger, + color: 'black', + fontWeight: 'bold', + opacity: 0.7, + '&:hover': { + backgroundColor: theme.palette.other.danger, + color: 'black', + opacity: 1, + }, + }} + > + {t('core:message.generic.qdn', { + postProcess: 'capitalizeFirstChar', + })} + + + )} {!isUsingImportExportSettings && ( - {!myName ? ( - - You need a registered Qortal name to save your pinned apps to QDN. - + + {t('core:message.generic.register_name', { + postProcess: 'capitalizeFirstChar', + })} + ) : ( <> - {hasChanged && ( - - - You have unsaved changes to your pinned apps. Save them to QDN. - - - - Save to QDN - - - {!isNaN(settingsQdnLastUpdated) && settingsQdnLastUpdated > 0 && ( - <> + {hasChanged && ( + - Don't like your current local changes? Would you like to - reset to your saved QDN pinned apps? + {t('core:message.generic.unsaved_changes', { + postProcess: 'capitalizeFirstChar', + })} + + - Revert to QDN - - - )} - {!isNaN(settingsQdnLastUpdated) && settingsQdnLastUpdated === 0 && ( - <> - - Don't like your current local changes? Would you like to - reset to the default pinned apps? - - - - Revert to default + {t('core:action.save_qdn', { + postProcess: 'capitalizeFirstChar', + })} - + + {!isNaN(settingsQdnLastUpdated) && + settingsQdnLastUpdated > 0 && ( + <> + + {t('core:message.question.reset_qdn', { + postProcess: 'capitalizeFirstChar', + })} + + + + {t('core:message.generic.revert_qdn', { + postProcess: 'capitalizeFirstChar', + })} + + + )} + {!isNaN(settingsQdnLastUpdated) && + settingsQdnLastUpdated === 0 && ( + <> + + {t('core:message.question.reset_pinned', { + postProcess: 'capitalizeFirstChar', + })} + + + + {t('core:message.generic.revert_default', { + postProcess: 'capitalizeFirstChar', + })} + + + )} + + )} + {!isNaN(settingsQdnLastUpdated) && + settingsQdnLastUpdated === -100 && + isUsingImportExportSettings !== true && ( + + + {t('core:message.question.overwrite_changes', { + postProcess: 'capitalizeFirstChar', + })} + + + + {t('core:message.generic.overwrite_qdn', { + postProcess: 'capitalizeFirstChar', + })} + + + )} + {!hasChanged && ( + + + {t('core:message.generic.no_pinned_changes', { + postProcess: 'capitalizeFirstChar', + })} + + )} - - )} - {!isNaN(settingsQdnLastUpdated) && settingsQdnLastUpdated === -100 && isUsingImportExportSettings !== true && ( - - - The app was unable to download your existing QDN-saved pinned - apps. Would you like to overwrite those changes? - - - - Overwrite to QDN - - - )} - {!hasChanged && ( - - - You currently do not have any changes to your pinned apps - - - - )} )} - )} - + - - { - try { - const fileContent = await handleImportClick(); - const decryptedData = await decryptData({ - encryptedData: fileContent, - }); - const decryptToUnit8ArraySubject = - base64ToUint8Array(decryptedData); - const responseData = uint8ArrayToObject( - decryptToUnit8ArraySubject - ); - if(Array.isArray(responseData)){ - saveToLocalStorage("ext_saved_settings_import_export", "sortablePinnedApps", responseData, { - isUsingImportExport: true - }); - setPinnedApps(responseData) - setOldPinnedApps(responseData) - setIsUsingImportExportSettings(true) - } - - } catch (error) { - console.log("error", error); + { + try { + const fileContent = await handleImportClick(); + const decryptedData = await decryptData({ + encryptedData: fileContent, + }); + const decryptToUnit8ArraySubject = + base64ToUint8Array(decryptedData); + const responseData = uint8ArrayToObject( + decryptToUnit8ArraySubject + ); + if (Array.isArray(responseData)) { + saveToLocalStorage( + 'ext_saved_settings_import_export', + 'sortablePinnedApps', + responseData, + { + isUsingImportExport: true, } - }}> - - Import - - { - try { - const data64 = await objectToBase64(pinnedApps); - - const encryptedData = await encryptData({ - data64, - }); - const blob = new Blob([encryptedData], { - type: "text/plain", - }); - - const timestamp = new Date() - .toISOString() - .replace(/:/g, "-"); // Safe timestamp for filenames - const filename = `qortal-new-ui-backup-settings-${timestamp}.txt`; - await saveFileToDiskGeneric(blob, filename) - - } catch (error) { - console.log('error', error) - } - }}> - Export + ); + setPinnedApps(responseData); + setOldPinnedApps(responseData); + setIsUsingImportExportSettings(true); + } + } catch (error) { + console.log('error', error); + } + }} + > + {t('core:action.import', { + postProcess: 'capitalizeFirstChar', + })} - - + + { + try { + const data64 = await objectToBase64(pinnedApps); + + const encryptedData = await encryptData({ + data64, + }); + const blob = new Blob([encryptedData], { + type: 'text/plain', + }); + + const timestamp = new Date().toISOString().replace(/:/g, '-'); // Safe timestamp for filenames + const filename = `qortal-new-ui-backup-settings-${timestamp}.txt`; + await saveFileToDiskGeneric(blob, filename); + } catch (error) { + console.log('error', error); + } + }} + > + {t('core:action.export', { + postProcess: 'capitalizeFirstChar', + })} + + + { - +export const LoadingSnackbar = ({ open, info }) => { return (
- - + + {info?.message}
); -} \ No newline at end of file +}; diff --git a/src/components/Snackbar/Snackbar.tsx b/src/components/Snackbar/Snackbar.tsx index 59fa295..d4315ed 100644 --- a/src/components/Snackbar/Snackbar.tsx +++ b/src/components/Snackbar/Snackbar.tsx @@ -1,31 +1,35 @@ -import * as React from 'react'; -import Button from '@mui/material/Button'; import Snackbar, { SnackbarCloseReason } from '@mui/material/Snackbar'; import Alert from '@mui/material/Alert'; -export const CustomizedSnackbars = ({open, setOpen, info, setInfo, duration}) => { - - - +export const CustomizedSnackbars = ({ + open, + setOpen, + info, + setInfo, + duration, +}) => { const handleClose = ( event?: React.SyntheticEvent | Event, - reason?: SnackbarCloseReason, + reason?: SnackbarCloseReason ) => { if (reason === 'clickaway') { return; } - setOpen(false); - setInfo(null) + setInfo(null); }; - if(!open) return null + if (!open) return null; + return (
- +
); -} \ No newline at end of file +}; diff --git a/src/components/TaskManager/TaskManger.tsx b/src/components/TaskManager/TaskManager.tsx similarity index 52% rename from src/components/TaskManager/TaskManger.tsx rename to src/components/TaskManager/TaskManager.tsx index a835ae1..2369a40 100644 --- a/src/components/TaskManager/TaskManger.tsx +++ b/src/components/TaskManager/TaskManager.tsx @@ -5,19 +5,32 @@ import { ListItemText, Collapse, IconButton, -} from "@mui/material"; -import React, { useContext, useEffect, useRef } from "react"; -import PendingIcon from "@mui/icons-material/Pending"; -import TaskAltIcon from "@mui/icons-material/TaskAlt"; -import ExpandLess from "@mui/icons-material/ExpandLess"; -import ExpandMore from "@mui/icons-material/ExpandMore"; -import { MyContext, getBaseApiReact, isMobile } from "../../App"; -import { executeEvent } from "../../utils/events"; + useTheme, +} from '@mui/material'; +import React, { useEffect, useRef } from 'react'; +import PendingIcon from '@mui/icons-material/Pending'; +import TaskAltIcon from '@mui/icons-material/TaskAlt'; +import ExpandLess from '@mui/icons-material/ExpandLess'; +import ExpandMore from '@mui/icons-material/ExpandMore'; +import { getBaseApiReact } from '../../App'; +import { executeEvent } from '../../utils/events'; +import { useAtom } from 'jotai'; +import { memberGroupsAtom, txListAtom } from '../../atoms/global'; +import { useTranslation } from 'react-i18next'; export const TaskManager = ({ getUserInfo }) => { - const { txList, setTxList, memberGroups } = useContext(MyContext); + const [memberGroups] = useAtom(memberGroupsAtom); + const [txList, setTxList] = useAtom(txListAtom); const [open, setOpen] = React.useState(false); const intervals = useRef({}); + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); const handleClick = () => { setOpen((prev) => !prev); @@ -58,7 +71,9 @@ export const TaskManager = ({ getUserInfo }) => { } clearInterval(intervals.current[signature]); } - } catch (error) {} + } catch (error) { + console.log(error); + } stop = false; } }; @@ -71,7 +86,7 @@ export const TaskManager = ({ getUserInfo }) => { let previousData = [...prev]; memberGroups.forEach((group) => { const findGroup = txList.findIndex( - (tx) => tx?.type === "joined-group" && tx?.groupId === group.groupId + (tx) => tx?.type === 'joined-group' && tx?.groupId === group.groupId ); if (findGroup !== -1 && !previousData[findGroup]?.done) { previousData[findGroup].done = true; @@ -81,7 +96,7 @@ export const TaskManager = ({ getUserInfo }) => { memberGroups.forEach((group) => { const findGroup = txList.findIndex( (tx) => - tx?.type === "created-group" && tx?.groupName === group.groupName + tx?.type === 'created-group' && tx?.groupName === group.groupName ); if (findGroup !== -1 && !previousData[findGroup]?.done) { previousData[findGroup].done = true; @@ -90,52 +105,54 @@ export const TaskManager = ({ getUserInfo }) => { prev.forEach((tx, index) => { if ( - tx?.type === "leave-group" && - memberGroups.findIndex((group) => tx?.groupId === group.groupId) === -1 + tx?.type === 'leave-group' && + memberGroups.findIndex((group) => tx?.groupId === group.groupId) === + -1 ) { previousData[index].done = true; } }); - - return previousData; }); }, [memberGroups, getUserInfo]); - useEffect(()=> { - - txList.forEach((tx) => { - if ( - ["created-common-secret", "joined-group-request", "join-request-accept"].includes( - tx?.type - ) && - tx?.signature && - !tx.done - ) { - if (!intervals.current[tx.signature]) { - getStatus({ signature: tx.signature }); - } + useEffect(() => { + txList.forEach((tx) => { + if ( + [ + 'created-common-secret', + 'joined-group-request', + 'join-request-accept', + ].includes(tx?.type) && + tx?.signature && + !tx.done + ) { + if (!intervals.current[tx.signature]) { + getStatus({ signature: tx.signature }); } - if (tx?.type === "register-name" && tx?.signature && !tx.done) { - if (!intervals.current[tx.signature]) { - getStatus({ signature: tx.signature }, getUserInfo); - } + } + if (tx?.type === 'register-name' && tx?.signature && !tx.done) { + if (!intervals.current[tx.signature]) { + getStatus({ signature: tx.signature }, getUserInfo); } - if((tx?.type === "remove-rewardShare" || tx?.type === "add-rewardShare") && tx?.signature && !tx.done){ - if (!intervals.current[tx.signature]) { - const sendEventForRewardShare = ()=> { - executeEvent('refresh-rewardshare-list', {}) - } - getStatus({ signature: tx.signature }, sendEventForRewardShare); - } + } + if ( + (tx?.type === 'remove-rewardShare' || tx?.type === 'add-rewardShare') && + tx?.signature && + !tx.done + ) { + if (!intervals.current[tx.signature]) { + const sendEventForRewardShare = () => { + executeEvent('refresh-rewardshare-list', {}); + }; + getStatus({ signature: tx.signature }, sendEventForRewardShare); } - }); + } + }); + }, [txList]); - }, [txList]) - - if (isMobile || txList?.length === 0 || txList.every((item) => item?.done)) - return null; + if (txList?.length === 0 || txList.every((item) => item?.done)) return null; return ( <> @@ -143,48 +160,59 @@ export const TaskManager = ({ getUserInfo }) => { - {txList.some((item) => !item.done) ? : } + {txList.some((item) => !item.done) ? ( + + ) : ( + + )} )} {open && ( - + {txList.some((item) => !item.done) ? ( - + ) : ( - + )} - + + {open ? : } + {txList.map((item) => ( diff --git a/src/components/Theme/ThemeContext.tsx b/src/components/Theme/ThemeContext.tsx new file mode 100644 index 0000000..3044045 --- /dev/null +++ b/src/components/Theme/ThemeContext.tsx @@ -0,0 +1,134 @@ +import { + createContext, + useContext, + useState, + useMemo, + useEffect, + useCallback, +} from 'react'; +import { + ThemeProvider as MuiThemeProvider, + createTheme, +} from '@mui/material/styles'; +import { lightThemeOptions } from '../../styles/theme-light'; +import { darkThemeOptions } from '../../styles/theme-dark'; +import i18n from '../../i18n/i18n'; + +const defaultTheme = { + id: 'default', + name: i18n.t('core:theme.default', { + postProcess: 'capitalizeFirstChar', + }), + light: lightThemeOptions.palette, + dark: darkThemeOptions.palette, +}; + +const ThemeContext = createContext({ + themeMode: 'dark', + toggleTheme: () => {}, + userThemes: [defaultTheme], + addUserTheme: (themes) => {}, + setUserTheme: (theme, themes) => {}, + currentThemeId: 'default', +}); + +export const ThemeProvider = ({ children }) => { + const [themeMode, setThemeMode] = useState('dark'); + const [userThemes, setUserThemes] = useState([defaultTheme]); + const [currentThemeId, setCurrentThemeId] = useState('default'); + + const currentTheme = + userThemes.find((theme) => theme.id === currentThemeId) || defaultTheme; + + const muiTheme = useMemo(() => { + const baseThemeOptions = + themeMode === 'light' ? lightThemeOptions : darkThemeOptions; + + const palette = + themeMode === 'light' ? currentTheme.light : currentTheme.dark; + + return createTheme({ + ...baseThemeOptions, + palette, + }); + }, [themeMode, currentTheme]); + + const saveSettings = ( + themes = userThemes, + mode = themeMode, + themeId = currentThemeId + ) => { + localStorage.setItem( + 'saved_ui_theme', + JSON.stringify({ + mode, + userThemes: themes, + currentThemeId: themeId, + }) + ); + }; + + const toggleTheme = () => { + setThemeMode((prev) => { + const newMode = prev === 'light' ? 'dark' : 'light'; + saveSettings(userThemes, newMode, currentThemeId); + return newMode; + }); + }; + + const addUserTheme = (themes) => { + setUserThemes(themes); + saveSettings(themes); + }; + + const setUserTheme = (theme, themes) => { + if (theme.id === 'default') { + setCurrentThemeId('default'); + saveSettings(themes || userThemes, themeMode, 'default'); + } else { + setCurrentThemeId(theme.id); + saveSettings(themes || userThemes, themeMode, theme.id); + } + }; + + const loadSettings = useCallback(() => { + const saved = localStorage.getItem('saved_ui_theme'); + if (saved) { + try { + const parsed = JSON.parse(saved); + if (parsed.mode === 'light' || parsed.mode === 'dark') + setThemeMode(parsed.mode); + if (Array.isArray(parsed.userThemes)) { + const filteredThemes = parsed.userThemes.filter( + (theme) => theme.id !== 'default' + ); + setUserThemes([defaultTheme, ...filteredThemes]); + } + if (parsed.currentThemeId) setCurrentThemeId(parsed.currentThemeId); + } catch (error) { + console.error('Failed to parse saved_ui_theme:', error); + } + } + }, []); + + useEffect(() => { + loadSettings(); + }, [loadSettings]); + + return ( + + {children} + + ); +}; + +export const useThemeContext = () => useContext(ThemeContext); diff --git a/src/components/Theme/ThemeManager.tsx b/src/components/Theme/ThemeManager.tsx new file mode 100644 index 0000000..f5d89f3 --- /dev/null +++ b/src/components/Theme/ThemeManager.tsx @@ -0,0 +1,457 @@ +import { useState, useRef, useEffect } from 'react'; +import { + Box, + Button, + IconButton, + Typography, + Dialog, + DialogTitle, + DialogContent, + DialogActions, + List, + ListItemText, + TextField, + Tabs, + Tab, + ListItemButton, + useTheme, + ListItem, +} from '@mui/material'; +import { Sketch } from '@uiw/react-color'; +import DeleteIcon from '@mui/icons-material/Delete'; +import EditIcon from '@mui/icons-material/Edit'; +import AddIcon from '@mui/icons-material/Add'; +import CheckIcon from '@mui/icons-material/Check'; +import { useThemeContext } from './ThemeContext'; +import { darkThemeOptions } from '../../styles/theme-dark'; +import { lightThemeOptions } from '../../styles/theme-light'; +import ShortUniqueId from 'short-unique-id'; +import { rgbStringToHsva, rgbaStringToHsva } from '@uiw/color-convert'; +import FileDownloadIcon from '@mui/icons-material/FileDownload'; +import { saveFileToDiskGeneric } from '../../utils/generateWallet/generateWallet'; +import { handleImportClick } from '../../utils/fileReading'; +import { useTranslation } from 'react-i18next'; +import '../../styles/themeManager.css'; + +const uid = new ShortUniqueId({ length: 8 }); + +function detectColorFormat(color) { + if (typeof color !== 'string') return null; + if (color.startsWith('rgba')) return 'rgba'; + if (color.startsWith('rgb')) return 'rgb'; + return null; +} + +const validateTheme = (theme) => { + if (typeof theme !== 'object' || !theme) return false; + if (typeof theme.name !== 'string') return false; + if (!theme.light || typeof theme.light !== 'object') return false; + if (!theme.dark || typeof theme.dark !== 'object') return false; + + // Optional: deeper checks on structure + const requiredKeys = [ + 'primary', + 'secondary', + 'background', + 'text', + 'border', + 'other', + ]; + + for (const mode of ['light', 'dark']) { + const modeTheme = theme[mode]; + if (modeTheme.mode !== mode) return false; + + for (const key of requiredKeys) { + if (!modeTheme[key] || typeof modeTheme[key] !== 'object') { + return false; + } + } + } + + return true; +}; + +export default function ThemeManager() { + const theme = useTheme(); + const { userThemes, addUserTheme, setUserTheme, currentThemeId } = + useThemeContext(); + const [openEditor, setOpenEditor] = useState(false); + const [themeDraft, setThemeDraft] = useState({ + id: '', + name: '', + light: {}, + dark: {}, + }); + const [currentTab, setCurrentTab] = useState('light'); + const nameInputRef = useRef(null); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + + useEffect(() => { + if (openEditor && nameInputRef.current) { + nameInputRef.current.focus(); + } + }, [openEditor]); + + const handleAddTheme = () => { + setThemeDraft({ + id: '', + name: '', + light: structuredClone(lightThemeOptions.palette), + dark: structuredClone(darkThemeOptions.palette), + }); + setOpenEditor(true); + }; + + const handleEditTheme = (themeId) => { + const themeToEdit = userThemes.find((theme) => theme.id === themeId); + if (themeToEdit) { + setThemeDraft({ ...themeToEdit }); + setOpenEditor(true); + } + }; + + const handleSaveTheme = () => { + if (themeDraft.id) { + const updatedThemes = [...userThemes]; + const index = updatedThemes.findIndex( + (theme) => theme.id === themeDraft.id + ); + if (index !== -1) { + updatedThemes[index] = themeDraft; + addUserTheme(updatedThemes); + } + } else { + const newTheme = { ...themeDraft, id: uid.rnd() }; + const updatedThemes = [...userThemes, newTheme]; + addUserTheme(updatedThemes); + setUserTheme(newTheme, updatedThemes); + } + setOpenEditor(false); + }; + + const handleDeleteTheme = (id) => { + const updatedThemes = userThemes.filter((theme) => theme.id !== id); + addUserTheme(updatedThemes); + + if (id === currentThemeId) { + // Find the default theme object in the list + const defaultTheme = updatedThemes.find( + (theme) => theme.id === 'default' + ); + + if (defaultTheme) { + setUserTheme(defaultTheme, updatedThemes); + } else { + // Emergency fallback + setUserTheme( + { + light: lightThemeOptions, + dark: darkThemeOptions, + }, + updatedThemes + ); + } + } + }; + + const handleApplyTheme = (theme) => { + setUserTheme(theme, null); + }; + + const handleColorChange = (mode, fieldPath, color) => { + setThemeDraft((prev) => { + const updated = { ...prev }; + const paths = fieldPath.split('.'); + updated[mode][paths[0]][paths[1]] = color.hex; + return updated; + }); + }; + + const renderColorPicker = (mode, label, fieldPath, currentValue) => { + let color = currentValue || '#ffffff'; + const format = detectColorFormat(currentValue); + if (format === 'rgba') { + color = rgbaStringToHsva(currentValue); + } else if (format === 'rgb') { + color = rgbStringToHsva(currentValue); + } + return ( + + + {label} + + + handleColorChange(mode, fieldPath, color)} + /> + + ); + }; + + const exportTheme = async (theme) => { + try { + const copyTheme = structuredClone(theme); + delete copyTheme.id; + const fileName = `ui_theme_${theme.name}.json`; + + const blob = new Blob([JSON.stringify(copyTheme, null, 2)], { + type: 'application/json', + }); + + await saveFileToDiskGeneric(blob, fileName); + } catch (error) { + console.error(error); + } + }; + + const importTheme = async (theme) => { + try { + const fileContent = await handleImportClick('.json'); + const importedTheme = JSON.parse(fileContent); + if (!validateTheme(importedTheme)) { + throw new Error( + t('core:message.generic.invalid_theme_format', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + const newTheme = { ...importedTheme, id: uid.rnd() }; + const updatedThemes = [...userThemes, newTheme]; + addUserTheme(updatedThemes); + + setUserTheme(newTheme, updatedThemes); + } catch (error) { + console.error(error); + } + }; + + return ( + + + {t('core:theme.manager', { postProcess: 'capitalizeFirstChar' })} + + + + + + + + {userThemes?.map((theme, index) => ( + + + + {theme.id !== 'default' && ( + <> + exportTheme(theme)}> + + + handleEditTheme(theme.id)}> + + + handleDeleteTheme(theme.id)}> + + + + )} + handleApplyTheme(theme)}> + + + + } + > + + ))} + + + setOpenEditor(false)} + fullWidth + maxWidth="md" + > + + {themeDraft.id + ? t('core:action.edit_theme', { + postProcess: 'capitalizeFirstChar', + }) + : t('core:action.new.theme', { + postProcess: 'capitalizeFirstChar', + })} + + + + + setThemeDraft((prev) => ({ ...prev, name: e.target.value })) + } + /> + + setCurrentTab(newValue)} + sx={{ mt: 2, mb: 2 }} + > + + + + + + {renderColorPicker( + currentTab, + 'Primary Main', + 'primary.main', + themeDraft[currentTab]?.primary?.main + )} + {renderColorPicker( + currentTab, + 'Primary Dark', + 'primary.dark', + themeDraft[currentTab]?.primary?.dark + )} + {renderColorPicker( + currentTab, + 'Primary Light', + 'primary.light', + themeDraft[currentTab]?.primary?.light + )} + {renderColorPicker( + currentTab, + 'Secondary Main', + 'secondary.main', + themeDraft[currentTab]?.secondary?.main + )} + {renderColorPicker( + currentTab, + 'Background Default', + 'background.default', + themeDraft[currentTab]?.background?.default + )} + {renderColorPicker( + currentTab, + 'Background Paper', + 'background.paper', + themeDraft[currentTab]?.background?.paper + )} + {renderColorPicker( + currentTab, + 'Background Surface', + 'background.surface', + themeDraft[currentTab]?.background?.surface + )} + {renderColorPicker( + currentTab, + 'Text Primary', + 'text.primary', + themeDraft[currentTab]?.text?.primary + )} + {renderColorPicker( + currentTab, + 'Text Secondary', + 'text.secondary', + themeDraft[currentTab]?.text?.secondary + )} + {renderColorPicker( + currentTab, + 'Border Main', + 'border.main', + themeDraft[currentTab]?.border?.main + )} + {renderColorPicker( + currentTab, + 'Border Subtle', + 'border.subtle', + themeDraft[currentTab]?.border?.subtle + )} + {renderColorPicker( + currentTab, + 'Positive', + 'other.positive', + themeDraft[currentTab]?.other?.positive + )} + {renderColorPicker( + currentTab, + 'Danger', + 'other.danger', + themeDraft[currentTab]?.other?.danger + )} + {renderColorPicker( + currentTab, + 'Unread', + 'other.unread', + themeDraft[currentTab]?.other?.unread + )} + + + + + + + + + + + ); +} diff --git a/src/components/Theme/ThemeSelector.tsx b/src/components/Theme/ThemeSelector.tsx new file mode 100644 index 0000000..d7b7c39 --- /dev/null +++ b/src/components/Theme/ThemeSelector.tsx @@ -0,0 +1,35 @@ +import { useThemeContext } from './ThemeContext'; +import { Box, IconButton, Tooltip, useTheme } from '@mui/material'; +import LightModeIcon from '@mui/icons-material/LightMode'; +import DarkModeIcon from '@mui/icons-material/DarkMode'; +import { useTranslation } from 'react-i18next'; +import { useRef } from 'react'; + +const ThemeSelector = () => { + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + const { themeMode, toggleTheme } = useThemeContext(); + const selectorRef = useRef(null); + const theme = useTheme(); + + return ( + + + {themeMode === 'dark' ? : } + + + ); +}; + +export default ThemeSelector; diff --git a/src/components/Tutorials/Tutorials.tsx b/src/components/Tutorials/Tutorials.tsx index 4f9ea49..6b41586 100644 --- a/src/components/Tutorials/Tutorials.tsx +++ b/src/components/Tutorials/Tutorials.tsx @@ -1,72 +1,107 @@ -import React, { useContext, useState } from 'react' -import { GlobalContext, MyContext } from '../../App'; -import { Button, Dialog, DialogActions, DialogContent, DialogTitle, IconButton, Tab, Tabs, Typography } from '@mui/material'; +import { useContext, useState } from 'react'; +import { QORTAL_APP_CONTEXT } from '../../App'; +import { + Button, + Dialog, + DialogActions, + DialogContent, + DialogTitle, + IconButton, + Tab, + Tabs, + useTheme, +} from '@mui/material'; import CloseIcon from '@mui/icons-material/Close'; import { VideoPlayer } from '../Embeds/VideoPlayer'; +import { useTranslation } from 'react-i18next'; export const Tutorials = () => { - const { openTutorialModal, setOpenTutorialModal } = useContext(GlobalContext); - const [multiNumber, setMultiNumber] = useState(0) - const handleClose = ()=> { - setOpenTutorialModal(null) - setMultiNumber(0) - } - if(!openTutorialModal) return null - if(openTutorialModal?.multi){ - const selectedTutorial = openTutorialModal?.multi[multiNumber] - return ( - { + setOpenTutorialModal(null); + setMultiNumber(0); + }; + + if (!openTutorialModal) return null; + + if (openTutorialModal?.multi) { + const selectedTutorial = openTutorialModal?.multi[multiNumber]; + return ( + - setMultiNumber(value)} aria-label="basic tabs example"> - {openTutorialModal?.multi?.map((item, index)=> { - return ( - - - ) - })} - - - {selectedTutorial?.title} {` Tutorial`} - + setMultiNumber(value)} + > + {openTutorialModal?.multi?.map((item, index) => { + return ( + + ); + })} + + + {selectedTutorial?.title} + ({ + sx={{ + bgcolor: theme.palette.background.default, + color: theme.palette.text.primary, position: 'absolute', right: 8, top: 8, - color: theme.palette.grey[500], - })} + }} > - - + + - ) - } + ); + } + return ( <> { fullWidth={true} maxWidth="xl" > - + {openTutorialModal?.title} {` Tutorial`} + ({ + sx={{ + bgcolor: theme.palette.background.default, + color: theme.palette.text.primary, position: 'absolute', right: 8, top: 8, - color: theme.palette.grey[500], - })} + }} > - - + + + - ) -} + ); +}; diff --git a/src/components/Tutorials/useHandleTutorials.tsx b/src/components/Tutorials/useHandleTutorials.tsx deleted file mode 100644 index 2fabfa0..0000000 --- a/src/components/Tutorials/useHandleTutorials.tsx +++ /dev/null @@ -1,192 +0,0 @@ -import React, { useCallback, useEffect, useState } from "react"; -import { saveToLocalStorage } from "../Apps/AppsNavBar"; -import creationImg from './img/creation.webp' -import dashboardImg from './img/dashboard.webp' -import groupsImg from './img/groups.webp' -import importantImg from './img/important.webp' -import navigationImg from './img/navigation.webp' -import overviewImg from './img/overview.webp' -import startedImg from './img/started.webp' -import obtainingImg from './img/obtaining-qort.jpg' - -const checkIfGatewayIsOnline = async () => { - try { - const url = `https://ext-node.qortal.link/admin/status`; - const response = await fetch(url, { - method: "GET", - headers: { - "Content-Type": "application/json", - }, - }); - const data = await response.json(); - if (data?.height) { - return true - } - return false - - } catch (error) { - return false - - } - } -export const useHandleTutorials = () => { - const [openTutorialModal, setOpenTutorialModal] = useState(null); -const [shownTutorials, setShowTutorials] = useState(null) - -useEffect(()=> { - try { - const storedData = localStorage.getItem('shown-tutorials'); - - - if (storedData) { - setShowTutorials(JSON.parse(storedData)); - } else { - setShowTutorials({}) - } - } catch (error) { - //error - } -}, []) - - const saveShowTutorial = useCallback((type)=> { - try { - - setShowTutorials((prev)=> { - return { - ...(prev || {}), - [type]: true - } - }) - saveToLocalStorage('shown-tutorials', type, true) - } catch (error) { - //error - } - }, []) - const showTutorial = useCallback(async (type, isForce) => { - try { - const isOnline = await checkIfGatewayIsOnline() - if(!isOnline) return - switch (type) { - case "create-account": - { - if((shownTutorials || {})['create-account'] && !isForce) return - saveShowTutorial('create-account') - setOpenTutorialModal({ - title: "Account Creation", - resource: { - name: "a-test", - service: "VIDEO", - identifier: "account-creation-hub", - poster: creationImg - }, - }); - } - break; - case "important-information": - { - if((shownTutorials || {})['important-information'] && !isForce) return - saveShowTutorial('important-information') - - setOpenTutorialModal({ - title: "Important Information!", - resource: { - name: "a-test", - service: "VIDEO", - identifier: "important-information-hub", - poster: importantImg - }, - }); - } - break; - case "getting-started": - { - if((shownTutorials || {})['getting-started'] && !isForce) return - saveShowTutorial('getting-started') - - setOpenTutorialModal({ - multi: [ - - { - title: "1. Getting Started", - resource: { - name: "a-test", - service: "VIDEO", - identifier: "getting-started-hub", - poster: startedImg - }, - }, - { - title: "2. Overview", - resource: { - name: "a-test", - service: "VIDEO", - identifier: "overview-hub", - poster: overviewImg - }, - }, - { - title: "3. Qortal Groups", - resource: { - name: "a-test", - service: "VIDEO", - identifier: "groups-hub", - poster: groupsImg - }, - }, - { - title: "4. Obtaining Qort", - resource: { - name: "a-test", - service: "VIDEO", - identifier: "obtaining-qort", - poster: obtainingImg - }, - }, - ], - }); - } - break; - case "qapps": - { - if((shownTutorials || {})['qapps'] && !isForce) return - saveShowTutorial('qapps') - - setOpenTutorialModal({ - multi: [ - { - title: "1. Apps Dashboard", - resource: { - name: "a-test", - service: "VIDEO", - identifier: "apps-dashboard-hub", - poster: dashboardImg - }, - }, - { - title: "2. Apps Navigation", - resource: { - name: "a-test", - service: "VIDEO", - identifier: "apps-navigation-hub", - poster: navigationImg - }, - } - ], - }); - } - break; - default: - break; - } - } catch (error) { - //error - } - }, [shownTutorials]); - return { - showTutorial, - hasSeenGettingStarted: shownTutorials === null ? null : !!(shownTutorials || {})['getting-started'], - openTutorialModal, - setOpenTutorialModal, - shownTutorialsInitiated: !!shownTutorials - }; -}; diff --git a/src/components/UserLookup.tsx/UserLookup.tsx b/src/components/UserLookup.tsx/UserLookup.tsx index 300ca2f..dc63094 100644 --- a/src/components/UserLookup.tsx/UserLookup.tsx +++ b/src/components/UserLookup.tsx/UserLookup.tsx @@ -1,5 +1,5 @@ -import React, { useCallback, useEffect, useState } from "react"; -import { DrawerUserLookup } from "../Drawer/DrawerUserLookup"; +import { useCallback, useEffect, useMemo, useState } from 'react'; +import { DrawerUserLookup } from '../Drawer/DrawerUserLookup'; import { Avatar, Box, @@ -16,16 +16,29 @@ import { Typography, Table, CircularProgress, -} from "@mui/material"; -import { getAddressInfo, getNameOrAddress } from "../../background"; -import { getBaseApiReact } from "../../App"; -import { getNameInfo } from "../Group/Group"; -import AccountCircleIcon from "@mui/icons-material/AccountCircle"; -import { Spacer } from "../../common/Spacer"; -import { formatTimestamp } from "../../utils/time"; -import CloseFullscreenIcon from '@mui/icons-material/CloseFullscreen'; -import SearchIcon from '@mui/icons-material/Search'; -import { executeEvent, subscribeToEvent, unsubscribeFromEvent } from "../../utils/events"; + useTheme, + Autocomplete, + IconButton, + ClickAwayListener, +} from '@mui/material'; +import { + getAddressInfo, + getNameOrAddress, +} from '../../background/background.ts'; +import { getBaseApiReact } from '../../App'; +import { getNameInfo } from '../Group/Group'; +import AccountCircleIcon from '@mui/icons-material/AccountCircle'; +import { Spacer } from '../../common/Spacer'; +import { formatTimestamp } from '../../utils/time'; +import CloseIcon from '@mui/icons-material/Close'; +import { + executeEvent, + subscribeToEvent, + unsubscribeFromEvent, +} from '../../utils/events'; +import { useNameSearch } from '../../hooks/useNameSearch'; +import { useTranslation } from 'react-i18next'; +import { validateAddress } from '../../utils/validateAddress.ts'; function formatAddress(str) { if (str.length <= 12) return str; @@ -37,471 +50,600 @@ function formatAddress(str) { } export const UserLookup = ({ isOpenDrawerLookup, setIsOpenDrawerLookup }) => { - const [nameOrAddress, setNameOrAddress] = useState(""); - const [errorMessage, setErrorMessage] = useState(""); + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + const [nameOrAddress, setNameOrAddress] = useState(''); + const [inputValue, setInputValue] = useState(''); + const { results, isLoading } = useNameSearch(inputValue); + const options = useMemo(() => { + const isAddress = validateAddress(inputValue); + if (isAddress) return [inputValue]; + return results?.map((item) => item.name); + }, [results, inputValue]); + const [errorMessage, setErrorMessage] = useState(''); const [addressInfo, setAddressInfo] = useState(null); const [isLoadingUser, setIsLoadingUser] = useState(false); const [isLoadingPayments, setIsLoadingPayments] = useState(false); const [payments, setPayments] = useState([]); - const lookupFunc = useCallback(async (messageAddressOrName) => { - try { - setErrorMessage('') - setIsLoadingUser(true) - setPayments([]) - setAddressInfo(null) - const inputAddressOrName = messageAddressOrName || nameOrAddress - if (!inputAddressOrName?.trim()) - throw new Error("Please insert a name or address"); - const owner = await getNameOrAddress(inputAddressOrName); - if (!owner) throw new Error("Name does not exist"); - const addressInfoRes = await getAddressInfo(owner); - if (!addressInfoRes?.publicKey) { - throw new Error("Address does not exist on blockchain"); + + const lookupFunc = useCallback( + async (messageAddressOrName) => { + try { + setErrorMessage(''); + setIsLoadingUser(true); + setPayments([]); + setAddressInfo(null); + const inputAddressOrName = messageAddressOrName || nameOrAddress; + + if (!inputAddressOrName?.trim()) + throw new Error( + t('auth:action.insert_name_address', { + postProcess: 'capitalizeFirstChar', + }) + ); + + const owner = await getNameOrAddress(inputAddressOrName); + if (!owner) + throw new Error( + t('auth:message.error.name_not_existing', { + postProcess: 'capitalizeFirstChar', + }) + ); + + const addressInfoRes = await getAddressInfo(owner); + if (!addressInfoRes?.publicKey) { + throw new Error( + t('auth:message.error.address_not_existing', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + const isAddress = validateAddress(messageAddressOrName); + const name = !isAddress + ? messageAddressOrName + : await getNameInfo(owner); + const balanceRes = await fetch( + `${getBaseApiReact()}/addresses/balance/${owner}` + ); + + const balanceData = await balanceRes.json(); + setAddressInfo({ + ...addressInfoRes, + balance: balanceData, + name, + }); + setIsLoadingUser(false); + setIsLoadingPayments(true); + + const getPayments = await fetch( + `${getBaseApiReact()}/transactions/search?txType=PAYMENT&address=${owner}&confirmationStatus=CONFIRMED&limit=20&reverse=true` + ); + const paymentsData = await getPayments.json(); + setPayments(paymentsData); + } catch (error) { + setErrorMessage(error?.message); + console.error(error); + } finally { + setIsLoadingUser(false); + setIsLoadingPayments(false); } - const name = await getNameInfo(owner); - const balanceRes = await fetch( - `${getBaseApiReact()}/addresses/balance/${owner}` - ); - const balanceData = await balanceRes.json(); - setAddressInfo({ - ...addressInfoRes, - balance: balanceData, - name, - }); - setIsLoadingUser(false) - setIsLoadingPayments(true) + }, + [nameOrAddress] + ); - const getPayments = await fetch( - `${getBaseApiReact()}/transactions/search?txType=PAYMENT&address=${owner}&confirmationStatus=CONFIRMED&limit=20&reverse=true` - ); - const paymentsData = await getPayments.json(); - setPayments(paymentsData); - - } catch (error) { - setErrorMessage(error?.message) - console.error(error); - } finally { - setIsLoadingUser(false) - setIsLoadingPayments(false) - } - }, [nameOrAddress]); - - const openUserLookupDrawerFunc = useCallback((e) => { - setIsOpenDrawerLookup(true) + const openUserLookupDrawerFunc = useCallback( + (e) => { + setIsOpenDrawerLookup(true); const message = e.detail?.addressOrName; - if(message){ - lookupFunc(message) + if (message) { + lookupFunc(message); } - }, [lookupFunc, setIsOpenDrawerLookup]); - - useEffect(() => { - subscribeToEvent("openUserLookupDrawer", openUserLookupDrawerFunc); - - return () => { - unsubscribeFromEvent("openUserLookupDrawer", openUserLookupDrawerFunc); - }; - }, [openUserLookupDrawerFunc]); + }, + [lookupFunc, setIsOpenDrawerLookup] + ); - const onClose = ()=> { - setIsOpenDrawerLookup(false) - setNameOrAddress('') - setErrorMessage('') - setPayments([]) - setIsLoadingUser(false) - setIsLoadingPayments(false) - setAddressInfo(null) - } + useEffect(() => { + subscribeToEvent('openUserLookupDrawer', openUserLookupDrawerFunc); + return () => { + unsubscribeFromEvent('openUserLookupDrawer', openUserLookupDrawerFunc); + }; + }, [openUserLookupDrawerFunc]); + + const onClose = () => { + setIsOpenDrawerLookup(false); + setNameOrAddress(''); + setInputValue(''); + setErrorMessage(''); + setPayments([]); + setIsLoadingUser(false); + setIsLoadingPayments(false); + setAddressInfo(null); + }; return ( - - - - - setNameOrAddress(e.target.value)} - size="small" - placeholder="Address or Name" - autoComplete="off" - onKeyDown={(e) => { - if (e.key === "Enter" && nameOrAddress) { - lookupFunc(); - } - }} - /> - { - lookupFunc(); - }} > - - - { - onClose() - }}> - - - + - {!isLoadingUser && errorMessage && ( - - {errorMessage} - - )} - {isLoadingUser && ( - - - - )} - {!isLoadingUser && addressInfo && ( - <> - - - { + if (!newValue) { + setNameOrAddress(''); + return; + } + setNameOrAddress(newValue); + lookupFunc(newValue); }} - > - - {addressInfo?.name ?? "Name not registered"} - - - - {addressInfo?.name ? ( - - - - ) : ( - - )} - - - - Level {addressInfo?.level} - - - { + setInputValue(newInputValue); }} - > + id="controllable-states-demo" + loading={isLoading} + noOptionsText={t('core:option_no', { + postProcess: 'capitalizeFirstChar', + })} + options={options} + sx={{ flexGrow: 1 }} + renderInput={(params) => ( + { + if (e.key === 'Enter' && inputValue) { + lookupFunc(inputValue); + } + }} + /> + )} + /> + + + + {!isLoadingUser && errorMessage && ( + {errorMessage} + + )} + + {isLoadingUser && ( + + + + )} + + {!isLoadingUser && addressInfo && ( + <> + - Address - - - copy address - - } - placement="bottom" - arrow - sx={{ fontSize: "24" }} - slotProps={{ - tooltip: { - sx: { - color: "#ffffff", - backgroundColor: "#444444", - }, - }, - arrow: { - sx: { - color: "#444444", - }, - }, - }} - > - { - navigator.clipboard.writeText(addressInfo?.address); + - {addressInfo?.address} + {addressInfo?.name ?? + t('auth:message.error.name_not_registered', { + postProcess: 'capitalizeFirstChar', + })} - - - + + + + + {addressInfo?.name ? ( + + + + ) : ( + + )} + + + + + + {t('core:level', { postProcess: 'capitalizeFirstChar' })}{' '} + {addressInfo?.level} + + + + + + + + {t('auth:address', { + postProcess: 'capitalizeFirstChar', + })} + + + + + {t('auth:action.copy_address', { + postProcess: 'capitalizeFirstChar', + })} + + } + placement="bottom" + arrow + sx={{ fontSize: '24' }} + slotProps={{ + tooltip: { + sx: { + color: theme.palette.text.primary, + backgroundColor: theme.palette.background.default, + }, + }, + arrow: { + sx: { + color: theme.palette.text.primary, + }, + }, + }} + > + { + navigator.clipboard.writeText(addressInfo?.address); + }} + > + + {addressInfo?.address} + + + + + + + + {t('core:balance', { + postProcess: 'capitalizeFirstChar', + })} + + + {addressInfo?.balance} + + + + + + + + + )} + + + + {isLoadingPayments && ( - Balance - {addressInfo?.balance} + - - - - - + )} - - )} - - {isLoadingPayments && ( - - - - )} - {!isLoadingPayments && addressInfo && ( - - 20 most recent payments - - {!isLoadingPayments && payments?.length === 0 && ( - - No payments - - )} - - - - Sender - Reciver - Amount - Time - - - - {payments.map((payment, index) => ( - - - - copy address - - } - placement="bottom" - arrow - sx={{ fontSize: "24" }} - slotProps={{ - tooltip: { - sx: { - color: "#ffffff", - backgroundColor: "#444444", - }, - }, - arrow: { - sx: { - color: "#444444", - }, - }, - }} - > - { - navigator.clipboard.writeText( - payment?.creatorAddress - ); - }} - > - {formatAddress(payment?.creatorAddress)} - - - - - - copy address - - } - placement="bottom" - arrow - sx={{ fontSize: "24" }} - slotProps={{ - tooltip: { - sx: { - color: "#ffffff", - backgroundColor: "#444444", - }, - }, - arrow: { - sx: { - color: "#444444", - }, - }, - }} - > - { - navigator.clipboard.writeText(payment?.recipient); - }} - > - {formatAddress(payment?.recipient)} - - - - - - {payment?.amount} - - {formatTimestamp(payment?.timestamp)} - - ))} - -
-
- )} - + {!isLoadingPayments && addressInfo && ( + + + {t('core:message.generic.most_recent_payment', { + count: 20, + postProcess: 'capitalizeFirstChar', + })} + + + + + {!isLoadingPayments && payments?.length === 0 && ( + + + {t('core:message.generic.no_payments', { + postProcess: 'capitalizeFirstChar', + })} + + + )} + + + + + + {t('core:sender', { + postProcess: 'capitalizeFirstChar', + })} + + + {t('core:receiver', { + postProcess: 'capitalizeFirstChar', + })} + + + {t('core:amount', { + postProcess: 'capitalizeFirstChar', + })} + + + {t('core:time.time', { + postProcess: 'capitalizeFirstChar', + })} + + + + + + {payments.map((payment, index) => ( + + + + {t('auth:action.copy_address', { + postProcess: 'capitalizeFirstChar', + })} + + } + placement="bottom" + arrow + sx={{ fontSize: '24' }} + slotProps={{ + tooltip: { + sx: { + color: theme.palette.text.primary, + backgroundColor: + theme.palette.background.default, + }, + }, + arrow: { + sx: { + color: theme.palette.text.primary, + }, + }, + }} + > + { + navigator.clipboard.writeText( + payment?.creatorAddress + ); + }} + > + {formatAddress(payment?.creatorAddress)} + + + + + + + {t('auth:action.copy_address', { + postProcess: 'capitalizeFirstChar', + })} + + } + placement="bottom" + arrow + sx={{ fontSize: '24' }} + slotProps={{ + tooltip: { + sx: { + color: theme.palette.text.primary, + backgroundColor: + theme.palette.background.default, + }, + }, + arrow: { + sx: { + color: theme.palette.text.primary, + }, + }, + }} + > + { + navigator.clipboard.writeText( + payment?.recipient + ); + }} + > + {formatAddress(payment?.recipient)} + + + + + {payment?.amount} + + + {formatTimestamp(payment?.timestamp)} + + + ))} + +
+
+ )} + - +
); }; diff --git a/src/components/Wallets.tsx b/src/components/Wallets.tsx new file mode 100644 index 0000000..c058677 --- /dev/null +++ b/src/components/Wallets.tsx @@ -0,0 +1,686 @@ +import { Fragment, useContext, useEffect, useState } from 'react'; +import List from '@mui/material/List'; +import ListItem from '@mui/material/ListItem'; +import Divider from '@mui/material/Divider'; +import ListItemText from '@mui/material/ListItemText'; +import ListItemAvatar from '@mui/material/ListItemAvatar'; +import Avatar from '@mui/material/Avatar'; +import Typography from '@mui/material/Typography'; +import { + Box, + Button, + ButtonBase, + Dialog, + DialogActions, + DialogContent, + DialogTitle, + IconButton, + Input, + useTheme, +} from '@mui/material'; +import { CustomButton } from '../styles/App-styles.ts'; +import { useDropzone } from 'react-dropzone'; +import EditIcon from '@mui/icons-material/Edit'; +import { Label } from './Group/AddGroup.tsx'; +import { Spacer } from '../common/Spacer.tsx'; +import { + getWallets, + storeWallets, + walletVersion, +} from '../background/background.ts'; +import { useModal } from '../hooks/useModal.tsx'; +import PhraseWallet from '../utils/generateWallet/phrase-wallet.ts'; +import { decryptStoredWalletFromSeedPhrase } from '../utils/decryptWallet.ts'; +import { crypto } from '../constants/decryptWallet.ts'; +import { LoadingButton } from '@mui/lab'; +import { PasswordField } from './index.ts'; +import { HtmlTooltip } from './NotAuthenticated.tsx'; +import { QORTAL_APP_CONTEXT } from '../App.tsx'; +import { useTranslation } from 'react-i18next'; + +const parsefilenameQortal = (filename) => { + return filename.startsWith('qortal_backup_') ? filename.slice(14) : filename; +}; + +export const Wallets = ({ setExtState, setRawWallet, rawWallet }) => { + const [wallets, setWallets] = useState([]); + const [isLoading, setIsLoading] = useState(true); + const [seedValue, setSeedValue] = useState(''); + const [seedName, setSeedName] = useState(''); + const [seedError, setSeedError] = useState(''); + const { hasSeenGettingStarted } = useContext(QORTAL_APP_CONTEXT); + const [password, setPassword] = useState(''); + const [isOpenSeedModal, setIsOpenSeedModal] = useState(false); + const [isLoadingEncryptSeed, setIsLoadingEncryptSeed] = useState(false); + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + const { isShow, onCancel, onOk, show } = useModal(); + + const { getRootProps, getInputProps } = useDropzone({ + accept: { + 'application/json': ['.json'], // Only accept JSON files + }, + onDrop: async (acceptedFiles) => { + const files: any = acceptedFiles; + let importedWallets: any = []; + + for (const file of files) { + try { + const fileContents = await new Promise((resolve, reject) => { + const reader = new FileReader(); + + reader.onabort = () => reject('File reading was aborted'); // TODO translate + reader.onerror = () => reject('File reading has failed'); + reader.onload = () => { + // Resolve the promise with the reader result when reading completes + resolve(reader.result); + }; + + // Read the file as text + reader.readAsText(file); + }); + if (typeof fileContents !== 'string') continue; + const parsedData = JSON.parse(fileContents); + importedWallets.push({ ...parsedData, filename: file?.name }); + } catch (error) { + console.error(error); + } + } + + const uniqueInitialMap = new Map(); + + // Only add a message if it doesn't already exist in the Map + importedWallets.forEach((wallet) => { + if (!wallet?.address0) return; + if (!uniqueInitialMap.has(wallet?.address0)) { + uniqueInitialMap.set(wallet?.address0, wallet); + } + }); + + const data = Array.from(uniqueInitialMap.values()); + + if (data && data?.length > 0) { + const uniqueNewWallets = data.filter( + (newWallet) => + !wallets.some( + (existingWallet) => + existingWallet?.address0 === newWallet?.address0 + ) + ); + setWallets([...wallets, ...uniqueNewWallets]); + } + }, + }); + + const updateWalletItem = (idx, wallet) => { + setWallets((prev) => { + let copyPrev = [...prev]; + if (wallet === null) { + copyPrev.splice(idx, 1); // Use splice to remove the item + return copyPrev; + } else { + copyPrev[idx] = wallet; // Update the wallet at the specified index + return copyPrev; + } + }); + }; + + const handleSetSeedValue = async () => { + try { + setIsOpenSeedModal(true); + const { seedValue, seedName, password } = await show({ + message: '', + publishFee: '', + }); + setIsLoadingEncryptSeed(true); + const res = await decryptStoredWalletFromSeedPhrase(seedValue); + const wallet2 = new PhraseWallet(res, walletVersion); + const wallet = await wallet2.generateSaveWalletData( + password, + crypto.kdfThreads, + () => {} + ); + if (wallet?.address0) { + setWallets([ + ...wallets, + { + ...wallet, + name: seedName, + }, + ]); + setIsOpenSeedModal(false); + setSeedValue(''); + setSeedName(''); + setPassword(''); + setSeedError(''); + } else { + setSeedError( + t('auth:message.error.account_creation', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + } catch (error) { + setSeedError( + error?.message || + t('auth:message.error.account_creation', { + postProcess: 'capitalizeFirstChar', + }) + ); + } finally { + setIsLoadingEncryptSeed(false); + } + }; + + const selectedWalletFunc = (wallet) => { + setRawWallet(wallet); + setExtState('wallet-dropped'); + }; + + useEffect(() => { + setIsLoading(true); + getWallets() + .then((res) => { + if (res && Array.isArray(res)) { + setWallets(res); + } + setIsLoading(false); + }) + .catch((error) => { + console.error(error); + setIsLoading(false); + }); + }, []); + + useEffect(() => { + if (!isLoading && wallets && Array.isArray(wallets)) { + storeWallets(wallets); + } + }, [wallets, isLoading]); + + if (isLoading) return null; + + return ( + + {wallets?.length === 0 || !wallets ? ( + <> + + {t('auth:message.generic.no_account', { + postProcess: 'capitalizeFirstChar', + })} + + + + + ) : ( + <> + + {t('auth:message.generic.your_accounts', { + postProcess: 'capitalizeFirstChar', + })} + + + + + )} + + {rawWallet && ( + + + {t('auth:account.selected', { + postProcess: 'capitalizeFirstChar', + })} + : + + {rawWallet?.name && {rawWallet.name}} + {rawWallet?.address0 && ( + {rawWallet?.address0} + )} + + )} + + {wallets?.length > 0 && ( + + {wallets?.map((wallet, idx) => { + return ( + <> + + + + ); + })} + + )} + + + + + {t('auth:tips.existing_account', { + postProcess: 'capitalizeFirstChar', + })} + + + } + > + + {t('auth:action.add.seed_phrase', { + postProcess: 'capitalizeFirstChar', + })} + + + + + + {t('auth:tips.additional_wallet', { + postProcess: 'capitalizeFirstChar', + })} + + + } + > + + + {t('auth:action.add.account', { + postProcess: 'capitalizeFirstChar', + })} + + + + + { + if (e.key === 'Enter' && seedValue && seedName && password) { + onOk({ seedValue, seedName, password }); + } + }} + > + + {t('auth:message.generic.type_seed', { + postProcess: 'capitalizeFirstChar', + })} + + + + + + setSeedName(e.target.value)} + /> + + + + + setSeedValue(e.target.value)} + autoComplete="off" + sx={{ + width: '100%', + }} + /> + + + + + setPassword(e.target.value)} + autoComplete="off" + sx={{ + width: '100%', + }} + /> + + + + + + + { + if (!seedValue || !seedName || !password) return; + onOk({ seedValue, seedName, password }); + }} + variant="contained" + > + {t('core:action.add', { + postProcess: 'capitalizeFirstChar', + })} + + + + {seedError} + + + + + ); +}; + +const WalletItem = ({ wallet, updateWalletItem, idx, setSelectedWallet }) => { + const [name, setName] = useState(''); + const [note, setNote] = useState(''); + const [isEdit, setIsEdit] = useState(false); + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + + useEffect(() => { + if (wallet?.name) { + setName(wallet.name); + } + if (wallet?.note) { + setNote(wallet.note); + } + }, [wallet]); + return ( + <> + { + setSelectedWallet(wallet); + }} + sx={{ + width: '100%', + padding: '10px', + }} + > + + + + + + + + {wallet?.address0} + + {wallet?.note} + + {t('core:action.login', { + postProcess: 'capitalizeFirstChar', + })} + + + } + /> + + + { + e.stopPropagation(); + setIsEdit(true); + }} + edge="end" + aria-label={t('core:action.edit', { + postProcess: 'capitalizeFirstChar', + })} + > + + + + {isEdit && ( + + + setName(e.target.value)} + sx={{ + width: '100%', + }} + /> + + + + + setNote(e.target.value)} + inputProps={{ + maxLength: 100, + }} + sx={{ + width: '100%', + }} + /> + + + + + + + + + + )} + + ); +}; diff --git a/src/components/WrapperUserAction.tsx b/src/components/WrapperUserAction.tsx index a3bcc3f..b182740 100644 --- a/src/components/WrapperUserAction.tsx +++ b/src/components/WrapperUserAction.tsx @@ -1,10 +1,28 @@ -import React, { useCallback, useContext, useEffect, useState } from 'react'; -import { Popover, Button, Box, CircularProgress } from '@mui/material'; +import { useCallback, useContext, useEffect, useState } from 'react'; +import { + Popover, + Button, + Box, + CircularProgress, + useTheme, +} from '@mui/material'; import { executeEvent } from '../utils/events'; -import { MyContext } from '../App'; +import { QORTAL_APP_CONTEXT } from '../App'; +import { useAtom } from 'jotai'; +import { isRunningPublicNodeAtom } from '../atoms/global'; +import { useTranslation } from 'react-i18next'; export const WrapperUserAction = ({ children, address, name, disabled }) => { - const {isRunningPublicNode} = useContext(MyContext) + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + const [isRunningPublicNode] = useAtom(isRunningPublicNodeAtom); + const [anchorEl, setAnchorEl] = useState(null); // Handle child element click to open Popover @@ -22,8 +40,8 @@ export const WrapperUserAction = ({ children, address, name, disabled }) => { const open = Boolean(anchorEl); const id = open ? address || name : undefined; - if(disabled){ - return children + if (disabled) { + return children; } return ( @@ -31,16 +49,16 @@ export const WrapperUserAction = ({ children, address, name, disabled }) => { {/* Render the child without altering dimensions */} @@ -49,156 +67,164 @@ export const WrapperUserAction = ({ children, address, name, disabled }) => { {/* Popover */} {open && ( - event.stopPropagation(), // Stop propagation inside popover - }, - }} - > - - {/* Option 1: Message */} - - - {/* Option 2: Send QORT */} - - - + event.stopPropagation(), // Stop propagation inside popover + }, + }} + > + + {/* Option 1: Message */} + - {!isRunningPublicNode && ( - + {/* Option 2: Send QORT */} + - )} - - + + + + + {!isRunningPublicNode && ( + + )} + + )} ); }; +const BlockUser = ({ address, name, handleClose }) => { + const [isAlreadyBlocked, setIsAlreadyBlocked] = useState(null); + const [isLoading, setIsLoading] = useState(false); + const { isUserBlocked, addToBlockList, removeBlockFromList } = + useContext(QORTAL_APP_CONTEXT); + const theme = useTheme(); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); -const BlockUser = ({address, name, handleClose})=> { - const [isAlreadyBlocked, setIsAlreadyBlocked] = useState(null) - const [isLoading, setIsLoading] = useState(false) - const {isUserBlocked, - addToBlockList, - removeBlockFromList} = useContext(MyContext) - -useEffect(()=> { - if(!address) return - setIsAlreadyBlocked(isUserBlocked(address, name)) -}, [address, setIsAlreadyBlocked, isUserBlocked, name]) + useEffect(() => { + if (!address) return; + setIsAlreadyBlocked(isUserBlocked(address, name)); + }, [address, setIsAlreadyBlocked, isUserBlocked, name]); return ( - ) -} \ No newline at end of file + }} + > + {(isAlreadyBlocked === null || isLoading) && ( + + )} + {isAlreadyBlocked && + t('auth:action.unblock_name', { postProcess: 'capitalizeFirstChar' })} + {isAlreadyBlocked === false && + t('auth:action.block_name', { postProcess: 'capitalizeFirstChar' })} + + ); +}; diff --git a/src/constants/codes.ts b/src/constants/codes.ts deleted file mode 100644 index 9b9224b..0000000 --- a/src/constants/codes.ts +++ /dev/null @@ -1 +0,0 @@ -export const PUBLIC_NOTIFICATION_CODE_FIRST_SECRET_KEY = "4001" \ No newline at end of file diff --git a/src/constants/constants.ts b/src/constants/constants.ts index 5b5e427..2707c49 100644 --- a/src/constants/constants.ts +++ b/src/constants/constants.ts @@ -1,175 +1,193 @@ - - // Qortal TX types const TX_TYPES = { - 1: "Genesis", - 2: "Payment", - 3: "Name registration", - 4: "Name update", - 5: "Sell name", - 6: "Cancel sell name", - 7: "Buy name", - 8: "Create poll", - 9: "Vote in poll", - 10: "Arbitrary", - 11: "Issue asset", - 12: "Transfer asset", - 13: "Create asset order", - 14: "Cancel asset order", - 15: "Multi-payment transaction", - 16: "Deploy AT", - 17: "Message", - 18: "Chat", - 19: "Publicize", - 20: "Airdrop", - 21: "AT", - 22: "Create group", - 23: "Update group", - 24: "Add group admin", - 25: "Remove group admin", - 26: "Group ban", - 27: "Cancel group ban", - 28: "Group kick", - 29: "Group invite", - 30: "Cancel group invite", - 31: "Join group", - 32: "Leave group", - 33: "Group approval", - 34: "Set group", - 35: "Update asset", - 36: "Account flags", - 37: "Enable forging", - 38: "Reward share", - 39: "Account level", - 40: "Transfer privs", - 41: "Presence" -} + 1: 'Genesis', + 2: 'Payment', + 3: 'Name registration', + 4: 'Name update', + 5: 'Sell name', + 6: 'Cancel sell name', + 7: 'Buy name', + 8: 'Create poll', + 9: 'Vote in poll', + 10: 'Arbitrary', + 11: 'Issue asset', + 12: 'Transfer asset', + 13: 'Create asset order', + 14: 'Cancel asset order', + 15: 'Multi-payment transaction', + 16: 'Deploy AT', + 17: 'Message', + 18: 'Chat', + 19: 'Publicize', + 20: 'Airdrop', + 21: 'AT', + 22: 'Create group', + 23: 'Update group', + 24: 'Add group admin', + 25: 'Remove group admin', + 26: 'Group ban', + 27: 'Cancel group ban', + 28: 'Group kick', + 29: 'Group invite', + 30: 'Cancel group invite', + 31: 'Join group', + 32: 'Leave group', + 33: 'Group approval', + 34: 'Set group', + 35: 'Update asset', + 36: 'Account flags', + 37: 'Enable forging', + 38: 'Reward share', + 39: 'Account level', + 40: 'Transfer privs', + 41: 'Presence', +}; // Qortal error codes const ERROR_CODES = { - 1: "Valid OK", - 2: "Invalid address", - 3: "Negative amount", - 4: "Nagative fee", - 5: "No balance", - 6: "Invalid reference", - 7: "Invalid time length", - 8: "Invalid value length", - 9: "Name already registered", - 10: "Name does not exist", - 11: "Invalid name owner", - 12: "Name already for sale", - 13: "Name not for sale", - 14: "Name buyer already owner", - 15: "Invalid amount", - 16: "Invalid seller", - 17: "Name not lowercase", - 18: "Invalid description length", - 19: "Invalid options length", - 20: "Invalid option length", - 21: "Duplicate option", - 22: "Poll already created", - 23: "Poll already has votes", - 24: "Poll does not exist", - 25: "Option does not exist", - 26: "Already voted for that option", - 27: "Invalid data length", - 28: "Invalid quantity", - 29: "Asset does not exist", - 30: "Invalid return", - 31: "Have equals want", - 32: "Order does not exist", - 33: "Invalid order creator", - 34: "Invalid payments length", - 35: "Negative price", - 36: "Invalid creation bytes", - 37: "Invalid tags length", - 38: "Invalid type length", - 39: "Invalid AT transaction", - 40: "Insufficient fee", - 41: "Asset does not match AT", + 1: 'Valid OK', + 2: 'Invalid address', + 3: 'Negative amount', + 4: 'Nagative fee', + 5: 'No balance', + 6: 'Invalid reference', + 7: 'Invalid time length', + 8: 'Invalid value length', + 9: 'Name already registered', + 10: 'Name does not exist', + 11: 'Invalid name owner', + 12: 'Name already for sale', + 13: 'Name not for sale', + 14: 'Name buyer already owner', + 15: 'Invalid amount', + 16: 'Invalid seller', + 17: 'Name not lowercase', + 18: 'Invalid description length', + 19: 'Invalid options length', + 20: 'Invalid option length', + 21: 'Duplicate option', + 22: 'Poll already created', + 23: 'Poll already has votes', + 24: 'Poll does not exist', + 25: 'Option does not exist', + 26: 'Already voted for that option', + 27: 'Invalid data length', + 28: 'Invalid quantity', + 29: 'Asset does not exist', + 30: 'Invalid return', + 31: 'Have equals want', + 32: 'Order does not exist', + 33: 'Invalid order creator', + 34: 'Invalid payments length', + 35: 'Negative price', + 36: 'Invalid creation bytes', + 37: 'Invalid tags length', + 38: 'Invalid type length', + 39: 'Invalid AT transaction', + 40: 'Insufficient fee', + 41: 'Asset does not match AT', - 43: "Asset already exists", - 44: "Missing creator", - 45: "Timestamp too old", - 46: "Timestamp too new", - 47: "Too many unconfirmed", - 48: "Group already exists", - 49: "Group does not exist", - 50: "Invalid group owner", - 51: "Already group memeber", - 52: "Group owner can not leave", - 53: "Not group member", - 54: "Already group admin", - 55: "Not group admin", - 56: "Invalid lifetime", - 57: "Invite unknown", - 58: "Ban exists", - 59: "Ban unknown", - 60: "Banned from group", - 61: "Join request", - 62: "Invalid group approval threshold", - 63: "Group ID mismatch", - 64: "Invalid group ID", - 65: "Transaction unknown", - 66: "Transaction already confirmed", - 67: "Invalid TX group", - 68: "TX group ID mismatch", - 69: "Multiple names forbidden", - 70: "Invalid asset owner", - 71: "AT is finished", - 72: "No flag permission", - 73: "Not minting accout", + 43: 'Asset already exists', + 44: 'Missing creator', + 45: 'Timestamp too old', + 46: 'Timestamp too new', + 47: 'Too many unconfirmed', + 48: 'Group already exists', + 49: 'Group does not exist', + 50: 'Invalid group owner', + 51: 'Already group memeber', + 52: 'Group owner can not leave', + 53: 'Not group member', + 54: 'Already group admin', + 55: 'Not group admin', + 56: 'Invalid lifetime', + 57: 'Invite unknown', + 58: 'Ban exists', + 59: 'Ban unknown', + 60: 'Banned from group', + 61: 'Join request', + 62: 'Invalid group approval threshold', + 63: 'Group ID mismatch', + 64: 'Invalid group ID', + 65: 'Transaction unknown', + 66: 'Transaction already confirmed', + 67: 'Invalid TX group', + 68: 'TX group ID mismatch', + 69: 'Multiple names forbidden', + 70: 'Invalid asset owner', + 71: 'AT is finished', + 72: 'No flag permission', + 73: 'Not minting accout', - 77: "Invalid rewardshare percent", - 78: "Public key unknown", - 79: "Invalid public key", - 80: "AT unknown", - 81: "AT already exists", - 82: "Group approval not required", - 83: "Group approval decided", - 84: "Maximum reward shares", - 85: "Transaction already exists", - 86: "No blockchain lock", - 87: "Order already closed", - 88: "Clock not synced", - 89: "Asset not spendable", - 90: "Account can not reward share", - 91: "Self share exists", - 92: "Account already exists", - 93: "Invalid group block delay", - 94: "Incorrect nonce", - 95: "Ivalid timestamp signature", - 96: "Address blocked", - 97: "Name Blocked", - 98: "Group approval required", - 99: "Account not transferable", + 77: 'Invalid rewardshare percent', + 78: 'Public key unknown', + 79: 'Invalid public key', + 80: 'AT unknown', + 81: 'AT already exists', + 82: 'Group approval not required', + 83: 'Group approval decided', + 84: 'Maximum reward shares', + 85: 'Transaction already exists', + 86: 'No blockchain lock', + 87: 'Order already closed', + 88: 'Clock not synced', + 89: 'Asset not spendable', + 90: 'Account can not reward share', + 91: 'Self share exists', + 92: 'Account already exists', + 93: 'Invalid group block delay', + 94: 'Incorrect nonce', + 95: 'Ivalid timestamp signature', + 96: 'Address blocked', + 97: 'Name Blocked', + 98: 'Group approval required', + 99: 'Account not transferable', - 999: "Ivalid but ok", - 1000: "Not yet released." -} + 999: 'Ivalid but ok', + 1000: 'Not yet released.', +}; // Qortal 8 decimals -const QORT_DECIMALS = 1e8 +const QORT_DECIMALS = 1e8; // Q for Qortal -const ADDRESS_VERSION = 58 +const ADDRESS_VERSION = 58; // Proxy for api calls -const PROXY_URL = "/proxy/" +const PROXY_URL = '/proxy/'; // Chat reference timestamp -const CHAT_REFERENCE_FEATURE_TRIGGER_TIMESTAMP = 1674316800000 +const CHAT_REFERENCE_FEATURE_TRIGGER_TIMESTAMP = 1674316800000; // Dynamic fee timestamp -const DYNAMIC_FEE_TIMESTAMP = 1692118800000 - +const DYNAMIC_FEE_TIMESTAMP = 1692118800000; // Used as a salt for all Qora addresses. Salts used for storing your private keys in local storage will be randomly generated -const STATIC_SALT = new Uint8Array([54, 190, 201, 206, 65, 29, 123, 129, 147, 231, 180, 166, 171, 45, 95, 165, 78, 200, 208, 194, 44, 207, 221, 146, 45, 238, 68, 68, 69, 102, 62, 6]) -const BCRYPT_ROUNDS = 10 // Remember that the total work spent on key derivation is BCRYPT_ROUNDS * KDF_THREADS -const BCRYPT_VERSION = "2a" -const STATIC_BCRYPT_SALT = `$${BCRYPT_VERSION}$${BCRYPT_ROUNDS}$IxVE941tXVUD4cW0TNVm.O` -const KDF_THREADS = 16 +const STATIC_SALT = new Uint8Array([ + 54, 190, 201, 206, 65, 29, 123, 129, 147, 231, 180, 166, 171, 45, 95, 165, 78, + 200, 208, 194, 44, 207, 221, 146, 45, 238, 68, 68, 69, 102, 62, 6, +]); +const BCRYPT_ROUNDS = 10; // Remember that the total work spent on key derivation is BCRYPT_ROUNDS * KDF_THREADS +const BCRYPT_VERSION = '2a'; +const STATIC_BCRYPT_SALT = `$${BCRYPT_VERSION}$${BCRYPT_ROUNDS}$IxVE941tXVUD4cW0TNVm.O`; +const KDF_THREADS = 16; -export { TX_TYPES, ERROR_CODES, QORT_DECIMALS, PROXY_URL, STATIC_SALT, ADDRESS_VERSION, KDF_THREADS, STATIC_BCRYPT_SALT, CHAT_REFERENCE_FEATURE_TRIGGER_TIMESTAMP, DYNAMIC_FEE_TIMESTAMP } +export { + TX_TYPES, + ERROR_CODES, + QORT_DECIMALS, + PROXY_URL, + STATIC_SALT, + ADDRESS_VERSION, + KDF_THREADS, + STATIC_BCRYPT_SALT, + CHAT_REFERENCE_FEATURE_TRIGGER_TIMESTAMP, + DYNAMIC_FEE_TIMESTAMP, +}; + +export const RESOURCE_TYPE_NUMBER_GROUP_CHAT_REACTIONS = 102; + +export const PUBLIC_NOTIFICATION_CODE_FIRST_SECRET_KEY = '4001'; // Q for Qortal + +export const MAX_SIZE_PUBLIC_NODE = 500 * 1024 * 1024; // 500mb +export const MAX_SIZE_PUBLISH = 2000 * 1024 * 1024; // 2GB diff --git a/src/constants/forum.ts b/src/constants/forum.ts deleted file mode 100644 index e69de29..0000000 diff --git a/src/constants/general.ts b/src/constants/general.ts deleted file mode 100644 index f6a150a..0000000 --- a/src/constants/general.ts +++ /dev/null @@ -1,5 +0,0 @@ -// Qortal 8 decimals -export const QORT_DECIMALS = 1e8 - -// Q for Qortal -export const ADDRESS_VERSION = 58 \ No newline at end of file diff --git a/src/constants/resourceTypes.ts b/src/constants/resourceTypes.ts deleted file mode 100644 index aa7a758..0000000 --- a/src/constants/resourceTypes.ts +++ /dev/null @@ -1 +0,0 @@ -export const RESOURCE_TYPE_NUMBER_GROUP_CHAT_REACTIONS = 102 \ No newline at end of file diff --git a/src/deps/AltcoinHDWallet.ts b/src/deps/AltcoinHDWallet.ts deleted file mode 100644 index cd4a10b..0000000 --- a/src/deps/AltcoinHDWallet.ts +++ /dev/null @@ -1,864 +0,0 @@ -// @ts-nocheck -; -import Base58 from '../deps/Base58.js' -import {Sha256, Sha512} from 'asmcrypto.js' -import jsSHA from 'jssha' -import RIPEMD160 from '../deps/ripemd160.js' -import utils from '../utils/utils' -import {BigInteger, EllipticCurve} from './ecbn' -import {Buffer} from 'buffer' - -export default class AltcoinHDWallet { - - constructor(addressParams) { - - /** - * Seed - 32 bytes - */ - - this.seed = new Uint8Array(32) - - /** - * Version Bytes - 4 byte - */ - - this.versionBytes = addressParams - - /** - * Depth - 1 byte - */ - - this.depth = 0 - - /** - * Parent Fingerprint - 4 bytes - */ - - this.parentFingerprint = '0x00000000' // master key - - /** - * Child Index - 4 bytes - */ - - this.childIndex = '0x00000000' // master key - - /** - * Chain Code - 32 bytes - */ - - this.chainCode = new Uint8Array(32) - - /** - * Key Data - 33 bytes - */ - - this.keyData = new Uint8Array(33) - - /** - * Seed Hash - 64 bytes - */ - - this.seedHash = new Uint8Array(64) - - /** - * Private Key - 32 bytes - */ - - this.privateKey = new Uint8Array(32) - - /** - * Public Key - 33 bytes (compressed) - */ - - this.publicKey = new Uint8Array(33) - - /** - * Public Key Hash160 (used to derive the parent fingerprint for derived) - */ - - this.publicKeyHash = new Uint8Array(20) - - /** - * Master Private Key (Base58 encoded) - */ - - this.masterPrivateKey = '' - - /** - * Master Public Key (Base58 encoded) - */ - - this.masterPublicKey = '' - - /** - * Testnet Master Private Key (Base58 encoded) - THIS IS TESTNET - */ - - this._tMasterPrivateKey = '' - - /** - * Testnet Master Public Key (Base58 encoded) - THIS IS TESTNET - */ - - this._tmasterPublicKey = '' - - /** - * Child Keys Derivation from the Parent Keys - */ - - /** - * Child Private Key - 32 bytes - */ - - this.childPrivateKey = new Uint8Array(32) - - /** - * Child Chain Code - 32 bytes - */ - - this.childChainCode = new Uint8Array(32) - - /** - * Child Public Key - 33 bytes (compressed) - */ - - this.childPublicKey = new Uint8Array(33) - - /** - * Child Public Key Hash160 (used to derive the parent fingerprint for derived) - */ - - this.childPublicKeyHash = new Uint8Array(20) - - /** - * Extended Private Child Key - Base58 encoded - */ - - this.xPrivateChildKey = '' - - /** - * Extended Public Child Key - Base58 encoded - */ - - this.xPublicChildKey = '' - - /** - * Grand Child Keys Derivation from the Child Keys - */ - - /** - * Grand Child Private Key - 32 bytes - */ - - this.grandChildPrivateKey = new Uint8Array(32) - - /** - * Grand Child Chain Code - 32 bytes - */ - - this.grandChildChainCode = new Uint8Array(32) - - /** - * Grand Child Public Key - 33 bytes (compressed) - */ - - this.grandChildPublicKey = new Uint8Array(33) - - /** - * Grand Public Key Hash160 (used to derive the parent fingerprint for derived) - */ - - this.grandChildPublicKeyHash = new Uint8Array(20) - - /** - * Extended Private Grand Child Key - Base58 encoded - */ - - this.xPrivateGrandChildKey = '' - - /** - * Extended Public Grand Child Key - Base58 encoded - */ - - this.xPublicGrandChildKey = '' - - /** - * Litecoin Legacy Address - Derived from the Grand Child Public Key Hash - */ - - this.litecoinLegacyAddress = '' - - /** - * TESTNET Litecoin Legacy Address (Derived from the Grand Child Public Key Hash) - THIS IS TESTNET - */ - - this._tlitecoinLegacyAddress = '' - - /** - * Wallet - Wallet Object (keys...) - */ - - this.wallet = {} - } - - setSeed(seed) { - this.seed = seed - } - - createWallet(seed, isBIP44, indicator = null) { - - // Set Seeed - this.setSeed(seed) - - // Generate Seed Hash - this.generateSeedHash(this.seed, isBIP44, indicator) - - // Generate Private Key - this.generatePrivateKey(this.seedHash) - - // Generate Chain Code - this.generateChainCode(this.seedHash) - - // Generate Public Key from Private Key - this.generatePublicKey(this.privateKey) - - // Generate Mainnet Master Private Key - this.generateMainnetMasterPrivateKey() - - // Generate Mainnet Master Public Key - this.generateMainnetMasterPublicKey() - - // Generate Testnet Master Private Key - this.generateTestnetMasterPrivateKey() - - // Generate Testnet Master Public Key - this.generateTestnetMasterPublicKey() - - // Generate Child and Grand Child Keys - this.generateDerivedChildKeys() - - // Return Wallet Object Specification - return this.returnWallet() - } - - - generateSeedHash(seed, isBIP44, indicator = null) { - let buffer - - if (isBIP44) { - buffer = utils.appendBuffer(seed.reverse(), utils.int32ToBytes(indicator)) - } else { - if(indicator !== null) { - const indicatorString = utils.stringtoUTF8Array(indicator) - buffer = utils.appendBuffer(seed.reverse(), indicatorString) - } - else - { - buffer = seed.reverse() - } - } - - const _reverseSeedHash = new Sha256().process(buffer).finish().result - this.seedHash = new Sha512().process(utils.appendBuffer(seed, _reverseSeedHash)).finish().result - } - - generatePrivateKey(seedHash) { - const SECP256K1_CURVE_ORDER = new BigInteger("0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141") - - const privateKeyHash = seedHash.slice(0, 32) - - this.seed58 = Base58.encode(privateKeyHash) - - const _privateKeyHash = [...privateKeyHash] - let privateKeyBigInt = BigInteger.fromByteArrayUnsigned(_privateKeyHash) - - const privateKey = (privateKeyBigInt.mod(SECP256K1_CURVE_ORDER.subtract(BigInteger.ONE))).add(BigInteger.ONE) - this.privateKey = privateKey.toByteArrayUnsigned() - } - - generateChainCode(seedHash) { - this.chainCode = new Sha256().process(seedHash.slice(32, 64)).finish().result - } - - generatePublicKey(privateKey) { - const _privateKey = [...privateKey] - const privateKeyBigInt = BigInteger.fromByteArrayUnsigned(_privateKey) - - const epCurve = EllipticCurve.getSECCurveByName("secp256k1") - const curvePoints = epCurve.getG().multiply(privateKeyBigInt) - - - const x = curvePoints.getX().toBigInteger() - const y = curvePoints.getY().toBigInteger() - - /** - * Deriving Uncompressed Public Key (65 bytes) - * - * const publicKeyBytes = EllipticCurve.integerToBytes(x, 32) - * this.publicKey = publicKeyBytes.concat(EllipticCurve.integerToBytes(y, 32)) - * this.publicKey.unshift(0x04) // append point indicator - */ - - // Compressed Public Key (33 bytes) - this.publicKey = EllipticCurve.integerToBytes(x, 32) - - - if (y.isEven()) { - this.publicKey.unshift(0x02) // append point indicator - } else { - this.publicKey.unshift(0x03) // append point indicator - } - - // PublicKey Hash - const publicKeySHA256 = new Sha256().process(new Uint8Array(this.publicKey)).finish().result - const _publicKeyHash = new RIPEMD160().update(Buffer.from(publicKeySHA256)).digest('hex') - this.publicKeyHash = _publicKeyHash - } - - generateMainnetMasterPrivateKey() { - // Serialization Variable - const s = [] - - // Append Version Byte - s.push(...(utils.int32ToBytes(this.versionBytes.mainnet.private))) - - // Append Depth - s.push(this.depth) - - // Append Parent Fingerprint - s.push(...(utils.int32ToBytes(this.parentFingerprint))) - - // Append Child Number - s.push(...(utils.int32ToBytes(this.childIndex))) - - // Append Chain Code - s.push(...this.chainCode) - - // Append 1 byte '0x00' (to make the key data 33 bytes, DO THIS ONLY FOR PRIVATE KEYS ) - s.push(0) - - //if the private key length is less than 32 let's add leading zeros - if(this.privateKey.length<32){ - for(let i=this.privateKey.length;i<32;i++){ - s.push(0) - } - } - - // Append Private Key - s.push(...this.privateKey) - - // Generate CheckSum - const _s = new Uint8Array(s) - const _checkSum = new Sha256().process(new Sha256().process(_s).finish().result).finish().result - const checkSum = _checkSum.slice(0, 4) - - // Append CheckSum - s.push(...checkSum) // And this brings us to the end of the serialization... - - // Save to Private Key as Base58 encoded - this.masterPrivateKey = Base58.encode(s) - } - - generateMainnetMasterPublicKey() { - // Serialization Variable - const s = [] - - // Append Version Byte - s.push(...(utils.int32ToBytes(this.versionBytes.mainnet.public))) - - // Append Depth - s.push(this.depth) - - // Append Parent Fingerprint - s.push(...(utils.int32ToBytes(this.parentFingerprint))) - - // Append Child Number - s.push(...(utils.int32ToBytes(this.childIndex))) - - // Append Chain Code - s.push(...this.chainCode) - - // Append Public Key - s.push(...this.publicKey) - - // Generate CheckSum - const _s = new Uint8Array(s) - const _checkSum = new Sha256().process(new Sha256().process(_s).finish().result).finish().result - const checkSum = _checkSum.slice(0, 4) - - // Append CheckSum - s.push(...checkSum) // And this brings us to the end of the serialization... - - // Save to Public Key as Base58 encoded - this.masterPublicKey = Base58.encode(s) - } - - generateTestnetMasterPrivateKey() { - - // To be Used ONLY in Testnet... - - // Serialization Variable - const s = [] - - // Append Version Byte - s.push(...(utils.int32ToBytes(this.versionBytes.testnet.private))) - - // Append Depth - s.push(this.depth) - - // Append Parent Fingerprint - s.push(...(utils.int32ToBytes(this.parentFingerprint))) - - // Append Child Number - s.push(...(utils.int32ToBytes(this.childIndex))) - - // Append Chain Code - s.push(...this.chainCode) - - // Append 1 byte '0x00' (to make the key data 33 bytes, DO THIS ONLY FOR PRIVATE KEYS ) - s.push(0) - - // Append Private Key - s.push(...this.privateKey) - - // Generate CheckSum - const _s = new Uint8Array(s) - const _checkSum = new Sha256().process(new Sha256().process(_s).finish().result).finish().result - const checkSum = _checkSum.slice(0, 4) - - // Append CheckSum - s.push(...checkSum) // And this brings us to the end of the serialization... - - // Save to Private Key as Base58 encoded - this._tMasterPrivateKey = Base58.encode(s) - } - - generateTestnetMasterPublicKey() { - - // To be Used ONLY in Testnet... - - // Serialization Variable - const s = [] - - // Append Version Byte - s.push(...(utils.int32ToBytes(this.versionBytes.testnet.public))) - - // Append Depth - s.push(this.depth) - - // Append Parent Fingerprint - s.push(...(utils.int32ToBytes(this.parentFingerprint))) - - // Append Child Number - s.push(...(utils.int32ToBytes(this.childIndex))) - - // Append Chain Code - s.push(...this.chainCode) - - // Append Private Key - s.push(...this.publicKey) - - // Generate CheckSum - const _s = new Uint8Array(s) - const _checkSum = new Sha256().process(new Sha256().process(_s).finish().result).finish().result - const checkSum = _checkSum.slice(0, 4) - - // Append CheckSum - s.push(...checkSum) // And this brings us to the end of the serialization... - - // Save to Private Key as Base58 encoded - this._tmasterPublicKey = Base58.encode(s) - } - - generateDerivedChildKeys() { - - // SPEC INFO: https://en.bitcoin.it/wiki/BIP_0032#Child_key_derivation_.28CKD.29_functions - // NOTE: will not be using some of derivations func as the value is known. (So I'd rather shove in the values and rewrite out the derivations later ?) - - // NOTE: I "re-wrote" and "reduplicate" the code for child and grandChild keys derivations inorder to get the child and grandchild from the child - // TODO: Make this more better in the future - - const path = 'm/0/0' - // let p = path.split('/') - - // Get Public kEY - const derivePublicChildKey = () => { - - const _privateKey = [...this.childPrivateKey] - const privateKeyBigInt = BigInteger.fromByteArrayUnsigned(_privateKey) - - const epCurve = EllipticCurve.getSECCurveByName("secp256k1") - const curvePoints = epCurve.getG().multiply(privateKeyBigInt) - - const x = curvePoints.getX().toBigInteger() - const y = curvePoints.getY().toBigInteger() - - // Compressed Public Key (33 bytes) - this.childPublicKey = EllipticCurve.integerToBytes(x, 32) - - - if (y.isEven()) { - - this.childPublicKey.unshift(0x02) // append point indicator - } else { - - this.childPublicKey.unshift(0x03) // append point indicator - } - - // PublicKey Hash - const childPublicKeySHA256 = new Sha256().process(new Uint8Array(this.childPublicKey)).finish().result - const _childPublicKeyHash = new RIPEMD160().update(Buffer.from(childPublicKeySHA256)).digest('hex') - this.childPublicKeyHash = _childPublicKeyHash - - - // Call deriveExtendedPublicChildKey // WIll be hardcoding the values... - deriveExtendedPublicChildKey(1, 0) - } - - const derivePrivateChildKey = (cI) => { - - let ib = [] - ib.push((cI >> 24) & 0xff) - ib.push((cI >> 16) & 0xff) - ib.push((cI >> 8) & 0xff) - ib.push(cI & 0xff) - - const s = [...this.publicKey].concat(ib) - - const _hmacSha512 = new jsSHA("SHA-512", "UINT8ARRAY", { numRounds: 1, hmacKey: { value: this.chainCode, format: "UINT8ARRAY" } }) - _hmacSha512.update(new Uint8Array(s)) - - - const IL = BigInteger.fromByteArrayUnsigned([..._hmacSha512.getHMAC('UINT8ARRAY').slice(0, 32)]) - this.childChainCode = _hmacSha512.getHMAC('UINT8ARRAY').slice(32, 64) // IR according to the SPEC - - - // SECP256k1 init - const epCurve = EllipticCurve.getSECCurveByName("secp256k1") - - - const ki = IL.add(BigInteger.fromByteArrayUnsigned(this.privateKey)).mod(epCurve.getN()) // parse256(IL) + kpar (mod n) ==> ki - this.childPrivateKey = ki.toByteArrayUnsigned() - - // Call deriveExtendedPrivateChildKey - deriveExtendedPrivateChildKey(1, 0) - } - - - const deriveExtendedPrivateChildKey = (i, childIndex) => { - - // Serialization Variable - const s = [] - - // Append Version Byte - s.push(...(utils.int32ToBytes(this.versionBytes.mainnet.private))) - - // Append Depth (using the index as depth) - i = parseInt(i) - s.push(i) - - // Append Parent Fingerprint - s.push(...(this.publicKeyHash.slice(0, 4))) - - // Append Child Index - s.push(childIndex >>> 24) - s.push((childIndex >>> 16) & 0xff) - s.push((childIndex >>> 8) & 0xff) - s.push(childIndex & 0xff) - - // Append Chain Code - s.push(...this.childChainCode) - - // Append 1 byte '0x00' (to make the key data 33 bytes, DO THIS ONLY FOR PRIVATE KEYS ) - s.push(0) - - // Append Private Key - s.push(...this.childPrivateKey) - - // Generate CheckSum - const _s = new Uint8Array(s) - const _checkSum = new Sha256().process(new Sha256().process(_s).finish().result).finish().result - const checkSum = _checkSum.slice(0, 4) - - // Append CheckSum - s.push(...checkSum) // And this brings us to the end of the serialization... - - // Save to Private Key as Base58 encoded - this.xPrivateChildKey = Base58.encode(s) - } - - const deriveExtendedPublicChildKey = (i, childIndex) => { - - // Serialization Variable - const s = [] - - // Append Version Byte - s.push(...(utils.int32ToBytes(this.versionBytes.mainnet.public))) - - // Append Depth - i = parseInt(i) - s.push(i) - - // Append Parent Fingerprint - s.push(...(this.publicKeyHash.slice(0, 4))) - - // Append Child Index - s.push(childIndex >>> 24) - s.push((childIndex >>> 16) & 0xff) - s.push((childIndex >>> 8) & 0xff) - s.push(childIndex & 0xff) - - // Append Chain Code - s.push(...this.childChainCode) - - // Append Public Key - s.push(...this.childPublicKey) - - // Generate CheckSum - const _s = new Uint8Array(s) - const _checkSum = new Sha256().process(new Sha256().process(_s).finish().result).finish().result - const checkSum = _checkSum.slice(0, 4) - - // Append CheckSum - s.push(...checkSum) // And this brings us to the end of the serialization... - - - // Save to Public Key as Base58 encoded - this.xPublicChildKey = Base58.encode(s) - } - - - /** - * GRAND CHILD KEYS - * - * NOTE: I know this is not the best way to generate this (even though it works the way it ought) - * Things to rewrite will be and not limited to deriving this through a for loop, removing hard code values, etc... - */ - - const derivePublicGrandChildKey = () => { - - const _privateKey = [...this.grandChildPrivateKey] - const privateKeyBigInt = BigInteger.fromByteArrayUnsigned(_privateKey) - - - const epCurve = EllipticCurve.getSECCurveByName("secp256k1") - const curvePoints = epCurve.getG().multiply(privateKeyBigInt) - - const x = curvePoints.getX().toBigInteger() - const y = curvePoints.getY().toBigInteger() - - // Compressed Public Key (33 bytes) - this.grandChildPublicKey = EllipticCurve.integerToBytes(x, 32) - - - if (y.isEven()) { - this.grandChildPublicKey.unshift(0x02) // append point indicator - } else { - this.grandChildPublicKey.unshift(0x03) // append point indicator - } - - - // PublicKey Hash - const grandChildPublicKeySHA256 = new Sha256().process(new Uint8Array(this.grandChildPublicKey)).finish().result - const _grandChildPublicKeyHash = new RIPEMD160().update(Buffer.from(grandChildPublicKeySHA256)).digest('hex') - this.grandChildPublicKeyHash = _grandChildPublicKeyHash - - - // Call deriveExtendedPublicChildKey // WIll be hardcoding the values... - deriveExtendedPublicGrandChildKey(2, 0) - - /** - * Derive Litecoin Legacy Address - */ - - // Append Address Prefix - let prefix = [this.versionBytes.mainnet.prefix] - if (2 == this.versionBytes.mainnet.prefix.length) { - prefix = [this.versionBytes.mainnet.prefix[0]] - prefix.push([this.versionBytes.mainnet.prefix[1]]) - } - - const k = prefix.concat(...this.grandChildPublicKeyHash) - - // Derive Checksum - const _addressCheckSum = new Sha256().process(new Sha256().process(new Uint8Array(k)).finish().result).finish().result - const addressCheckSum = _addressCheckSum.slice(0, 4) - - // Append CheckSum - const _litecoinLegacyAddress = k.concat(...addressCheckSum) - - // Convert to Base58 - this.litecoinLegacyAddress = Base58.encode(_litecoinLegacyAddress) - - - /** - * Derive TESTNET Litecoin Legacy Address - */ - - // Append Version Byte - const tK = [this.versionBytes.testnet.prefix].concat(...this.grandChildPublicKeyHash) - - // Derive Checksum - const _tAddressCheckSum = new Sha256().process(new Sha256().process(new Uint8Array(tK)).finish().result).finish().result - const tAddressCheckSum = _tAddressCheckSum.slice(0, 4) - - // Append CheckSum - const _tlitecoinLegacyAddress = tK.concat(...tAddressCheckSum) - - // Convert to Base58 - this._tlitecoinLegacyAddress = Base58.encode(_tlitecoinLegacyAddress) - } - - const derivePrivateGrandChildKey = (cI, i) => { - - let ib = [] - ib.push((cI >> 24) & 0xff) - ib.push((cI >> 16) & 0xff) - ib.push((cI >> 8) & 0xff) - ib.push(cI & 0xff) - - const s = [...this.childPublicKey].concat(ib) - - - const _hmacSha512 = new jsSHA("SHA-512", "UINT8ARRAY", { numRounds: 1, hmacKey: { value: this.childChainCode, format: "UINT8ARRAY" } }) - _hmacSha512.update(new Uint8Array(s)) - - - const IL = BigInteger.fromByteArrayUnsigned([..._hmacSha512.getHMAC('UINT8ARRAY').slice(0, 32)]) - this.grandChildChainCode = _hmacSha512.getHMAC('UINT8ARRAY').slice(32, 64) // IR according to the SPEC - - // SECP256k1 init - const epCurve = EllipticCurve.getSECCurveByName("secp256k1") - - - const ki = IL.add(BigInteger.fromByteArrayUnsigned(this.childPrivateKey)).mod(epCurve.getN()) // parse256(IL) + kpar (mod n) ==> ki - this.grandChildPrivateKey = ki.toByteArrayUnsigned() - - - // Call deriveExtendedPrivateChildKey - deriveExtendedPrivateGrandChildKey(2, 0) - } - - - const deriveExtendedPrivateGrandChildKey = (i, childIndex) => { - - // Serialization Variable - const s = [] - - // Append Version Byte - s.push(...(utils.int32ToBytes(this.versionBytes.mainnet.private))) - - // Append Depth (using the index as depth) - i = parseInt(i) - s.push(i) - - // Append Parent Fingerprint - s.push(...(this.childPublicKeyHash.slice(0, 4))) - - // Append Child Index - s.push(childIndex >>> 24) - s.push((childIndex >>> 16) & 0xff) - s.push((childIndex >>> 8) & 0xff) - s.push(childIndex & 0xff) - - // Append Chain Code - s.push(...this.grandChildChainCode) - - // Append 1 byte '0x00' (to make the key data 33 bytes, DO THIS ONLY FOR PRIVATE KEYS ) - s.push(0) - - // Append Private Key - s.push(...this.grandChildPrivateKey) - - // Generate CheckSum - const _s = new Uint8Array(s) - const _checkSum = new Sha256().process(new Sha256().process(_s).finish().result).finish().result - const checkSum = _checkSum.slice(0, 4) - - // Append CheckSum - s.push(...checkSum) // And this brings us to the end of the serialization... - - // Save to Private Key as Base58 encoded - this.xPrivateGrandChildKey = Base58.encode(s) - } - - const deriveExtendedPublicGrandChildKey = (i, childIndex) => { - - // Serialization Variable - const s = [] - - // Append Version Byte - s.push(...(utils.int32ToBytes(this.versionBytes.mainnet.public))) - - // Append Depth - i = parseInt(i) - s.push(i) - - // Append Parent Fingerprint - s.push(...(this.childPublicKeyHash.slice(0, 4))) - - // Append Child Index - s.push(childIndex >>> 24) - s.push((childIndex >>> 16) & 0xff) - s.push((childIndex >>> 8) & 0xff) - s.push(childIndex & 0xff) - - // Append Chain Code - s.push(...this.grandChildChainCode) - - // Append Public Key - s.push(...this.grandChildPublicKey) - - // Generate CheckSum - const _s = new Uint8Array(s) - const _checkSum = new Sha256().process(new Sha256().process(_s).finish().result).finish().result - const checkSum = _checkSum.slice(0, 4) - - // Append CheckSum - s.push(...checkSum) // And this brings us to the end of the serialization... - - // Save to Public Key as Base58 encoded - this.xPublicGrandChildKey = Base58.encode(s) - } - - - - // Hard Code value.. - let childIndex = 0 - - // Call derivePrivateChildKey //Hard code value - derivePrivateChildKey(childIndex) - - // Call derivePublicChildKey - derivePublicChildKey() - - - // Call derivePrivateGrandChildKey // Hard Code value... - derivePrivateGrandChildKey(0, 2) - - // Call derivePublicGrandChildKey - derivePublicGrandChildKey() - } - - returnWallet() { - - // Will be limiting the exported Wallet Object to just the Master keys and Legacy Addresses - - const wallet = { - derivedMasterPrivateKey: this.masterPrivateKey, - derivedMasterPublicKey: this.masterPublicKey, - _tDerivedMasterPrivateKey: this._tMasterPrivateKey, - _tDerivedmasterPublicKey: this._tmasterPublicKey, - seed58: this.seed58, - // derivedPrivateChildKey: this.xPrivateChildKey, - // derivedPublicChildKey: this.xPublicChildKey, - // derivedPrivateGrandChildKey: this.xPrivateGrandChildKey, - // derivedPublicGrandChildKey: this.xPublicGrandChildKey, - address: this.litecoinLegacyAddress, - _taddress: this._tlitecoinLegacyAddress - } - - this.wallet = wallet - return wallet - } -} diff --git a/src/deps/bcryptworker.worker.js b/src/deps/bcryptworker.worker.js deleted file mode 100644 index d6d048a..0000000 --- a/src/deps/bcryptworker.worker.js +++ /dev/null @@ -1,12 +0,0 @@ -import bcrypt from 'bcryptjs' - - -self.onmessage = function (e) { - const { hashBase64, salt } = e.data; - try { - const result = bcrypt.hashSync(hashBase64, salt); - self.postMessage({ result }); - } catch (error) { - self.postMessage({ error: error.message }); - } -}; \ No newline at end of file diff --git a/src/deps/kdf.ts b/src/deps/kdf.ts deleted file mode 100644 index 6844d67..0000000 --- a/src/deps/kdf.ts +++ /dev/null @@ -1,100 +0,0 @@ -// @ts-nocheck - -import {bytes_to_base64 as bytesToBase64, Sha512} from 'asmcrypto.js' -import utils from '../utils/utils' -import { crypto as crypto2 } from '../constants/decryptWallet' -import BcryptWorker from './bcryptworker.worker.js?worker'; - -const stringtoUTF8Array = (message)=> { - if (typeof message === 'string') { - var s = unescape(encodeURIComponent(message)) // UTF-8 - message = new Uint8Array(s.length) - for (var i = 0; i < s.length; i++) { - message[i] = s.charCodeAt(i) & 0xff - } - } - return message -} - - - -const bcryptInWorker = (hashBase64, salt) => { - return new Promise((resolve, reject) => { - const worker = new BcryptWorker() - worker.onmessage = (e) => { - const { result, error } = e.data; - if (error) { - reject(error); - } else { - resolve(result); - } - worker.terminate(); - }; - worker.onerror = (err) => { - reject(err.message); - worker.terminate(); - }; - worker.postMessage({ hashBase64, salt }); - }); -}; - - -const stringToUTF8Array=(message)=> { - if (typeof message !== 'string') return message; // Assuming you still want to pass through non-string inputs unchanged - const encoder = new TextEncoder(); // TextEncoder defaults to UTF-8 - return encoder.encode(message); -} -const computekdf = async (req)=> { - const { salt, key, nonce, staticSalt, staticBcryptSalt } = req - const combinedBytes = utils.appendBuffer(new Uint8Array([]), stringToUTF8Array(`${staticSalt}${key}${nonce}`)) - - const sha512Hash = new Sha512().process(combinedBytes).finish().result - const sha512HashBase64 = bytesToBase64(sha512Hash) - - const result = await bcryptInWorker(sha512HashBase64.substring(0, 72), staticBcryptSalt); - return { key, nonce, result } -} - -export const doInitWorkers = (numberOfWorkers) => { - const workers = [] - - try { - for (let i = 0; i < numberOfWorkers; i++) { - workers.push({}) - } - - } catch (e) { - } - - return workers -} - -export const kdf = async (seed, salt, threads) => { - const workers = threads - const salt2 = new Uint8Array(salt) - - salt = new Uint8Array(salt) - const seedParts = await Promise.all(workers.map((worker, index) => { - const nonce = index - return computekdf({ - key: seed, - salt, - nonce, - staticSalt: crypto2.staticSalt, - staticBcryptSalt: crypto2.staticBcryptSalt - }).then(data => { - let jsonData - try { - jsonData = JSON.parse(data) - data = jsonData - } catch (e) { - // ... - } - // if (seed !== data.key) throw new Error(kst3 + seed + ' !== ' + data.key) - // if (nonce !== data.nonce) throw new Error(kst4) - return data.result - }) - })) - const result = new Sha512().process(stringtoUTF8Array(crypto2.staticSalt + seedParts.reduce((a, c) => a + c))).finish().result - return result -} diff --git a/src/encryption/AltcoinHDWallet.ts b/src/encryption/AltcoinHDWallet.ts new file mode 100644 index 0000000..0af6875 --- /dev/null +++ b/src/encryption/AltcoinHDWallet.ts @@ -0,0 +1,881 @@ +// @ts-nocheck +import Base58 from './Base58.js'; +import { Sha256, Sha512 } from 'asmcrypto.js'; +import jsSHA from 'jssha'; +import RIPEMD160 from './ripemd160.js'; +import utils from '../utils/utils.js'; +import { BigInteger, EllipticCurve } from './ecbn'; +import { Buffer } from 'buffer'; + +export default class AltcoinHDWallet { + constructor(addressParams) { + /** + * Seed - 32 bytes + */ + + this.seed = new Uint8Array(32); + + /** + * Version Bytes - 4 byte + */ + + this.versionBytes = addressParams; + + /** + * Depth - 1 byte + */ + + this.depth = 0; + + /** + * Parent Fingerprint - 4 bytes + */ + + this.parentFingerprint = '0x00000000'; // master key + + /** + * Child Index - 4 bytes + */ + + this.childIndex = '0x00000000'; // master key + + /** + * Chain Code - 32 bytes + */ + + this.chainCode = new Uint8Array(32); + + /** + * Key Data - 33 bytes + */ + + this.keyData = new Uint8Array(33); + + /** + * Seed Hash - 64 bytes + */ + + this.seedHash = new Uint8Array(64); + + /** + * Private Key - 32 bytes + */ + + this.privateKey = new Uint8Array(32); + + /** + * Public Key - 33 bytes (compressed) + */ + + this.publicKey = new Uint8Array(33); + + /** + * Public Key Hash160 (used to derive the parent fingerprint for derived) + */ + + this.publicKeyHash = new Uint8Array(20); + + /** + * Master Private Key (Base58 encoded) + */ + + this.masterPrivateKey = ''; + + /** + * Master Public Key (Base58 encoded) + */ + + this.masterPublicKey = ''; + + /** + * Testnet Master Private Key (Base58 encoded) - THIS IS TESTNET + */ + + this._tMasterPrivateKey = ''; + + /** + * Testnet Master Public Key (Base58 encoded) - THIS IS TESTNET + */ + + this._tmasterPublicKey = ''; + + /** + * Child Keys Derivation from the Parent Keys + */ + + /** + * Child Private Key - 32 bytes + */ + + this.childPrivateKey = new Uint8Array(32); + + /** + * Child Chain Code - 32 bytes + */ + + this.childChainCode = new Uint8Array(32); + + /** + * Child Public Key - 33 bytes (compressed) + */ + + this.childPublicKey = new Uint8Array(33); + + /** + * Child Public Key Hash160 (used to derive the parent fingerprint for derived) + */ + + this.childPublicKeyHash = new Uint8Array(20); + + /** + * Extended Private Child Key - Base58 encoded + */ + + this.xPrivateChildKey = ''; + + /** + * Extended Public Child Key - Base58 encoded + */ + + this.xPublicChildKey = ''; + + /** + * Grand Child Keys Derivation from the Child Keys + */ + + /** + * Grand Child Private Key - 32 bytes + */ + + this.grandChildPrivateKey = new Uint8Array(32); + + /** + * Grand Child Chain Code - 32 bytes + */ + + this.grandChildChainCode = new Uint8Array(32); + + /** + * Grand Child Public Key - 33 bytes (compressed) + */ + + this.grandChildPublicKey = new Uint8Array(33); + + /** + * Grand Public Key Hash160 (used to derive the parent fingerprint for derived) + */ + + this.grandChildPublicKeyHash = new Uint8Array(20); + + /** + * Extended Private Grand Child Key - Base58 encoded + */ + + this.xPrivateGrandChildKey = ''; + + /** + * Extended Public Grand Child Key - Base58 encoded + */ + + this.xPublicGrandChildKey = ''; + + /** + * Litecoin Legacy Address - Derived from the Grand Child Public Key Hash + */ + + this.litecoinLegacyAddress = ''; + + /** + * TESTNET Litecoin Legacy Address (Derived from the Grand Child Public Key Hash) - THIS IS TESTNET + */ + + this._tlitecoinLegacyAddress = ''; + + /** + * Wallet - Wallet Object (keys...) + */ + + this.wallet = {}; + } + + setSeed(seed) { + this.seed = seed; + } + + createWallet(seed, isBIP44, indicator = null) { + // Set Seeed + this.setSeed(seed); + + // Generate Seed Hash + this.generateSeedHash(this.seed, isBIP44, indicator); + + // Generate Private Key + this.generatePrivateKey(this.seedHash); + + // Generate Chain Code + this.generateChainCode(this.seedHash); + + // Generate Public Key from Private Key + this.generatePublicKey(this.privateKey); + + // Generate Mainnet Master Private Key + this.generateMainnetMasterPrivateKey(); + + // Generate Mainnet Master Public Key + this.generateMainnetMasterPublicKey(); + + // Generate Testnet Master Private Key + this.generateTestnetMasterPrivateKey(); + + // Generate Testnet Master Public Key + this.generateTestnetMasterPublicKey(); + + // Generate Child and Grand Child Keys + this.generateDerivedChildKeys(); + + // Return Wallet Object Specification + return this.returnWallet(); + } + + generateSeedHash(seed, isBIP44, indicator = null) { + let buffer; + + if (isBIP44) { + buffer = utils.appendBuffer( + seed.reverse(), + utils.int32ToBytes(indicator) + ); + } else { + if (indicator !== null) { + const indicatorString = utils.stringtoUTF8Array(indicator); + buffer = utils.appendBuffer(seed.reverse(), indicatorString); + } else { + buffer = seed.reverse(); + } + } + + const _reverseSeedHash = new Sha256().process(buffer).finish().result; + this.seedHash = new Sha512() + .process(utils.appendBuffer(seed, _reverseSeedHash)) + .finish().result; + } + + generatePrivateKey(seedHash) { + const SECP256K1_CURVE_ORDER = new BigInteger( + '0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141' + ); + + const privateKeyHash = seedHash.slice(0, 32); + + this.seed58 = Base58.encode(privateKeyHash); + + const _privateKeyHash = [...privateKeyHash]; + let privateKeyBigInt = BigInteger.fromByteArrayUnsigned(_privateKeyHash); + + const privateKey = privateKeyBigInt + .mod(SECP256K1_CURVE_ORDER.subtract(BigInteger.ONE)) + .add(BigInteger.ONE); + this.privateKey = privateKey.toByteArrayUnsigned(); + } + + generateChainCode(seedHash) { + this.chainCode = new Sha256() + .process(seedHash.slice(32, 64)) + .finish().result; + } + + generatePublicKey(privateKey) { + const _privateKey = [...privateKey]; + const privateKeyBigInt = BigInteger.fromByteArrayUnsigned(_privateKey); + + const epCurve = EllipticCurve.getSECCurveByName('secp256k1'); + const curvePoints = epCurve.getG().multiply(privateKeyBigInt); + + const x = curvePoints.getX().toBigInteger(); + const y = curvePoints.getY().toBigInteger(); + + /** + * Deriving Uncompressed Public Key (65 bytes) + * + * const publicKeyBytes = EllipticCurve.integerToBytes(x, 32) + * this.publicKey = publicKeyBytes.concat(EllipticCurve.integerToBytes(y, 32)) + * this.publicKey.unshift(0x04) // append point indicator + */ + + // Compressed Public Key (33 bytes) + this.publicKey = EllipticCurve.integerToBytes(x, 32); + + if (y.isEven()) { + this.publicKey.unshift(0x02); // append point indicator + } else { + this.publicKey.unshift(0x03); // append point indicator + } + + // PublicKey Hash + const publicKeySHA256 = new Sha256() + .process(new Uint8Array(this.publicKey)) + .finish().result; + const _publicKeyHash = new RIPEMD160() + .update(Buffer.from(publicKeySHA256)) + .digest('hex'); + this.publicKeyHash = _publicKeyHash; + } + + generateMainnetMasterPrivateKey() { + // Serialization Variable + const s = []; + + // Append Version Byte + s.push(...utils.int32ToBytes(this.versionBytes.mainnet.private)); + + // Append Depth + s.push(this.depth); + + // Append Parent Fingerprint + s.push(...utils.int32ToBytes(this.parentFingerprint)); + + // Append Child Number + s.push(...utils.int32ToBytes(this.childIndex)); + + // Append Chain Code + s.push(...this.chainCode); + + // Append 1 byte '0x00' (to make the key data 33 bytes, DO THIS ONLY FOR PRIVATE KEYS ) + s.push(0); + + //if the private key length is less than 32 let's add leading zeros + if (this.privateKey.length < 32) { + for (let i = this.privateKey.length; i < 32; i++) { + s.push(0); + } + } + + // Append Private Key + s.push(...this.privateKey); + + // Generate CheckSum + const _s = new Uint8Array(s); + const _checkSum = new Sha256() + .process(new Sha256().process(_s).finish().result) + .finish().result; + const checkSum = _checkSum.slice(0, 4); + + // Append CheckSum + s.push(...checkSum); // And this brings us to the end of the serialization... + + // Save to Private Key as Base58 encoded + this.masterPrivateKey = Base58.encode(s); + } + + generateMainnetMasterPublicKey() { + // Serialization Variable + const s = []; + + // Append Version Byte + s.push(...utils.int32ToBytes(this.versionBytes.mainnet.public)); + + // Append Depth + s.push(this.depth); + + // Append Parent Fingerprint + s.push(...utils.int32ToBytes(this.parentFingerprint)); + + // Append Child Number + s.push(...utils.int32ToBytes(this.childIndex)); + + // Append Chain Code + s.push(...this.chainCode); + + // Append Public Key + s.push(...this.publicKey); + + // Generate CheckSum + const _s = new Uint8Array(s); + const _checkSum = new Sha256() + .process(new Sha256().process(_s).finish().result) + .finish().result; + const checkSum = _checkSum.slice(0, 4); + + // Append CheckSum + s.push(...checkSum); // And this brings us to the end of the serialization... + + // Save to Public Key as Base58 encoded + this.masterPublicKey = Base58.encode(s); + } + + generateTestnetMasterPrivateKey() { + // To be Used ONLY in Testnet... + + // Serialization Variable + const s = []; + + // Append Version Byte + s.push(...utils.int32ToBytes(this.versionBytes.testnet.private)); + + // Append Depth + s.push(this.depth); + + // Append Parent Fingerprint + s.push(...utils.int32ToBytes(this.parentFingerprint)); + + // Append Child Number + s.push(...utils.int32ToBytes(this.childIndex)); + + // Append Chain Code + s.push(...this.chainCode); + + // Append 1 byte '0x00' (to make the key data 33 bytes, DO THIS ONLY FOR PRIVATE KEYS ) + s.push(0); + + // Append Private Key + s.push(...this.privateKey); + + // Generate CheckSum + const _s = new Uint8Array(s); + const _checkSum = new Sha256() + .process(new Sha256().process(_s).finish().result) + .finish().result; + const checkSum = _checkSum.slice(0, 4); + + // Append CheckSum + s.push(...checkSum); // And this brings us to the end of the serialization... + + // Save to Private Key as Base58 encoded + this._tMasterPrivateKey = Base58.encode(s); + } + + generateTestnetMasterPublicKey() { + // To be Used ONLY in Testnet... + + // Serialization Variable + const s = []; + + // Append Version Byte + s.push(...utils.int32ToBytes(this.versionBytes.testnet.public)); + + // Append Depth + s.push(this.depth); + + // Append Parent Fingerprint + s.push(...utils.int32ToBytes(this.parentFingerprint)); + + // Append Child Number + s.push(...utils.int32ToBytes(this.childIndex)); + + // Append Chain Code + s.push(...this.chainCode); + + // Append Private Key + s.push(...this.publicKey); + + // Generate CheckSum + const _s = new Uint8Array(s); + const _checkSum = new Sha256() + .process(new Sha256().process(_s).finish().result) + .finish().result; + const checkSum = _checkSum.slice(0, 4); + + // Append CheckSum + s.push(...checkSum); // And this brings us to the end of the serialization... + + // Save to Private Key as Base58 encoded + this._tmasterPublicKey = Base58.encode(s); + } + + generateDerivedChildKeys() { + // SPEC INFO: https://en.bitcoin.it/wiki/BIP_0032#Child_key_derivation_.28CKD.29_functions + // NOTE: will not be using some of derivations func as the value is known. (So I'd rather shove in the values and rewrite out the derivations later ?) + + // NOTE: I "re-wrote" and "reduplicate" the code for child and grandChild keys derivations inorder to get the child and grandchild from the child + // TODO: Make this more better in the future + + const path = 'm/0/0'; + // let p = path.split('/') + + // Get Public kEY + const derivePublicChildKey = () => { + const _privateKey = [...this.childPrivateKey]; + const privateKeyBigInt = BigInteger.fromByteArrayUnsigned(_privateKey); + + const epCurve = EllipticCurve.getSECCurveByName('secp256k1'); + const curvePoints = epCurve.getG().multiply(privateKeyBigInt); + + const x = curvePoints.getX().toBigInteger(); + const y = curvePoints.getY().toBigInteger(); + + // Compressed Public Key (33 bytes) + this.childPublicKey = EllipticCurve.integerToBytes(x, 32); + + if (y.isEven()) { + this.childPublicKey.unshift(0x02); // append point indicator + } else { + this.childPublicKey.unshift(0x03); // append point indicator + } + + // PublicKey Hash + const childPublicKeySHA256 = new Sha256() + .process(new Uint8Array(this.childPublicKey)) + .finish().result; + const _childPublicKeyHash = new RIPEMD160() + .update(Buffer.from(childPublicKeySHA256)) + .digest('hex'); + this.childPublicKeyHash = _childPublicKeyHash; + + // Call deriveExtendedPublicChildKey // WIll be hardcoding the values... + deriveExtendedPublicChildKey(1, 0); + }; + + const derivePrivateChildKey = (cI) => { + let ib = []; + ib.push((cI >> 24) & 0xff); + ib.push((cI >> 16) & 0xff); + ib.push((cI >> 8) & 0xff); + ib.push(cI & 0xff); + + const s = [...this.publicKey].concat(ib); + + const _hmacSha512 = new jsSHA('SHA-512', 'UINT8ARRAY', { + numRounds: 1, + hmacKey: { value: this.chainCode, format: 'UINT8ARRAY' }, + }); + _hmacSha512.update(new Uint8Array(s)); + + const IL = BigInteger.fromByteArrayUnsigned([ + ..._hmacSha512.getHMAC('UINT8ARRAY').slice(0, 32), + ]); + this.childChainCode = _hmacSha512.getHMAC('UINT8ARRAY').slice(32, 64); // IR according to the SPEC + + // SECP256k1 init + const epCurve = EllipticCurve.getSECCurveByName('secp256k1'); + + const ki = IL.add(BigInteger.fromByteArrayUnsigned(this.privateKey)).mod( + epCurve.getN() + ); // parse256(IL) + kpar (mod n) ==> ki + this.childPrivateKey = ki.toByteArrayUnsigned(); + + // Call deriveExtendedPrivateChildKey + deriveExtendedPrivateChildKey(1, 0); + }; + + const deriveExtendedPrivateChildKey = (i, childIndex) => { + // Serialization Variable + const s = []; + + // Append Version Byte + s.push(...utils.int32ToBytes(this.versionBytes.mainnet.private)); + + // Append Depth (using the index as depth) + i = parseInt(i); + s.push(i); + + // Append Parent Fingerprint + s.push(...this.publicKeyHash.slice(0, 4)); + + // Append Child Index + s.push(childIndex >>> 24); + s.push((childIndex >>> 16) & 0xff); + s.push((childIndex >>> 8) & 0xff); + s.push(childIndex & 0xff); + + // Append Chain Code + s.push(...this.childChainCode); + + // Append 1 byte '0x00' (to make the key data 33 bytes, DO THIS ONLY FOR PRIVATE KEYS ) + s.push(0); + + // Append Private Key + s.push(...this.childPrivateKey); + + // Generate CheckSum + const _s = new Uint8Array(s); + const _checkSum = new Sha256() + .process(new Sha256().process(_s).finish().result) + .finish().result; + const checkSum = _checkSum.slice(0, 4); + + // Append CheckSum + s.push(...checkSum); // And this brings us to the end of the serialization... + + // Save to Private Key as Base58 encoded + this.xPrivateChildKey = Base58.encode(s); + }; + + const deriveExtendedPublicChildKey = (i, childIndex) => { + // Serialization Variable + const s = []; + + // Append Version Byte + s.push(...utils.int32ToBytes(this.versionBytes.mainnet.public)); + + // Append Depth + i = parseInt(i); + s.push(i); + + // Append Parent Fingerprint + s.push(...this.publicKeyHash.slice(0, 4)); + + // Append Child Index + s.push(childIndex >>> 24); + s.push((childIndex >>> 16) & 0xff); + s.push((childIndex >>> 8) & 0xff); + s.push(childIndex & 0xff); + + // Append Chain Code + s.push(...this.childChainCode); + + // Append Public Key + s.push(...this.childPublicKey); + + // Generate CheckSum + const _s = new Uint8Array(s); + const _checkSum = new Sha256() + .process(new Sha256().process(_s).finish().result) + .finish().result; + const checkSum = _checkSum.slice(0, 4); + + // Append CheckSum + s.push(...checkSum); // And this brings us to the end of the serialization... + + // Save to Public Key as Base58 encoded + this.xPublicChildKey = Base58.encode(s); + }; + + /** + * GRAND CHILD KEYS + * + * NOTE: I know this is not the best way to generate this (even though it works the way it ought) + * Things to rewrite will be and not limited to deriving this through a for loop, removing hard code values, etc... + */ + + const derivePublicGrandChildKey = () => { + const _privateKey = [...this.grandChildPrivateKey]; + const privateKeyBigInt = BigInteger.fromByteArrayUnsigned(_privateKey); + + const epCurve = EllipticCurve.getSECCurveByName('secp256k1'); + const curvePoints = epCurve.getG().multiply(privateKeyBigInt); + + const x = curvePoints.getX().toBigInteger(); + const y = curvePoints.getY().toBigInteger(); + + // Compressed Public Key (33 bytes) + this.grandChildPublicKey = EllipticCurve.integerToBytes(x, 32); + + if (y.isEven()) { + this.grandChildPublicKey.unshift(0x02); // append point indicator + } else { + this.grandChildPublicKey.unshift(0x03); // append point indicator + } + + // PublicKey Hash + const grandChildPublicKeySHA256 = new Sha256() + .process(new Uint8Array(this.grandChildPublicKey)) + .finish().result; + const _grandChildPublicKeyHash = new RIPEMD160() + .update(Buffer.from(grandChildPublicKeySHA256)) + .digest('hex'); + this.grandChildPublicKeyHash = _grandChildPublicKeyHash; + + // Call deriveExtendedPublicChildKey // WIll be hardcoding the values... + deriveExtendedPublicGrandChildKey(2, 0); + + /** + * Derive Litecoin Legacy Address + */ + + // Append Address Prefix + let prefix = [this.versionBytes.mainnet.prefix]; + if (2 == this.versionBytes.mainnet.prefix.length) { + prefix = [this.versionBytes.mainnet.prefix[0]]; + prefix.push([this.versionBytes.mainnet.prefix[1]]); + } + + const k = prefix.concat(...this.grandChildPublicKeyHash); + + // Derive Checksum + const _addressCheckSum = new Sha256() + .process(new Sha256().process(new Uint8Array(k)).finish().result) + .finish().result; + const addressCheckSum = _addressCheckSum.slice(0, 4); + + // Append CheckSum + const _litecoinLegacyAddress = k.concat(...addressCheckSum); + + // Convert to Base58 + this.litecoinLegacyAddress = Base58.encode(_litecoinLegacyAddress); + + /** + * Derive TESTNET Litecoin Legacy Address + */ + + // Append Version Byte + const tK = [this.versionBytes.testnet.prefix].concat( + ...this.grandChildPublicKeyHash + ); + + // Derive Checksum + const _tAddressCheckSum = new Sha256() + .process(new Sha256().process(new Uint8Array(tK)).finish().result) + .finish().result; + const tAddressCheckSum = _tAddressCheckSum.slice(0, 4); + + // Append CheckSum + const _tlitecoinLegacyAddress = tK.concat(...tAddressCheckSum); + + // Convert to Base58 + this._tlitecoinLegacyAddress = Base58.encode(_tlitecoinLegacyAddress); + }; + + const derivePrivateGrandChildKey = (cI, i) => { + let ib = []; + ib.push((cI >> 24) & 0xff); + ib.push((cI >> 16) & 0xff); + ib.push((cI >> 8) & 0xff); + ib.push(cI & 0xff); + + const s = [...this.childPublicKey].concat(ib); + + const _hmacSha512 = new jsSHA('SHA-512', 'UINT8ARRAY', { + numRounds: 1, + hmacKey: { value: this.childChainCode, format: 'UINT8ARRAY' }, + }); + _hmacSha512.update(new Uint8Array(s)); + + const IL = BigInteger.fromByteArrayUnsigned([ + ..._hmacSha512.getHMAC('UINT8ARRAY').slice(0, 32), + ]); + this.grandChildChainCode = _hmacSha512 + .getHMAC('UINT8ARRAY') + .slice(32, 64); // IR according to the SPEC + + // SECP256k1 init + const epCurve = EllipticCurve.getSECCurveByName('secp256k1'); + + const ki = IL.add( + BigInteger.fromByteArrayUnsigned(this.childPrivateKey) + ).mod(epCurve.getN()); // parse256(IL) + kpar (mod n) ==> ki + this.grandChildPrivateKey = ki.toByteArrayUnsigned(); + + // Call deriveExtendedPrivateChildKey + deriveExtendedPrivateGrandChildKey(2, 0); + }; + + const deriveExtendedPrivateGrandChildKey = (i, childIndex) => { + // Serialization Variable + const s = []; + + // Append Version Byte + s.push(...utils.int32ToBytes(this.versionBytes.mainnet.private)); + + // Append Depth (using the index as depth) + i = parseInt(i); + s.push(i); + + // Append Parent Fingerprint + s.push(...this.childPublicKeyHash.slice(0, 4)); + + // Append Child Index + s.push(childIndex >>> 24); + s.push((childIndex >>> 16) & 0xff); + s.push((childIndex >>> 8) & 0xff); + s.push(childIndex & 0xff); + + // Append Chain Code + s.push(...this.grandChildChainCode); + + // Append 1 byte '0x00' (to make the key data 33 bytes, DO THIS ONLY FOR PRIVATE KEYS ) + s.push(0); + + // Append Private Key + s.push(...this.grandChildPrivateKey); + + // Generate CheckSum + const _s = new Uint8Array(s); + const _checkSum = new Sha256() + .process(new Sha256().process(_s).finish().result) + .finish().result; + const checkSum = _checkSum.slice(0, 4); + + // Append CheckSum + s.push(...checkSum); // And this brings us to the end of the serialization... + + // Save to Private Key as Base58 encoded + this.xPrivateGrandChildKey = Base58.encode(s); + }; + + const deriveExtendedPublicGrandChildKey = (i, childIndex) => { + // Serialization Variable + const s = []; + + // Append Version Byte + s.push(...utils.int32ToBytes(this.versionBytes.mainnet.public)); + + // Append Depth + i = parseInt(i); + s.push(i); + + // Append Parent Fingerprint + s.push(...this.childPublicKeyHash.slice(0, 4)); + + // Append Child Index + s.push(childIndex >>> 24); + s.push((childIndex >>> 16) & 0xff); + s.push((childIndex >>> 8) & 0xff); + s.push(childIndex & 0xff); + + // Append Chain Code + s.push(...this.grandChildChainCode); + + // Append Public Key + s.push(...this.grandChildPublicKey); + + // Generate CheckSum + const _s = new Uint8Array(s); + const _checkSum = new Sha256() + .process(new Sha256().process(_s).finish().result) + .finish().result; + const checkSum = _checkSum.slice(0, 4); + + // Append CheckSum + s.push(...checkSum); // And this brings us to the end of the serialization... + + // Save to Public Key as Base58 encoded + this.xPublicGrandChildKey = Base58.encode(s); + }; + + // Hard Code value.. + let childIndex = 0; + + // Call derivePrivateChildKey //Hard code value + derivePrivateChildKey(childIndex); + + // Call derivePublicChildKey + derivePublicChildKey(); + + // Call derivePrivateGrandChildKey // Hard Code value... + derivePrivateGrandChildKey(0, 2); + + // Call derivePublicGrandChildKey + derivePublicGrandChildKey(); + } + + returnWallet() { + // Will be limiting the exported Wallet Object to just the Master keys and Legacy Addresses + + const wallet = { + derivedMasterPrivateKey: this.masterPrivateKey, + derivedMasterPublicKey: this.masterPublicKey, + _tDerivedMasterPrivateKey: this._tMasterPrivateKey, + _tDerivedmasterPublicKey: this._tmasterPublicKey, + seed58: this.seed58, + // derivedPrivateChildKey: this.xPrivateChildKey, + // derivedPublicChildKey: this.xPublicChildKey, + // derivedPrivateGrandChildKey: this.xPrivateGrandChildKey, + // derivedPublicGrandChildKey: this.xPublicGrandChildKey, + address: this.litecoinLegacyAddress, + _taddress: this._tlitecoinLegacyAddress, + }; + + this.wallet = wallet; + return wallet; + } +} diff --git a/src/deps/Base58.ts b/src/encryption/Base58.ts similarity index 100% rename from src/deps/Base58.ts rename to src/encryption/Base58.ts diff --git a/src/encryption/bcryptworker.worker.js b/src/encryption/bcryptworker.worker.js new file mode 100644 index 0000000..f324c3f --- /dev/null +++ b/src/encryption/bcryptworker.worker.js @@ -0,0 +1,11 @@ +import bcrypt from 'bcryptjs'; + +self.onmessage = function (e) { + const { hashBase64, salt } = e.data; + try { + const result = bcrypt.hashSync(hashBase64, salt); + self.postMessage({ result }); + } catch (error) { + self.postMessage({ error: error.message }); + } +}; diff --git a/src/deps/bcryptworkerwasm.worker.js b/src/encryption/bcryptworkerwasm.worker.js similarity index 100% rename from src/deps/bcryptworkerwasm.worker.js rename to src/encryption/bcryptworkerwasm.worker.js diff --git a/src/deps/broken-ripemd160.ts b/src/encryption/broken-ripemd160.ts similarity index 100% rename from src/deps/broken-ripemd160.ts rename to src/encryption/broken-ripemd160.ts diff --git a/src/deps/ecbn.ts b/src/encryption/ecbn.ts similarity index 100% rename from src/deps/ecbn.ts rename to src/encryption/ecbn.ts diff --git a/src/deps/ed2curve.ts b/src/encryption/ed2curve.ts similarity index 100% rename from src/deps/ed2curve.ts rename to src/encryption/ed2curve.ts diff --git a/src/encryption/encryption.ts b/src/encryption/encryption.ts new file mode 100644 index 0000000..2bf82f6 --- /dev/null +++ b/src/encryption/encryption.ts @@ -0,0 +1,369 @@ +import { getBaseApi } from '../background/background.ts'; +import i18n from '../i18n/i18n.ts'; +import { + createSymmetricKeyAndNonce, + decryptGroupData, + encryptDataGroup, + objectToBase64, +} from '../qdn/encryption/group-encryption.ts'; +import { publishData } from '../qdn/publish/publish.ts'; +import { getData } from '../utils/chromeStorage.ts'; +import { RequestQueueWithPromise } from '../utils/queue/queue.ts'; + +export const requestQueueGetPublicKeys = new RequestQueueWithPromise(10); + +async function getSaveWallet() { + const res = await getData('walletInfo').catch(() => null); + + if (res) { + return res; + } else { + throw new Error('No wallet saved'); // TODO translate + } +} + +export async function getNameInfo() { + const wallet = await getSaveWallet(); + const address = wallet.address0; + const validApi = await getBaseApi(); + const response = await fetch(validApi + '/names/primary/' + address); + const nameData = await response.json(); + if (nameData?.name) { + return nameData?.name; + } else { + return ''; + } +} + +export async function getAllUserNames() { + const wallet = await getSaveWallet(); + const address = wallet.address0; + const validApi = await getBaseApi(); + const response = await fetch(validApi + '/names/address/' + address); + const nameData = await response.json(); + return nameData.map((item) => item.name); +} + +async function getKeyPair() { + const res = await getData('keyPair').catch(() => null); + if (res) { + return res; + } else { + throw new Error('Wallet not authenticated'); + } +} + +const getPublicKeys = async (groupNumber: number) => { + const validApi = await getBaseApi(); + const response = await fetch( + `${validApi}/groups/members/${groupNumber}?limit=0` + ); + const groupData = await response.json(); + + if (groupData && Array.isArray(groupData.members)) { + // Use the request queue for fetching public keys + const memberPromises = groupData.members + .filter((member) => member.member) + .map((member) => + requestQueueGetPublicKeys.enqueue(async () => { + const resAddress = await fetch( + `${validApi}/addresses/${member.member}` + ); + const resData = await resAddress.json(); + return resData.publicKey; + }) + ); + + const members = await Promise.all(memberPromises); + return members; + } + + return []; +}; + +export const getPublicKeysByAddress = async (admins: string[]) => { + const validApi = await getBaseApi(); + + if (Array.isArray(admins)) { + // Use the request queue to limit concurrent fetches + const memberPromises = admins + .filter((address) => address) // Ensure the address is valid + .map((address) => + requestQueueGetPublicKeys.enqueue(async () => { + const resAddress = await fetch(`${validApi}/addresses/${address}`); + const resData = await resAddress.json(); + return resData.publicKey; + }) + ); + + const members = await Promise.all(memberPromises); + return members; + } + + return []; // Return empty array if admins is not an array +}; + +export const encryptAndPublishSymmetricKeyGroupChat = async ({ + groupId, + previousData, +}: { + groupId: number; + previousData: Object; +}) => { + try { + let highestKey = 0; + if (previousData) { + highestKey = Math.max( + ...Object.keys(previousData || {}) + .filter((item) => !isNaN(+item)) + .map(Number) + ); + } + + const resKeyPair = await getKeyPair(); + const parsedData = resKeyPair; + const privateKey = parsedData.privateKey; + const userPublicKey = parsedData.publicKey; + const groupmemberPublicKeys = await getPublicKeys(groupId); + const symmetricKey = createSymmetricKeyAndNonce(); + const nextNumber = highestKey + 1; + const objectToSave = { + ...previousData, + [nextNumber]: symmetricKey, + }; + + const symmetricKeyAndNonceBase64 = await objectToBase64(objectToSave); + + const encryptedData = encryptDataGroup({ + data64: symmetricKeyAndNonceBase64, + publicKeys: groupmemberPublicKeys, + privateKey, + userPublicKey, + }); + if (encryptedData) { + const registeredName = await getNameInfo(); + const data = await publishData({ + data: encryptedData, + file: encryptedData, + identifier: `symmetric-qchat-group-${groupId}`, + registeredName, + service: 'DOCUMENT_PRIVATE', + uploadType: 'base64', + withFee: true, + }); + return { + data, + numberOfMembers: groupmemberPublicKeys.length, + }; + } else { + throw new Error( + i18n.t('auth:message.error.encrypt_content', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + } catch (error: any) { + throw new Error(error.message); + } +}; + +export const encryptAndPublishSymmetricKeyGroupChatForAdmins = async ({ + groupId, + previousData, + admins, +}: { + groupId: number; + previousData: Object; +}) => { + try { + let highestKey = 0; + if (previousData) { + highestKey = Math.max( + ...Object.keys(previousData || {}) + .filter((item) => !isNaN(+item)) + .map(Number) + ); + } + + const resKeyPair = await getKeyPair(); + const parsedData = resKeyPair; + const privateKey = parsedData.privateKey; + const userPublicKey = parsedData.publicKey; + const groupmemberPublicKeys = await getPublicKeysByAddress( + admins.map((admin) => admin.address) + ); + + const symmetricKey = createSymmetricKeyAndNonce(); + const nextNumber = highestKey + 1; + const objectToSave = { + ...previousData, + [nextNumber]: symmetricKey, + }; + + const symmetricKeyAndNonceBase64 = await objectToBase64(objectToSave); + + const encryptedData = encryptDataGroup({ + data64: symmetricKeyAndNonceBase64, + publicKeys: groupmemberPublicKeys, + privateKey, + userPublicKey, + }); + if (encryptedData) { + const registeredName = await getNameInfo(); + const data = await publishData({ + data: encryptedData, + file: encryptedData, + identifier: `admins-symmetric-qchat-group-${groupId}`, + registeredName, + service: 'DOCUMENT_PRIVATE', + uploadType: 'base64', + withFee: true, + }); + return { + data, + numberOfMembers: groupmemberPublicKeys.length, + }; + } else { + throw new Error( + i18n.t('auth:message.error.encrypt_content', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + } catch (error: any) { + throw new Error(error.message); + } +}; + +export const publishGroupEncryptedResource = async ({ + encryptedData, + identifier, +}) => { + try { + if (encryptedData && identifier) { + const registeredName = await getNameInfo(); + if (!registeredName) + throw new Error( + i18n.t('core:message.generic.name_publish', { + postProcess: 'capitalizeFirstChar', + }) + ); + const data = await publishData({ + data: encryptedData, + file: encryptedData, + identifier, + registeredName, + service: 'DOCUMENT', + uploadType: 'base64', + withFee: true, + }); + return data; + } else { + throw new Error( + i18n.t('auth:message.error.encrypt_content', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + } catch (error: any) { + throw new Error(error.message); + } +}; + +export const publishOnQDN = async ({ + category, + data, + description, + identifier, + name, + service, + tag1, + tag2, + tag3, + tag4, + tag5, + title, + uploadType = 'base64', +}) => { + if (data && service) { + const registeredName = name || (await getNameInfo()); + if (!registeredName) + throw new Error( + i18n.t('core:message.generic.name_publish', { + postProcess: 'capitalizeFirstChar', + }) + ); + + const res = await publishData({ + registeredName, + data, + file: data, + service, + identifier, + uploadType, + withFee: true, + title, + description, + category, + tag1, + tag2, + tag3, + tag4, + tag5, + }); + return res; + } else { + throw new Error('Cannot publish content'); + } +}; + +export function uint8ArrayToBase64(uint8Array: any) { + const length = uint8Array.length; + let binaryString = ''; + const chunkSize = 1024 * 1024; // Process 1MB at a time + for (let i = 0; i < length; i += chunkSize) { + const chunkEnd = Math.min(i + chunkSize, length); + const chunk = uint8Array.subarray(i, chunkEnd); + + // @ts-ignore + binaryString += Array.from(chunk, (byte) => String.fromCharCode(byte)).join( + '' + ); + } + return btoa(binaryString); +} + +export function base64ToUint8Array(base64: string) { + const binaryString = atob(base64); + const len = binaryString.length; + const bytes = new Uint8Array(len); + + for (let i = 0; i < len; i++) { + bytes[i] = binaryString.charCodeAt(i); + } + + return bytes; +} + +export const decryptGroupEncryption = async ({ data }: { data: string }) => { + try { + const resKeyPair = await getKeyPair(); + const parsedData = resKeyPair; + const privateKey = parsedData.privateKey; + const encryptedData = decryptGroupData(data, privateKey); + return { + data: uint8ArrayToBase64(encryptedData.decryptedData), + count: encryptedData.count, + }; + } catch (error: any) { + throw new Error(error.message); + } +}; + +export function uint8ArrayToObject(uint8Array: any) { + // Decode the byte array using TextDecoder + const decoder = new TextDecoder(); + const jsonString = decoder.decode(uint8Array); + // Convert the JSON string back into an object + return JSON.parse(jsonString); +} diff --git a/src/encryption/kdf.ts b/src/encryption/kdf.ts new file mode 100644 index 0000000..5010c0e --- /dev/null +++ b/src/encryption/kdf.ts @@ -0,0 +1,110 @@ +// @ts-nocheck + +import { bytes_to_base64 as bytesToBase64, Sha512 } from 'asmcrypto.js'; +import utils from '../utils/utils'; +import { crypto as crypto2 } from '../constants/decryptWallet'; +import BcryptWorker from './bcryptworker.worker.js?worker'; + +const stringtoUTF8Array = (message) => { + if (typeof message === 'string') { + var s = unescape(encodeURIComponent(message)); // UTF-8 + message = new Uint8Array(s.length); + for (var i = 0; i < s.length; i++) { + message[i] = s.charCodeAt(i) & 0xff; + } + } + return message; +}; + +const bcryptInWorker = (hashBase64, salt) => { + return new Promise((resolve, reject) => { + const worker = new BcryptWorker(); + worker.onmessage = (e) => { + const { result, error } = e.data; + if (error) { + reject(error); + } else { + resolve(result); + } + worker.terminate(); + }; + worker.onerror = (err) => { + reject(err.message); + worker.terminate(); + }; + worker.postMessage({ hashBase64, salt }); + }); +}; + +const stringToUTF8Array = (message) => { + if (typeof message !== 'string') return message; // Assuming you still want to pass through non-string inputs unchanged + const encoder = new TextEncoder(); // TextEncoder defaults to UTF-8 + return encoder.encode(message); +}; + +const computekdf = async (req) => { + const { salt, key, nonce, staticSalt, staticBcryptSalt } = req; + const combinedBytes = utils.appendBuffer( + new Uint8Array([]), + stringToUTF8Array(`${staticSalt}${key}${nonce}`) + ); + + const sha512Hash = new Sha512().process(combinedBytes).finish().result; + const sha512HashBase64 = bytesToBase64(sha512Hash); + + const result = await bcryptInWorker( + sha512HashBase64.substring(0, 72), + staticBcryptSalt + ); + return { key, nonce, result }; +}; + +export const doInitWorkers = (numberOfWorkers) => { + const workers = []; + + try { + for (let i = 0; i < numberOfWorkers; i++) { + workers.push({}); + } + } catch (e) {} + + return workers; +}; + +export const kdf = async (seed, salt, threads) => { + const workers = threads; + const salt2 = new Uint8Array(salt); + + salt = new Uint8Array(salt); + const seedParts = await Promise.all( + workers.map((worker, index) => { + const nonce = index; + return computekdf({ + key: seed, + salt, + nonce, + staticSalt: crypto2.staticSalt, + staticBcryptSalt: crypto2.staticBcryptSalt, + }).then((data) => { + let jsonData; + try { + jsonData = JSON.parse(data); + data = jsonData; + } catch (e) { + // ... + } + // if (seed !== data.key) throw new Error(kst3 + seed + ' !== ' + data.key) + // if (nonce !== data.nonce) throw new Error(kst4) + return data.result; + }); + }) + ); + + const result = new Sha512() + .process( + stringtoUTF8Array(crypto2.staticSalt + seedParts.reduce((a, c) => a + c)) + ) + .finish().result; + + return result; +}; diff --git a/src/deps/nacl-fast.ts b/src/encryption/nacl-fast.ts similarity index 100% rename from src/deps/nacl-fast.ts rename to src/encryption/nacl-fast.ts diff --git a/src/deps/ripemd160.ts b/src/encryption/ripemd160.ts similarity index 100% rename from src/deps/ripemd160.ts rename to src/encryption/ripemd160.ts diff --git a/src/hooks/useAppFullscreen.tsx b/src/hooks/useAppFullscreen.tsx new file mode 100644 index 0000000..1ce6842 --- /dev/null +++ b/src/hooks/useAppFullscreen.tsx @@ -0,0 +1,85 @@ +import { useCallback, useEffect } from 'react'; + +export const useAppFullScreen = (setFullScreen) => { + const enterFullScreen = useCallback(() => { + const element = document.documentElement; // Target the entire HTML document + if (element.requestFullscreen) { + element.requestFullscreen(); + } else if (element.mozRequestFullScreen) { + // Firefox + element.mozRequestFullScreen(); + } else if (element.webkitRequestFullscreen) { + // Chrome, Safari and Opera + element.webkitRequestFullscreen(); + } else if (element.msRequestFullscreen) { + // IE/Edge + element.msRequestFullscreen(); + } + }, []); + + const exitFullScreen = useCallback(() => { + if (document.fullscreenElement) { + document.exitFullscreen(); + } else if (document.mozFullScreenElement) { + document.mozCancelFullScreen(); + } else if (document.webkitFullscreenElement) { + document.webkitExitFullscreen(); + } else if (document.msFullscreenElement) { + document.msExitFullscreen(); + } + }, []); + + const toggleFullScreen = useCallback(() => { + if ( + document.fullscreenElement || + document.mozFullScreenElement || + document.webkitFullscreenElement || + document.msFullscreenElement + ) { + exitFullScreen(); + setFullScreen(false); + } else { + enterFullScreen(); + setFullScreen(true); + } + }, [enterFullScreen, exitFullScreen]); + + // Listen for changes to fullscreen state + useEffect(() => { + const handleFullScreenChange = () => { + if ( + document.fullscreenElement || + document.mozFullScreenElement || + document.webkitFullscreenElement || + document.msFullscreenElement + ) { + // TODO check empty block + } else { + setFullScreen(false); + } + }; + + document.addEventListener('fullscreenchange', handleFullScreenChange); + document.addEventListener('webkitfullscreenchange', handleFullScreenChange); // Safari + document.addEventListener('mozfullscreenchange', handleFullScreenChange); // Firefox + document.addEventListener('MSFullscreenChange', handleFullScreenChange); // IE/Edge + + return () => { + document.removeEventListener('fullscreenchange', handleFullScreenChange); + document.removeEventListener( + 'webkitfullscreenchange', + handleFullScreenChange + ); + document.removeEventListener( + 'mozfullscreenchange', + handleFullScreenChange + ); + document.removeEventListener( + 'MSFullscreenChange', + handleFullScreenChange + ); + }; + }, []); + + return { enterFullScreen, exitFullScreen, toggleFullScreen }; +}; diff --git a/src/hooks/useBlockUsers.tsx b/src/hooks/useBlockUsers.tsx new file mode 100644 index 0000000..9e64e3b --- /dev/null +++ b/src/hooks/useBlockUsers.tsx @@ -0,0 +1,207 @@ +import { useCallback, useEffect, useMemo, useRef } from 'react'; + +export const useBlockedAddresses = (isAuthenticated?: boolean) => { + const userBlockedRef = useRef({}); + const userNamesBlockedRef = useRef({}); + + const getAllBlockedUsers = useCallback(() => { + return { + names: userNamesBlockedRef.current, + addresses: userBlockedRef.current, + }; + }, []); + + const isUserBlocked = useCallback((address, name) => { + try { + if (!address) return false; + if (userBlockedRef.current[address]) return true; + return false; + } catch (error) { + console.log(error); + } + }, []); + + useEffect(() => { + if (!isAuthenticated) return; + userBlockedRef.current = {}; + userNamesBlockedRef.current = {}; + const fetchBlockedList = async () => { + try { + const response = await new Promise((res, rej) => { + window + .sendMessage('listActions', { + type: 'get', + listName: `blockedAddresses`, + }) + .then((response) => { + if (response.error) { + rej(response?.message); + return; + } else { + res(response); + } + }) + .catch((error) => { + console.error('Failed qortalRequest', error); + }); + }); + + const blockedUsers = {}; + + response?.forEach((item) => { + blockedUsers[item] = true; + }); + + userBlockedRef.current = blockedUsers; + + const response2 = await new Promise((res, rej) => { + window + .sendMessage('listActions', { + type: 'get', + listName: `blockedNames`, + }) + .then((response) => { + if (response.error) { + rej(response?.message); + return; + } else { + res(response); + } + }) + .catch((error) => { + console.error('Failed qortalRequest', error); + }); + }); + + const blockedUsers2 = {}; + + response2?.forEach((item) => { + blockedUsers2[item] = true; + }); + + userNamesBlockedRef.current = blockedUsers2; + } catch (error) { + console.error(error); + } + }; + fetchBlockedList(); + }, [isAuthenticated]); + + const removeBlockFromList = useCallback(async (address, name) => { + if (name) { + await new Promise((res, rej) => { + window + .sendMessage('listActions', { + type: 'remove', + items: [name], + listName: 'blockedNames', + }) + .then((response) => { + if (response.error) { + rej(response?.message); + return; + } else { + const copyObject = { ...userNamesBlockedRef.current }; + delete copyObject[name]; + userNamesBlockedRef.current = copyObject; + + res(response); + } + }) + .catch((error) => { + console.error('Failed qortalRequest', error); + }); + }); + } + + if (address) { + await new Promise((res, rej) => { + window + .sendMessage('listActions', { + type: 'remove', + items: [address], + listName: 'blockedAddresses', + }) + .then((response) => { + if (response.error) { + rej(response?.message); + return; + } else { + const copyObject = { ...userBlockedRef.current }; + delete copyObject[address]; + userBlockedRef.current = copyObject; + + res(response); + } + }) + .catch((error) => { + console.error('Failed qortalRequest', error); + }); + }); + } + }, []); + + const addToBlockList = useCallback(async (address, name) => { + if (name) { + await new Promise((res, rej) => { + window + .sendMessage('listActions', { + type: 'add', + items: [name], + listName: 'blockedNames', + }) + .then((response) => { + if (response.error) { + rej(response?.message); + return; + } else { + const copyObject = { ...userNamesBlockedRef.current }; + copyObject[name] = true; + userNamesBlockedRef.current = copyObject; + + res(response); + } + }) + .catch((error) => { + console.error('Failed qortalRequest', error); + }); + }); + } + + if (address) { + await new Promise((res, rej) => { + window + .sendMessage('listActions', { + type: 'add', + items: [address], + listName: 'blockedAddresses', + }) + .then((response) => { + if (response.error) { + rej(response?.message); + return; + } else { + const copyObject = { ...userBlockedRef.current }; + copyObject[address] = true; + userBlockedRef.current = copyObject; + + res(response); + } + }) + .catch((error) => { + console.error('Failed qortalRequest', error); + }); + }); + } + }, []); + + return useMemo( + () => ({ + isUserBlocked, + addToBlockList, + removeBlockFromList, + getAllBlockedUsers, + }), + [isUserBlocked, addToBlockList, removeBlockFromList, getAllBlockedUsers] + ); +}; diff --git a/src/hooks/useFetchResources.tsx b/src/hooks/useFetchResources.tsx new file mode 100644 index 0000000..8e388a7 --- /dev/null +++ b/src/hooks/useFetchResources.tsx @@ -0,0 +1,167 @@ +import { useCallback } from 'react'; +import { resourceDownloadControllerAtom } from '../atoms/global'; +import { getBaseApiReact } from '../App'; +import { useSetAtom } from 'jotai'; + +export const useFetchResources = () => { + const setResources = useSetAtom(resourceDownloadControllerAtom); + + const downloadResource = useCallback( + ({ service, name, identifier }, build) => { + setResources((prev) => ({ + ...prev, + [`${service}-${name}-${identifier}`]: { + ...(prev[`${service}-${name}-${identifier}`] || {}), + service, + name, + identifier, + }, + })); + + try { + let isCalling = false; + let percentLoaded = 0; + let timer = 24; + let tries = 0; + let calledFirstTime = false; + let intervalId; + let timeoutId; + const callFunction = async () => { + if (isCalling) return; + isCalling = true; + + let res; + + if (!build) { + const urlFirstTime = `${getBaseApiReact()}/arbitrary/resource/status/${service}/${name}/${identifier}`; + const resCall = await fetch(urlFirstTime, { + method: 'GET', + headers: { + 'Content-Type': 'application/json', + }, + }); + res = await resCall.json(); + if (tries > 18) { + if (intervalId) { + clearInterval(intervalId); + } + if (timeoutId) { + clearTimeout(timeoutId); + } + setResources((prev) => ({ + ...prev, + [`${service}-${name}-${identifier}`]: { + ...(prev[`${service}-${name}-${identifier}`] || {}), + status: { + ...res, + status: 'FAILED_TO_DOWNLOAD', + }, + }, + })); + return; + } + tries = tries + 1; + } + + if (build || (calledFirstTime === false && res?.status !== 'READY')) { + const url = `${getBaseApiReact()}/arbitrary/resource/properties/${service}/${name}/${identifier}?build=true`; + const resCall = await fetch(url, { + method: 'GET', + headers: { + 'Content-Type': 'application/json', + }, + }); + res = await resCall.json(); + } + calledFirstTime = true; + isCalling = false; + + if (res.localChunkCount) { + if (res.percentLoaded) { + if ( + res.percentLoaded === percentLoaded && + res.percentLoaded !== 100 + ) { + timer = timer - 5; + } else { + timer = 24; + } + + if (timer < 0) { + timer = 24; + isCalling = true; + + // Update Recoil state for refetching + setResources((prev) => ({ + ...prev, + [`${service}-${name}-${identifier}`]: { + ...(prev[`${service}-${name}-${identifier}`] || {}), + status: { + ...res, + status: 'REFETCHING', + }, + }, + })); + + timeoutId = setTimeout(() => { + isCalling = false; + downloadResource({ name, service, identifier }, true); + }, 25000); + + return; + } + + percentLoaded = res.percentLoaded; + } + + // Update Recoil state for progress + setResources((prev) => ({ + ...prev, + [`${service}-${name}-${identifier}`]: { + ...(prev[`${service}-${name}-${identifier}`] || {}), + status: res, + }, + })); + } + + // Check if progress is 100% and clear interval if true + if (res?.status === 'READY') { + if (intervalId) { + clearInterval(intervalId); + } + if (timeoutId) { + clearTimeout(timeoutId); + } + // Update Recoil state for completion + setResources((prev) => ({ + ...prev, + [`${service}-${name}-${identifier}`]: { + ...(prev[`${service}-${name}-${identifier}`] || {}), + status: res, + }, + })); + } + if (res?.status === 'DOWNLOADED') { + const url = `${getBaseApiReact()}/arbitrary/resource/status/${service}/${name}/${identifier}?build=true`; + const resCall = await fetch(url, { + method: 'GET', + headers: { + 'Content-Type': 'application/json', + }, + }); + res = await resCall.json(); + } + }; + callFunction(); + intervalId = setInterval(async () => { + callFunction(); + }, 5000); + } catch (error) { + console.error('Error during resource fetch:', error); + } + }, + [setResources] + ); + + return downloadResource; +}; diff --git a/src/hooks/useHandlePaymentNotification.tsx b/src/hooks/useHandlePaymentNotification.tsx index b5df816..e25fae2 100644 --- a/src/hooks/useHandlePaymentNotification.tsx +++ b/src/hooks/useHandlePaymentNotification.tsx @@ -1,132 +1,142 @@ -import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react' +import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import { getBaseApiReact } from '../App'; import { getData, storeData } from '../utils/chromeStorage'; -import { checkDifference, getNameInfoForOthers } from '../background'; -import { useRecoilState } from 'recoil'; +import { + checkDifference, + getNameInfoForOthers, +} from '../background/background.ts'; import { lastPaymentSeenTimestampAtom } from '../atoms/global'; import { subscribeToEvent, unsubscribeFromEvent } from '../utils/events'; +import { useAtom } from 'jotai'; export const useHandlePaymentNotification = (address) => { - const [latestTx, setLatestTx] = useState(null); + const nameAddressOfSender = useRef({}); + const isFetchingName = useRef({}); + const [latestTx, setLatestTx] = useState(null); + const [lastEnteredTimestampPayment, setLastEnteredTimestampPayment] = useAtom( + lastPaymentSeenTimestampAtom + ); - const nameAddressOfSender = useRef({}) - const isFetchingName = useRef({}) - - - const [lastEnteredTimestampPayment, setLastEnteredTimestampPayment] = - useRecoilState(lastPaymentSeenTimestampAtom); - - useEffect(() => { - if (lastEnteredTimestampPayment && address) { - storeData(`last-seen-payment-${address}`, Date.now()).catch((error) => { - console.error(error); - }); - } - }, [lastEnteredTimestampPayment, address]); - - const getNameOrAddressOfSender = useCallback(async(senderAddress)=> { - if(isFetchingName.current[senderAddress]) return senderAddress - try { - isFetchingName.current[senderAddress] = true - const res = await getNameInfoForOthers(senderAddress) - nameAddressOfSender.current[senderAddress] = res || senderAddress - } catch (error) { - console.error(error) - } finally { - isFetchingName.current[senderAddress] = false - } - - }, []) - - const getNameOrAddressOfSenderMiddle = useCallback(async(senderAddress)=> { - getNameOrAddressOfSender(senderAddress) - return senderAddress - - }, [getNameOrAddressOfSender]) - - const hasNewPayment = useMemo(() => { - if (!latestTx) return false; - if (!checkDifference(latestTx?.timestamp)) return false; - if ( - !lastEnteredTimestampPayment || - lastEnteredTimestampPayment < latestTx?.timestamp - ) - return true; - - return false; - }, [lastEnteredTimestampPayment, latestTx]); - - const getLastSeenData = useCallback(async () => { - try { - if (!address) return; - const key = `last-seen-payment-${address}`; - - const res = await getData(key).catch(() => null); - if (res) { - setLastEnteredTimestampPayment(res); - } - - const response = await fetch( - `${getBaseApiReact()}/transactions/search?txType=PAYMENT&address=${address}&confirmationStatus=CONFIRMED&limit=5&reverse=true` - ); - - const responseData = await response.json(); - - const latestTx = responseData.filter( - (tx) => tx?.creatorAddress !== address && tx?.recipient === address - )[0]; - if (!latestTx) { - return; // continue to the next group - } - - setLatestTx(latestTx); - } catch (error) { + useEffect(() => { + if (lastEnteredTimestampPayment && address) { + storeData(`last-seen-payment-${address}`, Date.now()).catch((error) => { console.error(error); - } - }, [address, setLastEnteredTimestampPayment]); - - - useEffect(() => { - getLastSeenData(); - // Handler function for incoming messages - const messageHandler = (event) => { - if (event.origin !== window.location.origin) { - return; - } - const message = event.data; - if (message?.action === "SET_PAYMENT_ANNOUNCEMENT" && message?.payload) { - setLatestTx(message.payload); - } - }; - - // Attach the event listener - window.addEventListener("message", messageHandler); - - // Clean up the event listener on component unmount - return () => { - window.removeEventListener("message", messageHandler); - }; - }, [getLastSeenData]); + }); + } + }, [lastEnteredTimestampPayment, address]); - const setLastEnteredTimestampPaymentEventFunc = useCallback( - (e) => { - setLastEnteredTimestampPayment(Date.now) - }, - [setLastEnteredTimestampPayment] + const getNameOrAddressOfSender = useCallback(async (senderAddress) => { + if (isFetchingName.current[senderAddress]) return senderAddress; + try { + isFetchingName.current[senderAddress] = true; + const res = await getNameInfoForOthers(senderAddress); + nameAddressOfSender.current[senderAddress] = res || senderAddress; + } catch (error) { + console.error(error); + } finally { + isFetchingName.current[senderAddress] = false; + } + }, []); + + const getNameOrAddressOfSenderMiddle = useCallback( + async (senderAddress) => { + getNameOrAddressOfSender(senderAddress); + return senderAddress; + }, + [getNameOrAddressOfSender] + ); + + const hasNewPayment = useMemo(() => { + if (!latestTx) return false; + if (!checkDifference(latestTx?.timestamp)) return false; + if ( + !lastEnteredTimestampPayment || + lastEnteredTimestampPayment < latestTx?.timestamp + ) + return true; + + return false; + }, [lastEnteredTimestampPayment, latestTx]); + + const getLastSeenData = useCallback(async () => { + try { + if (!address) return; + const key = `last-seen-payment-${address}`; + + const res = await getData(key).catch(() => null); + + if (res) { + setLastEnteredTimestampPayment(res); + } + + const response = await fetch( + `${getBaseApiReact()}/transactions/search?txType=PAYMENT&address=${address}&confirmationStatus=CONFIRMED&limit=5&reverse=true` ); - - useEffect(() => { - subscribeToEvent("setLastEnteredTimestampPaymentEvent", setLastEnteredTimestampPaymentEventFunc); - - return () => { - unsubscribeFromEvent("setLastEnteredTimestampPaymentEvent", setLastEnteredTimestampPaymentEventFunc); - }; - }, [setLastEnteredTimestampPaymentEventFunc]); + + const responseData = await response.json(); + + const latestTx = responseData.filter( + (tx) => tx?.creatorAddress !== address && tx?.recipient === address + )[0]; + + if (!latestTx) { + return; // continue to the next group + } + + setLatestTx(latestTx); + } catch (error) { + console.error(error); + } + }, [address, setLastEnteredTimestampPayment]); + + useEffect(() => { + getLastSeenData(); + // Handler function for incoming messages + const messageHandler = (event) => { + if (event.origin !== window.location.origin) { + return; + } + const message = event.data; + if (message?.action === 'SET_PAYMENT_ANNOUNCEMENT' && message?.payload) { + setLatestTx(message.payload); + } + }; + + // Attach the event listener + window.addEventListener('message', messageHandler); + + // Clean up the event listener on component unmount + return () => { + window.removeEventListener('message', messageHandler); + }; + }, [getLastSeenData]); + + const setLastEnteredTimestampPaymentEventFunc = useCallback( + (e) => { + setLastEnteredTimestampPayment(Date.now); + }, + [setLastEnteredTimestampPayment] + ); + + useEffect(() => { + subscribeToEvent( + 'setLastEnteredTimestampPaymentEvent', + setLastEnteredTimestampPaymentEventFunc + ); + + return () => { + unsubscribeFromEvent( + 'setLastEnteredTimestampPaymentEvent', + setLastEnteredTimestampPaymentEventFunc + ); + }; + }, [setLastEnteredTimestampPaymentEventFunc]); + return { latestTx, getNameOrAddressOfSenderMiddle, hasNewPayment, setLastEnteredTimestampPayment, - nameAddressOfSender - } -} + nameAddressOfSender, + }; +}; diff --git a/src/hooks/useHandlePrivateApps.tsx b/src/hooks/useHandlePrivateApps.tsx new file mode 100644 index 0000000..1065502 --- /dev/null +++ b/src/hooks/useHandlePrivateApps.tsx @@ -0,0 +1,281 @@ +import { useContext, useState } from 'react'; +import { executeEvent } from '../utils/events'; +import { getBaseApiReact, QORTAL_APP_CONTEXT } from '../App'; +import { createEndpoint } from '../background/background.ts'; +import { + settingsLocalLastUpdatedAtom, + sortablePinnedAppsAtom, +} from '../atoms/global'; +import { saveToLocalStorage } from '../components/Apps/AppsNavBarDesktop'; +import { base64ToUint8Array } from '../qdn/encryption/group-encryption'; +import { uint8ArrayToObject } from '../encryption/encryption.ts'; +import { useSetAtom } from 'jotai'; +import { useTranslation } from 'react-i18next'; + +export const useHandlePrivateApps = () => { + const [status, setStatus] = useState(''); + const { + openSnackGlobal, + setOpenSnackGlobal, + infoSnackCustom, + setInfoSnackCustom, + } = useContext(QORTAL_APP_CONTEXT); + const setSortablePinnedApps = useSetAtom(sortablePinnedAppsAtom); + const setSettingsLocalLastUpdated = useSetAtom(settingsLocalLastUpdatedAtom); + const { t } = useTranslation([ + 'auth', + 'core', + 'group', + 'question', + 'tutorial', + ]); + + const openApp = async ( + privateAppProperties, + addToPinnedApps, + setLoadingStatePrivateApp + ) => { + try { + if (setLoadingStatePrivateApp) { + setLoadingStatePrivateApp( + t('core:message.generic.downloading_decrypting_app', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + setOpenSnackGlobal(true); + + setInfoSnackCustom({ + type: 'info', + message: t('core:message.generic.fetching_data', { + postProcess: 'capitalizeFirstChar', + }), + duration: null, + }); + const urlData = `${getBaseApiReact()}/arbitrary/${ + privateAppProperties?.service + }/${privateAppProperties?.name}/${ + privateAppProperties?.identifier + }?encoding=base64`; + let data; + try { + const responseData = await fetch(urlData, { + method: 'GET', + headers: { + 'Content-Type': 'application/json', + }, + }); + + if (!responseData?.ok) { + if (setLoadingStatePrivateApp) { + setLoadingStatePrivateApp( + t('core:message.generic.unable_download_private_app', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + + throw new Error( + t('core:message.error.fetch_app', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + + data = await responseData.text(); + if (data?.error) { + if (setLoadingStatePrivateApp) { + setLoadingStatePrivateApp( + t('core:message.generic.unable_download_private_app', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + throw new Error( + t('core:message.generic.unable_fetch_app', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + } catch (error) { + if (setLoadingStatePrivateApp) { + setLoadingStatePrivateApp( + t('core:message.generic.unable_download_private_app', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + throw error; + } + + let decryptedData; + // eslint-disable-next-line no-useless-catch + try { + decryptedData = await window.sendMessage('DECRYPT_QORTAL_GROUP_DATA', { + base64: data, + groupId: privateAppProperties?.groupId, + }); + if (decryptedData?.error) { + if (setLoadingStatePrivateApp) { + setLoadingStatePrivateApp( + t('core:message.generic.unable_decrypt_app', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + throw new Error(decryptedData?.error); + } + } catch (error) { + if (setLoadingStatePrivateApp) { + setLoadingStatePrivateApp( + t('core:message.generic.unable_decrypt_app', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + throw error; + } + + try { + const convertToUint = base64ToUint8Array(decryptedData); + const UintToObject = uint8ArrayToObject(convertToUint); + + if (decryptedData) { + setInfoSnackCustom({ + type: 'info', + message: t('core:message.generic.building_app', { + postProcess: 'capitalizeFirstChar', + }), + }); + + const endpoint = await createEndpoint( + `/arbitrary/APP/${privateAppProperties?.name}/zip?preview=true` + ); + + const response = await fetch(endpoint, { + method: 'POST', + headers: { + 'Content-Type': 'text/plain', + }, + body: UintToObject?.app, + }); + + const previewPath = await response.text(); + + const refreshfunc = async (tabId, privateAppProperties) => { + const checkIfPreviewLinkStillWorksUrl = await createEndpoint( + `/render/hash/HmtnZpcRPwisMfprUXuBp27N2xtv5cDiQjqGZo8tbZS?secret=E39WTiG4qBq3MFcMPeRZabtQuzyfHg9ZuR5SgY7nW1YH` + ); + const res = await fetch(checkIfPreviewLinkStillWorksUrl); + if (res.ok) { + executeEvent('refreshApp', { + tabId: tabId, + }); + } else { + const endpoint = await createEndpoint( + `/arbitrary/APP/${privateAppProperties?.name}/zip?preview=true` + ); + + const response = await fetch(endpoint, { + method: 'POST', + headers: { + 'Content-Type': 'text/plain', + }, + body: UintToObject?.app, + }); + + const previewPath = await response.text(); + executeEvent('updateAppUrl', { + tabId: tabId, + url: await createEndpoint(previewPath), + }); + + setTimeout(() => { + executeEvent('refreshApp', { + tabId: tabId, + }); + }, 300); + } + }; + + const appName = UintToObject?.name; + const logo = UintToObject?.logo + ? `data:image/png;base64,${UintToObject?.logo}` + : null; + + const dataBody = { + url: await createEndpoint(previewPath), + isPreview: true, + isPrivate: true, + privateAppProperties: { ...privateAppProperties, logo, appName }, + filePath: '', + refreshFunc: (tabId) => { + refreshfunc(tabId, privateAppProperties); + }, + }; + executeEvent('addTab', { + data: dataBody, + }); + setInfoSnackCustom({ + type: 'success', + message: t('core:message.generic.opened', { + postProcess: 'capitalizeFirstChar', + }), + }); + if (setLoadingStatePrivateApp) { + setLoadingStatePrivateApp(``); + } + if (addToPinnedApps) { + setSortablePinnedApps((prev) => { + const updatedApps = [ + ...prev, + { + isPrivate: true, + isPreview: true, + privateAppProperties: { + ...privateAppProperties, + logo, + appName, + }, + }, + ]; + + saveToLocalStorage( + 'ext_saved_settings', + 'sortablePinnedApps', + updatedApps + ); + return updatedApps; + }); + setSettingsLocalLastUpdated(Date.now()); + } + } + } catch (error) { + if (setLoadingStatePrivateApp) { + setLoadingStatePrivateApp( + `Error! ${ + error?.message || + t('core:message.error.build_app', { + postProcess: 'capitalizeFirstChar', + }) + }` + ); + } + throw error; + } + } catch (error) { + setInfoSnackCustom({ + type: 'error', + message: + error?.message || + t('core:message.error.fetch_app', { + postProcess: 'capitalizeFirstChar', + }), + }); + } + }; + return { + openApp, + status, + }; +}; diff --git a/src/hooks/useHandleTutorials.tsx b/src/hooks/useHandleTutorials.tsx new file mode 100644 index 0000000..fa4aeb4 --- /dev/null +++ b/src/hooks/useHandleTutorials.tsx @@ -0,0 +1,212 @@ +import { useCallback, useEffect, useMemo, useState } from 'react'; +import { saveToLocalStorage } from '../components/Apps/AppsNavBarDesktop'; +import creationImg from '../components/Tutorials/img/creation.webp'; +import dashboardImg from '../components/Tutorials/img/dashboard.webp'; +import groupsImg from '../components/Tutorials/img/groups.webp'; +import importantImg from '../components/Tutorials/img/important.webp'; +import navigationImg from '../components/Tutorials/img/navigation.webp'; +import overviewImg from '../components/Tutorials/img/overview.webp'; +import startedImg from '../components/Tutorials/img/started.webp'; +import obtainingImg from '../components/Tutorials/img/obtaining-qort.jpg'; +import { useTranslation } from 'react-i18next'; + +const checkIfGatewayIsOnline = async () => { + try { + const url = `https://ext-node.qortal.link/admin/status`; + const response = await fetch(url, { + method: 'GET', + headers: { + 'Content-Type': 'application/json', + }, + }); + const data = await response.json(); + if (data?.height) { + return true; + } + return false; + } catch (error) { + return false; + } +}; + +export const useHandleTutorials = () => { + const [openTutorialModal, setOpenTutorialModal] = useState(null); + const [shownTutorials, setShowTutorials] = useState(null); + const { t } = useTranslation(['core', 'tutorial']); + + useEffect(() => { + try { + const storedData = localStorage.getItem('shown-tutorials'); + + if (storedData) { + setShowTutorials(JSON.parse(storedData)); + } else { + setShowTutorials({}); + } + } catch (error) { + //error + } + }, []); + + const saveShowTutorial = useCallback((type) => { + try { + setShowTutorials((prev) => { + return { + ...(prev || {}), + [type]: true, + }; + }); + saveToLocalStorage('shown-tutorials', type, true); + } catch (error) { + //error + } + }, []); + const showTutorial = useCallback( + async (type, isForce) => { + try { + const isOnline = await checkIfGatewayIsOnline(); + if (!isOnline) return; + switch (type) { + case 'create-account': + { + if ((shownTutorials || {})['create-account'] && !isForce) return; + saveShowTutorial('create-account'); + setOpenTutorialModal({ + title: 'Account Creation', + resource: { + name: 'a-test', + service: 'VIDEO', + identifier: 'account-creation-hub', + poster: creationImg, + }, + }); + } + break; + case 'important-information': + { + if ((shownTutorials || {})['important-information'] && !isForce) + return; + saveShowTutorial('important-information'); + + setOpenTutorialModal({ + title: 'Important Information!', + resource: { + name: 'a-test', + service: 'VIDEO', + identifier: 'important-information-hub', + poster: importantImg, + }, + }); + } + break; + case 'getting-started': + { + if ((shownTutorials || {})['getting-started'] && !isForce) return; + saveShowTutorial('getting-started'); + + setOpenTutorialModal({ + multi: [ + { + title: t('tutorial:1_getting_started', { + postProcess: 'capitalizeFirstChar', + }), + resource: { + name: 'a-test', + service: 'VIDEO', + identifier: 'getting-started-hub', + poster: startedImg, + }, + }, + { + title: t('tutorial:2_overview', { + postProcess: 'capitalizeFirstChar', + }), + resource: { + name: 'a-test', + service: 'VIDEO', + identifier: 'overview-hub', + poster: overviewImg, + }, + }, + { + title: t('tutorial:3_groups', { + postProcess: 'capitalizeFirstChar', + }), + resource: { + name: 'a-test', + service: 'VIDEO', + identifier: 'groups-hub', + poster: groupsImg, + }, + }, + { + title: t('tutorial:4_obtain_qort', { + postProcess: 'capitalizeFirstChar', + }), + resource: { + name: 'a-test', + service: 'VIDEO', + identifier: 'obtaining-qort', + poster: obtainingImg, + }, + }, + ], + }); + } + break; + case 'qapps': + { + if ((shownTutorials || {})['qapps'] && !isForce) return; + saveShowTutorial('qapps'); + + setOpenTutorialModal({ + multi: [ + { + title: t('tutorial:apps.dashboard', { + postProcess: 'capitalizeFirstChar', + }), + resource: { + name: 'a-test', + service: 'VIDEO', + identifier: 'apps-dashboard-hub', + poster: dashboardImg, + }, + }, + { + title: t('tutorial:apps.navigation', { + postProcess: 'capitalizeFirstChar', + }), + resource: { + name: 'a-test', + service: 'VIDEO', + identifier: 'apps-navigation-hub', + poster: navigationImg, + }, + }, + ], + }); + } + break; + default: + break; + } + } catch (error) { + //error + } + }, + [shownTutorials] + ); + return useMemo( + () => ({ + showTutorial, + hasSeenGettingStarted: + shownTutorials === null + ? null + : !!(shownTutorials || {})['getting-started'], + openTutorialModal, + setOpenTutorialModal, + shownTutorialsInitiated: !!shownTutorials, + }), + [showTutorial, openTutorialModal, setOpenTutorialModal, shownTutorials] + ); +}; diff --git a/src/hooks/useHandleUserInfo.tsx b/src/hooks/useHandleUserInfo.tsx new file mode 100644 index 0000000..8faf7d1 --- /dev/null +++ b/src/hooks/useHandleUserInfo.tsx @@ -0,0 +1,30 @@ +import { useCallback, useRef } from 'react'; +import { getBaseApiReact } from '../App'; + +export const useHandleUserInfo = () => { + const userInfoRef = useRef({}); + + const getIndividualUserInfo = useCallback(async (address) => { + try { + if (!address) return null; + if (userInfoRef.current[address] !== undefined) + return userInfoRef.current[address]; + + const url = `${getBaseApiReact()}/addresses/${address}`; + const response = await fetch(url); + if (!response.ok) { + throw new Error('network error'); + } + const data = await response.json(); + userInfoRef.current = { + ...userInfoRef.current, + [address]: data?.level, + }; + return data?.level; + } catch (error) { + console.log(error); + } + }, []); + + return getIndividualUserInfo; +}; diff --git a/src/hooks/useModal.tsx b/src/hooks/useModal.tsx new file mode 100644 index 0000000..e01483c --- /dev/null +++ b/src/hooks/useModal.tsx @@ -0,0 +1,51 @@ +//TODO +import { useRef, useState, useCallback, useMemo } from 'react'; + +interface State { + isShow: boolean; +} + +export const useModal = () => { + const [state, setState] = useState({ isShow: false }); + const [message, setMessage] = useState({ publishFee: '', message: '' }); + const promiseConfig = useRef(null); + + const show = useCallback((data) => { + setMessage(data); + return new Promise((resolve, reject) => { + promiseConfig.current = { resolve, reject }; + setState({ isShow: true }); + }); + }, []); + + const hide = useCallback(() => { + setState({ isShow: false }); + setMessage({ publishFee: '', message: '' }); + }, []); + + const onOk = useCallback( + (payload: any) => { + const { resolve } = promiseConfig.current || {}; + hide(); + resolve?.(payload); + }, + [hide] + ); + + const onCancel = useCallback(() => { + const { reject } = promiseConfig.current || {}; + hide(); + reject?.({ isCanceled: true }); + }, [hide]); + + return useMemo( + () => ({ + show, + onOk, + onCancel, + isShow: state.isShow, + message, + }), + [show, onOk, onCancel, state.isShow, message] + ); +}; diff --git a/src/hooks/useNameSearch.tsx b/src/hooks/useNameSearch.tsx new file mode 100644 index 0000000..e00fec1 --- /dev/null +++ b/src/hooks/useNameSearch.tsx @@ -0,0 +1,57 @@ +import { useCallback, useEffect, useState } from 'react'; +import { getBaseApiReact } from '../App'; + +interface NameListItem { + name: string; + address: string; +} + +export const useNameSearch = (value: string, limit = 20) => { + const [nameList, setNameList] = useState([]); + const [isLoading, setIsLoading] = useState(false); + const checkIfNameExisits = useCallback( + async (name: string, listLimit: number) => { + try { + if (!name) { + setNameList([]); + return; + } + + const res = await fetch( + `${getBaseApiReact()}/names/search?query=${name}&prefix=true&limit=${listLimit}` + ); + const data = await res.json(); + setNameList( + data?.map((item: any) => { + return { + name: item.name, + address: item.owner, + }; + }) + ); + } catch (error) { + console.error(error); + } finally { + setIsLoading(false); + } + }, + [] + ); + // Debounce logic + useEffect(() => { + setIsLoading(true); + const handler = setTimeout(() => { + checkIfNameExisits(value, limit); + }, 500); + + // Cleanup timeout if searchValue changes before the timeout completes + return () => { + clearTimeout(handler); + }; + }, [value, limit, checkIfNameExisits]); + + return { + isLoading, + results: nameList, + }; +}; diff --git a/src/hooks/useQortalGetSaveSettings.tsx b/src/hooks/useQortalGetSaveSettings.tsx new file mode 100644 index 0000000..5fb62fc --- /dev/null +++ b/src/hooks/useQortalGetSaveSettings.tsx @@ -0,0 +1,128 @@ +import { useCallback, useEffect } from 'react'; +import { + canSaveSettingToQdnAtom, + isUsingImportExportSettingsAtom, + oldPinnedAppsAtom, + settingsLocalLastUpdatedAtom, + settingsQDNLastUpdatedAtom, + sortablePinnedAppsAtom, +} from '../atoms/global'; +import { getArbitraryEndpointReact, getBaseApiReact } from '../App'; +import { decryptResource } from '../components/Group/Group'; +import { + base64ToUint8Array, + uint8ArrayToObject, +} from '../encryption/encryption'; +import { useAtom, useSetAtom } from 'jotai'; + +function fetchFromLocalStorage(key) { + try { + const serializedValue = localStorage.getItem(key); + if (serializedValue === null) { + console.log(`No data found for key: ${key}`); + return null; + } + return JSON.parse(serializedValue); + } catch (error) { + console.error('Error fetching from localStorage:', error); + return null; + } +} + +const getPublishRecord = async (myName) => { + const url = `${getBaseApiReact()}${getArbitraryEndpointReact()}?mode=ALL&service=DOCUMENT_PRIVATE&identifier=ext_saved_settings&exactmatchnames=true&limit=1&prefix=true&name=${myName}`; + const response = await fetch(url); + if (!response.ok) { + throw new Error('network error'); + } + const publishData = await response.json(); + + if (publishData?.length > 0) + return { + hasPublishRecord: true, + timestamp: publishData[0]?.updated || publishData[0].created, + }; + + return { hasPublishRecord: false }; +}; + +const getPublish = async (myName) => { + try { + let data; + const res = await fetch( + `${getBaseApiReact()}/arbitrary/DOCUMENT_PRIVATE/${myName}/ext_saved_settings?encoding=base64` + ); + data = await res.text(); + + if (!data) throw new Error('Unable to fetch publish'); + + const decryptedKey: any = await decryptResource(data); + const dataint8Array = base64ToUint8Array(decryptedKey.data); + const decryptedKeyToObject = uint8ArrayToObject(dataint8Array); + return decryptedKeyToObject; + } catch (error) { + return null; + } +}; + +export const useQortalGetSaveSettings = (myName, isAuthenticated) => { + const setSortablePinnedApps = useSetAtom(sortablePinnedAppsAtom); + const setCanSave = useSetAtom(canSaveSettingToQdnAtom); + const setSettingsQDNLastUpdated = useSetAtom(settingsQDNLastUpdatedAtom); + + const [settingsLocalLastUpdated] = useAtom(settingsLocalLastUpdatedAtom); + const [isUsingImportExportSettings] = useAtom( + isUsingImportExportSettingsAtom + ); + const setOldPinnedApps = useSetAtom(oldPinnedAppsAtom); + + const getSavedSettings = useCallback( + async (myName, settingsLocalLastUpdated) => { + try { + const { hasPublishRecord, timestamp } = await getPublishRecord(myName); + if (hasPublishRecord) { + const settings = await getPublish(myName); + if ( + settings?.sortablePinnedApps && + timestamp > settingsLocalLastUpdated + ) { + setSortablePinnedApps(settings.sortablePinnedApps); + + setSettingsQDNLastUpdated(timestamp || 0); + } else if (settings?.sortablePinnedApps) { + setSettingsQDNLastUpdated(timestamp || 0); + setOldPinnedApps(settings.sortablePinnedApps); + } + if (!settings) { + // set -100 to indicate that it couldn't fetch the publish + setSettingsQDNLastUpdated(-100); + } + } else { + setSettingsQDNLastUpdated(0); + } + setCanSave(true); + } catch (error) { + console.log(error); + } + }, + [] + ); + + useEffect(() => { + if ( + !myName || + !settingsLocalLastUpdated || + !isAuthenticated || + isUsingImportExportSettings === null + ) + return; + if (isUsingImportExportSettings) return; + getSavedSettings(myName, settingsLocalLastUpdated); + }, [ + getSavedSettings, + myName, + settingsLocalLastUpdated, + isAuthenticated, + isUsingImportExportSettings, + ]); +}; diff --git a/src/hooks/useQortalMessageListener.tsx b/src/hooks/useQortalMessageListener.tsx new file mode 100644 index 0000000..bbdcb66 --- /dev/null +++ b/src/hooks/useQortalMessageListener.tsx @@ -0,0 +1,751 @@ +import { useCallback, useContext, useEffect, useState } from 'react'; +import { executeEvent } from '../utils/events'; +import { navigationControllerAtom } from '../atoms/global'; +import { Filesystem, Directory } from '@capacitor/filesystem'; +import { saveFile } from '../qortal/get'; +import { mimeToExtensionMap } from '../utils/memeTypes'; +import { QORTAL_APP_CONTEXT } from '../App'; +import FileSaver from 'file-saver'; +import { useSetAtom } from 'jotai'; + +export const saveFileInChunks = async ( + blob: Blob, + fileName: string, + chunkSize = 1024 * 1024 +) => { + try { + let offset = 0; + let isFirstChunk = true; + + // Extract the MIME type from the blob + const mimeType = blob.type || 'application/octet-stream'; + + // Create the dynamic base64 prefix + const base64Prefix = `data:${mimeType};base64,`; + + // Function to extract extension from fileName + const getExtensionFromFileName = (name: string): string => { + const lastDotIndex = name.lastIndexOf('.'); + if (lastDotIndex !== -1) { + return name.substring(lastDotIndex); // includes the dot + } + return ''; + }; + + // Extract existing extension from fileName + const existingExtension = getExtensionFromFileName(fileName); + + // Remove existing extension from fileName to avoid duplication + if (existingExtension) { + fileName = fileName.substring(0, fileName.lastIndexOf('.')); + } + + // Map MIME type to file extension + const mimeTypeToExtension = (mimeType: string): string => { + return mimeToExtensionMap[mimeType] || existingExtension || ''; // Use existing extension if MIME type not found + }; + + // Determine the final extension to use + const extension = mimeTypeToExtension(mimeType); + + // Construct the full file name with timestamp and extension + const fullFileName = `${fileName}_${Date.now()}${extension}`; + + // Read the blob in chunks + while (offset < blob.size) { + // Extract the current chunk + const chunk = blob.slice(offset, offset + chunkSize); + + // Convert the chunk to Base64 + const base64Chunk = await blobToBase64(chunk); + + // Write the chunk to the file with the prefix added on the first chunk + await Filesystem.writeFile({ + path: fullFileName, + data: isFirstChunk ? base64Prefix + base64Chunk : base64Chunk, + directory: Directory.Documents, + recursive: true, + append: !isFirstChunk, // Append after the first chunk + }); + + // Update offset and flag + offset += chunkSize; + isFirstChunk = false; + } + } catch (error) { + console.error('Error saving file in chunks:', error); + } +}; + +// Helper function to convert a Blob to a Base64 string +const blobToBase64 = (blob: Blob): Promise => { + return new Promise((resolve, reject) => { + const reader = new FileReader(); + reader.onloadend = () => { + const base64data = reader.result?.toString().split(',')[1]; + resolve(base64data || ''); + }; + reader.onerror = reject; + reader.readAsDataURL(blob); + }); +}; + +class Semaphore { + constructor(count) { + this.count = count; + this.waiting = []; + } + acquire() { + return new Promise((resolve) => { + if (this.count > 0) { + this.count--; + resolve(); + } else { + this.waiting.push(resolve); + } + }); + } + release() { + if (this.waiting.length > 0) { + const resolve = this.waiting.shift(); + resolve(); + } else { + this.count++; + } + } +} +let semaphore = new Semaphore(1); +let reader = new FileReader(); + +const fileToBase64 = (file) => + new Promise(async (resolve, reject) => { + if (!reader) { + reader = new FileReader(); + } + await semaphore.acquire(); + reader.readAsDataURL(file); + reader.onload = () => { + const dataUrl = reader.result; + if (typeof dataUrl === 'string') { + const base64String = dataUrl.split(',')[1]; + reader.onload = null; + reader.onerror = null; + resolve(base64String); + } else { + reader.onload = null; + reader.onerror = null; + reject(new Error('Invalid data URL')); + } + semaphore.release(); + }; + reader.onerror = (error) => { + reader.onload = null; + reader.onerror = null; + reject(error); + semaphore.release(); + }; + }); + +export function openIndexedDB() { + return new Promise((resolve, reject) => { + const request = indexedDB.open('fileStorageDB', 1); + + request.onupgradeneeded = function (event) { + const db = event.target.result; + if (!db.objectStoreNames.contains('files')) { + db.createObjectStore('files', { keyPath: 'id' }); + } + }; + + request.onsuccess = function (event) { + resolve(event.target.result); + }; + + request.onerror = function () { + reject('Error opening IndexedDB'); + }; + }); +} + +export const listOfAllQortalRequests = [ + 'ADD_FOREIGN_SERVER', + 'ADD_GROUP_ADMIN', + 'ADD_LIST_ITEMS', + 'ADMIN_ACTION', + 'BAN_FROM_GROUP', + 'BUY_NAME', + 'CANCEL_GROUP_BAN', + 'CANCEL_GROUP_INVITE', + 'CANCEL_SELL_NAME', + 'CANCEL_TRADE_SELL_ORDER', + 'CREATE_AND_COPY_EMBED_LINK', + 'CREATE_GROUP', + 'CREATE_POLL', + 'CREATE_TRADE_BUY_ORDER', + 'CREATE_TRADE_SELL_ORDER', + 'DECRYPT_AESGCM', + 'DECRYPT_DATA_WITH_SHARING_KEY', + 'DECRYPT_DATA', + 'DECRYPT_QORTAL_GROUP_DATA', + 'DELETE_HOSTED_DATA', + 'DELETE_LIST_ITEM', + 'DEPLOY_AT', + 'ENCRYPT_DATA_WITH_SHARING_KEY', + 'ENCRYPT_DATA', + 'ENCRYPT_QORTAL_GROUP_DATA', + 'FETCH_BLOCK_RANGE', + 'FETCH_BLOCK', + 'FETCH_QDN_RESOURCE', + 'GET_ACCOUNT_DATA', + 'GET_ACCOUNT_NAMES', + 'GET_ARRR_SYNC_STATUS', + 'GET_AT_DATA', + 'GET_AT', + 'GET_BALANCE', + 'GET_CROSSCHAIN_SERVER_INFO', + 'GET_DAY_SUMMARY', + 'GET_FOREIGN_FEE', + 'GET_HOSTED_DATA', + 'GET_LIST_ITEMS', + 'GET_NAME_DATA', + 'GET_NODE_INFO', + 'GET_NODE_STATUS', + 'GET_PRICE', + 'GET_QDN_RESOURCE_METADATA', + 'GET_QDN_RESOURCE_PROPERTIES', + 'GET_QDN_RESOURCE_STATUS', + 'GET_QDN_RESOURCE_URL', + 'GET_SERVER_CONNECTION_HISTORY', + 'GET_TX_ACTIVITY_SUMMARY', + 'GET_USER_ACCOUNT', + 'GET_USER_WALLET_INFO', + 'GET_USER_WALLET_TRANSACTIONS', + 'GET_USER_WALLET', + 'GET_WALLET_BALANCE', + 'INVITE_TO_GROUP', + 'IS_USING_PUBLIC_NODE', + 'JOIN_GROUP', + 'KICK_FROM_GROUP', + 'LEAVE_GROUP', + 'LINK_TO_QDN_RESOURCE', + 'LIST_ATS', + 'LIST_GROUPS', + 'LIST_QDN_RESOURCES', + 'MULTI_ASSET_PAYMENT_WITH_PRIVATE_DATA', + 'OPEN_NEW_TAB', + 'PUBLISH_MULTIPLE_QDN_RESOURCES', + 'PUBLISH_QDN_RESOURCE', + 'REGISTER_NAME', + 'REMOVE_FOREIGN_SERVER', + 'REMOVE_GROUP_ADMIN', + 'SAVE_FILE', + 'SEARCH_CHAT_MESSAGES', + 'SEARCH_NAMES', + 'SEARCH_QDN_RESOURCES', + 'SEARCH_TRANSACTIONS', + 'SELL_NAME', + 'SEND_CHAT_MESSAGE', + 'SEND_COIN', + 'SET_CURRENT_FOREIGN_SERVER', + 'SHOW_ACTIONS', + 'SHOW_PDF_READER', + 'SIGN_FOREIGN_FEES', + 'SIGN_TRANSACTION', + 'TRANSFER_ASSET', + 'UPDATE_FOREIGN_FEE', + 'UPDATE_GROUP', + 'UPDATE_NAME', + 'VOTE_ON_POLL', + 'GET_PRIMARY_NAME', +]; + +export const UIQortalRequests = [ + 'ADD_FOREIGN_SERVER', + 'ADD_GROUP_ADMIN', + 'ADD_LIST_ITEMS', + 'ADMIN_ACTION', + 'BAN_FROM_GROUP', + 'BUY_NAME', + 'CANCEL_GROUP_BAN', + 'CANCEL_GROUP_INVITE', + 'CANCEL_SELL_NAME', + 'CANCEL_TRADE_SELL_ORDER', + 'CREATE_AND_COPY_EMBED_LINK', + 'CREATE_GROUP', + 'CREATE_POLL', + 'CREATE_TRADE_BUY_ORDER', + 'CREATE_TRADE_SELL_ORDER', + 'DECRYPT_AESGCM', + 'DECRYPT_DATA_WITH_SHARING_KEY', + 'DECRYPT_DATA', + 'DECRYPT_QORTAL_GROUP_DATA', + 'DELETE_HOSTED_DATA', + 'DELETE_LIST_ITEM', + 'DEPLOY_AT', + 'GET_ARRR_SYNC_STATUS', + 'GET_CROSSCHAIN_SERVER_INFO', + 'GET_DAY_SUMMARY', + 'GET_FOREIGN_FEE', + 'GET_HOSTED_DATA', + 'GET_LIST_ITEMS', + 'GET_NODE_INFO', + 'GET_NODE_STATUS', + 'GET_SERVER_CONNECTION_HISTORY', + 'GET_TX_ACTIVITY_SUMMARY', + 'GET_USER_ACCOUNT', + 'GET_USER_WALLET_INFO', + 'GET_USER_WALLET_TRANSACTIONS', + 'GET_USER_WALLET', + 'GET_WALLET_BALANCE', + 'INVITE_TO_GROUP', + 'IS_USING_PUBLIC_NODE', + 'JOIN_GROUP', + 'KICK_FROM_GROUP', + 'LEAVE_GROUP', + 'MULTI_ASSET_PAYMENT_WITH_PRIVATE_DATA', + 'OPEN_NEW_TAB', + 'REGISTER_NAME', + 'REMOVE_FOREIGN_SERVER', + 'REMOVE_GROUP_ADMIN', + 'SELL_NAME', + 'SEND_CHAT_MESSAGE', + 'SEND_COIN', + 'SET_CURRENT_FOREIGN_SERVER', + 'SHOW_ACTIONS', + 'SHOW_PDF_READER', + 'SIGN_FOREIGN_FEES', + 'SIGN_TRANSACTION', + 'TRANSFER_ASSET', + 'UPDATE_FOREIGN_FEE', + 'UPDATE_GROUP', + 'UPDATE_NAME', + 'VOTE_ON_POLL', + 'GET_PRIMARY_NAME', +]; + +async function retrieveFileFromIndexedDB(fileId) { + const db = await openIndexedDB(); + const transaction = db.transaction(['files'], 'readwrite'); + const objectStore = transaction.objectStore('files'); + + return new Promise((resolve, reject) => { + const getRequest = objectStore.get(fileId); + + getRequest.onsuccess = function (event) { + if (getRequest.result) { + // File found, resolve it and delete from IndexedDB + const file = getRequest.result.data; + objectStore.delete(fileId); + resolve(file); + } else { + reject('File not found in IndexedDB'); + } + }; + + getRequest.onerror = function () { + reject('Error retrieving file from IndexedDB'); + }; + }); +} + +async function deleteQortalFilesFromIndexedDB() { + try { + const db = await openIndexedDB(); + const transaction = db.transaction(['files'], 'readwrite'); + const objectStore = transaction.objectStore('files'); + + // Create a request to get all keys + const getAllKeysRequest = objectStore.getAllKeys(); + + getAllKeysRequest.onsuccess = function (event) { + const keys = event.target.result; + + // Iterate through keys to find and delete those containing '_qortalfile' + for (let key of keys) { + if (key.includes('_qortalfile')) { + const deleteRequest = objectStore.delete(key); + + deleteRequest.onsuccess = function () { + console.log( + `File with key '${key}' has been deleted from IndexedDB` + ); + }; + + deleteRequest.onerror = function () { + console.error( + `Failed to delete file with key '${key}' from IndexedDB` + ); + }; + } + } + }; + + getAllKeysRequest.onerror = function () { + console.error('Failed to retrieve keys from IndexedDB'); + }; + + transaction.oncomplete = function () { + console.log('Transaction complete for deleting files from IndexedDB'); + }; + + transaction.onerror = function () { + console.error('Error occurred during transaction for deleting files'); + }; + } catch (error) { + console.error('Error opening IndexedDB:', error); + } +} + +export const showSaveFilePicker = async ( + data, + { openSnackGlobal, setOpenSnackGlobal, infoSnackCustom, setInfoSnackCustom } +) => { + try { + const { filename, mimeType, blob, fileHandleOptions } = data; + + setInfoSnackCustom({ + type: 'info', + message: 'Saving file...', + }); + + setOpenSnackGlobal(true); + + FileSaver.saveAs(blob, filename); + + setInfoSnackCustom({ + type: 'success', + message: 'Saving file success!', + }); + + setOpenSnackGlobal(true); + } catch (error) { + setInfoSnackCustom({ + type: 'error', + message: error?.message + ? `Error saving file: ${error?.message}` + : 'Error saving file', + }); + + setOpenSnackGlobal(true); + console.error('Error saving file:', error); + } +}; + +declare var cordova: any; + +async function storeFilesInIndexedDB(obj) { + // First delete any existing files in IndexedDB with '_qortalfile' in their ID + await deleteQortalFilesFromIndexedDB(); + + // Open the IndexedDB + const db = await openIndexedDB(); + const transaction = db.transaction(['files'], 'readwrite'); + const objectStore = transaction.objectStore('files'); + + // Handle the obj.file if it exists and is a File instance + if (obj.file) { + const fileId = Date.now() + 'objFile_qortalfile'; + + // Store the file in IndexedDB + const fileData = { + id: fileId, + data: obj.file, + }; + objectStore.put(fileData); + + // Replace the file object with the file ID in the original object + obj.fileId = fileId; + delete obj.file; + } + if (obj.blob) { + const fileId = Date.now() + 'objFile_qortalfile'; + + // Store the file in IndexedDB + const fileData = { + id: fileId, + data: obj.blob, + }; + objectStore.put(fileData); + + // Replace the file object with the file ID in the original object + let blobObj = { + type: obj.blob?.type, + }; + obj.fileId = fileId; + delete obj.blob; + obj.blob = blobObj; + } + + // Iterate through resources to find files and save them to IndexedDB + for (let resource of obj?.resources || []) { + if (resource.file) { + const fileId = resource.identifier + Date.now() + '_qortalfile'; + + // Store the file in IndexedDB + const fileData = { + id: fileId, + data: resource.file, + }; + objectStore.put(fileData); + + // Replace the file object with the file ID in the original object + resource.fileId = fileId; + delete resource.file; + } + } + + // Set transaction completion handlers + transaction.oncomplete = function () { + console.log('Files saved successfully to IndexedDB'); + }; + + transaction.onerror = function () { + console.error('Error saving files to IndexedDB'); + }; + + return obj; // Updated object with references to stored files +} + +export const useQortalMessageListener = ( + frameWindow, + iframeRef, + tabId, + isDevMode, + appName, + appService, + skipAuth +) => { + const [path, setPath] = useState(''); + const [history, setHistory] = useState({ + customQDNHistoryPaths: [], + currentIndex: -1, + isDOMContentLoaded: false, + }); + const setHasSettingsChangedAtom = useSetAtom(navigationControllerAtom); + + const { + openSnackGlobal, + setOpenSnackGlobal, + infoSnackCustom, + setInfoSnackCustom, + } = useContext(QORTAL_APP_CONTEXT); + + useEffect(() => { + if (tabId && !isNaN(history?.currentIndex)) { + setHasSettingsChangedAtom((prev) => { + return { + ...prev, + [tabId]: { + hasBack: history?.currentIndex > 0, + }, + }; + }); + } + }, [history?.currentIndex, tabId]); + + const changeCurrentIndex = useCallback((value) => { + setHistory((prev) => { + return { + ...prev, + currentIndex: value, + }; + }); + }, []); + + const resetHistory = useCallback(() => { + setHistory({ + customQDNHistoryPaths: [], + currentIndex: -1, + isManualNavigation: true, + isDOMContentLoaded: false, + }); + }, []); + + useEffect(() => { + const listener = async (event) => { + if (event?.data?.requestedHandler !== 'UI') return; + + const sendMessageToRuntime = (message, eventPort) => { + let timeout: number = 300000; + if ( + message?.action === 'PUBLISH_MULTIPLE_QDN_RESOURCES' && + message?.payload?.resources?.length > 0 + ) { + timeout = message?.payload?.resources?.length * 1200000; + } else if (message?.action === 'PUBLISH_QDN_RESOURCE') { + timeout = 1200000; + } + + window + .sendMessage( + message.action, + message.payload, + timeout, + message.isExtension, + { + name: appName, + service: appService, + tabId, + }, + skipAuth + ) + .then((response) => { + if (response.error) { + eventPort.postMessage({ + result: null, + error: { + error: response?.error, + message: + typeof response?.error === 'string' + ? response?.error + : typeof response?.message === 'string' + ? response?.message + : 'An error has occurred', + }, + }); + } else { + eventPort.postMessage({ + result: response, + error: null, + }); + } + }) + .catch((error) => { + console.error('Failed qortalRequest', error); + }); + }; + + // Check if action is included in the predefined list of UI requests + if (UIQortalRequests.includes(event.data.action)) { + sendMessageToRuntime( + { + action: event.data.action, + type: 'qortalRequest', + payload: event.data, + isExtension: true, + }, + event.ports[0] + ); + } else if (event?.data?.action === 'SAVE_FILE') { + try { + await saveFile(event.data, null, true, { + openSnackGlobal, + setOpenSnackGlobal, + infoSnackCustom, + setInfoSnackCustom, + }); + event.ports[0].postMessage({ + result: true, + error: null, + }); + } catch (error) { + event.ports[0].postMessage({ + result: null, + error: error?.message || 'Failed to save file', + }); + } + } else if ( + event?.data?.action === 'PUBLISH_MULTIPLE_QDN_RESOURCES' || + event?.data?.action === 'PUBLISH_QDN_RESOURCE' || + event?.data?.action === 'ENCRYPT_DATA' || + event?.data?.action === 'ENCRYPT_DATA_WITH_SHARING_KEY' || + event?.data?.action === 'ENCRYPT_QORTAL_GROUP_DATA' + ) { + const data = event.data; + + if (data) { + sendMessageToRuntime( + { + action: event.data.action, + type: 'qortalRequest', + payload: data, + isExtension: true, + }, + event.ports[0] + ); + } else { + event.ports[0].postMessage({ + result: null, + error: 'Failed to prepare data for publishing', + }); + } + } else if ( + event?.data?.action === 'LINK_TO_QDN_RESOURCE' || + event?.data?.action === 'QDN_RESOURCE_DISPLAYED' + ) { + const pathUrl = + event?.data?.path != null + ? (event?.data?.path.startsWith('/') ? '' : '/') + event?.data?.path + : null; + setPath(pathUrl); + if (appName?.toLowerCase() === 'q-mail') { + window.sendMessage('addEnteredQmailTimestamp').catch((error) => { + // TODO print error + }); + } else if (appName?.toLowerCase() === 'q-wallets') { + executeEvent('setLastEnteredTimestampPaymentEvent', {}); + } + } else if (event?.data?.action === 'NAVIGATION_HISTORY') { + if (event?.data?.payload?.isDOMContentLoaded) { + setHistory((prev) => { + const copyPrev = { ...prev }; + if ( + (copyPrev?.customQDNHistoryPaths || []).at(-1) === + (event?.data?.payload?.customQDNHistoryPaths || []).at(-1) + ) { + return { + ...prev, + currentIndex: + prev.customQDNHistoryPaths.length - 1 === -1 + ? 0 + : prev.customQDNHistoryPaths.length - 1, + }; + } + const copyHistory = { ...prev }; + const paths = [ + ...(copyHistory?.customQDNHistoryPaths.slice( + 0, + copyHistory.currentIndex + 1 + ) || []), + ...(event?.data?.payload?.customQDNHistoryPaths || []), + ]; + return { + ...prev, + customQDNHistoryPaths: paths, + currentIndex: paths.length - 1, + }; + }); + } else { + setHistory(event?.data?.payload); + } + } else if (event?.data?.action === 'SET_TAB' && !isDevMode) { + executeEvent('addTab', { + data: event?.data?.payload, + }); + const targetOrigin = iframeRef.current + ? new URL(iframeRef.current.src).origin + : '*'; + iframeRef.current.contentWindow.postMessage( + { + action: 'SET_TAB_SUCCESS', + requestedHandler: 'UI', + payload: { + name: event?.data?.payload?.name, + }, + }, + targetOrigin + ); + } + }; + + // Add the listener for messages coming from the frameWindow + frameWindow.addEventListener('message', listener); + + // Cleanup function to remove the event listener when the component is unmounted + return () => { + frameWindow.removeEventListener('message', listener); + }; + }, [isDevMode, appName, appService, tabId]); // Empty dependency array to run once when the component mounts + + return { path, history, resetHistory, changeCurrentIndex }; +}; diff --git a/src/hooks/useRetrieveDataLocalStorage.tsx b/src/hooks/useRetrieveDataLocalStorage.tsx new file mode 100644 index 0000000..4b7479c --- /dev/null +++ b/src/hooks/useRetrieveDataLocalStorage.tsx @@ -0,0 +1,61 @@ +import { useCallback, useEffect } from 'react'; +import { + isUsingImportExportSettingsAtom, + oldPinnedAppsAtom, + settingsLocalLastUpdatedAtom, + settingsQDNLastUpdatedAtom, + sortablePinnedAppsAtom, +} from '../atoms/global'; +import { useSetAtom } from 'jotai'; + +function fetchFromLocalStorage(key) { + try { + const serializedValue = localStorage.getItem(key); + if (serializedValue === null) { + return null; + } + return JSON.parse(serializedValue); + } catch (error) { + console.error('Error fetching from localStorage:', error); + return null; + } +} + +export const useRetrieveDataLocalStorage = (address) => { + const setSortablePinnedApps = useSetAtom(sortablePinnedAppsAtom); + const setSettingsLocalLastUpdated = useSetAtom(settingsLocalLastUpdatedAtom); + const setIsUsingImportExportSettings = useSetAtom( + isUsingImportExportSettingsAtom + ); + const setSettingsQDNLastUpdated = useSetAtom(settingsQDNLastUpdatedAtom); + const setOldPinnedApps = useSetAtom(oldPinnedAppsAtom); + + const getSortablePinnedApps = useCallback(() => { + const pinnedAppsLocal = fetchFromLocalStorage('ext_saved_settings'); + + if (pinnedAppsLocal?.sortablePinnedApps) { + setSortablePinnedApps(pinnedAppsLocal?.sortablePinnedApps); + setSettingsLocalLastUpdated(pinnedAppsLocal?.timestamp || -1); + } else { + setSettingsLocalLastUpdated(-1); + } + }, []); + + const getSortablePinnedAppsImportExport = useCallback(() => { + const pinnedAppsLocal = fetchFromLocalStorage( + 'ext_saved_settings_import_export' + ); + if (pinnedAppsLocal?.sortablePinnedApps) { + setOldPinnedApps(pinnedAppsLocal?.sortablePinnedApps); + setIsUsingImportExportSettings(true); + setSettingsQDNLastUpdated(pinnedAppsLocal?.timestamp || 0); + } else { + setIsUsingImportExportSettings(false); + } + }, []); + + useEffect(() => { + getSortablePinnedApps(); + getSortablePinnedAppsImportExport(); + }, [getSortablePinnedApps, address]); +}; diff --git a/src/hooks/useSortedMyNames.tsx b/src/hooks/useSortedMyNames.tsx new file mode 100644 index 0000000..6fb8917 --- /dev/null +++ b/src/hooks/useSortedMyNames.tsx @@ -0,0 +1,11 @@ +import { useMemo } from 'react'; + +export function useSortedMyNames(names, myName) { + return useMemo(() => { + return [...names].sort((a, b) => { + if (a === myName) return -1; + if (b === myName) return 1; + return 0; + }); + }, [names, myName]); +} diff --git a/src/i18n/i18n.ts b/src/i18n/i18n.ts new file mode 100644 index 0000000..84dbbee --- /dev/null +++ b/src/i18n/i18n.ts @@ -0,0 +1,67 @@ +import i18n from 'i18next'; +import { initReactI18next } from 'react-i18next'; +import HttpBackend from 'i18next-http-backend'; +import LanguageDetector from 'i18next-browser-languagedetector'; +import { + capitalizeAll, + capitalizeEachFirstChar, + capitalizeFirstChar, + capitalizeFirstWord, +} from './processors'; + +export const supportedLanguages = { + ar: { name: 'Arab', flag: '🇦🇪' }, + de: { name: 'Deutsch', flag: '🇩🇪' }, + en: { name: 'English', flag: '🇺🇸' }, + es: { name: 'Español', flag: '🇪🇸' }, + fr: { name: 'Français', flag: '🇫🇷' }, + it: { name: 'Italiano', flag: '🇮🇹' }, + ru: { name: 'Русский', flag: '🇷🇺' }, + ja: { name: '日本語', flag: '🇯🇵' }, + zh: { name: '中文', flag: '🇨🇳' }, +}; + +// Load all JSON files under locales/**/* +const modules = import.meta.glob('./locales/**/*.json', { + eager: true, +}) as Record; + +// Construct i18n resources object +const resources: Record> = {}; + +for (const path in modules) { + // Path format: './locales/en/core.json' + const match = path.match(/\.\/locales\/([^/]+)\/([^/]+)\.json$/); + if (!match) continue; + + const [, lang, ns] = match; + resources[lang] = resources[lang] || {}; + resources[lang][ns] = modules[path].default; +} + +i18n + .use(HttpBackend) + .use(initReactI18next) + .use(LanguageDetector) + .use(capitalizeAll as any) + .use(capitalizeEachFirstChar as any) + .use(capitalizeFirstChar as any) + .use(capitalizeFirstWord as any) + .init({ + resources, + fallbackLng: 'en', + lng: localStorage.getItem('i18nextLng') || 'en', + supportedLngs: Object.keys(supportedLanguages), + backend: { + loadPath: '/locales/{{lng}}/{{ns}}.json', + }, + ns: ['auth', 'core', 'group', 'question', 'tutorial'], + defaultNS: 'core', + interpolation: { escapeValue: false }, + react: { useSuspense: false }, + returnEmptyString: false, // return fallback instead of empty string + returnNull: false, // return fallback instead of null + debug: import.meta.env.MODE === 'development', + }); + +export default i18n; diff --git a/src/i18n/locales/ar/auth.json b/src/i18n/locales/ar/auth.json new file mode 100644 index 0000000..826f34d --- /dev/null +++ b/src/i18n/locales/ar/auth.json @@ -0,0 +1,138 @@ +{ + "account": { + "your": "حسابك", + "account_many": "حسابات", + "account_one": "حساب", + "selected": "الحساب المحدد" + }, + "action": { + "add": { + "account": "إضافة حساب", + "seed_phrase": "إضافة عبارة استرداد" + }, + "authenticate": "المصادقة", + "block": "حظر", + "block_all": "حظر الكل", + "block_data": "حظر بيانات QDN", + "block_name": "حظر الاسم", + "block_txs": "حظر المعاملات", + "fetch_names": "جلب الأسماء", + "copy_address": "نسخ العنوان", + "create_account": "إنشاء حساب", + "create_qortal_account": "أنشئ حساب كورتال الخاص بك بالضغط على التالي أدناه.", + "choose_password": "اختر كلمة مرور جديدة", + "download_account": "تحميل الحساب", + "enter_amount": "الرجاء إدخال مبلغ أكبر من 0", + "enter_recipient": "الرجاء إدخال مستلم", + "enter_wallet_password": "الرجاء إدخال كلمة مرور المحفظة", + "export_seedphrase": "تصدير عبارة الاسترداد", + "insert_name_address": "الرجاء إدخال اسم أو عنوان", + "publish_admin_secret_key": "نشر المفتاح السري للإداري", + "publish_group_secret_key": "نشر المفتاح السري للمجموعة", + "reencrypt_key": "إعادة تشفير المفتاح", + "return_to_list": "العودة إلى القائمة", + "setup_qortal_account": "إعداد حساب كورتال الخاص بك", + "unblock": "إلغاء الحظر", + "unblock_name": "إلغاء حظر الاسم" + }, + "address": "عنوان", + "address_name": "عنوان أو اسم", + "advanced_users": "للمستخدمين المتقدمين", + "apikey": { + "alternative": "بديل: اختيار ملف", + "change": "تغيير مفتاح API", + "enter": "إدخال مفتاح API", + "import": "استيراد مفتاح API", + "key": "مفتاح API", + "select_valid": "اختر مفتاح API صالح" + }, + "authentication": "المصادقة", + "blocked_users": "المستخدمون المحظورون", + "build_version": "إصدار البناء", + "message": { + "error": { + "account_creation": "تعذر إنشاء الحساب.", + "address_not_existing": "العنوان غير موجود على سلسلة الكتل", + "block_user": "تعذر حظر المستخدم", + "create_simmetric_key": "تعذر إنشاء مفتاح متناظر", + "decrypt_data": "تعذر فك تشفير البيانات", + "decrypt": "تعذر فك التشفير", + "encrypt_content": "تعذر تشفير المحتوى", + "fetch_user_account": "تعذر جلب حساب المستخدم", + "field_not_found_json": "{{ field }} غير موجود في JSON", + "find_secret_key": "تعذر العثور على المفتاح السري الصحيح", + "incorrect_password": "كلمة مرور غير صحيحة", + "invalid_qortal_link": "رابط كورتال غير صالح", + "invalid_secret_key": "المفتاح السري غير صالح", + "invalid_uint8": "بيانات Uint8Array المقدمة غير صالحة", + "name_not_existing": "الاسم غير موجود", + "name_not_registered": "الاسم غير مسجل", + "read_blob_base64": "فشل قراءة Blob كسلسلة مشفرة base64", + "reencrypt_secret_key": "تعذر إعادة تشفير المفتاح السري", + "set_apikey": "فشل تعيين مفتاح API:" + }, + "generic": { + "blocked_addresses": "عناوين محظورة - تمنع معالجة المعاملات", + "blocked_names": "أسماء محظورة لـ QDN", + "blocking": "جاري حظر {{ name }}", + "choose_block": "اختر 'حظر المعاملات' أو 'الكل' لحظر رسائل الدردشة", + "congrats_setup": "مبروك! لقد أكملت الإعداد بنجاح", + "decide_block": "حدد ما تريد حظره", + "downloading_encryption_keys": "جاري تحميل مفاتيح التشفير", + "fetching_admin_secret_key": "جاري جلب المفتاح السري للإداريين", + "fetching_group_secret_key": "جاري جلب منشورات المفتاح السري للمجموعة", + "keep_secure": "احفظ ملف حسابك في مكان آمن", + "last_encryption_date": "آخر تاريخ تشفير: {{ date }} بواسطة {{ name }}", + "locating_encryption_keys": "جاري تحديد موقع مفاتيح التشفير", + "name_address": "اسم أو عنوان", + "no_account": "لا توجد حسابات محفوظة", + "no_minimum_length": "لا يوجد حد أدنى لطول النص المطلوب", + "no_secret_key_published": "لا يوجد مفتاح سري منشور بعد", + "publishing_key": "تذكير: بعد نشر المفتاح، سيستغرق ظهوره بضع دقائق. يرجى الانتظار.", + "seedphrase_notice": "تم إنشاء عبارة استرداد عشوائيًا في الخلفية.", + "turn_local_node": "يرجى تشغيل نودك المحلي", + "type_seed": "اكتب أو الصق عبارة الاسترداد الخاصة بك", + "your_accounts": "حساباتك المحفوظة" + }, + "success": { + "reencrypted_secret_key": "تم إعادة تشفير المفتاح السري بنجاح. قد تستغرق التغييرات بضع دقائق للانتشار. يرجى تحديث المجموعة بعد 5 دقائق." + } + }, + "node": { + "choose": "اختر نود مخصص", + "custom_many": "نودات مخصصة", + "use_custom": "استخدم نود مخصص", + "use_local": "استخدم النود المحلي", + "using": "جاري استخدام النود", + "using_public": "جاري استخدام النود العام", + "using_public_gateway": "جاري استخدام النود العام: {{ gateway }}" + }, + "note": "ملاحظة", + "password": "كلمة المرور", + "password_confirmation": "تأكيد كلمة المرور", + "seed_phrase": "عبارة الاسترداد", + "seed_your": "عبارة الاسترداد الخاصة بك", + "tips": { + "additional_wallet": "استخدم هذا الخيار لربط محافظ كورتال إضافية قمت بإنشائها مسبقاً، لتتمكن من تسجيل الدخول بها لاحقاً. ستحتاج إلى الوصول لملف JSON الاحتياطي الخاص بك للقيام بذلك.", + "digital_id": "محفظتك هي بمثابة هويتك الرقمية على كورتال، وهي الطريقة التي ستسجل بها الدخول إلى واجهة المستخدم. تحتوي على عنوانك العام والاسم الذي ستختاره لاحقاً. كل معاملة تقوم بها مرتبطة بهويتك، وهنا تدير جميع عملاتك الكورتال والعملات الأخرى القابلة للتداول على المنصة.", + "existing_account": "هل لديك حساب كورتال بالفعل؟ أدخل عبارة الاسترداد السرية هنا للوصول إليه. هذه العبارة هي إحدى طرق استعادة حسابك.", + "key_encrypt_admin": "هذا المفتاح لتشفير المحتوى المتعلق بالإدارة. فقط المسؤولون سيرون المحتوى المشفر به.", + "key_encrypt_group": "هذا المفتاح لتشفير المحتوى المتعلق بالمجموعة. هذا هو المفتاح الوحيد المستخدم في هذه الواجهة حالياً. جميع أعضاء المجموعة سيتمكنون من رؤية المحتوى المشفر بهذا المفتاح.", + "new_account": "إنشاء حساب يعني إنشاء محفظة جديدة وهوية رقمية لبدء استخدام كورتال. بعد إنشاء حسابك، يمكنك البدء في الحصول على عملات كورتال، شراء اسم وصورة رمزية، نشر مقاطع فيديو ومدونات، وغير ذلك الكثير.", + "new_users": "المستخدمون الجدد يبدأون من هنا!", + "safe_place": "احفظ حسابك في مكان ستتذكره!", + "view_seedphrase": "إذا كنت ترغب في رؤية عبارة الاسترداد، انقر على كلمة 'عبارة الاسترداد' في هذا النص. تُستخدم عبارات الاسترداد لإنشاء المفتاح الخاص لحسابك على كورتال. لأسباب أمنية، لا يتم عرض عبارات الاسترداد إلا إذا اخترت ذلك بشكل صريح.", + "wallet_secure": "احتفظ بملف محفظتك في مكان آمن." + }, + "wallet": { + "password_confirmation": "تأكيد كلمة مرور المحفظة", + "password": "كلمة مرور المحفظة", + "keep_password": "احتفظ بكلمة المرور الحالية", + "new_password": "كلمة مرور جديدة", + "error": { + "missing_new_password": "الرجاء إدخال كلمة مرور جديدة", + "missing_password": "الرجاء إدخال كلمة المرور الخاصة بك" + } + }, + "welcome": "مرحبًا بك في" +} diff --git a/src/i18n/locales/ar/core.json b/src/i18n/locales/ar/core.json new file mode 100644 index 0000000..5b5e7f2 --- /dev/null +++ b/src/i18n/locales/ar/core.json @@ -0,0 +1,422 @@ +{ + "action": { + "accept": "موافق", + "access": "وصول", + "access_app": "دخول التطبيق", + "add": "إضافة", + "add_custom_framework": "إضافة إطار مخصص", + "add_reaction": "إضافة تفاعل", + "add_theme": "إضافة سمة", + "backup_account": "نسخ احتياطي للحساب", + "backup_wallet": "نسخ احتياطي للمحفظة", + "cancel": "إلغاء", + "cancel_invitation": "إلغاء دعوة", + "change": "تغيير", + "change_avatar": "تغيير الصورة", + "change_file": "تغيير الملف", + "change_language": "تغيير اللغة", + "choose": "اختيار", + "choose_file": "اختر ملف", + "choose_image": "اختر صورة", + "choose_logo": "اختر شعار", + "choose_name": "اختر اسم", + "close": "إغلاق", + "close_chat": "غلق الدردشة", + "continue": "متابعة", + "continue_logout": "متابعة الخروج", + "copy_link": "نسخ الرابط", + "create_apps": "إنشاء تطبيقات", + "create_file": "إنشاء ملف", + "create_transaction": "إنشاء معاملات على بلوكشين كورتال", + "create_thread": "إنشاء موضوع", + "decline": "رفض", + "decrypt": "فك التشفير", + "disable_enter": "تعطيل زر الإدخال", + "download": "تحميل", + "download_file": "تحميل ملف", + "edit": "تعديل", + "edit_theme": "تعديل السمة", + "enable_dev_mode": "تفعيل وضع المطور", + "enter_name": "أدخل اسم", + "export": "تصدير", + "get_qort": "الحصول على عملة كورتال", + "get_qort_trade": "احصل على كورتال من كيو-تريد", + "hide": "إخفاء", + "hide_qr_code": "إخفاء كود QR", + "import": "استيراد", + "import_theme": "استيراد سمة", + "invite": "دعوة", + "invite_member": "دعوة عضو جديد", + "join": "انضمام", + "leave_comment": "ترك تعليق", + "load_announcements": "تحميل إعلانات أقدم", + "login": "تسجيل دخول", + "logout": "تسجيل خروج", + "new": { + "chat": "دردشة جديدة", + "post": "منشور جديد", + "theme": "سمة جديدة", + "thread": "موضوع جديد" + }, + "notify": "تنبيه", + "open": "فتح", + "pin": "تثبيت", + "pin_app": "تثبيت التطبيق", + "pin_from_dashboard": "تثبيت من لوحة التحكم", + "post": "نشر", + "post_message": "نشر رسالة", + "publish": "نشر", + "publish_app": "نشر تطبيقك", + "publish_comment": "نشر تعليق", + "refresh": "تحديث", + "register_name": "تسجيل اسم", + "remove": "إزالة", + "remove_reaction": "إزالة تفاعل", + "return_apps_dashboard": "العودة إلى لوحة التطبيقات", + "save": "حفظ", + "save_disk": "حفظ على القرص", + "search": "بحث", + "search_apps": "بحث عن تطبيقات", + "search_groups": "بحث عن جروبات", + "search_chat_text": "بحث في نص الدردشة", + "see_qr_code": "عرض كود QR", + "select_app_type": "اختر نوع التطبيق", + "select_category": "اختر فئة", + "select_name_app": "اختر اسم/تطبيق", + "send": "إرسال", + "send_qort": "إرسال عملة كورتال", + "set_avatar": "تعيين صورة", + "show": "عرض", + "show_poll": "عرض استطلاع رأي", + "start_minting": "بدء التعدين", + "start_typing": "ابدأ الكتابة هنا...", + "trade_qort": "تداول عملة كورتال", + "transfer_qort": "تحويل عملة كورتال", + "unpin": "إلغاء التثبيت", + "unpin_app": "إلغاء تثبيت التطبيق", + "unpin_from_dashboard": "إلغاء التثبيت من لوحة التحكم", + "update": "تحديث", + "update_app": "تحديث تطبيقك", + "vote": "تصويت" + }, + "address_your": "عنوانك", + "admin": "أدمن", + "admin_other": "أدمنز", + "all": "الكل", + "amount": "المبلغ", + "announcement": "إعلان", + "announcement_other": "إعلانات", + "api": "API", + "app": "تطبيق", + "app_other": "تطبيقات", + "app_name": "اسم التطبيق", + "app_private": "خاص", + "app_service_type": "نوع خدمة التطبيق", + "apps_dashboard": "لوحة التطبيقات", + "apps_official": "تطبيقات رسمية", + "attachment": "مرفق", + "balance": "الرصيد:", + "category": "فئة", + "category_other": "فئات", + "chat": "دردشة", + "comment_other": "تعليقات", + "contact_other": "اتصالات", + "core": { + "block_height": "رقم البلوك", + "information": "معلومات السرفر", + "peers": "السيرفرات المتصلة", + "version": "نسخة السرفر" + }, + "current_language": "اللغة الحالية: {{ language }}", + "dev": "ديف", + "dev_mode": "وضع المطور", + "domain": "دومين", + "ui": { + "version": "نسخة الواجهة" + }, + "count": { + "none": "لا شيء", + "one": "واحد" + }, + "description": "الوصف", + "devmode_apps": "تطبيقات وضع المطور", + "directory": "دليل", + "downloading_qdn": "جاري التحميل من QDN", + "fee": { + "payment": "رسوم الدفع", + "publish": "رسوم النشر" + }, + "for": "لـ", + "general": "عام", + "general_settings": "الإعدادات العامة", + "home": "الرئيسية", + "identifier": "مُعرّف", + "image_embed": "تضمين صورة", + "last_height": "آخر ارتفاع", + "level": "مستوى", + "library": "مكتبة", + "list": { + "bans": "قائمة المحظورين", + "groups": "قائمة الجروبات", + "invites": "قائمة الدعوات", + "join_request": "قائمة طلبات الانضمام", + "member": "قائمة الأعضاء", + "members": "قائمة الأعضاء" + }, + "loading": { + "announcements": "جاري تحميل الإعلانات", + "generic": "جاري التحميل...", + "chat": "جاري تحميل الدردشة... انتظر من فضلك", + "comments": "جاري تحميل التعليقات... انتظر من فضلك", + "posts": "جاري تحميل المنشورات... انتظر من فضلك" + }, + "member": "عضو", + "member_other": "أعضاء", + "message_us": "راسلنا على نكست كلاود (لا يحتاج تسجيل) أو ديسكورد إذا كنت تحتاج 4 كورتال لبدء الدردشة بدون قيود", + "message": { + "error": { + "address_not_found": "لم يتم العثور على عنوانك", + "app_need_name": "تطبيقك يحتاج إلى اسم", + "build_app": "غير قادر على بناء تطبيق خاص", + "decrypt_app": "غير قادر على فك تشفير التطبيق الخاص", + "download_image": "غير قادر على تحميل الصورة. يرجى المحاولة لاحقاً عن طريق زر التحديث", + "download_private_app": "غير قادر على تحميل التطبيق الخاص", + "encrypt_app": "غير قادر على تشفير التطبيق. التطبيق غير منشور", + "fetch_app": "غير قادر على جلب التطبيق", + "fetch_publish": "غير قادر على جلب المنشور", + "file_too_large": "الملف {{ filename }} كبير جداً. الحد الأقصى المسموح به {{ size }} ميجابايت", + "generic": "حدث خطأ", + "initiate_download": "فشل بدء التحميل", + "invalid_amount": "مبلغ غير صالح", + "invalid_base64": "بيانات base64 غير صالحة", + "invalid_embed_link": "رابط التضمين غير صالح", + "invalid_image_embed_link_name": "رابط تضمين الصورة غير صالح. معامل مفقود", + "invalid_poll_embed_link_name": "رابط تضمين الاستطلاع غير صالح. الاسم مفقود", + "invalid_signature": "توقيع غير صالح", + "invalid_theme_format": "تنسيق السمة غير صالح", + "invalid_zip": "ملف zip غير صالح", + "message_loading": "خطأ في تحميل الرسالة", + "message_size": "حجم رسالتك {{ size }} بايت من أقصى حد {{ maximum }}", + "minting_account_add": "غير قادر على إضافة حساب تعدين", + "minting_account_remove": "غير قادر على إزالة حساب تعدين", + "missing_fields": "ناقص: {{ fields }}", + "navigation_timeout": "انتهت مهلة التنقل", + "network_generic": "خطأ في الشبكة", + "password_not_matching": "حقول كلمة المرور غير متطابقة!", + "password_wrong": "غير قادر على المصادقة. كلمة مرور خاطئة", + "publish_app": "غير قادر على نشر التطبيق", + "publish_image": "غير قادر على نشر الصورة", + "rate": "غير قادر على التقييم", + "rating_option": "تعذر العثور على خيار التقييم", + "save_qdn": "غير قادر على الحفظ في QDN", + "send_failed": "فشل الإرسال", + "update_failed": "فشل التحديث", + "vote": "غير قادر على التصويت" + }, + "generic": { + "already_voted": "لقد قمت بالتصويت بالفعل.", + "avatar_size": "الحد الأقصى {{ size }} كيلوبايت للصور المتحركة", + "benefits_qort": "فوائد امتلاك عملات كورتال", + "building_app": "جاري بناء التطبيق", + "building": "جاري البناء", + "buy_order_request": "التطبيق
{{hostname}}
يطلب {{count}} طلب شراء", + "buy_order_request_other": "التطبيق
{{hostname}}
يطلب {{count}} طلبات شراء", + "confirmed": "تم التأكيد", + "created_by": "تم إنشاؤه بواسطة {{ owner }}", + "devmode_local_node": "الرجاء استخدام نودك المحلي لوضع المطور! سجل الخروج واستخدم النود المحلي.", + "downloading_decrypting_app": "جاري تحميل وفك تشفير التطبيق الخاص.", + "downloading": "جاري التحميل", + "edited": "تم التعديل", + "editing_message": "جاري تعديل الرسالة", + "encrypted_not": "غير مشفر", + "encrypted": "مشفر", + "fee_qort": "الرسوم: {{ message }} كورتال", + "fetching_data": "جاري جلب بيانات التطبيق", + "foreign_fee": "رسوم العملات الأجنبية: {{ message }}", + "get_qort_trade_portal": "احصل على كورتال من بوابة التبادل عبر السلاسل", + "mentioned": "تم الإشارة إليك", + "message_with_image": "هذه الرسالة تحتوي بالفعل على صورة", + "minimal_qort_balance": "يجب أن يكون لديك {{ quantity }} كورتال كحد أدنى في رصيدك (4 كورتال للدردشة، 1.25 للأسماء، 0.75 لبعض المعاملات)", + "most_recent_payment": "آخر {{ count }} دفعة", + "name_available": "الاسم {{ name }} متاح", + "name_benefits": "فوائد امتلاك اسم", + "name_checking": "جاري التحقق من وجود الاسم", + "name_preview": "تحتاج إلى اسم لاستخدام المعاينة", + "name_publish": "تحتاج إلى اسم مسجل لنشر المحتوى", + "name_rate": "تحتاج إلى اسم للتقييم", + "name_registration": "رصيدك الحالي {{ balance }} كورتال. تسجيل الاسم يتطلب رسوم {{ fee }} كورتال", + "name_unavailable": "الاسم {{ name }} غير متاح", + "no_data_image": "لا توجد بيانات للصورة", + "no_description": "لا يوجد وصف", + "no_messages": "لا توجد رسائل", + "no_message": "لا توجد رسالة", + "no_minting_details": "لا يمكن عرض تفاصيل التعدين على البوابة", + "no_notifications": "لا توجد إشعارات جديدة", + "no_payments": "لا توجد مدفوعات", + "no_pinned_changes": "ليس لديك أي تغييرات على تطبيقاتك المثبتة", + "no_results": "لا توجد نتائج", + "one_app_per_name": "ملاحظة: حالياً، يُسمح بتطبيق وموقع واحد فقط لكل اسم.", + "ongoing_transactions": "معاملات قيد التنفيذ", + "opened": "تم الفتح", + "overwrite_qdn": "استبدال على QDN", + "password_confirm": "الرجاء تأكيد كلمة المرور", + "password_enter": "الرجاء إدخال كلمة المرور", + "payment_request": "التطبيق
{{hostname}}
يطلب دفعة", + "people_reaction": "الأشخاص الذين تفاعلوا بـ {{ reaction }}", + "processing_transaction": "جاري معالجة المعاملة، الرجاء الانتظار...", + "publish_data": "نشر البيانات على كورتال: من التطبيقات إلى الفيديوهات. لامركزية بالكامل!", + "publishing": "جاري النشر... الرجاء الانتظار.", + "qdn": "استخدام حفظ QDN", + "rating": "تقييم {{ service }} {{ name }}", + "register_name": "تحتاج إلى اسم مسجل لحفظ تطبيقاتك المثبتة على QDN.", + "replied_to": "رد على {{ person }}", + "revert_default": "الرجوع للإعدادات الافتراضية", + "revert_qdn": "الرجوع إلى QDN", + "save_qdn": "حفظ على QDN", + "secure_ownership": "تملك آمن للبيانات المنشورة باسمك. يمكنك حتى بيع اسمك مع بياناتك لطرف ثالث.", + "select_file": "الرجاء اختيار ملف", + "select_image": "الرجاء اختيار صورة للشعار", + "select_zip": "اختر ملف .zip يحتوي على محتوى ثابت:", + "sending": "جاري الإرسال...", + "settings": "أنت تستخدم طريقة الاستيراد/التصدير لحفظ الإعدادات.", + "space_for_admins": "عذراً، هذه المساحة مخصصة للإداريين فقط.", + "unread_messages": "رسائل غير مقروءة أدناه", + "unsaved_changes": "لديك تغييرات غير محفوظة على تطبيقاتك المثبتة. احفظها على QDN.", + "updating": "جاري التحديث", + "wait": "الرجاء الانتظار" + }, + "message": "رسالة", + "promotion_text": "نص الترويج", + "question": { + "accept_vote_on_poll": "هل توافق على معاملة التصويت على الاستفتاء؟ (الاستفتاءات عامة!)", + "logout": "هل أنت متأكد أنك تريد تسجيل الخروج؟", + "new_user": "هل أنت مستخدم جديد؟", + "delete_chat_image": "هل تريد حذف صورة الدردشة السابقة؟", + "perform_transaction": "هل تريد تنفيذ معاملة {{action}}؟", + "provide_thread": "الرجاء إدخال عنوان الموضوع", + "publish_app": "هل تريد نشر هذا التطبيق؟", + "publish_avatar": "هل تريد نشر صورة رمزية؟", + "publish_qdn": "هل تريد نشر إعداداتك على QDN (مشفرة)؟", + "overwrite_changes": "لم يتمكن التطبيق من تحميل تطبيقاتك المثبتة المحفوظة على QDN. هل تريد استبدال هذه التغييرات؟", + "rate_app": "هل تريد تقييم هذا التطبيق بتقييم {{ rate }}؟ (سيؤدي هذا إلى إنشاء معاملة استفتاء)", + "register_name": "هل تريد تسجيل هذا الاسم؟", + "reset_pinned": "لا تعجبك التغييرات المحلية الحالية؟ هل تريد العودة إلى التطبيقات المثبتة الافتراضية؟", + "reset_qdn": "لا تعجبك التغييرات المحلية الحالية؟ هل تريد العودة إلى تطبيقاتك المثبتة المحفوظة على QDN؟", + "transfer_qort": "هل تريد تحويل {{ amount }} كورتال؟" + }, + + "success": { + "order_submitted": "تم تقديم طلب الشراء بنجاح", + "published": "تم النشر بنجاح. يرجى الانتظار بضع دقائق حتى تنتشر التغييرات على الشبكة", + "published_qdn": "تم النشر بنجاح على QDN", + "rated_app": "تم التقييم بنجاح. يرجى الانتظار بضع دقائق حتى تنتشر التغييرات على الشبكة", + "request_read": "لقد قرأت هذا الطلب", + "transfer": "تم التحويل بنجاح!", + "voted": "تم التصويت بنجاح. يرجى الانتظار بضع دقائق حتى تنتشر التغييرات على الشبكة" + } + }, + "minting": { + "account_details": "تفاصيل حساب التعدين", + "actions": "إجراءات التعدين", + "average_blocktime": "متوسط وقت بلوك كورتال", + "average_blocks_per_day": "متوسط البلوكات يومياً", + "average_created_qorts_per_day": "متوسط عملات كورتال المُنشأة يومياً", + "blockchain_statistics": "إحصائيات البلوكشين", + "blocks_next_level": "بلوكات للوصول للمستوى التالي", + "current_level": "المستوى الحالي", + "current_status": "الحالة الحالية", + "current_tier": "المستوى الحالي", + "current_tier_content": "{{ tier }} (المستويات {{ levels }})", + "details": "تفاصيل التعدين", + "next_level": "مع التعدين المستمر 24/7 ستصبح في المستوى {{ level }} خلال {{ count }} يوم", + "rewards_info": "معلومات مكافآت التعدين", + "reward_per_block": "المكافأة المتوقعة لكل بلوك", + "reward_per_day": "المكافأة المتوقعة يومياً", + "status": { + "minting": "(جاري التعدين)", + "not_minting": "(غير معدّن)", + "no_status": "لا يوجد حالة", + "synchronized": "متزامن ({{ percent }}%)", + "synchronizing": "جاري المزامنة ({{ percent }}%)..." + }, + "status_title": "حالة التعدين", + "tier_share_per_block": "حصة المستوى لكل بلوك", + "total_minter_in_tier": "إجمالي المعدّنين في هذا المستوى" + }, + "name": "اسم", + "name_app": "اسم/تطبيق", + "new_post_in": "منشور جديد في {{ title }}", + "none": "لا شيء", + "note": "ملاحظة", + "option": "خيار", + "option_no": "لا توجد خيارات", + "option_other": "خيارات", + "page": { + "last": "آخر", + "first": "أول", + "next": "تالي", + "previous": "سابق" + }, + "payment_notification": "إشعار الدفع", + "payment": "دفع", + "poll_embed": "تضمين استطلاع رأي", + "port": "منفذ", + "price": "سعر", + "publish": "نشر", + "q_apps": { + "about": "حول تطبيق Q هذا", + "q_mail": "بريد Q", + "q_manager": "مدير Q", + "q_sandbox": "ساحة تطوير Q", + "q_wallets": "محافظ Q" + }, + "receiver": "المستقبِل", + "sender": "المرسِل", + "server": "الخادم", + "service_type": "نوع الخدمة", + "settings": "الإعدادات", + "sort": { + "by_member": "بواسطة العضو" + }, + "supply": "العرض", + "tags": "الوسوم", + "theme": { + "dark": "داكن", + "dark_mode": "الوضع الداكن", + "default": "السمة الافتراضية", + "light": "فاتح", + "light_mode": "الوضع الفاتح", + "manager": "مدير السمات", + "name": "اسم السمة" + }, + "thread": "موضوع", + "thread_other": "موضوعات", + "thread_title": "عنوان الموضوع", + "time": { + "day_one": "{{count}} يوم", + "day_other": "{{count}} أيام", + "hour_one": "{{count}} ساعة", + "hour_other": "{{count}} ساعات", + "minute_one": "{{count}} دقيقة", + "minute_other": "{{count}} دقائق", + "second_one": "{{count}} ثانية", + "second_other": "{{count}} ثواني", + "time": "الوقت" + }, + "title": "العنوان", + "to": "إلى", + "tutorial": "برنامج تعليمي", + "url": "رابط", + "user_lookup": "بحث عن المستخدم", + "vote": "تصويت", + "vote_other": "{{ count }} أصوات", + "zip": "ضغط", + "wallet": { + "litecoin": "محفظة لايتكوين", + "qortal": "محفظة كورتال", + "wallet": "محفظة", + "wallet_other": "محافظ" + }, + "website": "موقع ويب", + "welcome": "مرحبًا" +} diff --git a/src/i18n/locales/ar/group.json b/src/i18n/locales/ar/group.json new file mode 100644 index 0000000..f591e83 --- /dev/null +++ b/src/i18n/locales/ar/group.json @@ -0,0 +1,164 @@ +{ + "action": { + "add_promotion": "ضيف برومو", + "ban": "امنع عضو", + "cancel_ban": "شيل الحظر", + "copy_private_key": "انسخ المفتاح", + "create_group": "اعمل جروب", + "disable_push_notifications": "قفل التنبيهات", + "export_password": "حفظ الباسورد", + "export_private_key": "حفظ المفتاح", + "find_group": "دور على جروب", + "join_group": "ادخل جروب", + "kick_member": "اطرد عضو", + "invite_member": "دعّي عضو", + "leave_group": "اخرج من الجروب", + "load_members": "حمل الأعضاء", + "make_admin": "خليه أدمن", + "manage_members": "دير الأعضاء", + "promote_group": "روّج الجروب", + "publish_announcement": "نشر إعلان", + "publish_avatar": "غير الصورة", + "refetch_page": "جيب الصفحة تاني", + "remove_admin": "شيل أدمن", + "remove_minting_account": "مسح حساب المينت", + "return_to_thread": "ارجع للثريدات", + "scroll_bottom": "روح لآخر الصفحة", + "scroll_unread_messages": "روح للرسائل الجديدة", + "select_group": "اختار جروب", + "visit_q_mintership": "روح ل Q-Mintership" + }, + "advanced_options": "خيارات متقدمة", + "block_delay": { + "minimum": "أقل وقت بين البلوكات", + "maximum": "أقصى وقت بين البلوكات" + }, + "group": { + "approval_threshold": "حد الموافقة في الجروب", + "avatar": "صورة الجروب", + "closed": "مقفول (خاص) - محتاج إذن عشان تنضم", + "description": "وصف الجروب", + "id": "رقم الجروب", + "invites": "دعوات الجروب", + "group": "جروب", + "group_name": "جروب: {{ name }}", + "group_other": "جروبات", + "groups_admin": "الجروبات اللي انت أدمن فيها", + "management": "إدارة الجروب", + "member_number": "عدد الأعضاء", + "messaging": "المراسلة", + "name": "اسم الجروب", + "open": "مفتوح (عام)", + "private": "جروب خاص", + "promotions": "ترويج الجروب", + "public": "جروب عام", + "type": "نوع الجروب" + }, + "invitation_expiry": "مدة انتهاء الدعوة", + "invitees_list": "قائمة المدعوين", + "join_link": "لينك الانضمام للجروب", + "join_requests": "طلبات الانضمام", + "last_message": "آخر رسالة", + "last_message_date": "آخر رسالة: {{date}}", + "latest_mails": "آخر Q-Mails", + "message": { + "generic": { + "avatar_publish_fee": "نشر الصورة الشخصية يتطلب {{ fee }}", + "avatar_registered_name": "مطلوب اسم مسجل لتحديد صورة شخصية", + "admin_only": "هتظهر بس الجروبات اللي انت أدمن فيها", + "already_in_group": "أنت بالفعل في الجروب ده!", + "block_delay_minimum": "أقل تأخير للبلوك للموافقة على معاملات الجروب", + "block_delay_maximum": "أقصى تأخير للبلوك للموافقة على معاملات الجروب", + "closed_group": "الجروب ده خاص، محتاج تنتظر موافقة الأدمن", + "descrypt_wallet": "جاري فك تشفير المحفظة...", + "encryption_key": "جاري إنشاء أول مفتاح تشفير للجروب، استنى شوية لحد ما الشبكة تستلمه (هنتحقق كل دقيقتين)", + "group_announcement": "إعلانات الجروب", + "group_approval_threshold": "حد موافقة الجروب (عدد/نسبة الأدمنز المطلوبة للموافقة على المعاملة)", + "group_encrypted": "جروب مشفر", + "group_invited_you": "{{group}} دعاك للجروب", + "group_key_created": "أول مفتاح جروب اتعمل", + "group_member_list_changed": "قائمة الأعضاء اتغيرت، لازم تشفر المفتاح السري تاني", + "group_no_secret_key": "مفيش مفتاح سري للجروب، كن أول أدمن ينشره", + "group_secret_key_no_owner": "آخر مفتاح سري نُشر بواسطة غير المالك، كمالك الجروب لازم تشفر المفتاح تاني للسلامة", + "invalid_content": "محتوى أو مرسل أو توقيت غير صحيح في بيانات الرد", + "invalid_data": "غلط في تحميل المحتوى: بيانات غير صالحة", + "latest_promotion": "هتظهر بس آخر ترويجة في الأسبوع للجروب بتاعك", + "loading_members": "جاري تحميل قائمة الأعضاء بالأسامي... استنى شوية", + "max_chars": "200 حرف كحد أقصى. رسوم النشر", + "manage_minting": "ادير عملية التعدين بتاعتك", + "minter_group": "انت مش منضم لمجموعة المعدنين (MINTER)", + "mintership_app": "روح لتطبيق Q-Mintership عشان تتقدم تكون معدّن", + "minting_account": "حساب التعدين:", + "minting_keys_per_node": "مسموح بس بمفتاحين تعدين لكل نود، لو عايز تعدّن من الحساب ده لازم تشيل واحد", + "minting_keys_per_node_different": "مسموح بس بمفتاحين تعدين لكل نود، لو عايز تضيف حساب جديد لازم تشيل واحد", + "node_minting_account": "حسابات التعدين التابعة للنود", + "node_minting_key": "عندك بالفعل مفتاح تعدين لهذا الحساب على النود ده", + "no_announcement": "مفيش إعلانات", + "no_display": "مفيش حاجة للعرض", + "no_selection": "مفيش جروب محدد", + "not_part_group": "انت مش من أعضاء الجروب المشفر، استنى لحد ما الأدمن يشفر المفاتيح تاني", + "only_encrypted": "هتظهر بس الرسائل المشفرة", + "only_private_groups": "هتظهر بس الجروبات الخاصة", + "pending_join_requests": "{{ group }} عنده {{ count }} طلب انضمام قيد الانتظار", + "private_key_copied": "المفتاح الخاص اتنقل", + "provide_message": "اكتب أول رسالة في الموضوع", + "secure_place": "احفظ المفتاح السري في مكان آمن، متشاركش مع حد!", + "setting_group": "جاري إعداد الجروب... استنى شوية" + }, + "error": { + "access_name": "مش هتقدر ترسل رسالة من غير ما يكون عندك حق استخدام اسمك", + "descrypt_wallet": "غلط في فك تشفير المحفظة {{ message }}", + "description_required": "مطلوب وصف", + "group_info": "مش قادر اوصل لمعلومات الجروب", + "group_join": "فشل الانضمام للجروب", + "group_promotion": "غلط في نشر الترويجة، حاول تاني", + "group_secret_key": "مش قادر اجيب المفتاح السري للجروب", + "name_required": "مطلوب اسم", + "notify_admins": "حاول توصل لأدمن من قائمة الأدمنز دي:", + "qortals_required": "محتاج على الأقل {{ quantity }} عشان ترسل رسالة عملة كورتال", + "timeout_reward": "انتهى الوقت المستنظر لتأكيد حصة المكافأة", + "thread_id": "مش قادر ألاقي رقم الموضوع", + "unable_determine_group_private": "مش قادر أعرف إذا كان الجروب خاص ولا لا", + "unable_minting": "مش قادر أبدأ التعدين" + }, + "success": { + "group_ban": "تم حظر العضو من الجروب بنجاح. التغييرات ممكن تاخد دقائق عشان تظهر", + + "group_creation": "تم إنشاء الجروب بنجاح. التغييرات ممكن تاخد دقائق عشان تظهر", + "group_creation_name": "تم إنشاء الجروب {{group_name}}: في انتظار التأكيد", + "group_creation_label": "تم إنشاء الجروب {{name}}: نجاح!", + "group_invite": "تم دعوة {{invitee}} بنجاح. التغييرات ممكن تاخد دقائق عشان تظهر", + "group_join": "تم طلب الانضمام للجروب بنجاح. التغييرات ممكن تاخد دقائق عشان تظهر", + "group_join_name": "تم الانضمام للجروب {{group_name}}: في انتظار التأكيد", + "group_join_label": "تم الانضمام للجروب {{name}}: نجاح!", + "group_join_request": "تم طلب الانضمام للجروب {{group_name}}: في انتظار التأكيد", + "group_join_outcome": "تم طلب الانضمام للجروب {{group_name}}: نجاح!", + "group_kick": "تم طرد العضو من الجروب بنجاح. التغييرات ممكن تاخد دقائق عشان تظهر", + "group_leave": "تم طلب مغادرة الجروب بنجاح. التغييرات ممكن تاخد دقائق عشان تظهر", + "group_leave_name": "تم مغادرة الجروب {{group_name}}: في انتظار التأكيد", + "group_leave_label": "تم مغادرة الجروب {{name}}: نجاح!", + "group_member_admin": "تم تعيين العضو كأدمن بنجاح. التغييرات ممكن تاخد دقائق عشان تظهر", + "group_promotion": "تم نشر الترويجة بنجاح. ممكن تاخد دقائق عشان تظهر", + "group_remove_member": "تم إزالة العضو من الأدمنية بنجاح. التغييرات ممكن تاخد دقائق عشان تظهر", + "invitation_cancellation": "تم إلغاء الدعوة بنجاح. التغييرات ممكن تاخد دقائق عشان تظهر", + "invitation_request": "تم قبول طلب الانضمام: في انتظار التأكيد", + "loading_threads": "جاري تحميل المواضيع... استنى شوية", + "post_creation": "تم إنشاء المنشور بنجاح. النشر ممكن ياخد وقت عشان يكتمل", + "published_secret_key": "تم نشر المفتاح السري للجروب {{ group_id }}: في انتظار التأكيد", + "published_secret_key_label": "تم نشر المفتاح السري للجروب {{ group_id }}: نجاح!", + "registered_name": "تم التسجيل بنجاح. التغييرات ممكن تاخد دقائق عشان تظهر", + "registered_name_label": "تم تسجيل الاسم: في انتظار التأكيد. ممكن ياخد دقائق", + "registered_name_success": "تم تسجيل الاسم: نجاح!", + "rewardshare_add": "إضافة مشاركة المكافأة: في انتظار التأكيد", + "rewardshare_add_label": "إضافة مشاركة المكافأة: نجاح!", + "rewardshare_creation": "جاري تأكيد مشاركة المكافأة على السلسلة. ممكن ياخد لحد 90 ثانية", + "rewardshare_confirmed": "تم تأكيد مشاركة المكافأة. اضغط على التالي", + "rewardshare_remove": "إزالة مشاركة المكافأة: في انتظار التأكيد", + "rewardshare_remove_label": "إزالة مشاركة المكافأة: نجاح!", + "thread_creation": "تم إنشاء الموضوع بنجاح. النشر ممكن ياخد وقت عشان يكتمل", + "unbanned_user": "تم رفع الحظر عن المستخدم بنجاح. التغييرات ممكن تاخد دقائق عشان تظهر", + "user_joined": "تم انضمام المستخدم بنجاح!" + } + }, + "thread_posts": "بُوستات جديدة في الموضوع" +} diff --git a/src/i18n/locales/ar/question.json b/src/i18n/locales/ar/question.json new file mode 100644 index 0000000..6f5b8f7 --- /dev/null +++ b/src/i18n/locales/ar/question.json @@ -0,0 +1,194 @@ +{ + "accept_app_fee": "قبول مصاريف التطبيق", + "always_authenticate": "سجل دخول اوتوماتيك كل مرة", + "always_chat_messages": "اسمح بالشات من البرنامج دا دايماً", + "always_retrieve_balance": "جيب الرصيد اوتوماتيك كل مرة", + "always_retrieve_list": "جيب الليستات اوتوماتيك كل مرة", + "always_retrieve_wallet": "جيب المحفظة اوتوماتيك كل مرة", + "always_retrieve_wallet_transactions": "جيب حركات المحفظة اوتوماتيك كل مرة", + "amount_qty": "المبلغ: {{ quantity }}", + "asset_name": "الأصل: {{ asset }}", + "assets_used_pay": "الأصل المستخدم في الدفع: {{ asset }}", + "coin": "العملة: {{ coin }}", + "description": "الوصف: {{ description }}", + "deploy_at": "عايز تنشر الـ AT دا؟", + "download_file": "عايز تحمل الملف دا؟", + "message": { + "error": { + "add_to_list": "مش عارف أضيف في القايمة", + "at_info": "مش لاقي معلومات الـ AT", + "buy_order": "طلب الشراء فشل", + "cancel_sell_order": "فشل إلغاء طلب البيع. جرب تاني!", + "copy_clipboard": "مقدرش أنسخ للحافظة", + "create_sell_order": "فشل عمل طلب بيع. جرب تاني!", + "create_tradebot": "مش عارف أعمل تريد-بوت", + "decode_transaction": "فشل فك الترانزاكشن", + "decrypt": "مش عارف أفك التشفير", + "decrypt_message": "فشل فك الرسالة. تأكد إن البيانات والمفاتيح صح", + "decryption_failed": "فك التشفير فشل", + "empty_receiver": "مينفعش المستقبل يبقى فاضي!", + "encrypt": "مش عارف أشفر", + "encryption_failed": "التشفير فشل", + "encryption_requires_public_key": "عشان تشفر لازم يكون عندك المفاتيح العامة", + "fetch_balance_token": "فشل جلب رصيد {{ token }}. جرب تاني!", + "fetch_balance": "مش عارف أجيب الرصيد", + "fetch_connection_history": "فشل جلب تاريخ الاتصال بالسيرفر", + "fetch_generic": "مش عارف أجيب البيانات", + "fetch_group": "فشل جلب الجروب", + "fetch_list": "فشل جلب القايمة", + "fetch_poll": "فشل جلب الاستفتاء", + "fetch_recipient_public_key": "فشل جلب المفتاح العام بتاع المستقبل", + "fetch_wallet_info": "مش عارف أجيب معلومات المحفظة", + "fetch_wallet_transactions": "مش عارف أجيب حركات المحفظة", + "fetch_wallet": "جلب المحفظة فشل. جرب تاني", + "file_extension": "مش عارف أعرف امتداد الملف", + "gateway_balance_local_node": "مش هتقدر تشوف رصيد {{ token }} من الجيتواي. استخدم اللوكل نود بتاعك.", + "gateway_non_qort_local_node": "مينفعش ترسل عملة غير QORT من الجيتواي. استخدم اللوكل نود بتاعك.", + "gateway_retrieve_balance": "جلب رصيد {{ token }} مش مسموح من الجيتواي", + "gateway_wallet_local_node": "مش هتقدر تشوف محفظة {{ token }} من الجيتواي. استخدم اللوكل نود بتاعك.", + "get_foreign_fee": "غلط في جلب مصاريف العملة الأجنبية", + "insufficient_balance_qort": "رصيد عملة كورتال عندك مش كافي", + "insufficient_balance": "رصيد الأصل عندك مش كافي", + "insufficient_funds": "فلوسك مش كافية", + "invalid_encryption_iv": "IV مش صح: AES-GCM محتاج 12 بايت", + "invalid_encryption_key": "المفتاح مش صح: AES-GCM محتاج مفتاح 256 بت", + "invalid_fullcontent": "الحقل fullContent مش بطريقة صحيحة. استخدم string أو base64 أو object", + "invalid_receiver": "عنوان أو اسم المستقبل مش صح", + "invalid_type": "نوع مش صح", + "mime_type": "مش عارف أعرف نوع الملف (mimeType)", + "missing_fields": "حقول ناقصة: {{ fields }}", + "name_already_for_sale": "الاسم دا معروض للبيع بالفعل", + "name_not_for_sale": "الاسم دا مش معروض للبيع", + "no_api_found": "مفيش API شغال", + "no_data_encrypted_resource": "مفيش بيانات في المصدر المشفر", + "no_data_file_submitted": "مفيش بيانات أو ملف مرفوع", + "no_group_found": "الجروب مش موجود", + "no_group_key": "مفيش مفتاح جروب", + "no_poll": "الاستفتاء مش موجود", + "no_resources_publish": "مفيش حاجة تنشر", + "node_info": "فشل جلب معلومات النود", + "node_status": "فشل جلب حالة النود", + "only_encrypted_data": "بس البيانات المشفرة تقدر تروح للخدمات الخاصة", + "perform_request": "فشل تنفيذ الطلب", + "poll_create": "فشل عمل استفتاء", + "poll_vote": "فشل التصويت في الاستفتاء", + "process_transaction": "مش عارف أعالج الترانزاكشن", + "provide_key_shared_link": "عشان تعمل لينك لمصدر مشفر، محتاج توفر المفتاح", + "registered_name": "محتاج اسم مسجل عشان تنشر", + "resources_publish": "بعض الحاجات فشلت في النشر", + "retrieve_file": "فشل جلب الملف", + "retrieve_keys": "مش عارف أجيب المفاتيح", + "retrieve_summary": "فشل جلب الملخص", + "retrieve_sync_status": "غلط في جلب حالة Sync لـ {{ token }}", + "same_foreign_blockchain": "كل الـ ATs المطلوبة لازم تكون من نفس البلوكشين الأجنبي.", + "send": "فشل الإرسال", + "server_current_add": "فشل إضافة السيرفر الحالي", + "server_current_set": "فشل تعيين السيرفر الحالي", + "server_info": "غلط في جلب معلومات السيرفر", + "server_remove": "فشل مسح السيرفر", + "submit_sell_order": "فشل تقديم طلب بيع", + "synchronization_attempts": "فشل المزامنة بعد {{ count }} محاولات", + "timeout_request": "الطلب خلص وقته", + "token_not_supported": "{{ token }} غير مدعوم للطلب دا", + "transaction_activity_summary": "غلط في ملخص نشاط الترانزاكشن", + "unknown_error": "غلط مش معروف", + "unknown_admin_action_type": "نوع إجراء أداري مش معروف: {{ type }}", + "update_foreign_fee": "فشل تحديث مصاريف العملة الأجنبية", + "update_tradebot": "مش عارف أعدل التريد-بوت", + "upload_encryption": "الرفع فشل بسبب مشكلة في التشفير", + "upload": "الرفع فشل", + "use_private_service": "عشان تنشر حاجة مشفرة استخدم خدمة بتكون منتهية بـ _PRIVATE", + "user_qortal_name": "المستخدم ماعندوش اسم Qortal", + "max_size_publish": "أقصى حجم للملف المسموح بيه {{size}} جيجابايت لكل ملف.", + "max_size_publish_public": "أقصى حجم للملف على النود العام {{size}} ميجابايت. استخدم اللوكل نود بتاعك للملفات الكبيرة." + }, + "generic": { + "calculate_fee": "*العمولة {{ amount }} ساتوشي مبنية على سعر {{ rate }} ساتوشي لكل كيلوبايت، علشان الترانزاكشن حجمها حوالي 300 بايت.", + "confirm_join_group": "تأكيد الانضمام للجروب:", + "include_data_decrypt": "يا ريت تضيف بيانات عشان تفك تشفيرها", + "include_data_encrypt": "يا ريت تضيف بيانات عشان تشفرها", + "max_retry_transaction": "وصلت لأقصى عدد محاولات. بنسحب من الترانزاكشن دي.", + "no_action_public_node": "الحركة دي مش هتعمل على نود عام", + "private_service": "يا ريت تستخدم خدمة خاصة", + "provide_group_id": "يا ريت تحط آيدي الجروب", + "read_transaction_carefully": "اقرأ الترانزاكشن كويس قبل ما توافق!", + "user_declined_add_list": "المستخدم رفض الإضافة للقايمة", + "user_declined_delete_from_list": "المستخدم رفض الحذف من القايمة", + "user_declined_delete_hosted_resources": "المستخدم رفض مسح الملفات المضيفة", + "user_declined_join": "المستخدم رفض الانضمام للجروب", + "user_declined_list": "المستخدم رفض جلب قايمة الملفات المضيفة", + "user_declined_request": "المستخدم رفض الطلب", + "user_declined_save_file": "المستخدم رفض حفظ الملف", + "user_declined_send_message": "المستخدم رفض إرسال الرسالة", + "user_declined_share_list": "المستخدم رفض مشاركة القايمة" + } + }, + "name": "الاسم: {{ name }}", + "option": "الخيار: {{ option }}", + "options": "الخيارات: {{ optionList }}", + "permission": { + "access_list": "هل تسمح للتطبيق بالوصول للقائمة؟", + "add_admin": "هل تسمح للتطبيق بإضافة {{ invitee }} كأدمن؟", + "all_item_list": "هل تسمح للتطبيق بإضافة الآتي للقائمة {{ name }}:", + "authenticate": "هل تسمح للتطبيق بتسجيل الدخول؟", + "ban": "هل تسمح للتطبيق بمنع {{ partecipant }} من الجروب؟", + "buy_name_detail": "شراء {{ name }} بسعر {{ price }} QORT", + "buy_name": "هل تسمح للتطبيق بشراء اسم؟", + "buy_order_fee_estimation_one": "العمولة دي تقديرية بناء على {{ count }} طلب، بافتراض حجم 300 بايت ومعدل {{ fee }} {{ ticker }} لكل كيلوبايت.", + "buy_order_fee_estimation_other": "العمولة دي تقديرية بناء على {{ count }} طلبات، بافتراض حجم 300 بايت ومعدل {{ fee }} {{ ticker }} لكل كيلوبايت.", + "buy_order_per_kb": "{{ fee }} {{ ticker }} لكل كيلوبايت", + "buy_order_quantity_one": "{{ count }} طلب شراء", + "buy_order_quantity_other": "{{ count }} طلبات شراء", + "buy_order_ticker": "{{ qort_amount }} مقابل عملة كورتال {{ foreign_amount }} {{ ticker }}", + "buy_order": "هل تسمح للتطبيق بعمل طلب شراء؟", + "cancel_ban": "هل تسمح للتطبيق بإلغاء منع {{ partecipant }} من الجروب؟", + "cancel_group_invite": "هل تسمح للتطبيق بإلغاء دعوة {{ invitee }} للجروب؟", + "cancel_sell_order": "هل تسمح للتطبيق بإلغاء طلب بيع؟", + "create_group": "هل تسمح للتطبيق بعمل جروب جديد؟", + "delete_hosts_resources": "هل تسمح للتطبيق بحذف {{ size }} من الملفات المضيفة؟", + "fetch_balance": "هل تسمح للتطبيق بجلب رصيد {{ coin }} بتاعك؟", + "get_wallet_info": "هل تسمح للتطبيق بجلب معلومات محفظتك؟", + "get_wallet_transactions": "هل تسمح للتطبيق بجلب حركات محفظتك؟", + "invite": "هل تسمح للتطبيق بدعوة {{ invitee }}؟", + "kick": "هل تسمح للتطبيق بطرد {{ partecipant }} من الجروب؟", + "leave_group": "هل تسمح للتطبيق بمغادرة الجروب الآتي؟", + "list_hosted_data": "هل تسمح للتطبيق بجلب قائمة ملفاتك المضيفة؟", + "order_detail": "{{ qort_amount }} مقابل عملة كورتال {{ foreign_amount }} {{ ticker }}", + "pay_publish": "هل تسمح للتطبيق بعمل عمليات الدفع والنشر الآتية؟", + "perform_admin_action_with_value": "بقيمة: {{ value }}", + "perform_admin_action": "هل تسمح للتطبيق بعمل الإجراء الإداري: {{ type }}؟", + "publish_qdn": "هل تسمح للتطبيق بالنشر على QDN؟", + "register_name": "هل تسمح للتطبيق بتسجيل هذا الاسم؟", + "remove_admin": "هل تسمح للتطبيق بإزالة {{ partecipant }} من الأدمنية؟", + "remove_from_list": "هل تسمح للتطبيق بإزالة الآتي من القائمة {{ name }}:", + "sell_name_cancel": "هل تسمح للتطبيق بإلغاء بيع الاسم؟", + "sell_name_transaction_detail": "بيع {{ name }} بسعر {{ price }} QORT", + "sell_name_transaction": "هل تسمح للتطبيق بعمل صفقة بيع اسم؟", + "sell_order": "هل تسمح للتطبيق بعمل طلب بيع؟", + "send_chat_message": "هل تسمح للتطبيق بإرسال هذه الرسالة؟", + "send_coins": "هل تسمح للتطبيق بإرسال عملات؟", + "server_add": "هل تسمح للتطبيق بإضافة سيرفر؟", + "server_remove": "هل تسمح للتطبيق بإزالة سيرفر؟", + "set_current_server": "هل تسمح للتطبيق بتعيين السيرفر الحالي؟", + "sign_fee": "هل تسمح للتطبيق بتوقيع العمولات المطلوبة لجميع عروض التداول؟", + "sign_process_transaction": "هل تسمح للتطبيق بتوقيع ومعالجة الترانزاكشن؟", + "sign_transaction": "هل تسمح للتطبيق بتوقيع الترانزاكشن؟", + "transfer_asset": "هل تسمح للتطبيق بنقل الأصل الآتي؟", + "update_foreign_fee": "هل تسمح للتطبيق بتحديث عمولات العملات الأجنبية على نودك؟", + "update_group_detail": "المالك الجديد: {{ owner }}", + "update_group": "هل تسمح للتطبيق بتحديث هذا الجروب؟" + }, + "poll": "استفتاء: {{ name }}", + "provide_recipient_group_id": "لو سمحت توفر آيدي الجروب أو المستقبل", + "request_create_poll": "أنت تطلب عمل الاستفتاء الآتي:", + "request_vote_poll": "يتم طلب تصويتك على الاستفتاء الآتي:", + "sats_per_kb": "{{ amount }} ساتوشي لكل كيلوبايت", + "sats": "{{ amount }} ساتوشي", + "server_host": "السيرفر: {{ host }}", + "server_type": "النوع: {{ type }}", + "to_group": "ل: جروب {{ group_id }}", + "to_recipient": "ل: {{ recipient }}", + "total_locking_fee": "إجمالي عمولة القفل:", + "total_unlocking_fee": "إجمالي عمولة الفتح:", + "value": "القيمة: {{ value }}" +} diff --git a/src/i18n/locales/ar/tutorial.json b/src/i18n/locales/ar/tutorial.json new file mode 100644 index 0000000..82fb810 --- /dev/null +++ b/src/i18n/locales/ar/tutorial.json @@ -0,0 +1,21 @@ +{ + "1_getting_started": " ١.البدء", + "2_overview": " ٢.نظرة عامة", + "3_groups": " ٣.مجموعات كورتال", + "4_obtain_qort": "٤.الحصول على عملة كورتال", + "account_creation": "إنشاء حساب", + "important_info": "معلومات هامة", + "apps": { + "dashboard": "١.لوحة معلومات التطبيقات", + "navigation": "٢.التنقل بين التطبيقات" + }, + "initial": { + "recommended_qort_qty": "لديك على الأقل {{ quantity}} عملة كورتال في محفظتك", + "explore": "يستكشف", + "general_chat": "دردشة عامة", + "getting_started": "ابدء", + "register_name": "تسجيل اسم", + "see_apps": "انظر التطبيقات", + "trade_qort": "تداول عملة كورتال" + } +} diff --git a/src/i18n/locales/de/auth.json b/src/i18n/locales/de/auth.json new file mode 100644 index 0000000..7f67427 --- /dev/null +++ b/src/i18n/locales/de/auth.json @@ -0,0 +1,138 @@ +{ + "account": { + "your": "dein Konto", + "account_many": "Konten", + "account_one": "Konto", + "selected": "ausgewähltes Konto" + }, + "action": { + "add": { + "account": "Konto hinzufügen", + "seed_phrase": "Seed-Phrase hinzufügen" + }, + "authenticate": "authentifizieren", + "block": "blockieren", + "block_all": "alle blockieren", + "block_data": "QDN-Daten blockieren", + "block_name": "Name blockieren", + "block_txs": "TXs blockieren", + "fetch_names": "Namen abrufen", + "copy_address": "Adresse kopieren", + "create_account": "Konto erstellen", + "create_qortal_account": "Erstelle dein Qortal-Konto, indem du unten auf WEITER klickst.", + "choose_password": "neues Passwort wählen", + "download_account": "Konto herunterladen", + "enter_amount": "Bitte gib einen Betrag größer als 0 ein", + "enter_recipient": "Bitte gib einen Empfänger ein", + "enter_wallet_password": "Bitte gib dein Wallet-Passwort ein", + "export_seedphrase": "Seedphrase exportieren", + "insert_name_address": "Bitte gib einen Namen oder eine Adresse ein", + "publish_admin_secret_key": "Admin-Secret-Key veröffentlichen", + "publish_group_secret_key": "Gruppen-Secret-Key veröffentlichen", + "reencrypt_key": "Schlüssel neu verschlüsseln", + "return_to_list": "Zur Liste zurückkehren", + "setup_qortal_account": "Qortal-Konto einrichten", + "unblock": "entsperren", + "unblock_name": "Name entsperren" + }, + "address": "Adresse", + "address_name": "Adresse oder Name", + "advanced_users": "für fortgeschrittene Benutzer", + "apikey": { + "alternative": "Alternative: Datei auswählen", + "change": "API-Schlüssel ändern", + "enter": "API-Schlüssel eingeben", + "import": "API-Schlüssel importieren", + "key": "API-Schlüssel", + "select_valid": "Gültigen API-Schlüssel auswählen" + }, + "authentication": "Authentifizierung", + "blocked_users": "blockierte Benutzer", + "build_version": "Build-Version", + "message": { + "error": { + "account_creation": "Konto konnte nicht erstellt werden.", + "address_not_existing": "Adresse existiert nicht auf der Blockchain", + "block_user": "Benutzer konnte nicht blockiert werden", + "create_simmetric_key": "Symmetrischer Schlüssel kann nicht erstellt werden", + "decrypt_data": "Daten konnten nicht entschlüsselt werden", + "decrypt": "Entschlüsselung nicht möglich", + "encrypt_content": "Inhalt kann nicht verschlüsselt werden", + "fetch_user_account": "Benutzerkonto konnte nicht abgerufen werden", + "field_not_found_json": "{{ field }} nicht im JSON gefunden", + "find_secret_key": "Korrekter SecretKey konnte nicht gefunden werden", + "incorrect_password": "falsches Passwort", + "invalid_qortal_link": "ungültiger Qortal-Link", + "invalid_secret_key": "SecretKey ist ungültig", + "invalid_uint8": "Das eingereichte Uint8ArrayData ist ungültig", + "name_not_existing": "Name existiert nicht", + "name_not_registered": "Name nicht registriert", + "read_blob_base64": "Blob konnte nicht als base64-codierter String gelesen werden", + "reencrypt_secret_key": "Secret Key konnte nicht neu verschlüsselt werden", + "set_apikey": "API-Schlüssel konnte nicht gesetzt werden:" + }, + "generic": { + "blocked_addresses": "Blockierte Adressen – verhindert TX-Verarbeitung", + "blocked_names": "Blockierte Namen für QDN", + "blocking": "{{ name }} wird blockiert", + "choose_block": "Wähle 'TXs blockieren' oder 'alles', um Chat-Nachrichten zu blockieren", + "congrats_setup": "Glückwunsch, alles ist eingerichtet!", + "decide_block": "Entscheide, was blockiert werden soll", + "downloading_encryption_keys": "Verschlüsselungsschlüssel werden heruntergeladen", + "fetching_admin_secret_key": "Admin-Secret-Key wird abgerufen", + "fetching_group_secret_key": "Gruppen-Secret-Key wird veröffentlicht", + "keep_secure": "Halte deine Kontodatei sicher", + "last_encryption_date": "Letztes Verschlüsselungsdatum: {{ date }} von {{ name }}", + "locating_encryption_keys": "Verschlüsselungsschlüssel werden gesucht", + "name_address": "Name oder Adresse", + "no_account": "Keine Konten gespeichert", + "no_minimum_length": "Keine Mindestlänge erforderlich", + "no_secret_key_published": "Noch kein Secret Key veröffentlicht", + "publishing_key": "Hinweis: Nach der Veröffentlichung kann es ein paar Minuten dauern, bis der Schlüssel sichtbar ist. Bitte warte einfach.", + "seedphrase_notice": "Eine SEEDPHRASE wurde im Hintergrund zufällig generiert.", + "turn_local_node": "Bitte aktiviere deinen lokalen Node", + "type_seed": "Gib deine Seed-Phrase ein oder füge sie ein", + "your_accounts": "deine gespeicherten Konten" + }, + "success": { + "reencrypted_secret_key": "Secret Key erfolgreich neu verschlüsselt. Es kann ein paar Minuten dauern, bis die Änderungen wirksam werden. Aktualisiere die Gruppe in 5 Minuten." + } + }, + "node": { + "choose": "Benutzerdefinierten Node auswählen", + "custom_many": "Benutzerdefinierte Nodes", + "use_custom": "Benutzerdefinierten Node verwenden", + "use_local": "Lokalen Node verwenden", + "using": "Verwendeter Node", + "using_public": "Öffentlichen Node verwenden", + "using_public_gateway": "Öffentlichen Node verwenden: {{ gateway }}" + }, + "note": "Notiz", + "password": "Passwort", + "password_confirmation": "Passwort bestätigen", + "seed_phrase": "Seed-Phrase", + "seed_your": "deine Seedphrase", + "tips": { + "additional_wallet": "Nutze diese Option, um zusätzliche Qortal-Wallets zu verbinden, die du bereits erstellt hast, um dich später damit anzumelden. Du brauchst deine Backup-JSON-Datei dafür.", + "digital_id": "Dein Wallet ist wie dein digitaler Ausweis auf Qortal und dient zur Anmeldung in der Benutzeroberfläche. Es enthält deine öffentliche Adresse und den Qortal-Namen, den du auswählst. Alle Transaktionen sind mit deiner ID verknüpft und du verwaltest hier dein QORT sowie andere Kryptowährungen.", + "existing_account": "Du hast bereits ein Qortal-Konto? Gib hier deine geheime Backup-Phrase ein, um darauf zuzugreifen. Diese Phrase ist eine Möglichkeit zur Wiederherstellung.", + "key_encrypt_admin": "Dieser Schlüssel dient zur Verschlüsselung von ADMIN-Inhalten. Nur Admins können diesen Inhalt sehen.", + "key_encrypt_group": "Dieser Schlüssel verschlüsselt GRUPPEN-Inhalte. Nur Gruppenmitglieder können den Inhalt sehen. Dieser wird derzeit im UI verwendet.", + "new_account": "Ein Konto erstellen bedeutet, ein neues Wallet und eine digitale ID zu erstellen, um Qortal zu nutzen. Danach kannst du QORT erhalten, Namen und Avatare kaufen, Videos und Blogs veröffentlichen und mehr.", + "new_users": "Neue Benutzer starten hier!", + "safe_place": "Speichere dein Konto an einem Ort, den du dir merken kannst!", + "view_seedphrase": "Wenn du die SEEDPHRASE ansehen möchtest, klicke auf das Wort 'SEEDPHRASE'. Seedphrases generieren den privaten Schlüssel deines Kontos. Aus Sicherheitsgründen werden sie standardmäßig nicht angezeigt.", + "wallet_secure": "Halte deine Wallet-Datei sicher." + }, + "wallet": { + "password_confirmation": "Wallet-Passwort bestätigen", + "password": "Wallet-Passwort", + "keep_password": "aktuelles Passwort beibehalten", + "new_password": "neues Passwort", + "error": { + "missing_new_password": "Bitte gib ein neues Passwort ein", + "missing_password": "Bitte gib dein Passwort ein" + } + }, + "welcome": "Willkommen bei" +} diff --git a/src/i18n/locales/de/core.json b/src/i18n/locales/de/core.json new file mode 100644 index 0000000..94020dc --- /dev/null +++ b/src/i18n/locales/de/core.json @@ -0,0 +1,418 @@ +{ + "action": { + "accept": "akzeptieren", + "access": "Zugang", + "access_app": "Zugangs -App", + "add": "hinzufügen", + "add_custom_framework": "Fügen Sie benutzerdefiniertes Framework hinzu", + "add_reaction": "Reaktion hinzufügen", + "add_theme": "Thema hinzufügen", + "backup_account": "Sicherungskonto", + "backup_wallet": "Backup -Brieftasche", + "cancel": "stornieren", + "cancel_invitation": "Einladung abbrechen", + "change": "ändern", + "change_avatar": "Avatar ändern", + "change_file": "Datei ändern", + "change_language": "Sprache ändern", + "choose": "wählen", + "choose_file": "Datei wählen", + "choose_image": "Wählen Sie Bild", + "choose_logo": "Wählen Sie ein Logo", + "choose_name": "Wählen Sie einen Namen", + "close": "schließen", + "close_chat": "Direkten Chat schließen", + "continue": "weitermachen", + "continue_logout": "Melden Sie sich weiter an", + "copy_link": "Link kopieren", + "create_apps": "Apps erstellen", + "create_file": "Datei erstellen", + "create_transaction": "Erstellen Sie Transaktionen auf der Qortal Blockchain", + "create_thread": "Thread erstellen", + "decline": "Abfall", + "decrypt": "entschlüsseln", + "disable_enter": "Deaktivieren Sie die Eingabe", + "download": "herunterladen", + "download_file": "Datei herunterladen", + "edit": "bearbeiten", + "edit_theme": "Thema bearbeiten", + "enable_dev_mode": "Dev -Modus aktivieren", + "enter_name": "Geben Sie einen Namen ein", + "export": "Export", + "get_qort": "Holen Sie sich Qort", + "get_qort_trade": "Holen Sie sich Qort bei Q-Trade", + "hide": "verstecken", + "hide_qr_code": "QR -Code verbergen", + "import": "Import", + "import_theme": "Importthema", + "invite": "einladen", + "invite_member": "ein neues Mitglied einladen", + "join": "verbinden", + "leave_comment": "Kommentar hinterlassen", + "load_announcements": "ältere Ankündigungen laden", + "login": "Login", + "logout": "Abmelden", + "new": { + "chat": "neuer Chat", + "post": "neuer Beitrag", + "theme": "Neues Thema", + "thread": "neuer Thread" + }, + "notify": "benachrichtigen", + "open": "offen", + "pin": "Stift", + "pin_app": "Pin App", + "pin_from_dashboard": "Pin vom Armaturenbrett", + "post": "Post", + "post_message": "Post Nachricht", + "publish": "veröffentlichen", + "publish_app": "Veröffentlichen Sie Ihre App", + "publish_comment": "Kommentar veröffentlichen", + "refresh": "Aktualisieren", + "register_name": "Registrieren Sie den Namen", + "remove": "entfernen", + "remove_reaction": "Reaktion entfernen", + "return_apps_dashboard": "Kehren Sie zu Apps Dashboard zurück", + "save": "speichern", + "save_disk": "Speichern auf der Festplatte", + "search": "suchen", + "search_apps": "Suche nach Apps", + "search_groups": "Suche nach Gruppen", + "search_chat_text": "Chattext suchen", + "see_qr_code": "Siehe QR -Code", + "select_app_type": "Wählen Sie App -Typ", + "select_category": "Kategorie auswählen", + "select_name_app": "Wählen Sie Name/App", + "send": "schicken", + "send_qort": "Qort senden", + "set_avatar": "Setzen Sie Avatar", + "show": "zeigen", + "show_poll": "Umfrage zeigen", + "start_minting": "Fangen Sie an, zu streiten", + "start_typing": "Fangen Sie hier an, hier zu tippen ...", + "trade_qort": "Handel Qort", + "transfer_qort": "Qort übertragen", + "unpin": "unpin", + "unpin_app": "UNPIN App", + "unpin_from_dashboard": "Unpin aus dem Dashboard", + "update": "aktualisieren", + "update_app": "Aktualisieren Sie Ihre App", + "vote": "Abstimmung" + }, + "address_your": "Ihre Adresse", + "admin": "Administrator", + "admin_other": "Administratoren", + "all": "alle", + "amount": "Menge", + "announcement": "Bekanntmachung", + "announcement_other": "Ankündigungen", + "api": "API", + "app": "App", + "app_other": "Apps", + "app_name": "App -Name", + "app_private": "Privat", + "app_service_type": "App -Service -Typ", + "apps_dashboard": "Apps Dashboard", + "apps_official": "offizielle Apps", + "attachment": "Anhang", + "balance": "Gleichgewicht:", + "category": "Kategorie", + "category_other": "Kategorien", + "chat": "Chat", + "comment_other": "Kommentare", + "contact_other": "Kontakte", + "core": { + "block_height": "Blockhöhe", + "information": "Kerninformationen", + "peers": "Gefahrene Kollegen", + "version": "Kernversion" + }, + "current_language": "current language: {{ language }}", + "dev": "Dev", + "dev_mode": "Dev -Modus", + "domain": "Domain", + "ui": { + "version": "UI -Version" + }, + "count": { + "none": "keiner", + "one": "eins" + }, + "description": "Beschreibung", + "devmode_apps": "Dev -Modus -Apps", + "directory": "Verzeichnis", + "downloading_qdn": "Herunterladen von QDN", + "fee": { + "payment": "Zahlungsgebühr", + "publish": "Gebühr veröffentlichen" + }, + "for": "für", + "general": "allgemein", + "general_settings": "Allgemeine Einstellungen", + "home": "heim", + "identifier": "Kennung", + "image_embed": "Bildbett", + "last_height": "letzte Höhe", + "level": "Ebene", + "library": "Bibliothek", + "list": { + "bans": "Liste der Verbote", + "groups": "Liste der Gruppen", + "invites": "Liste der Einladungen", + "join_request": "Schließen Sie die Anforderungsliste an", + "member": "Mitgliedsliste", + "members": "Liste der Mitglieder" + }, + "loading": { + "announcements": "Laden von Ankündigungen", + "generic": "Laden...", + "chat": "Chat beladen ... Bitte warten Sie.", + "comments": "Kommentare laden ... bitte warten.", + "posts": "Beiträge laden ... bitte warten." + }, + "member": "Mitglied", + "member_other": "Mitglieder", + "message_us": "Bitte senden Sie uns eine Nachricht in NextCloud (keine Anmeldung erforderlich) oder Discord, wenn Sie 4 QORT benötigen, um ohne Einschränkungen zu chatten", + "message": { + "error": { + "address_not_found": "Ihre Adresse wurde nicht gefunden", + "app_need_name": "Ihre App benötigt einen Namen", + "build_app": "Private App kann nicht erstellen", + "decrypt_app": "Private App kann nicht entschlüsseln '", + "download_image": "Image kann nicht heruntergeladen werden. Bitte versuchen Sie es später erneut, indem Sie auf die Schaltfläche Aktualisieren klicken", + "download_private_app": "Private App kann nicht heruntergeladen werden", + "encrypt_app": "App kann nicht verschlüsseln. App nicht veröffentlicht '", + "fetch_app": "App kann nicht abrufen", + "fetch_publish": "Veröffentlichung kann nicht abrufen", + "file_too_large": "file {{ filename }} is too large. Max size allowed is {{ size }} MB.", + "generic": "Ein Fehler ist aufgetreten", + "initiate_download": "Download nicht einleiten", + "invalid_amount": "ungültiger Betrag", + "invalid_base64": "Ungültige Base64 -Daten", + "invalid_embed_link": "Ungültiger Einbettverbindung", + "invalid_image_embed_link_name": "Ungültiges Bild -Einbettungs -Link. Fehlender Param.", + "invalid_poll_embed_link_name": "Ungültige Umfrage -Einbettungsverbindung. Fehlender Name.", + "invalid_signature": "Ungültige Signatur", + "invalid_theme_format": "Ungültiges Themenformat", + "invalid_zip": "Ungültiges Reißverschluss", + "message_loading": "Fehlerladelademeldung.", + "message_size": "your message size is of {{ size }} bytes out of a maximum of {{ maximum }}", + "minting_account_add": "Es kann kein Münzkonto hinzufügen", + "minting_account_remove": "Münzkonto kann nicht entfernen", + "missing_fields": "missing: {{ fields }}", + "navigation_timeout": "Navigationszeitüberschreitung", + "network_generic": "Netzwerkfehler", + "password_not_matching": "Passwortfelder stimmen nicht überein!", + "password_wrong": "authentifizieren nicht. Falsches Passwort", + "publish_app": "App kann nicht veröffentlichen", + "publish_image": "Image kann nicht veröffentlichen", + "rate": "bewerten nicht", + "rating_option": "Bewertungsoption kann nicht finden", + "save_qdn": "qdn kann nicht speichern", + "send_failed": "nicht senden", + "update_failed": "nicht aktualisiert", + "vote": "nicht stimmen können" + }, + "generic": { + "already_voted": "Sie haben bereits gestimmt.", + "avatar_size": "{{ size }} KB max. for GIFS", + "benefits_qort": "Vorteile von Qort", + "building": "Gebäude", + "building_app": "App -App", + "created_by": "created by {{ owner }}", + "buy_order_request": "the Application
{{hostname}}
is requesting {{count}} buy order", + "buy_order_request_other": "the Application
{{hostname}}
is requesting {{count}} buy orders", + "devmode_local_node": "Bitte verwenden Sie Ihren lokalen Knoten für den Dev -Modus! Melden Sie sich an und verwenden Sie den lokalen Knoten.", + "downloading": "Herunterladen", + "downloading_decrypting_app": "private App herunterladen und entschlüsseln.", + "edited": "bearbeitet", + "editing_message": "Bearbeitungsnachricht", + "encrypted": "verschlüsselt", + "encrypted_not": "nicht verschlüsselt", + "fee_qort": "fee: {{ message }} QORT", + "fetching_data": "App -Daten abrufen", + "foreign_fee": "foreign fee: {{ message }}", + "get_qort_trade_portal": "Holen Sie sich QORT mit dem CrossChain -Handelsportal von Qortal", + "minimal_qort_balance": "having at least {{ quantity }} QORT in your balance (4 qort balance for chat, 1.25 for name, 0.75 for some transactions)", + "mentioned": "erwähnt", + "message_with_image": "Diese Nachricht hat bereits ein Bild", + "most_recent_payment": "{{ count }} most recent payment", + "name_available": "{{ name }} is available", + "name_benefits": "Vorteile eines Namens", + "name_checking": "Überprüfen Sie, ob der Name bereits vorhanden ist", + "name_preview": "Sie benötigen einen Namen, um die Vorschau zu verwenden", + "name_publish": "Sie benötigen einen Qortalnamen, um zu veröffentlichen", + "name_rate": "Sie benötigen einen Namen, um zu bewerten.", + "name_registration": "your balance is {{ balance }} QORT. A name registration requires a {{ fee }} QORT fee", + "name_unavailable": "{{ name }} is unavailable", + "no_data_image": "Keine Daten für das Bild", + "no_description": "Keine Beschreibung", + "no_messages": "Keine Nachrichten", + "no_message": "Keine Nachricht", + "no_minting_details": "Müngungsdetails auf dem Gateway können nicht angezeigt werden", + "no_notifications": "Keine neuen Benachrichtigungen", + "no_payments": "Keine Zahlungen", + "no_pinned_changes": "Sie haben derzeit keine Änderungen an Ihren angestellten Apps", + "no_results": "Keine Ergebnisse", + "one_app_per_name": "Hinweis: Derzeit ist pro Namen nur eine App und Website zulässig.", + "ongoing_transactions": "laufende Transaktionen", + "opened": "geöffnet", + "overwrite_qdn": "überschreibt zu QDN", + "password_confirm": "Bitte bestätigen Sie ein Passwort", + "password_enter": "Bitte geben Sie ein Passwort ein", + "payment_request": "the Application
{{hostname}}
is requesting a payment", + "people_reaction": "people who reacted with {{ reaction }}", + "processing_transaction": "Ist die Verarbeitung von Transaktionen, bitte warten ...", + "publish_data": "Veröffentlichung von Daten an Qortal: Alles, von Apps bis hin zu Videos. Voll dezentral!", + "publishing": "Veröffentlichung ... bitte warten.", + "qdn": "Verwenden Sie QDN Saving", + "rating": "rating for {{ service }} {{ name }}", + "register_name": "Sie benötigen einen registrierten Qortal -Namen, um Ihre angestellten Apps vor QDN zu speichern.", + "replied_to": "replied to {{ person }}", + "revert_default": "zurück zu Standard zurückkehren", + "revert_qdn": "zurück zu QDN zurückkehren", + "save_qdn": "speichern auf qdn", + "secure_ownership": "Sicheres Eigentum an Daten, die mit Ihrem Namen veröffentlicht wurden. Sie können Ihren Namen sogar zusammen mit Ihren Daten an einen Dritten verkaufen.", + "select_file": "Bitte wählen Sie eine Datei aus", + "select_image": "Bitte wählen Sie ein Bild für ein Logo", + "select_zip": "Wählen Sie .ZIP -Datei mit statischen Inhalten:", + "sending": "Senden ...", + "settings": "Sie verwenden den Export-/Import -Weg zum Speichern von Einstellungen.", + "space_for_admins": "Entschuldigung, dieser Raum gilt nur für Administratoren.", + "unread_messages": "ungelesene Nachrichten unten", + "unsaved_changes": "sie haben nicht gespeicherte Änderungen an Ihren angestellten Apps. Speichern Sie sie bei QDN.", + "updating": "aktualisierung", + "wait": "bitte warten" + }, + "message": "Nachricht", + "promotion_text": "Promotionstext", + "question": { + "accept_vote_on_poll": "Akzeptieren Sie diese VOTE_ON_POLL -Transaktion? Umfragen sind öffentlich!", + "logout": "Sind Sie sicher, dass Sie sich abmelden möchten?", + "new_user": "Sind Sie ein neuer Benutzer?", + "delete_chat_image": "Möchten Sie Ihr vorheriges Chat -Bild löschen?", + "perform_transaction": "would you like to perform a {{action}} transaction?", + "provide_thread": "Bitte geben Sie einen Thread -Titel an", + "publish_app": "Möchten Sie diese App veröffentlichen?", + "publish_avatar": "Möchten Sie einen Avatar veröffentlichen?", + "publish_qdn": "Möchten Sie Ihre Einstellungen an QDN veröffentlichen (verschlüsselt)?", + "overwrite_changes": "Die App konnte Ihre vorhandenen QDN-Saved-Apps nicht herunterladen. Möchten Sie diese Änderungen überschreiben?", + "rate_app": "would you like to rate this app a rating of {{ rate }}?. It will create a POLL tx.", + "register_name": "Möchten Sie diesen Namen registrieren?", + "reset_pinned": "Mögen Sie Ihre aktuellen lokalen Änderungen nicht? Möchten Sie auf die standardmäßigen angestellten Apps zurücksetzen?", + "reset_qdn": "Mögen Sie Ihre aktuellen lokalen Änderungen nicht? Möchten Sie auf Ihre gespeicherten QDN -Apps zurücksetzen?", + "transfer_qort": "would you like to transfer {{ amount }} QORT" + }, + "success": { + "order_submitted": "Ihre Kaufbestellung wurde eingereicht", + "published": "erfolgreich veröffentlicht. Bitte warten Sie ein paar Minuten, bis das Netzwerk die Änderungen vorschreibt.", + "published_qdn": "erfolgreich in QDN veröffentlicht", + "rated_app": "erfolgreich bewertet. Bitte warten Sie ein paar Minuten, bis das Netzwerk die Änderungen vorschreibt.", + "request_read": "Ich habe diese Anfrage gelesen", + "transfer": "Die Übertragung war erfolgreich!", + "voted": "erfolgreich abgestimmt. Bitte warten Sie ein paar Minuten, bis das Netzwerk die Änderungen vorschreibt." + } + }, + "minting": { + "account_details": "Minting-Kontodetails", + "actions": "Minting-Aktionen", + "average_blocktime": "durchschnittliche Qortal-Blockzeit", + "average_blocks_per_day": "durchschnittliche Blöcke pro Tag", + "average_created_qorts_per_day": "durchschnittlich erstellte QORTs pro Tag", + "blockchain_statistics": "Blockchain-Statistiken", + "blocks_next_level": "Blöcke bis zum nächsten Level", + "current_level": "aktuelles Level", + "current_status": "aktueller Status", + "current_tier": "aktuelle Stufe", + "current_tier_content": "{{ tier }} (Stufe {{ levels }})", + "details": "Minting-Details", + "next_level": "Mit 24/7-Minting erreichst du Level {{ level }} in {{ count }} Tagen", + "rewards_info": "Informationen zu Minting-Belohnungen", + "reward_per_block": "geschätzte Belohnung pro Block", + "reward_per_day": "geschätzte Belohnung pro Tag", + "status": { + "minting": "(Prägung)", + "not_minting": "(nicht punktieren)", + "no_status": "kein Status", + "synchronized": "synchronisiert ({{ percent }}%)", + "synchronizing": "Synchronisierung ({{ percent }}%)..." + }, + "status_title": "Münzstatus", + "tier_share_per_block": "Stufenanteil pro Block", + "total_minter_in_tier": "Gesamtanzahl der Minter in dieser Stufe" + }, + "name": "Name", + "name_app": "Name/App", + "new_post_in": "new post in {{ title }}", + "none": "keiner", + "note": "Notiz", + "option": "Option", + "option_no": "Keine Optionen", + "option_other": "Optionen", + "page": { + "last": "zuletzt", + "first": "Erste", + "next": "nächste", + "previous": "vorherige" + }, + "payment_notification": "Zahlungsbenachrichtigung", + "payment": "Zahlung", + "poll_embed": "Umfrage Einbettung", + "port": "Hafen", + "price": "Preis", + "publish": "veröffentlichen", + "q_apps": { + "about": "über diese Q-App", + "q_mail": "Q-Mail", + "q_manager": "Q-Manager", + "q_sandbox": "q-sandbox", + "q_wallets": "q-wallets" + }, + "receiver": "Empfänger", + "sender": "Absender", + "server": "Server", + "service_type": "Service -Typ", + "settings": "Einstellungen", + "sort": { + "by_member": "von Mitglied" + }, + "supply": "liefern", + "tags": "Tags", + "theme": { + "dark": "dunkel", + "dark_mode": "Dunkler Modus", + "default": "Standardthema", + "light": "Licht", + "light_mode": "Lichtmodus", + "manager": "Themenmanager", + "name": "Themenname" + }, + "thread": "Faden", + "thread_other": "Themen", + "thread_title": "Threadtitel", + "time": { + "day_one": "{{count}} tag", + "day_other": "{{count}} tage", + "hour_one": "{{count}} Stunden", + "hour_other": "{{count}} Stunden", + "minute_one": "{{count}} Minute", + "minute_other": "{{count}} Minuten", + "time": "zeit" + }, + "title": "Titel", + "to": "Zu", + "tutorial": "Tutorial", + "url": "URL", + "user_lookup": "Benutzer suchen", + "vote": "Abstimmung", + "vote_other": "{{ count }} votes", + "zip": "Reißverschluss", + "wallet": { + "litecoin": "Litecoin -Brieftasche", + "qortal": "Qortal Wallet", + "wallet": "Geldbörse", + "wallet_other": "Brieftaschen" + }, + "website": "Webseite", + "welcome": "Willkommen" +} diff --git a/src/i18n/locales/de/group.json b/src/i18n/locales/de/group.json new file mode 100644 index 0000000..344b492 --- /dev/null +++ b/src/i18n/locales/de/group.json @@ -0,0 +1,163 @@ +{ + "action": { + "add_promotion": "Promotion hinzufügen", + "ban": "Mitglied aus Gruppe verbannen", + "cancel_ban": "Sperrung aufheben", + "copy_private_key": "Privaten Schlüssel kopieren", + "create_group": "Gruppe erstellen", + "disable_push_notifications": "Alle Push-Benachrichtigungen deaktivieren", + "export_password": "Passwort exportieren", + "export_private_key": "Privaten Schlüssel exportieren", + "find_group": "Gruppe finden", + "join_group": "Gruppe beitreten", + "kick_member": "Mitglied aus Gruppe entfernen", + "invite_member": "Mitglied einladen", + "leave_group": "Gruppe verlassen", + "load_members": "Mitglieder mit Namen laden", + "make_admin": "Zum Admin machen", + "manage_members": "Mitglieder verwalten", + "promote_group": "Gruppe für Nichtmitglieder bewerben", + "publish_announcement": "Ankündigung veröffentlichen", + "publish_avatar": "Avatar veröffentlichen", + "refetch_page": "Seite neu laden", + "remove_admin": "Adminrechte entziehen", + "remove_minting_account": "Minting-Konto entfernen", + "return_to_thread": "Zu Threads zurückkehren", + "scroll_bottom": "Zum Ende scrollen", + "scroll_unread_messages": "Zu ungelesenen Nachrichten scrollen", + "select_group": "Gruppe auswählen", + "visit_q_mintership": "Q-Mintership besuchen" + }, + "advanced_options": "Erweiterte Optionen", + "block_delay": { + "minimum": "Minimale Blockverzögerung", + "maximum": "Maximale Blockverzögerung" + }, + "group": { + "approval_threshold": "Genehmigungsschwelle der Gruppe", + "avatar": "Gruppenavatar", + "closed": "geschlossen (privat) – Benutzer benötigen Genehmigung zum Beitritt", + "description": "Gruppenbeschreibung", + "id": "Gruppen-ID", + "invites": "Gruppeneinladungen", + "group": "Gruppe", + "group_name": "Gruppe: {{ name }}", + "group_other": "Gruppen", + "groups_admin": "Gruppen, in denen du Admin bist", + "management": "Gruppenverwaltung", + "member_number": "Anzahl der Mitglieder", + "messaging": "Nachrichten", + "name": "Gruppenname", + "open": "offen (öffentlich)", + "private": "private Gruppe", + "promotions": "Gruppen-Promotionen", + "public": "öffentliche Gruppe", + "type": "Gruppentyp" + }, + "invitation_expiry": "Ablaufzeit der Einladung", + "invitees_list": "Einladungsliste", + "join_link": "Beitrittslink zur Gruppe", + "join_requests": "Beitrittsanfragen", + "last_message": "Letzte Nachricht", + "last_message_date": "Letzte Nachricht: {{date }}", + "latest_mails": "Neueste Q-Mails", + "message": { + "generic": { + "avatar_publish_fee": "Das Veröffentlichen eines Avatars kostet {{ fee }}", + "avatar_registered_name": "Ein registrierter Name ist erforderlich, um einen Avatar zu setzen", + "admin_only": "Nur Gruppen, in denen du Admin bist, werden angezeigt", + "already_in_group": "Du bist bereits in dieser Gruppe!", + "block_delay_minimum": "Minimale Blockverzögerung für Gruppen-Transaktionsfreigaben", + "block_delay_maximum": "Maximale Blockverzögerung für Gruppen-Transaktionsfreigaben", + "closed_group": "Dies ist eine geschlossene/private Gruppe. Du musst warten, bis ein Admin deine Anfrage akzeptiert", + "descrypt_wallet": "Wallet wird entschlüsselt...", + "encryption_key": "Der erste gemeinsame Verschlüsselungsschlüssel der Gruppe wird erstellt. Bitte warte einige Minuten...", + "group_announcement": "Gruppenankündigungen", + "group_approval_threshold": "Genehmigungsschwelle der Gruppe (Anzahl/Prozentsatz der Admins, die zustimmen müssen)", + "group_encrypted": "Gruppe verschlüsselt", + "group_invited_you": "{{group}} hat dich eingeladen", + "group_key_created": "Erster Gruppenschlüssel erstellt.", + "group_member_list_changed": "Mitgliederliste hat sich geändert. Bitte Verschlüsselungsschlüssel neu verschlüsseln.", + "group_no_secret_key": "Es gibt keinen geheimen Gruppenschlüssel. Sei der erste Admin, der einen veröffentlicht!", + "group_secret_key_no_owner": "Der letzte Gruppenschlüssel wurde von einem Nicht-Besitzer veröffentlicht. Bitte verschlüssle den Schlüssel als Eigentümer erneut.", + "invalid_content": "Ungültiger Inhalt, Absender oder Zeitstempel in Reaktionsdaten", + "invalid_data": "Fehler beim Laden der Inhalte: Ungültige Daten", + "latest_promotion": "Nur die neueste Promotion der Woche wird angezeigt", + "loading_members": "Mitgliederliste wird geladen... bitte warten.", + "max_chars": "Maximal 200 Zeichen. Veröffentlichungsgebühr", + "manage_minting": "Minting verwalten", + "minter_group": "Du bist derzeit nicht Teil der MINTER-Gruppe", + "mintership_app": "Besuche die Q-Mintership App, um dich als Minter zu bewerben", + "minting_account": "Minting-Konto:", + "minting_keys_per_node": "Nur 2 Minting-Schlüssel pro Node erlaubt. Bitte entferne einen.", + "minting_keys_per_node_different": "Nur 2 Minting-Schlüssel pro Node erlaubt. Entferne einen, um einen anderen hinzuzufügen.", + "node_minting_account": "Minting-Konten dieses Nodes", + "node_minting_key": "Du hast bereits einen Minting-Schlüssel für dieses Konto auf diesem Node", + "no_announcement": "Keine Ankündigungen", + "no_display": "Nichts anzuzeigen", + "no_selection": "Keine Gruppe ausgewählt", + "not_part_group": "Du bist nicht Teil der verschlüsselten Mitgliedergruppe. Bitte warte, bis ein Admin den Schlüssel neu verschlüsselt.", + "only_encrypted": "Nur unverschlüsselte Nachrichten werden angezeigt.", + "only_private_groups": "Nur private Gruppen werden angezeigt", + "pending_join_requests": "{{ group }} hat {{ count }} ausstehende Beitrittsanfragen", + "private_key_copied": "Privater Schlüssel kopiert", + "provide_message": "Bitte gib eine erste Nachricht für den Thread ein", + "secure_place": "Bewahre deinen privaten Schlüssel sicher auf. Nicht weitergeben!", + "setting_group": "Gruppe wird eingerichtet... bitte warten." + }, + "error": { + "access_name": "Nachricht kann nicht gesendet werden ohne Zugriff auf deinen Namen", + "descrypt_wallet": "Fehler beim Entschlüsseln der Wallet {{ message }}", + "description_required": "Bitte gib eine Beschreibung an", + "group_info": "Gruppeninformationen können nicht abgerufen werden", + "group_join": "Beitritt zur Gruppe fehlgeschlagen", + "group_promotion": "Fehler beim Veröffentlichen der Promotion. Bitte erneut versuchen", + "group_secret_key": "Gruppenschlüssel kann nicht abgerufen werden", + "name_required": "Bitte gib einen Namen an", + "notify_admins": "Benachrichtige einen Admin aus der Liste unten:", + "qortals_required": "Du brauchst mindestens {{ quantity }} QORT, um eine Nachricht zu senden", + "timeout_reward": "Zeitüberschreitung bei Bestätigung der Rewardshare", + "thread_id": "Thread-ID nicht gefunden", + "unable_determine_group_private": "Konnte nicht feststellen, ob Gruppe privat ist", + "unable_minting": "Minting konnte nicht gestartet werden" + }, + "success": { + "group_ban": "Mitglied erfolgreich verbannt. Änderungen können einige Minuten dauern", + "group_creation": "Gruppe erfolgreich erstellt. Änderungen können einige Minuten dauern", + "group_creation_name": "Gruppe {{group_name}} erstellt: Warte auf Bestätigung", + "group_creation_label": "Gruppe {{name}} erstellt: Erfolgreich!", + "group_invite": "{{invitee}} erfolgreich eingeladen. Änderungen können einige Minuten dauern", + "group_join": "Beitrittsanfrage erfolgreich gestellt. Änderungen können einige Minuten dauern", + "group_join_name": "Gruppe {{group_name}} beigetreten: Warte auf Bestätigung", + "group_join_label": "Gruppe {{name}} beigetreten: Erfolgreich!", + "group_join_request": "Beitrittsanfrage für Gruppe {{group_name}} gestellt: Warte auf Bestätigung", + "group_join_outcome": "Beitrittsanfrage für Gruppe {{group_name}} gestellt: Erfolgreich!", + "group_kick": "Mitglied erfolgreich entfernt. Änderungen können einige Minuten dauern", + "group_leave": "Gruppe erfolgreich verlassen. Änderungen können einige Minuten dauern", + "group_leave_name": "Gruppe {{group_name}} verlassen: Warte auf Bestätigung", + "group_leave_label": "Gruppe {{name}} verlassen: Erfolgreich!", + "group_member_admin": "Mitglied erfolgreich zum Admin gemacht. Änderungen können einige Minuten dauern", + "group_promotion": "Promotion erfolgreich veröffentlicht. Änderungen können einige Minuten dauern", + "group_remove_member": "Adminrechte erfolgreich entzogen. Änderungen können einige Minuten dauern", + "invitation_cancellation": "Einladung erfolgreich storniert. Änderungen können einige Minuten dauern", + "invitation_request": "Beitrittsanfrage akzeptiert: Warte auf Bestätigung", + "loading_threads": "Threads werden geladen... bitte warten.", + "post_creation": "Beitrag erfolgreich erstellt. Veröffentlichung kann einige Zeit dauern", + "published_secret_key": "Geheimer Gruppenschlüssel veröffentlicht für {{ group_id }}: Warte auf Bestätigung", + "published_secret_key_label": "Geheimer Gruppenschlüssel veröffentlicht für {{ group_id }}: Erfolgreich!", + "registered_name": "Erfolgreich registriert. Änderungen können einige Minuten dauern", + "registered_name_label": "Registrierter Name: Warte auf Bestätigung", + "registered_name_success": "Registrierter Name: Erfolgreich!", + "rewardshare_add": "Rewardshare hinzufügen: Warte auf Bestätigung", + "rewardshare_add_label": "Rewardshare hinzufügen: Erfolgreich!", + "rewardshare_creation": "Rewardshare wird auf der Blockchain bestätigt. Dies kann bis zu 90 Sekunden dauern.", + "rewardshare_confirmed": "Rewardshare bestätigt. Bitte klicke auf Weiter.", + "rewardshare_remove": "Rewardshare entfernen: Warte auf Bestätigung", + "rewardshare_remove_label": "Rewardshare entfernen: Erfolgreich!", + "thread_creation": "Thread erfolgreich erstellt. Veröffentlichung kann einige Zeit dauern", + "unbanned_user": "Benutzer erfolgreich entsperrt. Änderungen können einige Minuten dauern", + "user_joined": "Benutzer ist erfolgreich beigetreten!" + } + }, + "thread_posts": "Neue Thread-Beiträge" +} diff --git a/src/i18n/locales/de/question.json b/src/i18n/locales/de/question.json new file mode 100644 index 0000000..0c34477 --- /dev/null +++ b/src/i18n/locales/de/question.json @@ -0,0 +1,194 @@ +{ + "accept_app_fee": "App-Gebühr akzeptieren", + "always_authenticate": "immer automatisch authentifizieren", + "always_chat_messages": "immer Chatnachrichten von dieser App zulassen", + "always_retrieve_balance": "immer den Kontostand automatisch abrufen", + "always_retrieve_list": "immer Listen automatisch abrufen", + "always_retrieve_wallet": "immer Wallet automatisch abrufen", + "always_retrieve_wallet_transactions": "immer Wallet-Transaktionen automatisch abrufen", + "amount_qty": "Betrag: {{ quantity }}", + "asset_name": "Asset: {{ asset }}", + "assets_used_pay": "Zahlungsmittel: {{ asset }}", + "coin": "Münze: {{ coin }}", + "description": "Beschreibung: {{ description }}", + "deploy_at": "Möchten Sie dieses AT bereitstellen?", + "download_file": "Möchten Sie herunterladen:", + "message": { + "error": { + "add_to_list": "Fehler beim Hinzufügen zur Liste", + "at_info": "AT-Informationen konnten nicht gefunden werden.", + "buy_order": "Handelsauftrag konnte nicht übermittelt werden", + "cancel_sell_order": "Fehler beim Abbrechen des Verkaufsauftrags. Versuchen Sie es erneut!", + "copy_clipboard": "Fehler beim Kopieren in die Zwischenablage", + "create_sell_order": "Fehler beim Erstellen des Verkaufsauftrags. Versuchen Sie es erneut!", + "create_tradebot": "Handelsbot konnte nicht erstellt werden", + "decode_transaction": "Transaktion konnte nicht decodiert werden", + "decrypt": "Entschlüsselung nicht möglich", + "decrypt_message": "Nachricht konnte nicht entschlüsselt werden. Stellen Sie sicher, dass Daten und Schlüssel korrekt sind", + "decryption_failed": "Entschlüsselung fehlgeschlagen", + "empty_receiver": "Empfänger darf nicht leer sein!", + "encrypt": "Verschlüsselung nicht möglich", + "encryption_failed": "Verschlüsselung fehlgeschlagen", + "encryption_requires_public_key": "Zum Verschlüsseln werden öffentliche Schlüssel benötigt", + "fetch_balance_token": "Fehler beim Abrufen des {{ token }}-Saldos. Versuchen Sie es erneut!", + "fetch_balance": "Saldo konnte nicht abgerufen werden", + "fetch_connection_history": "Fehler beim Abrufen der Serververbindungshistorie", + "fetch_generic": "Daten konnten nicht abgerufen werden", + "fetch_group": "Gruppe konnte nicht abgerufen werden", + "fetch_list": "Liste konnte nicht abgerufen werden", + "fetch_poll": "Umfrage konnte nicht abgerufen werden", + "fetch_recipient_public_key": "Öffentlicher Schlüssel des Empfängers konnte nicht abgerufen werden", + "fetch_wallet_info": "Wallet-Informationen konnten nicht abgerufen werden", + "fetch_wallet_transactions": "Wallet-Transaktionen konnten nicht abgerufen werden", + "fetch_wallet": "Wallet konnte nicht abgerufen werden. Bitte erneut versuchen", + "file_extension": "Dateierweiterung konnte nicht ermittelt werden", + "gateway_balance_local_node": "{{ token }}-Saldo kann über das Gateway nicht angezeigt werden. Bitte lokalen Node verwenden.", + "gateway_non_qort_local_node": "Nicht-QORT-Coins können nicht über das Gateway gesendet werden. Bitte lokalen Node verwenden.", + "gateway_retrieve_balance": "Abruf des {{ token }}-Saldos über das Gateway nicht erlaubt", + "gateway_wallet_local_node": "{{ token }}-Wallet kann über das Gateway nicht angezeigt werden. Bitte lokalen Node verwenden.", + "get_foreign_fee": "Fehler beim Abrufen der externen Gebühr", + "insufficient_balance_qort": "Ihr QORT-Saldo ist unzureichend", + "insufficient_balance": "Ihr Asset-Saldo ist unzureichend", + "insufficient_funds": "Unzureichende Mittel", + "invalid_encryption_iv": "Ungültiger IV: AES-GCM erfordert einen 12-Byte-IV", + "invalid_encryption_key": "Ungültiger Schlüssel: AES-GCM erfordert einen 256-Bit-Schlüssel.", + "invalid_fullcontent": "Feld 'fullContent' hat ein ungültiges Format. Verwenden Sie String, base64 oder ein Objekt", + "invalid_receiver": "Ungültige Empfängeradresse oder Name", + "invalid_type": "Ungültiger Typ", + "mime_type": "mimeType konnte nicht bestimmt werden", + "missing_fields": "Fehlende Felder: {{ fields }}", + "name_already_for_sale": "Dieser Name wird bereits zum Verkauf angeboten", + "name_not_for_sale": "Dieser Name steht nicht zum Verkauf", + "no_api_found": "Keine nutzbare API gefunden", + "no_data_encrypted_resource": "Keine Daten in der verschlüsselten Ressource", + "no_data_file_submitted": "Keine Daten oder Datei eingereicht", + "no_group_found": "Gruppe nicht gefunden", + "no_group_key": "Kein Gruppenschlüssel gefunden", + "no_poll": "Umfrage nicht gefunden", + "no_resources_publish": "Keine Ressourcen zum Veröffentlichen vorhanden", + "node_info": "Knoteninformationen konnten nicht abgerufen werden", + "node_status": "Knotenstatus konnte nicht abgerufen werden", + "only_encrypted_data": "Nur verschlüsselte Daten sind für private Dienste zulässig", + "perform_request": "Anfrage konnte nicht ausgeführt werden", + "poll_create": "Umfrage konnte nicht erstellt werden", + "poll_vote": "Abstimmung zur Umfrage fehlgeschlagen", + "process_transaction": "Transaktion konnte nicht verarbeitet werden", + "provide_key_shared_link": "Für verschlüsselte Ressourcen müssen Sie den Schlüssel für den Freigabelink angeben", + "registered_name": "Ein registrierter Name ist für die Veröffentlichung erforderlich", + "resources_publish": "Einige Ressourcen konnten nicht veröffentlicht werden", + "retrieve_file": "Datei konnte nicht abgerufen werden", + "retrieve_keys": "Schlüssel konnten nicht abgerufen werden", + "retrieve_summary": "Zusammenfassung konnte nicht abgerufen werden", + "retrieve_sync_status": "Fehler beim Abrufen des Synchronisierungsstatus von {{ token }}", + "same_foreign_blockchain": "Alle angeforderten ATs müssen auf derselben Blockchain basieren.", + "send": "Senden fehlgeschlagen", + "server_current_add": "Aktueller Server konnte nicht hinzugefügt werden", + "server_current_set": "Aktueller Server konnte nicht gesetzt werden", + "server_info": "Fehler beim Abrufen der Serverinformationen", + "server_remove": "Server konnte nicht entfernt werden", + "submit_sell_order": "Verkaufsauftrag konnte nicht übermittelt werden", + "synchronization_attempts": "Synchronisierung nach {{ quantity }} Versuchen fehlgeschlagen", + "timeout_request": "Zeitüberschreitung bei der Anfrage", + "token_not_supported": "{{ token }} wird für diesen Aufruf nicht unterstützt", + "transaction_activity_summary": "Fehler in der Zusammenfassung der Transaktionsaktivität", + "unknown_error": "Unbekannter Fehler", + "unknown_admin_action_type": "Unbekannter Admin-Aktionstyp: {{ type }}", + "update_foreign_fee": "Externe Gebühr konnte nicht aktualisiert werden", + "update_tradebot": "Tradebot konnte nicht aktualisiert werden", + "upload_encryption": "Upload fehlgeschlagen wegen Verschlüsselungsfehler", + "upload": "Upload fehlgeschlagen", + "use_private_service": "Für verschlüsselte Veröffentlichungen nutzen Sie bitte einen Dienst mit Endung _PRIVATE", + "user_qortal_name": "Benutzer hat keinen Qortal-Namen", + "max_size_publish": "Maximale Dateigröße pro Datei beträgt {{size}} GB.", + "max_size_publish_public": "Maximale Dateigröße auf dem öffentlichen Node beträgt {{size}} MB. Bitte lokalen Node für größere Dateien verwenden." + }, + "generic": { + "calculate_fee": "*Die Gebühr von {{ amount }} Sats basiert auf {{ rate }} Sats pro KB, bei einer geschätzten Transaktionsgröße von 300 Byte.", + "confirm_join_group": "Beitritt zur Gruppe bestätigen:", + "include_data_decrypt": "Bitte Daten zum Entschlüsseln angeben", + "include_data_encrypt": "Bitte Daten zum Verschlüsseln angeben", + "max_retry_transaction": "Maximale Anzahl an Versuchen erreicht. Transaktion wird übersprungen.", + "no_action_public_node": "Diese Aktion kann nicht über einen öffentlichen Node ausgeführt werden", + "private_service": "Bitte verwenden Sie einen privaten Dienst", + "provide_group_id": "Bitte groupId angeben", + "read_transaction_carefully": "Bitte lesen Sie die Transaktion sorgfältig, bevor Sie sie akzeptieren!", + "user_declined_add_list": "Benutzer hat das Hinzufügen zur Liste abgelehnt", + "user_declined_delete_from_list": "Benutzer hat das Löschen aus der Liste abgelehnt", + "user_declined_delete_hosted_resources": "Benutzer hat das Löschen gehosteter Ressourcen abgelehnt", + "user_declined_join": "Benutzer hat den Gruppenbeitritt abgelehnt", + "user_declined_list": "Benutzer hat das Abrufen der gehosteten Ressourcenliste abgelehnt", + "user_declined_request": "Benutzer hat die Anfrage abgelehnt", + "user_declined_save_file": "Benutzer hat das Speichern der Datei abgelehnt", + "user_declined_send_message": "Benutzer hat das Senden der Nachricht abgelehnt", + "user_declined_share_list": "Benutzer hat das Teilen der Liste abgelehnt" + } + }, + "name": "Name: {{ name }}", + "option": "Option: {{ option }}", + "options": "Optionen: {{ optionList }}", + "permission": { + "access_list": "Möchten Sie dieser Anwendung die Berechtigung geben, auf die Liste zuzugreifen?", + "add_admin": "Möchten Sie dieser Anwendung die Berechtigung geben, den Benutzer {{ invitee }} als Administrator hinzuzufügen?", + "all_item_list": "Möchten Sie dieser Anwendung die Berechtigung geben, Folgendes zur Liste {{ name }} hinzuzufügen:", + "authenticate": "Möchten Sie dieser Anwendung die Berechtigung zur Authentifizierung geben?", + "ban": "Möchten Sie dieser Anwendung die Berechtigung geben, {{ partecipant }} aus der Gruppe zu verbannen?", + "buy_name_detail": "{{ name }} für {{ price }} QORT kaufen", + "buy_name": "Möchten Sie dieser Anwendung die Berechtigung geben, einen Namen zu kaufen?", + "buy_order_fee_estimation_one": "Diese Gebühr ist eine Schätzung basierend auf {{ count }} Auftrag mit einer Größe von ca. 300 Byte und einem Satz von {{ fee }} {{ ticker }} pro KB.", + "buy_order_fee_estimation_other": "Diese Gebühr ist eine Schätzung basierend auf {{ count }} Aufträgen mit einer Größe von ca. 300 Byte und einem Satz von {{ fee }} {{ ticker }} pro KB.", + "buy_order_per_kb": "{{ fee }} {{ ticker }} pro KB", + "buy_order_quantity_one": "{{ count }} Kaufauftrag", + "buy_order_quantity_other": "{{ count }} Kaufaufträge", + "buy_order_ticker": "{{ qort_amount }} QORT für {{ foreign_amount }} {{ ticker }}", + "buy_order": "Möchten Sie dieser Anwendung die Berechtigung geben, einen Kaufauftrag auszuführen?", + "cancel_ban": "Möchten Sie dieser Anwendung die Berechtigung geben, das Gruppenverbot für Benutzer {{ partecipant }} aufzuheben?", + "cancel_group_invite": "Möchten Sie dieser Anwendung die Berechtigung geben, die Gruppeneinladung für {{ invitee }} zu stornieren?", + "cancel_sell_order": "Möchten Sie dieser Anwendung die Berechtigung geben, einen Verkaufsauftrag zu stornieren?", + "create_group": "Möchten Sie dieser Anwendung die Berechtigung geben, eine Gruppe zu erstellen?", + "delete_hosts_resources": "Möchten Sie dieser Anwendung die Berechtigung geben, {{ size }} gehostete Ressourcen zu löschen?", + "fetch_balance": "Möchten Sie dieser Anwendung die Berechtigung geben, Ihren {{ coin }}-Kontostand abzurufen?", + "get_wallet_info": "Möchten Sie dieser Anwendung die Berechtigung geben, Ihre Wallet-Informationen abzurufen?", + "get_wallet_transactions": "Möchten Sie dieser Anwendung die Berechtigung geben, Ihre Wallet-Transaktionen abzurufen?", + "invite": "Möchten Sie dieser Anwendung die Berechtigung geben, {{ invitee }} einzuladen?", + "kick": "Möchten Sie dieser Anwendung die Berechtigung geben, {{ partecipant }} aus der Gruppe zu entfernen?", + "leave_group": "Möchten Sie dieser Anwendung die Berechtigung geben, die folgende Gruppe zu verlassen?", + "list_hosted_data": "Möchten Sie dieser Anwendung die Berechtigung geben, eine Liste Ihrer gehosteten Daten abzurufen?", + "order_detail": "{{ qort_amount }} QORT für {{ foreign_amount }} {{ ticker }}", + "pay_publish": "Möchten Sie dieser Anwendung die Berechtigung geben, die folgenden Zahlungen und Veröffentlichungen vorzunehmen?", + "perform_admin_action_with_value": "mit Wert: {{ value }}", + "perform_admin_action": "Möchten Sie dieser Anwendung die Berechtigung geben, die Admin-Aktion {{ type }} auszuführen?", + "publish_qdn": "Möchten Sie dieser Anwendung die Berechtigung geben, auf QDN zu veröffentlichen?", + "register_name": "Möchten Sie dieser Anwendung die Berechtigung geben, diesen Namen zu registrieren?", + "remove_admin": "Möchten Sie dieser Anwendung die Berechtigung geben, den Benutzer {{ partecipant }} als Administrator zu entfernen?", + "remove_from_list": "Möchten Sie dieser Anwendung die Berechtigung geben, Folgendes aus der Liste {{ name }} zu entfernen:", + "sell_name_cancel": "Möchten Sie dieser Anwendung die Berechtigung geben, den Verkauf eines Namens abzubrechen?", + "sell_name_transaction_detail": "{{ name }} für {{ price }} QORT verkaufen", + "sell_name_transaction": "Möchten Sie dieser Anwendung die Berechtigung geben, eine Verkaufs-Transaktion für einen Namen zu erstellen?", + "sell_order": "Möchten Sie dieser Anwendung die Berechtigung geben, einen Verkaufsauftrag auszuführen?", + "send_chat_message": "Möchten Sie dieser Anwendung die Berechtigung geben, diese Chat-Nachricht zu senden?", + "send_coins": "Möchten Sie dieser Anwendung die Berechtigung geben, Coins zu senden?", + "server_add": "Möchten Sie dieser Anwendung die Berechtigung geben, einen Server hinzuzufügen?", + "server_remove": "Möchten Sie dieser Anwendung die Berechtigung geben, einen Server zu entfernen?", + "set_current_server": "Möchten Sie dieser Anwendung die Berechtigung geben, den aktuellen Server festzulegen?", + "sign_fee": "Möchten Sie dieser Anwendung die Berechtigung geben, die erforderlichen Gebühren für all Ihre Handelsangebote zu signieren?", + "sign_process_transaction": "Möchten Sie dieser Anwendung die Berechtigung geben, eine Transaktion zu signieren und zu verarbeiten?", + "sign_transaction": "Möchten Sie dieser Anwendung die Berechtigung geben, eine Transaktion zu signieren?", + "transfer_asset": "Möchten Sie dieser Anwendung die Berechtigung geben, das folgende Asset zu übertragen?", + "update_foreign_fee": "Möchten Sie dieser Anwendung die Berechtigung geben, die externen Gebühren auf Ihrem Node zu aktualisieren?", + "update_group_detail": "neuer Besitzer: {{ owner }}", + "update_group": "Möchten Sie dieser Anwendung die Berechtigung geben, diese Gruppe zu aktualisieren?" + }, + "poll": "Abstimmung: {{ name }}", + "provide_recipient_group_id": "Bitte geben Sie einen Empfänger oder groupId an", + "request_create_poll": "Sie beantragen, die folgende Abstimmung zu erstellen:", + "request_vote_poll": "Sie werden gebeten, über die folgende Abstimmung abzustimmen:", + "sats_per_kb": "{{ amount }} Sats pro KB", + "sats": "{{ amount }} Sats", + "server_host": "Host: {{ host }}", + "server_type": "Typ: {{ type }}", + "to_group": "an: Gruppe {{ group_id }}", + "to_recipient": "an: {{ recipient }}", + "total_locking_fee": "Gesamte Sperrgebühr:", + "total_unlocking_fee": "Gesamte Entsperrgebühr:", + "value": "Wert: {{ value }}" +} diff --git a/src/i18n/locales/de/tutorial.json b/src/i18n/locales/de/tutorial.json new file mode 100644 index 0000000..816ce4f --- /dev/null +++ b/src/i18n/locales/de/tutorial.json @@ -0,0 +1,21 @@ +{ + "1_getting_started": "1. Erste Schritte", + "2_overview": "2. Überblick", + "3_groups": "3. Qortal-Gruppen", + "4_obtain_qort": "4. QORT erhalten", + "account_creation": "Kontoerstellung", + "important_info": "wichtige Informationen", + "apps": { + "dashboard": "1. App-Dashboard", + "navigation": "2. App-Navigation" + }, + "initial": { + "recommended_qort_qty": "mindestens {{ quantity }} QORT im Wallet haben", + "explore": "entdecken", + "general_chat": "Allgemeiner Chat", + "getting_started": "Erste Schritte", + "register_name": "einen Namen registrieren", + "see_apps": "Apps ansehen", + "trade_qort": "QORT handeln" + } +} diff --git a/src/i18n/locales/en/auth.json b/src/i18n/locales/en/auth.json new file mode 100644 index 0000000..a128a3d --- /dev/null +++ b/src/i18n/locales/en/auth.json @@ -0,0 +1,138 @@ +{ + "account": { + "your": "your account", + "account_many": "accounts", + "account_one": "account", + "selected": "selected account" + }, + "action": { + "add": { + "account": "add account", + "seed_phrase": "add seed-phrase" + }, + "authenticate": "authenticate", + "block": "block", + "block_all": "block all", + "block_data": "block QDN data", + "block_name": "block name", + "block_txs": "block tsx", + "fetch_names": "fetch names", + "copy_address": "copy address", + "create_account": "create account", + "create_qortal_account": "create your Qortal account by clicking NEXT below.", + "choose_password": "choose new password", + "download_account": "download account", + "enter_amount": "please enter an amount greater than 0", + "enter_recipient": "please enter a recipient", + "enter_wallet_password": "please enter your wallet password", + "export_seedphrase": "export Seedphrase", + "insert_name_address": "please insert a name or address", + "publish_admin_secret_key": "publish admin secret key", + "publish_group_secret_key": "publish group secret key", + "reencrypt_key": "re-encrypt key", + "return_to_list": "return to list", + "setup_qortal_account": "set up your Qortal account", + "unblock": "unblock", + "unblock_name": "unblock name" + }, + "address": "address", + "address_name": "address or name", + "advanced_users": "for advanced users", + "apikey": { + "alternative": "alternative: File select", + "change": "change APIkey", + "enter": "enter APIkey", + "import": "import APIkey", + "key": "API key", + "select_valid": "select a valid apikey" + }, + "authentication": "authentication", + "blocked_users": "blocked users", + "build_version": "build version", + "message": { + "error": { + "account_creation": "could not create account.", + "address_not_existing": "address does not exist on blockchain", + "block_user": "unable to block user", + "create_simmetric_key": "cannot create symmetric key", + "decrypt_data": "could not decrypt data", + "decrypt": "unable to decrypt", + "encrypt_content": "cannot encrypt content", + "fetch_user_account": "unable to fetch user account", + "field_not_found_json": "{{ field }} not found in JSON", + "find_secret_key": "cannot find correct secretKey", + "incorrect_password": "incorrect password", + "invalid_qortal_link": "invalid qortal link", + "invalid_secret_key": "secretKey is not valid", + "invalid_uint8": "the Uint8ArrayData you've submitted is invalid", + "name_not_existing": "name does not exist", + "name_not_registered": "name not registered", + "read_blob_base64": "failed to read the Blob as a base64-encoded string", + "reencrypt_secret_key": "unable to re-encrypt secret key", + "set_apikey": "failed to set API key:" + }, + "generic": { + "blocked_addresses": "blocked addresses- blocks processing of txs", + "blocked_names": "blocked names for QDN", + "blocking": "blocking {{ name }}", + "choose_block": "choose 'block txs' or 'all' to block chat messages", + "congrats_setup": "congrats, you’re all set up!", + "decide_block": "decide what to block", + "downloading_encryption_keys": "downloading encryption keys", + "fetching_admin_secret_key": "fetching Admins secret key", + "fetching_group_secret_key": "fetching Group secret key publishes", + "keep_secure": "keep your account file secure", + "last_encryption_date": "last encryption date: {{ date }} by {{ name }}", + "locating_encryption_keys": "locating encryption keys", + "name_address": "name or address", + "no_account": "no accounts saved", + "no_minimum_length": "there is no minimum length requirement", + "no_secret_key_published": "no secret key published yet", + "publishing_key": "reminder: After publishing the key, it will take a couple of minutes for it to appear. Please just wait.", + "seedphrase_notice": "a SEEDPHRASE has been randomly generated in the background.", + "turn_local_node": "please turn on your local node", + "type_seed": "type or paste in your seed-phrase", + "your_accounts": "your saved accounts" + }, + "success": { + "reencrypted_secret_key": "successfully re-encrypted secret key. It may take a couple of minutes for the changes to propagate. Refresh the group in 5 mins." + } + }, + "node": { + "choose": "choose custom node", + "custom_many": "custom nodes", + "use_custom": "use custom node", + "use_local": "use local node", + "using": "using node", + "using_public": "using public node", + "using_public_gateway": "using public node: {{ gateway }}" + }, + "note": "note", + "password": "password", + "password_confirmation": "confirm password", + "seed_phrase": "seed phrase", + "seed_your": "your seedphrase", + "tips": { + "additional_wallet": "use this option to connect additional Qortal wallets you've already made, in order to login with them afterwards. You will need access to your backup JSON file in order to do so.", + "digital_id": "your wallet is like your digital ID on Qortal, and is how you will login to the Qortal User Interface. It holds your public address and the Qortal name you will eventually choose. Every transaction you make is linked to your ID, and this is where you manage all your QORT and other tradeable cryptocurrencies on Qortal.", + "existing_account": "already have a Qortal account? Enter your secret backup phrase here to access it. This phrase is one of the ways to recover your account.", + "key_encrypt_admin": "this key is to encrypt ADMIN related content. Only admins would see content encrypted with it.", + "key_encrypt_group": "this key is to encrypt GROUP related content. This is the only one used in this UI as of now. All group members will be able to see content encrypted with this key.", + "new_account": "creating an account means creating a new wallet and digital ID to start using Qortal. Once you have made your account, you can start doing things like obtaining some QORT, buying a name and avatar, publishing videos and blogs, and much more.", + "new_users": "new users start here!", + "safe_place": "save your account in a place where you will remember it!", + "view_seedphrase": "if you wish to VIEW THE SEEDPHRASE, click the word 'SEEDPHRASE' in this text. Seedphrases are used to generate the private key for your Qortal account. For security by default, seedphrases are NOT displayed unless specifically chosen.", + "wallet_secure": "keep your wallet file secure." + }, + "wallet": { + "password_confirmation": "confirm wallet password", + "password": "wallet password", + "keep_password": "keep current password", + "new_password": "new password", + "error": { + "missing_new_password": "please enter a new password", + "missing_password": "please enter your password" + } + }, + "welcome": "welcome to" +} diff --git a/src/i18n/locales/en/core.json b/src/i18n/locales/en/core.json new file mode 100644 index 0000000..b77d493 --- /dev/null +++ b/src/i18n/locales/en/core.json @@ -0,0 +1,422 @@ +{ + "action": { + "accept": "accept", + "access": "access", + "access_app": "access app", + "add": "add", + "add_custom_framework": "add custom framework", + "add_reaction": "add reaction", + "add_theme": "add theme", + "backup_account": "backup account", + "backup_wallet": "backup wallet", + "cancel": "cancel", + "cancel_invitation": "cancel invitation", + "change": "change", + "change_avatar": "change avatar", + "change_file": "change file", + "change_language": "change language", + "choose": "choose", + "choose_file": "choose file", + "choose_image": "choose image", + "choose_logo": "choose a logo", + "choose_name": "choose a name", + "close": "close", + "close_chat": "close Direct Chat", + "continue": "continue", + "continue_logout": "continue to logout", + "copy_link": "copy link", + "create_apps": "create apps", + "create_file": "create file", + "create_transaction": "create transactions on the Qortal Blockchain", + "create_thread": "create thread", + "decline": "decline", + "decrypt": "decrypt", + "disable_enter": "disable enter", + "download": "download", + "download_file": "download file", + "edit": "edit", + "edit_theme": "edit theme", + "enable_dev_mode": "enable dev mode", + "enter_name": "enter a name", + "export": "export", + "get_qort": "get QORT", + "get_qort_trade": "get QORT at Q-Trade", + "hide": "hide", + "hide_qr_code": "hide QR code", + "import": "import", + "import_theme": "import theme", + "invite": "invite", + "invite_member": "invite new member", + "join": "join", + "leave_comment": "leave comment", + "load_announcements": "load older announcements", + "login": "login", + "logout": "logout", + "new": { + "chat": "new chat", + "post": "new post", + "theme": "new theme", + "thread": "new thread" + }, + "notify": "notify", + "open": "open", + "pin": "pin", + "pin_app": "pin app", + "pin_from_dashboard": "pin from dashboard", + "post": "post", + "post_message": "post message", + "publish": "publish", + "publish_app": "publish your app", + "publish_comment": "publish comment", + "refresh": "refresh", + "register_name": "register name", + "remove": "remove", + "remove_reaction": "remove reaction", + "return_apps_dashboard": "return to Apps Dashboard", + "save": "save", + "save_disk": "save to disk", + "search": "search", + "search_apps": "search for apps", + "search_groups": "search for groups", + "search_chat_text": "search chat text", + "see_qr_code": "see QR code", + "select_app_type": "select App Type", + "select_category": "select Category", + "select_name_app": "select Name/App", + "send": "send", + "send_qort": "send QORT", + "set_avatar": "set avatar", + "show": "show", + "show_poll": "show poll", + "start_minting": "start minting", + "start_typing": "start typing here...", + "trade_qort": "trade QORT", + "transfer_qort": "transfer QORT", + "unpin": "unpin", + "unpin_app": "unpin app", + "unpin_from_dashboard": "unpin from dashboard", + "update": "update", + "update_app": "update your app", + "vote": "vote" + }, + "address_your": "your address", + "admin": "admin", + "admin_other": "admins", + "all": "all", + "amount": "amount", + "announcement": "announcement", + "announcement_other": "announcements", + "api": "API", + "app": "app", + "app_other": "apps", + "app_name": "app name", + "app_private": "private", + "app_service_type": "app service type", + "apps_dashboard": "apps Dashboard", + "apps_official": "official Apps", + "attachment": "attachment", + "balance": "balance:", + "category": "category", + "category_other": "categories", + "chat": "chat", + "comment_other": "comments", + "contact_other": "contacts", + "core": { + "block_height": "block height", + "information": "core information", + "peers": "connected peers", + "version": "core version" + }, + "current_language": "current language: {{ language }}", + "dev": "dev", + "dev_mode": "dev Mode", + "domain": "domain", + "ui": { + "version": "uI version" + }, + "count": { + "none": "none", + "one": "one" + }, + "description": "description", + "devmode_apps": "dev Mode Apps", + "directory": "directory", + "downloading_qdn": "downloading from QDN", + "fee": { + "payment": "payment fee", + "publish": "publish fee" + }, + "for": "for", + "general": "general", + "general_settings": "general settings", + "home": "home", + "identifier": "identifier", + "image_embed": "image embed", + "last_height": "last height", + "level": "level", + "library": "library", + "list": { + "bans": "list of bans", + "groups": "list of groups", + "invites": "list of invites", + "join_request": "join request list", + "member": "member list", + "members": "list of members" + }, + "loading": { + "announcements": "loading announcements", + "generic": "loading...", + "chat": "loading chat... please wait.", + "comments": "loading comments... please wait.", + "posts": "loading posts... please wait." + }, + "member": "member", + "member_other": "members", + "message_us": "please message us on Nextcloud (no signup required) or Discord if you need 4 QORT to start chatting without any limitations", + "message": { + "error": { + "address_not_found": "your address was not found", + "app_need_name": "your app needs a name", + "build_app": "unable to build private app", + "decrypt_app": "unable to decrypt private app'", + "download_image": "unable to download IMAGE. Please try again later by clicking the refresh button", + "download_private_app": "unable to download private app", + "encrypt_app": "unable to encrypt app. App not published'", + "fetch_app": "unable to fetch app", + "fetch_publish": "unable to fetch publish", + "file_too_large": "file {{ filename }} is too large. Max size allowed is {{ size }} MB.", + "generic": "an error occurred", + "initiate_download": "failed to initiate download", + "invalid_amount": "invalid amount", + "invalid_base64": "invalid base64 data", + "invalid_embed_link": "invalid embed link", + "invalid_image_embed_link_name": "invalid image embed link. Missing param.", + "invalid_poll_embed_link_name": "invalid poll embed link. Missing name.", + "invalid_signature": "invalid signature", + "invalid_theme_format": "invalid theme format", + "invalid_zip": "invalid zip", + "message_loading": "error loading message.", + "message_size": "your message size is of {{ size }} bytes out of a maximum of {{ maximum }}", + "minting_account_add": "unable to add minting account", + "minting_account_remove": "unable to remove minting account", + "missing_fields": "missing: {{ fields }}", + "navigation_timeout": "navigation timeout", + "network_generic": "network error", + "password_not_matching": "password fields do not match!", + "password_wrong": "unable to authenticate. Wrong password", + "publish_app": "unable to publish app", + "publish_image": "unable to publish image", + "rate": "unable to rate", + "rating_option": "cannot find rating option", + "save_qdn": "unable to save to QDN", + "send_failed": "failed to send", + "update_failed": "failed to update", + "vote": "unable to vote" + }, + "generic": { + "already_voted": "you've already voted.", + "avatar_size": "{{ size }} KB max. for GIFS", + "benefits_qort": "benefits of having QORT", + "building_app": "building app", + "building": "building", + "buy_order_request": "the Application
{{hostname}}
is requesting {{count}} buy order", + "buy_order_request_other": "the Application
{{hostname}}
is requesting {{count}} buy orders", + "confirmed": "confirmed", + "created_by": "created by {{ owner }}", + "devmode_local_node": "please use your local node for dev mode! Logout and use Local node.", + "downloading_decrypting_app": "downloading and decrypting private app.", + "downloading": "downloading", + "edited": "edited", + "editing_message": "editing message", + "encrypted_not": "not encrypted", + "encrypted": "encrypted", + "fee_qort": "fee: {{ message }} QORT", + "fetching_data": "fetching app data", + "foreign_fee": "foreign fee: {{ message }}", + "get_qort_trade_portal": "get QORT using Qortal's crosschain trade portal", + "mentioned": "mentioned", + "message_with_image": "this message already has an image", + "minimal_qort_balance": "having at least {{ quantity }} QORT in your balance (4 qort balance for chat, 1.25 for name, 0.75 for some transactions)", + "most_recent_payment": "{{ count }} most recent payment", + "name_available": "{{ name }} is available", + "name_benefits": "benefits of a name", + "name_checking": "checking if name already exists", + "name_preview": "you need a name to use preview", + "name_publish": "you need a Qortal name to publish", + "name_rate": "you need a name to rate.", + "name_registration": "your balance is {{ balance }} QORT. A name registration requires a {{ fee }} QORT fee", + "name_unavailable": "{{ name }} is unavailable", + "no_data_image": "no data for image", + "no_description": "no description", + "no_messages": "no messages", + "no_message": "no message", + "no_minting_details": "cannot view minting details on the gateway", + "no_notifications": "no new notifications", + "no_payments": "no payments", + "no_pinned_changes": "you currently do not have any changes to your pinned apps", + "no_results": "no results", + "one_app_per_name": "note: Currently, only one App and Website is allowed per Name.", + "ongoing_transactions": "ongoing transactions", + "opened": "opened", + "overwrite_qdn": "overwrite to QDN", + "password_confirm": "please confirm a password", + "password_enter": "please enter a password", + "payment_request": "the Application
{{hostname}}
is requesting a payment", + "people_reaction": "people who reacted with {{ reaction }}", + "processing_transaction": "is processing transaction, please wait...", + "publish_data": "publish data to Qortal: anything from apps to videos. Fully decentralized!", + "publishing": "publishing... Please wait.", + "qdn": "use QDN saving", + "rating": "rating for {{ service }} {{ name }}", + "register_name": "you need a registered Qortal name to save your pinned apps to QDN.", + "replied_to": "replied to {{ person }}", + "revert_default": "revert to default", + "revert_qdn": "revert to QDN", + "save_qdn": "save to QDN", + "secure_ownership": "secure ownership of data published by your name. You can even sell your name, along with your data to a third party.", + "select_file": "please select a file", + "select_image": "please select an image for a logo", + "select_zip": "select .zip file containing static content:", + "sending": "sending...", + "settings": "you are using the export/import way of saving settings.", + "space_for_admins": "sorry, this space is only for Admins.", + "unread_messages": "unread messages below", + "unsaved_changes": "you have unsaved changes to your pinned apps. Save them to QDN.", + "updating": "updating", + "wait": "please wait" + }, + "message": "message", + "promotion_text": "promotion text", + "question": { + "accept_vote_on_poll": "do you accept this VOTE_ON_POLL transaction? POLLS are public!", + "logout": "are you sure you would like to logout?", + "new_user": "are you a new user?", + "delete_chat_image": "would you like to delete your previous chat image?", + "perform_transaction": "would you like to perform a {{action}} transaction?", + "provide_thread": "please provide a thread title", + "publish_app": "would you like to publish this app?", + "publish_avatar": "would you like to publish an avatar?", + "publish_qdn": "would you like to publish your settings to QDN (encrypted)?", + "overwrite_changes": "the app was unable to download your existing QDN-saved pinned apps. Would you like to overwrite those changes?", + "rate_app": "would you like to rate this app a rating of {{ rate }}?. It will create a POLL tx.", + "register_name": "would you like to register this name?", + "reset_pinned": "don't like your current local changes? Would you like to reset to the default pinned apps?", + "reset_qdn": "don't like your current local changes? Would you like to reset to your saved QDN pinned apps?", + "transfer_qort": "would you like to transfer {{ amount }} QORT" + }, + + "success": { + "order_submitted": "your buy order was submitted", + "published": "successfully published. Please wait a couple minutes for the network to propogate the changes.", + "published_qdn": "successfully published to QDN", + "rated_app": "successfully rated. Please wait a couple minutes for the network to propogate the changes.", + "request_read": "i have read this request", + "transfer": "the transfer was succesful!", + "voted": "successfully voted. Please wait a couple minutes for the network to propogate the changes." + } + }, + "minting": { + "account_details": "minting account details", + "actions": "minting actions", + "average_blocktime": "average qortal blocktime", + "average_blocks_per_day": "average blocks per day", + "average_created_qorts_per_day": "average created QORT per day", + "blockchain_statistics": "blockchain statistics", + "blocks_next_level": "blocks to nexl level", + "current_level": "current level", + "current_status": "current status", + "current_tier": "current tier", + "current_tier_content": "{{ tier }} (Levels {{ levels }})", + "details": "minting details", + "next_level": "with a 24/7 minting you will reach level {{ level }} in {{ count }} days", + "rewards_info": "minting rewards info", + "reward_per_block": "estimated reward per block", + "reward_per_day": "estimated reward per day", + "status": { + "minting": "(minting)", + "not_minting": "(not minting)", + "no_status": "no status", + "synchronized": "synchronized ({{ percent }}%)", + "synchronizing": "synchronizing ({{ percent }}%)..." + }, + "status_title": "minting status", + "tier_share_per_block": "tier share per block", + "total_minter_in_tier": "total minters in the tier" + }, + "name": "name", + "name_app": "name/App", + "new_post_in": "new post in {{ title }}", + "none": "none", + "note": "note", + "option": "option", + "option_no": "no options", + "option_other": "options", + "page": { + "last": "last", + "first": "first", + "next": "next", + "previous": "previous" + }, + "payment_notification": "payment notification", + "payment": "payment", + "poll_embed": "poll embed", + "port": "port", + "price": "price", + "publish": "publish", + "q_apps": { + "about": "about this Q-App", + "q_mail": "q-mail", + "q_manager": "q-manager", + "q_sandbox": "q-Sandbox", + "q_wallets": "q-Wallets" + }, + "receiver": "receiver", + "sender": "sender", + "server": "server", + "service_type": "service type", + "settings": "settings", + "sort": { + "by_member": "by member" + }, + "supply": "supply", + "tags": "tags", + "theme": { + "dark": "dark", + "dark_mode": "dark mode", + "default": "default theme", + "light": "light", + "light_mode": "light mode", + "manager": "theme Manager", + "name": "theme name" + }, + "thread": "thread", + "thread_other": "threads", + "thread_title": "thread title", + "time": { + "day_one": "{{count}} day", + "day_other": "{{count}} days", + "hour_one": "{{count}} hour", + "hour_other": "{{count}} hours", + "minute_one": "{{count}} minute", + "minute_other": "{{count}} minutes", + "second_one": "{{count}} second", + "second_other": "{{count}} seconds", + "time": "time" + }, + "title": "title", + "to": "to", + "tutorial": "tutorial", + "url": "url", + "user_lookup": "user lookup", + "vote": "vote", + "vote_other": "{{ count }} votes", + "zip": "zip", + "wallet": { + "litecoin": "litecoin wallet", + "qortal": "qortal wallet", + "wallet": "wallet", + "wallet_other": "wallets" + }, + "website": "website", + "welcome": "welcome" +} diff --git a/src/i18n/locales/en/group.json b/src/i18n/locales/en/group.json new file mode 100644 index 0000000..4dfc636 --- /dev/null +++ b/src/i18n/locales/en/group.json @@ -0,0 +1,163 @@ +{ + "action": { + "add_promotion": "add promotion", + "ban": "ban member from group", + "cancel_ban": "cancel ban", + "copy_private_key": "copy private key", + "create_group": "create group", + "disable_push_notifications": "disable all push notifications", + "export_password": "export password", + "export_private_key": "export private key", + "find_group": "find group", + "join_group": "join group", + "kick_member": "kick member from group", + "invite_member": "invite member", + "leave_group": "leave group", + "load_members": "load members with names", + "make_admin": "make an admin", + "manage_members": "manage members", + "promote_group": "promote your group to non-members", + "publish_announcement": "publish announcement", + "publish_avatar": "publish avatar", + "refetch_page": "refetch page", + "remove_admin": "remove as admin", + "remove_minting_account": "remove minting account", + "return_to_thread": "return to threads", + "scroll_bottom": "scroll to bottom", + "scroll_unread_messages": "scroll to Unread Messages", + "select_group": "select a group", + "visit_q_mintership": "visit Q-Mintership" + }, + "advanced_options": "advanced options", + "block_delay": { + "minimum": "minimum Block delay", + "maximum": "maximum Block delay" + }, + "group": { + "approval_threshold": "group Approval Threshold", + "avatar": "group avatar", + "closed": "closed (private) - users need permission to join", + "description": "description of group", + "id": "group id", + "invites": "group invites", + "group": "group", + "group_name": "group: {{ name }}", + "group_other": "groups", + "groups_admin": "groups where you are an admin", + "management": "group management", + "member_number": "number of members", + "messaging": "messaging", + "name": "group name", + "open": "open (public)", + "private": "private group", + "promotions": "group promotions", + "public": "public group", + "type": "group type" + }, + "invitation_expiry": "invitation Expiry Time", + "invitees_list": "invitees list", + "join_link": "join group link", + "join_requests": "join requests", + "last_message": "last message", + "last_message_date": "last message: {{date }}", + "latest_mails": "latest Q-Mails", + "message": { + "generic": { + "avatar_publish_fee": "publishing an Avatar requires {{ fee }}", + "avatar_registered_name": "a registered name is required to set an avatar", + "admin_only": "only groups where you are an admin will be shown", + "already_in_group": "you are already in this group!", + "block_delay_minimum": "minimum Block delay for Group Transaction Approvals", + "block_delay_maximum": "maximum Block delay for Group Transaction Approvals", + "closed_group": "this is a closed/private group, so you will need to wait until an admin accepts your request", + "descrypt_wallet": "decrypting wallet...", + "encryption_key": "the group's first common encryption key is in the process of creation. Please wait a few minutes for it to be retrieved by the network. Checking every 2 minutes...", + "group_announcement": "group Announcements", + "group_approval_threshold": "group Approval Threshold (number / percentage of Admins that must approve a transaction)", + "group_encrypted": "group encrypted", + "group_invited_you": "{{group}} has invited you", + "group_key_created": "first group key created.", + "group_member_list_changed": "the group member list has changed. Please re-encrypt the secret key.", + "group_no_secret_key": "there is no group secret key. Be the first admin to publish one!", + "group_secret_key_no_owner": "the latest group secret key was published by a non-owner. As the owner of the group please re-encrypt the key as a safeguard.", + "invalid_content": "invalid content, sender, or timestamp in reaction data", + "invalid_data": "error loading content: Invalid Data", + "latest_promotion": "only the latest promotion from the week will be shown for your group.", + "loading_members": "loading member list with names... please wait.", + "max_chars": "max 200 characters. Publish Fee", + "manage_minting": "manage your minting", + "minter_group": "you are currently not part of the MINTER group", + "mintership_app": "visit the Q-Mintership app to apply to be a minter", + "minting_account": "minting account:", + "minting_keys_per_node": "only 2 minting keys are allowed per node. Please remove one if you would like to mint with this account.", + "minting_keys_per_node_different": "only 2 minting keys are allowed per node. Please remove one if you would like to add a different account.", + "node_minting_account": "node's minting accounts", + "node_minting_key": "you currently have a minting key for this account attached to this node", + "no_announcement": "no announcements", + "no_display": "nothing to display", + "no_selection": "no group selected", + "not_part_group": "you are not part of the encrypted group of members. Wait until an admin re-encrypts the keys.", + "only_encrypted": "only unencrypted messages will be displayed.", + "only_private_groups": "only private groups will be shown", + "pending_join_requests": "{{ group }} has {{ count }} pending join requests", + "private_key_copied": "private key copied", + "provide_message": "please provide a first message to the thread", + "secure_place": "keep your private key in a secure place. Do not share!", + "setting_group": "setting up group... please wait." + }, + "error": { + "access_name": "cannot send a message without a access to your name", + "descrypt_wallet": "error decrypting wallet {{ message }}", + "description_required": "please provide a description", + "group_info": "cannot access group information", + "group_join": "failed to join the group", + "group_promotion": "error publishing the promotion. Please try again", + "group_secret_key": "cannot get group secret key", + "name_required": "please provide a name", + "notify_admins": "try notifying an admin from the list of admins below:", + "qortals_required": "you need at least {{ quantity }} QORT to send a message", + "timeout_reward": "timeout waiting for reward share confirmation", + "thread_id": "unable to locate thread Id", + "unable_determine_group_private": "unable to determine if group is private", + "unable_minting": "unable to start minting" + }, + "success": { + "group_ban": "successfully banned member from group. It may take a couple of minutes for the changes to propagate", + "group_creation": "successfully created group. It may take a couple of minutes for the changes to propagate", + "group_creation_name": "created group {{group_name}}: awaiting confirmation", + "group_creation_label": "created group {{name}}: success!", + "group_invite": "successfully invited {{invitee}}. It may take a couple of minutes for the changes to propagate", + "group_join": "successfully requested to join group. It may take a couple of minutes for the changes to propagate", + "group_join_name": "joined group {{group_name}}: awaiting confirmation", + "group_join_label": "joined group {{name}}: success!", + "group_join_request": "requested to join Group {{group_name}}: awaiting confirmation", + "group_join_outcome": "requested to join Group {{group_name}}: success!", + "group_kick": "successfully kicked member from group. It may take a couple of minutes for the changes to propagate", + "group_leave": "successfully requested to leave group. It may take a couple of minutes for the changes to propagate", + "group_leave_name": "left group {{group_name}}: awaiting confirmation", + "group_leave_label": "left group {{name}}: success!", + "group_member_admin": "successfully made member an admin. It may take a couple of minutes for the changes to propagate", + "group_promotion": "successfully published promotion. It may take a couple of minutes for the promotion to appear", + "group_remove_member": "successfully removed member as an admin. It may take a couple of minutes for the changes to propagate", + "invitation_cancellation": "successfully canceled invitation. It may take a couple of minutes for the changes to propagate", + "invitation_request": "accepted join request: awaiting confirmation", + "loading_threads": "loading threads... please wait.", + "post_creation": "successfully created post. It may take some time for the publish to propagate", + "published_secret_key": "published secret key for group {{ group_id }}: awaiting confirmation", + "published_secret_key_label": "published secret key for group {{ group_id }}: success!", + "registered_name": "successfully registered. It may take a couple of minutes for the changes to propagate", + "registered_name_label": "registered name: awaiting confirmation. This may take a couple minutes.", + "registered_name_success": "registered name: success!", + "rewardshare_add": "add rewardshare: awaiting confirmation", + "rewardshare_add_label": "add rewardshare: success!", + "rewardshare_creation": "confirming creation of rewardshare on chain. Please be patient, this could take up to 90 seconds.", + "rewardshare_confirmed": "rewardshare confirmed. Please click Next.", + "rewardshare_remove": "remove rewardshare: awaiting confirmation", + "rewardshare_remove_label": "remove rewardshare: success!", + "thread_creation": "successfully created thread. It may take some time for the publish to propagate", + "unbanned_user": "successfully unbanned user. It may take a couple of minutes for the changes to propagate", + "user_joined": "user successfully joined!" + } + }, + "thread_posts": "new thread posts" +} diff --git a/src/i18n/locales/en/question.json b/src/i18n/locales/en/question.json new file mode 100644 index 0000000..a71ee77 --- /dev/null +++ b/src/i18n/locales/en/question.json @@ -0,0 +1,194 @@ +{ + "accept_app_fee": "accept app fee", + "always_authenticate": "always authenticate automatically", + "always_chat_messages": "always allow chat messages from this app", + "always_retrieve_balance": "always allow balance to be retrieved automatically", + "always_retrieve_list": "always allow lists to be retrieved automatically", + "always_retrieve_wallet": "always allow wallet to be retrieved automatically", + "always_retrieve_wallet_transactions": "always allow wallet transactions to be retrieved automatically", + "amount_qty": "amount: {{ quantity }}", + "asset_name": "asset: {{ asset }}", + "assets_used_pay": "asset used in payments: {{ asset }}", + "coin": "coin: {{ coin }}", + "description": "description: {{ description }}", + "deploy_at": "would you like to deploy this AT?", + "download_file": "would you like to download:", + "message": { + "error": { + "add_to_list": "failed to add to list", + "at_info": "cannot find AT info.", + "buy_order": "failed to submit trade order", + "cancel_sell_order": "failed to Cancel Sell Order. Try again!", + "copy_clipboard": "failed to copy to clipboard", + "create_sell_order": "failed to Create Sell Order. Try again!", + "create_tradebot": "unable to create tradebot", + "decode_transaction": "failed to decode transaction", + "decrypt": "unable to decrypt", + "decrypt_message": "failed to decrypt the message. Ensure the data and keys are correct", + "decryption_failed": "decryption failed", + "empty_receiver": "receiver cannot be empty!", + "encrypt": "unable to encrypt", + "encryption_failed": "encryption failed", + "encryption_requires_public_key": "encrypting data requires public keys", + "fetch_balance_token": "failed to fetch {{ token }} Balance. Try again!", + "fetch_balance": "unable to fetch balance", + "fetch_connection_history": "failed to fetch server connection history", + "fetch_generic": "unable to fetch", + "fetch_group": "failed to fetch the group", + "fetch_list": "failed to fetch the list", + "fetch_poll": "failed to fetch poll", + "fetch_recipient_public_key": "failed to fetch recipient's public key", + "fetch_wallet_info": "unable to fetch wallet information", + "fetch_wallet_transactions": "unable to fetch wallet transactions", + "fetch_wallet": "fetch Wallet Failed. Please try again", + "file_extension": "a file extension could not be derived", + "gateway_balance_local_node": "cannot view {{ token }} balance through the gateway. Please use your local node.", + "gateway_non_qort_local_node": "cannot send a non-QORT coin through the gateway. Please use your local node.", + "gateway_retrieve_balance": "retrieving {{ token }} balance is not allowed through a gateway", + "gateway_wallet_local_node": "cannot view {{ token }} wallet through the gateway. Please use your local node.", + "get_foreign_fee": "error in get foreign fee", + "insufficient_balance_qort": "your QORT balance is insufficient", + "insufficient_balance": "your asset balance is insufficient", + "insufficient_funds": "insufficient funds", + "invalid_encryption_iv": "invalid IV: AES-GCM requires a 12-byte IV", + "invalid_encryption_key": "invalid key: AES-GCM requires a 256-bit key.", + "invalid_fullcontent": "field fullContent is in an invalid format. Either use a string, base64 or an object", + "invalid_receiver": "invalid receiver address or name", + "invalid_type": "invalid type", + "mime_type": "a mimeType could not be derived", + "missing_fields": "missing fields: {{ fields }}", + "name_already_for_sale": "this name is already for sale", + "name_not_for_sale": "this name is not for sale", + "no_api_found": "no usable API found", + "no_data_encrypted_resource": "no data in the encrypted resource", + "no_data_file_submitted": "no data or file was submitted", + "no_group_found": "group not found", + "no_group_key": "no group key found", + "no_poll": "poll not found", + "no_resources_publish": "no resources to publish", + "node_info": "failed to retrieve node info", + "node_status": "failed to retrieve node status", + "only_encrypted_data": "only encrypted data can go into private services", + "perform_request": "failed to perform request", + "poll_create": "failed to create poll", + "poll_vote": "failed to vote on the poll", + "process_transaction": "unable to process transaction", + "provide_key_shared_link": "for an encrypted resource, you must provide the key to create the shared link", + "registered_name": "a registered name is needed to publish", + "resources_publish": "some resources have failed to publish", + "retrieve_file": "failed to retrieve file", + "retrieve_keys": "unable to retrieve keys", + "retrieve_summary": "failed to retrieve summary", + "retrieve_sync_status": "error in retrieving {{ token }} sync status", + "same_foreign_blockchain": "all requested ATs need to be of the same foreign Blockchain.", + "send": "failed to send", + "server_current_add": "failed to add current server", + "server_current_set": "failed to set current server", + "server_info": "error in retrieving server info", + "server_remove": "failed to remove server", + "submit_sell_order": "failed to submit sell order", + "synchronization_attempts": "failed to synchronize after {{ count }} attempts", + "timeout_request": "request timed out", + "token_not_supported": "{{ token }} is not supported for this call", + "transaction_activity_summary": "error in transaction activity summary", + "unknown_error": "unknown error", + "unknown_admin_action_type": "unknown admin action type: {{ type }}", + "update_foreign_fee": "failed to update foreign fee", + "update_tradebot": "unable to update tradebot", + "upload_encryption": "upload failed due to failed encryption", + "upload": "upload failed", + "use_private_service": "for an encrypted publish please use a service that ends with _PRIVATE", + "user_qortal_name": "user has no Qortal name", + "max_size_publish": "maximum file size allowed is {{size}} GB per file.", + "max_size_publish_public": "maximum file size allowed on the public node is {{size}} MB. Please use your local node for larger files." + }, + "generic": { + "calculate_fee": "*the {{ amount }} sats fee is derived from {{ rate }} sats per kb, for a transaction that is approximately 300 bytes in size.", + "confirm_join_group": "confirm joining the group:", + "include_data_decrypt": "please include data to decrypt", + "include_data_encrypt": "please include data to encrypt", + "max_retry_transaction": "max retries reached. Skipping transaction.", + "no_action_public_node": "this action cannot be done through a public node", + "private_service": "please use a private service", + "provide_group_id": "please provide a groupId", + "read_transaction_carefully": "read the transaction carefully before accepting!", + "user_declined_add_list": "user declined add to list", + "user_declined_delete_from_list": "user declined delete from list", + "user_declined_delete_hosted_resources": "user declined delete hosted resources", + "user_declined_join": "user declined to join group", + "user_declined_list": "user declined to get list of hosted resources", + "user_declined_request": "user declined request", + "user_declined_save_file": "user declined to save file", + "user_declined_send_message": "user declined to send message", + "user_declined_share_list": "user declined to share list" + } + }, + "name": "name: {{ name }}", + "option": "option: {{ option }}", + "options": "options: {{ optionList }}", + "permission": { + "access_list": "do you give this application permission to access the list", + "add_admin": "do you give this application permission to add user {{ invitee }} as an admin?", + "all_item_list": "do you give this application permission to add the following to the list {{ name }}:", + "authenticate": "do you give this application permission to authenticate?", + "ban": "do you give this application permission to ban {{ partecipant }} from the group?", + "buy_name_detail": "buying {{ name }} for {{ price }} QORT", + "buy_name": "do you give this application permission to buy a name?", + "buy_order_fee_estimation_one": "this fee is an estimate based on {{ count }} order, assuming a 300-byte size at a rate of {{ fee }} {{ ticker }} per KB.", + "buy_order_fee_estimation_other": "this fee is an estimate based on {{ count }} orders, assuming a 300-byte size at a rate of {{ fee }} {{ ticker }} per KB.", + "buy_order_per_kb": "{{ fee }} {{ ticker }} per kb", + "buy_order_quantity_one": "{{ count }} buy order", + "buy_order_quantity_other": "{{ count }} buy orders", + "buy_order_ticker": "{{ qort_amount }} QORT for {{ foreign_amount }} {{ ticker }}", + "buy_order": "do you give this application permission to perform a buy order?", + "cancel_ban": "do you give this application permission to cancel the group ban for user {{ partecipant }}?", + "cancel_group_invite": "do you give this application permission to cancel the group invite for {{ invitee }}?", + "cancel_sell_order": "do you give this application permission to perform: cancel a sell order?", + "create_group": "do you give this application permission to create a group?", + "delete_hosts_resources": "do you give this application permission to delete {{ size }} hosted resources?", + "fetch_balance": "do you give this application permission to fetch your {{ coin }} balance", + "get_wallet_info": "do you give this application permission to get your wallet information?", + "get_wallet_transactions": "do you give this application permission to retrieve your wallet transactions", + "invite": "do you give this application permission to invite {{ invitee }}?", + "kick": "do you give this application permission to kick {{ partecipant }} from the group?", + "leave_group": "do you give this application permission to leave the following group?", + "list_hosted_data": "do you give this application permission to get a list of your hosted data?", + "order_detail": "{{ qort_amount }} QORT for {{ foreign_amount }} {{ ticker }}", + "pay_publish": "do you give this application permission to make the following payments and publishes?", + "perform_admin_action_with_value": "with value: {{ value }}", + "perform_admin_action": "do you give this application permission to perform the admin action: {{ type }}", + "publish_qdn": "do you give this application permission to publish to QDN?", + "register_name": "do you give this application permission to register this name?", + "remove_admin": "do you give this application permission to remove user {{ partecipant }} as an admin?", + "remove_from_list": "do you give this application permission to remove the following from the list {{ name }}:", + "sell_name_cancel": "do you give this application permission to cancel the selling of a name?", + "sell_name_transaction_detail": "sell {{ name }} for {{ price }} QORT", + "sell_name_transaction": "do you give this application permission to create a sell name transaction?", + "sell_order": "do you give this application permission to perform a sell order?", + "send_chat_message": "do you give this application permission to send this chat message?", + "send_coins": "do you give this application permission to send coins?", + "server_add": "do you give this application permission to add a server?", + "server_remove": "do you give this application permission to remove a server?", + "set_current_server": "do you give this application permission to set the current server?", + "sign_fee": "do you give this application permission to sign the required fees for all your trade offers?", + "sign_process_transaction": "do you give this application permission to sign and process a transaction?", + "sign_transaction": "do you give this application permission to sign a transaction?", + "transfer_asset": "do you give this application permission to transfer the following asset?", + "update_foreign_fee": "do you give this application permission to update foreign fees on your node?", + "update_group_detail": "new owner: {{ owner }}", + "update_group": "do you give this application permission to update this group?" + }, + "poll": "poll: {{ name }}", + "provide_recipient_group_id": "please provide a recipient or groupId", + "request_create_poll": "you are requesting to create the poll below:", + "request_vote_poll": "you are being requested to vote on the poll below:", + "sats_per_kb": "{{ amount }} sats per KB", + "sats": "{{ amount }} sats", + "server_host": "host: {{ host }}", + "server_type": "type: {{ type }}", + "to_group": "to: group {{ group_id }}", + "to_recipient": "to: {{ recipient }}", + "total_locking_fee": "total Locking Fee:", + "total_unlocking_fee": "total Unlocking Fee:", + "value": "value: {{ value }}" +} diff --git a/src/i18n/locales/en/tutorial.json b/src/i18n/locales/en/tutorial.json new file mode 100644 index 0000000..cc54061 --- /dev/null +++ b/src/i18n/locales/en/tutorial.json @@ -0,0 +1,21 @@ +{ + "1_getting_started": "1. Getting Started", + "2_overview": "2. Overview", + "3_groups": "3. Qortal Groups", + "4_obtain_qort": "4. Obtaining Qort", + "account_creation": "account creation", + "important_info": "important information", + "apps": { + "dashboard": "1. Apps Dashboard", + "navigation": "2. Apps Navigation" + }, + "initial": { + "recommended_qort_qty": "have at least {{ quantity }} QORT in your wallet", + "explore": "explore", + "general_chat": "general chat", + "getting_started": "getting started", + "register_name": "register a name", + "see_apps": "see apps", + "trade_qort": "trade QORT" + } +} diff --git a/src/i18n/locales/es/auth.json b/src/i18n/locales/es/auth.json new file mode 100644 index 0000000..d17e1ee --- /dev/null +++ b/src/i18n/locales/es/auth.json @@ -0,0 +1,138 @@ +{ + "account": { + "your": "tu cuenta", + "account_many": "cuentas", + "account_one": "cuenta", + "selected": "cuenta seleccionada" + }, + "action": { + "add": { + "account": "agregar cuenta", + "seed_phrase": "agregar frase semilla" + }, + "authenticate": "autenticar", + "block": "bloquear", + "block_all": "bloquear todo", + "block_data": "bloquear datos QDN", + "block_name": "bloquear nombre", + "block_txs": "bloquear transacciones", + "fetch_names": "obtener nombres", + "copy_address": "copiar dirección", + "create_account": "crear cuenta", + "create_qortal_account": "crea tu cuenta de Qortal haciendo clic en SIGUIENTE abajo.", + "choose_password": "elige nueva contraseña", + "download_account": "descargar cuenta", + "enter_amount": "por favor ingresa una cantidad mayor que 0", + "enter_recipient": "por favor ingresa un destinatario", + "enter_wallet_password": "por favor ingresa la contraseña de tu billetera", + "export_seedphrase": "exportar frase semilla", + "insert_name_address": "por favor ingresa un nombre o dirección", + "publish_admin_secret_key": "publicar clave secreta de administrador", + "publish_group_secret_key": "publicar clave secreta del grupo", + "reencrypt_key": "reencriptar clave", + "return_to_list": "volver a la lista", + "setup_qortal_account": "configura tu cuenta de Qortal", + "unblock": "desbloquear", + "unblock_name": "desbloquear nombre" + }, + "address": "dirección", + "address_name": "dirección o nombre", + "advanced_users": "para usuarios avanzados", + "apikey": { + "alternative": "alternativa: seleccionar archivo", + "change": "cambiar clave API", + "enter": "ingresar clave API", + "import": "importar clave API", + "key": "clave API", + "select_valid": "selecciona una clave API válida" + }, + "authentication": "autenticación", + "blocked_users": "usuarios bloqueados", + "build_version": "versión de compilación", + "message": { + "error": { + "account_creation": "no se pudo crear la cuenta.", + "address_not_existing": "la dirección no existe en la blockchain", + "block_user": "no se puede bloquear al usuario", + "create_simmetric_key": "no se puede crear clave simétrica", + "decrypt_data": "no se pudieron descifrar los datos", + "decrypt": "no se puede descifrar", + "encrypt_content": "no se puede cifrar el contenido", + "fetch_user_account": "no se puede obtener la cuenta de usuario", + "field_not_found_json": "{{ field }} no encontrado en el JSON", + "find_secret_key": "no se puede encontrar la clave secreta correcta", + "incorrect_password": "contraseña incorrecta", + "invalid_qortal_link": "enlace Qortal inválido", + "invalid_secret_key": "clave secreta no válida", + "invalid_uint8": "el Uint8ArrayData enviado no es válido", + "name_not_existing": "el nombre no existe", + "name_not_registered": "nombre no registrado", + "read_blob_base64": "fallo al leer el Blob como cadena codificada en base64", + "reencrypt_secret_key": "no se pudo reencriptar la clave secreta", + "set_apikey": "fallo al establecer la clave API:" + }, + "generic": { + "blocked_addresses": "direcciones bloqueadas: bloquea procesamiento de transacciones", + "blocked_names": "nombres bloqueados para QDN", + "blocking": "bloqueando a {{ name }}", + "choose_block": "elige 'bloquear transacciones' o 'todo' para bloquear mensajes de chat", + "congrats_setup": "¡felicidades, todo está listo!", + "decide_block": "decide qué bloquear", + "downloading_encryption_keys": "descargando claves de cifrado", + "fetching_admin_secret_key": "obteniendo clave secreta de administrador", + "fetching_group_secret_key": "obteniendo publicación de clave secreta de grupo", + "keep_secure": "mantén segura tu archivo de cuenta", + "last_encryption_date": "última fecha de cifrado: {{ date }} por {{ name }}", + "locating_encryption_keys": "localizando claves de cifrado", + "name_address": "nombre o dirección", + "no_account": "no hay cuentas guardadas", + "no_minimum_length": "no hay requisito de longitud mínima", + "no_secret_key_published": "aún no se ha publicado ninguna clave secreta", + "publishing_key": "recordatorio: después de publicar la clave, puede tardar unos minutos en aparecer. Por favor, espera.", + "seedphrase_notice": "una FRASE SEMILLA se ha generado aleatoriamente en segundo plano.", + "turn_local_node": "por favor, enciende tu nodo local", + "type_seed": "escribe o pega tu frase semilla", + "your_accounts": "tus cuentas guardadas" + }, + "success": { + "reencrypted_secret_key": "clave secreta reencriptada exitosamente. Los cambios pueden tardar unos minutos en propagarse. Actualiza el grupo en 5 minutos." + } + }, + "node": { + "choose": "elegir nodo personalizado", + "custom_many": "nodos personalizados", + "use_custom": "usar nodo personalizado", + "use_local": "usar nodo local", + "using": "usando nodo", + "using_public": "usando nodo público", + "using_public_gateway": "usando nodo público: {{ gateway }}" + }, + "note": "nota", + "password": "contraseña", + "password_confirmation": "confirmar contraseña", + "seed_phrase": "frase semilla", + "seed_your": "tu frase semilla", + "tips": { + "additional_wallet": "usa esta opción para conectar carteras Qortal adicionales que ya has creado, para iniciar sesión más adelante. Necesitarás acceso a tu archivo de respaldo JSON.", + "digital_id": "tu billetera es como tu ID digital en Qortal y es la forma de iniciar sesión en la interfaz de usuario. Contiene tu dirección pública y el nombre Qortal que elijas. Cada transacción que haces está vinculada a tu ID, y aquí gestionas todo tu QORT y otras criptomonedas comerciables en Qortal.", + "existing_account": "¿ya tienes una cuenta de Qortal? Ingresa tu frase de respaldo secreta aquí para acceder. Esta frase es una de las formas de recuperar tu cuenta.", + "key_encrypt_admin": "esta clave es para cifrar contenido relacionado con ADMIN. Solo los administradores pueden ver el contenido cifrado con esta clave.", + "key_encrypt_group": "esta clave es para cifrar contenido de GRUPO. Actualmente es la única que se usa en esta interfaz. Todos los miembros del grupo podrán ver el contenido cifrado con esta clave.", + "new_account": "crear una cuenta significa crear una nueva billetera e ID digital para comenzar a usar Qortal. Una vez creada, podrás obtener QORT, comprar un nombre y avatar, publicar videos y blogs, y mucho más.", + "new_users": "¡los nuevos usuarios comienzan aquí!", + "safe_place": "¡guarda tu cuenta en un lugar seguro que recuerdes!", + "view_seedphrase": "si deseas VER LA FRASE SEMILLA, haz clic en la palabra 'FRASE SEMILLA' en este texto. Las frases semilla se usan para generar la clave privada de tu cuenta Qortal. Por seguridad, no se muestran por defecto.", + "wallet_secure": "mantén seguro el archivo de tu billetera." + }, + "wallet": { + "password_confirmation": "confirmar contraseña de billetera", + "password": "contraseña de billetera", + "keep_password": "mantener contraseña actual", + "new_password": "nueva contraseña", + "error": { + "missing_new_password": "por favor ingresa una nueva contraseña", + "missing_password": "por favor ingresa tu contraseña" + } + }, + "welcome": "bienvenido a" +} diff --git a/src/i18n/locales/es/core.json b/src/i18n/locales/es/core.json new file mode 100644 index 0000000..d157cf5 --- /dev/null +++ b/src/i18n/locales/es/core.json @@ -0,0 +1,419 @@ +{ + "action": { + "accept": "aceptar", + "access": "acceso", + "access_app": "aplicación de acceso", + "add": "agregar", + "add_custom_framework": "Agregar marco personalizado", + "add_reaction": "Agregar reacción", + "add_theme": "Agregar tema", + "backup_account": "cuenta de respaldo", + "backup_wallet": "billetera de respaldo", + "cancel": "Cancelar", + "cancel_invitation": "Cancelar invitación", + "change": "cambiar", + "change_avatar": "Cambiar avatar", + "change_file": "Cambiar archivo", + "change_language": "Cambiar lenguaje", + "choose": "elegir", + "choose_file": "Elija archivo", + "choose_image": "Elija imagen", + "choose_logo": "Elija un logotipo", + "choose_name": "Elige un nombre", + "close": "cerca", + "close_chat": "Cerrar chat directo", + "continue": "continuar", + "continue_logout": "Continuar inicio de sesión", + "copy_link": "enlace de copia", + "create_apps": "Crear aplicaciones", + "create_file": "Crear archivo", + "create_transaction": "Crear transacciones en la cadena de bloques Qortal", + "create_thread": "Crear hilo", + "decline": "rechazar", + "decrypt": "descifrar", + "disable_enter": "deshabilitar Enter", + "download": "descargar", + "download_file": "descargar archivo", + "edit": "editar", + "edit_theme": "editar tema", + "enable_dev_mode": "Habilitar el modo de desarrollo", + "enter_name": "Ingrese un nombre", + "export": "exportar", + "get_qort": "Obtener Qort", + "get_qort_trade": "Obtenga Qort en Q-Trade", + "hide": "esconder", + "hide_qr_code": "ocultar código QR", + "import": "importar", + "import_theme": "tema de importación", + "invite": "invitar", + "invite_member": "Invitar a un nuevo miembro", + "join": "unirse", + "leave_comment": "hacer comentarios", + "load_announcements": "Cargar anuncios más antiguos", + "login": "acceso", + "logout": "cierre de sesión", + "new": { + "chat": "nuevo chat", + "post": "nuevo post", + "theme": "nuevo tema", + "thread": "nuevo hilo" + }, + "notify": "notificar", + "open": "abierto", + "pin": "alfiler", + "pin_app": "aplicación PIN", + "pin_from_dashboard": "Pin del tablero", + "post": "correo", + "post_message": "mensaje de publicación", + "publish": "publicar", + "publish_app": "Publica tu aplicación", + "publish_comment": "publicar comentario", + "refresh": "refrescar", + "register_name": "Nombre de registro", + "remove": "eliminar", + "remove_reaction": "eliminar la reacción", + "return_apps_dashboard": "Volver al tablero de aplicaciones", + "save": "ahorrar", + "save_disk": "Guardar en el disco", + "search": "buscar", + "search_apps": "Buscar aplicaciones", + "search_groups": "buscar grupos", + "search_chat_text": "Search Chat Text", + "see_qr_code": "Ver código QR", + "select_app_type": "Seleccionar el tipo de aplicación", + "select_category": "Seleccionar categoría", + "select_name_app": "Seleccionar nombre/aplicación", + "send": "enviar", + "send_qort": "Enviar Qort", + "set_avatar": "establecer avatar", + "show": "espectáculo", + "show_poll": "encuesta", + "start_minting": "Empiece a acuñar", + "start_typing": "Empiece a escribir aquí ...", + "trade_qort": "comercio Qort", + "transfer_qort": "transferir Qort", + "unpin": "desprender", + "unpin_app": "Aplicación de desgaste", + "unpin_from_dashboard": "Desvinar del tablero", + "update": "actualizar", + "update_app": "Actualiza tu aplicación", + "vote": "votar" + }, + "address_your": "Tu dirección", + "admin": "administración", + "admin_other": "administradores", + "all": "todo", + "amount": "cantidad", + "announcement": "anuncio", + "announcement_other": "anuncios", + "api": "API", + "app": "aplicación", + "app_other": "aplicaciones", + "app_name": "nombre de la aplicación", + "app_private": "privado", + "app_service_type": "Tipo de servicio de aplicaciones", + "apps_dashboard": "Panel de aplicaciones", + "apps_official": "aplicaciones oficiales", + "attachment": "adjunto", + "balance": "balance:", + "category": "categoría", + "category_other": "categorías", + "chat": "charlar", + "comment_other": "comentario", + "contact_other": "contactos", + "core": { + "block_height": "altura de bloque", + "information": "información central", + "peers": "compañeros conectados", + "version": "versión central" + }, + "current_language": "current language: {{ language }}", + "dev": "enchufe", + "dev_mode": "modo de desarrollo", + "domain": "dominio", + "ui": { + "version": "versión de interfaz de usuario" + }, + "count": { + "none": "ninguno", + "one": "uno" + }, + "description": "descripción", + "devmode_apps": "aplicaciones en modo de desarrollo", + "directory": "directorio", + "downloading_qdn": "Descarga de QDN", + "fee": { + "payment": "tarifa de pago", + "publish": "publicar tarifa" + }, + "for": "para", + "general": "general", + "general_settings": "Configuración general", + "home": "hogar", + "identifier": "identificador", + "image_embed": "inserción de la imagen", + "last_height": "última altura", + "level": "nivel", + "library": "biblioteca", + "list": { + "bans": "Lista de prohibiciones", + "groups": "Lista de grupos", + "invites": "Lista de invitaciones", + "join_request": "Lista de solicitudes de unión", + "member": "lista de miembros", + "members": "Lista de miembros" + }, + "loading": { + "announcements": "Cargando anuncios", + "generic": "cargando...", + "chat": "Cargando chat ... por favor espera.", + "comments": "Cargando comentarios ... por favor espere.", + "posts": "Cargando publicaciones ... por favor espere." + }, + "member": "miembro", + "member_other": "miembros", + "message_us": "Envíenos un mensaje en NextCloud (no se requiere registro) o discordia si necesita 4 Qort para comenzar a chatear sin limitaciones", + "message": { + "error": { + "address_not_found": "No se encontró su dirección", + "app_need_name": "Tu aplicación necesita un nombre", + "build_app": "Incapaz de crear una aplicación privada", + "decrypt_app": "No se puede descifrar la aplicación privada '", + "download_image": "No se puede descargar la imagen. Vuelva a intentarlo más tarde haciendo clic en el botón Actualizar", + "download_private_app": "No se puede descargar la aplicación privada", + "encrypt_app": "No se puede cifrar la aplicación. Aplicación no publicada '", + "fetch_app": "Incapaz de buscar la aplicación", + "fetch_publish": "Incapaz de buscar publicar", + "file_too_large": "file {{ filename }} is too large. Max size allowed is {{ size }} MB.", + "generic": "Ocurrió un error", + "initiate_download": "No se pudo iniciar la descarga", + "invalid_amount": "cantidad no válida", + "invalid_base64": "datos no válidos de base64", + "invalid_embed_link": "enlace de inserción no válido", + "invalid_image_embed_link_name": "Enlace de incrustación de imagen no válida. Falta Param.", + "invalid_poll_embed_link_name": "Enlace de incrustación de encuesta inválida. Nombre faltante.", + "invalid_signature": "firma no válida", + "invalid_theme_format": "formato de tema no válido", + "invalid_zip": "zip no válido", + "message_loading": "Error de carga de mensaje.", + "message_size": "your message size is of {{ size }} bytes out of a maximum of {{ maximum }}", + "minting_account_add": "No se puede agregar una cuenta de menta", + "minting_account_remove": "No se puede eliminar la cuenta de acuñación", + "missing_fields": "missing: {{ fields }}", + "navigation_timeout": "tiempo de espera de navegación", + "network_generic": "error de red", + "password_not_matching": "¡Los campos de contraseña no coinciden!", + "password_wrong": "incapaz de autenticarse. Contraseña incorrecta", + "publish_app": "Incapaz de publicar la aplicación", + "publish_image": "Incapaz de publicar imagen", + "rate": "incapaz de calificar", + "rating_option": "No se puede encontrar la opción de calificación", + "save_qdn": "No se puede guardar en QDN", + "send_failed": "No se pudo enviar", + "update_failed": "No se pudo actualizar", + "vote": "Incapaz de votar" + }, + "generic": { + "already_voted": "ya has votado.", + "avatar_size": "{{ size }} KB max. for GIFS", + "benefits_qort": "beneficios de tener Qort", + "building": "edificio", + "building_app": "aplicación de construcción", + "confirmed": "confirmado", + "created_by": "created by {{ owner }}", + "buy_order_request": "the Application
{{hostname}}
is requesting {{count}} buy order", + "buy_order_request_other": "the Application
{{hostname}}
is requesting {{count}} buy orders", + "devmode_local_node": "¡Utilice su nodo local para el modo Dev! INCOGAR y USAR NODO LOCAL.", + "downloading": "descarga", + "downloading_decrypting_app": "Descarga y descifrado de la aplicación privada.", + "edited": "editado", + "editing_message": "mensaje de edición", + "encrypted": "encriptado", + "encrypted_not": "no encriptado", + "fee_qort": "fee: {{ message }} QORT", + "fetching_data": "Obtener datos de aplicaciones", + "foreign_fee": "foreign fee: {{ message }}", + "get_qort_trade_portal": "Obtenga Qort usando el portal de comercio Crosschain de Qortalal", + "minimal_qort_balance": "having at least {{ quantity }} QORT in your balance (4 qort balance for chat, 1.25 for name, 0.75 for some transactions)", + "mentioned": "mencionado", + "message_with_image": "Este mensaje ya tiene una imagen", + "most_recent_payment": "{{ count }} most recent payment", + "name_available": "{{ name }} is available", + "name_benefits": "Beneficios de un nombre", + "name_checking": "Verificar si el nombre ya existe", + "name_preview": "Necesita un nombre para usar la vista previa", + "name_publish": "Necesita un nombre de Qortal para publicar", + "name_rate": "Necesitas un nombre para calificar.", + "name_registration": "your balance is {{ balance }} QORT. A name registration requires a {{ fee }} QORT fee", + "name_unavailable": "{{ name }} is unavailable", + "no_data_image": "No hay datos para la imagen", + "no_description": "Sin descripción", + "no_messages": "Sin mensajes", + "no_message": "sin mensaje", + "no_minting_details": "No se puede ver los detalles de acuñado en la puerta de enlace", + "no_notifications": "No hay nuevas notificaciones", + "no_payments": "Sin pagos", + "no_pinned_changes": "Actualmente no tiene ningún cambio en sus aplicaciones fijadas", + "no_results": "Sin resultados", + "one_app_per_name": "Nota: Actualmente, solo se permite una aplicación y un sitio web por nombre.", + "ongoing_transactions": "transacciones en curso", + "opened": "abierto", + "overwrite_qdn": "sobrescribir a QDN", + "password_confirm": "Confirme una contraseña", + "password_enter": "Ingrese una contraseña", + "payment_request": "the Application
{{hostname}}
is requesting a payment", + "people_reaction": "people who reacted with {{ reaction }}", + "processing_transaction": "está procesando transacciones, espere ...", + "publish_data": "Publicar datos en Qortal: cualquier cosa, desde aplicaciones hasta videos. Totalmente descentralizado!", + "publishing": "Publicación ... por favor espera.", + "qdn": "Use el ahorro de QDN", + "rating": "rating for {{ service }} {{ name }}", + "register_name": "Necesita un nombre de Qortal registrado para guardar sus aplicaciones fijadas en QDN.", + "replied_to": "replied to {{ person }}", + "revert_default": "Volver al valor predeterminado", + "revert_qdn": "volver a QDN", + "save_qdn": "Guardar en QDN", + "secure_ownership": "Asegure la propiedad de los datos publicados por su nombre. Incluso puede vender su nombre, junto con sus datos a un tercero.", + "select_file": "Seleccione un archivo", + "select_image": "Seleccione una imagen para un logotipo", + "select_zip": "Seleccione el archivo .zip que contenga contenido estático:", + "sending": "envío...", + "settings": "está utilizando la forma de exportación/importación de la configuración de ahorro.", + "space_for_admins": "lo siento, este espacio es solo para administradores.", + "unread_messages": "mensajes no leídos a continuación", + "unsaved_changes": "tiene cambios no salvos en sus aplicaciones fijadas. Guárdelos a QDN.", + "updating": "actualización", + "wait": "espera por favor" + }, + "message": "mensaje", + "promotion_text": "texto de promoción", + "question": { + "accept_vote_on_poll": "¿Acepta esta transacción votante_on_poll? ¡Las encuestas son públicas!", + "logout": "¿Estás seguro de que te gustaría cerrar sesión?", + "new_user": "¿Eres un nuevo usuario?", + "delete_chat_image": "¿Le gustaría eliminar su imagen de chat anterior?", + "perform_transaction": "would you like to perform a {{action}} transaction?", + "provide_thread": "Proporcione un título de hilo", + "publish_app": "¿Le gustaría publicar esta aplicación?", + "publish_avatar": "¿Le gustaría publicar un avatar?", + "publish_qdn": "¿Le gustaría publicar su configuración en QDN (cifrado)?", + "overwrite_changes": "La aplicación no pudo descargar sus aplicaciones fijadas existentes de QDN. ¿Le gustaría sobrescribir esos cambios?", + "rate_app": "would you like to rate this app a rating of {{ rate }}?. It will create a POLL tx.", + "register_name": "¿Le gustaría registrar este nombre?", + "reset_pinned": "¿No te gustan tus cambios locales actuales? ¿Le gustaría restablecer las aplicaciones fijadas predeterminadas?", + "reset_qdn": "¿No te gustan tus cambios locales actuales? ¿Le gustaría restablecer a sus aplicaciones guardadas de QDN guardadas?", + "transfer_qort": "would you like to transfer {{ amount }} QORT" + }, + "success": { + "order_submitted": "Su pedido de compra fue enviado", + "published": "publicado con éxito. Espere un par de minutos para que la red propoque los cambios.", + "published_qdn": "publicado con éxito a QDN", + "rated_app": "calificado con éxito. Espere un par de minutos para que la red propoque los cambios.", + "request_read": "He leído esta solicitud", + "transfer": "¡La transferencia fue exitosa!", + "voted": "votado con éxito. Espere un par de minutos para que la red propoque los cambios." + } + }, + "minting": { + "account_details": "detalles de la cuenta de minting", + "actions": "acciones de minting", + "average_blocktime": "tiempo promedio por bloque de Qortal", + "average_blocks_per_day": "promedio de bloques por día", + "average_created_qorts_per_day": "promedio de QORT creados por día", + "blockchain_statistics": "estadísticas de la blockchain", + "blocks_next_level": "bloques para el siguiente nivel", + "current_level": "nivel actual", + "current_status": "estado actual", + "current_tier": "nivel actual", + "current_tier_content": "{{ tier }} (Nivels {{ levels }})", + "details": "detalles de minting", + "next_level": "Con minting 24/7 alcanzarás el nivel {{ level }} en {{ count }} días", + "rewards_info": "información sobre recompensas de minting", + "reward_per_block": "recompensa estimada por bloque", + "reward_per_day": "recompensa estimada por día", + "status": { + "minting": "(acuñado)", + "not_minting": "(no acuñar)", + "no_status": "sin estado", + "synchronized": "sincronizado ({{ percent }}%)", + "synchronizing": "sincronización ({{ percent }}%)..." + }, + "status_title": "estado de acuñación", + "tier_share_per_block": "porción del nivel por bloque", + "total_minter_in_tier": "total de minters en el nivel" + }, + "name": "nombre", + "name_app": "nombre/aplicación", + "new_post_in": "new post in {{ title }}", + "none": "ninguno", + "note": "nota", + "option": "opción", + "option_no": "No hay opciones", + "option_other": "opción", + "page": { + "last": "último", + "first": "primero", + "next": "próximo", + "previous": "anterior" + }, + "payment_notification": "notificación de pago", + "payment": "pago", + "poll_embed": "encuesta", + "port": "puerto", + "price": "precio", + "publish": "publicar", + "q_apps": { + "about": "Sobre este Q-App", + "q_mail": "QAIL", + "q_manager": "manager", + "q_sandbox": "Q-Sandbox", + "q_wallets": "Medillas Q" + }, + "receiver": "receptor", + "sender": "remitente", + "server": "servidor", + "service_type": "tipo de servicio", + "settings": "ajustes", + "sort": { + "by_member": "por miembro" + }, + "supply": "suministrar", + "tags": "etiquetas", + "theme": { + "dark": "oscuro", + "dark_mode": "modo oscuro", + "default": "tema predeterminado", + "light": "luz", + "light_mode": "modo de luz", + "manager": "gerente de tema", + "name": "nombre del tema" + }, + "thread": "hilo", + "thread_other": "trapos", + "thread_title": "título de hilo", + "time": { + "day_one": "{{count}} day", + "day_other": "{{count}} days", + "hour_one": "{{count}} hour", + "hour_other": "{{count}} hours", + "minute_one": "{{count}} minute", + "minute_other": "{{count}} minutes", + "time": "tiempo" + }, + "title": "título", + "to": "a", + "tutorial": "tutorial", + "url": "url", + "user_lookup": "búsqueda de usuarios", + "vote": "votar", + "vote_other": "{{ count }} votes", + "zip": "cremallera", + "wallet": { + "litecoin": "billetera", + "qortal": "billetera Qortal", + "wallet": "billetera", + "wallet_other": "billeteras" + }, + "website": "sitio web", + "welcome": "bienvenido" +} diff --git a/src/i18n/locales/es/group.json b/src/i18n/locales/es/group.json new file mode 100644 index 0000000..a5b49b2 --- /dev/null +++ b/src/i18n/locales/es/group.json @@ -0,0 +1,163 @@ +{ + "action": { + "add_promotion": "añadir promoción", + "ban": "expulsar miembro del grupo", + "cancel_ban": "cancelar expulsión", + "copy_private_key": "copiar clave privada", + "create_group": "crear grupo", + "disable_push_notifications": "desactivar todas las notificaciones push", + "export_password": "exportar contraseña", + "export_private_key": "exportar clave privada", + "find_group": "encontrar grupo", + "join_group": "unirse al grupo", + "kick_member": "eliminar miembro del grupo", + "invite_member": "invitar miembro", + "leave_group": "salir del grupo", + "load_members": "cargar miembros con nombres", + "make_admin": "hacer administrador", + "manage_members": "gestionar miembros", + "promote_group": "promocionar tu grupo a no miembros", + "publish_announcement": "publicar anuncio", + "publish_avatar": "publicar avatar", + "refetch_page": "recargar página", + "remove_admin": "quitar como administrador", + "remove_minting_account": "eliminar cuenta de minteo", + "return_to_thread": "volver a los hilos", + "scroll_bottom": "desplazar al final", + "scroll_unread_messages": "desplazar a mensajes no leídos", + "select_group": "seleccionar grupo", + "visit_q_mintership": "visitar Q-Mintership" + }, + "advanced_options": "opciones avanzadas", + "block_delay": { + "minimum": "retraso mínimo de bloque", + "maximum": "retraso máximo de bloque" + }, + "group": { + "approval_threshold": "umbral de aprobación del grupo", + "avatar": "avatar del grupo", + "closed": "cerrado (privado) - los usuarios necesitan permiso para unirse", + "description": "descripción del grupo", + "id": "ID del grupo", + "invites": "invitaciones del grupo", + "group": "grupo", + "group_name": "grupo: {{ name }}", + "group_other": "grupos", + "groups_admin": "grupos donde eres administrador", + "management": "gestión del grupo", + "member_number": "número de miembros", + "messaging": "mensajería", + "name": "nombre del grupo", + "open": "abierto (público)", + "private": "grupo privado", + "promotions": "promociones del grupo", + "public": "grupo público", + "type": "tipo de grupo" + }, + "invitation_expiry": "tiempo de expiración de la invitación", + "invitees_list": "lista de invitados", + "join_link": "enlace para unirse al grupo", + "join_requests": "solicitudes de unión", + "last_message": "último mensaje", + "last_message_date": "último mensaje: {{date }}", + "latest_mails": "últimos Q-Mails", + "message": { + "generic": { + "avatar_publish_fee": "publicar un avatar requiere {{ fee }}", + "avatar_registered_name": "se necesita un nombre registrado para establecer un avatar", + "admin_only": "solo se mostrarán los grupos donde eres administrador", + "already_in_group": "¡ya estás en este grupo!", + "block_delay_minimum": "retraso mínimo de bloque para aprobaciones de transacciones del grupo", + "block_delay_maximum": "retraso máximo de bloque para aprobaciones de transacciones del grupo", + "closed_group": "este es un grupo cerrado/privado, deberás esperar a que un administrador acepte tu solicitud", + "descrypt_wallet": "descifrando cartera...", + "encryption_key": "la clave de cifrado común del grupo está en proceso de creación. Espera unos minutos...", + "group_announcement": "anuncios del grupo", + "group_approval_threshold": "umbral de aprobación del grupo (número / porcentaje de administradores que deben aprobar una transacción)", + "group_encrypted": "grupo cifrado", + "group_invited_you": "{{group}} te ha invitado", + "group_key_created": "primera clave de grupo creada.", + "group_member_list_changed": "la lista de miembros ha cambiado. Vuelve a cifrar la clave secreta.", + "group_no_secret_key": "no hay clave secreta del grupo. ¡Sé el primer administrador en publicarla!", + "group_secret_key_no_owner": "la última clave secreta fue publicada por alguien que no es el dueño. Como propietario, vuelve a cifrarla como medida de seguridad.", + "invalid_content": "contenido, remitente o marca de tiempo inválido en los datos de reacción", + "invalid_data": "error al cargar contenido: datos inválidos", + "latest_promotion": "solo se mostrará la última promoción de la semana para tu grupo.", + "loading_members": "cargando lista de miembros con nombres... espera.", + "max_chars": "máximo 200 caracteres. Tarifa de publicación", + "manage_minting": "gestionar tu minteo", + "minter_group": "actualmente no formas parte del grupo MINTER", + "mintership_app": "visita la app Q-Mintership para postularte como minter", + "minting_account": "cuenta de minteo:", + "minting_keys_per_node": "solo se permiten 2 claves de minteo por nodo. Elimina una para usar esta cuenta.", + "minting_keys_per_node_different": "solo se permiten 2 claves de minteo por nodo. Elimina una para añadir otra cuenta.", + "node_minting_account": "cuentas de minteo del nodo", + "node_minting_key": "ya tienes una clave de minteo para esta cuenta en este nodo", + "no_announcement": "no hay anuncios", + "no_display": "nada que mostrar", + "no_selection": "ningún grupo seleccionado", + "not_part_group": "no formas parte del grupo cifrado. Espera a que un admin recifre las claves.", + "only_encrypted": "solo se mostrarán los mensajes no cifrados.", + "only_private_groups": "solo se mostrarán los grupos privados", + "pending_join_requests": "{{ group }} tiene {{ count }} solicitudes de unión pendientes", + "private_key_copied": "clave privada copiada", + "provide_message": "por favor proporciona un primer mensaje al hilo", + "secure_place": "guarda tu clave privada en un lugar seguro. ¡No la compartas!", + "setting_group": "configurando grupo... espera." + }, + "error": { + "access_name": "no se puede enviar un mensaje sin acceso a tu nombre", + "descrypt_wallet": "error al descifrar la cartera {{ message }}", + "description_required": "por favor proporciona una descripción", + "group_info": "no se puede acceder a la información del grupo", + "group_join": "no se pudo unir al grupo", + "group_promotion": "error al publicar la promoción. Inténtalo de nuevo", + "group_secret_key": "no se puede obtener la clave secreta del grupo", + "name_required": "por favor proporciona un nombre", + "notify_admins": "intenta notificar a un administrador de la lista a continuación:", + "qortals_required": "necesitas al menos {{ quantity }} QORT para enviar un mensaje", + "timeout_reward": "se agotó el tiempo de espera para la confirmación del rewardshare", + "thread_id": "no se pudo encontrar el ID del hilo", + "unable_determine_group_private": "no se pudo determinar si el grupo es privado", + "unable_minting": "no se pudo iniciar el minteo" + }, + "success": { + "group_ban": "miembro expulsado del grupo exitosamente. Los cambios pueden tardar unos minutos", + "group_creation": "grupo creado exitosamente. Los cambios pueden tardar unos minutos", + "group_creation_name": "grupo {{group_name}} creado: esperando confirmación", + "group_creation_label": "grupo {{name}} creado: ¡éxito!", + "group_invite": "{{invitee}} invitado exitosamente. Los cambios pueden tardar unos minutos", + "group_join": "solicitud para unirse enviada con éxito. Los cambios pueden tardar unos minutos", + "group_join_name": "te has unido al grupo {{group_name}}: esperando confirmación", + "group_join_label": "te has unido al grupo {{name}}: ¡éxito!", + "group_join_request": "solicitud para unirse al grupo {{group_name}} enviada: esperando confirmación", + "group_join_outcome": "solicitud para unirse al grupo {{group_name}}: ¡éxito!", + "group_kick": "miembro eliminado exitosamente. Los cambios pueden tardar unos minutos", + "group_leave": "solicitud para salir del grupo enviada con éxito. Los cambios pueden tardar unos minutos", + "group_leave_name": "saliste del grupo {{group_name}}: esperando confirmación", + "group_leave_label": "saliste del grupo {{name}}: ¡éxito!", + "group_member_admin": "miembro promovido a administrador exitosamente. Los cambios pueden tardar unos minutos", + "group_promotion": "promoción publicada con éxito. Puede tardar unos minutos en aparecer", + "group_remove_member": "administrador eliminado exitosamente. Los cambios pueden tardar unos minutos", + "invitation_cancellation": "invitación cancelada exitosamente. Los cambios pueden tardar unos minutos", + "invitation_request": "solicitud de unión aceptada: esperando confirmación", + "loading_threads": "cargando hilos... espera.", + "post_creation": "publicación creada con éxito. Puede tardar un poco en propagarse", + "published_secret_key": "clave secreta publicada para grupo {{ group_id }}: esperando confirmación", + "published_secret_key_label": "clave secreta publicada para grupo {{ group_id }}: ¡éxito!", + "registered_name": "registrado con éxito. Los cambios pueden tardar unos minutos", + "registered_name_label": "nombre registrado: esperando confirmación", + "registered_name_success": "nombre registrado: ¡éxito!", + "rewardshare_add": "añadir rewardshare: esperando confirmación", + "rewardshare_add_label": "añadir rewardshare: ¡éxito!", + "rewardshare_creation": "confirmando la creación del rewardshare en la cadena. Puede tardar hasta 90 segundos.", + "rewardshare_confirmed": "rewardshare confirmado. Haz clic en Siguiente.", + "rewardshare_remove": "eliminar rewardshare: esperando confirmación", + "rewardshare_remove_label": "eliminar rewardshare: ¡éxito!", + "thread_creation": "hilo creado exitosamente. Puede tardar un poco en propagarse", + "unbanned_user": "usuario desbloqueado exitosamente. Los cambios pueden tardar unos minutos", + "user_joined": "¡usuario unido con éxito!" + } + }, + "thread_posts": "nuevas publicaciones del hilo" +} diff --git a/src/i18n/locales/es/question.json b/src/i18n/locales/es/question.json new file mode 100644 index 0000000..78710fc --- /dev/null +++ b/src/i18n/locales/es/question.json @@ -0,0 +1,194 @@ +{ + "accept_app_fee": "aceptar tarifa de la aplicación", + "always_authenticate": "siempre autenticar automáticamente", + "always_chat_messages": "siempre permitir mensajes de chat de esta aplicación", + "always_retrieve_balance": "siempre permitir la recuperación automática del saldo", + "always_retrieve_list": "siempre permitir la recuperación automática de listas", + "always_retrieve_wallet": "siempre permitir la recuperación automática del monedero", + "always_retrieve_wallet_transactions": "siempre permitir la recuperación automática de transacciones del monedero", + "amount_qty": "cantidad: {{ quantity }}", + "asset_name": "activo: {{ asset }}", + "assets_used_pay": "activo usado para pagos: {{ asset }}", + "coin": "moneda: {{ coin }}", + "description": "descripción: {{ description }}", + "deploy_at": "¿Desea implementar este AT?", + "download_file": "¿Desea descargar:", + "message": { + "error": { + "add_to_list": "no se pudo agregar a la lista", + "at_info": "no se pudo encontrar la información del AT.", + "buy_order": "no se pudo enviar la orden de intercambio", + "cancel_sell_order": "falló al cancelar la orden de venta. ¡Inténtalo de nuevo!", + "copy_clipboard": "no se pudo copiar al portapapeles", + "create_sell_order": "no se pudo crear la orden de venta. ¡Inténtalo de nuevo!", + "create_tradebot": "no se pudo crear el bot de intercambio", + "decode_transaction": "no se pudo decodificar la transacción", + "decrypt": "no se pudo descifrar", + "decrypt_message": "no se pudo descifrar el mensaje. Asegúrese de que los datos y las claves sean correctos", + "decryption_failed": "falló el descifrado", + "empty_receiver": "¡el receptor no puede estar vacío!", + "encrypt": "no se pudo cifrar", + "encryption_failed": "falló el cifrado", + "encryption_requires_public_key": "el cifrado requiere claves públicas", + "fetch_balance_token": "no se pudo obtener el saldo de {{ token }}. ¡Inténtalo de nuevo!", + "fetch_balance": "no se pudo obtener el saldo", + "fetch_connection_history": "no se pudo obtener el historial de conexiones del servidor", + "fetch_generic": "no se pudo obtener", + "fetch_group": "no se pudo obtener el grupo", + "fetch_list": "no se pudo obtener la lista", + "fetch_poll": "no se pudo obtener la encuesta", + "fetch_recipient_public_key": "no se pudo obtener la clave pública del destinatario", + "fetch_wallet_info": "no se pudo obtener la información de la cartera", + "fetch_wallet_transactions": "no se pudieron obtener las transacciones de la cartera", + "fetch_wallet": "falló la obtención de la cartera. Intenta de nuevo", + "file_extension": "no se pudo derivar una extensión de archivo", + "gateway_balance_local_node": "no se puede ver el saldo de {{ token }} a través del gateway. Utilice su nodo local.", + "gateway_non_qort_local_node": "no se puede enviar una moneda que no sea QORT a través del gateway. Utilice su nodo local.", + "gateway_retrieve_balance": "no está permitido recuperar el saldo de {{ token }} a través de un gateway", + "gateway_wallet_local_node": "no se puede ver la cartera de {{ token }} a través del gateway. Utilice su nodo local.", + "get_foreign_fee": "error al obtener la tarifa extranjera", + "insufficient_balance_qort": "su saldo de QORT es insuficiente", + "insufficient_balance": "su saldo de activo es insuficiente", + "insufficient_funds": "fondos insuficientes", + "invalid_encryption_iv": "IV no válido: AES-GCM requiere un IV de 12 bytes", + "invalid_encryption_key": "clave no válida: AES-GCM requiere una clave de 256 bits.", + "invalid_fullcontent": "el campo fullContent tiene un formato no válido. Use una cadena, base64 u objeto", + "invalid_receiver": "dirección o nombre del receptor no válido", + "invalid_type": "tipo no válido", + "mime_type": "no se pudo derivar un tipo MIME", + "missing_fields": "faltan campos: {{ fields }}", + "name_already_for_sale": "este nombre ya está en venta", + "name_not_for_sale": "este nombre no está en venta", + "no_api_found": "no se encontró una API utilizable", + "no_data_encrypted_resource": "sin datos en el recurso cifrado", + "no_data_file_submitted": "no se enviaron datos ni archivo", + "no_group_found": "grupo no encontrado", + "no_group_key": "no se encontró clave del grupo", + "no_poll": "encuesta no encontrada", + "no_resources_publish": "no hay recursos para publicar", + "node_info": "no se pudo recuperar la información del nodo", + "node_status": "no se pudo recuperar el estado del nodo", + "only_encrypted_data": "solo se pueden usar datos cifrados en servicios privados", + "perform_request": "no se pudo realizar la solicitud", + "poll_create": "no se pudo crear la encuesta", + "poll_vote": "falló al votar en la encuesta", + "process_transaction": "no se pudo procesar la transacción", + "provide_key_shared_link": "para un recurso cifrado, debe proporcionar la clave para crear el enlace compartido", + "registered_name": "se necesita un nombre registrado para publicar", + "resources_publish": "algunos recursos no se pudieron publicar", + "retrieve_file": "no se pudo recuperar el archivo", + "retrieve_keys": "no se pudieron recuperar las claves", + "retrieve_summary": "no se pudo recuperar el resumen", + "retrieve_sync_status": "error al recuperar el estado de sincronización de {{ token }}", + "same_foreign_blockchain": "todos los AT solicitados deben pertenecer a la misma blockchain extranjera.", + "send": "no se pudo enviar", + "server_current_add": "no se pudo agregar el servidor actual", + "server_current_set": "no se pudo establecer el servidor actual", + "server_info": "error al recuperar la información del servidor", + "server_remove": "no se pudo eliminar el servidor", + "submit_sell_order": "no se pudo enviar la orden de venta", + "synchronization_attempts": "no se pudo sincronizar después de {{ count }} intentos", + "timeout_request": "la solicitud excedió el tiempo límite", + "token_not_supported": "{{ token }} no es compatible con esta llamada", + "transaction_activity_summary": "error en el resumen de actividad de transacción", + "unknown_error": "error desconocido", + "unknown_admin_action_type": "tipo de acción administrativa desconocida: {{ type }}", + "update_foreign_fee": "no se pudo actualizar la tarifa extranjera", + "update_tradebot": "no se pudo actualizar el bot de intercambio", + "upload_encryption": "la carga falló debido a un error de cifrado", + "upload": "carga fallida", + "use_private_service": "para publicaciones cifradas, utilice un servicio que termine en _PRIVATE", + "user_qortal_name": "el usuario no tiene un nombre Qortal", + "max_size_publish": "el tamaño máximo permitido por archivo es de {{size}} GB.", + "max_size_publish_public": "el tamaño máximo permitido en el nodo público es de {{size}} MB. Utilice su nodo local para archivos más grandes." + }, + "generic": { + "calculate_fee": "*La tarifa de {{ amount }} sats se deriva de {{ rate }} sats por KB, para una transacción de aproximadamente 300 bytes.", + "confirm_join_group": "confirmar unión al grupo:", + "include_data_decrypt": "por favor incluya los datos para descifrar", + "include_data_encrypt": "por favor incluya los datos para cifrar", + "max_retry_transaction": "se alcanzó el número máximo de reintentos. Saltando transacción.", + "no_action_public_node": "esta acción no se puede realizar a través de un nodo público", + "private_service": "por favor utilice un servicio privado", + "provide_group_id": "por favor proporcione un groupId", + "read_transaction_carefully": "¡lea cuidadosamente la transacción antes de aceptar!", + "user_declined_add_list": "el usuario rechazó agregar a la lista", + "user_declined_delete_from_list": "el usuario rechazó eliminar de la lista", + "user_declined_delete_hosted_resources": "el usuario rechazó eliminar recursos alojados", + "user_declined_join": "el usuario rechazó unirse al grupo", + "user_declined_list": "el usuario rechazó obtener la lista de recursos alojados", + "user_declined_request": "el usuario rechazó la solicitud", + "user_declined_save_file": "el usuario rechazó guardar el archivo", + "user_declined_send_message": "el usuario rechazó enviar el mensaje", + "user_declined_share_list": "el usuario rechazó compartir la lista" + } + }, + "name": "nombre: {{ name }}", + "option": "opción: {{ option }}", + "options": "opciones: {{ optionList }}", + "permission": { + "access_list": "¿Deseas permitir que esta aplicación acceda a la lista?", + "add_admin": "¿Deseas permitir que esta aplicación agregue al usuario {{ invitee }} como administrador?", + "all_item_list": "¿Deseas permitir que esta aplicación agregue lo siguiente a la lista {{ name }}:", + "authenticate": "¿Deseas permitir que esta aplicación se autentique?", + "ban": "¿Deseas permitir que esta aplicación expulse a {{ partecipant }} del grupo?", + "buy_name_detail": "comprando {{ name }} por {{ price }} QORT", + "buy_name": "¿Deseas permitir que esta aplicación compre un nombre?", + "buy_order_fee_estimation_one": "Esta tarifa es una estimación basada en {{ count }} orden, asumiendo un tamaño de 300 bytes y una tasa de {{ fee }} {{ ticker }} por KB.", + "buy_order_fee_estimation_other": "Esta tarifa es una estimación basada en {{ count }} órdenes, asumiendo un tamaño de 300 bytes y una tasa de {{ fee }} {{ ticker }} por KB.", + "buy_order_per_kb": "{{ fee }} {{ ticker }} por KB", + "buy_order_quantity_one": "{{ count }} orden de compra", + "buy_order_quantity_other": "{{ count }} órdenes de compra", + "buy_order_ticker": "{{ qort_amount }} QORT por {{ foreign_amount }} {{ ticker }}", + "buy_order": "¿Deseas permitir que esta aplicación realice una orden de compra?", + "cancel_ban": "¿Deseas permitir que esta aplicación cancele la expulsión del usuario {{ partecipant }} del grupo?", + "cancel_group_invite": "¿Deseas permitir que esta aplicación cancele la invitación al grupo de {{ invitee }}?", + "cancel_sell_order": "¿Deseas permitir que esta aplicación cancele una orden de venta?", + "create_group": "¿Deseas permitir que esta aplicación cree un grupo?", + "delete_hosts_resources": "¿Deseas permitir que esta aplicación elimine {{ size }} recursos alojados?", + "fetch_balance": "¿Deseas permitir que esta aplicación consulte tu saldo de {{ coin }}?", + "get_wallet_info": "¿Deseas permitir que esta aplicación acceda a la información de tu billetera?", + "get_wallet_transactions": "¿Deseas permitir que esta aplicación consulte tus transacciones?", + "invite": "¿Deseas permitir que esta aplicación invite a {{ invitee }}?", + "kick": "¿Deseas permitir que esta aplicación expulse a {{ partecipant }} del grupo?", + "leave_group": "¿Deseas permitir que esta aplicación abandone el siguiente grupo?", + "list_hosted_data": "¿Deseas permitir que esta aplicación obtenga una lista de tus datos alojados?", + "order_detail": "{{ qort_amount }} QORT por {{ foreign_amount }} {{ ticker }}", + "pay_publish": "¿Deseas permitir que esta aplicación realice los siguientes pagos y publicaciones?", + "perform_admin_action_with_value": "con valor: {{ value }}", + "perform_admin_action": "¿Deseas permitir que esta aplicación realice la acción administrativa: {{ type }}?", + "publish_qdn": "¿Deseas permitir que esta aplicación publique en QDN?", + "register_name": "¿Deseas permitir que esta aplicación registre este nombre?", + "remove_admin": "¿Deseas permitir que esta aplicación elimine al usuario {{ partecipant }} como administrador?", + "remove_from_list": "¿Deseas permitir que esta aplicación elimine lo siguiente de la lista {{ name }}?", + "sell_name_cancel": "¿Deseas permitir que esta aplicación cancele la venta de un nombre?", + "sell_name_transaction_detail": "vender {{ name }} por {{ price }} QORT", + "sell_name_transaction": "¿Deseas permitir que esta aplicación cree una transacción para vender un nombre?", + "sell_order": "¿Deseas permitir que esta aplicación realice una orden de venta?", + "send_chat_message": "¿Deseas permitir que esta aplicación envíe este mensaje de chat?", + "send_coins": "¿Deseas permitir que esta aplicación envíe monedas?", + "server_add": "¿Deseas permitir que esta aplicación agregue un servidor?", + "server_remove": "¿Deseas permitir que esta aplicación elimine un servidor?", + "set_current_server": "¿Deseas permitir que esta aplicación establezca el servidor actual?", + "sign_fee": "¿Deseas permitir que esta aplicación firme las tarifas requeridas para todas tus ofertas comerciales?", + "sign_process_transaction": "¿Deseas permitir que esta aplicación firme y procese una transacción?", + "sign_transaction": "¿Deseas permitir que esta aplicación firme una transacción?", + "transfer_asset": "¿Deseas permitir que esta aplicación transfiera el siguiente activo?", + "update_foreign_fee": "¿Deseas permitir que esta aplicación actualice las tarifas externas en tu nodo?", + "update_group_detail": "nuevo propietario: {{ owner }}", + "update_group": "¿Deseas permitir que esta aplicación actualice este grupo?" + }, + "poll": "votación: {{ name }}", + "provide_recipient_group_id": "por favor proporciona un destinatario o groupId", + "request_create_poll": "estás solicitando crear la siguiente votación:", + "request_vote_poll": "se te solicita votar en la siguiente votación:", + "sats_per_kb": "{{ amount }} sats por KB", + "sats": "{{ amount }} sats", + "server_host": "host: {{ host }}", + "server_type": "tipo: {{ type }}", + "to_group": "a: grupo {{ group_id }}", + "to_recipient": "a: {{ recipient }}", + "total_locking_fee": "cuota total de bloqueo:", + "total_unlocking_fee": "cuota total de desbloqueo:", + "value": "valor: {{ value }}" +} diff --git a/src/i18n/locales/es/tutorial.json b/src/i18n/locales/es/tutorial.json new file mode 100644 index 0000000..f2ce4f1 --- /dev/null +++ b/src/i18n/locales/es/tutorial.json @@ -0,0 +1,21 @@ +{ + "1_getting_started": "1. Comenzando", + "2_overview": "2. Visión general", + "3_groups": "3. Grupos de Qortal", + "4_obtain_qort": "4. Obtener QORT", + "account_creation": "creación de cuenta", + "important_info": "información importante", + "apps": { + "dashboard": "1. Panel de aplicaciones", + "navigation": "2. Navegación de aplicaciones" + }, + "initial": { + "recommended_qort_qty": "ten al menos {{ quantity }} QORT en tu billetera", + "explore": "explorar", + "general_chat": "chat general", + "getting_started": "comenzando", + "register_name": "registrar un nombre", + "see_apps": "ver aplicaciones", + "trade_qort": "intercambiar QORT" + } +} diff --git a/src/i18n/locales/fr/auth.json b/src/i18n/locales/fr/auth.json new file mode 100644 index 0000000..27a6801 --- /dev/null +++ b/src/i18n/locales/fr/auth.json @@ -0,0 +1,138 @@ +{ + "account": { + "your": "votre compte", + "account_many": "comptes", + "account_one": "compte", + "selected": "compte sélectionné" + }, + "action": { + "add": { + "account": "ajouter un compte", + "seed_phrase": "ajouter une phrase de récupération" + }, + "authenticate": "authentifier", + "block": "bloquer", + "block_all": "tout bloquer", + "block_data": "bloquer les données QDN", + "block_name": "bloquer le nom", + "block_txs": "bloquer les transactions", + "fetch_names": "récupérer les noms", + "copy_address": "copier l'adresse", + "create_account": "créer un compte", + "create_qortal_account": "créez votre compte Qortal en cliquant sur SUIVANT ci-dessous.", + "choose_password": "choisir un nouveau mot de passe", + "download_account": "télécharger le compte", + "enter_amount": "veuillez entrer un montant supérieur à 0", + "enter_recipient": "veuillez entrer un destinataire", + "enter_wallet_password": "veuillez entrer le mot de passe de votre portefeuille", + "export_seedphrase": "exporter la phrase de récupération", + "insert_name_address": "veuillez entrer un nom ou une adresse", + "publish_admin_secret_key": "publier la clé secrète administrateur", + "publish_group_secret_key": "publier la clé secrète du groupe", + "reencrypt_key": "re-chiffrer la clé", + "return_to_list": "retourner à la liste", + "setup_qortal_account": "configurer votre compte Qortal", + "unblock": "débloquer", + "unblock_name": "débloquer le nom" + }, + "address": "adresse", + "address_name": "adresse ou nom", + "advanced_users": "pour utilisateurs avancés", + "apikey": { + "alternative": "alternative : sélection de fichier", + "change": "changer la clé API", + "enter": "entrer la clé API", + "import": "importer la clé API", + "key": "clé API", + "select_valid": "sélectionner une clé API valide" + }, + "authentication": "authentification", + "blocked_users": "utilisateurs bloqués", + "build_version": "version de build", + "message": { + "error": { + "account_creation": "impossible de créer le compte.", + "address_not_existing": "l'adresse n'existe pas sur la blockchain", + "block_user": "impossible de bloquer l'utilisateur", + "create_simmetric_key": "impossible de créer une clé symétrique", + "decrypt_data": "impossible de déchiffrer les données", + "decrypt": "impossible de déchiffrer", + "encrypt_content": "impossible de chiffrer le contenu", + "fetch_user_account": "impossible de récupérer le compte utilisateur", + "field_not_found_json": "{{ field }} introuvable dans le JSON", + "find_secret_key": "clé secrète correcte introuvable", + "incorrect_password": "mot de passe incorrect", + "invalid_qortal_link": "lien Qortal invalide", + "invalid_secret_key": "clé secrète invalide", + "invalid_uint8": "les données Uint8Array soumises sont invalides", + "name_not_existing": "le nom n'existe pas", + "name_not_registered": "nom non enregistré", + "read_blob_base64": "échec de la lecture du Blob en base64", + "reencrypt_secret_key": "impossible de re-chiffrer la clé secrète", + "set_apikey": "échec de la configuration de la clé API :" + }, + "generic": { + "blocked_addresses": "adresses bloquées – bloque le traitement des transactions", + "blocked_names": "noms bloqués pour QDN", + "blocking": "blocage de {{ name }}", + "choose_block": "choisissez 'bloquer les transactions' ou 'tout' pour bloquer les messages de chat", + "congrats_setup": "félicitations, tout est prêt !", + "decide_block": "décidez quoi bloquer", + "downloading_encryption_keys": "téléchargement des clés de chiffrement", + "fetching_admin_secret_key": "récupération de la clé secrète administrateur", + "fetching_group_secret_key": "récupération de la clé secrète de groupe publiée", + "keep_secure": "gardez votre fichier de compte en sécurité", + "last_encryption_date": "dernière date de chiffrement : {{ date }} par {{ name }}", + "locating_encryption_keys": "localisation des clés de chiffrement", + "name_address": "nom ou adresse", + "no_account": "aucun compte enregistré", + "no_minimum_length": "aucune exigence de longueur minimale", + "no_secret_key_published": "aucune clé secrète publiée pour l'instant", + "publishing_key": "rappel : après la publication de la clé, cela peut prendre quelques minutes pour qu'elle apparaisse. Veuillez patienter.", + "seedphrase_notice": "une PHRASE DE RÉCUPÉRATION a été générée aléatoirement en arrière-plan.", + "turn_local_node": "veuillez activer votre nœud local", + "type_seed": "tapez ou collez votre phrase de récupération", + "your_accounts": "vos comptes enregistrés" + }, + "success": { + "reencrypted_secret_key": "clé secrète re-chiffrée avec succès. Les changements peuvent prendre quelques minutes pour se propager. Rafraîchissez le groupe dans 5 minutes." + } + }, + "node": { + "choose": "choisir un nœud personnalisé", + "custom_many": "nœuds personnalisés", + "use_custom": "utiliser un nœud personnalisé", + "use_local": "utiliser un nœud local", + "using": "utilisation du nœud", + "using_public": "utilisation d'un nœud public", + "using_public_gateway": "utilisation du nœud public : {{ gateway }}" + }, + "note": "note", + "password": "mot de passe", + "password_confirmation": "confirmer le mot de passe", + "seed_phrase": "phrase de récupération", + "seed_your": "votre phrase de récupération", + "tips": { + "additional_wallet": "utilisez cette option pour connecter d'autres portefeuilles Qortal que vous avez déjà créés, afin de vous connecter plus tard. Vous aurez besoin de votre fichier JSON de sauvegarde.", + "digital_id": "votre portefeuille est comme votre identifiant numérique sur Qortal, et il vous permet de vous connecter à l’interface utilisateur. Il contient votre adresse publique et le nom Qortal que vous choisirez. Chaque transaction est liée à votre ID, et c’est là que vous gérez votre QORT et d’autres cryptomonnaies échangeables sur Qortal.", + "existing_account": "vous avez déjà un compte Qortal ? Entrez votre phrase secrète de sauvegarde ici pour y accéder. Cette phrase est l’un des moyens de récupérer votre compte.", + "key_encrypt_admin": "cette clé sert à chiffrer le contenu ADMIN. Seuls les administrateurs verront ce contenu chiffré.", + "key_encrypt_group": "cette clé sert à chiffrer le contenu du GROUPE. C’est la seule utilisée actuellement dans cette interface. Tous les membres du groupe pourront voir le contenu chiffré.", + "new_account": "créer un compte signifie créer un nouveau portefeuille et identifiant numérique pour commencer à utiliser Qortal. Une fois le compte créé, vous pouvez obtenir du QORT, acheter un nom et un avatar, publier des vidéos et blogs, et bien plus encore.", + "new_users": "les nouveaux utilisateurs commencent ici !", + "safe_place": "sauvegardez votre compte dans un endroit sûr que vous retiendrez !", + "view_seedphrase": "si vous souhaitez VOIR LA PHRASE DE RÉCUPÉRATION, cliquez sur le mot 'PHRASE DE RÉCUPÉRATION' dans ce texte. Ces phrases sont utilisées pour générer la clé privée de votre compte Qortal. Pour des raisons de sécurité, elles ne sont PAS affichées par défaut.", + "wallet_secure": "gardez le fichier de votre portefeuille en sécurité." + }, + "wallet": { + "password_confirmation": "confirmer le mot de passe du portefeuille", + "password": "mot de passe du portefeuille", + "keep_password": "garder le mot de passe actuel", + "new_password": "nouveau mot de passe", + "error": { + "missing_new_password": "veuillez entrer un nouveau mot de passe", + "missing_password": "veuillez entrer votre mot de passe" + } + }, + "welcome": "bienvenue sur" +} diff --git a/src/i18n/locales/fr/core.json b/src/i18n/locales/fr/core.json new file mode 100644 index 0000000..8c28c23 --- /dev/null +++ b/src/i18n/locales/fr/core.json @@ -0,0 +1,419 @@ +{ + "action": { + "accept": "accepter", + "access": "accéder", + "access_app": "application d'accès", + "add": "ajouter", + "add_custom_framework": "Ajouter un cadre personnalisé", + "add_reaction": "ajouter une réaction", + "add_theme": "Ajouter le thème", + "backup_account": "compte de sauvegarde", + "backup_wallet": "portefeuille de secours", + "cancel": "Annuler", + "cancel_invitation": "Annuler l'invitation", + "change": "changement", + "change_avatar": "changer d'avatar", + "change_file": "modifier le fichier", + "change_language": "changer la langue", + "choose": "choisir", + "choose_file": "Choisir le fichier", + "choose_image": "Choisir l'image", + "choose_logo": "Choisissez un logo", + "choose_name": "Choisissez un nom", + "close": "fermer", + "close_chat": "Fermer le chat direct", + "continue": "continuer", + "continue_logout": "continuer à se déconnecter", + "copy_link": "Copier le lien", + "create_apps": "créer des applications", + "create_file": "créer un fichier", + "create_transaction": "créer des transactions sur la blockchain Qortal", + "create_thread": "créer un fil", + "decline": "déclin", + "decrypt": "décrypter", + "disable_enter": "Désactiver Entrer", + "download": "télécharger", + "download_file": "Télécharger le fichier", + "edit": "modifier", + "edit_theme": "Modifier le thème", + "enable_dev_mode": "Activer le mode Dev", + "enter_name": "Entrez un nom", + "export": "exporter", + "get_qort": "Obtenez Qort", + "get_qort_trade": "Obtenez Qort à Q-trade", + "hide": "cacher", + "hide_qr_code": "Masquer le code QR", + "import": "importer", + "import_theme": "thème d'importation", + "invite": "inviter", + "invite_member": "inviter un nouveau membre", + "join": "rejoindre", + "leave_comment": "laisser un commentaire", + "load_announcements": "Chargez des annonces plus anciennes", + "login": "se connecter", + "logout": "déconnexion", + "new": { + "chat": "nouveau chat", + "post": "nouveau message", + "theme": "nouveau thème", + "thread": "nouveau fil" + }, + "notify": "aviser", + "open": "ouvrir", + "pin": "épingle", + "pin_app": "application PIN", + "pin_from_dashboard": "Pin du tableau de bord", + "post": "poste", + "post_message": "Message de publication", + "publish": "publier", + "publish_app": "Publiez votre application", + "publish_comment": "Publier un commentaire", + "refresh": "rafraîchir", + "register_name": "nom de registre", + "remove": "retirer", + "remove_reaction": "éliminer la réaction", + "return_apps_dashboard": "Retour au tableau de bord Apps", + "save": "sauvegarder", + "save_disk": "Économiser sur le disque", + "search": "recherche", + "search_apps": "Rechercher des applications", + "search_groups": "rechercher des groupes", + "search_chat_text": "Texte de chat de recherche", + "see_qr_code": "Voir le code QR", + "select_app_type": "Sélectionner le type d'application", + "select_category": "Sélectionnez la catégorie", + "select_name_app": "Sélectionnez Nom / App", + "send": "envoyer", + "send_qort": "Envoyer Qort", + "set_avatar": "Définir l'avatar", + "show": "montrer", + "show_poll": "montrer le sondage", + "start_minting": "Commencer à frapper", + "start_typing": "Commencez à taper ici ...", + "trade_qort": "Trade Qort", + "transfer_qort": "transférer Qort", + "unpin": "détacher", + "unpin_app": "Appin Upin", + "unpin_from_dashboard": "UNIN DU Tableau de bord", + "update": "mise à jour", + "update_app": "Mettez à jour votre application", + "vote": "voter" + }, + "address_your": "Votre adresse", + "admin": "administrer", + "admin_other": "administrateurs", + "all": "tous", + "amount": "montant", + "announcement": "annonce", + "announcement_other": "annonces", + "api": "API", + "app": "appliquer", + "app_other": "applications", + "app_name": "nom de l'application", + "app_private": "privé", + "app_service_type": "type de service d'application", + "apps_dashboard": "Tableau de bord Apps", + "apps_official": "Applications officielles", + "attachment": "pièce jointe", + "balance": "équilibre:", + "category": "catégorie", + "category_other": "catégories", + "chat": "chat", + "comment_other": "commentaires", + "contact_other": "contacts", + "core": { + "block_height": "hauteur de blocage", + "information": "Informations de base", + "peers": "pairs connectés", + "version": "version de base" + }, + "current_language": "current language: {{ language }}", + "dev": "dev", + "dev_mode": "mode de développement", + "domain": "domaine", + "ui": { + "version": "version d'interface utilisateur" + }, + "count": { + "none": "aucun", + "one": "un" + }, + "description": "description", + "devmode_apps": "applications de mode dev", + "directory": "annuaire", + "downloading_qdn": "Téléchargement à partir de QDN", + "fee": { + "payment": "Frais de paiement", + "publish": "Publier les frais" + }, + "for": "pour", + "general": "général", + "general_settings": "Paramètres généraux", + "home": "maison", + "identifier": "identifiant", + "image_embed": "Image intégrer", + "last_height": "dernière hauteur", + "level": "niveau", + "library": "bibliothèque", + "list": { + "bans": "liste des interdictions", + "groups": "liste des groupes", + "invites": "liste des invitations", + "join_request": "JOINT LISTE DE REQUES", + "member": "liste des membres", + "members": "liste des membres" + }, + "loading": { + "announcements": "Annonces de chargement", + "generic": "chargement...", + "chat": "Chargement de chat ... Veuillez patienter.", + "comments": "Chargement des commentaires ... Veuillez patienter.", + "posts": "Chargement des messages ... Veuillez patienter." + }, + "member": "membre", + "member_other": "membres", + "message_us": "Veuillez nous envoyer un message sur NextCloud (aucune inscription requise) ou Discord si vous avez besoin de 4 Qort pour commencer à discuter sans aucune limitation", + "message": { + "error": { + "address_not_found": "Votre adresse n'a pas été trouvée", + "app_need_name": "Votre application a besoin d'un nom", + "build_app": "Impossible de créer une application privée", + "decrypt_app": "Impossible de décrypter l'application privée '", + "download_image": "Impossible de télécharger l'image. Veuillez réessayer plus tard en cliquant sur le bouton Actualiser", + "download_private_app": "Impossible de télécharger l'application privée", + "encrypt_app": "Impossible de crypter l'application. Application non publiée '", + "fetch_app": "Impossible de récupérer l'application", + "fetch_publish": "Impossible de récupérer la publication", + "file_too_large": "file {{ filename }} is too large. Max size allowed is {{ size }} MB.", + "generic": "Une erreur s'est produite", + "initiate_download": "Échec du téléchargement", + "invalid_amount": "montant non valide", + "invalid_base64": "Données non valides Base64", + "invalid_embed_link": "lien d'intégration non valide", + "invalid_image_embed_link_name": "lien d'intégration d'image non valide. Param manquant.", + "invalid_poll_embed_link_name": "lien d'intégration de sondage non valide. Nom manquant.", + "invalid_signature": "signature non valide", + "invalid_theme_format": "format de thème non valide", + "invalid_zip": "zip non valide", + "message_loading": "Message de chargement d'erreur.", + "message_size": "your message size is of {{ size }} bytes out of a maximum of {{ maximum }}", + "minting_account_add": "Impossible d'ajouter un compte de pénitence", + "minting_account_remove": "Impossible de supprimer le compte de pénitence", + "missing_fields": "missing: {{ fields }}", + "navigation_timeout": "Délai de navigation", + "network_generic": "erreur de réseau", + "password_not_matching": "Les champs de mot de passe ne correspondent pas!", + "password_wrong": "Impossible d'authentifier. Mauvais mot de passe", + "publish_app": "Impossible de publier l'application", + "publish_image": "Impossible de publier l'image", + "rate": "incapable de noter", + "rating_option": "Impossible de trouver l'option de notation", + "save_qdn": "Impossible d'économiser sur QDN", + "send_failed": "Échec de l'envoi", + "update_failed": "Échec de la mise à jour", + "vote": "Impossible de voter" + }, + "generic": { + "already_voted": "Vous avez déjà voté.", + "avatar_size": "{{ size }} KB max. for GIFS", + "benefits_qort": "Avantages d'avoir QORT", + "building": "bâtiment", + "building_app": "application de construction", + "confirmed": "confirmé", + "created_by": "created by {{ owner }}", + "buy_order_request": "the Application
{{hostname}}
is requesting {{count}} buy order", + "buy_order_request_other": "the Application
{{hostname}}
is requesting {{count}} buy orders", + "devmode_local_node": "Veuillez utiliser votre nœud local pour le mode Dev! Déconnectez-vous et utilisez le nœud local.", + "downloading": "téléchargement", + "downloading_decrypting_app": "Téléchargement et décryptez l'application privée.", + "edited": "édité", + "editing_message": "Message d'édition", + "encrypted": "crypté", + "encrypted_not": "pas crypté", + "fee_qort": "fee: {{ message }} QORT", + "fetching_data": "Rechercher les données de l'application", + "foreign_fee": "foreign fee: {{ message }}", + "get_qort_trade_portal": "Obtenez Qort en utilisant le portail commercial de Crosschain de Qortal", + "minimal_qort_balance": "having at least {{ quantity }} QORT in your balance (4 qort balance for chat, 1.25 for name, 0.75 for some transactions)", + "mentioned": "mentionné", + "message_with_image": "Ce message a déjà une image", + "most_recent_payment": "{{ count }} most recent payment", + "name_available": "{{ name }} is available", + "name_benefits": "Avantages d'un nom", + "name_checking": "Vérifier si le nom existe déjà", + "name_preview": "Vous avez besoin d'un nom pour utiliser l'aperçu", + "name_publish": "Vous avez besoin d'un nom Qortal pour publier", + "name_rate": "Vous avez besoin d'un nom pour évaluer.", + "name_registration": "your balance is {{ balance }} QORT. A name registration requires a {{ fee }} QORT fee", + "name_unavailable": "{{ name }} is unavailable", + "no_data_image": "Aucune donnée pour l'image", + "no_description": "Aucune description", + "no_messages": "pas de messages", + "no_message": "pas de message", + "no_minting_details": "Impossible d'afficher les détails de la passerelle sur la passerelle", + "no_notifications": "pas de nouvelles notifications", + "no_payments": "Aucun paiement", + "no_pinned_changes": "Vous n'avez actuellement aucune modification à vos applications épinglées", + "no_results": "Aucun résultat", + "one_app_per_name": "Remarque: Actuellement, une seule application et site Web est autorisée par nom.", + "ongoing_transactions": "transactions en cours", + "opened": "ouvert", + "overwrite_qdn": "Écraser à QDN", + "password_confirm": "Veuillez confirmer un mot de passe", + "password_enter": "Veuillez saisir un mot de passe", + "payment_request": "the Application
{{hostname}}
is requesting a payment", + "people_reaction": "people who reacted with {{ reaction }}", + "processing_transaction": "La transaction de traitement est-elle, veuillez patienter ...", + "publish_data": "Publier des données à Qortal: n'importe quoi, des applications aux vidéos. Entièrement décentralisé!", + "publishing": "Publication ... Veuillez patienter.", + "qdn": "Utiliser une économie QDN", + "rating": "rating for {{ service }} {{ name }}", + "register_name": "Vous avez besoin d'un nom Qortal enregistré pour enregistrer vos applications épinglées sur QDN.", + "replied_to": "replied to {{ person }}", + "revert_default": "revenir à la valeur par défaut", + "revert_qdn": "revenir à QDN", + "save_qdn": "Enregistrer sur QDN", + "secure_ownership": "sécuriser la propriété des données publiées par votre nom. Vous pouvez même vendre votre nom, ainsi que vos données à un tiers.", + "select_file": "Veuillez sélectionner un fichier", + "select_image": "Veuillez sélectionner une image pour un logo", + "select_zip": "Sélectionnez un fichier .zip contenant du contenu statique:", + "sending": "envoi...", + "settings": "vous utilisez la manière d'exportation / importation d'enregistrement des paramètres.", + "space_for_admins": "désolé, cet espace est uniquement pour les administrateurs.", + "unread_messages": "messages non lus ci-dessous", + "unsaved_changes": "vous avez des modifications non enregistrées à vos applications épinglées. Enregistrez-les sur QDN.", + "updating": "mise à jour", + "wait": "attendez s'il vous plaît" + }, + "message": "message", + "promotion_text": "texte de promotion", + "question": { + "accept_vote_on_poll": "Acceptez-vous cette transaction vote_on_poll? Les sondages sont publics!", + "logout": "Êtes-vous sûr que vous aimeriez vous connecter?", + "new_user": "Êtes-vous un nouvel utilisateur?", + "delete_chat_image": "Souhaitez-vous supprimer votre image de chat précédente?", + "perform_transaction": "would you like to perform a {{action}} transaction?", + "provide_thread": "Veuillez fournir un titre de fil", + "publish_app": "Souhaitez-vous publier cette application?", + "publish_avatar": "Souhaitez-vous publier un avatar?", + "publish_qdn": "Souhaitez-vous publier vos paramètres sur QDN (chiffré)?", + "overwrite_changes": "L'application n'a pas été en mesure de télécharger vos applications épinglées existantes existantes. Souhaitez-vous écraser ces changements?", + "rate_app": "would you like to rate this app a rating of {{ rate }}?. It will create a POLL tx.", + "register_name": "Souhaitez-vous enregistrer ce nom?", + "reset_pinned": "Vous n'aimez pas vos changements locaux actuels? Souhaitez-vous réinitialiser les applications épinglées par défaut?", + "reset_qdn": "Vous n'aimez pas vos changements locaux actuels? Souhaitez-vous réinitialiser avec vos applications QDN enregistrées?", + "transfer_qort": "would you like to transfer {{ amount }} QORT" + }, + "success": { + "order_submitted": "Votre commande d'achat a été soumise", + "published": "publié avec succès. Veuillez patienter quelques minutes pour que le réseau propage les modifications.", + "published_qdn": "publié avec succès sur QDN", + "rated_app": "Évalué avec succès. Veuillez patienter quelques minutes pour que le réseau propage les modifications.", + "request_read": "J'ai lu cette demande", + "transfer": "Le transfert a réussi!", + "voted": "voté avec succès. Veuillez patienter quelques minutes pour que le réseau propage les modifications." + } + }, + "minting": { + "account_details": "détails du compte de minting", + "actions": "actions de minting", + "average_blocktime": "temps moyen par bloc Qortal", + "average_blocks_per_day": "blocs moyens par jour", + "average_created_qorts_per_day": "QORT créés en moyenne par jour", + "blockchain_statistics": "statistiques de la blockchain", + "blocks_next_level": "blocs jusqu'au niveau suivant", + "current_level": "niveau actuel", + "current_status": "statut actuel", + "current_tier": "niveau actuel", + "current_tier_content": "{{ tier }} (Niveaux {{ levels }})", + "details": "détails du minting", + "next_level": "Avec un minting 24/7, vous atteindrez le niveau {{ level }} en {{ count }} jours", + "rewards_info": "informations sur les récompenses de minting", + "reward_per_block": "récompense estimée par bloc", + "reward_per_day": "récompense estimée par jour", + "status": { + "minting": "(Frappe)", + "not_minting": "(pas de la frappe)", + "no_status": "pas de statut", + "synchronized": "synchronisé ({{ percent }}%)", + "synchronizing": "synchronisation ({{ percent }}%)..." + }, + "status_title": "statut de frappe", + "tier_share_per_block": "part du niveau par bloc", + "total_minter_in_tier": "nombre total de minters dans ce niveau" + }, + "name": "nom", + "name_app": "nom / application", + "new_post_in": "new post in {{ title }}", + "none": "aucun", + "note": "note", + "option": "option", + "option_no": "aucune option", + "option_other": "options", + "page": { + "last": "dernier", + "first": "d'abord", + "next": "suivant", + "previous": "précédent" + }, + "payment_notification": "Notification de paiement", + "payment": "paiement", + "poll_embed": "sondage", + "port": "port", + "price": "prix", + "publish": "publier", + "q_apps": { + "about": "À propos de ce Q-App", + "q_mail": "Q-Rail", + "q_manager": "manager", + "q_sandbox": "Q-sandbox", + "q_wallets": "porte-à-tête" + }, + "receiver": "récepteur", + "sender": "expéditeur", + "server": "serveur", + "service_type": "type de service", + "settings": "paramètres", + "sort": { + "by_member": "par membre" + }, + "supply": "fournir", + "tags": "balises", + "theme": { + "dark": "sombre", + "dark_mode": "mode sombre", + "default": "Thème par défaut", + "light": "lumière", + "light_mode": "mode léger", + "manager": "directeur de thème", + "name": "nom de thème" + }, + "thread": "fil", + "thread_other": "threads", + "thread_title": "Titre du fil", + "time": { + "day_one": "{{count}} day", + "day_other": "{{count}} days", + "hour_one": "{{count}} hour", + "hour_other": "{{count}} hours", + "minute_one": "{{count}} minute", + "minute_other": "{{count}} minutes", + "time": "temps" + }, + "title": "titre", + "to": "à", + "tutorial": "tutoriel", + "url": "URL", + "user_lookup": "recherche d'utilisateur", + "vote": "voter", + "vote_other": "{{ count }} votes", + "zip": "fermeture éclair", + "wallet": { + "litecoin": "portefeuille litecoin", + "qortal": "portefeuille Qortal", + "wallet": "portefeuille", + "wallet_other": "portefeuilles" + }, + "website": "site web", + "welcome": "accueillir" +} diff --git a/src/i18n/locales/fr/group.json b/src/i18n/locales/fr/group.json new file mode 100644 index 0000000..d4edb9b --- /dev/null +++ b/src/i18n/locales/fr/group.json @@ -0,0 +1,163 @@ +{ + "action": { + "add_promotion": "ajouter une promotion", + "ban": "bannir un membre du groupe", + "cancel_ban": "annuler le bannissement", + "copy_private_key": "copier la clé privée", + "create_group": "créer un groupe", + "disable_push_notifications": "désactiver toutes les notifications push", + "export_password": "exporter le mot de passe", + "export_private_key": "exporter la clé privée", + "find_group": "trouver un groupe", + "join_group": "rejoindre un groupe", + "kick_member": "expulser un membre du groupe", + "invite_member": "inviter un membre", + "leave_group": "quitter le groupe", + "load_members": "charger les membres avec noms", + "make_admin": "nommer administrateur", + "manage_members": "gérer les membres", + "promote_group": "promouvoir votre groupe auprès des non-membres", + "publish_announcement": "publier une annonce", + "publish_avatar": "publier un avatar", + "refetch_page": "recharger la page", + "remove_admin": "retirer les droits d’admin", + "remove_minting_account": "retirer le compte de minage", + "return_to_thread": "retourner aux discussions", + "scroll_bottom": "faire défiler vers le bas", + "scroll_unread_messages": "faire défiler vers les messages non lus", + "select_group": "sélectionner un groupe", + "visit_q_mintership": "visiter Q-Mintership" + }, + "advanced_options": "options avancées", + "block_delay": { + "minimum": "délai minimum de bloc", + "maximum": "délai maximum de bloc" + }, + "group": { + "approval_threshold": "seuil d’approbation du groupe", + "avatar": "avatar du groupe", + "closed": "fermé (privé) – les utilisateurs ont besoin d’une autorisation pour rejoindre", + "description": "description du groupe", + "id": "ID du groupe", + "invites": "invitations du groupe", + "group": "groupe", + "group_name": "groupe : {{ name }}", + "group_other": "groupes", + "groups_admin": "groupes dont vous êtes administrateur", + "management": "gestion du groupe", + "member_number": "nombre de membres", + "messaging": "messagerie", + "name": "nom du groupe", + "open": "ouvert (public)", + "private": "groupe privé", + "promotions": "promotions du groupe", + "public": "groupe public", + "type": "type de groupe" + }, + "invitation_expiry": "expiration de l’invitation", + "invitees_list": "liste des invités", + "join_link": "lien pour rejoindre le groupe", + "join_requests": "demandes d’adhésion", + "last_message": "dernier message", + "last_message_date": "dernier message : {{date }}", + "latest_mails": "derniers Q-Mails", + "message": { + "generic": { + "avatar_publish_fee": "la publication d’un avatar coûte {{ fee }}", + "avatar_registered_name": "un nom enregistré est requis pour définir un avatar", + "admin_only": "seuls les groupes dont vous êtes admin seront affichés", + "already_in_group": "vous êtes déjà dans ce groupe !", + "block_delay_minimum": "délai minimum de bloc pour les validations de transactions de groupe", + "block_delay_maximum": "délai maximum de bloc pour les validations de transactions de groupe", + "closed_group": "ce groupe est fermé/privé. Veuillez attendre qu’un admin accepte votre demande", + "descrypt_wallet": "décryptage du portefeuille...", + "encryption_key": "la première clé de chiffrement commune est en cours de création. Veuillez patienter...", + "group_announcement": "annonces du groupe", + "group_approval_threshold": "seuil d’approbation du groupe (nombre ou pourcentage d’admins requis)", + "group_encrypted": "groupe chiffré", + "group_invited_you": "{{group}} vous a invité", + "group_key_created": "première clé de groupe créée.", + "group_member_list_changed": "la liste des membres a changé. Veuillez rechiffrer la clé secrète.", + "group_no_secret_key": "aucune clé secrète pour le groupe. Soyez le premier admin à en publier une !", + "group_secret_key_no_owner": "la dernière clé a été publiée par un non-propriétaire. Veuillez rechiffrer la clé pour plus de sécurité.", + "invalid_content": "contenu, expéditeur ou horodatage invalide dans les données de réaction", + "invalid_data": "erreur de chargement : données invalides", + "latest_promotion": "seule la dernière promotion de la semaine s’affichera", + "loading_members": "chargement de la liste des membres... veuillez patienter.", + "max_chars": "200 caractères max. Frais de publication", + "manage_minting": "gérer le minage", + "minter_group": "vous ne faites pas encore partie du groupe MINTER", + "mintership_app": "visitez l’app Q-Mintership pour devenir mineur", + "minting_account": "compte de minage :", + "minting_keys_per_node": "2 clés de minage max par nœud. Veuillez en retirer une.", + "minting_keys_per_node_different": "2 clés de minage max par nœud. Retirez-en une pour ajouter un autre compte.", + "node_minting_account": "comptes de minage du nœud", + "node_minting_key": "vous avez déjà une clé de minage attachée à ce nœud", + "no_announcement": "aucune annonce", + "no_display": "rien à afficher", + "no_selection": "aucun groupe sélectionné", + "not_part_group": "vous ne faites pas partie du groupe chiffré. Attendez qu’un admin rechiffre les clés.", + "only_encrypted": "seuls les messages non chiffrés seront affichés.", + "only_private_groups": "seuls les groupes privés seront affichés", + "pending_join_requests": "{{ group }} a {{ count }} demandes en attente", + "private_key_copied": "clé privée copiée", + "provide_message": "veuillez fournir un premier message pour le fil", + "secure_place": "gardez votre clé privée dans un endroit sûr. Ne la partagez pas !", + "setting_group": "configuration du groupe... veuillez patienter." + }, + "error": { + "access_name": "impossible d’envoyer un message sans accès à votre nom", + "descrypt_wallet": "erreur de décryptage du portefeuille {{ message }}", + "description_required": "veuillez fournir une description", + "group_info": "impossible d’accéder aux informations du groupe", + "group_join": "échec de l’adhésion au groupe", + "group_promotion": "erreur lors de la publication de la promotion. Veuillez réessayer", + "group_secret_key": "impossible d’obtenir la clé secrète du groupe", + "name_required": "veuillez fournir un nom", + "notify_admins": "essayez de notifier un admin dans la liste ci-dessous :", + "qortals_required": "vous avez besoin d’au moins {{ quantity }} QORT pour envoyer un message", + "timeout_reward": "délai dépassé pour la confirmation du partage de récompense", + "thread_id": "ID du fil introuvable", + "unable_determine_group_private": "impossible de déterminer si le groupe est privé", + "unable_minting": "échec du démarrage du minage" + }, + "success": { + "group_ban": "membre banni avec succès. Les changements peuvent prendre quelques minutes", + "group_creation": "groupe créé avec succès. Les changements peuvent prendre quelques minutes", + "group_creation_name": "groupe {{group_name}} créé : en attente de confirmation", + "group_creation_label": "groupe {{name}} créé : succès !", + "group_invite": "{{invitee}} invité avec succès. Les changements peuvent prendre quelques minutes", + "group_join": "demande de rejoindre le groupe envoyée avec succès. Les changements peuvent prendre quelques minutes", + "group_join_name": "rejoint le groupe {{group_name}} : en attente de confirmation", + "group_join_label": "rejoint le groupe {{name}} : succès !", + "group_join_request": "demande de rejoindre {{group_name}} envoyée : en attente de confirmation", + "group_join_outcome": "demande de rejoindre {{group_name}} : succès !", + "group_kick": "membre expulsé avec succès. Les changements peuvent prendre quelques minutes", + "group_leave": "demande de quitter le groupe envoyée. Les changements peuvent prendre quelques minutes", + "group_leave_name": "quitté le groupe {{group_name}} : en attente de confirmation", + "group_leave_label": "quitté le groupe {{name}} : succès !", + "group_member_admin": "membre promu admin avec succès. Les changements peuvent prendre quelques minutes", + "group_promotion": "promotion publiée avec succès. Peut prendre quelques minutes pour apparaître", + "group_remove_member": "droits d’admin retirés avec succès. Les changements peuvent prendre quelques minutes", + "invitation_cancellation": "invitation annulée avec succès. Les changements peuvent prendre quelques minutes", + "invitation_request": "demande d’adhésion acceptée : en attente de confirmation", + "loading_threads": "chargement des fils... veuillez patienter.", + "post_creation": "publication créée avec succès. Peut prendre du temps à se propager", + "published_secret_key": "clé secrète publiée pour le groupe {{ group_id }} : en attente de confirmation", + "published_secret_key_label": "clé secrète publiée pour le groupe {{ group_id }} : succès !", + "registered_name": "nom enregistré avec succès. Les changements peuvent prendre quelques minutes", + "registered_name_label": "nom enregistré : en attente de confirmation", + "registered_name_success": "nom enregistré : succès !", + "rewardshare_add": "ajout du partage de récompense : en attente de confirmation", + "rewardshare_add_label": "ajout du partage de récompense : succès !", + "rewardshare_creation": "confirmation de la création du partage de récompense en cours. Cela peut prendre jusqu’à 90 secondes.", + "rewardshare_confirmed": "partage de récompense confirmé. Cliquez sur Suivant.", + "rewardshare_remove": "suppression du partage de récompense : en attente de confirmation", + "rewardshare_remove_label": "suppression du partage de récompense : succès !", + "thread_creation": "fil créé avec succès. Peut prendre du temps à se propager", + "unbanned_user": "utilisateur débanni avec succès. Les changements peuvent prendre quelques minutes", + "user_joined": "utilisateur ajouté avec succès !" + } + }, + "thread_posts": "nouveaux messages du fil" +} diff --git a/src/i18n/locales/fr/question.json b/src/i18n/locales/fr/question.json new file mode 100644 index 0000000..e080d49 --- /dev/null +++ b/src/i18n/locales/fr/question.json @@ -0,0 +1,194 @@ +{ + "accept_app_fee": "accepter les frais de l'application", + "always_authenticate": "toujours s'authentifier automatiquement", + "always_chat_messages": "toujours autoriser les messages de chat de cette application", + "always_retrieve_balance": "toujours autoriser la récupération automatique du solde", + "always_retrieve_list": "toujours autoriser la récupération automatique des listes", + "always_retrieve_wallet": "toujours autoriser la récupération automatique du portefeuille", + "always_retrieve_wallet_transactions": "toujours autoriser la récupération automatique des transactions du portefeuille", + "amount_qty": "montant : {{ quantity }}", + "asset_name": "actif : {{ asset }}", + "assets_used_pay": "actif utilisé pour le paiement : {{ asset }}", + "coin": "pièce : {{ coin }}", + "description": "description : {{ description }}", + "deploy_at": "Souhaitez-vous déployer cet AT ?", + "download_file": "Souhaitez-vous télécharger :", + "message": { + "error": { + "add_to_list": "échec de l'ajout à la liste", + "at_info": "impossible de trouver les informations AT.", + "buy_order": "échec de l'envoi de l'ordre d'achat", + "cancel_sell_order": "échec de l'annulation de l'ordre de vente. Veuillez réessayer !", + "copy_clipboard": "échec de la copie dans le presse-papiers", + "create_sell_order": "échec de la création de l'ordre de vente. Veuillez réessayer !", + "create_tradebot": "impossible de créer le robot de trading", + "decode_transaction": "échec du décodage de la transaction", + "decrypt": "impossible de déchiffrer", + "decrypt_message": "échec du déchiffrement du message. Vérifiez que les données et les clés sont correctes", + "decryption_failed": "échec du déchiffrement", + "empty_receiver": "le destinataire ne peut pas être vide !", + "encrypt": "impossible de chiffrer", + "encryption_failed": "échec du chiffrement", + "encryption_requires_public_key": "le chiffrement des données nécessite des clés publiques", + "fetch_balance_token": "échec de la récupération du solde {{ token }}. Veuillez réessayer !", + "fetch_balance": "impossible de récupérer le solde", + "fetch_connection_history": "échec de la récupération de l'historique de connexion du serveur", + "fetch_generic": "impossible de récupérer", + "fetch_group": "échec de la récupération du groupe", + "fetch_list": "échec de la récupération de la liste", + "fetch_poll": "échec de la récupération du sondage", + "fetch_recipient_public_key": "échec de la récupération de la clé publique du destinataire", + "fetch_wallet_info": "impossible de récupérer les informations du portefeuille", + "fetch_wallet_transactions": "impossible de récupérer les transactions du portefeuille", + "fetch_wallet": "échec de la récupération du portefeuille. Veuillez réessayer", + "file_extension": "impossible de déterminer l'extension du fichier", + "gateway_balance_local_node": "le solde {{ token }} ne peut pas être consulté via la passerelle. Utilisez votre nœud local.", + "gateway_non_qort_local_node": "les pièces non-QORT ne peuvent pas être envoyées via la passerelle. Utilisez votre nœud local.", + "gateway_retrieve_balance": "la récupération du solde {{ token }} n'est pas autorisée via une passerelle", + "gateway_wallet_local_node": "le portefeuille {{ token }} ne peut pas être consulté via la passerelle. Utilisez votre nœud local.", + "get_foreign_fee": "erreur lors de l'obtention des frais étrangers", + "insufficient_balance_qort": "votre solde QORT est insuffisant", + "insufficient_balance": "votre solde d'actif est insuffisant", + "insufficient_funds": "fonds insuffisants", + "invalid_encryption_iv": "IV invalide : AES-GCM nécessite un IV de 12 octets", + "invalid_encryption_key": "clé invalide : AES-GCM nécessite une clé de 256 bits", + "invalid_fullcontent": "le champ fullContent est au format invalide. Utilisez une chaîne, base64 ou un objet", + "invalid_receiver": "adresse ou nom de destinataire invalide", + "invalid_type": "type invalide", + "mime_type": "impossible de déterminer le type MIME", + "missing_fields": "champs manquants : {{ fields }}", + "name_already_for_sale": "ce nom est déjà en vente", + "name_not_for_sale": "ce nom n'est pas à vendre", + "no_api_found": "aucune API utilisable trouvée", + "no_data_encrypted_resource": "aucune donnée dans la ressource chiffrée", + "no_data_file_submitted": "aucune donnée ou fichier soumis", + "no_group_found": "groupe introuvable", + "no_group_key": "aucune clé de groupe trouvée", + "no_poll": "sondage introuvable", + "no_resources_publish": "aucune ressource à publier", + "node_info": "échec de la récupération des infos du nœud", + "node_status": "échec de la récupération de l'état du nœud", + "only_encrypted_data": "seules les données chiffrées peuvent être utilisées dans des services privés", + "perform_request": "échec de l'exécution de la requête", + "poll_create": "échec de la création du sondage", + "poll_vote": "échec du vote dans le sondage", + "process_transaction": "impossible de traiter la transaction", + "provide_key_shared_link": "pour une ressource chiffrée, vous devez fournir la clé pour créer le lien partagé", + "registered_name": "un nom enregistré est requis pour publier", + "resources_publish": "certaines ressources n'ont pas pu être publiées", + "retrieve_file": "échec de la récupération du fichier", + "retrieve_keys": "impossible de récupérer les clés", + "retrieve_summary": "échec de la récupération du résumé", + "retrieve_sync_status": "erreur lors de la récupération du statut de synchronisation de {{ token }}", + "same_foreign_blockchain": "tous les AT demandés doivent appartenir à la même blockchain étrangère.", + "send": "échec de l'envoi", + "server_current_add": "échec de l'ajout du serveur actuel", + "server_current_set": "échec de la définition du serveur actuel", + "server_info": "erreur lors de la récupération des informations du serveur", + "server_remove": "échec de la suppression du serveur", + "submit_sell_order": "échec de l'envoi de l'ordre de vente", + "synchronization_attempts": "échec de la synchronisation après {{ count }} tentatives", + "timeout_request": "la requête a expiré", + "token_not_supported": "{{ token }} n'est pas pris en charge pour cet appel", + "transaction_activity_summary": "erreur dans le résumé d'activité des transactions", + "unknown_error": "erreur inconnue", + "unknown_admin_action_type": "type d'action d'administration inconnu : {{ type }}", + "update_foreign_fee": "échec de la mise à jour des frais étrangers", + "update_tradebot": "impossible de mettre à jour le robot de trading", + "upload_encryption": "échec du téléchargement à cause d'une erreur de chiffrement", + "upload": "échec du téléchargement", + "use_private_service": "pour une publication chiffrée, utilisez un service se terminant par _PRIVATE", + "user_qortal_name": "l'utilisateur n'a pas de nom Qortal", + "max_size_publish": "la taille maximale autorisée est de {{size}} Go par fichier.", + "max_size_publish_public": "la taille maximale autorisée sur le nœud public est de {{size}} Mo. Utilisez votre nœud local pour les fichiers plus volumineux." + }, + "generic": { + "calculate_fee": "*Les frais de {{ amount }} sats sont dérivés de {{ rate }} sats par KB, pour une transaction d'environ 300 octets.", + "confirm_join_group": "confirmer l'adhésion au groupe :", + "include_data_decrypt": "veuillez inclure les données à déchiffrer", + "include_data_encrypt": "veuillez inclure les données à chiffrer", + "max_retry_transaction": "nombre maximal de tentatives atteint. Transaction ignorée.", + "no_action_public_node": "cette action ne peut pas être effectuée via un nœud public", + "private_service": "veuillez utiliser un service privé", + "provide_group_id": "veuillez fournir un groupId", + "read_transaction_carefully": "lisez attentivement la transaction avant d'accepter !", + "user_declined_add_list": "l'utilisateur a refusé d'ajouter à la liste", + "user_declined_delete_from_list": "l'utilisateur a refusé de supprimer de la liste", + "user_declined_delete_hosted_resources": "l'utilisateur a refusé de supprimer les ressources hébergées", + "user_declined_join": "l'utilisateur a refusé de rejoindre le groupe", + "user_declined_list": "l'utilisateur a refusé d'obtenir la liste des ressources hébergées", + "user_declined_request": "l'utilisateur a refusé la requête", + "user_declined_save_file": "l'utilisateur a refusé d'enregistrer le fichier", + "user_declined_send_message": "l'utilisateur a refusé d'envoyer le message", + "user_declined_share_list": "l'utilisateur a refusé de partager la liste" + } + }, + "name": "nom : {{ name }}", + "option": "option : {{ option }}", + "options": "options : {{ optionList }}", + "permission": { + "access_list": "Souhaitez-vous autoriser cette application à accéder à la liste ?", + "add_admin": "Souhaitez-vous autoriser cette application à ajouter l'utilisateur {{ invitee }} comme administrateur ?", + "all_item_list": "Souhaitez-vous autoriser cette application à ajouter les éléments suivants à la liste {{ name }} :", + "authenticate": "Souhaitez-vous autoriser cette application à s'authentifier ?", + "ban": "Souhaitez-vous autoriser cette application à bannir {{ partecipant }} du groupe ?", + "buy_name_detail": "achat de {{ name }} pour {{ price }} QORT", + "buy_name": "Souhaitez-vous autoriser cette application à acheter un nom ?", + "buy_order_fee_estimation_one": "Ces frais sont estimés sur la base de {{ count }} ordre, supposant une taille de 300 octets à un taux de {{ fee }} {{ ticker }} par KB.", + "buy_order_fee_estimation_other": "Ces frais sont estimés sur la base de {{ count }} ordres, supposant une taille de 300 octets à un taux de {{ fee }} {{ ticker }} par KB.", + "buy_order_per_kb": "{{ fee }} {{ ticker }} par KB", + "buy_order_quantity_one": "{{ count }} ordre d'achat", + "buy_order_quantity_other": "{{ count }} ordres d'achat", + "buy_order_ticker": "{{ qort_amount }} QORT pour {{ foreign_amount }} {{ ticker }}", + "buy_order": "Souhaitez-vous autoriser cette application à passer un ordre d'achat ?", + "cancel_ban": "Souhaitez-vous autoriser cette application à lever le bannissement de {{ partecipant }} dans le groupe ?", + "cancel_group_invite": "Souhaitez-vous autoriser cette application à annuler l'invitation au groupe de {{ invitee }} ?", + "cancel_sell_order": "Souhaitez-vous autoriser cette application à annuler un ordre de vente ?", + "create_group": "Souhaitez-vous autoriser cette application à créer un groupe ?", + "delete_hosts_resources": "Souhaitez-vous autoriser cette application à supprimer {{ size }} ressources hébergées ?", + "fetch_balance": "Souhaitez-vous autoriser cette application à consulter votre solde {{ coin }} ?", + "get_wallet_info": "Souhaitez-vous autoriser cette application à consulter les informations de votre portefeuille ?", + "get_wallet_transactions": "Souhaitez-vous autoriser cette application à récupérer les transactions de votre portefeuille ?", + "invite": "Souhaitez-vous autoriser cette application à inviter {{ invitee }} ?", + "kick": "Souhaitez-vous autoriser cette application à exclure {{ partecipant }} du groupe ?", + "leave_group": "Souhaitez-vous autoriser cette application à quitter le groupe suivant ?", + "list_hosted_data": "Souhaitez-vous autoriser cette application à obtenir une liste de vos données hébergées ?", + "order_detail": "{{ qort_amount }} QORT pour {{ foreign_amount }} {{ ticker }}", + "pay_publish": "Souhaitez-vous autoriser cette application à effectuer les paiements et publications suivants ?", + "perform_admin_action_with_value": "avec la valeur : {{ value }}", + "perform_admin_action": "Souhaitez-vous autoriser cette application à exécuter l'action d'administration : {{ type }} ?", + "publish_qdn": "Souhaitez-vous autoriser cette application à publier sur QDN ?", + "register_name": "Souhaitez-vous autoriser cette application à enregistrer ce nom ?", + "remove_admin": "Souhaitez-vous autoriser cette application à retirer {{ partecipant }} en tant qu'administrateur ?", + "remove_from_list": "Souhaitez-vous autoriser cette application à supprimer les éléments suivants de la liste {{ name }} :", + "sell_name_cancel": "Souhaitez-vous autoriser cette application à annuler la vente d'un nom ?", + "sell_name_transaction_detail": "vente de {{ name }} pour {{ price }} QORT", + "sell_name_transaction": "Souhaitez-vous autoriser cette application à créer une transaction de vente de nom ?", + "sell_order": "Souhaitez-vous autoriser cette application à passer un ordre de vente ?", + "send_chat_message": "Souhaitez-vous autoriser cette application à envoyer ce message de chat ?", + "send_coins": "Souhaitez-vous autoriser cette application à envoyer des pièces ?", + "server_add": "Souhaitez-vous autoriser cette application à ajouter un serveur ?", + "server_remove": "Souhaitez-vous autoriser cette application à supprimer un serveur ?", + "set_current_server": "Souhaitez-vous autoriser cette application à définir le serveur actuel ?", + "sign_fee": "Souhaitez-vous autoriser cette application à signer les frais requis pour toutes vos offres de trading ?", + "sign_process_transaction": "Souhaitez-vous autoriser cette application à signer et traiter une transaction ?", + "sign_transaction": "Souhaitez-vous autoriser cette application à signer une transaction ?", + "transfer_asset": "Souhaitez-vous autoriser cette application à transférer l'actif suivant ?", + "update_foreign_fee": "Souhaitez-vous autoriser cette application à mettre à jour les frais étrangers sur votre nœud ?", + "update_group_detail": "nouveau propriétaire : {{ owner }}", + "update_group": "Souhaitez-vous autoriser cette application à mettre à jour ce groupe ?" + }, + "poll": "sondage : {{ name }}", + "provide_recipient_group_id": "veuillez fournir un destinataire ou un groupId", + "request_create_poll": "vous demandez la création du sondage suivant :", + "request_vote_poll": "vous êtes invité à voter au sondage suivant :", + "sats_per_kb": "{{ amount }} sats par KB", + "sats": "{{ amount }} sats", + "server_host": "hôte : {{ host }}", + "server_type": "type : {{ type }}", + "to_group": "à : groupe {{ group_id }}", + "to_recipient": "à : {{ recipient }}", + "total_locking_fee": "frais de verrouillage totaux :", + "total_unlocking_fee": "frais de déverrouillage totaux :", + "value": "valeur : {{ value }}" +} diff --git a/src/i18n/locales/fr/tutorial.json b/src/i18n/locales/fr/tutorial.json new file mode 100644 index 0000000..5b93b3f --- /dev/null +++ b/src/i18n/locales/fr/tutorial.json @@ -0,0 +1,21 @@ +{ + "1_getting_started": "1. Premiers pas", + "2_overview": "2. Vue d'ensemble", + "3_groups": "3. Groupes Qortal", + "4_obtain_qort": "4. Obtenir du QORT", + "account_creation": "création de compte", + "important_info": "informations importantes", + "apps": { + "dashboard": "1. Tableau de bord des applications", + "navigation": "2. Navigation des applications" + }, + "initial": { + "recommended_qort_qty": "avoir au moins {{ quantity }} QORT dans votre portefeuille", + "explore": "explorer", + "general_chat": "discussion générale", + "getting_started": "démarrer", + "register_name": "enregistrer un nom", + "see_apps": "voir les applications", + "trade_qort": "échanger du QORT" + } +} diff --git a/src/i18n/locales/it/auth.json b/src/i18n/locales/it/auth.json new file mode 100644 index 0000000..e5b1f6e --- /dev/null +++ b/src/i18n/locales/it/auth.json @@ -0,0 +1,138 @@ +{ + "account": { + "your": "il tuo account", + "account_many": "account", + "account_one": "account", + "selected": "account selezionato" + }, + "action": { + "add": { + "account": "aggiungi account", + "seed_phrase": "aggiungi seed phrase" + }, + "authenticate": "autentica", + "block": "blocca", + "block_all": "blocca tutto", + "block_data": "blocca i dati QDN", + "block_name": "blocca nome", + "block_txs": "blocca TSX", + "fetch_names": "recupera nomi", + "copy_address": "copia indirizzo", + "create_account": "crea un account", + "create_qortal_account": "crea il tuo account Qortal cliccando NEXT sotto.", + "choose_password": "scegli nuova password", + "download_account": "scarica account", + "enter_amount": "si prega di inserire un importo maggiore di 0", + "enter_recipient": "inserisci un destinatario", + "enter_wallet_password": "inserisci la password del tuo wallet", + "export_seedphrase": "esporta seed phrase", + "insert_name_address": "si prega di inserire un nome o un indirizzo", + "publish_admin_secret_key": "pubblica la chiave segreta dell'amministratore", + "publish_group_secret_key": "pubblica chiave segreta di gruppo", + "reencrypt_key": "recripta chiave", + "return_to_list": "torna all'elenco", + "setup_qortal_account": "imposta il tuo account Qortal", + "unblock": "sblocca", + "unblock_name": "sblocca nome" + }, + "address": "indirizzo", + "address_name": "indirizzo o nome", + "advanced_users": "per utenti avanzati", + "apikey": { + "alternative": "alternativa: selezione file", + "change": "cambia Apikey", + "enter": "inserisci Apikey", + "import": "importa apikey", + "key": "chiave API", + "select_valid": "seleziona una apikey valida" + }, + "authentication": "autenticazione", + "blocked_users": "utenti bloccati", + "build_version": "versione build", + "message": { + "error": { + "account_creation": "impossibile creare un account", + "address_not_existing": "l'indirizzo non esiste sulla blockchain", + "block_user": "impossibile bloccare l'utente", + "create_simmetric_key": "impossibile creare una chiave simmetrica", + "decrypt_data": "non poteva decrittografare i dati", + "decrypt": "impossibile decrittografare", + "encrypt_content": "impossibile crittografare il contenuto", + "fetch_user_account": "impossibile recuperare l'account utente", + "field_not_found_json": "{{ field }} non trovato nel JSON", + "find_secret_key": "impossibile trovare secretkey corretta", + "incorrect_password": "password errata", + "invalid_qortal_link": "collegamento Qortal non valido", + "invalid_secret_key": "la chiave segreta non è valida", + "invalid_uint8": "l'uint8arraydata inviato non è valido", + "name_not_existing": "il nome non esiste", + "name_not_registered": "nome non registrato", + "read_blob_base64": "impossibile leggere il BLOB come stringa codificata da base64", + "reencrypt_secret_key": "impossibile recriptare la chiave segreta", + "set_apikey": "impossibile impostare la chiave API:" + }, + "generic": { + "blocked_addresses": "indirizzi bloccati: l'elaborazione dei blocchi di TXS", + "blocked_names": "nomi bloccati per QDN", + "blocking": "blocking {{ name }}", + "choose_block": "scegli 'Blocca TXS' o 'Tutti' per bloccare i messaggi di chat", + "congrats_setup": "congratulazioni, tutto è stato impostato!", + "decide_block": "decidi cosa bloccare", + "downloading_encryption_keys": "scaricamento chiavi di crittazione", + "name_address": "nome o indirizzo", + "no_account": "nessun account salvato", + "no_minimum_length": "non esiste un requisito di lunghezza minima", + "no_secret_key_published": "nessuna chiave segreta ancora pubblicata", + "fetching_admin_secret_key": "recupero chiave segreta admin", + "fetching_group_secret_key": "recupero chiavi segreta di gruppo pubblicate", + "last_encryption_date": "ultima data di crittazione: {{ date }} eseguito da {{ name }}", + "locating_encryption_keys": "individuazione chiavi di crittazione", + "keep_secure": "mantieni al sicuro questo file d'account", + "publishing_key": "attenzione: dopo aver pubblicato la chiave, occorrono un paio di minuti per la pubblicazione. Attendere, per favore.", + "seedphrase_notice": "È stato generato una SEED PHRASE in background.", + "turn_local_node": "si prega di attivare il nodo locale", + "type_seed": "digita o incolla la seed phrase", + "your_accounts": "i tuoi account salvati" + }, + "success": { + "reencrypted_secret_key": "chiave segreta recriptata con successo. Potrebbero essere necessari un paio di minuti per propagare le modifiche. Aggiorna il gruppo fra 5 minuti." + } + }, + "node": { + "choose": "scegli un nodo custom", + "custom_many": "nodi custom", + "use_custom": "utilizza nodo custom", + "use_local": "utilizza nodo locale", + "using": "utilizzo nodo", + "using_public": "utilizzo di un nodo pubblico", + "using_public_gateway": "utilizzo di un nodo pubblico: {{ gateway }}" + }, + "note": "nota", + "password": "password", + "password_confirmation": "conferma password", + "seed_phrase": "seed phrase", + "seed_your": "la tua seed phrase", + "tips": { + "additional_wallet": "usa quest'opzione per collegare ulteriori portafogli Qortal già creati, per potervi accedere in seguito. Avrai bisogno di accedere al tuo file JSON di backup.", + "digital_id": "il tuo wallet è come il tuo ID digitale su Qortal ed e verrà usato per accedere a Qortal. Contiene il tuo indirizzo pubblico e il nome Qortal che alla fine sceglierai. Ogni transazione che fai è collegata al tuo ID, nel quale potrai gestire tutte le tue criptovalute Qort e altre criptovalute negoziabili su Qortal.", + "existing_account": "hai già un account Qortal? Inserisci qui la tua frase di backup segreta per accedervi. Questa frase è uno dei modi per recuperare il tuo account.", + "key_encrypt_admin": "questa chiave crittografa i contenuti relativi ad amministratore. Solo gli amministratori vedranno il contenuto crittografato.", + "key_encrypt_group": "questa chiave crittografa i contenuti relativi al gruppo. Per ora questa è l'unica utilizzata in quest'interfaccia grafica. Tutti i membri del gruppo saranno in grado di vedere i contenuti crittografati con questa chiave.", + "new_account": "la creazione di un account consiste nella creazione di un wallet e di un ID digitale per iniziare a utilizzare Qortal. Una volta creato l'account, potrai iniziare a fare cose come ottenere dei Qort, acquistare un nome e un Avatar, pubblicare video e blog e molto altro.", + "new_users": "i nuovi utenti iniziano qui!", + "safe_place": "salva il tuo account in un posto da ricordare!", + "view_seedphrase": "se si desidera visualizzare la seed phrase, fai clic sulla parola \"seed phrase\" in questo testo. Le seed phrase vengono utilizzate per generare la chiave privata per il tuo account Qortal. Per la sicurezza per impostazione predefinita, le seed phrase non vengono visualizzate se non specificamente scelte.", + "wallet_secure": "mantieni al sicuro il tuo file del wallet" + }, + "wallet": { + "password_confirmation": "conferma la password del wallet", + "password": "password del wallet", + "keep_password": "mantieni la password corrente", + "new_password": "nuova password", + "error": { + "missing_new_password": "inserisci una nuova password", + "missing_password": "inserisci la tua password" + } + }, + "welcome": "benvenuto in" +} diff --git a/src/i18n/locales/it/core.json b/src/i18n/locales/it/core.json new file mode 100644 index 0000000..678bdaa --- /dev/null +++ b/src/i18n/locales/it/core.json @@ -0,0 +1,418 @@ +{ + "action": { + "accept": "accetta", + "access": "accedi", + "access_app": "accesso app", + "add": "aggiungi", + "add_custom_framework": "aggiungi framework personalizzato", + "add_reaction": "aggiungi reazione", + "add_theme": "aggiungi tema", + "backup_account": "account di backup", + "backup_wallet": "wallet di backup", + "cancel": "cancella", + "cancel_invitation": "annulla l'invito", + "change": "modifica", + "change_avatar": "cambia Avatar", + "change_file": "modifica file", + "change_language": "cambia la lingua", + "choose": "scegli", + "choose_file": "scegli il file", + "choose_image": "scegli l'immagine", + "choose_logo": "scegli un logo", + "choose_name": "scegli un nome", + "close": "chiudi", + "close_chat": "chiudi la chat diretta", + "continue": "continua", + "continue_logout": "conferma il logout", + "copy_link": "copia link", + "create_apps": "crea app", + "create_file": "crea file", + "create_transaction": "creare transazioni sulla blockchain Qortal", + "create_thread": "crea thread", + "decline": "rifiuta", + "decrypt": "decripta", + "disable_enter": "disabilita invio", + "download": "scarica", + "download_file": "scarica file", + "edit": "modifica", + "edit_theme": "modifica tema", + "enable_dev_mode": "abilita la modalità Dev", + "enter_name": "immetti un nome", + "export": "esporta", + "get_qort": "ottieni QORT", + "get_qort_trade": "ottieni Qort in Q-Trade", + "hide": "nascondi", + "hide_qr_code": "nascondi QR code", + "import": "importare", + "import_theme": "importa un tema", + "invite": "invitare", + "invite_member": "invita un nuovo membro", + "join": "unisciti a", + "leave_comment": "lascia un commento", + "load_announcements": "carica annunci più vecchi", + "login": "login", + "logout": "logout", + "new": { + "chat": "nuova chat", + "post": "nuovo post", + "theme": "nuovo tema", + "thread": "nuovo thread" + }, + "notify": "notifica", + "open": "apri", + "pin": "blocca", + "pin_app": "blocca app", + "pin_from_dashboard": "pin dalla dashboard", + "post": "posta", + "post_message": "posta messaggio", + "publish": "pubblica", + "publish_app": "pubblica la tua app", + "publish_comment": "pubblica un commento", + "refresh": "aggiorna", + "register_name": "registra nome", + "remove": "rimuovi", + "remove_reaction": "rimuovi la reazione", + "return_apps_dashboard": "torna alla dashboard delle app", + "save": "salva", + "save_disk": "salva su disco", + "search": "ricerca", + "search_apps": "cerca app", + "search_groups": "cerca gruppi", + "search_chat_text": "cerca il testo della chat", + "see_qr_code": "vedi QR code", + "select_app_type": "seleziona il tipo di app", + "select_category": "seleziona categoria", + "select_name_app": "seleziona nome/app", + "send": "invia", + "send_qort": "invia QORT", + "set_avatar": "imposta Avatar", + "show": "mostra", + "show_poll": "mostra il sondaggio", + "start_minting": "inizia a coniare", + "start_typing": "puoi iniziare a digitare qui...", + "trade_qort": "scambia qort", + "transfer_qort": "trasferisci QORT", + "unpin": "sblocca", + "unpin_app": "sblocca app", + "unpin_from_dashboard": "rimuovi dalla dashboard", + "update": "aggiorna", + "update_app": "aggiorna la tua app", + "vote": "vota" + }, + "address_your": "il tuo indirizzo", + "admin": "amministratore", + "admin_other": "amministratori", + "all": "tutto", + "amount": "quantità", + "announcement": "annuncio", + "announcement_other": "annunci", + "api": "API", + "app": "app", + "app_other": "app", + "app_name": "nome app", + "app_private": "privata", + "app_service_type": "tipo di servizio app", + "apps_dashboard": "dashboard delle app", + "apps_official": "app ufficiali", + "attachment": "allegato", + "balance": "bilancio:", + "category": "categoria", + "category_other": "categorie", + "chat": "chat", + "comment_other": "commenti", + "contact_other": "contatti", + "core": { + "block_height": "altezza del blocco", + "information": "informazioni di base", + "peers": "peer connessi", + "version": "versione principale" + }, + "current_language": "lingua corrente: {{ language }}", + "dev": "dev", + "dev_mode": "modalità Dev", + "domain": "dominio", + "ui": { + "version": "versione UI" + }, + "count": { + "none": "nessuno", + "one": "uno" + }, + "description": "descrizione", + "devmode_apps": "app in modalità dev", + "directory": "directory", + "downloading_qdn": "download da QDN", + "fee": { + "payment": "commissione di pagamento", + "publish": "commissione di pubblicazione" + }, + "for": "per", + "general": "generale", + "general_settings": "impostazioni generali", + "home": "casa", + "identifier": "identificativo", + "image_embed": "immagine incorporata", + "last_height": "ultimo blocco", + "level": "livello", + "library": "libreria", + "list": { + "bans": "elenco degli esclusi", + "groups": "elenco dei gruppi", + "invites": "elenco degli inviti", + "join_request": "elenco di richieste di iscrizione", + "member": "elenco dei membri", + "members": "elenco dei membri" + }, + "loading": { + "announcements": "caricamento di annunci", + "generic": "caricamento...", + "chat": "caricamento della chat. Attendere, per favore.", + "comments": "caricamento dei commenti. Attendere, per favore.", + "posts": "caricamento di post. Attendere, per favore." + }, + "member": "membro", + "member_other": "membri", + "message_us": "si prega di inviarci un messaggio su Nextcloud (nessuna registrazione richiesta) o Discord se hai bisogno di 4 QORT per iniziare a chattare senza limitazioni", + "message": { + "error": { + "address_not_found": "il tuo indirizzo non è stato trovato.", + "app_need_name": "la tua app ha bisogno di un nome.", + "build_app": "impossibile creare app privata.", + "decrypt_app": "impossibile decrittografare l'app privata '", + "download_image": "impossibile scaricare l'immagine. Riprova più tardi facendo clic sul pulsante Aggiorna.", + "download_private_app": "impossibile scaricare l'app privata.", + "encrypt_app": "impossibile crittografare. App non pubblicata.", + "fetch_app": "impossibile recuperare l'app.", + "fetch_publish": "impossibile recuperare la pubblicazione.", + "file_too_large": "il file {{ filename }} è troppo grande. La massima dimensione può essere di {{ size }} MB.", + "generic": "si è verificato un errore", + "initiate_download": "impossibile avviare il download.", + "invalid_amount": "importo non valido", + "invalid_base64": "dati Base64 non validi", + "invalid_embed_link": "collegamento incorporato non valido", + "invalid_image_embed_link_name": "link incorporato dell'immagine non valido. Parametro mancante.", + "invalid_poll_embed_link_name": "link incorporato del sondaggio non valido. Nome mancante.", + "invalid_signature": "firma non valida", + "invalid_theme_format": "formato tema non valido", + "invalid_zip": "zip non valido", + "message_loading": "errore di caricamento del messaggio", + "message_size": "la dimensione del messaggio è di {{ size }} byte su un massimo di {{maximum }}", + "minting_account_add": "impossibile aggiungere l'account di minting.", + "minting_account_remove": "impossibile rimuovere l'account di minting.", + "missing_fields": "mancano i campi: {{ fields }}", + "navigation_timeout": "timeout di navigazione", + "network_generic": "errore di rete", + "password_not_matching": "i campi della password non corrispondono!", + "password_wrong": "impossibile autenticare. Password sbagliata.", + "publish_app": "impossibile pubblicare l'app", + "publish_image": "impossibile pubblicare l'immagine", + "rate": "impossibile valutare", + "rating_option": "impossibile trovare l'opzione di valutazione", + "save_qdn": "impossibile salvare a QDN", + "send_failed": "impossibile inviare", + "update_failed": "impossibile aggiornare", + "vote": "impossibile votare" + }, + "generic": { + "already_voted": "hai già votato.", + "avatar_size": "{{ size }} KB max. per GIFS", + "benefits_qort": "vantaggi di avere QORT", + "building": "creazione", + "building_app": "creazione app", + "confirmed": "confermato", + "created_by": "creato da {{ owner }}", + "buy_order_request": "l'applicazione
{{hostname}}
sta effettuando {{count}} ordine d'acquisto.", + "buy_order_request_other": "l'applicazione
{{hostname}}
sta effettuando {{count}} ordini d'acquisto.", + "devmode_local_node": "si prega di utilizzare il tuo nodo locale per la modalità Dev! Scollegati ed usa il nodo locale.", + "downloading": "download", + "downloading_decrypting_app": "download e decriptazione dell'app privata.", + "edited": "modificato", + "editing_message": "messaggio di modifica", + "encrypted": "crittografato", + "encrypted_not": "non crittografato", + "fee_qort": "commissione: {{ message }} QORT", + "fetching_data": "recupero dei dati dell'app", + "foreign_fee": "commissione esterna: {{ message }}", + "get_qort_trade_portal": "ottieni QORT con il portale di trade crosschain di Qortal", + "minimal_qort_balance": "avere almeno {{ quantity }} QORT a bilancio (4 qort per la chat, 1.25 per il nome, 0.75 per alcune transazioni)", + "mentioned": "menzionato", + "message_with_image": "questo messaggio ha già un'immagine", + "most_recent_payment": "{{ count }} pagamenti più recenti", + "name_available": "{{ name }} è disponibile", + "name_benefits": "vantaggi di un nome", + "name_checking": "verifica se esiste già il nome", + "name_preview": "hai bisogno di un nome per utilizzare l'anteprima", + "name_publish": "hai bisogno di un nome Qortal per pubblicare", + "name_rate": "hai bisogno di un nome da valutare.", + "name_registration": "il tuo saldo è {{ balance }} QORT. La registrazione di un nome richiede una commissione di {{ fee }} QORT", + "name_unavailable": "{{ name }} non disponibile", + "no_data_image": "nessun dato per l'immagine", + "no_description": "nessuna descrizione", + "no_messages": "nessun messaggio", + "no_minting_details": "impossibile visualizzare i dettagli di minting sul gateway", + "no_notifications": "nessuna nuova notifica", + "no_payments": "nessun pagamento", + "no_pinned_changes": "per ora non ci sono modifiche alle app bloccate", + "no_results": "nessun risultato", + "one_app_per_name": "nota: per adesso sono consentiti solo un'app e un sito Web per nome.", + "ongoing_transactions": "transazioni in corso", + "opened": "aperto", + "overwrite_qdn": "sovrascrivi a QDN", + "password_confirm": "si prega di confermare una password", + "password_enter": "inserisci una password", + "payment_request": "l'applicazione
{{hostname}}
sta richiedendo un pagamento", + "people_reaction": "persone che hanno reagito con {{ reaction }}", + "processing_transaction": "elaborazione della transazione, per favore aspetta ...", + "publish_data": "pubblica dati su Qortal: qualsiasi cosa, dalle app ai video. Completamente decentralizzato!", + "publishing": "in pubblicazione. Attendere, per favore.", + "qdn": "usa il salvataggio QDN", + "rating": "valutazione di {{ service }} {{ name }}", + "register_name": "hai bisogno di un nome Qortal registrato per salvare in QDN le app bloccate.", + "replied_to": "risposta a {{ person }}", + "revert_default": "ritorna a predefinito", + "revert_qdn": "ritorna a QDN", + "save_qdn": "salva su QDN", + "secure_ownership": "sicura proprietà dei dati pubblicati con il tuo nome. Puoi anche vendere il tuo nome, insieme ai tuoi dati a una terza parte.", + "select_file": "seleziona un file", + "select_image": "seleziona un'immagine per un logo", + "select_zip": "seleziona il file .zip contenente il contenuto statico:", + "sending": "invio ...", + "settings": "si utilizza il modo di esportazione/importazione per salvare le impostazioni.", + "space_for_admins": "mi dispiace, questo spazio è solo per gli amministratori.", + "unread_messages": "messaggi non letti qua sotto", + "unsaved_changes": "hai cambiato modifiche alle app bloccate. Salvali su QDN.", + "updating": "aggiornamento", + "wait": "attendere per favore" + }, + "message": "messaggio", + "promotion_text": "testo di promozione", + "question": { + "accept_vote_on_poll": "accettate questa transazione vota_on_poll? I sondaggi sono pubblici!", + "logout": "sei sicuro di voler fare logout?", + "new_user": "sei un nuovo utente?", + "delete_chat_image": "vorresti eliminare la tua immagine di chat precedente?", + "perform_transaction": "vuoi eseguire una transazione {{action}}?", + "provide_thread": "si prega di fornire un titolo al thread", + "publish_app": "vorresti pubblicare questa app?", + "publish_avatar": "vorresti pubblicare un avatar?", + "publish_qdn": "vorresti pubblicare le impostazioni su QDN (crittografato)?", + "overwrite_changes": "l'app non è stata in grado di scaricare le app bloccate a QDN esistenti. Vorresti sovrascrivere quei cambiamenti?", + "rate_app": "vorresti dare il voto {{ rate }} a quest'app?. Questo creerà una transazione POLL.", + "register_name": "vorresti registrare questo nome?", + "reset_pinned": "non ti piacciono le attuali modifiche locali? Vorresti ripristinare le app bloccate predefinite?", + "reset_qdn": "non ti piacciono le attuali modifiche locali? Vorresti ripristinare le app QDN salvate?", + "transfer_qort": "vuoi trasferire {{ amount }} QORT?" + }, + "success": { + "order_submitted": "l'ordine di acquisto è stato inviato", + "published": "pubblicato con successo. Si prega di attendere un paio di minuti affinché la rete propaghi le modifiche.", + "published_qdn": "pubblicato con successo su QDN", + "rated_app": "valutato con successo. Si prega di attendere un paio di minuti affinché la rete propaghi le modifiche.", + "request_read": "ho letto questa richiesta", + "transfer": "il trasferimento è stato di successo!", + "voted": "votato con successo. Si prega di attendere un paio di minuti affinché la rete propaghi le modifiche." + } + }, + "minting": { + "account_details": "dettagli dell'account di minting", + "actions": "azioni sul minting", + "average_blocktime": "tempo medio per blocco di Qortal", + "average_blocks_per_day": "blocchi medi al giorno", + "average_created_qorts_per_day": "QORT medi creati al giorno", + "blockchain_statistics": "statistiche della blockchain", + "blocks_next_level": "blocchi al prossimo livello", + "current_level": "livello attuale", + "current_status": "stato attuale", + "current_tier": "fascia attuale", + "current_tier_content": "{{ tier }} (Livelli {{ levels }})", + "details": "dettagli sul minting", + "next_level": "Con un minting 24/7 raggiungerai il livello {{ level }} in {{ count }} giorni", + "rewards_info": "informazioni sulle ricompense del minting", + "reward_per_block": "ricompensa stimata per blocco", + "reward_per_day": "ricompensa stimata al giorno", + "status": { + "minting": "(minting)", + "not_minting": "(non minting)", + "no_status": "nessun stato", + "synchronized": "sincronizzato ({{ percent }}%)", + "synchronizing": "sincronizzazione ({{ percent }}%)..." + }, + "status_title": "stato minting", + "tier_share_per_block": "quota della fascia per blocco", + "total_minter_in_tier": "minter totali in questa fascia" + }, + "name": "nome", + "name_app": "nome/app", + "new_post_in": "nuovo post in {{ title }}", + "none": "nessuno", + "note": "nota", + "option": "opzione", + "option_no": "nessuna opzione", + "option_other": "opzioni", + "page": { + "last": "scorso", + "first": "primo", + "next": "prossimo", + "previous": "precedente" + }, + "payment": "pagamento", + "payment_notification": "notifica di pagamento", + "poll_embed": "sondaggio incorporato", + "port": "porta", + "price": "prezzo", + "publish": "pubblicazione", + "q_apps": { + "about": "su questo Q-app", + "q_mail": "Q-Mail", + "q_manager": "Q-Manager", + "q_sandbox": "Q-Sandbox", + "q_wallets": "Q-Wallets" + }, + "receiver": "ricevitore", + "sender": "mittente", + "server": "server", + "service_type": "tipo di servizio", + "settings": "impostazioni", + "sort": { + "by_member": "per membro" + }, + "supply": "offerta monetaria", + "tags": "tag", + "theme": { + "dark": "scuro", + "dark_mode": "modalità scura", + "default": "tema di default", + "light": "chiaro", + "light_mode": "modalità chiara", + "manager": "gestore del tema", + "name": "nome tema" + }, + "thread": "thread", + "thread_other": "discussioni", + "thread_title": "titolo del thread", + "time": { + "day_one": "{{count}} giorno", + "day_other": "{{count}} giorni", + "hour_one": "{{count}} ora", + "hour_other": "{{count}} ore", + "minute_one": "{{count}} minuto", + "minute_other": "{{count}} minuti", + "time": "tempo" + }, + "title": "titolo", + "to": "a", + "tutorial": "tutorial", + "url": "uRL", + "user_lookup": "ricerca utente", + "vote": "votare", + "vote_other": "{{ count }} votes", + "zip": "zip", + "wallet": { + "litecoin": "wallet Litecoin", + "qortal": "wallet Qortal", + "wallet": "wallet", + "wallet_other": "wallet" + }, + "website": "sito web", + "welcome": "benvenuto" +} diff --git a/src/i18n/locales/it/group.json b/src/i18n/locales/it/group.json new file mode 100644 index 0000000..f0a4229 --- /dev/null +++ b/src/i18n/locales/it/group.json @@ -0,0 +1,163 @@ +{ + "action": { + "add_promotion": "aggiungi promozione", + "ban": "escludi membro del gruppo", + "cancel_ban": "annulla esclusione", + "copy_private_key": "copia chiave privata", + "create_group": "crea gruppo", + "disable_push_notifications": "disabilita tutte le notifiche push", + "export_password": "esporta la password", + "export_private_key": "esporta una chiave privata", + "find_group": "trova gruppo", + "join_group": "entra nel gruppo", + "kick_member": "allontana membro dal gruppo", + "invite_member": "invita membro", + "leave_group": "lascia il gruppo", + "load_members": "carica i membri con i nomi", + "make_admin": "rendi amministratore", + "manage_members": "gestione dei membri", + "promote_group": "promuovi il gruppo ai non membri", + "publish_announcement": "pubblica annuncio", + "publish_avatar": "pubblica avatar", + "refetch_page": "ricarica pagina", + "remove_admin": "rimuovi da amministratore", + "remove_minting_account": "rimuovi l'account di minting", + "return_to_thread": "torna ai thread", + "scroll_bottom": "scorri in fondo", + "scroll_unread_messages": "scendi ai messaggi non letti", + "select_group": "seleziona un gruppo", + "visit_q_mintership": "visita Q-Mintership" + }, + "advanced_options": "opzioni avanzate", + "block_delay": { + "minimum": "ritardo del blocco minimo", + "maximum": "ritardo massimo del blocco" + }, + "group": { + "approval_threshold": "soglia di approvazione del gruppo", + "avatar": "avatar di gruppo", + "closed": "chiuso (privato) - Gli utenti necessitano dell'autorizzazione per partecipare", + "description": "descrizione del gruppo", + "id": "gruppo ID", + "invites": "inviti di gruppo", + "group": "gruppo", + "group_name": "gruppo: {{ name }}", + "group_other": "gruppi", + "groups_admin": "gruppi in cui sei un amministratore", + "management": "gestione del gruppo", + "member_number": "numero di membri", + "messaging": "chat", + "name": "nome del gruppo", + "open": "aperto (pubblico)", + "private": "gruppo privato", + "promotions": "promozioni di gruppo", + "public": "gruppo pubblico", + "type": "tipo di gruppo" + }, + "invitation_expiry": "scadenza dell'invito", + "invitees_list": "elenco degli inviti", + "join_link": "link per entrare nel gruppo", + "join_requests": "richieste di adesione", + "last_message": "ultimo messaggio", + "last_message_date": "ultimo messaggio: {{ date }}", + "latest_mails": "ultimi Q-Mail", + "message": { + "generic": { + "avatar_publish_fee": "la pubblicazione di un Avatar richiede {{ fee }}", + "avatar_registered_name": "È necessario un nome registrato per impostare un avatar", + "admin_only": "verranno mostrati solo i gruppi in cui sei un amministratore", + "already_in_group": "sei già in questo gruppo!", + "block_delay_minimum": "ritardo minimo del blocco per le approvazioni delle transazioni di gruppo", + "block_delay_maximum": "ritardo massimo del blocco per le approvazioni delle transazioni di gruppo", + "closed_group": "questo è un gruppo chiuso/privato, quindi occorre attendere fino a quando un amministratore accetta la richiesta", + "descrypt_wallet": "decrittazione del wallet ...", + "encryption_key": "la prima chiave di crittografia comune del gruppo è in fase di creazione. Si prega di attendere qualche minuto per il suo recupero dalla rete. Controllo ogni 2 minuti ...", + "group_announcement": "annunci di gruppo", + "group_approval_threshold": "soglia di approvazione del gruppo (numero / percentuale di amministratori che devono approvare una transazione)", + "group_encrypted": "gruppo crittografato", + "group_invited_you": "{{group}} ti ha invitato", + "group_key_created": "creata la prima chiave di gruppo.", + "group_member_list_changed": "l'elenco dei membri del gruppo è cambiato. Si prega di recriptare nuovamente la chiave segreta.", + "group_no_secret_key": "non esiste una chiave segreta di gruppo. Potresti essere il primo amministratore a pubblicarne una!", + "group_secret_key_no_owner": "l'ultima chiave segreta del gruppo è stata pubblicata da un non proprietario. Per sicurezza, come proprietario del gruppo, si prega di recriptare la chiave.", + "invalid_content": "contenuto non valido, mittente o timestamp nei dati di reazione", + "invalid_data": "errore di caricamento del contenuto: dati non validi", + "latest_promotion": "verrà mostrata solo l'ultima promozione della settimana per il tuo gruppo.", + "loading_members": "caricamento dell'elenco dei membri con nomi ... Attendere.", + "max_chars": "max 200 caratteri. Commissione", + "manage_minting": "gestione del minting", + "minter_group": "per ora non fai parte del gruppo Minter", + "mintership_app": "visita l'app Q-Mintership per chiedere di diventare un minter", + "minting_account": "account di minting:", + "minting_keys_per_node": "sono ammesse solo 2 chiavi di minting per nodo. Rimuoverne una se si desidera fare minting con questo account.", + "minting_keys_per_node_different": "sono ammesse solo 2 chiavi di minting per nodo. Rimuovine una se desideri aggiungere un account diverso.", + "node_minting_account": "account minting del nodo", + "node_minting_key": "hai una chiave di minting per questo account collegata al nodo", + "no_announcement": "nessun annuncio", + "no_display": "niente da visualizzare", + "no_selection": "nessun gruppo selezionato", + "not_part_group": "non fai parte del gruppo crittografato di membri. Attendere che un amministratore recripti le chiavi.", + "only_encrypted": "verranno visualizzati solo messaggi non crittografati.", + "only_private_groups": "verranno mostrati solo gruppi privati", + "pending_join_requests": "{{ group }} ha {{ count }} richieste pendenti di adesione", + "private_key_copied": "chiave privata copiata", + "provide_message": "si prega di fornire un primo messaggio al thread", + "secure_place": "mantieni la chiave privata in un luogo sicuro. Non condividerla!", + "setting_group": "impostazione gruppo. Attendere, per favore." + }, + "error": { + "access_name": "impossibile inviare un messaggio senza accesso al tuo nome", + "descrypt_wallet": "errore di decrifrazione del wallet {{ message }}", + "description_required": "si prega di fornire una descrizione", + "group_info": "impossibile accedere alle informazioni del gruppo", + "group_join": "impossibile aderire al gruppo", + "group_promotion": "errore di pubblicazione della promozione. Per favore riprovare", + "group_secret_key": "impossibile ottenere la chiave segreta del gruppo", + "name_required": "si prega di fornire un nome", + "notify_admins": "prova a notificare un amministratore dall'elenco degli amministratori seguente:", + "qortals_required": "occorrono almeno {{ quantity }} QORT per inviare un messaggio", + "timeout_reward": "timeout in attesa di conferma della condivisione della ricompensa", + "thread_id": "impossibile individuare il thread ID", + "unable_determine_group_private": "impossibile determinare se il gruppo è privato", + "unable_minting": "impossibile iniziare a coniare" + }, + "success": { + "group_ban": "membro escluso con successo dal gruppo. Potrebbero essere necessari un paio di minuti per propagare le modifiche.", + "group_creation": "gruppo creato correttamente. Potrebbero essere necessari un paio di minuti per propagare le modifiche.", + "group_creation_name": "creato il gruppo {{group_name}}: attendere la conferma", + "group_creation_label": "creato il gruppo {{name}}: successo!", + "group_invite": "invitato con successo {{invitee}}. Potrebbero essere necessari un paio di minuti per propagare le modifiche.", + "group_join": "richiesto con successo di unirsi al gruppo. Potrebbero essere necessari un paio di minuti per propagare le modifiche.", + "group_join_name": "adesione al gruppo {{group_name}}: attendere la conferma", + "group_join_label": "adesione al gruppo {{name}}: success!", + "group_join_request": "richiesta di adesione al gruppo {{group_name}}: attendere la conferma", + "group_join_outcome": "richiesta di adesione al gruppo {{group_name}}: successo!", + "group_kick": "il membro è stato escludo dal gruppo. Potrebbero essere necessari un paio di minuti per propagare le modifiche.", + "group_leave": "richiesto con successo l'abbandono del gruppo. Potrebbero essere necessari un paio di minuti per propagare le modifiche.", + "group_leave_name": "abbandonato il gruppo {{group_name}}: attendere la conferma", + "group_leave_label": "abbandonato il gruppo {{name}}: successo!", + "group_member_admin": "il membro è ora amministratore. Potrebbero essere necessari un paio di minuti per propagare le modifiche.", + "group_promotion": "promozione pubblicata con successo. Potrebbero essere necessari un paio di minuti per la promozione", + "group_remove_member": "rimosso con successo il membro come amministratore. Potrebbero essere necessari un paio di minuti per propagare le modifiche.", + "invitation_cancellation": "invito annullato con successo. Potrebbero essere necessari un paio di minuti per propagare le modifiche.", + "invitation_request": "richiesta di adesione accettata: in attesa di conferma", + "loading_threads": "caricamento dei thread ... Attendi.", + "post_creation": "post creato correttamente. Potrebbe essere necessario del tempo per la propagazione della pubblicazione", + "published_secret_key": "pubblicata la secret key per il gruppo {{ group_id }}: attendere la conferma", + "published_secret_key_label": "pubblicata la secret key per il gruppo {{ group_id }}: successo!", + "registered_name": "registrato con successo. Potrebbero essere necessari un paio di minuti per propagare le modifiche.", + "registered_name_label": "nome registrato: in attesa di conferma. Questo potrebbe richiedere un paio di minuti.", + "registered_name_success": "nome registrato: successo!", + "rewardshare_add": "aggiungi ricompensa: in attesa di conferma", + "rewardshare_add_label": "aggiungi ricompensa: successo!", + "rewardshare_creation": "confermare la creazione di ricompensa sulla catena. Si prega di pazientare, potrebbe richiedere fino a 90 secondi.", + "rewardshare_confirmed": "ricompensa confermata. Fare clic su Avanti.", + "rewardshare_remove": "rimuovi la ricompensa: in attesa di conferma", + "rewardshare_remove_label": "rimuovi la ricompensa: successo!", + "thread_creation": "thread creato correttamente. Potrebbe essere necessario del tempo per la propagazione della pubblicazione.", + "unbanned_user": "utente riammesso con successo. Potrebbero essere necessari un paio di minuti per propagare le modifiche.", + "user_joined": "l'utente si è unito con successo!" + } + }, + "thread_posts": "nuovi post di thread" +} diff --git a/src/i18n/locales/it/question.json b/src/i18n/locales/it/question.json new file mode 100644 index 0000000..4b52943 --- /dev/null +++ b/src/i18n/locales/it/question.json @@ -0,0 +1,194 @@ +{ + "accept_app_fee": "accetta la commissione dell'app", + "always_authenticate": "autentica sempre automaticamente", + "always_chat_messages": "consenti sempre i messaggi chat da questa app", + "always_retrieve_balance": "consenti sempre il recupero automatico del saldo", + "always_retrieve_list": "consenti sempre il recupero automatico delle liste", + "always_retrieve_wallet": "consenti sempre il recupero automatico del wallet", + "always_retrieve_wallet_transactions": "consenti sempre il recupero automatico delle transazioni del wallet", + "amount_qty": "quantità: {{ quantity }}", + "asset_name": "asset: {{ asset }}", + "assets_used_pay": "asset usato nei pagamenti: {{ asset }}", + "coin": "moneta: {{ coin }}", + "description": "descrizione: {{ description }}", + "deploy_at": "vuoi distribuire questo AT?", + "download_file": "vuoi scaricare:", + "message": { + "error": { + "add_to_list": "impossibile aggiungere alla lista", + "at_info": "impossibile trovare informazioni sull'AT", + "buy_order": "invio ordine di scambio fallito", + "cancel_sell_order": "annullamento ordine di vendita fallito. Riprova!", + "copy_clipboard": "copia negli appunti fallita", + "create_sell_order": "creazione ordine di vendita fallita. Riprova!", + "create_tradebot": "impossibile creare tradebot", + "decode_transaction": "decodifica della transazione fallita", + "decrypt": "impossibile decriptare", + "decrypt_message": "decriptazione del messaggio fallita. Verifica dati e chiavi", + "decryption_failed": "decriptazione fallita", + "empty_receiver": "il destinatario non può essere vuoto!", + "encrypt": "impossibile criptare", + "encryption_failed": "criptazione fallita", + "encryption_requires_public_key": "la criptazione richiede chiavi pubbliche", + "fetch_balance_token": "impossibile recuperare il saldo di {{ token }}. Riprova!", + "fetch_balance": "impossibile recuperare il saldo", + "fetch_connection_history": "recupero cronologia connessioni fallito", + "fetch_generic": "impossibile recuperare", + "fetch_group": "recupero gruppo fallito", + "fetch_list": "recupero lista fallito", + "fetch_poll": "recupero sondaggio fallito", + "fetch_recipient_public_key": "recupero chiave pubblica del destinatario fallito", + "fetch_wallet_info": "impossibile recuperare informazioni sul wallet", + "fetch_wallet_transactions": "impossibile recuperare transazioni del wallet", + "fetch_wallet": "recupero wallet fallito. Riprova", + "file_extension": "impossibile determinare l'estensione del file", + "gateway_balance_local_node": "non è possibile visualizzare il saldo {{ token }} tramite il gateway. Utilizzare il nodo locale.", + "gateway_non_qort_local_node": "non è possibile inviare monete non-QORT tramite il gateway. Utilizzare il nodo locale.", + "gateway_retrieve_balance": "il recupero del saldo {{ token }} non è consentito tramite un gateway", + "gateway_wallet_local_node": "non è possibile visualizzare il wallet {{ token }} tramite il gateway. Utilizzare il nodo locale.", + "get_foreign_fee": "errore nel recupero delle commissioni estere", + "insufficient_balance_qort": "saldo QORT insufficiente", + "insufficient_balance": "saldo asset insufficiente", + "insufficient_funds": "fondi insufficienti", + "invalid_encryption_iv": "IV non valido: AES-GCM richiede un IV di 12 byte", + "invalid_encryption_key": "chiave non valida: AES-GCM richiede una chiave di 256 bit", + "invalid_fullcontent": "campo fullContent in formato non valido. Utilizzare stringa, base64 o oggetto", + "invalid_receiver": "indirizzo o nome destinatario non valido", + "invalid_type": "tipo non valido", + "mime_type": "impossibile determinare il mimeType", + "missing_fields": "campi mancanti: {{ fields }}", + "name_already_for_sale": "questo nome è già in vendita", + "name_not_for_sale": "questo nome non è in vendita", + "no_api_found": "nessuna API disponibile trovata", + "no_data_encrypted_resource": "nessun dato nella risorsa criptata", + "no_data_file_submitted": "nessun dato o file inviato", + "no_group_found": "gruppo non trovato", + "no_group_key": "chiave del gruppo non trovata", + "no_poll": "sondaggio non trovato", + "no_resources_publish": "nessuna risorsa da pubblicare", + "node_info": "recupero info nodo fallito", + "node_status": "recupero stato nodo fallito", + "only_encrypted_data": "solo dati criptati possono essere usati nei servizi privati", + "perform_request": "richiesta fallita", + "poll_create": "creazione sondaggio fallita", + "poll_vote": "voto al sondaggio fallito", + "process_transaction": "impossibile elaborare la transazione", + "provide_key_shared_link": "per una risorsa criptata, devi fornire la chiave per creare il link condiviso", + "registered_name": "serve un nome registrato per pubblicare", + "resources_publish": "alcune risorse non sono state pubblicate", + "retrieve_file": "recupero file fallito", + "retrieve_keys": "impossibile recuperare le chiavi", + "retrieve_summary": "recupero sommario fallito", + "retrieve_sync_status": "errore nel recupero dello stato di sincronizzazione di {{ token }}", + "same_foreign_blockchain": "tutti gli AT richiesti devono essere della stessa blockchain esterna", + "send": "invio fallito", + "server_current_add": "aggiunta server corrente fallita", + "server_current_set": "impostazione server corrente fallita", + "server_info": "errore nel recupero informazioni del server", + "server_remove": "rimozione server fallita", + "submit_sell_order": "invio ordine di vendita fallito", + "synchronization_attempts": "sincronizzazione fallita dopo {{ count }} tentativi", + "timeout_request": "richiesta scaduta", + "token_not_supported": "{{ token }} non è supportato per questa operazione", + "transaction_activity_summary": "errore nel riepilogo attività transazioni", + "unknown_error": "errore sconosciuto", + "unknown_admin_action_type": "tipo di azione amministrativa sconosciuto: {{ type }}", + "update_foreign_fee": "aggiornamento commissione estera fallito", + "update_tradebot": "impossibile aggiornare tradebot", + "upload_encryption": "caricamento fallito a causa della criptazione", + "upload": "caricamento fallito", + "use_private_service": "per pubblicare criptato, utilizzare un servizio che termina con _PRIVATE", + "user_qortal_name": "l'utente non ha un nome Qortal", + "max_size_publish": "dimensione massima consentita per file: {{size}} GB.", + "max_size_publish_public": "dimensione massima consentita sul nodo pubblico: {{size}} MB. Si prega di utilizzare il proprio nodo locale per file più grandi." + }, + "generic": { + "calculate_fee": "*la commissione di {{ amount }} sats è calcolata su una tariffa di {{ rate }} sats per kb, per una transazione di circa 300 byte.", + "confirm_join_group": "conferma partecipazione al gruppo:", + "include_data_decrypt": "includi dati da decriptare", + "include_data_encrypt": "includi dati da criptare", + "max_retry_transaction": "numero massimo di tentativi raggiunto. Transazione saltata.", + "no_action_public_node": "questa azione non può essere eseguita tramite un nodo pubblico", + "private_service": "usa un servizio privato", + "provide_group_id": "fornisci un groupId", + "read_transaction_carefully": "leggere attentamente la transazione prima di accettare!", + "user_declined_add_list": "l'utente ha rifiutato l'aggiunta alla lista", + "user_declined_delete_from_list": "l'utente ha rifiutato l'eliminazione dalla lista", + "user_declined_delete_hosted_resources": "l'utente ha rifiutato l'eliminazione delle risorse ospitate", + "user_declined_join": "l'utente ha rifiutato di unirsi al gruppo", + "user_declined_list": "l'utente ha rifiutato di ottenere la lista delle risorse ospitate", + "user_declined_request": "l'utente ha rifiutato la richiesta", + "user_declined_save_file": "l'utente ha rifiutato di salvare il file", + "user_declined_send_message": "l'utente ha rifiutato di inviare il messaggio", + "user_declined_share_list": "l'utente ha rifiutato di condividere la lista" + } + }, + "name": "nome: {{ name }}", + "option": "opzione: {{ option }}", + "options": "opzioni: {{ optionList }}", + "permission": { + "access_list": "consenti a questa applicazione di accedere alla lista?", + "add_admin": "consenti a questa applicazione di aggiungere l'utente {{ invitee }} come amministratore?", + "all_item_list": "consenti a questa applicazione di aggiungere i seguenti elementi alla lista {{ name }}:", + "authenticate": "consenti a questa applicazione di autenticarti?", + "ban": "consenti a questa applicazione di escludere {{ partecipant }} dal gruppo?", + "buy_name_detail": "acquisto di {{ name }} per {{ price }} QORT", + "buy_name": "consenti a questa applicazione di acquistare un nome?", + "buy_order_fee_estimation_one": "questa commissione è una stima basata su {{ count }} ordine, assumendo una dimensione di 300 byte e una tariffa di {{ fee }} {{ ticker }} per KB.", + "buy_order_fee_estimation_other": "questa commissione è una stima basata su {{ count }} ordini, assumendo una dimensione di 300 byte e una tariffa di {{ fee }} {{ ticker }} per KB.", + "buy_order_per_kb": "{{ fee }} {{ ticker }} per KB", + "buy_order_quantity_one": "{{ count }} ordine di acquisto", + "buy_order_quantity_other": "{{ count }} ordini di acquisto", + "buy_order_ticker": "{{ qort_amount }} QORT per {{ foreign_amount }} {{ ticker }}", + "buy_order": "consenti a questa applicazione di eseguire un ordine di acquisto?", + "cancel_ban": "consenti a questa applicazione di annullare il ban del gruppo per l'utente {{ partecipant }}?", + "cancel_group_invite": "consenti a questa applicazione di annullare l'invito al gruppo per {{ invitee }}?", + "cancel_sell_order": "consenti a questa applicazione di annullare un ordine di vendita?", + "create_group": "consenti a questa applicazione di creare un gruppo?", + "delete_hosts_resources": "consenti a questa applicazione di eliminare {{ size }} risorse ospitate?", + "fetch_balance": "consenti a questa applicazione di recuperare il saldo {{ coin }}?", + "get_wallet_info": "consenti a questa applicazione di ottenere le informazioni del tuo wallet?", + "get_wallet_transactions": "consenti a questa applicazione di recuperare le transazioni del tuo wallet?", + "invite": "consenti a questa applicazione di invitare {{ invitee }}?", + "kick": "consenti a questa applicazione di espellere {{ partecipant }} dal gruppo?", + "leave_group": "consenti a questa applicazione di uscire dal seguente gruppo?", + "list_hosted_data": "consenti a questa applicazione di ottenere l'elenco dei tuoi dati ospitati?", + "order_detail": "{{ qort_amount }} QORT per {{ foreign_amount }} {{ ticker }}", + "pay_publish": "consenti a questa applicazione di effettuare i seguenti pagamenti e pubblicazioni?", + "perform_admin_action_with_value": "con valore: {{ value }}", + "perform_admin_action": "consenti a questa applicazione di eseguire l'azione amministrativa: {{ type }}", + "publish_qdn": "consenti a questa applicazione di pubblicare su QDN?", + "register_name": "consenti a questa applicazione di registrare questo nome?", + "remove_admin": "consenti a questa applicazione di rimuovere l'utente {{ partecipant }} come amministratore?", + "remove_from_list": "consenti a questa applicazione di rimuovere i seguenti elementi dalla lista {{ name }}?", + "sell_name_cancel": "consenti a questa applicazione di annullare la vendita di un nome?", + "sell_name_transaction_detail": "vendi {{ name }} per {{ price }} QORT", + "sell_name_transaction": "consenti a questa applicazione di creare una transazione di vendita nome?", + "sell_order": "consenti a questa applicazione di eseguire un ordine di vendita?", + "send_chat_message": "consenti a questa applicazione di inviare questo messaggio chat?", + "send_coins": "consenti a questa applicazione di inviare monete?", + "server_add": "consenti a questa applicazione di aggiungere un server?", + "server_remove": "consenti a questa applicazione di rimuovere un server?", + "set_current_server": "consenti a questa applicazione di impostare il server corrente?", + "sign_fee": "consenti a questa applicazione di firmare le commissioni richieste per tutte le tue offerte di scambio?", + "sign_process_transaction": "consenti a questa applicazione di firmare ed elaborare una transazione?", + "sign_transaction": "consenti a questa applicazione di firmare una transazione?", + "transfer_asset": "consenti a questa applicazione di trasferire il seguente asset?", + "update_foreign_fee": "consenti a questa applicazione di aggiornare le commissioni estere sul tuo nodo?", + "update_group_detail": "nuovo proprietario: {{ owner }}", + "update_group": "consenti a questa applicazione di aggiornare questo gruppo?" + }, + "poll": "sondaggio: {{ name }}", + "provide_recipient_group_id": "fornisci un destinatario o un groupId", + "request_create_poll": "si sta richiedendo di creare il seguente sondaggio:", + "request_vote_poll": "viene richiesto di votare nel seguente sondaggio:", + "sats_per_kb": "{{ amount }} sats per KB", + "sats": "{{ amount }} sats", + "server_host": "host: {{ host }}", + "server_type": "tipo: {{ type }}", + "to_group": "a: gruppo {{ group_id }}", + "to_recipient": "a: {{ recipient }}", + "total_locking_fee": "commissione totale di blocco:", + "total_unlocking_fee": "commissione totale di sblocco:", + "value": "valore: {{ value }}" +} diff --git a/src/i18n/locales/it/tutorial.json b/src/i18n/locales/it/tutorial.json new file mode 100644 index 0000000..8c1cc52 --- /dev/null +++ b/src/i18n/locales/it/tutorial.json @@ -0,0 +1,21 @@ +{ + "1_getting_started": "1. Iniziare", + "2_overview": "2. Panoramica", + "3_groups": "3. Gruppi Qortal", + "4_obtain_qort": "4. Ottenere QORT", + "account_creation": "creazione dell'account", + "important_info": "informazioni importanti", + "apps": { + "dashboard": "1. Dashboard delle app", + "navigation": "2. Navigazione delle app" + }, + "initial": { + "recommended_qort_qty": "avere almeno {{ quantity }} QORT nel proprio wallet", + "explore": "esplora", + "general_chat": "chat generale", + "getting_started": "come iniziare", + "register_name": "registrare un nome", + "see_apps": "vedi le app", + "trade_qort": "scambia qort" + } +} diff --git a/src/i18n/locales/ja/auth.json b/src/i18n/locales/ja/auth.json new file mode 100644 index 0000000..5ab4735 --- /dev/null +++ b/src/i18n/locales/ja/auth.json @@ -0,0 +1,138 @@ +{ + "account": { + "your": "あなたのアカウント", + "account_many": "アカウント", + "account_one": "アカウント", + "selected": "選択されたアカウント" + }, + "action": { + "add": { + "account": "アカウントを追加", + "seed_phrase": "シードフレーズを追加" + }, + "authenticate": "認証する", + "block": "ブロック", + "block_all": "すべてブロック", + "block_data": "QDNデータをブロック", + "block_name": "名前をブロック", + "block_txs": "取引をブロック", + "fetch_names": "名前を取得", + "copy_address": "アドレスをコピー", + "create_account": "アカウントを作成", + "create_qortal_account": "下の次へをクリックしてQortalアカウントを作成してください。", + "choose_password": "新しいパスワードを選択", + "download_account": "アカウントをダウンロード", + "enter_amount": "0より大きい金額を入力してください", + "enter_recipient": "受取人を入力してください", + "enter_wallet_password": "ウォレットのパスワードを入力してください", + "export_seedphrase": "シードフレーズをエクスポート", + "insert_name_address": "名前またはアドレスを入力してください", + "publish_admin_secret_key": "管理者の秘密鍵を公開", + "publish_group_secret_key": "グループの秘密鍵を公開", + "reencrypt_key": "キーを再暗号化", + "return_to_list": "リストに戻る", + "setup_qortal_account": "Qortalアカウントを設定", + "unblock": "ブロック解除", + "unblock_name": "名前のブロック解除" + }, + "address": "アドレス", + "address_name": "アドレスまたは名前", + "advanced_users": "上級ユーザー向け", + "apikey": { + "alternative": "代替:ファイル選択", + "change": "APIキーを変更", + "enter": "APIキーを入力", + "import": "APIキーをインポート", + "key": "APIキー", + "select_valid": "有効なAPIキーを選択してください" + }, + "authentication": "認証", + "blocked_users": "ブロックされたユーザー", + "build_version": "ビルドバージョン", + "message": { + "error": { + "account_creation": "アカウントを作成できませんでした。", + "address_not_existing": "アドレスはブロックチェーン上に存在しません", + "block_user": "ユーザーをブロックできません", + "create_simmetric_key": "共通鍵を作成できません", + "decrypt_data": "データを復号できませんでした", + "decrypt": "復号に失敗しました", + "encrypt_content": "コンテンツを暗号化できません", + "fetch_user_account": "ユーザーアカウントを取得できません", + "field_not_found_json": "JSONに{{ field }}が見つかりません", + "find_secret_key": "正しい秘密鍵が見つかりません", + "incorrect_password": "パスワードが間違っています", + "invalid_qortal_link": "無効なQortalリンク", + "invalid_secret_key": "無効な秘密鍵です", + "invalid_uint8": "送信されたUint8ArrayDataは無効です", + "name_not_existing": "名前が存在しません", + "name_not_registered": "名前が登録されていません", + "read_blob_base64": "Blobをbase64文字列として読み取れませんでした", + "reencrypt_secret_key": "秘密鍵を再暗号化できませんでした", + "set_apikey": "APIキーの設定に失敗しました:" + }, + "generic": { + "blocked_addresses": "ブロックされたアドレス - トランザクションの処理をブロックします", + "blocked_names": "QDN用のブロックされた名前", + "blocking": "{{ name }} をブロック中", + "choose_block": "チャットメッセージをブロックするには「取引をブロック」または「すべて」を選択してください", + "congrats_setup": "おめでとうございます、準備が整いました!", + "decide_block": "何をブロックするか決定してください", + "downloading_encryption_keys": "暗号鍵をダウンロード中", + "fetching_admin_secret_key": "管理者の秘密鍵を取得中", + "fetching_group_secret_key": "グループ秘密鍵の公開を取得中", + "keep_secure": "アカウントファイルを安全に保管してください", + "last_encryption_date": "最終暗号化日: {{ date }}({{ name }} により)", + "locating_encryption_keys": "暗号鍵を特定中", + "name_address": "名前またはアドレス", + "no_account": "保存されたアカウントがありません", + "no_minimum_length": "最小文字数の制限はありません", + "no_secret_key_published": "まだ秘密鍵が公開されていません", + "publishing_key": "注意:キーの公開後、表示されるまで数分かかることがあります。しばらくお待ちください。", + "seedphrase_notice": "バックグラウンドでシードフレーズが自動生成されました。", + "turn_local_node": "ローカルノードを起動してください", + "type_seed": "シードフレーズを入力または貼り付けてください", + "your_accounts": "保存されたあなたのアカウント" + }, + "success": { + "reencrypted_secret_key": "秘密鍵の再暗号化に成功しました。変更が反映されるまで数分かかる場合があります。5分後にグループを更新してください。" + } + }, + "node": { + "choose": "カスタムノードを選択", + "custom_many": "カスタムノード", + "use_custom": "カスタムノードを使用", + "use_local": "ローカルノードを使用", + "using": "使用中のノード", + "using_public": "パブリックノードを使用", + "using_public_gateway": "パブリックノードを使用中: {{ gateway }}" + }, + "note": "メモ", + "password": "パスワード", + "password_confirmation": "パスワードの確認", + "seed_phrase": "シードフレーズ", + "seed_your": "あなたのシードフレーズ", + "tips": { + "additional_wallet": "すでに作成した他のQortalウォレットを接続するにはこのオプションを使用してください。ログインにはバックアップJSONファイルが必要です。", + "digital_id": "あなたのウォレットはQortal上のデジタルIDであり、ユーザーインターフェースにログインする方法です。公開アドレスと選択したQortal名が含まれます。すべての取引はこのIDにリンクされ、ここでQORTおよび他の暗号通貨を管理します。", + "existing_account": "既にQortalアカウントをお持ちですか?ここに秘密のバックアップフレーズを入力してアクセスしてください。このフレーズはアカウントを復元する手段の1つです。", + "key_encrypt_admin": "この鍵はADMIN関連のコンテンツを暗号化するためのものです。管理者のみがこの内容を表示できます。", + "key_encrypt_group": "この鍵はGROUP関連のコンテンツを暗号化します。現在このUIで唯一使用されています。グループの全メンバーがこの鍵で暗号化されたコンテンツを表示できます。", + "new_account": "アカウントを作成すると、新しいウォレットとデジタルIDが作成され、Qortalの利用が始められます。QORTの取得、名前とアバターの購入、動画やブログの公開などが可能になります。", + "new_users": "新規ユーザーはこちらから!", + "safe_place": "アカウントは覚えやすい安全な場所に保存してください!", + "view_seedphrase": "シードフレーズを表示したい場合は、このテキスト内の「シードフレーズ」という単語をクリックしてください。セキュリティのため、明示的に選択しない限り表示されません。", + "wallet_secure": "ウォレットファイルを安全に保管してください。" + }, + "wallet": { + "password_confirmation": "ウォレットのパスワード確認", + "password": "ウォレットのパスワード", + "keep_password": "現在のパスワードを維持", + "new_password": "新しいパスワード", + "error": { + "missing_new_password": "新しいパスワードを入力してください", + "missing_password": "パスワードを入力してください" + } + }, + "welcome": "ようこそ" +} diff --git a/src/i18n/locales/ja/core.json b/src/i18n/locales/ja/core.json new file mode 100644 index 0000000..06ca85f --- /dev/null +++ b/src/i18n/locales/ja/core.json @@ -0,0 +1,419 @@ +{ + "action": { + "accept": "受け入れる", + "access": "アクセス", + "access_app": "アクセスアプリ", + "add": "追加", + "add_custom_framework": "カスタムフレームワークを追加します", + "add_reaction": "反応を追加します", + "add_theme": "テーマを追加します", + "backup_account": "バックアップアカウント", + "backup_wallet": "バックアップウォレット", + "cancel": "キャンセル", + "cancel_invitation": "招待状をキャンセルします", + "change": "変化", + "change_avatar": "アバターを変更します", + "change_file": "ファイルを変更します", + "change_language": "言語を変更します", + "choose": "選ぶ", + "choose_file": "ファイルを選択します", + "choose_image": "画像を選択します", + "choose_logo": "ロゴを選択してください", + "choose_name": "名前を選択してください", + "close": "近い", + "close_chat": "直接チャットを閉じます", + "continue": "続く", + "continue_logout": "ログアウトを続けます", + "copy_link": "リンクをコピーします", + "create_apps": "アプリを作成します", + "create_file": "ファイルを作成します", + "create_transaction": "Qortalブロックチェーンでトランザクションを作成します", + "create_thread": "スレッドを作成します", + "decline": "衰退", + "decrypt": "復号化", + "disable_enter": "Enterを無効にします", + "download": "ダウンロード", + "download_file": "ファイルをダウンロードします", + "edit": "編集", + "edit_theme": "テーマを編集します", + "enable_dev_mode": "DEVモードを有効にします", + "enter_name": "名前を入力します", + "export": "輸出", + "get_qort": "QORTを取得します", + "get_qort_trade": "QトレードでQORTを取得します", + "hide": "隠れる", + "hide_qr_code": "QRコードを非表示にします", + "import": "輸入", + "import_theme": "テーマをインポートします", + "invite": "招待する", + "invite_member": "新しいメンバーを招待します", + "join": "参加する", + "leave_comment": "コメントを残してください", + "load_announcements": "古いアナウンスをロードします", + "login": "ログイン", + "logout": "ログアウト", + "new": { + "chat": "新しいチャット", + "post": "新しい投稿", + "theme": "新しいテーマ", + "thread": "新しいスレッド" + }, + "notify": "通知します", + "open": "開ける", + "pin": "ピン", + "pin_app": "ピンアプリ", + "pin_from_dashboard": "ダッシュボードからピン", + "post": "役職", + "post_message": "メッセージを投稿します", + "publish": "公開", + "publish_app": "アプリを公開します", + "publish_comment": "コメントを公開します", + "refresh": "リフレッシュします", + "register_name": "登録名", + "remove": "取り除く", + "remove_reaction": "反応を取り除きます", + "return_apps_dashboard": "アプリダッシュボードに戻ります", + "save": "保存", + "save_disk": "ディスクに保存します", + "search": "検索", + "search_apps": "アプリを検索します", + "search_groups": "グループを検索します", + "search_chat_text": "チャットテキストを検索します", + "see_qr_code": "QRコードを参照してください", + "select_app_type": "[アプリタイプ]を選択します", + "select_category": "カテゴリを選択します", + "select_name_app": "名前/アプリを選択します", + "send": "送信", + "send_qort": "QORTを送信します", + "set_avatar": "アバターを設定します", + "show": "見せる", + "show_poll": "投票を表示します", + "start_minting": "ミントを開始します", + "start_typing": "ここで入力を開始します...", + "trade_qort": "取引Qort", + "transfer_qort": "QORTを転送します", + "unpin": "unpin", + "unpin_app": "UNPINアプリ", + "unpin_from_dashboard": "ダッシュボードからリプリッド", + "update": "アップデート", + "update_app": "アプリを更新します", + "vote": "投票する" + }, + "address_your": "あなたの住所", + "admin": "管理者", + "admin_other": "管理者", + "all": "全て", + "amount": "額", + "announcement": "発表", + "announcement_other": "発表", + "api": "API", + "app": "アプリ", + "app_other": "アプリ", + "app_name": "アプリ名", + "app_private": "プライベート", + "app_service_type": "アプリサービスタイプ", + "apps_dashboard": "アプリダッシュボード", + "apps_official": "公式アプリ", + "attachment": "添付ファイル", + "balance": "バランス:", + "category": "カテゴリ", + "category_other": "カテゴリ", + "chat": "チャット", + "comment_other": "コメント", + "contact_other": "連絡先", + "core": { + "block_height": "ブロックの高さ", + "information": "コア情報", + "peers": "コネクテッドピア", + "version": "コアバージョン" + }, + "current_language": "current language: {{ language }}", + "dev": "開発者", + "dev_mode": "開発モード", + "domain": "ドメイン", + "ui": { + "version": "UIバージョン" + }, + "count": { + "none": "なし", + "one": "1つ" + }, + "description": "説明", + "devmode_apps": "開発モードアプリ", + "directory": "ディレクトリ", + "downloading_qdn": "QDNからダウンロード", + "fee": { + "payment": "支払い料", + "publish": "公開料金" + }, + "for": "のために", + "general": "一般的な", + "general_settings": "一般的な設定", + "home": "家", + "identifier": "識別子", + "image_embed": "画像埋め込み", + "last_height": "最後の高さ", + "level": "レベル", + "library": "図書館", + "list": { + "bans": "禁止のリスト", + "groups": "グループのリスト", + "invites": "招待状のリスト", + "join_request": "リクエストリストに参加します", + "member": "メンバーリスト", + "members": "メンバーのリスト" + }, + "loading": { + "announcements": "発表の読み込み", + "generic": "読み込み...", + "chat": "チャットの読み込み...待ってください。", + "comments": "コメントの読み込み...待ってください。", + "posts": "投稿の読み込み...待ってください。" + }, + "member": "メンバー", + "member_other": "メンバー", + "message_us": "制限なしにチャットを開始するために4 QORTが必要な場合は、NextCloud(サインアップは不要)または不一致で私たちにメッセージを送ってください", + "message": { + "error": { + "address_not_found": "あなたの住所は見つかりませんでした", + "app_need_name": "アプリには名前が必要です", + "build_app": "プライベートアプリを作成できません", + "decrypt_app": "プライベートアプリを復号化できません」", + "download_image": "画像をダウンロードできません。リフレッシュボタンをクリックして、後でもう一度やり直してください", + "download_private_app": "プライベートアプリをダウンロードできません", + "encrypt_app": "アプリを暗号化できません。公開されていないアプリ」", + "fetch_app": "アプリを取得できません", + "fetch_publish": "公開を取得できません", + "file_too_large": "file {{ filename }} is too large. Max size allowed is {{ size }} MB.", + "generic": "エラーが発生しました", + "initiate_download": "ダウンロードを開始できませんでした", + "invalid_amount": "無効な量", + "invalid_base64": "無効なbase64データ", + "invalid_embed_link": "無効な埋め込みリンク", + "invalid_image_embed_link_name": "無効な画像埋め込みリンク。 PARAMがありません。", + "invalid_poll_embed_link_name": "無効な世論調査リンク。欠落している名前。", + "invalid_signature": "無効な署名", + "invalid_theme_format": "無効なテーマ形式", + "invalid_zip": "無効なzip", + "message_loading": "メッセージの読み込みエラー。", + "message_size": "your message size is of {{ size }} bytes out of a maximum of {{ maximum }}", + "minting_account_add": "ミントアカウントを追加できません", + "minting_account_remove": "ミントアカウントを削除できません", + "missing_fields": "missing: {{ fields }}", + "navigation_timeout": "ナビゲーションタイムアウト", + "network_generic": "ネットワークエラー", + "password_not_matching": "パスワードフィールドは一致しません!", + "password_wrong": "認証できません。間違ったパスワード", + "publish_app": "アプリを公開できません", + "publish_image": "画像を公開できません", + "rate": "評価できません", + "rating_option": "評価オプションが見つかりません", + "save_qdn": "QDNに保存できません", + "send_failed": "送信に失敗しました", + "update_failed": "更新に失敗しました", + "vote": "投票できません" + }, + "generic": { + "already_voted": "あなたはすでに投票しました。", + "avatar_size": "{{ size }} KB max. for GIFS", + "benefits_qort": "QORTを持つことの利点", + "building": "建物", + "building_app": "ビルディングアプリ", + "confirmed": "確認済み", + "created_by": "created by {{ owner }}", + "buy_order_request": "the Application
{{hostname}}
is requesting {{count}} buy order", + "buy_order_request_other": "the Application
{{hostname}}
is requesting {{count}} buy orders", + "devmode_local_node": "DEVモードにローカルノードを使用してください!ログアウトしてローカルノードを使用します。", + "downloading": "ダウンロード", + "downloading_decrypting_app": "プライベートアプリのダウンロードと復号化。", + "edited": "編集", + "editing_message": "メッセージの編集", + "encrypted": "暗号化", + "encrypted_not": "暗号化されていません", + "fee_qort": "fee: {{ message }} QORT", + "fetching_data": "アプリデータを取得します", + "foreign_fee": "foreign fee: {{ message }}", + "get_qort_trade_portal": "QORTALのCrossChain Tradeポータルを使用してQORTを取得します", + "minimal_qort_balance": "having at least {{ quantity }} QORT in your balance (4 qort balance for chat, 1.25 for name, 0.75 for some transactions)", + "mentioned": "言及された", + "message_with_image": "このメッセージにはすでに画像があります", + "most_recent_payment": "{{ count }} most recent payment", + "name_available": "{{ name }} is available", + "name_benefits": "名前の利点", + "name_checking": "名前が既に存在するかどうかを確認します", + "name_preview": "プレビューを使用するには名前が必要です", + "name_publish": "公開するにはQortal名が必要です", + "name_rate": "評価するには名前が必要です。", + "name_registration": "your balance is {{ balance }} QORT. A name registration requires a {{ fee }} QORT fee", + "name_unavailable": "{{ name }} is unavailable", + "no_data_image": "画像のデータはありません", + "no_description": "説明なし", + "no_messages": "メッセージはありません", + "no_message": "メッセージはありません", + "no_minting_details": "ゲートウェイでミントの詳細を表示できません", + "no_notifications": "新しい通知はありません", + "no_payments": "支払いなし", + "no_pinned_changes": "現在、ピン留めアプリに変更がありません", + "no_results": "結果はありません", + "one_app_per_name": "注:現在、名前ごとに1つのアプリとWebサイトのみが許可されています。", + "ongoing_transactions": "継続中の取引", + "opened": "オープン", + "overwrite_qdn": "QDNに上書きします", + "password_confirm": "パスワードを確認してください", + "password_enter": "パスワードを入力してください", + "payment_request": "the Application
{{hostname}}
is requesting a payment", + "people_reaction": "people who reacted with {{ reaction }}", + "processing_transaction": "トランザクションを処理していますか、お待ちください...", + "publish_data": "Qortalにデータを公開:アプリからビデオまで何でも。完全に分散化されました!", + "publishing": "出版...待ってください。", + "qdn": "QDN保存を使用します", + "rating": "rating for {{ service }} {{ name }}", + "register_name": "ピン留めアプリをQDNに保存するには、登録されたQORTAL名が必要です。", + "replied_to": "replied to {{ person }}", + "revert_default": "デフォルトに戻します", + "revert_qdn": "QDNに戻ります", + "save_qdn": "QDNに保存します", + "secure_ownership": "あなたの名前で公開されたデータの安全な所有権。データとともに、名前をサードパーティに販売することもできます。", + "select_file": "ファイルを選択してください", + "select_image": "ロゴの画像を選択してください", + "select_zip": "静的コンテンツを含む.zipファイルを選択します。", + "sending": "送信...", + "settings": "設定を保存するエクスポート/インポート方法を使用しています。", + "space_for_admins": "申し訳ありませんが、このスペースは管理者専用です。", + "unread_messages": "以下の未読メッセージ", + "unsaved_changes": "ピン留めアプリに救われていない変更があります。それらをqdnに保存します。", + "updating": "更新", + "wait": "お待ちください" + }, + "message": "メッセージ", + "promotion_text": "プロモーションテキスト", + "question": { + "accept_vote_on_poll": "この投票_ON_POLLトランザクションを受け入れますか?世論調査は公開されています!", + "logout": "ログアウトしたいですか?", + "new_user": "あなたは新しいユーザーですか?", + "delete_chat_image": "以前のチャット画像を削除しますか?", + "perform_transaction": "would you like to perform a {{action}} transaction?", + "provide_thread": "スレッドタイトルを提供してください", + "publish_app": "このアプリを公開しますか?", + "publish_avatar": "アバターを公開しますか?", + "publish_qdn": "設定をQDN(暗号化)に公開しますか?", + "overwrite_changes": "このアプリは、既存のQDNが節約したピン留めアプリをダウンロードできませんでした。これらの変更を上書きしませんか?", + "rate_app": "would you like to rate this app a rating of {{ rate }}?. It will create a POLL tx.", + "register_name": "この名前を登録しますか?", + "reset_pinned": "あなたの現在のローカルの変更が気に入らない?デフォルトのピン留めアプリにリセットしますか?", + "reset_qdn": "あなたの現在のローカルの変更が気に入らない?保存したQDNピン留めアプリにリセットしますか?", + "transfer_qort": "would you like to transfer {{ amount }} QORT" + }, + "success": { + "order_submitted": "購入注文が提出されました", + "published": "正常に公開されました。ネットワークが変更を提案するまで数分待ってください。", + "published_qdn": "QDNに正常に公開されました", + "rated_app": "正常に評価されています。ネットワークが変更を提案するまで数分待ってください。", + "request_read": "このリクエストを読みました", + "transfer": "転送は成功しました!", + "voted": "正常に投票しました。ネットワークが変更を提案するまで数分待ってください。" + } + }, + "minting": { + "account_details": "ミンティングアカウントの詳細", + "actions": "ミンティングアクション", + "average_blocktime": "Qortalの平均ブロック時間", + "average_blocks_per_day": "1日あたりの平均ブロック数", + "average_created_qorts_per_day": "1日あたりに作成された平均QORT数", + "blockchain_statistics": "ブロックチェーン統計", + "blocks_next_level": "次のレベルまでのブロック数", + "current_level": "現在のレベル", + "current_status": "現在のステータス", + "current_tier": "現在のティア", + "current_tier_content": "{{ tier }}(レベル {{ levels }})", + "details": "ミンティングの詳細", + "next_level": "24時間年中無休のミンティングで、{{ count }}日以内にレベル{{ level }}に到達します", + "rewards_info": "ミンティング報酬情報", + "reward_per_block": "ブロックごとの推定報酬", + "reward_per_day": "1日あたりの推定報酬", + "status": { + "minting": "(鋳造)", + "not_minting": "(造りではありません)", + "no_status": "ステータスなし", + "synchronized": "同期 ({{ percent }}%)", + "synchronizing": "同期 ({{ percent }}%)..." + }, + "status_title": "ミントステータス", + "tier_share_per_block": "ブロックごとのティアシェア", + "total_minter_in_tier": "このティアの合計ミンター数" + }, + "name": "名前", + "name_app": "名前/アプリ", + "new_post_in": "new post in {{ title }}", + "none": "なし", + "note": "注記", + "option": "オプション", + "option_no": "オプションはありません", + "option_other": "オプション", + "page": { + "last": "最後", + "first": "初め", + "next": "次", + "previous": "前の" + }, + "payment_notification": "支払い通知", + "payment": "支払い", + "poll_embed": "投票埋め込み", + "port": "ポート", + "price": "価格", + "publish": "公開", + "q_apps": { + "about": "このq-appについて", + "q_mail": "Qメール", + "q_manager": "Qマネージャー", + "q_sandbox": "Q-Sandbox", + "q_wallets": "Q-Wallets" + }, + "receiver": "受信機", + "sender": "送信者", + "server": "サーバ", + "service_type": "サービスタイプ", + "settings": "設定", + "sort": { + "by_member": "メンバーによって" + }, + "supply": "供給", + "tags": "タグ", + "theme": { + "dark": "暗い", + "dark_mode": "ダークモード", + "default": "デフォルトのテーマ", + "light": "ライト", + "light_mode": "ライトモード", + "manager": "テーママネージャー", + "name": "テーマ名" + }, + "thread": "糸", + "thread_other": "スレッド", + "thread_title": "スレッドタイトル", + "time": { + "day_one": "{{count}} day", + "day_other": "{{count}} days", + "hour_one": "{{count}} hour", + "hour_other": "{{count}} hours", + "minute_one": "{{count}} minute", + "minute_other": "{{count}} minutes", + "time": "時間" + }, + "title": "タイトル", + "to": "に", + "tutorial": "チュートリアル", + "url": "URL", + "user_lookup": "ユーザールックアップ", + "vote": "投票する", + "vote_other": "{{ count }} votes", + "zip": "ジップ", + "wallet": { + "litecoin": "ライトコインウォレット", + "qortal": "Qortalウォレット", + "wallet": "財布", + "wallet_other": "財布" + }, + "website": "Webサイト", + "welcome": "いらっしゃいませ" +} diff --git a/src/i18n/locales/ja/group.json b/src/i18n/locales/ja/group.json new file mode 100644 index 0000000..94dfac2 --- /dev/null +++ b/src/i18n/locales/ja/group.json @@ -0,0 +1,163 @@ +{ + "action": { + "add_promotion": "プロモーションを追加", + "ban": "グループからメンバーを禁止する", + "cancel_ban": "禁止を解除", + "copy_private_key": "秘密鍵をコピー", + "create_group": "グループを作成", + "disable_push_notifications": "すべてのプッシュ通知を無効化", + "export_password": "パスワードをエクスポート", + "export_private_key": "秘密鍵をエクスポート", + "find_group": "グループを探す", + "join_group": "グループに参加", + "kick_member": "グループからメンバーを削除", + "invite_member": "メンバーを招待", + "leave_group": "グループを退出", + "load_members": "名前付きのメンバーを読み込み", + "make_admin": "管理者に設定", + "manage_members": "メンバーを管理", + "promote_group": "非メンバーにグループを宣伝", + "publish_announcement": "お知らせを投稿", + "publish_avatar": "アバターを公開", + "refetch_page": "ページを再取得", + "remove_admin": "管理者から除外", + "remove_minting_account": "マイニングアカウントを削除", + "return_to_thread": "スレッドに戻る", + "scroll_bottom": "一番下までスクロール", + "scroll_unread_messages": "未読メッセージへスクロール", + "select_group": "グループを選択", + "visit_q_mintership": "Q-Mintership を訪問" + }, + "advanced_options": "高度なオプション", + "block_delay": { + "minimum": "最小ブロック遅延", + "maximum": "最大ブロック遅延" + }, + "group": { + "approval_threshold": "グループの承認閾値", + "avatar": "グループアバター", + "closed": "クローズド(非公開) - 参加には許可が必要", + "description": "グループの説明", + "id": "グループID", + "invites": "グループ招待", + "group": "グループ", + "group_name": "グループ: {{ name }}", + "group_other": "グループ", + "groups_admin": "あなたが管理者のグループ", + "management": "グループ管理", + "member_number": "メンバー数", + "messaging": "メッセージ", + "name": "グループ名", + "open": "公開(誰でも参加可)", + "private": "非公開グループ", + "promotions": "グループのプロモーション", + "public": "公開グループ", + "type": "グループの種類" + }, + "invitation_expiry": "招待の有効期限", + "invitees_list": "招待者リスト", + "join_link": "グループ参加リンク", + "join_requests": "参加リクエスト", + "last_message": "最後のメッセージ", + "last_message_date": "最後のメッセージ: {{date }}", + "latest_mails": "最新のQメール", + "message": { + "generic": { + "avatar_publish_fee": "アバターの公開には {{ fee }} が必要です", + "avatar_registered_name": "アバターを設定するには登録済みの名前が必要です", + "admin_only": "あなたが管理者のグループのみ表示されます", + "already_in_group": "すでにこのグループに参加しています!", + "block_delay_minimum": "グループ取引承認の最小ブロック遅延", + "block_delay_maximum": "グループ取引承認の最大ブロック遅延", + "closed_group": "このグループは非公開のため、管理者の承認を待つ必要があります", + "descrypt_wallet": "ウォレットを復号中...", + "encryption_key": "グループの共通暗号鍵を生成中です。数分お待ちください...", + "group_announcement": "グループのお知らせ", + "group_approval_threshold": "グループの承認閾値(取引を承認する必要がある管理者の数/割合)", + "group_encrypted": "グループは暗号化されています", + "group_invited_you": "{{group}} があなたを招待しました", + "group_key_created": "最初のグループ鍵が作成されました。", + "group_member_list_changed": "メンバーリストが変更されました。秘密鍵を再暗号化してください。", + "group_no_secret_key": "グループの秘密鍵が存在しません。最初の管理者として公開してください!", + "group_secret_key_no_owner": "最後の鍵は所有者以外により公開されました。安全のため再暗号化してください。", + "invalid_content": "リアクションデータ内の内容、送信者、またはタイムスタンプが無効です", + "invalid_data": "無効なデータ:コンテンツの読み込みエラー", + "latest_promotion": "今週の最新プロモーションのみが表示されます", + "loading_members": "メンバーリストを読み込み中...しばらくお待ちください", + "max_chars": "最大200文字。投稿料が発生します", + "manage_minting": "マイニングを管理する", + "minter_group": "現在、MINTERグループに所属していません", + "mintership_app": "Q-Mintershipアプリでマイナー申請を行ってください", + "minting_account": "マイニングアカウント:", + "minting_keys_per_node": "ノードごとに最大2つのマイニング鍵が許可されています。削除してから追加してください。", + "minting_keys_per_node_different": "他のアカウントを追加するには、既存の鍵を削除してください。", + "node_minting_account": "ノードのマイニングアカウント", + "node_minting_key": "このノードに現在接続されているアカウントのマイニング鍵があります", + "no_announcement": "お知らせはありません", + "no_display": "表示するものがありません", + "no_selection": "グループが選択されていません", + "not_part_group": "暗号化されたグループの一員ではありません。管理者による鍵の再暗号化をお待ちください。", + "only_encrypted": "暗号化されていないメッセージのみ表示されます", + "only_private_groups": "非公開グループのみが表示されます", + "pending_join_requests": "{{ group }} に保留中の参加リクエストが {{ count }} 件あります", + "private_key_copied": "秘密鍵がコピーされました", + "provide_message": "スレッドへの最初のメッセージを入力してください", + "secure_place": "秘密鍵は安全な場所に保管してください。他人に共有しないでください!", + "setting_group": "グループを設定中...しばらくお待ちください" + }, + "error": { + "access_name": "名前にアクセスできないため、メッセージを送信できません", + "descrypt_wallet": "ウォレットの復号エラー:{{ message }}", + "description_required": "説明を入力してください", + "group_info": "グループ情報にアクセスできません", + "group_join": "グループへの参加に失敗しました", + "group_promotion": "プロモーションの投稿中にエラーが発生しました。もう一度お試しください", + "group_secret_key": "グループの秘密鍵を取得できません", + "name_required": "名前を入力してください", + "notify_admins": "以下の管理者に通知してみてください:", + "qortals_required": "メッセージを送信するには少なくとも {{ quantity }} QORT が必要です", + "timeout_reward": "報酬共有の確認待ちのタイムアウト", + "thread_id": "スレッドIDを特定できません", + "unable_determine_group_private": "グループが非公開かどうかを判別できません", + "unable_minting": "マイニングを開始できませんでした" + }, + "success": { + "group_ban": "メンバーをグループから禁止しました。反映には数分かかる場合があります", + "group_creation": "グループを作成しました。反映には数分かかる場合があります", + "group_creation_name": "グループ {{group_name}} を作成:確認待ち", + "group_creation_label": "グループ {{name}} を作成:成功!", + "group_invite": "{{invitee}} を招待しました。反映には数分かかる場合があります", + "group_join": "グループへの参加を申請しました。反映には数分かかる場合があります", + "group_join_name": "{{group_name}} に参加しました:確認待ち", + "group_join_label": "{{name}} に参加しました:成功!", + "group_join_request": "グループ {{group_name}} に参加申請:確認待ち", + "group_join_outcome": "グループ {{group_name}} への参加申請:成功!", + "group_kick": "メンバーをグループから削除しました。反映には数分かかる場合があります", + "group_leave": "グループからの退会を申請しました。反映には数分かかる場合があります", + "group_leave_name": "グループ {{group_name}} を退出:確認待ち", + "group_leave_label": "グループ {{name}} を退出:成功!", + "group_member_admin": "メンバーを管理者に昇格しました。反映には数分かかる場合があります", + "group_promotion": "プロモーションを公開しました。反映までに数分かかる場合があります", + "group_remove_member": "管理者権限を削除しました。反映には数分かかる場合があります", + "invitation_cancellation": "招待をキャンセルしました。反映には数分かかる場合があります", + "invitation_request": "参加リクエストを承認しました:確認待ち", + "loading_threads": "スレッドを読み込み中...お待ちください", + "post_creation": "投稿を作成しました。反映までに時間がかかる場合があります", + "published_secret_key": "グループ {{ group_id }} の秘密鍵を公開しました:確認待ち", + "published_secret_key_label": "グループ {{ group_id }} の秘密鍵を公開:成功!", + "registered_name": "名前を登録しました。反映には数分かかる場合があります", + "registered_name_label": "名前を登録:確認待ち", + "registered_name_success": "名前を登録:成功!", + "rewardshare_add": "報酬共有を追加:確認待ち", + "rewardshare_add_label": "報酬共有を追加:成功!", + "rewardshare_creation": "ブロックチェーン上で報酬共有の作成を確認中。最大90秒かかる場合があります。", + "rewardshare_confirmed": "報酬共有が確認されました。「次へ」をクリックしてください。", + "rewardshare_remove": "報酬共有を削除:確認待ち", + "rewardshare_remove_label": "報酬共有を削除:成功!", + "thread_creation": "スレッドを作成しました。反映までに時間がかかる場合があります", + "unbanned_user": "ユーザーの禁止を解除しました。反映には数分かかる場合があります", + "user_joined": "ユーザーが正常に参加しました!" + } + }, + "thread_posts": "新しいスレッド投稿" +} diff --git a/src/i18n/locales/ja/question.json b/src/i18n/locales/ja/question.json new file mode 100644 index 0000000..0c54ee8 --- /dev/null +++ b/src/i18n/locales/ja/question.json @@ -0,0 +1,194 @@ +{ + "accept_app_fee": "アプリの手数料を承認する", + "always_authenticate": "常に自動で認証する", + "always_chat_messages": "このアプリからのチャットメッセージを常に許可する", + "always_retrieve_balance": "残高を常に自動で取得する", + "always_retrieve_list": "リストを常に自動で取得する", + "always_retrieve_wallet": "ウォレットを常に自動で取得する", + "always_retrieve_wallet_transactions": "ウォレット取引を常に自動で取得する", + "amount_qty": "金額:{{ quantity }}", + "asset_name": "アセット:{{ asset }}", + "assets_used_pay": "支払いに使用されたアセット:{{ asset }}", + "coin": "コイン:{{ coin }}", + "description": "説明:{{ description }}", + "deploy_at": "このATをデプロイしますか?", + "download_file": "次のファイルをダウンロードしますか:", + "message": { + "error": { + "add_to_list": "リストへの追加に失敗しました", + "at_info": "AT情報が見つかりません。", + "buy_order": "取引注文の送信に失敗しました", + "cancel_sell_order": "売却注文のキャンセルに失敗しました。もう一度お試しください!", + "copy_clipboard": "クリップボードへのコピーに失敗しました", + "create_sell_order": "売却注文の作成に失敗しました。もう一度お試しください!", + "create_tradebot": "トレードボットの作成に失敗しました", + "decode_transaction": "トランザクションのデコードに失敗しました", + "decrypt": "復号できません", + "decrypt_message": "メッセージの復号に失敗しました。データと鍵が正しいことを確認してください", + "decryption_failed": "復号に失敗しました", + "empty_receiver": "受信者を空にすることはできません!", + "encrypt": "暗号化できません", + "encryption_failed": "暗号化に失敗しました", + "encryption_requires_public_key": "データの暗号化には公開鍵が必要です", + "fetch_balance_token": "{{ token }}の残高取得に失敗しました。再試行してください!", + "fetch_balance": "残高を取得できません", + "fetch_connection_history": "サーバー接続履歴の取得に失敗しました", + "fetch_generic": "取得に失敗しました", + "fetch_group": "グループの取得に失敗しました", + "fetch_list": "リストの取得に失敗しました", + "fetch_poll": "投票の取得に失敗しました", + "fetch_recipient_public_key": "受信者の公開鍵の取得に失敗しました", + "fetch_wallet_info": "ウォレット情報を取得できません", + "fetch_wallet_transactions": "ウォレットの取引を取得できません", + "fetch_wallet": "ウォレットの取得に失敗しました。もう一度お試しください", + "file_extension": "ファイルの拡張子を特定できませんでした", + "gateway_balance_local_node": "ゲートウェイ経由で{{ token }}の残高を表示できません。ローカルノードを使用してください。", + "gateway_non_qort_local_node": "ゲートウェイ経由でQORT以外のコインを送信できません。ローカルノードを使用してください。", + "gateway_retrieve_balance": "ゲートウェイ経由では{{ token }}の残高取得は許可されていません", + "gateway_wallet_local_node": "ゲートウェイ経由で{{ token }}のウォレットを表示できません。ローカルノードを使用してください。", + "get_foreign_fee": "外国手数料の取得時にエラーが発生しました", + "insufficient_balance_qort": "QORT残高が不足しています", + "insufficient_balance": "資産残高が不足しています", + "insufficient_funds": "残高不足です", + "invalid_encryption_iv": "無効なIV:AES-GCMには12バイトのIVが必要です", + "invalid_encryption_key": "無効な鍵:AES-GCMには256ビットの鍵が必要です", + "invalid_fullcontent": "フィールドfullContentの形式が無効です。文字列、base64、またはオブジェクトを使用してください", + "invalid_receiver": "無効な受信者アドレスまたは名前", + "invalid_type": "無効なタイプ", + "mime_type": "MIMEタイプを特定できませんでした", + "missing_fields": "不足しているフィールド:{{ fields }}", + "name_already_for_sale": "この名前はすでに販売中です", + "name_not_for_sale": "この名前は販売されていません", + "no_api_found": "利用可能なAPIが見つかりません", + "no_data_encrypted_resource": "暗号化リソースにデータがありません", + "no_data_file_submitted": "データまたはファイルが送信されていません", + "no_group_found": "グループが見つかりません", + "no_group_key": "グループキーが見つかりません", + "no_poll": "投票が見つかりません", + "no_resources_publish": "公開するリソースがありません", + "node_info": "ノード情報の取得に失敗しました", + "node_status": "ノードステータスの取得に失敗しました", + "only_encrypted_data": "プライベートサービスには暗号化されたデータのみを使用できます", + "perform_request": "リクエストの実行に失敗しました", + "poll_create": "投票の作成に失敗しました", + "poll_vote": "投票への投票に失敗しました", + "process_transaction": "トランザクションを処理できません", + "provide_key_shared_link": "暗号化リソースのため、共有リンク作成にはキーが必要です", + "registered_name": "公開には登録済みの名前が必要です", + "resources_publish": "一部のリソースの公開に失敗しました", + "retrieve_file": "ファイルの取得に失敗しました", + "retrieve_keys": "鍵の取得に失敗しました", + "retrieve_summary": "概要の取得に失敗しました", + "retrieve_sync_status": "{{ token }}の同期状態の取得時にエラーが発生しました", + "same_foreign_blockchain": "要求されたすべてのATは同じ外部ブロックチェーンである必要があります。", + "send": "送信に失敗しました", + "server_current_add": "現在のサーバーの追加に失敗しました", + "server_current_set": "現在のサーバーの設定に失敗しました", + "server_info": "サーバー情報の取得時にエラーが発生しました", + "server_remove": "サーバーの削除に失敗しました", + "submit_sell_order": "売却注文の送信に失敗しました", + "synchronization_attempts": "{{ count }} 回の試行後に同期に失敗しました", + "timeout_request": "リクエストがタイムアウトしました", + "token_not_supported": "{{ token }} はこの呼び出しではサポートされていません", + "transaction_activity_summary": "取引アクティビティの要約でエラーが発生しました", + "unknown_error": "不明なエラー", + "unknown_admin_action_type": "不明な管理アクションタイプ:{{ type }}", + "update_foreign_fee": "外部手数料の更新に失敗しました", + "update_tradebot": "トレードボットの更新ができません", + "upload_encryption": "暗号化に失敗したため、アップロードできませんでした", + "upload": "アップロードに失敗しました", + "use_private_service": "暗号化された公開には、_PRIVATEで終わるサービスを使用してください", + "user_qortal_name": "ユーザーはQortal名を持っていません", + "max_size_publish": "ファイルごとの最大サイズは{{size}}GBです。", + "max_size_publish_public": "公開ノードで許可されている最大ファイルサイズは{{size}}MBです。より大きなファイルにはローカルノードを使用してください。" + }, + "generic": { + "calculate_fee": "*{{ amount }} sats の手数料は、約300バイトのトランザクションに対して、{{ rate }} sats/KB に基づいて算出されています。", + "confirm_join_group": "グループへの参加を確認してください:", + "include_data_decrypt": "復号するデータを含めてください", + "include_data_encrypt": "暗号化するデータを含めてください", + "max_retry_transaction": "最大リトライ回数に達しました。トランザクションをスキップします。", + "no_action_public_node": "この操作はパブリックノードでは実行できません", + "private_service": "プライベートサービスを使用してください", + "provide_group_id": "groupId を提供してください", + "read_transaction_carefully": "トランザクションを承認する前に内容をよく確認してください!", + "user_declined_add_list": "ユーザーがリストへの追加を拒否しました", + "user_declined_delete_from_list": "ユーザーがリストからの削除を拒否しました", + "user_declined_delete_hosted_resources": "ユーザーがホストされたリソースの削除を拒否しました", + "user_declined_join": "ユーザーがグループへの参加を拒否しました", + "user_declined_list": "ユーザーがホストされたリソースのリスト取得を拒否しました", + "user_declined_request": "ユーザーがリクエストを拒否しました", + "user_declined_save_file": "ユーザーがファイルの保存を拒否しました", + "user_declined_send_message": "ユーザーがメッセージの送信を拒否しました", + "user_declined_share_list": "ユーザーがリストの共有を拒否しました" + } + }, + "name": "名前:{{ name }}", + "option": "オプション:{{ option }}", + "options": "オプション一覧:{{ optionList }}", + "permission": { + "access_list": "このアプリにリストへのアクセスを許可しますか?", + "add_admin": "このアプリにユーザー {{ invitee }} を管理者として追加することを許可しますか?", + "all_item_list": "このアプリに以下をリスト {{ name }} に追加することを許可しますか?", + "authenticate": "このアプリに認証を許可しますか?", + "ban": "このアプリに {{ partecipant }} をグループから追放することを許可しますか?", + "buy_name_detail": "{{ price }} QORTで{{ name }}を購入", + "buy_name": "このアプリに名前を購入することを許可しますか?", + "buy_order_fee_estimation_one": "{{ count }} 件の注文に基づく推定手数料です。300バイトのサイズで {{ fee }} {{ ticker }}/KB のレートに基づいています。", + "buy_order_fee_estimation_other": "{{ count }} 件の注文に基づく推定手数料です。300バイトのサイズで {{ fee }} {{ ticker }}/KB のレートに基づいています。", + "buy_order_per_kb": "{{ fee }} {{ ticker }}/KB", + "buy_order_quantity_one": "{{ count }} 件の買い注文", + "buy_order_quantity_other": "{{ count }} 件の買い注文", + "buy_order_ticker": "{{ foreign_amount }} {{ ticker }} に対して {{ qort_amount }} QORT", + "buy_order": "このアプリに買い注文を実行することを許可しますか?", + "cancel_ban": "このアプリにユーザー {{ partecipant }} のグループ禁止を解除することを許可しますか?", + "cancel_group_invite": "このアプリに {{ invitee }} へのグループ招待をキャンセルすることを許可しますか?", + "cancel_sell_order": "このアプリに売り注文のキャンセルを許可しますか?", + "create_group": "このアプリにグループを作成することを許可しますか?", + "delete_hosts_resources": "このアプリに {{ size }} 件のホストされたリソースを削除することを許可しますか?", + "fetch_balance": "このアプリに {{ coin }} の残高を取得することを許可しますか?", + "get_wallet_info": "このアプリにウォレット情報へのアクセスを許可しますか?", + "get_wallet_transactions": "このアプリにウォレットの取引履歴を取得することを許可しますか?", + "invite": "このアプリに {{ invitee }} を招待することを許可しますか?", + "kick": "このアプリに {{ partecipant }} をグループからキックすることを許可しますか?", + "leave_group": "このアプリに次のグループを退出することを許可しますか?", + "list_hosted_data": "このアプリにホストされたデータの一覧を取得することを許可しますか?", + "order_detail": "{{ foreign_amount }} {{ ticker }} に対して {{ qort_amount }} QORT", + "pay_publish": "このアプリに以下の支払いや公開を許可しますか?", + "perform_admin_action_with_value": "値:{{ value }}", + "perform_admin_action": "このアプリに管理アクション {{ type }} を実行することを許可しますか?", + "publish_qdn": "このアプリにQDNへの公開を許可しますか?", + "register_name": "このアプリにこの名前を登録することを許可しますか?", + "remove_admin": "このアプリに {{ partecipant }} を管理者から削除することを許可しますか?", + "remove_from_list": "このアプリにリスト {{ name }} から以下を削除することを許可しますか?", + "sell_name_cancel": "このアプリに名前の販売をキャンセルすることを許可しますか?", + "sell_name_transaction_detail": "{{ price }} QORTで{{ name }}を販売", + "sell_name_transaction": "このアプリに名前の販売取引を作成することを許可しますか?", + "sell_order": "このアプリに売り注文を実行することを許可しますか?", + "send_chat_message": "このアプリにこのチャットメッセージを送信することを許可しますか?", + "send_coins": "このアプリにコインを送信することを許可しますか?", + "server_add": "このアプリにサーバーを追加することを許可しますか?", + "server_remove": "このアプリにサーバーを削除することを許可しますか?", + "set_current_server": "このアプリに現在のサーバーを設定することを許可しますか?", + "sign_fee": "このアプリにすべての取引オファーに必要な手数料の署名を許可しますか?", + "sign_process_transaction": "このアプリにトランザクションの署名と処理を許可しますか?", + "sign_transaction": "このアプリにトランザクションの署名を許可しますか?", + "transfer_asset": "このアプリに以下の資産を転送することを許可しますか?", + "update_foreign_fee": "このアプリにノードの外部手数料を更新することを許可しますか?", + "update_group_detail": "新しい所有者:{{ owner }}", + "update_group": "このアプリにこのグループを更新することを許可しますか?" + }, + "poll": "投票:{{ name }}", + "provide_recipient_group_id": "受信者または groupId を入力してください", + "request_create_poll": "次の投票を作成しようとしています:", + "request_vote_poll": "次の投票への投票が求められています:", + "sats_per_kb": "{{ amount }} sats/KB", + "sats": "{{ amount }} sats", + "server_host": "ホスト:{{ host }}", + "server_type": "タイプ:{{ type }}", + "to_group": "宛先:グループ {{ group_id }}", + "to_recipient": "宛先:{{ recipient }}", + "total_locking_fee": "ロック手数料合計:", + "total_unlocking_fee": "アンロック手数料合計:", + "value": "値:{{ value }}" +} diff --git a/src/i18n/locales/ja/tutorial.json b/src/i18n/locales/ja/tutorial.json new file mode 100644 index 0000000..bb1810a --- /dev/null +++ b/src/i18n/locales/ja/tutorial.json @@ -0,0 +1,21 @@ +{ + "1_getting_started": "1. はじめに", + "2_overview": "2. 概要", + "3_groups": "3. Qortal グループ", + "4_obtain_qort": "4. QORT の入手方法", + "account_creation": "アカウント作成", + "important_info": "重要な情報", + "apps": { + "dashboard": "1. アプリ ダッシュボード", + "navigation": "2. アプリ ナビゲーション" + }, + "initial": { + "recommended_qort_qty": "ウォレットに少なくとも {{ quantity }} QORT を保有してください", + "explore": "探索する", + "general_chat": "全体チャット", + "getting_started": "はじめに", + "register_name": "名前を登録する", + "see_apps": "アプリを見る", + "trade_qort": "QORT を取引する" + } +} diff --git a/src/i18n/locales/ru/auth.json b/src/i18n/locales/ru/auth.json new file mode 100644 index 0000000..407d31f --- /dev/null +++ b/src/i18n/locales/ru/auth.json @@ -0,0 +1,138 @@ +{ + "account": { + "your": "ваш аккаунт", + "account_many": "аккаунты", + "account_one": "аккаунт", + "selected": "выбранный аккаунт" + }, + "action": { + "add": { + "account": "добавить аккаунт", + "seed_phrase": "добавить сид-фразу" + }, + "authenticate": "аутентификация", + "block": "заблокировать", + "block_all": "заблокировать всё", + "block_data": "блокировать данные QDN", + "block_name": "блокировать имя", + "block_txs": "блокировать транзакции", + "fetch_names": "получить имена", + "copy_address": "копировать адрес", + "create_account": "создать аккаунт", + "create_qortal_account": "создайте аккаунт Qortal, нажав ДАЛЕЕ ниже.", + "choose_password": "выберите новый пароль", + "download_account": "скачать аккаунт", + "enter_amount": "пожалуйста, введите сумму больше 0", + "enter_recipient": "пожалуйста, введите получателя", + "enter_wallet_password": "пожалуйста, введите пароль от кошелька", + "export_seedphrase": "экспорт сид-фразы", + "insert_name_address": "введите имя или адрес", + "publish_admin_secret_key": "опубликовать секретный ключ администратора", + "publish_group_secret_key": "опубликовать секретный ключ группы", + "reencrypt_key": "повторно зашифровать ключ", + "return_to_list": "вернуться к списку", + "setup_qortal_account": "настроить аккаунт Qortal", + "unblock": "разблокировать", + "unblock_name": "разблокировать имя" + }, + "address": "адрес", + "address_name": "адрес или имя", + "advanced_users": "для опытных пользователей", + "apikey": { + "alternative": "альтернатива: выбор файла", + "change": "изменить API-ключ", + "enter": "введите API-ключ", + "import": "импортировать API-ключ", + "key": "API-ключ", + "select_valid": "выберите допустимый API-ключ" + }, + "authentication": "аутентификация", + "blocked_users": "заблокированные пользователи", + "build_version": "версия сборки", + "message": { + "error": { + "account_creation": "не удалось создать аккаунт.", + "address_not_existing": "адрес не существует в блокчейне", + "block_user": "не удалось заблокировать пользователя", + "create_simmetric_key": "невозможно создать симметричный ключ", + "decrypt_data": "не удалось расшифровать данные", + "decrypt": "не удалось расшифровать", + "encrypt_content": "невозможно зашифровать содержимое", + "fetch_user_account": "не удалось получить аккаунт пользователя", + "field_not_found_json": "{{ field }} не найден в JSON", + "find_secret_key": "не удалось найти правильный секретный ключ", + "incorrect_password": "неверный пароль", + "invalid_qortal_link": "недействительная ссылка Qortal", + "invalid_secret_key": "недопустимый секретный ключ", + "invalid_uint8": "предоставленные данные Uint8Array недействительны", + "name_not_existing": "имя не существует", + "name_not_registered": "имя не зарегистрировано", + "read_blob_base64": "не удалось прочитать Blob как строку base64", + "reencrypt_secret_key": "не удалось повторно зашифровать секретный ключ", + "set_apikey": "не удалось установить API-ключ:" + }, + "generic": { + "blocked_addresses": "заблокированные адреса — блокируют обработку транзакций", + "blocked_names": "заблокированные имена для QDN", + "blocking": "блокировка {{ name }}", + "choose_block": "выберите 'блокировать транзакции' или 'всё' для блокировки чата", + "congrats_setup": "поздравляем, всё готово!", + "decide_block": "выберите, что блокировать", + "downloading_encryption_keys": "загрузка ключей шифрования", + "fetching_admin_secret_key": "получение секретного ключа администратора", + "fetching_group_secret_key": "получение публикаций секретного ключа группы", + "keep_secure": "сохраните файл аккаунта в безопасности", + "last_encryption_date": "последняя дата шифрования: {{ date }} от {{ name }}", + "locating_encryption_keys": "поиск ключей шифрования", + "name_address": "имя или адрес", + "no_account": "нет сохранённых аккаунтов", + "no_minimum_length": "нет требования к минимальной длине", + "no_secret_key_published": "секретный ключ ещё не опубликован", + "publishing_key": "напоминание: после публикации ключа его появление может занять несколько минут. Пожалуйста, подождите.", + "seedphrase_notice": "СИД-ФРАЗА была случайным образом сгенерирована в фоновом режиме.", + "turn_local_node": "пожалуйста, включите ваш локальный узел", + "type_seed": "введите или вставьте вашу сид-фразу", + "your_accounts": "ваши сохранённые аккаунты" + }, + "success": { + "reencrypted_secret_key": "секретный ключ успешно повторно зашифрован. Изменения вступят в силу через несколько минут. Обновите группу через 5 минут." + } + }, + "node": { + "choose": "выбрать пользовательский узел", + "custom_many": "пользовательские узлы", + "use_custom": "использовать пользовательский узел", + "use_local": "использовать локальный узел", + "using": "используемый узел", + "using_public": "используется публичный узел", + "using_public_gateway": "используется публичный узел: {{ gateway }}" + }, + "note": "заметка", + "password": "пароль", + "password_confirmation": "подтверждение пароля", + "seed_phrase": "сид-фраза", + "seed_your": "ваша сид-фраза", + "tips": { + "additional_wallet": "используйте эту опцию, чтобы подключить дополнительные Qortal-кошельки, которые вы уже создали. Для этого потребуется ваш резервный JSON-файл.", + "digital_id": "ваш кошелёк — это ваш цифровой ID в Qortal, с помощью которого вы входите в интерфейс. Он содержит ваш публичный адрес и выбранное имя Qortal. Все транзакции связаны с этим ID, и здесь вы управляете своим QORT и другими валютами.", + "existing_account": "уже есть аккаунт Qortal? Введите здесь вашу секретную фразу восстановления, чтобы получить доступ. Это один из способов восстановить аккаунт.", + "key_encrypt_admin": "этот ключ используется для шифрования содержимого, связанного с АДМИНИСТРАТОРАМИ. Только админы смогут просматривать это содержимое.", + "key_encrypt_group": "этот ключ используется для шифрования содержимого ГРУПП. Все члены группы смогут его просматривать. Это единственный используемый ключ в текущем интерфейсе.", + "new_account": "создание аккаунта означает создание нового кошелька и цифрового ID для начала использования Qortal. После создания вы сможете получать QORT, покупать имена и аватары, публиковать видео и блоги и многое другое.", + "new_users": "новые пользователи начинают здесь!", + "safe_place": "сохраните ваш аккаунт в безопасном месте, которое вы запомните!", + "view_seedphrase": "если вы хотите ПРОСМОТРЕТЬ СИД-ФРАЗУ, нажмите на слово 'СИД-ФРАЗА' в этом тексте. Сид-фразы используются для создания приватного ключа вашего аккаунта. По умолчанию они скрыты ради безопасности.", + "wallet_secure": "храните файл кошелька в безопасности." + }, + "wallet": { + "password_confirmation": "подтверждение пароля кошелька", + "password": "пароль кошелька", + "keep_password": "оставить текущий пароль", + "new_password": "новый пароль", + "error": { + "missing_new_password": "пожалуйста, введите новый пароль", + "missing_password": "пожалуйста, введите ваш пароль" + } + }, + "welcome": "добро пожаловать в" +} diff --git a/src/i18n/locales/ru/core.json b/src/i18n/locales/ru/core.json new file mode 100644 index 0000000..0272068 --- /dev/null +++ b/src/i18n/locales/ru/core.json @@ -0,0 +1,419 @@ +{ + "action": { + "accept": "принимать", + "access": "доступ", + "access_app": "доступ к App", + "add": "добавлять", + "add_custom_framework": "Добавьте пользовательскую структуру", + "add_reaction": "Добавить реакцию", + "add_theme": "Добавить тему", + "backup_account": "резервная учетная запись", + "backup_wallet": "резервный кошелек", + "cancel": "отмена", + "cancel_invitation": "Отменить приглашение", + "change": "изменять", + "change_avatar": "изменить аватар", + "change_file": "изменить файл", + "change_language": "Изменение языка", + "choose": "выбирать", + "choose_file": "Выберите файл", + "choose_image": "Выберите изображение", + "choose_logo": "Выберите логотип", + "choose_name": "Выберите имя", + "close": "закрывать", + "close_chat": "Близкий прямой чат", + "continue": "продолжать", + "continue_logout": "Продолжайте выходить в систему", + "copy_link": "Ссылка копирования", + "create_apps": "Создать приложения", + "create_file": "Создать файл", + "create_transaction": "Создать транзакции на блокчейне Qortal", + "create_thread": "Создать потоку", + "decline": "отклонить", + "decrypt": "дешифровать", + "disable_enter": "Отключить вход", + "download": "скачать", + "download_file": "Загрузить файл", + "edit": "редактировать", + "edit_theme": "Редактировать тему", + "enable_dev_mode": "Включить режим разработки", + "enter_name": "Введите имя", + "export": "экспорт", + "get_qort": "Получить Qort", + "get_qort_trade": "Получить Qort в Q-Trade", + "hide": "скрывать", + "hide_qr_code": "скрыть QR -код", + "import": "импорт", + "import_theme": "Импортная тема", + "invite": "приглашать", + "invite_member": "пригласить нового участника", + "join": "присоединиться", + "leave_comment": "оставить комментарий", + "load_announcements": "загрузить старые объявления", + "login": "авторизоваться", + "logout": "выход", + "new": { + "chat": "новый чат", + "post": "Новый пост", + "theme": "Новая тема", + "thread": "Новая ветка" + }, + "notify": "уведомлять", + "open": "открыть", + "pin": "приколоть", + "pin_app": "приложение приложения", + "pin_from_dashboard": "PIN -штифт от приборной панели", + "post": "почта", + "post_message": "опубликовать сообщение", + "publish": "публиковать", + "publish_app": "Публикуйте свое приложение", + "publish_comment": "Публикуйте комментарий", + "refresh": "обновлять", + "register_name": "зарегистрировать имя", + "remove": "удалять", + "remove_reaction": "удалить реакцию", + "return_apps_dashboard": "Вернуться в приложения для приложений", + "save": "сохранять", + "save_disk": "сохранить на диск", + "search": "поиск", + "search_apps": "Поиск приложений", + "search_groups": "Поиск групп", + "search_chat_text": "Поиск текста чата", + "see_qr_code": "Смотрите QR -код", + "select_app_type": "Выберите тип приложения", + "select_category": "Выберите категорию", + "select_name_app": "Выберите имя/приложение", + "send": "отправлять", + "send_qort": "Отправить Qort", + "set_avatar": "установить аватар", + "show": "показывать", + "show_poll": "Показать опрос", + "start_minting": "Начните добычу", + "start_typing": "Начните печатать здесь ...", + "trade_qort": "Торговый Qort", + "transfer_qort": "Передача qort", + "unpin": "открепить", + "unpin_app": "открепить App", + "unpin_from_dashboard": "открепить с приборной панели", + "update": "обновлять", + "update_app": "Обновите свое приложение", + "vote": "голосование" + }, + "address_your": "Ваш адрес", + "admin": "администратор", + "admin_other": "администраторы", + "all": "все", + "amount": "количество", + "announcement": "объявление", + "announcement_other": "объявления", + "api": "API", + "app": "приложение", + "app_other": "приложения", + "app_name": "Название приложения", + "app_private": "частный", + "app_service_type": "Тип службы приложений", + "apps_dashboard": "приложения панель панели", + "apps_official": "официальные приложения", + "attachment": "вложение", + "balance": "баланс:", + "category": "категория", + "category_other": "категории", + "chat": "чат", + "comment_other": "Комментарии", + "contact_other": "контакты", + "core": { + "block_height": "высота блока", + "information": "Основная информация", + "peers": "Подключенные сверстники", + "version": "Основная версия" + }, + "current_language": "current language: {{ language }}", + "dev": "девчонка", + "dev_mode": "разработчик режим", + "domain": "домен", + "ui": { + "version": "версия пользовательского интерфейса" + }, + "count": { + "none": "никто", + "one": "один" + }, + "description": "описание", + "devmode_apps": "Dev Mode Apps", + "directory": "каталог", + "downloading_qdn": "Загрузка с QDN", + "fee": { + "payment": "плата за оплату", + "publish": "Публикайте плату" + }, + "for": "для", + "general": "общий", + "general_settings": "Общие настройки", + "home": "дом", + "identifier": "идентификатор", + "image_embed": "Изображение встроено", + "last_height": "Последняя высота", + "level": "уровень", + "library": "библиотека", + "list": { + "bans": "Список запретов", + "groups": "Список групп", + "invites": "Список приглашений", + "join_request": "Присоединяйтесь к списку запросов", + "member": "Список участников", + "members": "Список членов" + }, + "loading": { + "announcements": "Загрузка объявлений", + "generic": "загрузка ...", + "chat": "Загрузка чата ... пожалуйста, подождите.", + "comments": "Загрузка комментариев ... пожалуйста, подождите.", + "posts": "Загрузка сообщений ... пожалуйста, подождите." + }, + "member": "член", + "member_other": "члены", + "message_us": "Пожалуйста, напишите нам на NextCloud (не требуется регистрация) или раздора, если вам нужно 4 Qort, чтобы начать чат без каких -либо ограничений", + "message": { + "error": { + "address_not_found": "Ваш адрес не был найден", + "app_need_name": "Ваше приложение нужно имя", + "build_app": "Невозможно создать частное приложение", + "decrypt_app": "Невозможно расшифровать частное приложение '", + "download_image": "Невозможно загрузить изображение. Пожалуйста, попробуйте еще раз, нажав кнопку обновления", + "download_private_app": "Невозможно скачать частное приложение", + "encrypt_app": "Невозможно зашифровать приложение. Приложение не опубликовано '", + "fetch_app": "Невозможно получить приложение", + "fetch_publish": "Невозможно получить опубликовать", + "file_too_large": "file {{ filename }} is too large. Max size allowed is {{ size }} MB.", + "generic": "Произошла ошибка", + "initiate_download": "Не удалось инициировать загрузку", + "invalid_amount": "неверная сумма", + "invalid_base64": "Неверные данные базы64", + "invalid_embed_link": "Недействительная встроенная ссылка", + "invalid_image_embed_link_name": "Неверное изображение встраиваемого ссылки. Отсутствует парам.", + "invalid_poll_embed_link_name": "Неверный опрос встроенный ссылка. Пропавшее имя.", + "invalid_signature": "Неверная подпись", + "invalid_theme_format": "Неверный формат темы", + "invalid_zip": "Неверный молния", + "message_loading": "Ошибка загрузки сообщения.", + "message_size": "your message size is of {{ size }} bytes out of a maximum of {{ maximum }}", + "minting_account_add": "Невозможно добавить аккаунт с майном", + "minting_account_remove": "Невозможно удалить счета -майтинга", + "missing_fields": "missing: {{ fields }}", + "navigation_timeout": "Тайм -аут навигации", + "network_generic": "сетевая ошибка", + "password_not_matching": "Поля пароля не совпадают!", + "password_wrong": "Невозможно аутентифицировать. Неправильный пароль", + "publish_app": "Невозможно опубликовать приложение", + "publish_image": "Невозможно опубликовать изображение", + "rate": "Невозможно оценить", + "rating_option": "Не удается найти вариант оценки", + "save_qdn": "Невозможно сохранить в QDN", + "send_failed": "не удалось отправить", + "update_failed": "Не удалось обновить", + "vote": "Невозможно проголосовать" + }, + "generic": { + "already_voted": "Вы уже проголосовали.", + "avatar_size": "{{ size }} KB max. for GIFS", + "benefits_qort": "Преимущества наличия qort", + "building": "здание", + "building_app": "строительство приложения", + "confirmed": "подтвержденный", + "created_by": "created by {{ owner }}", + "buy_order_request": "the Application
{{hostname}}
is requesting {{count}} buy order", + "buy_order_request_other": "the Application
{{hostname}}
is requesting {{count}} buy orders", + "devmode_local_node": "Пожалуйста, используйте свой локальный узел для режима Dev! Выход и используйте локальный узел.", + "downloading": "загрузка", + "downloading_decrypting_app": "Загрузка и расшифровка частного приложения.", + "edited": "отредактировано", + "editing_message": "Редактирование сообщения", + "encrypted": "зашифровано", + "encrypted_not": "не шифровано", + "fee_qort": "fee: {{ message }} QORT", + "fetching_data": "Извлечение данных приложения", + "foreign_fee": "foreign fee: {{ message }}", + "get_qort_trade_portal": "Получить Qort, используя торговый портал Qortal's Crosschain", + "minimal_qort_balance": "having at least {{ quantity }} QORT in your balance (4 qort balance for chat, 1.25 for name, 0.75 for some transactions)", + "mentioned": "упомянул", + "message_with_image": "У этого сообщения уже есть изображение", + "most_recent_payment": "{{ count }} most recent payment", + "name_available": "{{ name }} is available", + "name_benefits": "Преимущества имени", + "name_checking": "Проверка, если имя уже существует", + "name_preview": "вам нужно имя для использования предварительного просмотра", + "name_publish": "вам нужно имя Qortal для публикации", + "name_rate": "Вам нужно имя, чтобы оценить.", + "name_registration": "your balance is {{ balance }} QORT. A name registration requires a {{ fee }} QORT fee", + "name_unavailable": "{{ name }} is unavailable", + "no_data_image": "Нет данных для изображения", + "no_description": "Нет описания", + "no_messages": "Нет сообщений", + "no_message": "Нет сообщения", + "no_minting_details": "Не могу просматривать детали маттинга на шлюзе", + "no_notifications": "Нет новых уведомлений", + "no_payments": "Нет платежей", + "no_pinned_changes": "В настоящее время у вас нет никаких изменений в ваших приложениях", + "no_results": "Нет результатов", + "one_app_per_name": "ПРИМЕЧАНИЕ. В настоящее время только одно приложение и веб -сайт разрешены для имени.", + "ongoing_transactions": "текущие операции", + "opened": "открыл", + "overwrite_qdn": "перезаписать в QDN", + "password_confirm": "Пожалуйста, подтвердите пароль", + "password_enter": "Пожалуйста, введите пароль", + "payment_request": "the Application
{{hostname}}
is requesting a payment", + "people_reaction": "people who reacted with {{ reaction }}", + "processing_transaction": "Обработка транзакции, подождите ...", + "publish_data": "Опубликовать данные в Qortal: все, от приложений до видео. Полностью децентрализован!", + "publishing": "Публикация ... пожалуйста, подождите.", + "qdn": "Используйте QDN Saving", + "rating": "rating for {{ service }} {{ name }}", + "register_name": "Вам нужно зарегистрированное имя Qortal, чтобы сохранить ваши приложения для QDN.", + "replied_to": "replied to {{ person }}", + "revert_default": "вернуться к дефолту", + "revert_qdn": "вернуться к QDN", + "save_qdn": "сохранить в QDN", + "secure_ownership": "Безопасное право собственности на данные, опубликованные вашим именем. Вы даже можете продать свое имя вместе с вашими данными третьей стороне.", + "select_file": "Пожалуйста, выберите файл", + "select_image": "Пожалуйста, выберите изображение для логотипа", + "select_zip": "Выберите файл .zip, содержащий статический контент:", + "sending": "отправка ...", + "settings": "Вы используете способ сохранения настройки экспорта/импорта.", + "space_for_admins": "Извините, это пространство только для администраторов.", + "unread_messages": "Непрочитанные сообщения ниже", + "unsaved_changes": "У вас есть неспасенные изменения в ваши приложения. Сохраните их в QDN.", + "updating": "обновление", + "wait": "пожалуйста, подождите" + }, + "message": "сообщение", + "promotion_text": "Текст продвижения", + "question": { + "accept_vote_on_poll": "Принимаете ли вы эту транзакцию holed_on_poll? Опросы публики!", + "logout": "Вы уверены, что хотели бы выйти в систему?", + "new_user": "Вы новый пользователь?", + "delete_chat_image": "Хотели бы вы удалить предыдущее изображение чата?", + "perform_transaction": "would you like to perform a {{action}} transaction?", + "provide_thread": "Пожалуйста, предоставьте заголовок ветки", + "publish_app": "Хотели бы вы опубликовать это приложение?", + "publish_avatar": "Хотели бы вы опубликовать аватар?", + "publish_qdn": "Хотели бы вы опубликовать свои настройки в QDN (зашифровано)?", + "overwrite_changes": "Приложение не смогло загрузить ваши существующие приложения, закрепленные QDN. Хотели бы вы перезаписать эти изменения?", + "rate_app": "would you like to rate this app a rating of {{ rate }}?. It will create a POLL tx.", + "register_name": "Хотите зарегистрировать это имя?", + "reset_pinned": "Не нравятся ваши текущие локальные изменения? Хотели бы вы сбросить приложения по умолчанию?", + "reset_qdn": "Не нравятся ваши текущие локальные изменения? Хотели бы вы сбросить в сохраненные приложения QDN?", + "transfer_qort": "would you like to transfer {{ amount }} QORT" + }, + "success": { + "order_submitted": "Ваш заказ на покупку был отправлен", + "published": "успешно опубликовано. Пожалуйста, подождите пару минут, пока сеть прокатит изменения.", + "published_qdn": "успешно опубликовано в QDN", + "rated_app": "успешно оцененный. Пожалуйста, подождите пару минут, пока сеть прокатит изменения.", + "request_read": "Я прочитал этот запрос", + "transfer": "Передача была успешной!", + "voted": "успешно проголосовал. Пожалуйста, подождите пару минут, пока сеть прокатит изменения." + } + }, + "minting": { + "account_details": "детали аккаунта майнинга", + "actions": "действия по майнингу", + "average_blocktime": "среднее время блока Qortal", + "average_blocks_per_day": "среднее количество блоков в день", + "average_created_qorts_per_day": "среднее количество создаваемых QORT в день", + "blockchain_statistics": "статистика блокчейна", + "blocks_next_level": "блоков до следующего уровня", + "current_level": "текущий уровень", + "current_status": "текущий статус", + "current_tier": "текущий уровень", + "current_tier_content": "{{ tier }} (Уровни {{ levels }})", + "details": "детали майнинга", + "next_level": "При майнинге 24/7 вы достигнете {{ level }} уровня за {{ count }} дней", + "rewards_info": "информация о наградах за майнинг", + "reward_per_block": "предполагаемая награда за блок", + "reward_per_day": "предполагаемая награда в день", + "status": { + "minting": "(добыча)", + "not_minting": "(не шахта)", + "no_status": "нет статуса", + "synchronized": "синхронизированный ({{ percent }}%)", + "synchronizing": "синхронизация ({{ percent }}%)..." + }, + "status_title": "Статус майтинга", + "tier_share_per_block": "доля уровня за блок", + "total_minter_in_tier": "всего майнеров на этом уровне" + }, + "name": "имя", + "name_app": "имя/приложение", + "new_post_in": "новые сообщения в {{ title }}", + "none": "никто", + "note": "примечание", + "option": "вариант", + "option_no": "Нет вариантов", + "option_other": "параметры", + "page": { + "last": "последний", + "first": "первый", + "next": "следующий", + "previous": "предыдущий" + }, + "payment_notification": "уведомление о платеже", + "payment": "оплата", + "poll_embed": "Опрос встроен", + "port": "порт", + "price": "цена", + "publish": "публиковать", + "q_apps": { + "about": "об этом Q-App", + "q_mail": "Q-Mail", + "q_manager": "Q-Manager", + "q_sandbox": "Q-SANDBOX", + "q_wallets": "Q-Wallet" + }, + "receiver": "приемник", + "sender": "отправитель", + "server": "сервер", + "service_type": "тип обслуживания", + "settings": "настройки", + "sort": { + "by_member": "членом" + }, + "supply": "поставлять", + "tags": "теги", + "theme": { + "dark": "темный", + "dark_mode": "темный режим", + "default": "тема по умолчанию", + "light": "свет", + "light_mode": "легкий режим", + "manager": "Менеджер темы", + "name": "Название темы" + }, + "thread": "нить", + "thread_other": "нить", + "thread_title": "Название ветки", + "time": { + "day_one": "{{count}} day", + "day_other": "{{count}} days", + "hour_one": "{{count}} hour", + "hour_other": "{{count}} hours", + "minute_one": "{{count}} minute", + "minute_other": "{{count}} minutes", + "time": "время" + }, + "title": "заголовок", + "to": "к", + "tutorial": "Учебник", + "url": "URL", + "user_lookup": "Посмотреть пользователя", + "vote": "голосование", + "vote_other": "{{ count }} votes", + "zip": "молния", + "wallet": { + "litecoin": "кошелек Litecoin", + "qortal": "кошелек Qortal", + "wallet": "кошелек", + "wallet_other": "кошельки" + }, + "website": "веб -сайт", + "welcome": "добро пожаловать" +} diff --git a/src/i18n/locales/ru/group.json b/src/i18n/locales/ru/group.json new file mode 100644 index 0000000..5c8cb2e --- /dev/null +++ b/src/i18n/locales/ru/group.json @@ -0,0 +1,163 @@ +{ + "action": { + "add_promotion": "добавить промо", + "ban": "забанить участника в группе", + "cancel_ban": "отменить бан", + "copy_private_key": "скопировать приватный ключ", + "create_group": "создать группу", + "disable_push_notifications": "отключить все push-уведомления", + "export_password": "экспортировать пароль", + "export_private_key": "экспортировать приватный ключ", + "find_group": "найти группу", + "join_group": "вступить в группу", + "kick_member": "удалить участника из группы", + "invite_member": "пригласить участника", + "leave_group": "выйти из группы", + "load_members": "загрузить участников с именами", + "make_admin": "сделать администратором", + "manage_members": "управлять участниками", + "promote_group": "продвигать группу среди не участников", + "publish_announcement": "опубликовать объявление", + "publish_avatar": "опубликовать аватар", + "refetch_page": "перезагрузить страницу", + "remove_admin": "удалить из администраторов", + "remove_minting_account": "удалить аккаунт майнинга", + "return_to_thread": "вернуться к обсуждениям", + "scroll_bottom": "прокрутить вниз", + "scroll_unread_messages": "перейти к непрочитанным сообщениям", + "select_group": "выбрать группу", + "visit_q_mintership": "посетить Q-Mintership" + }, + "advanced_options": "расширенные настройки", + "block_delay": { + "minimum": "минимальная задержка блока", + "maximum": "максимальная задержка блока" + }, + "group": { + "approval_threshold": "порог одобрения группы", + "avatar": "аватар группы", + "closed": "закрытая (приватная) — требуется разрешение на вступление", + "description": "описание группы", + "id": "ID группы", + "invites": "приглашения в группу", + "group": "группа", + "group_name": "группа: {{ name }}", + "group_other": "группы", + "groups_admin": "группы, где вы администратор", + "management": "управление группой", + "member_number": "количество участников", + "messaging": "сообщения", + "name": "название группы", + "open": "открытая (публичная)", + "private": "приватная группа", + "promotions": "промоакции группы", + "public": "публичная группа", + "type": "тип группы" + }, + "invitation_expiry": "срок действия приглашения", + "invitees_list": "список приглашённых", + "join_link": "ссылка для вступления в группу", + "join_requests": "запросы на вступление", + "last_message": "последнее сообщение", + "last_message_date": "последнее сообщение: {{date }}", + "latest_mails": "последние Q-сообщения", + "message": { + "generic": { + "avatar_publish_fee": "публикация аватара требует {{ fee }}", + "avatar_registered_name": "для установки аватара требуется зарегистрированное имя", + "admin_only": "будут показаны только группы, где вы админ", + "already_in_group": "вы уже состоите в этой группе!", + "block_delay_minimum": "минимальная задержка блока для одобрения транзакций", + "block_delay_maximum": "максимальная задержка блока для одобрения транзакций", + "closed_group": "эта группа закрыта, дождитесь одобрения администратором", + "descrypt_wallet": "дешифровка кошелька...", + "encryption_key": "создается общий ключ шифрования. Подождите несколько минут...", + "group_announcement": "объявления группы", + "group_approval_threshold": "порог одобрения группы (кол-во/процент админов, необходимых для одобрения транзакции)", + "group_encrypted": "группа зашифрована", + "group_invited_you": "{{group}} пригласила вас", + "group_key_created": "первичный ключ группы создан", + "group_member_list_changed": "список участников изменился. Перешифруйте секретный ключ.", + "group_no_secret_key": "секретного ключа группы нет. Станьте первым админом, кто его опубликует!", + "group_secret_key_no_owner": "последний ключ опубликован не владельцем. Перешифруйте как владелец.", + "invalid_content": "некорректный контент, отправитель или временная метка", + "invalid_data": "ошибка загрузки данных: некорректные данные", + "latest_promotion": "отображается только последняя промоакция недели", + "loading_members": "загрузка списка участников... пожалуйста, подождите.", + "max_chars": "максимум 200 символов. Плата за публикацию", + "manage_minting": "управление майнингом", + "minter_group": "вы не состоите в группе MINTER", + "mintership_app": "перейдите в приложение Q-Mintership, чтобы подать заявку на майнинг", + "minting_account": "аккаунт майнинга:", + "minting_keys_per_node": "максимум 2 ключа майнинга на узел. Удалите один, чтобы продолжить.", + "minting_keys_per_node_different": "максимум 2 ключа майнинга на узел. Удалите ключ для добавления другого.", + "node_minting_account": "аккаунты майнинга узла", + "node_minting_key": "этот узел уже содержит ключ майнинга для этой учетной записи", + "no_announcement": "нет объявлений", + "no_display": "нечего отображать", + "no_selection": "группа не выбрана", + "not_part_group": "вы не состоите в зашифрованной группе. Подождите, пока админ обновит ключи.", + "only_encrypted": "будут показаны только незашифрованные сообщения", + "only_private_groups": "будут показаны только приватные группы", + "pending_join_requests": "у группы {{ group }} {{ count }} ожидающих запросов", + "private_key_copied": "приватный ключ скопирован", + "provide_message": "введите первое сообщение в тему", + "secure_place": "храните приватный ключ в надежном месте. Не делитесь им!", + "setting_group": "настройка группы... пожалуйста, подождите." + }, + "error": { + "access_name": "нельзя отправить сообщение без доступа к вашему имени", + "descrypt_wallet": "ошибка дешифровки кошелька: {{ message }}", + "description_required": "укажите описание", + "group_info": "не удалось получить информацию о группе", + "group_join": "не удалось вступить в группу", + "group_promotion": "ошибка публикации промо. Попробуйте снова", + "group_secret_key": "не удалось получить секретный ключ группы", + "name_required": "укажите имя", + "notify_admins": "попробуйте уведомить администратора из списка ниже:", + "qortals_required": "требуется минимум {{ quantity }} QORT для отправки сообщения", + "timeout_reward": "превышено время ожидания подтверждения распределения награды", + "thread_id": "не удалось определить ID темы", + "unable_determine_group_private": "не удалось определить, приватная ли группа", + "unable_minting": "не удалось начать майнинг" + }, + "success": { + "group_ban": "участник успешно забанен. Обновление может занять несколько минут", + "group_creation": "группа успешно создана. Обновление может занять несколько минут", + "group_creation_name": "группа {{group_name}} создана: ожидает подтверждения", + "group_creation_label": "группа {{name}} создана: успешно!", + "group_invite": "приглашение для {{invitee}} успешно отправлено. Изменения вступят в силу через несколько минут", + "group_join": "запрос на вступление успешно отправлен. Обновление может занять несколько минут", + "group_join_name": "вы присоединились к группе {{group_name}}: ожидается подтверждение", + "group_join_label": "вы присоединились к группе {{name}}: успешно!", + "group_join_request": "запрос на вступление в группу {{group_name}}: ожидается подтверждение", + "group_join_outcome": "запрос на вступление в группу {{group_name}}: успешно!", + "group_kick": "участник успешно удалён. Обновление может занять несколько минут", + "group_leave": "запрос на выход из группы отправлен. Обновление может занять несколько минут", + "group_leave_name": "вышли из группы {{group_name}}: ожидается подтверждение", + "group_leave_label": "вышли из группы {{name}}: успешно!", + "group_member_admin": "участник назначен администратором. Обновление может занять несколько минут", + "group_promotion": "промоакция успешно опубликована. Может занять немного времени для отображения", + "group_remove_member": "администраторские права успешно удалены. Обновление может занять несколько минут", + "invitation_cancellation": "приглашение успешно отменено. Обновление может занять несколько минут", + "invitation_request": "запрос на вступление принят: ожидается подтверждение", + "loading_threads": "загрузка тем... подождите.", + "post_creation": "публикация успешно создана. Может потребоваться время для отображения", + "published_secret_key": "секретный ключ группы {{ group_id }} опубликован: ожидается подтверждение", + "published_secret_key_label": "секретный ключ группы {{ group_id }} опубликован: успешно!", + "registered_name": "имя успешно зарегистрировано. Обновление может занять несколько минут", + "registered_name_label": "имя зарегистрировано: ожидается подтверждение", + "registered_name_success": "имя зарегистрировано: успешно!", + "rewardshare_add": "добавление распределения награды: ожидается подтверждение", + "rewardshare_add_label": "распределение награды добавлено: успешно!", + "rewardshare_creation": "создание распределения награды в блокчейне. Подтверждение может занять до 90 секунд", + "rewardshare_confirmed": "распределение награды подтверждено. Нажмите «Далее».", + "rewardshare_remove": "удаление распределения награды: ожидается подтверждение", + "rewardshare_remove_label": "распределение награды удалено: успешно!", + "thread_creation": "тема успешно создана. Публикация может занять время", + "unbanned_user": "пользователь успешно разбанен. Обновление может занять несколько минут", + "user_joined": "пользователь успешно присоединился!" + } + }, + "thread_posts": "новые сообщения темы" +} diff --git a/src/i18n/locales/ru/question.json b/src/i18n/locales/ru/question.json new file mode 100644 index 0000000..fee7ecd --- /dev/null +++ b/src/i18n/locales/ru/question.json @@ -0,0 +1,194 @@ +{ + "accept_app_fee": "принять комиссию приложения", + "always_authenticate": "всегда аутентифицировать автоматически", + "always_chat_messages": "всегда разрешать сообщения чата от этого приложения", + "always_retrieve_balance": "всегда автоматически получать баланс", + "always_retrieve_list": "всегда автоматически получать списки", + "always_retrieve_wallet": "всегда автоматически получать кошелек", + "always_retrieve_wallet_transactions": "всегда автоматически получать транзакции кошелька", + "amount_qty": "сумма: {{ quantity }}", + "asset_name": "актив: {{ asset }}", + "assets_used_pay": "используемый актив для оплаты: {{ asset }}", + "coin": "монета: {{ coin }}", + "description": "описание: {{ description }}", + "deploy_at": "Вы хотите развернуть этот AT?", + "download_file": "Вы хотите загрузить:", + "message": { + "error": { + "add_to_list": "не удалось добавить в список", + "at_info": "не удалось найти информацию об AT.", + "buy_order": "не удалось отправить ордер на покупку", + "cancel_sell_order": "не удалось отменить ордер на продажу. Повторите попытку!", + "copy_clipboard": "не удалось скопировать в буфер обмена", + "create_sell_order": "не удалось создать ордер на продажу. Повторите попытку!", + "create_tradebot": "не удалось создать торгового бота", + "decode_transaction": "не удалось декодировать транзакцию", + "decrypt": "не удалось расшифровать", + "decrypt_message": "не удалось расшифровать сообщение. Убедитесь, что данные и ключи верны", + "decryption_failed": "ошибка расшифровки", + "empty_receiver": "поле получателя не может быть пустым!", + "encrypt": "не удалось зашифровать", + "encryption_failed": "ошибка шифрования", + "encryption_requires_public_key": "для шифрования данных требуется открытый ключ", + "fetch_balance_token": "не удалось получить баланс {{ token }}. Повторите попытку!", + "fetch_balance": "не удалось получить баланс", + "fetch_connection_history": "не удалось получить историю подключений к серверу", + "fetch_generic": "не удалось получить данные", + "fetch_group": "не удалось получить группу", + "fetch_list": "не удалось получить список", + "fetch_poll": "не удалось получить опрос", + "fetch_recipient_public_key": "не удалось получить открытый ключ получателя", + "fetch_wallet_info": "не удалось получить информацию о кошельке", + "fetch_wallet_transactions": "не удалось получить транзакции кошелька", + "fetch_wallet": "не удалось получить кошелек. Повторите попытку", + "file_extension": "не удалось определить расширение файла", + "gateway_balance_local_node": "нельзя просмотреть баланс {{ token }} через шлюз. Используйте локальный узел.", + "gateway_non_qort_local_node": "нельзя отправить не-QORT монету через шлюз. Используйте локальный узел.", + "gateway_retrieve_balance": "получение баланса {{ token }} через шлюз запрещено", + "gateway_wallet_local_node": "нельзя просмотреть кошелек {{ token }} через шлюз. Используйте локальный узел.", + "get_foreign_fee": "ошибка при получении внешней комиссии", + "insufficient_balance_qort": "недостаточно QORT на балансе", + "insufficient_balance": "недостаточно средств на счете", + "insufficient_funds": "недостаточно средств", + "invalid_encryption_iv": "недопустимый IV: AES-GCM требует IV длиной 12 байт", + "invalid_encryption_key": "недопустимый ключ: AES-GCM требует ключ длиной 256 бит", + "invalid_fullcontent": "поле fullContent имеет неверный формат. Используйте строку, base64 или объект", + "invalid_receiver": "некорректный адрес получателя или имя", + "invalid_type": "недопустимый тип", + "mime_type": "не удалось определить MIME-тип", + "missing_fields": "отсутствуют поля: {{ fields }}", + "name_already_for_sale": "это имя уже выставлено на продажу", + "name_not_for_sale": "это имя не выставлено на продажу", + "no_api_found": "не найдено подходящего API", + "no_data_encrypted_resource": "в зашифрованном ресурсе отсутствуют данные", + "no_data_file_submitted": "данные или файл не были отправлены", + "no_group_found": "группа не найдена", + "no_group_key": "не найден ключ группы", + "no_poll": "опрос не найден", + "no_resources_publish": "нет ресурсов для публикации", + "node_info": "не удалось получить информацию об узле", + "node_status": "не удалось получить статус узла", + "only_encrypted_data": "только зашифрованные данные могут использоваться в частных сервисах", + "perform_request": "не удалось выполнить запрос", + "poll_create": "не удалось создать опрос", + "poll_vote": "не удалось проголосовать в опросе", + "process_transaction": "не удалось обработать транзакцию", + "provide_key_shared_link": "для зашифрованного ресурса необходимо указать ключ для создания общей ссылки", + "registered_name": "для публикации необходимо зарегистрированное имя", + "resources_publish": "некоторые ресурсы не удалось опубликовать", + "retrieve_file": "не удалось получить файл", + "retrieve_keys": "не удалось получить ключи", + "retrieve_summary": "не удалось получить сводку", + "retrieve_sync_status": "ошибка при получении статуса синхронизации {{ token }}", + "same_foreign_blockchain": "все запрашиваемые AT должны быть из одной внешней блокчейн-сети.", + "send": "не удалось отправить", + "server_current_add": "не удалось добавить текущий сервер", + "server_current_set": "не удалось установить текущий сервер", + "server_info": "ошибка при получении информации о сервере", + "server_remove": "не удалось удалить сервер", + "submit_sell_order": "не удалось отправить ордер на продажу", + "synchronization_attempts": "не удалось синхронизироваться после {{ count }} попыток", + "timeout_request": "время ожидания запроса истекло", + "token_not_supported": "{{ token }} не поддерживается этим вызовом", + "transaction_activity_summary": "ошибка при получении сводки транзакционной активности", + "unknown_error": "неизвестная ошибка", + "unknown_admin_action_type": "неизвестный тип действия администратора: {{ type }}", + "update_foreign_fee": "не удалось обновить внешнюю комиссию", + "update_tradebot": "не удалось обновить торгового бота", + "upload_encryption": "загрузка не удалась из-за ошибки шифрования", + "upload": "загрузка не удалась", + "use_private_service": "для зашифрованной публикации используйте сервис, оканчивающийся на _PRIVATE", + "user_qortal_name": "у пользователя нет имени Qortal", + "max_size_publish": "максимально допустимый размер файла: {{size}} ГБ.", + "max_size_publish_public": "максимальный размер файла на публичном узле — {{size}} МБ. Используйте локальный узел для больших файлов." + }, + "generic": { + "calculate_fee": "*Комиссия {{ amount }} сат составляет примерно {{ rate }} сат/КБ для транзакции размером около 300 байт.", + "confirm_join_group": "подтвердите вступление в группу:", + "include_data_decrypt": "пожалуйста, добавьте данные для расшифровки", + "include_data_encrypt": "пожалуйста, добавьте данные для шифрования", + "max_retry_transaction": "достигнуто максимальное количество попыток. Транзакция пропущена.", + "no_action_public_node": "это действие невозможно через публичный узел", + "private_service": "пожалуйста, используйте приватный сервис", + "provide_group_id": "пожалуйста, укажите groupId", + "read_transaction_carefully": "внимательно прочитайте транзакцию перед подтверждением!", + "user_declined_add_list": "пользователь отклонил добавление в список", + "user_declined_delete_from_list": "пользователь отклонил удаление из списка", + "user_declined_delete_hosted_resources": "пользователь отклонил удаление размещённых ресурсов", + "user_declined_join": "пользователь отклонил присоединение к группе", + "user_declined_list": "пользователь отклонил получение списка размещённых ресурсов", + "user_declined_request": "пользователь отклонил запрос", + "user_declined_save_file": "пользователь отклонил сохранение файла", + "user_declined_send_message": "пользователь отклонил отправку сообщения", + "user_declined_share_list": "пользователь отклонил совместное использование списка" + } + }, + "name": "имя: {{ name }}", + "option": "опция: {{ option }}", + "options": "опции: {{ optionList }}", + "permission": { + "access_list": "Разрешить этому приложению доступ к списку?", + "add_admin": "Разрешить этому приложению назначить пользователя {{ invitee }} администратором?", + "all_item_list": "Разрешить этому приложению добавить следующее в список {{ name }}:", + "authenticate": "Разрешить этому приложению выполнить аутентификацию?", + "ban": "Разрешить этому приложению забанить {{ partecipant }} в группе?", + "buy_name_detail": "покупка {{ name }} за {{ price }} QORT", + "buy_name": "Разрешить этому приложению купить имя?", + "buy_order_fee_estimation_one": "Комиссия рассчитывается исходя из {{ count }} ордера, размером 300 байт при ставке {{ fee }} {{ ticker }} за KB.", + "buy_order_fee_estimation_other": "Комиссия рассчитывается исходя из {{ count }} ордеров, размером 300 байт при ставке {{ fee }} {{ ticker }} за KB.", + "buy_order_per_kb": "{{ fee }} {{ ticker }} за KB", + "buy_order_quantity_one": "{{ count }} ордер на покупку", + "buy_order_quantity_other": "{{ count }} ордеров на покупку", + "buy_order_ticker": "{{ qort_amount }} QORT за {{ foreign_amount }} {{ ticker }}", + "buy_order": "Разрешить этому приложению выполнить ордер на покупку?", + "cancel_ban": "Разрешить этому приложению снять бан с пользователя {{ partecipant }} в группе?", + "cancel_group_invite": "Разрешить этому приложению отменить приглашение в группу для {{ invitee }}?", + "cancel_sell_order": "Разрешить этому приложению отменить ордер на продажу?", + "create_group": "Разрешить этому приложению создать группу?", + "delete_hosts_resources": "Разрешить этому приложению удалить {{ size }} размещённых ресурсов?", + "fetch_balance": "Разрешить этому приложению получить баланс {{ coin }}?", + "get_wallet_info": "Разрешить этому приложению получить информацию о кошельке?", + "get_wallet_transactions": "Разрешить этому приложению получить транзакции кошелька?", + "invite": "Разрешить этому приложению пригласить {{ invitee }}?", + "kick": "Разрешить этому приложению исключить {{ partecipant }} из группы?", + "leave_group": "Разрешить этому приложению выйти из следующей группы?", + "list_hosted_data": "Разрешить этому приложению получить список ваших размещённых данных?", + "order_detail": "{{ qort_amount }} QORT за {{ foreign_amount }} {{ ticker }}", + "pay_publish": "Разрешить этому приложению произвести следующие платежи и публикации?", + "perform_admin_action_with_value": "со значением: {{ value }}", + "perform_admin_action": "Разрешить этому приложению выполнить административное действие: {{ type }}?", + "publish_qdn": "Разрешить этому приложению публиковать в QDN?", + "register_name": "Разрешить этому приложению зарегистрировать это имя?", + "remove_admin": "Разрешить этому приложению удалить пользователя {{ partecipant }} из администраторов?", + "remove_from_list": "Разрешить этому приложению удалить следующее из списка {{ name }}:", + "sell_name_cancel": "Разрешить этому приложению отменить продажу имени?", + "sell_name_transaction_detail": "продажа {{ name }} за {{ price }} QORT", + "sell_name_transaction": "Разрешить этому приложению создать транзакцию продажи имени?", + "sell_order": "Разрешить этому приложению выполнить ордер на продажу?", + "send_chat_message": "Разрешить этому приложению отправить это сообщение в чат?", + "send_coins": "Разрешить этому приложению отправить монеты?", + "server_add": "Разрешить этому приложению добавить сервер?", + "server_remove": "Разрешить этому приложению удалить сервер?", + "set_current_server": "Разрешить этому приложению установить текущий сервер?", + "sign_fee": "Разрешить этому приложению подписать комиссии для всех ваших предложений по сделкам?", + "sign_process_transaction": "Разрешить этому приложению подписать и обработать транзакцию?", + "sign_transaction": "Разрешить этому приложению подписать транзакцию?", + "transfer_asset": "Разрешить этому приложению перевести следующий актив?", + "update_foreign_fee": "Разрешить этому приложению обновить комиссии внешних валют на вашем узле?", + "update_group_detail": "новый владелец: {{ owner }}", + "update_group": "Разрешить этому приложению обновить эту группу?" + }, + "poll": "опрос: {{ name }}", + "provide_recipient_group_id": "пожалуйста, укажите получателя или groupId", + "request_create_poll": "Вы запрашиваете создание следующего опроса:", + "request_vote_poll": "Вам предлагается проголосовать в следующем опросе:", + "sats_per_kb": "{{ amount }} сатоши за KB", + "sats": "{{ amount }} сатоши", + "server_host": "хост: {{ host }}", + "server_type": "тип: {{ type }}", + "to_group": "в: группа {{ group_id }}", + "to_recipient": "кому: {{ recipient }}", + "total_locking_fee": "общая комиссия за блокировку:", + "total_unlocking_fee": "общая комиссия за разблокировку:", + "value": "значение: {{ value }}" +} diff --git a/src/i18n/locales/ru/tutorial.json b/src/i18n/locales/ru/tutorial.json new file mode 100644 index 0000000..7602642 --- /dev/null +++ b/src/i18n/locales/ru/tutorial.json @@ -0,0 +1,21 @@ +{ + "1_getting_started": "1. Начало работы", + "2_overview": "2. Обзор", + "3_groups": "3. Группы Qortal", + "4_obtain_qort": "4. Получение QORT", + "account_creation": "создание аккаунта", + "important_info": "важная информация", + "apps": { + "dashboard": "1. Панель приложений", + "navigation": "2. Навигация по приложениям" + }, + "initial": { + "recommended_qort_qty": "имейте не менее {{ quantity }} QORT на вашем кошельке", + "explore": "исследовать", + "general_chat": "общий чат", + "getting_started": "начало работы", + "register_name": "зарегистрировать имя", + "see_apps": "посмотреть приложения", + "trade_qort": "обмен QORT" + } +} diff --git a/src/i18n/locales/zh/auth.json b/src/i18n/locales/zh/auth.json new file mode 100644 index 0000000..1c21f88 --- /dev/null +++ b/src/i18n/locales/zh/auth.json @@ -0,0 +1,138 @@ +{ + "account": { + "your": "你的账户", + "account_many": "账户", + "account_one": "账户", + "selected": "已选择的账户" + }, + "action": { + "add": { + "account": "添加账户", + "seed_phrase": "添加助记词" + }, + "authenticate": "认证", + "block": "屏蔽", + "block_all": "全部屏蔽", + "block_data": "屏蔽 QDN 数据", + "block_name": "屏蔽名称", + "block_txs": "屏蔽交易", + "fetch_names": "获取名称", + "copy_address": "复制地址", + "create_account": "创建账户", + "create_qortal_account": "点击下方的 下一步 创建你的 Qortal 账户。", + "choose_password": "选择新密码", + "download_account": "下载账户", + "enter_amount": "请输入大于 0 的金额", + "enter_recipient": "请输入接收者", + "enter_wallet_password": "请输入你的钱包密码", + "export_seedphrase": "导出助记词", + "insert_name_address": "请输入名称或地址", + "publish_admin_secret_key": "发布管理员密钥", + "publish_group_secret_key": "发布群组密钥", + "reencrypt_key": "重新加密密钥", + "return_to_list": "返回列表", + "setup_qortal_account": "设置你的 Qortal 账户", + "unblock": "取消屏蔽", + "unblock_name": "取消名称屏蔽" + }, + "address": "地址", + "address_name": "地址或名称", + "advanced_users": "高级用户专用", + "apikey": { + "alternative": "备选方式:选择文件", + "change": "更改 API 密钥", + "enter": "输入 API 密钥", + "import": "导入 API 密钥", + "key": "API 密钥", + "select_valid": "请选择一个有效的 API 密钥" + }, + "authentication": "身份验证", + "blocked_users": "已屏蔽用户", + "build_version": "构建版本", + "message": { + "error": { + "account_creation": "无法创建账户。", + "address_not_existing": "区块链中不存在该地址", + "block_user": "无法屏蔽用户", + "create_simmetric_key": "无法创建对称密钥", + "decrypt_data": "无法解密数据", + "decrypt": "解密失败", + "encrypt_content": "无法加密内容", + "fetch_user_account": "无法获取用户账户", + "field_not_found_json": "在 JSON 中未找到 {{ field }}", + "find_secret_key": "找不到正确的密钥", + "incorrect_password": "密码错误", + "invalid_qortal_link": "无效的 Qortal 链接", + "invalid_secret_key": "密钥无效", + "invalid_uint8": "提供的 Uint8ArrayData 无效", + "name_not_existing": "名称不存在", + "name_not_registered": "名称未注册", + "read_blob_base64": "无法将 Blob 读取为 base64 编码字符串", + "reencrypt_secret_key": "无法重新加密密钥", + "set_apikey": "设置 API 密钥失败:" + }, + "generic": { + "blocked_addresses": "被屏蔽的地址 - 阻止交易处理", + "blocked_names": "QDN 屏蔽名称", + "blocking": "正在屏蔽 {{ name }}", + "choose_block": "选择“屏蔽交易”或“全部”来屏蔽聊天消息", + "congrats_setup": "恭喜,你已完成设置!", + "decide_block": "请选择要屏蔽的内容", + "downloading_encryption_keys": "正在下载加密密钥", + "fetching_admin_secret_key": "正在获取管理员密钥", + "fetching_group_secret_key": "正在获取群组密钥发布", + "keep_secure": "请妥善保管你的账户文件", + "last_encryption_date": "最后加密时间:{{ date }},由 {{ name }} 完成", + "locating_encryption_keys": "正在定位加密密钥", + "name_address": "名称或地址", + "no_account": "没有保存的账户", + "no_minimum_length": "没有最小长度要求", + "no_secret_key_published": "尚未发布密钥", + "publishing_key": "提醒:密钥发布后需要几分钟才能显示,请耐心等待。", + "seedphrase_notice": "已在后台随机生成 助记词。", + "turn_local_node": "请启动你的本地节点", + "type_seed": "输入或粘贴你的助记词", + "your_accounts": "你保存的账户" + }, + "success": { + "reencrypted_secret_key": "密钥重新加密成功。更改可能需要几分钟传播,请 5 分钟后刷新群组。" + } + }, + "node": { + "choose": "选择自定义节点", + "custom_many": "自定义节点", + "use_custom": "使用自定义节点", + "use_local": "使用本地节点", + "using": "使用的节点", + "using_public": "使用公共节点", + "using_public_gateway": "使用公共节点:{{ gateway }}" + }, + "note": "备注", + "password": "密码", + "password_confirmation": "确认密码", + "seed_phrase": "助记词", + "seed_your": "你的助记词", + "tips": { + "additional_wallet": "使用此选项连接你之前创建的其他 Qortal 钱包,以便之后登录。你需要备份的 JSON 文件。", + "digital_id": "你的钱包是你在 Qortal 上的数字身份,用于登录用户界面。它包含你的公开地址和最终选择的 Qortal 名称。所有交易都与该身份相关,你可以在这里管理 QORT 和其他加密资产。", + "existing_account": "已有 Qortal 账户?请输入你的备份助记词以访问。这是恢复账户的方式之一。", + "key_encrypt_admin": "该密钥用于加密管理员相关内容。只有管理员才能查看。", + "key_encrypt_group": "该密钥用于加密群组内容。目前这是唯一在此界面中使用的密钥。所有群组成员都可以查看加密内容。", + "new_account": "创建账户即创建新的钱包和数字身份,从而开始使用 Qortal。一旦完成,你就可以获取 QORT、购买名称和头像、发布视频和博客等。", + "new_users": "新用户请从这里开始!", + "safe_place": "请将你的账户保存在你记得住的安全地方!", + "view_seedphrase": "如需查看助记词,请点击本段文字中的“助记词”一词。助记词用于生成你的私钥,默认情况下为安全起见不显示。", + "wallet_secure": "请妥善保管你的钱包文件。" + }, + "wallet": { + "password_confirmation": "确认钱包密码", + "password": "钱包密码", + "keep_password": "保持当前密码", + "new_password": "新密码", + "error": { + "missing_new_password": "请输入新密码", + "missing_password": "请输入密码" + } + }, + "welcome": "欢迎来到" +} diff --git a/src/i18n/locales/zh/core.json b/src/i18n/locales/zh/core.json new file mode 100644 index 0000000..7f80d55 --- /dev/null +++ b/src/i18n/locales/zh/core.json @@ -0,0 +1,419 @@ +{ + "action": { + "accept": "接受", + "access": "使用权", + "access_app": "访问应用程序", + "add": "添加", + "add_custom_framework": "添加自定义框架", + "add_reaction": "添加反应", + "add_theme": "添加主题", + "backup_account": "备份帐户", + "backup_wallet": "备用钱包", + "cancel": "取消", + "cancel_invitation": "取消邀请", + "change": "改变", + "change_avatar": "更改头像", + "change_file": "更改文件", + "change_language": "更改语言", + "choose": "选择", + "choose_file": "选择文件", + "choose_image": "选择图像", + "choose_logo": "选择一个徽标", + "choose_name": "选择一个名称", + "close": "关闭", + "close_chat": "直接聊天", + "continue": "继续", + "continue_logout": "继续注销", + "copy_link": "复制链接", + "create_apps": "创建应用程序", + "create_file": "创建文件", + "create_transaction": "在Qortal区块链上创建交易", + "create_thread": "创建线程", + "decline": "衰退", + "decrypt": "解密", + "disable_enter": "禁用输入", + "download": "下载", + "download_file": "下载文件", + "edit": "编辑", + "edit_theme": "编辑主题", + "enable_dev_mode": "启用开发模式", + "enter_name": "输入名称", + "export": "出口", + "get_qort": "获取Qort", + "get_qort_trade": "在Q-trade获取Qort", + "hide": "隐藏", + "hide_qr_code": "隐藏QR码", + "import": "进口", + "import_theme": "导入主题", + "invite": "邀请", + "invite_member": "邀请新成员", + "join": "加入", + "leave_comment": "留下评论", + "load_announcements": "加载较旧的公告", + "login": "登录", + "logout": "注销", + "new": { + "chat": "新聊天", + "post": "新帖子", + "theme": "新主题", + "thread": "新线程" + }, + "notify": "通知", + "open": "打开", + "pin": "别针", + "pin_app": "引脚应用程序", + "pin_from_dashboard": "仪表板上的销钉", + "post": "邮政", + "post_message": "发布消息", + "publish": "发布", + "publish_app": "发布您的应用", + "publish_comment": "发布评论", + "refresh": "刷新", + "register_name": "登记名称", + "remove": "消除", + "remove_reaction": "删除反应", + "return_apps_dashboard": "返回应用程序仪表板", + "save": "节省", + "save_disk": "保存到磁盘", + "search": "搜索", + "search_apps": "搜索应用程序", + "search_groups": "搜索组", + "search_chat_text": "搜索聊天文字", + "see_qr_code": "请参阅QR码", + "select_app_type": "选择应用程序类型", + "select_category": "选择类别", + "select_name_app": "选择名称/应用", + "send": "发送", + "send_qort": "发送Qort", + "set_avatar": "设置化身", + "show": "展示", + "show_poll": "显示民意调查", + "start_minting": "开始铸造", + "start_typing": "开始在这里输入...", + "trade_qort": "贸易Qort", + "transfer_qort": "转移Qort", + "unpin": "Uncin", + "unpin_app": "Unpin App", + "unpin_from_dashboard": "从仪表板上锁定", + "update": "更新", + "update_app": "更新您的应用程序", + "vote": "投票" + }, + "address_your": "您的地址", + "admin": "行政", + "admin_other": "管理员", + "all": "全部", + "amount": "数量", + "announcement": "公告", + "announcement_other": "公告", + "api": "API", + "app": "应用程序", + "app_other": "应用", + "app_name": "应用名称", + "app_private": "私人的", + "app_service_type": "应用服务类型", + "apps_dashboard": "应用仪表板", + "apps_official": "官方应用程序", + "attachment": "依恋", + "balance": "平衡:", + "category": "类别", + "category_other": "类别", + "chat": "聊天", + "comment_other": "评论", + "contact_other": "联系人", + "core": { + "block_height": "块高度", + "information": "核心信息", + "peers": "连接的同行", + "version": "核心版本" + }, + "current_language": "current language: {{ language }}", + "dev": "开发", + "dev_mode": "开发模式", + "domain": "领域", + "ui": { + "version": "UI版本" + }, + "count": { + "none": "没有任何", + "one": "一" + }, + "description": "描述", + "devmode_apps": "开发模式应用程序", + "directory": "目录", + "downloading_qdn": "从QDN下载", + "fee": { + "payment": "付款费", + "publish": "发布费" + }, + "for": "为了", + "general": "一般的", + "general_settings": "一般设置", + "home": "家", + "identifier": "标识符", + "image_embed": "嵌入图像", + "last_height": "最后的高度", + "level": "等级", + "library": "图书馆", + "list": { + "bans": "禁令名单", + "groups": "组列表", + "invites": "邀请列表", + "join_request": "加入请求列表", + "member": "成员列表", + "members": "成员列表" + }, + "loading": { + "announcements": "加载公告", + "generic": "加载中...", + "chat": "加载聊天...请等待。", + "comments": "加载评论...请等待。", + "posts": "加载帖子...请等待。" + }, + "member": "成员", + "member_other": "成员", + "message_us": "如果您需要4个Qort开始聊天而无需任何限制,请在NextCloud(无需注册)或不符合", + "message": { + "error": { + "address_not_found": "找不到您的地址", + "app_need_name": "您的应用需要一个名称", + "build_app": "无法构建私人应用", + "decrypt_app": "无法解密私人应用程序'", + "download_image": "无法下载图像。请单击“刷新”按钮,请稍后再试", + "download_private_app": "无法下载私人应用", + "encrypt_app": "无法加密应用程序。应用未发布'", + "fetch_app": "无法获取应用", + "fetch_publish": "无法获取发布", + "file_too_large": "file {{ filename }} is too large. Max size allowed is {{ size }} MB.", + "generic": "发生错误", + "initiate_download": "无法启动下载", + "invalid_amount": "无效的金额", + "invalid_base64": "无效的base64数据", + "invalid_embed_link": "无效的嵌入链接", + "invalid_image_embed_link_name": "无效的图像嵌入链接。缺少参数。", + "invalid_poll_embed_link_name": "无效的民意测验嵌入链接。缺少名称。", + "invalid_signature": "无效的签名", + "invalid_theme_format": "无效的主题格式", + "invalid_zip": "无效拉链", + "message_loading": "错误加载消息。", + "message_size": "your message size is of {{ size }} bytes out of a maximum of {{ maximum }}", + "minting_account_add": "无法添加薄荷帐户", + "minting_account_remove": "无法删除铸造帐户", + "missing_fields": "missing: {{ fields }}", + "navigation_timeout": "导航超时", + "network_generic": "网络错误", + "password_not_matching": "密码字段不匹配!", + "password_wrong": "无法验证。错误的密码", + "publish_app": "无法发布应用", + "publish_image": "无法发布图像", + "rate": "无法评价", + "rating_option": "找不到评分选项", + "save_qdn": "无法保存到QDN", + "send_failed": "未能发送", + "update_failed": "无法更新", + "vote": "无法投票" + }, + "generic": { + "already_voted": "您已经投票了。", + "avatar_size": "{{ size }} KB max. for GIFS", + "benefits_qort": "Qort的好处", + "building": "建筑", + "building_app": "建筑应用", + "confirmed": "已确认", + "created_by": "创建人 {{ owner }}", + "buy_order_request": "应用程序
{{hostname}}
正在请求{{count}}购买订单", + "buy_order_request_other": "应用程序
{{hostname}}
正在请求{{count}}购买订单", + "devmode_local_node": "请使用您的本地节点进行开发模式!注销并使用本地节点。", + "downloading": "下载", + "downloading_decrypting_app": "下载和解密私人应用程序。", + "edited": "编辑", + "editing_message": "编辑消息", + "encrypted": "加密", + "encrypted_not": "没有加密", + "fee_qort": "fee: {{ message }} QORT", + "fetching_data": "获取应用程序数据", + "foreign_fee": "foreign fee: {{ message }}", + "get_qort_trade_portal": "使用Qortal的交叉链贸易门户网站获取Qort", + "minimal_qort_balance": "having at least {{ quantity }} QORT in your balance (4 qort balance for chat, 1.25 for name, 0.75 for some transactions)", + "mentioned": "提及", + "message_with_image": "此消息已经有一个图像", + "most_recent_payment": "{{ count }} most recent payment", + "name_available": "{{ name }} is available", + "name_benefits": "名称的好处", + "name_checking": "检查名称是否已经存在", + "name_preview": "您需要一个使用预览的名称", + "name_publish": "您需要一个Qortal名称才能发布", + "name_rate": "您需要一个名称来评估。", + "name_registration": "your balance is {{ balance }} QORT. A name registration requires a {{ fee }} QORT fee", + "name_unavailable": "{{ name }} is unavailable", + "no_data_image": "没有图像数据", + "no_description": "没有描述", + "no_messages": "没有消息", + "no_message": "没有消息", + "no_minting_details": "无法在网关上查看薄荷细节", + "no_notifications": "没有新的通知", + "no_payments": "无付款", + "no_pinned_changes": "您目前对固定应用程序没有任何更改", + "no_results": "没有结果", + "one_app_per_name": "注意:目前,每个名称只允许一个应用程序和网站。", + "ongoing_transactions": "正在进行的交易", + "opened": "打开", + "overwrite_qdn": "覆盖为QDN", + "password_confirm": "请确认密码", + "password_enter": "请输入密码", + "payment_request": "the Application
{{hostname}}
is requesting a payment", + "people_reaction": "people who reacted with {{ reaction }}", + "processing_transaction": "正在处理交易,请等待...", + "publish_data": "将数据发布到Qortal:从应用到视频的任何内容。完全分散!", + "publishing": "出版...请等待。", + "qdn": "使用QDN保存", + "rating": "rating for {{ service }} {{ name }}", + "register_name": "您需要一个注册的Qortal名称来将固定的应用程序保存到QDN。", + "replied_to": "replied to {{ person }}", + "revert_default": "还原为默认值", + "revert_qdn": "还原为QDN", + "save_qdn": "保存到QDN", + "secure_ownership": "确保按您的名字发布的数据所有权。您甚至可以将数据以及数据出售给第三方。", + "select_file": "请选择一个文件", + "select_image": "请选择徽标的图像", + "select_zip": "选择包含静态内容的.zip文件:", + "sending": "发送...", + "settings": "您正在使用保存设置的导出/导入方式。", + "space_for_admins": "抱歉,这个空间仅适用于管理员。", + "unread_messages": "下面未读消息", + "unsaved_changes": "您对固定应用程序有未保存的更改。将它们保存到QDN。", + "updating": "更新", + "wait": "请稍等" + }, + "message": "信息", + "promotion_text": "促销文本", + "question": { + "accept_vote_on_poll": "您是否接受此投票_ON_POLL交易?民意调查是公开的!", + "logout": "您确定要注销吗?", + "new_user": "您是新用户吗?", + "delete_chat_image": "您想删除以前的聊天图片吗?", + "perform_transaction": "would you like to perform a {{action}} transaction?", + "provide_thread": "请提供线程标题", + "publish_app": "您想发布此应用吗?", + "publish_avatar": "您想发布一个化身吗?", + "publish_qdn": "您想将您的设置发布到QDN(加密)吗?", + "overwrite_changes": "该应用程序无法下载您现有的QDN固定固定应用程序。您想覆盖这些更改吗?", + "rate_app": "would you like to rate this app a rating of {{ rate }}?. It will create a POLL tx.", + "register_name": "您想注册这个名字吗?", + "reset_pinned": "不喜欢您当前的本地更改吗?您想重置默认的固定应用吗?", + "reset_qdn": "不喜欢您当前的本地更改吗?您想重置保存的QDN固定应用吗?", + "transfer_qort": "would you like to transfer {{ amount }} QORT" + }, + "success": { + "order_submitted": "您的买入订单已提交", + "published": "成功出版。请等待几分钟,以使网络传播更改。", + "published_qdn": "成功出版给QDN", + "rated_app": "成功评分。请等待几分钟,以使网络传播更改。", + "request_read": "我读了这个请求", + "transfer": "转会很成功!", + "voted": "成功投票。请等待几分钟,以使网络传播更改。" + } + }, + "minting": { + "account_details": "铸造账户详情", + "actions": "铸造操作", + "average_blocktime": "Qortal平均区块时间", + "average_blocks_per_day": "每日平均区块数", + "average_created_qorts_per_day": "每日平均生成的QORT数量", + "blockchain_statistics": "区块链统计", + "blocks_next_level": "距离下一级的区块数", + "current_level": "当前等级", + "current_status": "当前状态", + "current_tier": "当前等级层级", + "current_tier_content": "{{ tier }}(等级 {{ levels }})", + "details": "铸造详情", + "next_level": "全天候铸造将使你在{{ count }}天内达到{{ level }}级", + "rewards_info": "铸造奖励信息", + "reward_per_block": "每个区块的预计奖励", + "reward_per_day": "每日预计奖励", + "status": { + "minting": "(铸造)", + "not_minting": "(不是铸造)", + "no_status": "没有状态", + "synchronized": "同步 ({{ percent }}%)", + "synchronizing": "同步 ({{ percent }}%)..." + }, + "status_title": "铸造状态", + "tier_share_per_block": "每个区块的等级份额", + "total_minter_in_tier": "该等级层级中的总铸造者数" + }, + "name": "姓名", + "name_app": "名称/应用", + "new_post_in": "new post in {{ title }}", + "none": "没有任何", + "note": "笔记", + "option": "选项", + "option_no": "没有选项", + "option_other": "选项", + "page": { + "last": "最后的", + "first": "第一的", + "next": "下一个", + "previous": "以前的" + }, + "payment_notification": "付款通知", + "payment": "支付", + "poll_embed": "嵌入民意测验", + "port": "港口", + "price": "价格", + "publish": "发布", + "q_apps": { + "about": "关于这个Q-App", + "q_mail": "Q邮件", + "q_manager": "Q-Manager", + "q_sandbox": "q-sandbox", + "q_wallets": "Q-WALLETS" + }, + "receiver": "接收者", + "sender": "发件人", + "server": "服务器", + "service_type": "服务类型", + "settings": "设置", + "sort": { + "by_member": "由会员" + }, + "supply": "供应", + "tags": "标签", + "theme": { + "dark": "黑暗的", + "dark_mode": "黑暗模式", + "default": "默认主题", + "light": "光", + "light_mode": "光模式", + "manager": "主题经理", + "name": "主题名称" + }, + "thread": "线", + "thread_other": "线程", + "thread_title": "线程标题", + "time": { + "day_one": "{{count}} day", + "day_other": "{{count}} days", + "hour_one": "{{count}} hour", + "hour_other": "{{count}} hours", + "minute_one": "{{count}} minute", + "minute_other": "{{count}} minutes", + "time": "时间" + }, + "title": "标题", + "to": "到", + "tutorial": "教程", + "url": "URL", + "user_lookup": "用户查找", + "vote": "投票", + "vote_other": "{{ count }} votes", + "zip": "拉链", + "wallet": { + "litecoin": "莱特币钱包", + "qortal": "Qortal钱包", + "wallet": "钱包", + "wallet_other": "钱包" + }, + "website": "网站", + "welcome": "欢迎" +} diff --git a/src/i18n/locales/zh/group.json b/src/i18n/locales/zh/group.json new file mode 100644 index 0000000..9ef565e --- /dev/null +++ b/src/i18n/locales/zh/group.json @@ -0,0 +1,163 @@ +{ + "action": { + "add_promotion": "添加推广", + "ban": "将成员移出群组", + "cancel_ban": "取消封禁", + "copy_private_key": "复制私钥", + "create_group": "创建群组", + "disable_push_notifications": "关闭所有推送通知", + "export_password": "导出密码", + "export_private_key": "导出私钥", + "find_group": "查找群组", + "join_group": "加入群组", + "kick_member": "从群组中移除成员", + "invite_member": "邀请成员", + "leave_group": "退出群组", + "load_members": "加载成员(含姓名)", + "make_admin": "设为管理员", + "manage_members": "管理成员", + "promote_group": "向非成员推广群组", + "publish_announcement": "发布公告", + "publish_avatar": "发布头像", + "refetch_page": "重新加载页面", + "remove_admin": "取消管理员身份", + "remove_minting_account": "移除铸币账户", + "return_to_thread": "返回主题列表", + "scroll_bottom": "滚动到底部", + "scroll_unread_messages": "滚动到未读消息", + "select_group": "选择群组", + "visit_q_mintership": "访问 Q-Mintership" + }, + "advanced_options": "高级选项", + "block_delay": { + "minimum": "最小区块延迟", + "maximum": "最大区块延迟" + }, + "group": { + "approval_threshold": "群组批准阈值", + "avatar": "群组头像", + "closed": "封闭(私有)- 加入需要批准", + "description": "群组描述", + "id": "群组 ID", + "invites": "群组邀请", + "group": "群组", + "group_name": "群组:{{ name }}", + "group_other": "群组列表", + "groups_admin": "你是管理员的群组", + "management": "群组管理", + "member_number": "成员数量", + "messaging": "消息", + "name": "群组名称", + "open": "开放(公共)", + "private": "私有群组", + "promotions": "群组推广", + "public": "公共群组", + "type": "群组类型" + }, + "invitation_expiry": "邀请过期时间", + "invitees_list": "被邀请者列表", + "join_link": "加入群组链接", + "join_requests": "加入请求", + "last_message": "最后一条消息", + "last_message_date": "最后一条消息:{{date }}", + "latest_mails": "最新 Q 邮件", + "message": { + "generic": { + "avatar_publish_fee": "发布头像需支付 {{ fee }}", + "avatar_registered_name": "设置头像需先注册名称", + "admin_only": "仅显示你为管理员的群组", + "already_in_group": "你已经在这个群组中!", + "block_delay_minimum": "群组交易批准的最小区块延迟", + "block_delay_maximum": "群组交易批准的最大区块延迟", + "closed_group": "这是私有群组,请等待管理员批准你的加入请求", + "descrypt_wallet": "正在解密钱包...", + "encryption_key": "群组加密密钥正在生成,请稍等几分钟...", + "group_announcement": "群组公告", + "group_approval_threshold": "群组批准阈值(需要批准交易的管理员数量或百分比)", + "group_encrypted": "群组已加密", + "group_invited_you": "{{group}} 邀请了你", + "group_key_created": "群组初始密钥已创建", + "group_member_list_changed": "成员列表已变更,请重新加密密钥", + "group_no_secret_key": "尚无群组密钥,你可以作为管理员发布第一个!", + "group_secret_key_no_owner": "最新密钥由非拥有者发布,请作为拥有者重新加密", + "invalid_content": "反应数据中的内容、发送者或时间戳无效", + "invalid_data": "加载内容出错:数据无效", + "latest_promotion": "仅显示本周最新的群组推广", + "loading_members": "正在加载成员列表,请稍候...", + "max_chars": "最多 200 字符。发布需付费", + "manage_minting": "管理你的铸币账户", + "minter_group": "你当前不在 MINTER 群组中", + "mintership_app": "访问 Q-Mintership 应用申请成为铸币者", + "minting_account": "铸币账户:", + "minting_keys_per_node": "每个节点最多允许 2 个铸币密钥。请先移除一个", + "minting_keys_per_node_different": "每个节点最多允许 2 个铸币密钥。请先移除再添加其他账户", + "node_minting_account": "节点铸币账户", + "node_minting_key": "你已有该账户的铸币密钥与该节点绑定", + "no_announcement": "暂无公告", + "no_display": "无显示内容", + "no_selection": "未选择任何群组", + "not_part_group": "你不是该加密群组的成员。请等待管理员重新加密密钥", + "only_encrypted": "只显示未加密消息", + "only_private_groups": "仅显示私有群组", + "pending_join_requests": "{{ group }} 有 {{ count }} 条待处理的加入请求", + "private_key_copied": "私钥已复制", + "provide_message": "请先输入主题的第一条消息", + "secure_place": "请将私钥妥善保管,切勿分享!", + "setting_group": "正在设置群组,请稍候..." + }, + "error": { + "access_name": "无法发送消息:缺少姓名访问权限", + "descrypt_wallet": "解密钱包出错:{{ message }}", + "description_required": "请提供描述", + "group_info": "无法获取群组信息", + "group_join": "加入群组失败", + "group_promotion": "发布推广失败,请重试", + "group_secret_key": "无法获取群组密钥", + "name_required": "请提供名称", + "notify_admins": "请尝试联系以下管理员:", + "qortals_required": "发送消息至少需 {{ quantity }} QORT", + "timeout_reward": "奖励分享确认超时", + "thread_id": "找不到主题 ID", + "unable_determine_group_private": "无法判断群组是否为私有", + "unable_minting": "无法开始铸币" + }, + "success": { + "group_ban": "成员已成功封禁。更改可能需几分钟生效", + "group_creation": "群组已成功创建。更改可能需几分钟生效", + "group_creation_name": "已创建群组 {{group_name}},等待确认", + "group_creation_label": "成功创建群组 {{name}}!", + "group_invite": "已成功邀请 {{invitee}}。更改可能需几分钟生效", + "group_join": "已成功发送加入请求。更改可能需几分钟生效", + "group_join_name": "已加入群组 {{group_name}},等待确认", + "group_join_label": "成功加入群组 {{name}}!", + "group_join_request": "已请求加入群组 {{group_name}},等待确认", + "group_join_outcome": "请求加入群组 {{group_name}} 成功!", + "group_kick": "成员已成功移除。更改可能需几分钟生效", + "group_leave": "成功申请退出群组。更改可能需几分钟生效", + "group_leave_name": "已退出群组 {{group_name}},等待确认", + "group_leave_label": "成功退出群组 {{name}}!", + "group_member_admin": "已成功设为管理员。更改可能需几分钟生效", + "group_promotion": "推广发布成功。可能需要几分钟显示", + "group_remove_member": "已取消管理员身份。更改可能需几分钟生效", + "invitation_cancellation": "邀请已成功取消。更改可能需几分钟生效", + "invitation_request": "已接受加入请求:等待确认", + "loading_threads": "正在加载主题,请稍候...", + "post_creation": "帖子创建成功。发布可能需要一些时间", + "published_secret_key": "已为群组 {{ group_id }} 发布密钥:等待确认", + "published_secret_key_label": "成功为群组 {{ group_id }} 发布密钥!", + "registered_name": "名称注册成功。更改可能需几分钟生效", + "registered_name_label": "名称注册中:等待确认", + "registered_name_success": "名称注册成功!", + "rewardshare_add": "添加奖励分享:等待确认", + "rewardshare_add_label": "奖励分享添加成功!", + "rewardshare_creation": "正在链上确认奖励分享创建,最多可能需 90 秒", + "rewardshare_confirmed": "奖励分享已确认,请点击“下一步”", + "rewardshare_remove": "移除奖励分享:等待确认", + "rewardshare_remove_label": "奖励分享移除成功!", + "thread_creation": "主题已成功创建。发布可能需要一些时间", + "unbanned_user": "用户已成功解禁。更改可能需几分钟生效", + "user_joined": "用户成功加入!" + } + }, + "thread_posts": "新主题消息" +} diff --git a/src/i18n/locales/zh/question.json b/src/i18n/locales/zh/question.json new file mode 100644 index 0000000..c81bac7 --- /dev/null +++ b/src/i18n/locales/zh/question.json @@ -0,0 +1,194 @@ +{ + "accept_app_fee": "接受应用费用", + "always_authenticate": "始终自动认证", + "always_chat_messages": "始终允许该应用发送聊天消息", + "always_retrieve_balance": "始终自动获取余额", + "always_retrieve_list": "始终自动获取列表", + "always_retrieve_wallet": "始终自动获取钱包", + "always_retrieve_wallet_transactions": "始终自动获取钱包交易记录", + "amount_qty": "金额:{{ quantity }}", + "asset_name": "资产:{{ asset }}", + "assets_used_pay": "用于支付的资产:{{ asset }}", + "coin": "币种:{{ coin }}", + "description": "描述:{{ description }}", + "deploy_at": "您想部署此AT吗?", + "download_file": "您想下载以下内容:", + "message": { + "error": { + "add_to_list": "添加到列表失败", + "at_info": "无法找到AT信息。", + "buy_order": "提交交易订单失败", + "cancel_sell_order": "取消出售订单失败。请再试一次!", + "copy_clipboard": "复制到剪贴板失败", + "create_sell_order": "创建出售订单失败。请再试一次!", + "create_tradebot": "无法创建交易机器人", + "decode_transaction": "解码交易失败", + "decrypt": "无法解密", + "decrypt_message": "解密消息失败。请确保数据和密钥正确", + "decryption_failed": "解密失败", + "empty_receiver": "收件人不能为空!", + "encrypt": "无法加密", + "encryption_failed": "加密失败", + "encryption_requires_public_key": "加密数据需要公钥", + "fetch_balance_token": "获取 {{ token }} 余额失败。请重试!", + "fetch_balance": "无法获取余额", + "fetch_connection_history": "获取服务器连接历史失败", + "fetch_generic": "无法获取", + "fetch_group": "获取群组失败", + "fetch_list": "获取列表失败", + "fetch_poll": "获取投票失败", + "fetch_recipient_public_key": "获取收件人公钥失败", + "fetch_wallet_info": "无法获取钱包信息", + "fetch_wallet_transactions": "无法获取钱包交易记录", + "fetch_wallet": "获取钱包失败。请再试一次", + "file_extension": "无法推断文件扩展名", + "gateway_balance_local_node": "无法通过网关查看 {{ token }} 余额。请使用本地节点。", + "gateway_non_qort_local_node": "无法通过网关发送非 QORT 币。请使用本地节点。", + "gateway_retrieve_balance": "无法通过网关获取 {{ token }} 余额", + "gateway_wallet_local_node": "无法通过网关查看 {{ token }} 钱包。请使用本地节点。", + "get_foreign_fee": "获取外部费用时出错", + "insufficient_balance_qort": "您的 QORT 余额不足", + "insufficient_balance": "您的资产余额不足", + "insufficient_funds": "资金不足", + "invalid_encryption_iv": "无效的 IV:AES-GCM 需要 12 字节的 IV", + "invalid_encryption_key": "无效的密钥:AES-GCM 需要 256 位密钥。", + "invalid_fullcontent": "字段 fullContent 格式无效。请使用字符串、base64 或对象", + "invalid_receiver": "无效的收件人地址或名称", + "invalid_type": "无效的类型", + "mime_type": "无法推断 MIME 类型", + "missing_fields": "缺少字段:{{ fields }}", + "name_already_for_sale": "该名称已在售", + "name_not_for_sale": "该名称未出售", + "no_api_found": "未找到可用的 API", + "no_data_encrypted_resource": "加密资源中没有数据", + "no_data_file_submitted": "未提交任何数据或文件", + "no_group_found": "未找到群组", + "no_group_key": "未找到群组密钥", + "no_poll": "未找到投票", + "no_resources_publish": "没有可发布的资源", + "node_info": "获取节点信息失败", + "node_status": "获取节点状态失败", + "only_encrypted_data": "仅加密数据可用于私有服务", + "perform_request": "请求执行失败", + "poll_create": "创建投票失败", + "poll_vote": "投票失败", + "process_transaction": "无法处理交易", + "provide_key_shared_link": "加密资源需要提供密钥以创建共享链接", + "registered_name": "发布需要注册的名称", + "resources_publish": "某些资源发布失败", + "retrieve_file": "获取文件失败", + "retrieve_keys": "获取密钥失败", + "retrieve_summary": "获取摘要失败", + "retrieve_sync_status": "获取 {{ token }} 同步状态出错", + "same_foreign_blockchain": "所有请求的 AT 必须属于同一个外部区块链。", + "send": "发送失败", + "server_current_add": "添加当前服务器失败", + "server_current_set": "设置当前服务器失败", + "server_info": "获取服务器信息失败", + "server_remove": "删除服务器失败", + "submit_sell_order": "提交出售订单失败", + "synchronization_attempts": "在 {{ count }} 次尝试后仍未同步成功", + "timeout_request": "请求超时", + "token_not_supported": "{{ token }} 不支持该调用", + "transaction_activity_summary": "获取交易活动摘要时出错", + "unknown_error": "未知错误", + "unknown_admin_action_type": "未知的管理员操作类型:{{ type }}", + "update_foreign_fee": "更新外部费用失败", + "update_tradebot": "更新交易机器人失败", + "upload_encryption": "由于加密失败,上传失败", + "upload": "上传失败", + "use_private_service": "请使用以 _PRIVATE 结尾的服务进行加密发布", + "user_qortal_name": "用户没有 Qortal 名称", + "max_size_publish": "每个文件允许的最大大小为 {{size}} GB。", + "max_size_publish_public": "公共节点允许的最大文件大小为 {{size}} MB。请使用本地节点上传更大文件。" + }, + "generic": { + "calculate_fee": "*{{ amount }} 聪的费用是基于每 KB {{ rate }} 聪的费率,交易大约为 300 字节。", + "confirm_join_group": "确认加入该群组:", + "include_data_decrypt": "请提供需要解密的数据", + "include_data_encrypt": "请提供需要加密的数据", + "max_retry_transaction": "已达到最大重试次数。跳过该交易。", + "no_action_public_node": "此操作无法通过公共节点执行", + "private_service": "请使用私有服务", + "provide_group_id": "请提供 groupId", + "read_transaction_carefully": "请在确认前仔细阅读交易内容!", + "user_declined_add_list": "用户拒绝添加到列表", + "user_declined_delete_from_list": "用户拒绝从列表中删除", + "user_declined_delete_hosted_resources": "用户拒绝删除托管的资源", + "user_declined_join": "用户拒绝加入群组", + "user_declined_list": "用户拒绝获取托管资源列表", + "user_declined_request": "用户拒绝请求", + "user_declined_save_file": "用户拒绝保存文件", + "user_declined_send_message": "用户拒绝发送消息", + "user_declined_share_list": "用户拒绝共享列表" + } + }, + "name": "名称:{{ name }}", + "option": "选项:{{ option }}", + "options": "选项列表:{{ optionList }}", + "permission": { + "access_list": "是否允许该应用访问列表?", + "add_admin": "是否允许该应用将用户 {{ invitee }} 添加为管理员?", + "all_item_list": "是否允许该应用将以下内容添加到列表 {{ name }} 中?", + "authenticate": "是否允许该应用进行身份验证?", + "ban": "是否允许该应用将 {{ partecipant }} 从群组中封禁?", + "buy_name_detail": "以 {{ price }} QORT 购买 {{ name }}", + "buy_name": "是否允许该应用购买名称?", + "buy_order_fee_estimation_one": "该费用是基于 {{ count }} 个订单的估算,假设每个交易大小为 300 字节,费率为每 KB {{ fee }} {{ ticker }}。", + "buy_order_fee_estimation_other": "该费用是基于 {{ count }} 个订单的估算,假设每个交易大小为 300 字节,费率为每 KB {{ fee }} {{ ticker }}。", + "buy_order_per_kb": "{{ fee }} {{ ticker }} / KB", + "buy_order_quantity_one": "{{ count }} 个买单", + "buy_order_quantity_other": "{{ count }} 个买单", + "buy_order_ticker": "{{ qort_amount }} QORT 兑换 {{ foreign_amount }} {{ ticker }}", + "buy_order": "是否允许该应用执行买单操作?", + "cancel_ban": "是否允许该应用取消对用户 {{ partecipant }} 的群组封禁?", + "cancel_group_invite": "是否允许该应用取消对 {{ invitee }} 的群组邀请?", + "cancel_sell_order": "是否允许该应用取消一个卖单?", + "create_group": "是否允许该应用创建群组?", + "delete_hosts_resources": "是否允许该应用删除 {{ size }} 个已托管资源?", + "fetch_balance": "是否允许该应用获取您的 {{ coin }} 余额?", + "get_wallet_info": "是否允许该应用获取您的钱包信息?", + "get_wallet_transactions": "是否允许该应用获取您的钱包交易记录?", + "invite": "是否允许该应用邀请 {{ invitee }}?", + "kick": "是否允许该应用将 {{ partecipant }} 从群组中移除?", + "leave_group": "是否允许该应用退出以下群组?", + "list_hosted_data": "是否允许该应用获取您托管的数据列表?", + "order_detail": "{{ qort_amount }} QORT 兑换 {{ foreign_amount }} {{ ticker }}", + "pay_publish": "是否允许该应用执行以下付款和发布?", + "perform_admin_action_with_value": "值:{{ value }}", + "perform_admin_action": "是否允许该应用执行管理员操作:{{ type }}?", + "publish_qdn": "是否允许该应用发布到 QDN?", + "register_name": "是否允许该应用注册该名称?", + "remove_admin": "是否允许该应用将用户 {{ partecipant }} 移除管理员权限?", + "remove_from_list": "是否允许该应用从列表 {{ name }} 中移除以下内容?", + "sell_name_cancel": "是否允许该应用取消名称的出售?", + "sell_name_transaction_detail": "以 {{ price }} QORT 出售 {{ name }}", + "sell_name_transaction": "是否允许该应用创建出售名称的交易?", + "sell_order": "是否允许该应用执行卖单操作?", + "send_chat_message": "是否允许该应用发送此聊天消息?", + "send_coins": "是否允许该应用发送代币?", + "server_add": "是否允许该应用添加服务器?", + "server_remove": "是否允许该应用移除服务器?", + "set_current_server": "是否允许该应用设置当前服务器?", + "sign_fee": "是否允许该应用为所有交易报价签署所需费用?", + "sign_process_transaction": "是否允许该应用签署并处理交易?", + "sign_transaction": "是否允许该应用签署交易?", + "transfer_asset": "是否允许该应用转移以下资产?", + "update_foreign_fee": "是否允许该应用更新节点上的外部费用?", + "update_group_detail": "新所有者:{{ owner }}", + "update_group": "是否允许该应用更新该群组?" + }, + "poll": "投票:{{ name }}", + "provide_recipient_group_id": "请提供接收人或群组ID", + "request_create_poll": "您正在请求创建以下投票:", + "request_vote_poll": "您被请求参与以下投票:", + "sats_per_kb": "{{ amount }} sats / KB", + "sats": "{{ amount }} sats", + "server_host": "主机:{{ host }}", + "server_type": "类型:{{ type }}", + "to_group": "发送至群组:{{ group_id }}", + "to_recipient": "发送至:{{ recipient }}", + "total_locking_fee": "总锁仓费用:", + "total_unlocking_fee": "总解锁费用:", + "value": "数值:{{ value }}" +} diff --git a/src/i18n/locales/zh/tutorial.json b/src/i18n/locales/zh/tutorial.json new file mode 100644 index 0000000..886789b --- /dev/null +++ b/src/i18n/locales/zh/tutorial.json @@ -0,0 +1,21 @@ +{ + "1_getting_started": "1. 入门指南", + "2_overview": "2. 总览", + "3_groups": "3. Qortal 群组", + "4_obtain_qort": "4. 获取 QORT", + "account_creation": "账户创建", + "important_info": "重要信息", + "apps": { + "dashboard": "1. 应用仪表盘", + "navigation": "2. 应用导航" + }, + "initial": { + "recommended_qort_qty": "钱包中至少拥有 {{ quantity }} QORT", + "explore": "探索", + "general_chat": "综合聊天", + "getting_started": "入门", + "register_name": "注册名称", + "see_apps": "查看应用", + "trade_qort": "交易 QORT" + } +} diff --git a/src/i18n/processors.ts b/src/i18n/processors.ts new file mode 100644 index 0000000..d7ae34c --- /dev/null +++ b/src/i18n/processors.ts @@ -0,0 +1,54 @@ +export const capitalizeAll = { + type: 'postProcessor', + name: 'capitalizeAll', + process: (value: string) => value.toUpperCase(), +}; + +export const capitalizeEachFirstChar = { + type: 'postProcessor', + name: 'capitalizeEachFirstChar', + process: (value: string) => { + if (!value?.trim()) return value; + + const leadingSpaces = value.match(/^\s*/)?.[0] || ''; + const trailingSpaces = value.match(/\s*$/)?.[0] || ''; + + const core = value + .trim() + .split(/\s+/) + .map( + (word) => + word.charAt(0).toLocaleUpperCase() + word.slice(1).toLocaleLowerCase() + ) + .join(' '); + + return leadingSpaces + core + trailingSpaces; + }, +}; + +export const capitalizeFirstChar = { + type: 'postProcessor', + name: 'capitalizeFirstChar', + process: (value: string) => value.charAt(0).toUpperCase() + value.slice(1), +}; + +export const capitalizeFirstWord = { + type: 'postProcessor', + name: 'capitalizeFirstWord', + process: (value: string) => { + if (!value?.trim()) return value; + + const trimmed = value.trimStart(); + const firstSpaceIndex = trimmed.indexOf(' '); + + if (firstSpaceIndex === -1) { + return trimmed.charAt(0).toUpperCase() + trimmed.slice(1); + } + + const firstWord = trimmed.slice(0, firstSpaceIndex); + const restOfString = trimmed.slice(firstSpaceIndex); + const trailingSpaces = value.slice(trimmed.length); + + return firstWord.toUpperCase() + restOfString + trailingSpaces; + }, +}; diff --git a/src/main.tsx b/src/main.tsx index 22bba47..2b224c8 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -1,81 +1,19 @@ -import React from 'react' -import ReactDOM from 'react-dom/client' -import App from './App.tsx' -import './index.css' -import "./messaging/messagesToBackground"; -import { ThemeProvider, createTheme } from '@mui/material/styles'; +import { createRoot } from 'react-dom/client'; +import App from './App.tsx'; +import '../src/styles/index.css'; +import './messaging/MessagesToBackground.tsx'; +import { MessageQueueProvider } from './messaging/MessageQueueContext.tsx'; +import { ThemeProvider } from './components/Theme/ThemeContext.tsx'; import { CssBaseline } from '@mui/material'; -import { MessageQueueProvider } from './MessageQueueContext.tsx'; -import { RecoilRoot } from 'recoil'; -const theme = createTheme({ - palette: { - primary: { - main: '#232428', // Primary color (e.g., used for buttons, headers, etc.) - }, - secondary: { - main: '#232428', // Secondary color - }, - background: { - default: '#27282c', // Default background color - paper: '#1d1d1d', // Paper component background (for dropdowns, dialogs, etc.) - }, - text: { - primary: '#ffffff', // White as the primary text color - secondary: '#b0b0b0', // Light gray for secondary text - disabled: '#808080', // Gray for disabled text - }, - action: { - // disabledBackground: 'set color of background here', - disabled: 'rgb(255 255 255 / 70%)' - } - }, - typography: { - fontFamily: '"Inter", "Roboto", "Helvetica", "Arial", sans-serif', // Font family - h1: { - color: '#ffffff', // White color for h1 elements - }, - h2: { - color: '#ffffff', // White color for h2 elements - }, - body1: { - color: '#ffffff', // Default body text color - }, - body2: { - color: '#b0b0b0', // Lighter text for body2, often used for secondary text - }, - }, - components: { - MuiOutlinedInput: { - styleOverrides: { - root: { - ".MuiOutlinedInput-notchedOutline": { - borderColor: "white", // ⚪ Default outline color - }, - }, - }, - }, - MuiSelect: { - styleOverrides: { - icon: { - color: "white", // ✅ Caret (dropdown arrow) color - }, - }, - }, - }, -}); +import './i18n/i18n.js'; -export default theme; - - -ReactDOM.createRoot(document.getElementById('root')!).render( +createRoot(document.getElementById('root')!).render( <> - + - - - - - + + + - , -) + +); diff --git a/src/MessageQueueContext.tsx b/src/messaging/MessageQueueContext.tsx similarity index 67% rename from src/MessageQueueContext.tsx rename to src/messaging/MessageQueueContext.tsx index 7104520..11f356f 100644 --- a/src/MessageQueueContext.tsx +++ b/src/messaging/MessageQueueContext.tsx @@ -1,12 +1,17 @@ -import React, { createContext, useContext, useState, useCallback, useRef } from 'react'; -import ShortUniqueId from "short-unique-id"; +import { + createContext, + useContext, + useState, + useCallback, + useRef, +} from 'react'; +import ShortUniqueId from 'short-unique-id'; const MessageQueueContext = createContext(null); +const uid = new ShortUniqueId({ length: 8 }); export const useMessageQueue = () => useContext(MessageQueueContext); -const uid = new ShortUniqueId({ length: 8 }); - export const MessageQueueProvider = ({ children }) => { const messageQueueRef = useRef([]); const [queueChats, setQueueChats] = useState({}); // Stores chats and status for display @@ -21,39 +26,41 @@ export const MessageQueueProvider = ({ children }) => { const processingPromiseRef = useRef(Promise.resolve()); // Function to add a message to the queue - const addToQueue = useCallback((sendMessageFunc, messageObj, type, groupDirectId) => { - const tempId = uid.rnd(); - const chatData = { - ...messageObj, - type, - groupDirectId, - signature: uid.rnd(), - identifier: tempId, - retries: 0, // Retry count for display purposes - status: 'pending' // Initial status is 'pending' - }; + const addToQueue = useCallback( + (sendMessageFunc, messageObj, type, groupDirectId) => { + const tempId = uid.rnd(); + const chatData = { + ...messageObj, + type, + groupDirectId, + signature: uid.rnd(), + identifier: tempId, + retries: 0, // Retry count for display purposes + status: 'pending', // Initial status is 'pending' + }; - // Add chat data to queueChats for status tracking - setQueueChats((prev) => ({ - ...prev, - [groupDirectId]: [...(prev[groupDirectId] || []), chatData] - })); + // Add chat data to queueChats for status tracking + setQueueChats((prev) => ({ + ...prev, + [groupDirectId]: [...(prev[groupDirectId] || []), chatData], + })); - // Add the message to the global messageQueueRef - messageQueueRef.current.push({ - func: sendMessageFunc, - identifier: tempId, - groupDirectId, - specialId: messageObj?.message?.specialId - }); + // Add the message to the global messageQueueRef + messageQueueRef.current.push({ + func: sendMessageFunc, + identifier: tempId, + groupDirectId, + specialId: messageObj?.message?.specialId, + }); - // Start processing the queue - processQueue([], groupDirectId); - }, []); + // Start processing the queue + processQueue([], groupDirectId); + }, + [] + ); // Function to process the message queue const processQueue = useCallback((newMessages = [], groupDirectId) => { - processingPromiseRef.current = processingPromiseRef.current .then(() => processQueueInternal(newMessages, groupDirectId)) .catch((err) => console.error('Error in processQueue:', err)); @@ -62,7 +69,7 @@ export const MessageQueueProvider = ({ children }) => { // Internal function to handle queue processing const processQueueInternal = async (newMessages, groupDirectId) => { // Remove any messages from the queue that match the specialId from newMessages - + // If the queue is empty, no need to process if (messageQueueRef.current.length === 0) return; @@ -92,7 +99,6 @@ export const MessageQueueProvider = ({ children }) => { // Remove the message from the queue after successful sending messageQueueRef.current.shift(); - } catch (error) { console.error('Message sending failed', error); @@ -110,7 +116,8 @@ export const MessageQueueProvider = ({ children }) => { updatedChats[groupDirectId][chatIndex].status = 'failed'; } else { // Max retries reached, set status to 'failed-permanent' - updatedChats[groupDirectId][chatIndex].status = 'failed-permanent'; + updatedChats[groupDirectId][chatIndex].status = + 'failed-permanent'; // Remove the message from the queue after max retries messageQueueRef.current.shift(); @@ -127,33 +134,39 @@ export const MessageQueueProvider = ({ children }) => { // Method to process with new messages and groupDirectId const processWithNewMessages = (newMessages, groupDirectId) => { - let updatedNewMessages = newMessages + let updatedNewMessages = newMessages; if (newMessages.length > 0) { // Remove corresponding entries in queueChats for the provided groupDirectId setQueueChats((prev) => { const updatedChats = { ...prev }; if (updatedChats[groupDirectId]) { - - updatedNewMessages = newMessages?.map((msg)=> { - const findTempMsg = updatedChats[groupDirectId]?.find((msg2)=> msg2?.message?.specialId === msg?.specialId) - if(findTempMsg){ + updatedNewMessages = newMessages?.map((msg) => { + const findTempMsg = updatedChats[groupDirectId]?.find( + (msg2) => msg2?.message?.specialId === msg?.specialId + ); + if (findTempMsg) { return { ...msg, - tempSignature: findTempMsg?.signature - } + tempSignature: findTempMsg?.signature, + }; } - return msg - }) - - - updatedChats[groupDirectId] = updatedChats[groupDirectId].filter((chat) => { - return !newMessages.some(newMsg => newMsg?.specialId === chat?.message?.specialId); + return msg; }); + updatedChats[groupDirectId] = updatedChats[groupDirectId].filter( + (chat) => { + return !newMessages.some( + (newMsg) => newMsg?.specialId === chat?.message?.specialId + ); + } + ); + // Remove messages with status 'failed-permanent' - updatedChats[groupDirectId] = updatedChats[groupDirectId].filter((chat) => { - return chat?.status !== 'failed-permanent'; - }); + updatedChats[groupDirectId] = updatedChats[groupDirectId].filter( + (chat) => { + return chat?.status !== 'failed-permanent'; + } + ); // If no more chats for this group, delete the groupDirectId entry if (updatedChats[groupDirectId].length === 0) { @@ -162,27 +175,36 @@ export const MessageQueueProvider = ({ children }) => { } return updatedChats; }); - } setTimeout(() => { - if(!messageQueueRef.current.find((msg) => msg?.groupDirectId === groupDirectId)){ + if ( + !messageQueueRef.current.find( + (msg) => msg?.groupDirectId === groupDirectId + ) + ) { setQueueChats((prev) => { const updatedChats = { ...prev }; if (updatedChats[groupDirectId]) { - delete updatedChats[groupDirectId] + delete updatedChats[groupDirectId]; } - - return updatedChats - } - ) + + return updatedChats; + }); } }, 300); - - return updatedNewMessages + + return updatedNewMessages; }; return ( - + {children} ); diff --git a/src/messaging/messagesToBackground.tsx b/src/messaging/MessagesToBackground.tsx similarity index 71% rename from src/messaging/messagesToBackground.tsx rename to src/messaging/MessagesToBackground.tsx index 0ba8f71..305a826 100644 --- a/src/messaging/messagesToBackground.tsx +++ b/src/messaging/MessagesToBackground.tsx @@ -1,5 +1,3 @@ - - // Utility to generate unique request IDs function generateRequestId() { return `msg-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`; @@ -9,34 +7,55 @@ function generateRequestId() { const callbackMap = new Map(); // Global listener for handling message responses -window.addEventListener("message", (event) => { +window.addEventListener('message', (event) => { const { type, requestId, payload, error, message } = event.data; // Only process messages of type `backgroundMessageResponse` - if (type !== "backgroundMessageResponse") return; + if (type !== 'backgroundMessageResponse') return; // Check if there’s a callback stored for this requestId if (callbackMap.has(requestId)) { const { resolve, reject } = callbackMap.get(requestId); callbackMap.delete(requestId); // Remove callback after use - resolve(event.data) + resolve(event.data); } }); -export const sendMessageBackground = (action, data = {}, timeout = 180000, isExtension, appInfo, skipAuth) => { +export const sendMessageBackground = ( + action, + data = {}, + timeout = 600000, + isExtension, + appInfo, + skipAuth +) => { return new Promise((resolve, reject) => { const requestId = generateRequestId(); // Unique ID for each request callbackMap.set(requestId, { resolve, reject }); // Store both resolve and reject callbacks - const targetOrigin = window.location.origin + const targetOrigin = window.location.origin; // Send the message with `backgroundMessage` type - window.postMessage({ type: "backgroundMessage", action, requestId, payload: data, isExtension, appInfo, skipAuth }, targetOrigin); + window.postMessage( + { + type: 'backgroundMessage', + action, + requestId, + payload: data, + isExtension, + appInfo, + skipAuth, + }, + targetOrigin + ); // Set up a timeout to automatically reject if no response is received const timeoutId = setTimeout(() => { // Remove the callback to prevent memory leaks callbackMap.delete(requestId); - reject({ error: "timeout", message: `Request timed out after ${timeout} ms` }); + reject({ + error: 'timeout', + message: `Request timed out after ${timeout} ms`, + }); }, timeout); // Adjust resolve/reject to clear the timeout when a response arrives @@ -48,14 +67,17 @@ export const sendMessageBackground = (action, data = {}, timeout = 180000, isExt reject: (error) => { clearTimeout(timeoutId); // Clear the timeout if an error occurs reject(error); - } + }, }); }).then((response) => { // Return payload or error based on response content if (response?.payload !== null && response?.payload !== undefined) { return response.payload; } else if (response?.error) { - return { error: response.error, message: response?.message || "An error occurred" }; + return { + error: response.error, + message: response?.message || 'An error occurred', + }; } }); }; diff --git a/src/qdn/encryption/group-encryption.ts b/src/qdn/encryption/group-encryption.ts index 82734ee..904413c 100644 --- a/src/qdn/encryption/group-encryption.ts +++ b/src/qdn/encryption/group-encryption.ts @@ -1,509 +1,702 @@ // @ts-nocheck -import Base58 from "../../deps/Base58" -import ed2curve from "../../deps/ed2curve" -import nacl from "../../deps/nacl-fast" - +import Base58 from '../../encryption/Base58'; +import ed2curve from '../../encryption/ed2curve'; +import nacl from '../../encryption/nacl-fast'; +import i18n from '../../i18n/i18n'; export function base64ToUint8Array(base64: string) { - const binaryString = atob(base64) - const len = binaryString.length - const bytes = new Uint8Array(len) - for (let i = 0; i < len; i++) { - bytes[i] = binaryString.charCodeAt(i) - } - return bytes + const binaryString = atob(base64); + const len = binaryString.length; + const bytes = new Uint8Array(len); + for (let i = 0; i < len; i++) { + bytes[i] = binaryString.charCodeAt(i); + } + return bytes; } export function uint8ArrayToBase64(uint8Array: any) { - const length = uint8Array.length - let binaryString = '' - const chunkSize = 1024 * 1024; // Process 1MB at a time - for (let i = 0; i < length; i += chunkSize) { - const chunkEnd = Math.min(i + chunkSize, length) - const chunk = uint8Array.subarray(i, chunkEnd) - binaryString += Array.from(chunk, byte => String.fromCharCode(byte)).join('') - } - return btoa(binaryString) + const length = uint8Array.length; + let binaryString = ''; + const chunkSize = 1024 * 1024; // Process 1MB at a time + for (let i = 0; i < length; i += chunkSize) { + const chunkEnd = Math.min(i + chunkSize, length); + const chunk = uint8Array.subarray(i, chunkEnd); + binaryString += Array.from(chunk, (byte) => String.fromCharCode(byte)).join( + '' + ); + } + return btoa(binaryString); } export function objectToBase64(obj: Object) { - // Step 1: Convert the object to a JSON string - const jsonString = JSON.stringify(obj) - // Step 2: Create a Blob from the JSON string - const blob = new Blob([jsonString], { type: 'application/json' }) - // Step 3: Create a FileReader to read the Blob as a base64-encoded string - return new Promise((resolve, reject) => { - const reader = new FileReader() - reader.onloadend = () => { - if (typeof reader.result === 'string') { - // Remove 'data:application/json;base64,' prefix - const base64 = reader.result.replace( - 'data:application/json;base64,', - '' - ) - resolve(base64) - } else { - reject(new Error('Failed to read the Blob as a base64-encoded string')) - } - } - reader.onerror = () => { - reject(reader.error) - } - reader.readAsDataURL(blob) - }) + // Step 1: Convert the object to a JSON string + const jsonString = JSON.stringify(obj); + // Step 2: Create a Blob from the JSON string + const blob = new Blob([jsonString], { type: 'application/json' }); + // Step 3: Create a FileReader to read the Blob as a base64-encoded string + return new Promise((resolve, reject) => { + const reader = new FileReader(); + reader.onloadend = () => { + if (typeof reader.result === 'string') { + // Remove 'data:application/json;base64,' prefix + const base64 = reader.result.replace( + 'data:application/json;base64,', + '' + ); + resolve(base64); + } else { + reject( + new Error( + i18n.t('auth:message.error.read_blob_base64', { + postProcess: 'capitalizeFirstChar', + }) + ) + ); + } + }; + reader.onerror = () => { + reject(reader.error); + }; + reader.readAsDataURL(blob); + }); } // Function to create a symmetric key and nonce export const createSymmetricKeyAndNonce = () => { - const messageKey = new Uint8Array(32); // 32 bytes for the symmetric key - crypto.getRandomValues(messageKey); + const messageKey = new Uint8Array(32); // 32 bytes for the symmetric key + crypto.getRandomValues(messageKey); - - - return { messageKey: uint8ArrayToBase64(messageKey)}; + return { messageKey: uint8ArrayToBase64(messageKey) }; }; +export const encryptDataGroup = ({ + data64, + publicKeys, + privateKey, + userPublicKey, + customSymmetricKey, +}: any) => { + const combinedPublicKeys = [...publicKeys, userPublicKey]; + const decodedPrivateKey = Base58.decode(privateKey); + const publicKeysDuplicateFree = [...new Set(combinedPublicKeys)]; + const Uint8ArrayData = base64ToUint8Array(data64); -export const encryptDataGroup = ({ data64, publicKeys, privateKey, userPublicKey, customSymmetricKey }: any) => { + if (!(Uint8ArrayData instanceof Uint8Array)) { + throw new Error( + i18n.t('auth:message.error.invalid_uint8', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + try { + // Generate a random symmetric key for the message. - let combinedPublicKeys = [...publicKeys, userPublicKey] - const decodedPrivateKey = Base58.decode(privateKey) - const publicKeysDuplicateFree = [...new Set(combinedPublicKeys)] + let messageKey; + if (customSymmetricKey) { + messageKey = base64ToUint8Array(customSymmetricKey); + } else { + messageKey = new Uint8Array(32); + crypto.getRandomValues(messageKey); + } - const Uint8ArrayData = base64ToUint8Array(data64) - if (!(Uint8ArrayData instanceof Uint8Array)) { - throw new Error("The Uint8ArrayData you've submitted is invalid") - } - try { - // Generate a random symmetric key for the message. - - let messageKey - if(customSymmetricKey){ - messageKey = base64ToUint8Array(customSymmetricKey) - } else { - messageKey = new Uint8Array(32) - crypto.getRandomValues(messageKey) - } + if (!messageKey) + throw new Error( + i18n.t('auth:message.error.create_simmetric_key', { + postProcess: 'capitalizeFirstChar', + }) + ); + const nonce = new Uint8Array(24); + crypto.getRandomValues(nonce); + // Encrypt the data with the symmetric key. + const encryptedData = nacl.secretbox(Uint8ArrayData, nonce, messageKey); + // Generate a keyNonce outside of the loop. + const keyNonce = new Uint8Array(24); + crypto.getRandomValues(keyNonce); + // Encrypt the symmetric key for each recipient. + const encryptedKeys = []; + publicKeysDuplicateFree.forEach((recipientPublicKey) => { + const publicKeyUnit8Array = Base58.decode(recipientPublicKey); + const convertedPrivateKey = ed2curve.convertSecretKey(decodedPrivateKey); + const convertedPublicKey = ed2curve.convertPublicKey(publicKeyUnit8Array); + const sharedSecret = new Uint8Array(32); - if(!messageKey) throw new Error('Cannot create symmetric key') - const nonce = new Uint8Array(24) - crypto.getRandomValues(nonce) - // Encrypt the data with the symmetric key. - const encryptedData = nacl.secretbox(Uint8ArrayData, nonce, messageKey) - // Generate a keyNonce outside of the loop. - const keyNonce = new Uint8Array(24) - crypto.getRandomValues(keyNonce) - // Encrypt the symmetric key for each recipient. - let encryptedKeys = [] - publicKeysDuplicateFree.forEach((recipientPublicKey) => { - const publicKeyUnit8Array = Base58.decode(recipientPublicKey) - const convertedPrivateKey = ed2curve.convertSecretKey(decodedPrivateKey) - const convertedPublicKey = ed2curve.convertPublicKey(publicKeyUnit8Array) - const sharedSecret = new Uint8Array(32) + // the length of the sharedSecret will be 32 + 16 + // When you're encrypting data using nacl.secretbox, it's adding an authentication tag to the result, which is 16 bytes long. This tag is used for verifying the integrity and authenticity of the data when it is decrypted + nacl.lowlevel.crypto_scalarmult( + sharedSecret, + convertedPrivateKey, + convertedPublicKey + ); - // the length of the sharedSecret will be 32 + 16 - // When you're encrypting data using nacl.secretbox, it's adding an authentication tag to the result, which is 16 bytes long. This tag is used for verifying the integrity and authenticity of the data when it is decrypted - nacl.lowlevel.crypto_scalarmult(sharedSecret, convertedPrivateKey, convertedPublicKey) + // Encrypt the symmetric key with the shared secret. + const encryptedKey = nacl.secretbox(messageKey, keyNonce, sharedSecret); - // Encrypt the symmetric key with the shared secret. - const encryptedKey = nacl.secretbox(messageKey, keyNonce, sharedSecret) + encryptedKeys.push(encryptedKey); + }); + const str = 'qortalGroupEncryptedData'; + const strEncoder = new TextEncoder(); + const strUint8Array = strEncoder.encode(str); + // Convert sender's public key to Uint8Array and add to the message + const senderPublicKeyUint8Array = Base58.decode(userPublicKey); + // Combine all data into a single Uint8Array. + // Calculate size of combinedData + let combinedDataSize = + strUint8Array.length + + nonce.length + + keyNonce.length + + senderPublicKeyUint8Array.length + + encryptedData.length + + 4; + let encryptedKeysSize = 0; + encryptedKeys.forEach((key) => { + encryptedKeysSize += key.length; + }); + combinedDataSize += encryptedKeysSize; + const combinedData = new Uint8Array(combinedDataSize); + combinedData.set(strUint8Array); + combinedData.set(nonce, strUint8Array.length); + combinedData.set(keyNonce, strUint8Array.length + nonce.length); + combinedData.set( + senderPublicKeyUint8Array, + strUint8Array.length + nonce.length + keyNonce.length + ); + combinedData.set( + encryptedData, + strUint8Array.length + + nonce.length + + keyNonce.length + + senderPublicKeyUint8Array.length + ); + // Initialize offset for encryptedKeys + let encryptedKeysOffset = + strUint8Array.length + + nonce.length + + keyNonce.length + + senderPublicKeyUint8Array.length + + encryptedData.length; + encryptedKeys.forEach((key) => { + combinedData.set(key, encryptedKeysOffset); + encryptedKeysOffset += key.length; + }); + const countArray = new Uint8Array( + new Uint32Array([publicKeysDuplicateFree.length]).buffer + ); + combinedData.set(countArray, combinedData.length - 4); + return uint8ArrayToBase64(combinedData); + } catch (error) { + console.log('error', error); + throw new Error( + i18n.t('question:message.error.encryption_failed', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; - encryptedKeys.push(encryptedKey) - }) - const str = "qortalGroupEncryptedData" - const strEncoder = new TextEncoder() - const strUint8Array = strEncoder.encode(str) - // Convert sender's public key to Uint8Array and add to the message - const senderPublicKeyUint8Array = Base58.decode(userPublicKey) - // Combine all data into a single Uint8Array. - // Calculate size of combinedData - let combinedDataSize = strUint8Array.length + nonce.length + keyNonce.length + senderPublicKeyUint8Array.length + encryptedData.length + 4 - let encryptedKeysSize = 0 - encryptedKeys.forEach((key) => { - encryptedKeysSize += key.length - }) - combinedDataSize += encryptedKeysSize - let combinedData = new Uint8Array(combinedDataSize) - combinedData.set(strUint8Array) - combinedData.set(nonce, strUint8Array.length) - combinedData.set(keyNonce, strUint8Array.length + nonce.length) - combinedData.set(senderPublicKeyUint8Array, strUint8Array.length + nonce.length + keyNonce.length) - combinedData.set(encryptedData, strUint8Array.length + nonce.length + keyNonce.length + senderPublicKeyUint8Array.length) - // Initialize offset for encryptedKeys - let encryptedKeysOffset = strUint8Array.length + nonce.length + keyNonce.length + senderPublicKeyUint8Array.length + encryptedData.length - encryptedKeys.forEach((key) => { - combinedData.set(key, encryptedKeysOffset) - encryptedKeysOffset += key.length - }) - const countArray = new Uint8Array(new Uint32Array([publicKeysDuplicateFree.length]).buffer) - combinedData.set(countArray, combinedData.length - 4) - return uint8ArrayToBase64(combinedData) - } catch (error) { - console.log('error', error) - throw new Error("Error in encrypting data") - } +export const encryptSingle = async ({ + data64, + secretKeyObject, + typeNumber = 2, +}: any) => { + // Find the highest key in the secretKeyObject + const highestKey = Math.max( + ...Object.keys(secretKeyObject) + .filter((item) => !isNaN(+item)) + .map(Number) + ); + const highestKeyObject = secretKeyObject[highestKey]; + + // Convert data and keys from base64 + const Uint8ArrayData = base64ToUint8Array(data64); + const messageKey = base64ToUint8Array(highestKeyObject.messageKey); + + if (!(Uint8ArrayData instanceof Uint8Array)) { + throw new Error( + i18n.t('auth:message.error.invalid_uint8', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + + let nonce, encryptedData, encryptedDataBase64, finalEncryptedData; + + // Convert type number to a fixed length of 3 digits + const typeNumberStr = typeNumber.toString().padStart(3, '0'); + + if (highestKeyObject.nonce) { + // Old format: Use the nonce from secretKeyObject + nonce = base64ToUint8Array(highestKeyObject.nonce); + + // Encrypt the data with the existing nonce and message key + encryptedData = nacl.secretbox(Uint8ArrayData, nonce, messageKey); + encryptedDataBase64 = uint8ArrayToBase64(encryptedData); + + // Concatenate the highest key, type number, and encrypted data (old format) + const highestKeyStr = highestKey.toString().padStart(10, '0'); // Fixed length of 10 digits + finalEncryptedData = btoa(highestKeyStr + encryptedDataBase64); + } else { + // New format: Generate a random nonce and embed it in the message + nonce = new Uint8Array(24); // 24 bytes for the nonce + crypto.getRandomValues(nonce); + + // Encrypt the data with the new nonce and message key + encryptedData = nacl.secretbox(Uint8ArrayData, nonce, messageKey); + encryptedDataBase64 = uint8ArrayToBase64(encryptedData); + + // Concatenate the highest key, type number, nonce, and encrypted data (new format) + const highestKeyStr = highestKey.toString().padStart(10, '0'); // Fixed length of 10 digits + + const highestKeyBytes = new TextEncoder().encode( + highestKeyStr.padStart(10, '0') + ); + const typeNumberBytes = new TextEncoder().encode( + typeNumberStr.padStart(3, '0') + ); + + // Step 3: Concatenate all binary + const combinedBinary = new Uint8Array( + highestKeyBytes.length + + typeNumberBytes.length + + nonce.length + + encryptedData.length + ); + // finalEncryptedData = btoa(highestKeyStr) + btoa(typeNumberStr) + nonceBase64 + encryptedDataBase64; + combinedBinary.set(highestKeyBytes, 0); + combinedBinary.set(typeNumberBytes, highestKeyBytes.length); + combinedBinary.set(nonce, highestKeyBytes.length + typeNumberBytes.length); + combinedBinary.set( + encryptedData, + highestKeyBytes.length + typeNumberBytes.length + nonce.length + ); + + // Step 4: Base64 encode once + finalEncryptedData = uint8ArrayToBase64(combinedBinary); + } + + return finalEncryptedData; +}; + +export const decodeBase64ForUIChatMessages = (messages) => { + const msgs = []; + for (const msg of messages) { + try { + const decoded = atob(msg?.data); + const parseDecoded = JSON.parse(decodeURIComponent(escape(decoded))); + + msgs.push({ + ...msg, + ...parseDecoded, + }); + } catch (error) { + console.log(error); + } + } + return msgs; +}; + +export const decryptSingle = async ({ + data64, + secretKeyObject, + skipDecodeBase64, +}: any) => { + // First, decode the base64-encoded input (if skipDecodeBase64 is not set) + const decodedData = skipDecodeBase64 ? data64 : atob(data64); + + if (secretKeyObject) { + // Then, decode it again for the specific format (if double encoding is used) + const decodeForNumber = atob(decodedData); + + // Extract the key (assuming it's always the first 10 characters) + const keyStr = decodeForNumber.slice(0, 10); + + // Convert the key string back to a number + const highestKey = parseInt(keyStr, 10); + + // Check if we have a valid secret key for the extracted highestKey + if (!secretKeyObject[highestKey]) { + throw new Error( + i18n.t('auth:message.error.find_secret_key', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + + const secretKeyEntry = secretKeyObject[highestKey]; + + let nonceBase64, encryptedDataBase64; + + // Determine if typeNumber exists by checking if the next 3 characters after keyStr are digits + const possibleTypeNumberStr = decodeForNumber.slice(10, 13); + const hasTypeNumber = /^\d{3}$/.test(possibleTypeNumberStr); // Check if next 3 characters are digits + + if (secretKeyEntry.nonce) { + // Old format: nonce is present in the secretKeyObject, so no type number exists + nonceBase64 = secretKeyEntry.nonce; + encryptedDataBase64 = decodeForNumber.slice(10); // The remaining part is the encrypted data + } else { + if (hasTypeNumber) { + // const typeNumberStr = new TextDecoder().decode(typeNumberBytes); + if (decodeForNumber.slice(10, 13) !== '001') { + const decodedBinary = base64ToUint8Array(decodedData); + const highestKeyBytes = decodedBinary.slice(0, 10); // if ASCII digits only + const highestKeyStr = new TextDecoder().decode(highestKeyBytes); + + const nonce = decodedBinary.slice(13, 13 + 24); + const encryptedData = decodedBinary.slice(13 + 24); + const highestKey = parseInt(highestKeyStr, 10); + + const messageKey = base64ToUint8Array( + secretKeyObject[+highestKey].messageKey + ); + const decryptedBytes = nacl.secretbox.open( + encryptedData, + nonce, + messageKey + ); + + // Check if decryption was successful + if (!decryptedBytes) { + throw new Error( + i18n.t('question:message.error.decryption_failed', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + + // Convert the decrypted Uint8Array back to a Base64 string + return uint8ArrayToBase64(decryptedBytes); + } + // New format: Extract type number and nonce + nonceBase64 = decodeForNumber.slice(13, 45); // Extract nonce (next 32 characters after type number) + encryptedDataBase64 = decodeForNumber.slice(45); // The remaining part is the encrypted data + } else { + // Old format without type number (nonce is embedded in the message, first 32 characters after keyStr) + nonceBase64 = decodeForNumber.slice(10, 42); // First 32 characters for the nonce + encryptedDataBase64 = decodeForNumber.slice(42); // The remaining part is the encrypted data + } + } + + // Convert Base64 strings to Uint8Array + const Uint8ArrayData = base64ToUint8Array(encryptedDataBase64); + const nonce = base64ToUint8Array(nonceBase64); + const messageKey = base64ToUint8Array(secretKeyEntry.messageKey); + + if (!(Uint8ArrayData instanceof Uint8Array)) { + throw new Error( + i18n.t('auth:message.error.invalid_uint8', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + + // Decrypt the data using the nonce and messageKey + const decryptedData = nacl.secretbox.open( + Uint8ArrayData, + nonce, + messageKey + ); + + // Check if decryption was successful + if (!decryptedData) { + throw new Error( + i18n.t('question:message.error.decryption_failed', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + + // Convert the decrypted Uint8Array back to a Base64 string + return uint8ArrayToBase64(decryptedData); + } + + return; +}; + +export const decryptGroupEncryptionWithSharingKey = async ({ + data64EncryptedData, + key, +}: any) => { + const allCombined = base64ToUint8Array(data64EncryptedData); + const str = 'qortalGroupEncryptedData'; + const strEncoder = new TextEncoder(); + const strUint8Array = strEncoder.encode(str); + // Extract the nonce + const nonceStartPosition = strUint8Array.length; + const nonceEndPosition = nonceStartPosition + 24; // Nonce is 24 bytes + const nonce = allCombined.slice(nonceStartPosition, nonceEndPosition); + // Extract the shared keyNonce + const keyNonceStartPosition = nonceEndPosition; + const keyNonceEndPosition = keyNonceStartPosition + 24; // Nonce is 24 bytes + // Extract the sender's public key + const senderPublicKeyStartPosition = keyNonceEndPosition; + const senderPublicKeyEndPosition = senderPublicKeyStartPosition + 32; // Public keys are 32 bytes + // Calculate count first + const countStartPosition = allCombined.length - 4; // 4 bytes before the end, since count is stored in Uint32 (4 bytes) + const countArray = allCombined.slice( + countStartPosition, + countStartPosition + 4 + ); + const count = new Uint32Array(countArray.buffer)[0]; + // Then use count to calculate encryptedData + const encryptedDataStartPosition = senderPublicKeyEndPosition; // start position of encryptedData + const encryptedDataEndPosition = allCombined.length - (count * (32 + 16) + 4); + const encryptedData = allCombined.slice( + encryptedDataStartPosition, + encryptedDataEndPosition + ); + const symmetricKey = base64ToUint8Array(key); + + // Decrypt the data using the nonce and messageKey + const decryptedData = nacl.secretbox.open(encryptedData, nonce, symmetricKey); + + // Check if decryption was successful + if (!decryptedData) { + throw new Error( + i18n.t('question:message.error.decryption_failed', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + // Convert the decrypted Uint8Array back to a Base64 string + return uint8ArrayToBase64(decryptedData); +}; + +export function decryptGroupDataQortalRequest(data64EncryptedData, privateKey) { + const allCombined = base64ToUint8Array(data64EncryptedData); + const str = 'qortalGroupEncryptedData'; + const strEncoder = new TextEncoder(); + const strUint8Array = strEncoder.encode(str); + // Extract the nonce + const nonceStartPosition = strUint8Array.length; + const nonceEndPosition = nonceStartPosition + 24; // Nonce is 24 bytes + const nonce = allCombined.slice(nonceStartPosition, nonceEndPosition); + // Extract the shared keyNonce + const keyNonceStartPosition = nonceEndPosition; + const keyNonceEndPosition = keyNonceStartPosition + 24; // Nonce is 24 bytes + const keyNonce = allCombined.slice( + keyNonceStartPosition, + keyNonceEndPosition + ); + // Extract the sender's public key + const senderPublicKeyStartPosition = keyNonceEndPosition; + const senderPublicKeyEndPosition = senderPublicKeyStartPosition + 32; // Public keys are 32 bytes + const senderPublicKey = allCombined.slice( + senderPublicKeyStartPosition, + senderPublicKeyEndPosition + ); + // Calculate count first + const countStartPosition = allCombined.length - 4; // 4 bytes before the end, since count is stored in Uint32 (4 bytes) + const countArray = allCombined.slice( + countStartPosition, + countStartPosition + 4 + ); + const count = new Uint32Array(countArray.buffer)[0]; + // Then use count to calculate encryptedData + const encryptedDataStartPosition = senderPublicKeyEndPosition; // start position of encryptedData + const encryptedDataEndPosition = allCombined.length - (count * (32 + 16) + 4); + const encryptedData = allCombined.slice( + encryptedDataStartPosition, + encryptedDataEndPosition + ); + // Extract the encrypted keys + // 32+16 = 48 + const combinedKeys = allCombined.slice( + encryptedDataEndPosition, + encryptedDataEndPosition + count * 48 + ); + if (!privateKey) { + throw new Error( + i18n.t('question:message.error.retrieve_keys', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + const decodedPrivateKey = Base58.decode(privateKey); + const convertedPrivateKey = ed2curve.convertSecretKey(decodedPrivateKey); + const convertedSenderPublicKey = ed2curve.convertPublicKey(senderPublicKey); + const sharedSecret = new Uint8Array(32); + nacl.lowlevel.crypto_scalarmult( + sharedSecret, + convertedPrivateKey, + convertedSenderPublicKey + ); + for (let i = 0; i < count; i++) { + const encryptedKey = combinedKeys.slice(i * 48, (i + 1) * 48); + // Decrypt the symmetric key. + const decryptedKey = nacl.secretbox.open( + encryptedKey, + keyNonce, + sharedSecret + ); + // If decryption was successful, decryptedKey will not be null. + if (decryptedKey) { + // Decrypt the data using the symmetric key. + const decryptedData = nacl.secretbox.open( + encryptedData, + nonce, + decryptedKey + ); + // If decryption was successful, decryptedData will not be null. + if (decryptedData) { + return decryptedData; + } + } + } + throw new Error( + i18n.t('question:message.error.decrypt', { + postProcess: 'capitalizeFirstChar', + }) + ); } -export const encryptSingle = async ({ data64, secretKeyObject, typeNumber = 2 }: any) => { - // Find the highest key in the secretKeyObject - const highestKey = Math.max(...Object.keys(secretKeyObject).filter(item => !isNaN(+item)).map(Number)); - const highestKeyObject = secretKeyObject[highestKey]; - - // Convert data and keys from base64 - const Uint8ArrayData = base64ToUint8Array(data64); - const messageKey = base64ToUint8Array(highestKeyObject.messageKey); - - if (!(Uint8ArrayData instanceof Uint8Array)) { - throw new Error("The Uint8ArrayData you've submitted is invalid"); - } - - let nonce, encryptedData, encryptedDataBase64, finalEncryptedData; - - // Convert type number to a fixed length of 3 digits - const typeNumberStr = typeNumber.toString().padStart(3, '0'); - - if (highestKeyObject.nonce) { - // Old format: Use the nonce from secretKeyObject - nonce = base64ToUint8Array(highestKeyObject.nonce); - - // Encrypt the data with the existing nonce and message key - encryptedData = nacl.secretbox(Uint8ArrayData, nonce, messageKey); - encryptedDataBase64 = uint8ArrayToBase64(encryptedData); - - // Concatenate the highest key, type number, and encrypted data (old format) - const highestKeyStr = highestKey.toString().padStart(10, '0'); // Fixed length of 10 digits - finalEncryptedData = btoa(highestKeyStr + encryptedDataBase64); - } else { - // New format: Generate a random nonce and embed it in the message - nonce = new Uint8Array(24); // 24 bytes for the nonce - crypto.getRandomValues(nonce); - - // Encrypt the data with the new nonce and message key - encryptedData = nacl.secretbox(Uint8ArrayData, nonce, messageKey); - encryptedDataBase64 = uint8ArrayToBase64(encryptedData); - - // Convert the nonce to base64 - const nonceBase64 = uint8ArrayToBase64(nonce); - - // Concatenate the highest key, type number, nonce, and encrypted data (new format) - const highestKeyStr = highestKey.toString().padStart(10, '0'); // Fixed length of 10 digits +export function decryptGroupData( + data64EncryptedData: string, + privateKey: string +) { + const allCombined = base64ToUint8Array(data64EncryptedData); + const str = 'qortalGroupEncryptedData'; + const strEncoder = new TextEncoder(); + const strUint8Array = strEncoder.encode(str); + // Extract the nonce + const nonceStartPosition = strUint8Array.length; + const nonceEndPosition = nonceStartPosition + 24; // Nonce is 24 bytes + const nonce = allCombined.slice(nonceStartPosition, nonceEndPosition); + // Extract the shared keyNonce + const keyNonceStartPosition = nonceEndPosition; + const keyNonceEndPosition = keyNonceStartPosition + 24; // Nonce is 24 bytes + const keyNonce = allCombined.slice( + keyNonceStartPosition, + keyNonceEndPosition + ); + // Extract the sender's public key + const senderPublicKeyStartPosition = keyNonceEndPosition; + const senderPublicKeyEndPosition = senderPublicKeyStartPosition + 32; // Public keys are 32 bytes + const senderPublicKey = allCombined.slice( + senderPublicKeyStartPosition, + senderPublicKeyEndPosition + ); + // Calculate count first + const countStartPosition = allCombined.length - 4; // 4 bytes before the end, since count is stored in Uint32 (4 bytes) + const countArray = allCombined.slice( + countStartPosition, + countStartPosition + 4 + ); + const count = new Uint32Array(countArray.buffer)[0]; + // Then use count to calculate encryptedData + const encryptedDataStartPosition = senderPublicKeyEndPosition; // start position of encryptedData + const encryptedDataEndPosition = allCombined.length - (count * (32 + 16) + 4); + const encryptedData = allCombined.slice( + encryptedDataStartPosition, + encryptedDataEndPosition + ); + // Extract the encrypted keys + // 32+16 = 48 + const combinedKeys = allCombined.slice( + encryptedDataEndPosition, + encryptedDataEndPosition + count * 48 + ); + if (!privateKey) { + throw new Error( + i18n.t('question:message.error.retrieve_keys', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + const decodedPrivateKey = Base58.decode(privateKey); + const convertedPrivateKey = ed2curve.convertSecretKey(decodedPrivateKey); + const convertedSenderPublicKey = ed2curve.convertPublicKey(senderPublicKey); + const sharedSecret = new Uint8Array(32); + nacl.lowlevel.crypto_scalarmult( + sharedSecret, + convertedPrivateKey, + convertedSenderPublicKey + ); + for (let i = 0; i < count; i++) { + const encryptedKey = combinedKeys.slice(i * 48, (i + 1) * 48); + // Decrypt the symmetric key. + const decryptedKey = nacl.secretbox.open( + encryptedKey, + keyNonce, + sharedSecret + ); - const highestKeyBytes = new TextEncoder().encode(highestKeyStr.padStart(10, '0')); -const typeNumberBytes = new TextEncoder().encode(typeNumberStr.padStart(3, '0')); - -// Step 3: Concatenate all binary -const combinedBinary = new Uint8Array( - highestKeyBytes.length + typeNumberBytes.length + nonce.length + encryptedData.length -); - // finalEncryptedData = btoa(highestKeyStr) + btoa(typeNumberStr) + nonceBase64 + encryptedDataBase64; - combinedBinary.set(highestKeyBytes, 0); -combinedBinary.set(typeNumberBytes, highestKeyBytes.length); -combinedBinary.set(nonce, highestKeyBytes.length + typeNumberBytes.length); -combinedBinary.set(encryptedData, highestKeyBytes.length + typeNumberBytes.length + nonce.length); - -// Step 4: Base64 encode once - finalEncryptedData = uint8ArrayToBase64(combinedBinary); - } - - return finalEncryptedData; - }; - - -export const decodeBase64ForUIChatMessages = (messages)=> { - - let msgs = [] - for(const msg of messages){ - try { - const decoded = atob(msg?.data); - const parseDecoded =JSON.parse(decodeURIComponent(escape(decoded))) - - msgs.push({ - ...msg, - ...parseDecoded - }) - - } catch (error) { - - } - } - return msgs -} - -export const decryptSingle = async ({ data64, secretKeyObject, skipDecodeBase64 }: any) => { - // First, decode the base64-encoded input (if skipDecodeBase64 is not set) - const decodedData = skipDecodeBase64 ? data64 : atob(data64); - - // Then, decode it again for the specific format (if double encoding is used) - const decodeForNumber = atob(decodedData); - - // Extract the key (assuming it's always the first 10 characters) - const keyStr = decodeForNumber.slice(0, 10); - - // Convert the key string back to a number - const highestKey = parseInt(keyStr, 10); - - // Check if we have a valid secret key for the extracted highestKey - if (!secretKeyObject[highestKey]) { - throw new Error('Cannot find correct secretKey'); - } - - const secretKeyEntry = secretKeyObject[highestKey]; - - let typeNumberStr, nonceBase64, encryptedDataBase64; - - // Determine if typeNumber exists by checking if the next 3 characters after keyStr are digits - const possibleTypeNumberStr = decodeForNumber.slice(10, 13); - const hasTypeNumber = /^\d{3}$/.test(possibleTypeNumberStr); // Check if next 3 characters are digits - - if (secretKeyEntry.nonce) { - // Old format: nonce is present in the secretKeyObject, so no type number exists - nonceBase64 = secretKeyEntry.nonce; - encryptedDataBase64 = decodeForNumber.slice(10); // The remaining part is the encrypted data - } else { - if (hasTypeNumber) { - // const typeNumberStr = new TextDecoder().decode(typeNumberBytes); - if(decodeForNumber.slice(10, 13) !== '001'){ - const decodedBinary = base64ToUint8Array(decodedData); - const highestKeyBytes = decodedBinary.slice(0, 10); // if ASCII digits only - const highestKeyStr = new TextDecoder().decode(highestKeyBytes); - -const nonce = decodedBinary.slice(13, 13 + 24); -const encryptedData = decodedBinary.slice(13 + 24); -const highestKey = parseInt(highestKeyStr, 10); - -const messageKey = base64ToUint8Array(secretKeyObject[+highestKey].messageKey); -const decryptedBytes = nacl.secretbox.open(encryptedData, nonce, messageKey); - - // Check if decryption was successful - if (!decryptedBytes) { - throw new Error("Decryption failed"); - } - - // Convert the decrypted Uint8Array back to a Base64 string - return uint8ArrayToBase64(decryptedBytes); - - } - // New format: Extract type number and nonce - typeNumberStr = possibleTypeNumberStr; // Extract type number - nonceBase64 = decodeForNumber.slice(13, 45); // Extract nonce (next 32 characters after type number) - encryptedDataBase64 = decodeForNumber.slice(45); // The remaining part is the encrypted data - } else { - // Old format without type number (nonce is embedded in the message, first 32 characters after keyStr) - nonceBase64 = decodeForNumber.slice(10, 42); // First 32 characters for the nonce - encryptedDataBase64 = decodeForNumber.slice(42); // The remaining part is the encrypted data - } - } - - // Convert Base64 strings to Uint8Array - const Uint8ArrayData = base64ToUint8Array(encryptedDataBase64); - const nonce = base64ToUint8Array(nonceBase64); - const messageKey = base64ToUint8Array(secretKeyEntry.messageKey); - - if (!(Uint8ArrayData instanceof Uint8Array)) { - throw new Error("The Uint8ArrayData you've submitted is invalid"); - } - - // Decrypt the data using the nonce and messageKey - const decryptedData = nacl.secretbox.open(Uint8ArrayData, nonce, messageKey); - - // Check if decryption was successful - if (!decryptedData) { - throw new Error("Decryption failed"); - } - - // Convert the decrypted Uint8Array back to a Base64 string - return uint8ArrayToBase64(decryptedData); - }; - - - - - export const decryptGroupEncryptionWithSharingKey = async ({ data64EncryptedData, key }: any) => { - - const allCombined = base64ToUint8Array(data64EncryptedData) - const str = "qortalGroupEncryptedData" - const strEncoder = new TextEncoder() - const strUint8Array = strEncoder.encode(str) - // Extract the nonce - const nonceStartPosition = strUint8Array.length - const nonceEndPosition = nonceStartPosition + 24 // Nonce is 24 bytes - const nonce = allCombined.slice(nonceStartPosition, nonceEndPosition) - // Extract the shared keyNonce - const keyNonceStartPosition = nonceEndPosition - const keyNonceEndPosition = keyNonceStartPosition + 24 // Nonce is 24 bytes - const keyNonce = allCombined.slice(keyNonceStartPosition, keyNonceEndPosition) - // Extract the sender's public key - const senderPublicKeyStartPosition = keyNonceEndPosition - const senderPublicKeyEndPosition = senderPublicKeyStartPosition + 32 // Public keys are 32 bytes - - // Calculate count first - const countStartPosition = allCombined.length - 4 // 4 bytes before the end, since count is stored in Uint32 (4 bytes) - const countArray = allCombined.slice(countStartPosition, countStartPosition + 4) - const count = new Uint32Array(countArray.buffer)[0] - // Then use count to calculate encryptedData - const encryptedDataStartPosition = senderPublicKeyEndPosition // start position of encryptedData - const encryptedDataEndPosition = allCombined.length - ((count * (32 + 16)) + 4) - const encryptedData = allCombined.slice(encryptedDataStartPosition, encryptedDataEndPosition) - const symmetricKey = base64ToUint8Array(key); - - // Decrypt the data using the nonce and messageKey - const decryptedData = nacl.secretbox.open(encryptedData, nonce, symmetricKey) - - - // Check if decryption was successful - if (!decryptedData) { - throw new Error("Decryption failed"); - } - // Convert the decrypted Uint8Array back to a Base64 string - return uint8ArrayToBase64(decryptedData); - }; - - - - export function decryptGroupDataQortalRequest(data64EncryptedData, privateKey) { - const allCombined = base64ToUint8Array(data64EncryptedData) - const str = "qortalGroupEncryptedData" - const strEncoder = new TextEncoder() - const strUint8Array = strEncoder.encode(str) - // Extract the nonce - const nonceStartPosition = strUint8Array.length - const nonceEndPosition = nonceStartPosition + 24 // Nonce is 24 bytes - const nonce = allCombined.slice(nonceStartPosition, nonceEndPosition) - // Extract the shared keyNonce - const keyNonceStartPosition = nonceEndPosition - const keyNonceEndPosition = keyNonceStartPosition + 24 // Nonce is 24 bytes - const keyNonce = allCombined.slice(keyNonceStartPosition, keyNonceEndPosition) - // Extract the sender's public key - const senderPublicKeyStartPosition = keyNonceEndPosition - const senderPublicKeyEndPosition = senderPublicKeyStartPosition + 32 // Public keys are 32 bytes - const senderPublicKey = allCombined.slice(senderPublicKeyStartPosition, senderPublicKeyEndPosition) - // Calculate count first - const countStartPosition = allCombined.length - 4 // 4 bytes before the end, since count is stored in Uint32 (4 bytes) - const countArray = allCombined.slice(countStartPosition, countStartPosition + 4) - const count = new Uint32Array(countArray.buffer)[0] - // Then use count to calculate encryptedData - const encryptedDataStartPosition = senderPublicKeyEndPosition // start position of encryptedData - const encryptedDataEndPosition = allCombined.length - ((count * (32 + 16)) + 4) - const encryptedData = allCombined.slice(encryptedDataStartPosition, encryptedDataEndPosition) - // Extract the encrypted keys - // 32+16 = 48 - const combinedKeys = allCombined.slice(encryptedDataEndPosition, encryptedDataEndPosition + (count * 48)) - if (!privateKey) { - throw new Error("Unable to retrieve keys") - } - const decodedPrivateKey = Base58.decode(privateKey) - const convertedPrivateKey = ed2curve.convertSecretKey(decodedPrivateKey) - const convertedSenderPublicKey = ed2curve.convertPublicKey(senderPublicKey) - const sharedSecret = new Uint8Array(32) - nacl.lowlevel.crypto_scalarmult(sharedSecret, convertedPrivateKey, convertedSenderPublicKey) - for (let i = 0; i < count; i++) { - const encryptedKey = combinedKeys.slice(i * 48, (i + 1) * 48) - // Decrypt the symmetric key. - const decryptedKey = nacl.secretbox.open(encryptedKey, keyNonce, sharedSecret) - // If decryption was successful, decryptedKey will not be null. - if (decryptedKey) { - // Decrypt the data using the symmetric key. - const decryptedData = nacl.secretbox.open(encryptedData, nonce, decryptedKey) - // If decryption was successful, decryptedData will not be null. - if (decryptedData) { - return decryptedData - } - } - } - throw new Error("Unable to decrypt data") -} - - -export function decryptGroupData(data64EncryptedData: string, privateKey: string) { - const allCombined = base64ToUint8Array(data64EncryptedData) - const str = "qortalGroupEncryptedData" - const strEncoder = new TextEncoder() - const strUint8Array = strEncoder.encode(str) - // Extract the nonce - const nonceStartPosition = strUint8Array.length - const nonceEndPosition = nonceStartPosition + 24 // Nonce is 24 bytes - const nonce = allCombined.slice(nonceStartPosition, nonceEndPosition) - // Extract the shared keyNonce - const keyNonceStartPosition = nonceEndPosition - const keyNonceEndPosition = keyNonceStartPosition + 24 // Nonce is 24 bytes - const keyNonce = allCombined.slice(keyNonceStartPosition, keyNonceEndPosition) - // Extract the sender's public key - const senderPublicKeyStartPosition = keyNonceEndPosition - const senderPublicKeyEndPosition = senderPublicKeyStartPosition + 32 // Public keys are 32 bytes - const senderPublicKey = allCombined.slice(senderPublicKeyStartPosition, senderPublicKeyEndPosition) - // Calculate count first - const countStartPosition = allCombined.length - 4 // 4 bytes before the end, since count is stored in Uint32 (4 bytes) - const countArray = allCombined.slice(countStartPosition, countStartPosition + 4) - const count = new Uint32Array(countArray.buffer)[0] - // Then use count to calculate encryptedData - const encryptedDataStartPosition = senderPublicKeyEndPosition // start position of encryptedData - const encryptedDataEndPosition = allCombined.length - ((count * (32 + 16)) + 4) - const encryptedData = allCombined.slice(encryptedDataStartPosition, encryptedDataEndPosition) - // Extract the encrypted keys - // 32+16 = 48 - const combinedKeys = allCombined.slice(encryptedDataEndPosition, encryptedDataEndPosition + (count * 48)) - if (!privateKey) { - throw new Error("Unable to retrieve keys") - } - const decodedPrivateKey = Base58.decode(privateKey) - const convertedPrivateKey = ed2curve.convertSecretKey(decodedPrivateKey) - const convertedSenderPublicKey = ed2curve.convertPublicKey(senderPublicKey) - const sharedSecret = new Uint8Array(32) - nacl.lowlevel.crypto_scalarmult(sharedSecret, convertedPrivateKey, convertedSenderPublicKey) - for (let i = 0; i < count; i++) { - const encryptedKey = combinedKeys.slice(i * 48, (i + 1) * 48) - // Decrypt the symmetric key. - const decryptedKey = nacl.secretbox.open(encryptedKey, keyNonce, sharedSecret) - - // If decryption was successful, decryptedKey will not be null. - if (decryptedKey) { - // Decrypt the data using the symmetric key. - const decryptedData = nacl.secretbox.open(encryptedData, nonce, decryptedKey) - // If decryption was successful, decryptedData will not be null. - if (decryptedData) { - return {decryptedData, count} - } - } - } - throw new Error("Unable to decrypt data") + // If decryption was successful, decryptedKey will not be null. + if (decryptedKey) { + // Decrypt the data using the symmetric key. + const decryptedData = nacl.secretbox.open( + encryptedData, + nonce, + decryptedKey + ); + // If decryption was successful, decryptedData will not be null. + if (decryptedData) { + return { decryptedData, count }; + } + } + } + throw new Error( + i18n.t('question:message.error.decrypt', { + postProcess: 'capitalizeFirstChar', + }) + ); } export function uint8ArrayStartsWith(uint8Array, string) { - const stringEncoder = new TextEncoder() - const stringUint8Array = stringEncoder.encode(string) - if (uint8Array.length < stringUint8Array.length) { - return false - } - for (let i = 0; i < stringUint8Array.length; i++) { - if (uint8Array[i] !== stringUint8Array[i]) { - return false - } - } - return true + const stringEncoder = new TextEncoder(); + const stringUint8Array = stringEncoder.encode(string); + if (uint8Array.length < stringUint8Array.length) { + return false; + } + for (let i = 0; i < stringUint8Array.length; i++) { + if (uint8Array[i] !== stringUint8Array[i]) { + return false; + } + } + return true; } export function decryptDeprecatedSingle(uint8Array, publicKey, privateKey) { - const combinedData = uint8Array - const str = "qortalEncryptedData" - const strEncoder = new TextEncoder() - const strUint8Array = strEncoder.encode(str) - const strData = combinedData.slice(0, strUint8Array.length) - const nonce = combinedData.slice(strUint8Array.length, strUint8Array.length + 24) - const _encryptedData = combinedData.slice(strUint8Array.length + 24) - - const _publicKey = window.parent.Base58.decode(publicKey) - if (!privateKey || !_publicKey) { - throw new Error("Unable to retrieve keys") - } - const convertedPrivateKey = ed2curve.convertSecretKey(privateKey) - const convertedPublicKey = ed2curve.convertPublicKey(_publicKey) - const sharedSecret = new Uint8Array(32) - nacl.lowlevel.crypto_scalarmult(sharedSecret, convertedPrivateKey, convertedPublicKey) - const _chatEncryptionSeed = new window.parent.Sha256().process(sharedSecret).finish().result - const _decryptedData = nacl.secretbox.open(_encryptedData, nonce, _chatEncryptionSeed) - if (!_decryptedData) { - throw new Error("Unable to decrypt") - } - return uint8ArrayToBase64(_decryptedData) -} \ No newline at end of file + const combinedData = uint8Array; + const str = 'qortalEncryptedData'; + const strEncoder = new TextEncoder(); + const strUint8Array = strEncoder.encode(str); + const nonce = combinedData.slice( + strUint8Array.length, + strUint8Array.length + 24 + ); + const _encryptedData = combinedData.slice(strUint8Array.length + 24); + + const _publicKey = window.parent.Base58.decode(publicKey); + if (!privateKey || !_publicKey) { + throw new Error( + i18n.t('question:message.error.retrieve_keys', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + const convertedPrivateKey = ed2curve.convertSecretKey(privateKey); + const convertedPublicKey = ed2curve.convertPublicKey(_publicKey); + const sharedSecret = new Uint8Array(32); + nacl.lowlevel.crypto_scalarmult( + sharedSecret, + convertedPrivateKey, + convertedPublicKey + ); + const _chatEncryptionSeed = new window.parent.Sha256() + .process(sharedSecret) + .finish().result; + const _decryptedData = nacl.secretbox.open( + _encryptedData, + nonce, + _chatEncryptionSeed + ); + if (!_decryptedData) { + throw new Error( + i18n.t('question:message.error.decrypt', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + return uint8ArrayToBase64(_decryptedData); +} diff --git a/src/qdn/publish/pubish.ts b/src/qdn/publish/pubish.ts deleted file mode 100644 index 08c4d15..0000000 --- a/src/qdn/publish/pubish.ts +++ /dev/null @@ -1,266 +0,0 @@ -// @ts-nocheck - -import { Buffer } from "buffer" -import Base58 from "../../deps/Base58" -import nacl from "../../deps/nacl-fast" -import utils from "../../utils/utils" -import { createEndpoint, getBaseApi } from "../../background"; -import { getData } from "../../utils/chromeStorage"; - -export async function reusableGet(endpoint){ - const validApi = await getBaseApi(); - - const response = await fetch(validApi + endpoint); - const data = await response.json(); - return data - } - - async function reusablePost(endpoint, _body){ - // const validApi = await findUsableApi(); - const url = await createEndpoint(endpoint) - const response = await fetch(url, { - method: 'POST', - headers: { - 'Content-Type': 'application/json' - }, - body: _body - }); - let data - try { - data = await response.clone().json() - } catch (e) { - data = await response.text() - } - return data - } - -async function getKeyPair() { - const res = await getData("keyPair").catch(() => null); - if (res) { - return res - } else { - throw new Error("Wallet not authenticated"); - } - } - -export const publishData = async ({ - registeredName, - file, - service, - identifier, - uploadType, - isBase64, - filename, - withFee, - title, - description, - category, - tag1, - tag2, - tag3, - tag4, - tag5, - feeAmount -}: any) => { - - const validateName = async (receiverName: string) => { - return await reusableGet(`/names/${receiverName}`) - } - - const convertBytesForSigning = async (transactionBytesBase58: string) => { - return await reusablePost('/transactions/convert', transactionBytesBase58) - } - - const getArbitraryFee = async () => { - const timestamp = Date.now() - - let fee = await reusableGet(`/transactions/unitfee?txType=ARBITRARY×tamp=${timestamp}`) - - return { - timestamp, - fee: Number(fee), - feeToShow: (Number(fee) / 1e8).toFixed(8) - } - } - - const signArbitraryWithFee = (arbitraryBytesBase58, arbitraryBytesForSigningBase58, keyPair) => { - if (!arbitraryBytesBase58) { - throw new Error('ArbitraryBytesBase58 not defined') - } - - if (!keyPair) { - throw new Error('keyPair not defined') - } - - const arbitraryBytes = Base58.decode(arbitraryBytesBase58) - const _arbitraryBytesBuffer = Object.keys(arbitraryBytes).map(function (key) { return arbitraryBytes[key]; }) - const arbitraryBytesBuffer = new Uint8Array(_arbitraryBytesBuffer) - const arbitraryBytesForSigning = Base58.decode(arbitraryBytesForSigningBase58) - const _arbitraryBytesForSigningBuffer = Object.keys(arbitraryBytesForSigning).map(function (key) { return arbitraryBytesForSigning[key]; }) - const arbitraryBytesForSigningBuffer = new Uint8Array(_arbitraryBytesForSigningBuffer) - const signature = nacl.sign.detached(arbitraryBytesForSigningBuffer, keyPair.privateKey) - - return utils.appendBuffer(arbitraryBytesBuffer, signature) - } - - const processTransactionVersion2 = async (bytes) => { - - return await reusablePost('/transactions/process?apiVersion=2', Base58.encode(bytes)) - } - - const signAndProcessWithFee = async (transactionBytesBase58: string) => { - let convertedBytesBase58 = await convertBytesForSigning( - transactionBytesBase58 - ) - - - if (convertedBytesBase58.error) { - throw new Error('Error when signing') - } - - - const resKeyPair = await getKeyPair() - const parsedData = resKeyPair - const uint8PrivateKey = Base58.decode(parsedData.privateKey); - const uint8PublicKey = Base58.decode(parsedData.publicKey); - const keyPair = { - privateKey: uint8PrivateKey, - publicKey: uint8PublicKey - }; - - let signedArbitraryBytes = signArbitraryWithFee(transactionBytesBase58, convertedBytesBase58, keyPair) - const response = await processTransactionVersion2(signedArbitraryBytes) - - let myResponse = { error: '' } - - if (response === false) { - throw new Error('Error when signing') - } else { - myResponse = response - } - - return myResponse - } - - const validate = async () => { - let validNameRes = await validateName(registeredName) - - if (validNameRes.error) { - throw new Error('Name not found') - } - - let fee = null - - if (withFee && feeAmount) { - fee = feeAmount - } else if (withFee) { - const res = await getArbitraryFee() - if (res.fee) { - fee = res.fee - } else { - throw new Error('unable to get fee') - } - } - - let transactionBytes = await uploadData(registeredName, file, fee) - if (!transactionBytes || transactionBytes.error) { - throw new Error(transactionBytes?.message || 'Error when uploading') - } else if (transactionBytes.includes('Error 500 Internal Server Error')) { - throw new Error('Error when uploading') - } - - let signAndProcessRes - - if (withFee) { - signAndProcessRes = await signAndProcessWithFee(transactionBytes) - } - - if (signAndProcessRes?.error) { - throw new Error('Error when signing') - } - - return signAndProcessRes - } - - const uploadData = async (registeredName: string, file:any, fee: number) => { - - let postBody = '' - let urlSuffix = '' - - if (file != null) { - // If we're sending zipped data, make sure to use the /zip version of the POST /arbitrary/* API - if (uploadType === 'zip') { - urlSuffix = '/zip' - } - - // If we're sending file data, use the /base64 version of the POST /arbitrary/* API - else if (uploadType === 'file') { - urlSuffix = '/base64' - } - - // Base64 encode the file to work around compatibility issues between javascript and java byte arrays - if (isBase64) { - postBody = file - } - - if (!isBase64) { - let fileBuffer = new Uint8Array(await file.arrayBuffer()) - postBody = Buffer.from(fileBuffer).toString("base64") - } - - } - - let uploadDataUrl = `/arbitrary/${service}/${registeredName}${urlSuffix}` - if (identifier?.trim().length > 0) { - uploadDataUrl = `/arbitrary/${service}/${registeredName}/${identifier}${urlSuffix}` - } - - uploadDataUrl = uploadDataUrl + `?fee=${fee}` - - - if (filename != null && filename != 'undefined') { - uploadDataUrl = uploadDataUrl + '&filename=' + encodeURIComponent(filename) - } - - if (title != null && title != 'undefined') { - uploadDataUrl = uploadDataUrl + '&title=' + encodeURIComponent(title) - } - - if (description != null && description != 'undefined') { - uploadDataUrl = uploadDataUrl + '&description=' + encodeURIComponent(description) - } - - if (category != null && category != 'undefined') { - uploadDataUrl = uploadDataUrl + '&category=' + encodeURIComponent(category) - } - - if (tag1 != null && tag1 != 'undefined') { - uploadDataUrl = uploadDataUrl + '&tags=' + encodeURIComponent(tag1) - } - - if (tag2 != null && tag2 != 'undefined') { - uploadDataUrl = uploadDataUrl + '&tags=' + encodeURIComponent(tag2) - } - - if (tag3 != null && tag3 != 'undefined') { - uploadDataUrl = uploadDataUrl + '&tags=' + encodeURIComponent(tag3) - } - - if (tag4 != null && tag4 != 'undefined') { - uploadDataUrl = uploadDataUrl + '&tags=' + encodeURIComponent(tag4) - } - - if (tag5 != null && tag5 != 'undefined') { - uploadDataUrl = uploadDataUrl + '&tags=' + encodeURIComponent(tag5) - } - - return await reusablePost(uploadDataUrl, postBody) - - } - - try { - return await validate() - } catch (error: any) { - throw new Error(error?.message) - } -} \ No newline at end of file diff --git a/src/qdn/publish/publish.ts b/src/qdn/publish/publish.ts new file mode 100644 index 0000000..31b6d65 --- /dev/null +++ b/src/qdn/publish/publish.ts @@ -0,0 +1,474 @@ +// @ts-nocheck + +import { Buffer } from 'buffer'; +import Base58 from '../../encryption/Base58'; +import nacl from '../../encryption/nacl-fast'; +import utils from '../../utils/utils'; +import { createEndpoint, getBaseApi } from '../../background/background'; +import { getData } from '../../utils/chromeStorage'; +import { executeEvent } from '../../utils/events'; + +export async function reusableGet(endpoint) { + const validApi = await getBaseApi(); + + const response = await fetch(validApi + endpoint); + const data = await response.json(); + return data; +} + +async function reusablePost(endpoint, _body) { + // const validApi = await findUsableApi(); + const url = await createEndpoint(endpoint); + const response = await fetch(url, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: _body, + }); + if (!response.ok) { + const errorText = await response.text(); + throw new Error(errorText); + } + let data; + try { + data = await response.clone().json(); + } catch (e) { + data = await response.text(); + } + return data; +} + +async function reusablePostStream(endpoint, _body) { + const url = await createEndpoint(endpoint); + + const headers = {}; + + const response = await fetch(url, { + method: 'POST', + headers, + body: _body, + }); + + return response; // return the actual response so calling code can use response.ok +} + +async function uploadChunkWithRetry(endpoint, formData, index, maxRetries = 3) { + let attempt = 0; + while (attempt < maxRetries) { + try { + const response = await reusablePostStream(endpoint, formData); + if (!response.ok) { + const errorText = await response.text(); + throw new Error(errorText); + } + return; // Success + } catch (err) { + attempt++; + console.warn( + `Chunk ${index} failed (attempt ${attempt}): ${err.message}` + ); + if (attempt >= maxRetries) { + throw new Error(`Chunk ${index} failed after ${maxRetries} attempts`); + } + // Wait 25 seconds before next retry + await new Promise((res) => setTimeout(res, 25_000)); + } + } +} + +async function resuablePostRetry( + endpoint, + body, + maxRetries = 3, + appInfo, + resourceInfo +) { + let attempt = 0; + while (attempt < maxRetries) { + try { + const response = await reusablePost(endpoint, body); + + return response; + } catch (err) { + attempt++; + if (attempt >= maxRetries) { + throw new Error( + err instanceof Error + ? err?.message || `Failed to make request` + : `Failed to make request` + ); + } + if (appInfo?.tabId && resourceInfo) { + executeEvent('receiveChunks', { + tabId: appInfo.tabId, + publishLocation: { + name: resourceInfo?.name, + identifier: resourceInfo?.identifier, + service: resourceInfo?.service, + }, + retry: true, + }); + } + // Wait 10 seconds before next retry + await new Promise((res) => setTimeout(res, 25_000)); + } + } +} + +async function getKeyPair() { + const res = await getData('keyPair').catch(() => null); + if (res) { + return res; + } else { + throw new Error('Wallet not authenticated'); + } +} + +export const publishData = async ({ + category, + data, + description, + feeAmount, + filename, + identifier, + registeredName, + service, + tag1, + tag2, + tag3, + tag4, + tag5, + title, + uploadType, + withFee, + appInfo, +}: any) => { + const validateName = async (receiverName: string) => { + return await reusableGet(`/names/${receiverName}`); + }; + + const convertBytesForSigning = async (transactionBytesBase58: string) => { + return await resuablePostRetry( + '/transactions/convert', + transactionBytesBase58, + 3, + appInfo, + { identifier, name: registeredName, service } + ); + }; + + const getArbitraryFee = async () => { + const timestamp = Date.now(); + + let fee = await reusableGet( + `/transactions/unitfee?txType=ARBITRARY×tamp=${timestamp}` + ); + + return { + timestamp, + fee: Number(fee), + feeToShow: (Number(fee) / 1e8).toFixed(8), + }; + }; + + const signArbitraryWithFee = ( + arbitraryBytesBase58, + arbitraryBytesForSigningBase58, + keyPair + ) => { + if (!arbitraryBytesBase58) { + throw new Error('ArbitraryBytesBase58 not defined'); // TODO translate + } + + if (!keyPair) { + throw new Error('keyPair not defined'); + } + + const arbitraryBytes = Base58.decode(arbitraryBytesBase58); + const _arbitraryBytesBuffer = Object.keys(arbitraryBytes).map( + function (key) { + return arbitraryBytes[key]; + } + ); + const arbitraryBytesBuffer = new Uint8Array(_arbitraryBytesBuffer); + const arbitraryBytesForSigning = Base58.decode( + arbitraryBytesForSigningBase58 + ); + const _arbitraryBytesForSigningBuffer = Object.keys( + arbitraryBytesForSigning + ).map(function (key) { + return arbitraryBytesForSigning[key]; + }); + const arbitraryBytesForSigningBuffer = new Uint8Array( + _arbitraryBytesForSigningBuffer + ); + const signature = nacl.sign.detached( + arbitraryBytesForSigningBuffer, + keyPair.privateKey + ); + + return utils.appendBuffer(arbitraryBytesBuffer, signature); + }; + + const processTransactionVersion2 = async (bytes) => { + return await resuablePostRetry( + '/transactions/process?apiVersion=2', + Base58.encode(bytes), + 3, + appInfo, + { identifier, name: registeredName, service } + ); + }; + + const signAndProcessWithFee = async (transactionBytesBase58: string) => { + let convertedBytesBase58 = await convertBytesForSigning( + transactionBytesBase58 + ); + + if (convertedBytesBase58.error) { + throw new Error('Error when signing'); + } + + const resKeyPair = await getKeyPair(); + const parsedData = resKeyPair; + const uint8PrivateKey = Base58.decode(parsedData.privateKey); + const uint8PublicKey = Base58.decode(parsedData.publicKey); + const keyPair = { + privateKey: uint8PrivateKey, + publicKey: uint8PublicKey, + }; + + let signedArbitraryBytes = signArbitraryWithFee( + transactionBytesBase58, + convertedBytesBase58, + keyPair + ); + const response = await processTransactionVersion2(signedArbitraryBytes); + + let myResponse = { error: '' }; + + if (response === false) { + throw new Error('Error when signing'); + } else { + myResponse = response; + } + + return myResponse; + }; + + const validate = async () => { + let validNameRes = await validateName(registeredName); + + if (validNameRes.error) { + throw new Error('Name not found'); + } + + let fee = null; + + if (withFee && feeAmount) { + fee = feeAmount; + } else if (withFee) { + const res = await getArbitraryFee(); + if (res.fee) { + fee = res.fee; + } else { + throw new Error('unable to get fee'); + } + } + + let transactionBytes = await uploadData(registeredName, data, fee); + if (!transactionBytes || transactionBytes.error) { + throw new Error(transactionBytes?.message || 'Error when uploading'); + } else if (transactionBytes.includes('Error 500 Internal Server Error')) { + throw new Error('Error when uploading'); + } + + let signAndProcessRes; + + if (withFee) { + signAndProcessRes = await signAndProcessWithFee(transactionBytes); + } + + if (signAndProcessRes?.error) { + throw new Error('Error when signing'); + } + if (appInfo?.tabId) { + executeEvent('receiveChunks', { + tabId: appInfo.tabId, + publishLocation: { + name: registeredName, + identifier, + service, + }, + processed: true, + }); + } + return signAndProcessRes; + }; + + const uploadData = async (registeredName: string, data: any, fee: number) => { + let postBody = ''; + let urlSuffix = ''; + + if (data != null) { + if (uploadType === 'base64') { + urlSuffix = '/base64'; + } + + if (uploadType === 'base64') { + postBody = data; + } + } else { + throw new Error('No data provided'); + } + + let uploadDataUrl = `/arbitrary/${service}/${registeredName}`; + let paramQueries = ''; + if (identifier?.trim().length > 0) { + uploadDataUrl = `/arbitrary/${service}/${registeredName}/${identifier}`; + } + + paramQueries = paramQueries + `?fee=${fee}`; + + if (filename != null && filename != 'undefined') { + paramQueries = paramQueries + '&filename=' + encodeURIComponent(filename); + } + + if (title != null && title != 'undefined') { + paramQueries = paramQueries + '&title=' + encodeURIComponent(title); + } + + if (description != null && description != 'undefined') { + paramQueries = + paramQueries + '&description=' + encodeURIComponent(description); + } + + if (category != null && category != 'undefined') { + paramQueries = paramQueries + '&category=' + encodeURIComponent(category); + } + + if (tag1 != null && tag1 != 'undefined') { + paramQueries = paramQueries + '&tags=' + encodeURIComponent(tag1); + } + + if (tag2 != null && tag2 != 'undefined') { + paramQueries = paramQueries + '&tags=' + encodeURIComponent(tag2); + } + + if (tag3 != null && tag3 != 'undefined') { + paramQueries = paramQueries + '&tags=' + encodeURIComponent(tag3); + } + + if (tag4 != null && tag4 != 'undefined') { + paramQueries = paramQueries + '&tags=' + encodeURIComponent(tag4); + } + + if (tag5 != null && tag5 != 'undefined') { + paramQueries = paramQueries + '&tags=' + encodeURIComponent(tag5); + } + if (uploadType === 'zip') { + paramQueries = paramQueries + '&isZip=' + true; + } + + if (uploadType === 'base64') { + if (urlSuffix) { + uploadDataUrl = uploadDataUrl + urlSuffix; + } + uploadDataUrl = uploadDataUrl + paramQueries; + if (appInfo?.tabId) { + executeEvent('receiveChunks', { + tabId: appInfo.tabId, + publishLocation: { + name: registeredName, + identifier, + service, + }, + chunksSubmitted: 1, + totalChunks: 1, + processed: false, + filename: filename || title || `${service}-${identifier || ''}`, + }); + } + return await resuablePostRetry(uploadDataUrl, postBody, 3, appInfo, { + identifier, + name: registeredName, + service, + }); + } + + const file = data; + const urlCheck = `/arbitrary/check/tmp?totalSize=${file.size}`; + + const checkEndpoint = await createEndpoint(urlCheck); + const checkRes = await fetch(checkEndpoint); + if (!checkRes.ok) { + throw new Error('Not enough space on your hard drive'); + } + + const chunkUrl = uploadDataUrl + `/chunk`; + const chunkSize = 5 * 1024 * 1024; // 5MB + + const totalChunks = Math.ceil(file.size / chunkSize); + if (appInfo?.tabId) { + executeEvent('receiveChunks', { + tabId: appInfo.tabId, + publishLocation: { + name: registeredName, + identifier, + service, + }, + chunksSubmitted: 0, + totalChunks, + processed: false, + filename: + file?.name || filename || title || `${service}-${identifier || ''}`, + }); + } + for (let index = 0; index < totalChunks; index++) { + const start = index * chunkSize; + const end = Math.min(start + chunkSize, file.size); + const chunk = file.slice(start, end); + + const formData = new FormData(); + formData.append('chunk', chunk, file.name); // Optional: include filename + formData.append('index', index); + + await uploadChunkWithRetry(chunkUrl, formData, index); + if (appInfo?.tabId) { + executeEvent('receiveChunks', { + tabId: appInfo.tabId, + publishLocation: { + name: registeredName, + identifier, + service, + }, + chunksSubmitted: index + 1, + totalChunks, + }); + } + } + const finalizeUrl = uploadDataUrl + `/finalize` + paramQueries; + + const finalizeEndpoint = await createEndpoint(finalizeUrl); + + const response = await fetch(finalizeEndpoint, { + method: 'POST', + headers: {}, + }); + + if (!response?.ok) { + const errorText = await response.text(); + throw new Error(`Finalize failed: ${errorText}`); + } + + const result = await response.text(); // Base58-encoded unsigned transaction + return result; + }; + + try { + return await validate(); + } catch (error: any) { + throw new Error(error?.message); + } +}; diff --git a/src/qortal/get.ts b/src/qortal/get.ts new file mode 100644 index 0000000..52e50dc --- /dev/null +++ b/src/qortal/get.ts @@ -0,0 +1,7155 @@ +import { Sha256 } from 'asmcrypto.js'; +import { + createEndpoint, + getBalanceInfo, + getFee, + getKeyPair, + getLastRef, + getSaveWallet, + processTransactionVersion2, + signChatFunc, + joinGroup as joinGroupFunc, + sendQortFee, + sendCoin as sendCoinFunc, + createBuyOrderTx, + performPowTask, + parseErrorResponse, + groupSecretkeys, + registerName, + updateName, + leaveGroup, + inviteToGroup, + getNameInfoForOthers, + kickFromGroup, + banFromGroup, + cancelBan, + makeAdmin, + removeAdmin, + cancelInvitationToGroup, + createGroup, + updateGroup, + sellName, + cancelSellName, + buyName, + getBaseApi, + getAssetBalanceInfo, + getNameOrAddress, + getAssetInfo, + getPublicKey, + transferAsset, +} from '../background/background.ts'; +import { + getAllUserNames, + getNameInfo, + uint8ArrayToObject, +} from '../encryption/encryption.ts'; +import { showSaveFilePicker } from '../hooks/useQortalMessageListener.tsx'; +import { getPublishesFromAdminsAdminSpace } from '../components/Chat/AdminSpaceInner.tsx'; +import { extractComponents } from '../components/Chat/MessageDisplay.tsx'; +import { + decryptResource, + getGroupAdmins, + getPublishesFromAdmins, + validateSecretKey, +} from '../components/Group/Group.tsx'; +import { + MAX_SIZE_PUBLIC_NODE, + MAX_SIZE_PUBLISH, + QORT_DECIMALS, +} from '../constants/constants.ts'; +import Base58 from '../encryption/Base58.ts'; +import ed2curve from '../encryption/ed2curve.ts'; +import nacl from '../encryption/nacl-fast.ts'; +import { + base64ToUint8Array, + createSymmetricKeyAndNonce, + decryptDeprecatedSingle, + decryptGroupDataQortalRequest, + decryptGroupEncryptionWithSharingKey, + decryptSingle, + encryptDataGroup, + encryptSingle, + objectToBase64, + uint8ArrayStartsWith, + uint8ArrayToBase64, +} from '../qdn/encryption/group-encryption.ts'; +import { publishData } from '../qdn/publish/publish.ts'; +import { + getPermission, + isRunningGateway, + setPermission, +} from './qortal-requests.ts'; +import TradeBotCreateRequest from '../transactions/TradeBotCreateRequest.ts'; +import DeleteTradeOffer from '../transactions/TradeBotDeleteRequest.ts'; +import signTradeBotTransaction from '../transactions/signTradeBotTransaction.ts'; +import { createTransaction } from '../transactions/transactions.ts'; +import { executeEvent } from '../utils/events.ts'; +import { fileToBase64 } from '../utils/fileReading/index.ts'; +import { mimeToExtensionMap } from '../utils/memeTypes.ts'; +import { RequestQueueWithPromise } from '../utils/queue/queue.ts'; +import utils from '../utils/utils.ts'; +import ShortUniqueId from 'short-unique-id'; +import { isValidBase64WithDecode } from '../utils/decode.ts'; +import i18n from 'i18next'; + +const uid = new ShortUniqueId({ length: 6 }); + +export const requestQueueGetAtAddresses = new RequestQueueWithPromise(10); + +const sellerForeignFee = { + LITECOIN: { + value: '~0.00005', + ticker: 'LTC', + }, + DOGECOIN: { + value: '~0.005', + ticker: 'DOGE', + }, + BITCOIN: { + value: '~0.0001', + ticker: 'BTC', + }, + DIGIBYTE: { + value: '~0.0005', + ticker: 'DGB', + }, + RAVENCOIN: { + value: '~0.006', + ticker: 'RVN', + }, + PIRATECHAIN: { + value: '~0.0002', + ticker: 'ARRR', + }, +}; + +const btcFeePerByte = 0.000001; +const ltcFeePerByte = 0.0000003; +const dogeFeePerByte = 0.00001; +const dgbFeePerByte = 0.0000001; +const rvnFeePerByte = 0.00001125; + +const MAX_RETRIES = 3; // Set max number of retries + +export async function retryTransaction( + fn, + args, + throwError, + retries = MAX_RETRIES +) { + let attempt = 0; + while (attempt < retries) { + try { + return await fn(...args); + } catch (error) { + console.error(`Attempt ${attempt + 1} failed: ${error.message}`); + attempt++; + if (attempt === retries) { + console.error( + i18n.t('question:message.generic.max_retry_transaction', { + postProcess: 'capitalizeFirstChar', + }) + ); + if (throwError) { + throw new Error( + error?.message || + i18n.t('question:message.error.process_transaction', { + postProcess: 'capitalizeFirstChar', + }) + ); + } else { + throw new Error( + error?.message || + i18n.t('question:message.error.process_transaction', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + } + await new Promise((res) => setTimeout(res, 10000)); + } + } +} + +function roundUpToDecimals(number, decimals = 8) { + const factor = Math.pow(10, decimals); // Create a factor based on the number of decimals + return Math.ceil(+number * factor) / factor; +} + +export const _createPoll = async ( + { pollName, pollDescription, options }, + isFromExtension, + skipPermission +) => { + const fee = await getFee('CREATE_POLL'); + let resPermission = {}; + if (!skipPermission) { + resPermission = await getUserPermission( + { + text1: i18n.t('question:request_create_poll', { + postProcess: 'capitalizeFirstChar', + }), + text2: i18n.t('question:poll', { + name: pollName, + postProcess: 'capitalizeFirstChar', + }), + text3: i18n.t('question:description', { + description: pollDescription, + postProcess: 'capitalizeFirstChar', + }), + text4: i18n.t('question:options', { + optionList: options?.join(', '), + postProcess: 'capitalizeFirstChar', + }), + fee: fee.fee, + }, + isFromExtension + ); + } + + const { accepted = false } = resPermission; + + if (accepted || skipPermission) { + const wallet = await getSaveWallet(); + const address = wallet.address0; + const resKeyPair = await getKeyPair(); + const parsedData = resKeyPair; + const uint8PrivateKey = Base58.decode(parsedData.privateKey); + const uint8PublicKey = Base58.decode(parsedData.publicKey); + const keyPair = { + privateKey: uint8PrivateKey, + publicKey: uint8PublicKey, + }; + let lastRef = await getLastRef(); + + const tx = await createTransaction(8, keyPair, { + fee: fee.fee, + ownerAddress: address, + rPollName: pollName, + rPollDesc: pollDescription, + rOptions: options, + lastReference: lastRef, + }); + const signedBytes = Base58.encode(tx.signedBytes); + const res = await processTransactionVersion2(signedBytes); + if (!res?.signature) + throw new Error( + res?.message || + i18n.t('question:message.error.process_transaction', { + postProcess: 'capitalizeFirstChar', + }) + ); + return res; + } else { + throw new Error( + i18n.t('question:message.generic.user_declined_request', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +const _deployAt = async ( + { name, description, tags, creationBytes, amount, assetId, atType }, + isFromExtension +) => { + const fee = await getFee('DEPLOY_AT'); + + const resPermission = await getUserPermission( + { + text1: i18n.t('question:deploy_at', { + postProcess: 'capitalizeFirstChar', + }), + text2: i18n.t('question:name', { + name: name, + postProcess: 'capitalizeFirstChar', + }), + text3: i18n.t('question:description', { + description: description, + postProcess: 'capitalizeFirstChar', + }), + fee: fee.fee, + }, + isFromExtension + ); + + const { accepted } = resPermission; + + if (accepted) { + const wallet = await getSaveWallet(); + const address = wallet.address0; + const lastReference = await getLastRef(); + const resKeyPair = await getKeyPair(); + const parsedData = resKeyPair; + const uint8PrivateKey = Base58.decode(parsedData.privateKey); + const uint8PublicKey = Base58.decode(parsedData.publicKey); + const keyPair = { + privateKey: uint8PrivateKey, + publicKey: uint8PublicKey, + }; + + const tx = await createTransaction(16, keyPair, { + fee: fee.fee, + rName: name, + rDescription: description, + rTags: tags, + rAmount: amount, + rAssetId: assetId, + rCreationBytes: creationBytes, + atType: atType, + lastReference: lastReference, + }); + + const signedBytes = Base58.encode(tx.signedBytes); + + const res = await processTransactionVersion2(signedBytes); + if (!res?.signature) + throw new Error( + res?.message || + i18n.t('question:message.error.process_transaction', { + postProcess: 'capitalizeFirstChar', + }) + ); + return res; + } else { + throw new Error( + i18n.t('question:message.generic.user_declined_request', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const _voteOnPoll = async ( + { pollName, optionIndex, optionName }, + isFromExtension, + skipPermission +) => { + const fee = await getFee('VOTE_ON_POLL'); + let resPermission = {}; + + if (!skipPermission) { + resPermission = await getUserPermission( + { + text1: i18n.t('question:request_vote_poll', { + postProcess: 'capitalizeFirstChar', + }), + text2: i18n.t('question:poll', { + name: pollName, + postProcess: 'capitalizeFirstChar', + }), + text3: i18n.t('question:option', { + option: optionName, + postProcess: 'capitalizeFirstChar', + }), + fee: fee.fee, + }, + isFromExtension + ); + } + + const { accepted = false } = resPermission; + + if (accepted || skipPermission) { + const wallet = await getSaveWallet(); + const address = wallet.address0; + const resKeyPair = await getKeyPair(); + const parsedData = resKeyPair; + const uint8PrivateKey = Base58.decode(parsedData.privateKey); + const uint8PublicKey = Base58.decode(parsedData.publicKey); + const keyPair = { + privateKey: uint8PrivateKey, + publicKey: uint8PublicKey, + }; + let lastRef = await getLastRef(); + + const tx = await createTransaction(9, keyPair, { + fee: fee.fee, + voterAddress: address, + rPollName: pollName, + rOptionIndex: optionIndex, + lastReference: lastRef, + }); + const signedBytes = Base58.encode(tx.signedBytes); + const res = await processTransactionVersion2(signedBytes); + if (!res?.signature) + throw new Error( + res?.message || + i18n.t('question:message.error.process_transaction', { + postProcess: 'capitalizeFirstChar', + }) + ); + return res; + } else { + throw new Error( + i18n.t('question:message.generic.user_declined_request', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +// Map to store resolvers and rejectors by requestId +const fileRequestResolvers = new Map(); + +const handleFileMessage = (event) => { + const { action, requestId, result, error } = event.data; + + if ( + action === 'getFileFromIndexedDBResponse' && + fileRequestResolvers.has(requestId) + ) { + const { resolve, reject } = fileRequestResolvers.get(requestId); + fileRequestResolvers.delete(requestId); // Clean up after resolving + + if (result) { + resolve(result); + } else { + reject( + error || + i18n.t('question:message.error.retrieve_file', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + } +}; + +window.addEventListener('message', handleFileMessage); + +function getFileFromContentScript(fileId) { + return new Promise((resolve, reject) => { + const requestId = `getFile_${fileId}_${Date.now()}`; + + fileRequestResolvers.set(requestId, { resolve, reject }); // Store resolvers by requestId + const targetOrigin = window.location.origin; + + // Send the request message + window.postMessage( + { action: 'getFileFromIndexedDB', fileId, requestId }, + targetOrigin + ); + + // Timeout to handle no response scenario + setTimeout(() => { + if (fileRequestResolvers.has(requestId)) { + fileRequestResolvers.get(requestId).reject( + i18n.t('question:message.error.timeout_request', { + postProcess: 'capitalizeFirstChar', + }) + ); + fileRequestResolvers.delete(requestId); // Clean up on timeout + } + }, 10000); // 10-second timeout + }); +} + +const responseResolvers = new Map(); + +const handleMessage = (event) => { + const { action, requestId, result } = event.data; + + // Check if this is the expected response action and if we have a stored resolver + if ( + action === 'QORTAL_REQUEST_PERMISSION_RESPONSE' && + responseResolvers.has(requestId) + ) { + // Resolve the stored promise with the result + responseResolvers.get(requestId)(result || false); + responseResolvers.delete(requestId); // Clean up after resolving + } +}; + +window.addEventListener('message', handleMessage); + +async function getUserPermission(payload, isFromExtension) { + return new Promise((resolve) => { + const requestId = `qortalRequest_${Date.now()}`; + responseResolvers.set(requestId, resolve); // Store resolver by requestId + const targetOrigin = window.location.origin; + + // Send the request message + window.postMessage( + { + action: 'QORTAL_REQUEST_PERMISSION', + payload, + requestId, + isFromExtension, + }, + targetOrigin + ); + + // Optional timeout to handle no response scenario + setTimeout(() => { + if (responseResolvers.has(requestId)) { + responseResolvers.get(requestId)(false); // Resolve with `false` if no response + responseResolvers.delete(requestId); + } + }, 60000); // 30-second timeout + }); +} + +export const getUserAccount = async ({ + isFromExtension, + appInfo, + skipAuth, +}) => { + try { + const value = + (await getPermission(`qAPPAutoAuth-${appInfo?.name}`)) || false; + let skip = false; + if (value) { + skip = true; + } + if (skipAuth) { + skip = true; + } + let resPermission; + if (!skip) { + resPermission = await getUserPermission( + { + text1: i18n.t('question:permission.authenticate', { + postProcess: 'capitalizeFirstChar', + }), + checkbox1: { + value: false, + label: i18n.t('question:always_authenticate', { + postProcess: 'capitalizeFirstChar', + }), + }, + }, + isFromExtension + ); + } + + const { accepted = false, checkbox1 = false } = resPermission || {}; + if (resPermission) { + setPermission(`qAPPAutoAuth-${appInfo?.name}`, checkbox1); + } + if (accepted || skip) { + const wallet = await getSaveWallet(); + const address = wallet.address0; + const publicKey = wallet.publicKey; + return { + address, + publicKey, + }; + } else { + throw new Error( + i18n.t('question:message.generic.user_declined_request', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + } catch (error) { + throw new Error( + i18n.t('auth:message.error.fetch_user_account', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const encryptData = async (data, sender) => { + let data64 = data.data64 || data.base64; + const publicKeys = data.publicKeys || []; + if (data?.file || data?.blob) { + data64 = await fileToBase64(data?.file || data?.blob); + } + if (!data64) { + throw new Error( + i18n.t('question:message.generic.include_data_encrypt', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + const resKeyPair = await getKeyPair(); + const parsedData = resKeyPair; + const privateKey = parsedData.privateKey; + const userPublicKey = parsedData.publicKey; + + const encryptDataResponse = encryptDataGroup({ + data64, + publicKeys: publicKeys, + privateKey, + userPublicKey, + }); + if (encryptDataResponse) { + return encryptDataResponse; + } else { + throw new Error( + i18n.t('question:message.error.encrypt', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const encryptQortalGroupData = async (data, sender) => { + let data64 = data?.data64 || data?.base64; + const groupId = data?.groupId; + const isAdmins = data?.isAdmins; + if (!groupId) { + throw new Error( + i18n.t('question:message.generic.provide_group_id', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + if (data?.file || data?.blob) { + data64 = await fileToBase64(data?.file || data?.blob); + } + if (!data64) { + throw new Error( + i18n.t('question:message.generic.include_data_encrypt', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + + let secretKeyObject; + if (!isAdmins) { + if ( + groupSecretkeys[groupId] && + groupSecretkeys[groupId].secretKeyObject && + groupSecretkeys[groupId]?.timestamp && + Date.now() - groupSecretkeys[groupId]?.timestamp < 1200000 // TODO magic number + ) { + secretKeyObject = groupSecretkeys[groupId].secretKeyObject; + } + + if (!secretKeyObject) { + const { names } = await getGroupAdmins(groupId); + + const publish = await getPublishesFromAdmins(names, groupId); + if (publish === false) + throw new Error( + i18n.t('question:message.error.no_group_key', { + postProcess: 'capitalizeFirstChar', + }) + ); + const url = await createEndpoint( + `/arbitrary/DOCUMENT_PRIVATE/${publish.name}/${ + publish.identifier + }?encoding=base64&rebuild=true` + ); + + const res = await fetch(url); + const resData = await res.text(); + + const decryptedKey: any = await decryptResource(resData, true); + + const dataint8Array = base64ToUint8Array(decryptedKey.data); + const decryptedKeyToObject = uint8ArrayToObject(dataint8Array); + + if (!validateSecretKey(decryptedKeyToObject)) + throw new Error( + i18n.t('auth:message.error.invalid_secret_key', { + postProcess: 'capitalizeFirstChar', + }) + ); + secretKeyObject = decryptedKeyToObject; + groupSecretkeys[groupId] = { + secretKeyObject, + timestamp: Date.now(), + }; + } + } else { + if ( + groupSecretkeys[`admins-${groupId}`] && + groupSecretkeys[`admins-${groupId}`].secretKeyObject && + groupSecretkeys[`admins-${groupId}`]?.timestamp && + Date.now() - groupSecretkeys[`admins-${groupId}`]?.timestamp < 1200000 // TODO magic number + ) { + secretKeyObject = groupSecretkeys[`admins-${groupId}`].secretKeyObject; + } + + if (!secretKeyObject) { + const { names } = await getGroupAdmins(groupId); + + const publish = await getPublishesFromAdminsAdminSpace(names, groupId); + if (publish === false) + throw new Error( + i18n.t('question:message.error.no_group_key', { + postProcess: 'capitalizeFirstChar', + }) + ); + const url = await createEndpoint( + `/arbitrary/DOCUMENT_PRIVATE/${publish.name}/${ + publish.identifier + }?encoding=base64&rebuild=true` + ); + + const res = await fetch(url); + const resData = await res.text(); + const decryptedKey: any = await decryptResource(resData, true); + const dataint8Array = base64ToUint8Array(decryptedKey.data); + const decryptedKeyToObject = uint8ArrayToObject(dataint8Array); + + if (!validateSecretKey(decryptedKeyToObject)) + throw new Error( + i18n.t('auth:message.error.invalid_secret_key', { + postProcess: 'capitalizeFirstChar', + }) + ); + secretKeyObject = decryptedKeyToObject; + groupSecretkeys[`admins-${groupId}`] = { + secretKeyObject, + timestamp: Date.now(), + }; + } + } + + const resGroupEncryptedResource = encryptSingle({ + data64, + secretKeyObject: secretKeyObject, + }); + + if (resGroupEncryptedResource) { + return resGroupEncryptedResource; + } else { + throw new Error( + i18n.t('question:message.error.encrypt', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const decryptQortalGroupData = async (data, sender) => { + const data64 = data?.data64 || data?.base64; + const groupId = data?.groupId; + const isAdmins = data?.isAdmins; + if (!groupId) { + throw new Error( + i18n.t('question:message.generic.provide_group_id', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + + if (!data64) { + throw new Error( + i18n.t('question:message.generic.include_data_encrypt', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + + let secretKeyObject; + if (!isAdmins) { + if ( + groupSecretkeys[groupId] && + groupSecretkeys[groupId].secretKeyObject && + groupSecretkeys[groupId]?.timestamp && + Date.now() - groupSecretkeys[groupId]?.timestamp < 1200000 // TODO magic number + ) { + secretKeyObject = groupSecretkeys[groupId].secretKeyObject; + } + if (!secretKeyObject) { + const { names } = await getGroupAdmins(groupId); + + const publish = await getPublishesFromAdmins(names, groupId); + if (publish === false) + throw new Error( + i18n.t('question:message.error.no_group_key', { + postProcess: 'capitalizeFirstChar', + }) + ); + const url = await createEndpoint( + `/arbitrary/DOCUMENT_PRIVATE/${publish.name}/${ + publish.identifier + }?encoding=base64&rebuild=true` + ); + + const res = await fetch(url); + const resData = await res.text(); + const decryptedKey: any = await decryptResource(resData, true); + + const dataint8Array = base64ToUint8Array(decryptedKey.data); + const decryptedKeyToObject = uint8ArrayToObject(dataint8Array); + if (!validateSecretKey(decryptedKeyToObject)) + throw new Error( + i18n.t('auth:message.error.invalid_secret_key', { + postProcess: 'capitalizeFirstChar', + }) + ); + secretKeyObject = decryptedKeyToObject; + groupSecretkeys[groupId] = { + secretKeyObject, + timestamp: Date.now(), + }; + } + } else { + if ( + groupSecretkeys[`admins-${groupId}`] && + groupSecretkeys[`admins-${groupId}`].secretKeyObject && + groupSecretkeys[`admins-${groupId}`]?.timestamp && + Date.now() - groupSecretkeys[`admins-${groupId}`]?.timestamp < 1200000 // TODO magic nummber + ) { + secretKeyObject = groupSecretkeys[`admins-${groupId}`].secretKeyObject; + } + if (!secretKeyObject) { + const { names } = await getGroupAdmins(groupId); + + const publish = await getPublishesFromAdminsAdminSpace(names, groupId); + if (publish === false) + throw new Error( + i18n.t('question:message.error.no_group_key', { + postProcess: 'capitalizeFirstChar', + }) + ); + const url = await createEndpoint( + `/arbitrary/DOCUMENT_PRIVATE/${publish.name}/${ + publish.identifier + }?encoding=base64&rebuild=true` + ); + + const res = await fetch(url); + const resData = await res.text(); + const decryptedKey: any = await decryptResource(resData, true); + + const dataint8Array = base64ToUint8Array(decryptedKey.data); + const decryptedKeyToObject = uint8ArrayToObject(dataint8Array); + if (!validateSecretKey(decryptedKeyToObject)) + throw new Error( + i18n.t('auth:message.error.invalid_secret_key', { + postProcess: 'capitalizeFirstChar', + }) + ); + secretKeyObject = decryptedKeyToObject; + groupSecretkeys[`admins-${groupId}`] = { + secretKeyObject, + timestamp: Date.now(), + }; + } + } + + const resGroupDecryptResource = decryptSingle({ + data64, + secretKeyObject: secretKeyObject, + skipDecodeBase64: true, + }); + if (resGroupDecryptResource) { + return resGroupDecryptResource; + } else { + throw new Error( + i18n.t('question:message.error.encrypt', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const encryptDataWithSharingKey = async (data, sender) => { + let data64 = data?.data64 || data?.base64; + const publicKeys = data.publicKeys || []; + if (data?.file || data?.blob) { + data64 = await fileToBase64(data?.file || data?.blob); + } + if (!data64) { + throw new Error( + i18n.t('question:message.generic.include_data_encrypt', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + const symmetricKey = createSymmetricKeyAndNonce(); + const dataObject = { + data: data64, + key: symmetricKey.messageKey, + }; + const dataObjectBase64 = await objectToBase64(dataObject); + + const resKeyPair = await getKeyPair(); + const parsedData = resKeyPair; + const privateKey = parsedData.privateKey; + const userPublicKey = parsedData.publicKey; + + const encryptDataResponse = encryptDataGroup({ + data64: dataObjectBase64, + publicKeys: publicKeys, + privateKey, + userPublicKey, + customSymmetricKey: symmetricKey.messageKey, + }); + if (encryptDataResponse) { + return encryptDataResponse; + } else { + throw new Error( + i18n.t('question:message.error.encrypt', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const decryptDataWithSharingKey = async (data, sender) => { + const { encryptedData, key } = data; + + if (!encryptedData) { + throw new Error( + i18n.t('question:message.generic.include_data_decrypt', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + + const decryptedData = await decryptGroupEncryptionWithSharingKey({ + data64EncryptedData: encryptedData, + key, + }); + + const base64ToObject = JSON.parse(atob(decryptedData)); + + if (!base64ToObject.data) + throw new Error( + i18n.t('question:message.error.no_data_encrypted_resource', { + postProcess: 'capitalizeFirstChar', + }) + ); + return base64ToObject.data; +}; + +export const getHostedData = async (data, isFromExtension) => { + const isGateway = await isRunningGateway(); + if (isGateway) { + throw new Error( + i18n.t('question:message.generic.no_action_public_node', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + const resPermission = await getUserPermission( + { + text1: i18n.t('question:message.error.submit_sell_order', { + postProcess: 'capitalizeFirstChar', + }), + }, + isFromExtension + ); + const { accepted } = resPermission; + + if (accepted) { + const limit = data?.limit ? data?.limit : 20; + const query = data?.query ? data?.query : ''; + const offset = data?.offset ? data?.offset : 0; + + let urlPath = `/arbitrary/hosted/resources/?limit=${limit}&offset=${offset}`; + if (query) { + urlPath = urlPath + `&query=${query}`; + } + + const url = await createEndpoint(urlPath); + const response = await fetch(url); + const dataResponse = await response.json(); + return dataResponse; + } else { + throw new Error( + i18n.t('question:message.generic.user_declined_list', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const deleteHostedData = async (data, isFromExtension) => { + const isGateway = await isRunningGateway(); + if (isGateway) { + throw new Error( + i18n.t('question:message.generic.no_action_public_node', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + const requiredFields = ['hostedData']; + const missingFields: string[] = []; + requiredFields.forEach((field) => { + if (!data[field]) { + missingFields.push(field); + } + }); + const resPermission = await getUserPermission( + { + text1: i18n.t('question:permission.delete_hosts_resources', { + size: data?.hostedData?.length, + postProcess: 'capitalizeFirstChar', + }), + }, + isFromExtension + ); + const { accepted } = resPermission; + + if (accepted) { + const { hostedData } = data; + + for (const hostedDataItem of hostedData) { + try { + const url = await createEndpoint( + `/arbitrary/resource/${hostedDataItem.service}/${hostedDataItem.name}/${hostedDataItem.identifier}` + ); + await fetch(url, { + method: 'DELETE', + headers: { + 'Content-Type': 'application/json', + }, + }); + } catch (error) { + console.log(error); + } + } + + return true; + } else { + throw new Error( + i18n.t('question:message.generic.user_declined_delete_hosted_resources', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; +export const decryptData = async (data) => { + const { encryptedData, publicKey } = data; + + if (!encryptedData) { + throw new Error(`Missing fields: encryptedData`); + } + const resKeyPair = await getKeyPair(); + const parsedData = resKeyPair; + const uint8PrivateKey = Base58.decode(parsedData.privateKey); + const uint8Array = base64ToUint8Array(encryptedData); + const startsWithQortalEncryptedData = uint8ArrayStartsWith( + uint8Array, + 'qortalEncryptedData' + ); + if (startsWithQortalEncryptedData) { + if (!publicKey) { + throw new Error(`Missing fields: publicKey`); + } + + const decryptedDataToBase64 = decryptDeprecatedSingle( + uint8Array, + publicKey, + uint8PrivateKey + ); + return decryptedDataToBase64; + } + const startsWithQortalGroupEncryptedData = uint8ArrayStartsWith( + uint8Array, + 'qortalGroupEncryptedData' + ); + if (startsWithQortalGroupEncryptedData) { + const decryptedData = decryptGroupDataQortalRequest( + encryptedData, + parsedData.privateKey + ); + const decryptedDataToBase64 = uint8ArrayToBase64(decryptedData); + return decryptedDataToBase64; + } + throw new Error( + i18n.t('question:message.error.encrypt', { + postProcess: 'capitalizeFirstChar', + }) + ); +}; + +export const getListItems = async (data, isFromExtension) => { + const isGateway = await isRunningGateway(); + if (isGateway) { + throw new Error( + i18n.t('question:message.generic.no_action_public_node', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + const requiredFields = ['list_name']; + const missingFields: string[] = []; + requiredFields.forEach((field) => { + if (!data[field]) { + missingFields.push(field); + } + }); + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + const value = (await getPermission('qAPPAutoLists')) || false; + + let skip = false; + if (value) { + skip = true; + } + let resPermission; + let acceptedVar; + let checkbox1Var; + if (!skip) { + resPermission = await getUserPermission( + { + text1: i18n.t('question:permission.access_list', { + postProcess: 'capitalizeFirstChar', + }), + highlightedText: data.list_name, + checkbox1: { + value: value, + label: i18n.t('question:always_retrieve_list', { + postProcess: 'capitalizeFirstChar', + }), + }, + }, + isFromExtension + ); + const { accepted, checkbox1 } = resPermission; + acceptedVar = accepted; + checkbox1Var = checkbox1; + setPermission('qAPPAutoLists', checkbox1); + } + + if (acceptedVar || skip) { + const url = await createEndpoint(`/lists/${data.list_name}`); + const response = await fetch(url); + if (!response.ok) + throw new Error( + i18n.t('question:message.error.fetch_list', { + postProcess: 'capitalizeFirstChar', + }) + ); + + const list = await response.json(); + return list; + } else { + throw new Error( + i18n.t('question:message.generic.user_declined_share_list', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const addListItems = async (data, isFromExtension) => { + const isGateway = await isRunningGateway(); + if (isGateway) { + throw new Error( + i18n.t('question:message.generic.no_action_public_node', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + const requiredFields = ['list_name', 'items']; + const missingFields: string[] = []; + requiredFields.forEach((field) => { + if (!data[field]) { + missingFields.push(field); + } + }); + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + + const items = data.items; + const list_name = data.list_name; + + const resPermission = await getUserPermission( + { + text1: i18n.t('question:permission.all_item_list', { + name: list_name, + postProcess: 'capitalizeFirstChar', + }), + highlightedText: items.join(', '), + }, + isFromExtension + ); + const { accepted } = resPermission; + + if (accepted) { + const url = await createEndpoint(`/lists/${list_name}`); + const body = { + items: items, + }; + const bodyToString = JSON.stringify(body); + const response = await fetch(url, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: bodyToString, + }); + + if (!response.ok) + throw new Error( + i18n.t('question:message.error.add_to_list', { + postProcess: 'capitalizeFirstChar', + }) + ); + let res; + try { + res = await response.clone().json(); + } catch (e) { + res = await response.text(); + } + return res; + } else { + throw new Error( + i18n.t('question:message.generic.user_declined_add_list', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const deleteListItems = async (data, isFromExtension) => { + const isGateway = await isRunningGateway(); + if (isGateway) { + throw new Error( + i18n.t('question:message.generic.no_action_public_node', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + const requiredFields = ['list_name']; + const missingFields: string[] = []; + requiredFields.forEach((field) => { + if (!data[field]) { + missingFields.push(field); + } + }); + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + if (!data?.item && !data?.items) { + throw new Error( + i18n.t('question:message.error.missing_fields', { + fields: 'items', + postProcess: 'capitalizeFirstChar', + }) + ); + } + const item = data?.item; + const items = data?.items; + const list_name = data.list_name; + + const resPermission = await getUserPermission( + { + text1: i18n.t('question:permission.remove_from_list', { + name: list_name, + postProcess: 'capitalizeFirstChar', + }), + highlightedText: items ? JSON.stringify(items) : item, + }, + isFromExtension + ); + const { accepted } = resPermission; + + if (accepted) { + const url = await createEndpoint(`/lists/${list_name}`); + const body = { + items: items || [item], + }; + const bodyToString = JSON.stringify(body); + const response = await fetch(url, { + method: 'DELETE', + headers: { + 'Content-Type': 'application/json', + }, + body: bodyToString, + }); + + if (!response.ok) + throw new Error( + i18n.t('question:message.error.add_to_list', { + postProcess: 'capitalizeFirstChar', + }) + ); + let res; + try { + res = await response.clone().json(); + } catch (e) { + res = await response.text(); + } + return res; + } else { + throw new Error( + i18n.t('question:message.generic.user_declined_delete_from_list', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const publishQDNResource = async ( + data: any, + sender, + isFromExtension +) => { + const requiredFields = ['service']; + const missingFields: string[] = []; + requiredFields.forEach((field) => { + if (!data[field]) { + missingFields.push(field); + } + }); + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + if (!data.file && !data.data64 && !data.base64) { + throw new Error( + i18n.t('question:message.error.no_data_file_submitted', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + // Use "default" if user hasn't specified an identifier + const service = data.service; + const appFee = data?.appFee ? +data.appFee : undefined; + const appFeeRecipient = data?.appFeeRecipient; + let hasAppFee = false; + if (appFee && appFee > 0 && appFeeRecipient) { + hasAppFee = true; + } + const registeredName = data?.name || (await getNameInfo()); + const name = registeredName; + if (!name) { + throw new Error( + i18n.t('question:message.error.user_qortal_name', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + + let identifier = data.identifier; + let data64 = data.data64 || data.base64; + const filename = data.filename; + const title = data.title; + const description = data.description; + const category = data.category; + const file = data?.file || data?.blob; + const tags = data?.tags || []; + const result = {}; + + if (file && file.size > MAX_SIZE_PUBLISH) { + throw new Error( + i18n.t('question:message.error.max_size_publish', { + size: 2, + postProcess: 'capitalizeFirstChar', + }) + ); + } + + if (file && file.size > MAX_SIZE_PUBLIC_NODE) { + const isPublicNode = await isRunningGateway(); + if (isPublicNode) { + throw new Error( + i18n.t('question:message.error.max_size_publish_public', { + size: 500, + postProcess: 'capitalizeFirstChar', + }) + ); + } + } + + // Fill tags dynamically while maintaining backward compatibility + for (let i = 0; i < 5; i++) { + result[`tag${i + 1}`] = tags[i] || data[`tag${i + 1}`] || undefined; + } + + // Access tag1 to tag5 from result + const { tag1, tag2, tag3, tag4, tag5 } = result; + + if (data.identifier == null) { + identifier = 'default'; + } + + if ( + data.encrypt && + (!data.publicKeys || + (Array.isArray(data.publicKeys) && data.publicKeys.length === 0)) + ) { + throw new Error( + i18n.t('question:message.error.encryption_requires_public_key', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + + if (data.encrypt) { + try { + const resKeyPair = await getKeyPair(); + const parsedData = resKeyPair; + const privateKey = parsedData.privateKey; + const userPublicKey = parsedData.publicKey; + if (data?.file || data?.blob) { + data64 = await fileToBase64(data?.file || data?.blob); + } + const encryptDataResponse = encryptDataGroup({ + data64, + publicKeys: data.publicKeys, + privateKey, + userPublicKey, + }); + if (encryptDataResponse) { + data64 = encryptDataResponse; + } + } catch (error) { + throw new Error( + error.message || + i18n.t('question:message.error.upload_encryption', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + } + + const fee = await getFee('ARBITRARY'); + + const handleDynamicValues = {}; + if (hasAppFee) { + const feePayment = await getFee('PAYMENT'); + + (handleDynamicValues['appFee'] = +appFee + +feePayment.fee), + (handleDynamicValues['checkbox1'] = { + value: true, + label: i18n.t('question:accept_app_fee', { + postProcess: 'capitalizeFirstChar', + }), + }); + } + if (!!data?.encrypt) { + handleDynamicValues['highlightedText'] = `isEncrypted: ${!!data.encrypt}`; + } + const resPermission = await getUserPermission( + { + text1: i18n.t('question:permission.publish_qdn', { + postProcess: 'capitalizeFirstChar', + }), + text2: `service: ${service}`, + text3: `identifier: ${identifier || null}`, + text4: `name: ${registeredName}`, + fee: fee.fee, + ...handleDynamicValues, + }, + isFromExtension + ); + const { accepted, checkbox1 = false } = resPermission; + if (accepted) { + try { + const resPublish = await publishData({ + registeredName: encodeURIComponent(name), + data: data64 ? data64 : file, + service: service, + identifier: encodeURIComponent(identifier), + uploadType: data64 ? 'base64' : 'file', + filename: filename, + title, + description, + category, + tag1, + tag2, + tag3, + tag4, + tag5, + apiVersion: 2, + withFee: true, + }); + if (resPublish?.signature && hasAppFee && checkbox1) { + sendCoinFunc( + { + amount: appFee, + receiver: appFeeRecipient, + }, + true + ); + } + return resPublish; + } catch (error) { + throw new Error(error?.message || 'Upload failed'); + } + } else { + throw new Error( + i18n.t('question:message.generic.user_declined_request', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const checkArrrSyncStatus = async (seed) => { + const _url = await createEndpoint(`/crosschain/arrr/syncstatus`); + let tries = 0; // Track the number of attempts + + while (tries < 36) { + const response = await fetch(_url, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: seed, + }); + + let res; + try { + res = await response.clone().json(); + } catch (e) { + res = await response.text(); + } + + if (res.indexOf('<') > -1 || res !== 'Synchronized') { + // Wait 2 seconds before trying again + await new Promise((resolve) => setTimeout(resolve, 2000)); + tries += 1; + } else { + // If the response doesn't meet the two conditions, exit the function + return; + } + } + + // If we exceed N tries, throw an error + throw new Error( + i18n.t('question:message.error.synchronization_attempts', { + count: 36, + postProcess: 'capitalizeFirstChar', + }) + ); +}; + +export const publishMultipleQDNResources = async ( + data: any, + sender, + isFromExtension, + appInfo +) => { + const requiredFields = ['resources']; + const missingFields: string[] = []; + + requiredFields.forEach((field) => { + if (!data[field]) { + missingFields.push(field); + } + }); + + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + + const resources = data.resources; + if (!Array.isArray(resources)) { + throw new Error( + i18n.t('group:message.generic.invalid_data', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + + if (resources.length === 0) { + throw new Error( + i18n.t('question:message.error.no_resources_publish', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + const isPublicNode = await isRunningGateway(); + if (isPublicNode) { + const hasOversizedFilePublicNode = resources.some((resource) => { + const file = resource?.file; + return file instanceof File && file.size > MAX_SIZE_PUBLIC_NODE; + }); + + if (hasOversizedFilePublicNode) { + throw new Error( + i18n.t('question:message.error.max_size_publish_public', { + size: 500, + postProcess: 'capitalizeFirstChar', + }) + ); + } + } + + const hasOversizedFile = resources.some((resource) => { + const file = resource?.file; + return file instanceof File && file.size > MAX_SIZE_PUBLISH; + }); + + if (hasOversizedFile) { + throw new Error( + i18n.t('question:message.error.max_size_publish', { + size: 2, + postProcess: 'capitalizeFirstChar', + }) + ); + } + + const totalFileSize = resources.reduce((acc, resource) => { + const file = resource?.file; + if (file && file?.size && !isNaN(file?.size)) { + return acc + file.size; + } + return acc; + }, 0); + if (totalFileSize > 0) { + const urlCheck = `/arbitrary/check/tmp?totalSize=${totalFileSize}`; + + const checkEndpoint = await createEndpoint(urlCheck); + const checkRes = await fetch(checkEndpoint); + if (!checkRes.ok) { + throw new Error('Not enough space on your hard drive'); + } + } + + const encrypt = data?.encrypt; + + for (const resource of resources) { + const resourceEncrypt = encrypt && resource?.disableEncrypt !== true; + + if (!resourceEncrypt && resource?.service.endsWith('_PRIVATE')) { + const errorMsg = i18n.t('question:message.error.only_encrypted_data', { + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } else if (resourceEncrypt && !resource?.service.endsWith('_PRIVATE')) { + const errorMsg = i18n.t('question:message.error.use_private_service', { + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + } + + const fee = await getFee('ARBITRARY'); + const registeredName = await getNameInfo(); + + const name = registeredName; + + if (!name) { + throw new Error( + i18n.t('question:message.error.registered_name', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + + const userNames = await getAllUserNames(); + data.resources?.forEach((item) => { + if (item?.name && !userNames?.includes(item.name)) + throw new Error( + `The name ${item.name}, does not belong to the publisher.` + ); + }); + + const appFee = data?.appFee ? +data.appFee : undefined; + const appFeeRecipient = data?.appFeeRecipient; + let hasAppFee = false; + + if (appFee && appFee > 0 && appFeeRecipient) { + hasAppFee = true; + } + + const handleDynamicValues = {}; + if (hasAppFee) { + const feePayment = await getFee('PAYMENT'); + + (handleDynamicValues['appFee'] = +appFee + +feePayment.fee), + (handleDynamicValues['checkbox1'] = { + value: true, + label: i18n.t('question:accept_app_fee', { + postProcess: 'capitalizeFirstChar', + }), + }); + } + if (data?.encrypt) { + handleDynamicValues['highlightedText'] = `isEncrypted: ${!!data.encrypt}`; + } + const resPermission = await getUserPermission( + { + text1: i18n.t('question:permission.publish_qdn', { + postProcess: 'capitalizeFirstChar', + }), + html: ` +
+ + + ${data.resources + .map( + (resource) => ` +
+
Service: ${ + resource.service + }
+
Name: ${resource?.name || name}
+
Identifier: ${ + resource.identifier + }
+ ${ + resource.filename + ? `
Filename: ${resource.filename}
` + : '' + } +
` + ) + .join('')} +
+ + `, + fee: +fee.fee * resources.length, + ...handleDynamicValues, + }, + isFromExtension + ); + + const { accepted, checkbox1 = false } = resPermission; + if (!accepted) { + throw new Error( + i18n.t('question:message.generic.user_declined_request', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + + type FailedPublish = { + reason: string; + identifier: any; + service: any; + }; + + const failedPublishesIdentifiers: FailedPublish[] = []; + const publishedResponses = []; + for (const resource of resources) { + try { + const requiredFields = ['service']; + const missingFields: string[] = []; + requiredFields.forEach((field) => { + if (!resource[field]) { + missingFields.push(field); + } + }); + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + failedPublishesIdentifiers.push({ + reason: errorMsg, + identifier: resource.identifier, + service: resource.service, + name: resource?.name || name, + }); + continue; + } + if (!resource.file && !resource.data64 && !resource?.base64) { + const errorMsg = i18n.t( + 'question:message.error.no_data_file_submitted', + { + postProcess: 'capitalizeFirstChar', + } + ); + failedPublishesIdentifiers.push({ + reason: errorMsg, + identifier: resource.identifier, + service: resource.service, + name: resource?.name || name, + }); + continue; + } + const service = resource.service; + let identifier = resource.identifier; + let rawData = resource?.data64 || resource?.base64; + const filename = resource.filename; + const title = resource.title; + const description = resource.description; + const category = resource.category; + const tags = resource?.tags || []; + const result = {}; + + // Fill tags dynamically while maintaining backward compatibility + for (let i = 0; i < 5; i++) { + result[`tag${i + 1}`] = tags[i] || resource[`tag${i + 1}`] || undefined; + } + + // Access tag1 to tag5 from result + const { tag1, tag2, tag3, tag4, tag5 } = result; + const resourceEncrypt = encrypt && resource?.disableEncrypt !== true; + if (resource.identifier == null) { + identifier = 'default'; + } + if (!resourceEncrypt && service.endsWith('_PRIVATE')) { + const errorMsg = i18n.t('question:message.error.only_encrypted_data', { + postProcess: 'capitalizeFirstChar', + }); + failedPublishesIdentifiers.push({ + reason: errorMsg, + identifier: resource.identifier, + service: resource.service, + name: resource?.name || name, + }); + continue; + } + if (resource.file) { + rawData = resource.file; + } + + if (resourceEncrypt) { + try { + if (resource?.file) { + rawData = await fileToBase64(resource.file); + } + const resKeyPair = await getKeyPair(); + const parsedData = resKeyPair; + const privateKey = parsedData.privateKey; + const userPublicKey = parsedData.publicKey; + const encryptDataResponse = encryptDataGroup({ + data64: rawData, + publicKeys: data.publicKeys, + privateKey, + userPublicKey, + }); + if (encryptDataResponse) { + rawData = encryptDataResponse; + } + } catch (error) { + const errorMsg = + error?.message || + i18n.t('question:message.error.upload_encryption', { + postProcess: 'capitalizeFirstChar', + }); + failedPublishesIdentifiers.push({ + reason: errorMsg, + identifier: resource.identifier, + service: resource.service, + name: resource?.name || name, + }); + continue; + } + } + + try { + const dataType = + resource?.base64 || resource?.data64 || resourceEncrypt + ? 'base64' + : 'file'; + + const response = await publishData({ + apiVersion: 2, + category, + data: rawData, + description, + filename: filename, + identifier: encodeURIComponent(identifier), + registeredName: encodeURIComponent(resource?.name || name), + service: service, + tag1, + tag2, + tag3, + tag4, + tag5, + title, + uploadType: dataType, + withFee: true, + appInfo, + }); + if (response?.signature) { + publishedResponses.push(response); + } + await new Promise((res) => { + setTimeout(() => { + res(); + }, 1000); + }); + } catch (error) { + const errorMsg = + error.message || + i18n.t('question:message.error.upload', { + postProcess: 'capitalizeFirstChar', + }); + failedPublishesIdentifiers.push({ + reason: errorMsg, + identifier: resource.identifier, + service: resource.service, + name: resource?.name || name, + }); + } + } catch (error) { + failedPublishesIdentifiers.push({ + reason: + error?.message || + i18n.t('question:message.error.unknown_error', { + postProcess: 'capitalizeFirstChar', + }), + identifier: resource.identifier, + service: resource.service, + name: resource?.name || name, + }); + } + } + if (failedPublishesIdentifiers.length > 0) { + const obj = { + message: i18n.t('question:message.error.resources_publish', { + postProcess: 'capitalizeFirstChar', + }), + }; + obj['error'] = { + unsuccessfulPublishes: failedPublishesIdentifiers, + }; + return obj; + } + if (hasAppFee && checkbox1) { + sendCoinFunc( + { + amount: appFee, + receiver: appFeeRecipient, + }, + true + ); + } + return publishedResponses; +}; + +export const voteOnPoll = async (data, isFromExtension) => { + const requiredFields = ['pollName', 'optionIndex']; + const missingFields: string[] = []; + + requiredFields.forEach((field) => { + if (!data[field] && data[field] !== 0) { + missingFields.push(field); + } + }); + + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + + const pollName = data.pollName; + const optionIndex = data.optionIndex; + let pollInfo = null; + try { + const url = await createEndpoint(`/polls/${encodeURIComponent(pollName)}`); + const response = await fetch(url); + if (!response.ok) { + const errorMessage = await parseErrorResponse( + response, + i18n.t('question:message.error.fetch_poll', { + postProcess: 'capitalizeFirstChar', + }) + ); + throw new Error(errorMessage); + } + + pollInfo = await response.json(); + } catch (error) { + const errorMsg = + (error && error.message) || + i18n.t('question:message.error.no_poll', { + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + if (!pollInfo || pollInfo.error) { + const errorMsg = + (pollInfo && pollInfo.message) || + i18n.t('question:message.error.no_poll', { + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + try { + const optionName = pollInfo.pollOptions[optionIndex].optionName; + const resVoteOnPoll = await _voteOnPoll( + { pollName, optionIndex, optionName }, + isFromExtension + ); + return resVoteOnPoll; + } catch (error) { + throw new Error( + error?.message || + i18n.t('question:message.error.poll_vote', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const createPoll = async (data, isFromExtension) => { + const requiredFields = [ + 'pollName', + 'pollDescription', + 'pollOptions', + 'pollOwnerAddress', + ]; + const missingFields: string[] = []; + requiredFields.forEach((field) => { + if (!data[field]) { + missingFields.push(field); + } + }); + + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + + const pollName = data.pollName; + const pollDescription = data.pollDescription; + const pollOptions = data.pollOptions; + try { + const resCreatePoll = await _createPoll( + { + pollName, + pollDescription, + options: pollOptions, + }, + isFromExtension + ); + return resCreatePoll; + } catch (error) { + throw new Error( + error?.message || + i18n.t('question:message.error.poll_create', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +function isBase64(str) { + const base64Regex = + /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/; + return base64Regex.test(str) && str.length % 4 === 0; +} + +function checkValue(value) { + if (typeof value === 'string') { + if (isBase64(value)) { + return 'string'; + } else { + return 'string'; + } + } else if (typeof value === 'object' && value !== null) { + return 'object'; + } else { + throw new Error( + i18n.t('question:message.error.invalid_fullcontent', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +} + +export const sendChatMessage = async (data, isFromExtension, appInfo) => { + const message = data?.message; + const fullMessageObject = data?.fullMessageObject || data?.fullContent; + const recipient = data?.destinationAddress || data.recipient; + const groupId = data.groupId; + const isRecipient = groupId === undefined; + const chatReference = data?.chatReference; + if (groupId === undefined && recipient === undefined) { + throw new Error( + i18n.t('question:provide_recipient_group_id', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + let fullMessageObjectType; + if (fullMessageObject) { + fullMessageObjectType = checkValue(fullMessageObject); + } + const value = + (await getPermission(`qAPPSendChatMessage-${appInfo?.name}`)) || false; + let skip = false; + if (value) { + skip = true; + } + let resPermission; + if (!skip) { + resPermission = await getUserPermission( + { + text1: i18n.t('question:permission.send_chat_message', { + postProcess: 'capitalizeFirstChar', + }), + text2: isRecipient + ? i18n.t('question:to_recipient', { + recipient: recipient, + postProcess: 'capitalizeFirstChar', + }) + : i18n.t('question:to_group', { + group_id: groupId, + postProcess: 'capitalizeFirstChar', + }), + text3: fullMessageObject + ? fullMessageObjectType === 'string' + ? `${fullMessageObject?.slice(0, 25)}${fullMessageObject?.length > 25 ? '...' : ''}` + : `${JSON.stringify(fullMessageObject)?.slice(0, 25)}${JSON.stringify(fullMessageObject)?.length > 25 ? '...' : ''}` + : `${message?.slice(0, 25)}${message?.length > 25 ? '...' : ''}`, + checkbox1: { + value: false, + label: i18n.t('question:always_chat_messages', { + postProcess: 'capitalizeFirstChar', + }), + }, + }, + isFromExtension + ); + } + const { accepted = false, checkbox1 = false } = resPermission || {}; + if (resPermission && accepted) { + setPermission(`qAPPSendChatMessage-${appInfo?.name}`, checkbox1); + } + if (accepted || skip) { + const tiptapJson = { + type: 'doc', + content: [ + { + type: 'paragraph', + content: [ + { + type: 'text', + text: message, + }, + ], + }, + ], + }; + const messageObject = fullMessageObject + ? fullMessageObject + : { + messageText: tiptapJson, + images: [], + repliedTo: '', + version: 3, + }; + + let stringifyMessageObject = JSON.stringify(messageObject); + if (fullMessageObjectType === 'string') { + stringifyMessageObject = messageObject; + } + + const balance = await getBalanceInfo(); + const hasEnoughBalance = +balance < 4 ? false : true; + if (!hasEnoughBalance) { + throw new Error( + i18n.t('group:message.error.qortals_required', { + quantity: 4, + postProcess: 'capitalizeFirstChar', + }) + ); + } + if (isRecipient && recipient) { + const url = await createEndpoint(`/addresses/publickey/${recipient}`); + const response = await fetch(url); + if (!response.ok) + throw new Error( + i18n.t('question:message.error.fetch_recipient_public_key', { + postProcess: 'capitalizeFirstChar', + }) + ); + + let key; + let hasPublicKey; + let res; + const contentType = response.headers.get('content-type'); + + // If the response is JSON, parse it as JSON + if (contentType && contentType.includes('application/json')) { + res = await response.json(); + } else { + // Otherwise, treat it as plain text + res = await response.text(); + } + if (res?.error === 102) { + key = ''; + hasPublicKey = false; + } else if (res !== false) { + key = res; + hasPublicKey = true; + } else { + key = ''; + hasPublicKey = false; + } + + if (!hasPublicKey && isRecipient) { + throw new Error( + 'Cannot send an encrypted message to this user since they do not have their publickey on chain.' + ); + } + let _reference = new Uint8Array(64); + self.crypto.getRandomValues(_reference); + + let sendTimestamp = Date.now(); + + let reference = Base58.encode(_reference); + const resKeyPair = await getKeyPair(); + const parsedData = resKeyPair; + const uint8PrivateKey = Base58.decode(parsedData.privateKey); + const uint8PublicKey = Base58.decode(parsedData.publicKey); + const keyPair = { + privateKey: uint8PrivateKey, + publicKey: uint8PublicKey, + }; + + let handleDynamicValues = {}; + if (chatReference) { + handleDynamicValues['chatReference'] = chatReference; + } + + const tx = await createTransaction(18, keyPair, { + timestamp: sendTimestamp, + recipient: recipient, + recipientPublicKey: key, + hasChatReference: chatReference ? 1 : 0, + message: stringifyMessageObject, + lastReference: reference, + proofOfWorkNonce: 0, + isEncrypted: 1, + isText: 1, + ...handleDynamicValues, + }); + + const chatBytes = tx.chatBytes; + const difficulty = 8; + const { nonce, chatBytesArray } = await performPowTask( + chatBytes, + difficulty + ); + + let _response = await signChatFunc(chatBytesArray, nonce, null, keyPair); + if (_response?.error) { + throw new Error(_response?.message); + } + return _response; + } else if (!isRecipient && groupId) { + let _reference = new Uint8Array(64); + self.crypto.getRandomValues(_reference); + + let reference = Base58.encode(_reference); + const resKeyPair = await getKeyPair(); + const parsedData = resKeyPair; + const uint8PrivateKey = Base58.decode(parsedData.privateKey); + const uint8PublicKey = Base58.decode(parsedData.publicKey); + const keyPair = { + privateKey: uint8PrivateKey, + publicKey: uint8PublicKey, + }; + + let handleDynamicValues = {}; + if (chatReference) { + handleDynamicValues['chatReference'] = chatReference; + } + + const txBody = { + timestamp: Date.now(), + groupID: Number(groupId), + hasReceipient: 0, + hasChatReference: chatReference ? 1 : 0, + message: stringifyMessageObject, + lastReference: reference, + proofOfWorkNonce: 0, + isEncrypted: 0, // Set default to not encrypted for groups + isText: 1, + ...handleDynamicValues, + }; + + const tx = await createTransaction(181, keyPair, txBody); + + // if (!hasEnoughBalance) { + // throw new Error("Must have at least 4 QORT to send a chat message"); + // } + + const chatBytes = tx.chatBytes; + const difficulty = 8; + const { nonce, chatBytesArray } = await performPowTask( + chatBytes, + difficulty + ); + + let _response = await signChatFunc(chatBytesArray, nonce, null, keyPair); + if (_response?.error) { + throw new Error(_response?.message); + } + return _response; + } else { + throw new Error( + i18n.t('question:provide_recipient_group_id', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + } else { + throw new Error( + i18n.t('question:message.generic.user_declined_send_message', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const joinGroup = async (data, isFromExtension) => { + const requiredFields = ['groupId']; + const missingFields: string[] = []; + requiredFields.forEach((field) => { + if (!data[field]) { + missingFields.push(field); + } + }); + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + let groupInfo = null; + try { + const url = await createEndpoint(`/groups/${data.groupId}`); + const response = await fetch(url); + if (!response.ok) + throw new Error( + i18n.t('question:message.error.fetch_group', { + postProcess: 'capitalizeFirstChar', + }) + ); + + groupInfo = await response.json(); + } catch (error) { + const errorMsg = + (error && error.message) || + i18n.t('question:message.error.no_group_found', { + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + const fee = await getFee('JOIN_GROUP'); + + const resPermission = await getUserPermission( + { + text1: i18n.t('question:message.generic.confirm_join_group', { + postProcess: 'capitalizeFirstChar', + }), + highlightedText: `${groupInfo.groupName}`, + fee: fee.fee, + }, + isFromExtension + ); + const { accepted } = resPermission; + + if (accepted) { + const groupId = data.groupId; + + if (!groupInfo || groupInfo.error) { + const errorMsg = + (groupInfo && groupInfo.message) || + i18n.t('question:message.error.no_group_found', { + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + try { + const resJoinGroup = await joinGroupFunc({ groupId }); + return resJoinGroup; + } catch (error) { + throw new Error( + error?.message || + i18n.t('group:message.error.group_join', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + } else { + throw new Error( + i18n.t('question:message.generic.user_declined_join', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const saveFile = async (data, sender, isFromExtension, snackMethods) => { + try { + if (!data?.filename) throw new Error('Missing filename'); + if (data?.location) { + const requiredFieldsLocation = ['service', 'name']; + const missingFieldsLocation: string[] = []; + requiredFieldsLocation.forEach((field) => { + if (!data?.location[field]) { + missingFieldsLocation.push(field); + } + }); + if (missingFieldsLocation.length > 0) { + const missingFieldsString = missingFieldsLocation.join(', '); + const errorMsg = `Missing fields: ${missingFieldsString}`; + throw new Error(errorMsg); + } + const resPermission = await getUserPermission( + { + text1: 'Would you like to download:', + highlightedText: `${data?.filename}`, + }, + isFromExtension + ); + const { accepted } = resPermission; + if (!accepted) throw new Error('User declined to save file'); + const a = document.createElement('a'); + let locationUrl = `/arbitrary/${data.location.service}/${data.location.name}`; + if (data.location.identifier) { + locationUrl = locationUrl + `/${data.location.identifier}`; + } + const endpoint = await createEndpoint( + locationUrl + `?attachment=true&attachmentFilename=${data?.filename}` + ); + a.href = endpoint; + a.download = data.filename; + document.body.appendChild(a); + a.click(); + a.remove(); + return true; + } + const requiredFields = ['filename', 'blob']; + const missingFields: string[] = []; + requiredFields.forEach((field) => { + if (!data[field]) { + missingFields.push(field); + } + }); + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + const filename = data.filename; + const blob = data.blob; + + const resPermission = await getUserPermission( + { + text1: i18n.t('question:download_file', { + postProcess: 'capitalizeFirstChar', + }), + highlightedText: `${filename}`, + }, + isFromExtension + ); + const { accepted } = resPermission; + + if (accepted) { + const mimeType = blob.type || data.mimeType; + let backupExention = filename.split('.').pop(); + if (backupExention) { + backupExention = '.' + backupExention; + } + const fileExtension = mimeToExtensionMap[mimeType] || backupExention; + let fileHandleOptions = {}; + if (!mimeType) { + throw new Error( + i18n.t('question:message.error.mime_type', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + if (!fileExtension) { + throw new Error( + i18n.t('question:message.error.file_extension', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + if (fileExtension && mimeType) { + fileHandleOptions = { + accept: { + [mimeType]: [fileExtension], + }, + }; + } + + showSaveFilePicker( + { + filename, + mimeType, + blob, + }, + snackMethods + ); + return true; + } else { + throw new Error( + i18n.t('question:message.generic.user_declined_save_file', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + } catch (error) { + throw new Error( + error?.message || + i18n.t('core:message.error.initiate_download', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const deployAt = async (data, isFromExtension) => { + const requiredFields = [ + 'name', + 'description', + 'tags', + 'creationBytes', + 'amount', + 'assetId', + 'type', + ]; + + const missingFields: string[] = []; + + requiredFields.forEach((field) => { + if (!data[field] && data[field] !== 0) { + missingFields.push(field); + } + }); + + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + + try { + const resDeployAt = await _deployAt( + { + name: data.name, + description: data.description, + tags: data.tags, + creationBytes: data.creationBytes, + amount: data.amount, + assetId: data.assetId, + atType: data.type, + }, + isFromExtension + ); + return resDeployAt; + } catch (error) { + throw new Error( + error?.message || + i18n.t('group:message.error.group_join', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const getUserWallet = async (data, isFromExtension, appInfo) => { + const requiredFields = ['coin']; + const missingFields: string[] = []; + requiredFields.forEach((field) => { + if (!data[field]) { + missingFields.push(field); + } + }); + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + const isGateway = await isRunningGateway(); + + if (data?.coin === 'ARRR' && isGateway) + throw new Error( + i18n.t('question:message.error.gateway_wallet_local_node', { + token: 'ARRR', + postProcess: 'capitalizeFirstChar', + }) + ); + + const value = + (await getPermission( + `qAPPAutoGetUserWallet-${appInfo?.name}-${data.coin}` + )) || false; + let skip = false; + if (value) { + skip = true; + } + + let resPermission; + + if (!skip) { + resPermission = await getUserPermission( + { + text1: i18n.t('question:permission.get_wallet_info', { + postProcess: 'capitalizeFirstChar', + }), + highlightedText: `coin: ${data.coin}`, + checkbox1: { + value: true, + label: i18n.t('question:always_retrieve_wallet', { + postProcess: 'capitalizeFirstChar', + }), + }, + }, + isFromExtension + ); + } + const { accepted = false, checkbox1 = false } = resPermission || {}; + + if (resPermission) { + setPermission( + `qAPPAutoGetUserWallet-${appInfo?.name}-${data.coin}`, + checkbox1 + ); + } + + if (accepted || skip) { + let coin = data.coin; + let userWallet = {}; + let arrrAddress = ''; + const wallet = await getSaveWallet(); + const address = wallet.address0; + const resKeyPair = await getKeyPair(); + const parsedData = resKeyPair; + const arrrSeed58 = parsedData.arrrSeed58; + if (coin === 'ARRR') { + const bodyToString = arrrSeed58; + const url = await createEndpoint(`/crosschain/arrr/walletaddress`); + const response = await fetch(url, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: bodyToString, + }); + let res; + try { + res = await response.clone().json(); + } catch (e) { + res = await response.text(); + } + if (res?.error && res?.message) { + throw new Error(res.message); + } + arrrAddress = res; + } + switch (coin) { + case 'QORT': + userWallet['address'] = address; + userWallet['publickey'] = parsedData.publicKey; + break; + case 'BTC': + userWallet['address'] = parsedData.btcAddress; + userWallet['publickey'] = parsedData.btcPublicKey; + break; + case 'LTC': + userWallet['address'] = parsedData.ltcAddress; + userWallet['publickey'] = parsedData.ltcPublicKey; + break; + case 'DOGE': + userWallet['address'] = parsedData.dogeAddress; + userWallet['publickey'] = parsedData.dogePublicKey; + break; + case 'DGB': + userWallet['address'] = parsedData.dgbAddress; + userWallet['publickey'] = parsedData.dgbPublicKey; + break; + case 'RVN': + userWallet['address'] = parsedData.rvnAddress; + userWallet['publickey'] = parsedData.rvnPublicKey; + break; + case 'ARRR': + await checkArrrSyncStatus(parsedData.arrrSeed58); + userWallet['address'] = arrrAddress; + break; + default: + break; + } + return userWallet; + } else { + throw new Error( + i18n.t('question:message.generic.user_declined_request', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const getWalletBalance = async ( + data, + bypassPermission?: boolean, + isFromExtension?: boolean, + appInfo?: any +) => { + const requiredFields = ['coin']; + const missingFields: string[] = []; + requiredFields.forEach((field) => { + if (!data[field]) { + missingFields.push(field); + } + }); + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + + const isGateway = await isRunningGateway(); + + if (data?.coin === 'ARRR' && isGateway) + throw new Error( + i18n.t('question:message.error.gateway_balance_local_node', { + token: 'ARRR', + postProcess: 'capitalizeFirstChar', + }) + ); + + const value = + (await getPermission( + `qAPPAutoWalletBalance-${appInfo?.name}-${data.coin}` + )) || false; + let skip = false; + if (value) { + skip = true; + } + let resPermission; + + if (!bypassPermission && !skip) { + resPermission = await getUserPermission( + { + text1: i18n.t('question:permission.fetch_balance', { + coin: data.coin, // TODO highlight coin in the modal + postProcess: 'capitalizeFirstChar', + }), + checkbox1: { + value: true, + label: i18n.t('question:always_retrieve_balance', { + postProcess: 'capitalizeFirstChar', + }), + }, + }, + isFromExtension + ); + } + const { accepted = false, checkbox1 = false } = resPermission || {}; + if (resPermission) { + setPermission( + `qAPPAutoWalletBalance-${appInfo?.name}-${data.coin}`, + checkbox1 + ); + } + if (accepted || bypassPermission || skip) { + let coin = data.coin; + const wallet = await getSaveWallet(); + const address = wallet.address0; + const resKeyPair = await getKeyPair(); + const parsedData = resKeyPair; + if (coin === 'QORT') { + let qortAddress = address; + try { + const url = await createEndpoint(`/addresses/balance/${qortAddress}`); + const response = await fetch(url); + if (!response.ok) + throw new Error( + i18n.t('question:message.error.fetch_balance', { + postProcess: 'capitalizeFirstChar', + }) + ); + let res; + try { + res = await response.clone().json(); + } catch (e) { + res = await response.text(); + } + return res; + } catch (error) { + throw new Error( + error?.message || + i18n.t('question:message.error.fetch_wallet', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + } else { + let _url = ``; + let _body = null; + switch (coin) { + case 'BTC': + _url = await createEndpoint(`/crosschain/btc/walletbalance`); + + _body = parsedData.btcPublicKey; + break; + case 'LTC': + _url = await createEndpoint(`/crosschain/ltc/walletbalance`); + _body = parsedData.ltcPublicKey; + break; + case 'DOGE': + _url = await createEndpoint(`/crosschain/doge/walletbalance`); + _body = parsedData.dogePublicKey; + break; + case 'DGB': + _url = await createEndpoint(`/crosschain/dgb/walletbalance`); + _body = parsedData.dgbPublicKey; + break; + case 'RVN': + _url = await createEndpoint(`/crosschain/rvn/walletbalance`); + _body = parsedData.rvnPublicKey; + break; + case 'ARRR': + await checkArrrSyncStatus(parsedData.arrrSeed58); + _url = await createEndpoint(`/crosschain/arrr/walletbalance`); + _body = parsedData.arrrSeed58; + break; + default: + break; + } + try { + const response = await fetch(_url, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: _body, + }); + let res; + try { + res = await response.clone().json(); + } catch (e) { + res = await response.text(); + } + if (res?.error && res?.message) { + throw new Error(res.message); + } + if (isNaN(Number(res))) { + throw new Error( + i18n.t('question:message.error.fetch_balance', { + postProcess: 'capitalizeFirstChar', + }) + ); + } else { + return (Number(res) / 1e8).toFixed(8); + } + } catch (error) { + throw new Error( + error?.message || + i18n.t('question:message.error.fetch_balance', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + } + } else { + throw new Error( + i18n.t('question:message.generic.user_declined_request', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +const getPirateWallet = async (arrrSeed58) => { + const isGateway = await isRunningGateway(); + if (isGateway) { + throw new Error( + i18n.t('question:message.error.gateway_retrieve_balance', { + token: 'PIRATECHAIN', + postProcess: 'capitalizeFirstChar', + }) + ); + } + const bodyToString = arrrSeed58; + await checkArrrSyncStatus(bodyToString); + const url = await createEndpoint(`/crosschain/arrr/walletaddress`); + const response = await fetch(url, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: bodyToString, + }); + let res; + try { + res = await response.clone().json(); + } catch (e) { + res = await response.text(); + } + if (res?.error && res?.message) { + throw new Error(res.message); + } + return res; +}; + +export const getUserWalletFunc = async (coin) => { + let userWallet = {}; + const wallet = await getSaveWallet(); + const address = wallet.address0; + const resKeyPair = await getKeyPair(); + const parsedData = resKeyPair; + switch (coin) { + case 'QORT': + userWallet['address'] = address; + userWallet['publickey'] = parsedData.publicKey; + break; + case 'BTC': + case 'BITCOIN': + userWallet['address'] = parsedData.btcAddress; + userWallet['publickey'] = parsedData.btcPublicKey; + break; + case 'LTC': + case 'LITECOIN': + userWallet['address'] = parsedData.ltcAddress; + userWallet['publickey'] = parsedData.ltcPublicKey; + break; + case 'DOGE': + case 'DOGECOIN': + userWallet['address'] = parsedData.dogeAddress; + userWallet['publickey'] = parsedData.dogePublicKey; + break; + case 'DGB': + case 'DIGIBYTE': + userWallet['address'] = parsedData.dgbAddress; + userWallet['publickey'] = parsedData.dgbPublicKey; + break; + case 'RVN': + case 'RAVENCOIN': + userWallet['address'] = parsedData.rvnAddress; + userWallet['publickey'] = parsedData.rvnPublicKey; + break; + case 'ARRR': + case 'PIRATECHAIN': + const arrrAddress = await getPirateWallet(parsedData.arrrSeed58); + userWallet['address'] = arrrAddress; + break; + default: + break; + } + return userWallet; +}; + +export const getUserWalletInfo = async (data, isFromExtension, appInfo) => { + const requiredFields = ['coin']; + const missingFields: string[] = []; + requiredFields.forEach((field) => { + if (!data[field]) { + missingFields.push(field); + } + }); + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + if (data?.coin === 'ARRR') { + throw new Error( + i18n.t('question:message.error.token_not_supported', { + token: 'ARRR', + postProcess: 'capitalizeFirstChar', + }) + ); + } + const value = + (await getPermission(`getUserWalletInfo-${appInfo?.name}-${data.coin}`)) || + false; + let skip = false; + if (value) { + skip = true; + } + let resPermission; + + if (!skip) { + resPermission = await getUserPermission( + { + text1: i18n.t('question:permission.get_wallet_info', { + postProcess: 'capitalizeFirstChar', + }), + highlightedText: `coin: ${data.coin}`, + checkbox1: { + value: true, + label: i18n.t('question:always_retrieve_wallet', { + postProcess: 'capitalizeFirstChar', + }), + }, + }, + isFromExtension + ); + } + const { accepted = false, checkbox1 = false } = resPermission || {}; + + if (resPermission) { + setPermission(`getUserWalletInfo-${appInfo?.name}-${data.coin}`, checkbox1); + } + + if (accepted || skip) { + let coin = data.coin; + let walletKeys = await getUserWalletFunc(coin); + + const _url = await createEndpoint( + `/crosschain/` + data.coin.toLowerCase() + `/addressinfos` + ); + let _body = { xpub58: walletKeys['publickey'] }; + try { + const response = await fetch(_url, { + method: 'POST', + headers: { + Accept: '*/*', + 'Content-Type': 'application/json', + }, + body: JSON.stringify(_body), + }); + if (!response?.ok) + throw new Error( + i18n.t('question:message.error.fetch_wallet_info', { + postProcess: 'capitalizeFirstChar', + }) + ); + let res; + try { + res = await response.clone().json(); + } catch (e) { + res = await response.text(); + } + if (res?.error && res?.message) { + throw new Error(res.message); + } + + return res; + } catch (error) { + throw new Error( + error?.message || + i18n.t('question:message.error.fetch_wallet', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + } else { + throw new Error( + i18n.t('question:message.generic.user_declined_request', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const getUserWalletTransactions = async ( + data, + isFromExtension, + appInfo +) => { + const requiredFields = ['coin']; + const missingFields: string[] = []; + requiredFields.forEach((field) => { + if (!data[field]) { + missingFields.push(field); + } + }); + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + + const value = + (await getPermission( + `getUserWalletTransactions-${appInfo?.name}-${data.coin}` + )) || false; + let skip = false; + if (value) { + skip = true; + } + let resPermission; + + if (!skip) { + resPermission = await getUserPermission( + { + text1: i18n.t('question:permission.get_wallet_transactions', { + postProcess: 'capitalizeFirstChar', + }), + highlightedText: `coin: ${data.coin}`, + checkbox1: { + value: true, + label: i18n.t('question:always_retrieve_wallet_transactions', { + postProcess: 'capitalizeFirstChar', + }), + }, + }, + isFromExtension + ); + } + const { accepted = false, checkbox1 = false } = resPermission || {}; + + if (resPermission) { + setPermission( + `getUserWalletTransactions-${appInfo?.name}-${data.coin}`, + checkbox1 + ); + } + + if (accepted || skip) { + const coin = data.coin; + const walletKeys = await getUserWalletFunc(coin); + let publicKey; + if (data?.coin === 'ARRR') { + const resKeyPair = await getKeyPair(); + const parsedData = resKeyPair; + publicKey = parsedData.arrrSeed58; + } else { + publicKey = walletKeys['publickey']; + } + + const _url = await createEndpoint( + `/crosschain/` + data.coin.toLowerCase() + `/wallettransactions` + ); + const _body = publicKey; + try { + const response = await fetch(_url, { + method: 'POST', + headers: { + Accept: '*/*', + 'Content-Type': 'application/json', + }, + body: _body, + }); + if (!response?.ok) + throw new Error( + i18n.t('question:message.error.fetch_wallet_transactions', { + postProcess: 'capitalizeFirstChar', + }) + ); + let res; + try { + res = await response.clone().json(); + } catch (e) { + res = await response.text(); + } + if (res?.error && res?.message) { + throw new Error(res.message); + } + + return res; + } catch (error) { + throw new Error( + error?.message || + i18n.t('question:message.error.fetch_wallet_transactions', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + } else { + throw new Error( + i18n.t('question:message.generic.user_declined_request', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const getCrossChainServerInfo = async (data) => { + const requiredFields = ['coin']; + const missingFields: string[] = []; + requiredFields.forEach((field) => { + if (!data[field]) { + missingFields.push(field); + } + }); + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + const _url = `/crosschain/` + data.coin.toLowerCase() + `/serverinfos`; + try { + const url = await createEndpoint(_url); + const response = await fetch(url); + if (!response.ok) + throw new Error( + i18n.t('question:message.error.fetch_generic', { + postProcess: 'capitalizeFirstChar', + }) + ); + let res; + try { + res = await response.clone().json(); + } catch (e) { + res = await response.text(); + } + if (res?.error && res?.message) { + throw new Error(res.message); + } + return res.servers; + } catch (error) { + throw new Error( + error?.message || + i18n.t('question:message.error.server_info', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const getTxActivitySummary = async (data) => { + const requiredFields = ['coin']; + const missingFields: string[] = []; + requiredFields.forEach((field) => { + if (!data[field]) { + missingFields.push(field); + } + }); + + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + + const coin = data.coin; + const url = `/crosschain/txactivity?foreignBlockchain=${coin}`; // No apiKey here + + try { + const endpoint = await createEndpoint(url); + const response = await fetch(endpoint, { + method: 'POST', + headers: { + Accept: '*/*', + 'Content-Type': 'application/json', + }, + }); + + if (!response.ok) + throw new Error( + i18n.t('question:message.error.fetch_generic', { + postProcess: 'capitalizeFirstChar', + }) + ); + let res; + try { + res = await response.clone().json(); + } catch (e) { + res = await response.text(); + } + if (res?.error && res?.message) { + throw new Error(res.message); + } + return res; // Return full response here + } catch (error) { + throw new Error( + error?.message || + i18n.t('question:message.error.transaction_activity_summary', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const getForeignFee = async (data) => { + const requiredFields = ['coin', 'type']; + const missingFields: string[] = []; + + requiredFields.forEach((field) => { + if (!data[field]) { + missingFields.push(field); + } + }); + + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + + const { coin, type } = data; + const url = `/crosschain/${coin.toLowerCase()}/${type}`; + + try { + const endpoint = await createEndpoint(url); + const response = await fetch(endpoint, { + method: 'GET', + headers: { + Accept: '*/*', + 'Content-Type': 'application/json', + }, + }); + + if (!response.ok) + throw new Error( + i18n.t('question:message.error.fetch_generic', { + postProcess: 'capitalizeFirstChar', + }) + ); + let res; + try { + res = await response.clone().json(); + } catch (e) { + res = await response.text(); + } + if (res?.error && res?.message) { + throw new Error(res.message); + } + return res; // Return full response here + } catch (error) { + throw new Error( + error?.message || + i18n.t('question:message.error.get_foreign_fee', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +function calculateRateFromFee(totalFee, sizeInBytes) { + const fee = (totalFee / sizeInBytes) * 1000; + return fee.toFixed(0); +} + +export const updateForeignFee = async (data, isFromExtension) => { + const isGateway = await isRunningGateway(); + if (isGateway) { + throw new Error( + i18n.t('question:message.generic.no_action_public_node', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + const requiredFields = ['coin', 'type', 'value']; + const missingFields: string[] = []; + + requiredFields.forEach((field) => { + if (!data[field]) { + missingFields.push(field); + } + }); + + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + + const { coin, type, value } = data; + + const text3 = + type === 'feerequired' + ? i18n.t('question:sats', { + amount: value, + postProcess: 'capitalizeFirstChar', + }) + : i18n.t('question:sats_per_kb', { + amount: value, + postProcess: 'capitalizeFirstChar', + }); + const text4 = + type === 'feerequired' + ? i18n.t('question:message.generic.calculate_fee', { + amount: value, + rate: calculateRateFromFee(value, 300), + postProcess: 'capitalizeFirstChar', + }) + : ''; + const resPermission = await getUserPermission( + { + text1: i18n.t('question:permission.update_foreign_fee', { + postProcess: 'capitalizeFirstChar', + }), + text2: `type: ${type === 'feerequired' ? 'unlocking' : 'locking'}`, + text3: i18n.t('question:value', { + value: text3, + postProcess: 'capitalizeFirstChar', + }), + highlightedText: i18n.t('question:coin', { + coin: coin, + postProcess: 'capitalizeFirstChar', + }), + }, + isFromExtension + ); + + const { accepted } = resPermission; + if (!accepted) { + throw new Error( + i18n.t('question:message.generic.user_declined_request', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + const url = `/crosschain/${coin.toLowerCase()}/update${type}`; + const valueStringified = JSON.stringify(+value); + + const endpoint = await createEndpoint(url); + const response = await fetch(endpoint, { + method: 'POST', + headers: { + Accept: '*/*', + 'Content-Type': 'application/json', + }, + body: valueStringified, + }); + + if (!response.ok) + throw new Error( + i18n.t('question:message.error.update_foreign_fee', { + postProcess: 'capitalizeFirstChar', + }) + ); + let res; + try { + res = await response.clone().json(); + } catch (e) { + res = await response.text(); + } + if (res?.error && res?.message) { + throw new Error(res.message); + } + return res; // Return full response here +}; + +export const getServerConnectionHistory = async (data) => { + const requiredFields = ['coin']; + const missingFields: string[] = []; + + // Validate required fields + requiredFields.forEach((field) => { + if (!data[field]) { + missingFields.push(field); + } + }); + + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + + const coin = data.coin.toLowerCase(); + const url = `/crosschain/${coin.toLowerCase()}/serverconnectionhistory`; + + try { + const endpoint = await createEndpoint(url); // Assuming createEndpoint is available + const response = await fetch(endpoint, { + method: 'GET', + headers: { + Accept: '*/*', + 'Content-Type': 'application/json', + }, + }); + + if (!response.ok) + throw new Error( + i18n.t('question:message.error.fetch_connection_history', { + postProcess: 'capitalizeFirstChar', + }) + ); + + let res; + try { + res = await response.clone().json(); + } catch (e) { + res = await response.text(); + } + + if (res?.error && res?.message) { + throw new Error(res.message); + } + + return res; // Return full response here + } catch (error) { + throw new Error( + error?.message || + i18n.t('question:message.error.fetch_connection_history', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const setCurrentForeignServer = async (data, isFromExtension) => { + const isGateway = await isRunningGateway(); + if (isGateway) { + throw new Error( + i18n.t('question:message.generic.no_action_public_node', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + const requiredFields = ['coin']; + const missingFields: string[] = []; + + // Validate required fields + requiredFields.forEach((field) => { + if (!data[field]) { + missingFields.push(field); + } + }); + + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + + const { coin, host, port, type } = data; + + const resPermission = await getUserPermission( + { + text1: i18n.t('question:permission.set_current_server', { + postProcess: 'capitalizeFirstChar', + }), + text2: i18n.t('question:server_type', { + type: type, + postProcess: 'capitalizeFirstChar', + }), + text3: i18n.t('question:server_host', { + host: host, + postProcess: 'capitalizeFirstChar', + }), + highlightedText: i18n.t('question:coin', { + coin: coin, + postProcess: 'capitalizeFirstChar', + }), + }, + isFromExtension + ); + + const { accepted } = resPermission; + if (!accepted) { + throw new Error( + i18n.t('question:message.generic.user_declined_request', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + const body = { + hostName: host, + port: port, + connectionType: type, + }; + + const url = `/crosschain/${coin.toLowerCase()}/setcurrentserver`; + + const endpoint = await createEndpoint(url); // Assuming createEndpoint is available + const response = await fetch(endpoint, { + method: 'POST', + headers: { + Accept: '*/*', + 'Content-Type': 'application/json', + }, + body: JSON.stringify(body), + }); + + if (!response.ok) + throw new Error( + i18n.t('question:message.error.server_current_set', { + postProcess: 'capitalizeFirstChar', + }) + ); + + let res; + try { + res = await response.clone().json(); + } catch (e) { + res = await response.text(); + } + + if (res?.error && res?.message) { + throw new Error(res.message); + } + + return res; // Return the full response +}; + +export const addForeignServer = async (data, isFromExtension) => { + const isGateway = await isRunningGateway(); + if (isGateway) { + throw new Error( + i18n.t('question:message.generic.no_action_public_node', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + const requiredFields = ['coin']; + const missingFields: string[] = []; + + // Validate required fields + requiredFields.forEach((field) => { + if (!data[field]) { + missingFields.push(field); + } + }); + + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + + const { coin, host, port, type } = data; + + const resPermission = await getUserPermission( + { + text1: i18n.t('question:permission.server_add', { + postProcess: 'capitalizeFirstChar', + }), + text2: i18n.t('question:server_type', { + type: type, + postProcess: 'capitalizeFirstChar', + }), + text3: i18n.t('question:server_host', { + host: host, + postProcess: 'capitalizeFirstChar', + }), + highlightedText: i18n.t('question:coin', { + coin: coin, + postProcess: 'capitalizeFirstChar', + }), + }, + isFromExtension + ); + + const { accepted } = resPermission; + if (!accepted) { + throw new Error( + i18n.t('question:message.generic.user_declined_request', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + const body = { + hostName: host, + port: port, + connectionType: type, + }; + + const url = `/crosschain/${coin.toLowerCase()}/addserver`; + + const endpoint = await createEndpoint(url); // Assuming createEndpoint is available + const response = await fetch(endpoint, { + method: 'POST', + headers: { + Accept: '*/*', + 'Content-Type': 'application/json', + }, + body: JSON.stringify(body), + }); + + if (!response.ok) + throw new Error( + i18n.t('question:message.error.server_current_add', { + postProcess: 'capitalizeFirstChar', + }) + ); + + let res; + try { + res = await response.clone().json(); + } catch (e) { + res = await response.text(); + } + + if (res?.error && res?.message) { + throw new Error(res.message); + } + + return res; // Return the full response +}; + +export const removeForeignServer = async (data, isFromExtension) => { + const isGateway = await isRunningGateway(); + if (isGateway) { + throw new Error( + i18n.t('question:message.generic.no_action_public_node', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + const requiredFields = ['coin']; + const missingFields: string[] = []; + + // Validate required fields + requiredFields.forEach((field) => { + if (!data[field]) { + missingFields.push(field); + } + }); + + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + + const { coin, host, port, type } = data; + + const resPermission = await getUserPermission( + { + text1: i18n.t('question:permission.server_remove', { + postProcess: 'capitalizeFirstChar', + }), + text2: i18n.t('question:server_type', { + type: type, + postProcess: 'capitalizeFirstChar', + }), + text3: i18n.t('question:server_host', { + host: host, + postProcess: 'capitalizeFirstChar', + }), + highlightedText: i18n.t('question:coin', { + coin: coin, + postProcess: 'capitalizeFirstChar', + }), + }, + isFromExtension + ); + + const { accepted } = resPermission; + if (!accepted) { + throw new Error( + i18n.t('question:message.generic.user_declined_request', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + const body = { + hostName: host, + port: port, + connectionType: type, + }; + + const url = `/crosschain/${coin.toLowerCase()}/removeserver`; + + const endpoint = await createEndpoint(url); // Assuming createEndpoint is available + const response = await fetch(endpoint, { + method: 'POST', + headers: { + Accept: '*/*', + 'Content-Type': 'application/json', + }, + body: JSON.stringify(body), + }); + + if (!response.ok) + throw new Error( + i18n.t('question:message.error.server_remove', { + postProcess: 'capitalizeFirstChar', + }) + ); + + let res; + try { + res = await response.clone().json(); + } catch (e) { + res = await response.text(); + } + + if (res?.error && res?.message) { + throw new Error(res.message); + } + + return res; // Return the full response +}; + +export const getDaySummary = async () => { + const url = `/admin/summary`; // Simplified endpoint URL + + try { + const endpoint = await createEndpoint(url); // Assuming createEndpoint is available for constructing the full URL + const response = await fetch(endpoint, { + method: 'GET', + headers: { + Accept: '*/*', + }, + }); + + if (!response.ok) + throw new Error( + i18n.t('question:message.error.retrieve_summary', { + postProcess: 'capitalizeFirstChar', + }) + ); + + let res; + try { + res = await response.clone().json(); + } catch (e) { + res = await response.text(); + } + + if (res?.error && res?.message) { + throw new Error(res.message); + } + + return res; // Return the full response + } catch (error) { + throw new Error( + error?.message || + i18n.t('question:message.error.retrieve_summary', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const getNodeInfo = async () => { + const url = `/admin/info`; // Simplified endpoint URL + + try { + const endpoint = await createEndpoint(url); // Assuming createEndpoint is available for constructing the full URL + const response = await fetch(endpoint, { + method: 'GET', + headers: { + Accept: '*/*', + }, + }); + + if (!response.ok) + throw new Error( + i18n.t('question:message.error.node_info', { + postProcess: 'capitalizeFirstChar', + }) + ); + + let res; + try { + res = await response.clone().json(); + } catch (e) { + res = await response.text(); + } + + if (res?.error && res?.message) { + throw new Error(res.message); + } + + return res; // Return the full response + } catch (error) { + throw new Error( + error?.message || + i18n.t('question:message.error.node_info', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const getNodeStatus = async () => { + const url = `/admin/status`; // Simplified endpoint URL + + try { + const endpoint = await createEndpoint(url); // Assuming createEndpoint is available for constructing the full URL + const response = await fetch(endpoint, { + method: 'GET', + headers: { + Accept: '*/*', + }, + }); + + if (!response.ok) + throw new Error( + i18n.t('question:message.error.node_status', { + postProcess: 'capitalizeFirstChar', + }) + ); + + let res; + try { + res = await response.clone().json(); + } catch (e) { + res = await response.text(); + } + + if (res?.error && res?.message) { + throw new Error(res.message); + } + + return res; // Return the full response + } catch (error) { + throw new Error( + error?.message || + i18n.t('question:message.error.node_status', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const getArrrSyncStatus = async () => { + const resKeyPair = await getKeyPair(); + const parsedData = resKeyPair; + const arrrSeed = parsedData.arrrSeed58; + const url = `/crosschain/arrr/syncstatus`; // Simplified endpoint URL + + try { + const endpoint = await createEndpoint(url); // Assuming createEndpoint is available for constructing the full URL + const response = await fetch(endpoint, { + method: 'POST', + headers: { + Accept: '*/*', + }, + body: arrrSeed, + }); + + let res; + + try { + res = await response.clone().json(); + } catch (e) { + res = await response.text(); + } + + return res; // Return the full response + } catch (error) { + throw new Error( + error?.message || + i18n.t('question:message.error.retrieve_sync_status', { + token: 'ARRR', + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const sendCoin = async (data, isFromExtension) => { + const requiredFields = ['coin', 'amount']; + const missingFields: string[] = []; + requiredFields.forEach((field) => { + if (!data[field]) { + missingFields.push(field); + } + }); + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + if (!data?.destinationAddress && !data?.recipient) { + throw new Error( + i18n.t('question:message.error.missing_fields', { + fields: 'recipient', + postProcess: 'capitalizeFirstChar', + }) + ); + } + let checkCoin = data.coin; + const wallet = await getSaveWallet(); + const address = wallet.address0; + const resKeyPair = await getKeyPair(); + const parsedData = resKeyPair; + const isGateway = await isRunningGateway(); + + if (checkCoin !== 'QORT' && isGateway) + throw new Error( + i18n.t('question:message.error.gateway_non_qort_local_node', { + postProcess: 'capitalizeFirstChar', + }) + ); + if (checkCoin === 'QORT') { + // Params: data.coin, data.recipient, data.amount, data.fee + // TODO: prompt user to send. If they confirm, call `POST /crosschain/:coin/send`, or for QORT, broadcast a PAYMENT transaction + // then set the response string from the core to the `response` variable (defined above) + // If they decline, send back JSON that includes an `error` key, such as `{"error": "User declined request"}` + const amount = Number(data.amount); + const recipient = data?.recipient || data.destinationAddress; + + const url = await createEndpoint(`/addresses/balance/${address}`); + const response = await fetch(url); + if (!response.ok) + throw new Error( + i18n.t('question:message.error.fetch_balance', { + postProcess: 'capitalizeFirstChar', + }) + ); + let walletBalance; + try { + walletBalance = await response.clone().json(); + } catch (e) { + walletBalance = await response.text(); + } + if (isNaN(Number(walletBalance))) { + const errorMsg = i18n.t('question:message.error.fetch_balance_token', { + token: 'QORT', + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + + const transformDecimals = (Number(walletBalance) * QORT_DECIMALS).toFixed( + 0 + ); + const walletBalanceDecimals = Number(transformDecimals); + const amountDecimals = Number(amount) * QORT_DECIMALS; + const fee: number = await sendQortFee(); + if (amountDecimals + fee * QORT_DECIMALS > walletBalanceDecimals) { + const errorMsg = i18n.t('question:message.error.insufficient_funds', { + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + if (amount <= 0) { + const errorMsg = i18n.t('core:message.error.invalid_amount', { + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + if (recipient.length === 0) { + const errorMsg = i18n.t('question:message.error.empty_receiver', { + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + + const resPermission = await getUserPermission( + { + text1: i18n.t('question:permission.send_coins', { + postProcess: 'capitalizeFirstChar', + }), + text2: i18n.t('question:to_recipient', { + recipient: recipient, + postProcess: 'capitalizeFirstChar', + }), + highlightedText: `${amount} ${checkCoin}`, + fee: fee, + confirmCheckbox: true, + }, + isFromExtension + ); + const { accepted } = resPermission; + + if (accepted) { + const makePayment = await sendCoinFunc( + { amount, password: null, receiver: recipient }, + true + ); + return makePayment.res?.data; + } else { + throw new Error( + i18n.t('question:message.generic.user_declined_request', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + } else if (checkCoin === 'BTC') { + const amount = Number(data.amount); + const recipient = data?.recipient || data.destinationAddress; + const xprv58 = parsedData.btcPrivateKey; + const feePerByte = data.fee ? data.fee : btcFeePerByte; + + const btcWalletBalance = await getWalletBalance({ coin: checkCoin }, true); + + if (isNaN(Number(btcWalletBalance))) { + throw new Error( + i18n.t('question:message.error.fetch_balance_token', { + token: 'BTC', + postProcess: 'capitalizeFirstChar', + }) + ); + } + const btcWalletBalanceDecimals = Number(btcWalletBalance); + const btcAmountDecimals = Number(amount); + const fee = feePerByte * 500; // default 0.00050000 + if (btcAmountDecimals + fee > btcWalletBalanceDecimals) { + throw new Error( + i18n.t('question:message.error.insufficient_funds', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + + const resPermission = await getUserPermission( + { + text1: i18n.t('question:permission.send_coins', { + postProcess: 'capitalizeFirstChar', + }), + text2: i18n.t('question:to_recipient', { + recipient: recipient, + postProcess: 'capitalizeFirstChar', + }), + highlightedText: `${amount} ${checkCoin}`, + foreignFee: `${fee} BTC`, + }, + isFromExtension + ); + const { accepted } = resPermission; + + if (accepted) { + const opts = { + xprv58: xprv58, + receivingAddress: recipient, + bitcoinAmount: amount, + feePerByte: feePerByte, + }; + const url = await createEndpoint(`/crosschain/btc/send`); + + const response = await fetch(url, { + method: 'POST', + headers: { + Accept: 'application/json', + 'Content-Type': 'application/json', + }, + body: JSON.stringify(opts), + }); + if (!response.ok) + throw new Error( + i18n.t('question:message.error.send', { + postProcess: 'capitalizeFirstChar', + }) + ); + let res; + try { + res = await response.clone().json(); + } catch (e) { + res = await response.text(); + } + return res; + } else { + throw new Error( + i18n.t('question:message.generic.user_declined_request', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + } else if (checkCoin === 'LTC') { + const amount = Number(data.amount); + const recipient = data?.recipient || data.destinationAddress; + const xprv58 = parsedData.ltcPrivateKey; + const feePerByte = data.fee ? data.fee : ltcFeePerByte; + const ltcWalletBalance = await getWalletBalance({ coin: checkCoin }, true); + + if (isNaN(Number(ltcWalletBalance))) { + const errorMsg = i18n.t('question:message.error.fetch_balance_token', { + token: 'LTC', + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + const ltcWalletBalanceDecimals = Number(ltcWalletBalance); + const ltcAmountDecimals = Number(amount); + const fee = feePerByte * 1000; // default 0.00030000 + if (ltcAmountDecimals + fee > ltcWalletBalanceDecimals) { + throw new Error( + i18n.t('question:message.error.insufficient_funds', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + const resPermission = await getUserPermission( + { + text1: i18n.t('question:permission.send_coins', { + postProcess: 'capitalizeFirstChar', + }), + text2: i18n.t('question:to_recipient', { + recipient: recipient, + postProcess: 'capitalizeFirstChar', + }), + highlightedText: `${amount} ${checkCoin}`, + foreignFee: `${fee} LTC`, + }, + isFromExtension + ); + const { accepted } = resPermission; + + if (accepted) { + const url = await createEndpoint(`/crosschain/ltc/send`); + const opts = { + xprv58: xprv58, + receivingAddress: recipient, + litecoinAmount: amount, + feePerByte: feePerByte, + }; + const response = await fetch(url, { + method: 'POST', + headers: { + Accept: 'application/json', + 'Content-Type': 'application/json', + }, + body: JSON.stringify(opts), + }); + if (!response.ok) + throw new Error( + i18n.t('question:message.error.send', { + postProcess: 'capitalizeFirstChar', + }) + ); + let res; + try { + res = await response.clone().json(); + } catch (e) { + res = await response.text(); + } + return res; + } else { + throw new Error( + i18n.t('question:message.generic.user_declined_request', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + } else if (checkCoin === 'DOGE') { + const amount = Number(data.amount); + const recipient = data?.recipient || data.destinationAddress; + const xprv58 = parsedData.dogePrivateKey; + const feePerByte = data.fee ? data.fee : dogeFeePerByte; + const dogeWalletBalance = await getWalletBalance({ coin: checkCoin }, true); + if (isNaN(Number(dogeWalletBalance))) { + const errorMsg = i18n.t('question:message.error.fetch_balance_token', { + token: 'DOGE', + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + const dogeWalletBalanceDecimals = Number(dogeWalletBalance); + const dogeAmountDecimals = Number(amount); + const fee = feePerByte * 5000; // default 0.05000000 + if (dogeAmountDecimals + fee > dogeWalletBalanceDecimals) { + const errorMsg = i18n.t('question:message.error.insufficient_funds', { + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + + const resPermission = await getUserPermission( + { + text1: i18n.t('question:permission.send_coins', { + postProcess: 'capitalizeFirstChar', + }), + text2: i18n.t('question:to_recipient', { + recipient: recipient, + postProcess: 'capitalizeFirstChar', + }), + highlightedText: `${amount} ${checkCoin}`, + foreignFee: `${fee} DOGE`, + }, + isFromExtension + ); + const { accepted } = resPermission; + + if (accepted) { + const opts = { + xprv58: xprv58, + receivingAddress: recipient, + dogecoinAmount: amount, + feePerByte: feePerByte, + }; + const url = await createEndpoint(`/crosschain/doge/send`); + + const response = await fetch(url, { + method: 'POST', + headers: { + Accept: 'application/json', + 'Content-Type': 'application/json', + }, + body: JSON.stringify(opts), + }); + if (!response.ok) + throw new Error( + i18n.t('question:message.error.send', { + postProcess: 'capitalizeFirstChar', + }) + ); + let res; + try { + res = await response.clone().json(); + } catch (e) { + res = await response.text(); + } + return res; + } else { + throw new Error( + i18n.t('question:message.generic.user_declined_request', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + } else if (checkCoin === 'DGB') { + const amount = Number(data.amount); + const recipient = data?.recipient || data.destinationAddress; + const xprv58 = parsedData.dbgPrivateKey; + const feePerByte = data.fee ? data.fee : dgbFeePerByte; + const dgbWalletBalance = await getWalletBalance({ coin: checkCoin }, true); + if (isNaN(Number(dgbWalletBalance))) { + const errorMsg = i18n.t('question:message.error.fetch_balance_token', { + token: 'DGB', + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + const dgbWalletBalanceDecimals = Number(dgbWalletBalance); + const dgbAmountDecimals = Number(amount); + const fee = feePerByte * 500; // default 0.00005000 + if (dgbAmountDecimals + fee > dgbWalletBalanceDecimals) { + const errorMsg = i18n.t('question:message.error.insufficient_funds', { + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + + const resPermission = await getUserPermission( + { + text1: i18n.t('question:permission.send_coins', { + postProcess: 'capitalizeFirstChar', + }), + text2: `To: ${recipient}`, + highlightedText: `${amount} ${checkCoin}`, + foreignFee: `${fee} DGB`, + }, + isFromExtension + ); + const { accepted } = resPermission; + + if (accepted) { + const opts = { + xprv58: xprv58, + receivingAddress: recipient, + digibyteAmount: amount, + feePerByte: feePerByte, + }; + const url = await createEndpoint(`/crosschain/dgb/send`); + + const response = await fetch(url, { + method: 'POST', + headers: { + Accept: 'application/json', + 'Content-Type': 'application/json', + }, + body: JSON.stringify(opts), + }); + if (!response.ok) + throw new Error( + i18n.t('question:message.error.send', { + postProcess: 'capitalizeFirstChar', + }) + ); + let res; + try { + res = await response.clone().json(); + } catch (e) { + res = await response.text(); + } + return res; + } else { + throw new Error( + i18n.t('question:message.generic.user_declined_request', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + } else if (checkCoin === 'RVN') { + const amount = Number(data.amount); + const recipient = data?.recipient || data.destinationAddress; + const xprv58 = parsedData.rvnPrivateKey; + const feePerByte = data.fee ? data.fee : rvnFeePerByte; + const rvnWalletBalance = await getWalletBalance({ coin: checkCoin }, true); + if (isNaN(Number(rvnWalletBalance))) { + const errorMsg = i18n.t('question:message.error.fetch_balance_token', { + token: 'RVN', + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + const rvnWalletBalanceDecimals = Number(rvnWalletBalance); + const rvnAmountDecimals = Number(amount); + const fee = feePerByte * 500; // default 0.00562500 + if (rvnAmountDecimals + fee > rvnWalletBalanceDecimals) { + const errorMsg = i18n.t('question:message.error.insufficient_funds', { + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + + const resPermission = await getUserPermission( + { + text1: i18n.t('question:permission.send_coins', { + postProcess: 'capitalizeFirstChar', + }), + text2: `To: ${recipient}`, + highlightedText: `${amount} ${checkCoin}`, + foreignFee: `${fee} RVN`, + }, + isFromExtension + ); + const { accepted } = resPermission; + + if (accepted) { + const opts = { + xprv58: xprv58, + receivingAddress: recipient, + ravencoinAmount: amount, + feePerByte: feePerByte, + }; + const url = await createEndpoint(`/crosschain/rvn/send`); + + const response = await fetch(url, { + method: 'POST', + headers: { + Accept: 'application/json', + 'Content-Type': 'application/json', + }, + body: JSON.stringify(opts), + }); + if (!response.ok) + throw new Error( + i18n.t('question:message.error.send', { + postProcess: 'capitalizeFirstChar', + }) + ); + let res; + try { + res = await response.clone().json(); + } catch (e) { + res = await response.text(); + } + return res; + } else { + throw new Error( + i18n.t('question:message.generic.user_declined_request', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + } else if (checkCoin === 'ARRR') { + const amount = Number(data.amount); + const recipient = data?.recipient || data.destinationAddress; + const memo = data?.memo; + const arrrWalletBalance = await getWalletBalance({ coin: checkCoin }, true); + + if (isNaN(Number(arrrWalletBalance))) { + const errorMsg = i18n.t('question:message.error.fetch_balance_token', { + token: 'ARR', + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + const arrrWalletBalanceDecimals = Number(arrrWalletBalance); + const arrrAmountDecimals = Number(amount); + const fee = 0.0001; + if (arrrAmountDecimals + fee > arrrWalletBalanceDecimals) { + const errorMsg = i18n.t('question:message.error.insufficient_funds', { + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + + const resPermission = await getUserPermission( + { + text1: i18n.t('question:permission.send_coins', { + postProcess: 'capitalizeFirstChar', + }), + text2: `To: ${recipient}`, + highlightedText: `${amount} ${checkCoin}`, + foreignFee: `${fee} ARRR`, + }, + isFromExtension + ); + const { accepted } = resPermission; + + if (accepted) { + const opts = { + entropy58: parsedData.arrrSeed58, + receivingAddress: recipient, + arrrAmount: amount, + memo: memo, + }; + const url = await createEndpoint(`/crosschain/arrr/send`); + + const response = await fetch(url, { + method: 'POST', + headers: { + Accept: 'application/json', + 'Content-Type': 'application/json', + }, + body: JSON.stringify(opts), + }); + if (!response.ok) + throw new Error( + i18n.t('question:message.error.send', { + postProcess: 'capitalizeFirstChar', + }) + ); + let res; + try { + res = await response.clone().json(); + } catch (e) { + res = await response.text(); + } + return res; + } else { + throw new Error( + i18n.t('question:message.generic.user_declined_request', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + } +}; + +function calculateFeeFromRate(feePerKb, sizeInBytes) { + return (feePerKb / 1000) * sizeInBytes; +} + +const getBuyingFees = async (foreignBlockchain) => { + const ticker = sellerForeignFee[foreignBlockchain].ticker; + if (!ticker) throw new Error('invalid foreign blockchain'); + const unlockFee = await getForeignFee({ + coin: ticker, + type: 'feerequired', + }); + const lockFee = await getForeignFee({ + coin: ticker, + type: 'feekb', + }); + return { + ticker: ticker, + lock: { + sats: lockFee, + fee: lockFee / QORT_DECIMALS, + }, + unlock: { + sats: unlockFee, + fee: unlockFee / QORT_DECIMALS, + feePerKb: +calculateRateFromFee(+unlockFee, 300) / QORT_DECIMALS, + }, + }; +}; + +export const createBuyOrder = async (data, isFromExtension) => { + const requiredFields = ['crosschainAtInfo', 'foreignBlockchain']; + const missingFields: string[] = []; + requiredFields.forEach((field) => { + if (!data[field]) { + missingFields.push(field); + } + }); + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + const isGateway = await isRunningGateway(); + const foreignBlockchain = data.foreignBlockchain; + const atAddresses = data.crosschainAtInfo?.map( + (order) => order.qortalAtAddress + ); + + const atPromises = atAddresses.map((atAddress) => + requestQueueGetAtAddresses.enqueue(async () => { + const url = await createEndpoint(`/crosschain/trade/${atAddress}`); + const resAddress = await fetch(url); + const resData = await resAddress.json(); + if (foreignBlockchain !== resData?.foreignBlockchain) { + throw new Error( + i18n.t('core:message.error.same_foreign_blockchain', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + return resData; + }) + ); + + const crosschainAtInfo = await Promise.all(atPromises); + + try { + const buyingFees = await getBuyingFees(foreignBlockchain); + const resPermission = await getUserPermission( + { + text1: i18n.t('question:permission.buy_order', { + postProcess: 'capitalizeFirstChar', + }), + text2: i18n.t('question:permission.buy_order_quantity', { + quantity: atAddresses?.length, + postProcess: 'capitalizeFirstChar', + }), + text3: i18n.t('question:permission.buy_order_ticker', { + qort_amount: crosschainAtInfo?.reduce((latest, cur) => { + return latest + +cur?.qortAmount; + }, 0), + foreign_amount: roundUpToDecimals( + crosschainAtInfo?.reduce((latest, cur) => { + return latest + +cur?.expectedForeignAmount; + }, 0) + ), + ticker: buyingFees.ticker, + postProcess: 'capitalizeFirstChar', + }), + highlightedText: i18n.t('auth:node.using_public_gateway', { + gateway: isGateway, + postProcess: 'capitalizeFirstChar', + }), + fee: '', + html: ` +
+ + +
+
${i18n.t('question:total_unlocking_fee', { + postProcess: 'capitalizeFirstChar', + })}
+
${(+buyingFees?.unlock?.fee * atAddresses?.length)?.toFixed(8)} ${buyingFees.ticker}
+
+ ${i18n.t('question:permission.buy_order_fee_estimation', { + count: atAddresses?.length, + fee: buyingFees?.unlock?.feePerKb?.toFixed(8), + ticker: buyingFees.ticker, + postProcess: 'capitalizeFirstChar', + })} +
+
${i18n.t('question:total_locking_fee', { + postProcess: 'capitalizeFirstChar', + })}
+
${i18n.t('question:permission.buy_order_per_kb', { + fee: +buyingFees?.lock.fee.toFixed(8), + ticker: buyingFees.ticker, + postProcess: 'capitalizeFirstChar', + })} +
+
+
+`, + }, + isFromExtension + ); + const { accepted } = resPermission; + if (accepted) { + const resBuyOrder = await createBuyOrderTx({ + crosschainAtInfo, + isGateway, + foreignBlockchain, + }); + return resBuyOrder; + } else { + throw new Error( + i18n.t('question:message.generic.user_declined_request', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + } catch (error) { + throw new Error( + error?.message || + i18n.t('question:message.error.buy_order', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +const cancelTradeOfferTradeBot = async (body, keyPair) => { + const txn = new DeleteTradeOffer().createTransaction(body); + const url = await createEndpoint(`/crosschain/tradeoffer`); + const bodyToString = JSON.stringify(txn); + + const deleteTradeBotResponse = await fetch(url, { + method: 'DELETE', + headers: { + 'Content-Type': 'application/json', + }, + body: bodyToString, + }); + + if (!deleteTradeBotResponse.ok) { + throw new Error( + i18n.t('question:message.error.update_tradebot', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + + const unsignedTxn = await deleteTradeBotResponse.text(); + const signedTxnBytes = await signTradeBotTransaction(unsignedTxn, keyPair); + const signedBytes = Base58.encode(signedTxnBytes); + + let res; + try { + res = await processTransactionVersion2(signedBytes); + } catch (error) { + return { + error: i18n.t('question:message.error.cancel_sell_order', { + postProcess: 'capitalizeFirstChar', + }), + failedTradeBot: { + atAddress: body.atAddress, + creatorAddress: body.creatorAddress, + }, + }; + } + if (res?.error) { + return { + error: i18n.t('question:message.error.cancel_sell_order', { + postProcess: 'capitalizeFirstChar', + }), + failedTradeBot: { + atAddress: body.atAddress, + creatorAddress: body.creatorAddress, + }, + }; + } + if (res?.signature) { + return res; + } else { + throw new Error( + i18n.t('question:message.error.cancel_sell_order', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; +const findFailedTradebot = async (createBotCreationTimestamp, body) => { + //wait 5 secs + const wallet = await getSaveWallet(); + const address = wallet.address0; + await new Promise((res) => { + setTimeout(() => { + res(null); + }, 5000); + }); + const url = await createEndpoint( + `/crosschain/tradebot?foreignBlockchain=LITECOIN` + ); + + const tradeBotsReponse = await fetch(url, { + method: 'GET', + headers: { + 'Content-Type': 'application/json', + }, + }); + const data = await tradeBotsReponse.json(); + const latestItem2 = data + .filter((item) => item.creatorAddress === address) + .sort((a, b) => b.timestamp - a.timestamp)[0]; + const latestItem = data + .filter( + (item) => + item.creatorAddress === address && + +item.foreignAmount === +body.foreignAmount + ) + .sort((a, b) => b.timestamp - a.timestamp)[0]; + if ( + latestItem && + createBotCreationTimestamp - latestItem.timestamp <= 5000 && + createBotCreationTimestamp > latestItem.timestamp // Ensure latestItem's timestamp is before createBotCreationTimestamp + ) { + return latestItem; + } else { + return null; + } +}; +const tradeBotCreateRequest = async (body, keyPair) => { + const txn = new TradeBotCreateRequest().createTransaction(body); + const url = await createEndpoint(`/crosschain/tradebot/create`); + const bodyToString = JSON.stringify(txn); + + const unsignedTxnResponse = await fetch(url, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: bodyToString, + }); + if (!unsignedTxnResponse.ok) + throw new Error( + i18n.t('question:message.error.create_tradebot', { + postProcess: 'capitalizeFirstChar', + }) + ); + const createBotCreationTimestamp = Date.now(); + const unsignedTxn = await unsignedTxnResponse.text(); + const signedTxnBytes = await signTradeBotTransaction(unsignedTxn, keyPair); + const signedBytes = Base58.encode(signedTxnBytes); + + let res; + try { + res = await processTransactionVersion2(signedBytes); + } catch (error) { + const findFailedTradeBot = await findFailedTradebot( + createBotCreationTimestamp, + body + ); + return { + error: i18n.t('question:message.error.create_sell_order', { + postProcess: 'capitalizeFirstChar', + }), + failedTradeBot: findFailedTradeBot, + }; + } + + if (res?.signature) { + return res; + } else { + throw new Error( + i18n.t('question:message.error.create_sell_order', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const createSellOrder = async (data, isFromExtension) => { + const requiredFields = ['qortAmount', 'foreignBlockchain', 'foreignAmount']; + const missingFields: string[] = []; + requiredFields.forEach((field) => { + if (!data[field]) { + missingFields.push(field); + } + }); + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + + const parsedForeignAmount = Number(data.foreignAmount)?.toFixed(8); + + const receivingAddress = await getUserWalletFunc(data.foreignBlockchain); + try { + const resPermission = await getUserPermission( + { + text1: i18n.t('question:permission.sell_order', { + postProcess: 'capitalizeFirstChar', + }), + text2: i18n.t('question:permission.order_detail', { + qort_amount: data.qortAmount, + foreign_amount: parsedForeignAmount, + ticker: data.foreignBlockchain, + postProcess: 'capitalizeFirstChar', + }), + fee: '0.02', + }, + isFromExtension + ); + const { accepted } = resPermission; + if (accepted) { + const resKeyPair = await getKeyPair(); + const parsedData = resKeyPair; + const userPublicKey = parsedData.publicKey; + const uint8PrivateKey = Base58.decode(parsedData.privateKey); + const uint8PublicKey = Base58.decode(parsedData.publicKey); + const keyPair = { + privateKey: uint8PrivateKey, + publicKey: uint8PublicKey, + }; + const response = await tradeBotCreateRequest( + { + creatorPublicKey: userPublicKey, + qortAmount: parseFloat(data.qortAmount), + fundingQortAmount: parseFloat(data.qortAmount) + 0.01, + foreignBlockchain: data.foreignBlockchain, + foreignAmount: parseFloat(parsedForeignAmount), + tradeTimeout: 120, + receivingAddress: receivingAddress.address, + }, + keyPair + ); + + return response; + } else { + throw new Error( + i18n.t('question:message.generic.user_declined_request', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + } catch (error) { + throw new Error( + error?.message || + i18n.t('question:message.error.submit_sell_order', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const cancelSellOrder = async (data, isFromExtension) => { + const requiredFields = ['atAddress']; + const missingFields: string[] = []; + + requiredFields.forEach((field) => { + if (!data[field]) { + missingFields.push(field); + } + }); + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + + const url = await createEndpoint(`/crosschain/trade/${data.atAddress}`); + const resAddress = await fetch(url); + const resData = await resAddress.json(); + + if (!resData?.qortalAtAddress) + throw new Error( + i18n.t('question:message.error.at_info', { + postProcess: 'capitalizeFirstChar', + }) + ); + + try { + const fee = await getFee('MESSAGE'); + + const resPermission = await getUserPermission( + { + text1: i18n.t('question:permission.cancel_sell_order', { + postProcess: 'capitalizeFirstChar', + }), + text2: i18n.t('question:permission.order_detail', { + qort_amount: resData.qortAmount, + foreign_amount: resData.expectedForeignAmount, + ticker: resData.foreignBlockchain, + postProcess: 'capitalizeFirstChar', + }), + fee: fee.fee, + }, + isFromExtension + ); + const { accepted } = resPermission; + if (accepted) { + const resKeyPair = await getKeyPair(); + const parsedData = resKeyPair; + const userPublicKey = parsedData.publicKey; + const uint8PrivateKey = Base58.decode(parsedData.privateKey); + const uint8PublicKey = Base58.decode(parsedData.publicKey); + const keyPair = { + privateKey: uint8PrivateKey, + publicKey: uint8PublicKey, + }; + const response = await cancelTradeOfferTradeBot( + { + creatorPublicKey: userPublicKey, + atAddress: data.atAddress, + }, + keyPair + ); + + return response; + } else { + throw new Error( + i18n.t('question:message.generic.user_declined_request', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + } catch (error) { + throw new Error( + error?.message || + i18n.t('question:message.error.submit_sell_order', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const openNewTab = async (data, isFromExtension) => { + const requiredFields = ['qortalLink']; + const missingFields: string[] = []; + requiredFields.forEach((field) => { + if (!data[field]) { + missingFields.push(field); + } + }); + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + + const res = extractComponents(data.qortalLink); + if (res) { + const { service, name, identifier, path } = res; + if (!service && !name) + throw new Error( + i18n.t('auth:message.error.invalid_qortal_link', { + postProcess: 'capitalizeFirstChar', + }) + ); + executeEvent('addTab', { data: { service, name, identifier, path } }); + executeEvent('open-apps-mode', {}); + return true; + } else { + throw new Error( + i18n.t('auth:message.error.invalid_qortal_link', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const adminAction = async (data, isFromExtension) => { + const requiredFields = ['type']; + const missingFields: string[] = []; + requiredFields.forEach((field) => { + if (!data[field]) { + missingFields.push(field); + } + }); + // For actions that require a value, check for 'value' field + const actionsRequiringValue = [ + 'addpeer', + 'removepeer', + 'forcesync', + 'addmintingaccount', + 'removemintingaccount', + ]; + if (actionsRequiringValue.includes(data.type.toLowerCase()) && !data.value) { + missingFields.push('value'); + } + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + const isGateway = await isRunningGateway(); + if (isGateway) { + throw new Error( + i18n.t('question:message.generic.no_action_public_node', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + + let apiEndpoint = ''; + let method = 'GET'; // Default method + let includeValueInBody = false; + switch (data.type.toLowerCase()) { + case 'stop': + apiEndpoint = await createEndpoint('/admin/stop'); + break; + case 'restart': + apiEndpoint = await createEndpoint('/admin/restart'); + break; + case 'bootstrap': + apiEndpoint = await createEndpoint('/admin/bootstrap'); + break; + case 'addmintingaccount': + apiEndpoint = await createEndpoint('/admin/mintingaccounts'); + method = 'POST'; + includeValueInBody = true; + break; + case 'removemintingaccount': + apiEndpoint = await createEndpoint('/admin/mintingaccounts'); + method = 'DELETE'; + includeValueInBody = true; + break; + case 'forcesync': + apiEndpoint = await createEndpoint('/admin/forcesync'); + method = 'POST'; + includeValueInBody = true; + break; + case 'addpeer': + apiEndpoint = await createEndpoint('/peers'); + method = 'POST'; + includeValueInBody = true; + break; + case 'removepeer': + apiEndpoint = await createEndpoint('/peers'); + method = 'DELETE'; + includeValueInBody = true; + break; + default: + throw new Error( + i18n.t('question:message.error.unknown_admin_action_type', { + type: data.type, + postProcess: 'capitalizeFirstChar', + }) + ); + } + // Prepare the permission prompt text + let permissionText = i18n.t('question:permission.perform_admin_action', { + type: data.type, + postProcess: 'capitalizeFirstChar', + }); + + if (data.value) { + permissionText += + ' ' + + i18n.t('question:permission.perform_admin_action_with_value', { + value: data.value, + postProcess: 'capitalizeFirstChar', + }); + } + + const resPermission = await getUserPermission( + { + text1: permissionText, + }, + isFromExtension + ); + + const { accepted } = resPermission; + + if (accepted) { + // Set up options for the API call + const options: RequestInit = { + method: method, + headers: {}, + }; + if (includeValueInBody) { + options.headers['Content-Type'] = 'text/plain'; + options.body = data.value; + } + const response = await fetch(apiEndpoint, options); + if (!response.ok) + throw new Error( + i18n.t('question:message.error.perform_request', { + postProcess: 'capitalizeFirstChar', + }) + ); + + let res; + try { + res = await response.clone().json(); + } catch (e) { + res = await response.text(); + } + return res; + } else { + throw new Error( + i18n.t('question:message.generic.user_declined_request', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const signTransaction = async (data, isFromExtension) => { + const requiredFields = ['unsignedBytes']; + const missingFields: string[] = []; + requiredFields.forEach((field) => { + if (!data[field]) { + missingFields.push(field); + } + }); + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + + const shouldProcess = data?.process || false; + const _url = await createEndpoint( + '/transactions/decode?ignoreValidityChecks=false' + ); + + const _body = data.unsignedBytes; + const response = await fetch(_url, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: _body, + }); + + if (!response.ok) + throw new Error( + i18n.t('question:message.error.decode_transaction', { + postProcess: 'capitalizeFirstChar', + }) + ); + const decodedData = await response.json(); + const resPermission = await getUserPermission( + { + text1: shouldProcess + ? i18n.t('question:permission.sign_process_transaction', { + postProcess: 'capitalizeFirstChar', + }) + : i18n.t('question:permission.sign_transaction', { + postProcess: 'capitalizeFirstChar', + }), + highlightedText: i18n.t( + 'question:message.generic.read_transaction_carefully', + { postProcess: 'capitalizeFirstChar' } + ), + text2: `Tx type: ${decodedData.type}`, + json: decodedData, + }, + isFromExtension + ); + + const { accepted } = resPermission; + if (accepted) { + let urlConverted = await createEndpoint('/transactions/convert'); + + const responseConverted = await fetch(urlConverted, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: data.unsignedBytes, + }); + const resKeyPair = await getKeyPair(); + const parsedData = resKeyPair; + const uint8PrivateKey = Base58.decode(parsedData.privateKey); + const uint8PublicKey = Base58.decode(parsedData.publicKey); + const keyPair = { + privateKey: uint8PrivateKey, + publicKey: uint8PublicKey, + }; + const convertedBytes = await responseConverted.text(); + const txBytes = Base58.decode(data.unsignedBytes); + const _arbitraryBytesBuffer = Object.keys(txBytes).map(function (key) { + return txBytes[key]; + }); + const arbitraryBytesBuffer = new Uint8Array(_arbitraryBytesBuffer); + const txByteSigned = Base58.decode(convertedBytes); + const _bytesForSigningBuffer = Object.keys(txByteSigned).map( + function (key) { + return txByteSigned[key]; + } + ); + const bytesForSigningBuffer = new Uint8Array(_bytesForSigningBuffer); + const signature = nacl.sign.detached( + bytesForSigningBuffer, + keyPair.privateKey + ); + const signedBytes = utils.appendBuffer(arbitraryBytesBuffer, signature); + const signedBytesToBase58 = Base58.encode(signedBytes); + if (!shouldProcess) { + return signedBytesToBase58; + } + const res = await processTransactionVersion2(signedBytesToBase58); + if (!res?.signature) + throw new Error( + res?.message || + i18n.t('question:message.error.process_transaction', { + postProcess: 'capitalizeFirstChar', + }) + ); + return res; + } else { + throw new Error( + i18n.t('question:message.generic.user_declined_request', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +const missingFieldsFunc = (data, requiredFields) => { + const missingFields: string[] = []; + requiredFields.forEach((field) => { + if (!data[field]) { + missingFields.push(field); + } + }); + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } +}; + +const encode = (value) => encodeURIComponent(value.trim()); // Helper to encode values +const buildQueryParams = (data) => { + const allowedParams = [ + 'name', + 'service', + 'identifier', + 'mimeType', + 'fileName', + 'encryptionType', + 'key', + ]; + return Object.entries(data) + .map(([key, value]) => { + if ( + value === undefined || + value === null || + value === false || + !allowedParams.includes(key) + ) + return null; // Skip null, undefined, or false + if (typeof value === 'boolean') return `${key}=${value}`; // Handle boolean values + return `${key}=${encode(value)}`; // Encode other values + }) + .filter(Boolean) // Remove null values + .join('&'); // Join with `&` +}; +export const createAndCopyEmbedLink = async (data, isFromExtension) => { + const requiredFields = ['type']; + const missingFields: string[] = []; + requiredFields.forEach((field) => { + if (!data[field]) { + missingFields.push(field); + } + }); + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + + switch (data.type) { + case 'POLL': { + missingFieldsFunc(data, ['type', 'name']); + + const queryParams = [ + `name=${encode(data.name)}`, + data.ref ? `ref=${encode(data.ref)}` : null, // Add only if ref exists + ] + .filter(Boolean) // Remove null values + .join('&'); // Join with `&` + const link = `qortal://use-embed/POLL?${queryParams}`; + try { + await navigator.clipboard.writeText(link); + } catch (error) { + throw new Error( + i18n.t('question:message.error.copy_clipboard', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + return link; + } + case 'IMAGE': + case 'ATTACHMENT': { + missingFieldsFunc(data, ['type', 'name', 'service', 'identifier']); + if (data?.encryptionType === 'private' && !data?.key) { + throw new Error( + i18n.t('question:message.generic.provide_key_shared_link', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + const queryParams = buildQueryParams(data); + + const link = `qortal://use-embed/${data.type}?${queryParams}`; + + try { + await navigator.clipboard.writeText(link); + } catch (error) { + throw new Error( + i18n.t('question:message.error.copy_clipboard', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + + return link; + } + + default: + throw new Error( + i18n.t('question:message.error.invalid_type', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const registerNameRequest = async (data, isFromExtension) => { + const requiredFields = ['name']; + const missingFields: string[] = []; + requiredFields.forEach((field) => { + if (!data[field]) { + missingFields.push(field); + } + }); + + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + const fee = await getFee('REGISTER_NAME'); + const resPermission = await getUserPermission( + { + text1: i18n.t('question:permission.register_name', { + postProcess: 'capitalizeFirstChar', + }), + highlightedText: data.name, + text2: data?.description, + fee: fee.fee, + }, + isFromExtension + ); + const { accepted } = resPermission; + if (accepted) { + const name = data.name; + const description = data?.description || ''; + const response = await registerName({ name, description }); + return response; + } else { + throw new Error( + i18n.t('question:message.generic.user_declined_request', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const updateNameRequest = async (data, isFromExtension) => { + const requiredFields = ['newName', 'oldName']; + const missingFields: string[] = []; + requiredFields.forEach((field) => { + if (!data[field]) { + missingFields.push(field); + } + }); + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + const oldName = data.oldName; + const newName = data.newName; + const description = data?.description || ''; + const fee = await getFee('UPDATE_NAME'); + const resPermission = await getUserPermission( + { + text1: `Do you give this application permission to update this name?`, // TODO translate + text2: `previous name: ${oldName}`, + text3: `new name: ${newName}`, + text4: data?.description, + fee: fee.fee, + }, + isFromExtension + ); + const { accepted } = resPermission; + if (accepted) { + const response = await updateName({ oldName, newName, description }); + return response; + } else { + throw new Error( + i18n.t('question:message.generic.user_declined_request', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const leaveGroupRequest = async (data, isFromExtension) => { + const requiredFields = ['groupId']; + const missingFields: string[] = []; + requiredFields.forEach((field) => { + if (!data[field]) { + missingFields.push(field); + } + }); + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + const groupId = data.groupId; + let groupInfo = null; + try { + const url = await createEndpoint(`/groups/${groupId}`); + const response = await fetch(url); + if (!response.ok) + throw new Error( + i18n.t('question:message.error.fetch_group', { + postProcess: 'capitalizeFirstChar', + }) + ); + + groupInfo = await response.json(); + } catch (error) { + const errorMsg = + (error && error.message) || + i18n.t('question:message.error.no_group_found', { + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + + const fee = await getFee('LEAVE_GROUP'); + const resPermission = await getUserPermission( + { + text1: i18n.t('question:permission.leave_group', { + postProcess: 'capitalizeFirstChar', + }), + highlightedText: `${groupInfo.groupName}`, + fee: fee.fee, + }, + isFromExtension + ); + const { accepted } = resPermission; + if (accepted) { + const response = await leaveGroup({ groupId }); + return response; + } else { + throw new Error( + i18n.t('question:message.generic.user_declined_request', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const inviteToGroupRequest = async (data, isFromExtension) => { + const requiredFields = ['groupId', 'inviteTime', 'inviteeAddress']; + const missingFields: string[] = []; + requiredFields.forEach((field) => { + if (!data[field]) { + missingFields.push(field); + } + }); + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + const groupId = data.groupId; + const qortalAddress = data?.inviteeAddress; + const inviteTime = data?.inviteTime; + const txGroupId = data?.txGroupId || 0; + + let groupInfo = null; + try { + const url = await createEndpoint(`/groups/${groupId}`); + const response = await fetch(url); + if (!response.ok) + throw new Error( + i18n.t('question:message.error.fetch_group', { + postProcess: 'capitalizeFirstChar', + }) + ); + + groupInfo = await response.json(); + } catch (error) { + const errorMsg = + (error && error.message) || + i18n.t('question:message.error.no_group_found', { + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + + const displayInvitee = await getNameInfoForOthers(qortalAddress); + + const fee = await getFee('GROUP_INVITE'); + const resPermission = await getUserPermission( + { + text1: i18n.t('question:permission.invite', { + invitee: displayInvitee || qortalAddress, + postProcess: 'capitalizeFirstChar', + }), + highlightedText: i18n.t('group:group.group_name', { + name: groupInfo?.groupName, + postProcess: 'capitalizeFirstChar', + }), + fee: fee.fee, + }, + isFromExtension + ); + const { accepted } = resPermission; + if (accepted) { + const response = await inviteToGroup({ + groupId, + qortalAddress, + inviteTime, + txGroupId, + }); + return response; + } else { + throw new Error( + i18n.t('question:message.generic.user_declined_request', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const kickFromGroupRequest = async (data, isFromExtension) => { + const requiredFields = ['groupId', 'qortalAddress']; + const missingFields: string[] = []; + requiredFields.forEach((field) => { + if (!data[field]) { + missingFields.push(field); + } + }); + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + const groupId = data.groupId; + const qortalAddress = data?.qortalAddress; + const reason = data?.reason; + const txGroupId = data?.txGroupId || 0; + let groupInfo = null; + try { + const url = await createEndpoint(`/groups/${groupId}`); + const response = await fetch(url); + if (!response.ok) + throw new Error( + i18n.t('question:message.error.fetch_group', { + postProcess: 'capitalizeFirstChar', + }) + ); + + groupInfo = await response.json(); + } catch (error) { + const errorMsg = + (error && error.message) || + i18n.t('question:message.error.no_group_found', { + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + + const displayInvitee = await getNameInfoForOthers(qortalAddress); + + const fee = await getFee('GROUP_KICK'); + const resPermission = await getUserPermission( + { + text1: i18n.t('question:permission.kick', { + partecipant: displayInvitee || qortalAddress, + postProcess: 'capitalizeFirstChar', + }), + highlightedText: i18n.t('group:group.group_name', { + name: groupInfo?.groupName, + postProcess: 'capitalizeFirstChar', + }), + fee: fee.fee, + }, + isFromExtension + ); + const { accepted } = resPermission; + if (accepted) { + const response = await kickFromGroup({ + groupId, + qortalAddress, + rBanReason: reason, + txGroupId, + }); + return response; + } else { + throw new Error( + i18n.t('question:message.generic.user_declined_request', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const banFromGroupRequest = async (data, isFromExtension) => { + const requiredFields = ['groupId', 'qortalAddress']; + const missingFields: string[] = []; + requiredFields.forEach((field) => { + if (!data[field]) { + missingFields.push(field); + } + }); + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + const groupId = data.groupId; + const qortalAddress = data?.qortalAddress; + const rBanTime = data?.banTime; + const reason = data?.reason; + const txGroupId = data?.txGroupId || 0; + let groupInfo = null; + try { + const url = await createEndpoint(`/groups/${groupId}`); + const response = await fetch(url); + if (!response.ok) + throw new Error( + i18n.t('question:message.error.fetch_group', { + postProcess: 'capitalizeFirstChar', + }) + ); + + groupInfo = await response.json(); + } catch (error) { + const errorMsg = + (error && error.message) || + i18n.t('question:message.error.no_group_found', { + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + + const displayInvitee = await getNameInfoForOthers(qortalAddress); + + const fee = await getFee('GROUP_BAN'); + const resPermission = await getUserPermission( + { + text1: i18n.t('question:permission.ban', { + partecipant: displayInvitee || qortalAddress, + postProcess: 'capitalizeFirstChar', + }), + highlightedText: i18n.t('group:group.group_name', { + name: groupInfo?.groupName, + postProcess: 'capitalizeFirstChar', + }), + fee: fee.fee, + }, + isFromExtension + ); + const { accepted } = resPermission; + if (accepted) { + const response = await banFromGroup({ + groupId, + qortalAddress, + rBanTime, + rBanReason: reason, + txGroupId, + }); + return response; + } else { + throw new Error( + i18n.t('question:message.generic.user_declined_request', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const cancelGroupBanRequest = async (data, isFromExtension) => { + const requiredFields = ['groupId', 'qortalAddress']; + const missingFields: string[] = []; + requiredFields.forEach((field) => { + if (!data[field]) { + missingFields.push(field); + } + }); + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + const groupId = data.groupId; + const qortalAddress = data?.qortalAddress; + const txGroupId = data?.txGroupId || 0; + + let groupInfo = null; + try { + const url = await createEndpoint(`/groups/${groupId}`); + const response = await fetch(url); + if (!response.ok) + throw new Error( + i18n.t('question:message.error.fetch_group', { + postProcess: 'capitalizeFirstChar', + }) + ); + + groupInfo = await response.json(); + } catch (error) { + const errorMsg = + (error && error.message) || + i18n.t('question:message.error.no_group_found', { + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + + const displayInvitee = await getNameInfoForOthers(qortalAddress); + + const fee = await getFee('CANCEL_GROUP_BAN'); + const resPermission = await getUserPermission( + { + text1: i18n.t('question:permission.cancel_ban', { + partecipant: displayInvitee || qortalAddress, + postProcess: 'capitalizeFirstChar', + }), + highlightedText: i18n.t('group:group.group_name', { + name: groupInfo?.groupName, + postProcess: 'capitalizeFirstChar', + }), + fee: fee.fee, + }, + isFromExtension + ); + const { accepted } = resPermission; + if (accepted) { + const response = await cancelBan({ + groupId, + qortalAddress, + txGroupId, + }); + return response; + } else { + throw new Error( + i18n.t('question:message.generic.user_declined_request', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const addGroupAdminRequest = async (data, isFromExtension) => { + const requiredFields = ['groupId', 'qortalAddress']; + const missingFields: string[] = []; + requiredFields.forEach((field) => { + if (!data[field]) { + missingFields.push(field); + } + }); + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + const groupId = data.groupId; + const qortalAddress = data?.qortalAddress; + const txGroupId = data?.txGroupId || 0; + + let groupInfo = null; + try { + const url = await createEndpoint(`/groups/${groupId}`); + const response = await fetch(url); + if (!response.ok) + throw new Error( + i18n.t('question:message.error.fetch_group', { + postProcess: 'capitalizeFirstChar', + }) + ); + + groupInfo = await response.json(); + } catch (error) { + const errorMsg = + (error && error.message) || + i18n.t('question:message.error.no_group_found', { + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + + const displayInvitee = await getNameInfoForOthers(qortalAddress); + + const fee = await getFee('ADD_GROUP_ADMIN'); + const resPermission = await getUserPermission( + { + text1: i18n.t('question:permission.add_admin', { + invitee: displayInvitee || qortalAddress, + postProcess: 'capitalizeFirstChar', + }), + highlightedText: i18n.t('group:group.group_name', { + name: groupInfo?.groupName, + postProcess: 'capitalizeFirstChar', + }), + fee: fee.fee, + }, + isFromExtension + ); + const { accepted } = resPermission; + if (accepted) { + const response = await makeAdmin({ + groupId, + qortalAddress, + txGroupId, + }); + return response; + } else { + throw new Error( + i18n.t('question:message.generic.user_declined_request', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const removeGroupAdminRequest = async (data, isFromExtension) => { + const requiredFields = ['groupId', 'qortalAddress']; + const missingFields: string[] = []; + requiredFields.forEach((field) => { + if (!data[field]) { + missingFields.push(field); + } + }); + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + const groupId = data.groupId; + const qortalAddress = data?.qortalAddress; + const txGroupId = data?.txGroupId || 0; + let groupInfo = null; + try { + const url = await createEndpoint(`/groups/${groupId}`); + const response = await fetch(url); + if (!response.ok) + throw new Error( + i18n.t('question:message.error.fetch_group', { + postProcess: 'capitalizeFirstChar', + }) + ); + + groupInfo = await response.json(); + } catch (error) { + const errorMsg = + (error && error.message) || + i18n.t('question:message.error.no_group_found', { + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + + const displayInvitee = await getNameInfoForOthers(qortalAddress); + + const fee = await getFee('REMOVE_GROUP_ADMIN'); + const resPermission = await getUserPermission( + { + text1: i18n.t('question:permission.remove_admin', { + partecipant: displayInvitee || qortalAddress, + postProcess: 'capitalizeFirstChar', + }), + highlightedText: i18n.t('group:group.group_name', { + name: groupInfo?.groupName, + postProcess: 'capitalizeFirstChar', + }), + fee: fee.fee, + }, + isFromExtension + ); + const { accepted } = resPermission; + if (accepted) { + const response = await removeAdmin({ + groupId, + qortalAddress, + txGroupId, + }); + return response; + } else { + throw new Error( + i18n.t('question:message.generic.user_declined_request', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const cancelGroupInviteRequest = async (data, isFromExtension) => { + const requiredFields = ['groupId', 'qortalAddress']; + const missingFields: string[] = []; + requiredFields.forEach((field) => { + if (!data[field]) { + missingFields.push(field); + } + }); + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + const groupId = data.groupId; + const qortalAddress = data?.qortalAddress; + const txGroupId = data?.txGroupId || 0; + + let groupInfo = null; + try { + const url = await createEndpoint(`/groups/${groupId}`); + const response = await fetch(url); + if (!response.ok) + throw new Error( + i18n.t('question:message.error.fetch_group', { + postProcess: 'capitalizeFirstChar', + }) + ); + + groupInfo = await response.json(); + } catch (error) { + const errorMsg = + (error && error.message) || + i18n.t('question:message.error.no_group_found', { + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + + const displayInvitee = await getNameInfoForOthers(qortalAddress); + + const fee = await getFee('CANCEL_GROUP_INVITE'); + const resPermission = await getUserPermission( + { + text1: i18n.t('question:permission.cancel_group_invite', { + invitee: displayInvitee || qortalAddress, + postProcess: 'capitalizeFirstChar', + }), + highlightedText: i18n.t('group:group.group_name', { + name: groupInfo?.groupName, + postProcess: 'capitalizeFirstChar', + }), + fee: fee.fee, + }, + isFromExtension + ); + + const { accepted } = resPermission; + + if (accepted) { + const response = await cancelInvitationToGroup({ + groupId, + qortalAddress, + txGroupId, + }); + return response; + } else { + throw new Error( + i18n.t('question:message.generic.user_declined_request', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const createGroupRequest = async (data, isFromExtension) => { + const requiredFields = [ + 'approvalThreshold', + 'groupId', + 'groupName', + 'maxBlock', + 'minBlock', + 'qortalAddress', + 'type', + ]; + const missingFields: string[] = []; + requiredFields.forEach((field) => { + if (data[field] === undefined || data[field] === null) { + missingFields.push(field); + } + }); + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + const groupName = data.groupName; + const description = data?.description || ''; + const type = +data.type; + const approvalThreshold = +data?.approvalThreshold; + const minBlock = +data?.minBlock; + const maxBlock = +data.maxBlock; + + const fee = await getFee('CREATE_GROUP'); + const resPermission = await getUserPermission( + { + text1: i18n.t('question:permission.create_group', { + postProcess: 'capitalizeFirstChar', + }), + highlightedText: i18n.t('group:group.group_name', { + name: groupName, + postProcess: 'capitalizeFirstChar', + }), + fee: fee.fee, + }, + isFromExtension + ); + const { accepted } = resPermission; + if (accepted) { + const response = await createGroup({ + groupName, + groupDescription: description, + groupType: type, + groupApprovalThreshold: approvalThreshold, + minBlock, + maxBlock, + }); + return response; + } else { + throw new Error( + i18n.t('question:message.generic.user_declined_request', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const updateGroupRequest = async (data, isFromExtension) => { + const requiredFields = [ + 'groupId', + 'newOwner', + 'type', + 'approvalThreshold', + 'minBlock', + 'maxBlock', + ]; + const missingFields: string[] = []; + requiredFields.forEach((field) => { + if (data[field] === undefined || data[field] === null) { + missingFields.push(field); + } + }); + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + const groupId = +data.groupId; + const newOwner = data.newOwner; + const description = data?.description || ''; + const type = +data.type; + const approvalThreshold = +data?.approvalThreshold; + const minBlock = +data?.minBlock; + const maxBlock = +data.maxBlock; + const txGroupId = data?.txGroupId || 0; + let groupInfo = null; + try { + const url = await createEndpoint(`/groups/${groupId}`); + const response = await fetch(url); + if (!response.ok) + throw new Error( + i18n.t('question:message.error.fetch_group', { + postProcess: 'capitalizeFirstChar', + }) + ); + + groupInfo = await response.json(); + } catch (error) { + const errorMsg = + (error && error.message) || + i18n.t('question:message.error.no_group_found', { + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + + const displayInvitee = await getNameInfoForOthers(newOwner); + + const fee = await getFee('CREATE_GROUP'); + const resPermission = await getUserPermission( + { + text1: i18n.t('question:permission.update_group', { + postProcess: 'capitalizeFirstChar', + }), + text2: i18n.t('question:permission.update_group_detail', { + owner: displayInvitee || newOwner, + postProcess: 'capitalizeFirstChar', + }), + highlightedText: i18n.t('group:group.group_name', { + name: groupInfo?.groupName, + postProcess: 'capitalizeFirstChar', + }), + fee: fee.fee, + }, + isFromExtension + ); + const { accepted } = resPermission; + if (accepted) { + const response = await updateGroup({ + groupId, + newOwner, + newIsOpen: type, + newDescription: description, + newApprovalThreshold: approvalThreshold, + newMinimumBlockDelay: minBlock, + newMaximumBlockDelay: maxBlock, + txGroupId, + }); + return response; + } else { + throw new Error( + i18n.t('question:message.generic.user_declined_request', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const decryptAESGCMRequest = async (data, isFromExtension) => { + const requiredFields = ['encryptedData', 'iv', 'senderPublicKey']; + requiredFields.forEach((field) => { + if (!data[field]) { + throw new Error( + i18n.t('question:message.error.missing_fields', { + fields: field, + postProcess: 'capitalizeFirstChar', + }) + ); + } + }); + + const encryptedData = data.encryptedData; + const iv = data.iv; + const senderPublicKeyBase58 = data.senderPublicKey; + + // Decode keys and IV + const senderPublicKey = Base58.decode(senderPublicKeyBase58); + const resKeyPair = await getKeyPair(); // Assume this retrieves the current user's keypair + const uint8PrivateKey = Base58.decode(resKeyPair.privateKey); + + // Convert ed25519 keys to Curve25519 + const convertedPrivateKey = ed2curve.convertSecretKey(uint8PrivateKey); + const convertedPublicKey = ed2curve.convertPublicKey(senderPublicKey); + + // Generate shared secret + const sharedSecret = new Uint8Array(32); + nacl.lowlevel.crypto_scalarmult( + sharedSecret, + convertedPrivateKey, + convertedPublicKey + ); + + // Derive encryption key + const encryptionKey: Uint8Array = new Sha256() + .process(sharedSecret) + .finish().result; + + // Convert IV and ciphertext from Base64 + const base64ToUint8Array = (base64) => + Uint8Array.from(atob(base64), (c) => c.charCodeAt(0)); + const ivUint8Array = base64ToUint8Array(iv); + const ciphertext = base64ToUint8Array(encryptedData); + // Validate IV and key lengths + if (ivUint8Array.length !== 12) { + throw new Error( + i18n.t('question:message.error.invalid_encryption_iv', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + if (encryptionKey.length !== 32) { + throw new Error( + i18n.t('question:message.error.invalid_encryption_key', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + + try { + // Decrypt data + const algorithm = { name: 'AES-GCM', iv: ivUint8Array }; + const cryptoKey = await crypto.subtle.importKey( + 'raw', + encryptionKey, + algorithm, + false, + ['decrypt'] + ); + const decryptedArrayBuffer = await crypto.subtle.decrypt( + algorithm, + cryptoKey, + ciphertext + ); + + // Return decrypted data as Base64 + return uint8ArrayToBase64(new Uint8Array(decryptedArrayBuffer)); + } catch (error) { + console.error('Decryption failed:', error); + throw new Error( + i18n.t('question:message.error.decrypt_message', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const sellNameRequest = async (data, isFromExtension) => { + const requiredFields = ['salePrice', 'nameForSale']; + const missingFields: string[] = []; + requiredFields.forEach((field) => { + if (data[field] === undefined || data[field] === null) { + missingFields.push(field); + } + }); + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + const name = data.nameForSale; + const sellPrice = +data.salePrice; + + const validApi = await getBaseApi(); + + const response = await fetch(validApi + '/names/' + name); + const nameData = await response.json(); + if (!nameData) + throw new Error( + i18n.t('auth:message.error.name_not_existing', { + postProcess: 'capitalizeFirstChar', + }) + ); + + if (nameData?.isForSale) + throw new Error( + i18n.t('question:message.error.name_already_for_sale', { + postProcess: 'capitalizeFirstChar', + }) + ); + const fee = await getFee('SELL_NAME'); + const resPermission = await getUserPermission( + { + text1: i18n.t('question:permission.sell_name_transaction', { + postProcess: 'capitalizeFirstChar', + }), + highlightedText: i18n.t( + 'question:permission.sell_name_transaction_detail', + { + name: name, + price: sellPrice, + postProcess: 'capitalizeFirstChar', + } + ), + fee: fee.fee, + }, + isFromExtension + ); + const { accepted } = resPermission; + if (accepted) { + const response = await sellName({ + name, + sellPrice, + }); + return response; + } else { + throw new Error( + i18n.t('question:message.generic.user_declined_request', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const cancelSellNameRequest = async (data, isFromExtension) => { + const requiredFields = ['nameForSale']; + const missingFields: string[] = []; + requiredFields.forEach((field) => { + if (data[field] === undefined || data[field] === null) { + missingFields.push(field); + } + }); + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + const name = data.nameForSale; + const validApi = await getBaseApi(); + + const response = await fetch(validApi + '/names/' + name); + const nameData = await response.json(); + if (!nameData?.isForSale) + throw new Error( + i18n.t('question:message.error.name_not_for_sale', { + postProcess: 'capitalizeFirstChar', + }) + ); + + const fee = await getFee('CANCEL_SELL_NAME'); + const resPermission = await getUserPermission( + { + text1: i18n.t('question:permission.sell_name_cancel', { + postProcess: 'capitalizeFirstChar', + }), + highlightedText: i18n.t('question:name', { + name: name, + postProcess: 'capitalizeFirstChar', + }), + fee: fee.fee, + }, + isFromExtension + ); + const { accepted } = resPermission; + if (accepted) { + const response = await cancelSellName({ + name, + }); + return response; + } else { + throw new Error( + i18n.t('question:message.generic.user_declined_request', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const buyNameRequest = async (data, isFromExtension) => { + const requiredFields = ['nameForSale']; + const missingFields: string[] = []; + requiredFields.forEach((field) => { + if (data[field] === undefined || data[field] === null) { + missingFields.push(field); + } + }); + if (missingFields.length > 0) { + const missingFieldsString = missingFields.join(', '); + const errorMsg = i18n.t('question:message.error.missing_fields', { + fields: missingFieldsString, + postProcess: 'capitalizeFirstChar', + }); + throw new Error(errorMsg); + } + + const name = data.nameForSale; + const validApi = await getBaseApi(); + const response = await fetch(validApi + '/names/' + name); + const nameData = await response.json(); + + if (!nameData?.isForSale) + throw new Error( + i18n.t('question:message.error.name_not_for_sale', { + postProcess: 'capitalizeFirstChar', + }) + ); + + const sellerAddress = nameData.owner; + const sellPrice = +nameData.salePrice; + + const fee = await getFee('BUY_NAME'); + const resPermission = await getUserPermission( + { + text1: i18n.t('question:permission.buy_name', { + postProcess: 'capitalizeFirstChar', + }), + highlightedText: i18n.t('question:permission.buy_name_detail', { + name: name, + price: sellPrice, + postProcess: 'capitalizeFirstChar', + }), + fee: fee.fee, + }, + isFromExtension + ); + const { accepted } = resPermission; + if (accepted) { + const response = await buyName({ + name, + sellerAddress, + sellPrice, + }); + return response; + } else { + throw new Error( + i18n.t('question:message.generic.user_declined_request', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; + +export const signForeignFees = async (data, isFromExtension) => { + const resPermission = await getUserPermission( + { + text1: i18n.t('question:permission.sign_fee', { + postProcess: 'capitalizeFirstChar', + }), + }, + isFromExtension + ); + const { accepted } = resPermission; + if (accepted) { + const wallet = await getSaveWallet(); + const address = wallet.address0; + const resKeyPair = await getKeyPair(); + const parsedData = resKeyPair; + const uint8PrivateKey = Base58.decode(parsedData.privateKey); + const uint8PublicKey = Base58.decode(parsedData.publicKey); + const keyPair = { + privateKey: uint8PrivateKey, + publicKey: uint8PublicKey, + }; + + const unsignedFeesUrl = await createEndpoint( + `/crosschain/unsignedfees/${address}` + ); + + const unsignedFeesResponse = await fetch(unsignedFeesUrl); + + const unsignedFees = await unsignedFeesResponse.json(); + + const signedFees = []; + + unsignedFees.forEach((unsignedFee) => { + const unsignedDataDecoded = Base58.decode(unsignedFee.data); + + const signature = nacl.sign.detached( + unsignedDataDecoded, + keyPair.privateKey + ); + + const signedFee = { + timestamp: unsignedFee.timestamp, + data: `${Base58.encode(signature)}`, + atAddress: unsignedFee.atAddress, + fee: unsignedFee.fee, + }; + + signedFees.push(signedFee); + }); + + const signedFeesUrl = await createEndpoint(`/crosschain/signedfees`); + + await fetch(signedFeesUrl, { + method: 'POST', + headers: { + Accept: '*/*', + 'Content-Type': 'application/json', + }, + body: `${JSON.stringify(signedFees)}`, + }); + + return true; + } else { + throw new Error( + i18n.t('question:message.generic.user_declined_request', { + postProcess: 'capitalizeFirstChar', + }) + ); + } +}; +export const multiPaymentWithPrivateData = async (data, isFromExtension) => { + const requiredFields = ['payments', 'assetId']; + requiredFields.forEach((field) => { + if (data[field] === undefined || data[field] === null) { + throw new Error( + i18n.t('question:message.error.missing_fields', { + fields: field, + postProcess: 'capitalizeFirstChar', + }) + ); + } + }); + const resKeyPair = await getKeyPair(); + const parsedData = resKeyPair; + const privateKey = parsedData.privateKey; + const userPublicKey = parsedData.publicKey; + const { fee: paymentFee } = await getFee('TRANSFER_ASSET'); + const { fee: arbitraryFee } = await getFee('ARBITRARY'); + + let name = null; + const payments = data.payments; + const assetId = data.assetId; + const pendingTransactions = []; + const pendingAdditionalArbitraryTxs = []; + const additionalArbitraryTxsWithoutPayment = + data?.additionalArbitraryTxsWithoutPayment || []; + let totalAmount = 0; + let fee = 0; + for (const payment of payments) { + const paymentRefId = uid.rnd(); + const requiredFieldsPayment = ['recipient', 'amount']; + + for (const field of requiredFieldsPayment) { + if (!payment[field]) { + throw new Error( + i18n.t('question:message.error.missing_fields', { + fields: field, + postProcess: 'capitalizeFirstChar', + }) + ); + } + } + + const confirmReceiver = await getNameOrAddress(payment.recipient); + if (confirmReceiver.error) { + throw new Error( + i18n.t('question:message.error.invalid_receiver', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + const receiverPublicKey = await getPublicKey(confirmReceiver); + + const amount = +payment.amount.toFixed(8); + + pendingTransactions.push({ + type: 'PAYMENT', + recipientAddress: confirmReceiver, + amount: amount, + paymentRefId, + }); + + fee = fee + +paymentFee; + totalAmount = totalAmount + amount; + + if (payment.arbitraryTxs && payment.arbitraryTxs.length > 0) { + for (const arbitraryTx of payment.arbitraryTxs) { + const requiredFieldsArbitraryTx = ['service', 'identifier', 'base64']; + + for (const field of requiredFieldsArbitraryTx) { + if (!arbitraryTx[field]) { + throw new Error( + i18n.t('question:message.error.missing_fields', { + fields: field, + postProcess: 'capitalizeFirstChar', + }) + ); + } + } + + if (!name) { + const getName = await getNameInfo(); + if (!getName) + throw new Error( + i18n.t('question:message.error.registered_name', { + postProcess: 'capitalizeFirstChar', + }) + ); + name = getName; + } + + const isValid = isValidBase64WithDecode(arbitraryTx.base64); + if (!isValid) + throw new Error( + i18n.t('core:message.error.invalid_base64', { + postProcess: 'capitalizeFirstChar', + }) + ); + if (!arbitraryTx?.service?.includes('_PRIVATE')) + throw new Error( + i18n.t('question:message.generic.private_service', { + postProcess: 'capitalizeFirstChar', + }) + ); + const additionalPublicKeys = arbitraryTx?.additionalPublicKeys || []; + pendingTransactions.push({ + type: 'ARBITRARY', + identifier: arbitraryTx.identifier, + service: arbitraryTx.service, + base64: arbitraryTx.base64, + description: arbitraryTx?.description || '', + paymentRefId, + publicKeys: [receiverPublicKey, ...additionalPublicKeys], + }); + + fee = fee + +arbitraryFee; + } + } + } + + if ( + additionalArbitraryTxsWithoutPayment && + additionalArbitraryTxsWithoutPayment.length > 0 + ) { + for (const arbitraryTx of additionalArbitraryTxsWithoutPayment) { + const requiredFieldsArbitraryTx = ['service', 'identifier', 'base64']; + + for (const field of requiredFieldsArbitraryTx) { + if (!arbitraryTx[field]) { + throw new Error( + i18n.t('question:message.error.missing_fields', { + fields: field, + postProcess: 'capitalizeFirstChar', + }) + ); + } + } + + if (!name) { + const getName = await getNameInfo(); + if (!getName) + throw new Error( + i18n.t('question:message.error.registered_name', { + postProcess: 'capitalizeFirstChar', + }) + ); + name = getName; + } + + const isValid = isValidBase64WithDecode(arbitraryTx.base64); + if (!isValid) + throw new Error( + i18n.t('core:message.error.invalid_base64', { + postProcess: 'capitalizeFirstChar', + }) + ); + if (!arbitraryTx?.service?.includes('_PRIVATE')) + throw new Error( + i18n.t('question:message.generic.private_service', { + postProcess: 'capitalizeFirstChar', + }) + ); + const additionalPublicKeys = arbitraryTx?.additionalPublicKeys || []; + pendingAdditionalArbitraryTxs.push({ + type: 'ARBITRARY', + identifier: arbitraryTx.identifier, + service: arbitraryTx.service, + base64: arbitraryTx.base64, + description: arbitraryTx?.description || '', + publicKeys: additionalPublicKeys, + }); + + fee = fee + +arbitraryFee; + } + } + + if (!name) + throw new Error( + i18n.t('question:message.error.registered_name', { + postProcess: 'capitalizeFirstChar', + }) + ); + const balance = await getBalanceInfo(); + + if (+balance < fee) + throw new Error( + i18n.t('question:message.error.insufficient_balance_qort', { + postProcess: 'capitalizeFirstChar', + }) + ); + const assetBalance = await getAssetBalanceInfo(assetId); + const assetInfo = await getAssetInfo(assetId); + if (assetBalance < totalAmount) + throw new Error( + i18n.t('question:message.error.insufficient_balance', { + postProcess: 'capitalizeFirstChar', + }) + ); + + const resPermission = await getUserPermission( + { + text1: i18n.t('question:permission.pay_publish', { + postProcess: 'capitalizeFirstChar', + }), + text2: i18n.t('question:assets_used_pay', { + asset: assetInfo.name, + postProcess: 'capitalizeFirstChar', + }), + html: ` +
+ + + ${pendingTransactions + .filter((item) => item.type === 'PAYMENT') + .map( + (payment) => ` +
+
Recipient: ${ + payment.recipientAddress + }
+
Amount: ${payment.amount}
+
` + ) + .join('')} + ${[...pendingTransactions, ...pendingAdditionalArbitraryTxs] + .filter((item) => item.type === 'ARBITRARY') + .map( + (arbitraryTx) => ` +
+
Service: ${ + arbitraryTx.service + }
+
Name: ${name}
+
Identifier: ${ + arbitraryTx.identifier + }
+
` + ) + .join('')} +
+ + `, + highlightedText: `Total Amount: ${totalAmount}`, + fee: fee, + }, + isFromExtension + ); + + const { accepted, checkbox1 = false } = resPermission; + if (!accepted) { + throw new Error( + i18n.t('question:message.generic.user_declined_request', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + + // const failedTxs = [] + const paymentsDone = {}; + + const transactionsDone = []; + + for (const transaction of pendingTransactions) { + const type = transaction.type; + + if (type === 'PAYMENT') { + const makePayment = await retryTransaction( + transferAsset, + [ + { + amount: transaction.amount, + assetId, + recipient: transaction.recipientAddress, + }, + ], + true + ); + if (makePayment) { + transactionsDone.push(makePayment?.signature); + if (transaction.paymentRefId) { + paymentsDone[transaction.paymentRefId] = makePayment; + } + } + } else if (type === 'ARBITRARY' && paymentsDone[transaction.paymentRefId]) { + const objectToEncrypt = { + data: transaction.base64, + payment: paymentsDone[transaction.paymentRefId], + }; + + const toBase64 = await retryTransaction( + objectToBase64, + [objectToEncrypt], + true + ); + + if (!toBase64) continue; // Skip if encryption fails + + const encryptDataResponse = await retryTransaction( + encryptDataGroup, + [ + { + data64: toBase64, + publicKeys: transaction.publicKeys, + privateKey, + userPublicKey, + }, + ], + true + ); + + if (!encryptDataResponse) continue; // Skip if encryption fails + + const resPublish = await retryTransaction( + publishData, + [ + { + registeredName: encodeURIComponent(name), + file: encryptDataResponse, + service: transaction.service, + identifier: encodeURIComponent(transaction.identifier), + uploadType: 'file', + description: transaction?.description, + isBase64: true, + apiVersion: 2, + withFee: true, + }, + ], + true + ); + + if (resPublish?.signature) { + transactionsDone.push(resPublish?.signature); + } + } + } + + for (const transaction of pendingAdditionalArbitraryTxs) { + const objectToEncrypt = { + data: transaction.base64, + }; + + const toBase64 = await retryTransaction( + objectToBase64, + [objectToEncrypt], + true + ); + + if (!toBase64) continue; // Skip if encryption fails + + const encryptDataResponse = await retryTransaction( + encryptDataGroup, + [ + { + data64: toBase64, + publicKeys: transaction.publicKeys, + privateKey, + userPublicKey, + }, + ], + true + ); + + if (!encryptDataResponse) continue; // Skip if encryption fails + + const resPublish = await retryTransaction( + publishData, + [ + { + registeredName: encodeURIComponent(name), + data: encryptDataResponse, + service: transaction.service, + identifier: encodeURIComponent(transaction.identifier), + uploadType: 'base64', + description: transaction?.description, + apiVersion: 2, + withFee: true, + }, + ], + true + ); + + if (resPublish?.signature) { + transactionsDone.push(resPublish?.signature); + } + } + + return transactionsDone; +}; + +export const transferAssetRequest = async (data, isFromExtension) => { + const requiredFields = ['amount', 'assetId', 'recipient']; + requiredFields.forEach((field) => { + if (data[field] === undefined || data[field] === null) { + throw new Error( + i18n.t('question:message.error.missing_fields', { + fields: field, + postProcess: 'capitalizeFirstChar', + }) + ); + } + }); + const amount = data.amount; + const assetId = data.assetId; + const recipient = data.recipient; + + const { fee } = await getFee('TRANSFER_ASSET'); + const balance = await getBalanceInfo(); + + if (+balance < +fee) + throw new Error( + i18n.t('question:message.error.insufficient_balance_qort', { + postProcess: 'capitalizeFirstChar', + }) + ); + const assetBalance = await getAssetBalanceInfo(assetId); + if (assetBalance < amount) + throw new Error( + i18n.t('question:message.error.insufficient_balance', { + postProcess: 'capitalizeFirstChar', + }) + ); + const confirmReceiver = await getNameOrAddress(recipient); + if (confirmReceiver.error) { + throw new Error( + i18n.t('question:message.error.invalid_receiver', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + const assetInfo = await getAssetInfo(assetId); + const resPermission = await getUserPermission( + { + text1: i18n.t('question:permission.transfer_asset', { + postProcess: 'capitalizeFirstChar', + }), + text2: i18n.t('question:asset_name', { + asset: assetInfo?.name, + postProcess: 'capitalizeFirstChar', + }), + highlightedText: i18n.t('question:amount_qty', { + quantity: amount, + postProcess: 'capitalizeFirstChar', + }), + fee: fee, + }, + isFromExtension + ); + + const { accepted } = resPermission; + if (!accepted) { + throw new Error( + i18n.t('question:message.generic.user_declined_request', { + postProcess: 'capitalizeFirstChar', + }) + ); + } + const res = await transferAsset({ + amount, + recipient: confirmReceiver, + assetId, + }); + return res; +}; diff --git a/src/qortal/qortal-requests.ts b/src/qortal/qortal-requests.ts new file mode 100644 index 0000000..078116e --- /dev/null +++ b/src/qortal/qortal-requests.ts @@ -0,0 +1,1973 @@ +import { + gateways, + getApiKeyFromStorage, + getNameInfoForOthers, +} from '../background/background.ts'; +import { listOfAllQortalRequests } from '../hooks/useQortalMessageListener.tsx'; +import { + addForeignServer, + addGroupAdminRequest, + addListItems, + adminAction, + banFromGroupRequest, + cancelGroupBanRequest, + cancelGroupInviteRequest, + cancelSellOrder, + createAndCopyEmbedLink, + createBuyOrder, + createGroupRequest, + createPoll, + createSellOrder, + decryptAESGCMRequest, + decryptData, + decryptDataWithSharingKey, + decryptQortalGroupData, + deleteHostedData, + deleteListItems, + deployAt, + encryptData, + encryptDataWithSharingKey, + encryptQortalGroupData, + getCrossChainServerInfo, + getDaySummary, + getNodeInfo, + getNodeStatus, + getForeignFee, + getHostedData, + getListItems, + getServerConnectionHistory, + getTxActivitySummary, + getUserAccount, + getUserWallet, + getUserWalletInfo, + getUserWalletTransactions, + getWalletBalance, + inviteToGroupRequest, + joinGroup, + kickFromGroupRequest, + leaveGroupRequest, + openNewTab, + publishMultipleQDNResources, + publishQDNResource, + registerNameRequest, + removeForeignServer, + removeGroupAdminRequest, + sendChatMessage, + sendCoin, + setCurrentForeignServer, + signTransaction, + updateForeignFee, + updateNameRequest, + voteOnPoll, + getArrrSyncStatus, + updateGroupRequest, + buyNameRequest, + sellNameRequest, + cancelSellNameRequest, + signForeignFees, + multiPaymentWithPrivateData, + transferAssetRequest, +} from './get.ts'; +import { getData, storeData } from '../utils/chromeStorage.ts'; +import { executeEvent } from '../utils/events.ts'; + +function getLocalStorage(key) { + return getData(key).catch((error) => { + console.error('Error retrieving data:', error); + throw error; + }); +} + +// Promisify setting data in localStorage +function setLocalStorage(key, data) { + return storeData(key, data).catch((error) => { + console.error('Error saving data:', error); + throw error; + }); +} + +export const isRunningGateway = async () => { + let isGateway = true; + const apiKey = await getApiKeyFromStorage(); + if ( + apiKey && + apiKey?.url && + !gateways.some((gateway) => apiKey?.url?.includes(gateway)) + ) { + isGateway = false; + } + + return isGateway; +}; + +export async function setPermission(key, value) { + try { + // Get the existing qortalRequestPermissions object + const qortalRequestPermissions = + (await getLocalStorage('qortalRequestPermissions')) || {}; + + // Update the permission + qortalRequestPermissions[key] = value; + + // Save the updated object back to storage + await setLocalStorage('qortalRequestPermissions', qortalRequestPermissions); + } catch (error) { + console.error('Error setting permission:', error); + } +} + +export async function getPermission(key) { + try { + // Get the qortalRequestPermissions object from storage + const qortalRequestPermissions = + (await getLocalStorage('qortalRequestPermissions')) || {}; + + // Return the value for the given key, or null if it doesn't exist + return qortalRequestPermissions[key] || null; + } catch (error) { + console.error('Error getting permission:', error); + return null; + } +} + +// TODO: feature: add call to GET_FRIENDS_LIST +// NOT SURE IF TO IMPLEMENT: LINK_TO_QDN_RESOURCE, QDN_RESOURCE_DISPLAYED, SET_TAB_NOTIFICATIONS + +function setupMessageListenerQortalRequest() { + window.addEventListener('message', async (event) => { + const request = event.data; + + // Ensure the message is from a trusted source + const isFromExtension = request?.isExtension; + const appInfo = request?.appInfo; + const skipAuth = request?.skipAuth || false; + if (request?.type !== 'backgroundMessage') return; // Only process messages of type 'backgroundMessage' + + // Handle actions based on the `request.action` value + switch (request.action) { + case 'GET_USER_ACCOUNT': { + try { + const res = await getUserAccount({ + isFromExtension, + appInfo, + skipAuth, + }); + event.source!.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source!.postMessage( + { + requestId: request.requestId, + action: request.action, + error: 'Unable to get user account', + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'ENCRYPT_DATA': { + try { + const res = await encryptData(request.payload, event.source); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'ENCRYPT_QORTAL_GROUP_DATA': { + try { + const res = await encryptQortalGroupData( + request.payload, + event.source + ); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'DECRYPT_QORTAL_GROUP_DATA': { + try { + const res = await decryptQortalGroupData( + request.payload, + event.source + ); + event.source!.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source!.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'DECRYPT_DATA': { + try { + const res = await decryptData(request.payload); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'GET_LIST_ITEMS': { + try { + const res = await getListItems(request.payload, isFromExtension); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'ADD_LIST_ITEMS': { + try { + const res = await addListItems(request.payload, isFromExtension); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'DELETE_LIST_ITEM': { + try { + const res = await deleteListItems(request.payload, isFromExtension); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'PUBLISH_QDN_RESOURCE': { + try { + const res = await publishQDNResource( + request.payload, + event.source, + isFromExtension + ); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'PUBLISH_MULTIPLE_QDN_RESOURCES': { + try { + const res = await publishMultipleQDNResources( + request.payload, + event.source, + isFromExtension, + appInfo + ); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'VOTE_ON_POLL': { + try { + const res = await voteOnPoll(request.payload, isFromExtension); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'CREATE_POLL': { + try { + const res = await createPoll(request.payload, isFromExtension); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'SEND_CHAT_MESSAGE': { + try { + const res = await sendChatMessage( + request.payload, + isFromExtension, + appInfo + ); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'JOIN_GROUP': { + try { + const res = await joinGroup(request.payload, isFromExtension); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'DEPLOY_AT': { + try { + const res = await deployAt(request.payload, isFromExtension); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'GET_USER_WALLET': { + try { + const res = await getUserWallet( + request.payload, + isFromExtension, + appInfo + ); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'GET_WALLET_BALANCE': { + try { + const res = await getWalletBalance( + request.payload, + false, + isFromExtension, + appInfo + ); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'GET_USER_WALLET_TRANSACTIONS': { + try { + const res = await getUserWalletTransactions( + request.payload, + isFromExtension, + appInfo + ); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'GET_USER_WALLET_INFO': { + try { + const res = await getUserWalletInfo( + request.payload, + isFromExtension, + appInfo + ); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'GET_CROSSCHAIN_SERVER_INFO': { + try { + const res = await getCrossChainServerInfo(request.payload); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'GET_TX_ACTIVITY_SUMMARY': { + try { + const res = await getTxActivitySummary(request.payload); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'GET_FOREIGN_FEE': { + try { + const res = await getForeignFee(request.payload); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'UPDATE_FOREIGN_FEE': { + try { + const res = await updateForeignFee(request.payload, isFromExtension); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'GET_SERVER_CONNECTION_HISTORY': { + try { + const res = await getServerConnectionHistory(request.payload); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'SET_CURRENT_FOREIGN_SERVER': { + try { + const res = await setCurrentForeignServer( + request.payload, + isFromExtension + ); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'ADD_FOREIGN_SERVER': { + try { + const res = await addForeignServer(request.payload, isFromExtension); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'REMOVE_FOREIGN_SERVER': { + try { + const res = await removeForeignServer( + request.payload, + isFromExtension + ); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'GET_DAY_SUMMARY': { + try { + const res = await getDaySummary(request.payload); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'GET_NODE_INFO': { + try { + const res = await getNodeInfo(request.payload); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'GET_NODE_STATUS': { + try { + const res = await getNodeStatus(request.payload); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'SEND_COIN': { + try { + const res = await sendCoin(request.payload, isFromExtension); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'CREATE_TRADE_BUY_ORDER': { + try { + const res = await createBuyOrder(request.payload, isFromExtension); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'CREATE_TRADE_SELL_ORDER': { + try { + const res = await createSellOrder(request.payload, isFromExtension); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'CANCEL_TRADE_SELL_ORDER': { + try { + const res = await cancelSellOrder(request.payload, isFromExtension); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'IS_USING_PUBLIC_NODE': { + try { + let isGateway = await isRunningGateway(); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: isGateway, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'ADMIN_ACTION': { + try { + const res = await adminAction(request.payload, isFromExtension); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'SIGN_TRANSACTION': { + try { + const res = await signTransaction(request.payload, isFromExtension); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'OPEN_NEW_TAB': { + try { + const res = await openNewTab(request.payload, isFromExtension); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'CREATE_AND_COPY_EMBED_LINK': { + try { + const res = await createAndCopyEmbedLink( + request.payload, + isFromExtension + ); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'ENCRYPT_DATA_WITH_SHARING_KEY': { + try { + const res = await encryptDataWithSharingKey( + request.payload, + isFromExtension + ); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'DECRYPT_DATA_WITH_SHARING_KEY': { + try { + const res = await decryptDataWithSharingKey( + request.payload, + isFromExtension + ); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'DELETE_HOSTED_DATA': { + try { + const res = await deleteHostedData(request.payload, isFromExtension); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'GET_HOSTED_DATA': { + try { + const res = await getHostedData(request.payload, isFromExtension); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'SHOW_ACTIONS': { + try { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: listOfAllQortalRequests, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'REGISTER_NAME': { + try { + const res = await registerNameRequest( + request.payload, + isFromExtension + ); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'UPDATE_NAME': { + try { + const res = await updateNameRequest(request.payload, isFromExtension); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'LEAVE_GROUP': { + try { + const res = await leaveGroupRequest(request.payload, isFromExtension); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'INVITE_TO_GROUP': { + try { + const res = await inviteToGroupRequest( + request.payload, + isFromExtension + ); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'KICK_FROM_GROUP': { + try { + const res = await kickFromGroupRequest( + request.payload, + isFromExtension + ); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'BAN_FROM_GROUP': { + try { + const res = await banFromGroupRequest( + request.payload, + isFromExtension + ); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'CANCEL_GROUP_BAN': { + try { + const res = await cancelGroupBanRequest( + request.payload, + isFromExtension + ); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'ADD_GROUP_ADMIN': { + try { + const res = await addGroupAdminRequest( + request.payload, + isFromExtension + ); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'DECRYPT_AESGCM': { + try { + const res = await decryptAESGCMRequest( + request.payload, + isFromExtension + ); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'REMOVE_GROUP_ADMIN': { + try { + const res = await removeGroupAdminRequest( + request.payload, + isFromExtension + ); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'CANCEL_GROUP_INVITE': { + try { + const res = await cancelGroupInviteRequest( + request.payload, + isFromExtension + ); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'CREATE_GROUP': { + try { + const res = await createGroupRequest( + request.payload, + isFromExtension + ); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'UPDATE_GROUP': { + try { + const res = await updateGroupRequest( + request.payload, + isFromExtension + ); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'GET_ARRR_SYNC_STATUS': { + try { + const res = await getArrrSyncStatus(request.payload); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'SHOW_PDF_READER': { + try { + if (!request.payload?.blob) { + throw new Error('Missing blob'); + } + if (request.payload?.blob?.type !== 'application/pdf') + throw new Error('blob type must be application/pdf'); + executeEvent('openPdf', { blob: request.payload?.blob }); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: true, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'MULTI_ASSET_PAYMENT_WITH_PRIVATE_DATA': { + try { + const res = await multiPaymentWithPrivateData( + request.payload, + isFromExtension + ); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'TRANSFER_ASSET': { + try { + const res = await transferAssetRequest( + request.payload, + isFromExtension + ); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error?.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'BUY_NAME': { + try { + const res = await buyNameRequest(request.payload, isFromExtension); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'SELL_NAME': { + try { + const res = await sellNameRequest(request.payload, isFromExtension); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'CANCEL_SELL_NAME': { + try { + const res = await cancelSellNameRequest( + request.payload, + isFromExtension + ); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'SIGN_FOREIGN_FEES': { + try { + const res = await signForeignFees(request.payload, isFromExtension); + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: res, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + case 'GET_PRIMARY_NAME': { + try { + const res = await getNameInfoForOthers(request.payload?.address); + const resData = res ? res : ''; + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + payload: resData, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } catch (error) { + event.source.postMessage( + { + requestId: request.requestId, + action: request.action, + error: error.message, + type: 'backgroundMessageResponse', + }, + event.origin + ); + } + break; + } + + default: + break; + } + }); +} + +// Initialize the message listener +setupMessageListenerQortalRequest(); diff --git a/src/qortalRequests copy.ts b/src/qortalRequests copy.ts deleted file mode 100644 index 6807fe9..0000000 --- a/src/qortalRequests copy.ts +++ /dev/null @@ -1,427 +0,0 @@ -import { addForeignServer, addListItems, createPoll, decryptData, deleteListItems, deployAt, encryptData, getCrossChainServerInfo, getDaySummary, getForeignFee, getListItems, getServerConnectionHistory, getTxActivitySummary, getUserAccount, getUserWallet, getUserWalletInfo, getWalletBalance, joinGroup, publishMultipleQDNResources, publishQDNResource, removeForeignServer, saveFile, sendChatMessage, sendCoin, setCurrentForeignServer, updateForeignFee, voteOnPoll } from "./qortalRequests/get"; - - - -// Promisify chrome.storage.local.get -function getLocalStorage(key) { - return new Promise((resolve, reject) => { - chrome.storage.local.get([key], function (result) { - if (chrome.runtime.lastError) { - return reject(chrome.runtime.lastError); - } - resolve(result[key]); - }); - }); - } - - // Promisify chrome.storage.local.set - function setLocalStorage(data) { - return new Promise((resolve, reject) => { - chrome.storage.local.set(data, function () { - if (chrome.runtime.lastError) { - return reject(chrome.runtime.lastError); - } - resolve(); - }); - }); - } - - - export async function setPermission(key, value) { - try { - // Get the existing qortalRequestPermissions object - const qortalRequestPermissions = (await getLocalStorage('qortalRequestPermissions')) || {}; - - // Update the permission - qortalRequestPermissions[key] = value; - - // Save the updated object back to storage - await setLocalStorage({ qortalRequestPermissions }); - - } catch (error) { - console.error('Error setting permission:', error); - } - } - - export async function getPermission(key) { - try { - // Get the qortalRequestPermissions object from storage - const qortalRequestPermissions = (await getLocalStorage('qortalRequestPermissions')) || {}; - - // Return the value for the given key, or null if it doesn't exist - return qortalRequestPermissions[key] || null; - } catch (error) { - console.error('Error getting permission:', error); - return null; - } - } - - - // TODO: GET_FRIENDS_LIST - // NOT SURE IF TO IMPLEMENT: LINK_TO_QDN_RESOURCE, QDN_RESOURCE_DISPLAYED, SET_TAB_NOTIFICATIONS - -chrome?.runtime?.onMessage.addListener((request, sender, sendResponse) => { - if (request) { - const isFromExtension = request?.isExtension - switch (request.action) { - case "GET_USER_ACCOUNT": { - getUserAccount() - .then((res) => { - sendResponse(res); - }) - .catch((error) => { - sendResponse({ error: "Unable to get user account" }); - }); - - break; - } - case "ENCRYPT_DATA": { - const data = request.payload; - - encryptData(data, sender) - .then((res) => { - sendResponse(res); - }) - .catch((error) => { - sendResponse({ error: error.message }); - }); - - break; - } - case "DECRYPT_DATA": { - const data = request.payload; - - decryptData(data) - .then((res) => { - sendResponse(res); - }) - .catch((error) => { - sendResponse({ error: error.message }); - }); - - break; - } - case "GET_LIST_ITEMS": { - const data = request.payload; - - getListItems(data, isFromExtension) - .then((res) => { - sendResponse(res); - }) - .catch((error) => { - sendResponse({ error: error.message }); - }); - - break; - } - case "ADD_LIST_ITEMS": { - const data = request.payload; - - addListItems(data, isFromExtension) - .then((res) => { - sendResponse(res); - }) - .catch((error) => { - sendResponse({ error: error.message }); - }); - - break; - } - case "DELETE_LIST_ITEM": { - const data = request.payload; - - deleteListItems(data, isFromExtension) - .then((res) => { - sendResponse(res); - }) - .catch((error) => { - sendResponse({ error: error.message }); - }); - - break; - } - case "PUBLISH_QDN_RESOURCE": { - const data = request.payload; - - publishQDNResource(data, sender, isFromExtension) - .then((res) => { - sendResponse(res); - }) - .catch((error) => { - sendResponse({ error: error.message }); - }); - - break; - } - case "PUBLISH_MULTIPLE_QDN_RESOURCES": { - const data = request.payload; - - publishMultipleQDNResources(data, sender, isFromExtension) - .then((res) => { - sendResponse(res); - }) - .catch((error) => { - sendResponse({ error: error.message }); - }); - - break; - } - case "VOTE_ON_POLL": { - const data = request.payload; - - voteOnPoll(data, isFromExtension) - .then((res) => { - sendResponse(res); - }) - .catch((error) => { - sendResponse({ error: error.message }); - }); - - break; - } - case "CREATE_POLL": { - const data = request.payload; - - createPoll(data, isFromExtension) - .then((res) => { - sendResponse(res); - }) - .catch((error) => { - sendResponse({ error: error.message }); - }); - - break; - } - case "SEND_CHAT_MESSAGE": { - const data = request.payload; - sendChatMessage(data, isFromExtension) - .then((res) => { - sendResponse(res); - }) - .catch((error) => { - sendResponse({ error: error.message }); - }); - - break; - } - case "JOIN_GROUP": { - const data = request.payload; - - joinGroup(data, isFromExtension) - .then((res) => { - sendResponse(res); - }) - .catch((error) => { - sendResponse({ error: error.message }); - }); - - break; - } - case "SAVE_FILE": { - const data = request.payload; - - saveFile(data, sender, isFromExtension) - .then((res) => { - sendResponse(res); - }) - .catch((error) => { - sendResponse({ error: error.message }); - }); - - break; - } - case "DEPLOY_AT": { - const data = request.payload; - - deployAt(data, isFromExtension) - .then((res) => { - sendResponse(res); - }) - .catch((error) => { - sendResponse({ error: error.message }); - }); - - break; - } - case "GET_USER_WALLET": { - const data = request.payload; - - getUserWallet(data, isFromExtension) - .then((res) => { - sendResponse(res); - }) - .catch((error) => { - sendResponse({ error: error.message }); - }); - - break; - } - case "GET_WALLET_BALANCE": { - const data = request.payload; - - getWalletBalance(data, false, isFromExtension) - .then((res) => { - sendResponse(res); - }) - .catch((error) => { - sendResponse({ error: error.message }); - }); - - break; - } - - case "GET_USER_WALLET_INFO": { - const data = request.payload; - - getUserWalletInfo(data, isFromExtension) - .then((res) => { - sendResponse(res); - }) - .catch((error) => { - sendResponse({ error: error.message }); - }); - - break; - } - case "GET_CROSSCHAIN_SERVER_INFO": { - const data = request.payload; - - getCrossChainServerInfo(data) - .then((res) => { - sendResponse(res); - }) - .catch((error) => { - sendResponse({ error: error.message }); - }); - - break; - } - case "GET_TX_ACTIVITY_SUMMARY": { - const data = request.payload; - - getTxActivitySummary(data) - .then((res) => { - sendResponse(res); - }) - .catch((error) => { - sendResponse({ error: error.message }); - }); - - break; - } - - case "GET_FOREIGN_FEE": { - const data = request.payload; - - getForeignFee(data) - .then((res) => { - sendResponse(res); - }) - .catch((error) => { - sendResponse({ error: error.message }); - }); - - break; - } - - case "UPDATE_FOREIGN_FEE": { - const data = request.payload; - - updateForeignFee(data) - .then((res) => { - sendResponse(res); - }) - .catch((error) => { - sendResponse({ error: error.message }); - }); - - break; - } - - case "GET_SERVER_CONNECTION_HISTORY": { - const data = request.payload; - - getServerConnectionHistory(data) - .then((res) => { - sendResponse(res); - }) - .catch((error) => { - sendResponse({ error: error.message }); - }); - - break; - } - - case "SET_CURRENT_FOREIGN_SERVER": { - const data = request.payload; - - setCurrentForeignServer(data) - .then((res) => { - sendResponse(res); - }) - .catch((error) => { - sendResponse({ error: error.message }); - }); - - break; - } - - case "ADD_FOREIGN_SERVER": { - const data = request.payload; - - addForeignServer(data) - .then((res) => { - sendResponse(res); - }) - .catch((error) => { - sendResponse({ error: error.message }); - }); - - break; - } - - case "REMOVE_FOREIGN_SERVER": { - const data = request.payload; - - removeForeignServer(data) - .then((res) => { - sendResponse(res); - }) - .catch((error) => { - sendResponse({ error: error.message }); - }); - - break; - } - - case "GET_DAY_SUMMARY": { - const data = request.payload; - - getDaySummary(data) - .then((res) => { - sendResponse(res); - }) - .catch((error) => { - sendResponse({ error: error.message }); - }); - - break; - } - - case "SEND_COIN": { - const data = request.payload; - - sendCoin(data, isFromExtension) - .then((res) => { - sendResponse(res); - }) - .catch((error) => { - sendResponse({ error: error.message }); - }); - - break; - } - } - } - return true; -}); diff --git a/src/qortalRequests.ts b/src/qortalRequests.ts deleted file mode 100644 index 0c890ba..0000000 --- a/src/qortalRequests.ts +++ /dev/null @@ -1,1225 +0,0 @@ -import { gateways, getApiKeyFromStorage } from "./background"; -import { listOfAllQortalRequests } from "./components/Apps/useQortalMessageListener"; -import { addForeignServer, addGroupAdminRequest, addListItems, adminAction, banFromGroupRequest, cancelGroupBanRequest, cancelGroupInviteRequest, cancelSellOrder, createAndCopyEmbedLink, createBuyOrder, createGroupRequest, createPoll, createSellOrder, decryptAESGCMRequest, decryptData, decryptDataWithSharingKey, decryptQortalGroupData, deleteHostedData, deleteListItems, deployAt, encryptData, encryptDataWithSharingKey, encryptQortalGroupData, getCrossChainServerInfo, getDaySummary, getNodeInfo, getNodeStatus, getForeignFee, getHostedData, getListItems, getServerConnectionHistory, getTxActivitySummary, getUserAccount, getUserWallet, getUserWalletInfo, getUserWalletTransactions, getWalletBalance, inviteToGroupRequest, joinGroup, kickFromGroupRequest, leaveGroupRequest, openNewTab, publishMultipleQDNResources, publishQDNResource, registerNameRequest, removeForeignServer, removeGroupAdminRequest, saveFile, sendChatMessage, sendCoin, setCurrentForeignServer, signTransaction, updateForeignFee, updateNameRequest, voteOnPoll, getArrrSyncStatus } from "./qortalRequests/get"; -import { getData, storeData } from "./utils/chromeStorage"; - -function getLocalStorage(key) { - return getData(key).catch((error) => { - console.error("Error retrieving data:", error); - throw error; - }); -} - -// Promisify setting data in localStorage -function setLocalStorage(key, data) { - return storeData(key, data).catch((error) => { - console.error("Error saving data:", error); - throw error; - }); -} - -export const isRunningGateway = async ()=> { - let isGateway = true; - const apiKey = await getApiKeyFromStorage(); - if (apiKey && (apiKey?.url && !gateways.some(gateway => apiKey?.url?.includes(gateway)))) { - isGateway = false; - } - - return isGateway -} - - - export async function setPermission(key, value) { - try { - // Get the existing qortalRequestPermissions object - const qortalRequestPermissions = (await getLocalStorage('qortalRequestPermissions')) || {}; - - // Update the permission - qortalRequestPermissions[key] = value; - - // Save the updated object back to storage - await setLocalStorage('qortalRequestPermissions', qortalRequestPermissions ); - - } catch (error) { - console.error('Error setting permission:', error); - } - } - - export async function getPermission(key) { - try { - // Get the qortalRequestPermissions object from storage - const qortalRequestPermissions = (await getLocalStorage('qortalRequestPermissions')) || {}; - - // Return the value for the given key, or null if it doesn't exist - return qortalRequestPermissions[key] || null; - } catch (error) { - console.error('Error getting permission:', error); - return null; - } - } - - - // TODO: GET_FRIENDS_LIST - // NOT SURE IF TO IMPLEMENT: LINK_TO_QDN_RESOURCE, QDN_RESOURCE_DISPLAYED, SET_TAB_NOTIFICATIONS - - function setupMessageListenerQortalRequest() { - window.addEventListener("message", async (event) => { - const request = event.data; - - // Ensure the message is from a trusted source - const isFromExtension = request?.isExtension; - const appInfo = request?.appInfo; - const skipAuth = request?.skipAuth || false - if (request?.type !== "backgroundMessage") return; // Only process messages of type 'backgroundMessage' - - - // Handle actions based on the `request.action` value - switch (request.action) { - case "GET_USER_ACCOUNT": { - try { - const res = await getUserAccount({isFromExtension, appInfo, skipAuth}); - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: "Unable to get user account", - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "ENCRYPT_DATA": { - try { - const res = await encryptData(request.payload, event.source); - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error?.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "ENCRYPT_QORTAL_GROUP_DATA": { - try { - const res = await encryptQortalGroupData(request.payload, event.source); - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error?.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "DECRYPT_QORTAL_GROUP_DATA": { - try { - const res = await decryptQortalGroupData(request.payload, event.source); - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error?.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "DECRYPT_DATA": { - try { - const res = await decryptData(request.payload); - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "GET_LIST_ITEMS": { - try { - const res = await getListItems(request.payload, isFromExtension); - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "ADD_LIST_ITEMS": { - try { - const res = await addListItems(request.payload, isFromExtension); - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "DELETE_LIST_ITEM": { - try { - const res = await deleteListItems(request.payload, isFromExtension); - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "PUBLISH_QDN_RESOURCE": { - try { - const res = await publishQDNResource(request.payload, event.source, isFromExtension); - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "PUBLISH_MULTIPLE_QDN_RESOURCES": { - try { - const res = await publishMultipleQDNResources(request.payload, event.source, isFromExtension); - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "VOTE_ON_POLL": { - try { - const res = await voteOnPoll(request.payload, isFromExtension); - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "CREATE_POLL": { - try { - const res = await createPoll(request.payload, isFromExtension); - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "SEND_CHAT_MESSAGE": { - try { - const res = await sendChatMessage(request.payload, isFromExtension, appInfo); - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "JOIN_GROUP": { - try { - const res = await joinGroup(request.payload, isFromExtension); - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "DEPLOY_AT": { - try { - const res = await deployAt(request.payload, isFromExtension); - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "GET_USER_WALLET": { - try { - const res = await getUserWallet(request.payload, isFromExtension, appInfo); - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "GET_WALLET_BALANCE": { - try { - const res = await getWalletBalance(request.payload, false, isFromExtension, appInfo); - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "GET_USER_WALLET_TRANSACTIONS": { - try { - const res = await getUserWalletTransactions(request.payload, isFromExtension, appInfo); - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "GET_USER_WALLET_INFO": { - try { - const res = await getUserWalletInfo(request.payload, isFromExtension, appInfo); - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "GET_CROSSCHAIN_SERVER_INFO": { - try { - const res = await getCrossChainServerInfo(request.payload); - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "GET_TX_ACTIVITY_SUMMARY": { - try { - const res = await getTxActivitySummary(request.payload); - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "GET_FOREIGN_FEE": { - try { - const res = await getForeignFee(request.payload); - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "UPDATE_FOREIGN_FEE": { - try { - const res = await updateForeignFee(request.payload); - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "GET_SERVER_CONNECTION_HISTORY": { - try { - const res = await getServerConnectionHistory(request.payload); - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "SET_CURRENT_FOREIGN_SERVER": { - try { - const res = await setCurrentForeignServer(request.payload); - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "ADD_FOREIGN_SERVER": { - try { - const res = await addForeignServer(request.payload); - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "REMOVE_FOREIGN_SERVER": { - try { - const res = await removeForeignServer(request.payload); - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "GET_DAY_SUMMARY": { - try { - const res = await getDaySummary(request.payload); - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "GET_NODE_INFO": { - try { - const res = await getNodeInfo(request.payload); - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "GET_NODE_STATUS": { - try { - const res = await getNodeStatus(request.payload); - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "SEND_COIN": { - try { - const res = await sendCoin(request.payload, isFromExtension); - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "CREATE_TRADE_BUY_ORDER": { - try { - const res = await createBuyOrder(request.payload, isFromExtension); - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "CREATE_TRADE_SELL_ORDER": { - try { - const res = await createSellOrder(request.payload, isFromExtension); - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "CANCEL_TRADE_SELL_ORDER": { - try { - const res = await cancelSellOrder(request.payload, isFromExtension); - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "IS_USING_PUBLIC_NODE": { - try { - let isGateway = await isRunningGateway() - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: isGateway, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error?.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "ADMIN_ACTION": { - try { - const res = await adminAction(request.payload, isFromExtension) - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error?.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "SIGN_TRANSACTION": { - try { - const res = await signTransaction(request.payload, isFromExtension) - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error?.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "OPEN_NEW_TAB": { - try { - const res = await openNewTab(request.payload, isFromExtension) - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error?.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "CREATE_AND_COPY_EMBED_LINK": { - try { - const res = await createAndCopyEmbedLink(request.payload, isFromExtension) - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error?.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "ENCRYPT_DATA_WITH_SHARING_KEY": { - try { - const res = await encryptDataWithSharingKey(request.payload, isFromExtension) - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error?.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "DECRYPT_DATA_WITH_SHARING_KEY": { - try { - const res = await decryptDataWithSharingKey(request.payload, isFromExtension) - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error?.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "DELETE_HOSTED_DATA" : { - try { - const res = await deleteHostedData(request.payload, isFromExtension) - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error?.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - case "GET_HOSTED_DATA" : { - try { - const res = await getHostedData(request.payload, isFromExtension) - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error?.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "SHOW_ACTIONS" : { - try { - - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: listOfAllQortalRequests, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error?.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "REGISTER_NAME" : { - try { - const res = await registerNameRequest(request.payload, isFromExtension) - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error?.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "UPDATE_NAME" : { - try { - const res = await updateNameRequest(request.payload, isFromExtension) - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error?.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "LEAVE_GROUP" : { - try { - const res = await leaveGroupRequest(request.payload, isFromExtension) - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error?.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "INVITE_TO_GROUP" : { - try { - const res = await inviteToGroupRequest(request.payload, isFromExtension) - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error?.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "KICK_FROM_GROUP" : { - try { - const res = await kickFromGroupRequest(request.payload, isFromExtension) - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error?.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "BAN_FROM_GROUP" : { - try { - const res = await banFromGroupRequest(request.payload, isFromExtension) - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error?.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "CANCEL_GROUP_BAN" : { - try { - const res = await cancelGroupBanRequest(request.payload, isFromExtension) - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error?.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "ADD_GROUP_ADMIN" : { - try { - const res = await addGroupAdminRequest(request.payload, isFromExtension) - - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error?.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "DECRYPT_AESGCM" : { - try { - const res = await decryptAESGCMRequest(request.payload, isFromExtension) - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error?.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "REMOVE_GROUP_ADMIN" : { - try { - const res = await removeGroupAdminRequest(request.payload, isFromExtension) - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error?.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "CANCEL_GROUP_INVITE" : { - try { - const res = await cancelGroupInviteRequest(request.payload, isFromExtension) - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error?.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "CREATE_GROUP" : { - try { - const res = await createGroupRequest(request.payload, isFromExtension) - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error?.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - case "GET_ARRR_SYNC_STATUS": { - try { - const res = await getArrrSyncStatus(request.payload); - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - payload: res, - type: "backgroundMessageResponse", - }, event.origin); - } catch (error) { - event.source.postMessage({ - requestId: request.requestId, - action: request.action, - error: error.message, - type: "backgroundMessageResponse", - }, event.origin); - } - break; - } - - default: - break; - } - }); - } - - // Initialize the message listener - setupMessageListenerQortalRequest(); diff --git a/src/qortalRequests/get.ts b/src/qortalRequests/get.ts deleted file mode 100644 index f220276..0000000 --- a/src/qortalRequests/get.ts +++ /dev/null @@ -1,4593 +0,0 @@ -import { Sha256 } from "asmcrypto.js"; -import { - computePow, - createEndpoint, - getBalanceInfo, - getFee, - getKeyPair, - getLastRef, - getSaveWallet, - processTransactionVersion2, - removeDuplicateWindow, - signChatFunc, - joinGroup as joinGroupFunc, - sendQortFee, - sendCoin as sendCoinFunc, - isUsingLocal, - createBuyOrderTx, - performPowTask, - parseErrorResponse, - groupSecretkeys, - registerName, - updateName, - leaveGroup, - inviteToGroup, - getNameInfoForOthers, - kickFromGroup, - banFromGroup, - cancelBan, - makeAdmin, - removeAdmin, - cancelInvitationToGroup, - createGroup, -} from "../background"; -import { getNameInfo, uint8ArrayToObject } from "../backgroundFunctions/encryption"; -import { showSaveFilePicker } from "../components/Apps/useQortalMessageListener"; -import { getPublishesFromAdminsAdminSpace } from "../components/Chat/AdminSpaceInner"; -import { extractComponents } from "../components/Chat/MessageDisplay"; -import { decryptResource, getGroupAdmins, getPublishesFromAdmins, validateSecretKey } from "../components/Group/Group"; -import { QORT_DECIMALS } from "../constants/constants"; -import Base58 from "../deps/Base58"; -import ed2curve from "../deps/ed2curve"; -import nacl from "../deps/nacl-fast"; - - -import { - base64ToUint8Array, - createSymmetricKeyAndNonce, - decryptDeprecatedSingle, - decryptGroupDataQortalRequest, - decryptGroupEncryptionWithSharingKey, - decryptSingle, - encryptDataGroup, - encryptSingle, - objectToBase64, - uint8ArrayStartsWith, - uint8ArrayToBase64, -} from "../qdn/encryption/group-encryption"; -import { publishData } from "../qdn/publish/pubish"; -import { - getPermission, - isRunningGateway, - setPermission, -} from "../qortalRequests"; -import TradeBotCreateRequest from "../transactions/TradeBotCreateRequest"; -import DeleteTradeOffer from "../transactions/TradeBotDeleteRequest"; -import signTradeBotTransaction from "../transactions/signTradeBotTransaction"; -import { createTransaction } from "../transactions/transactions"; -import { executeEvent } from "../utils/events"; -import { fileToBase64 } from "../utils/fileReading"; -import { mimeToExtensionMap } from "../utils/memeTypes"; -import { RequestQueueWithPromise } from "../utils/queue/queue"; -import utils from "../utils/utils"; - -export const requestQueueGetAtAddresses = new RequestQueueWithPromise(10); - -const sellerForeignFee = { - LITECOIN: { - value: "~0.00005", - ticker: "LTC", - }, - DOGECOIN: { - value: "~0.005", - ticker: "DOGE", - }, - BITCOIN: { - value: "~0.0001", - ticker: "BTC", - }, - DIGIBYTE: { - value: "~0.0005", - ticker: "DGB", - }, - RAVENCOIN: { - value: "~0.006", - ticker: "RVN", - }, - PIRATECHAIN: { - value: "~0.0002", - ticker: "ARRR", - }, -}; - -const btcFeePerByte = 0.000001; -const ltcFeePerByte = 0.0000003; -const dogeFeePerByte = 0.00001; -const dgbFeePerByte = 0.0000001; -const rvnFeePerByte = 0.00001125; - -function roundUpToDecimals(number, decimals = 8) { - const factor = Math.pow(10, decimals); // Create a factor based on the number of decimals - return Math.ceil(+number * factor) / factor; -} - -export const _createPoll = async ( - { pollName, pollDescription, options }, - isFromExtension, skipPermission -) => { - const fee = await getFee("CREATE_POLL"); - let resPermission = {} - if(!skipPermission){ - resPermission = await getUserPermission( - { - text1: "You are requesting to create the poll below:", - text2: `Poll: ${pollName}`, - text3: `Description: ${pollDescription}`, - text4: `Options: ${options?.join(", ")}`, - fee: fee.fee, - }, - isFromExtension - ); - } - - const { accepted = false } = resPermission; - - if (accepted || skipPermission) { - const wallet = await getSaveWallet(); - const address = wallet.address0; - const resKeyPair = await getKeyPair(); - const parsedData = resKeyPair; - const uint8PrivateKey = Base58.decode(parsedData.privateKey); - const uint8PublicKey = Base58.decode(parsedData.publicKey); - const keyPair = { - privateKey: uint8PrivateKey, - publicKey: uint8PublicKey, - }; - let lastRef = await getLastRef(); - - const tx = await createTransaction(8, keyPair, { - fee: fee.fee, - ownerAddress: address, - rPollName: pollName, - rPollDesc: pollDescription, - rOptions: options, - lastReference: lastRef, - }); - const signedBytes = Base58.encode(tx.signedBytes); - const res = await processTransactionVersion2(signedBytes); - if (!res?.signature) - throw new Error( - res?.message || "Transaction was not able to be processed" - ); - return res; - } else { - throw new Error("User declined request"); - } -}; - -const _deployAt = async ( - { name, description, tags, creationBytes, amount, assetId, atType }, - isFromExtension -) => { - const fee = await getFee("DEPLOY_AT"); - - const resPermission = await getUserPermission( - { - text1: "Would you like to deploy this AT?", - text2: `Name: ${name}`, - text3: `Description: ${description}`, - fee: fee.fee, - }, - isFromExtension - ); - - const { accepted } = resPermission; - - if (accepted) { - const wallet = await getSaveWallet(); - const address = wallet.address0; - const lastReference = await getLastRef(); - const resKeyPair = await getKeyPair(); - const parsedData = resKeyPair; - const uint8PrivateKey = Base58.decode(parsedData.privateKey); - const uint8PublicKey = Base58.decode(parsedData.publicKey); - const keyPair = { - privateKey: uint8PrivateKey, - publicKey: uint8PublicKey, - }; - - const tx = await createTransaction(16, keyPair, { - fee: fee.fee, - rName: name, - rDescription: description, - rTags: tags, - rAmount: amount, - rAssetId: assetId, - rCreationBytes: creationBytes, - atType: atType, - lastReference: lastReference, - }); - - const signedBytes = Base58.encode(tx.signedBytes); - - const res = await processTransactionVersion2(signedBytes); - if (!res?.signature) - throw new Error( - res?.message || "Transaction was not able to be processed" - ); - return res; - } else { - throw new Error("User declined transaction"); - } -}; - -export const _voteOnPoll = async ( - { pollName, optionIndex, optionName }, - isFromExtension, skipPermission -) => { - const fee = await getFee("VOTE_ON_POLL"); - let resPermission = {} - if(!skipPermission){ - resPermission = await getUserPermission( - { - text1: "You are being requested to vote on the poll below:", - text2: `Poll: ${pollName}`, - text3: `Option: ${optionName}`, - fee: fee.fee, - }, - isFromExtension - ); - } - - const { accepted = false } = resPermission; - - if (accepted || skipPermission) { - const wallet = await getSaveWallet(); - const address = wallet.address0; - const resKeyPair = await getKeyPair(); - const parsedData = resKeyPair; - const uint8PrivateKey = Base58.decode(parsedData.privateKey); - const uint8PublicKey = Base58.decode(parsedData.publicKey); - const keyPair = { - privateKey: uint8PrivateKey, - publicKey: uint8PublicKey, - }; - let lastRef = await getLastRef(); - - const tx = await createTransaction(9, keyPair, { - fee: fee.fee, - voterAddress: address, - rPollName: pollName, - rOptionIndex: optionIndex, - lastReference: lastRef, - }); - const signedBytes = Base58.encode(tx.signedBytes); - const res = await processTransactionVersion2(signedBytes); - if (!res?.signature) - throw new Error( - res?.message || "Transaction was not able to be processed" - ); - return res; - } else { - throw new Error("User declined request"); - } -}; - -// Map to store resolvers and rejectors by requestId -const fileRequestResolvers = new Map(); - -const handleFileMessage = (event) => { - const { action, requestId, result, error } = event.data; - - if ( - action === "getFileFromIndexedDBResponse" && - fileRequestResolvers.has(requestId) - ) { - const { resolve, reject } = fileRequestResolvers.get(requestId); - fileRequestResolvers.delete(requestId); // Clean up after resolving - - if (result) { - resolve(result); - } else { - reject(error || "Failed to retrieve file"); - } - } -}; - -window.addEventListener("message", handleFileMessage); - -function getFileFromContentScript(fileId) { - return new Promise((resolve, reject) => { - const requestId = `getFile_${fileId}_${Date.now()}`; - - fileRequestResolvers.set(requestId, { resolve, reject }); // Store resolvers by requestId - const targetOrigin = window.location.origin; - - // Send the request message - window.postMessage( - { action: "getFileFromIndexedDB", fileId, requestId }, - targetOrigin - ); - - // Timeout to handle no response scenario - setTimeout(() => { - if (fileRequestResolvers.has(requestId)) { - fileRequestResolvers.get(requestId).reject("Request timed out"); - fileRequestResolvers.delete(requestId); // Clean up on timeout - } - }, 10000); // 10-second timeout - }); -} - -// function sendToSaveFilePicker(data) { -// window.postMessage({ -// action: "SHOW_SAVE_FILE_PICKER", -// payload: data, -// }, "*"); -// } - -const responseResolvers = new Map(); - -const handleMessage = (event) => { - const { action, requestId, result } = event.data; - - // Check if this is the expected response action and if we have a stored resolver - if ( - action === "QORTAL_REQUEST_PERMISSION_RESPONSE" && - responseResolvers.has(requestId) - ) { - // Resolve the stored promise with the result - responseResolvers.get(requestId)(result || false); - responseResolvers.delete(requestId); // Clean up after resolving - } -}; - -window.addEventListener("message", handleMessage); - -async function getUserPermission(payload, isFromExtension) { - return new Promise((resolve) => { - const requestId = `qortalRequest_${Date.now()}`; - responseResolvers.set(requestId, resolve); // Store resolver by requestId - const targetOrigin = window.location.origin; - - // Send the request message - window.postMessage( - { - action: "QORTAL_REQUEST_PERMISSION", - payload, - requestId, - isFromExtension, - }, - targetOrigin - ); - - // Optional timeout to handle no response scenario - setTimeout(() => { - if (responseResolvers.has(requestId)) { - responseResolvers.get(requestId)(false); // Resolve with `false` if no response - responseResolvers.delete(requestId); - } - }, 30000); // 30-second timeout - }); -} - -export const getUserAccount = async ({ isFromExtension, appInfo, skipAuth }) => { - try { - const value = - (await getPermission(`qAPPAutoAuth-${appInfo?.name}`)) || false; - let skip = false; - if (value) { - skip = true; - } - if(skipAuth){ - skip = true - } - let resPermission; - if (!skip) { - resPermission = await getUserPermission( - { - text1: "Do you give this application permission to authenticate?", - checkbox1: { - value: false, - label: "Always authenticate automatically", - }, - }, - isFromExtension - ); - } - - const { accepted = false, checkbox1 = false } = resPermission || {}; - if (resPermission) { - setPermission(`qAPPAutoAuth-${appInfo?.name}`, checkbox1); - } - if (accepted || skip) { - const wallet = await getSaveWallet(); - const address = wallet.address0; - const publicKey = wallet.publicKey; - return { - address, - publicKey, - }; - } else { - throw new Error("User declined request"); - } - } catch (error) { - throw new Error("Unable to fetch user account"); - } -}; - -export const encryptData = async (data, sender) => { - let data64 = data.data64 || data.base64; - let publicKeys = data.publicKeys || []; - if (data?.file || data?.blob) { - data64 = await fileToBase64(data?.file || data?.blob); - } - if (!data64) { - throw new Error("Please include data to encrypt"); - } - const resKeyPair = await getKeyPair(); - const parsedData = resKeyPair; - const privateKey = parsedData.privateKey; - const userPublicKey = parsedData.publicKey; - - const encryptDataResponse = encryptDataGroup({ - data64, - publicKeys: publicKeys, - privateKey, - userPublicKey, - }); - if (encryptDataResponse) { - return encryptDataResponse; - } else { - throw new Error("Unable to encrypt"); - } -}; - -export const encryptQortalGroupData = async (data, sender) => { - let data64 = data?.data64 || data?.base64; - let groupId = data?.groupId - let isAdmins = data?.isAdmins - if(!groupId){ - throw new Error('Please provide a groupId') - } - if (data?.file || data?.blob) { - data64 = await fileToBase64(data?.file || data?.blob); - } - if (!data64) { - throw new Error("Please include data to encrypt"); - } - - - let secretKeyObject - if(!isAdmins){ - if(groupSecretkeys[groupId] && groupSecretkeys[groupId].secretKeyObject && groupSecretkeys[groupId]?.timestamp && (Date.now() - groupSecretkeys[groupId]?.timestamp) < 1200000){ - secretKeyObject = groupSecretkeys[groupId].secretKeyObject - } - - if(!secretKeyObject){ - const { names } = - await getGroupAdmins(groupId) - - const publish = - await getPublishesFromAdmins(names, groupId); - if(publish === false) throw new Error('No group key found.') - const url = await createEndpoint(`/arbitrary/DOCUMENT_PRIVATE/${publish.name}/${ - publish.identifier - }?encoding=base64`); - - const res = await fetch( -url - ); - const resData = await res.text(); - - const decryptedKey: any = await decryptResource(resData, true); - - const dataint8Array = base64ToUint8Array(decryptedKey.data); - const decryptedKeyToObject = uint8ArrayToObject(dataint8Array); - - if (!validateSecretKey(decryptedKeyToObject)) - throw new Error("SecretKey is not valid"); - secretKeyObject = decryptedKeyToObject - groupSecretkeys[groupId] = { - secretKeyObject, - timestamp: Date.now() - } - } -} else { - - if(groupSecretkeys[`admins-${groupId}`] && groupSecretkeys[`admins-${groupId}`].secretKeyObject && groupSecretkeys[`admins-${groupId}`]?.timestamp && (Date.now() - groupSecretkeys[`admins-${groupId}`]?.timestamp) < 1200000){ - secretKeyObject = groupSecretkeys[`admins-${groupId}`].secretKeyObject - } - - if(!secretKeyObject){ - const { names } = - await getGroupAdmins(groupId) - - const publish = - await getPublishesFromAdminsAdminSpace(names, groupId); - if(publish === false) throw new Error('No group key found.') - const url = await createEndpoint(`/arbitrary/DOCUMENT_PRIVATE/${publish.name}/${ - publish.identifier - }?encoding=base64`); - - const res = await fetch( -url - ); - const resData = await res.text(); - const decryptedKey: any = await decryptResource(resData, true); - const dataint8Array = base64ToUint8Array(decryptedKey.data); - const decryptedKeyToObject = uint8ArrayToObject(dataint8Array); - - if (!validateSecretKey(decryptedKeyToObject)) - throw new Error("SecretKey is not valid"); - secretKeyObject = decryptedKeyToObject - groupSecretkeys[`admins-${groupId}`] = { - secretKeyObject, - timestamp: Date.now() - } - } - - - -} - - const resGroupEncryptedResource = encryptSingle({ - data64, secretKeyObject: secretKeyObject, - }) - - if (resGroupEncryptedResource) { - return resGroupEncryptedResource; - } else { - throw new Error("Unable to encrypt"); - } -}; - -export const decryptQortalGroupData = async (data, sender) => { - let data64 = data?.data64 || data?.base64; - let groupId = data?.groupId - let isAdmins = data?.isAdmins - if(!groupId){ - throw new Error('Please provide a groupId') - } - - if (!data64) { - throw new Error("Please include data to encrypt"); - } - - let secretKeyObject - if(!isAdmins){ - if(groupSecretkeys[groupId] && groupSecretkeys[groupId].secretKeyObject && groupSecretkeys[groupId]?.timestamp && (Date.now() - groupSecretkeys[groupId]?.timestamp) < 1200000){ - secretKeyObject = groupSecretkeys[groupId].secretKeyObject - } - if(!secretKeyObject){ - const { names } = - await getGroupAdmins(groupId) - - const publish = - await getPublishesFromAdmins(names, groupId); - if(publish === false) throw new Error('No group key found.') - const url = await createEndpoint(`/arbitrary/DOCUMENT_PRIVATE/${publish.name}/${ - publish.identifier - }?encoding=base64`); - - const res = await fetch( -url - ); - const resData = await res.text(); - const decryptedKey: any = await decryptResource(resData, true); - - const dataint8Array = base64ToUint8Array(decryptedKey.data); - const decryptedKeyToObject = uint8ArrayToObject(dataint8Array); - if (!validateSecretKey(decryptedKeyToObject)) - throw new Error("SecretKey is not valid"); - secretKeyObject = decryptedKeyToObject - groupSecretkeys[groupId] = { - secretKeyObject, - timestamp: Date.now() - } - } -} else { - if(groupSecretkeys[`admins-${groupId}`] && groupSecretkeys[`admins-${groupId}`].secretKeyObject && groupSecretkeys[`admins-${groupId}`]?.timestamp && (Date.now() - groupSecretkeys[`admins-${groupId}`]?.timestamp) < 1200000){ - secretKeyObject = groupSecretkeys[`admins-${groupId}`].secretKeyObject - } - if(!secretKeyObject){ - const { names } = - await getGroupAdmins(groupId) - - const publish = - await getPublishesFromAdminsAdminSpace(names, groupId); - if(publish === false) throw new Error('No group key found.') - const url = await createEndpoint(`/arbitrary/DOCUMENT_PRIVATE/${publish.name}/${ - publish.identifier - }?encoding=base64`); - - const res = await fetch( -url - ); - const resData = await res.text(); - const decryptedKey: any = await decryptResource(resData, true); - - const dataint8Array = base64ToUint8Array(decryptedKey.data); - const decryptedKeyToObject = uint8ArrayToObject(dataint8Array); - if (!validateSecretKey(decryptedKeyToObject)) - throw new Error("SecretKey is not valid"); - secretKeyObject = decryptedKeyToObject - groupSecretkeys[`admins-${groupId}`] = { - secretKeyObject, - timestamp: Date.now() - } - } - - -} - - const resGroupDecryptResource = decryptSingle({ - data64, secretKeyObject: secretKeyObject, skipDecodeBase64: true - }) - if (resGroupDecryptResource) { - return resGroupDecryptResource; - } else { - throw new Error("Unable to decrypt"); - } -}; - -export const encryptDataWithSharingKey = async (data, sender) => { - let data64 = data?.data64 || data?.base64; - let publicKeys = data.publicKeys || []; - if (data?.file || data?.blob) { - data64 = await fileToBase64(data?.file || data?.blob); - } - if (!data64) { - throw new Error("Please include data to encrypt"); - } - const symmetricKey = createSymmetricKeyAndNonce() - const dataObject = { - data: data64, - key:symmetricKey.messageKey - } - const dataObjectBase64 = await objectToBase64(dataObject) - - const resKeyPair = await getKeyPair(); - const parsedData = resKeyPair; - const privateKey = parsedData.privateKey; - const userPublicKey = parsedData.publicKey; - - const encryptDataResponse = encryptDataGroup({ - data64: dataObjectBase64, - publicKeys: publicKeys, - privateKey, - userPublicKey, - customSymmetricKey: symmetricKey.messageKey - }); - if (encryptDataResponse) { - return encryptDataResponse; - } else { - throw new Error("Unable to encrypt"); - } -}; - -export const decryptDataWithSharingKey = async (data, sender) => { - const { encryptedData, key } = data; - - - if (!encryptedData) { - throw new Error("Please include data to decrypt"); - } - const decryptedData = await decryptGroupEncryptionWithSharingKey({data64EncryptedData: encryptedData, key}) - const base64ToObject = JSON.parse(atob(decryptedData)) - if(!base64ToObject.data) throw new Error('No data in the encrypted resource') - return base64ToObject.data -}; - -export const getHostedData = async (data, isFromExtension) => { - const isGateway = await isRunningGateway(); - if (isGateway) { - throw new Error("This action cannot be done through a public node"); - } - const resPermission = await getUserPermission( - { - text1: "Do you give this application permission to", - text2: `Get a list of your hosted data?`, - }, - isFromExtension - ); - const { accepted } = resPermission; - - if(accepted){ - const limit = data?.limit ? data?.limit : 20; - const query = data?.query ? data?.query : "" - const offset = data?.offset ? data?.offset : 0 - - let urlPath = `/arbitrary/hosted/resources/?limit=${limit}&offset=${offset}` - if(query){ - urlPath = urlPath + `&query=${query}` - } - - const url = await createEndpoint(urlPath); - const response = await fetch(url); - const dataResponse = await response.json(); - return dataResponse - - - } else { - throw new Error("User declined to get list of hosted resources"); - } - -}; - -export const deleteHostedData = async (data, isFromExtension) => { - const isGateway = await isRunningGateway(); - if (isGateway) { - throw new Error("This action cannot be done through a public node"); - } - const requiredFields = ["hostedData"]; - const missingFields: string[] = []; - requiredFields.forEach((field) => { - if (!data[field]) { - missingFields.push(field); - } - }); - const resPermission = await getUserPermission( - { - text1: "Do you give this application permission to", - text2: `Delete ${data?.hostedData?.length} hosted resources?`, - }, - isFromExtension - ); - const { accepted } = resPermission; - - if(accepted){ - const { hostedData } = data; - - for (const hostedDataItem of hostedData){ - try { - const url = await createEndpoint(`/arbitrary/resource/${hostedDataItem.service}/${hostedDataItem.name}/${hostedDataItem.identifier}`); - await fetch(url, { - method: "DELETE", - headers: { - "Content-Type": "application/json", - } - }); - } catch (error) { - //error - } - } - - return true - } else { - throw new Error("User declined delete hosted resources"); - } - -}; -export const decryptData = async (data) => { - const { encryptedData, publicKey } = data; - - if (!encryptedData) { - throw new Error(`Missing fields: encryptedData`); - } - const resKeyPair = await getKeyPair(); - const parsedData = resKeyPair; - const uint8PrivateKey = Base58.decode(parsedData.privateKey); - const uint8Array = base64ToUint8Array(encryptedData); - const startsWithQortalEncryptedData = uint8ArrayStartsWith( - uint8Array, - "qortalEncryptedData" - ); - if (startsWithQortalEncryptedData) { - if (!publicKey) { - throw new Error(`Missing fields: publicKey`); - } - - const decryptedDataToBase64 = decryptDeprecatedSingle( - uint8Array, - publicKey, - uint8PrivateKey - ); - return decryptedDataToBase64; - } - const startsWithQortalGroupEncryptedData = uint8ArrayStartsWith( - uint8Array, - "qortalGroupEncryptedData" - ); - if (startsWithQortalGroupEncryptedData) { - const decryptedData = decryptGroupDataQortalRequest( - encryptedData, - parsedData.privateKey - ); - const decryptedDataToBase64 = uint8ArrayToBase64(decryptedData); - return decryptedDataToBase64; - } - throw new Error("Unable to decrypt"); -}; - -export const getListItems = async (data, isFromExtension) => { - const isGateway = await isRunningGateway(); - if (isGateway) { - throw new Error("This action cannot be done through a public node"); - } - const requiredFields = ["list_name"]; - const missingFields: string[] = []; - requiredFields.forEach((field) => { - if (!data[field]) { - missingFields.push(field); - } - }); - if (missingFields.length > 0) { - const missingFieldsString = missingFields.join(", "); - const errorMsg = `Missing fields: ${missingFieldsString}`; - throw new Error(errorMsg); - } - const value = (await getPermission("qAPPAutoLists")) || false; - - let skip = false; - if (value) { - skip = true; - } - let resPermission; - let acceptedVar; - let checkbox1Var; - if (!skip) { - resPermission = await getUserPermission( - { - text1: "Do you give this application permission to", - text2: "Access the list", - highlightedText: data.list_name, - checkbox1: { - value: value, - label: "Always allow lists to be retrieved automatically", - }, - }, - isFromExtension - ); - const { accepted, checkbox1 } = resPermission; - acceptedVar = accepted; - checkbox1Var = checkbox1; - setPermission("qAPPAutoLists", checkbox1); - } - - if (acceptedVar || skip) { - const url = await createEndpoint(`/lists/${data.list_name}`); - const response = await fetch(url); - if (!response.ok) throw new Error("Failed to fetch"); - - const list = await response.json(); - return list; - } else { - throw new Error("User declined to share list"); - } -}; - -export const addListItems = async (data, isFromExtension) => { - const isGateway = await isRunningGateway(); - if (isGateway) { - throw new Error("This action cannot be done through a public node"); - } - const requiredFields = ["list_name", "items"]; - const missingFields: string[] = []; - requiredFields.forEach((field) => { - if (!data[field]) { - missingFields.push(field); - } - }); - if (missingFields.length > 0) { - const missingFieldsString = missingFields.join(", "); - const errorMsg = `Missing fields: ${missingFieldsString}`; - throw new Error(errorMsg); - } - - const items = data.items; - const list_name = data.list_name; - - const resPermission = await getUserPermission( - { - text1: "Do you give this application permission to", - text2: `Add the following to the list ${list_name}:`, - highlightedText: items.join(", "), - }, - isFromExtension - ); - const { accepted } = resPermission; - - if (accepted) { - const url = await createEndpoint(`/lists/${list_name}`); - const body = { - items: items, - }; - const bodyToString = JSON.stringify(body); - const response = await fetch(url, { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: bodyToString, - }); - - if (!response.ok) throw new Error("Failed to add to list"); - let res; - try { - res = await response.clone().json(); - } catch (e) { - res = await response.text(); - } - return res; - } else { - throw new Error("User declined add to list"); - } -}; - -export const deleteListItems = async (data, isFromExtension) => { - const isGateway = await isRunningGateway(); - if (isGateway) { - throw new Error("This action cannot be done through a public node"); - } - const requiredFields = ["list_name"]; - const missingFields: string[] = []; - requiredFields.forEach((field) => { - if (!data[field]) { - missingFields.push(field); - } - }); - if (missingFields.length > 0) { - const missingFieldsString = missingFields.join(", "); - const errorMsg = `Missing fields: ${missingFieldsString}`; - throw new Error(errorMsg); - } - if(!data?.item && !data?.items){ - throw new Error('Missing fields: items') - } - const item = data?.item; - const items = data?.items - const list_name = data.list_name; - - const resPermission = await getUserPermission( - { - text1: "Do you give this application permission to", - text2: `Remove the following from the list ${list_name}:`, - highlightedText: items ? JSON.stringify(items) : item, - }, - isFromExtension - ); - const { accepted } = resPermission; - - if (accepted) { - const url = await createEndpoint(`/lists/${list_name}`); - const body = { - items: items || [item], - }; - const bodyToString = JSON.stringify(body); - const response = await fetch(url, { - method: "DELETE", - headers: { - "Content-Type": "application/json", - }, - body: bodyToString, - }); - - if (!response.ok) throw new Error("Failed to add to list"); - let res; - try { - res = await response.clone().json(); - } catch (e) { - res = await response.text(); - } - return res; - } else { - throw new Error("User declined delete from list"); - } -}; - -export const publishQDNResource = async ( - data: any, - sender, - isFromExtension -) => { - const requiredFields = ["service"]; - const missingFields: string[] = []; - requiredFields.forEach((field) => { - if (!data[field]) { - missingFields.push(field); - } - }); - if (missingFields.length > 0) { - const missingFieldsString = missingFields.join(", "); - const errorMsg = `Missing fields: ${missingFieldsString}`; - throw new Error(errorMsg); - } - if (!data.file && !data.data64 && !data.base64) { - throw new Error("No data or file was submitted"); - } - // Use "default" if user hasn't specified an identifier - const service = data.service; - const appFee = data?.appFee ? +data.appFee : undefined - const appFeeRecipient = data?.appFeeRecipient - let hasAppFee = false - if(appFee && appFee > 0 && appFeeRecipient){ - hasAppFee = true - } - const registeredName = await getNameInfo(); - const name = registeredName; - if(!name){ - throw new Error('User has no Qortal name') - } - let identifier = data.identifier; - let data64 = data.data64 || data.base64; - const filename = data.filename; - const title = data.title; - const description = data.description; - const category = data.category; - - const tags = data?.tags || []; -const result = {}; - -// Fill tags dynamically while maintaining backward compatibility -for (let i = 0; i < 5; i++) { - result[`tag${i + 1}`] = tags[i] || data[`tag${i + 1}`] || undefined; -} - -// Access tag1 to tag5 from result -const { tag1, tag2, tag3, tag4, tag5 } = result; - - if (data.identifier == null) { - identifier = "default"; - } - if (data?.file || data?.blob) { - data64 = await fileToBase64(data?.file || data?.blob); - } - if ( - data.encrypt && - (!data.publicKeys || - (Array.isArray(data.publicKeys) && data.publicKeys.length === 0)) - ) { - throw new Error("Encrypting data requires public keys"); - } - - - if (data.encrypt) { - try { - const resKeyPair = await getKeyPair(); - const parsedData = resKeyPair; - const privateKey = parsedData.privateKey; - const userPublicKey = parsedData.publicKey; - const encryptDataResponse = encryptDataGroup({ - data64, - publicKeys: data.publicKeys, - privateKey, - userPublicKey, - }); - if (encryptDataResponse) { - data64 = encryptDataResponse; - } - } catch (error) { - throw new Error( - error.message || "Upload failed due to failed encryption" - ); - } - } - - const fee = await getFee("ARBITRARY"); - - const handleDynamicValues = {} - if(hasAppFee){ - const feePayment = await getFee("PAYMENT"); - - handleDynamicValues['appFee'] = +appFee + +feePayment.fee, - handleDynamicValues['checkbox1'] = { - value: true, - label: "accept app fee", - } - } - if(!!data?.encrypt){ - handleDynamicValues['highlightedText'] = `isEncrypted: ${!!data.encrypt}` - } - const resPermission = await getUserPermission( - { - text1: "Do you give this application permission to publish to QDN?", - text2: `service: ${service}`, - text3: `identifier: ${identifier || null}`, - fee: fee.fee, - ...handleDynamicValues - }, - isFromExtension - ); - const { accepted, checkbox1 = false } = resPermission; - if (accepted) { - - try { - const resPublish = await publishData({ - registeredName: encodeURIComponent(name), - file: data64, - service: service, - identifier: encodeURIComponent(identifier), - uploadType: "file", - isBase64: true, - filename: filename, - title, - description, - category, - tag1, - tag2, - tag3, - tag4, - tag5, - apiVersion: 2, - withFee: true, - }); - if(resPublish?.signature && hasAppFee && checkbox1){ - sendCoinFunc({ - amount: appFee, - receiver: appFeeRecipient - }, true) - } - return resPublish; - } catch (error) { - throw new Error(error?.message || "Upload failed"); - } - } else { - throw new Error("User declined request"); - } -}; - -export const checkArrrSyncStatus = async (seed) => { - const _url = await createEndpoint(`/crosschain/arrr/syncstatus`); - let tries = 0; // Track the number of attempts - - while (tries < 36) { - const response = await fetch(_url, { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: seed, - }); - - let res; - try { - res = await response.clone().json(); - } catch (e) { - res = await response.text(); - } - - if (res.indexOf('<') > -1 || res !== "Synchronized") { - // Wait 2 seconds before trying again - await new Promise((resolve) => setTimeout(resolve, 2000)); - tries += 1; - } else { - // If the response doesn't meet the two conditions, exit the function - return; - } - } - - // If we exceed 6 tries, throw an error - throw new Error("Failed to synchronize after 36 attempts"); -}; - - -export const publishMultipleQDNResources = async ( - data: any, - sender, - isFromExtension -) => { - const requiredFields = ["resources"]; - const missingFields: string[] = []; - let feeAmount = null; - requiredFields.forEach((field) => { - if (!data[field]) { - missingFields.push(field); - } - }); - if (missingFields.length > 0) { - const missingFieldsString = missingFields.join(", "); - const errorMsg = `Missing fields: ${missingFieldsString}`; - throw new Error(errorMsg); - } - const resources = data.resources; - if (!Array.isArray(resources)) { - throw new Error("Invalid data"); - } - if (resources.length === 0) { - throw new Error("No resources to publish"); - } - - const encrypt = data?.encrypt - - for (const resource of resources) { - const resourceEncrypt = encrypt && resource?.disableEncrypt !== true - if (!resourceEncrypt && resource?.service.endsWith("_PRIVATE")) { - const errorMsg = "Only encrypted data can go into private services"; - throw new Error(errorMsg) - } else if(resourceEncrypt && !resource?.service.endsWith("_PRIVATE")){ - const errorMsg = "For an encrypted publish please use a service that ends with _PRIVATE"; - throw new Error(errorMsg) - } - } - - - // if ( - // data.encrypt && - // (!data.publicKeys || - // (Array.isArray(data.publicKeys) && data.publicKeys.length === 0)) - // ) { - // throw new Error("Encrypting data requires public keys"); - // } - const fee = await getFee("ARBITRARY"); - const registeredName = await getNameInfo(); - const name = registeredName; - if(!name){ - throw new Error('You need a Qortal name to publish.') - } - const appFee = data?.appFee ? +data.appFee : undefined - const appFeeRecipient = data?.appFeeRecipient - let hasAppFee = false - if(appFee && appFee > 0 && appFeeRecipient){ - hasAppFee = true - } - - const handleDynamicValues = {} - if(hasAppFee){ - const feePayment = await getFee("PAYMENT"); - - handleDynamicValues['appFee'] = +appFee + +feePayment.fee, - handleDynamicValues['checkbox1'] = { - value: true, - label: "accept app fee", - } - } - if(data?.encrypt){ - handleDynamicValues['highlightedText'] = `isEncrypted: ${!!data.encrypt}` - } - const resPermission = await getUserPermission( - { - text1: "Do you give this application permission to publish to QDN?", - html: ` -
- - - ${data.resources - .map( - (resource) => ` -
-
Service: ${ - resource.service - }
-
Name: ${name}
-
Identifier: ${ - resource.identifier - }
- ${ - resource.filename - ? `
Filename: ${resource.filename}
` - : "" - } -
` - ) - .join("")} -
- - `, - fee: +fee.fee * resources.length, - ...handleDynamicValues - }, - isFromExtension - ); - const { accepted, checkbox1 = false } = resPermission; - if (!accepted) { - throw new Error("User declined request"); - } - let failedPublishesIdentifiers = []; - for (const resource of resources) { - try { - const requiredFields = ["service"]; - const missingFields: string[] = []; - requiredFields.forEach((field) => { - if (!resource[field]) { - missingFields.push(field); - } - }); - if (missingFields.length > 0) { - const missingFieldsString = missingFields.join(", "); - const errorMsg = `Missing fields: ${missingFieldsString}`; - failedPublishesIdentifiers.push({ - reason: errorMsg, - identifier: resource.identifier, - }); - continue; - } - if (!resource.file && !resource.data64 && !resource?.base64) { - const errorMsg = "No data or file was submitted"; - failedPublishesIdentifiers.push({ - reason: errorMsg, - identifier: resource.identifier, - }); - continue; - } - const service = resource.service; - let identifier = resource.identifier; - let data64 = resource?.data64 || resource?.base64; - const filename = resource.filename; - const title = resource.title; - const description = resource.description; - const category = resource.category; - const tags = resource?.tags || []; - const result = {}; - - // Fill tags dynamically while maintaining backward compatibility - for (let i = 0; i < 5; i++) { - result[`tag${i + 1}`] = tags[i] || resource[`tag${i + 1}`] || undefined; - } - - // Access tag1 to tag5 from result - const { tag1, tag2, tag3, tag4, tag5 } = result; - const resourceEncrypt = encrypt && resource?.disableEncrypt !== true - if (resource.identifier == null) { - identifier = "default"; - } - if (!resourceEncrypt && service.endsWith("_PRIVATE")) { - const errorMsg = "Only encrypted data can go into private services"; - failedPublishesIdentifiers.push({ - reason: errorMsg, - identifier: resource.identifier, - }); - continue; - } - if (resource.file) { - data64 = await fileToBase64(resource.file); - } - if (resourceEncrypt) { - try { - const resKeyPair = await getKeyPair(); - const parsedData = resKeyPair; - const privateKey = parsedData.privateKey; - const userPublicKey = parsedData.publicKey; - const encryptDataResponse = encryptDataGroup({ - data64, - publicKeys: data.publicKeys, - privateKey, - userPublicKey, - }); - if (encryptDataResponse) { - data64 = encryptDataResponse; - } - } catch (error) { - const errorMsg = - error?.message || "Upload failed due to failed encryption"; - failedPublishesIdentifiers.push({ - reason: errorMsg, - identifier: resource.identifier, - }); - continue; - } - } - - try { - await publishData({ - registeredName: encodeURIComponent(name), - file: data64, - service: service, - identifier: encodeURIComponent(identifier), - uploadType: "file", - isBase64: true, - filename: filename, - title, - description, - category, - tag1, - tag2, - tag3, - tag4, - tag5, - apiVersion: 2, - withFee: true, - }); - await new Promise((res) => { - setTimeout(() => { - res(); - }, 1000); - }); - } catch (error) { - const errorMsg = error.message || "Upload failed"; - failedPublishesIdentifiers.push({ - reason: errorMsg, - identifier: resource.identifier, - }); - } - } catch (error) { - failedPublishesIdentifiers.push({ - reason: error?.message || "Unknown error", - identifier: resource.identifier, - }); - } - } - if (failedPublishesIdentifiers.length > 0) { - const obj = {}; - obj["error"] = { - unsuccessfulPublishes: failedPublishesIdentifiers, - }; - return obj; - } - if(hasAppFee && checkbox1){ - sendCoinFunc({ - amount: appFee, - receiver: appFeeRecipient - }, true) - } - return true; -}; - -export const voteOnPoll = async (data, isFromExtension) => { - const requiredFields = ["pollName", "optionIndex"]; - const missingFields: string[] = []; - requiredFields.forEach((field) => { - if (!data[field] && data[field] !== 0) { - missingFields.push(field); - } - }); - if (missingFields.length > 0) { - const missingFieldsString = missingFields.join(", "); - const errorMsg = `Missing fields: ${missingFieldsString}`; - throw new Error(errorMsg); - } - const pollName = data.pollName; - const optionIndex = data.optionIndex; - let pollInfo = null; - try { - const url = await createEndpoint(`/polls/${encodeURIComponent(pollName)}`); - const response = await fetch(url); - if (!response.ok){ - const errorMessage = await parseErrorResponse(response, "Failed to fetch poll"); - throw new Error(errorMessage); - } - - pollInfo = await response.json(); - } catch (error) { - const errorMsg = (error && error.message) || "Poll not found"; - throw new Error(errorMsg); - } - if (!pollInfo || pollInfo.error) { - - const errorMsg = (pollInfo && pollInfo.message) || "Poll not found"; - throw new Error(errorMsg); - } - try { - const optionName = pollInfo.pollOptions[optionIndex].optionName; - const resVoteOnPoll = await _voteOnPoll( - { pollName, optionIndex, optionName }, - isFromExtension - ); - return resVoteOnPoll; - } catch (error) { - throw new Error(error?.message || "Failed to vote on the poll."); - } -}; - -export const createPoll = async (data, isFromExtension) => { - const requiredFields = [ - "pollName", - "pollDescription", - "pollOptions", - "pollOwnerAddress", - ]; - const missingFields: string[] = []; - requiredFields.forEach((field) => { - if (!data[field]) { - missingFields.push(field); - } - }); - if (missingFields.length > 0) { - const missingFieldsString = missingFields.join(", "); - const errorMsg = `Missing fields: ${missingFieldsString}`; - throw new Error(errorMsg); - } - const pollName = data.pollName; - const pollDescription = data.pollDescription; - const pollOptions = data.pollOptions; - const pollOwnerAddress = data.pollOwnerAddress; - try { - const resCreatePoll = await _createPoll( - { - pollName, - pollDescription, - options: pollOptions, - }, - isFromExtension - ); - return resCreatePoll; - } catch (error) { - throw new Error(error?.message || "Failed to created poll."); - } -}; - - -function isBase64(str) { - const base64Regex = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/; - return base64Regex.test(str) && str.length % 4 === 0; -} - -function checkValue(value) { - if (typeof value === "string") { - if (isBase64(value)) { - return 'string' - } else { - return 'string' - } - } else if (typeof value === "object" && value !== null) { - return 'object' - } else { - throw new Error('Field fullContent is in an invalid format. Either use a string, base64 or an object.') - } -} - - -export const sendChatMessage = async (data, isFromExtension, appInfo) => { - const message = data?.message; - const fullMessageObject = data?.fullMessageObject || data?.fullContent - const recipient = data?.destinationAddress || data.recipient; - const groupId = data.groupId; - const isRecipient = groupId === undefined; - const chatReference = data?.chatReference - if(groupId === undefined && recipient === undefined){ - throw new Error('Please provide a recipient or groupId') - } - let fullMessageObjectType - if(fullMessageObject){ - fullMessageObjectType = checkValue(fullMessageObject) - } - const value = (await getPermission(`qAPPSendChatMessage-${appInfo?.name}`)) || false; -let skip = false; -if (value) { - skip = true; -} -let resPermission; -if (!skip) { - resPermission = await getUserPermission( - { - text1: - "Do you give this application permission to send this chat message?", - text2: `To: ${isRecipient ? recipient : `group ${groupId}`}`, - text3: fullMessageObject ? fullMessageObjectType === 'string' ? `${fullMessageObject?.slice(0, 25)}${fullMessageObject?.length > 25 ? "..." : ""}` : `${JSON.stringify(fullMessageObject)?.slice(0, 25)}${JSON.stringify(fullMessageObject)?.length > 25 ? "..." : ""}` : `${message?.slice(0, 25)}${message?.length > 25 ? "..." : ""}`, - checkbox1: { - value: false, - label: "Always allow chat messages from this app", - }, - }, - isFromExtension - ); - } - const { accepted = false, checkbox1 = false } = resPermission || {}; - if (resPermission && accepted) { - setPermission(`qAPPSendChatMessage-${appInfo?.name}`, checkbox1); - } - if (accepted || skip) { - const tiptapJson = { - type: "doc", - content: [ - { - type: "paragraph", - content: [ - { - type: "text", - text: message, - }, - ], - }, - ], - }; - const messageObject = fullMessageObject ? fullMessageObject : { - messageText: tiptapJson, - images: [""], - repliedTo: "", - version: 3, - }; - - let stringifyMessageObject = JSON.stringify(messageObject); - if(fullMessageObjectType === 'string'){ - stringifyMessageObject = messageObject - } - - const balance = await getBalanceInfo(); - const hasEnoughBalance = +balance < 4 ? false : true; - if (!hasEnoughBalance) { - throw new Error("You need at least 4 QORT to send a message"); - } - if (isRecipient && recipient) { - const url = await createEndpoint(`/addresses/publickey/${recipient}`); - const response = await fetch(url); - if (!response.ok) - throw new Error("Failed to fetch recipient's public key"); - - let key; - let hasPublicKey; - let res; - const contentType = response.headers.get("content-type"); - - // If the response is JSON, parse it as JSON - if (contentType && contentType.includes("application/json")) { - res = await response.json(); - } else { - // Otherwise, treat it as plain text - res = await response.text(); - } - if (res?.error === 102) { - key = ""; - hasPublicKey = false; - } else if (res !== false) { - key = res; - hasPublicKey = true; - } else { - key = ""; - hasPublicKey = false; - } - - if (!hasPublicKey && isRecipient) { - throw new Error( - "Cannot send an encrypted message to this user since they do not have their publickey on chain." - ); - } - let _reference = new Uint8Array(64); - self.crypto.getRandomValues(_reference); - - let sendTimestamp = Date.now(); - - let reference = Base58.encode(_reference); - const resKeyPair = await getKeyPair(); - const parsedData = resKeyPair; - const uint8PrivateKey = Base58.decode(parsedData.privateKey); - const uint8PublicKey = Base58.decode(parsedData.publicKey); - const keyPair = { - privateKey: uint8PrivateKey, - publicKey: uint8PublicKey, - }; - - let handleDynamicValues = {} - if(chatReference){ - handleDynamicValues['chatReference'] = chatReference - } - - const tx = await createTransaction(18, keyPair, { - timestamp: sendTimestamp, - recipient: recipient, - recipientPublicKey: key, - hasChatReference: chatReference ? 1 : 0, - message: stringifyMessageObject, - lastReference: reference, - proofOfWorkNonce: 0, - isEncrypted: 1, - isText: 1, - ...handleDynamicValues - }); - - const chatBytes = tx.chatBytes; - const difficulty = 8; - const { nonce, chatBytesArray } = await performPowTask( - chatBytes, - difficulty - ); - - let _response = await signChatFunc(chatBytesArray, nonce, null, keyPair); - if (_response?.error) { - throw new Error(_response?.message); - } - return _response; - } else if (!isRecipient && groupId) { - let _reference = new Uint8Array(64); - self.crypto.getRandomValues(_reference); - - let reference = Base58.encode(_reference); - const resKeyPair = await getKeyPair(); - const parsedData = resKeyPair; - const uint8PrivateKey = Base58.decode(parsedData.privateKey); - const uint8PublicKey = Base58.decode(parsedData.publicKey); - const keyPair = { - privateKey: uint8PrivateKey, - publicKey: uint8PublicKey, - }; - - let handleDynamicValues = {} - if(chatReference){ - handleDynamicValues['chatReference'] = chatReference - } - - const txBody = { - timestamp: Date.now(), - groupID: Number(groupId), - hasReceipient: 0, - hasChatReference: chatReference ? 1 : 0, - message: stringifyMessageObject, - lastReference: reference, - proofOfWorkNonce: 0, - isEncrypted: 0, // Set default to not encrypted for groups - isText: 1, - ...handleDynamicValues - }; - - const tx = await createTransaction(181, keyPair, txBody); - - // if (!hasEnoughBalance) { - // throw new Error("Must have at least 4 QORT to send a chat message"); - // } - - const chatBytes = tx.chatBytes; - const difficulty = 8; - const { nonce, chatBytesArray } = await performPowTask( - chatBytes, - difficulty - ); - - let _response = await signChatFunc(chatBytesArray, nonce, null, keyPair); - if (_response?.error) { - throw new Error(_response?.message); - } - return _response; - } else { - throw new Error("Please enter a recipient or groupId"); - } - } else { - throw new Error("User declined to send message"); - } -}; - -export const joinGroup = async (data, isFromExtension) => { - const requiredFields = ["groupId"]; - const missingFields: string[] = []; - requiredFields.forEach((field) => { - if (!data[field]) { - missingFields.push(field); - } - }); - if (missingFields.length > 0) { - const missingFieldsString = missingFields.join(", "); - const errorMsg = `Missing fields: ${missingFieldsString}`; - throw new Error(errorMsg); - } - let groupInfo = null; - try { - const url = await createEndpoint(`/groups/${data.groupId}`); - const response = await fetch(url); - if (!response.ok) throw new Error("Failed to fetch group"); - - groupInfo = await response.json(); - } catch (error) { - const errorMsg = (error && error.message) || "Group not found"; - throw new Error(errorMsg); - } - const fee = await getFee("JOIN_GROUP"); - - const resPermission = await getUserPermission( - { - text1: "Confirm joining the group:", - highlightedText: `${groupInfo.groupName}`, - fee: fee.fee, - }, - isFromExtension - ); - const { accepted } = resPermission; - - if (accepted) { - const groupId = data.groupId; - - if (!groupInfo || groupInfo.error) { - const errorMsg = (groupInfo && groupInfo.message) || "Group not found"; - throw new Error(errorMsg); - } - try { - const resJoinGroup = await joinGroupFunc({ groupId }); - return resJoinGroup; - } catch (error) { - throw new Error(error?.message || "Failed to join the group."); - } - } else { - throw new Error("User declined to join group"); - } -}; - -export const saveFile = async (data, sender, isFromExtension, snackMethods) => { - try { - const requiredFields = ["filename", "blob"]; - const missingFields: string[] = []; - requiredFields.forEach((field) => { - if (!data[field]) { - missingFields.push(field); - } - }); - if (missingFields.length > 0) { - const missingFieldsString = missingFields.join(", "); - const errorMsg = `Missing fields: ${missingFieldsString}`; - throw new Error(errorMsg); - } - const filename = data.filename; - const blob = data.blob; - const resPermission = await getUserPermission( - { - text1: "Would you like to download:", - highlightedText: `${filename}`, - }, - isFromExtension - ); - const { accepted } = resPermission; - - if (accepted) { - const mimeType = blob.type || data.mimeType; - let backupExention = filename.split(".").pop(); - if (backupExention) { - backupExention = "." + backupExention; - } - const fileExtension = mimeToExtensionMap[mimeType] || backupExention; - let fileHandleOptions = {}; - if (!mimeType) { - throw new Error("A mimeType could not be derived"); - } - if (!fileExtension) { - const obj = {}; - throw new Error("A file extension could not be derived"); - } - if (fileExtension && mimeType) { - fileHandleOptions = { - accept: { - [mimeType]: [fileExtension], - }, - }; - } - - showSaveFilePicker( - { - filename, - mimeType, - blob, - }, - snackMethods - ); - // sendToSaveFilePicker( - // { - // filename, - // mimeType, - // blob, - // fileId - // } - // ); - return true; - } else { - throw new Error("User declined to save file"); - } - } catch (error) { - throw new Error(error?.message || "Failed to initiate download"); - } -}; - -export const deployAt = async (data, isFromExtension) => { - const requiredFields = [ - "name", - "description", - "tags", - "creationBytes", - "amount", - "assetId", - "type", - ]; - const missingFields: string[] = []; - requiredFields.forEach((field) => { - if (!data[field] && data[field] !== 0) { - missingFields.push(field); - } - }); - if (missingFields.length > 0) { - const missingFieldsString = missingFields.join(", "); - const errorMsg = `Missing fields: ${missingFieldsString}`; - throw new Error(errorMsg); - } - try { - const resDeployAt = await _deployAt( - { - name: data.name, - description: data.description, - tags: data.tags, - creationBytes: data.creationBytes, - amount: data.amount, - assetId: data.assetId, - atType: data.type, - }, - isFromExtension - ); - return resDeployAt; - } catch (error) { - throw new Error(error?.message || "Failed to join the group."); - } -}; - -export const getUserWallet = async (data, isFromExtension, appInfo) => { - const requiredFields = ["coin"]; - const missingFields: string[] = []; - requiredFields.forEach((field) => { - if (!data[field]) { - missingFields.push(field); - } - }); - if (missingFields.length > 0) { - const missingFieldsString = missingFields.join(", "); - const errorMsg = `Missing fields: ${missingFieldsString}`; - throw new Error(errorMsg); - } - const isGateway = await isRunningGateway(); - - if (data?.coin === "ARRR" && isGateway) - throw new Error( - "Cannot view ARRR wallet info through the gateway. Please use your local node." - ); - - const value = - (await getPermission( - `qAPPAutoGetUserWallet-${appInfo?.name}-${data.coin}` - )) || false; - let skip = false; - if (value) { - skip = true; - } - - let resPermission; - - if (!skip) { - resPermission = await getUserPermission( - { - text1: - "Do you give this application permission to get your wallet information?", - highlightedText: `coin: ${data.coin}`, - checkbox1: { - value: true, - label: "Always allow wallet to be retrieved automatically", - }, - }, - isFromExtension - ); - -} -const { accepted = false, checkbox1 = false } = resPermission || {}; - -if (resPermission) { - setPermission( - `qAPPAutoGetUserWallet-${appInfo?.name}-${data.coin}`, - checkbox1 - ); -} - - if (accepted || skip) { - let coin = data.coin; - let userWallet = {}; - let arrrAddress = ""; - const wallet = await getSaveWallet(); - const address = wallet.address0; - const resKeyPair = await getKeyPair(); - const parsedData = resKeyPair; - const arrrSeed58 = parsedData.arrrSeed58; - if (coin === "ARRR") { - const bodyToString = arrrSeed58; - const url = await createEndpoint(`/crosschain/arrr/walletaddress`); - const response = await fetch(url, { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: bodyToString, - }); - let res; - try { - res = await response.clone().json(); - } catch (e) { - res = await response.text(); - } - if (res?.error && res?.message) { - throw new Error(res.message); - } - arrrAddress = res; - } - switch (coin) { - case "QORT": - userWallet["address"] = address; - userWallet["publickey"] = parsedData.publicKey; - break; - case "BTC": - userWallet["address"] = parsedData.btcAddress; - userWallet["publickey"] = parsedData.btcPublicKey; - break; - case "LTC": - userWallet["address"] = parsedData.ltcAddress; - userWallet["publickey"] = parsedData.ltcPublicKey; - break; - case "DOGE": - userWallet["address"] = parsedData.dogeAddress; - userWallet["publickey"] = parsedData.dogePublicKey; - break; - case "DGB": - userWallet["address"] = parsedData.dgbAddress; - userWallet["publickey"] = parsedData.dgbPublicKey; - break; - case "RVN": - userWallet["address"] = parsedData.rvnAddress; - userWallet["publickey"] = parsedData.rvnPublicKey; - break; - case "ARRR": - await checkArrrSyncStatus(parsedData.arrrSeed58) - userWallet["address"] = arrrAddress; - break; - default: - break; - } - return userWallet; - } else { - throw new Error("User declined request"); - } -}; - -export const getWalletBalance = async ( - data, - bypassPermission?: boolean, - isFromExtension?: boolean, - appInfo?: any -) => { - const requiredFields = ["coin"]; - const missingFields: string[] = []; - requiredFields.forEach((field) => { - if (!data[field]) { - missingFields.push(field); - } - }); - if (missingFields.length > 0) { - const missingFieldsString = missingFields.join(", "); - const errorMsg = `Missing fields: ${missingFieldsString}`; - throw new Error(errorMsg); - } - - const isGateway = await isRunningGateway(); - - if (data?.coin === "ARRR" && isGateway) - throw new Error( - "Cannot view ARRR balance through the gateway. Please use your local node." - ); - - const value = - (await getPermission( - `qAPPAutoWalletBalance-${appInfo?.name}-${data.coin}` - )) || false; - let skip = false; - if (value) { - skip = true; - } - let resPermission; - - if (!bypassPermission && !skip) { - resPermission = await getUserPermission( - { - text1: "Do you give this application permission to fetch your", - highlightedText: `${data.coin} balance`, - checkbox1: { - value: true, - label: "Always allow balance to be retrieved automatically", - }, - }, - isFromExtension - ); - } - const { accepted = false, checkbox1 = false } = resPermission || {}; - if (resPermission) { - setPermission( - `qAPPAutoWalletBalance-${appInfo?.name}-${data.coin}`, - checkbox1 - ); - } - if (accepted || bypassPermission || skip) { - let coin = data.coin; - const wallet = await getSaveWallet(); - const address = wallet.address0; - const resKeyPair = await getKeyPair(); - const parsedData = resKeyPair; - if (coin === "QORT") { - let qortAddress = address; - try { - const url = await createEndpoint(`/addresses/balance/${qortAddress}`); - const response = await fetch(url); - if (!response.ok) throw new Error("Failed to fetch"); - let res; - try { - res = await response.clone().json(); - } catch (e) { - res = await response.text(); - } - return res; - } catch (error) { - throw new Error( - error?.message || "Fetch Wallet Failed. Please try again" - ); - } - } else { - let _url = ``; - let _body = null; - switch (coin) { - case "BTC": - _url = await createEndpoint(`/crosschain/btc/walletbalance`); - - _body = parsedData.btcPublicKey; - break; - case "LTC": - _url = await createEndpoint(`/crosschain/ltc/walletbalance`); - _body = parsedData.ltcPublicKey; - break; - case "DOGE": - _url = await createEndpoint(`/crosschain/doge/walletbalance`); - _body = parsedData.dogePublicKey; - break; - case "DGB": - _url = await createEndpoint(`/crosschain/dgb/walletbalance`); - _body = parsedData.dgbPublicKey; - break; - case "RVN": - _url = await createEndpoint(`/crosschain/rvn/walletbalance`); - _body = parsedData.rvnPublicKey; - break; - case "ARRR": - await checkArrrSyncStatus(parsedData.arrrSeed58) - _url = await createEndpoint(`/crosschain/arrr/walletbalance`); - _body = parsedData.arrrSeed58; - break; - default: - break; - } - try { - const response = await fetch(_url, { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: _body, - }); - let res; - try { - res = await response.clone().json(); - } catch (e) { - res = await response.text(); - } - if (res?.error && res?.message) { - throw new Error(res.message); - } - if (isNaN(Number(res))) { - throw new Error("Unable to fetch balance"); - } else { - return (Number(res) / 1e8).toFixed(8); - } - } catch (error) { - throw new Error(error?.message || "Unable to fetch balance"); - } - } - } else { - throw new Error("User declined request"); - } -}; - -const getPirateWallet = async (arrrSeed58)=> { - const isGateway = await isRunningGateway(); - if (isGateway) { - throw new Error("Retrieving PIRATECHAIN balance is not allowed through a gateway."); - } - const bodyToString = arrrSeed58; - await checkArrrSyncStatus(bodyToString) - const url = await createEndpoint(`/crosschain/arrr/walletaddress`); - const response = await fetch(url, { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: bodyToString, - }); - let res; - try { - res = await response.clone().json(); - } catch (e) { - res = await response.text(); - } - if (res?.error && res?.message) { - throw new Error(res.message); - } - return res -} - -export const getUserWalletFunc = async (coin) => { - let userWallet = {}; - const wallet = await getSaveWallet(); - const address = wallet.address0; - const resKeyPair = await getKeyPair(); - const parsedData = resKeyPair; - switch (coin) { - case "QORT": - userWallet["address"] = address; - userWallet["publickey"] = parsedData.publicKey; - break; - case "BTC": - case "BITCOIN": - userWallet["address"] = parsedData.btcAddress; - userWallet["publickey"] = parsedData.btcPublicKey; - break; - case "LTC": - case "LITECOIN": - userWallet["address"] = parsedData.ltcAddress; - userWallet["publickey"] = parsedData.ltcPublicKey; - break; - case "DOGE": - case "DOGECOIN": - userWallet["address"] = parsedData.dogeAddress; - userWallet["publickey"] = parsedData.dogePublicKey; - break; - case "DGB": - case "DIGIBYTE": - userWallet["address"] = parsedData.dgbAddress; - userWallet["publickey"] = parsedData.dgbPublicKey; - break; - case "RVN": - case "RAVENCOIN": - userWallet["address"] = parsedData.rvnAddress; - userWallet["publickey"] = parsedData.rvnPublicKey; - break; - case "ARRR": - case "PIRATECHAIN": - const arrrAddress = await getPirateWallet(parsedData.arrrSeed58) - userWallet["address"] = arrrAddress - break; - default: - break; - } - return userWallet; -}; - -export const getUserWalletInfo = async (data, isFromExtension, appInfo) => { - const requiredFields = ["coin"]; - const missingFields: string[] = []; - requiredFields.forEach((field) => { - if (!data[field]) { - missingFields.push(field); - } - }); - if (missingFields.length > 0) { - const missingFieldsString = missingFields.join(", "); - const errorMsg = `Missing fields: ${missingFieldsString}`; - throw new Error(errorMsg); - } - if(data?.coin === 'ARRR'){ - - throw new Error( - "ARRR is not supported for this call." - ); - } - const value = - (await getPermission( - `getUserWalletInfo-${appInfo?.name}-${data.coin}` - )) || false; -let skip = false; -if (value) { - skip = true; -} - let resPermission; - - if (!skip) { - - resPermission = await getUserPermission( - { - text1: - "Do you give this application permission to retrieve your wallet information", - highlightedText: `coin: ${data.coin}`, - checkbox1: { - value: true, - label: "Always allow wallet info to be retrieved automatically", - }, - }, - isFromExtension - ); -} -const { accepted = false, checkbox1 = false } = resPermission || {}; - -if (resPermission) { - setPermission( - `getUserWalletInfo-${appInfo?.name}-${data.coin}`, - checkbox1 - ); -} - - if (accepted || skip) { - let coin = data.coin; - let walletKeys = await getUserWalletFunc(coin); - - - const _url = await createEndpoint( - `/crosschain/` + data.coin.toLowerCase() + `/addressinfos` - ); - let _body = { xpub58: walletKeys["publickey"] }; - try { - const response = await fetch(_url, { - method: "POST", - headers: { - Accept: "*/*", - "Content-Type": "application/json", - }, - body: JSON.stringify(_body), - }); - if (!response?.ok) throw new Error("Unable to fetch wallet information"); - let res; - try { - res = await response.clone().json(); - } catch (e) { - res = await response.text(); - } - if (res?.error && res?.message) { - throw new Error(res.message); - } - - return res; - } catch (error) { - throw new Error(error?.message || "Fetch Wallet Failed"); - } - } else { - throw new Error("User declined request"); - } -}; - -export const getUserWalletTransactions = async (data, isFromExtension, appInfo) => { - const requiredFields = ["coin"]; - const missingFields: string[] = []; - requiredFields.forEach((field) => { - if (!data[field]) { - missingFields.push(field); - } - }); - if (missingFields.length > 0) { - const missingFieldsString = missingFields.join(", "); - const errorMsg = `Missing fields: ${missingFieldsString}`; - throw new Error(errorMsg); - } - - const value = - (await getPermission( - `getUserWalletTransactions-${appInfo?.name}-${data.coin}` - )) || false; -let skip = false; -if (value) { - skip = true; -} - let resPermission; - - if (!skip) { - - resPermission = await getUserPermission( - { - text1: - "Do you give this application permission to retrieve your wallet transactions", - highlightedText: `coin: ${data.coin}`, - checkbox1: { - value: true, - label: "Always allow wallet txs to be retrieved automatically", - }, - }, - isFromExtension - ); -} -const { accepted = false, checkbox1 = false } = resPermission || {}; - -if (resPermission) { - setPermission( - `getUserWalletTransactions-${appInfo?.name}-${data.coin}`, - checkbox1 - ); -} - - if (accepted || skip) { - const coin = data.coin; - const walletKeys = await getUserWalletFunc(coin); - let publicKey - if(data?.coin === 'ARRR'){ - const resKeyPair = await getKeyPair(); - const parsedData = resKeyPair; - publicKey = parsedData.arrrSeed58; - } else { - publicKey = walletKeys["publickey"] - } - - const _url = await createEndpoint( - `/crosschain/` + data.coin.toLowerCase() + `/wallettransactions` - ); - const _body = publicKey; - try { - const response = await fetch(_url, { - method: "POST", - headers: { - Accept: "*/*", - "Content-Type": "application/json", - }, - body: _body, - }); - if (!response?.ok) throw new Error("Unable to fetch wallet transactions"); - let res; - try { - res = await response.clone().json(); - } catch (e) { - res = await response.text(); - } - if (res?.error && res?.message) { - throw new Error(res.message); - } - - return res; - } catch (error) { - throw new Error(error?.message || "Fetch Wallet Transactions Failed"); - } - } else { - throw new Error("User declined request"); - } -}; - -export const getCrossChainServerInfo = async (data) => { - const requiredFields = ["coin"]; - const missingFields: string[] = []; - requiredFields.forEach((field) => { - if (!data[field]) { - missingFields.push(field); - } - }); - if (missingFields.length > 0) { - const missingFieldsString = missingFields.join(", "); - const errorMsg = `Missing fields: ${missingFieldsString}`; - throw new Error(errorMsg); - } - let _url = `/crosschain/` + data.coin.toLowerCase() + `/serverinfos`; - try { - const url = await createEndpoint(_url); - const response = await fetch(url); - if (!response.ok) throw new Error("Failed to fetch"); - let res; - try { - res = await response.clone().json(); - } catch (e) { - res = await response.text(); - } - if (res?.error && res?.message) { - throw new Error(res.message); - } - return res.servers; - } catch (error) { - throw new Error(error?.message || "Error in retrieving server info"); - } -}; - -export const getTxActivitySummary = async (data) => { - const requiredFields = ["coin"]; - const missingFields: string[] = []; - requiredFields.forEach((field) => { - if (!data[field]) { - missingFields.push(field); - } - }); - - if (missingFields.length > 0) { - const missingFieldsString = missingFields.join(", "); - const errorMsg = `Missing fields: ${missingFieldsString}`; - throw new Error(errorMsg); - } - - const coin = data.coin; - const url = `/crosschain/txactivity?foreignBlockchain=${coin}`; // No apiKey here - - try { - const endpoint = await createEndpoint(url); - const response = await fetch(endpoint, { - method: "POST", - headers: { - Accept: "*/*", - "Content-Type": "application/json", - }, - }); - - if (!response.ok) throw new Error("Failed to fetch"); - let res; - try { - res = await response.clone().json(); - } catch (e) { - res = await response.text(); - } - if (res?.error && res?.message) { - throw new Error(res.message); - } - return res; // Return full response here - } catch (error) { - throw new Error(error?.message || "Error in tx activity summary"); - } -}; - -export const getForeignFee = async (data) => { - const requiredFields = ["coin", "type"]; - const missingFields: string[] = []; - - requiredFields.forEach((field) => { - if (!data[field]) { - missingFields.push(field); - } - }); - - if (missingFields.length > 0) { - const missingFieldsString = missingFields.join(", "); - const errorMsg = `Missing fields: ${missingFieldsString}`; - throw new Error(errorMsg); - } - - const { coin, type } = data; - const url = `/crosschain/${coin.toLowerCase()}/${type}`; - - try { - const endpoint = await createEndpoint(url); - const response = await fetch(endpoint, { - method: "GET", - headers: { - Accept: "*/*", - "Content-Type": "application/json", - }, - }); - - if (!response.ok) throw new Error("Failed to fetch"); - let res; - try { - res = await response.clone().json(); - } catch (e) { - res = await response.text(); - } - if (res?.error && res?.message) { - throw new Error(res.message); - } - return res; // Return full response here - } catch (error) { - throw new Error(error?.message || "Error in get foreign fee"); - } -}; - -export const updateForeignFee = async (data) => { - const isGateway = await isRunningGateway(); - if (isGateway) { - throw new Error("This action cannot be done through a public node"); - } - const requiredFields = ["coin", "type", "value"]; - const missingFields: string[] = []; - - requiredFields.forEach((field) => { - if (!data[field]) { - missingFields.push(field); - } - }); - - if (missingFields.length > 0) { - const missingFieldsString = missingFields.join(", "); - const errorMsg = `Missing fields: ${missingFieldsString}`; - throw new Error(errorMsg); - } - - const { coin, type, value } = data; - const url = `/crosschain/${coin.toLowerCase()}/update${type}`; - - try { - const endpoint = await createEndpoint(url); - const response = await fetch(endpoint, { - method: "POST", - headers: { - Accept: "*/*", - "Content-Type": "application/json", - }, - body: JSON.stringify({ value }), - }); - - if (!response.ok) throw new Error("Failed to update foreign fee"); - let res; - try { - res = await response.clone().json(); - } catch (e) { - res = await response.text(); - } - if (res?.error && res?.message) { - throw new Error(res.message); - } - return res; // Return full response here - } catch (error) { - throw new Error(error?.message || "Error in update foreign fee"); - } -}; - -export const getServerConnectionHistory = async (data) => { - const requiredFields = ["coin"]; - const missingFields: string[] = []; - - // Validate required fields - requiredFields.forEach((field) => { - if (!data[field]) { - missingFields.push(field); - } - }); - - if (missingFields.length > 0) { - const missingFieldsString = missingFields.join(", "); - const errorMsg = `Missing fields: ${missingFieldsString}`; - throw new Error(errorMsg); - } - - const coin = data.coin.toLowerCase(); - const url = `/crosschain/${coin.toLowerCase()}/serverconnectionhistory`; - - try { - const endpoint = await createEndpoint(url); // Assuming createEndpoint is available - const response = await fetch(endpoint, { - method: "GET", - headers: { - Accept: "*/*", - "Content-Type": "application/json", - }, - }); - - if (!response.ok) - throw new Error("Failed to fetch server connection history"); - - let res; - try { - res = await response.clone().json(); - } catch (e) { - res = await response.text(); - } - - if (res?.error && res?.message) { - throw new Error(res.message); - } - - return res; // Return full response here - } catch (error) { - throw new Error(error?.message || "Error in get server connection history"); - } -}; - -export const setCurrentForeignServer = async (data) => { - const isGateway = await isRunningGateway(); - if (isGateway) { - throw new Error("This action cannot be done through a public node"); - } - const requiredFields = ["coin"]; - const missingFields: string[] = []; - - // Validate required fields - requiredFields.forEach((field) => { - if (!data[field]) { - missingFields.push(field); - } - }); - - if (missingFields.length > 0) { - const missingFieldsString = missingFields.join(", "); - const errorMsg = `Missing fields: ${missingFieldsString}`; - throw new Error(errorMsg); - } - - const { coin, host, port, type } = data; - const body = { - hostName: host, - port: port, - connectionType: type, - }; - - const url = `/crosschain/${coin.toLowerCase()}/setcurrentserver`; - - try { - const endpoint = await createEndpoint(url); // Assuming createEndpoint is available - const response = await fetch(endpoint, { - method: "POST", - headers: { - Accept: "*/*", - "Content-Type": "application/json", - }, - body: JSON.stringify(body), - }); - - if (!response.ok) throw new Error("Failed to set current server"); - - let res; - try { - res = await response.clone().json(); - } catch (e) { - res = await response.text(); - } - - if (res?.error && res?.message) { - throw new Error(res.message); - } - - return res; // Return the full response - } catch (error) { - throw new Error(error?.message || "Error in set current server"); - } -}; - -export const addForeignServer = async (data) => { - const isGateway = await isRunningGateway(); - if (isGateway) { - throw new Error("This action cannot be done through a public node"); - } - const requiredFields = ["coin"]; - const missingFields: string[] = []; - - // Validate required fields - requiredFields.forEach((field) => { - if (!data[field]) { - missingFields.push(field); - } - }); - - if (missingFields.length > 0) { - const missingFieldsString = missingFields.join(", "); - const errorMsg = `Missing fields: ${missingFieldsString}`; - throw new Error(errorMsg); - } - - const { coin, host, port, type } = data; - const body = { - hostName: host, - port: port, - connectionType: type, - }; - - const url = `/crosschain/${coin.toLowerCase()}/addserver`; - - try { - const endpoint = await createEndpoint(url); // Assuming createEndpoint is available - const response = await fetch(endpoint, { - method: "POST", - headers: { - Accept: "*/*", - "Content-Type": "application/json", - }, - body: JSON.stringify(body), - }); - - if (!response.ok) throw new Error("Failed to add server"); - - let res; - try { - res = await response.clone().json(); - } catch (e) { - res = await response.text(); - } - - if (res?.error && res?.message) { - throw new Error(res.message); - } - - return res; // Return the full response - } catch (error) { - throw new Error(error.message || "Error in adding server"); - } -}; - -export const removeForeignServer = async (data) => { - const isGateway = await isRunningGateway(); - if (isGateway) { - throw new Error("This action cannot be done through a public node"); - } - const requiredFields = ["coin"]; - const missingFields: string[] = []; - - // Validate required fields - requiredFields.forEach((field) => { - if (!data[field]) { - missingFields.push(field); - } - }); - - if (missingFields.length > 0) { - const missingFieldsString = missingFields.join(", "); - const errorMsg = `Missing fields: ${missingFieldsString}`; - throw new Error(errorMsg); - } - - const { coin, host, port, type } = data; - const body = { - hostName: host, - port: port, - connectionType: type, - }; - - const url = `/crosschain/${coin.toLowerCase()}/removeserver`; - - try { - const endpoint = await createEndpoint(url); // Assuming createEndpoint is available - const response = await fetch(endpoint, { - method: "POST", - headers: { - Accept: "*/*", - "Content-Type": "application/json", - }, - body: JSON.stringify(body), - }); - - if (!response.ok) throw new Error("Failed to remove server"); - - let res; - try { - res = await response.clone().json(); - } catch (e) { - res = await response.text(); - } - - if (res?.error && res?.message) { - throw new Error(res.message); - } - - return res; // Return the full response - } catch (error) { - throw new Error(error?.message || "Error in removing server"); - } -}; - -export const getDaySummary = async () => { - const url = `/admin/summary`; // Simplified endpoint URL - - try { - const endpoint = await createEndpoint(url); // Assuming createEndpoint is available for constructing the full URL - const response = await fetch(endpoint, { - method: "GET", - headers: { - Accept: "*/*", - }, - }); - - if (!response.ok) throw new Error("Failed to retrieve summary"); - - let res; - try { - res = await response.clone().json(); - } catch (e) { - res = await response.text(); - } - - if (res?.error && res?.message) { - throw new Error(res.message); - } - - return res; // Return the full response - } catch (error) { - throw new Error(error?.message || "Error in retrieving summary"); - } -}; - -export const getNodeInfo = async () => { - const url = `/admin/info`; // Simplified endpoint URL - - try { - const endpoint = await createEndpoint(url); // Assuming createEndpoint is available for constructing the full URL - const response = await fetch(endpoint, { - method: "GET", - headers: { - Accept: "*/*", - }, - }); - - if (!response.ok) throw new Error("Failed to retrieve node info"); - - let res; - try { - res = await response.clone().json(); - } catch (e) { - res = await response.text(); - } - - if (res?.error && res?.message) { - throw new Error(res.message); - } - - return res; // Return the full response - } catch (error) { - throw new Error(error?.message || "Error in retrieving node info"); - } -}; - -export const getNodeStatus = async () => { - const url = `/admin/status`; // Simplified endpoint URL - - try { - const endpoint = await createEndpoint(url); // Assuming createEndpoint is available for constructing the full URL - const response = await fetch(endpoint, { - method: "GET", - headers: { - Accept: "*/*", - }, - }); - - if (!response.ok) throw new Error("Failed to retrieve node status"); - - let res; - try { - res = await response.clone().json(); - } catch (e) { - res = await response.text(); - } - - if (res?.error && res?.message) { - throw new Error(res.message); - } - - return res; // Return the full response - } catch (error) { - throw new Error(error?.message || "Error in retrieving node status"); - } -}; - -export const getArrrSyncStatus = async () => { - const resKeyPair = await getKeyPair(); - const parsedData = resKeyPair; - const arrrSeed = parsedData.arrrSeed58; - const url = `/crosschain/arrr/syncstatus`; // Simplified endpoint URL - - try { - const endpoint = await createEndpoint(url); // Assuming createEndpoint is available for constructing the full URL - const response = await fetch(endpoint, { - method: "POST", - headers: { - Accept: "*/*", - }, - body: arrrSeed - }); - - let res; - - try { - res = await response.clone().json(); - } catch (e) { - res = await response.text(); - } - - return res; // Return the full response - } catch (error) { - throw new Error(error?.message || "Error in retrieving arrr sync status"); - } -}; - -export const sendCoin = async (data, isFromExtension) => { - const requiredFields = ["coin", "amount"]; - const missingFields: string[] = []; - requiredFields.forEach((field) => { - if (!data[field]) { - missingFields.push(field); - } - }); - if (missingFields.length > 0) { - const missingFieldsString = missingFields.join(", "); - const errorMsg = `Missing fields: ${missingFieldsString}`; - throw new Error(errorMsg); - } - if(!data?.destinationAddress && !data?.recipient){ - throw new Error('Missing fields: recipient') - } - let checkCoin = data.coin; - const wallet = await getSaveWallet(); - const address = wallet.address0; - const resKeyPair = await getKeyPair(); - const parsedData = resKeyPair; - const isGateway = await isRunningGateway(); - - if (checkCoin !== "QORT" && isGateway) - throw new Error( - "Cannot send a non-QORT coin through the gateway. Please use your local node." - ); - if (checkCoin === "QORT") { - // Params: data.coin, data.recipient, data.amount, data.fee - // TODO: prompt user to send. If they confirm, call `POST /crosschain/:coin/send`, or for QORT, broadcast a PAYMENT transaction - // then set the response string from the core to the `response` variable (defined above) - // If they decline, send back JSON that includes an `error` key, such as `{"error": "User declined request"}` - const amount = Number(data.amount); - const recipient = data?.recipient || data.destinationAddress; - - const url = await createEndpoint(`/addresses/balance/${address}`); - const response = await fetch(url); - if (!response.ok) throw new Error("Failed to fetch"); - let walletBalance; - try { - walletBalance = await response.clone().json(); - } catch (e) { - walletBalance = await response.text(); - } - if (isNaN(Number(walletBalance))) { - let errorMsg = "Failed to Fetch QORT Balance. Try again!"; - throw new Error(errorMsg); - } - - const transformDecimals = (Number(walletBalance) * QORT_DECIMALS).toFixed( - 0 - ); - const walletBalanceDecimals = Number(transformDecimals); - const amountDecimals = Number(amount) * QORT_DECIMALS; - const fee: number = await sendQortFee(); - if (amountDecimals + fee * QORT_DECIMALS > walletBalanceDecimals) { - let errorMsg = "Insufficient Funds!"; - throw new Error(errorMsg); - } - if (amount <= 0) { - let errorMsg = "Invalid Amount!"; - throw new Error(errorMsg); - } - if (recipient.length === 0) { - let errorMsg = "Receiver cannot be empty!"; - throw new Error(errorMsg); - } - - const resPermission = await getUserPermission( - { - text1: "Do you give this application permission to send coins?", - text2: `To: ${recipient}`, - highlightedText: `${amount} ${checkCoin}`, - fee: fee, - }, - isFromExtension - ); - const { accepted } = resPermission; - - if (accepted) { - const makePayment = await sendCoinFunc( - { amount, password: null, receiver: recipient }, - true - ); - return makePayment.res; - } else { - throw new Error("User declined request"); - } - } else if (checkCoin === "BTC") { - const amount = Number(data.amount); - const recipient = data?.recipient || data.destinationAddress; - const xprv58 = parsedData.btcPrivateKey; - const feePerByte = data.fee ? data.fee : btcFeePerByte; - - const btcWalletBalance = await getWalletBalance({ coin: checkCoin }, true); - - if (isNaN(Number(btcWalletBalance))) { - throw new Error("Unable to fetch BTC balance"); - } - const btcWalletBalanceDecimals = Number(btcWalletBalance); - const btcAmountDecimals = Number(amount); - const fee = feePerByte * 500; // default 0.00050000 - if (btcAmountDecimals + fee > btcWalletBalanceDecimals) { - throw new Error("INSUFFICIENT_FUNDS"); - } - - const resPermission = await getUserPermission( - { - text1: "Do you give this application permission to send coins?", - text2: `To: ${recipient}`, - highlightedText: `${amount} ${checkCoin}`, - foreignFee: `${fee} BTC`, - }, - isFromExtension - ); - const { accepted } = resPermission; - - if (accepted) { - const opts = { - xprv58: xprv58, - receivingAddress: recipient, - bitcoinAmount: amount, - feePerByte: feePerByte, - }; - const url = await createEndpoint(`/crosschain/btc/send`); - - const response = await fetch(url, { - method: "POST", - headers: { - Accept: "application/json", - "Content-Type": "application/json", - }, - body: JSON.stringify(opts), - }); - if (!response.ok) throw new Error("Failed to send"); - let res; - try { - res = await response.clone().json(); - } catch (e) { - res = await response.text(); - } - return res; - } else { - throw new Error("User declined request"); - } - } else if (checkCoin === "LTC") { - const amount = Number(data.amount); - const recipient = data?.recipient || data.destinationAddress; - const xprv58 = parsedData.ltcPrivateKey; - const feePerByte = data.fee ? data.fee : ltcFeePerByte; - const ltcWalletBalance = await getWalletBalance({ coin: checkCoin }, true); - - if (isNaN(Number(ltcWalletBalance))) { - let errorMsg = "Failed to Fetch LTC Balance. Try again!"; - throw new Error(errorMsg); - } - const ltcWalletBalanceDecimals = Number(ltcWalletBalance); - const ltcAmountDecimals = Number(amount); - const fee = feePerByte * 1000; // default 0.00030000 - if (ltcAmountDecimals + fee > ltcWalletBalanceDecimals) { - throw new Error("Insufficient Funds!"); - } - const resPermission = await getUserPermission( - { - text1: "Do you give this application permission to send coins?", - text2: `To: ${recipient}`, - highlightedText: `${amount} ${checkCoin}`, - foreignFee: `${fee} LTC`, - }, - isFromExtension - ); - const { accepted } = resPermission; - - if (accepted) { - const url = await createEndpoint(`/crosschain/ltc/send`); - const opts = { - xprv58: xprv58, - receivingAddress: recipient, - litecoinAmount: amount, - feePerByte: feePerByte, - }; - const response = await fetch(url, { - method: "POST", - headers: { - Accept: "application/json", - "Content-Type": "application/json", - }, - body: JSON.stringify(opts), - }); - if (!response.ok) throw new Error("Failed to send"); - let res; - try { - res = await response.clone().json(); - } catch (e) { - res = await response.text(); - } - return res; - } else { - throw new Error("User declined request"); - } - } else if (checkCoin === "DOGE") { - const amount = Number(data.amount); - const recipient = data?.recipient || data.destinationAddress; - const xprv58 = parsedData.dogePrivateKey; - const feePerByte = data.fee ? data.fee : dogeFeePerByte; - const dogeWalletBalance = await getWalletBalance({ coin: checkCoin }, true); - if (isNaN(Number(dogeWalletBalance))) { - let errorMsg = "Failed to Fetch DOGE Balance. Try again!"; - throw new Error(errorMsg); - } - const dogeWalletBalanceDecimals = Number(dogeWalletBalance); - const dogeAmountDecimals = Number(amount); - const fee = feePerByte * 5000; // default 0.05000000 - if (dogeAmountDecimals + fee > dogeWalletBalanceDecimals) { - let errorMsg = "Insufficient Funds!"; - throw new Error(errorMsg); - } - - const resPermission = await getUserPermission( - { - text1: "Do you give this application permission to send coins?", - text2: `To: ${recipient}`, - highlightedText: `${amount} ${checkCoin}`, - foreignFee: `${fee} DOGE`, - }, - isFromExtension - ); - const { accepted } = resPermission; - - if (accepted) { - const opts = { - xprv58: xprv58, - receivingAddress: recipient, - dogecoinAmount: amount, - feePerByte: feePerByte, - }; - const url = await createEndpoint(`/crosschain/doge/send`); - - const response = await fetch(url, { - method: "POST", - headers: { - Accept: "application/json", - "Content-Type": "application/json", - }, - body: JSON.stringify(opts), - }); - if (!response.ok) throw new Error("Failed to send"); - let res; - try { - res = await response.clone().json(); - } catch (e) { - res = await response.text(); - } - return res; - } else { - throw new Error("User declined request"); - } - } else if (checkCoin === "DGB") { - const amount = Number(data.amount); - const recipient = data?.recipient || data.destinationAddress; - const xprv58 = parsedData.dbgPrivateKey; - const feePerByte = data.fee ? data.fee : dgbFeePerByte; - const dgbWalletBalance = await getWalletBalance({ coin: checkCoin }, true); - if (isNaN(Number(dgbWalletBalance))) { - let errorMsg = "Failed to Fetch DGB Balance. Try again!"; - throw new Error(errorMsg); - } - const dgbWalletBalanceDecimals = Number(dgbWalletBalance); - const dgbAmountDecimals = Number(amount); - const fee = feePerByte * 500; // default 0.00005000 - if (dgbAmountDecimals + fee > dgbWalletBalanceDecimals) { - let errorMsg = "Insufficient Funds!"; - throw new Error(errorMsg); - } - - const resPermission = await getUserPermission( - { - text1: "Do you give this application permission to send coins?", - text2: `To: ${recipient}`, - highlightedText: `${amount} ${checkCoin}`, - foreignFee: `${fee} DGB`, - }, - isFromExtension - ); - const { accepted } = resPermission; - - if (accepted) { - const opts = { - xprv58: xprv58, - receivingAddress: recipient, - digibyteAmount: amount, - feePerByte: feePerByte, - }; - const url = await createEndpoint(`/crosschain/dgb/send`); - - const response = await fetch(url, { - method: "POST", - headers: { - Accept: "application/json", - "Content-Type": "application/json", - }, - body: JSON.stringify(opts), - }); - if (!response.ok) throw new Error("Failed to send"); - let res; - try { - res = await response.clone().json(); - } catch (e) { - res = await response.text(); - } - return res; - } else { - throw new Error("User declined request"); - } - } else if (checkCoin === "RVN") { - const amount = Number(data.amount); - const recipient = data?.recipient || data.destinationAddress; - const xprv58 = parsedData.rvnPrivateKey; - const feePerByte = data.fee ? data.fee : rvnFeePerByte; - const rvnWalletBalance = await getWalletBalance({ coin: checkCoin }, true); - if (isNaN(Number(rvnWalletBalance))) { - let errorMsg = "Failed to Fetch RVN Balance. Try again!"; - throw new Error(errorMsg); - } - const rvnWalletBalanceDecimals = Number(rvnWalletBalance); - const rvnAmountDecimals = Number(amount); - const fee = feePerByte * 500; // default 0.00562500 - if (rvnAmountDecimals + fee > rvnWalletBalanceDecimals) { - let errorMsg = "Insufficient Funds!"; - throw new Error(errorMsg); - } - - const resPermission = await getUserPermission( - { - text1: "Do you give this application permission to send coins?", - text2: `To: ${recipient}`, - highlightedText: `${amount} ${checkCoin}`, - foreignFee: `${fee} RVN`, - }, - isFromExtension - ); - const { accepted } = resPermission; - - if (accepted) { - const opts = { - xprv58: xprv58, - receivingAddress: recipient, - ravencoinAmount: amount, - feePerByte: feePerByte, - }; - const url = await createEndpoint(`/crosschain/rvn/send`); - - const response = await fetch(url, { - method: "POST", - headers: { - Accept: "application/json", - "Content-Type": "application/json", - }, - body: JSON.stringify(opts), - }); - if (!response.ok) throw new Error("Failed to send"); - let res; - try { - res = await response.clone().json(); - } catch (e) { - res = await response.text(); - } - return res; - } else { - throw new Error("User declined request"); - } - } else if (checkCoin === "ARRR") { - const amount = Number(data.amount); - const recipient = data?.recipient || data.destinationAddress; - const memo = data?.memo; - const arrrWalletBalance = await getWalletBalance({ coin: checkCoin }, true); - - if (isNaN(Number(arrrWalletBalance))) { - let errorMsg = "Failed to Fetch ARRR Balance. Try again!"; - throw new Error(errorMsg); - } - const arrrWalletBalanceDecimals = Number(arrrWalletBalance); - const arrrAmountDecimals = Number(amount); - const fee = 0.0001; - if (arrrAmountDecimals + fee > arrrWalletBalanceDecimals) { - let errorMsg = "Insufficient Funds!"; - throw new Error(errorMsg); - } - - const resPermission = await getUserPermission( - { - text1: "Do you give this application permission to send coins?", - text2: `To: ${recipient}`, - highlightedText: `${amount} ${checkCoin}`, - foreignFee: `${fee} ARRR`, - }, - isFromExtension - ); - const { accepted } = resPermission; - - if (accepted) { - const opts = { - entropy58: parsedData.arrrSeed58, - receivingAddress: recipient, - arrrAmount: amount, - memo: memo, - }; - const url = await createEndpoint(`/crosschain/arrr/send`); - - const response = await fetch(url, { - method: "POST", - headers: { - Accept: "application/json", - "Content-Type": "application/json", - }, - body: JSON.stringify(opts), - }); - if (!response.ok) throw new Error("Failed to send"); - let res; - try { - res = await response.clone().json(); - } catch (e) { - res = await response.text(); - } - return res; - } else { - throw new Error("User declined request"); - } - } -}; - -export const createBuyOrder = async (data, isFromExtension) => { - const requiredFields = ["crosschainAtInfo", "foreignBlockchain"]; - const missingFields: string[] = []; - requiredFields.forEach((field) => { - if (!data[field]) { - missingFields.push(field); - } - }); - if (missingFields.length > 0) { - const missingFieldsString = missingFields.join(", "); - const errorMsg = `Missing fields: ${missingFieldsString}`; - throw new Error(errorMsg); - } - const isGateway = await isRunningGateway(); - const foreignBlockchain = data.foreignBlockchain; - const atAddresses = data.crosschainAtInfo?.map( - (order) => order.qortalAtAddress - ); - - const atPromises = atAddresses - .map((atAddress) => - requestQueueGetAtAddresses.enqueue(async () => { - const url = await createEndpoint(`/crosschain/trade/${atAddress}`) - const resAddress = await fetch(url); - const resData = await resAddress.json(); - if(foreignBlockchain !== resData?.foreignBlockchain){ - throw new Error('All requested ATs need to be of the same foreign Blockchain.') - } - return resData - }) - ); - - const crosschainAtInfo = await Promise.all(atPromises); - try { - const resPermission = await getUserPermission( - { - text1: - "Do you give this application permission to perform a buy order?", - text2: `${atAddresses?.length}${" "} - ${`buy order${atAddresses?.length === 1 ? "" : "s"}`}`, - text3: `${crosschainAtInfo?.reduce((latest, cur) => { - return latest + +cur?.qortAmount; - }, 0)} QORT FOR ${roundUpToDecimals( - crosschainAtInfo?.reduce((latest, cur) => { - return latest + +cur?.expectedForeignAmount; - }, 0) - )} - ${` ${crosschainAtInfo?.[0]?.foreignBlockchain}`}`, - highlightedText: `Is using public node: ${isGateway}`, - fee: "", - foreignFee: `${sellerForeignFee[foreignBlockchain].value} ${sellerForeignFee[foreignBlockchain].ticker}`, - }, - isFromExtension - ); - const { accepted } = resPermission; - if (accepted) { - const resBuyOrder = await createBuyOrderTx({ - crosschainAtInfo, - isGateway, - foreignBlockchain, - }); - return resBuyOrder; - } else { - throw new Error("User declined request"); - } - } catch (error) { - throw new Error(error?.message || "Failed to submit trade order."); - } -}; - -const cancelTradeOfferTradeBot = async (body, keyPair) => { - const txn = new DeleteTradeOffer().createTransaction(body); - const url = await createEndpoint(`/crosschain/tradeoffer`); - const bodyToString = JSON.stringify(txn); - - const deleteTradeBotResponse = await fetch(url, { - method: "DELETE", - headers: { - "Content-Type": "application/json", - }, - body: bodyToString, - }); - - if (!deleteTradeBotResponse.ok) throw new Error("Unable to update tradebot"); - const unsignedTxn = await deleteTradeBotResponse.text(); - const signedTxnBytes = await signTradeBotTransaction(unsignedTxn, keyPair); - const signedBytes = Base58.encode(signedTxnBytes); - - let res; - try { - res = await processTransactionVersion2(signedBytes); - } catch (error) { - return { - error: "Failed to Cancel Sell Order. Try again!", - failedTradeBot: { - atAddress: body.atAddress, - creatorAddress: body.creatorAddress, - }, - }; - } - if (res?.error) { - return { - error: "Failed to Cancel Sell Order. Try again!", - failedTradeBot: { - atAddress: body.atAddress, - creatorAddress: body.creatorAddress, - }, - }; - } - if (res?.signature) { - return res; - } else { - throw new Error("Failed to Cancel Sell Order. Try again!"); - } -}; -const findFailedTradebot = async (createBotCreationTimestamp, body) => { - //wait 5 secs - const wallet = await getSaveWallet(); - const address = wallet.address0; - await new Promise((res) => { - setTimeout(() => { - res(null); - }, 5000); - }); - const url = await createEndpoint( - `/crosschain/tradebot?foreignBlockchain=LITECOIN` - ); - - const tradeBotsReponse = await fetch(url, { - method: "GET", - headers: { - "Content-Type": "application/json", - }, - }); - const data = await tradeBotsReponse.json(); - const latestItem2 = data - .filter((item) => item.creatorAddress === address) - .sort((a, b) => b.timestamp - a.timestamp)[0]; - const latestItem = data - .filter( - (item) => - item.creatorAddress === address && - +item.foreignAmount === +body.foreignAmount - ) - .sort((a, b) => b.timestamp - a.timestamp)[0]; - if ( - latestItem && - createBotCreationTimestamp - latestItem.timestamp <= 5000 && - createBotCreationTimestamp > latestItem.timestamp // Ensure latestItem's timestamp is before createBotCreationTimestamp - ) { - return latestItem; - } else { - return null; - } -}; -const tradeBotCreateRequest = async (body, keyPair) => { - const txn = new TradeBotCreateRequest().createTransaction(body); - const url = await createEndpoint(`/crosschain/tradebot/create`); - const bodyToString = JSON.stringify(txn); - - const unsignedTxnResponse = await fetch(url, { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: bodyToString, - }); - if (!unsignedTxnResponse.ok) throw new Error("Unable to create tradebot"); - const createBotCreationTimestamp = Date.now(); - const unsignedTxn = await unsignedTxnResponse.text(); - const signedTxnBytes = await signTradeBotTransaction(unsignedTxn, keyPair); - const signedBytes = Base58.encode(signedTxnBytes); - - let res; - try { - res = await processTransactionVersion2(signedBytes); - } catch (error) { - const findFailedTradeBot = await findFailedTradebot( - createBotCreationTimestamp, - body - ); - return { - error: "Failed to Create Sell Order. Try again!", - failedTradeBot: findFailedTradeBot, - }; - } - - if (res?.signature) { - return res; - } else { - throw new Error("Failed to Create Sell Order. Try again!"); - } -}; - -export const createSellOrder = async (data, isFromExtension) => { - const requiredFields = ["qortAmount", "foreignBlockchain", "foreignAmount"]; - const missingFields: string[] = []; - requiredFields.forEach((field) => { - if (!data[field]) { - missingFields.push(field); - } - }); - if (missingFields.length > 0) { - const missingFieldsString = missingFields.join(", "); - const errorMsg = `Missing fields: ${missingFieldsString}`; - throw new Error(errorMsg); - } - - const parsedForeignAmount = Number(data.foreignAmount)?.toFixed(8) - - const receivingAddress = await getUserWalletFunc(data.foreignBlockchain); - try { - const resPermission = await getUserPermission( - { - text1: - "Do you give this application permission to perform a sell order?", - text2: `${data.qortAmount}${" "} - ${`QORT`}`, - text3: `FOR ${parsedForeignAmount} ${data.foreignBlockchain}`, - fee: "0.02", - }, - isFromExtension - ); - const { accepted } = resPermission; - if (accepted) { - const resKeyPair = await getKeyPair(); - const parsedData = resKeyPair; - const userPublicKey = parsedData.publicKey; - const uint8PrivateKey = Base58.decode(parsedData.privateKey); - const uint8PublicKey = Base58.decode(parsedData.publicKey); - const keyPair = { - privateKey: uint8PrivateKey, - publicKey: uint8PublicKey, - }; - const response = await tradeBotCreateRequest( - { - creatorPublicKey: userPublicKey, - qortAmount: parseFloat(data.qortAmount), - fundingQortAmount: parseFloat(data.qortAmount) + 0.01, - foreignBlockchain: data.foreignBlockchain, - foreignAmount: parseFloat(parsedForeignAmount), - tradeTimeout: 120, - receivingAddress: receivingAddress.address, - }, - keyPair - ); - - return response; - } else { - throw new Error("User declined request"); - } - } catch (error) { - throw new Error(error?.message || "Failed to submit sell order."); - } -}; - -export const cancelSellOrder = async (data, isFromExtension) => { - const requiredFields = [ - "atAddress", - ]; - const missingFields: string[] = []; - requiredFields.forEach((field) => { - if (!data[field]) { - missingFields.push(field); - } - }); - if (missingFields.length > 0) { - const missingFieldsString = missingFields.join(", "); - const errorMsg = `Missing fields: ${missingFieldsString}`; - throw new Error(errorMsg); - } - - const url = await createEndpoint(`/crosschain/trade/${data.atAddress}`) - const resAddress = await fetch(url); - const resData = await resAddress.json(); - if(!resData?.qortalAtAddress) throw new Error('Cannot find AT info.') - try { - const fee = await getFee("MESSAGE"); - - const resPermission = await getUserPermission( - { - text1: - "Do you give this application permission to perform: cancel a sell order?", - text2: `${resData.qortAmount}${" "} - ${`QORT`}`, - text3: `FOR ${resData.expectedForeignAmount} ${resData.foreignBlockchain}`, - fee: fee.fee, - }, - isFromExtension - ); - const { accepted } = resPermission; - if (accepted) { - const resKeyPair = await getKeyPair(); - const parsedData = resKeyPair; - const userPublicKey = parsedData.publicKey; - const uint8PrivateKey = Base58.decode(parsedData.privateKey); - const uint8PublicKey = Base58.decode(parsedData.publicKey); - const keyPair = { - privateKey: uint8PrivateKey, - publicKey: uint8PublicKey, - }; - const response = await cancelTradeOfferTradeBot( - { - creatorPublicKey: userPublicKey, - atAddress: data.atAddress, - }, - keyPair - ); - - return response; - } else { - throw new Error("User declined request"); - } - } catch (error) { - throw new Error(error?.message || "Failed to submit sell order."); - } -}; - -export const openNewTab = async (data, isFromExtension) => { - const requiredFields = [ - "qortalLink", - ]; - const missingFields: string[] = []; - requiredFields.forEach((field) => { - if (!data[field]) { - missingFields.push(field); - } - }); - if (missingFields.length > 0) { - const missingFieldsString = missingFields.join(", "); - const errorMsg = `Missing fields: ${missingFieldsString}`; - throw new Error(errorMsg); - } - - const res = extractComponents(data.qortalLink); - if (res) { - const { service, name, identifier, path } = res; - if(!service && !name) throw new Error('Invalid qortal link') - executeEvent("addTab", { data: { service, name, identifier, path } }); - executeEvent("open-apps-mode", { }); - return true - } else { - throw new Error("Invalid qortal link") - } - - - -}; - -export const adminAction = async (data, isFromExtension) => { - const requiredFields = ["type"]; - const missingFields: string[] = []; - requiredFields.forEach((field) => { - if (!data[field]) { - missingFields.push(field); - } - }); - // For actions that require a value, check for 'value' field - const actionsRequiringValue = [ - "addpeer", - "removepeer", - "forcesync", - "addmintingaccount", - "removemintingaccount", - ]; - if ( - actionsRequiringValue.includes(data.type.toLowerCase()) && - !data.value - ) { - missingFields.push("value"); - } - if (missingFields.length > 0) { - const missingFieldsString = missingFields.join(", "); - const errorMsg = `Missing fields: ${missingFieldsString}`; - throw new Error(errorMsg); - } - const isGateway = await isRunningGateway(); - if (isGateway) { - throw new Error("This action cannot be done through a public node"); - } - - let apiEndpoint = ""; - let method = "GET"; // Default method - let includeValueInBody = false; - switch (data.type.toLowerCase()) { - case "stop": - apiEndpoint = await createEndpoint("/admin/stop"); - break; - case "restart": - apiEndpoint = await createEndpoint("/admin/restart"); - break; - case "bootstrap": - apiEndpoint = await createEndpoint("/admin/bootstrap"); - break; - case "addmintingaccount": - apiEndpoint = await createEndpoint("/admin/mintingaccounts"); - method = "POST"; - includeValueInBody = true; - break; - case "removemintingaccount": - apiEndpoint = await createEndpoint("/admin/mintingaccounts"); - method = "DELETE"; - includeValueInBody = true; - break; - case "forcesync": - apiEndpoint = await createEndpoint("/admin/forcesync"); - method = "POST"; - includeValueInBody = true; - break; - case "addpeer": - apiEndpoint = await createEndpoint("/peers"); - method = "POST"; - includeValueInBody = true; - break; - case "removepeer": - apiEndpoint = await createEndpoint("/peers"); - method = "DELETE"; - includeValueInBody = true; - break; - default: - throw new Error(`Unknown admin action type: ${data.type}`); - } - // Prepare the permission prompt text - let permissionText = `Do you give this application permission to perform the admin action: ${data.type}`; - if (data.value) { - permissionText += ` with value: ${data.value}`; - } - - const resPermission = await getUserPermission( - { - text1: permissionText, - }, - isFromExtension - ); - const { accepted } = resPermission; - if (accepted) { - // Set up options for the API call - const options: RequestInit = { - method: method, - headers: {}, - }; - if (includeValueInBody) { - options.headers["Content-Type"] = "text/plain"; - options.body = data.value; - } - const response = await fetch(apiEndpoint, options); - if (!response.ok) throw new Error("Failed to perform request"); - - let res; - try { - res = await response.clone().json(); - } catch (e) { - res = await response.text(); - } - return res; - } else { - throw new Error("User declined request"); - } -}; - -export const signTransaction = async (data, isFromExtension) => { - const requiredFields = ["unsignedBytes"]; - const missingFields: string[] = []; - requiredFields.forEach((field) => { - if (!data[field]) { - missingFields.push(field); - } - }); - if (missingFields.length > 0) { - const missingFieldsString = missingFields.join(", "); - const errorMsg = `Missing fields: ${missingFieldsString}`; - throw new Error(errorMsg); - } - - const shouldProcess = data?.process || false; - let _url = await createEndpoint( - "/transactions/decode?ignoreValidityChecks=false" - ); - - let _body = data.unsignedBytes; - const response = await fetch(_url, { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: _body, - }); - if (!response.ok) throw new Error("Failed to decode transaction"); - const decodedData = await response.json(); - const resPermission = await getUserPermission( - { - text1: `Do you give this application permission to ${ shouldProcess ? 'SIGN and PROCESS' : 'SIGN' } a transaction?`, - highlightedText: "Read the transaction carefully before accepting!", - text2: `Tx type: ${decodedData.type}`, - json: decodedData, - }, - isFromExtension - ); - const { accepted } = resPermission; - if (accepted) { - - let urlConverted = await createEndpoint("/transactions/convert"); - - const responseConverted = await fetch(urlConverted, { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: data.unsignedBytes, - }); - const resKeyPair = await getKeyPair(); - const parsedData = resKeyPair; - const uint8PrivateKey = Base58.decode(parsedData.privateKey); - const uint8PublicKey = Base58.decode(parsedData.publicKey); - const keyPair = { - privateKey: uint8PrivateKey, - publicKey: uint8PublicKey, - }; - const convertedBytes = await responseConverted.text(); - const txBytes = Base58.decode(data.unsignedBytes); - const _arbitraryBytesBuffer = Object.keys(txBytes).map(function (key) { - return txBytes[key]; - }); - const arbitraryBytesBuffer = new Uint8Array(_arbitraryBytesBuffer); - const txByteSigned = Base58.decode(convertedBytes); - const _bytesForSigningBuffer = Object.keys(txByteSigned).map(function ( - key - ) { - return txByteSigned[key]; - }); - const bytesForSigningBuffer = new Uint8Array(_bytesForSigningBuffer); - const signature = nacl.sign.detached( - bytesForSigningBuffer, - keyPair.privateKey - ); - const signedBytes = utils.appendBuffer(arbitraryBytesBuffer, signature); - const signedBytesToBase58 = Base58.encode(signedBytes); - if(!shouldProcess){ - return signedBytesToBase58 - } - const res = await processTransactionVersion2(signedBytesToBase58); - if (!res?.signature) - throw new Error( - res?.message || "Transaction was not able to be processed" - ); - return res; - - } else { - throw new Error("User declined request"); - } -}; - -const missingFieldsFunc = (data, requiredFields)=> { - const missingFields: string[] = []; - requiredFields.forEach((field) => { - if (!data[field]) { - missingFields.push(field); - } - }); - if (missingFields.length > 0) { - const missingFieldsString = missingFields.join(", "); - const errorMsg = `Missing fields: ${missingFieldsString}`; - throw new Error(errorMsg); - } -} - -const encode = (value) => encodeURIComponent(value.trim()); // Helper to encode values -const buildQueryParams = (data) => { -const allowedParams= ["name", "service", "identifier", "mimeType", "fileName", "encryptionType", "key"] - return Object.entries(data) - .map(([key, value]) => { - if (value === undefined || value === null || value === false || !allowedParams.includes(key)) return null; // Skip null, undefined, or false - if (typeof value === "boolean") return `${key}=${value}`; // Handle boolean values - return `${key}=${encode(value)}`; // Encode other values - }) - .filter(Boolean) // Remove null values - .join("&"); // Join with `&` -}; -export const createAndCopyEmbedLink = async (data, isFromExtension) => { - const requiredFields = [ - "type", - ]; - const missingFields: string[] = []; - requiredFields.forEach((field) => { - if (!data[field]) { - missingFields.push(field); - } - }); - if (missingFields.length > 0) { - const missingFieldsString = missingFields.join(", "); - const errorMsg = `Missing fields: ${missingFieldsString}`; - throw new Error(errorMsg); - } - - - switch (data.type) { - case "POLL": { - missingFieldsFunc(data, [ - "type", - "name" - ]) - - const queryParams = [ - `name=${encode(data.name)}`, - data.ref ? `ref=${encode(data.ref)}` : null, // Add only if ref exists - ] - .filter(Boolean) // Remove null values - .join("&"); // Join with `&` - const link = `qortal://use-embed/POLL?${queryParams}` - try { - await navigator.clipboard.writeText(link); - } catch (error) { - throw new Error('Failed to copy to clipboard.') - } - return link; - } - case "IMAGE": - case "ATTACHMENT": - { - missingFieldsFunc(data, [ - "type", - "name", - "service", - "identifier" - ]) - if(data?.encryptionType === 'private' && !data?.key){ - throw new Error('For an encrypted resource, you must provide the key to create the shared link') - } - const queryParams = buildQueryParams(data) - - const link = `qortal://use-embed/${data.type}?${queryParams}`; - - try { - await navigator.clipboard.writeText(link); - } catch (error) { - throw new Error('Failed to copy to clipboard.') - } - - return link; - } - - - default: - throw new Error('Invalid type') - } - -}; - -export const registerNameRequest = async (data, isFromExtension) => { - const requiredFields = ["name"]; - const missingFields: string[] = []; - requiredFields.forEach((field) => { - if (!data[field]) { - missingFields.push(field); - } - }); - const fee = await getFee("REGISTER_NAME"); - const resPermission = await getUserPermission( - { - text1: `Do you give this application permission to register this name?`, - highlightedText: data.name, - text2: data?.description, - fee: fee.fee - }, - isFromExtension - ); - const { accepted } = resPermission; - if (accepted) { - const name = data.name - const description = data?.description - const response = await registerName({ name, description }); - return response - - } else { - throw new Error("User declined request"); - } -}; - -export const updateNameRequest = async (data, isFromExtension) => { - const requiredFields = ["newName", "oldName"]; - const missingFields: string[] = []; - requiredFields.forEach((field) => { - if (!data[field]) { - missingFields.push(field); - } - }); - const oldName = data.oldName - const newName = data.newName - const description = data?.description - const fee = await getFee("UPDATE_NAME"); - const resPermission = await getUserPermission( - { - text1: `Do you give this application permission to register this name?`, - highlightedText: data.newName, - text2: data?.description, - fee: fee.fee, - }, - isFromExtension - ); - const { accepted } = resPermission; - if (accepted) { - const response = await updateName({ oldName, newName, description }); - return response - - } else { - throw new Error("User declined request"); - } -}; - -export const leaveGroupRequest = async (data, isFromExtension) => { - const requiredFields = ["groupId"]; - const missingFields: string[] = []; - requiredFields.forEach((field) => { - if (!data[field]) { - missingFields.push(field); - } - }); - const groupId = data.groupId - let groupInfo = null; - try { - const url = await createEndpoint(`/groups/${groupId}`); - const response = await fetch(url); - if (!response.ok) throw new Error("Failed to fetch group"); - - groupInfo = await response.json(); - } catch (error) { - const errorMsg = (error && error.message) || "Group not found"; - throw new Error(errorMsg); - } - - const fee = await getFee("LEAVE_GROUP"); - const resPermission = await getUserPermission( - { - text1: `Do you give this application permission to leave the following group?`, - highlightedText: `${groupInfo.groupName}`, - fee: fee.fee, - }, - isFromExtension - ); - const { accepted } = resPermission; - if (accepted) { - const response = await leaveGroup({ groupId }); - return response - - } else { - throw new Error("User declined request"); - } -}; - -export const inviteToGroupRequest = async (data, isFromExtension) => { - const requiredFields = ["groupId", "inviteTime", "inviteeAddress"]; - const missingFields: string[] = []; - requiredFields.forEach((field) => { - if (!data[field]) { - missingFields.push(field); - } - }); - const groupId = data.groupId - const qortalAddress = data?.inviteeAddress - const inviteTime = data?.inviteTime - - let groupInfo = null; - try { - const url = await createEndpoint(`/groups/${groupId}`); - const response = await fetch(url); - if (!response.ok) throw new Error("Failed to fetch group"); - - groupInfo = await response.json(); - } catch (error) { - const errorMsg = (error && error.message) || "Group not found"; - throw new Error(errorMsg); - } - - const displayInvitee = await getNameInfoForOthers(qortalAddress) - - const fee = await getFee("GROUP_INVITE"); - const resPermission = await getUserPermission( - { - text1: `Do you give this application permission to invite ${displayInvitee || qortalAddress}?`, - highlightedText: `Group: ${groupInfo.groupName}`, - fee: fee.fee, - }, - isFromExtension - ); - const { accepted } = resPermission; - if (accepted) { - const response = await inviteToGroup({ - groupId, - qortalAddress, - inviteTime, - }) - return response - - } else { - throw new Error("User declined request"); - } -}; - -export const kickFromGroupRequest = async (data, isFromExtension) => { - const requiredFields = ["groupId", "qortalAddress"]; - const missingFields: string[] = []; - requiredFields.forEach((field) => { - if (!data[field]) { - missingFields.push(field); - } - }); - const groupId = data.groupId - const qortalAddress = data?.qortalAddress - const reason = data?.reason - - let groupInfo = null; - try { - const url = await createEndpoint(`/groups/${groupId}`); - const response = await fetch(url); - if (!response.ok) throw new Error("Failed to fetch group"); - - groupInfo = await response.json(); - } catch (error) { - const errorMsg = (error && error.message) || "Group not found"; - throw new Error(errorMsg); - } - - const displayInvitee = await getNameInfoForOthers(qortalAddress) - - const fee = await getFee("GROUP_KICK"); - const resPermission = await getUserPermission( - { - text1: `Do you give this application permission to kick ${displayInvitee || qortalAddress} from the group?`, - highlightedText: `Group: ${groupInfo.groupName}`, - fee: fee.fee, - }, - isFromExtension - ); - const { accepted } = resPermission; - if (accepted) { - const response = await kickFromGroup({ - groupId, - qortalAddress, - rBanReason: reason - }) - return response - - } else { - throw new Error("User declined request"); - } -}; - -export const banFromGroupRequest = async (data, isFromExtension) => { - const requiredFields = ["groupId", "qortalAddress"]; - const missingFields: string[] = []; - requiredFields.forEach((field) => { - if (!data[field]) { - missingFields.push(field); - } - }); - const groupId = data.groupId - const qortalAddress = data?.qortalAddress - const rBanTime = data?.banTime - const reason = data?.reason - let groupInfo = null; - try { - const url = await createEndpoint(`/groups/${groupId}`); - const response = await fetch(url); - if (!response.ok) throw new Error("Failed to fetch group"); - - groupInfo = await response.json(); - } catch (error) { - const errorMsg = (error && error.message) || "Group not found"; - throw new Error(errorMsg); - } - - const displayInvitee = await getNameInfoForOthers(qortalAddress) - - const fee = await getFee("GROUP_BAN"); - const resPermission = await getUserPermission( - { - text1: `Do you give this application permission to ban ${displayInvitee || qortalAddress} from the group?`, - highlightedText: `Group: ${groupInfo.groupName}`, - fee: fee.fee, - }, - isFromExtension - ); - const { accepted } = resPermission; - if (accepted) { - const response = await banFromGroup({ - groupId, - qortalAddress, - rBanTime, - rBanReason: reason - }) - return response - - } else { - throw new Error("User declined request"); - } -}; - -export const cancelGroupBanRequest = async (data, isFromExtension) => { - const requiredFields = ["groupId", "qortalAddress"]; - const missingFields: string[] = []; - requiredFields.forEach((field) => { - if (!data[field]) { - missingFields.push(field); - } - }); - const groupId = data.groupId - const qortalAddress = data?.qortalAddress - - let groupInfo = null; - try { - const url = await createEndpoint(`/groups/${groupId}`); - const response = await fetch(url); - if (!response.ok) throw new Error("Failed to fetch group"); - - groupInfo = await response.json(); - } catch (error) { - const errorMsg = (error && error.message) || "Group not found"; - throw new Error(errorMsg); - } - - const displayInvitee = await getNameInfoForOthers(qortalAddress) - - const fee = await getFee("CANCEL_GROUP_BAN"); - const resPermission = await getUserPermission( - { - text1: `Do you give this application permission to cancel the group ban for user ${displayInvitee || qortalAddress}?`, - highlightedText: `Group: ${groupInfo.groupName}`, - fee: fee.fee, - }, - isFromExtension - ); - const { accepted } = resPermission; - if (accepted) { - const response = await cancelBan({ - groupId, - qortalAddress, - }) - return response - - } else { - throw new Error("User declined request"); - } -}; - -export const addGroupAdminRequest = async (data, isFromExtension) => { - const requiredFields = ["groupId", "qortalAddress"]; - const missingFields: string[] = []; - requiredFields.forEach((field) => { - if (!data[field]) { - missingFields.push(field); - } - }); - const groupId = data.groupId - const qortalAddress = data?.qortalAddress - - let groupInfo = null; - try { - const url = await createEndpoint(`/groups/${groupId}`); - const response = await fetch(url); - if (!response.ok) throw new Error("Failed to fetch group"); - - groupInfo = await response.json(); - } catch (error) { - const errorMsg = (error && error.message) || "Group not found"; - throw new Error(errorMsg); - } - - const displayInvitee = await getNameInfoForOthers(qortalAddress) - - const fee = await getFee("ADD_GROUP_ADMIN"); - const resPermission = await getUserPermission( - { - text1: `Do you give this application permission to add user ${displayInvitee || qortalAddress} as an admin?`, - highlightedText: `Group: ${groupInfo.groupName}`, - fee: fee.fee, - }, - isFromExtension - ); - const { accepted } = resPermission; - if (accepted) { - const response = await makeAdmin({ - groupId, - qortalAddress, - }) - return response - - } else { - throw new Error("User declined request"); - } -}; - -export const removeGroupAdminRequest = async (data, isFromExtension) => { - const requiredFields = ["groupId", "qortalAddress"]; - const missingFields: string[] = []; - requiredFields.forEach((field) => { - if (!data[field]) { - missingFields.push(field); - } - }); - const groupId = data.groupId - const qortalAddress = data?.qortalAddress - - let groupInfo = null; - try { - const url = await createEndpoint(`/groups/${groupId}`); - const response = await fetch(url); - if (!response.ok) throw new Error("Failed to fetch group"); - - groupInfo = await response.json(); - } catch (error) { - const errorMsg = (error && error.message) || "Group not found"; - throw new Error(errorMsg); - } - - const displayInvitee = await getNameInfoForOthers(qortalAddress) - - const fee = await getFee("REMOVE_GROUP_ADMIN"); - const resPermission = await getUserPermission( - { - text1: `Do you give this application permission to remove user ${displayInvitee || qortalAddress} as admin?`, - highlightedText: `Group: ${groupInfo.groupName}`, - fee: fee.fee, - }, - isFromExtension - ); - const { accepted } = resPermission; - if (accepted) { - const response = await removeAdmin({ - groupId, - qortalAddress, - }) - return response - - } else { - throw new Error("User declined request"); - } -}; - -export const cancelGroupInviteRequest = async (data, isFromExtension) => { - const requiredFields = ["groupId", "qortalAddress"]; - const missingFields: string[] = []; - requiredFields.forEach((field) => { - if (!data[field]) { - missingFields.push(field); - } - }); - const groupId = data.groupId - const qortalAddress = data?.qortalAddress - - let groupInfo = null; - try { - const url = await createEndpoint(`/groups/${groupId}`); - const response = await fetch(url); - if (!response.ok) throw new Error("Failed to fetch group"); - - groupInfo = await response.json(); - } catch (error) { - const errorMsg = (error && error.message) || "Group not found"; - throw new Error(errorMsg); - } - - const displayInvitee = await getNameInfoForOthers(qortalAddress) - - const fee = await getFee("CANCEL_GROUP_INVITE"); - const resPermission = await getUserPermission( - { - text1: `Do you give this application permission to cancel the group invite for ${displayInvitee || qortalAddress}?`, - highlightedText: `Group: ${groupInfo.groupName}`, - fee: fee.fee, - }, - isFromExtension - ); - const { accepted } = resPermission; - if (accepted) { - const response = await cancelInvitationToGroup({ - groupId, - qortalAddress, - }) - return response - - } else { - throw new Error("User declined request"); - } -}; - - -export const createGroupRequest = async (data, isFromExtension) => { - const requiredFields = ["groupId", "qortalAddress"]; - const missingFields: string[] = []; - requiredFields.forEach((field) => { - if (!data[field]) { - missingFields.push(field); - } - }); - const groupName = data.groupName - const description = data?.description - const type = +data.type - const approvalThreshold = +data?.approvalThreshold - const minBlock = +data?.minBlock - const maxBlock = +data.maxBlock - - - const fee = await getFee("CREATE_GROUP"); - const resPermission = await getUserPermission( - { - text1: `Do you give this application permission to create a group?`, - highlightedText: `Group name: ${groupName}`, - fee: fee.fee, - }, - isFromExtension - ); - const { accepted } = resPermission; - if (accepted) { - const response = await createGroup({ - groupName, - groupDescription: description, - groupType: type, - groupApprovalThreshold: approvalThreshold, - minBlock, - maxBlock - }) - return response - - } else { - throw new Error("User declined request"); - } -}; - -export const decryptAESGCMRequest = async (data, isFromExtension) => { - const requiredFields = ["encryptedData", "iv", "senderPublicKey"]; - requiredFields.forEach((field) => { - if (!data[field]) { - throw new Error(`Missing required field: ${field}`); - } - }); - - const encryptedData = data.encryptedData; - const iv = data.iv; - const senderPublicKeyBase58 = data.senderPublicKey; - - - // Decode keys and IV - const senderPublicKey = Base58.decode(senderPublicKeyBase58); - const resKeyPair = await getKeyPair(); // Assume this retrieves the current user's keypair - const uint8PrivateKey = Base58.decode(resKeyPair.privateKey); - - // Convert ed25519 keys to Curve25519 - const convertedPrivateKey = ed2curve.convertSecretKey(uint8PrivateKey); - const convertedPublicKey = ed2curve.convertPublicKey(senderPublicKey); - - // Generate shared secret - const sharedSecret = new Uint8Array(32); - nacl.lowlevel.crypto_scalarmult(sharedSecret, convertedPrivateKey, convertedPublicKey); - - // Derive encryption key - const encryptionKey: Uint8Array = new Sha256().process(sharedSecret).finish().result; - - // Convert IV and ciphertext from Base64 - const base64ToUint8Array = (base64) => Uint8Array.from(atob(base64), c => c.charCodeAt(0)); - const ivUint8Array = base64ToUint8Array(iv); - const ciphertext = base64ToUint8Array(encryptedData); - // Validate IV and key lengths - if (ivUint8Array.length !== 12) { - throw new Error("Invalid IV: AES-GCM requires a 12-byte IV."); - } - if (encryptionKey.length !== 32) { - throw new Error("Invalid key: AES-GCM requires a 256-bit key."); - } - - try { - // Decrypt data - const algorithm = { name: "AES-GCM", iv: ivUint8Array }; - const cryptoKey = await crypto.subtle.importKey("raw", encryptionKey, algorithm, false, ["decrypt"]); - const decryptedArrayBuffer = await crypto.subtle.decrypt(algorithm, cryptoKey, ciphertext); - - // Return decrypted data as Base64 - return uint8ArrayToBase64(new Uint8Array(decryptedArrayBuffer)); - } catch (error) { - console.error("Decryption failed:", error); - throw new Error("Failed to decrypt the message. Ensure the data and keys are correct."); - } -}; diff --git a/src/styles/App-styles.ts b/src/styles/App-styles.ts new file mode 100644 index 0000000..8061fa5 --- /dev/null +++ b/src/styles/App-styles.ts @@ -0,0 +1,235 @@ +import { Typography, Box, TextField, InputLabel } from '@mui/material'; +import { styled } from '@mui/system'; + +export const AppContainer = styled(Box)(({ theme }) => ({ + alignItems: 'center', + backgroundColor: theme.palette.background.default, + color: theme.palette.text.primary, + display: 'flex', + flexDirection: 'column', + height: '100vh', + overflow: 'hidden', + radius: '15px', + width: '100vw', +})); + +export const AuthenticatedContainer = styled(Box)(({ theme }) => ({ + backgroundColor: theme.palette.background.default, + color: theme.palette.text.primary, + display: 'flex', + height: '100%', + justifyContent: 'space-between', + width: '100%', +})); + +export const AuthenticatedContainerInnerLeft = styled(Box)(({ theme }) => ({ + alignItems: 'center', + backgroundColor: theme.palette.background.default, + color: theme.palette.text.primary, + display: 'flex', + flexDirection: 'column', + height: '100%', + width: '100%', +})); + +export const AuthenticatedContainerInnerRight = styled(Box)(({ theme }) => ({ + alignItems: 'center', + backgroundColor: theme.palette.background.default, + color: theme.palette.text.primary, + display: 'flex', + flexDirection: 'column', + height: '100%', + width: '60px', +})); + +export const AuthenticatedContainerInnerTop = styled(Box)(({ theme }) => ({ + alignItems: 'center', + backgroundColor: theme.palette.background.default, + color: theme.palette.text.primary, + display: 'flex', + height: '60px', + justifyContent: 'flex-start', + padding: '20px', + width: '100%px', +})); + +export const TextP = styled(Typography)(({ theme }) => ({ + color: theme.palette.text.primary, + fontFamily: 'Inter', + fontSize: '13px', + fontWeight: 600, +})); + +export const TextItalic = styled('span')(({ theme }) => ({ + color: theme.palette.text.primary, + fontFamily: 'Inter', + fontSize: '13px', + fontStyle: 'italic', + fontWeight: 600, +})); + +export const TextSpan = styled('span')(({ theme }) => ({ + color: theme.palette.text.primary, + fontFamily: 'Inter', + fontSize: '13px', + fontWeight: 800, +})); + +export const AddressBox = styled(Box)(({ theme }) => ({ + alignItems: 'center', + backgroundColor: theme.palette.background.default, + borderColor: theme.palette.background.paper, + borderRadius: '100px', + borderStyle: 'solid', + borderWidth: '1px', + color: theme.palette.text.primary, + cursor: 'pointer', + display: 'flex', + fontFamily: 'Inter', + fontSize: '12px', + fontWeight: 600, + gap: '5px', + height: '25px', + justifyContent: 'space-between', + lineHeight: '14.52px', + padding: '5px 15px', + textAlign: 'left', + transition: 'all 0.2s', + width: 'auto', + '&:hover': { + backgroundColor: theme.palette.background.paper, + color: theme.palette.text.secondary, + 'svg path': { + fill: theme.palette.mode === 'dark' ? '#fff' : '#000', + }, + }, +})); + +export const CustomButton = styled(Box)(({ theme }) => ({ + alignItems: 'center', + backgroundColor: theme.palette.background.paper, + borderColor: theme.palette.background.paper, + borderRadius: '8px', + borderStyle: 'solid', + borderWidth: '0.5px', + boxSizing: 'border-box', + color: theme.palette.text.primary, + cursor: 'pointer', + display: 'inline-flex', + fontFamily: 'Inter', + fontWeight: 600, + gap: '10px', + justifyContent: 'center', + minWidth: '160px', + padding: '15px 20px', + textAlign: 'center', + transition: 'all 0.3s', + width: 'fit-content', + '&:hover': { + backgroundColor: theme.palette.background.surface, + 'svg path': { + fill: theme.palette.secondary, + }, + }, +})); + +interface CustomButtonProps { + customBgColor?: string; + customColor?: string; +} + +export const CustomButtonAccept = styled(Box, { + shouldForwardProp: (prop) => + prop !== 'customBgColor' && prop !== 'customColor', +})((props) => { + const { customBgColor, customColor, theme } = props; + return { + alignItems: 'center', + backgroundColor: customBgColor || theme.palette.background.default, + borderColor: theme.palette.background.paper, + borderRadius: 5, + borderStyle: 'solid', + borderWidth: '0.5px', + boxSizing: 'border-box', + color: customColor || theme.palette.background.default, + cursor: 'pointer', + display: 'inline-flex', + filter: 'drop-shadow(1px 4px 10.5px rgba(0,0,0,0.3))', + fontFamily: 'Inter', + fontWeight: 600, + gap: '10px', + justifyContent: 'center', + minWidth: 160, + opacity: 0.7, + padding: '15px 20px', + textAlign: 'center', + transition: 'all 0.2s', + width: 'fit-content', + '&:hover': { + opacity: 1, + backgroundColor: customBgColor || theme.palette.background.default, + color: customColor || '#fff', + svg: { + path: { + fill: customColor || '#fff', + }, + }, + }, + }; +}); + +export const CustomInput = styled(TextField)(({ theme }) => ({ + backgroundColor: theme.palette.background.default, + borderColor: theme.palette.background.paper, + borderRadius: '8px', + color: theme.palette.text.primary, + outline: 'none', + width: '183px', // Adjust the width as needed + input: { + fontSize: '12px', + fontFamily: 'Inter', + fontWeight: 400, + color: theme.palette.text.primary, + '&::placeholder': { + fontSize: 16, + color: theme.palette.text.secondary, + }, + outline: 'none', + padding: '10px', + }, + '& .MuiOutlinedInput-root': { + '& fieldset': { + borderColor: theme.palette.background.paper, + borderRadius: '0.5px', + borderStyle: 'solid', + }, + '&:hover fieldset': { + borderColor: theme.palette.background.paper, + borderRadius: '0.5px', + borderStyle: 'solid', + }, + '&.Mui-focused fieldset': { + borderColor: theme.palette.background.paper, + borderRadius: '0.5px', + borderStyle: 'solid', + }, + }, + '& .MuiInput-underline:before': { + borderBottom: 'none', + }, + '& .MuiInput-underline:hover:not(.Mui-disabled):before': { + borderBottom: 'none', + }, + '& .MuiInput-underline:after': { + borderBottom: 'none', + }, +})); + +export const CustomLabel = styled(InputLabel)(({ theme }) => ({ + backgroundColor: theme.palette.background.default, + color: theme.palette.text.primary, + fontFamily: 'Inter', + fontSize: '15px', + fontWeight: 400, + lineHeight: '24px', +})); diff --git a/src/styles/CoreSyncStatus.css b/src/styles/CoreSyncStatus.css new file mode 100644 index 0000000..97b970b --- /dev/null +++ b/src/styles/CoreSyncStatus.css @@ -0,0 +1,53 @@ +.lineHeight { + line-height: 33%; +} + +.tooltip { + display: inline-block; + position: relative; + text-align: left; +} + +.tooltip .core-panel { + border-radius: 8px; + border: 1px solid var(--black); + box-shadow: 0 1px 8px rgba(0, 0, 0, 0.5); + box-sizing: border-box; + font-size: 13px; + font-weight: normal; + width: max-content; + opacity: 0; + padding: 10px 10px; + position: absolute; + right: 0px; + top: 35px; + transition: opacity 0.2s; + visibility: hidden; + z-index: 99999999; +} + +.tooltip[data-theme='light'] .core-panel { + background-color: #f1f1f1; + color: #000000; +} + +.tooltip[data-theme='dark'] .core-panel { + background-color: var(--bg-2); + color: var(--black); +} + +.tooltip:hover .core-panel { + visibility: visible; + opacity: 1; + z-index: 100; +} + +.tooltip .core-panel i { + bottom: 100%; + height: 12px; + left: 50%; + margin-left: -12px; + overflow: hidden; + position: absolute; + width: 24px; +} diff --git a/src/styles/ReactionPicker.css b/src/styles/ReactionPicker.css new file mode 100644 index 0000000..6d0a354 --- /dev/null +++ b/src/styles/ReactionPicker.css @@ -0,0 +1,26 @@ +.reaction-container { + position: relative; /* Parent must be positioned relatively */ +} + +.emoji-picker { + position: absolute; /* Picker positioned absolutely relative to the parent */ + right: 0; + z-index: 9000000000; /* Ensure picker appears above other content */ +} + +.message-container { + overflow: visible; /* Ensure the message container doesn't cut off the picker */ +} + +.reaction-container { + position: relative; +} + +.emoji-picker { + overflow: hidden; + width: auto; +} + +.EmojiPickerReact.epr-dark-theme { + --epr-emoji-size: 18px; /* Adjust emoji size for dark mode */ +} diff --git a/src/index.css b/src/styles/index.css similarity index 52% rename from src/index.css rename to src/styles/index.css index 867382c..2afd8fb 100644 --- a/src/index.css +++ b/src/styles/index.css @@ -1,49 +1,30 @@ @font-face { font-family: 'Inter'; - src: url('./styles/fonts/Inter-SemiBold.ttf') format('truetype'); + src: url('./fonts/Inter-SemiBold.ttf') format('truetype'); font-weight: 600; } - @font-face { font-family: 'Inter'; - src: url('./styles/fonts/Inter-ExtraBold.ttf') format('truetype'); + src: url('./fonts/Inter-ExtraBold.ttf') format('truetype'); font-weight: 800; } @font-face { font-family: 'Inter'; - src: url('./styles/fonts/Inter-Bold.ttf') format('truetype'); + src: url('./fonts/Inter-Bold.ttf') format('truetype'); font-weight: 700; } @font-face { font-family: 'Inter'; - src: url('./styles/fonts/Inter-Regular.ttf') format('truetype'); + src: url('./fonts/Inter-Regular.ttf') format('truetype'); font-weight: 400; } - -:root { - padding: 0px; - margin: 0px; - box-sizing: border-box !important; - word-break: break-word; - --color-instance : #1E1E20; - --color-instance-popover-bg: #222222; - --Mail-Background: rgba(49, 51, 56, 1); - --new-message-text: black; - - --bg-primary : rgba(31, 32, 35, 1); - --bg-2: #27282c; - --bg-3: rgba(0, 0, 0, 0.1); - --unread: #4297e2; - --danger: #B14646; - --apps-circle: #1F2023; - --green: #5EB049; -} - -body { - margin: 0px; - overflow: hidden; -} +/* * { // TODO restore and check + margin: 0; + padding: 0; + box-sizing: border-box; + font-family: 'Roboto'; +} */ .image-container { position: relative; @@ -68,43 +49,18 @@ body { opacity: 0.6; } -::-webkit-scrollbar-track { - background-color: transparent; -} -::-webkit-scrollbar-track:hover { - background-color: transparent; -} - -::-webkit-scrollbar { - width: 16px; - height: 10px; -} - -::-webkit-scrollbar-thumb { - background-color: #444444; - border-radius: 8px; - background-clip: content-box; - border: 4px solid transparent; - transition: 0.3s background-color; -} -::-webkit-scrollbar-thumb:hover { - background-color: #363636; -} - @property --var1 { - syntax: ""; + syntax: ''; inherits: true; initial-value: transparent; } - .scrollable-container { transition: --var1 0.4s; - } .scrollable-container:hover { - --var1: #444444; + --var1: var(--primary-main); } .scrollable-container::-webkit-scrollbar-thumb { @@ -115,11 +71,6 @@ body { opacity: 0; } - - - - - /* Mobile-specific scrollbar styles */ @media only screen and (max-width: 600px) { ::-webkit-scrollbar { @@ -137,11 +88,7 @@ body { background-color: whitesmoke; } -html, body { - overscroll-behavior:none !important; +html, +body { + overscroll-behavior: none !important; } - -.swiper { - width: 100%; -} - diff --git a/src/styles/theme-common.ts b/src/styles/theme-common.ts new file mode 100644 index 0000000..481f82f --- /dev/null +++ b/src/styles/theme-common.ts @@ -0,0 +1,120 @@ +// Extend the Theme interface +const commonThemeOptions = { + typography: { + fontFamily: ['Inter'].join(','), + h1: { + fontSize: '2rem', + fontWeight: 600, + }, + h2: { + fontSize: '1.75rem', + fontWeight: 500, + }, + h3: { + fontSize: '1.5rem', + fontWeight: 500, + }, + h4: { + fontSize: '1.25rem', + fontWeight: 500, + }, + h5: { + fontSize: '1rem', + fontWeight: 500, + }, + h6: { + fontSize: '0.875rem', + fontWeight: 500, + }, + body: { + margin: '0px', + overflow: 'hidden', + }, + body1: { + fontSize: '16px', + fontWeight: 400, + lineHeight: 1.5, + letterSpacing: 'normal', + }, + body2: { + fontSize: '18px', + fontWeight: 400, + lineHeight: 1.4, + letterSpacing: '0.2px', + }, + }, + spacing: 8, + shape: { + borderRadius: 4, + }, + breakpoints: { + values: { + xs: 0, + sm: 600, + md: 900, + lg: 1200, + xl: 1536, + }, + }, + + components: { + MuiButton: { + styleOverrides: { + root: { + transition: 'filter 0.3s ease-in-out', + '&:hover': { + filter: 'brightness(1.1)', + }, + }, + }, + defaultProps: { + disableElevation: true, + disableRipple: true, + }, + }, + + MuiDialog: { + styleOverrides: { + paper: { + backgroundColor: 'background.paper', + color: 'text.primary', + }, + }, + }, + + MuiDialogTitle: { + styleOverrides: { + root: { + backgroundColor: 'inherit', + color: 'inherit', + }, + }, + }, + + MuiDialogContent: { + styleOverrides: { + root: { + backgroundColor: 'inherit', + }, + }, + }, + + MuiModal: { + styleOverrides: { + root: { + zIndex: 50000, + }, + }, + }, + + MuiPopover: { + styleOverrides: { + paper: { + backgroundImage: 'none', + }, + }, + }, + }, +}; + +export { commonThemeOptions }; diff --git a/src/styles/theme-dark.ts b/src/styles/theme-dark.ts new file mode 100644 index 0000000..d8937a8 --- /dev/null +++ b/src/styles/theme-dark.ts @@ -0,0 +1,130 @@ +import { createTheme, ThemeOptions } from '@mui/material/styles'; +import { commonThemeOptions } from './theme-common'; + +export const darkThemeOptions: ThemeOptions = { + ...commonThemeOptions, + palette: { + mode: 'dark', + primary: { + main: 'rgb(100, 155, 240)', + dark: 'rgb(45, 92, 201)', + light: 'rgb(130, 185, 255)', + }, + secondary: { + main: 'rgb(69, 173, 255)', + }, + background: { + default: 'rgb(49, 51, 56)', + surface: 'rgb(58, 60, 65)', + paper: 'rgb(77, 80, 85)', + }, + text: { + primary: 'rgb(255, 255, 255)', + secondary: 'rgb(179, 179, 179)', + }, + border: { + main: 'rgba(255, 255, 255, 0.12)', + subtle: 'rgba(255, 255, 255, 0.08)', + }, + other: { + positive: 'rgb(94, 176, 73)', + danger: 'rgb(177, 70, 70)', + unread: 'rgb(66, 151, 226)', + }, + }, + + components: { + MuiCard: { + styleOverrides: { + root: { + boxShadow: 'none', + borderRadius: '8px', + transition: 'all 0.3s ease-in-out', + '&:hover': { + cursor: 'pointer', + boxShadow: + ' 0px 3px 4px 0px hsla(0,0%,0%,0.14), 0px 3px 3px -2px hsla(0,0%,0%,0.12), 0px 1px 8px 0px hsla(0,0%,0%,0.2);', + }, + }, + }, + }, + + MuiCssBaseline: { + styleOverrides: (theme) => ({ + ':root': { + '--Mail-Background': 'rgba(6, 10, 30, 1)', + '--bg-primary': 'rgba(6, 10, 30, 1)', + '--bg-2': 'rgb(39, 40, 44)', + '--primary-main': theme.palette.primary.main, + '--text-primary': theme.palette.text.primary, + '--text-secondary': theme.palette.text.secondary, + '--background-default': theme.palette.background.default, + '--background-paper': theme.palette.background.paper, + '--background-surface': theme.palette.background.surface, + '--videoplayer-bg': 'rgba(31, 32, 35, 1)', + }, + + '*, *::before, *::after': { + boxSizing: 'border-box', + }, + + html: { + padding: 0, + margin: 0, + }, + + body: { + padding: 0, + margin: 0, + wordBreak: 'break-word', + }, + '::-webkit-scrollbar-track': { + backgroundColor: 'transparent', + }, + + '::-webkit-scrollbar-track:hover': { + backgroundColor: 'transparent', + }, + + '::-webkit-scrollbar': { + width: '16px', + height: '10px', + }, + + '::-webkit-scrollbar-thumb': { + backgroundColor: theme.palette.primary.main, + borderRadius: '8px', + backgroundClip: 'content-box', + border: '4px solid transparent', + transition: '0.3s background-color', + }, + + '::-webkit-scrollbar-thumb:hover': { + backgroundColor: theme.palette.primary.light, + }, + }), + }, + + MuiIcon: { + defaultProps: { + style: { + color: 'rgb(255, 255, 255)', + opacity: 0.5, + }, + }, + }, + + MuiPaper: { + styleOverrides: { + root: { + backgroundColor: 'rgb(77, 80, 85)', + color: 'rgb(255, 255, 255)', + }, + }, + }, + }, +}; + +const darkTheme = createTheme(darkThemeOptions); + +export { darkTheme }; diff --git a/src/styles/theme-light.ts b/src/styles/theme-light.ts new file mode 100644 index 0000000..314ad7c --- /dev/null +++ b/src/styles/theme-light.ts @@ -0,0 +1,132 @@ +import { createTheme, ThemeOptions } from '@mui/material/styles'; +import { commonThemeOptions } from './theme-common'; + +export const lightThemeOptions: ThemeOptions = { + ...commonThemeOptions, + palette: { + mode: 'light', + primary: { + main: 'rgba(0, 133, 255, 1)', + dark: 'rgb(113, 198, 212)', + light: 'rgb(180, 200, 235)', + }, + secondary: { + main: 'rgb(69, 173, 255)', + }, + background: { + default: 'rgba(250, 250, 250, 1)', + surface: 'rgb(240, 240, 240)', // optional middle gray for replies, side panels + paper: 'rgb(220, 220, 220)', // darker card background + }, + text: { + primary: 'rgba(0, 0, 0, 0.87)', // 87% black (slightly softened) + secondary: 'rgba(0, 0, 0, 0.6)', // 60% black + }, + border: { + main: 'rgba(0, 0, 0, 0.12)', + subtle: 'rgba(0, 0, 0, 0.08)', + }, + other: { + positive: 'rgb(94, 176, 73)', + danger: 'rgb(177, 70, 70)', + unread: 'rgb(66, 151, 226)', + }, + }, + + components: { + MuiCard: { + styleOverrides: { + root: { + boxShadow: + 'rgba(0, 0, 0, 0.1) 0px 1px 3px 0px, rgba(230, 200, 200, 0.06) 0px 1px 2px 0px;', + borderRadius: '8px', + transition: 'all 0.3s ease-in-out', + '&:hover': { + cursor: 'pointer', + boxShadow: + 'rgba(0, 0, 0, 0.1) 0px 4px 6px -1px, rgba(0, 0, 0, 0.06) 0px 2px 4px -1px;', + }, + }, + }, + }, + + MuiCssBaseline: { + styleOverrides: (theme) => ({ + ':root': { + '--Mail-Background': 'rgba(49, 51, 56, 1)', + '--bg-primary': 'rgba(31, 32, 35, 1)', + '--bg-2': 'rgba(39, 40, 44, 1)', + '--primary-main': theme.palette.primary.main, + '--text-primary': theme.palette.text.primary, + '--text-secondary': theme.palette.text.secondary, + '--background-default': theme.palette.background.default, + '--background-paper': theme.palette.background.paper, + '--background-surface': theme.palette.background.surface, + '--videoplayer-bg': 'rgba(31, 32, 35, 1)', + }, + + '*, *::before, *::after': { + boxSizing: 'border-box', + }, + + html: { + padding: 0, + margin: 0, + }, + + body: { + padding: 0, + margin: 0, + wordBreak: 'break-word', + }, + + '::-webkit-scrollbar-track': { + backgroundColor: 'transparent', + }, + + '::-webkit-scrollbar-track:hover': { + backgroundColor: 'transparent', + }, + + '::-webkit-scrollbar': { + width: '16px', + height: '10px', + }, + + '::-webkit-scrollbar-thumb': { + backgroundColor: theme.palette.primary.main, + borderRadius: '8px', + backgroundClip: 'content-box', + border: '4px solid transparent', + transition: '0.3s background-color', + }, + + '::-webkit-scrollbar-thumb:hover': { + backgroundColor: theme.palette.primary.light, + }, + }), + }, + + MuiIcon: { + defaultProps: { + style: { + color: 'rgba(0, 0, 0, 1)', + opacity: 0.5, + }, + }, + }, + + MuiPaper: { + styleOverrides: { + root: { + backgroundColor: 'rgb(220, 220, 220)', + color: 'rgba(0, 0, 0, 0.87)', + }, + }, + }, + }, +}; + +const lightTheme = createTheme(lightThemeOptions); + +export { lightTheme }; diff --git a/src/styles/theme.d.ts b/src/styles/theme.d.ts new file mode 100644 index 0000000..e10c5c1 --- /dev/null +++ b/src/styles/theme.d.ts @@ -0,0 +1,29 @@ +import '@mui/material/styles'; + +declare module '@mui/material/styles' { + interface TypeBackground { + surface: string; + } + interface Palette { + border: { + main: string; + subtle: string; + }; + other: { + positive: string; + danger: string; + unread: string; + }; + } + interface PaletteOptions { + border?: { + main?: string; + subtle?: string; + }; + other?: { + positive?: string; + danger?: string; + unread?: string; + }; + } +} diff --git a/src/styles/theme.ts b/src/styles/theme.ts deleted file mode 100644 index feb0367..0000000 --- a/src/styles/theme.ts +++ /dev/null @@ -1,184 +0,0 @@ -import { createTheme } from '@mui/material/styles' - - -// Extend the Theme interface - -const commonThemeOptions = { - typography: { - fontFamily: [ - 'Roboto' - ].join(','), - h1: { - fontSize: '2rem', - fontWeight: 600 - }, - h2: { - fontSize: '1.75rem', - fontWeight: 500 - }, - h3: { - fontSize: '1.5rem', - fontWeight: 500 - }, - h4: { - fontSize: '1.25rem', - fontWeight: 500 - }, - h5: { - fontSize: '1rem', - fontWeight: 500 - }, - h6: { - fontSize: '0.875rem', - fontWeight: 500 - }, - body1: { - fontSize: '23px', - fontWeight: 400, - lineHeight: 1.5, - letterSpacing: '0.5px' - }, - - body2: { - fontSize: '18px', - fontWeight: 400, - lineHeight: 1.4, - letterSpacing: '0.2px' - } - }, - spacing: 8, - shape: { - borderRadius: 4 - }, - breakpoints: { - values: { - xs: 0, - sm: 600, - md: 900, - lg: 1200, - xl: 1536 - } - }, - components: { - MuiButton: { - styleOverrides: { - root: { - backgroundColor: 'inherit', - transition: 'filter 0.3s ease-in-out', - '&:hover': { - filter: 'brightness(1.1)' - } - } - }, - defaultProps: { - disableElevation: true, - disableRipple: true - } - }, - MuiModal: { - styleOverrides: { - root: { - zIndex: 50000, - }, - } - - } - } -} - -const lightTheme = createTheme({ - ...commonThemeOptions, - palette: { - mode: 'light', - primary: { - main: '#f4f4fb', - dark: '#eaecf4', - light: '#f9f9fd' - }, - secondary: { - main: '#1EAAF1' - }, - background: { - default: '#fafafa', - paper: '#f0f0f0' - }, - text: { - primary: '#000000', - secondary: '#525252' - } - }, - - components: { - MuiCard: { - styleOverrides: { - root: { - boxShadow: - 'rgba(0, 0, 0, 0.1) 0px 1px 3px 0px, rgba(0, 0, 0, 0.06) 0px 1px 2px 0px;', - borderRadius: '8px', - transition: 'all 0.3s ease-in-out', - '&:hover': { - cursor: 'pointer', - boxShadow: - 'rgba(0, 0, 0, 0.1) 0px 4px 6px -1px, rgba(0, 0, 0, 0.06) 0px 2px 4px -1px;' - } - } - } - }, - MuiIcon: { - defaultProps: { - style: { - color: '#000000' - } - } - } - }, -}) - -const darkTheme = createTheme({ - ...commonThemeOptions, - palette: { - mode: 'dark', - primary: { - main: '#2e3d60', - dark: "#1a2744", - light: "#3f4b66", - }, - secondary: { - main: '#45adff' - }, - - background: { - default: '#313338', - paper: "#1e1e20" - }, - text: { - primary: '#ffffff', - secondary: '#b3b3b3' - } - }, - components: { - MuiCard: { - styleOverrides: { - root: { - boxShadow: "none", - borderRadius: '8px', - transition: 'all 0.3s ease-in-out', - '&:hover': { - cursor: 'pointer', - boxShadow: - ' 0px 3px 4px 0px hsla(0,0%,0%,0.14), 0px 3px 3px -2px hsla(0,0%,0%,0.12), 0px 1px 8px 0px hsla(0,0%,0%,0.2);' - } - } - } - }, - MuiIcon: { - defaultProps: { - style: { - color: '#ffffff' - } - } - } - }, -}) - -export { lightTheme, darkTheme } diff --git a/src/styles/themeManager.css b/src/styles/themeManager.css new file mode 100644 index 0000000..85a4538 --- /dev/null +++ b/src/styles/themeManager.css @@ -0,0 +1,39 @@ +[data-color-mode*='dark'] .w-color-sketch { + --sketch-background: #323232 !important; +} + +[data-color-mode*='dark'] .w-color-swatch { + --sketch-swatch-border-top: 1px solid #525252 !important; +} + +[data-color-mode*='dark'] .w-color-block { + --block-background-color: #323232 !important; + --block-box-shadow: rgb(0 0 0 / 10%) 0 1px !important; +} + +[data-color-mode*='dark'] .w-color-editable-input { + --editable-input-label-color: #757575 !important; + --editable-input-box-shadow: #616161 0px 0px 0px 1px inset !important; + --editable-input-color: #bbb !important; +} + +[data-color-mode*='dark'] .w-color-github { + --github-border: 1px solid rgba(0, 0, 0, 0.2) !important; + --github-background-color: #323232 !important; + --github-box-shadow: rgb(0 0 0 / 15%) 0px 3px 12px !important; + --github-arrow-border-color: rgba(0, 0, 0, 0.15) !important; +} + +[data-color-mode*='dark'] .w-color-compact { + --compact-background-color: #323232 !important; +} + +[data-color-mode*='dark'] .w-color-material { + --material-background-color: #323232 !important; + --material-border-bottom-color: #707070 !important; +} + +[data-color-mode*='dark'] .w-color-alpha { + --alpha-pointer-background-color: #6a6a6a !important; + --alpha-pointer-box-shadow: rgb(0 0 0 / 37%) 0px 1px 4px 0px !important; +} diff --git a/src/transactions/AddGroupAdminTransaction.ts b/src/transactions/AddGroupAdminTransaction.ts index f66f730..dd65ec4 100644 --- a/src/transactions/AddGroupAdminTransaction.ts +++ b/src/transactions/AddGroupAdminTransaction.ts @@ -1,37 +1,35 @@ // @ts-nocheck -import { QORT_DECIMALS } from "../constants/constants" -import TransactionBase from "./TransactionBase" - +import { QORT_DECIMALS } from '../constants/constants'; +import TransactionBase from './TransactionBase'; export default class AddGroupAdminTransaction extends TransactionBase { - constructor() { - super() - this.type = 24 - } + constructor() { + super(); + this.type = 24; + } - set rGroupId(rGroupId) { - this._rGroupId = rGroupId - this._rGroupIdBytes = this.constructor.utils.int32ToBytes(this._rGroupId) - } + set rGroupId(rGroupId) { + this._rGroupId = rGroupId; + this._rGroupIdBytes = this.constructor.utils.int32ToBytes(this._rGroupId); + } - set recipient(recipient) { - this._recipient = recipient instanceof Uint8Array ? recipient : this.constructor.Base58.decode(recipient) - this.theRecipient = recipient - } + set recipient(recipient) { + this._recipient = + recipient instanceof Uint8Array + ? recipient + : this.constructor.Base58.decode(recipient); + this.theRecipient = recipient; + } - set fee(fee) { - this._fee = fee * QORT_DECIMALS - this._feeBytes = this.constructor.utils.int64ToBytes(this._fee) - } + set fee(fee) { + this._fee = fee * QORT_DECIMALS; + this._feeBytes = this.constructor.utils.int64ToBytes(this._fee); + } - get params() { - const params = super.params - params.push( - this._rGroupIdBytes, - this._recipient, - this._feeBytes - ) - return params - } + get params() { + const params = super.params; + params.push(this._rGroupIdBytes, this._recipient, this._feeBytes); + return params; + } } diff --git a/src/transactions/BuyNameTransacion.ts b/src/transactions/BuyNameTransacion.ts new file mode 100644 index 0000000..0664b1c --- /dev/null +++ b/src/transactions/BuyNameTransacion.ts @@ -0,0 +1,48 @@ +// @ts-nocheck + +import { QORT_DECIMALS } from '../constants/constants'; +import TransactionBase from './TransactionBase'; +export default class BuyNameTransacion extends TransactionBase { + constructor() { + super(); + this.type = 7; + } + + set fee(fee) { + this._fee = fee * QORT_DECIMALS; + this._feeBytes = this.constructor.utils.int64ToBytes(this._fee); + } + + set name(name) { + this.nameText = name; + this._nameBytes = this.constructor.utils.stringtoUTF8Array(name); + this._nameLength = this.constructor.utils.int32ToBytes( + this._nameBytes.length + ); + } + + set sellPrice(sellPrice) { + this._sellPrice = sellPrice * QORT_DECIMALS; + this._sellPriceBytes = this.constructor.utils.int64ToBytes(this._sellPrice); + } + + set recipient(recipient) { + this._recipient = + recipient instanceof Uint8Array + ? recipient + : this.constructor.Base58.decode(recipient); + this.theRecipient = recipient; + } + + get params() { + const params = super.params; + params.push( + this._nameLength, + this._nameBytes, + this._sellPriceBytes, + this._recipient, + this._feeBytes + ); + return params; + } +} diff --git a/src/transactions/CancelGroupBanTransaction.ts b/src/transactions/CancelGroupBanTransaction.ts index d1bbef7..fc3ca73 100644 --- a/src/transactions/CancelGroupBanTransaction.ts +++ b/src/transactions/CancelGroupBanTransaction.ts @@ -1,37 +1,35 @@ // @ts-nocheck -import { QORT_DECIMALS } from "../constants/constants" -import TransactionBase from "./TransactionBase" - +import { QORT_DECIMALS } from '../constants/constants'; +import TransactionBase from './TransactionBase'; export default class CancelGroupBanTransaction extends TransactionBase { - constructor() { - super() - this.type = 27 - } + constructor() { + super(); + this.type = 27; + } - set rGroupId(rGroupId) { - this._rGroupId = rGroupId - this._rGroupIdBytes = this.constructor.utils.int32ToBytes(this._rGroupId) - } + set rGroupId(rGroupId) { + this._rGroupId = rGroupId; + this._rGroupIdBytes = this.constructor.utils.int32ToBytes(this._rGroupId); + } - set recipient(recipient) { - this._recipient = recipient instanceof Uint8Array ? recipient : this.constructor.Base58.decode(recipient) - this.theRecipient = recipient - } + set recipient(recipient) { + this._recipient = + recipient instanceof Uint8Array + ? recipient + : this.constructor.Base58.decode(recipient); + this.theRecipient = recipient; + } - set fee(fee) { - this._fee = fee * QORT_DECIMALS - this._feeBytes = this.constructor.utils.int64ToBytes(this._fee) - } + set fee(fee) { + this._fee = fee * QORT_DECIMALS; + this._feeBytes = this.constructor.utils.int64ToBytes(this._fee); + } - get params() { - const params = super.params - params.push( - this._rGroupIdBytes, - this._recipient, - this._feeBytes - ) - return params - } + get params() { + const params = super.params; + params.push(this._rGroupIdBytes, this._recipient, this._feeBytes); + return params; + } } diff --git a/src/transactions/CancelGroupInviteTransaction.ts b/src/transactions/CancelGroupInviteTransaction.ts index b575f3e..6ece4fd 100644 --- a/src/transactions/CancelGroupInviteTransaction.ts +++ b/src/transactions/CancelGroupInviteTransaction.ts @@ -1,36 +1,33 @@ // @ts-nocheck -import { QORT_DECIMALS } from "../constants/constants" -import TransactionBase from "./TransactionBase" - - +import { QORT_DECIMALS } from '../constants/constants'; +import TransactionBase from './TransactionBase'; export default class CancelGroupInviteTransaction extends TransactionBase { - constructor() { - super() - this.type = 30 - } + constructor() { + super(); + this.type = 30; + } - set rGroupId(rGroupId) { - this._rGroupId = rGroupId - this._rGroupIdBytes = this.constructor.utils.int32ToBytes(this._rGroupId) - } + set rGroupId(rGroupId) { + this._rGroupId = rGroupId; + this._rGroupIdBytes = this.constructor.utils.int32ToBytes(this._rGroupId); + } - set recipient(recipient) { - this._recipient = recipient instanceof Uint8Array ? recipient : this.constructor.Base58.decode(recipient) - this.theRecipient = recipient - } + set recipient(recipient) { + this._recipient = + recipient instanceof Uint8Array + ? recipient + : this.constructor.Base58.decode(recipient); + this.theRecipient = recipient; + } - set fee(fee) { - this._fee = fee * QORT_DECIMALS - this._feeBytes = this.constructor.utils.int64ToBytes(this._fee) - } + set fee(fee) { + this._fee = fee * QORT_DECIMALS; + this._feeBytes = this.constructor.utils.int64ToBytes(this._fee); + } - get params() { - const params = super.params - params.push( - this._rGroupIdBytes, - this._recipient, - this._feeBytes - ) - return params - } + get params() { + const params = super.params; + params.push(this._rGroupIdBytes, this._recipient, this._feeBytes); + return params; + } } diff --git a/src/transactions/CancelSellNameTransacion.ts b/src/transactions/CancelSellNameTransacion.ts new file mode 100644 index 0000000..28420f7 --- /dev/null +++ b/src/transactions/CancelSellNameTransacion.ts @@ -0,0 +1,29 @@ +// @ts-nocheck + +import { QORT_DECIMALS } from '../constants/constants'; +import TransactionBase from './TransactionBase'; +export default class CancelSellNameTransacion extends TransactionBase { + constructor() { + super(); + this.type = 6; + } + + set fee(fee) { + this._fee = fee * QORT_DECIMALS; + this._feeBytes = this.constructor.utils.int64ToBytes(this._fee); + } + + set name(name) { + this.nameText = name; + this._nameBytes = this.constructor.utils.stringtoUTF8Array(name); + this._nameLength = this.constructor.utils.int32ToBytes( + this._nameBytes.length + ); + } + + get params() { + const params = super.params; + params.push(this._nameLength, this._nameBytes, this._feeBytes); + return params; + } +} diff --git a/src/transactions/ChatBase.ts b/src/transactions/ChatBase.ts index cdfacaf..17cb509 100644 --- a/src/transactions/ChatBase.ts +++ b/src/transactions/ChatBase.ts @@ -1,148 +1,161 @@ // @ts-nocheck -import { QORT_DECIMALS, TX_TYPES } from '../constants/constants' -import nacl from '../deps/nacl-fast' -import Base58 from '../deps/Base58' -import utils from '../utils/utils' - +import { QORT_DECIMALS, TX_TYPES } from '../constants/constants'; +import nacl from '../encryption/nacl-fast'; +import Base58 from '../encryption/Base58'; +import utils from '../utils/utils'; export default class ChatBase { - static get utils() { - return utils - } + static get utils() { + return utils; + } - static get nacl() { - return nacl - } + static get nacl() { + return nacl; + } - static get Base58() { - return Base58 - } + static get Base58() { + return Base58; + } - constructor() { - - this.fee = 0 - this.groupID = 0 - this.tests = [ - () => { - if (!(this._type >= 1 && this._type in TX_TYPES)) { - return 'Invalid type: ' + this.type - } - return true - }, - () => { - if (this._fee < 0) { - return 'Invalid fee: ' + this._fee / QORT_DECIMALS - } - return true - }, - () => { - if (this._groupID < 0 || !Number.isInteger(this._groupID)) { - return 'Invalid groupID: ' + this._groupID - } - return true - }, - () => { - if (!(new Date(this._timestamp)).getTime() > 0) { - return 'Invalid timestamp: ' + this._timestamp - } - return true - }, - () => { - - if (!(this._lastReference instanceof Uint8Array && this._lastReference.byteLength == 64)) { - return 'Invalid last reference: ' + this._lastReference - } - return true - }, - () => { - if (!(this._keyPair)) { - return 'keyPair must be specified' - } - if (!(this._keyPair.publicKey instanceof Uint8Array && this._keyPair.publicKey.byteLength === 32)) { - return 'Invalid publicKey' - } - if (!(this._keyPair.privateKey instanceof Uint8Array && this._keyPair.privateKey.byteLength === 64)) { - return 'Invalid privateKey' - } - return true - } - ] - } + constructor() { + this.fee = 0; + this.groupID = 0; + this.tests = [ + () => { + if (!(this._type >= 1 && this._type in TX_TYPES)) { + return 'Invalid type: ' + this.type; + } + return true; + }, + () => { + if (this._fee < 0) { + return 'Invalid fee: ' + this._fee / QORT_DECIMALS; + } + return true; + }, + () => { + if (this._groupID < 0 || !Number.isInteger(this._groupID)) { + return 'Invalid groupID: ' + this._groupID; + } + return true; + }, + () => { + if (!new Date(this._timestamp).getTime() > 0) { + return 'Invalid timestamp: ' + this._timestamp; + } + return true; + }, + () => { + if ( + !( + this._lastReference instanceof Uint8Array && + this._lastReference.byteLength == 64 + ) + ) { + return 'Invalid last reference: ' + this._lastReference; + } + return true; + }, + () => { + if (!this._keyPair) { + return 'keyPair must be specified'; + } + if ( + !( + this._keyPair.publicKey instanceof Uint8Array && + this._keyPair.publicKey.byteLength === 32 + ) + ) { + return 'Invalid publicKey'; + } + if ( + !( + this._keyPair.privateKey instanceof Uint8Array && + this._keyPair.privateKey.byteLength === 64 + ) + ) { + return 'Invalid privateKey'; + } + return true; + }, + ]; + } - set keyPair(keyPair) { - this._keyPair = keyPair - } + set keyPair(keyPair) { + this._keyPair = keyPair; + } - set type(type) { - this.typeText = TX_TYPES[type] - this._type = type - this._typeBytes = this.constructor.utils.int32ToBytes(this._type) - } + set type(type) { + this.typeText = TX_TYPES[type]; + this._type = type; + this._typeBytes = this.constructor.utils.int32ToBytes(this._type); + } - set groupID(groupID) { - this._groupID = groupID - this._groupIDBytes = this.constructor.utils.int32ToBytes(this._groupID) - } + set groupID(groupID) { + this._groupID = groupID; + this._groupIDBytes = this.constructor.utils.int32ToBytes(this._groupID); + } - set timestamp(timestamp) { - this._timestamp = timestamp - this._timestampBytes = this.constructor.utils.int64ToBytes(this._timestamp) - } + set timestamp(timestamp) { + this._timestamp = timestamp; + this._timestampBytes = this.constructor.utils.int64ToBytes(this._timestamp); + } - set fee(fee) { - this._fee = fee * QORT_DECIMALS - this._feeBytes = this.constructor.utils.int64ToBytes(this._fee) - } + set fee(fee) { + this._fee = fee * QORT_DECIMALS; + this._feeBytes = this.constructor.utils.int64ToBytes(this._fee); + } - set lastReference(lastReference) { + set lastReference(lastReference) { + this._lastReference = + lastReference instanceof Uint8Array + ? lastReference + : this.constructor.Base58.decode(lastReference); + } - this._lastReference = lastReference instanceof Uint8Array ? lastReference : this.constructor.Base58.decode(lastReference) - } + get params() { + return [ + this._typeBytes, + this._timestampBytes, + this._groupIDBytes, + this._lastReference, + this._keyPair.publicKey, + ]; + } - get params() { - return [ - this._typeBytes, - this._timestampBytes, - this._groupIDBytes, - this._lastReference, - this._keyPair.publicKey - ] - } + get chatBytes() { + const isValid = this.validParams(); + if (!isValid.valid) { + throw new Error(isValid.message); + } - get chatBytes() { - const isValid = this.validParams() - if (!isValid.valid) { - throw new Error(isValid.message) - } + let result = new Uint8Array(); - let result = new Uint8Array() + this.params.forEach((item) => { + result = this.constructor.utils.appendBuffer(result, item); + }); - this.params.forEach(item => { - result = this.constructor.utils.appendBuffer(result, item) - }) + this._chatBytes = result; - this._chatBytes = result + return this._chatBytes; + } - return this._chatBytes - } + validParams() { + let finalResult = { + valid: true, + }; - validParams() { - let finalResult = { - valid: true - } - - this.tests.some(test => { - const result = test() - if (result !== true) { - finalResult = { - valid: false, - message: result - } - return true - } - }) - - return finalResult - } + this.tests.some((test) => { + const result = test(); + if (result !== true) { + finalResult = { + valid: false, + message: result, + }; + return true; + } + }); + return finalResult; + } } diff --git a/src/transactions/ChatTransaction.ts b/src/transactions/ChatTransaction.ts index ec30c8c..7abf040 100644 --- a/src/transactions/ChatTransaction.ts +++ b/src/transactions/ChatTransaction.ts @@ -1,92 +1,126 @@ // @ts-nocheck -import ChatBase from './ChatBase' -import nacl from '../deps/nacl-fast' -import ed2curve from '../deps/ed2curve' -import { Sha256 } from 'asmcrypto.js' -import { CHAT_REFERENCE_FEATURE_TRIGGER_TIMESTAMP } from '../constants/constants' - +import ChatBase from './ChatBase'; +import nacl from '../encryption/nacl-fast'; +import ed2curve from '../encryption/ed2curve'; +import { Sha256 } from 'asmcrypto.js'; +import { CHAT_REFERENCE_FEATURE_TRIGGER_TIMESTAMP } from '../constants/constants'; export default class ChatTransaction extends ChatBase { - constructor() { - super() - this.type = 18 - this.fee = 0 - } + constructor() { + super(); + this.type = 18; + this.fee = 0; + } - set recipientPublicKey(recipientPublicKey) { - this._base58RecipientPublicKey = recipientPublicKey instanceof Uint8Array ? this.constructor.Base58.encode(recipientPublicKey) : recipientPublicKey - this._recipientPublicKey = this.constructor.Base58.decode(this._base58RecipientPublicKey) - } + set recipientPublicKey(recipientPublicKey) { + this._base58RecipientPublicKey = + recipientPublicKey instanceof Uint8Array + ? this.constructor.Base58.encode(recipientPublicKey) + : recipientPublicKey; + this._recipientPublicKey = this.constructor.Base58.decode( + this._base58RecipientPublicKey + ); + } - set proofOfWorkNonce(proofOfWorkNonce) { - this._proofOfWorkNonce = this.constructor.utils.int32ToBytes(proofOfWorkNonce) - } + set proofOfWorkNonce(proofOfWorkNonce) { + this._proofOfWorkNonce = + this.constructor.utils.int32ToBytes(proofOfWorkNonce); + } - set recipient(recipient) { - this._recipient = recipient instanceof Uint8Array ? recipient : this.constructor.Base58.decode(recipient) - this._hasReceipient = new Uint8Array(1) - this._hasReceipient[0] = 1 - } + set recipient(recipient) { + this._recipient = + recipient instanceof Uint8Array + ? recipient + : this.constructor.Base58.decode(recipient); + this._hasReceipient = new Uint8Array(1); + this._hasReceipient[0] = 1; + } - set hasChatReference(hasChatReference) { - this._hasChatReference = new Uint8Array(1) - this._hasChatReference[0] = hasChatReference - } + set hasChatReference(hasChatReference) { + this._hasChatReference = new Uint8Array(1); + this._hasChatReference[0] = hasChatReference; + } - set chatReference(chatReference) { - this._chatReference = chatReference instanceof Uint8Array ? chatReference : this.constructor.Base58.decode(chatReference) - } + set chatReference(chatReference) { + this._chatReference = + chatReference instanceof Uint8Array + ? chatReference + : this.constructor.Base58.decode(chatReference); + } - set message(message) { - this.messageText = message; - this._message = this.constructor.utils.stringtoUTF8Array(message) - this._messageLength = this.constructor.utils.int32ToBytes(this._message.length) - } + set message(message) { + this.messageText = message; + this._message = this.constructor.utils.stringtoUTF8Array(message); + this._messageLength = this.constructor.utils.int32ToBytes( + this._message.length + ); + } - set isEncrypted(isEncrypted) { - this._isEncrypted = new Uint8Array(1) - this._isEncrypted[0] = isEncrypted + set isEncrypted(isEncrypted) { + this._isEncrypted = new Uint8Array(1); + this._isEncrypted[0] = isEncrypted; - if (isEncrypted === 1) { - const convertedPrivateKey = ed2curve.convertSecretKey(this._keyPair.privateKey) - const convertedPublicKey = ed2curve.convertPublicKey(this._recipientPublicKey) - const sharedSecret = new Uint8Array(32) - nacl.lowlevel.crypto_scalarmult(sharedSecret, convertedPrivateKey, convertedPublicKey) + if (isEncrypted === 1) { + const convertedPrivateKey = ed2curve.convertSecretKey( + this._keyPair.privateKey + ); + const convertedPublicKey = ed2curve.convertPublicKey( + this._recipientPublicKey + ); + const sharedSecret = new Uint8Array(32); + nacl.lowlevel.crypto_scalarmult( + sharedSecret, + convertedPrivateKey, + convertedPublicKey + ); - this._chatEncryptionSeed = new Sha256().process(sharedSecret).finish().result - this._encryptedMessage = nacl.secretbox(this._message, this._lastReference.slice(0, 24), this._chatEncryptionSeed) - } + this._chatEncryptionSeed = new Sha256() + .process(sharedSecret) + .finish().result; + this._encryptedMessage = nacl.secretbox( + this._message, + this._lastReference.slice(0, 24), + this._chatEncryptionSeed + ); + } - this._myMessage = isEncrypted === 1 ? this._encryptedMessage : this._message - this._myMessageLenth = isEncrypted === 1 ? this.constructor.utils.int32ToBytes(this._myMessage.length) : this._messageLength - } + this._myMessage = + isEncrypted === 1 ? this._encryptedMessage : this._message; + this._myMessageLenth = + isEncrypted === 1 + ? this.constructor.utils.int32ToBytes(this._myMessage.length) + : this._messageLength; + } - set isText(isText) { - this._isText = new Uint8Array(1) - this._isText[0] = isText - } + set isText(isText) { + this._isText = new Uint8Array(1); + this._isText[0] = isText; + } - get params() { - const params = super.params - params.push( - this._proofOfWorkNonce, - this._hasReceipient, - this._recipient, - this._myMessageLenth, - this._myMessage, - this._isEncrypted, - this._isText, - this._feeBytes - ) + get params() { + const params = super.params; + params.push( + this._proofOfWorkNonce, + this._hasReceipient, + this._recipient, + this._myMessageLenth, + this._myMessage, + this._isEncrypted, + this._isText, + this._feeBytes + ); - // After the feature trigger timestamp we need to include chat reference - if (new Date(this._timestamp).getTime() >= CHAT_REFERENCE_FEATURE_TRIGGER_TIMESTAMP) { - params.push(this._hasChatReference) + // After the feature trigger timestamp we need to include chat reference + if ( + new Date(this._timestamp).getTime() >= + CHAT_REFERENCE_FEATURE_TRIGGER_TIMESTAMP + ) { + params.push(this._hasChatReference); - if (this._hasChatReference[0] == 1) { - params.push(this._chatReference) - } - } - return params - } + if (this._hasChatReference[0] == 1) { + params.push(this._chatReference); + } + } + return params; + } } diff --git a/src/transactions/CreateGroupTransaction.ts b/src/transactions/CreateGroupTransaction.ts index a2eb7ea..24aff1e 100644 --- a/src/transactions/CreateGroupTransaction.ts +++ b/src/transactions/CreateGroupTransaction.ts @@ -1,64 +1,73 @@ // @ts-nocheck -import { QORT_DECIMALS } from "../constants/constants" -import TransactionBase from "./TransactionBase" - - +import { QORT_DECIMALS } from '../constants/constants'; +import TransactionBase from './TransactionBase'; export default class CreateGroupTransaction extends TransactionBase { - constructor() { - super() - this.type = 22 - } + constructor() { + super(); + this.type = 22; + } + set fee(fee) { + this._fee = fee * QORT_DECIMALS; + this._feeBytes = this.constructor.utils.int64ToBytes(this._fee); + } - set fee(fee) { - this._fee = fee * QORT_DECIMALS - this._feeBytes = this.constructor.utils.int64ToBytes(this._fee) - } + set rGroupName(rGroupName) { + this._rGroupName = rGroupName; + this._rGroupNameBytes = this.constructor.utils.stringtoUTF8Array( + this._rGroupName + ); + this._rGroupNameLength = this.constructor.utils.int32ToBytes( + this._rGroupNameBytes.length + ); + } - set rGroupName(rGroupName) { - this._rGroupName = rGroupName - this._rGroupNameBytes = this.constructor.utils.stringtoUTF8Array(this._rGroupName) - this._rGroupNameLength = this.constructor.utils.int32ToBytes(this._rGroupNameBytes.length) - } + set rGroupDesc(rGroupDesc) { + this._rGroupDesc = rGroupDesc; + this._rGroupDescBytes = this.constructor.utils.stringtoUTF8Array( + this._rGroupDesc + ); + this._rGroupDescLength = this.constructor.utils.int32ToBytes( + this._rGroupDescBytes.length + ); + } - set rGroupDesc(rGroupDesc) { - this._rGroupDesc = rGroupDesc - this._rGroupDescBytes = this.constructor.utils.stringtoUTF8Array(this._rGroupDesc) - this._rGroupDescLength = this.constructor.utils.int32ToBytes(this._rGroupDescBytes.length) - } + set rGroupType(rGroupType) { + this._rGroupType = new Uint8Array(1); + this._rGroupType[0] = rGroupType; + } - set rGroupType(rGroupType) { - this._rGroupType = new Uint8Array(1) - this._rGroupType[0] = rGroupType - } + set rGroupApprovalThreshold(rGroupApprovalThreshold) { + this._rGroupApprovalThreshold = new Uint8Array(1); + this._rGroupApprovalThreshold[0] = rGroupApprovalThreshold; + } - set rGroupApprovalThreshold(rGroupApprovalThreshold) { - this._rGroupApprovalThreshold = new Uint8Array(1) - this._rGroupApprovalThreshold[0] = rGroupApprovalThreshold - } + set rGroupMinimumBlockDelay(rGroupMinimumBlockDelay) { + this._rGroupMinimumBlockDelayBytes = this.constructor.utils.int32ToBytes( + rGroupMinimumBlockDelay + ); + } - set rGroupMinimumBlockDelay(rGroupMinimumBlockDelay) { - this._rGroupMinimumBlockDelayBytes = this.constructor.utils.int32ToBytes(rGroupMinimumBlockDelay) - } + set rGroupMaximumBlockDelay(rGroupMaximumBlockDelay) { + this._rGroupMaximumBlockDelayBytes = this.constructor.utils.int32ToBytes( + rGroupMaximumBlockDelay + ); + } - set rGroupMaximumBlockDelay(rGroupMaximumBlockDelay) { - this._rGroupMaximumBlockDelayBytes = this.constructor.utils.int32ToBytes(rGroupMaximumBlockDelay) - } - - get params() { - const params = super.params - params.push( - this._rGroupNameLength, - this._rGroupNameBytes, - this._rGroupDescLength, - this._rGroupDescBytes, - this._rGroupType, - this._rGroupApprovalThreshold, - this._rGroupMinimumBlockDelayBytes, - this._rGroupMaximumBlockDelayBytes, - this._feeBytes - ) - return params - } + get params() { + const params = super.params; + params.push( + this._rGroupNameLength, + this._rGroupNameBytes, + this._rGroupDescLength, + this._rGroupDescBytes, + this._rGroupType, + this._rGroupApprovalThreshold, + this._rGroupMinimumBlockDelayBytes, + this._rGroupMaximumBlockDelayBytes, + this._feeBytes + ); + return params; + } } diff --git a/src/transactions/CreatePollTransaction.ts b/src/transactions/CreatePollTransaction.ts index a2a9cc0..3717ba9 100644 --- a/src/transactions/CreatePollTransaction.ts +++ b/src/transactions/CreatePollTransaction.ts @@ -1,73 +1,84 @@ // @ts-nocheck -import { QORT_DECIMALS } from '../constants/constants' -import TransactionBase from './TransactionBase' - +import { QORT_DECIMALS } from '../constants/constants'; +import TransactionBase from './TransactionBase'; export default class CreatePollTransaction extends TransactionBase { - constructor() { - super() - this.type = 8 - this._options = [] - } + constructor() { + super(); + this.type = 8; + this._options = []; + } - addOption(option) { - const optionBytes = this.constructor.utils.stringtoUTF8Array(option) - const optionLength = this.constructor.utils.int32ToBytes(optionBytes.length) - this._options.push({ length: optionLength, bytes: optionBytes }) - } + addOption(option) { + const optionBytes = this.constructor.utils.stringtoUTF8Array(option); + const optionLength = this.constructor.utils.int32ToBytes( + optionBytes.length + ); + this._options.push({ length: optionLength, bytes: optionBytes }); + } + set fee(fee) { + this._fee = fee * QORT_DECIMALS; + this._feeBytes = this.constructor.utils.int64ToBytes(this._fee); + } - set fee(fee) { - this._fee = fee * QORT_DECIMALS - this._feeBytes = this.constructor.utils.int64ToBytes(this._fee) - } + set ownerAddress(ownerAddress) { + this._ownerAddress = + ownerAddress instanceof Uint8Array + ? ownerAddress + : this.constructor.Base58.decode(ownerAddress); + } - set ownerAddress(ownerAddress) { - this._ownerAddress = ownerAddress instanceof Uint8Array ? ownerAddress : this.constructor.Base58.decode(ownerAddress) - } + set rPollName(rPollName) { + this._rPollName = rPollName; + this._rPollNameBytes = this.constructor.utils.stringtoUTF8Array( + this._rPollName + ); + this._rPollNameLength = this.constructor.utils.int32ToBytes( + this._rPollNameBytes.length + ); + } - set rPollName(rPollName) { - this._rPollName = rPollName - this._rPollNameBytes = this.constructor.utils.stringtoUTF8Array(this._rPollName) - this._rPollNameLength = this.constructor.utils.int32ToBytes(this._rPollNameBytes.length) + set rPollDesc(rPollDesc) { + this._rPollDesc = rPollDesc; + this._rPollDescBytes = this.constructor.utils.stringtoUTF8Array( + this._rPollDesc + ); + this._rPollDescLength = this.constructor.utils.int32ToBytes( + this._rPollDescBytes.length + ); + } - } + set rOptions(rOptions) { + const optionsArray = rOptions[0].split(', ').map((opt) => opt.trim()); + this._pollOptions = optionsArray; - set rPollDesc(rPollDesc) { - this._rPollDesc = rPollDesc - this._rPollDescBytes = this.constructor.utils.stringtoUTF8Array(this._rPollDesc) - this._rPollDescLength = this.constructor.utils.int32ToBytes(this._rPollDescBytes.length) - } + for (let i = 0; i < optionsArray.length; i++) { + this.addOption(optionsArray[i]); + } - set rOptions(rOptions) { - const optionsArray = rOptions[0].split(', ').map(opt => opt.trim()) - this._pollOptions = optionsArray + this._rNumberOfOptionsBytes = this.constructor.utils.int32ToBytes( + optionsArray.length + ); + } - for (let i = 0; i < optionsArray.length; i++) { - this.addOption(optionsArray[i]) - } + get params() { + const params = super.params; + params.push( + this._ownerAddress, + this._rPollNameLength, + this._rPollNameBytes, + this._rPollDescLength, + this._rPollDescBytes, + this._rNumberOfOptionsBytes + ); - this._rNumberOfOptionsBytes = this.constructor.utils.int32ToBytes(optionsArray.length) - } + // Push the dynamic options + for (let i = 0; i < this._options.length; i++) { + params.push(this._options[i].length, this._options[i].bytes); + } + params.push(this._feeBytes); - get params() { - const params = super.params - params.push( - this._ownerAddress, - this._rPollNameLength, - this._rPollNameBytes, - this._rPollDescLength, - this._rPollDescBytes, - this._rNumberOfOptionsBytes - ) - - // Push the dynamic options - for (let i = 0; i < this._options.length; i++) { - params.push(this._options[i].length, this._options[i].bytes) - } - - params.push(this._feeBytes) - - return params - } + return params; + } } diff --git a/src/transactions/DeployAtTransaction.ts b/src/transactions/DeployAtTransaction.ts index 8a20553..698ef5a 100644 --- a/src/transactions/DeployAtTransaction.ts +++ b/src/transactions/DeployAtTransaction.ts @@ -1,78 +1,90 @@ // @ts-nocheck - -import TransactionBase from './TransactionBase' -import { QORT_DECIMALS } from '../constants/constants' - +import TransactionBase from './TransactionBase'; +import { QORT_DECIMALS } from '../constants/constants'; export default class DeployAtTransaction extends TransactionBase { - constructor() { - super() - this.type = 16 - } + constructor() { + super(); + this.type = 16; + } + set fee(fee) { + this._fee = fee * QORT_DECIMALS; + this._feeBytes = this.constructor.utils.int64ToBytes(this._fee); + } + set rAmount(rAmount) { + this._rAmount = Math.round(rAmount * QORT_DECIMALS); + this._rAmountBytes = this.constructor.utils.int64ToBytes(this._rAmount); + } - set fee(fee) { - this._fee = fee * QORT_DECIMALS - this._feeBytes = this.constructor.utils.int64ToBytes(this._fee) - } + set rName(rName) { + this._rName = rName; + this._rNameBytes = this.constructor.utils.stringtoUTF8Array( + this._rName.toLocaleLowerCase() + ); + this._rNameLength = this.constructor.utils.int32ToBytes( + this._rNameBytes.length + ); + } - set rAmount(rAmount) { - this._rAmount = Math.round(rAmount * QORT_DECIMALS) - this._rAmountBytes = this.constructor.utils.int64ToBytes(this._rAmount) - } + set rDescription(rDescription) { + this._rDescription = rDescription; + this._rDescriptionBytes = this.constructor.utils.stringtoUTF8Array( + this._rDescription.toLocaleLowerCase() + ); + this._rDescriptionLength = this.constructor.utils.int32ToBytes( + this._rDescriptionBytes.length + ); + } - set rName(rName) { - this._rName = rName - this._rNameBytes = this.constructor.utils.stringtoUTF8Array(this._rName.toLocaleLowerCase()) - this._rNameLength = this.constructor.utils.int32ToBytes(this._rNameBytes.length) - } + set atType(atType) { + this._atType = atType; + this._atTypeBytes = this.constructor.utils.stringtoUTF8Array(this._atType); + this._atTypeLength = this.constructor.utils.int32ToBytes( + this._atTypeBytes.length + ); + } - set rDescription(rDescription) { - this._rDescription = rDescription - this._rDescriptionBytes = this.constructor.utils.stringtoUTF8Array(this._rDescription.toLocaleLowerCase()) - this._rDescriptionLength = this.constructor.utils.int32ToBytes(this._rDescriptionBytes.length) - } + set rTags(rTags) { + this._rTags = rTags; + this._rTagsBytes = this.constructor.utils.stringtoUTF8Array( + this._rTags.toLocaleLowerCase() + ); + this._rTagsLength = this.constructor.utils.int32ToBytes( + this._rTagsBytes.length + ); + } - set atType(atType) { - this._atType = atType - this._atTypeBytes = this.constructor.utils.stringtoUTF8Array(this._atType) - this._atTypeLength = this.constructor.utils.int32ToBytes(this._atTypeBytes.length) - } + set rCreationBytes(rCreationBytes) { + const decode = this.constructor.Base58.decode(rCreationBytes); + this._rCreationBytes = this.constructor.utils.stringtoUTF8Array(decode); + this._rCreationBytesLength = this.constructor.utils.int32ToBytes( + this._rCreationBytes.length + ); + } - set rTags(rTags) { - this._rTags = rTags - this._rTagsBytes = this.constructor.utils.stringtoUTF8Array(this._rTags.toLocaleLowerCase()) - this._rTagsLength = this.constructor.utils.int32ToBytes(this._rTagsBytes.length) - } + set rAssetId(rAssetId) { + this._rAssetId = this.constructor.utils.int64ToBytes(rAssetId); + } - set rCreationBytes(rCreationBytes) { - const decode = this.constructor.Base58.decode(rCreationBytes) - this._rCreationBytes = this.constructor.utils.stringtoUTF8Array(decode) - this._rCreationBytesLength = this.constructor.utils.int32ToBytes(this._rCreationBytes.length) - } - - set rAssetId(rAssetId) { - this._rAssetId = this.constructor.utils.int64ToBytes(rAssetId) - } - - get params() { - const params = super.params - params.push( - this._rNameLength, - this._rNameBytes, - this._rDescriptionLength, - this._rDescriptionBytes, - this._atTypeLength, - this._atTypeBytes, - this._rTagsLength, - this._rTagsBytes, - this._rCreationBytesLength, - this._rCreationBytes, - this._rAmountBytes, - this._rAssetId, - this._feeBytes - ) - return params - } + get params() { + const params = super.params; + params.push( + this._rNameLength, + this._rNameBytes, + this._rDescriptionLength, + this._rDescriptionBytes, + this._atTypeLength, + this._atTypeBytes, + this._rTagsLength, + this._rTagsBytes, + this._rCreationBytesLength, + this._rCreationBytes, + this._rAmountBytes, + this._rAssetId, + this._feeBytes + ); + return params; + } } diff --git a/src/transactions/GroupBanTransaction.ts b/src/transactions/GroupBanTransaction.ts index 3eb3210..de59e74 100644 --- a/src/transactions/GroupBanTransaction.ts +++ b/src/transactions/GroupBanTransaction.ts @@ -1,50 +1,56 @@ // @ts-nocheck -import { QORT_DECIMALS } from "../constants/constants" -import TransactionBase from "./TransactionBase" - +import { QORT_DECIMALS } from '../constants/constants'; +import TransactionBase from './TransactionBase'; export default class GroupBanTransaction extends TransactionBase { - constructor() { - super() - this.type = 26 - } + constructor() { + super(); + this.type = 26; + } - set rGroupId(rGroupId) { - this._rGroupId = rGroupId - this._rGroupIdBytes = this.constructor.utils.int32ToBytes(this._rGroupId) - } + set rGroupId(rGroupId) { + this._rGroupId = rGroupId; + this._rGroupIdBytes = this.constructor.utils.int32ToBytes(this._rGroupId); + } - set rBanReason(rBanReason) { - this._rBanReason = rBanReason - this._rBanReasonBytes = this.constructor.utils.stringtoUTF8Array(this._rBanReason) - this._rBanReasonLength = this.constructor.utils.int32ToBytes(this._rBanReasonBytes.length) - } + set rBanReason(rBanReason) { + this._rBanReason = rBanReason; + this._rBanReasonBytes = this.constructor.utils.stringtoUTF8Array( + this._rBanReason + ); + this._rBanReasonLength = this.constructor.utils.int32ToBytes( + this._rBanReasonBytes.length + ); + } - set rBanTime(rBanTime) { - this._rBanTime = rBanTime - this._rBanTimeBytes = this.constructor.utils.int32ToBytes(this._rBanTime) - } + set rBanTime(rBanTime) { + this._rBanTime = rBanTime; + this._rBanTimeBytes = this.constructor.utils.int32ToBytes(this._rBanTime); + } - set recipient(recipient) { - this._recipient = recipient instanceof Uint8Array ? recipient : this.constructor.Base58.decode(recipient) - this.theRecipient = recipient - } + set recipient(recipient) { + this._recipient = + recipient instanceof Uint8Array + ? recipient + : this.constructor.Base58.decode(recipient); + this.theRecipient = recipient; + } - set fee(fee) { - this._fee = fee * QORT_DECIMALS - this._feeBytes = this.constructor.utils.int64ToBytes(this._fee) - } + set fee(fee) { + this._fee = fee * QORT_DECIMALS; + this._feeBytes = this.constructor.utils.int64ToBytes(this._fee); + } - get params() { - const params = super.params - params.push( - this._rGroupIdBytes, - this._recipient, - this._rBanReasonLength, - this._rBanReasonBytes, - this._rBanTimeBytes, - this._feeBytes - ) - return params - } + get params() { + const params = super.params; + params.push( + this._rGroupIdBytes, + this._recipient, + this._rBanReasonLength, + this._rBanReasonBytes, + this._rBanTimeBytes, + this._feeBytes + ); + return params; + } } diff --git a/src/transactions/GroupChatTransaction.ts b/src/transactions/GroupChatTransaction.ts index 1cd9d9b..1df7a4f 100644 --- a/src/transactions/GroupChatTransaction.ts +++ b/src/transactions/GroupChatTransaction.ts @@ -1,72 +1,79 @@ // @ts-nocheck - -import ChatBase from './ChatBase' -import { CHAT_REFERENCE_FEATURE_TRIGGER_TIMESTAMP } from '../constants/constants' - +import ChatBase from './ChatBase'; +import { CHAT_REFERENCE_FEATURE_TRIGGER_TIMESTAMP } from '../constants/constants'; export default class GroupChatTransaction extends ChatBase { - constructor() { - super(); - this.type = 18 - this.fee = 0 - } + constructor() { + super(); + this.type = 18; + this.fee = 0; + } - set proofOfWorkNonce(proofOfWorkNonce) { - this._proofOfWorkNonce = this.constructor.utils.int32ToBytes(proofOfWorkNonce) - } + set proofOfWorkNonce(proofOfWorkNonce) { + this._proofOfWorkNonce = + this.constructor.utils.int32ToBytes(proofOfWorkNonce); + } - set hasReceipient(hasReceipient) { - this._hasReceipient = new Uint8Array(1) - this._hasReceipient[0] = hasReceipient - } + set hasReceipient(hasReceipient) { + this._hasReceipient = new Uint8Array(1); + this._hasReceipient[0] = hasReceipient; + } - set message(message) { - this.messageText = message - - this._message = this.constructor.utils.stringtoUTF8Array(message) - this._messageLength = this.constructor.utils.int32ToBytes(this._message.length) - } + set message(message) { + this.messageText = message; - set hasChatReference(hasChatReference) { - this._hasChatReference = new Uint8Array(1) - this._hasChatReference[0] = hasChatReference - } + this._message = this.constructor.utils.stringtoUTF8Array(message); + this._messageLength = this.constructor.utils.int32ToBytes( + this._message.length + ); + } - set chatReference(chatReference) { - this._chatReference = chatReference instanceof Uint8Array ? chatReference : this.constructor.Base58.decode(chatReference) - } + set hasChatReference(hasChatReference) { + this._hasChatReference = new Uint8Array(1); + this._hasChatReference[0] = hasChatReference; + } - set isEncrypted(isEncrypted) { - this._isEncrypted = new Uint8Array(1) - this._isEncrypted[0] = isEncrypted - } + set chatReference(chatReference) { + this._chatReference = + chatReference instanceof Uint8Array + ? chatReference + : this.constructor.Base58.decode(chatReference); + } - set isText(isText) { - this._isText = new Uint8Array(1) - this._isText[0] = isText - } + set isEncrypted(isEncrypted) { + this._isEncrypted = new Uint8Array(1); + this._isEncrypted[0] = isEncrypted; + } - get params() { - const params = super.params - params.push( - this._proofOfWorkNonce, - this._hasReceipient, - this._messageLength, - this._message, - this._isEncrypted, - this._isText, - this._feeBytes - ) + set isText(isText) { + this._isText = new Uint8Array(1); + this._isText[0] = isText; + } - // After the feature trigger timestamp we need to include chat reference - if (new Date(this._timestamp).getTime() >= CHAT_REFERENCE_FEATURE_TRIGGER_TIMESTAMP) { - params.push(this._hasChatReference) + get params() { + const params = super.params; + params.push( + this._proofOfWorkNonce, + this._hasReceipient, + this._messageLength, + this._message, + this._isEncrypted, + this._isText, + this._feeBytes + ); - if (this._hasChatReference[0] == 1) { - params.push(this._chatReference) - } - } + // After the feature trigger timestamp we need to include chat reference + if ( + new Date(this._timestamp).getTime() >= + CHAT_REFERENCE_FEATURE_TRIGGER_TIMESTAMP + ) { + params.push(this._hasChatReference); - return params - } + if (this._hasChatReference[0] == 1) { + params.push(this._chatReference); + } + } + + return params; + } } diff --git a/src/transactions/GroupInviteTransaction.ts b/src/transactions/GroupInviteTransaction.ts index 3cbf978..448534b 100644 --- a/src/transactions/GroupInviteTransaction.ts +++ b/src/transactions/GroupInviteTransaction.ts @@ -1,42 +1,46 @@ // @ts-nocheck -import { QORT_DECIMALS } from "../constants/constants" -import TransactionBase from "./TransactionBase" - +import { QORT_DECIMALS } from '../constants/constants'; +import TransactionBase from './TransactionBase'; export default class GroupInviteTransaction extends TransactionBase { - constructor() { - super() - this.type = 29 - } + constructor() { + super(); + this.type = 29; + } - set rGroupId(rGroupId) { - this._rGroupId = rGroupId - this._rGroupIdBytes = this.constructor.utils.int32ToBytes(this._rGroupId) - } + set rGroupId(rGroupId) { + this._rGroupId = rGroupId; + this._rGroupIdBytes = this.constructor.utils.int32ToBytes(this._rGroupId); + } - set rInviteTime(rInviteTime) { - this._rInviteTime = rInviteTime - this._rInviteTimeBytes = this.constructor.utils.int32ToBytes(this._rInviteTime) - } + set rInviteTime(rInviteTime) { + this._rInviteTime = rInviteTime; + this._rInviteTimeBytes = this.constructor.utils.int32ToBytes( + this._rInviteTime + ); + } - set recipient(recipient) { - this._recipient = recipient instanceof Uint8Array ? recipient : this.constructor.Base58.decode(recipient) - this.theRecipient = recipient - } + set recipient(recipient) { + this._recipient = + recipient instanceof Uint8Array + ? recipient + : this.constructor.Base58.decode(recipient); + this.theRecipient = recipient; + } - set fee(fee) { - this._fee = fee * QORT_DECIMALS - this._feeBytes = this.constructor.utils.int64ToBytes(this._fee) - } + set fee(fee) { + this._fee = fee * QORT_DECIMALS; + this._feeBytes = this.constructor.utils.int64ToBytes(this._fee); + } - get params() { - const params = super.params - params.push( - this._rGroupIdBytes, - this._recipient, - this._rInviteTimeBytes, - this._feeBytes - ) - return params - } + get params() { + const params = super.params; + params.push( + this._rGroupIdBytes, + this._recipient, + this._rInviteTimeBytes, + this._feeBytes + ); + return params; + } } diff --git a/src/transactions/GroupKickTransaction.ts b/src/transactions/GroupKickTransaction.ts index 969380f..298ebc9 100644 --- a/src/transactions/GroupKickTransaction.ts +++ b/src/transactions/GroupKickTransaction.ts @@ -1,46 +1,50 @@ // @ts-nocheck - -import { QORT_DECIMALS } from "../constants/constants" -import TransactionBase from "./TransactionBase" - - +import { QORT_DECIMALS } from '../constants/constants'; +import TransactionBase from './TransactionBase'; export default class GroupKickTransaction extends TransactionBase { - constructor() { - super() - this.type = 28 - } + constructor() { + super(); + this.type = 28; + } - set rGroupId(rGroupId) { - this._rGroupId = rGroupId - this._rGroupIdBytes = this.constructor.utils.int32ToBytes(this._rGroupId) - } + set rGroupId(rGroupId) { + this._rGroupId = rGroupId; + this._rGroupIdBytes = this.constructor.utils.int32ToBytes(this._rGroupId); + } - set rBanReason(rBanReason) { - this._rBanReason = rBanReason - this._rBanReasonBytes = this.constructor.utils.stringtoUTF8Array(this._rBanReason) - this._rBanReasonLength = this.constructor.utils.int32ToBytes(this._rBanReasonBytes.length) - } + set rBanReason(rBanReason) { + this._rBanReason = rBanReason; + this._rBanReasonBytes = this.constructor.utils.stringtoUTF8Array( + this._rBanReason + ); + this._rBanReasonLength = this.constructor.utils.int32ToBytes( + this._rBanReasonBytes.length + ); + } - set recipient(recipient) { - this._recipient = recipient instanceof Uint8Array ? recipient : this.constructor.Base58.decode(recipient) - this.theRecipient = recipient - } + set recipient(recipient) { + this._recipient = + recipient instanceof Uint8Array + ? recipient + : this.constructor.Base58.decode(recipient); + this.theRecipient = recipient; + } - set fee(fee) { - this._fee = fee * QORT_DECIMALS - this._feeBytes = this.constructor.utils.int64ToBytes(this._fee) - } + set fee(fee) { + this._fee = fee * QORT_DECIMALS; + this._feeBytes = this.constructor.utils.int64ToBytes(this._fee); + } - get params() { - const params = super.params - params.push( - this._rGroupIdBytes, - this._recipient, - this._rBanReasonLength, - this._rBanReasonBytes, - this._feeBytes - ) - return params - } + get params() { + const params = super.params; + params.push( + this._rGroupIdBytes, + this._recipient, + this._rBanReasonLength, + this._rBanReasonBytes, + this._feeBytes + ); + return params; + } } diff --git a/src/transactions/JoinGroupTransaction.ts b/src/transactions/JoinGroupTransaction.ts index 0aae8f7..dc51048 100644 --- a/src/transactions/JoinGroupTransaction.ts +++ b/src/transactions/JoinGroupTransaction.ts @@ -1,38 +1,33 @@ // @ts-nocheck -import { QORT_DECIMALS } from "../constants/constants" -import TransactionBase from "./TransactionBase" - - +import { QORT_DECIMALS } from '../constants/constants'; +import TransactionBase from './TransactionBase'; export default class JoinGroupTransaction extends TransactionBase { - constructor() { - super() - this.type = 31 - } + constructor() { + super(); + this.type = 31; + } + set fee(fee) { + this._fee = fee * QORT_DECIMALS; + this._feeBytes = this.constructor.utils.int64ToBytes(this._fee); + } + set registrantAddress(registrantAddress) { + this._registrantAddress = + registrantAddress instanceof Uint8Array + ? registrantAddress + : this.constructor.Base58.decode(registrantAddress); + } - set fee(fee) { - this._fee = fee * QORT_DECIMALS - this._feeBytes = this.constructor.utils.int64ToBytes(this._fee) - } + set rGroupId(rGroupId) { + this._rGroupId = rGroupId; + this._rGroupIdBytes = this.constructor.utils.int32ToBytes(this._rGroupId); + } - set registrantAddress(registrantAddress) { - this._registrantAddress = registrantAddress instanceof Uint8Array ? registrantAddress : this.constructor.Base58.decode(registrantAddress) - } - - set rGroupId(rGroupId) { - this._rGroupId = rGroupId - this._rGroupIdBytes = this.constructor.utils.int32ToBytes(this._rGroupId) - } - - - get params() { - const params = super.params - params.push( - this._rGroupIdBytes, - this._feeBytes - ) - return params - } + get params() { + const params = super.params; + params.push(this._rGroupIdBytes, this._feeBytes); + return params; + } } diff --git a/src/transactions/LeaveGroupTransaction.ts b/src/transactions/LeaveGroupTransaction.ts index 222f250..85eeeec 100644 --- a/src/transactions/LeaveGroupTransaction.ts +++ b/src/transactions/LeaveGroupTransaction.ts @@ -1,35 +1,34 @@ // @ts-nocheck -import { QORT_DECIMALS } from "../constants/constants" -import TransactionBase from "./TransactionBase" - +import { QORT_DECIMALS } from '../constants/constants'; +import TransactionBase from './TransactionBase'; export default class LeaveGroupTransaction extends TransactionBase { - constructor() { - super() - this.type = 32 - } - - set fee(fee) { - this._fee = fee * QORT_DECIMALS - this._feeBytes = this.constructor.utils.int64ToBytes(this._fee) - } + constructor() { + super(); + this.type = 32; + } - set registrantAddress(registrantAddress) { - this._registrantAddress = registrantAddress instanceof Uint8Array ? registrantAddress : this.constructor.Base58.decode(registrantAddress) - } + set fee(fee) { + this._fee = fee * QORT_DECIMALS; + this._feeBytes = this.constructor.utils.int64ToBytes(this._fee); + } - set rGroupId(rGroupId) { - this._rGroupId = rGroupId - this._rGroupIdBytes = this.constructor.utils.int32ToBytes(this._rGroupId) - } + set registrantAddress(registrantAddress) { + this._registrantAddress = + registrantAddress instanceof Uint8Array + ? registrantAddress + : this.constructor.Base58.decode(registrantAddress); + } - get params() { - const params = super.params - params.push( - this._rGroupIdBytes, - this._feeBytes - ) - return params - } + set rGroupId(rGroupId) { + this._rGroupId = rGroupId; + this._rGroupIdBytes = this.constructor.utils.int32ToBytes(this._rGroupId); + } + + get params() { + const params = super.params; + params.push(this._rGroupIdBytes, this._feeBytes); + return params; + } } diff --git a/src/transactions/PaymentTransaction.ts b/src/transactions/PaymentTransaction.ts index 120bbe9..af770f8 100644 --- a/src/transactions/PaymentTransaction.ts +++ b/src/transactions/PaymentTransaction.ts @@ -1,38 +1,36 @@ // @ts-nocheck -import { QORT_DECIMALS } from '../constants/constants' -import TransactionBase from './TransactionBase' - +import { QORT_DECIMALS } from '../constants/constants'; +import TransactionBase from './TransactionBase'; export default class PaymentTransaction extends TransactionBase { - constructor() { - super() - this.type = 2 - } + constructor() { + super(); + this.type = 2; + } - set recipient(recipient) { - this._recipient = recipient instanceof Uint8Array ? recipient : this.constructor.Base58.decode(recipient) - } + set recipient(recipient) { + this._recipient = + recipient instanceof Uint8Array + ? recipient + : this.constructor.Base58.decode(recipient); + } - set dialogto(dialogto) { - this._dialogto = dialogto - } + set dialogto(dialogto) { + this._dialogto = dialogto; + } - set dialogamount(dialogamount) { - this._dialogamount = dialogamount - } + set dialogamount(dialogamount) { + this._dialogamount = dialogamount; + } - set amount(amount) { - this._amount = Math.round(amount * QORT_DECIMALS) - this._amountBytes = this.constructor.utils.int64ToBytes(this._amount) - } + set amount(amount) { + this._amount = Math.round(amount * QORT_DECIMALS); + this._amountBytes = this.constructor.utils.int64ToBytes(this._amount); + } - get params() { - const params = super.params - params.push( - this._recipient, - this._amountBytes, - this._feeBytes - ) - return params - } + get params() { + const params = super.params; + params.push(this._recipient, this._amountBytes, this._feeBytes); + return params; + } } diff --git a/src/transactions/RegisterNameTransaction.ts b/src/transactions/RegisterNameTransaction.ts index 53046ee..e523f28 100644 --- a/src/transactions/RegisterNameTransaction.ts +++ b/src/transactions/RegisterNameTransaction.ts @@ -1,42 +1,44 @@ // @ts-nocheck -import { QORT_DECIMALS } from "../constants/constants" -import TransactionBase from "./TransactionBase" - - +import { QORT_DECIMALS } from '../constants/constants'; +import TransactionBase from './TransactionBase'; export default class RegisterNameTransaction extends TransactionBase { - constructor() { - super() - this.type = 3 - } + constructor() { + super(); + this.type = 3; + } + set fee(fee) { + this._fee = fee * QORT_DECIMALS; + this._feeBytes = this.constructor.utils.int64ToBytes(this._fee); + } - set fee(fee) { - this._fee = fee * QORT_DECIMALS - this._feeBytes = this.constructor.utils.int64ToBytes(this._fee) - } + set name(name) { + this.nameText = name; + this._nameBytes = this.constructor.utils.stringtoUTF8Array(name); + this._nameLength = this.constructor.utils.int32ToBytes( + this._nameBytes.length + ); + } - set name(name) { - this.nameText = name - this._nameBytes = this.constructor.utils.stringtoUTF8Array(name) - this._nameLength = this.constructor.utils.int32ToBytes(this._nameBytes.length) - } + set value(value) { + this.valueText = + value.length === 0 ? 'Registered Name on the Qortal Chain' : value; + this._valueBytes = this.constructor.utils.stringtoUTF8Array(this.valueText); + this._valueLength = this.constructor.utils.int32ToBytes( + this._valueBytes.length + ); + } - set value(value) { - this.valueText = value.length === 0 ? "Registered Name on the Qortal Chain" : value - this._valueBytes = this.constructor.utils.stringtoUTF8Array(this.valueText) - this._valueLength = this.constructor.utils.int32ToBytes(this._valueBytes.length) - } - - get params() { - const params = super.params - params.push( - this._nameLength, - this._nameBytes, - this._valueLength, - this._valueBytes, - this._feeBytes - ) - return params - } + get params() { + const params = super.params; + params.push( + this._nameLength, + this._nameBytes, + this._valueLength, + this._valueBytes, + this._feeBytes + ); + return params; + } } diff --git a/src/transactions/RemoveGroupAdminTransaction.ts b/src/transactions/RemoveGroupAdminTransaction.ts index 3392f79..11896be 100644 --- a/src/transactions/RemoveGroupAdminTransaction.ts +++ b/src/transactions/RemoveGroupAdminTransaction.ts @@ -1,38 +1,34 @@ // @ts-nocheck -import { QORT_DECIMALS } from "../constants/constants" -import TransactionBase from "./TransactionBase" - +import { QORT_DECIMALS } from '../constants/constants'; +import TransactionBase from './TransactionBase'; export default class RemoveGroupAdminTransaction extends TransactionBase { - constructor() { - super() - this.type = 25 - } + constructor() { + super(); + this.type = 25; + } + set rGroupId(rGroupId) { + this._rGroupId = rGroupId; + this._rGroupIdBytes = this.constructor.utils.int32ToBytes(this._rGroupId); + } + set recipient(recipient) { + this._recipient = + recipient instanceof Uint8Array + ? recipient + : this.constructor.Base58.decode(recipient); + this.theRecipient = recipient; + } - set rGroupId(rGroupId) { - this._rGroupId = rGroupId - this._rGroupIdBytes = this.constructor.utils.int32ToBytes(this._rGroupId) - } + set fee(fee) { + this._fee = fee * QORT_DECIMALS; + this._feeBytes = this.constructor.utils.int64ToBytes(this._fee); + } - set recipient(recipient) { - this._recipient = recipient instanceof Uint8Array ? recipient : this.constructor.Base58.decode(recipient) - this.theRecipient = recipient - } - - set fee(fee) { - this._fee = fee * QORT_DECIMALS - this._feeBytes = this.constructor.utils.int64ToBytes(this._fee) - } - - get params() { - const params = super.params - params.push( - this._rGroupIdBytes, - this._recipient, - this._feeBytes - ) - return params - } + get params() { + const params = super.params; + params.push(this._rGroupIdBytes, this._recipient, this._feeBytes); + return params; + } } diff --git a/src/transactions/RemoveRewardShareTransaction.ts b/src/transactions/RemoveRewardShareTransaction.ts index 375711a..078c8ed 100644 --- a/src/transactions/RemoveRewardShareTransaction.ts +++ b/src/transactions/RemoveRewardShareTransaction.ts @@ -1,46 +1,50 @@ // @ts-nocheck -import { DYNAMIC_FEE_TIMESTAMP } from "../constants/constants" -import Base58 from "../deps/Base58" -import publicKeyToAddress from "../utils/generateWallet/publicKeyToAddress" -import TransactionBase from "./TransactionBase" - - +import { DYNAMIC_FEE_TIMESTAMP } from '../constants/constants'; +import Base58 from '../encryption/Base58'; +import publicKeyToAddress from '../utils/generateWallet/publicKeyToAddress'; +import TransactionBase from './TransactionBase'; export default class RemoveRewardShareTransaction extends TransactionBase { - constructor() { - super() - this.type = 38 - } + constructor() { + super(); + this.type = 38; + } + set rewardShareKeyPairPublicKey(rewardShareKeyPairPublicKey) { + this._rewardShareKeyPairPublicKey = Base58.decode( + rewardShareKeyPairPublicKey + ); + } - set rewardShareKeyPairPublicKey(rewardShareKeyPairPublicKey) { - this._rewardShareKeyPairPublicKey = Base58.decode(rewardShareKeyPairPublicKey) - } + set recipient(recipient) { + const _address = publicKeyToAddress(this._keyPair.publicKey); + this._recipient = + recipient instanceof Uint8Array + ? recipient + : this.constructor.Base58.decode(recipient); - set recipient(recipient) { - const _address = publicKeyToAddress(this._keyPair.publicKey) - this._recipient = recipient instanceof Uint8Array ? recipient : this.constructor.Base58.decode(recipient) + if (new Date(this._timestamp).getTime() >= DYNAMIC_FEE_TIMESTAMP) { + this.fee = _address === recipient ? 0 : 0.01; + } else { + this.fee = _address === recipient ? 0 : 0.001; + } + } - if (new Date(this._timestamp).getTime() >= DYNAMIC_FEE_TIMESTAMP) { - this.fee = _address === recipient ? 0 : 0.01 - } else { - this.fee = _address === recipient ? 0 : 0.001 - } - } + set percentageShare(share) { + this._percentageShare = share * 100; + this._percentageShareBytes = this.constructor.utils.int64ToBytes( + this._percentageShare + ); + } - set percentageShare(share) { - this._percentageShare = share * 100 - this._percentageShareBytes = this.constructor.utils.int64ToBytes(this._percentageShare) - } - - get params() { - const params = super.params - params.push( - this._recipient, - this._rewardShareKeyPairPublicKey, - this._percentageShareBytes, - this._feeBytes - ) - return params - } + get params() { + const params = super.params; + params.push( + this._recipient, + this._rewardShareKeyPairPublicKey, + this._percentageShareBytes, + this._feeBytes + ); + return params; + } } diff --git a/src/transactions/RewardShareTransaction.ts b/src/transactions/RewardShareTransaction.ts index 8419432..661f7f8 100644 --- a/src/transactions/RewardShareTransaction.ts +++ b/src/transactions/RewardShareTransaction.ts @@ -1,60 +1,86 @@ // @ts-nocheck -import TransactionBase from './TransactionBase' - -import { Sha256 } from 'asmcrypto.js' -import nacl from '../deps/nacl-fast' -import ed2curve from '../deps/ed2curve' -import { DYNAMIC_FEE_TIMESTAMP } from '../constants/constants' -import publicKeyToAddress from '../utils/generateWallet/publicKeyToAddress' - +import TransactionBase from './TransactionBase'; +import { Sha256 } from 'asmcrypto.js'; +import nacl from '../encryption/nacl-fast'; +import ed2curve from '../encryption/ed2curve'; +import { DYNAMIC_FEE_TIMESTAMP } from '../constants/constants'; +import publicKeyToAddress from '../utils/generateWallet/publicKeyToAddress'; export default class RewardShareTransaction extends TransactionBase { - constructor() { - super() - this.type = 38 - } + constructor() { + super(); + this.type = 38; + } + set recipientPublicKey(recipientPublicKey) { + this._base58RecipientPublicKey = + recipientPublicKey instanceof Uint8Array + ? this.constructor.Base58.encode(recipientPublicKey) + : recipientPublicKey; + this._recipientPublicKey = this.constructor.Base58.decode( + this._base58RecipientPublicKey + ); + this.recipient = publicKeyToAddress(this._recipientPublicKey); + const convertedPrivateKey = ed2curve.convertSecretKey( + this._keyPair.privateKey + ); + const convertedPublicKey = ed2curve.convertPublicKey( + this._recipientPublicKey + ); + const sharedSecret = new Uint8Array(32); - set recipientPublicKey(recipientPublicKey) { - this._base58RecipientPublicKey = recipientPublicKey instanceof Uint8Array ? this.constructor.Base58.encode(recipientPublicKey) : recipientPublicKey - this._recipientPublicKey = this.constructor.Base58.decode(this._base58RecipientPublicKey) - this.recipient = publicKeyToAddress(this._recipientPublicKey) + nacl.lowlevel.crypto_scalarmult( + sharedSecret, + convertedPrivateKey, + convertedPublicKey + ); - const convertedPrivateKey = ed2curve.convertSecretKey(this._keyPair.privateKey) - const convertedPublicKey = ed2curve.convertPublicKey(this._recipientPublicKey) - const sharedSecret = new Uint8Array(32) + this._rewardShareSeed = new Sha256().process(sharedSecret).finish().result; + this._base58RewardShareSeed = this.constructor.Base58.encode( + this._rewardShareSeed + ); + this._rewardShareKeyPair = nacl.sign.keyPair.fromSeed( + this._rewardShareSeed + ); - nacl.lowlevel.crypto_scalarmult(sharedSecret, convertedPrivateKey, convertedPublicKey) + if (new Date(this._timestamp).getTime() >= DYNAMIC_FEE_TIMESTAMP) { + this.fee = + recipientPublicKey === + this.constructor.Base58.encode(this._keyPair.publicKey) + ? 0 + : 0.01; + } else { + this.fee = + recipientPublicKey === + this.constructor.Base58.encode(this._keyPair.publicKey) + ? 0 + : 0.001; + } + } - this._rewardShareSeed = new Sha256().process(sharedSecret).finish().result - this._base58RewardShareSeed = this.constructor.Base58.encode(this._rewardShareSeed) - this._rewardShareKeyPair = nacl.sign.keyPair.fromSeed(this._rewardShareSeed) + set recipient(recipient) { + this._recipient = + recipient instanceof Uint8Array + ? recipient + : this.constructor.Base58.decode(recipient); + } - if (new Date(this._timestamp).getTime() >= DYNAMIC_FEE_TIMESTAMP) { - this.fee = (recipientPublicKey === this.constructor.Base58.encode(this._keyPair.publicKey) ? 0 : 0.01) - } else { - this.fee = (recipientPublicKey === this.constructor.Base58.encode(this._keyPair.publicKey) ? 0 : 0.001) - } - } + set percentageShare(share) { + this._percentageShare = share * 100; + this._percentageShareBytes = this.constructor.utils.int64ToBytes( + this._percentageShare + ); + } - set recipient(recipient) { - this._recipient = recipient instanceof Uint8Array ? recipient : this.constructor.Base58.decode(recipient) - } - - set percentageShare(share) { - this._percentageShare = share * 100 - this._percentageShareBytes = this.constructor.utils.int64ToBytes(this._percentageShare) - } - - get params() { - const params = super.params - params.push( - this._recipient, - this._rewardShareKeyPair.publicKey, - this._percentageShareBytes, - this._feeBytes - ) - return params - } + get params() { + const params = super.params; + params.push( + this._recipient, + this._rewardShareKeyPair.publicKey, + this._percentageShareBytes, + this._feeBytes + ); + return params; + } } diff --git a/src/transactions/SellNameTransacion.ts b/src/transactions/SellNameTransacion.ts new file mode 100644 index 0000000..2e5f15e --- /dev/null +++ b/src/transactions/SellNameTransacion.ts @@ -0,0 +1,40 @@ +// @ts-nocheck + +import { QORT_DECIMALS } from '../constants/constants'; +import TransactionBase from './TransactionBase'; +export default class SellNameTransacion extends TransactionBase { + constructor() { + super(); + this.type = 5; + } + + set fee(fee) { + this._fee = fee * QORT_DECIMALS; + this._feeBytes = this.constructor.utils.int64ToBytes(this._fee); + } + + set name(name) { + this.nameText = name; + this._nameBytes = this.constructor.utils.stringtoUTF8Array(name); + this._nameLength = this.constructor.utils.int32ToBytes( + this._nameBytes.length + ); + } + + set sellPrice(sellPrice) { + this.showSellPrice = sellPrice; + this._sellPrice = sellPrice * QORT_DECIMALS; + this._sellPriceBytes = this.constructor.utils.int64ToBytes(this._sellPrice); + } + + get params() { + const params = super.params; + params.push( + this._nameLength, + this._nameBytes, + this._sellPriceBytes, + this._feeBytes + ); + return params; + } +} diff --git a/src/transactions/TradeBotCreateRequest.ts b/src/transactions/TradeBotCreateRequest.ts index 800ddec..fbdcdb5 100644 --- a/src/transactions/TradeBotCreateRequest.ts +++ b/src/transactions/TradeBotCreateRequest.ts @@ -2,64 +2,64 @@ /** * CrossChain - TradeBot Create Request (Sell Action) - * + * * These are special types of transactions (JSON ENCODED) */ export default class TradeBotCreateRequest { - constructor() { - // ... - } + constructor() { + // ... + } - createTransaction(txnReq) { - this.creatorPublicKey(txnReq.creatorPublicKey) - this.qortAmount(txnReq.qortAmount) - this.fundingQortAmount(txnReq.fundingQortAmount) - this.foreignBlockchain(txnReq.foreignBlockchain) - this.foreignAmount(txnReq.foreignAmount) - this.tradeTimeout(txnReq.tradeTimeout) - this.receivingAddress(txnReq.receivingAddress) + createTransaction(txnReq) { + this.creatorPublicKey(txnReq.creatorPublicKey); + this.qortAmount(txnReq.qortAmount); + this.fundingQortAmount(txnReq.fundingQortAmount); + this.foreignBlockchain(txnReq.foreignBlockchain); + this.foreignAmount(txnReq.foreignAmount); + this.tradeTimeout(txnReq.tradeTimeout); + this.receivingAddress(txnReq.receivingAddress); - return this.txnRequest() - } + return this.txnRequest(); + } - creatorPublicKey(creatorPublicKey) { - this._creatorPublicKey = creatorPublicKey - } + creatorPublicKey(creatorPublicKey) { + this._creatorPublicKey = creatorPublicKey; + } - qortAmount(qortAmount) { - this._qortAmount = qortAmount - } + qortAmount(qortAmount) { + this._qortAmount = qortAmount; + } - fundingQortAmount(fundingQortAmount) { - this._fundingQortAmount = fundingQortAmount - } + fundingQortAmount(fundingQortAmount) { + this._fundingQortAmount = fundingQortAmount; + } - foreignBlockchain(foreignBlockchain) { - this._foreignBlockchain = foreignBlockchain - } + foreignBlockchain(foreignBlockchain) { + this._foreignBlockchain = foreignBlockchain; + } - foreignAmount(foreignAmount) { - this._foreignAmount = foreignAmount - } + foreignAmount(foreignAmount) { + this._foreignAmount = foreignAmount; + } - tradeTimeout(tradeTimeout) { - this._tradeTimeout = tradeTimeout - } + tradeTimeout(tradeTimeout) { + this._tradeTimeout = tradeTimeout; + } - receivingAddress(receivingAddress) { - this._receivingAddress = receivingAddress - } + receivingAddress(receivingAddress) { + this._receivingAddress = receivingAddress; + } - txnRequest() { - return { - creatorPublicKey: this._creatorPublicKey, - qortAmount: this._qortAmount, - fundingQortAmount: this._fundingQortAmount, - foreignBlockchain: this._foreignBlockchain, - foreignAmount: this._foreignAmount, - tradeTimeout: this._tradeTimeout, - receivingAddress: this._receivingAddress - } - } + txnRequest() { + return { + creatorPublicKey: this._creatorPublicKey, + qortAmount: this._qortAmount, + fundingQortAmount: this._fundingQortAmount, + foreignBlockchain: this._foreignBlockchain, + foreignAmount: this._foreignAmount, + tradeTimeout: this._tradeTimeout, + receivingAddress: this._receivingAddress, + }; + } } diff --git a/src/transactions/TradeBotDeleteRequest.ts b/src/transactions/TradeBotDeleteRequest.ts index cd3c1b4..1e4a69d 100644 --- a/src/transactions/TradeBotDeleteRequest.ts +++ b/src/transactions/TradeBotDeleteRequest.ts @@ -1,35 +1,35 @@ // @ts-nocheck /** - * CrossChain - DELETE TradeOffer - * + * CrossChain - DELETE TradeOffer + * * These are special types of transactions (JSON ENCODED) */ export default class DeleteTradeOffer { - constructor() { - // ... - } + constructor() { + // ... + } - createTransaction(txnReq) { - this.creatorPublicKey(txnReq.creatorPublicKey) - this.atAddress(txnReq.atAddress) + createTransaction(txnReq) { + this.creatorPublicKey(txnReq.creatorPublicKey); + this.atAddress(txnReq.atAddress); - return this.txnRequest() - } + return this.txnRequest(); + } - creatorPublicKey(creatorPublicKey) { - this._creatorPublicKey = creatorPublicKey - } + creatorPublicKey(creatorPublicKey) { + this._creatorPublicKey = creatorPublicKey; + } - atAddress(atAddress) { - this._atAddress = atAddress - } + atAddress(atAddress) { + this._atAddress = atAddress; + } - txnRequest() { - return { - creatorPublicKey: this._creatorPublicKey, - atAddress: this._atAddress - } - } + txnRequest() { + return { + creatorPublicKey: this._creatorPublicKey, + atAddress: this._atAddress, + }; + } } diff --git a/src/transactions/TradeBotRespondMultipleRequest.ts b/src/transactions/TradeBotRespondMultipleRequest.ts index a7eb4d8..da3b93e 100644 --- a/src/transactions/TradeBotRespondMultipleRequest.ts +++ b/src/transactions/TradeBotRespondMultipleRequest.ts @@ -7,36 +7,35 @@ */ export class TradeBotRespondMultipleRequest { - constructor() { - // ... - } + constructor() { + // ... + } - createTransaction(txnReq) { - this.addresses(txnReq.addresses) - this.foreignKey(txnReq.foreignKey) - this.receivingAddress(txnReq.receivingAddress) + createTransaction(txnReq) { + this.addresses(txnReq.addresses); + this.foreignKey(txnReq.foreignKey); + this.receivingAddress(txnReq.receivingAddress); - return this.txnRequest() - } + return this.txnRequest(); + } - addresses(addresses) { - this._addresses = addresses - } + addresses(addresses) { + this._addresses = addresses; + } - foreignKey(foreignKey) { - this._foreignKey = foreignKey - } + foreignKey(foreignKey) { + this._foreignKey = foreignKey; + } - receivingAddress(receivingAddress) { - this._receivingAddress = receivingAddress - } + receivingAddress(receivingAddress) { + this._receivingAddress = receivingAddress; + } - txnRequest() { - return { - addresses: this._addresses, - foreignKey: this._foreignKey, - receivingAddress: this._receivingAddress - } - } + txnRequest() { + return { + addresses: this._addresses, + foreignKey: this._foreignKey, + receivingAddress: this._receivingAddress, + }; + } } - diff --git a/src/transactions/TradeBotRespondRequest.ts b/src/transactions/TradeBotRespondRequest.ts index fcd1af5..76f548a 100644 --- a/src/transactions/TradeBotRespondRequest.ts +++ b/src/transactions/TradeBotRespondRequest.ts @@ -2,40 +2,40 @@ /** * CrossChain - TradeBot Respond Request (Buy Action) - * + * * These are special types of transactions (JSON ENCODED) */ export default class TradeBotRespondRequest { - constructor() { - // ... - } + constructor() { + // ... + } - createTransaction(txnReq) { - this.atAddress(txnReq.atAddress) - this.foreignKey(txnReq.foreignKey) - this.receivingAddress(txnReq.receivingAddress) + createTransaction(txnReq) { + this.atAddress(txnReq.atAddress); + this.foreignKey(txnReq.foreignKey); + this.receivingAddress(txnReq.receivingAddress); - return this.txnRequest() - } + return this.txnRequest(); + } - atAddress(atAddress) { - this._atAddress = atAddress - } + atAddress(atAddress) { + this._atAddress = atAddress; + } - foreignKey(foreignKey) { - this._foreignKey = foreignKey - } + foreignKey(foreignKey) { + this._foreignKey = foreignKey; + } - receivingAddress(receivingAddress) { - this._receivingAddress = receivingAddress - } + receivingAddress(receivingAddress) { + this._receivingAddress = receivingAddress; + } - txnRequest() { - return { - atAddress: this._atAddress, - foreignKey: this._foreignKey, - receivingAddress: this._receivingAddress - } - } + txnRequest() { + return { + atAddress: this._atAddress, + foreignKey: this._foreignKey, + receivingAddress: this._receivingAddress, + }; + } } diff --git a/src/transactions/TransactionBase.ts b/src/transactions/TransactionBase.ts index ca9e7ea..f4abf0f 100644 --- a/src/transactions/TransactionBase.ts +++ b/src/transactions/TransactionBase.ts @@ -1,165 +1,188 @@ // @ts-nocheck -import nacl from '../deps/nacl-fast' -import Base58 from '../deps/Base58' -import utils from '../utils/utils' -import { QORT_DECIMALS, TX_TYPES } from '../constants/constants.js' - +import nacl from '../encryption/nacl-fast.js'; +import Base58 from '../encryption/Base58.js'; +import utils from '../utils/utils'; +import { QORT_DECIMALS, TX_TYPES } from '../constants/constants.js'; export default class TransactionBase { - static get utils() { - return utils - } - static get nacl() { - return nacl - } - static get Base58() { - return Base58 - } + static get utils() { + return utils; + } + static get nacl() { + return nacl; + } + static get Base58() { + return Base58; + } - constructor() { - this.fee = 0 - this.groupID = 0 - this.timestamp = Date.now() - this.tests = [ - () => { - if (!(this._type >= 1 && this._type in TX_TYPES)) { - return 'Invalid type: ' + this.type - } - return true - }, - () => { - if (this._fee < 0) { - return 'Invalid fee: ' + this._fee / QORT_DECIMALS - } - return true - }, - () => { - if (this._groupID < 0 || !Number.isInteger(this._groupID)) { - return 'Invalid groupID: ' + this._groupID - } - return true - }, - () => { - if (!(new Date(this._timestamp)).getTime() > 0) { - return 'Invalid timestamp: ' + this._timestamp - } - return true - }, - () => { - if (!(this._lastReference instanceof Uint8Array && this._lastReference.byteLength == 64)) { - if (this._lastReference == 0) { - return 'Invalid last reference. Please ensure that you have at least 0.001 QORT for the transaction fee.' - } - return 'Invalid last reference: ' + this._lastReference - } - return true - }, - () => { - if (!(this._keyPair)) { - return 'keyPair must be specified' - } - if (!(this._keyPair.publicKey instanceof Uint8Array && this._keyPair.publicKey.byteLength === 32)) { - return 'Invalid publicKey' - } - if (!(this._keyPair.privateKey instanceof Uint8Array && this._keyPair.privateKey.byteLength === 64)) { - return 'Invalid privateKey' - } - return true - } - ] - } + constructor() { + this.fee = 0; + this.groupID = 0; + this.timestamp = Date.now(); + this.tests = [ + () => { + if (!(this._type >= 1 && this._type in TX_TYPES)) { + return 'Invalid type: ' + this.type; + } + return true; + }, + () => { + if (this._fee < 0) { + return 'Invalid fee: ' + this._fee / QORT_DECIMALS; + } + return true; + }, + () => { + if (this._groupID < 0 || !Number.isInteger(this._groupID)) { + return 'Invalid groupID: ' + this._groupID; + } + return true; + }, + () => { + if (!new Date(this._timestamp).getTime() > 0) { + return 'Invalid timestamp: ' + this._timestamp; + } + return true; + }, + () => { + if ( + !( + this._lastReference instanceof Uint8Array && + this._lastReference.byteLength == 64 + ) + ) { + if (this._lastReference == 0) { + return 'Invalid last reference. Please ensure that you have at least 0.001 QORT for the transaction fee.'; + } + return 'Invalid last reference: ' + this._lastReference; + } + return true; + }, + () => { + if (!this._keyPair) { + return 'keyPair must be specified'; + } + if ( + !( + this._keyPair.publicKey instanceof Uint8Array && + this._keyPair.publicKey.byteLength === 32 + ) + ) { + return 'Invalid publicKey'; + } + if ( + !( + this._keyPair.privateKey instanceof Uint8Array && + this._keyPair.privateKey.byteLength === 64 + ) + ) { + return 'Invalid privateKey'; + } + return true; + }, + ]; + } - set keyPair(keyPair) { - this._keyPair = keyPair - } + set keyPair(keyPair) { + this._keyPair = keyPair; + } - set type(type) { - this.typeText = TX_TYPES[type] - this._type = type - this._typeBytes = this.constructor.utils.int32ToBytes(this._type) - } + set type(type) { + this.typeText = TX_TYPES[type]; + this._type = type; + this._typeBytes = this.constructor.utils.int32ToBytes(this._type); + } - set groupID(groupID) { - this._groupID = groupID - this._groupIDBytes = this.constructor.utils.int32ToBytes(this._groupID) - } + set groupID(groupID) { + this._groupID = groupID; + this._groupIDBytes = this.constructor.utils.int32ToBytes(this._groupID); + } - set timestamp(timestamp) { - this._timestamp = timestamp - this._timestampBytes = this.constructor.utils.int64ToBytes(this._timestamp) - } + set timestamp(timestamp) { + this._timestamp = timestamp; + this._timestampBytes = this.constructor.utils.int64ToBytes(this._timestamp); + } - set fee(fee) { - this._fee = fee * QORT_DECIMALS - this._feeBytes = this.constructor.utils.int64ToBytes(this._fee) - } + set fee(fee) { + this._fee = fee * QORT_DECIMALS; + this._feeBytes = this.constructor.utils.int64ToBytes(this._fee); + } - set lastReference(lastReference) { - this._lastReference = lastReference instanceof Uint8Array ? lastReference : this.constructor.Base58.decode(lastReference) - } + set lastReference(lastReference) { + this._lastReference = + lastReference instanceof Uint8Array + ? lastReference + : this.constructor.Base58.decode(lastReference); + } - get params() { - return [ - this._typeBytes, - this._timestampBytes, - this._groupIDBytes, - this._lastReference, - this._keyPair.publicKey - ] - } + get params() { + return [ + this._typeBytes, + this._timestampBytes, + this._groupIDBytes, + this._lastReference, + this._keyPair.publicKey, + ]; + } - get signedBytes() { - if (!this._signedBytes) { - this.sign() - } - return this._signedBytes - } + get signedBytes() { + if (!this._signedBytes) { + this.sign(); + } + return this._signedBytes; + } - validParams() { - let finalResult = { - valid: true - } - this.tests.some(test => { - const result = test() - if (result !== true) { - finalResult = { - valid: false, - message: result - } - return true // exists the loop - } - }) - return finalResult - } + validParams() { + let finalResult = { + valid: true, + }; + this.tests.some((test) => { + const result = test(); + if (result !== true) { + finalResult = { + valid: false, + message: result, + }; + return true; // exists the loop + } + }); + return finalResult; + } - generateBase() { - const isValid = this.validParams() - if (!isValid.valid) { - throw new Error(isValid.message) - } - let result = new Uint8Array() + generateBase() { + const isValid = this.validParams(); + if (!isValid.valid) { + throw new Error(isValid.message); + } + let result = new Uint8Array(); - this.params.forEach(item => { - result = this.constructor.utils.appendBuffer(result, item) - }) + this.params.forEach((item) => { + result = this.constructor.utils.appendBuffer(result, item); + }); - this._base = result - return result - } + this._base = result; + return result; + } - sign() { - if (!this._keyPair) { - throw new Error('keyPair not defined') - } + sign() { + if (!this._keyPair) { + throw new Error('keyPair not defined'); + } - if (!this._base) { - this.generateBase() - } + if (!this._base) { + this.generateBase(); + } - this._signature = this.constructor.nacl.sign.detached(this._base, this._keyPair.privateKey) + this._signature = this.constructor.nacl.sign.detached( + this._base, + this._keyPair.privateKey + ); - this._signedBytes = this.constructor.utils.appendBuffer(this._base, this._signature) + this._signedBytes = this.constructor.utils.appendBuffer( + this._base, + this._signature + ); - return this._signature - } + return this._signature; + } } diff --git a/src/transactions/TransferAssetTransaction.ts b/src/transactions/TransferAssetTransaction.ts new file mode 100644 index 0000000..31bc69a --- /dev/null +++ b/src/transactions/TransferAssetTransaction.ts @@ -0,0 +1,37 @@ +// @ts-nocheck + +import { QORT_DECIMALS } from '../constants/constants'; +import TransactionBase from './TransactionBase'; +export default class TransferAssetTransaction extends TransactionBase { + constructor() { + super(); + this.type = 12; + } + + set recipient(recipient) { + this._recipient = + recipient instanceof Uint8Array + ? recipient + : this.constructor.Base58.decode(recipient); + } + + set amount(amount) { + this._amount = Math.round(amount * QORT_DECIMALS); + this._amountBytes = this.constructor.utils.int64ToBytes(this._amount); + } + + set assetId(assetId) { + this._assetId = this.constructor.utils.int64ToBytes(assetId); + } + + get params() { + const params = super.params; + params.push( + this._recipient, + this._assetId, + this._amountBytes, + this._feeBytes + ); + return params; + } +} diff --git a/src/transactions/UpdateGroupTransaction.ts b/src/transactions/UpdateGroupTransaction.ts new file mode 100644 index 0000000..cc0ce48 --- /dev/null +++ b/src/transactions/UpdateGroupTransaction.ts @@ -0,0 +1,64 @@ +// @ts-nocheck + +import { QORT_DECIMALS } from '../constants/constants'; +import TransactionBase from './TransactionBase'; +export default class UpdateGroupTransaction extends TransactionBase { + constructor() { + super(); + this.type = 23; + } + + set fee(fee) { + this._fee = fee * QORT_DECIMALS; + this._feeBytes = this.constructor.utils.int64ToBytes(this._fee); + } + set newOwner(newOwner) { + this._newOwner = + newOwner instanceof Uint8Array + ? newOwner + : this.constructor.Base58.decode(newOwner); + } + set newIsOpen(newIsOpen) { + this._rGroupType = new Uint8Array(1); + this._rGroupType[0] = newIsOpen; + } + set newDescription(newDescription) { + this._rGroupDescBytes = this.constructor.utils.stringtoUTF8Array( + newDescription.toLocaleLowerCase() + ); + this._rGroupDescLength = this.constructor.utils.int32ToBytes( + this._rGroupDescBytes.length + ); + } + set newApprovalThreshold(newApprovalThreshold) { + this._rGroupApprovalThreshold = new Uint8Array(1); + this._rGroupApprovalThreshold[0] = newApprovalThreshold; + } + set newMinimumBlockDelay(newMinimumBlockDelay) { + this._rGroupMinimumBlockDelayBytes = + this.constructor.utils.int32ToBytes(newMinimumBlockDelay); + } + set newMaximumBlockDelay(newMaximumBlockDelay) { + this._rGroupMaximumBlockDelayBytes = + this.constructor.utils.int32ToBytes(newMaximumBlockDelay); + } + + set _groupId(_groupId) { + this._groupBytes = this.constructor.utils.int32ToBytes(_groupId); + } + get params() { + const params = super.params; + params.push( + this._groupBytes, + this._newOwner, + this._rGroupDescLength, + this._rGroupDescBytes, + this._rGroupType, + this._rGroupApprovalThreshold, + this._rGroupMinimumBlockDelayBytes, + this._rGroupMaximumBlockDelayBytes, + this._feeBytes + ); + return params; + } +} diff --git a/src/transactions/UpdateNameTransaction.ts b/src/transactions/UpdateNameTransaction.ts index e90b388..1aee16e 100644 --- a/src/transactions/UpdateNameTransaction.ts +++ b/src/transactions/UpdateNameTransaction.ts @@ -1,51 +1,56 @@ // @ts-nocheck -import { QORT_DECIMALS } from "../constants/constants" -import TransactionBase from "./TransactionBase" - - +import { QORT_DECIMALS } from '../constants/constants'; +import TransactionBase from './TransactionBase'; export default class UpdateNameTransaction extends TransactionBase { - constructor() { - super() - this.type = 4 - } + constructor() { + super(); + this.type = 4; + } + set fee(fee) { + this._fee = fee * QORT_DECIMALS; + this._feeBytes = this.constructor.utils.int64ToBytes(this._fee); + } + set name(name) { + this.nameText = name; + this._nameBytes = this.constructor.utils.stringtoUTF8Array(name); + this._nameLength = this.constructor.utils.int32ToBytes( + this._nameBytes.length + ); + } - set fee(fee) { - this._fee = fee * QORT_DECIMALS - this._feeBytes = this.constructor.utils.int64ToBytes(this._fee) - } + set newName(newName) { + this.newNameText = newName; + this._newNameBytes = this.constructor.utils.stringtoUTF8Array(newName); + this._newNameLength = this.constructor.utils.int32ToBytes( + this._newNameBytes.length + ); + } - set name(name) { - this.nameText = name - this._nameBytes = this.constructor.utils.stringtoUTF8Array(name) - this._nameLength = this.constructor.utils.int32ToBytes(this._nameBytes.length) - } + set newData(newData) { + this.newDataText = + newData.length === 0 ? 'Registered Name on the Qortal Chain' : newData; + this._newDataBytes = this.constructor.utils.stringtoUTF8Array( + this.newDataText + ); + this._newDataLength = this.constructor.utils.int32ToBytes( + this._newDataBytes.length + ); + } - set newName(newName) { - this.newNameText = newName - this._newNameBytes = this.constructor.utils.stringtoUTF8Array(newName) - this._newNameLength = this.constructor.utils.int32ToBytes(this._newNameBytes.length) - } - - set newData(newData) { - this.newDataText = newData.length === 0 ? "Registered Name on the Qortal Chain" : newData - this._newDataBytes = this.constructor.utils.stringtoUTF8Array(this.newDataText) - this._newDataLength = this.constructor.utils.int32ToBytes(this._newDataBytes.length) - } - - get params() { - const params = super.params - params.push( - this._nameLength, - this._nameBytes, - this._newNameLength, - this._newNameBytes, - this._newDataLength, - this._newDataBytes, - this._feeBytes - ) - return params - } + get params() { + const params = super.params; + params.push( + this._nameLength, + this._nameBytes, + this._newNameLength, + this._newNameBytes, + this._newDataLength, + this._newDataBytes, + this._feeBytes + ); + return params; + } } diff --git a/src/transactions/VoteOnPollTransaction.ts b/src/transactions/VoteOnPollTransaction.ts index 327295e..5b37163 100644 --- a/src/transactions/VoteOnPollTransaction.ts +++ b/src/transactions/VoteOnPollTransaction.ts @@ -1,38 +1,42 @@ // @ts-nocheck -import { QORT_DECIMALS } from '../constants/constants' -import TransactionBase from './TransactionBase' - +import { QORT_DECIMALS } from '../constants/constants'; +import TransactionBase from './TransactionBase'; export default class VoteOnPollTransaction extends TransactionBase { - constructor() { - super() - this.type = 9 - } + constructor() { + super(); + this.type = 9; + } + set fee(fee) { + this._fee = fee * QORT_DECIMALS; + this._feeBytes = this.constructor.utils.int64ToBytes(this._fee); + } - set fee(fee) { - this._fee = fee * QORT_DECIMALS - this._feeBytes = this.constructor.utils.int64ToBytes(this._fee) - } + set rPollName(rPollName) { + this._rPollName = rPollName; + this._rPollNameBytes = this.constructor.utils.stringtoUTF8Array( + this._rPollName + ); + this._rPollNameLength = this.constructor.utils.int32ToBytes( + this._rPollNameBytes.length + ); + } - set rPollName(rPollName) { - this._rPollName = rPollName - this._rPollNameBytes = this.constructor.utils.stringtoUTF8Array(this._rPollName) - this._rPollNameLength = this.constructor.utils.int32ToBytes(this._rPollNameBytes.length) - } + set rOptionIndex(rOptionIndex) { + this._rOptionIndex = rOptionIndex; + this._rOptionIndexBytes = this.constructor.utils.int32ToBytes( + this._rOptionIndex + ); + } - set rOptionIndex(rOptionIndex) { - this._rOptionIndex = rOptionIndex - this._rOptionIndexBytes = this.constructor.utils.int32ToBytes(this._rOptionIndex) - } - - get params() { - const params = super.params - params.push( - this._rPollNameLength, - this._rPollNameBytes, - this._rOptionIndexBytes, - this._feeBytes - ) - return params - } + get params() { + const params = super.params; + params.push( + this._rPollNameLength, + this._rPollNameBytes, + this._rOptionIndexBytes, + this._feeBytes + ); + return params; + } } diff --git a/src/transactions/signChat.ts b/src/transactions/signChat.ts index 8814c2a..bdc3cb9 100644 --- a/src/transactions/signChat.ts +++ b/src/transactions/signChat.ts @@ -1,39 +1,40 @@ // @ts-nocheck -import nacl from '../deps/nacl-fast' -import utils from '../utils/utils' +import nacl from '../encryption/nacl-fast'; +import utils from '../utils/utils'; export const signChat = (chatBytes, nonce, keyPair) => { - if (!chatBytes) { - throw new Error('Chat Bytes not defined') - } + if (!chatBytes) { + throw new Error('Chat Bytes not defined'); + } - if (!nonce) { - throw new Error('Nonce not defined') - } + if (!nonce) { + throw new Error('Nonce not defined'); + } - if (!keyPair) { - throw new Error('keyPair not defined') - } + if (!keyPair) { + throw new Error('keyPair not defined'); + } - const _nonce = utils.int32ToBytes(nonce) + const _nonce = utils.int32ToBytes(nonce); - if (chatBytes.length === undefined) { - const _chatBytesBuffer = Object.keys(chatBytes).map(function (key) { return chatBytes[key]; }) + if (chatBytes.length === undefined) { + const _chatBytesBuffer = Object.keys(chatBytes).map(function (key) { + return chatBytes[key]; + }); - const chatBytesBuffer = new Uint8Array(_chatBytesBuffer) - chatBytesBuffer.set(_nonce, 112) + const chatBytesBuffer = new Uint8Array(_chatBytesBuffer); + chatBytesBuffer.set(_nonce, 112); - const signature = nacl.sign.detached(chatBytesBuffer, keyPair.privateKey) + const signature = nacl.sign.detached(chatBytesBuffer, keyPair.privateKey); - return utils.appendBuffer(chatBytesBuffer, signature) - } else { - const chatBytesBuffer = new Uint8Array(chatBytes) - chatBytesBuffer.set(_nonce, 112) + return utils.appendBuffer(chatBytesBuffer, signature); + } else { + const chatBytesBuffer = new Uint8Array(chatBytes); + chatBytesBuffer.set(_nonce, 112); - const signature = nacl.sign.detached(chatBytesBuffer, keyPair.privateKey) - - return utils.appendBuffer(chatBytesBuffer, signature) - } -} + const signature = nacl.sign.detached(chatBytesBuffer, keyPair.privateKey); + return utils.appendBuffer(chatBytesBuffer, signature); + } +}; diff --git a/src/transactions/signTradeBotTransaction.ts b/src/transactions/signTradeBotTransaction.ts index 929898f..fc0e0e5 100644 --- a/src/transactions/signTradeBotTransaction.ts +++ b/src/transactions/signTradeBotTransaction.ts @@ -1,30 +1,31 @@ // @ts-nocheck - -import nacl from '../deps/nacl-fast' -import Base58 from '../deps/Base58' -import utils from '../utils/utils' +import nacl from '../encryption/nacl-fast'; +import Base58 from '../encryption/Base58'; +import utils from '../utils/utils'; const signTradeBotTransaction = async (unsignedTxn, keyPair) => { - if (!unsignedTxn) { - throw new Error('Unsigned Transaction Bytes not defined') - } + if (!unsignedTxn) { + throw new Error('Unsigned Transaction Bytes not defined'); + } - if (!keyPair) { - throw new Error('keyPair not defined') - } + if (!keyPair) { + throw new Error('keyPair not defined'); + } - const txnBuffer = Base58.decode(unsignedTxn) + const txnBuffer = Base58.decode(unsignedTxn); - if (keyPair.privateKey.length === undefined) { - const _privateKey = Object.keys(keyPair.privateKey).map(function (key) { return keyPair.privateKey[key] }) - const privateKey = new Uint8Array(_privateKey) - const signature = nacl.sign.detached(txnBuffer, privateKey) - return utils.appendBuffer(txnBuffer, signature) - } else { - const signature = nacl.sign.detached(txnBuffer, keyPair.privateKey) - return utils.appendBuffer(txnBuffer, signature) - } -} + if (keyPair.privateKey.length === undefined) { + const _privateKey = Object.keys(keyPair.privateKey).map(function (key) { + return keyPair.privateKey[key]; + }); + const privateKey = new Uint8Array(_privateKey); + const signature = nacl.sign.detached(txnBuffer, privateKey); + return utils.appendBuffer(txnBuffer, signature); + } else { + const signature = nacl.sign.detached(txnBuffer, keyPair.privateKey); + return utils.appendBuffer(txnBuffer, signature); + } +}; -export default signTradeBotTransaction +export default signTradeBotTransaction; diff --git a/src/transactions/transactions.ts b/src/transactions/transactions.ts index 62c5e6a..816e2b6 100644 --- a/src/transactions/transactions.ts +++ b/src/transactions/transactions.ts @@ -1,58 +1,65 @@ // @ts-nocheck -import PaymentTransaction from './PaymentTransaction.js' -import ChatTransaction from './ChatTransaction.js' -import GroupChatTransaction from './GroupChatTransaction.js' -import GroupInviteTransaction from './GroupInviteTransaction.js' -import CancelGroupInviteTransaction from './CancelGroupInviteTransaction.js' -import GroupKickTransaction from './GroupKickTransaction.js' -import GroupBanTransaction from './GroupBanTransaction.js' -import CancelGroupBanTransaction from './CancelGroupBanTransaction.js' -import CreateGroupTransaction from './CreateGroupTransaction.js' -import LeaveGroupTransaction from './LeaveGroupTransaction.js' -import JoinGroupTransaction from './JoinGroupTransaction.js' -import AddGroupAdminTransaction from './AddGroupAdminTransaction.js' -import RemoveGroupAdminTransaction from './RemoveGroupAdminTransaction.js' -import RegisterNameTransaction from './RegisterNameTransaction.js' -import VoteOnPollTransaction from './VoteOnPollTransaction.js' -import CreatePollTransaction from './CreatePollTransaction.js' -import DeployAtTransaction from './DeployAtTransaction.js' -import RewardShareTransaction from './RewardShareTransaction.js' -import RemoveRewardShareTransaction from './RemoveRewardShareTransaction.js' -import UpdateNameTransaction from './UpdateNameTransaction.js' - +import PaymentTransaction from './PaymentTransaction.js'; +import ChatTransaction from './ChatTransaction.js'; +import GroupChatTransaction from './GroupChatTransaction.js'; +import GroupInviteTransaction from './GroupInviteTransaction.js'; +import CancelGroupInviteTransaction from './CancelGroupInviteTransaction.js'; +import GroupKickTransaction from './GroupKickTransaction.js'; +import GroupBanTransaction from './GroupBanTransaction.js'; +import CancelGroupBanTransaction from './CancelGroupBanTransaction.js'; +import CreateGroupTransaction from './CreateGroupTransaction.js'; +import LeaveGroupTransaction from './LeaveGroupTransaction.js'; +import JoinGroupTransaction from './JoinGroupTransaction.js'; +import AddGroupAdminTransaction from './AddGroupAdminTransaction.js'; +import RemoveGroupAdminTransaction from './RemoveGroupAdminTransaction.js'; +import RegisterNameTransaction from './RegisterNameTransaction.js'; +import VoteOnPollTransaction from './VoteOnPollTransaction.js'; +import CreatePollTransaction from './CreatePollTransaction.js'; +import DeployAtTransaction from './DeployAtTransaction.js'; +import RewardShareTransaction from './RewardShareTransaction.js'; +import RemoveRewardShareTransaction from './RemoveRewardShareTransaction.js'; +import UpdateNameTransaction from './UpdateNameTransaction.js'; +import UpdateGroupTransaction from './UpdateGroupTransaction.js'; +import SellNameTransacion from './SellNameTransacion.js'; +import CancelSellNameTransacion from './CancelSellNameTransacion.js'; +import BuyNameTransacion from './BuyNameTransacion.js'; +import TransferAssetTransaction from './TransferAssetTransaction.js'; export const transactionTypes = { - 3: RegisterNameTransaction, - 4: UpdateNameTransaction, - 2: PaymentTransaction, - 8: CreatePollTransaction, - 9: VoteOnPollTransaction, - 16: DeployAtTransaction, - 18: ChatTransaction, - 181: GroupChatTransaction, - 22: CreateGroupTransaction, - 24: AddGroupAdminTransaction, - 25: RemoveGroupAdminTransaction, - 26: GroupBanTransaction, - 27: CancelGroupBanTransaction, - 28: GroupKickTransaction, - 29: GroupInviteTransaction, - 30: CancelGroupInviteTransaction, - 31: JoinGroupTransaction, - 32: LeaveGroupTransaction, - 38: RewardShareTransaction, - 381: RemoveRewardShareTransaction -} - + 2: PaymentTransaction, + 3: RegisterNameTransaction, + 4: UpdateNameTransaction, + 5: SellNameTransacion, + 6: CancelSellNameTransacion, + 7: BuyNameTransacion, + 8: CreatePollTransaction, + 9: VoteOnPollTransaction, + 12: TransferAssetTransaction, + 16: DeployAtTransaction, + 18: ChatTransaction, + 181: GroupChatTransaction, + 22: CreateGroupTransaction, + 23: UpdateGroupTransaction, + 24: AddGroupAdminTransaction, + 25: RemoveGroupAdminTransaction, + 26: GroupBanTransaction, + 27: CancelGroupBanTransaction, + 28: GroupKickTransaction, + 29: GroupInviteTransaction, + 30: CancelGroupInviteTransaction, + 31: JoinGroupTransaction, + 32: LeaveGroupTransaction, + 38: RewardShareTransaction, + 381: RemoveRewardShareTransaction, +}; export const createTransaction = (type, keyPair, params) => { - const tx = new transactionTypes[type]() - tx.keyPair = keyPair - Object.keys(params).forEach(param => { - - tx[param] = params[param] - }) + const tx = new transactionTypes[type](); + tx.keyPair = keyPair; + Object.keys(params).forEach((param) => { + tx[param] = params[param]; + }); - return tx -} \ No newline at end of file + return tx; +}; diff --git a/src/useAppFullscreen.tsx b/src/useAppFullscreen.tsx deleted file mode 100644 index 3dbe4a1..0000000 --- a/src/useAppFullscreen.tsx +++ /dev/null @@ -1,67 +0,0 @@ -import { useCallback, useEffect } from 'react'; -import { isMobile } from './App'; - -export const useAppFullScreen = (setFullScreen) => { - const enterFullScreen = useCallback(() => { - const element = document.documentElement; // Target the entire HTML document - if (element.requestFullscreen) { - element.requestFullscreen(); - } else if (element.mozRequestFullScreen) { // Firefox - element.mozRequestFullScreen(); - } else if (element.webkitRequestFullscreen) { // Chrome, Safari and Opera - element.webkitRequestFullscreen(); - } else if (element.msRequestFullscreen) { // IE/Edge - element.msRequestFullscreen(); - } - }, []); - - const exitFullScreen = useCallback(() => { - if (document.fullscreenElement) { - document.exitFullscreen(); - } else if (document.mozFullScreenElement) { - document.mozCancelFullScreen(); - } else if (document.webkitFullscreenElement) { - document.webkitExitFullscreen(); - } else if (document.msFullscreenElement) { - document.msExitFullscreen(); - } - }, []); - - const toggleFullScreen = useCallback(() => { - if(!isMobile || isMobile) return - if (document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement) { - exitFullScreen(); - setFullScreen(false) - } else { - enterFullScreen(); - setFullScreen(true) - } - }, [enterFullScreen, exitFullScreen]); - - // Listen for changes to fullscreen state - useEffect(() => { - const handleFullScreenChange = () => { - if (document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement) { - - } else { - setFullScreen(false); - } - }; - - document.addEventListener('fullscreenchange', handleFullScreenChange); - document.addEventListener('webkitfullscreenchange', handleFullScreenChange); // Safari - document.addEventListener('mozfullscreenchange', handleFullScreenChange); // Firefox - document.addEventListener('MSFullscreenChange', handleFullScreenChange); // IE/Edge - - return () => { - document.removeEventListener('fullscreenchange', handleFullScreenChange); - document.removeEventListener('webkitfullscreenchange', handleFullScreenChange); - document.removeEventListener('mozfullscreenchange', handleFullScreenChange); - document.removeEventListener('MSFullscreenChange', handleFullScreenChange); - }; - }, []); - - return { enterFullScreen, exitFullScreen, toggleFullScreen }; -}; - - diff --git a/src/useQortalGetSaveSettings.tsx b/src/useQortalGetSaveSettings.tsx deleted file mode 100644 index 532e049..0000000 --- a/src/useQortalGetSaveSettings.tsx +++ /dev/null @@ -1,97 +0,0 @@ -import React, { useCallback, useEffect } from 'react' -import { useRecoilState, useSetRecoilState } from 'recoil'; -import { canSaveSettingToQdnAtom, isUsingImportExportSettingsAtom, oldPinnedAppsAtom, settingsLocalLastUpdatedAtom, settingsQDNLastUpdatedAtom, sortablePinnedAppsAtom } from './atoms/global'; -import { getArbitraryEndpointReact, getBaseApiReact } from './App'; -import { decryptResource } from './components/Group/Group'; -import { base64ToUint8Array, uint8ArrayToObject } from './backgroundFunctions/encryption'; - -function fetchFromLocalStorage(key) { - try { - const serializedValue = localStorage.getItem(key); - if (serializedValue === null) { - console.log(`No data found for key: ${key}`); - return null; - } - return JSON.parse(serializedValue); - } catch (error) { - console.error('Error fetching from localStorage:', error); - return null; - } -} - -const getPublishRecord = async (myName) => { - // const validApi = await findUsableApi(); - const url = `${getBaseApiReact()}${getArbitraryEndpointReact()}?mode=ALL&service=DOCUMENT_PRIVATE&identifier=ext_saved_settings&exactmatchnames=true&limit=1&prefix=true&name=${myName}`; - const response = await fetch(url); - if (!response.ok) { - throw new Error("network error"); - } - const publishData = await response.json(); - - if(publishData?.length > 0) return {hasPublishRecord: true, timestamp: publishData[0]?.updated || publishData[0].created} - - return {hasPublishRecord: false} - }; - const getPublish = async (myName) => { - try { - let data - const res = await fetch( - `${getBaseApiReact()}/arbitrary/DOCUMENT_PRIVATE/${myName}/ext_saved_settings?encoding=base64` - ); - data = await res.text(); - - if(!data) throw new Error('Unable to fetch publish') - - const decryptedKey: any = await decryptResource(data); - - const dataint8Array = base64ToUint8Array(decryptedKey.data); - const decryptedKeyToObject = uint8ArrayToObject(dataint8Array); - return decryptedKeyToObject - } catch (error) { - return null - } - }; - - -export const useQortalGetSaveSettings = (myName, isAuthenticated) => { - const setSortablePinnedApps = useSetRecoilState(sortablePinnedAppsAtom); - const setCanSave = useSetRecoilState(canSaveSettingToQdnAtom); - const setSettingsQDNLastUpdated = useSetRecoilState(settingsQDNLastUpdatedAtom); - const [settingsLocalLastUpdated] = useRecoilState(settingsLocalLastUpdatedAtom); - const [isUsingImportExportSettings] = useRecoilState(isUsingImportExportSettingsAtom); - - const [oldPinnedApps, setOldPinnedApps] = useRecoilState(oldPinnedAppsAtom) - - const getSavedSettings = useCallback(async (myName, settingsLocalLastUpdated)=> { - try { - const {hasPublishRecord, timestamp} = await getPublishRecord(myName) - if(hasPublishRecord){ - const settings = await getPublish(myName) - if(settings?.sortablePinnedApps && timestamp > settingsLocalLastUpdated){ - setSortablePinnedApps(settings.sortablePinnedApps) - - setSettingsQDNLastUpdated(timestamp || 0) - } else if(settings?.sortablePinnedApps){ - setSettingsQDNLastUpdated(timestamp || 0) - setOldPinnedApps(settings.sortablePinnedApps) - } - if(!settings){ - // set -100 to indicate that it couldn't fetch the publish - setSettingsQDNLastUpdated(-100) - - } - } else { - setSettingsQDNLastUpdated( 0) - } - setCanSave(true) - } catch (error) { - - } - }, []) - useEffect(()=> { - if(!myName || !settingsLocalLastUpdated || !isAuthenticated || isUsingImportExportSettings === null) return - if(isUsingImportExportSettings) return - getSavedSettings(myName, settingsLocalLastUpdated) - }, [getSavedSettings, myName, settingsLocalLastUpdated, isAuthenticated, isUsingImportExportSettings]) - -} diff --git a/src/useRetrieveDataLocalStorage.tsx b/src/useRetrieveDataLocalStorage.tsx deleted file mode 100644 index fafcd5c..0000000 --- a/src/useRetrieveDataLocalStorage.tsx +++ /dev/null @@ -1,55 +0,0 @@ -import React, { useCallback, useEffect } from 'react' -import { useSetRecoilState } from 'recoil'; -import { isUsingImportExportSettingsAtom, oldPinnedAppsAtom, settingsLocalLastUpdatedAtom, settingsQDNLastUpdatedAtom, sortablePinnedAppsAtom } from './atoms/global'; - -function fetchFromLocalStorage(key) { - try { - const serializedValue = localStorage.getItem(key); - if (serializedValue === null) { - return null; - } - return JSON.parse(serializedValue); - } catch (error) { - console.error('Error fetching from localStorage:', error); - return null; - } -} - -export const useRetrieveDataLocalStorage = (address) => { - const setSortablePinnedApps = useSetRecoilState(sortablePinnedAppsAtom); - const setSettingsLocalLastUpdated = useSetRecoilState(settingsLocalLastUpdatedAtom); - const setIsUsingImportExportSettings = useSetRecoilState(isUsingImportExportSettingsAtom) - const setSettingsQDNLastUpdated = useSetRecoilState(settingsQDNLastUpdatedAtom); - const setOldPinnedApps = useSetRecoilState(oldPinnedAppsAtom) - - const getSortablePinnedApps = useCallback(()=> { - const pinnedAppsLocal = fetchFromLocalStorage('ext_saved_settings') - if(pinnedAppsLocal?.sortablePinnedApps){ - setSortablePinnedApps(pinnedAppsLocal?.sortablePinnedApps) - setSettingsLocalLastUpdated(pinnedAppsLocal?.timestamp || -1) - } else { - setSettingsLocalLastUpdated(-1) - } - - }, []) - const getSortablePinnedAppsImportExport = useCallback(()=> { - const pinnedAppsLocal = fetchFromLocalStorage('ext_saved_settings_import_export') - if(pinnedAppsLocal?.sortablePinnedApps){ - setOldPinnedApps(pinnedAppsLocal?.sortablePinnedApps) - - - setIsUsingImportExportSettings(true) - setSettingsQDNLastUpdated(pinnedAppsLocal?.timestamp || 0) - - } else { - setIsUsingImportExportSettings(false) - } - - }, []) - useEffect(()=> { - - getSortablePinnedApps() - getSortablePinnedAppsImportExport() - }, [getSortablePinnedApps, address]) - -} diff --git a/src/utils/chat.ts b/src/utils/chat.ts new file mode 100644 index 0000000..fed287d --- /dev/null +++ b/src/utils/chat.ts @@ -0,0 +1,26 @@ +export function buildImageEmbedLink(image?: { + name?: string; + identifier?: string; + service?: string; + timestamp?: number; +}): string | null { + if (!image?.name || !image.identifier || !image.service) return null; + + const base = `qortal://use-embed/IMAGE?name=${image.name}&identifier=${image.identifier}&service=${image.service}&mimeType=image%2Fpng×tamp=${image?.timestamp || ''}`; + + const isEncrypted = image.identifier.startsWith('grp-q-manager_0'); + return isEncrypted ? `${base}&encryptionType=group` : base; +} + +export const messageHasImage = (message) => { + return ( + Array.isArray(message?.images) && + message.images[0]?.identifier && + message.images[0]?.name && + message.images[0]?.service + ); +}; + +export function isHtmlString(value) { + return typeof value === 'string' && /<[^>]+>/.test(value.trim()); +} diff --git a/src/utils/chromeStorage.ts b/src/utils/chromeStorage.ts index ebe7578..f2b227c 100644 --- a/src/utils/chromeStorage.ts +++ b/src/utils/chromeStorage.ts @@ -7,22 +7,25 @@ const keysToEncrypt = ['keyPair']; async function initializeKeyAndIV() { if (!inMemoryKey) { - inMemoryKey = await generateKey(); // Generates the key in memory + inMemoryKey = await generateKey(); // Generates the key in memory } } async function generateKey(): Promise { return await crypto.subtle.generateKey( { - name: "AES-GCM", - length: 256 + name: 'AES-GCM', + length: 256, }, true, - ["encrypt", "decrypt"] + ['encrypt', 'decrypt'] ); } -async function encryptData(data: string, key: CryptoKey): Promise<{ iv: Uint8Array; encryptedData: ArrayBuffer }> { +async function encryptData( + data: string, + key: CryptoKey +): Promise<{ iv: Uint8Array; encryptedData: ArrayBuffer }> { const encoder = new TextEncoder(); const encodedData = encoder.encode(data); @@ -31,8 +34,8 @@ async function encryptData(data: string, key: CryptoKey): Promise<{ iv: Uint8Arr const encryptedData = await crypto.subtle.encrypt( { - name: "AES-GCM", - iv: iv + name: 'AES-GCM', + iv: iv, }, key, encodedData @@ -41,11 +44,15 @@ async function encryptData(data: string, key: CryptoKey): Promise<{ iv: Uint8Arr return { iv, encryptedData }; } -async function decryptData(encryptedData: ArrayBuffer, key: CryptoKey, iv: Uint8Array): Promise { +async function decryptData( + encryptedData: ArrayBuffer, + key: CryptoKey, + iv: Uint8Array +): Promise { const decryptedData = await crypto.subtle.decrypt( { - name: "AES-GCM", - iv: iv + name: 'AES-GCM', + iv: iv, }, key, encryptedData @@ -83,7 +90,10 @@ export const storeData = async (key: string, payload: any): Promise => { const { iv, encryptedData } = await encryptData(base64Data, inMemoryKey); // Combine IV and encrypted data into a single Uint8Array - const combinedData = new Uint8Array([...iv, ...new Uint8Array(encryptedData)]); + const combinedData = new Uint8Array([ + ...iv, + ...new Uint8Array(encryptedData), + ]); const encryptedBase64Data = btoa(String.fromCharCode(...combinedData)); await SecureStoragePlugin.set({ key, value: encryptedBase64Data }); } else { @@ -91,10 +101,9 @@ export const storeData = async (key: string, payload: any): Promise => { await SecureStoragePlugin.set({ key, value: base64Data }); } - return "Data saved successfully"; + return 'Data saved successfully'; }; - export const getData = async (key: string): Promise => { await initializeKeyAndIV(); @@ -105,13 +114,17 @@ export const getData = async (key: string): Promise => { if (keysToEncrypt.includes(key) && inMemoryKey) { // Decode the Base64-encoded encrypted data const combinedData = atob(storedDataBase64.value) - .split("") + .split('') .map((c) => c.charCodeAt(0)); const iv = new Uint8Array(combinedData.slice(0, 12)); // First 12 bytes are the IV const encryptedData = new Uint8Array(combinedData.slice(12)).buffer; - const decryptedBase64Data = await decryptData(encryptedData, inMemoryKey, iv); + const decryptedBase64Data = await decryptData( + encryptedData, + inMemoryKey, + iv + ); return base64ToJson(decryptedBase64Data); } else { // Decode non-encrypted data @@ -121,21 +134,21 @@ export const getData = async (key: string): Promise => { return null; } } catch (error) { - return null + return null; } }; - - - - // Remove keys from storage and log out -export async function removeKeysAndLogout(keys: string[], event: MessageEvent, request: any) { +export async function removeKeysAndLogout( + keys: string[], + event: MessageEvent, + request: any +) { try { for (const key of keys) { try { await SecureStoragePlugin.remove({ key }); - await SecureStoragePlugin.remove({ key: `${key}_iv` }); // Remove associated IV + await SecureStoragePlugin.remove({ key: `${key}_iv` }); // Remove associated IV } catch (error) { console.warn(`Key not found: ${key}`); } @@ -144,13 +157,13 @@ export async function removeKeysAndLogout(keys: string[], event: MessageEvent, r event.source.postMessage( { requestId: request.requestId, - action: "logout", + action: 'logout', payload: true, - type: "backgroundMessageResponse", + type: 'backgroundMessageResponse', }, event.origin ); } catch (error) { - console.error("Error removing keys:", error); + console.error('Error removing keys:', error); } } diff --git a/src/utils/decode.ts b/src/utils/decode.ts index 3123810..d457cee 100644 --- a/src/utils/decode.ts +++ b/src/utils/decode.ts @@ -1,16 +1,30 @@ export function decodeIfEncoded(input) { - try { - // Check if input is URI-encoded by encoding and decoding - const encoded = encodeURIComponent(decodeURIComponent(input)); - if (encoded === input) { - // Input is URI-encoded, so decode it - return decodeURIComponent(input); - } - } catch (e) { - // decodeURIComponent throws an error if input is not encoded - console.error("Error decoding URI:", e); + try { + // Check if input is URI-encoded by encoding and decoding + const encoded = encodeURIComponent(decodeURIComponent(input)); + if (encoded === input) { + // Input is URI-encoded, so decode it + return decodeURIComponent(input); } - - // Return input as-is if not URI-encoded - return input; - } \ No newline at end of file + } catch (e) { + // decodeURIComponent throws an error if input is not encoded + console.error('Error decoding URI:', e); + } + + // Return input as-is if not URI-encoded + return input; +} + +export const isValidBase64 = (str: string): boolean => { + if (typeof str !== 'string' || str.length % 4 !== 0) return false; + const base64Regex = /^[A-Za-z0-9+/]*={0,2}$/; + return base64Regex.test(str); +}; + +export const isValidBase64WithDecode = (str: string): boolean => { + try { + return isValidBase64(str) && Boolean(atob(str)); + } catch { + return false; + } +}; diff --git a/src/utils/decryptChatMessage.ts b/src/utils/decryptChatMessage.ts index c50bb45..d58009f 100644 --- a/src/utils/decryptChatMessage.ts +++ b/src/utils/decryptChatMessage.ts @@ -1,38 +1,59 @@ // @ts-nocheck -import Base58 from '../deps/Base58' -import ed2curve from '../deps/ed2curve' -import nacl from '../deps/nacl-fast' -import {Sha256} from 'asmcrypto.js' +import Base58 from '../encryption/Base58'; +import ed2curve from '../encryption/ed2curve'; +import nacl from '../encryption/nacl-fast'; +import { Sha256 } from 'asmcrypto.js'; +export const decryptChatMessage = ( + encryptedMessage, + privateKey, + recipientPublicKey, + lastReference +) => { + const test = encryptedMessage; + let _encryptedMessage = atob(encryptedMessage); + const binaryLength = _encryptedMessage.length; + const bytes = new Uint8Array(binaryLength); -export const decryptChatMessage = (encryptedMessage, privateKey, recipientPublicKey, lastReference) => { - const test = encryptedMessage - let _encryptedMessage = atob(encryptedMessage) - const binaryLength = _encryptedMessage.length - const bytes = new Uint8Array(binaryLength) + for (let i = 0; i < binaryLength; i++) { + bytes[i] = _encryptedMessage.charCodeAt(i); + } - for (let i = 0; i < binaryLength; i++) { - bytes[i] = _encryptedMessage.charCodeAt(i) - } + const _base58RecipientPublicKey = + recipientPublicKey instanceof Uint8Array + ? Base58.encode(recipientPublicKey) + : recipientPublicKey; + const _recipientPublicKey = Base58.decode(_base58RecipientPublicKey); - - const _base58RecipientPublicKey = recipientPublicKey instanceof Uint8Array ? Base58.encode(recipientPublicKey) : recipientPublicKey - const _recipientPublicKey = Base58.decode(_base58RecipientPublicKey) + const _lastReference = + lastReference instanceof Uint8Array + ? lastReference + : Base58.decode(lastReference); - const _lastReference = lastReference instanceof Uint8Array ? lastReference : Base58.decode(lastReference) + const convertedPrivateKey = ed2curve.convertSecretKey(privateKey); + const convertedPublicKey = ed2curve.convertPublicKey(_recipientPublicKey); + const sharedSecret = new Uint8Array(32); + nacl.lowlevel.crypto_scalarmult( + sharedSecret, + convertedPrivateKey, + convertedPublicKey + ); - const convertedPrivateKey = ed2curve.convertSecretKey(privateKey) - const convertedPublicKey = ed2curve.convertPublicKey(_recipientPublicKey) - const sharedSecret = new Uint8Array(32); - nacl.lowlevel.crypto_scalarmult(sharedSecret, convertedPrivateKey, convertedPublicKey) + const _chatEncryptionSeed = new Sha256() + .process(sharedSecret) + .finish().result; + const _decryptedMessage = nacl.secretbox.open( + bytes, + _lastReference.slice(0, 24), + _chatEncryptionSeed + ); - const _chatEncryptionSeed = new Sha256().process(sharedSecret).finish().result - const _decryptedMessage = nacl.secretbox.open(bytes, _lastReference.slice(0, 24), _chatEncryptionSeed) + let decryptedMessage = ''; - let decryptedMessage = '' + _decryptedMessage === false + ? decryptedMessage + : (decryptedMessage = new TextDecoder('utf-8').decode(_decryptedMessage)); - _decryptedMessage === false ? decryptedMessage : decryptedMessage = new TextDecoder('utf-8').decode(_decryptedMessage) - - return decryptedMessage -} \ No newline at end of file + return decryptedMessage; +}; diff --git a/src/utils/decryptWallet.ts b/src/utils/decryptWallet.ts index b091639..44b4aa9 100644 --- a/src/utils/decryptWallet.ts +++ b/src/utils/decryptWallet.ts @@ -1,33 +1,39 @@ // @ts-nocheck -import { crypto } from '../constants/decryptWallet' -import Base58 from '../deps/Base58' -import {AES_CBC, HmacSha512} from 'asmcrypto.js' -import { doInitWorkers, kdf } from '../deps/kdf' - +import { crypto } from '../constants/decryptWallet'; +import Base58 from '../encryption/Base58'; +import { AES_CBC, HmacSha512 } from 'asmcrypto.js'; +import { doInitWorkers, kdf } from '../encryption/kdf'; +import i18n from 'i18next'; export const decryptStoredWallet = async (password, wallet) => { - const threads = doInitWorkers(crypto.kdfThreads) - const encryptedSeedBytes = Base58.decode(wallet.encryptedSeed) - const iv = Base58.decode(wallet.iv) - const salt = Base58.decode(wallet.salt) - - const key = await kdf(password, salt, threads) - const encryptionKey = key.slice(0, 32) - const macKey = key.slice(32, 63) - const mac = new HmacSha512(macKey).process(encryptedSeedBytes).finish().result - if (Base58.encode(mac) !== wallet.mac) { - throw new Error("Incorrect password") - } - const decryptedBytes = AES_CBC.decrypt(encryptedSeedBytes, encryptionKey, false, iv) - return decryptedBytes -} + const threads = doInitWorkers(crypto.kdfThreads); + const encryptedSeedBytes = Base58.decode(wallet.encryptedSeed); + const iv = Base58.decode(wallet.iv); + const salt = Base58.decode(wallet.salt); + + const key = await kdf(password, salt, threads); + const encryptionKey = key.slice(0, 32); + const macKey = key.slice(32, 63); + const mac = new HmacSha512(macKey) + .process(encryptedSeedBytes) + .finish().result; + if (Base58.encode(mac) !== wallet.mac) { + throw new Error(i18n.t('auth:message.error.incorrect_password')); + } + const decryptedBytes = AES_CBC.decrypt( + encryptedSeedBytes, + encryptionKey, + false, + iv + ); + return decryptedBytes; +}; export const decryptStoredWalletFromSeedPhrase = async (password) => { - const threads = doInitWorkers(crypto.kdfThreads) - const salt = new Uint8Array(void 0) + const threads = doInitWorkers(crypto.kdfThreads); + const salt = new Uint8Array(void 0); - - const seed = await kdf(password, salt, threads) - return seed -} \ No newline at end of file + const seed = await kdf(password, salt, threads); + return seed; +}; diff --git a/src/utils/events.ts b/src/utils/events.ts index 94d1c31..5145a93 100644 --- a/src/utils/events.ts +++ b/src/utils/events.ts @@ -1,11 +1,12 @@ -export const executeEvent = (eventName: string, data: any)=> { - const event = new CustomEvent(eventName, {detail: data}) - document.dispatchEvent(event) -} -export const subscribeToEvent = (eventName: string, listener: any)=> { - document.addEventListener(eventName, listener) -} +export const executeEvent = (eventName: string, data: any) => { + const event = new CustomEvent(eventName, { detail: data }); + document.dispatchEvent(event); +}; -export const unsubscribeFromEvent = (eventName: string, listener: any)=> { - document.removeEventListener(eventName, listener) -} \ No newline at end of file +export const subscribeToEvent = (eventName: string, listener: any) => { + document.addEventListener(eventName, listener); +}; + +export const unsubscribeFromEvent = (eventName: string, listener: any) => { + document.removeEventListener(eventName, listener); +}; diff --git a/src/utils/fileReading/index.ts b/src/utils/fileReading/index.ts index a6295c8..a04435c 100644 --- a/src/utils/fileReading/index.ts +++ b/src/utils/fileReading/index.ts @@ -1,63 +1,93 @@ // @ts-nocheck class Semaphore { - constructor(count) { - this.count = count - this.waiting = [] - } - acquire() { - return new Promise(resolve => { - if (this.count > 0) { - this.count-- - resolve() - } else { - this.waiting.push(resolve) - } - }) - } - release() { - if (this.waiting.length > 0) { - const resolve = this.waiting.shift() - resolve() - } else { - this.count++ - } - } + constructor(count) { + this.count = count; + this.waiting = []; + } + acquire() { + return new Promise((resolve) => { + if (this.count > 0) { + this.count--; + resolve(); + } else { + this.waiting.push(resolve); + } + }); + } + release() { + if (this.waiting.length > 0) { + const resolve = this.waiting.shift(); + resolve(); + } else { + this.count++; + } + } } -let semaphore = new Semaphore(1) -let reader = new FileReader() +let semaphore = new Semaphore(1); +let reader = new FileReader(); -export const fileToBase64 = (file) => new Promise(async (resolve, reject) => { - const reader = new FileReader(); // Create a new instance - await semaphore.acquire(); - reader.readAsDataURL(file); - reader.onload = () => { - const dataUrl = reader.result; - semaphore.release(); - if (typeof dataUrl === 'string') { - resolve(dataUrl.split(',')[1]); - } else { - reject(new Error('Invalid data URL')); - } - reader.onload = null; // Clear the handler - reader.onerror = null; // Clear the handle - }; - reader.onerror = (error) => { - semaphore.release(); - reject(error); - reader.onload = null; // Clear the handler - reader.onerror = null; // Clear the handle - }; +export const fileToBase64 = (file) => + new Promise(async (resolve, reject) => { + const reader = new FileReader(); // Create a new instance + await semaphore.acquire(); + reader.readAsDataURL(file); + reader.onload = () => { + const dataUrl = reader.result; + semaphore.release(); + if (typeof dataUrl === 'string') { + resolve(dataUrl.split(',')[1]); + } else { + reject(new Error('Invalid data URL')); + } + reader.onload = null; // Clear the handler + reader.onerror = null; // Clear the handle + }; + reader.onerror = (error) => { + semaphore.release(); + reject(error); + reader.onload = null; // Clear the handler + reader.onerror = null; // Clear the handle + }; }); - -export const base64ToBlobUrl = (base64, mimeType = "image/png") => { - const binary = atob(base64); - const array = []; - for (let i = 0; i < binary.length; i++) { - array.push(binary.charCodeAt(i)); - } - const blob = new Blob([new Uint8Array(array)], { type: mimeType }); - return URL.createObjectURL(blob); - }; \ No newline at end of file +export const base64ToBlobUrl = (base64, mimeType = 'image/png') => { + const binary = atob(base64); + const array = []; + for (let i = 0; i < binary.length; i++) { + array.push(binary.charCodeAt(i)); + } + const blob = new Blob([new Uint8Array(array)], { type: mimeType }); + return URL.createObjectURL(blob); +}; + +export const handleImportClick = async (fileTypes) => { + const fileInput = document.createElement('input'); + fileInput.type = 'file'; + fileInput.accept = fileTypes; + + // Create a promise to handle file selection and reading synchronously + return await new Promise((resolve, reject) => { + fileInput.onchange = () => { + const file = fileInput.files[0]; + if (!file) { + reject(new Error('No file selected')); + return; + } + + const reader = new FileReader(); + reader.onload = (e) => { + resolve(e.target.result); // Resolve with the file content + }; + reader.onerror = () => { + reject(new Error('Error reading file')); + }; + + reader.readAsText(file); // Read the file as text (Base64 string) + }; + + // Trigger the file input dialog + fileInput.click(); + }); +}; diff --git a/src/utils/generateWallet/generateWallet.ts b/src/utils/generateWallet/generateWallet.ts index f05c707..977f903 100644 --- a/src/utils/generateWallet/generateWallet.ts +++ b/src/utils/generateWallet/generateWallet.ts @@ -1,123 +1,127 @@ // @ts-nocheck import { crypto, walletVersion } from '../../constants/decryptWallet'; -import { doInitWorkers, kdf } from '../../deps/kdf'; +import { doInitWorkers, kdf } from '../../encryption/kdf'; import PhraseWallet from './phrase-wallet'; import * as WORDLISTS from './wordlists'; import FileSaver from 'file-saver'; - import { Filesystem, Directory, Encoding } from '@capacitor/filesystem'; import { mimeToExtensionMap } from '../memeTypes'; -export function generateRandomSentence(template = 'adverb verb noun adjective noun adverb verb noun adjective noun adjective verbed adjective noun', maxWordLength = 0, capitalize = true) { - const partsOfSpeechMap = { - 'noun': 'nouns', - 'adverb': 'adverbs', - 'adv': 'adverbs', - 'verb': 'verbs', - 'interjection': 'interjections', - 'adjective': 'adjectives', - 'adj': 'adjectives', - 'verbed': 'verbed' - }; - let _wordlists = WORDLISTS; - - function _RNG(entropy) { - if (entropy > 1074) { - throw new Error('Javascript can not handle that much entropy!'); - } - let randNum = 0; - const crypto = window.crypto || window.msCrypto; - - if (crypto) { - const entropy256 = Math.ceil(entropy / 8); - let buffer = new Uint8Array(entropy256); - crypto.getRandomValues(buffer); - randNum = buffer.reduce((num, value) => num * 256 + value, 0) / Math.pow(256, entropy256); - } else { - console.warn('Secure RNG not found. Using Math.random'); - randNum = Math.random(); - } - return randNum; - } - - function _capitalize(str) { - return str.charAt(0).toUpperCase() + str.slice(1); - } - - function getWord(partOfSpeech) { - let words = _wordlists[partsOfSpeechMap[partOfSpeech]]; - if (maxWordLength) { - words = words.filter(word => word.length <= maxWordLength); - } - const requiredEntropy = Math.log(words.length) / Math.log(2); - const index = Math.floor(_RNG(requiredEntropy) * words.length); - return words[index]; - } - - function parse(template) { - return template.split(/\s+/).map(token => { - const match = token.match(/^(\w+)(.*)$/); - if (!match) return token; // No match, return original token - - const [ , partOfSpeech, rest ] = match; - if (partsOfSpeechMap[partOfSpeech]) { - let word = getWord(partOfSpeech); - if (capitalize && token === token[0].toUpperCase() + token.slice(1).toLowerCase()) { - word = _capitalize(word); - } - return word + rest; - } - - return token; - }).join(' '); - } - - return parse(template); -} - -export const createAccount = async(generatedSeedPhrase)=> { - if(!generatedSeedPhrase) throw new Error('No generated seed-phrase') - const threads = doInitWorkers(crypto.kdfThreads) - - const seed = await kdf(generatedSeedPhrase, void 0, threads) - const wallet = new PhraseWallet(seed, walletVersion) - return wallet - - } - - const hasExtension = (filename) => { - return filename.includes(".") && filename.split(".").pop().length > 0; +export function generateRandomSentence( + template = 'adverb verb noun adjective noun adverb verb noun adjective noun adjective verbed adjective noun', + maxWordLength = 0, + capitalize = true +) { + const partsOfSpeechMap = { + noun: 'nouns', + adverb: 'adverbs', + adv: 'adverbs', + verb: 'verbs', + interjection: 'interjections', + adjective: 'adjectives', + adj: 'adjectives', + verbed: 'verbed', }; - export const saveFileToDisk = async (data, qortAddress) => { - - const dataString = JSON.stringify(data); - const blob = new Blob([dataString], { type: 'application/json' }); - const fileName = "qortal_backup_" + qortAddress + ".json"; + let _wordlists = WORDLISTS; - await FileSaver.saveAs(blob, fileName); - + function _RNG(entropy) { + if (entropy > 1074) { + throw new Error('Javascript can not handle that much entropy!'); + } + let randNum = 0; + const crypto = window.crypto || window.msCrypto; + + if (crypto) { + const entropy256 = Math.ceil(entropy / 8); + let buffer = new Uint8Array(entropy256); + crypto.getRandomValues(buffer); + randNum = + buffer.reduce((num, value) => num * 256 + value, 0) / + Math.pow(256, entropy256); + } else { + console.warn('Secure RNG not found. Using Math.random'); + randNum = Math.random(); + } + return randNum; + } + + function _capitalize(str) { + return str.charAt(0).toUpperCase() + str.slice(1); + } + + function getWord(partOfSpeech) { + let words = _wordlists[partsOfSpeechMap[partOfSpeech]]; + if (maxWordLength) { + words = words.filter((word) => word.length <= maxWordLength); + } + const requiredEntropy = Math.log(words.length) / Math.log(2); + const index = Math.floor(_RNG(requiredEntropy) * words.length); + return words[index]; + } + + function parse(template) { + return template + .split(/\s+/) + .map((token) => { + const match = token.match(/^(\w+)(.*)$/); + if (!match) return token; // No match, return original token + + const [, partOfSpeech, rest] = match; + if (partsOfSpeechMap[partOfSpeech]) { + let word = getWord(partOfSpeech); + if ( + capitalize && + token === token[0].toUpperCase() + token.slice(1).toLowerCase() + ) { + word = _capitalize(word); + } + return word + rest; + } + + return token; + }) + .join(' '); + } + + return parse(template); } +export const createAccount = async (generatedSeedPhrase) => { + if (!generatedSeedPhrase) throw new Error('No generated seed-phrase'); + const threads = doInitWorkers(crypto.kdfThreads); + + const seed = await kdf(generatedSeedPhrase, void 0, threads); + const wallet = new PhraseWallet(seed, walletVersion); + return wallet; +}; + +const hasExtension = (filename) => { + return filename.includes('.') && filename.split('.').pop().length > 0; +}; + +export const saveFileToDisk = async (data, qortAddress) => { + const dataString = JSON.stringify(data); + const blob = new Blob([dataString], { type: 'application/json' }); + const fileName = 'qortal_backup_' + qortAddress + '.json'; + + await FileSaver.saveAs(blob, fileName); +}; + export const saveFileToDiskGeneric = async (blob, filename) => { - const timestamp = new Date() - .toISOString() - .replace(/:/g, "-"); // Safe timestamp for filenames - - const fileExtension = mimeToExtensionMap[blob.type] -let fileName = filename || "qortal_file_" + timestamp + "." + fileExtension; -fileName = hasExtension(fileName) ? fileName : fileName + "." + fileExtension; + const timestamp = new Date().toISOString().replace(/:/g, '-'); // Safe timestamp for filenames -await FileSaver.saveAs(blob, fileName); + const fileExtension = mimeToExtensionMap[blob.type]; + let fileName = filename || 'qortal_file_' + timestamp + '.' + fileExtension; + fileName = hasExtension(fileName) ? fileName : fileName + '.' + fileExtension; -} + await FileSaver.saveAs(blob, fileName); +}; export const saveSeedPhraseToDisk = async (data) => { - - const blob = new Blob([data], { type: 'text/plain;charset=utf-8' }) - const fileName = "qortal_seedphrase.txt" + const blob = new Blob([data], { type: 'text/plain;charset=utf-8' }); + const fileName = 'qortal_seedphrase.txt'; -await FileSaver.saveAs(blob, fileName); - -} \ No newline at end of file + await FileSaver.saveAs(blob, fileName); +}; diff --git a/src/utils/generateWallet/phrase-wallet.ts b/src/utils/generateWallet/phrase-wallet.ts index 0f21cba..3cd9ed1 100644 --- a/src/utils/generateWallet/phrase-wallet.ts +++ b/src/utils/generateWallet/phrase-wallet.ts @@ -3,208 +3,206 @@ Copyright 2017-2018 @ irontiga and vbcs (original developer) */ -import Base58 from '../../deps/Base58' -import {Sha256, Sha512} from 'asmcrypto.js' -import nacl from '../../deps/nacl-fast' -import utils from '../../utils/utils' +import Base58 from '../../encryption/Base58.js'; +import { Sha256, Sha512 } from 'asmcrypto.js'; +import nacl from '../../encryption/nacl-fast.js'; +import utils from '../../utils/utils'; -import {generateSaveWalletData} from './storeWallet.js' +import { generateSaveWalletData } from './storeWallet.js'; -import publicKeyToAddress from './publicKeyToAddress' -import AltcoinHDWallet from "../../deps/AltcoinHDWallet" +import publicKeyToAddress from './publicKeyToAddress'; +import AltcoinHDWallet from '../../encryption/AltcoinHDWallet.js'; export default class PhraseWallet { - constructor(seed, walletVersion) { + constructor(seed, walletVersion) { + this._walletVersion = walletVersion || 2; + this.seed = seed; - this._walletVersion = walletVersion || 2 - this.seed = seed + this.savedSeedData = {}; + this.hasBeenSaved = false; + } - this.savedSeedData = {} - this.hasBeenSaved = false - } + set seed(seed) { + this._byteSeed = seed; + this._base58Seed = Base58.encode(seed); - set seed(seed) { - this._byteSeed = seed - this._base58Seed = Base58.encode(seed) + this._addresses = []; - this._addresses = [] + this.genAddress(0); + } - this.genAddress(0) - } + getAddress(nonce) { + return this._addresses[nonce]; + } - getAddress(nonce) { - return this._addresses[nonce] - } + get addresses() { + return this._addresses; + } - get addresses() { - return this._addresses - } + get addressIDs() { + return this._addresses.map((addr) => { + return addr.address; + }); + } - get addressIDs() { - return this._addresses.map(addr => { - return addr.address - }) - } + get seed() { + return this._byteSeed; + } - get seed() { - return this._byteSeed - } + addressExists(nonce) { + return this._addresses[nonce] != undefined; + } - addressExists(nonce) { - return this._addresses[nonce] != undefined - } + _genAddressSeed(seed) { + let newSeed = new Sha512().process(seed).finish().result; + newSeed = new Sha512() + .process(utils.appendBuffer(newSeed, seed)) + .finish().result; + return newSeed; + } - _genAddressSeed(seed) { - let newSeed = new Sha512().process(seed).finish().result - newSeed = new Sha512().process(utils.appendBuffer(newSeed, seed)).finish().result - return newSeed - } + genAddress(nonce) { + if (nonce >= this._addresses.length) { + this._addresses.length = nonce + 1; + } - genAddress(nonce) { - if (nonce >= this._addresses.length) { - this._addresses.length = nonce + 1 - } + if (this.addressExists(nonce)) { + return this.addresses[nonce]; + } - if (this.addressExists(nonce)) { - return this.addresses[nonce] - } + const nonceBytes = utils.int32ToBytes(nonce); - const nonceBytes = utils.int32ToBytes(nonce) + let addrSeed = new Uint8Array(); + addrSeed = utils.appendBuffer(addrSeed, nonceBytes); + addrSeed = utils.appendBuffer(addrSeed, this._byteSeed); + addrSeed = utils.appendBuffer(addrSeed, nonceBytes); - let addrSeed = new Uint8Array() - addrSeed = utils.appendBuffer(addrSeed, nonceBytes) - addrSeed = utils.appendBuffer(addrSeed, this._byteSeed) - addrSeed = utils.appendBuffer(addrSeed, nonceBytes) + if (this._walletVersion == 1) { + addrSeed = new Sha256() + .process(new Sha256().process(addrSeed).finish().result) + .finish().result; - if (this._walletVersion == 1) { - addrSeed = new Sha256().process( - new Sha256() - .process(addrSeed) - .finish() - .result - ).finish().result + addrSeed = this._byteSeed; + } else { + addrSeed = this._genAddressSeed(addrSeed).slice(0, 32); + } - addrSeed = this._byteSeed - } else { - addrSeed = this._genAddressSeed(addrSeed).slice(0, 32) - } + const addrKeyPair = nacl.sign.keyPair.fromSeed(new Uint8Array(addrSeed)); - const addrKeyPair = nacl.sign.keyPair.fromSeed(new Uint8Array(addrSeed)); + const address = publicKeyToAddress(addrKeyPair.publicKey); + const qoraAddress = publicKeyToAddress(addrKeyPair.publicKey, true); - const address = publicKeyToAddress(addrKeyPair.publicKey); - const qoraAddress = publicKeyToAddress(addrKeyPair.publicKey, true); + // Create Bitcoin HD Wallet + const btcSeed = [...addrSeed]; + const btcWallet = new AltcoinHDWallet({ + mainnet: { + private: 0x0488ade4, + public: 0x0488b21e, + prefix: 0, + }, + testnet: { + private: 0x04358394, + public: 0x043587cf, + prefix: 0x6f, + }, + }).createWallet(new Uint8Array(btcSeed), false); - // Create Bitcoin HD Wallet - const btcSeed = [...addrSeed]; - const btcWallet = new AltcoinHDWallet({ - mainnet: { - private: 0x0488ADE4, - public: 0x0488B21E, - prefix: 0 - }, - testnet: { - private: 0x04358394, - public: 0x043587CF, - prefix: 0x6F - } - }).createWallet(new Uint8Array(btcSeed), false); + // Create Litecoin HD Wallet + const ltcSeed = [...addrSeed]; + const ltcWallet = new AltcoinHDWallet({ + mainnet: { + private: 0x0488ade4, + public: 0x0488b21e, + prefix: 0x30, + }, + testnet: { + private: 0x04358394, + public: 0x043587cf, + prefix: 0x6f, + }, + }).createWallet(new Uint8Array(ltcSeed), false, 'LTC'); - // Create Litecoin HD Wallet - const ltcSeed = [...addrSeed]; - const ltcWallet = new AltcoinHDWallet({ - mainnet: { - private: 0x0488ADE4, - public: 0x0488B21E, - prefix: 0x30 - }, - testnet: { - private: 0x04358394, - public: 0x043587CF, - prefix: 0x6F - } - }).createWallet(new Uint8Array(ltcSeed), false, 'LTC'); + // Create Dogecoin HD Wallet + const dogeSeed = [...addrSeed]; + const dogeWallet = new AltcoinHDWallet({ + mainnet: { + private: 0x02fac398, + public: 0x02facafd, + prefix: 0x1e, + }, + testnet: { + private: 0x04358394, + public: 0x043587cf, + prefix: 0x71, + }, + }).createWallet(new Uint8Array(dogeSeed), false, 'DOGE'); - // Create Dogecoin HD Wallet - const dogeSeed = [...addrSeed]; - const dogeWallet = new AltcoinHDWallet({ - mainnet: { - private: 0x02FAC398, - public: 0x02FACAFD, - prefix: 0x1E - }, - testnet: { - private: 0x04358394, - public: 0x043587CF, - prefix: 0x71 - } - }).createWallet(new Uint8Array(dogeSeed), false, 'DOGE'); + // Create Digibyte HD Wallet + const dgbSeed = [...addrSeed]; + const dgbWallet = new AltcoinHDWallet({ + mainnet: { + private: 0x0488ade4, + public: 0x0488b21e, + prefix: 0x1e, + }, + testnet: { + private: 0x04358394, + public: 0x043587cf, + prefix: 0x7e, + }, + }).createWallet(new Uint8Array(dgbSeed), false, 'DGB'); - // Create Digibyte HD Wallet - const dgbSeed = [...addrSeed]; - const dgbWallet = new AltcoinHDWallet({ - mainnet: { - private: 0x0488ADE4, - public: 0x0488B21E, - prefix: 0x1E - }, - testnet: { - private: 0x04358394, - public: 0x043587CF, - prefix: 0x7E - } - }).createWallet(new Uint8Array(dgbSeed), false, 'DGB'); + // Create Ravencoin HD Wallet + const rvnSeed = [...addrSeed]; + const rvnWallet = new AltcoinHDWallet({ + mainnet: { + private: 0x0488ade4, + public: 0x0488b21e, + prefix: 0x3c, + }, + testnet: { + private: 0x04358394, + public: 0x043587cf, + prefix: 0x6f, + }, + }).createWallet(new Uint8Array(rvnSeed), false, 'RVN'); - // Create Ravencoin HD Wallet - const rvnSeed = [...addrSeed]; - const rvnWallet = new AltcoinHDWallet({ - mainnet: { - private: 0x0488ADE4, - public: 0x0488B21E, - prefix: 0x3C - }, - testnet: { - private: 0x04358394, - public: 0x043587CF, - prefix: 0x6F - } - }).createWallet(new Uint8Array(rvnSeed), false, 'RVN'); + // Create Pirate Chain HD Wallet + const arrrSeed = [...addrSeed]; + const arrrWallet = new AltcoinHDWallet({ + mainnet: { + private: 0x0488ade4, + public: 0x0488b21e, + prefix: [0x16, 0x9a], + }, + testnet: { + private: 0x04358394, + public: 0x043587cf, + prefix: [0x14, 0x51], + }, + }).createWallet(new Uint8Array(arrrSeed), false, 'ARRR'); - // Create Pirate Chain HD Wallet - const arrrSeed = [...addrSeed]; - const arrrWallet = new AltcoinHDWallet({ - mainnet: { - private: 0x0488ADE4, - public: 0x0488B21E, - prefix: [0x16, 0x9A] - }, - testnet: { - private: 0x04358394, - public: 0x043587CF, - prefix: [0x14, 0x51] - } - }).createWallet(new Uint8Array(arrrSeed), false, 'ARRR'); + this._addresses[nonce] = { + address, + btcWallet, + ltcWallet, + dogeWallet, + dgbWallet, + rvnWallet, + arrrWallet, + qoraAddress, + keyPair: { + publicKey: addrKeyPair.publicKey, + privateKey: addrKeyPair.secretKey, + }, + base58PublicKey: Base58.encode(addrKeyPair.publicKey), + seed: addrSeed, + nonce: nonce, + }; + return this._addresses[nonce]; + } - this._addresses[nonce] = { - address, - btcWallet, - ltcWallet, - dogeWallet, - dgbWallet, - rvnWallet, - arrrWallet, - qoraAddress, - keyPair: { - publicKey: addrKeyPair.publicKey, - privateKey: addrKeyPair.secretKey - }, - base58PublicKey: Base58.encode(addrKeyPair.publicKey), - seed: addrSeed, - nonce: nonce - } - return this._addresses[nonce] - } - - generateSaveWalletData(...args) { - return generateSaveWalletData(this, ...args) - } + generateSaveWalletData(...args) { + return generateSaveWalletData(this, ...args); + } } diff --git a/src/utils/generateWallet/publicKeyToAddress.ts b/src/utils/generateWallet/publicKeyToAddress.ts index b2efad6..dba25a1 100644 --- a/src/utils/generateWallet/publicKeyToAddress.ts +++ b/src/utils/generateWallet/publicKeyToAddress.ts @@ -1,36 +1,38 @@ // @ts-nocheck -import Base58 from '../../deps/Base58' -import BROKEN_RIPEMD160 from '../../deps/broken-ripemd160' -import RIPEMD160 from '../../deps/ripemd160' -import utils from '../../utils/utils' -import {Buffer} from 'buffer' -import {Sha256} from 'asmcrypto.js' -import { ADDRESS_VERSION } from '../../constants/general.js' +import Base58 from '../../encryption/Base58.js'; +import BROKEN_RIPEMD160 from '../../encryption/broken-ripemd160.js'; +import RIPEMD160 from '../../encryption/ripemd160.js'; +import utils from '../../utils/utils'; +import { Buffer } from 'buffer'; +import { Sha256 } from 'asmcrypto.js'; +import { ADDRESS_VERSION } from '../../constants/constants.js'; const repeatSHA256 = (passphrase, hashes) => { - let hash = passphrase - for (let i = 0; i < hashes; i++) { - hash = new Sha256().process(hash).finish().result - } - return hash -} + let hash = passphrase; + for (let i = 0; i < hashes; i++) { + hash = new Sha256().process(hash).finish().result; + } + return hash; +}; const publicKeyToAddress = (publicKey, qora = false) => { - const publicKeySha256 = new Sha256().process(publicKey).finish().result - const _publicKeyHash = qora ? new BROKEN_RIPEMD160().digest(publicKeySha256) : new RIPEMD160().update(Buffer.from(publicKeySha256)).digest('hex') - const publicKeyHash = qora ? _publicKeyHash : _publicKeyHash + const publicKeySha256 = new Sha256().process(publicKey).finish().result; + const _publicKeyHash = qora + ? new BROKEN_RIPEMD160().digest(publicKeySha256) + : new RIPEMD160().update(Buffer.from(publicKeySha256)).digest('hex'); + const publicKeyHash = qora ? _publicKeyHash : _publicKeyHash; - let address = new Uint8Array() + let address = new Uint8Array(); - address = utils.appendBuffer(address, [ADDRESS_VERSION]) - address = utils.appendBuffer(address, publicKeyHash) + address = utils.appendBuffer(address, [ADDRESS_VERSION]); + address = utils.appendBuffer(address, publicKeyHash); - const checkSum = repeatSHA256(address, 2) - address = utils.appendBuffer(address, checkSum.subarray(0, 4)) + const checkSum = repeatSHA256(address, 2); + address = utils.appendBuffer(address, checkSum.subarray(0, 4)); - address = Base58.encode(address) + address = Base58.encode(address); - return address -} + return address; +}; -export default publicKeyToAddress +export default publicKeyToAddress; diff --git a/src/utils/generateWallet/storeWallet.ts b/src/utils/generateWallet/storeWallet.ts index 83222ae..c90b549 100644 --- a/src/utils/generateWallet/storeWallet.ts +++ b/src/utils/generateWallet/storeWallet.ts @@ -1,31 +1,37 @@ // @ts-nocheck -import {AES_CBC, HmacSha512} from 'asmcrypto.js' +import { AES_CBC, HmacSha512 } from 'asmcrypto.js'; +import Base58 from '../../encryption/Base58.js'; +import { doInitWorkers, kdf } from '../../encryption/kdf.js'; +import { crypto as cryptoVals } from '../../constants/decryptWallet.js'; -import Base58 from '../../deps/Base58' -import { doInitWorkers, kdf } from '../../deps/kdf.js' -import { crypto as cryptoVals } from '../../constants/decryptWallet.js' - -const getRandomValues = crypto ? crypto.getRandomValues.bind(crypto) : msCrypto.getRandomValues.bind(msCrypto) +const getRandomValues = crypto + ? crypto.getRandomValues.bind(crypto) + : msCrypto.getRandomValues.bind(msCrypto); export const generateSaveWalletData = async (wallet, password, kdfThreads) => { - const threads = doInitWorkers(cryptoVals.kdfThreads) + const threads = doInitWorkers(cryptoVals.kdfThreads); - let iv = new Uint8Array(16) - getRandomValues(iv) - let salt = new Uint8Array(32) - getRandomValues(salt) - const key = await kdf(password, salt, threads) - const encryptionKey = key.slice(0, 32) - const macKey = key.slice(32, 63) - const encryptedSeed = AES_CBC.encrypt(wallet._byteSeed, encryptionKey, false, iv) - const mac = new HmacSha512(macKey).process(encryptedSeed).finish().result - return { - address0: wallet._addresses[0].address, - encryptedSeed: Base58.encode(encryptedSeed), - salt: Base58.encode(salt), - iv: Base58.encode(iv), - version: wallet._walletVersion, - mac: Base58.encode(mac), - kdfThreads - } -} + let iv = new Uint8Array(16); + getRandomValues(iv); + let salt = new Uint8Array(32); + getRandomValues(salt); + const key = await kdf(password, salt, threads); + const encryptionKey = key.slice(0, 32); + const macKey = key.slice(32, 63); + const encryptedSeed = AES_CBC.encrypt( + wallet._byteSeed, + encryptionKey, + false, + iv + ); + const mac = new HmacSha512(macKey).process(encryptedSeed).finish().result; + return { + address0: wallet._addresses[0].address, + encryptedSeed: Base58.encode(encryptedSeed), + salt: Base58.encode(salt), + iv: Base58.encode(iv), + version: wallet._walletVersion, + mac: Base58.encode(mac), + kdfThreads, + }; +}; diff --git a/src/utils/generateWallet/verb-past-tense.ts b/src/utils/generateWallet/verb-past-tense.ts index 2e9da0c..b3b12b3 100644 --- a/src/utils/generateWallet/verb-past-tense.ts +++ b/src/utils/generateWallet/verb-past-tense.ts @@ -2,36 +2,36 @@ // @ts-nocheck export const EXCEPTIONS = { - 'are': 'were', - 'eat': 'ate', - 'go': 'went', - 'have': 'had', - 'inherit': 'inherited', - 'is': 'was', - 'run': 'ran', - 'sit': 'sat', - 'visit': 'visited' -} + are: 'were', + eat: 'ate', + go: 'went', + have: 'had', + inherit: 'inherited', + is: 'was', + run: 'ran', + sit: 'sat', + visit: 'visited', +}; export const getPastTense = (verb, exceptions = EXCEPTIONS) => { - if (exceptions[verb]) { - return exceptions[verb] - } - if ((/e$/i).test(verb)) { - return verb + 'd' - } - if ((/[aeiou]c$/i).test(verb)) { - return verb + 'ked' - } - // for american english only - if ((/el$/i).test(verb)) { - return verb + 'ed' - } - if ((/[aeio][aeiou][dlmnprst]$/).test(verb)) { - return verb + 'ed' - } - if ((/[aeiou][bdglmnprst]$/i).test(verb)) { - return verb.replace(/(.+[aeiou])([bdglmnprst])/, '$1$2$2ed') - } - return verb + 'ed' -} + if (exceptions[verb]) { + return exceptions[verb]; + } + if (/e$/i.test(verb)) { + return verb + 'd'; + } + if (/[aeiou]c$/i.test(verb)) { + return verb + 'ked'; + } + // for american english only + if (/el$/i.test(verb)) { + return verb + 'ed'; + } + if (/[aeio][aeiou][dlmnprst]$/.test(verb)) { + return verb + 'ed'; + } + if (/[aeiou][bdglmnprst]$/i.test(verb)) { + return verb.replace(/(.+[aeiou])([bdglmnprst])/, '$1$2$2ed'); + } + return verb + 'ed'; +}; diff --git a/src/utils/helpers.ts b/src/utils/helpers.ts index ff7997c..a60a523 100644 --- a/src/utils/helpers.ts +++ b/src/utils/helpers.ts @@ -1,34 +1,28 @@ -import moment from "moment"; - -export const delay = (time: number) => new Promise((_, reject) => +export const delay = (time: number) => + new Promise((_, reject) => setTimeout(() => reject(new Error('Request timed out')), time) -); - -// const originalHtml = `

---------- Forwarded message ---------

From: Alex

Date: Mon, Jun 9 2014 9:32 PM

Subject: Batteries

To: Jessica



`; - - -// export function updateMessageDetails(newFrom: string, newDateMillis: number, newTo: string) { -// let htmlString = originalHtml -// // Use Moment.js to format the date from milliseconds -// const formattedDate = moment(newDateMillis).format('ddd, MMM D YYYY h:mm A'); - -// // Replace the From, Date, and To fields in the HTML string -// htmlString = htmlString.replace(/

From:.*?<\/p>/, `

From: ${newFrom}

`); -// htmlString = htmlString.replace(/

Date:.*?<\/p>/, `

Date: ${formattedDate}

`); -// htmlString = htmlString.replace(/

To:.*?<\/p>/, `

To: ${newTo}

`); - -// return htmlString; -// } + ); const originalHtml = `

---------- Forwarded message ---------

From: Alex

Subject: Batteries

To: Jessica



`; +export function updateMessageDetails( + newFrom: string, + newSubject: string, + newTo: string +) { + let htmlString = originalHtml; -export function updateMessageDetails(newFrom: string, newSubject: string, newTo: string) { - let htmlString = originalHtml + htmlString = htmlString.replace( + /

From:.*?<\/p>/, + `

From: ${newFrom}

` + ); - htmlString = htmlString.replace(/

From:.*?<\/p>/, `

From: ${newFrom}

`); - htmlString = htmlString.replace(/

Subject:.*?<\/p>/, `

Subject: ${newSubject}

`); - htmlString = htmlString.replace(/

To:.*?<\/p>/, `

To: ${newTo}

`); + htmlString = htmlString.replace( + /

Subject:.*?<\/p>/, + `

Subject: ${newSubject}

` + ); - return htmlString; -} \ No newline at end of file + htmlString = htmlString.replace(/

To:.*?<\/p>/, `

To: ${newTo}

`); + + return htmlString; +} diff --git a/src/utils/indexedDB.ts b/src/utils/indexedDB.ts index 0364570..ea29e3f 100644 --- a/src/utils/indexedDB.ts +++ b/src/utils/indexedDB.ts @@ -1,90 +1,107 @@ -import { openIndexedDB } from "../components/Apps/useQortalMessageListener"; -import { fileToBase64 } from "./fileReading"; +import { openIndexedDB } from '../hooks/useQortalMessageListener'; +import { fileToBase64 } from './fileReading'; export async function handleGetFileFromIndexedDB(event) { - try { - const { fileId, requestId } = event.data; - const db = await openIndexedDB(); - const transaction = db.transaction(["files"], "readonly"); - const objectStore = transaction.objectStore("files"); - - const getRequest = objectStore.get(fileId); - - getRequest.onsuccess = async function (event) { - if (getRequest.result) { - const file = getRequest.result.data; - - try { - const base64String = await fileToBase64(file); - - // Create a new transaction to delete the file - const deleteTransaction = db.transaction(["files"], "readwrite"); - const deleteObjectStore = deleteTransaction.objectStore("files"); - const deleteRequest = deleteObjectStore.delete(fileId); - - deleteRequest.onsuccess = function () { - try { - const targetOrigin = window.location.origin; + try { + const { fileId, requestId } = event.data; + const db = await openIndexedDB(); + const transaction = db.transaction(['files'], 'readonly'); + const objectStore = transaction.objectStore('files'); - window.postMessage( - { action: "getFileFromIndexedDBResponse", requestId, result: base64String }, - targetOrigin - ); - } catch (error) { - console.log('error', error) - } - }; - - deleteRequest.onerror = function () { - console.error(`Error deleting file with ID ${fileId} from IndexedDB`); - - }; - } catch (error) { - console.error("Error converting file to Base64:", error); - event.ports[0].postMessage({ - result: null, - error: "Failed to convert file to Base64", - }); - const targetOrigin = window.location.origin; + const getRequest = objectStore.get(fileId); - window.postMessage( - { action: "getFileFromIndexedDBResponse", requestId, result: null, - error: "Failed to convert file to Base64" - }, - targetOrigin + getRequest.onsuccess = async function (event) { + if (getRequest.result) { + const file = getRequest.result.data; + + try { + const base64String = await fileToBase64(file); + + // Create a new transaction to delete the file + const deleteTransaction = db.transaction(['files'], 'readwrite'); + const deleteObjectStore = deleteTransaction.objectStore('files'); + const deleteRequest = deleteObjectStore.delete(fileId); + + deleteRequest.onsuccess = function () { + try { + const targetOrigin = window.location.origin; + + window.postMessage( + { + action: 'getFileFromIndexedDBResponse', + requestId, + result: base64String, + }, + targetOrigin + ); + } catch (error) { + console.log('error', error); + } + }; + + deleteRequest.onerror = function () { + console.error( + `Error deleting file with ID ${fileId} from IndexedDB` ); - } - } else { - console.error(`File with ID ${fileId} not found in IndexedDB`); + }; + } catch (error) { + console.error('Error converting file to Base64:', error); + event.ports[0].postMessage({ + result: null, + error: 'Failed to convert file to Base64', + }); const targetOrigin = window.location.origin; window.postMessage( - { action: "getFileFromIndexedDBResponse", requestId, result: null, - error: 'File not found in IndexedDB' - }, - targetOrigin + { + action: 'getFileFromIndexedDBResponse', + requestId, + result: null, + error: 'Failed to convert file to Base64', + }, + targetOrigin ); } - }; - - getRequest.onerror = function () { - console.error(`Error retrieving file with ID ${fileId} from IndexedDB`); - - event.source.postMessage( - { action: "getFileFromIndexedDBResponse", requestId, result: null, - error: 'Error retrieving file from IndexedDB' - }, - event.origin + } else { + console.error(`File with ID ${fileId} not found in IndexedDB`); + const targetOrigin = window.location.origin; + + window.postMessage( + { + action: 'getFileFromIndexedDBResponse', + requestId, + result: null, + error: 'File not found in IndexedDB', + }, + targetOrigin ); - }; - } catch (error) { - const { requestId } = event.data; - console.error("Error opening IndexedDB:", error); + } + }; + + getRequest.onerror = function () { + console.error(`Error retrieving file with ID ${fileId} from IndexedDB`); + event.source.postMessage( - { action: "getFileFromIndexedDBResponse", requestId, result: null, - error: 'Error opening IndexedDB' - }, + { + action: 'getFileFromIndexedDBResponse', + requestId, + result: null, + error: 'Error retrieving file from IndexedDB', + }, event.origin ); - } - } \ No newline at end of file + }; + } catch (error) { + const { requestId } = event.data; + console.error('Error opening IndexedDB:', error); + event.source.postMessage( + { + action: 'getFileFromIndexedDBResponse', + requestId, + result: null, + error: 'Error opening IndexedDB', + }, + event.origin + ); + } +} diff --git a/src/utils/memeTypes.ts b/src/utils/memeTypes.ts index 2bd8ac0..f87277f 100644 --- a/src/utils/memeTypes.ts +++ b/src/utils/memeTypes.ts @@ -1,123 +1,125 @@ export const mimeToExtensionMap = { - // Documents - "application/pdf": ".pdf", - "application/msword": ".doc", - "application/vnd.openxmlformats-officedocument.wordprocessingml.document": ".docx", - "application/vnd.ms-excel": ".xls", - "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": ".xlsx", - "application/vnd.ms-powerpoint": ".ppt", - "application/vnd.openxmlformats-officedocument.presentationml.presentation": ".pptx", - "application/vnd.oasis.opendocument.text": ".odt", - "application/vnd.oasis.opendocument.spreadsheet": ".ods", - "application/vnd.oasis.opendocument.presentation": ".odp", - "text/plain": ".txt", - "text/csv": ".csv", - "application/xhtml+xml": ".xhtml", - "application/xml": ".xml", - "application/rtf": ".rtf", - "application/vnd.apple.pages": ".pages", - "application/vnd.google-apps.document": ".gdoc", - "application/vnd.google-apps.spreadsheet": ".gsheet", - "application/vnd.google-apps.presentation": ".gslides", + // Documents + 'application/pdf': '.pdf', + 'application/msword': '.doc', + 'application/vnd.openxmlformats-officedocument.wordprocessingml.document': + '.docx', + 'application/vnd.ms-excel': '.xls', + 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': '.xlsx', + 'application/vnd.ms-powerpoint': '.ppt', + 'application/vnd.openxmlformats-officedocument.presentationml.presentation': + '.pptx', + 'application/vnd.oasis.opendocument.text': '.odt', + 'application/vnd.oasis.opendocument.spreadsheet': '.ods', + 'application/vnd.oasis.opendocument.presentation': '.odp', + 'text/plain': '.txt', + 'text/csv': '.csv', + 'application/xhtml+xml': '.xhtml', + 'application/xml': '.xml', + 'application/rtf': '.rtf', + 'application/vnd.apple.pages': '.pages', + 'application/vnd.google-apps.document': '.gdoc', + 'application/vnd.google-apps.spreadsheet': '.gsheet', + 'application/vnd.google-apps.presentation': '.gslides', - // Images - "image/jpeg": ".jpg", - "image/png": ".png", - "image/gif": ".gif", - "image/webp": ".webp", - "image/svg+xml": ".svg", - "image/tiff": ".tif", - "image/bmp": ".bmp", - "image/x-icon": ".ico", - "image/heic": ".heic", - "image/heif": ".heif", - "image/apng": ".apng", - "image/avif": ".avif", + // Images + 'image/jpeg': '.jpg', + 'image/png': '.png', + 'image/gif': '.gif', + 'image/webp': '.webp', + 'image/svg+xml': '.svg', + 'image/tiff': '.tif', + 'image/bmp': '.bmp', + 'image/x-icon': '.ico', + 'image/heic': '.heic', + 'image/heif': '.heif', + 'image/apng': '.apng', + 'image/avif': '.avif', - // Audio - "audio/mpeg": ".mp3", - "audio/ogg": ".ogg", - "audio/wav": ".wav", - "audio/webm": ".weba", - "audio/aac": ".aac", - "audio/flac": ".flac", - "audio/x-m4a": ".m4a", - "audio/x-ms-wma": ".wma", - "audio/midi": ".midi", - "audio/x-midi": ".mid", + // Audio + 'audio/mpeg': '.mp3', + 'audio/ogg': '.ogg', + 'audio/wav': '.wav', + 'audio/webm': '.weba', + 'audio/aac': '.aac', + 'audio/flac': '.flac', + 'audio/x-m4a': '.m4a', + 'audio/x-ms-wma': '.wma', + 'audio/midi': '.midi', + 'audio/x-midi': '.mid', - // Video - "video/mp4": ".mp4", - "video/webm": ".webm", - "video/ogg": ".ogv", - "video/x-msvideo": ".avi", - "video/quicktime": ".mov", - "video/x-ms-wmv": ".wmv", - "video/mpeg": ".mpeg", - "video/3gpp": ".3gp", - "video/3gpp2": ".3g2", - "video/x-matroska": ".mkv", - "video/x-flv": ".flv", - "video/x-ms-asf": ".asf", + // Video + 'video/mp4': '.mp4', + 'video/webm': '.webm', + 'video/ogg': '.ogv', + 'video/x-msvideo': '.avi', + 'video/quicktime': '.mov', + 'video/x-ms-wmv': '.wmv', + 'video/mpeg': '.mpeg', + 'video/3gpp': '.3gp', + 'video/3gpp2': '.3g2', + 'video/x-matroska': '.mkv', + 'video/x-flv': '.flv', + 'video/x-ms-asf': '.asf', - // Archives - "application/zip": ".zip", - "application/x-rar-compressed": ".rar", - "application/x-tar": ".tar", - "application/x-7z-compressed": ".7z", - "application/x-gzip": ".gz", - "application/x-bzip2": ".bz2", - "application/x-apple-diskimage": ".dmg", - "application/vnd.android.package-archive": ".apk", - "application/x-iso9660-image": ".iso", + // Archives + 'application/zip': '.zip', + 'application/x-rar-compressed': '.rar', + 'application/x-tar': '.tar', + 'application/x-7z-compressed': '.7z', + 'application/x-gzip': '.gz', + 'application/x-bzip2': '.bz2', + 'application/x-apple-diskimage': '.dmg', + 'application/vnd.android.package-archive': '.apk', + 'application/x-iso9660-image': '.iso', - // Code Files - "text/javascript": ".js", - "text/css": ".css", - "text/html": ".html", - "application/json": ".json", - "text/xml": ".xml", - "application/x-sh": ".sh", - "application/x-csh": ".csh", - "text/x-python": ".py", - "text/x-java-source": ".java", - "application/java-archive": ".jar", - "application/vnd.microsoft.portable-executable": ".exe", - "application/x-msdownload": ".msi", - "text/x-c": ".c", - "text/x-c++": ".cpp", - "text/x-go": ".go", - "application/x-perl": ".pl", - "text/x-php": ".php", - "text/x-ruby": ".rb", - "text/x-sql": ".sql", - "application/x-httpd-php": ".php", - "application/x-python-code": ".pyc", + // Code Files + 'text/javascript': '.js', + 'text/css': '.css', + 'text/html': '.html', + 'application/json': '.json', + 'text/xml': '.xml', + 'application/x-sh': '.sh', + 'application/x-csh': '.csh', + 'text/x-python': '.py', + 'text/x-java-source': '.java', + 'application/java-archive': '.jar', + 'application/vnd.microsoft.portable-executable': '.exe', + 'application/x-msdownload': '.msi', + 'text/x-c': '.c', + 'text/x-c++': '.cpp', + 'text/x-go': '.go', + 'application/x-perl': '.pl', + 'text/x-php': '.php', + 'text/x-ruby': '.rb', + 'text/x-sql': '.sql', + 'application/x-httpd-php': '.php', + 'application/x-python-code': '.pyc', - // ROM Files - "application/x-nintendo-nes-rom": ".nes", - "application/x-snes-rom": ".smc", - "application/x-gameboy-rom": ".gb", - "application/x-gameboy-advance-rom": ".gba", - "application/x-n64-rom": ".n64", - "application/x-sega-genesis-rom": ".gen", - "application/x-sega-master-system-rom": ".sms", - "application/x-psx-rom": ".iso", // PlayStation ROMs - "application/x-bios-rom": ".rom", - "application/x-flash-rom": ".bin", - "application/x-eeprom": ".eep", - "application/x-c64-rom": ".prg", + // ROM Files + 'application/x-nintendo-nes-rom': '.nes', + 'application/x-snes-rom': '.smc', + 'application/x-gameboy-rom': '.gb', + 'application/x-gameboy-advance-rom': '.gba', + 'application/x-n64-rom': '.n64', + 'application/x-sega-genesis-rom': '.gen', + 'application/x-sega-master-system-rom': '.sms', + 'application/x-psx-rom': '.iso', // PlayStation ROMs + 'application/x-bios-rom': '.rom', + 'application/x-flash-rom': '.bin', + 'application/x-eeprom': '.eep', + 'application/x-c64-rom': '.prg', - // Miscellaneous - "application/octet-stream": ".bin", // General binary files - "application/x-shockwave-flash": ".swf", - "application/x-silverlight-app": ".xap", - "application/x-ms-shortcut": ".lnk", - "application/vnd.ms-fontobject": ".eot", - "font/woff": ".woff", - "font/woff2": ".woff2", - "font/ttf": ".ttf", - "font/otf": ".otf", - "application/vnd.visio": ".vsd", - "application/vnd.ms-project": ".mpp", + // Miscellaneous + 'application/octet-stream': '.bin', // General binary files + 'application/x-shockwave-flash': '.swf', + 'application/x-silverlight-app': '.xap', + 'application/x-ms-shortcut': '.lnk', + 'application/vnd.ms-fontobject': '.eot', + 'font/woff': '.woff', + 'font/woff2': '.woff2', + 'font/ttf': '.ttf', + 'font/otf': '.otf', + 'application/vnd.visio': '.vsd', + 'application/vnd.ms-project': '.mpp', }; diff --git a/src/utils/mobile/mobileUtils.ts b/src/utils/mobile/mobileUtils.ts deleted file mode 100644 index 144c8c1..0000000 --- a/src/utils/mobile/mobileUtils.ts +++ /dev/null @@ -1,5 +0,0 @@ - -export const getRootHeight = ()=> { - - return document?.getElementById('root')?.style?.height || '100%' -} \ No newline at end of file diff --git a/src/utils/qortalLink/index.ts b/src/utils/qortalLink/index.ts index bc2f132..0b884d6 100644 --- a/src/utils/qortalLink/index.ts +++ b/src/utils/qortalLink/index.ts @@ -1,12 +1,12 @@ export function convertQortalLinks(inputHtml: string) { - // Regular expression to match 'qortal://...' URLs. - // This will stop at the first whitespace, comma, or HTML tag - var regex = /(qortal:\/\/[^\s,<]+)/g; + // Regular expression to match 'qortal://...' URLs. + // This will stop at the first whitespace, comma, or HTML tag + var regex = /(qortal:\/\/[^\s,<]+)/g; - // Replace matches in inputHtml with formatted anchor tag - var outputHtml = inputHtml.replace(regex, function (match) { - return `${match}`; - }); + // Replace matches in inputHtml with formatted anchor tag + var outputHtml = inputHtml.replace(regex, function (match) { + return `${match}`; + }); - return outputHtml; -} \ No newline at end of file + return outputHtml; +} diff --git a/src/utils/queue/queue.ts b/src/utils/queue/queue.ts index fcbd544..c3c1c2f 100644 --- a/src/utils/queue/queue.ts +++ b/src/utils/queue/queue.ts @@ -1,56 +1,58 @@ export class RequestQueueWithPromise { - constructor(maxConcurrent = 5) { - this.queue = []; - this.maxConcurrent = maxConcurrent; - this.currentlyProcessing = 0; - this.isPaused = false; // Flag to track whether the queue is paused - } - - // Add a request to the queue and return a promise - enqueue(request) { - return new Promise((resolve, reject) => { - // Push the request and its resolve and reject callbacks to the queue - this.queue.push({ request, resolve, reject }); - this.process(); - }); - } - - // Process requests in the queue - async process() { - // Process requests only if the queue is not paused - if (this.isPaused) return; - - while (this.queue.length > 0 && this.currentlyProcessing < this.maxConcurrent) { - this.currentlyProcessing++; - - const { request, resolve, reject } = this.queue.shift(); - - try { - const response = await request(); - resolve(response); - } catch (error) { - reject(error); - } finally { - this.currentlyProcessing--; - await this.process(); - } - } - } - - // Pause the queue processing - pause() { - this.isPaused = true; - } - - // Resume the queue processing - resume() { - this.isPaused = false; - this.process(); // Continue processing when resumed - } - - // Clear pending requests in the queue - clear() { - this.queue.length = 0; - } + constructor(maxConcurrent = 5) { + this.queue = []; + this.maxConcurrent = maxConcurrent; + this.currentlyProcessing = 0; + this.isPaused = false; // Flag to track whether the queue is paused } - \ No newline at end of file + + // Add a request to the queue and return a promise + enqueue(request) { + return new Promise((resolve, reject) => { + // Push the request and its resolve and reject callbacks to the queue + this.queue.push({ request, resolve, reject }); + this.process(); + }); + } + + // Process requests in the queue + async process() { + // Process requests only if the queue is not paused + if (this.isPaused) return; + + while ( + this.queue.length > 0 && + this.currentlyProcessing < this.maxConcurrent + ) { + this.currentlyProcessing++; + + const { request, resolve, reject } = this.queue.shift(); + + try { + const response = await request(); + resolve(response); + } catch (error) { + reject(error); + } finally { + this.currentlyProcessing--; + await this.process(); + } + } + } + + // Pause the queue processing + pause() { + this.isPaused = true; + } + + // Resume the queue processing + resume() { + this.isPaused = false; + this.process(); // Continue processing when resumed + } + + // Clear pending requests in the queue + clear() { + this.queue.length = 0; + } +} diff --git a/src/utils/seedPhrase/RandomSentenceGenerator.ts b/src/utils/seedPhrase/RandomSentenceGenerator.ts deleted file mode 100644 index 8fdf71d..0000000 --- a/src/utils/seedPhrase/RandomSentenceGenerator.ts +++ /dev/null @@ -1,173 +0,0 @@ -// Author: irontiga - -import { html, LitElement, css } from 'lit' -import * as WORDLISTS from './wordList' - -class RandomSentenceGenerator extends LitElement { - static get properties() { - return { - template: { type: String, attribute: 'template' }, - parsedString: { type: String }, - fetchedWordlistCount: { type: Number, value: 0 }, - capitalize: { type: Boolean }, - partsOfSpeechMap: { type: Object }, - templateEntropy: { type: Number, reflect: true, attribute: 'template-entropy' }, - maxWordLength: { type: Number, attribute: 'max-word-length' } - } - } - - constructor() { - super() - this.template = 'adjective noun verb adverb.' - this.maxWordLength = 0 - this.parsedString = '' - this.fetchedWordlistCount = 0 - this.capitalize = true - this.partsOfSpeechMap = { - 'noun': 'nouns', - 'adverb': 'adverbs', - 'adv': 'adverbs', - 'verb': 'verbs', - 'interjection': 'interjections', - 'adjective': 'adjectives', - 'adj': 'adjectives', - 'verbed': 'verbed' - } - this.partsOfSpeech = Object.keys(this.partsOfSpeechMap) - this._wordlists = WORDLISTS - } - - static styles = css` - div { - text-align: center; - width: 100%; - background-color: #1f2023; - border-radius: 5px; - padding: 10px; - } - `; - - render() { - return html` -
${this.parsedString}
- ` - } - - - - firstUpdated() { - // ... - } - - updated(changedProperties) { - let regen = false - - if (changedProperties.has('template')) { - regen = true - } - - if (changedProperties.has('maxWordLength')) { - console.dir(this.maxWordLength) - - if (this.maxWordLength) { - const wl = { ...this._wordlists } - - for (const partOfSpeech in this._wordlists) { - if (Array.isArray(this._wordlists[partOfSpeech])) { - wl[partOfSpeech] = this._wordlists[partOfSpeech].filter(word => word.length <= this.maxWordLength) - } - } - - this._wordlists = wl - } - - regen = true - } - - if (regen) this.generate() - } - - _RNG(entropy) { - if (entropy > 1074) { - throw new Error('Javascript can not handle that much entropy!') - } - - let randNum = 0 - - const crypto = window.crypto || window.msCrypto - - if (crypto) { - const entropy256 = Math.ceil(entropy / 8) - - let buffer = new Uint8Array(entropy256) - - crypto.getRandomValues(buffer) - - randNum = buffer.reduce((num, value) => { - return num * value - }, 1) / Math.pow(256, entropy256) - } else { - console.warn('Secure RNG not found. Using Math.random') - - randNum = Math.random() - } - - return randNum - } - - setRNG(fn) { - this._RNG = fn - } - - _captitalize(str) { - return str.charAt(0).toUpperCase() + str.slice(1) - } - - getWord(partOfSpeech) { - const words = this._wordlists[this.partsOfSpeechMap[partOfSpeech]] - const requiredEntropy = Math.log(words.length) / Math.log(2) - const index = this._RNG(requiredEntropy) * words.length - - return { - word: words[Math.round(index)], - entropy: words.length - } - } - - generate() { - this.parsedString = this.parse(this.template) - } - - parse(template) { - const split = template.split(/[\s]/g) - - let entropy = 1 - - const final = split.map(word => { - const lower = word.toLowerCase() - - this.partsOfSpeech.some(partOfSpeech => { - const partOfSpeechIndex = lower.indexOf(partOfSpeech) // Check it exists - const nextChar = word.charAt(partOfSpeech.length) - - if (partOfSpeechIndex === 0 && !(nextChar && (nextChar.match(/[a-zA-Z]/g) != null))) { - const replacement = this.getWord(partOfSpeech) - word = replacement.word + word.slice(partOfSpeech.length) // Append the rest of the "word" (punctuation) - entropy = entropy * replacement.entropy - - return true - } - }) - - return word - }) - - this.templateEntropy = Math.floor(Math.log(entropy) / Math.log(8)) - - return final.join(' ') - } -} - -window.customElements.define('random-sentence-generator', RandomSentenceGenerator) - -export default RandomSentenceGenerator \ No newline at end of file diff --git a/src/utils/seedPhrase/randomSentenceGenerator.ts b/src/utils/seedPhrase/randomSentenceGenerator.ts new file mode 100644 index 0000000..86ba436 --- /dev/null +++ b/src/utils/seedPhrase/randomSentenceGenerator.ts @@ -0,0 +1,182 @@ +// Author: irontiga + +import { html, LitElement, css } from 'lit'; +import * as WORDLISTS from './wordList'; + +class RandomSentenceGenerator extends LitElement { + static get properties() { + return { + template: { type: String, attribute: 'template' }, + parsedString: { type: String }, + fetchedWordlistCount: { type: Number, value: 0 }, + capitalize: { type: Boolean }, + partsOfSpeechMap: { type: Object }, + templateEntropy: { + type: Number, + reflect: true, + attribute: 'template-entropy', + }, + maxWordLength: { type: Number, attribute: 'max-word-length' }, + }; + } + + constructor() { + super(); + this.template = 'adjective noun verb adverb.'; + this.maxWordLength = 0; + this.parsedString = ''; + this.fetchedWordlistCount = 0; + this.capitalize = true; + this.partsOfSpeechMap = { + noun: 'nouns', + adverb: 'adverbs', + adv: 'adverbs', + verb: 'verbs', + interjection: 'interjections', + adjective: 'adjectives', + adj: 'adjectives', + verbed: 'verbed', + }; + this.partsOfSpeech = Object.keys(this.partsOfSpeechMap); + this._wordlists = WORDLISTS; + } + + static styles = css` + div { + text-align: center; + width: 100%; + background-color: #1f2023; + border-radius: 5px; + padding: 10px; + } + `; + + render() { + return html`
${this.parsedString}
`; + } + + firstUpdated() { + // ... + } + + updated(changedProperties) { + let regen = false; + + if (changedProperties.has('template')) { + regen = true; + } + + if (changedProperties.has('maxWordLength')) { + console.dir(this.maxWordLength); + + if (this.maxWordLength) { + const wl = { ...this._wordlists }; + + for (const partOfSpeech in this._wordlists) { + if (Array.isArray(this._wordlists[partOfSpeech])) { + wl[partOfSpeech] = this._wordlists[partOfSpeech].filter( + (word) => word.length <= this.maxWordLength + ); + } + } + + this._wordlists = wl; + } + + regen = true; + } + + if (regen) this.generate(); + } + + _RNG(entropy) { + if (entropy > 1074) { + throw new Error('Javascript can not handle that much entropy!'); + } + + let randNum = 0; + + const crypto = window.crypto || window.msCrypto; + + if (crypto) { + const entropy256 = Math.ceil(entropy / 8); + + let buffer = new Uint8Array(entropy256); + + crypto.getRandomValues(buffer); + + randNum = + buffer.reduce((num, value) => { + return num * value; + }, 1) / Math.pow(256, entropy256); + } else { + console.warn('Secure RNG not found. Using Math.random'); + + randNum = Math.random(); + } + + return randNum; + } + + setRNG(fn) { + this._RNG = fn; + } + + _captitalize(str) { + return str.charAt(0).toUpperCase() + str.slice(1); + } + + getWord(partOfSpeech) { + const words = this._wordlists[this.partsOfSpeechMap[partOfSpeech]]; + const requiredEntropy = Math.log(words.length) / Math.log(2); + const index = this._RNG(requiredEntropy) * words.length; + + return { + word: words[Math.round(index)], + entropy: words.length, + }; + } + + generate() { + this.parsedString = this.parse(this.template); + } + + parse(template) { + const split = template.split(/[\s]/g); + + let entropy = 1; + + const final = split.map((word) => { + const lower = word.toLowerCase(); + + this.partsOfSpeech.some((partOfSpeech) => { + const partOfSpeechIndex = lower.indexOf(partOfSpeech); // Check it exists + const nextChar = word.charAt(partOfSpeech.length); + + if ( + partOfSpeechIndex === 0 && + !(nextChar && nextChar.match(/[a-zA-Z]/g) != null) + ) { + const replacement = this.getWord(partOfSpeech); + word = replacement.word + word.slice(partOfSpeech.length); // Append the rest of the "word" (punctuation) + entropy = entropy * replacement.entropy; + + return true; + } + }); + + return word; + }); + + this.templateEntropy = Math.floor(Math.log(entropy) / Math.log(8)); + + return final.join(' '); + } +} + +window.customElements.define( + 'random-sentence-generator', + RandomSentenceGenerator +); + +export default RandomSentenceGenerator; diff --git a/src/utils/seedPhrase/verb-past-tense.ts b/src/utils/seedPhrase/verb-past-tense.ts index c5b279f..5b55086 100644 --- a/src/utils/seedPhrase/verb-past-tense.ts +++ b/src/utils/seedPhrase/verb-past-tense.ts @@ -1,40 +1,40 @@ export const EXCEPTIONS = { - 'are': 'were', - 'eat': 'ate', - 'go': 'went', - 'have': 'had', - 'inherit': 'inherited', - 'is': 'was', - 'run': 'ran', - 'sit': 'sat', - 'visit': 'visited' -} + are: 'were', + eat: 'ate', + go: 'went', + have: 'had', + inherit: 'inherited', + is: 'was', + run: 'ran', + sit: 'sat', + visit: 'visited', +}; export const getPastTense = (verb, exceptions = EXCEPTIONS) => { - if (exceptions[verb]) { - return exceptions[verb] - } + if (exceptions[verb]) { + return exceptions[verb]; + } - if ((/e$/i).test(verb)) { - return verb + 'd' - } + if (/e$/i.test(verb)) { + return verb + 'd'; + } - if ((/[aeiou]c$/i).test(verb)) { - return verb + 'ked' - } + if (/[aeiou]c$/i.test(verb)) { + return verb + 'ked'; + } - // for american english only - if ((/el$/i).test(verb)) { - return verb + 'ed' - } + // for american english only + if (/el$/i.test(verb)) { + return verb + 'ed'; + } - if ((/[aeio][aeiou][dlmnprst]$/).test(verb)) { - return verb + 'ed' - } + if (/[aeio][aeiou][dlmnprst]$/.test(verb)) { + return verb + 'ed'; + } - if ((/[aeiou][bdglmnprst]$/i).test(verb)) { - return verb.replace(/(.+[aeiou])([bdglmnprst])/, '$1$2$2ed') - } + if (/[aeiou][bdglmnprst]$/i.test(verb)) { + return verb.replace(/(.+[aeiou])([bdglmnprst])/, '$1$2$2ed'); + } - return verb + 'ed' -} \ No newline at end of file + return verb + 'ed'; +}; diff --git a/src/utils/Size/index.ts b/src/utils/size/index.ts similarity index 100% rename from src/utils/Size/index.ts rename to src/utils/size/index.ts diff --git a/src/utils/time.ts b/src/utils/time.ts index c89c1cd..d8d1ef4 100644 --- a/src/utils/time.ts +++ b/src/utils/time.ts @@ -1,56 +1,57 @@ -import moment from "moment" +import moment from 'moment'; export function formatTimestamp(timestamp: number): string { - const now = moment() - const timestampMoment = moment(timestamp) - const elapsedTime = now.diff(timestampMoment, 'minutes') - - if (elapsedTime < 1) { - return 'Just now' - } else if (elapsedTime < 60) { - return `${elapsedTime}m ago` - } else if (elapsedTime < 1440) { - return `${Math.floor(elapsedTime / 60)}h ago` - } else { - return timestampMoment.format('MMM D, YYYY') - } + const now = moment(); + const timestampMoment = moment(timestamp); + const elapsedTime = now.diff(timestampMoment, 'minutes'); + + if (elapsedTime < 1) { + return 'Just now'; + } else if (elapsedTime < 60) { + return `${elapsedTime}m ago`; + } else if (elapsedTime < 1440) { + return `${Math.floor(elapsedTime / 60)}h ago`; + } else { + return timestampMoment.format('MMM D, YYYY'); } - export function formatTimestampForum(timestamp: number): string { - const now = moment(); - const timestampMoment = moment(timestamp); - const elapsedTime = now.diff(timestampMoment, 'minutes'); - - if (elapsedTime < 1) { - return `Just now - ${timestampMoment.format('h:mm A')}`; - } else if (elapsedTime < 60) { - return `${elapsedTime}m ago - ${timestampMoment.format('h:mm A')}`; - } else if (elapsedTime < 1440) { - return `${Math.floor(elapsedTime / 60)}h ago - ${timestampMoment.format('h:mm A')}`; - } else { - return timestampMoment.format('MMM D, YYYY - h:mm A'); - } } - export const formatDate = (unixTimestamp: number): string => { - const date = moment(unixTimestamp, 'x').fromNow() - - return date - } +export function formatTimestampForum(timestamp: number): string { + const now = moment(); + const timestampMoment = moment(timestamp); + const elapsedTime = now.diff(timestampMoment, 'minutes'); - export function sortArrayByTimestampAndGroupName(array) { - return array.sort((a, b) => { - if (a.timestamp && b.timestamp) { - // Both have timestamp, sort by timestamp descending - return b.timestamp - a.timestamp; - } else if (a.timestamp) { - // Only `a` has timestamp, it comes first - return -1; - } else if (b.timestamp) { - // Only `b` has timestamp, it comes first - return 1; - } else { - // Neither has timestamp, sort alphabetically by groupName - return a.groupName.localeCompare(b.groupName); - } - }); - } \ No newline at end of file + if (elapsedTime < 1) { + return `Just now - ${timestampMoment.format('h:mm A')}`; + } else if (elapsedTime < 60) { + return `${elapsedTime}m ago - ${timestampMoment.format('h:mm A')}`; + } else if (elapsedTime < 1440) { + return `${Math.floor(elapsedTime / 60)}h ago - ${timestampMoment.format('h:mm A')}`; + } else { + return timestampMoment.format('MMM D, YYYY - h:mm A'); + } +} + +export const formatDate = (unixTimestamp: number): string => { + const date = moment(unixTimestamp, 'x').fromNow(); + + return date; +}; + +export function sortArrayByTimestampAndGroupName(array) { + return array.sort((a, b) => { + if (a.timestamp && b.timestamp) { + // Both have timestamp, sort by timestamp descending + return b.timestamp - a.timestamp; + } else if (a.timestamp) { + return -1; + } else if (b.timestamp) { + return 1; + } else { + // Neither has timestamp, sort alphabetically by groupName (with fallback) + const nameA = a.groupName || ''; + const nameB = b.groupName || ''; + return nameA.localeCompare(nameB); + } + }); +} diff --git a/src/utils/utils.ts b/src/utils/utils.ts index 49912ae..a981fe0 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -1,55 +1,55 @@ // @ts-nocheck const utils = { - int32ToBytes (word) { - var byteArray = [] - for (var b = 0; b < 32; b += 8) { - byteArray.push((word >>> (24 - b % 32)) & 0xFF) - } - return byteArray - }, - - stringtoUTF8Array (message) { - if (typeof message === 'string') { - var s = unescape(encodeURIComponent(message)) // UTF-8 - message = new Uint8Array(s.length) - for (var i = 0; i < s.length; i++) { - message[i] = s.charCodeAt(i) & 0xff - } - } - return message - }, - // ...buffers then buffers.foreach and append to buffer1 - appendBuffer (buffer1, buffer2) { - buffer1 = new Uint8Array(buffer1) - buffer2 = new Uint8Array(buffer2) - const tmp = new Uint8Array(buffer1.byteLength + buffer2.byteLength) - tmp.set(buffer1, 0) - tmp.set(buffer2, buffer1.byteLength) - return tmp - }, - - int64ToBytes (int64) { - // we want to represent the input as a 8-bytes array - var byteArray = [0, 0, 0, 0, 0, 0, 0, 0] - - for (var index = 0; index < byteArray.length; index++) { - var byte = int64 & 0xff - byteArray[byteArray.length - index - 1] = byte - int64 = (int64 - byte) / 256 - } - - return byteArray - }, - - equal (buf1, buf2) { - if (buf1.byteLength != buf2.byteLength) return false - var dv1 = new Uint8Array(buf1) - var dv2 = new Uint8Array(buf2) - for (var i = 0; i != buf1.byteLength; i++) { - if (dv1[i] != dv2[i]) return false - } - return true + int32ToBytes(word) { + var byteArray = []; + for (var b = 0; b < 32; b += 8) { + byteArray.push((word >>> (24 - (b % 32))) & 0xff); } -} + return byteArray; + }, -export default utils + stringtoUTF8Array(message) { + if (typeof message === 'string') { + var s = unescape(encodeURIComponent(message)); // UTF-8 + message = new Uint8Array(s.length); + for (var i = 0; i < s.length; i++) { + message[i] = s.charCodeAt(i) & 0xff; + } + } + return message; + }, + // ...buffers then buffers.foreach and append to buffer1 + appendBuffer(buffer1, buffer2) { + buffer1 = new Uint8Array(buffer1); + buffer2 = new Uint8Array(buffer2); + const tmp = new Uint8Array(buffer1.byteLength + buffer2.byteLength); + tmp.set(buffer1, 0); + tmp.set(buffer2, buffer1.byteLength); + return tmp; + }, + + int64ToBytes(int64) { + // we want to represent the input as a 8-bytes array + var byteArray = [0, 0, 0, 0, 0, 0, 0, 0]; + + for (var index = 0; index < byteArray.length; index++) { + var byte = int64 & 0xff; + byteArray[byteArray.length - index - 1] = byte; + int64 = (int64 - byte) / 256; + } + + return byteArray; + }, + + equal(buf1, buf2) { + if (buf1.byteLength != buf2.byteLength) return false; + var dv1 = new Uint8Array(buf1); + var dv2 = new Uint8Array(buf2); + for (var i = 0; i != buf1.byteLength; i++) { + if (dv1[i] != dv2[i]) return false; + } + return true; + }, +}; + +export default utils; diff --git a/src/utils/validateAddress.ts b/src/utils/validateAddress.ts index 8b359bf..aa01af1 100644 --- a/src/utils/validateAddress.ts +++ b/src/utils/validateAddress.ts @@ -1,21 +1,21 @@ // @ts-nocheck -import Base58 from "../deps/Base58" +import Base58 from '../encryption/Base58'; export const validateAddress = (address) => { - let isAddress = false - try { - const decodePubKey = Base58.decode(address) + let isAddress = false; - if (!(decodePubKey instanceof Uint8Array && decodePubKey.length == 25)) { - isAddress = false - } else { - isAddress = true - } - - } catch (error) { - - } + try { + const decodePubKey = Base58.decode(address); - return isAddress -} + if (!(decodePubKey instanceof Uint8Array && decodePubKey.length == 25)) { + isAddress = false; + } else { + isAddress = true; + } + } catch (error) { + console.log(error); + } + + return isAddress; +}; diff --git a/tsconfig.json b/tsconfig.json index e49f745..95bc40f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,15 +4,17 @@ "useDefineForClassFields": true, "lib": ["ES2020", "DOM", "DOM.Iterable"], "module": "ESNext", + "noImplicitAny": false, "skipLibCheck": true, /* Bundler mode */ - "moduleResolution": "bundler", + "moduleResolution": "node", "allowImportingTsExtensions": true, "resolveJsonModule": true, "isolatedModules": true, "noEmit": true, "jsx": "react-jsx", + "allowSyntheticDefaultImports": true, /* Linting */ "strict": true, diff --git a/vite.config.ts b/vite.config.ts index e515bea..d902a5e 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,51 +1,55 @@ /// -import { defineConfig } from 'vite'; -import react from '@vitejs/plugin-react'; +import { defineConfig } from "vite"; +import react from "@vitejs/plugin-react"; // Import path module for resolving file paths -import fixReactVirtualized from 'esbuild-plugin-react-virtualized' -import wasm from 'vite-plugin-wasm'; -import topLevelAwait from 'vite-plugin-top-level-await'; -import { VitePWA } from 'vite-plugin-pwa'; +import fixReactVirtualized from "esbuild-plugin-react-virtualized"; +import wasm from "vite-plugin-wasm"; +import topLevelAwait from "vite-plugin-top-level-await"; +import { VitePWA } from "vite-plugin-pwa"; export default defineConfig({ - test: { - environment: 'jsdom', + environment: "jsdom", globals: true, - setupFiles: ['./src/test/setup.ts'] + setupFiles: ["./src/test/setup.ts"], }, - assetsInclude: ['**/*.wasm'], - plugins: [react(), wasm(), topLevelAwait(), VitePWA({ - registerType: 'prompt', - manifest: { - name: 'Qortal Hub', - short_name: 'Hub', - description: 'Your easy access to the Qortal blockchain', - start_url: '/', - display: 'standalone', - theme_color: '#ffffff', - background_color: '#ffffff', - icons: [ - { - src: '/qortal192.png', - sizes: '192x192', - type: 'image/png', - }, - { - src: '/qortal.png', - sizes: '512x512', - type: 'image/png', - }, - ], - }, - workbox: { - maximumFileSizeToCacheInBytes: 5 * 1024 * 1024, // 5MB limit - disableDevLogs: true, // Suppresses logs in development - }, - })], + assetsInclude: ["**/*.wasm"], + plugins: [ + react(), + wasm(), + topLevelAwait(), + VitePWA({ + registerType: "prompt", + manifest: { + name: "Qortal Hub", + short_name: "Hub", + description: "Your easy access to the Qortal blockchain", + start_url: "/", + display: "standalone", + theme_color: "#ffffff", + background_color: "#ffffff", + icons: [ + { + src: "/qortal192.png", + sizes: "192x192", + type: "image/png", + }, + { + src: "/qortal.png", + sizes: "512x512", + type: "image/png", + }, + ], + }, + workbox: { + maximumFileSizeToCacheInBytes: 5 * 1024 * 1024, // 5MB limit + disableDevLogs: true, // Suppresses logs in development + }, + }), + ], optimizeDeps: { esbuildOptions: { plugins: [fixReactVirtualized], - } - } + }, + }, });